Class: Telnyx::Resources::ExternalConnections

Inherits:
Object
  • Object
show all
Defined in:
lib/telnyx/resources/external_connections.rb,
lib/telnyx/resources/external_connections/uploads.rb,
lib/telnyx/resources/external_connections/releases.rb,
lib/telnyx/resources/external_connections/log_messages.rb,
lib/telnyx/resources/external_connections/phone_numbers.rb,
lib/telnyx/resources/external_connections/civic_addresses.rb

Overview

External Connections operations

Defined Under Namespace

Classes: CivicAddresses, LogMessages, PhoneNumbers, Releases, Uploads

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ ExternalConnections

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 ExternalConnections.

Parameters:



220
221
222
223
224
225
226
227
# File 'lib/telnyx/resources/external_connections.rb', line 220

def initialize(client:)
  @client = client
  @log_messages = Telnyx::Resources::ExternalConnections::LogMessages.new(client: client)
  @civic_addresses = Telnyx::Resources::ExternalConnections::CivicAddresses.new(client: client)
  @phone_numbers = Telnyx::Resources::ExternalConnections::PhoneNumbers.new(client: client)
  @releases = Telnyx::Resources::ExternalConnections::Releases.new(client: client)
  @uploads = Telnyx::Resources::ExternalConnections::Uploads.new(client: client)
end

Instance Attribute Details

#civic_addressesTelnyx::Resources::ExternalConnections::CivicAddresses (readonly)

External Connections operations



13
14
15
# File 'lib/telnyx/resources/external_connections.rb', line 13

def civic_addresses
  @civic_addresses
end

#log_messagesTelnyx::Resources::ExternalConnections::LogMessages (readonly)

External Connections operations



9
10
11
# File 'lib/telnyx/resources/external_connections.rb', line 9

def log_messages
  @log_messages
end

#phone_numbersTelnyx::Resources::ExternalConnections::PhoneNumbers (readonly)

External Connections operations



17
18
19
# File 'lib/telnyx/resources/external_connections.rb', line 17

def phone_numbers
  @phone_numbers
end

#releasesTelnyx::Resources::ExternalConnections::Releases (readonly)

External Connections operations



21
22
23
# File 'lib/telnyx/resources/external_connections.rb', line 21

def releases
  @releases
end

#uploadsTelnyx::Resources::ExternalConnections::Uploads (readonly)

External Connections operations



25
26
27
# File 'lib/telnyx/resources/external_connections.rb', line 25

def uploads
  @uploads
end

Instance Method Details

#create(external_sip_connection:, outbound:, active: nil, inbound: nil, tags: nil, webhook_event_failover_url: nil, webhook_event_url: nil, webhook_timeout_secs: nil, request_options: {}) ⇒ Telnyx::Models::ExternalConnectionCreateResponse

Some parameter documentations has been truncated, see Models::ExternalConnectionCreateParams for more details.

