Class: Telnyx::Resources::WireguardInterfaces
- Inherits:
-
Object
- Object
- Telnyx::Resources::WireguardInterfaces
- Defined in:
- lib/telnyx/resources/wireguard_interfaces.rb
Overview
WireGuard Interface operations
Instance Method Summary collapse
-
#create(region_code:, enable_sip_trunking: nil, name: nil, network_id: nil, request_options: {}) ⇒ Telnyx::Models::WireguardInterfaceCreateResponse
Create a new WireGuard Interface.
-
#delete(id, request_options: {}) ⇒ Telnyx::Models::WireguardInterfaceDeleteResponse
Delete a WireGuard Interface.
-
#initialize(client:) ⇒ WireguardInterfaces
constructor
private
A new instance of WireguardInterfaces.
-
#list(filter: nil, page_number: nil, page_size: nil, request_options: {}) ⇒ Telnyx::Internal::DefaultFlatPagination<Telnyx::Models::WireguardInterfaceListResponse>
Some parameter documentations has been truncated, see Models::WireguardInterfaceListParams for more details.
-
#retrieve(id, request_options: {}) ⇒ Telnyx::Models::WireguardInterfaceRetrieveResponse
Retrieve a WireGuard Interfaces.
Constructor Details
#initialize(client:) ⇒ WireguardInterfaces
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 WireguardInterfaces.
110 111 112 |
# File 'lib/telnyx/resources/wireguard_interfaces.rb', line 110 def initialize(client:) @client = client end |
Instance Method Details
#create(region_code:, enable_sip_trunking: nil, name: nil, network_id: nil, request_options: {}) ⇒ Telnyx::Models::WireguardInterfaceCreateResponse
Create a new WireGuard Interface. Current limitation of 10 interfaces per user can be created.
25 26 27 28 29 30 31 32 33 34 |
# File 'lib/telnyx/resources/wireguard_interfaces.rb', line 25 def create(params) parsed, = Telnyx::WireguardInterfaceCreateParams.dump_request(params) @client.request( method: :post, path: "wireguard_interfaces", body: parsed, model: Telnyx::Models::WireguardInterfaceCreateResponse, options: ) end |
#delete(id, request_options: {}) ⇒ Telnyx::Models::WireguardInterfaceDeleteResponse
Delete a WireGuard Interface.
98 99 100 101 102 103 104 105 |
# File 'lib/telnyx/resources/wireguard_interfaces.rb', line 98 def delete(id, params = {}) @client.request( method: :delete, path: ["wireguard_interfaces/%1$s", id], model: Telnyx::Models::WireguardInterfaceDeleteResponse, options: params[:request_options] ) end |
#list(filter: nil, page_number: nil, page_size: nil, request_options: {}) ⇒ Telnyx::Internal::DefaultFlatPagination<Telnyx::Models::WireguardInterfaceListResponse>
Some parameter documentations has been truncated, see Models::WireguardInterfaceListParams for more details.
List all WireGuard Interfaces.
74 75 76 77 78 79 80 81 82 83 84 85 |
# File 'lib/telnyx/resources/wireguard_interfaces.rb', line 74 def list(params = {}) parsed, = Telnyx::WireguardInterfaceListParams.dump_request(params) query = Telnyx::Internal::Util.encode_query_params(parsed) @client.request( method: :get, path: "wireguard_interfaces", query: query.transform_keys(page_number: "page[number]", page_size: "page[size]"), page: Telnyx::Internal::DefaultFlatPagination, model: Telnyx::Models::WireguardInterfaceListResponse, options: ) end |
#retrieve(id, request_options: {}) ⇒ Telnyx::Models::WireguardInterfaceRetrieveResponse
Retrieve a WireGuard Interfaces.
47 48 49 50 51 52 53 54 |
# File 'lib/telnyx/resources/wireguard_interfaces.rb', line 47 def retrieve(id, params = {}) @client.request( method: :get, path: ["wireguard_interfaces/%1$s", id], model: Telnyx::Models::WireguardInterfaceRetrieveResponse, options: params[:request_options] ) end |