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

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:



213
214
215
216
217
218
219
220
# File 'lib/telnyx/resources/external_connections.rb', line 213

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)



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

def civic_addresses
  @civic_addresses
end

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



7
8
9
# File 'lib/telnyx/resources/external_connections.rb', line 7

def log_messages
  @log_messages
end

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



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

def phone_numbers
  @phone_numbers
end

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



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

def releases
  @releases
end

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



19
20
21
# File 'lib/telnyx/resources/external_connections.rb', line 19

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:



52
53
54
55
56
57
58
59
60
61
# File 'lib/telnyx/resources/external_connections.rb', line 52

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:



171
172
173
174
175
176
177
178
# File 'lib/telnyx/resources/external_connections.rb', line 171

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:



145
146
147
148
149
150
151
152
153
154
155
# File 'lib/telnyx/resources/external_connections.rb', line 145

def list(params = {})
  parsed, options = Telnyx::ExternalConnectionListParams.dump_request(params)
  @client.request(
    method: :get,
    path: "external_connections",
    query: parsed.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:



75
76
77
78
79
80
81
82
# File 'lib/telnyx/resources/external_connections.rb', line 75

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:



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

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:



195
196
197
198
199
200
201
202
203
204
205
206
207
208
# File 'lib/telnyx/resources/external_connections.rb', line 195

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