To create and manage your Private Networks, check out the [VPC API](https://www.scaleway.com/en/developers/api/vpc). (switchcolumn) ## Concepts Refer to our [dedicated concepts page](https://www.scaleway.com/en/docs/public-gateways/concepts/) to find definitions of all terminology related to Public Gateways, including NAT, SSH bastion and more. (switchcolumn) (switchcolumn) ## Quickstart 1. Configure your environment variables. This is an optional step that seeks to simplify your usage of the Public Gateways API. ```bash export SCW_SECRET_KEY=\"\" export SCW_DEFAULT_ZONE=\"\" export SCW_PROJECT_ID=\"\" ``` 2. **Choose a Public Gateway type**: Public Gateways come in different shapes and sizes, with different network capabilities and pricing. When you create your Public Gateway, you need to include the required Public Gateway type in the request. Use the following call to get a list of available Public Gateway offer types and their details: ```bash curl -X GET \\ -H \"X-Auth-Token: $SCW_SECRET_KEY\" \\ -H \"Content-Type: application/json\" \\ \"https://api.scaleway.com/vpc-gw/v2/zones/$SCW_DEFAULT_ZONE/gateway-types\" ``` 3. **Create a Public Gateway**: run the following command to create a Public Gateway. You can customize the details in the payload (name, description, tags, etc) to your needs: use the information below to adjust the payload as necessary. ```bash curl -X POST \\ -H \"X-Auth-Token: $SCW_SECRET_KEY\" \\ -H \"Content-Type: application/json\" \\ \"https://api.scaleway.com/vpc-gw/v2/zones/$SCW_DEFAULT_ZONE/gateways\" \\ -d '{ \"type\": \"VPC-GW-S\", \"name\": \"my-new-gateway\", \"tags\": [\"my-first-tag\", \"my-second-tag\"], \"project_id\": \"'\"$SCW_PROJECT_ID\"'\" }' ``` | Parameter | Description | Valid values | |-----------------|-----------------------------------------------------|-------------------------------| | type | The type of Public Gateway (commercial offer type) to create. Use the Gateway Types endpoint to get a list of offer types. | Any valid offer type string, e.g. `VPC-GW-S` | | name | A name of your choice for the Public Gateway | Any string containing only alphanumeric characters and dashes, e.g. `my-new-gateway`. | | tags | A list of tags to describe your Public Gateway. These can help you manage and filter your gateways. | A list of alphanumeric strings, e.g. `[\"my-first-tag`, `my-second-tag` | | project_id | The Scaleway Project ID to create the Public Gateway in. | A valid Scaleway Project ID, e.g. `f5fe13a0-b9c7-11ed-afa1-0242ac120002` | **Note**: Further parameters are available, but for the purposes of this quickstart we have included only the essentials. See the `Create a Public Gateway` endpoint documentation below for full details of all possible parameters. 4. **Get a list of your Public Gateways**: run the following command to get a list of all your Public Gateways. ```bash curl -X GET \\ -H \"X-Auth-Token: $SCW_SECRET_KEY\" \\ -H \"Content-Type: application/json\" \\ \"https://api.scaleway.com/vpc-gw/v2/zones/$SCW_DEFAULT_ZONE/gateways\" ``` 5. **Attach a Private Network to a Public Gateway**: run the following command to attach a Private Network to your Public Gateway, and make all the Gateway's services such as NAT available to the Private Network. You can customize the details in the payload to your needs: use the information below to adjust the payload as necessary. If you haven't created a Private Network yet, see the [Private Networks](https://www/scaleway.com/en/developers/api/vpc/) documentation to learn how to do so. Ensure you retain the ID of the Private Network. ```bash curl -X POST \\ -H \"X-Auth-Token: $SCW_SECRET_KEY\" \\ -H \"Content-Type: application/json\" \\ \"https://api.scaleway.com/vpc-gw/v2/zones/$SCW_DEFAULT_ZONE/gateway-networks\" \\ -d '{ \"gateway_id\": \"b1b2edda-9364-422d-93f2-ad04e6a054dc\", \"private_network_id\": \"548dbcc3-8b78-486f-a79a-c3f5a17642f9\", \"enable_masquerade\": true }' ``` This configuration will set up the Public Gateway as a NAT gateway, masquerading traffic sent to it to the outer internet to provide internet access to resources in the Private Network. | Parameter | Description | Valid values | |-----------------|-----------------------------------------------------|-------------------------------| | gateway_id | The Public Gateway ID of an existing Public Gateway | Any valid Public Gateway ID, e.g. `b1b2edda-9364-422d-93f2-ad04e6a054dc` | | private_network_id | The Private Network ID of an existing Private Network | Any valid Private Network ID in the same Availability Zone as the Public Gateway, e.g. `548dbcc3-8b78-486f-a79a-c3f5a17642f9` | | enable_masquerade | Defines whether the gateway should masquerade traffic for the attached Private Network (i.e. whether to enable dynamic NAT) | A boolean value, e.g. `true` | Further parameters are available, but for the purposes of this quickstart we have included only the essentials. See the [Attach a gateway to a Private Network](#path-gateway-networks-attach-a-public-gateway-to-a-private-network) documentation below for full details of all possible parameters. 6. **Delete a Public Gateway**: run the following call to delete your Public Gateway. Ensure that you replace `` in the URL with the ID of the Public Gateway you want to delete. ```bash curl -X DELETE \\ -H \"X-Auth-Token: $SCW_SECRET_KEY\" \\ -H \"Content-Type: application/json\" \\ \"https://api.scaleway.com/vpc-gw/v2/zones/$SCW_DEFAULT_ZONE/gateways/\" ``` The expected successful response is empty. (switchcolumn) - You have a [Scaleway account](https://console.scaleway.com/) - You have [created an API key](https://www.scaleway.com/en/docs/iam/how-to/create-api-keys/) and that the API key has sufficient [IAM permissions](https://www.scaleway.com/en/docs/iam/reference-content/permission-sets/) to perform the actions described on this page - You have [installed `curl`](https://curl.se/download.html) (switchcolumn) ## Technical limitations The following limitations apply to Public Gateways: - A maximum of eight (8) Private Networks can be plugged into a single Public Gateway - Note that the Public Gateway takes some time to start up, and actions on it are impossible unless it is in the `running` state. To check the current state of a Public Gateway, use the [Get a Public Gateway](#path-gateways-get-a-public-gateway) endpoint to get information for your gateway: the `status` field of the response will tell you if it is running or in another state. - For further information about Public Gateway limitations see our [dedicated documentation](https://www.scaleway.com/en/docs/public-gateways/troubleshooting/gw-limitations/). ## Technical information ### Availability Zones Public Gateways can be deployed in the following Availability Zones: | Name | API ID | |-----------|-----------------------| | Paris | `fr-par-1` `fr-par-2` | | Amsterdam | `nl-ams-1` `nl-ams-2` `nl-ams-3` | | Warsaw | `pl-waw-1` `pl-waw-2` `pl-waw-3` | The Scaleway Public Gateways API is a **zoned** API, meaning that each call must specify in its path parameters the Availability Zone for the resources concerned by the call. ## Going further For more help using Scaleway Public Gateways, check out the following resources: - Our [main documentation](https://www.scaleway.com/en/docs/public-gateways/) - The #public-gateway channel on our [Slack Community](https://www.scaleway.com/en/docs/tutorials/scaleway-slack-community/) - Our [support ticketing system](https://www.scaleway.com/en/docs/account/how-to/open-a-support-ticket/).
*
* The version of the OpenAPI document: v2
* Generated by: https://openapi-generator.tech
* Generator version: 7.11.0
*/
/**
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
namespace OpenAPI\Client\Model;
use \ArrayAccess;
use \OpenAPI\Client\ObjectSerializer;
/**
* ScalewayVpcGwV2Gateway Class Doc Comment
*
* @category Class
* @package OpenAPI\Client
* @author OpenAPI Generator team
* @link https://openapi-generator.tech
* @implements \ArrayAccess
*/
class ScalewayVpcGwV2Gateway implements ModelInterface, ArrayAccess, \JsonSerializable
{
public const DISCRIMINATOR = null;
/**
* The original name of the model.
*
* @var string
*/
protected static $openAPIModelName = 'scaleway.vpc_gw.v2.Gateway';
/**
* Array of property to type mappings. Used for (de)serialization
*
* @var string[]
*/
protected static $openAPITypes = [
'id' => 'string',
'organization_id' => 'string',
'project_id' => 'string',
'created_at' => '\DateTime',
'updated_at' => '\DateTime',
'type' => 'string',
'bandwidth' => 'int',
'status' => 'string',
'name' => 'string',
'tags' => 'string[]',
'ipv4' => '\OpenAPI\Client\Model\ScalewayVpcGwV2GatewayIpv4',
'gateway_networks' => '\OpenAPI\Client\Model\ScalewayVpcGwV2GatewayNetwork[]',
'version' => 'string',
'can_upgrade_to' => 'string',
'bastion_enabled' => 'bool',
'bastion_port' => 'int',
'smtp_enabled' => 'bool',
'is_legacy' => 'bool',
'bastion_allowed_ips' => 'string[]',
'zone' => 'string'
];
/**
* Array of property to format mappings. Used for (de)serialization
*
* @var string[]
* @phpstan-var array
* @psalm-var array
*/
protected static $openAPIFormats = [
'id' => null,
'organization_id' => null,
'project_id' => null,
'created_at' => 'date-time',
'updated_at' => 'date-time',
'type' => null,
'bandwidth' => 'uint64',
'status' => null,
'name' => null,
'tags' => null,
'ipv4' => null,
'gateway_networks' => null,
'version' => null,
'can_upgrade_to' => null,
'bastion_enabled' => null,
'bastion_port' => 'uint32',
'smtp_enabled' => null,
'is_legacy' => null,
'bastion_allowed_ips' => null,
'zone' => null
];
/**
* Array of nullable properties. Used for (de)serialization
*
* @var boolean[]
*/
protected static array $openAPINullables = [
'id' => false,
'organization_id' => false,
'project_id' => false,
'created_at' => false,
'updated_at' => false,
'type' => false,
'bandwidth' => false,
'status' => false,
'name' => false,
'tags' => false,
'ipv4' => false,
'gateway_networks' => false,
'version' => false,
'can_upgrade_to' => false,
'bastion_enabled' => false,
'bastion_port' => false,
'smtp_enabled' => false,
'is_legacy' => false,
'bastion_allowed_ips' => false,
'zone' => false
];
/**
* If a nullable field gets set to null, insert it here
*
* @var boolean[]
*/
protected array $openAPINullablesSetToNull = [];
/**
* Array of property to type mappings. Used for (de)serialization
*
* @return array
*/
public static function openAPITypes()
{
return self::$openAPITypes;
}
/**
* Array of property to format mappings. Used for (de)serialization
*
* @return array
*/
public static function openAPIFormats()
{
return self::$openAPIFormats;
}
/**
* Array of nullable properties
*
* @return array
*/
protected static function openAPINullables(): array
{
return self::$openAPINullables;
}
/**
* Array of nullable field names deliberately set to null
*
* @return boolean[]
*/
private function getOpenAPINullablesSetToNull(): array
{
return $this->openAPINullablesSetToNull;
}
/**
* Setter - Array of nullable field names deliberately set to null
*
* @param boolean[] $openAPINullablesSetToNull
*/
private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void
{
$this->openAPINullablesSetToNull = $openAPINullablesSetToNull;
}
/**
* Checks if a property is nullable
*
* @param string $property
* @return bool
*/
public static function isNullable(string $property): bool
{
return self::openAPINullables()[$property] ?? false;
}
/**
* Checks if a nullable property is set to null.
*
* @param string $property
* @return bool
*/
public function isNullableSetToNull(string $property): bool
{
return in_array($property, $this->getOpenAPINullablesSetToNull(), true);
}
/**
* Array of attributes where the key is the local name,
* and the value is the original name
*
* @var string[]
*/
protected static $attributeMap = [
'id' => 'id',
'organization_id' => 'organization_id',
'project_id' => 'project_id',
'created_at' => 'created_at',
'updated_at' => 'updated_at',
'type' => 'type',
'bandwidth' => 'bandwidth',
'status' => 'status',
'name' => 'name',
'tags' => 'tags',
'ipv4' => 'ipv4',
'gateway_networks' => 'gateway_networks',
'version' => 'version',
'can_upgrade_to' => 'can_upgrade_to',
'bastion_enabled' => 'bastion_enabled',
'bastion_port' => 'bastion_port',
'smtp_enabled' => 'smtp_enabled',
'is_legacy' => 'is_legacy',
'bastion_allowed_ips' => 'bastion_allowed_ips',
'zone' => 'zone'
];
/**
* Array of attributes to setter functions (for deserialization of responses)
*
* @var string[]
*/
protected static $setters = [
'id' => 'setId',
'organization_id' => 'setOrganizationId',
'project_id' => 'setProjectId',
'created_at' => 'setCreatedAt',
'updated_at' => 'setUpdatedAt',
'type' => 'setType',
'bandwidth' => 'setBandwidth',
'status' => 'setStatus',
'name' => 'setName',
'tags' => 'setTags',
'ipv4' => 'setIpv4',
'gateway_networks' => 'setGatewayNetworks',
'version' => 'setVersion',
'can_upgrade_to' => 'setCanUpgradeTo',
'bastion_enabled' => 'setBastionEnabled',
'bastion_port' => 'setBastionPort',
'smtp_enabled' => 'setSmtpEnabled',
'is_legacy' => 'setIsLegacy',
'bastion_allowed_ips' => 'setBastionAllowedIps',
'zone' => 'setZone'
];
/**
* Array of attributes to getter functions (for serialization of requests)
*
* @var string[]
*/
protected static $getters = [
'id' => 'getId',
'organization_id' => 'getOrganizationId',
'project_id' => 'getProjectId',
'created_at' => 'getCreatedAt',
'updated_at' => 'getUpdatedAt',
'type' => 'getType',
'bandwidth' => 'getBandwidth',
'status' => 'getStatus',
'name' => 'getName',
'tags' => 'getTags',
'ipv4' => 'getIpv4',
'gateway_networks' => 'getGatewayNetworks',
'version' => 'getVersion',
'can_upgrade_to' => 'getCanUpgradeTo',
'bastion_enabled' => 'getBastionEnabled',
'bastion_port' => 'getBastionPort',
'smtp_enabled' => 'getSmtpEnabled',
'is_legacy' => 'getIsLegacy',
'bastion_allowed_ips' => 'getBastionAllowedIps',
'zone' => 'getZone'
];
/**
* Array of attributes where the key is the local name,
* and the value is the original name
*
* @return array
*/
public static function attributeMap()
{
return self::$attributeMap;
}
/**
* Array of attributes to setter functions (for deserialization of responses)
*
* @return array
*/
public static function setters()
{
return self::$setters;
}
/**
* Array of attributes to getter functions (for serialization of requests)
*
* @return array
*/
public static function getters()
{
return self::$getters;
}
/**
* The original name of the model.
*
* @return string
*/
public function getModelName()
{
return self::$openAPIModelName;
}
public const STATUS_UNKNOWN_STATUS = 'unknown_status';
public const STATUS_STOPPED = 'stopped';
public const STATUS_ALLOCATING = 'allocating';
public const STATUS_CONFIGURING = 'configuring';
public const STATUS_RUNNING = 'running';
public const STATUS_STOPPING = 'stopping';
public const STATUS_FAILED = 'failed';
public const STATUS_DELETING = 'deleting';
public const STATUS_LOCKED = 'locked';
/**
* Gets allowable values of the enum
*
* @return string[]
*/
public function getStatusAllowableValues()
{
return [
self::STATUS_UNKNOWN_STATUS,
self::STATUS_STOPPED,
self::STATUS_ALLOCATING,
self::STATUS_CONFIGURING,
self::STATUS_RUNNING,
self::STATUS_STOPPING,
self::STATUS_FAILED,
self::STATUS_DELETING,
self::STATUS_LOCKED,
];
}
/**
* Associative array for storing property values
*
* @var mixed[]
*/
protected $container = [];
/**
* Constructor
*
* @param mixed[]|null $data Associated array of property values
* initializing the model
*/
public function __construct(?array $data = null)
{
$this->setIfExists('id', $data ?? [], null);
$this->setIfExists('organization_id', $data ?? [], null);
$this->setIfExists('project_id', $data ?? [], null);
$this->setIfExists('created_at', $data ?? [], null);
$this->setIfExists('updated_at', $data ?? [], null);
$this->setIfExists('type', $data ?? [], null);
$this->setIfExists('bandwidth', $data ?? [], null);
$this->setIfExists('status', $data ?? [], 'unknown_status');
$this->setIfExists('name', $data ?? [], null);
$this->setIfExists('tags', $data ?? [], null);
$this->setIfExists('ipv4', $data ?? [], null);
$this->setIfExists('gateway_networks', $data ?? [], null);
$this->setIfExists('version', $data ?? [], null);
$this->setIfExists('can_upgrade_to', $data ?? [], null);
$this->setIfExists('bastion_enabled', $data ?? [], null);
$this->setIfExists('bastion_port', $data ?? [], null);
$this->setIfExists('smtp_enabled', $data ?? [], null);
$this->setIfExists('is_legacy', $data ?? [], null);
$this->setIfExists('bastion_allowed_ips', $data ?? [], null);
$this->setIfExists('zone', $data ?? [], null);
}
/**
* Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName
* is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the
* $this->openAPINullablesSetToNull array
*
* @param string $variableName
* @param array $fields
* @param mixed $defaultValue
*/
private function setIfExists(string $variableName, array $fields, $defaultValue): void
{
if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) {
$this->openAPINullablesSetToNull[] = $variableName;
}
$this->container[$variableName] = $fields[$variableName] ?? $defaultValue;
}
/**
* Show all the invalid properties with reasons.
*
* @return array invalid properties with reasons
*/
public function listInvalidProperties()
{
$invalidProperties = [];
$allowedValues = $this->getStatusAllowableValues();
if (!is_null($this->container['status']) && !in_array($this->container['status'], $allowedValues, true)) {
$invalidProperties[] = sprintf(
"invalid value '%s' for 'status', must be one of '%s'",
$this->container['status'],
implode("', '", $allowedValues)
);
}
return $invalidProperties;
}
/**
* Validate all the properties in the model
* return true if all passed
*
* @return bool True if all properties are valid
*/
public function valid()
{
return count($this->listInvalidProperties()) === 0;
}
/**
* Gets id
*
* @return string|null
*/
public function getId()
{
return $this->container['id'];
}
/**
* Sets id
*
* @param string|null $id ID of the gateway. (UUID format)
*
* @return self
*/
public function setId($id)
{
if (is_null($id)) {
throw new \InvalidArgumentException('non-nullable id cannot be null');
}
$this->container['id'] = $id;
return $this;
}
/**
* Gets organization_id
*
* @return string|null
*/
public function getOrganizationId()
{
return $this->container['organization_id'];
}
/**
* Sets organization_id
*
* @param string|null $organization_id Owning Organization. (UUID format)
*
* @return self
*/
public function setOrganizationId($organization_id)
{
if (is_null($organization_id)) {
throw new \InvalidArgumentException('non-nullable organization_id cannot be null');
}
$this->container['organization_id'] = $organization_id;
return $this;
}
/**
* Gets project_id
*
* @return string|null
*/
public function getProjectId()
{
return $this->container['project_id'];
}
/**
* Sets project_id
*
* @param string|null $project_id Owning Project. (UUID format)
*
* @return self
*/
public function setProjectId($project_id)
{
if (is_null($project_id)) {
throw new \InvalidArgumentException('non-nullable project_id cannot be null');
}
$this->container['project_id'] = $project_id;
return $this;
}
/**
* Gets created_at
*
* @return \DateTime|null
*/
public function getCreatedAt()
{
return $this->container['created_at'];
}
/**
* Sets created_at
*
* @param \DateTime|null $created_at Gateway creation date. (RFC 3339 format)
*
* @return self
*/
public function setCreatedAt($created_at)
{
if (is_null($created_at)) {
throw new \InvalidArgumentException('non-nullable created_at cannot be null');
}
$this->container['created_at'] = $created_at;
return $this;
}
/**
* Gets updated_at
*
* @return \DateTime|null
*/
public function getUpdatedAt()
{
return $this->container['updated_at'];
}
/**
* Sets updated_at
*
* @param \DateTime|null $updated_at Gateway last modification date. (RFC 3339 format)
*
* @return self
*/
public function setUpdatedAt($updated_at)
{
if (is_null($updated_at)) {
throw new \InvalidArgumentException('non-nullable updated_at cannot be null');
}
$this->container['updated_at'] = $updated_at;
return $this;
}
/**
* Gets type
*
* @return string|null
*/
public function getType()
{
return $this->container['type'];
}
/**
* Sets type
*
* @param string|null $type Gateway type name (commercial offer).
*
* @return self
*/
public function setType($type)
{
if (is_null($type)) {
throw new \InvalidArgumentException('non-nullable type cannot be null');
}
$this->container['type'] = $type;
return $this;
}
/**
* Gets bandwidth
*
* @return int|null
*/
public function getBandwidth()
{
return $this->container['bandwidth'];
}
/**
* Sets bandwidth
*
* @param int|null $bandwidth Bandwidth available of the gateway.
*
* @return self
*/
public function setBandwidth($bandwidth)
{
if (is_null($bandwidth)) {
throw new \InvalidArgumentException('non-nullable bandwidth cannot be null');
}
$this->container['bandwidth'] = $bandwidth;
return $this;
}
/**
* Gets status
*
* @return string|null
*/
public function getStatus()
{
return $this->container['status'];
}
/**
* Sets status
*
* @param string|null $status Current status of the gateway.
*
* @return self
*/
public function setStatus($status)
{
if (is_null($status)) {
throw new \InvalidArgumentException('non-nullable status cannot be null');
}
$allowedValues = $this->getStatusAllowableValues();
if (!in_array($status, $allowedValues, true)) {
throw new \InvalidArgumentException(
sprintf(
"Invalid value '%s' for 'status', must be one of '%s'",
$status,
implode("', '", $allowedValues)
)
);
}
$this->container['status'] = $status;
return $this;
}
/**
* Gets name
*
* @return string|null
*/
public function getName()
{
return $this->container['name'];
}
/**
* Sets name
*
* @param string|null $name Name of the gateway.
*
* @return self
*/
public function setName($name)
{
if (is_null($name)) {
throw new \InvalidArgumentException('non-nullable name cannot be null');
}
$this->container['name'] = $name;
return $this;
}
/**
* Gets tags
*
* @return string[]|null
*/
public function getTags()
{
return $this->container['tags'];
}
/**
* Sets tags
*
* @param string[]|null $tags Tags associated with the gateway.
*
* @return self
*/
public function setTags($tags)
{
if (is_null($tags)) {
throw new \InvalidArgumentException('non-nullable tags cannot be null');
}
$this->container['tags'] = $tags;
return $this;
}
/**
* Gets ipv4
*
* @return \OpenAPI\Client\Model\ScalewayVpcGwV2GatewayIpv4|null
*/
public function getIpv4()
{
return $this->container['ipv4'];
}
/**
* Sets ipv4
*
* @param \OpenAPI\Client\Model\ScalewayVpcGwV2GatewayIpv4|null $ipv4 ipv4
*
* @return self
*/
public function setIpv4($ipv4)
{
if (is_null($ipv4)) {
throw new \InvalidArgumentException('non-nullable ipv4 cannot be null');
}
$this->container['ipv4'] = $ipv4;
return $this;
}
/**
* Gets gateway_networks
*
* @return \OpenAPI\Client\Model\ScalewayVpcGwV2GatewayNetwork[]|null
*/
public function getGatewayNetworks()
{
return $this->container['gateway_networks'];
}
/**
* Sets gateway_networks
*
* @param \OpenAPI\Client\Model\ScalewayVpcGwV2GatewayNetwork[]|null $gateway_networks GatewayNetwork objects attached to the gateway (each one represents a connection to a Private Network).
*
* @return self
*/
public function setGatewayNetworks($gateway_networks)
{
if (is_null($gateway_networks)) {
throw new \InvalidArgumentException('non-nullable gateway_networks cannot be null');
}
$this->container['gateway_networks'] = $gateway_networks;
return $this;
}
/**
* Gets version
*
* @return string|null
*/
public function getVersion()
{
return $this->container['version'];
}
/**
* Sets version
*
* @param string|null $version Version of the running gateway software.
*
* @return self
*/
public function setVersion($version)
{
if (is_null($version)) {
throw new \InvalidArgumentException('non-nullable version cannot be null');
}
$this->container['version'] = $version;
return $this;
}
/**
* Gets can_upgrade_to
*
* @return string|null
*/
public function getCanUpgradeTo()
{
return $this->container['can_upgrade_to'];
}
/**
* Sets can_upgrade_to
*
* @param string|null $can_upgrade_to Newly available gateway software version that can be updated to.
*
* @return self
*/
public function setCanUpgradeTo($can_upgrade_to)
{
if (is_null($can_upgrade_to)) {
throw new \InvalidArgumentException('non-nullable can_upgrade_to cannot be null');
}
$this->container['can_upgrade_to'] = $can_upgrade_to;
return $this;
}
/**
* Gets bastion_enabled
*
* @return bool|null
*/
public function getBastionEnabled()
{
return $this->container['bastion_enabled'];
}
/**
* Sets bastion_enabled
*
* @param bool|null $bastion_enabled Defines whether SSH bastion is enabled on the gateway.
*
* @return self
*/
public function setBastionEnabled($bastion_enabled)
{
if (is_null($bastion_enabled)) {
throw new \InvalidArgumentException('non-nullable bastion_enabled cannot be null');
}
$this->container['bastion_enabled'] = $bastion_enabled;
return $this;
}
/**
* Gets bastion_port
*
* @return int|null
*/
public function getBastionPort()
{
return $this->container['bastion_port'];
}
/**
* Sets bastion_port
*
* @param int|null $bastion_port Port of the SSH bastion.
*
* @return self
*/
public function setBastionPort($bastion_port)
{
if (is_null($bastion_port)) {
throw new \InvalidArgumentException('non-nullable bastion_port cannot be null');
}
$this->container['bastion_port'] = $bastion_port;
return $this;
}
/**
* Gets smtp_enabled
*
* @return bool|null
*/
public function getSmtpEnabled()
{
return $this->container['smtp_enabled'];
}
/**
* Sets smtp_enabled
*
* @param bool|null $smtp_enabled Defines whether SMTP traffic is allowed to pass through the gateway.
*
* @return self
*/
public function setSmtpEnabled($smtp_enabled)
{
if (is_null($smtp_enabled)) {
throw new \InvalidArgumentException('non-nullable smtp_enabled cannot be null');
}
$this->container['smtp_enabled'] = $smtp_enabled;
return $this;
}
/**
* Gets is_legacy
*
* @return bool|null
*/
public function getIsLegacy()
{
return $this->container['is_legacy'];
}
/**
* Sets is_legacy
*
* @param bool|null $is_legacy Defines whether the gateway uses non-IPAM IP configurations.
*
* @return self
*/
public function setIsLegacy($is_legacy)
{
if (is_null($is_legacy)) {
throw new \InvalidArgumentException('non-nullable is_legacy cannot be null');
}
$this->container['is_legacy'] = $is_legacy;
return $this;
}
/**
* Gets bastion_allowed_ips
*
* @return string[]|null
*/
public function getBastionAllowedIps()
{
return $this->container['bastion_allowed_ips'];
}
/**
* Sets bastion_allowed_ips
*
* @param string[]|null $bastion_allowed_ips Ranges of IP addresses allowed to connect to the gateway's SSH bastion. (IP network)
*
* @return self
*/
public function setBastionAllowedIps($bastion_allowed_ips)
{
if (is_null($bastion_allowed_ips)) {
throw new \InvalidArgumentException('non-nullable bastion_allowed_ips cannot be null');
}
$this->container['bastion_allowed_ips'] = $bastion_allowed_ips;
return $this;
}
/**
* Gets zone
*
* @return string|null
*/
public function getZone()
{
return $this->container['zone'];
}
/**
* Sets zone
*
* @param string|null $zone Zone of the gateway.
*
* @return self
*/
public function setZone($zone)
{
if (is_null($zone)) {
throw new \InvalidArgumentException('non-nullable zone cannot be null');
}
$this->container['zone'] = $zone;
return $this;
}
/**
* Returns true if offset exists. False otherwise.
*
* @param integer $offset Offset
*
* @return boolean
*/
public function offsetExists($offset): bool
{
return isset($this->container[$offset]);
}
/**
* Gets offset.
*
* @param integer $offset Offset
*
* @return mixed|null
*/
#[\ReturnTypeWillChange]
public function offsetGet($offset)
{
return $this->container[$offset] ?? null;
}
/**
* Sets value based on offset.
*
* @param int|null $offset Offset
* @param mixed $value Value to be set
*
* @return void
*/
public function offsetSet($offset, $value): void
{
if (is_null($offset)) {
$this->container[] = $value;
} else {
$this->container[$offset] = $value;
}
}
/**
* Unsets offset.
*
* @param integer $offset Offset
*
* @return void
*/
public function offsetUnset($offset): void
{
unset($this->container[$offset]);
}
/**
* Serializes the object to a value that can be serialized natively by json_encode().
* @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php
*
* @return mixed Returns data which can be serialized by json_encode(), which is a value
* of any type other than a resource.
*/
#[\ReturnTypeWillChange]
public function jsonSerialize()
{
return ObjectSerializer::sanitizeForSerialization($this);
}
/**
* Gets the string presentation of the object
*
* @return string
*/
public function __toString()
{
return json_encode(
ObjectSerializer::sanitizeForSerialization($this),
JSON_PRETTY_PRINT
);
}
/**
* Gets a header-safe presentation of the object
*
* @return string
*/
public function toHeaderValue()
{
return json_encode(ObjectSerializer::sanitizeForSerialization($this));
}
}