Class: Telnyx::Resources::UserAddresses

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

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ UserAddresses

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

Parameters:



112
113
114
# File 'lib/telnyx/resources/user_addresses.rb', line 112

def initialize(client:)
  @client = client
end

Instance Method Details

#create(business_name:, country_code:, first_name:, last_name:, locality:, street_address:, administrative_area: nil, borough: nil, customer_reference: nil, extended_address: nil, neighborhood: nil, phone_number: nil, postal_code: nil, skip_address_verification: nil, request_options: {}) ⇒ Telnyx::Models::UserAddressCreateResponse

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

Creates a user address.

Parameters:

  • business_name (String)

    The business name associated with the user address.

  • country_code (String)

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

  • first_name (String)

    The first name associated with the user address.

  • last_name (String)

    The last name associated with the user address.

  • locality (String)

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

  • street_address (String)

    The primary street address information about the user address.

  • administrative_area (String)

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

  • borough (String)

    The borough of the user address. This field is not used for addresses in the US

  • customer_reference (String)

    A customer reference string for customer look ups.

  • extended_address (String)

    Additional street address information about the user address such as, but not li

  • neighborhood (String)

    The neighborhood of the user address. This field is not used for addresses in th

  • phone_number (String)

    The phone number associated with the user address.

  • postal_code (String)

    The postal code of the user address.

  • skip_address_verification (Boolean)

    An optional boolean value specifying if verification of the address should be sk

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

Returns:

See Also:



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

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

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

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

Returns a list of your user addresses.

Parameters:

Returns:

See Also:



97
98
99
100
101
102
103
104
105
106
107
# File 'lib/telnyx/resources/user_addresses.rb', line 97

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

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

Retrieves the details of an existing user address.

Parameters:

Returns:

See Also:



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

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