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

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

Overview

Phone-number reputation monitoring (spam-score lookup and tracking).

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ Loa

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

Parameters:



77
78
79
# File 'lib/telnyx/resources/enterprises/reputation/loa.rb', line 77

def initialize(client:)
  @client = client
end

Instance Method Details

#render(enterprise_id, agent: nil, signature: nil, request_options: {}) ⇒ StringIO

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

Render the LOA for this enterprise as a PDF. The enterprise identity, address, and authorized-representative contact are taken from the enterprise record; the optional ‘agent` block is supplied only when a third-party partner manages the numbers. The response is the PDF itself (unsigned unless a `signature` is provided). Sign it and upload it to the Telnyx Documents API (`POST /v2/documents`, see developers.telnyx.com/api/documents) to obtain the `loa_document_id` required by `POST …/reputation`.

Parameters:

Returns:

  • (StringIO)

See Also:



62
63
64
65
66
67
68
69
70
71
72
# File 'lib/telnyx/resources/enterprises/reputation/loa.rb', line 62

def render(enterprise_id, params = {})
  parsed, options = Telnyx::Enterprises::Reputation::LoaRenderParams.dump_request(params)
  @client.request(
    method: :post,
    path: ["enterprises/%1$s/reputation/loa", enterprise_id],
    headers: {"accept" => "application/pdf"},
    body: parsed,
    model: StringIO,
    options: options
  )
end

#update(enterprise_id, loa_document_id:, request_options: {}) ⇒ Telnyx::Models::Enterprises::Reputation::LoaUpdateResponse

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

Point the enterprise’s reputation settings at a new signed LOA document. This resets LOA approval to ‘pending`; the new document must be approved before additional phone numbers can be added.

Parameters:

  • enterprise_id (String)

    The enterprise id. Lowercase UUID.

  • loa_document_id (String)

    Id of the new signed LOA document (from the Telnyx Documents API). Changing it r

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

Returns:

See Also:



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

def update(enterprise_id, params)
  parsed, options = Telnyx::Enterprises::Reputation::LoaUpdateParams.dump_request(params)
  @client.request(
    method: :patch,
    path: ["enterprises/%1$s/reputation/loa", enterprise_id],
    body: parsed,
    model: Telnyx::Models::Enterprises::Reputation::LoaUpdateResponse,
    options: options
  )
end