Class: Telnyx::Resources::MobileVoiceConnections

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

Overview

Mobile voice connection operations

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ MobileVoiceConnections

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

Parameters:



156
157
158
# File 'lib/telnyx/resources/mobile_voice_connections.rb', line 156

def initialize(client:)
  @client = client
end

Instance Method Details

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

Create a Mobile Voice Connection

Parameters:

Returns:

See Also:



25
26
27
28
29
30
31
32
33
34
# File 'lib/telnyx/resources/mobile_voice_connections.rb', line 25

def create(params = {})
  parsed, options = Telnyx::MobileVoiceConnectionCreateParams.dump_request(params)
  @client.request(
    method: :post,
    path: "v2/mobile_voice_connections",
    body: parsed,
    model: Telnyx::Models::MobileVoiceConnectionCreateResponse,
    options: options
  )
end

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

Delete a Mobile Voice Connection

Parameters:

  • id (String)

    The ID of the mobile voice connection

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

Returns:

See Also:



144
145
146
147
148
149
150
151
# File 'lib/telnyx/resources/mobile_voice_connections.rb', line 144

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

#list(filter_connection_name_contains: nil, page_number: nil, page_size: nil, sort: nil, request_options: {}) ⇒ Telnyx::Internal::DefaultFlatPagination<Telnyx::Models::MobileVoiceConnection>

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

List Mobile Voice Connections

Parameters:

  • filter_connection_name_contains (String)

    Filter by connection name containing the given string

  • page_number (Integer)

    The page number to load

  • page_size (Integer)

    The size of the page

  • sort (String)

    Sort by field (e.g., created_at, connection_name, active). Prefix with - for des

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

Returns:

See Also:



116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
# File 'lib/telnyx/resources/mobile_voice_connections.rb', line 116

def list(params = {})
  parsed, options = Telnyx::MobileVoiceConnectionListParams.dump_request(params)
  query = Telnyx::Internal::Util.encode_query_params(parsed)
  @client.request(
    method: :get,
    path: "v2/mobile_voice_connections",
    query: query.transform_keys(
      filter_connection_name_contains: "filter[connection_name][contains]",
      page_number: "page[number]",
      page_size: "page[size]"
    ),
    page: Telnyx::Internal::DefaultFlatPagination,
    model: Telnyx::MobileVoiceConnection,
    options: options
  )
end

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

Retrieve a Mobile Voice Connection

Parameters:

  • id (String)

    The ID of the mobile voice connection

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

Returns:

See Also:



47
48
49
50
51
52
53
54
# File 'lib/telnyx/resources/mobile_voice_connections.rb', line 47

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

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

Update a Mobile Voice Connection

Parameters:

Returns:

See Also:



85
86
87
88
89
90
91
92
93
94
# File 'lib/telnyx/resources/mobile_voice_connections.rb', line 85

def update(id, params = {})
  parsed, options = Telnyx::MobileVoiceConnectionUpdateParams.dump_request(params)
  @client.request(
    method: :patch,
    path: ["v2/mobile_voice_connections/%1$s", id],
    body: parsed,
    model: Telnyx::Models::MobileVoiceConnectionUpdateResponse,
    options: options
  )
end