Class: Telnyx::Resources::Faxes
- Inherits:
-
Object
- Object
- Telnyx::Resources::Faxes
- Defined in:
- lib/telnyx/resources/faxes.rb,
lib/telnyx/resources/faxes/actions.rb,
sig/telnyx/resources/faxes.rbs,
sig/telnyx/resources/faxes/actions.rbs
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.
160 161 162 163 |
# File 'lib/telnyx/resources/faxes.rb', line 160 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.
Supported file formats:
- PDF (
application/pdf) - TIFF (
application/tiff,image/tiff) - JPEG (
image/jpeg) - PNG (
image/png) - Microsoft Word
.doc(application/msword) - Microsoft Word
.docx(application/vnd.openxmlformats-officedocument.wordprocessingml.document) - Rich Text Format
.rtf(application/rtf) - Plain text
.txt(text/plain)
Expected Webhooks:
fax.queuedfax.media.processedfax.sending.startedfax.deliveredfax.failed
75 76 77 78 79 80 81 82 83 84 |
# File 'lib/telnyx/resources/faxes.rb', line 75 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
148 149 150 151 152 153 154 155 |
# File 'lib/telnyx/resources/faxes.rb', line 148 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
124 125 126 127 128 129 130 131 132 133 134 135 |
# File 'lib/telnyx/resources/faxes.rb', line 124 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
97 98 99 100 101 102 103 104 |
# File 'lib/telnyx/resources/faxes.rb', line 97 def retrieve(id, params = {}) @client.request( method: :get, path: ["faxes/%1$s", id], model: Telnyx::Models::FaxRetrieveResponse, options: params[:request_options] ) end |