Class: Telnyx::Resources::CustomerServiceRecords

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

Overview

Customer Service Record operations

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ CustomerServiceRecords

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

Parameters:



111
112
113
# File 'lib/telnyx/resources/customer_service_records.rb', line 111

def initialize(client:)
  @client = client
end

Instance Method Details

#create(phone_number:, additional_data: nil, webhook_url: nil, request_options: {}) ⇒ Telnyx::Models::CustomerServiceRecordCreateResponse

Create a new customer service record for the provided phone number.

Parameters:

Returns:

See Also:



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

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

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

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

List customer service records.

Parameters:

Returns:

See Also:



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

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

#retrieve(customer_service_record_id, request_options: {}) ⇒ Telnyx::Models::CustomerServiceRecordRetrieveResponse

Get a specific customer service record.

Parameters:

  • customer_service_record_id (String)

    The ID of the customer service record

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

Returns:

See Also:



44
45
46
47
48
49
50
51
# File 'lib/telnyx/resources/customer_service_records.rb', line 44

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

#verify_phone_number_coverage(phone_numbers:, request_options: {}) ⇒ Telnyx::Models::CustomerServiceRecordVerifyPhoneNumberCoverageResponse

Verify the coverage for a list of phone numbers.

Parameters:

  • phone_numbers (Array<String>)

    The phone numbers list to be verified.

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

Returns:

See Also:



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

def verify_phone_number_coverage(params)
  parsed, options = Telnyx::CustomerServiceRecordVerifyPhoneNumberCoverageParams.dump_request(params)
  @client.request(
    method: :post,
    path: "customer_service_records/phone_number_coverages",
    body: parsed,
    model: Telnyx::Models::CustomerServiceRecordVerifyPhoneNumberCoverageResponse,
    options: options
  )
end