Class: Telnyx::Resources::Porting::LoaConfigurations

Inherits:
Object
  • Object
show all
Defined in:
lib/telnyx/resources/porting/loa_configurations.rb,
sig/telnyx/resources/porting/loa_configurations.rbs

Overview

Endpoints related to porting orders management.

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ LoaConfigurations

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

Parameters:



229
230
231
# File 'lib/telnyx/resources/porting/loa_configurations.rb', line 229

def initialize(client:)
  @client = client
end

Instance Method Details

#create(address:, company_name:, contact:, logo:, name:, request_options: {}) ⇒ Telnyx::Models::Porting::LoaConfigurationCreateResponse

Creates a new LOA configuration with your company details and branding for use when generating LOA documents for porting orders.

Parameters:

Returns:

See Also:



28
29
30
31
32
33
34
35
36
37
# File 'lib/telnyx/resources/porting/loa_configurations.rb', line 28

def create(params)
  parsed, options = Telnyx::Porting::LoaConfigurationCreateParams.dump_request(params)
  @client.request(
    method: :post,
    path: "porting/loa_configurations",
    body: parsed,
    model: Telnyx::Models::Porting::LoaConfigurationCreateResponse,
    options: options
  )
end

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

Permanently deletes the specified LOA configuration so it can no longer be used when generating LOA documents.

Parameters:

  • id (String)

    Identifies a LOA configuration.

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

Returns:

  • (nil)

See Also:



131
132
133
134
135
136
137
138
# File 'lib/telnyx/resources/porting/loa_configurations.rb', line 131

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

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

Returns a paginated list of your LOA (Letter of Authorization) configurations. LOA configurations customize the company details and branding used on generated LOA documents.

Parameters:

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

Returns:

See Also:



106
107
108
109
110
111
112
113
114
115
116
117
# File 'lib/telnyx/resources/porting/loa_configurations.rb', line 106

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

#preview(address:, company_name:, contact:, logo:, name:, request_options: {}) ⇒ StringIO

Preview the LOA template that would be generated without need to create LOA configuration.

Parameters:

Returns:

  • (StringIO)

See Also:



160
161
162
163
164
165
166
167
168
169
170
# File 'lib/telnyx/resources/porting/loa_configurations.rb', line 160

def preview(params)
  parsed, options = Telnyx::Porting::LoaConfigurationPreviewParams.dump_request(params)
  @client.request(
    method: :post,
    path: "porting/loa_configurations/preview",
    headers: {"accept" => "application/pdf"},
    body: parsed,
    model: StringIO,
    options: options
  )
end

#preview_0(address:, company_name:, contact:, logo:, name:, request_options: {}) ⇒ StringIO

Preview the LOA template that would be generated without need to create LOA configuration.

Parameters:

Returns:

  • (StringIO)

See Also:



192
193
194
195
196
197
198
199
200
201
202
# File 'lib/telnyx/resources/porting/loa_configurations.rb', line 192

def preview_0(params)
  parsed, options = Telnyx::Porting::LoaConfigurationPreview0Params.dump_request(params)
  @client.request(
    method: :post,
    path: "porting/loa_configurations/preview",
    headers: {"accept" => "application/pdf"},
    body: parsed,
    model: StringIO,
    options: options
  )
end

#preview_1(id, request_options: {}) ⇒ StringIO

Renders a preview of the LOA document produced by this configuration so you can verify company details and branding before using it on porting orders.

Parameters:

  • id (String)

    Identifies a LOA configuration.

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

Returns:

  • (StringIO)

See Also:



216
217
218
219
220
221
222
223
224
# File 'lib/telnyx/resources/porting/loa_configurations.rb', line 216

def preview_1(id, params = {})
  @client.request(
    method: :get,
    path: ["porting/loa_configurations/%1$s/preview", id],
    headers: {"accept" => "application/pdf"},
    model: StringIO,
    options: params[:request_options]
  )
end

#retrieve(id, request_options: {}) ⇒ Telnyx::Models::Porting::LoaConfigurationRetrieveResponse

Returns the details of a single LOA (Letter of Authorization) configuration by its identifier.

Parameters:

  • id (String)

    Identifies a LOA configuration.

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

Returns:

See Also:



51
52
53
54
55
56
57
58
# File 'lib/telnyx/resources/porting/loa_configurations.rb', line 51

def retrieve(id, params = {})
  @client.request(
    method: :get,
    path: ["porting/loa_configurations/%1$s", id],
    model: Telnyx::Models::Porting::LoaConfigurationRetrieveResponse,
    options: params[:request_options]
  )
end

#update(id, address:, company_name:, contact:, logo:, name:, request_options: {}) ⇒ Telnyx::Models::Porting::LoaConfigurationUpdateResponse

Updates the specified LOA configuration with the provided fields and returns the updated configuration.

Parameters:

Returns:

See Also:



82
83
84
85
86
87
88
89
90
91
# File 'lib/telnyx/resources/porting/loa_configurations.rb', line 82

def update(id, params)
  parsed, options = Telnyx::Porting::LoaConfigurationUpdateParams.dump_request(params)
  @client.request(
    method: :patch,
    path: ["porting/loa_configurations/%1$s", id],
    body: parsed,
    model: Telnyx::Models::Porting::LoaConfigurationUpdateResponse,
    options: options
  )
end