Class: Telnyx::Resources::Dir::References
- Inherits:
-
Object
- Object
- Telnyx::Resources::Dir::References
- 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
-
#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.
-
#initialize(client:) ⇒ References
constructor
private
A new instance of References.
-
#list(dir_id, request_options: {}) ⇒ Telnyx::Models::Dir::ReferenceList
List the business and financial references submitted for a DIR.
-
#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.
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.
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.
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, = Telnyx::Dir::ReferenceCreateParams.dump_request(params) @client.request( method: :post, path: ["dir/%1$s/references", dir_id], body: parsed, model: Telnyx::Dir::ReferenceList, 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.
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.
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, = 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: ) end |