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:



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.

Parameters:

  • region_code (String)

    The region the interface should be deployed to.

  • enable_sip_trunking (Boolean)

    Enable SIP traffic forwarding over VPN interface.

  • name (String)

    A user specified name for the interface.

  • network_id (String)

    The id of the network associated with the interface.

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

Returns:

See Also:



25
26
27
28
29
30
31
32
33
34
# File 'lib/telnyx/resources/wireguard_interfaces.rb', line 25

def create(params)
  parsed, options = Telnyx::WireguardInterfaceCreateParams.dump_request(params)
  @client.request(
    method: :post,
    path: "wireguard_interfaces",
    body: parsed,
    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:



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.

Parameters:

Returns:

See Also:



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, 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::Models::WireguardInterfaceListResponse,
    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:



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