Class: Telnyx::Resources::Fqdns

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

Overview

FQDN operations

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ Fqdns

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

Parameters:



146
147
148
# File 'lib/telnyx/resources/fqdns.rb', line 146

def initialize(client:)
  @client = client
end

Instance Method Details

#create(connection_id:, dns_record_type:, fqdn:, port: nil, request_options: {}) ⇒ Telnyx::Models::FqdnCreateResponse

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

Create a new FQDN object.

Parameters:

  • connection_id (String)

    ID of the FQDN connection to which this IP should be attached.

  • dns_record_type (String)

    The DNS record type for the FQDN. For cases where a port is not set, the DNS rec

  • fqdn (String)

    FQDN represented by this resource.

  • port (Integer, nil)

    Port to use when connecting to this FQDN.

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

Returns:

See Also:



27
28
29
30
31
32
33
34
35
36
# File 'lib/telnyx/resources/fqdns.rb', line 27

def create(params)
  parsed, options = Telnyx::FqdnCreateParams.dump_request(params)
  @client.request(
    method: :post,
    path: "fqdns",
    body: parsed,
    model: Telnyx::Models::FqdnCreateResponse,
    options: options
  )
end

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

Delete an FQDN.

Parameters:

  • id (String)

    Identifies the resource.

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

Returns:

See Also:



134
135
136
137
138
139
140
141
# File 'lib/telnyx/resources/fqdns.rb', line 134

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

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

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

Get all FQDNs belonging to the user that match the given filters.

filter[connection_

Parameters:

Returns:

See Also:



110
111
112
113
114
115
116
117
118
119
120
121
# File 'lib/telnyx/resources/fqdns.rb', line 110

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

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

Return the details regarding a specific FQDN.

Parameters:

  • id (String)

    Identifies the resource.

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

Returns:

See Also:



49
50
51
52
53
54
55
56
# File 'lib/telnyx/resources/fqdns.rb', line 49

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

#update(id, connection_id: nil, dns_record_type: nil, fqdn: nil, port: nil, request_options: {}) ⇒ Telnyx::Models::FqdnUpdateResponse

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

Update the details of a specific FQDN.

Parameters:

  • id (String)

    Identifies the resource.

  • connection_id (String)

    ID of the FQDN connection to which this IP should be attached.

  • dns_record_type (String)

    The DNS record type for the FQDN. For cases where a port is not set, the DNS rec

  • fqdn (String)

    FQDN represented by this resource.

  • port (Integer, nil)

    Port to use when connecting to this FQDN.

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

Returns:

See Also:



80
81
82
83
84
85
86
87
88
89
# File 'lib/telnyx/resources/fqdns.rb', line 80

def update(id, params = {})
  parsed, options = Telnyx::FqdnUpdateParams.dump_request(params)
  @client.request(
    method: :patch,
    path: ["fqdns/%1$s", id],
    body: parsed,
    model: Telnyx::Models::FqdnUpdateResponse,
    options: options
  )
end