Class: Telnyx::Resources::OutboundVoiceProfiles

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

Overview

Outbound voice profiles operations

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ OutboundVoiceProfiles

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

Parameters:



188
189
190
# File 'lib/telnyx/resources/outbound_voice_profiles.rb', line 188

def initialize(client:)
  @client = client
end

Instance Method Details

#create(name:, billing_group_id: nil, call_recording: nil, calling_window: nil, concurrent_call_limit: nil, daily_spend_limit: nil, daily_spend_limit_enabled: nil, enabled: nil, max_destination_rate: nil, service_plan: nil, tags: nil, traffic_type: nil, usage_payment_method: nil, whitelisted_destinations: nil, request_options: {}) ⇒ Telnyx::Models::OutboundVoiceProfileCreateResponse

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

Create an outbound voice profile.

Parameters:

  • name (String)

    A user-supplied name to help with organization.

  • billing_group_id (String, nil)

    The ID of the billing group associated with the outbound proflile. Defaults to n

  • call_recording (Telnyx::Models::OutboundCallRecording)
  • calling_window (Telnyx::Models::OutboundVoiceProfileCreateParams::CallingWindow)

    (BETA) Specifies the time window and call limits for calls made using this outbo

  • concurrent_call_limit (Integer, nil)

    Must be no more than your global concurrent call limit. Null means no limit.

  • daily_spend_limit (String)

    The maximum amount of usage charges, in USD, you want Telnyx to allow on this ou

  • daily_spend_limit_enabled (Boolean)

    Specifies whether to enforce the daily_spend_limit on this outbound voice profil

  • enabled (Boolean)

    Specifies whether the outbound voice profile can be used. Disabled profiles will

  • max_destination_rate (Float)

    Maximum rate (price per minute) for a Destination to be allowed when making outb

  • service_plan (Symbol, Telnyx::Models::ServicePlan)

    Indicates the coverage of the termination regions.

  • tags (Array<String>)
  • traffic_type (Symbol, Telnyx::Models::TrafficType)

    Specifies the type of traffic allowed in this profile.

  • usage_payment_method (Symbol, Telnyx::Models::UsagePaymentMethod)

    Setting for how costs for outbound profile are calculated.

  • whitelisted_destinations (Array<String>)

    The list of destinations you want to be able to call using this outbound voice p

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

Returns:

See Also:



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

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

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

Deletes an existing outbound voice profile.

Parameters:

  • id (String)

    Identifies the resource.

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

Returns:

See Also:



176
177
178
179
180
181
182
183
# File 'lib/telnyx/resources/outbound_voice_profiles.rb', line 176

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

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

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

Get all outbound voice profiles belonging to the user that match the given filters.

Parameters:

Returns:

See Also:



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

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

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

Retrieves the details of an existing outbound voice profile.

Parameters:

  • id (String)

    Identifies the resource.

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

Returns:

See Also:



69
70
71
72
73
74
75
76
# File 'lib/telnyx/resources/outbound_voice_profiles.rb', line 69

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

#update(id, name:, billing_group_id: nil, call_recording: nil, calling_window: nil, concurrent_call_limit: nil, daily_spend_limit: nil, daily_spend_limit_enabled: nil, enabled: nil, max_destination_rate: nil, service_plan: nil, tags: nil, traffic_type: nil, usage_payment_method: nil, whitelisted_destinations: nil, request_options: {}) ⇒ Telnyx::Models::OutboundVoiceProfileUpdateResponse

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

Updates an existing outbound voice profile.

Parameters:

  • id (String)

    Identifies the resource.

  • name (String)

    A user-supplied name to help with organization.

  • billing_group_id (String, nil)

    The ID of the billing group associated with the outbound proflile. Defaults to n

  • call_recording (Telnyx::Models::OutboundCallRecording)
  • calling_window (Telnyx::Models::OutboundVoiceProfileUpdateParams::CallingWindow)

    (BETA) Specifies the time window and call limits for calls made using this outbo

  • concurrent_call_limit (Integer, nil)

    Must be no more than your global concurrent call limit. Null means no limit.

  • daily_spend_limit (String)

    The maximum amount of usage charges, in USD, you want Telnyx to allow on this ou

  • daily_spend_limit_enabled (Boolean)

    Specifies whether to enforce the daily_spend_limit on this outbound voice profil

  • enabled (Boolean)

    Specifies whether the outbound voice profile can be used. Disabled profiles will

  • max_destination_rate (Float)

    Maximum rate (price per minute) for a Destination to be allowed when making outb

  • service_plan (Symbol, Telnyx::Models::ServicePlan)

    Indicates the coverage of the termination regions.

  • tags (Array<String>)
  • traffic_type (Symbol, Telnyx::Models::TrafficType)

    Specifies the type of traffic allowed in this profile.

  • usage_payment_method (Symbol, Telnyx::Models::UsagePaymentMethod)

    Setting for how costs for outbound profile are calculated.

  • whitelisted_destinations (Array<String>)

    The list of destinations you want to be able to call using this outbound voice p

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

Returns:

See Also:



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

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