Class: Telnyx::Resources::ExternalConnections::Uploads

Inherits:
Object
  • Object
show all
Defined in:
lib/telnyx/resources/external_connections/uploads.rb

Instance Method Summary collapse

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.

Parameters:



178
179
180
# File 'lib/telnyx/resources/external_connections/uploads.rb', line 178

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.

Parameters:

Returns:

See Also:



33
34
35
36
37
38
39
40
41
42
# File 'lib/telnyx/resources/external_connections/uploads.rb', line 33

def create(id, params)
  parsed, options = 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: 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.

Parameters:

Returns:

See Also:



91
92
93
94
95
96
97
98
99
100
101
# File 'lib/telnyx/resources/external_connections/uploads.rb', line 91

def list(id, params = {})
  parsed, options = Telnyx::ExternalConnections::UploadListParams.dump_request(params)
  @client.request(
    method: :get,
    path: ["external_connections/%1$s/uploads", id],
    query: parsed.transform_keys(page_number: "page[number]", page_size: "page[size]"),
    page: Telnyx::Internal::DefaultFlatPagination,
    model: Telnyx::ExternalConnections::Upload,
    options: options
  )
end

#pending_count(id, request_options: {}) ⇒ Telnyx::Models::ExternalConnections::UploadPendingCountResponse

Returns the count of all pending upload requests for the given external connection.

Parameters:

  • id (String)

    Identifies the resource.

  • request_options (Telnyx::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



115
116
117
118
119
120
121
122
# File 'lib/telnyx/resources/external_connections/uploads.rb', line 115

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.

Parameters:

  • id (String)

    Identifies the resource.

  • request_options (Telnyx::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



136
137
138
139
140
141
142
143
# File 'lib/telnyx/resources/external_connections/uploads.rb', line 136

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.

Parameters:

  • ticket_id (String)

    Identifies an Upload request

  • id (String)

    Identifies the resource.

  • request_options (Telnyx::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



57
58
59
60
61
62
63
64
65
66
67
68
69
# File 'lib/telnyx/resources/external_connections/uploads.rb', line 57

def retrieve(ticket_id, params)
  parsed, options = 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: 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.

Parameters:

  • ticket_id (String)

    Identifies an Upload request

  • id (String)

    Identifies the resource.

  • request_options (Telnyx::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



161
162
163
164
165
166
167
168
169
170
171
172
173
# File 'lib/telnyx/resources/external_connections/uploads.rb', line 161

def retry_(ticket_id, params)
  parsed, options = 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: options
  )
end