Class: Telnyx::Resources::Enterprises

Inherits:
Object
  • Object
show all
Defined in:
lib/telnyx/resources/enterprises.rb,
lib/telnyx/resources/enterprises/reputation.rb,
lib/telnyx/resources/enterprises/reputation/numbers.rb

Overview

Enterprise management for Branded Calling and Number Reputation services

Defined Under Namespace

Classes: Reputation

Instance Attribute Summary collapse

Instance Method Summary collapse

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.

Parameters:



211
212
213
214
# File 'lib/telnyx/resources/enterprises.rb', line 211

def initialize(client:)
  @client = client
  @reputation = Telnyx::Resources::Enterprises::Reputation.new(client: client)
end

Instance Attribute Details

#reputationTelnyx::Resources::Enterprises::Reputation (readonly)

Manage Number Reputation enrollment and check frequency settings for an enterprise



10
11
12
# File 'lib/telnyx/resources/enterprises.rb', line 10

def reputation
  @reputation
end

Instance Method Details

#create(billing_address:, billing_contact:, country_code:, doing_business_as:, fein:, industry:, 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::EnterpriseCreateResponse

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

Create a new enterprise for Branded Calling / Number Reputation services.

Registers the enterprise in the Branded Calling / Number Reputation services, enabling it to create Display Identity Records (DIRs) or enroll in Number Reputation monitoring.

**Required Fields:** ‘legal_name`, `doing_business_as`, `organization_type`, `country_code`, `website`, `fein`, `industry`, `number_of_employees`, `organization_legal_type`, `organization_contact`, `billing_contact`, `organization_physical_address`, `billing_address`

Parameters:

Returns:

See Also:



71
72
73
74
75
76
77
78
79
80
# File 'lib/telnyx/resources/enterprises.rb', line 71

def create(params)
  parsed, options = Telnyx::EnterpriseCreateParams.dump_request(params)
  @client.request(
    method: :post,
    path: "enterprises",
    body: parsed,
    model: Telnyx::Models::EnterpriseCreateResponse,
    options: options
  )
end

#delete(enterprise_id, request_options: {}) ⇒ nil

Delete an enterprise and all associated resources. This action is irreversible.

Parameters:

  • enterprise_id (String)

    Unique identifier of the enterprise (UUID)

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

Returns:

  • (nil)

See Also:



199
200
201
202
203
204
205
206
# File 'lib/telnyx/resources/enterprises.rb', line 199

def delete(enterprise_id, params = {})
  @client.request(
    method: :delete,
    path: ["enterprises/%1$s", enterprise_id],
    model: NilClass,
    options: params[:request_options]
  )
end

#list(legal_name: nil, page_number: nil, page_size: nil, request_options: {}) ⇒ Telnyx::Internal::DefaultFlatPagination<Telnyx::Models::EnterprisePublic>

Retrieve a paginated list of enterprises associated with your account.

Parameters:

  • legal_name (String)

    Filter by legal name (partial match)

  • page_number (Integer)

    Page number (1-indexed)

  • page_size (Integer)

    Number of items per page

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

Returns:

See Also:



175
176
177
178
179
180
181
182
183
184
185
186
# File 'lib/telnyx/resources/enterprises.rb', line 175

def list(params = {})
  parsed, options = Telnyx::EnterpriseListParams.dump_request(params)
  query = Telnyx::Internal::Util.encode_query_params(parsed)
  @client.request(
    method: :get,
    path: "enterprises",
    query: query.transform_keys(page_number: "page[number]", page_size: "page[size]"),
    page: Telnyx::Internal::DefaultFlatPagination,
    model: Telnyx::EnterprisePublic,
    options: options
  )
end

#retrieve(enterprise_id, request_options: {}) ⇒ Telnyx::Models::EnterpriseRetrieveResponse

Retrieve details of a specific enterprise by ID.

Parameters:

  • enterprise_id (String)

    Unique identifier of the enterprise (UUID)

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

Returns:

See Also:



93
94
95
96
97
98
99
100
# File 'lib/telnyx/resources/enterprises.rb', line 93

def retrieve(enterprise_id, params = {})
  @client.request(
    method: :get,
    path: ["enterprises/%1$s", enterprise_id],
    model: Telnyx::Models::EnterpriseRetrieveResponse,
    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, 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::EnterpriseUpdateResponse

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

Update enterprise information. All fields are optional — only the provided fields will be updated.

Parameters:

Returns:

See Also:



149
150
151
152
153
154
155
156
157
158
# File 'lib/telnyx/resources/enterprises.rb', line 149

def update(enterprise_id, params = {})
  parsed, options = Telnyx::EnterpriseUpdateParams.dump_request(params)
  @client.request(
    method: :put,
    path: ["enterprises/%1$s", enterprise_id],
    body: parsed,
    model: Telnyx::Models::EnterpriseUpdateResponse,
    options: options
  )
end