Class: Telnyx::Resources::PhoneNumbers::Actions

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

Overview

Configure your phone numbers

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ Actions

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

Parameters:



88
89
90
# File 'lib/telnyx/resources/phone_numbers/actions.rb', line 88

def initialize(client:)
  @client = client
end

Instance Method Details

#change_bundle_status(id, bundle_id:, request_options: {}) ⇒ Telnyx::Models::PhoneNumbers::ActionChangeBundleStatusResponse

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

Change the bundle status for a phone number (set to being in a bundle or remove from a bundle)

Parameters:

  • id (String)

    Identifies the resource.

  • bundle_id (String)

    The new bundle_id setting for the number. If you are assigning the number to a b

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

Returns:

See Also:



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

def change_bundle_status(id, params)
  parsed, options = Telnyx::PhoneNumbers::ActionChangeBundleStatusParams.dump_request(params)
  @client.request(
    method: :patch,
    path: ["phone_numbers/%1$s/actions/bundle_status_change", id],
    body: parsed,
    model: Telnyx::Models::PhoneNumbers::ActionChangeBundleStatusResponse,
    options: options
  )
end

#enable_emergency(id, emergency_address_id:, emergency_enabled:, request_options: {}) ⇒ Telnyx::Models::PhoneNumbers::ActionEnableEmergencyResponse

Enable emergency for a phone number

Parameters:

  • id (String)

    Identifies the resource.

  • emergency_address_id (String)

    Identifies the address to be used with emergency services.

  • emergency_enabled (Boolean)

    Indicates whether to enable emergency services on this number.

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

Returns:

See Also:



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

def enable_emergency(id, params)
  parsed, options = Telnyx::PhoneNumbers::ActionEnableEmergencyParams.dump_request(params)
  @client.request(
    method: :post,
    path: ["phone_numbers/%1$s/actions/enable_emergency", id],
    body: parsed,
    model: Telnyx::Models::PhoneNumbers::ActionEnableEmergencyResponse,
    options: options
  )
end

#verify_ownership(phone_numbers:, request_options: {}) ⇒ Telnyx::Models::PhoneNumbers::ActionVerifyOwnershipResponse

Verifies ownership of the provided phone numbers and returns a mapping of numbers to their IDs, plus a list of numbers not found in the account.

Parameters:

  • phone_numbers (Array<String>)

    Array of phone numbers to verify ownership for

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

Returns:

See Also:



74
75
76
77
78
79
80
81
82
83
# File 'lib/telnyx/resources/phone_numbers/actions.rb', line 74

def verify_ownership(params)
  parsed, options = Telnyx::PhoneNumbers::ActionVerifyOwnershipParams.dump_request(params)
  @client.request(
    method: :post,
    path: "phone_numbers/actions/verify_ownership",
    body: parsed,
    model: Telnyx::Models::PhoneNumbers::ActionVerifyOwnershipResponse,
    options: options
  )
end