Class: Telnyx::Resources::Dir::References

Inherits:
Object
  • Object
show all
Defined in:
lib/telnyx/resources/dir/references.rb,
sig/telnyx/resources/dir/references.rbs

Overview

Submit and manage the two business references and one financial reference that vouch for a DIR. References are contacted to confirm the business identity during vetting.

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ References

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

Parameters:



133
134
135
# File 'lib/telnyx/resources/dir/references.rb', line 133

def initialize(client:)
  @client = client
end

Instance Method Details

#create(dir_id, business_references:, financial_reference:, request_options: {}) ⇒ Telnyx::Models::Dir::ReferenceList

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

Submit the two business references and one financial reference for a DIR.

The DIR's authorizer email must be verified first (see the email-verification endpoint). Until it is, this returns 409 and no references are stored.

The request body carries exactly two business references plus one financial reference. On success the references are stored and the response echoes them in the same shape as the GET. Submitting again converges on the already-stored references rather than erroring.

Parameters:

Returns:

See Also:



36
37
38
39
40
41
42
43
44
45
# File 'lib/telnyx/resources/dir/references.rb', line 36

def create(dir_id, params)
  parsed, options = Telnyx::Dir::ReferenceCreateParams.dump_request(params)
  @client.request(
    method: :post,
    path: ["dir/%1$s/references", dir_id],
    body: parsed,
    model: Telnyx::Dir::ReferenceList,
    options: options
  )
end

#list(dir_id, request_options: {}) ⇒ Telnyx::Models::Dir::ReferenceList

List the business and financial references submitted for a DIR.

Returns the two business references (slots 0 and 1) followed by the single financial reference. Each entry carries only the customer-supplied details (name, title, organization, relationship, phone, email, timezone). Returns an empty list when no references were submitted.

Parameters:

  • dir_id (String)

    The DIR id. Lowercase UUID.

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

Returns:

See Also:



121
122
123
124
125
126
127
128
# File 'lib/telnyx/resources/dir/references.rb', line 121

def list(dir_id, params = {})
  @client.request(
    method: :get,
    path: ["dir/%1$s/references", dir_id],
    model: Telnyx::Dir::ReferenceList,
    options: params[:request_options]
  )
end

#update(slot, dir_id:, ref_type:, email: nil, full_name: nil, job_title: nil, organization: nil, phone_e164: nil, relationship_to_registrant: nil, timezone: nil, request_options: {}) ⇒ Telnyx::Models::Dir::ReferenceUpdateResponse

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

Partially update one reference, addressed by the DIR id plus the reference's type (business or financial) and slot.

Cosmetic fields (full name, job title, organization, relationship, email) are always editable. The phone number and timezone may only be changed while a scheduled call has not yet been dialed; if a call is in progress or all attempts are complete, those fields are locked. Changing the timezone reschedules any pending call into the new local calling window.

Parameters:

  • slot (Integer)

    Path param: Reference slot. Business references use slots 0 and 1; the financial

  • dir_id (String)

    Path param: The DIR id. Lowercase UUID.

  • ref_type (Symbol, Telnyx::Models::Dir::ReferenceUpdateParams::RefType)

    Path param: Reference type to address.

  • email (String)

    Body param: Reference contact email address.

  • full_name (String)

    Body param: Full name of the reference contact.

  • job_title (String, nil)

    Body param: Job title of the reference contact.

  • organization (String, nil)

    Body param: Organization the reference contact belongs to.

  • phone_e164 (String)

    Body param: Reference phone number in E.164 format.

  • relationship_to_registrant (String, nil)

    Body param: How the reference contact is related to the registering business.

  • timezone (String)

    Body param: IANA timezone id for the reference.

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

Returns:

See Also:



86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
# File 'lib/telnyx/resources/dir/references.rb', line 86

def update(slot, params)
  parsed, options = Telnyx::Dir::ReferenceUpdateParams.dump_request(params)
  dir_id =
    parsed.delete(:dir_id) do
      raise ArgumentError.new("missing required path argument #{_1}")
    end
  ref_type =
    parsed.delete(:ref_type) do
      raise ArgumentError.new("missing required path argument #{_1}")
    end
  @client.request(
    method: :patch,
    path: ["dir/%1$s/references/%2$s/%3$s", dir_id, ref_type, slot],
    body: parsed,
    model: Telnyx::Models::Dir::ReferenceUpdateResponse,
    options: options
  )
end