# NATGatewaysApi

All URIs are relative to *<https://api.ionos.com/cloudapi/v6>*

| Method                                                                                                                              | HTTP request                                                                               | Description                               |
| ----------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------ | ----------------------------------------- |
| [**datacenters\_natgateways\_delete**](#datacenters_natgateways_delete)                                                             | **DELETE** /datacenters/{datacenterId}/natgateways/{natGatewayId}                          | Delete NAT Gateways                       |
| [**datacenters\_natgateways\_find\_by\_nat\_gateway\_id**](#datacenters_natgateways_find_by_nat_gateway_id)                         | **GET** /datacenters/{datacenterId}/natgateways/{natGatewayId}                             | Retrieve NAT Gateways                     |
| [**datacenters\_natgateways\_flowlogs\_delete**](#datacenters_natgateways_flowlogs_delete)                                          | **DELETE** /datacenters/{datacenterId}/natgateways/{natGatewayId}/flowlogs/{flowLogId}     | Delete NAT Gateway Flow Logs              |
| [**datacenters\_natgateways\_flowlogs\_find\_by\_flow\_log\_id**](#datacenters_natgateways_flowlogs_find_by_flow_log_id)            | **GET** /datacenters/{datacenterId}/natgateways/{natGatewayId}/flowlogs/{flowLogId}        | Retrieve NAT Gateway Flow Logs            |
| [**datacenters\_natgateways\_flowlogs\_get**](#datacenters_natgateways_flowlogs_get)                                                | **GET** /datacenters/{datacenterId}/natgateways/{natGatewayId}/flowlogs                    | List NAT Gateway Flow Logs                |
| [**datacenters\_natgateways\_flowlogs\_patch**](#datacenters_natgateways_flowlogs_patch)                                            | **PATCH** /datacenters/{datacenterId}/natgateways/{natGatewayId}/flowlogs/{flowLogId}      | Partially modify NAT Gateway Flow Logs    |
| [**datacenters\_natgateways\_flowlogs\_post**](#datacenters_natgateways_flowlogs_post)                                              | **POST** /datacenters/{datacenterId}/natgateways/{natGatewayId}/flowlogs                   | Create a NAT Gateway Flow Log             |
| [**datacenters\_natgateways\_flowlogs\_put**](#datacenters_natgateways_flowlogs_put)                                                | **PUT** /datacenters/{datacenterId}/natgateways/{natGatewayId}/flowlogs/{flowLogId}        | Modify NAT Gateway Flow Logs              |
| [**datacenters\_natgateways\_get**](#datacenters_natgateways_get)                                                                   | **GET** /datacenters/{datacenterId}/natgateways                                            | List NAT Gateways                         |
| [**datacenters\_natgateways\_patch**](#datacenters_natgateways_patch)                                                               | **PATCH** /datacenters/{datacenterId}/natgateways/{natGatewayId}                           | Partially modify NAT Gateways             |
| [**datacenters\_natgateways\_post**](#datacenters_natgateways_post)                                                                 | **POST** /datacenters/{datacenterId}/natgateways                                           | Create a NAT Gateway                      |
| [**datacenters\_natgateways\_put**](#datacenters_natgateways_put)                                                                   | **PUT** /datacenters/{datacenterId}/natgateways/{natGatewayId}                             | Modify NAT Gateways                       |
| [**datacenters\_natgateways\_rules\_delete**](#datacenters_natgateways_rules_delete)                                                | **DELETE** /datacenters/{datacenterId}/natgateways/{natGatewayId}/rules/{natGatewayRuleId} | Delete NAT Gateway rules                  |
| [**datacenters\_natgateways\_rules\_find\_by\_nat\_gateway\_rule\_id**](#datacenters_natgateways_rules_find_by_nat_gateway_rule_id) | **GET** /datacenters/{datacenterId}/natgateways/{natGatewayId}/rules/{natGatewayRuleId}    | Retrieve NAT Gateway rules                |
| [**datacenters\_natgateways\_rules\_get**](#datacenters_natgateways_rules_get)                                                      | **GET** /datacenters/{datacenterId}/natgateways/{natGatewayId}/rules                       | List NAT Gateway rules                    |
| [**datacenters\_natgateways\_rules\_patch**](#datacenters_natgateways_rules_patch)                                                  | **PATCH** /datacenters/{datacenterId}/natgateways/{natGatewayId}/rules/{natGatewayRuleId}  | Partially Modify a NAT Gateway Rule by ID |
| [**datacenters\_natgateways\_rules\_post**](#datacenters_natgateways_rules_post)                                                    | **POST** /datacenters/{datacenterId}/natgateways/{natGatewayId}/rules                      | Create a NAT Gateway Rule                 |
| [**datacenters\_natgateways\_rules\_put**](#datacenters_natgateways_rules_put)                                                      | **PUT** /datacenters/{datacenterId}/natgateways/{natGatewayId}/rules/{natGatewayRuleId}    | Modify a NAT Gateway Rule by ID           |

## datacenters\_natgateways\_delete

> datacenters\_natgateways\_delete(datacenter\_id, nat\_gateway\_id, opts)

Delete NAT Gateways

Remove the specified NAT Gateway from the data center.

### Examples

```ruby
require 'time'
require 'ionoscloud'
# setup authorization
Ionoscloud.configure do |config|
  # Configure HTTP basic authorization: Basic Authentication
  config.username = 'YOUR USERNAME'
  config.password = 'YOUR PASSWORD'

  # Configure API key authorization: Token Authentication
  config.api_key['Authorization'] = 'YOUR API KEY'
  # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
  # config.api_key_prefix['Authorization'] = 'Bearer'
end

api_instance = Ionoscloud::NATGatewaysApi.new
datacenter_id = 'datacenter_id_example' # String | The unique ID of the data center.
nat_gateway_id = 'nat_gateway_id_example' # String | The unique ID of the NAT Gateway.
opts = {
  pretty: true, # Boolean | Controls whether the response is pretty-printed (with indentations and new lines).
  depth: 56, # Integer | Controls the detail depth of the response objects.  GET /datacenters/[ID]  - depth=0: Only direct properties are included; children (servers and other elements) are not included.  - depth=1: Direct properties and children references are included.  - depth=2: Direct properties and children properties are included.  - depth=3: Direct properties and children properties and children's children are included.  - depth=... and so on
  x_contract_number: 56 # Integer | Users with multiple contracts must provide the contract number, for which all API requests are to be executed.
}

begin
  # Delete NAT Gateways
  api_instance.datacenters_natgateways_delete(datacenter_id, nat_gateway_id, opts)
rescue Ionoscloud::ApiError => e
  puts "Error when calling NATGatewaysApi->datacenters_natgateways_delete: #{e}"
end
```

#### Using the datacenters\_natgateways\_delete\_with\_http\_info variant

This returns an Array which contains the response data (`nil` in this case), status code and headers.

> \<Array(nil, Integer, Hash)> datacenters\_natgateways\_delete\_with\_http\_info(datacenter\_id, nat\_gateway\_id, opts)

```ruby
begin
  # Delete NAT Gateways
  data, status_code, headers = api_instance.datacenters_natgateways_delete_with_http_info(datacenter_id, nat_gateway_id, opts)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => nil
rescue Ionoscloud::ApiError => e
  puts "Error when calling NATGatewaysApi->datacenters_natgateways_delete_with_http_info: #{e}"
end
```

### Parameters

| Name                    | Type        | Description                                                                                                                                                                                                                                                                                                                                                                                                                              | Notes                         |
| ----------------------- | ----------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------- |
| **datacenter\_id**      | **String**  | The unique ID of the data center.                                                                                                                                                                                                                                                                                                                                                                                                        |                               |
| **nat\_gateway\_id**    | **String**  | The unique ID of the NAT Gateway.                                                                                                                                                                                                                                                                                                                                                                                                        |                               |
| **pretty**              | **Boolean** | Controls whether the response is pretty-printed (with indentations and new lines).                                                                                                                                                                                                                                                                                                                                                       | \[optional]\[default to true] |
| **depth**               | **Integer** | Controls the detail depth of the response objects. GET /datacenters/\[ID] - depth=0: Only direct properties are included; children (servers and other elements) are not included. - depth=1: Direct properties and children references are included. - depth=2: Direct properties and children properties are included. - depth=3: Direct properties and children properties and children's children are included. - depth=... and so on | \[optional]\[default to 0]    |
| **x\_contract\_number** | **Integer** | Users with multiple contracts must provide the contract number, for which all API requests are to be executed.                                                                                                                                                                                                                                                                                                                           | \[optional]                   |

### Return type

nil (empty response body)

### Authorization

Basic Authentication, Token Authentication

### HTTP request headers

* **Content-Type**: Not defined
* **Accept**: application/json

## datacenters\_natgateways\_find\_by\_nat\_gateway\_id

> datacenters\_natgateways\_find\_by\_nat\_gateway\_id(datacenter\_id, nat\_gateway\_id, opts)

Retrieve NAT Gateways

Retrieve the properties of the specified NAT Gateway within the data center.

### Examples

```ruby
require 'time'
require 'ionoscloud'
# setup authorization
Ionoscloud.configure do |config|
  # Configure HTTP basic authorization: Basic Authentication
  config.username = 'YOUR USERNAME'
  config.password = 'YOUR PASSWORD'

  # Configure API key authorization: Token Authentication
  config.api_key['Authorization'] = 'YOUR API KEY'
  # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
  # config.api_key_prefix['Authorization'] = 'Bearer'
end

api_instance = Ionoscloud::NATGatewaysApi.new
datacenter_id = 'datacenter_id_example' # String | The unique ID of the data center.
nat_gateway_id = 'nat_gateway_id_example' # String | The unique ID of the NAT Gateway.
opts = {
  pretty: true, # Boolean | Controls whether the response is pretty-printed (with indentations and new lines).
  depth: 56, # Integer | Controls the detail depth of the response objects.  GET /datacenters/[ID]  - depth=0: Only direct properties are included; children (servers and other elements) are not included.  - depth=1: Direct properties and children references are included.  - depth=2: Direct properties and children properties are included.  - depth=3: Direct properties and children properties and children's children are included.  - depth=... and so on
  x_contract_number: 56 # Integer | Users with multiple contracts must provide the contract number, for which all API requests are to be executed.
}

begin
  # Retrieve NAT Gateways
  result = api_instance.datacenters_natgateways_find_by_nat_gateway_id(datacenter_id, nat_gateway_id, opts)
  p result
rescue Ionoscloud::ApiError => e
  puts "Error when calling NATGatewaysApi->datacenters_natgateways_find_by_nat_gateway_id: #{e}"
end
```

#### Using the datacenters\_natgateways\_find\_by\_nat\_gateway\_id\_with\_http\_info variant

This returns an Array which contains the response data, status code and headers.

> \<Array(, Integer, Hash)> datacenters\_natgateways\_find\_by\_nat\_gateway\_id\_with\_http\_info(datacenter\_id, nat\_gateway\_id, opts)

```ruby
begin
  # Retrieve NAT Gateways
  data, status_code, headers = api_instance.datacenters_natgateways_find_by_nat_gateway_id_with_http_info(datacenter_id, nat_gateway_id, opts)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => <NatGateway>
rescue Ionoscloud::ApiError => e
  puts "Error when calling NATGatewaysApi->datacenters_natgateways_find_by_nat_gateway_id_with_http_info: #{e}"
end
```

### Parameters

| Name                    | Type        | Description                                                                                                                                                                                                                                                                                                                                                                                                                              | Notes                         |
| ----------------------- | ----------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------- |
| **datacenter\_id**      | **String**  | The unique ID of the data center.                                                                                                                                                                                                                                                                                                                                                                                                        |                               |
| **nat\_gateway\_id**    | **String**  | The unique ID of the NAT Gateway.                                                                                                                                                                                                                                                                                                                                                                                                        |                               |
| **pretty**              | **Boolean** | Controls whether the response is pretty-printed (with indentations and new lines).                                                                                                                                                                                                                                                                                                                                                       | \[optional]\[default to true] |
| **depth**               | **Integer** | Controls the detail depth of the response objects. GET /datacenters/\[ID] - depth=0: Only direct properties are included; children (servers and other elements) are not included. - depth=1: Direct properties and children references are included. - depth=2: Direct properties and children properties are included. - depth=3: Direct properties and children properties and children's children are included. - depth=... and so on | \[optional]\[default to 0]    |
| **x\_contract\_number** | **Integer** | Users with multiple contracts must provide the contract number, for which all API requests are to be executed.                                                                                                                                                                                                                                                                                                                           | \[optional]                   |

### Return type

[**NatGateway**](/ruby-sdk/models/natgateway.md)

### Authorization

Basic Authentication, Token Authentication

### HTTP request headers

* **Content-Type**: Not defined
* **Accept**: application/json

## datacenters\_natgateways\_flowlogs\_delete

> datacenters\_natgateways\_flowlogs\_delete(datacenter\_id, nat\_gateway\_id, flow\_log\_id, opts)

Delete NAT Gateway Flow Logs

Delete the specified NAT Gateway Flow Log.

### Examples

```ruby
require 'time'
require 'ionoscloud'
# setup authorization
Ionoscloud.configure do |config|
  # Configure HTTP basic authorization: Basic Authentication
  config.username = 'YOUR USERNAME'
  config.password = 'YOUR PASSWORD'

  # Configure API key authorization: Token Authentication
  config.api_key['Authorization'] = 'YOUR API KEY'
  # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
  # config.api_key_prefix['Authorization'] = 'Bearer'
end

api_instance = Ionoscloud::NATGatewaysApi.new
datacenter_id = 'datacenter_id_example' # String | The unique ID of the data center.
nat_gateway_id = 'nat_gateway_id_example' # String | The unique ID of the NAT Gateway.
flow_log_id = 'flow_log_id_example' # String | The unique ID of the Flow Log.
opts = {
  pretty: true, # Boolean | Controls whether the response is pretty-printed (with indentations and new lines).
  depth: 56 # Integer | Controls the detail depth of the response objects.  GET /datacenters/[ID]  - depth=0: Only direct properties are included; children (servers and other elements) are not included.  - depth=1: Direct properties and children references are included.  - depth=2: Direct properties and children properties are included.  - depth=3: Direct properties and children properties and children's children are included.  - depth=... and so on
}

begin
  # Delete NAT Gateway Flow Logs
  api_instance.datacenters_natgateways_flowlogs_delete(datacenter_id, nat_gateway_id, flow_log_id, opts)
rescue Ionoscloud::ApiError => e
  puts "Error when calling NATGatewaysApi->datacenters_natgateways_flowlogs_delete: #{e}"
end
```

#### Using the datacenters\_natgateways\_flowlogs\_delete\_with\_http\_info variant

This returns an Array which contains the response data (`nil` in this case), status code and headers.

> \<Array(nil, Integer, Hash)> datacenters\_natgateways\_flowlogs\_delete\_with\_http\_info(datacenter\_id, nat\_gateway\_id, flow\_log\_id, opts)

```ruby
begin
  # Delete NAT Gateway Flow Logs
  data, status_code, headers = api_instance.datacenters_natgateways_flowlogs_delete_with_http_info(datacenter_id, nat_gateway_id, flow_log_id, opts)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => nil
rescue Ionoscloud::ApiError => e
  puts "Error when calling NATGatewaysApi->datacenters_natgateways_flowlogs_delete_with_http_info: #{e}"
end
```

### Parameters

| Name                 | Type        | Description                                                                                                                                                                                                                                                                                                                                                                                                                              | Notes                         |
| -------------------- | ----------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------- |
| **datacenter\_id**   | **String**  | The unique ID of the data center.                                                                                                                                                                                                                                                                                                                                                                                                        |                               |
| **nat\_gateway\_id** | **String**  | The unique ID of the NAT Gateway.                                                                                                                                                                                                                                                                                                                                                                                                        |                               |
| **flow\_log\_id**    | **String**  | The unique ID of the Flow Log.                                                                                                                                                                                                                                                                                                                                                                                                           |                               |
| **pretty**           | **Boolean** | Controls whether the response is pretty-printed (with indentations and new lines).                                                                                                                                                                                                                                                                                                                                                       | \[optional]\[default to true] |
| **depth**            | **Integer** | Controls the detail depth of the response objects. GET /datacenters/\[ID] - depth=0: Only direct properties are included; children (servers and other elements) are not included. - depth=1: Direct properties and children references are included. - depth=2: Direct properties and children properties are included. - depth=3: Direct properties and children properties and children's children are included. - depth=... and so on | \[optional]\[default to 0]    |

### Return type

nil (empty response body)

### Authorization

Basic Authentication, Token Authentication

### HTTP request headers

* **Content-Type**: Not defined
* **Accept**: application/json

## datacenters\_natgateways\_flowlogs\_find\_by\_flow\_log\_id

> datacenters\_natgateways\_flowlogs\_find\_by\_flow\_log\_id(datacenter\_id, nat\_gateway\_id, flow\_log\_id, opts)

Retrieve NAT Gateway Flow Logs

Retrieve the specified NAT Gateway Flow Log.

### Examples

```ruby
require 'time'
require 'ionoscloud'
# setup authorization
Ionoscloud.configure do |config|
  # Configure HTTP basic authorization: Basic Authentication
  config.username = 'YOUR USERNAME'
  config.password = 'YOUR PASSWORD'

  # Configure API key authorization: Token Authentication
  config.api_key['Authorization'] = 'YOUR API KEY'
  # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
  # config.api_key_prefix['Authorization'] = 'Bearer'
end

api_instance = Ionoscloud::NATGatewaysApi.new
datacenter_id = 'datacenter_id_example' # String | The unique ID of the data center.
nat_gateway_id = 'nat_gateway_id_example' # String | The unique ID of the NAT Gateway.
flow_log_id = 'flow_log_id_example' # String | The unique ID of the Flow Log.
opts = {
  pretty: true, # Boolean | Controls whether the response is pretty-printed (with indentations and new lines).
  depth: 56 # Integer | Controls the detail depth of the response objects.  GET /datacenters/[ID]  - depth=0: Only direct properties are included; children (servers and other elements) are not included.  - depth=1: Direct properties and children references are included.  - depth=2: Direct properties and children properties are included.  - depth=3: Direct properties and children properties and children's children are included.  - depth=... and so on
}

begin
  # Retrieve NAT Gateway Flow Logs
  result = api_instance.datacenters_natgateways_flowlogs_find_by_flow_log_id(datacenter_id, nat_gateway_id, flow_log_id, opts)
  p result
rescue Ionoscloud::ApiError => e
  puts "Error when calling NATGatewaysApi->datacenters_natgateways_flowlogs_find_by_flow_log_id: #{e}"
end
```

#### Using the datacenters\_natgateways\_flowlogs\_find\_by\_flow\_log\_id\_with\_http\_info variant

This returns an Array which contains the response data, status code and headers.

> \<Array(, Integer, Hash)> datacenters\_natgateways\_flowlogs\_find\_by\_flow\_log\_id\_with\_http\_info(datacenter\_id, nat\_gateway\_id, flow\_log\_id, opts)

```ruby
begin
  # Retrieve NAT Gateway Flow Logs
  data, status_code, headers = api_instance.datacenters_natgateways_flowlogs_find_by_flow_log_id_with_http_info(datacenter_id, nat_gateway_id, flow_log_id, opts)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => <FlowLog>
rescue Ionoscloud::ApiError => e
  puts "Error when calling NATGatewaysApi->datacenters_natgateways_flowlogs_find_by_flow_log_id_with_http_info: #{e}"
end
```

### Parameters

| Name                 | Type        | Description                                                                                                                                                                                                                                                                                                                                                                                                                              | Notes                         |
| -------------------- | ----------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------- |
| **datacenter\_id**   | **String**  | The unique ID of the data center.                                                                                                                                                                                                                                                                                                                                                                                                        |                               |
| **nat\_gateway\_id** | **String**  | The unique ID of the NAT Gateway.                                                                                                                                                                                                                                                                                                                                                                                                        |                               |
| **flow\_log\_id**    | **String**  | The unique ID of the Flow Log.                                                                                                                                                                                                                                                                                                                                                                                                           |                               |
| **pretty**           | **Boolean** | Controls whether the response is pretty-printed (with indentations and new lines).                                                                                                                                                                                                                                                                                                                                                       | \[optional]\[default to true] |
| **depth**            | **Integer** | Controls the detail depth of the response objects. GET /datacenters/\[ID] - depth=0: Only direct properties are included; children (servers and other elements) are not included. - depth=1: Direct properties and children references are included. - depth=2: Direct properties and children properties are included. - depth=3: Direct properties and children properties and children's children are included. - depth=... and so on | \[optional]\[default to 0]    |

### Return type

[**FlowLog**](/ruby-sdk/models/flowlog.md)

### Authorization

Basic Authentication, Token Authentication

### HTTP request headers

* **Content-Type**: Not defined
* **Accept**: application/json

## datacenters\_natgateways\_flowlogs\_get

> datacenters\_natgateways\_flowlogs\_get(datacenter\_id, nat\_gateway\_id, opts)

List NAT Gateway Flow Logs

List all the Flow Logs for the specified NAT Gateway.

### Examples

```ruby
require 'time'
require 'ionoscloud'
# setup authorization
Ionoscloud.configure do |config|
  # Configure HTTP basic authorization: Basic Authentication
  config.username = 'YOUR USERNAME'
  config.password = 'YOUR PASSWORD'

  # Configure API key authorization: Token Authentication
  config.api_key['Authorization'] = 'YOUR API KEY'
  # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
  # config.api_key_prefix['Authorization'] = 'Bearer'
end

api_instance = Ionoscloud::NATGatewaysApi.new
datacenter_id = 'datacenter_id_example' # String | The unique ID of the data center.
nat_gateway_id = 'nat_gateway_id_example' # String | The unique ID of the NAT Gateway.
opts = {
  pretty: true, # Boolean | Controls whether the response is pretty-printed (with indentations and new lines).
  depth: 56, # Integer | Controls the detail depth of the response objects.  GET /datacenters/[ID]  - depth=0: Only direct properties are included; children (servers and other elements) are not included.  - depth=1: Direct properties and children references are included.  - depth=2: Direct properties and children properties are included.  - depth=3: Direct properties and children properties and children's children are included.  - depth=... and so on
  offset: 56, # Integer | The first element (from the complete list of the elements) to include in the response (used together with <b><i>limit</i></b> for pagination).
  limit: 56 # Integer | The maximum number of elements to return (use together with offset for pagination).
}

begin
  # List NAT Gateway Flow Logs
  result = api_instance.datacenters_natgateways_flowlogs_get(datacenter_id, nat_gateway_id, opts)
  p result
rescue Ionoscloud::ApiError => e
  puts "Error when calling NATGatewaysApi->datacenters_natgateways_flowlogs_get: #{e}"
end
```

#### Using the datacenters\_natgateways\_flowlogs\_get\_with\_http\_info variant

This returns an Array which contains the response data, status code and headers.

> \<Array(, Integer, Hash)> datacenters\_natgateways\_flowlogs\_get\_with\_http\_info(datacenter\_id, nat\_gateway\_id, opts)

```ruby
begin
  # List NAT Gateway Flow Logs
  data, status_code, headers = api_instance.datacenters_natgateways_flowlogs_get_with_http_info(datacenter_id, nat_gateway_id, opts)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => <FlowLogs>
rescue Ionoscloud::ApiError => e
  puts "Error when calling NATGatewaysApi->datacenters_natgateways_flowlogs_get_with_http_info: #{e}"
end
```

### Parameters

| Name                 | Type        | Description                                                                                                                                                                                                                                                                                                                                                                                                                              | Notes                         |
| -------------------- | ----------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------- |
| **datacenter\_id**   | **String**  | The unique ID of the data center.                                                                                                                                                                                                                                                                                                                                                                                                        |                               |
| **nat\_gateway\_id** | **String**  | The unique ID of the NAT Gateway.                                                                                                                                                                                                                                                                                                                                                                                                        |                               |
| **pretty**           | **Boolean** | Controls whether the response is pretty-printed (with indentations and new lines).                                                                                                                                                                                                                                                                                                                                                       | \[optional]\[default to true] |
| **depth**            | **Integer** | Controls the detail depth of the response objects. GET /datacenters/\[ID] - depth=0: Only direct properties are included; children (servers and other elements) are not included. - depth=1: Direct properties and children references are included. - depth=2: Direct properties and children properties are included. - depth=3: Direct properties and children properties and children's children are included. - depth=... and so on | \[optional]\[default to 0]    |
| **offset**           | **Integer** | The first element (from the complete list of the elements) to include in the response (used together with \<b>\<i>limit\</i>\</b> for pagination).                                                                                                                                                                                                                                                                                       | \[optional]\[default to 0]    |
| **limit**            | **Integer** | The maximum number of elements to return (use together with offset for pagination).                                                                                                                                                                                                                                                                                                                                                      | \[optional]\[default to 1000] |

### Return type

[**FlowLogs**](/ruby-sdk/models/flowlogs.md)

### Authorization

Basic Authentication, Token Authentication

### HTTP request headers

* **Content-Type**: Not defined
* **Accept**: application/json

## datacenters\_natgateways\_flowlogs\_patch

> datacenters\_natgateways\_flowlogs\_patch(datacenter\_id, nat\_gateway\_id, flow\_log\_id, nat\_gateway\_flow\_log\_properties, opts)

Partially modify NAT Gateway Flow Logs

Update the properties of the specified NAT Gateway Flow Log.

### Examples

```ruby
require 'time'
require 'ionoscloud'
# setup authorization
Ionoscloud.configure do |config|
  # Configure HTTP basic authorization: Basic Authentication
  config.username = 'YOUR USERNAME'
  config.password = 'YOUR PASSWORD'

  # Configure API key authorization: Token Authentication
  config.api_key['Authorization'] = 'YOUR API KEY'
  # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
  # config.api_key_prefix['Authorization'] = 'Bearer'
end

api_instance = Ionoscloud::NATGatewaysApi.new
datacenter_id = 'datacenter_id_example' # String | The unique ID of the data center.
nat_gateway_id = 'nat_gateway_id_example' # String | The unique ID of the NAT Gateway.
flow_log_id = 'flow_log_id_example' # String | The unique ID of the Flow Log.
nat_gateway_flow_log_properties = Ionoscloud::FlowLogProperties.new({action: 'ACCEPTED', bucket: 'bucketName/key', direction: 'INGRESS', name: 'My resource'}) # FlowLogProperties | The properties of the Flow Log to be updated.
opts = {
  pretty: true, # Boolean | Controls whether the response is pretty-printed (with indentations and new lines).
  depth: 56 # Integer | Controls the detail depth of the response objects.  GET /datacenters/[ID]  - depth=0: Only direct properties are included; children (servers and other elements) are not included.  - depth=1: Direct properties and children references are included.  - depth=2: Direct properties and children properties are included.  - depth=3: Direct properties and children properties and children's children are included.  - depth=... and so on
}

begin
  # Partially modify NAT Gateway Flow Logs
  result = api_instance.datacenters_natgateways_flowlogs_patch(datacenter_id, nat_gateway_id, flow_log_id, nat_gateway_flow_log_properties, opts)
  p result
rescue Ionoscloud::ApiError => e
  puts "Error when calling NATGatewaysApi->datacenters_natgateways_flowlogs_patch: #{e}"
end
```

#### Using the datacenters\_natgateways\_flowlogs\_patch\_with\_http\_info variant

This returns an Array which contains the response data, status code and headers.

> \<Array(, Integer, Hash)> datacenters\_natgateways\_flowlogs\_patch\_with\_http\_info(datacenter\_id, nat\_gateway\_id, flow\_log\_id, nat\_gateway\_flow\_log\_properties, opts)

```ruby
begin
  # Partially modify NAT Gateway Flow Logs
  data, status_code, headers = api_instance.datacenters_natgateways_flowlogs_patch_with_http_info(datacenter_id, nat_gateway_id, flow_log_id, nat_gateway_flow_log_properties, opts)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => <FlowLog>
rescue Ionoscloud::ApiError => e
  puts "Error when calling NATGatewaysApi->datacenters_natgateways_flowlogs_patch_with_http_info: #{e}"
end
```

### Parameters

| Name                                    | Type                                                           | Description                                                                                                                                                                                                                                                                                                                                                                                                                              | Notes                         |
| --------------------------------------- | -------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------- |
| **datacenter\_id**                      | **String**                                                     | The unique ID of the data center.                                                                                                                                                                                                                                                                                                                                                                                                        |                               |
| **nat\_gateway\_id**                    | **String**                                                     | The unique ID of the NAT Gateway.                                                                                                                                                                                                                                                                                                                                                                                                        |                               |
| **flow\_log\_id**                       | **String**                                                     | The unique ID of the Flow Log.                                                                                                                                                                                                                                                                                                                                                                                                           |                               |
| **nat\_gateway\_flow\_log\_properties** | [**FlowLogProperties**](/ruby-sdk/models/flowlogproperties.md) | The properties of the Flow Log to be updated.                                                                                                                                                                                                                                                                                                                                                                                            |                               |
| **pretty**                              | **Boolean**                                                    | Controls whether the response is pretty-printed (with indentations and new lines).                                                                                                                                                                                                                                                                                                                                                       | \[optional]\[default to true] |
| **depth**                               | **Integer**                                                    | Controls the detail depth of the response objects. GET /datacenters/\[ID] - depth=0: Only direct properties are included; children (servers and other elements) are not included. - depth=1: Direct properties and children references are included. - depth=2: Direct properties and children properties are included. - depth=3: Direct properties and children properties and children's children are included. - depth=... and so on | \[optional]\[default to 0]    |

### Return type

[**FlowLog**](/ruby-sdk/models/flowlog.md)

### Authorization

Basic Authentication, Token Authentication

### HTTP request headers

* **Content-Type**: Not defined
* **Accept**: application/json

## datacenters\_natgateways\_flowlogs\_post

> datacenters\_natgateways\_flowlogs\_post(datacenter\_id, nat\_gateway\_id, nat\_gateway\_flow\_log, opts)

Create a NAT Gateway Flow Log

Adds a new Flow Log to the specified NAT Gateway.

### Examples

```ruby
require 'time'
require 'ionoscloud'
# setup authorization
Ionoscloud.configure do |config|
  # Configure HTTP basic authorization: Basic Authentication
  config.username = 'YOUR USERNAME'
  config.password = 'YOUR PASSWORD'

  # Configure API key authorization: Token Authentication
  config.api_key['Authorization'] = 'YOUR API KEY'
  # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
  # config.api_key_prefix['Authorization'] = 'Bearer'
end

api_instance = Ionoscloud::NATGatewaysApi.new
datacenter_id = 'datacenter_id_example' # String | The unique ID of the data center.
nat_gateway_id = 'nat_gateway_id_example' # String | The unique ID of the NAT Gateway.
nat_gateway_flow_log = Ionoscloud::FlowLog.new({properties: Ionoscloud::FlowLogProperties.new({action: 'ACCEPTED', bucket: 'bucketName/key', direction: 'INGRESS', name: 'My resource'})}) # FlowLog | The Flow Log to create.
opts = {
  pretty: true, # Boolean | Controls whether the response is pretty-printed (with indentations and new lines).
  depth: 56 # Integer | Controls the detail depth of the response objects.  GET /datacenters/[ID]  - depth=0: Only direct properties are included; children (servers and other elements) are not included.  - depth=1: Direct properties and children references are included.  - depth=2: Direct properties and children properties are included.  - depth=3: Direct properties and children properties and children's children are included.  - depth=... and so on
}

begin
  # Create a NAT Gateway Flow Log
  result = api_instance.datacenters_natgateways_flowlogs_post(datacenter_id, nat_gateway_id, nat_gateway_flow_log, opts)
  p result
rescue Ionoscloud::ApiError => e
  puts "Error when calling NATGatewaysApi->datacenters_natgateways_flowlogs_post: #{e}"
end
```

#### Using the datacenters\_natgateways\_flowlogs\_post\_with\_http\_info variant

This returns an Array which contains the response data, status code and headers.

> \<Array(, Integer, Hash)> datacenters\_natgateways\_flowlogs\_post\_with\_http\_info(datacenter\_id, nat\_gateway\_id, nat\_gateway\_flow\_log, opts)

```ruby
begin
  # Create a NAT Gateway Flow Log
  data, status_code, headers = api_instance.datacenters_natgateways_flowlogs_post_with_http_info(datacenter_id, nat_gateway_id, nat_gateway_flow_log, opts)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => <FlowLog>
rescue Ionoscloud::ApiError => e
  puts "Error when calling NATGatewaysApi->datacenters_natgateways_flowlogs_post_with_http_info: #{e}"
end
```

### Parameters

| Name                        | Type                                       | Description                                                                                                                                                                                                                                                                                                                                                                                                                              | Notes                         |
| --------------------------- | ------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------- |
| **datacenter\_id**          | **String**                                 | The unique ID of the data center.                                                                                                                                                                                                                                                                                                                                                                                                        |                               |
| **nat\_gateway\_id**        | **String**                                 | The unique ID of the NAT Gateway.                                                                                                                                                                                                                                                                                                                                                                                                        |                               |
| **nat\_gateway\_flow\_log** | [**FlowLog**](/ruby-sdk/models/flowlog.md) | The Flow Log to create.                                                                                                                                                                                                                                                                                                                                                                                                                  |                               |
| **pretty**                  | **Boolean**                                | Controls whether the response is pretty-printed (with indentations and new lines).                                                                                                                                                                                                                                                                                                                                                       | \[optional]\[default to true] |
| **depth**                   | **Integer**                                | Controls the detail depth of the response objects. GET /datacenters/\[ID] - depth=0: Only direct properties are included; children (servers and other elements) are not included. - depth=1: Direct properties and children references are included. - depth=2: Direct properties and children properties are included. - depth=3: Direct properties and children properties and children's children are included. - depth=... and so on | \[optional]\[default to 0]    |

### Return type

[**FlowLog**](/ruby-sdk/models/flowlog.md)

### Authorization

Basic Authentication, Token Authentication

### HTTP request headers

* **Content-Type**: application/json
* **Accept**: application/json

## datacenters\_natgateways\_flowlogs\_put

> datacenters\_natgateways\_flowlogs\_put(datacenter\_id, nat\_gateway\_id, flow\_log\_id, nat\_gateway\_flow\_log, opts)

Modify NAT Gateway Flow Logs

Modify the specified NAT Gateway Flow Log.

### Examples

```ruby
require 'time'
require 'ionoscloud'
# setup authorization
Ionoscloud.configure do |config|
  # Configure HTTP basic authorization: Basic Authentication
  config.username = 'YOUR USERNAME'
  config.password = 'YOUR PASSWORD'

  # Configure API key authorization: Token Authentication
  config.api_key['Authorization'] = 'YOUR API KEY'
  # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
  # config.api_key_prefix['Authorization'] = 'Bearer'
end

api_instance = Ionoscloud::NATGatewaysApi.new
datacenter_id = 'datacenter_id_example' # String | The unique ID of the data center.
nat_gateway_id = 'nat_gateway_id_example' # String | The unique ID of the NAT Gateway.
flow_log_id = 'flow_log_id_example' # String | The unique ID of the Flow Log.
nat_gateway_flow_log = Ionoscloud::FlowLogPut.new({properties: Ionoscloud::FlowLogProperties.new({action: 'ACCEPTED', bucket: 'bucketName/key', direction: 'INGRESS', name: 'My resource'})}) # FlowLogPut | The modified NAT Gateway Flow Log.
opts = {
  pretty: true, # Boolean | Controls whether the response is pretty-printed (with indentations and new lines).
  depth: 56 # Integer | Controls the detail depth of the response objects.  GET /datacenters/[ID]  - depth=0: Only direct properties are included; children (servers and other elements) are not included.  - depth=1: Direct properties and children references are included.  - depth=2: Direct properties and children properties are included.  - depth=3: Direct properties and children properties and children's children are included.  - depth=... and so on
}

begin
  # Modify NAT Gateway Flow Logs
  result = api_instance.datacenters_natgateways_flowlogs_put(datacenter_id, nat_gateway_id, flow_log_id, nat_gateway_flow_log, opts)
  p result
rescue Ionoscloud::ApiError => e
  puts "Error when calling NATGatewaysApi->datacenters_natgateways_flowlogs_put: #{e}"
end
```

#### Using the datacenters\_natgateways\_flowlogs\_put\_with\_http\_info variant

This returns an Array which contains the response data, status code and headers.

> \<Array(, Integer, Hash)> datacenters\_natgateways\_flowlogs\_put\_with\_http\_info(datacenter\_id, nat\_gateway\_id, flow\_log\_id, nat\_gateway\_flow\_log, opts)

```ruby
begin
  # Modify NAT Gateway Flow Logs
  data, status_code, headers = api_instance.datacenters_natgateways_flowlogs_put_with_http_info(datacenter_id, nat_gateway_id, flow_log_id, nat_gateway_flow_log, opts)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => <FlowLog>
rescue Ionoscloud::ApiError => e
  puts "Error when calling NATGatewaysApi->datacenters_natgateways_flowlogs_put_with_http_info: #{e}"
end
```

### Parameters

| Name                        | Type                                             | Description                                                                                                                                                                                                                                                                                                                                                                                                                              | Notes                         |
| --------------------------- | ------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------- |
| **datacenter\_id**          | **String**                                       | The unique ID of the data center.                                                                                                                                                                                                                                                                                                                                                                                                        |                               |
| **nat\_gateway\_id**        | **String**                                       | The unique ID of the NAT Gateway.                                                                                                                                                                                                                                                                                                                                                                                                        |                               |
| **flow\_log\_id**           | **String**                                       | The unique ID of the Flow Log.                                                                                                                                                                                                                                                                                                                                                                                                           |                               |
| **nat\_gateway\_flow\_log** | [**FlowLogPut**](/ruby-sdk/models/flowlogput.md) | The modified NAT Gateway Flow Log.                                                                                                                                                                                                                                                                                                                                                                                                       |                               |
| **pretty**                  | **Boolean**                                      | Controls whether the response is pretty-printed (with indentations and new lines).                                                                                                                                                                                                                                                                                                                                                       | \[optional]\[default to true] |
| **depth**                   | **Integer**                                      | Controls the detail depth of the response objects. GET /datacenters/\[ID] - depth=0: Only direct properties are included; children (servers and other elements) are not included. - depth=1: Direct properties and children references are included. - depth=2: Direct properties and children properties are included. - depth=3: Direct properties and children properties and children's children are included. - depth=... and so on | \[optional]\[default to 0]    |

### Return type

[**FlowLog**](/ruby-sdk/models/flowlog.md)

### Authorization

Basic Authentication, Token Authentication

### HTTP request headers

* **Content-Type**: application/json
* **Accept**: application/json

## datacenters\_natgateways\_get

> datacenters\_natgateways\_get(datacenter\_id, opts)

List NAT Gateways

List all NAT Gateways within the data center.

### Examples

```ruby
require 'time'
require 'ionoscloud'
# setup authorization
Ionoscloud.configure do |config|
  # Configure HTTP basic authorization: Basic Authentication
  config.username = 'YOUR USERNAME'
  config.password = 'YOUR PASSWORD'

  # Configure API key authorization: Token Authentication
  config.api_key['Authorization'] = 'YOUR API KEY'
  # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
  # config.api_key_prefix['Authorization'] = 'Bearer'
end

api_instance = Ionoscloud::NATGatewaysApi.new
datacenter_id = 'datacenter_id_example' # String | The unique ID of the data center.
opts = {
  pretty: true, # Boolean | Controls whether the response is pretty-printed (with indentations and new lines).
  depth: 56, # Integer | Controls the detail depth of the response objects.  GET /datacenters/[ID]  - depth=0: Only direct properties are included; children (servers and other elements) are not included.  - depth=1: Direct properties and children references are included.  - depth=2: Direct properties and children properties are included.  - depth=3: Direct properties and children properties and children's children are included.  - depth=... and so on
  x_contract_number: 56 # Integer | Users with multiple contracts must provide the contract number, for which all API requests are to be executed.
}

begin
  # List NAT Gateways
  result = api_instance.datacenters_natgateways_get(datacenter_id, opts)
  p result
rescue Ionoscloud::ApiError => e
  puts "Error when calling NATGatewaysApi->datacenters_natgateways_get: #{e}"
end
```

#### Using the datacenters\_natgateways\_get\_with\_http\_info variant

This returns an Array which contains the response data, status code and headers.

> \<Array(, Integer, Hash)> datacenters\_natgateways\_get\_with\_http\_info(datacenter\_id, opts)

```ruby
begin
  # List NAT Gateways
  data, status_code, headers = api_instance.datacenters_natgateways_get_with_http_info(datacenter_id, opts)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => <NatGateways>
rescue Ionoscloud::ApiError => e
  puts "Error when calling NATGatewaysApi->datacenters_natgateways_get_with_http_info: #{e}"
end
```

### Parameters

| Name                    | Type        | Description                                                                                                                                                                                                                                                                                                                                                                                                                              | Notes                         |
| ----------------------- | ----------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------- |
| **datacenter\_id**      | **String**  | The unique ID of the data center.                                                                                                                                                                                                                                                                                                                                                                                                        |                               |
| **pretty**              | **Boolean** | Controls whether the response is pretty-printed (with indentations and new lines).                                                                                                                                                                                                                                                                                                                                                       | \[optional]\[default to true] |
| **depth**               | **Integer** | Controls the detail depth of the response objects. GET /datacenters/\[ID] - depth=0: Only direct properties are included; children (servers and other elements) are not included. - depth=1: Direct properties and children references are included. - depth=2: Direct properties and children properties are included. - depth=3: Direct properties and children properties and children's children are included. - depth=... and so on | \[optional]\[default to 0]    |
| **x\_contract\_number** | **Integer** | Users with multiple contracts must provide the contract number, for which all API requests are to be executed.                                                                                                                                                                                                                                                                                                                           | \[optional]                   |

### Return type

[**NatGateways**](/ruby-sdk/models/natgateways.md)

### Authorization

Basic Authentication, Token Authentication

### HTTP request headers

* **Content-Type**: Not defined
* **Accept**: application/json

## datacenters\_natgateways\_patch

> datacenters\_natgateways\_patch(datacenter\_id, nat\_gateway\_id, nat\_gateway\_properties, opts)

Partially modify NAT Gateways

Update the properties of the specified NAT Gateway within the data center.

### Examples

```ruby
require 'time'
require 'ionoscloud'
# setup authorization
Ionoscloud.configure do |config|
  # Configure HTTP basic authorization: Basic Authentication
  config.username = 'YOUR USERNAME'
  config.password = 'YOUR PASSWORD'

  # Configure API key authorization: Token Authentication
  config.api_key['Authorization'] = 'YOUR API KEY'
  # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
  # config.api_key_prefix['Authorization'] = 'Bearer'
end

api_instance = Ionoscloud::NATGatewaysApi.new
datacenter_id = 'datacenter_id_example' # String | The unique ID of the data center.
nat_gateway_id = 'nat_gateway_id_example' # String | The unique ID of the NAT Gateway.
nat_gateway_properties = Ionoscloud::NatGatewayProperties.new({name: 'My NAT Gateway', public_ips: ['public_ips_example']}) # NatGatewayProperties | The properties of the NAT Gateway to be updated.
opts = {
  pretty: true, # Boolean | Controls whether the response is pretty-printed (with indentations and new lines).
  depth: 56, # Integer | Controls the detail depth of the response objects.  GET /datacenters/[ID]  - depth=0: Only direct properties are included; children (servers and other elements) are not included.  - depth=1: Direct properties and children references are included.  - depth=2: Direct properties and children properties are included.  - depth=3: Direct properties and children properties and children's children are included.  - depth=... and so on
  x_contract_number: 56 # Integer | Users with multiple contracts must provide the contract number, for which all API requests are to be executed.
}

begin
  # Partially modify NAT Gateways
  result = api_instance.datacenters_natgateways_patch(datacenter_id, nat_gateway_id, nat_gateway_properties, opts)
  p result
rescue Ionoscloud::ApiError => e
  puts "Error when calling NATGatewaysApi->datacenters_natgateways_patch: #{e}"
end
```

#### Using the datacenters\_natgateways\_patch\_with\_http\_info variant

This returns an Array which contains the response data, status code and headers.

> \<Array(, Integer, Hash)> datacenters\_natgateways\_patch\_with\_http\_info(datacenter\_id, nat\_gateway\_id, nat\_gateway\_properties, opts)

```ruby
begin
  # Partially modify NAT Gateways
  data, status_code, headers = api_instance.datacenters_natgateways_patch_with_http_info(datacenter_id, nat_gateway_id, nat_gateway_properties, opts)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => <NatGateway>
rescue Ionoscloud::ApiError => e
  puts "Error when calling NATGatewaysApi->datacenters_natgateways_patch_with_http_info: #{e}"
end
```

### Parameters

| Name                         | Type                                                                 | Description                                                                                                                                                                                                                                                                                                                                                                                                                              | Notes                         |
| ---------------------------- | -------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------- |
| **datacenter\_id**           | **String**                                                           | The unique ID of the data center.                                                                                                                                                                                                                                                                                                                                                                                                        |                               |
| **nat\_gateway\_id**         | **String**                                                           | The unique ID of the NAT Gateway.                                                                                                                                                                                                                                                                                                                                                                                                        |                               |
| **nat\_gateway\_properties** | [**NatGatewayProperties**](/ruby-sdk/models/natgatewayproperties.md) | The properties of the NAT Gateway to be updated.                                                                                                                                                                                                                                                                                                                                                                                         |                               |
| **pretty**                   | **Boolean**                                                          | Controls whether the response is pretty-printed (with indentations and new lines).                                                                                                                                                                                                                                                                                                                                                       | \[optional]\[default to true] |
| **depth**                    | **Integer**                                                          | Controls the detail depth of the response objects. GET /datacenters/\[ID] - depth=0: Only direct properties are included; children (servers and other elements) are not included. - depth=1: Direct properties and children references are included. - depth=2: Direct properties and children properties are included. - depth=3: Direct properties and children properties and children's children are included. - depth=... and so on | \[optional]\[default to 0]    |
| **x\_contract\_number**      | **Integer**                                                          | Users with multiple contracts must provide the contract number, for which all API requests are to be executed.                                                                                                                                                                                                                                                                                                                           | \[optional]                   |

### Return type

[**NatGateway**](/ruby-sdk/models/natgateway.md)

### Authorization

Basic Authentication, Token Authentication

### HTTP request headers

* **Content-Type**: Not defined
* **Accept**: application/json

## datacenters\_natgateways\_post

> datacenters\_natgateways\_post(datacenter\_id, nat\_gateway, opts)

Create a NAT Gateway

Creates a NAT Gateway within the data center. This operation is restricted to contract owner, admin, and users with 'createInternetAccess' privileges.

### Examples

```ruby
require 'time'
require 'ionoscloud'
# setup authorization
Ionoscloud.configure do |config|
  # Configure HTTP basic authorization: Basic Authentication
  config.username = 'YOUR USERNAME'
  config.password = 'YOUR PASSWORD'

  # Configure API key authorization: Token Authentication
  config.api_key['Authorization'] = 'YOUR API KEY'
  # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
  # config.api_key_prefix['Authorization'] = 'Bearer'
end

api_instance = Ionoscloud::NATGatewaysApi.new
datacenter_id = 'datacenter_id_example' # String | The unique ID of the data center.
nat_gateway = Ionoscloud::NatGateway.new({properties: Ionoscloud::NatGatewayProperties.new({name: 'My NAT Gateway', public_ips: ['public_ips_example']})}) # NatGateway | The NAT Gateway to create.
opts = {
  pretty: true, # Boolean | Controls whether the response is pretty-printed (with indentations and new lines).
  depth: 56, # Integer | Controls the detail depth of the response objects.  GET /datacenters/[ID]  - depth=0: Only direct properties are included; children (servers and other elements) are not included.  - depth=1: Direct properties and children references are included.  - depth=2: Direct properties and children properties are included.  - depth=3: Direct properties and children properties and children's children are included.  - depth=... and so on
  x_contract_number: 56 # Integer | Users with multiple contracts must provide the contract number, for which all API requests are to be executed.
}

begin
  # Create a NAT Gateway
  result = api_instance.datacenters_natgateways_post(datacenter_id, nat_gateway, opts)
  p result
rescue Ionoscloud::ApiError => e
  puts "Error when calling NATGatewaysApi->datacenters_natgateways_post: #{e}"
end
```

#### Using the datacenters\_natgateways\_post\_with\_http\_info variant

This returns an Array which contains the response data, status code and headers.

> \<Array(, Integer, Hash)> datacenters\_natgateways\_post\_with\_http\_info(datacenter\_id, nat\_gateway, opts)

```ruby
begin
  # Create a NAT Gateway
  data, status_code, headers = api_instance.datacenters_natgateways_post_with_http_info(datacenter_id, nat_gateway, opts)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => <NatGateway>
rescue Ionoscloud::ApiError => e
  puts "Error when calling NATGatewaysApi->datacenters_natgateways_post_with_http_info: #{e}"
end
```

### Parameters

| Name                    | Type                                             | Description                                                                                                                                                                                                                                                                                                                                                                                                                              | Notes                         |
| ----------------------- | ------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------- |
| **datacenter\_id**      | **String**                                       | The unique ID of the data center.                                                                                                                                                                                                                                                                                                                                                                                                        |                               |
| **nat\_gateway**        | [**NatGateway**](/ruby-sdk/models/natgateway.md) | The NAT Gateway to create.                                                                                                                                                                                                                                                                                                                                                                                                               |                               |
| **pretty**              | **Boolean**                                      | Controls whether the response is pretty-printed (with indentations and new lines).                                                                                                                                                                                                                                                                                                                                                       | \[optional]\[default to true] |
| **depth**               | **Integer**                                      | Controls the detail depth of the response objects. GET /datacenters/\[ID] - depth=0: Only direct properties are included; children (servers and other elements) are not included. - depth=1: Direct properties and children references are included. - depth=2: Direct properties and children properties are included. - depth=3: Direct properties and children properties and children's children are included. - depth=... and so on | \[optional]\[default to 0]    |
| **x\_contract\_number** | **Integer**                                      | Users with multiple contracts must provide the contract number, for which all API requests are to be executed.                                                                                                                                                                                                                                                                                                                           | \[optional]                   |

### Return type

[**NatGateway**](/ruby-sdk/models/natgateway.md)

### Authorization

Basic Authentication, Token Authentication

### HTTP request headers

* **Content-Type**: application/json
* **Accept**: application/json

## datacenters\_natgateways\_put

> datacenters\_natgateways\_put(datacenter\_id, nat\_gateway\_id, nat\_gateway, opts)

Modify NAT Gateways

Modify the properties of the specified NAT Gateway within the data center.

### Examples

```ruby
require 'time'
require 'ionoscloud'
# setup authorization
Ionoscloud.configure do |config|
  # Configure HTTP basic authorization: Basic Authentication
  config.username = 'YOUR USERNAME'
  config.password = 'YOUR PASSWORD'

  # Configure API key authorization: Token Authentication
  config.api_key['Authorization'] = 'YOUR API KEY'
  # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
  # config.api_key_prefix['Authorization'] = 'Bearer'
end

api_instance = Ionoscloud::NATGatewaysApi.new
datacenter_id = 'datacenter_id_example' # String | The unique ID of the data center.
nat_gateway_id = 'nat_gateway_id_example' # String | The unique ID of the NAT Gateway.
nat_gateway = Ionoscloud::NatGatewayPut.new({properties: Ionoscloud::NatGatewayProperties.new({name: 'My NAT Gateway', public_ips: ['public_ips_example']})}) # NatGatewayPut | The modified NAT Gateway.
opts = {
  pretty: true, # Boolean | Controls whether the response is pretty-printed (with indentations and new lines).
  depth: 56, # Integer | Controls the detail depth of the response objects.  GET /datacenters/[ID]  - depth=0: Only direct properties are included; children (servers and other elements) are not included.  - depth=1: Direct properties and children references are included.  - depth=2: Direct properties and children properties are included.  - depth=3: Direct properties and children properties and children's children are included.  - depth=... and so on
  x_contract_number: 56 # Integer | Users with multiple contracts must provide the contract number, for which all API requests are to be executed.
}

begin
  # Modify NAT Gateways
  result = api_instance.datacenters_natgateways_put(datacenter_id, nat_gateway_id, nat_gateway, opts)
  p result
rescue Ionoscloud::ApiError => e
  puts "Error when calling NATGatewaysApi->datacenters_natgateways_put: #{e}"
end
```

#### Using the datacenters\_natgateways\_put\_with\_http\_info variant

This returns an Array which contains the response data, status code and headers.

> \<Array(, Integer, Hash)> datacenters\_natgateways\_put\_with\_http\_info(datacenter\_id, nat\_gateway\_id, nat\_gateway, opts)

```ruby
begin
  # Modify NAT Gateways
  data, status_code, headers = api_instance.datacenters_natgateways_put_with_http_info(datacenter_id, nat_gateway_id, nat_gateway, opts)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => <NatGateway>
rescue Ionoscloud::ApiError => e
  puts "Error when calling NATGatewaysApi->datacenters_natgateways_put_with_http_info: #{e}"
end
```

### Parameters

| Name                    | Type                                                   | Description                                                                                                                                                                                                                                                                                                                                                                                                                              | Notes                         |
| ----------------------- | ------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------- |
| **datacenter\_id**      | **String**                                             | The unique ID of the data center.                                                                                                                                                                                                                                                                                                                                                                                                        |                               |
| **nat\_gateway\_id**    | **String**                                             | The unique ID of the NAT Gateway.                                                                                                                                                                                                                                                                                                                                                                                                        |                               |
| **nat\_gateway**        | [**NatGatewayPut**](/ruby-sdk/models/natgatewayput.md) | The modified NAT Gateway.                                                                                                                                                                                                                                                                                                                                                                                                                |                               |
| **pretty**              | **Boolean**                                            | Controls whether the response is pretty-printed (with indentations and new lines).                                                                                                                                                                                                                                                                                                                                                       | \[optional]\[default to true] |
| **depth**               | **Integer**                                            | Controls the detail depth of the response objects. GET /datacenters/\[ID] - depth=0: Only direct properties are included; children (servers and other elements) are not included. - depth=1: Direct properties and children references are included. - depth=2: Direct properties and children properties are included. - depth=3: Direct properties and children properties and children's children are included. - depth=... and so on | \[optional]\[default to 0]    |
| **x\_contract\_number** | **Integer**                                            | Users with multiple contracts must provide the contract number, for which all API requests are to be executed.                                                                                                                                                                                                                                                                                                                           | \[optional]                   |

### Return type

[**NatGateway**](/ruby-sdk/models/natgateway.md)

### Authorization

Basic Authentication, Token Authentication

### HTTP request headers

* **Content-Type**: application/json
* **Accept**: application/json

## datacenters\_natgateways\_rules\_delete

> datacenters\_natgateways\_rules\_delete(datacenter\_id, nat\_gateway\_id, nat\_gateway\_rule\_id, opts)

Delete NAT Gateway rules

Delete the specified NAT Gateway rule.

### Examples

```ruby
require 'time'
require 'ionoscloud'
# setup authorization
Ionoscloud.configure do |config|
  # Configure HTTP basic authorization: Basic Authentication
  config.username = 'YOUR USERNAME'
  config.password = 'YOUR PASSWORD'

  # Configure API key authorization: Token Authentication
  config.api_key['Authorization'] = 'YOUR API KEY'
  # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
  # config.api_key_prefix['Authorization'] = 'Bearer'
end

api_instance = Ionoscloud::NATGatewaysApi.new
datacenter_id = 'datacenter_id_example' # String | The unique ID of the data center.
nat_gateway_id = 'nat_gateway_id_example' # String | The unique ID of the NAT Gateway.
nat_gateway_rule_id = 'nat_gateway_rule_id_example' # String | The unique ID of the NAT Gateway rule.
opts = {
  pretty: true, # Boolean | Controls whether the response is pretty-printed (with indentations and new lines).
  depth: 56, # Integer | Controls the detail depth of the response objects.  GET /datacenters/[ID]  - depth=0: Only direct properties are included; children (servers and other elements) are not included.  - depth=1: Direct properties and children references are included.  - depth=2: Direct properties and children properties are included.  - depth=3: Direct properties and children properties and children's children are included.  - depth=... and so on
  x_contract_number: 56 # Integer | Users with multiple contracts must provide the contract number, for which all API requests are to be executed.
}

begin
  # Delete NAT Gateway rules
  api_instance.datacenters_natgateways_rules_delete(datacenter_id, nat_gateway_id, nat_gateway_rule_id, opts)
rescue Ionoscloud::ApiError => e
  puts "Error when calling NATGatewaysApi->datacenters_natgateways_rules_delete: #{e}"
end
```

#### Using the datacenters\_natgateways\_rules\_delete\_with\_http\_info variant

This returns an Array which contains the response data (`nil` in this case), status code and headers.

> \<Array(nil, Integer, Hash)> datacenters\_natgateways\_rules\_delete\_with\_http\_info(datacenter\_id, nat\_gateway\_id, nat\_gateway\_rule\_id, opts)

```ruby
begin
  # Delete NAT Gateway rules
  data, status_code, headers = api_instance.datacenters_natgateways_rules_delete_with_http_info(datacenter_id, nat_gateway_id, nat_gateway_rule_id, opts)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => nil
rescue Ionoscloud::ApiError => e
  puts "Error when calling NATGatewaysApi->datacenters_natgateways_rules_delete_with_http_info: #{e}"
end
```

### Parameters

| Name                       | Type        | Description                                                                                                                                                                                                                                                                                                                                                                                                                              | Notes                         |
| -------------------------- | ----------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------- |
| **datacenter\_id**         | **String**  | The unique ID of the data center.                                                                                                                                                                                                                                                                                                                                                                                                        |                               |
| **nat\_gateway\_id**       | **String**  | The unique ID of the NAT Gateway.                                                                                                                                                                                                                                                                                                                                                                                                        |                               |
| **nat\_gateway\_rule\_id** | **String**  | The unique ID of the NAT Gateway rule.                                                                                                                                                                                                                                                                                                                                                                                                   |                               |
| **pretty**                 | **Boolean** | Controls whether the response is pretty-printed (with indentations and new lines).                                                                                                                                                                                                                                                                                                                                                       | \[optional]\[default to true] |
| **depth**                  | **Integer** | Controls the detail depth of the response objects. GET /datacenters/\[ID] - depth=0: Only direct properties are included; children (servers and other elements) are not included. - depth=1: Direct properties and children references are included. - depth=2: Direct properties and children properties are included. - depth=3: Direct properties and children properties and children's children are included. - depth=... and so on | \[optional]\[default to 0]    |
| **x\_contract\_number**    | **Integer** | Users with multiple contracts must provide the contract number, for which all API requests are to be executed.                                                                                                                                                                                                                                                                                                                           | \[optional]                   |

### Return type

nil (empty response body)

### Authorization

Basic Authentication, Token Authentication

### HTTP request headers

* **Content-Type**: Not defined
* **Accept**: application/json

## datacenters\_natgateways\_rules\_find\_by\_nat\_gateway\_rule\_id

> datacenters\_natgateways\_rules\_find\_by\_nat\_gateway\_rule\_id(datacenter\_id, nat\_gateway\_id, nat\_gateway\_rule\_id, opts)

Retrieve NAT Gateway rules

Retrieve the properties of the specified NAT Gateway rule.

### Examples

```ruby
require 'time'
require 'ionoscloud'
# setup authorization
Ionoscloud.configure do |config|
  # Configure HTTP basic authorization: Basic Authentication
  config.username = 'YOUR USERNAME'
  config.password = 'YOUR PASSWORD'

  # Configure API key authorization: Token Authentication
  config.api_key['Authorization'] = 'YOUR API KEY'
  # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
  # config.api_key_prefix['Authorization'] = 'Bearer'
end

api_instance = Ionoscloud::NATGatewaysApi.new
datacenter_id = 'datacenter_id_example' # String | The unique ID of the data center.
nat_gateway_id = 'nat_gateway_id_example' # String | The unique ID of the NAT Gateway.
nat_gateway_rule_id = 'nat_gateway_rule_id_example' # String | The unique ID of the NAT Gateway rule.
opts = {
  pretty: true, # Boolean | Controls whether the response is pretty-printed (with indentations and new lines).
  depth: 56, # Integer | Controls the detail depth of the response objects.  GET /datacenters/[ID]  - depth=0: Only direct properties are included; children (servers and other elements) are not included.  - depth=1: Direct properties and children references are included.  - depth=2: Direct properties and children properties are included.  - depth=3: Direct properties and children properties and children's children are included.  - depth=... and so on
  x_contract_number: 56 # Integer | Users with multiple contracts must provide the contract number, for which all API requests are to be executed.
}

begin
  # Retrieve NAT Gateway rules
  result = api_instance.datacenters_natgateways_rules_find_by_nat_gateway_rule_id(datacenter_id, nat_gateway_id, nat_gateway_rule_id, opts)
  p result
rescue Ionoscloud::ApiError => e
  puts "Error when calling NATGatewaysApi->datacenters_natgateways_rules_find_by_nat_gateway_rule_id: #{e}"
end
```

#### Using the datacenters\_natgateways\_rules\_find\_by\_nat\_gateway\_rule\_id\_with\_http\_info variant

This returns an Array which contains the response data, status code and headers.

> \<Array(, Integer, Hash)> datacenters\_natgateways\_rules\_find\_by\_nat\_gateway\_rule\_id\_with\_http\_info(datacenter\_id, nat\_gateway\_id, nat\_gateway\_rule\_id, opts)

```ruby
begin
  # Retrieve NAT Gateway rules
  data, status_code, headers = api_instance.datacenters_natgateways_rules_find_by_nat_gateway_rule_id_with_http_info(datacenter_id, nat_gateway_id, nat_gateway_rule_id, opts)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => <NatGatewayRule>
rescue Ionoscloud::ApiError => e
  puts "Error when calling NATGatewaysApi->datacenters_natgateways_rules_find_by_nat_gateway_rule_id_with_http_info: #{e}"
end
```

### Parameters

| Name                       | Type        | Description                                                                                                                                                                                                                                                                                                                                                                                                                              | Notes                         |
| -------------------------- | ----------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------- |
| **datacenter\_id**         | **String**  | The unique ID of the data center.                                                                                                                                                                                                                                                                                                                                                                                                        |                               |
| **nat\_gateway\_id**       | **String**  | The unique ID of the NAT Gateway.                                                                                                                                                                                                                                                                                                                                                                                                        |                               |
| **nat\_gateway\_rule\_id** | **String**  | The unique ID of the NAT Gateway rule.                                                                                                                                                                                                                                                                                                                                                                                                   |                               |
| **pretty**                 | **Boolean** | Controls whether the response is pretty-printed (with indentations and new lines).                                                                                                                                                                                                                                                                                                                                                       | \[optional]\[default to true] |
| **depth**                  | **Integer** | Controls the detail depth of the response objects. GET /datacenters/\[ID] - depth=0: Only direct properties are included; children (servers and other elements) are not included. - depth=1: Direct properties and children references are included. - depth=2: Direct properties and children properties are included. - depth=3: Direct properties and children properties and children's children are included. - depth=... and so on | \[optional]\[default to 0]    |
| **x\_contract\_number**    | **Integer** | Users with multiple contracts must provide the contract number, for which all API requests are to be executed.                                                                                                                                                                                                                                                                                                                           | \[optional]                   |

### Return type

[**NatGatewayRule**](/ruby-sdk/models/natgatewayrule.md)

### Authorization

Basic Authentication, Token Authentication

### HTTP request headers

* **Content-Type**: Not defined
* **Accept**: application/json

## datacenters\_natgateways\_rules\_get

> datacenters\_natgateways\_rules\_get(datacenter\_id, nat\_gateway\_id, opts)

List NAT Gateway rules

List all rules for the specified NAT Gateway.

### Examples

```ruby
require 'time'
require 'ionoscloud'
# setup authorization
Ionoscloud.configure do |config|
  # Configure HTTP basic authorization: Basic Authentication
  config.username = 'YOUR USERNAME'
  config.password = 'YOUR PASSWORD'

  # Configure API key authorization: Token Authentication
  config.api_key['Authorization'] = 'YOUR API KEY'
  # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
  # config.api_key_prefix['Authorization'] = 'Bearer'
end

api_instance = Ionoscloud::NATGatewaysApi.new
datacenter_id = 'datacenter_id_example' # String | The unique ID of the data center.
nat_gateway_id = 'nat_gateway_id_example' # String | The unique ID of the NAT Gateway.
opts = {
  pretty: true, # Boolean | Controls whether the response is pretty-printed (with indentations and new lines).
  depth: 56, # Integer | Controls the detail depth of the response objects.  GET /datacenters/[ID]  - depth=0: Only direct properties are included; children (servers and other elements) are not included.  - depth=1: Direct properties and children references are included.  - depth=2: Direct properties and children properties are included.  - depth=3: Direct properties and children properties and children's children are included.  - depth=... and so on
  x_contract_number: 56 # Integer | Users with multiple contracts must provide the contract number, for which all API requests are to be executed.
}

begin
  # List NAT Gateway rules
  result = api_instance.datacenters_natgateways_rules_get(datacenter_id, nat_gateway_id, opts)
  p result
rescue Ionoscloud::ApiError => e
  puts "Error when calling NATGatewaysApi->datacenters_natgateways_rules_get: #{e}"
end
```

#### Using the datacenters\_natgateways\_rules\_get\_with\_http\_info variant

This returns an Array which contains the response data, status code and headers.

> \<Array(, Integer, Hash)> datacenters\_natgateways\_rules\_get\_with\_http\_info(datacenter\_id, nat\_gateway\_id, opts)

```ruby
begin
  # List NAT Gateway rules
  data, status_code, headers = api_instance.datacenters_natgateways_rules_get_with_http_info(datacenter_id, nat_gateway_id, opts)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => <NatGatewayRules>
rescue Ionoscloud::ApiError => e
  puts "Error when calling NATGatewaysApi->datacenters_natgateways_rules_get_with_http_info: #{e}"
end
```

### Parameters

| Name                    | Type        | Description                                                                                                                                                                                                                                                                                                                                                                                                                              | Notes                         |
| ----------------------- | ----------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------- |
| **datacenter\_id**      | **String**  | The unique ID of the data center.                                                                                                                                                                                                                                                                                                                                                                                                        |                               |
| **nat\_gateway\_id**    | **String**  | The unique ID of the NAT Gateway.                                                                                                                                                                                                                                                                                                                                                                                                        |                               |
| **pretty**              | **Boolean** | Controls whether the response is pretty-printed (with indentations and new lines).                                                                                                                                                                                                                                                                                                                                                       | \[optional]\[default to true] |
| **depth**               | **Integer** | Controls the detail depth of the response objects. GET /datacenters/\[ID] - depth=0: Only direct properties are included; children (servers and other elements) are not included. - depth=1: Direct properties and children references are included. - depth=2: Direct properties and children properties are included. - depth=3: Direct properties and children properties and children's children are included. - depth=... and so on | \[optional]\[default to 0]    |
| **x\_contract\_number** | **Integer** | Users with multiple contracts must provide the contract number, for which all API requests are to be executed.                                                                                                                                                                                                                                                                                                                           | \[optional]                   |

### Return type

[**NatGatewayRules**](/ruby-sdk/models/natgatewayrules.md)

### Authorization

Basic Authentication, Token Authentication

### HTTP request headers

* **Content-Type**: Not defined
* **Accept**: application/json

## datacenters\_natgateways\_rules\_patch

> datacenters\_natgateways\_rules\_patch(datacenter\_id, nat\_gateway\_id, nat\_gateway\_rule\_id, nat\_gateway\_rule\_properties, opts)

Partially Modify a NAT Gateway Rule by ID

Updates the properties of the specified NAT Gateway rule.

### Examples

```ruby
require 'time'
require 'ionoscloud'
# setup authorization
Ionoscloud.configure do |config|
  # Configure HTTP basic authorization: Basic Authentication
  config.username = 'YOUR USERNAME'
  config.password = 'YOUR PASSWORD'

  # Configure API key authorization: Token Authentication
  config.api_key['Authorization'] = 'YOUR API KEY'
  # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
  # config.api_key_prefix['Authorization'] = 'Bearer'
end

api_instance = Ionoscloud::NATGatewaysApi.new
datacenter_id = 'datacenter_id_example' # String | The unique ID of the data center.
nat_gateway_id = 'nat_gateway_id_example' # String | The unique ID of the NAT Gateway.
nat_gateway_rule_id = 'nat_gateway_rule_id_example' # String | The unique ID of the NAT Gateway rule.
nat_gateway_rule_properties = Ionoscloud::NatGatewayRuleProperties.new({name: 'My NAT Gateway rule', public_ip: '192.18.7.17', source_subnet: '10.0.1.0/24'}) # NatGatewayRuleProperties | The properties of the NAT Gateway rule to be updated.
opts = {
  pretty: true, # Boolean | Controls whether the response is pretty-printed (with indentations and new lines).
  depth: 56, # Integer | Controls the detail depth of the response objects.  GET /datacenters/[ID]  - depth=0: Only direct properties are included; children (servers and other elements) are not included.  - depth=1: Direct properties and children references are included.  - depth=2: Direct properties and children properties are included.  - depth=3: Direct properties and children properties and children's children are included.  - depth=... and so on
  x_contract_number: 56 # Integer | Users with multiple contracts must provide the contract number, for which all API requests are to be executed.
}

begin
  # Partially Modify a NAT Gateway Rule by ID
  result = api_instance.datacenters_natgateways_rules_patch(datacenter_id, nat_gateway_id, nat_gateway_rule_id, nat_gateway_rule_properties, opts)
  p result
rescue Ionoscloud::ApiError => e
  puts "Error when calling NATGatewaysApi->datacenters_natgateways_rules_patch: #{e}"
end
```

#### Using the datacenters\_natgateways\_rules\_patch\_with\_http\_info variant

This returns an Array which contains the response data, status code and headers.

> \<Array(, Integer, Hash)> datacenters\_natgateways\_rules\_patch\_with\_http\_info(datacenter\_id, nat\_gateway\_id, nat\_gateway\_rule\_id, nat\_gateway\_rule\_properties, opts)

```ruby
begin
  # Partially Modify a NAT Gateway Rule by ID
  data, status_code, headers = api_instance.datacenters_natgateways_rules_patch_with_http_info(datacenter_id, nat_gateway_id, nat_gateway_rule_id, nat_gateway_rule_properties, opts)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => <NatGatewayRule>
rescue Ionoscloud::ApiError => e
  puts "Error when calling NATGatewaysApi->datacenters_natgateways_rules_patch_with_http_info: #{e}"
end
```

### Parameters

| Name                               | Type                                                                         | Description                                                                                                                                                                                                                                                                                                                                                                                                                              | Notes                         |
| ---------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------- |
| **datacenter\_id**                 | **String**                                                                   | The unique ID of the data center.                                                                                                                                                                                                                                                                                                                                                                                                        |                               |
| **nat\_gateway\_id**               | **String**                                                                   | The unique ID of the NAT Gateway.                                                                                                                                                                                                                                                                                                                                                                                                        |                               |
| **nat\_gateway\_rule\_id**         | **String**                                                                   | The unique ID of the NAT Gateway rule.                                                                                                                                                                                                                                                                                                                                                                                                   |                               |
| **nat\_gateway\_rule\_properties** | [**NatGatewayRuleProperties**](/ruby-sdk/models/natgatewayruleproperties.md) | The properties of the NAT Gateway rule to be updated.                                                                                                                                                                                                                                                                                                                                                                                    |                               |
| **pretty**                         | **Boolean**                                                                  | Controls whether the response is pretty-printed (with indentations and new lines).                                                                                                                                                                                                                                                                                                                                                       | \[optional]\[default to true] |
| **depth**                          | **Integer**                                                                  | Controls the detail depth of the response objects. GET /datacenters/\[ID] - depth=0: Only direct properties are included; children (servers and other elements) are not included. - depth=1: Direct properties and children references are included. - depth=2: Direct properties and children properties are included. - depth=3: Direct properties and children properties and children's children are included. - depth=... and so on | \[optional]\[default to 0]    |
| **x\_contract\_number**            | **Integer**                                                                  | Users with multiple contracts must provide the contract number, for which all API requests are to be executed.                                                                                                                                                                                                                                                                                                                           | \[optional]                   |

### Return type

[**NatGatewayRule**](/ruby-sdk/models/natgatewayrule.md)

### Authorization

Basic Authentication, Token Authentication

### HTTP request headers

* **Content-Type**: Not defined
* **Accept**: application/json

## datacenters\_natgateways\_rules\_post

> datacenters\_natgateways\_rules\_post(datacenter\_id, nat\_gateway\_id, nat\_gateway\_rule, opts)

Create a NAT Gateway Rule

Creates a rule for the specified NAT Gateway.

### Examples

```ruby
require 'time'
require 'ionoscloud'
# setup authorization
Ionoscloud.configure do |config|
  # Configure HTTP basic authorization: Basic Authentication
  config.username = 'YOUR USERNAME'
  config.password = 'YOUR PASSWORD'

  # Configure API key authorization: Token Authentication
  config.api_key['Authorization'] = 'YOUR API KEY'
  # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
  # config.api_key_prefix['Authorization'] = 'Bearer'
end

api_instance = Ionoscloud::NATGatewaysApi.new
datacenter_id = 'datacenter_id_example' # String | The unique ID of the data center.
nat_gateway_id = 'nat_gateway_id_example' # String | The unique ID of the NAT Gateway.
nat_gateway_rule = Ionoscloud::NatGatewayRule.new({properties: Ionoscloud::NatGatewayRuleProperties.new({name: 'My NAT Gateway rule', public_ip: '192.18.7.17', source_subnet: '10.0.1.0/24'})}) # NatGatewayRule | The NAT Gateway rule to create.
opts = {
  pretty: true, # Boolean | Controls whether the response is pretty-printed (with indentations and new lines).
  depth: 56, # Integer | Controls the detail depth of the response objects.  GET /datacenters/[ID]  - depth=0: Only direct properties are included; children (servers and other elements) are not included.  - depth=1: Direct properties and children references are included.  - depth=2: Direct properties and children properties are included.  - depth=3: Direct properties and children properties and children's children are included.  - depth=... and so on
  x_contract_number: 56 # Integer | Users with multiple contracts must provide the contract number, for which all API requests are to be executed.
}

begin
  # Create a NAT Gateway Rule
  result = api_instance.datacenters_natgateways_rules_post(datacenter_id, nat_gateway_id, nat_gateway_rule, opts)
  p result
rescue Ionoscloud::ApiError => e
  puts "Error when calling NATGatewaysApi->datacenters_natgateways_rules_post: #{e}"
end
```

#### Using the datacenters\_natgateways\_rules\_post\_with\_http\_info variant

This returns an Array which contains the response data, status code and headers.

> \<Array(, Integer, Hash)> datacenters\_natgateways\_rules\_post\_with\_http\_info(datacenter\_id, nat\_gateway\_id, nat\_gateway\_rule, opts)

```ruby
begin
  # Create a NAT Gateway Rule
  data, status_code, headers = api_instance.datacenters_natgateways_rules_post_with_http_info(datacenter_id, nat_gateway_id, nat_gateway_rule, opts)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => <NatGatewayRule>
rescue Ionoscloud::ApiError => e
  puts "Error when calling NATGatewaysApi->datacenters_natgateways_rules_post_with_http_info: #{e}"
end
```

### Parameters

| Name                    | Type                                                     | Description                                                                                                                                                                                                                                                                                                                                                                                                                              | Notes                         |
| ----------------------- | -------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------- |
| **datacenter\_id**      | **String**                                               | The unique ID of the data center.                                                                                                                                                                                                                                                                                                                                                                                                        |                               |
| **nat\_gateway\_id**    | **String**                                               | The unique ID of the NAT Gateway.                                                                                                                                                                                                                                                                                                                                                                                                        |                               |
| **nat\_gateway\_rule**  | [**NatGatewayRule**](/ruby-sdk/models/natgatewayrule.md) | The NAT Gateway rule to create.                                                                                                                                                                                                                                                                                                                                                                                                          |                               |
| **pretty**              | **Boolean**                                              | Controls whether the response is pretty-printed (with indentations and new lines).                                                                                                                                                                                                                                                                                                                                                       | \[optional]\[default to true] |
| **depth**               | **Integer**                                              | Controls the detail depth of the response objects. GET /datacenters/\[ID] - depth=0: Only direct properties are included; children (servers and other elements) are not included. - depth=1: Direct properties and children references are included. - depth=2: Direct properties and children properties are included. - depth=3: Direct properties and children properties and children's children are included. - depth=... and so on | \[optional]\[default to 0]    |
| **x\_contract\_number** | **Integer**                                              | Users with multiple contracts must provide the contract number, for which all API requests are to be executed.                                                                                                                                                                                                                                                                                                                           | \[optional]                   |

### Return type

[**NatGatewayRule**](/ruby-sdk/models/natgatewayrule.md)

### Authorization

Basic Authentication, Token Authentication

### HTTP request headers

* **Content-Type**: application/json
* **Accept**: application/json

## datacenters\_natgateways\_rules\_put

> datacenters\_natgateways\_rules\_put(datacenter\_id, nat\_gateway\_id, nat\_gateway\_rule\_id, nat\_gateway\_rule, opts)

Modify a NAT Gateway Rule by ID

Modify the specified NAT Gateway rule.

### Examples

```ruby
require 'time'
require 'ionoscloud'
# setup authorization
Ionoscloud.configure do |config|
  # Configure HTTP basic authorization: Basic Authentication
  config.username = 'YOUR USERNAME'
  config.password = 'YOUR PASSWORD'

  # Configure API key authorization: Token Authentication
  config.api_key['Authorization'] = 'YOUR API KEY'
  # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
  # config.api_key_prefix['Authorization'] = 'Bearer'
end

api_instance = Ionoscloud::NATGatewaysApi.new
datacenter_id = 'datacenter_id_example' # String | The unique ID of the data center.
nat_gateway_id = 'nat_gateway_id_example' # String | The unique ID of the NAT Gateway.
nat_gateway_rule_id = 'nat_gateway_rule_id_example' # String | The unique ID of the NAT Gateway rule.
nat_gateway_rule = Ionoscloud::NatGatewayRulePut.new({properties: Ionoscloud::NatGatewayRuleProperties.new({name: 'My NAT Gateway rule', public_ip: '192.18.7.17', source_subnet: '10.0.1.0/24'})}) # NatGatewayRulePut | The modified NAT Gateway rule.
opts = {
  pretty: true, # Boolean | Controls whether the response is pretty-printed (with indentations and new lines).
  depth: 56, # Integer | Controls the detail depth of the response objects.  GET /datacenters/[ID]  - depth=0: Only direct properties are included; children (servers and other elements) are not included.  - depth=1: Direct properties and children references are included.  - depth=2: Direct properties and children properties are included.  - depth=3: Direct properties and children properties and children's children are included.  - depth=... and so on
  x_contract_number: 56 # Integer | Users with multiple contracts must provide the contract number, for which all API requests are to be executed.
}

begin
  # Modify a NAT Gateway Rule by ID
  result = api_instance.datacenters_natgateways_rules_put(datacenter_id, nat_gateway_id, nat_gateway_rule_id, nat_gateway_rule, opts)
  p result
rescue Ionoscloud::ApiError => e
  puts "Error when calling NATGatewaysApi->datacenters_natgateways_rules_put: #{e}"
end
```

#### Using the datacenters\_natgateways\_rules\_put\_with\_http\_info variant

This returns an Array which contains the response data, status code and headers.

> \<Array(, Integer, Hash)> datacenters\_natgateways\_rules\_put\_with\_http\_info(datacenter\_id, nat\_gateway\_id, nat\_gateway\_rule\_id, nat\_gateway\_rule, opts)

```ruby
begin
  # Modify a NAT Gateway Rule by ID
  data, status_code, headers = api_instance.datacenters_natgateways_rules_put_with_http_info(datacenter_id, nat_gateway_id, nat_gateway_rule_id, nat_gateway_rule, opts)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => <NatGatewayRule>
rescue Ionoscloud::ApiError => e
  puts "Error when calling NATGatewaysApi->datacenters_natgateways_rules_put_with_http_info: #{e}"
end
```

### Parameters

| Name                       | Type                                                           | Description                                                                                                                                                                                                                                                                                                                                                                                                                              | Notes                         |
| -------------------------- | -------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------- |
| **datacenter\_id**         | **String**                                                     | The unique ID of the data center.                                                                                                                                                                                                                                                                                                                                                                                                        |                               |
| **nat\_gateway\_id**       | **String**                                                     | The unique ID of the NAT Gateway.                                                                                                                                                                                                                                                                                                                                                                                                        |                               |
| **nat\_gateway\_rule\_id** | **String**                                                     | The unique ID of the NAT Gateway rule.                                                                                                                                                                                                                                                                                                                                                                                                   |                               |
| **nat\_gateway\_rule**     | [**NatGatewayRulePut**](/ruby-sdk/models/natgatewayruleput.md) | The modified NAT Gateway rule.                                                                                                                                                                                                                                                                                                                                                                                                           |                               |
| **pretty**                 | **Boolean**                                                    | Controls whether the response is pretty-printed (with indentations and new lines).                                                                                                                                                                                                                                                                                                                                                       | \[optional]\[default to true] |
| **depth**                  | **Integer**                                                    | Controls the detail depth of the response objects. GET /datacenters/\[ID] - depth=0: Only direct properties are included; children (servers and other elements) are not included. - depth=1: Direct properties and children references are included. - depth=2: Direct properties and children properties are included. - depth=3: Direct properties and children properties and children's children are included. - depth=... and so on | \[optional]\[default to 0]    |
| **x\_contract\_number**    | **Integer**                                                    | Users with multiple contracts must provide the contract number, for which all API requests are to be executed.                                                                                                                                                                                                                                                                                                                           | \[optional]                   |

### Return type

[**NatGatewayRule**](/ruby-sdk/models/natgatewayrule.md)

### Authorization

Basic Authentication, Token Authentication

### HTTP request headers

* **Content-Type**: application/json
* **Accept**: application/json


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.ionos.com/ruby-sdk/api/natgatewaysapi.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
