Class: Telnyx::Resources::WireguardInterfaces

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

Overview

WireGuard Interface operations

Instance Method Summary collapse

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.

Parameters:



103
104
105
# File 'lib/telnyx/resources/wireguard_interfaces.rb', line 103

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, options = Telnyx::WireguardInterfaceCreateParams.dump_request(params)
  @client.request(
    method: :post,
    path: "wireguard_interfaces",
    body: parsed[:body],
    model: Telnyx::Models::WireguardInterfaceCreateResponse,
    options: options
  )
end

#delete(id, request_options: {}) ⇒ Telnyx::Models::WireguardInterfaceDeleteResponse

Delete a WireGuard Interface.

Parameters:

  • id (String)

    Identifies the resource.

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

Returns:

See Also:



91
92
93
94
95
96
97
98
# File 'lib/telnyx/resources/wireguard_interfaces.rb', line 91

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.

List all WireGuard Interfaces.

Parameters:

Returns:

See Also:



67
68
69
70
71
72
73
74
75
76
77
78
# File 'lib/telnyx/resources/wireguard_interfaces.rb', line 67

def list(params = {})
  parsed, options = 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: options
  )
end

#retrieve(id, request_options: {}) ⇒ Telnyx::Models::WireguardInterfaceRetrieveResponse

Retrieve a WireGuard Interfaces.

Parameters:

  • id (String)

    Identifies the resource.

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

Returns:

See Also:



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