Class: Telnyx::Resources::Addresses::Actions

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

Overview

Operations to work with Address records. Address records are emergency-validated addresses meant to be associated with phone numbers. They are validated for emergency usage purposes at creation time, although you may validate them separately with a custom workflow using the ValidateAddress operation separately. Address records are not usable for physical orders, such as for Telnyx SIM cards, please use UserAddress for that. It is not possible to entirely skip emergency service validation for Address records; if an emergency provider for a phone number rejects the address then it cannot be used on a phone number. To prevent records from getting out of sync, Address records are immutable and cannot be altered once created. If you realize you need to alter an address, a new record must be created with the differing address.

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:



81
82
83
# File 'lib/telnyx/resources/addresses/actions.rb', line 81

def initialize(client:)
  @client = client
end

Instance Method Details

#accept_suggestions(address_uuid, id: nil, request_options: {}) ⇒ Telnyx::Models::Addresses::ActionAcceptSuggestionsResponse

Accepts this address suggestion as a new emergency address for Operator Connect and finishes the uploads of the numbers associated with it to Microsoft.

Parameters:

  • address_uuid (String)

    The UUID of the address that should be accepted.

  • id (String)

    The ID of the address.

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

Returns:

See Also:



32
33
34
35
36
37
38
39
40
41
# File 'lib/telnyx/resources/addresses/actions.rb', line 32

def accept_suggestions(address_uuid, params = {})
  parsed, options = Telnyx::Addresses::ActionAcceptSuggestionsParams.dump_request(params)
  @client.request(
    method: :post,
    path: ["addresses/%1$s/actions/accept_suggestions", address_uuid],
    body: parsed,
    model: Telnyx::Models::Addresses::ActionAcceptSuggestionsResponse,
    options: options
  )
end

#validate(country_code:, postal_code:, street_address:, administrative_area: nil, extended_address: nil, locality: nil, request_options: {}) ⇒ Telnyx::Models::Addresses::ActionValidateResponse

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

Validates an address for emergency services.

Parameters:

  • country_code (String)

    The two-character (ISO 3166-1 alpha-2) country code of the address.

  • postal_code (String)

    The postal code of the address.

  • street_address (String)

    The primary street address information about the address.

  • administrative_area (String)

    The locality of the address. For US addresses, this corresponds to the state of

  • extended_address (String)

    Additional street address information about the address such as, but not limited

  • locality (String)

    The locality of the address. For US addresses, this corresponds to the city of t

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

Returns:

See Also:



67
68
69
70
71
72
73
74
75
76
# File 'lib/telnyx/resources/addresses/actions.rb', line 67

def validate(params)
  parsed, options = Telnyx::Addresses::ActionValidateParams.dump_request(params)
  @client.request(
    method: :post,
    path: "addresses/actions/validate",
    body: parsed,
    model: Telnyx::Models::Addresses::ActionValidateResponse,
    options: options
  )
end