Class: Telnyx::Resources::Porting::LoaConfigurations
- Inherits:
-
Object
- Object
- Telnyx::Resources::Porting::LoaConfigurations
- Defined in:
- lib/telnyx/resources/porting/loa_configurations.rb
Instance Method Summary collapse
-
#create(address:, company_name:, contact:, logo:, name:, request_options: {}) ⇒ Telnyx::Models::Porting::LoaConfigurationCreateResponse
Create a LOA configuration.
-
#delete(id, request_options: {}) ⇒ nil
Delete a specific LOA configuration.
-
#initialize(client:) ⇒ LoaConfigurations
constructor
private
A new instance of LoaConfigurations.
-
#list(page_number: nil, page_size: nil, request_options: {}) ⇒ Telnyx::Internal::DefaultFlatPagination<Telnyx::Models::Porting::PortingLoaConfiguration>
List the LOA configurations.
-
#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.
-
#preview_1(id, request_options: {}) ⇒ StringIO
Preview a specific LOA configuration.
-
#retrieve(id, request_options: {}) ⇒ Telnyx::Models::Porting::LoaConfigurationRetrieveResponse
Retrieve a specific LOA configuration.
-
#update(id, address:, company_name:, contact:, logo:, name:, request_options: {}) ⇒ Telnyx::Models::Porting::LoaConfigurationUpdateResponse
Update a specific LOA configuration.
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.
188 189 190 |
# File 'lib/telnyx/resources/porting/loa_configurations.rb', line 188 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.
26 27 28 29 30 31 32 33 34 35 |
# File 'lib/telnyx/resources/porting/loa_configurations.rb', line 26 def create(params) parsed, = Telnyx::Porting::LoaConfigurationCreateParams.dump_request(params) @client.request( method: :post, path: "porting/loa_configurations", body: parsed, model: Telnyx::Models::Porting::LoaConfigurationCreateResponse, options: ) end |
#delete(id, request_options: {}) ⇒ nil
Delete a specific LOA configuration.
123 124 125 126 127 128 129 130 |
# File 'lib/telnyx/resources/porting/loa_configurations.rb', line 123 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.
100 101 102 103 104 105 106 107 108 109 110 |
# File 'lib/telnyx/resources/porting/loa_configurations.rb', line 100 def list(params = {}) parsed, = Telnyx::Porting::LoaConfigurationListParams.dump_request(params) @client.request( method: :get, path: "porting/loa_configurations", query: parsed.transform_keys(page_number: "page[number]", page_size: "page[size]"), page: Telnyx::Internal::DefaultFlatPagination, model: Telnyx::Porting::PortingLoaConfiguration, 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.
152 153 154 155 156 157 158 159 160 161 162 |
# File 'lib/telnyx/resources/porting/loa_configurations.rb', line 152 def preview_0(params) parsed, = Telnyx::Porting::LoaConfigurationPreview0Params.dump_request(params) @client.request( method: :post, path: "porting/loa_configuration/preview", headers: {"accept" => "application/pdf"}, body: parsed, model: StringIO, options: ) end |
#preview_1(id, request_options: {}) ⇒ StringIO
Preview a specific LOA configuration.
175 176 177 178 179 180 181 182 183 |
# File 'lib/telnyx/resources/porting/loa_configurations.rb', line 175 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.
48 49 50 51 52 53 54 55 |
# File 'lib/telnyx/resources/porting/loa_configurations.rb', line 48 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.
78 79 80 81 82 83 84 85 86 87 |
# File 'lib/telnyx/resources/porting/loa_configurations.rb', line 78 def update(id, params) parsed, = 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: ) end |