Class: Telnyx::Resources::Enterprises::Reputation

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

Overview

Manage Number Reputation enrollment and check frequency settings for an enterprise

Defined Under Namespace

Classes: Numbers

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ Reputation

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 Reputation.

Parameters:



159
160
161
162
# File 'lib/telnyx/resources/enterprises/reputation.rb', line 159

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

Instance Attribute Details

#numbersTelnyx::Resources::Enterprises::Reputation::Numbers (readonly)

Associate phone numbers with an enterprise for reputation monitoring and retrieve reputation scores



12
13
14
# File 'lib/telnyx/resources/enterprises/reputation.rb', line 12

def numbers
  @numbers
end

Instance Method Details

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

Disable Number Reputation for an enterprise.

This will:

  • Delete the reputation settings record

  • Log the deletion for audit purposes

  • Stop all future automated reputation checks

Note: Can only be performed on ‘approved` reputation settings.

Parameters:

  • enterprise_id (String)

    Unique identifier of the enterprise (UUID)

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

Returns:

  • (nil)

See Also:



58
59
60
61
62
63
64
65
# File 'lib/telnyx/resources/enterprises/reputation.rb', line 58

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

#enable(enterprise_id, loa_document_id:, check_frequency: nil, request_options: {}) ⇒ Telnyx::Models::Enterprises::ReputationEnableResponse

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

Enable Number Reputation service for an enterprise.

Requirements:

  • Signed LOA (Letter of Authorization) document ID

  • Reputation check frequency (defaults to ‘business_daily`)

  • Number Reputation Terms of Service must be accepted

Flow:

  1. Registers the enterprise for reputation monitoring

  2. Creates reputation settings with ‘pending` status

  3. Awaits admin approval before monitoring begins

**Resubmission After Rejection:** If a previously rejected record exists, this endpoint will delete it and create a new ‘pending` record.

**Available Frequencies:**

  • ‘business_daily` — Monday–Friday

  • ‘daily` — Every day

  • ‘weekly` — Once per week

  • ‘biweekly` — Once every two weeks

  • ‘monthly` — Once per month

  • ‘never` — Manual refresh only

Parameters:

Returns:

See Also:



109
110
111
112
113
114
115
116
117
118
# File 'lib/telnyx/resources/enterprises/reputation.rb', line 109

def enable(enterprise_id, params)
  parsed, options = Telnyx::Enterprises::ReputationEnableParams.dump_request(params)
  @client.request(
    method: :post,
    path: ["enterprises/%1$s/reputation", enterprise_id],
    body: parsed,
    model: Telnyx::Models::Enterprises::ReputationEnableResponse,
    options: options
  )
end

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

Retrieve the current Number Reputation settings for an enterprise.

Returns the enrollment status (‘pending`, `approved`, `rejected`, `deleted`), check frequency, and any rejection reasons.

Returns ‘404` if reputation has not been enabled for this enterprise.

Parameters:

  • enterprise_id (String)

    Unique identifier of the enterprise (UUID)

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

Returns:

See Also:



30
31
32
33
34
35
36
37
# File 'lib/telnyx/resources/enterprises/reputation.rb', line 30

def retrieve(enterprise_id, params = {})
  @client.request(
    method: :get,
    path: ["enterprises/%1$s/reputation", enterprise_id],
    model: Telnyx::Models::Enterprises::ReputationRetrieveResponse,
    options: params[:request_options]
  )
end

#update_frequency(enterprise_id, check_frequency:, request_options: {}) ⇒ Telnyx::Models::Enterprises::ReputationUpdateFrequencyResponse

Update how often reputation data is automatically refreshed.

Note: The enterprise must have ‘approved` reputation settings. Updating frequency on `pending` or `rejected` settings will return an error.

**Available Frequencies:**

  • ‘business_daily` — Monday–Friday

  • ‘daily` — Every day including weekends

  • ‘weekly` — Once per week

  • ‘biweekly` — Once every two weeks

  • ‘monthly` — Once per month

  • ‘never` — Manual refresh only (no automatic checks)

Parameters:

Returns:

See Also:



145
146
147
148
149
150
151
152
153
154
# File 'lib/telnyx/resources/enterprises/reputation.rb', line 145

def update_frequency(enterprise_id, params)
  parsed, options = Telnyx::Enterprises::ReputationUpdateFrequencyParams.dump_request(params)
  @client.request(
    method: :patch,
    path: ["enterprises/%1$s/reputation/frequency", enterprise_id],
    body: parsed,
    model: Telnyx::Models::Enterprises::ReputationUpdateFrequencyResponse,
    options: options
  )
end