Class: Telnyx::Resources::PublicInternetGateways

Inherits:
Object
  • Object
show all
Defined in:
lib/telnyx/resources/public_internet_gateways.rb,
sig/telnyx/resources/public_internet_gateways.rbs

Overview

Public Internet Gateway operations

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ PublicInternetGateways

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 PublicInternetGateways.

Parameters:



106
107
108
# File 'lib/telnyx/resources/public_internet_gateways.rb', line 106

def initialize(client:)
  @client = client
end

Instance Method Details

#create(body:, request_options: {}) ⇒ Telnyx::Models::PublicInternetGatewayCreateResponse

Requests creation of a public internet gateway on the specified network, giving the network internet egress. Creation is asynchronous, so the request is accepted and completes in the background.



19
20
21
22
23
24
25
26
27
28
# File 'lib/telnyx/resources/public_internet_gateways.rb', line 19

def create(params)
  parsed, options = Telnyx::PublicInternetGatewayCreateParams.dump_request(params)
  @client.request(
    method: :post,
    path: "public_internet_gateways",
    body: parsed[:body],
    model: Telnyx::Models::PublicInternetGatewayCreateResponse,
    options: options
  )
end

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

Deletes the specified public internet gateway, removing internet egress through it.

Parameters:

  • id (String)

    Identifies the resource.

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

Returns:

See Also:



94
95
96
97
98
99
100
101
# File 'lib/telnyx/resources/public_internet_gateways.rb', line 94

def delete(id, params = {})
  @client.request(
    method: :delete,
    path: ["public_internet_gateways/%1$s", id],
    model: Telnyx::Models::PublicInternetGatewayDeleteResponse,
    options: params[:request_options]
  )
end

#list(filter: nil, page_number: nil, page_size: nil, request_options: {}) ⇒ Telnyx::Internal::DefaultFlatPagination<Telnyx::Models::PublicInternetGatewayRead>

Some parameter documentations has been truncated, see Models::PublicInternetGatewayListParams for more details.

Returns a paginated list of the public internet gateways on your account, with support for filtering.

Parameters:

Returns:

See Also:



69
70
71
72
73
74
75
76
77
78
79
80
# File 'lib/telnyx/resources/public_internet_gateways.rb', line 69

def list(params = {})
  parsed, options = Telnyx::PublicInternetGatewayListParams.dump_request(params)
  query = Telnyx::Internal::Util.encode_query_params(parsed)
  @client.request(
    method: :get,
    path: "public_internet_gateways",
    query: query.transform_keys(page_number: "page[number]", page_size: "page[size]"),
    page: Telnyx::Internal::DefaultFlatPagination,
    model: Telnyx::PublicInternetGatewayRead,
    options: options
  )
end

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

Returns the details of a single public internet gateway by its identifier.

Parameters:

  • id (String)

    Identifies the resource.

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

Returns:

See Also:



41
42
43
44
45
46
47
48
# File 'lib/telnyx/resources/public_internet_gateways.rb', line 41

def retrieve(id, params = {})
  @client.request(
    method: :get,
    path: ["public_internet_gateways/%1$s", id],
    model: Telnyx::Models::PublicInternetGatewayRetrieveResponse,
    options: params[:request_options]
  )
end