Class: Telnyx::Resources::Enterprises
- Inherits:
-
Object
- Object
- Telnyx::Resources::Enterprises
- Defined in:
- lib/telnyx/resources/enterprises.rb,
lib/telnyx/resources/enterprises/dir.rb,
lib/telnyx/resources/enterprises/reputation.rb,
lib/telnyx/resources/enterprises/reputation/loa.rb,
lib/telnyx/resources/enterprises/reputation/numbers.rb,
lib/telnyx/resources/enterprises/reputation/remediation.rb,
sig/telnyx/resources/enterprises.rbs,
sig/telnyx/resources/enterprises/dir.rbs,
sig/telnyx/resources/enterprises/reputation.rbs,
sig/telnyx/resources/enterprises/reputation/loa.rbs,
sig/telnyx/resources/enterprises/reputation/numbers.rbs,
sig/telnyx/resources/enterprises/reputation/remediation.rbs
Overview
Manage the legal-entity record that owns your DIRs and phone numbers.
Defined Under Namespace
Classes: Dir, Reputation
Instance Attribute Summary collapse
-
#dir ⇒ Telnyx::Resources::Enterprises::Dir
readonly
A Display Identity Record (DIR) is the verified calling identity (display name, logo, call reasons) shown to recipients on outbound calls.
-
#reputation ⇒ Telnyx::Resources::Enterprises::Reputation
readonly
Phone-number reputation monitoring (spam-score lookup and tracking).
Instance Method Summary collapse
-
#branded_calling(enterprise_id, request_options: {}) ⇒ Telnyx::Models::EnterprisePublicWrapped
Branded Calling is a paid product that must be activated on each enterprise.
-
#create(billing_address:, billing_contact:, country_code:, doing_business_as:, fein:, industry:, jurisdiction_of_incorporation:, legal_name:, number_of_employees:, organization_contact:, organization_legal_type:, organization_physical_address:, organization_type:, website:, corporate_registration_number: nil, customer_reference: nil, dun_bradstreet_number: nil, primary_business_domain_sic_code: nil, professional_license_number: nil, role_type: nil, request_options: {}) ⇒ Telnyx::Models::EnterprisePublicWrapped
Some parameter documentations has been truncated, see Models::EnterpriseCreateParams for more details.
-
#delete(enterprise_id, request_options: {}) ⇒ nil
Soft-delete an enterprise.
-
#initialize(client:) ⇒ Enterprises
constructor
private
A new instance of Enterprises.
-
#list(filter_legal_name_contains: nil, legal_name: nil, page_number: nil, page_size: nil, request_options: {}) ⇒ Telnyx::Internal::DefaultFlatPagination<Telnyx::Models::EnterprisePublic>
Some parameter documentations has been truncated, see Models::EnterpriseListParams for more details.
-
#retrieve(enterprise_id, request_options: {}) ⇒ Telnyx::Models::EnterprisePublicWrapped
Retrieve a single enterprise by id.
-
#update(enterprise_id, billing_address: nil, billing_contact: nil, corporate_registration_number: nil, customer_reference: nil, doing_business_as: nil, dun_bradstreet_number: nil, fein: nil, industry: nil, jurisdiction_of_incorporation: nil, legal_name: nil, number_of_employees: nil, organization_contact: nil, organization_legal_type: nil, organization_physical_address: nil, primary_business_domain_sic_code: nil, professional_license_number: nil, website: nil, request_options: {}) ⇒ Telnyx::Models::EnterprisePublicWrapped
Replace the enterprise's mutable fields.
Constructor Details
#initialize(client:) ⇒ Enterprises
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 Enterprises.
281 282 283 284 285 |
# File 'lib/telnyx/resources/enterprises.rb', line 281 def initialize(client:) @client = client @reputation = Telnyx::Resources::Enterprises::Reputation.new(client: client) @dir = Telnyx::Resources::Enterprises::Dir.new(client: client) end |
Instance Attribute Details
#dir ⇒ Telnyx::Resources::Enterprises::Dir (readonly)
A Display Identity Record (DIR) is the verified calling identity (display name, logo, call reasons) shown to recipients on outbound calls.
14 15 16 |
# File 'lib/telnyx/resources/enterprises.rb', line 14 def dir @dir end |
#reputation ⇒ Telnyx::Resources::Enterprises::Reputation (readonly)
Phone-number reputation monitoring (spam-score lookup and tracking).
9 10 11 |
# File 'lib/telnyx/resources/enterprises.rb', line 9 def reputation @reputation end |
Instance Method Details
#branded_calling(enterprise_id, request_options: {}) ⇒ Telnyx::Models::EnterprisePublicWrapped
Branded Calling is a paid product that must be activated on each enterprise. Activation is idempotent:
- First call: marks the enterprise as activated and begins onboarding it with
the Branded Calling platform asynchronously. Returns
200withbranded_calling_enabled: true. - Re-call after success: no-op, returns the same enterprise body.
- Re-call after a prior failure: re-queues onboarding, returns
200.
Prerequisite: the calling user must have agreed to the Branded Calling Terms of
Service (POST /terms_of_service/branded_calling/agree). Without that, this
endpoint returns 403 terms_of_service_not_accepted.
Failure modes:
403- Branded Calling Terms of Service not accepted.404- enterprise does not exist or does not belong to your account.
Pricing: This is a billable action. See https://telnyx.com/pricing/numbers for current pricing.
269 270 271 272 273 274 275 276 |
# File 'lib/telnyx/resources/enterprises.rb', line 269 def branded_calling(enterprise_id, params = {}) @client.request( method: :post, path: ["enterprises/%1$s/branded_calling", enterprise_id], model: Telnyx::EnterprisePublicWrapped, options: params[:request_options] ) end |
#create(billing_address:, billing_contact:, country_code:, doing_business_as:, fein:, industry:, jurisdiction_of_incorporation:, legal_name:, number_of_employees:, organization_contact:, organization_legal_type:, organization_physical_address:, organization_type:, website:, corporate_registration_number: nil, customer_reference: nil, dun_bradstreet_number: nil, primary_business_domain_sic_code: nil, professional_license_number: nil, role_type: nil, request_options: {}) ⇒ Telnyx::Models::EnterprisePublicWrapped
Some parameter documentations has been truncated, see Models::EnterpriseCreateParams for more details.
Create the legal entity (enterprise) that represents your business on the Telnyx platform.
The response carries a server-assigned id you use for every subsequent call.
An enterprise is created once and reused; the API collects all required fields
up front.
Common failure modes:
422- a required field is missing or malformed (the responseerrors[].source.pointernames the field).409- an enterprise with the same identifying details already exists under your account.
80 81 82 83 84 85 86 87 88 89 |
# File 'lib/telnyx/resources/enterprises.rb', line 80 def create(params) parsed, = Telnyx::EnterpriseCreateParams.dump_request(params) @client.request( method: :post, path: "enterprises", body: parsed, model: Telnyx::EnterprisePublicWrapped, options: ) end |
#delete(enterprise_id, request_options: {}) ⇒ nil
Soft-delete an enterprise.
Failure modes:
400- the enterprise still has dependent resources in a non-deletable state. Remove those first; the responsedetailidentifies what is blocking the delete.409- the enterprise has a dependent resource with an unresolved claim. Resolve it before deleting.404- the enterprise does not exist or does not belong to your account.
230 231 232 233 234 235 236 237 |
# File 'lib/telnyx/resources/enterprises.rb', line 230 def delete(enterprise_id, params = {}) @client.request( method: :delete, path: ["enterprises/%1$s", enterprise_id], model: NilClass, options: params[:request_options] ) end |
#list(filter_legal_name_contains: nil, legal_name: nil, page_number: nil, page_size: nil, request_options: {}) ⇒ Telnyx::Internal::DefaultFlatPagination<Telnyx::Models::EnterprisePublic>
Some parameter documentations has been truncated, see Models::EnterpriseListParams for more details.
Return the enterprises you own, paginated. The default page size is 20; the maximum is 250.
193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 |
# File 'lib/telnyx/resources/enterprises.rb', line 193 def list(params = {}) parsed, = Telnyx::EnterpriseListParams.dump_request(params) query = Telnyx::Internal::Util.encode_query_params(parsed) @client.request( method: :get, path: "enterprises", query: query.transform_keys( filter_legal_name_contains: "filter[legal_name][contains]", page_number: "page[number]", page_size: "page[size]" ), page: Telnyx::Internal::DefaultFlatPagination, model: Telnyx::EnterprisePublic, options: ) end |
#retrieve(enterprise_id, request_options: {}) ⇒ Telnyx::Models::EnterprisePublicWrapped
Retrieve a single enterprise by id. Returns 404 if the id does not exist or
does not belong to your account.
103 104 105 106 107 108 109 110 |
# File 'lib/telnyx/resources/enterprises.rb', line 103 def retrieve(enterprise_id, params = {}) @client.request( method: :get, path: ["enterprises/%1$s", enterprise_id], model: Telnyx::EnterprisePublicWrapped, options: params[:request_options] ) end |
#update(enterprise_id, billing_address: nil, billing_contact: nil, corporate_registration_number: nil, customer_reference: nil, doing_business_as: nil, dun_bradstreet_number: nil, fein: nil, industry: nil, jurisdiction_of_incorporation: nil, legal_name: nil, number_of_employees: nil, organization_contact: nil, organization_legal_type: nil, organization_physical_address: nil, primary_business_domain_sic_code: nil, professional_license_number: nil, website: nil, request_options: {}) ⇒ Telnyx::Models::EnterprisePublicWrapped
Replace the enterprise's mutable fields. Only mutable fields may be sent.
Server-assigned and immutable fields (id, record_type, created_at,
updated_at, status fields, organization_type, country_code, role_type)
cannot be changed: including any of them in the body is rejected with
400 Bad Request (Field 'X' is not allowed in this request).
161 162 163 164 165 166 167 168 169 170 |
# File 'lib/telnyx/resources/enterprises.rb', line 161 def update(enterprise_id, params = {}) parsed, = Telnyx::EnterpriseUpdateParams.dump_request(params) @client.request( method: :put, path: ["enterprises/%1$s", enterprise_id], body: parsed, model: Telnyx::EnterprisePublicWrapped, options: ) end |