Class: Telnyx::Resources::Faxes
- Inherits:
-
Object
- Object
- Telnyx::Resources::Faxes
- Defined in:
- lib/telnyx/resources/faxes.rb,
lib/telnyx/resources/faxes/actions.rb
Overview
Programmable fax command operations
Defined Under Namespace
Classes: Actions
Instance Attribute Summary collapse
-
#actions ⇒ Telnyx::Resources::Faxes::Actions
readonly
Programmable fax command operations.
Instance Method Summary collapse
-
#create(connection_id:, from:, to:, black_threshold: nil, client_state: nil, from_display_name: nil, media_name: nil, media_url: nil, monochrome: nil, preview_format: nil, quality: nil, store_media: nil, store_preview: nil, t38_enabled: nil, webhook_url: nil, request_options: {}) ⇒ Telnyx::Models::FaxCreateResponse
Some parameter documentations has been truncated, see Models::FaxCreateParams for more details.
-
#delete(id, request_options: {}) ⇒ nil
Delete a fax.
-
#initialize(client:) ⇒ Faxes
constructor
private
A new instance of Faxes.
-
#list(filter: nil, page_number: nil, page_size: nil, request_options: {}) ⇒ Telnyx::Internal::DefaultFlatPagination<Telnyx::Models::Fax>
Some parameter documentations has been truncated, see Models::FaxListParams for more details.
-
#retrieve(id, request_options: {}) ⇒ Telnyx::Models::FaxRetrieveResponse
View a fax.
Constructor Details
#initialize(client:) ⇒ Faxes
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of Faxes.
148 149 150 151 |
# File 'lib/telnyx/resources/faxes.rb', line 148 def initialize(client:) @client = client @actions = Telnyx::Resources::Faxes::Actions.new(client: client) end |
Instance Attribute Details
#actions ⇒ Telnyx::Resources::Faxes::Actions (readonly)
Programmable fax command operations
9 10 11 |
# File 'lib/telnyx/resources/faxes.rb', line 9 def actions @actions end |
Instance Method Details
#create(connection_id:, from:, to:, black_threshold: nil, client_state: nil, from_display_name: nil, media_name: nil, media_url: nil, monochrome: nil, preview_format: nil, quality: nil, store_media: nil, store_preview: nil, t38_enabled: nil, webhook_url: nil, request_options: {}) ⇒ Telnyx::Models::FaxCreateResponse
Some parameter documentations has been truncated, see Models::FaxCreateParams for more details.
Send a fax. Files have size limits and page count limit validations. If a file is bigger than 50MB or has more than 350 pages it will fail with ‘file_size_limit_exceeded` and `page_count_limit_exceeded` respectively.
**Expected Webhooks:**
-
‘fax.queued`
-
‘fax.media.processed`
-
‘fax.sending.started`
-
‘fax.delivered`
-
‘fax.failed`
63 64 65 66 67 68 69 70 71 72 |
# File 'lib/telnyx/resources/faxes.rb', line 63 def create(params) parsed, = Telnyx::FaxCreateParams.dump_request(params) @client.request( method: :post, path: "faxes", body: parsed, model: Telnyx::Models::FaxCreateResponse, options: ) end |
#delete(id, request_options: {}) ⇒ nil
Delete a fax
136 137 138 139 140 141 142 143 |
# File 'lib/telnyx/resources/faxes.rb', line 136 def delete(id, params = {}) @client.request( method: :delete, path: ["faxes/%1$s", id], model: NilClass, options: params[:request_options] ) end |
#list(filter: nil, page_number: nil, page_size: nil, request_options: {}) ⇒ Telnyx::Internal::DefaultFlatPagination<Telnyx::Models::Fax>
Some parameter documentations has been truncated, see Models::FaxListParams for more details.
View a list of faxes
112 113 114 115 116 117 118 119 120 121 122 123 |
# File 'lib/telnyx/resources/faxes.rb', line 112 def list(params = {}) parsed, = Telnyx::FaxListParams.dump_request(params) query = Telnyx::Internal::Util.encode_query_params(parsed) @client.request( method: :get, path: "faxes", query: query.transform_keys(page_number: "page[number]", page_size: "page[size]"), page: Telnyx::Internal::DefaultFlatPagination, model: Telnyx::Fax, options: ) end |
#retrieve(id, request_options: {}) ⇒ Telnyx::Models::FaxRetrieveResponse
View a fax
85 86 87 88 89 90 91 92 |
# File 'lib/telnyx/resources/faxes.rb', line 85 def retrieve(id, params = {}) @client.request( method: :get, path: ["faxes/%1$s", id], model: Telnyx::Models::FaxRetrieveResponse, options: params[:request_options] ) end |