Class: Telnyx::Resources::Connections
- Inherits:
-
Object
- Object
- Telnyx::Resources::Connections
- Defined in:
- lib/telnyx/resources/connections.rb
Instance Method Summary collapse
-
#initialize(client:) ⇒ Connections
constructor
private
A new instance of Connections.
-
#list(filter: nil, page_number: nil, page_size: nil, sort: nil, request_options: {}) ⇒ Telnyx::Internal::DefaultFlatPagination<Telnyx::Models::ConnectionListResponse>
Some parameter documentations has been truncated, see Models::ConnectionListParams for more details.
-
#list_active_calls(connection_id, page_number: nil, page_size: nil, request_options: {}) ⇒ Telnyx::Internal::DefaultFlatPagination<Telnyx::Models::ConnectionListActiveCallsResponse>
Lists all active calls for given connection.
-
#retrieve(id, request_options: {}) ⇒ Telnyx::Models::ConnectionRetrieveResponse
Retrieves the high-level details of an existing connection.
Constructor Details
#initialize(client:) ⇒ Connections
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 Connections.
94 95 96 |
# File 'lib/telnyx/resources/connections.rb', line 94 def initialize(client:) @client = client end |
Instance Method Details
#list(filter: nil, page_number: nil, page_size: nil, sort: nil, request_options: {}) ⇒ Telnyx::Internal::DefaultFlatPagination<Telnyx::Models::ConnectionListResponse>
Some parameter documentations has been truncated, see Models::ConnectionListParams for more details.
Returns a list of your connections irrespective of type.
filter[connection_
48 49 50 51 52 53 54 55 56 57 58 59 |
# File 'lib/telnyx/resources/connections.rb', line 48 def list(params = {}) parsed, = Telnyx::ConnectionListParams.dump_request(params) query = Telnyx::Internal::Util.encode_query_params(parsed) @client.request( method: :get, path: "connections", query: query.transform_keys(page_number: "page[number]", page_size: "page[size]"), page: Telnyx::Internal::DefaultFlatPagination, model: Telnyx::Models::ConnectionListResponse, options: ) end |
#list_active_calls(connection_id, page_number: nil, page_size: nil, request_options: {}) ⇒ Telnyx::Internal::DefaultFlatPagination<Telnyx::Models::ConnectionListActiveCallsResponse>
Lists all active calls for given connection. Acceptable connections are either SIP connections with webhook_url or xml_request_url, call control or texml. Returned results are cursor paginated.
78 79 80 81 82 83 84 85 86 87 88 89 |
# File 'lib/telnyx/resources/connections.rb', line 78 def list_active_calls(connection_id, params = {}) parsed, = Telnyx::ConnectionListActiveCallsParams.dump_request(params) query = Telnyx::Internal::Util.encode_query_params(parsed) @client.request( method: :get, path: ["connections/%1$s/active_calls", connection_id], query: query.transform_keys(page_number: "page[number]", page_size: "page[size]"), page: Telnyx::Internal::DefaultFlatPagination, model: Telnyx::Models::ConnectionListActiveCallsResponse, options: ) end |
#retrieve(id, request_options: {}) ⇒ Telnyx::Models::ConnectionRetrieveResponse
Retrieves the high-level details of an existing connection. To retrieve specific authentication information, use the endpoint for the specific connection type.
18 19 20 21 22 23 24 25 |
# File 'lib/telnyx/resources/connections.rb', line 18 def retrieve(id, params = {}) @client.request( method: :get, path: ["connections/%1$s", id], model: Telnyx::Models::ConnectionRetrieveResponse, options: params[:request_options] ) end |