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/phone_numbers.rb,
lib/telnyx/resources/dir/phone_number_batches.rb
Defined Under Namespace
Classes: Comments, PhoneNumberBatches, PhoneNumbers
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.
Instance Method Summary collapse
-
#create_loa(dir_id, phone_numbers:, agent: nil, signature: nil, request_options: {}) ⇒ StringIO
Some parameter documentations has been truncated, see Models::DirCreateLoaParams for more details.
-
#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::DirListResponse>
Some parameter documentations has been truncated, see Models::DirListParams for more details.
-
#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.
-
#list_infringement_claims(dir_id, page_number: nil, page_size: nil, request_options: {}) ⇒ Telnyx::Internal::DefaultFlatPagination<Telnyx::Models::DirListInfringementClaimsResponse>
Some parameter documentations has been truncated, see Models::DirListInfringementClaimsParams for more details.
-
#retrieve(dir_id, request_options: {}) ⇒ Telnyx::Models::DirRetrieveResponse
Returns a single DIR by id.
-
#submit(dir_id, request_options: {}) ⇒ Telnyx::Models::DirSubmitResponse
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::DirUpdateResponse
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::DirUpdateInfringementResponse
Push a fix for a DIR that is ‘suspended` with an open infringement claim back into vetting.
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.
349 350 351 352 353 354 |
# File 'lib/telnyx/resources/dir.rb', line 349 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) 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 |
Instance Method Details
#create_loa(dir_id, phone_numbers:, agent: nil, signature: nil, request_options: {}) ⇒ StringIO
Some parameter documentations has been truncated, see Models::DirCreateLoaParams 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`.
205 206 207 208 209 210 211 212 213 214 215 |
# File 'lib/telnyx/resources/dir.rb', line 205 def create_loa(dir_id, params) parsed, = Telnyx::DirCreateLoaParams.dump_request(params) @client.request( method: :post, path: ["dir/%1$s/loa", dir_id], headers: {"accept" => "application/pdf"}, body: parsed, model: StringIO, options: ) end |
#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.
167 168 169 170 171 172 173 174 |
# File 'lib/telnyx/resources/dir.rb', line 167 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::DirListResponse>
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`, `page`, max 250). Supports `filter[]` query params: `filter`, `filter`, `filter[contains]`, `filter[contains]`, plus the renewal-window filters `filter[gte]` / `filter[lte]`. Sortable by `created_at`, `updated_at`, `display_name`, `status` (prefix `-` for descending; default `-created_at`).
132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 |
# File 'lib/telnyx/resources/dir.rb', line 132 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::Models::DirListResponse, 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.
229 230 231 232 233 234 235 236 |
# File 'lib/telnyx/resources/dir.rb', line 229 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::DirListInfringementClaimsResponse>
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).
261 262 263 264 265 266 267 268 269 270 271 272 |
# File 'lib/telnyx/resources/dir.rb', line 261 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::Models::DirListInfringementClaimsResponse, options: ) end |
#retrieve(dir_id, request_options: {}) ⇒ Telnyx::Models::DirRetrieveResponse
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.
33 34 35 36 37 38 39 40 |
# File 'lib/telnyx/resources/dir.rb', line 33 def retrieve(dir_id, params = {}) @client.request( method: :get, path: ["dir/%1$s", dir_id], model: Telnyx::Models::DirRetrieveResponse, options: params[:request_options] ) end |
#submit(dir_id, request_options: {}) ⇒ Telnyx::Models::DirSubmitResponse
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.
292 293 294 295 296 297 298 299 |
# File 'lib/telnyx/resources/dir.rb', line 292 def submit(dir_id, params = {}) @client.request( method: :post, path: ["dir/%1$s/submit", dir_id], model: Telnyx::Models::DirSubmitResponse, 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::DirUpdateResponse
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.
84 85 86 87 88 89 90 91 92 93 |
# File 'lib/telnyx/resources/dir.rb', line 84 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::Models::DirUpdateResponse, 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::DirUpdateInfringementResponse
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.
335 336 337 338 339 340 341 342 343 344 |
# File 'lib/telnyx/resources/dir.rb', line 335 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::Models::DirUpdateInfringementResponse, options: ) end |