Class: Telnyx::Resources::WireguardInterfaces
- Inherits:
-
Object
- Object
- Telnyx::Resources::WireguardInterfaces
- Defined in:
- lib/telnyx/resources/wireguard_interfaces.rb,
sig/telnyx/resources/wireguard_interfaces.rbs
Overview
WireGuard Interface operations
Instance Method Summary collapse
-
#create(body:, request_options: {}) ⇒ Telnyx::Models::WireguardInterfaceCreateResponse
Create a new WireGuard Interface.
-
#delete(id, request_options: {}) ⇒ Telnyx::Models::WireguardInterfaceDeleteResponse
Deletes the specified WireGuard interface from its network.
-
#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::WireguardInterfaceRead>
Some parameter documentations has been truncated, see Models::WireguardInterfaceListParams for more details.
-
#retrieve(id, request_options: {}) ⇒ Telnyx::Models::WireguardInterfaceRetrieveResponse
Returns the details of a single WireGuard interface by its identifier.
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.
104 105 106 |
# File 'lib/telnyx/resources/wireguard_interfaces.rb', line 104 def initialize(client:) @client = client end |
Instance Method Details
#create(body:, request_options: {}) ⇒ Telnyx::Models::WireguardInterfaceCreateResponse
Create a new WireGuard Interface. Current limitation of 10 interfaces per user can be created.
18 19 20 21 22 23 24 25 26 27 |
# File 'lib/telnyx/resources/wireguard_interfaces.rb', line 18 def create(params) parsed, = Telnyx::WireguardInterfaceCreateParams.dump_request(params) @client.request( method: :post, path: "wireguard_interfaces", body: parsed[:body], model: Telnyx::Models::WireguardInterfaceCreateResponse, options: ) end |
#delete(id, request_options: {}) ⇒ Telnyx::Models::WireguardInterfaceDeleteResponse
Deletes the specified WireGuard interface from its network.
92 93 94 95 96 97 98 99 |
# File 'lib/telnyx/resources/wireguard_interfaces.rb', line 92 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::WireguardInterfaceRead>
Some parameter documentations has been truncated, see Models::WireguardInterfaceListParams for more details.
Returns a paginated list of the WireGuard interfaces on your account, with support for filtering.
68 69 70 71 72 73 74 75 76 77 78 79 |
# File 'lib/telnyx/resources/wireguard_interfaces.rb', line 68 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::WireguardInterfaceRead, options: ) end |
#retrieve(id, request_options: {}) ⇒ Telnyx::Models::WireguardInterfaceRetrieveResponse
Returns the details of a single WireGuard interface by its identifier.
40 41 42 43 44 45 46 47 |
# File 'lib/telnyx/resources/wireguard_interfaces.rb', line 40 def retrieve(id, params = {}) @client.request( method: :get, path: ["wireguard_interfaces/%1$s", id], model: Telnyx::Models::WireguardInterfaceRetrieveResponse, options: params[:request_options] ) end |