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

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

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:



222
223
224
# File 'lib/telnyx/resources/porting/loa_configurations.rb', line 222

def initialize(client:)
  @client = client
end

Instance Method Details

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

Create a LOA configuration.

Parameters:

Returns:

See Also:



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

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

Delete a specific LOA configuration.

Parameters:

  • id (String)

    Identifies a LOA configuration.

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

Returns:

  • (nil)

See Also:



125
126
127
128
129
130
131
132
# File 'lib/telnyx/resources/porting/loa_configurations.rb', line 125

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>

List the LOA configurations.

Parameters:

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

Returns:

See Also:



101
102
103
104
105
106
107
108
109
110
111
112
# File 'lib/telnyx/resources/porting/loa_configurations.rb', line 101

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:



154
155
156
157
158
159
160
161
162
163
164
# File 'lib/telnyx/resources/porting/loa_configurations.rb', line 154

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:



186
187
188
189
190
191
192
193
194
195
196
# File 'lib/telnyx/resources/porting/loa_configurations.rb', line 186

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

Preview a specific LOA configuration.

Parameters:

  • id (String)

    Identifies a LOA configuration.

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

Returns:

  • (StringIO)

See Also:



209
210
211
212
213
214
215
216
217
# File 'lib/telnyx/resources/porting/loa_configurations.rb', line 209

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

Retrieve a specific LOA configuration.

Parameters:

  • id (String)

    Identifies a LOA configuration.

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

Returns:

See Also:



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

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

Update a specific LOA configuration.

Parameters:

Returns:

See Also:



79
80
81
82
83
84
85
86
87
88
# File 'lib/telnyx/resources/porting/loa_configurations.rb', line 79

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