Creates a new External Connection based on the parameters sent in the request. The external_sip_connection and outbound voice profile id are required. Once created, you can assign phone numbers to your application using the ‘/phone_numbers` endpoint.

Parameters:

Returns:

See Also:



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

def create(params)
  parsed, options = Telnyx::ExternalConnectionCreateParams.dump_request(params)
  @client.request(
    method: :post,
    path: "external_connections",
    body: parsed,
    model: Telnyx::Models::ExternalConnectionCreateResponse,
    options: options
  )
end

#delete(id, request_options: {}) ⇒ Telnyx::Models::ExternalConnectionDeleteResponse

Permanently deletes an External Connection. Deletion may be prevented if the application is in use by phone numbers, is active, or if it is an Operator Connect connection. To remove an Operator Connect integration please contact Telnyx support.

Parameters:

  • id (String)

    Identifies the resource.

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

Returns:

See Also:



178
179
180
181
182
183
184
185
# File 'lib/telnyx/resources/external_connections.rb', line 178

def delete(id, params = {})
  @client.request(
    method: :delete,
    path: ["external_connections/%1$s", id],
    model: Telnyx::Models::ExternalConnectionDeleteResponse,
    options: params[:request_options]
  )
end

#list(filter: nil, page_number: nil, page_size: nil, request_options: {}) ⇒ Telnyx::Internal::DefaultFlatPagination<Telnyx::Models::ExternalConnection>

Some parameter documentations has been truncated, see Models::ExternalConnectionListParams for more details.

This endpoint returns a list of your External Connections inside the ‘data’ attribute of the response. External Connections are used by Telnyx customers to seamless configure SIP trunking integrations with Telnyx Partners, through External Voice Integrations in Mission Control Portal.

Parameters:

Returns:

See Also:



151
152
153
154
155
156
157
158
159
160
161
162
# File 'lib/telnyx/resources/external_connections.rb', line 151

def list(params = {})
  parsed, options = Telnyx::ExternalConnectionListParams.dump_request(params)
  query = Telnyx::Internal::Util.encode_query_params(parsed)
  @client.request(
    method: :get,
    path: "external_connections",
    query: query.transform_keys(page_number: "page[number]", page_size: "page[size]"),
    page: Telnyx::Internal::DefaultFlatPagination,
    model: Telnyx::ExternalConnection,
    options: options
  )
end

#retrieve(id, request_options: {}) ⇒ Telnyx::Models::ExternalConnectionRetrieveResponse

Return the details of an existing External Connection inside the ‘data’ attribute of the response.

Parameters:

  • id (String)

    Identifies the resource.

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

Returns:

See Also:



81
82
83
84
85
86
87
88
# File 'lib/telnyx/resources/external_connections.rb', line 81

def retrieve(id, params = {})
  @client.request(
    method: :get,
    path: ["external_connections/%1$s", id],
    model: Telnyx::Models::ExternalConnectionRetrieveResponse,
    options: params[:request_options]
  )
end

#update(id, outbound:, active: nil, inbound: nil, tags: nil, webhook_event_failover_url: nil, webhook_event_url: nil, webhook_timeout_secs: nil, request_options: {}) ⇒ Telnyx::Models::ExternalConnectionUpdateResponse

Some parameter documentations has been truncated, see Models::ExternalConnectionUpdateParams for more details.

Updates settings of an existing External Connection based on the parameters of the request.

Parameters:

  • id (String)

    Identifies the resource.

  • outbound (Telnyx::Models::ExternalConnectionUpdateParams::Outbound)
  • active (Boolean)

    Specifies whether the connection can be used.

  • inbound (Telnyx::Models::ExternalConnectionUpdateParams::Inbound)
  • tags (Array<String>)

    Tags associated with the connection.

  • webhook_event_failover_url (String, nil)

    The failover URL where webhooks related to this connection will be sent if sendi

  • webhook_event_url (String)

    The URL where webhooks related to this connection will be sent. Must include a s

  • webhook_timeout_secs (Integer, nil)

    Specifies how many seconds to wait before timing out a webhook.

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

Returns:

See Also:



119
120
121
122
123
124
125
126
127
128
# File 'lib/telnyx/resources/external_connections.rb', line 119

def update(id, params)
  parsed, options = Telnyx::ExternalConnectionUpdateParams.dump_request(params)
  @client.request(
    method: :patch,
    path: ["external_connections/%1$s", id],
    body: parsed,
    model: Telnyx::Models::ExternalConnectionUpdateResponse,
    options: options
  )
end

#update_location(location_id, id:, static_emergency_address_id:, request_options: {}) ⇒ Telnyx::Models::ExternalConnectionUpdateLocationResponse

Update a location’s static emergency address

Parameters:

  • location_id (String)

    Path param: The ID of the location to update

  • id (String)

    Path param: The ID of the external connection

  • static_emergency_address_id (String)

    Body param: A new static emergency address ID to update the location with

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

Returns:

See Also:



202
203
204
205
206
207
208
209
210
211
212
213
214
215
# File 'lib/telnyx/resources/external_connections.rb', line 202

def update_location(location_id, params)
  parsed, options = Telnyx::ExternalConnectionUpdateLocationParams.dump_request(params)
  id =
    parsed.delete(:id) do
      raise ArgumentError.new("missing required path argument #{_1}")
    end
  @client.request(
    method: :patch,
    path: ["external_connections/%1$s/locations/%2$s", id, location_id],
    body: parsed,
    model: Telnyx::Models::ExternalConnectionUpdateLocationResponse,
    options: options
  )
end