Class: Telnyx::Resources::GlobalIPs
- Inherits:
-
Object
- Object
- Telnyx::Resources::GlobalIPs
- Defined in:
- lib/telnyx/resources/global_ips.rb
Overview
Global IPs
Instance Method Summary collapse
-
#create(description: nil, name: nil, ports: nil, request_options: {}) ⇒ Telnyx::Models::GlobalIPCreateResponse
Create a Global IP.
-
#delete(id, request_options: {}) ⇒ Telnyx::Models::GlobalIPDeleteResponse
Delete a Global IP.
-
#initialize(client:) ⇒ GlobalIPs
constructor
private
A new instance of GlobalIPs.
-
#list(page_number: nil, page_size: nil, request_options: {}) ⇒ Telnyx::Internal::DefaultFlatPagination<Telnyx::Models::GlobalIPListResponse>
List all Global IPs.
-
#retrieve(id, request_options: {}) ⇒ Telnyx::Models::GlobalIPRetrieveResponse
Retrieve a Global IP.
Constructor Details
#initialize(client:) ⇒ GlobalIPs
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 GlobalIPs.
100 101 102 |
# File 'lib/telnyx/resources/global_ips.rb', line 100 def initialize(client:) @client = client end |
Instance Method Details
#create(description: nil, name: nil, ports: nil, request_options: {}) ⇒ Telnyx::Models::GlobalIPCreateResponse
Create a Global IP.
22 23 24 25 26 27 28 29 30 31 |
# File 'lib/telnyx/resources/global_ips.rb', line 22 def create(params = {}) parsed, = Telnyx::GlobalIPCreateParams.dump_request(params) @client.request( method: :post, path: "global_ips", body: parsed, model: Telnyx::Models::GlobalIPCreateResponse, options: ) end |
#delete(id, request_options: {}) ⇒ Telnyx::Models::GlobalIPDeleteResponse
Delete a Global IP.
88 89 90 91 92 93 94 95 |
# File 'lib/telnyx/resources/global_ips.rb', line 88 def delete(id, params = {}) @client.request( method: :delete, path: ["global_ips/%1$s", id], model: Telnyx::Models::GlobalIPDeleteResponse, options: params[:request_options] ) end |
#list(page_number: nil, page_size: nil, request_options: {}) ⇒ Telnyx::Internal::DefaultFlatPagination<Telnyx::Models::GlobalIPListResponse>
List all Global IPs.
64 65 66 67 68 69 70 71 72 73 74 75 |
# File 'lib/telnyx/resources/global_ips.rb', line 64 def list(params = {}) parsed, = Telnyx::GlobalIPListParams.dump_request(params) query = Telnyx::Internal::Util.encode_query_params(parsed) @client.request( method: :get, path: "global_ips", query: query.transform_keys(page_number: "page[number]", page_size: "page[size]"), page: Telnyx::Internal::DefaultFlatPagination, model: Telnyx::Models::GlobalIPListResponse, options: ) end |
#retrieve(id, request_options: {}) ⇒ Telnyx::Models::GlobalIPRetrieveResponse
Retrieve a Global IP.
44 45 46 47 48 49 50 51 |
# File 'lib/telnyx/resources/global_ips.rb', line 44 def retrieve(id, params = {}) @client.request( method: :get, path: ["global_ips/%1$s", id], model: Telnyx::Models::GlobalIPRetrieveResponse, options: params[:request_options] ) end |