Class: Telnyx::Resources::Dir
- Inherits:
-
Object
- Object
- Telnyx::Resources::Dir
- Defined in:
- lib/telnyx/resources/dir.rb,
lib/telnyx/resources/dir/comments.rb,
lib/telnyx/resources/dir/references.rb,
lib/telnyx/resources/dir/verify_email.rb,
lib/telnyx/resources/dir/phone_numbers.rb,
lib/telnyx/resources/dir/phone_number_batches.rb,
sig/telnyx/resources/dir.rbs,
sig/telnyx/resources/dir/comments.rbs,
sig/telnyx/resources/dir/references.rbs,
sig/telnyx/resources/dir/verify_email.rbs,
sig/telnyx/resources/dir/phone_numbers.rbs,
sig/telnyx/resources/dir/phone_number_batches.rbs
Defined Under Namespace
Classes: Comments, PhoneNumberBatches, PhoneNumbers, References, VerifyEmail
Instance Attribute Summary collapse
-
#comments ⇒ Telnyx::Resources::Dir::Comments
readonly
Read messages from the Telnyx vetting team and reply with clarifying information.
-
#phone_number_batches ⇒ Telnyx::Resources::Dir::PhoneNumberBatches
readonly
Phone numbers are submitted to Telnyx for vetting in batches.
-
#phone_numbers ⇒ Telnyx::Resources::Dir::PhoneNumbers
readonly
Associate phone numbers with a verified DIR so calls from those numbers carry the DIR's display identity.
-
#references ⇒ Telnyx::Resources::Dir::References
readonly
Submit and manage the two business references and one financial reference that vouch for a DIR.
-
#verify_email ⇒ Telnyx::Resources::Dir::VerifyEmail
readonly
Verify ownership of a DIR's authorizer email.
Instance Method Summary collapse
-
#delete(dir_id, request_options: {}) ⇒ nil
Delete a DIR.
-
#initialize(client:) ⇒ Dir
constructor
private
A new instance of Dir.
-
#list(filter_call_reason_contains: nil, filter_display_name_contains: nil, filter_enterprise_id: nil, filter_expiring_at_gte: nil, filter_expiring_at_lte: nil, filter_status: nil, page_number: nil, page_size: nil, sort: nil, request_options: {}) ⇒ Telnyx::Internal::DefaultFlatPagination<Telnyx::Models::DirAPI>
Some parameter documentations has been truncated, see Models::DirListParams for more details.
-
#list_document_types(request_options: {}) ⇒ Telnyx::Models::DirListDocumentTypesResponse
Reference list of
document_typevalues accepted byDirCreateRequest.documents[].document_typeand the infringement-contest endpoint. -
#list_infringement_claims(dir_id, page_number: nil, page_size: nil, request_options: {}) ⇒ Telnyx::Internal::DefaultFlatPagination<Telnyx::Models::InfringementClaim>
Some parameter documentations has been truncated, see Models::DirListInfringementClaimsParams for more details.
-
#new_loa(dir_id, phone_numbers:, agent: nil, signature: nil, request_options: {}) ⇒ StringIO
Some parameter documentations has been truncated, see Models::DirNewLoaParams for more details.
-
#retrieve(dir_id, request_options: {}) ⇒ Telnyx::Models::DirWrapped
Returns a single DIR by id.
-
#submit(dir_id, request_options: {}) ⇒ Telnyx::Models::DirWrapped
Submit a DIR for vetting.
-
#update(dir_id, authorizer_email: nil, authorizer_name: nil, call_reasons: nil, certify_brand_is_accurate: nil, certify_ip_ownership: nil, certify_no_shaft_content: nil, display_name: nil, documents: nil, logo_url: nil, reselling: nil, request_options: {}) ⇒ Telnyx::Models::DirWrapped
Some parameter documentations has been truncated, see Models::DirUpdateParams for more details.
-
#update_infringement(dir_id, certify_brand_is_accurate:, certify_ip_ownership:, certify_no_infringement:, certify_no_shaft_content:, infringement_resolution_notes:, call_reasons: nil, display_name: nil, documents: nil, logo_url: nil, request_options: {}) ⇒ Telnyx::Models::DirWrapped
Some parameter documentations has been truncated, see Models::DirUpdateInfringementParams for more details.
Constructor Details
#initialize(client:) ⇒ Dir
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 Dir.
363 364 365 366 367 368 369 370 |
# File 'lib/telnyx/resources/dir.rb', line 363 def initialize(client:) @client = client @comments = Telnyx::Resources::Dir::Comments.new(client: client) @phone_number_batches = Telnyx::Resources::Dir::PhoneNumberBatches.new(client: client) @phone_numbers = Telnyx::Resources::Dir::PhoneNumbers.new(client: client) @references = Telnyx::Resources::Dir::References.new(client: client) @verify_email = Telnyx::Resources::Dir::VerifyEmail.new(client: client) end |
Instance Attribute Details
#comments ⇒ Telnyx::Resources::Dir::Comments (readonly)
Read messages from the Telnyx vetting team and reply with clarifying information.
9 10 11 |
# File 'lib/telnyx/resources/dir.rb', line 9 def comments @comments end |
#phone_number_batches ⇒ Telnyx::Resources::Dir::PhoneNumberBatches (readonly)
Phone numbers are submitted to Telnyx for vetting in batches. Batches group all numbers added in a single request under the same Letter of Authorization.
14 15 16 |
# File 'lib/telnyx/resources/dir.rb', line 14 def phone_number_batches @phone_number_batches end |
#phone_numbers ⇒ Telnyx::Resources::Dir::PhoneNumbers (readonly)
Associate phone numbers with a verified DIR so calls from those numbers carry the DIR's display identity.
19 20 21 |
# File 'lib/telnyx/resources/dir.rb', line 19 def phone_numbers @phone_numbers end |
#references ⇒ Telnyx::Resources::Dir::References (readonly)
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.
25 26 27 |
# File 'lib/telnyx/resources/dir.rb', line 25 def references @references end |
#verify_email ⇒ Telnyx::Resources::Dir::VerifyEmail (readonly)
Verify ownership of a DIR's authorizer email. A short code is emailed and confirmed; the email must be verified before references can be submitted.
30 31 32 |
# File 'lib/telnyx/resources/dir.rb', line 30 def verify_email @verify_email end |
Instance Method Details
#delete(dir_id, request_options: {}) ⇒ nil
Delete a DIR. Failure modes: 400 if a child phone number is in a non-deletable
status, 409 if the DIR has an unresolved infringement claim, 404 if the DIR
is not yours.
178 179 180 181 182 183 184 185 |
# File 'lib/telnyx/resources/dir.rb', line 178 def delete(dir_id, params = {}) @client.request( method: :delete, path: ["dir/%1$s", dir_id], model: NilClass, options: params[:request_options] ) end |
#list(filter_call_reason_contains: nil, filter_display_name_contains: nil, filter_enterprise_id: nil, filter_expiring_at_gte: nil, filter_expiring_at_lte: nil, filter_status: nil, page_number: nil, page_size: nil, sort: nil, request_options: {}) ⇒ Telnyx::Internal::DefaultFlatPagination<Telnyx::Models::DirAPI>
Some parameter documentations has been truncated, see Models::DirListParams for more details.
Returns every DIR (Display Identity Record) you own, across all of your
enterprises, as a single list. Pagination is JSON:API style (page[number],
page[size], max 250). Supports filter[] query params:
filter[enterprise_id], filter[status], filter[display_name][contains],
filter[call_reason][contains], plus the renewal-window filters
filter[expiring_at][gte] / filter[expiring_at][lte]. Sortable by
created_at, updated_at, display_name, status (prefix - for descending;
default -created_at).
143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 |
# File 'lib/telnyx/resources/dir.rb', line 143 def list(params = {}) parsed, = Telnyx::DirListParams.dump_request(params) query = Telnyx::Internal::Util.encode_query_params(parsed) @client.request( method: :get, path: "dir", query: query.transform_keys( filter_call_reason_contains: "filter[call_reason][contains]", filter_display_name_contains: "filter[display_name][contains]", filter_enterprise_id: "filter[enterprise_id]", filter_expiring_at_gte: "filter[expiring_at][gte]", filter_expiring_at_lte: "filter[expiring_at][lte]", filter_status: "filter[status]", page_number: "page[number]", page_size: "page[size]" ), page: Telnyx::Internal::DefaultFlatPagination, model: Telnyx::DirAPI, options: ) end |
#list_document_types(request_options: {}) ⇒ Telnyx::Models::DirListDocumentTypesResponse
Reference list of document_type values accepted by
DirCreateRequest.documents[].document_type and the infringement-contest
endpoint. Each entry has a stable short_name (used in API calls) and a
customer-facing description.
199 200 201 202 203 204 205 206 |
# File 'lib/telnyx/resources/dir.rb', line 199 def list_document_types(params = {}) @client.request( method: :get, path: "dir/document_types", model: Telnyx::Models::DirListDocumentTypesResponse, options: params[:request_options] ) end |
#list_infringement_claims(dir_id, page_number: nil, page_size: nil, request_options: {}) ⇒ Telnyx::Internal::DefaultFlatPagination<Telnyx::Models::InfringementClaim>
Some parameter documentations has been truncated, see Models::DirListInfringementClaimsParams for more details.
Return the trademark or copyright claims filed against this DIR. Each claim's
status is pending (newly filed; DIR auto-suspended), contested (you have
submitted contest evidence; awaiting resolution), or resolved (final).
Resolution outcomes: upheld (claim accepted; DIR stays
suspended/permanently_rejected), rejected (claim dismissed; DIR restored to
verified), modified (partial outcome).
231 232 233 234 235 236 237 238 239 240 241 242 |
# File 'lib/telnyx/resources/dir.rb', line 231 def list_infringement_claims(dir_id, params = {}) parsed, = Telnyx::DirListInfringementClaimsParams.dump_request(params) query = Telnyx::Internal::Util.encode_query_params(parsed) @client.request( method: :get, path: ["dir/%1$s/infringement_claims", dir_id], query: query.transform_keys(page_number: "page[number]", page_size: "page[size]"), page: Telnyx::Internal::DefaultFlatPagination, model: Telnyx::InfringementClaim, options: ) end |
#new_loa(dir_id, phone_numbers:, agent: nil, signature: nil, request_options: {}) ⇒ StringIO
Some parameter documentations has been truncated, see Models::DirNewLoaParams for more details.
Generate a pre-filled Letter of Authorization (LOA) PDF for a DIR. Enterprise identity (legal name, DBA, address, contact, website, tax id) and the DIR display name are read server-side; the caller supplies the telephone numbers to authorize, an optional Authorized Agent block, and an optional drawn signature.
When signature is omitted the PDF is returned unsigned so the customer can
sign it externally and upload it via the Documents API. When signature is
present the PDF embeds the supplied image, printed name, and signed-at date.
Returns application/pdf.
273 274 275 276 277 278 279 280 281 282 283 |
# File 'lib/telnyx/resources/dir.rb', line 273 def new_loa(dir_id, params) parsed, = Telnyx::DirNewLoaParams.dump_request(params) @client.request( method: :post, path: ["dir/%1$s/loa", dir_id], headers: {"accept" => "application/pdf"}, body: parsed, model: StringIO, options: ) end |
#retrieve(dir_id, request_options: {}) ⇒ Telnyx::Models::DirWrapped
Returns a single DIR by id. The enterprise is resolved server-side from the DIR
id. Returns 404 if the DIR does not exist or is not yours.
44 45 46 47 48 49 50 51 |
# File 'lib/telnyx/resources/dir.rb', line 44 def retrieve(dir_id, params = {}) @client.request( method: :get, path: ["dir/%1$s", dir_id], model: Telnyx::DirWrapped, options: params[:request_options] ) end |
#submit(dir_id, request_options: {}) ⇒ Telnyx::Models::DirWrapped
Submit a DIR for vetting. Sends the DIR back through the vetting cycle from any
non-terminal status. When re-submitting from suspended or expired, the DIR's
previous Branded Calling registration is torn down transactionally and its phone
numbers flip back to submitted. When re-submitting from verified, the
existing registration stays live throughout the new vetting cycle.
Returns 400 from submitted/in_review/permanently_rejected. Returns 409
if the DIR has an unresolved infringement claim.
303 304 305 306 307 308 309 310 |
# File 'lib/telnyx/resources/dir.rb', line 303 def submit(dir_id, params = {}) @client.request( method: :post, path: ["dir/%1$s/submit", dir_id], model: Telnyx::DirWrapped, options: params[:request_options] ) end |
#update(dir_id, authorizer_email: nil, authorizer_name: nil, call_reasons: nil, certify_brand_is_accurate: nil, certify_ip_ownership: nil, certify_no_shaft_content: nil, display_name: nil, documents: nil, logo_url: nil, reselling: nil, request_options: {}) ⇒ Telnyx::Models::DirWrapped
Some parameter documentations has been truncated, see Models::DirUpdateParams for more details.
Edit a DIR. DIRs in draft, rejected, unsuccessful, or suspended can be
edited freely: PATCH is a pure edit, status is never changed, and you re-vet
by calling POST /v2/dir/{dir_id}/submit explicitly. A verified DIR can also
be edited in place: a PATCH that changes any value returns the DIR to draft
and branded delivery stops until you re-submit and the DIR is approved again,
while a PATCH that changes nothing (an empty body or values identical to the
current ones) leaves the DIR verified, so idempotent retries are safe. DIRs in
any other status (submitted, in_review, expired, infringement_claimed,
permanently_rejected) cannot be edited.
95 96 97 98 99 100 101 102 103 104 |
# File 'lib/telnyx/resources/dir.rb', line 95 def update(dir_id, params = {}) parsed, = Telnyx::DirUpdateParams.dump_request(params) @client.request( method: :patch, path: ["dir/%1$s", dir_id], body: parsed, model: Telnyx::DirWrapped, options: ) end |
#update_infringement(dir_id, certify_brand_is_accurate:, certify_ip_ownership:, certify_no_infringement:, certify_no_shaft_content:, infringement_resolution_notes:, call_reasons: nil, display_name: nil, documents: nil, logo_url: nil, request_options: {}) ⇒ Telnyx::Models::DirWrapped
Some parameter documentations has been truncated, see Models::DirUpdateInfringementParams for more details.
Push a fix for a DIR that is suspended with an open infringement claim back
into vetting. POST /dir/{dir_id}/submit is blocked while a claim is open, so
this is the customer-callable path to update the DIR's content and re-certify
before Telnyx adjudicates the claim. All four certification booleans must be
true. Optional content fields (display_name, logo_url, call_reasons,
documents) update the DIR; documents are append-only.
349 350 351 352 353 354 355 356 357 358 |
# File 'lib/telnyx/resources/dir.rb', line 349 def update_infringement(dir_id, params) parsed, = Telnyx::DirUpdateInfringementParams.dump_request(params) @client.request( method: :put, path: ["dir/%1$s/infringement_update", dir_id], body: parsed, model: Telnyx::DirWrapped, options: ) end |