Class: Telnyx::Resources::ExternalConnections::Uploads
- Inherits:
-
Object
- Object
- Telnyx::Resources::ExternalConnections::Uploads
- Defined in:
- lib/telnyx/resources/external_connections/uploads.rb
Overview
External Connections operations
Instance Method Summary collapse
-
#create(id, number_ids:, additional_usages: nil, civic_address_id: nil, location_id: nil, usage: nil, request_options: {}) ⇒ Telnyx::Models::ExternalConnections::UploadCreateResponse
Some parameter documentations has been truncated, see Models::ExternalConnections::UploadCreateParams for more details.
-
#initialize(client:) ⇒ Uploads
constructor
private
A new instance of Uploads.
-
#list(id, filter: nil, page_number: nil, page_size: nil, request_options: {}) ⇒ Telnyx::Internal::DefaultFlatPagination<Telnyx::Models::ExternalConnections::Upload>
Some parameter documentations has been truncated, see Models::ExternalConnections::UploadListParams for more details.
-
#pending_count(id, request_options: {}) ⇒ Telnyx::Models::ExternalConnections::UploadPendingCountResponse
Returns the count of all pending upload requests for the given external connection.
-
#refresh_status(id, request_options: {}) ⇒ Telnyx::Models::ExternalConnections::UploadRefreshStatusResponse
Forces a recheck of the status of all pending Upload requests for the given external connection in the background.
-
#retrieve(ticket_id, id:, request_options: {}) ⇒ Telnyx::Models::ExternalConnections::UploadRetrieveResponse
Return the details of an Upload request and its phone numbers.
-
#retry_(ticket_id, id:, request_options: {}) ⇒ Telnyx::Models::ExternalConnections::UploadRetryResponse
If there were any errors during the upload process, this endpoint will retry the upload request.
Constructor Details
#initialize(client:) ⇒ Uploads
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 Uploads.
180 181 182 |
# File 'lib/telnyx/resources/external_connections/uploads.rb', line 180 def initialize(client:) @client = client end |
Instance Method Details
#create(id, number_ids:, additional_usages: nil, civic_address_id: nil, location_id: nil, usage: nil, request_options: {}) ⇒ Telnyx::Models::ExternalConnections::UploadCreateResponse
Some parameter documentations has been truncated, see Models::ExternalConnections::UploadCreateParams for more details.
Creates a new Upload request to Microsoft teams with the included phone numbers. Only one of civic_address_id or location_id must be provided, not both. The maximum allowed phone numbers for the numbers_ids array is 1000.
34 35 36 37 38 39 40 41 42 43 |
# File 'lib/telnyx/resources/external_connections/uploads.rb', line 34 def create(id, params) parsed, = Telnyx::ExternalConnections::UploadCreateParams.dump_request(params) @client.request( method: :post, path: ["external_connections/%1$s/uploads", id], body: parsed, model: Telnyx::Models::ExternalConnections::UploadCreateResponse, options: ) end |
#list(id, filter: nil, page_number: nil, page_size: nil, request_options: {}) ⇒ Telnyx::Internal::DefaultFlatPagination<Telnyx::Models::ExternalConnections::Upload>
Some parameter documentations has been truncated, see Models::ExternalConnections::UploadListParams for more details.
Returns a list of your Upload requests for the given external connection.
92 93 94 95 96 97 98 99 100 101 102 103 |
# File 'lib/telnyx/resources/external_connections/uploads.rb', line 92 def list(id, params = {}) parsed, = Telnyx::ExternalConnections::UploadListParams.dump_request(params) query = Telnyx::Internal::Util.encode_query_params(parsed) @client.request( method: :get, path: ["external_connections/%1$s/uploads", id], query: query.transform_keys(page_number: "page[number]", page_size: "page[size]"), page: Telnyx::Internal::DefaultFlatPagination, model: Telnyx::ExternalConnections::Upload, options: ) end |
#pending_count(id, request_options: {}) ⇒ Telnyx::Models::ExternalConnections::UploadPendingCountResponse
Returns the count of all pending upload requests for the given external connection.
117 118 119 120 121 122 123 124 |
# File 'lib/telnyx/resources/external_connections/uploads.rb', line 117 def pending_count(id, params = {}) @client.request( method: :get, path: ["external_connections/%1$s/uploads/status", id], model: Telnyx::Models::ExternalConnections::UploadPendingCountResponse, options: params[:request_options] ) end |
#refresh_status(id, request_options: {}) ⇒ Telnyx::Models::ExternalConnections::UploadRefreshStatusResponse
Forces a recheck of the status of all pending Upload requests for the given external connection in the background.
138 139 140 141 142 143 144 145 |
# File 'lib/telnyx/resources/external_connections/uploads.rb', line 138 def refresh_status(id, params = {}) @client.request( method: :post, path: ["external_connections/%1$s/uploads/refresh", id], model: Telnyx::Models::ExternalConnections::UploadRefreshStatusResponse, options: params[:request_options] ) end |
#retrieve(ticket_id, id:, request_options: {}) ⇒ Telnyx::Models::ExternalConnections::UploadRetrieveResponse
Return the details of an Upload request and its phone numbers.
58 59 60 61 62 63 64 65 66 67 68 69 70 |
# File 'lib/telnyx/resources/external_connections/uploads.rb', line 58 def retrieve(ticket_id, params) parsed, = Telnyx::ExternalConnections::UploadRetrieveParams.dump_request(params) id = parsed.delete(:id) do raise ArgumentError.new("missing required path argument #{_1}") end @client.request( method: :get, path: ["external_connections/%1$s/uploads/%2$s", id, ticket_id], model: Telnyx::Models::ExternalConnections::UploadRetrieveResponse, options: ) end |
#retry_(ticket_id, id:, request_options: {}) ⇒ Telnyx::Models::ExternalConnections::UploadRetryResponse
If there were any errors during the upload process, this endpoint will retry the upload request. In some cases this will reattempt the existing upload request, in other cases it may create a new upload request. Please check the ticket_id in the response to determine if a new upload request was created.
163 164 165 166 167 168 169 170 171 172 173 174 175 |
# File 'lib/telnyx/resources/external_connections/uploads.rb', line 163 def retry_(ticket_id, params) parsed, = Telnyx::ExternalConnections::UploadRetryParams.dump_request(params) id = parsed.delete(:id) do raise ArgumentError.new("missing required path argument #{_1}") end @client.request( method: :post, path: ["external_connections/%1$s/uploads/%2$s/retry", id, ticket_id], model: Telnyx::Models::ExternalConnections::UploadRetryResponse, options: ) end |