Class: Telnyx::Resources::ChannelZones

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

Overview

Voice Channels

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ ChannelZones

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

Parameters:



65
66
67
# File 'lib/telnyx/resources/channel_zones.rb', line 65

def initialize(client:)
  @client = client
end

Instance Method Details

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

Returns the non-US voice channels for your account. voice channels allow you to use Channel Billing for calls to your Telnyx phone numbers. Please check the <a href=“support.telnyx.com/en/articles/8428806-global-channel-billing”>Telnyx Support Articles</a> section for full information and examples of how to utilize Channel Billing.

Parameters:

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

Returns:

See Also:



49
50
51
52
53
54
55
56
57
58
59
60
# File 'lib/telnyx/resources/channel_zones.rb', line 49

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

#update(channel_zone_id, channels:, request_options: {}) ⇒ Telnyx::Models::ChannelZoneUpdateResponse

Update the number of Voice Channels for the Non-US Zones. This allows your account to handle multiple simultaneous inbound calls to Non-US numbers. Use this endpoint to increase or decrease your capacity based on expected call volume.

Parameters:

  • channel_zone_id (String)

    Channel zone identifier

  • channels (Integer)

    The number of reserved channels

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

Returns:

See Also:



23
24
25
26
27
28
29
30
31
32
# File 'lib/telnyx/resources/channel_zones.rb', line 23

def update(channel_zone_id, params)
  parsed, options = Telnyx::ChannelZoneUpdateParams.dump_request(params)
  @client.request(
    method: :put,
    path: ["channel_zones/%1$s", channel_zone_id],
    body: parsed,
    model: Telnyx::Models::ChannelZoneUpdateResponse,
    options: options
  )
end