<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/appengine/v1/version.proto

namespace Google\Cloud\AppEngine\V1;

use Google\Protobuf\Internal\GPBType;
use Google\Protobuf\Internal\RepeatedField;
use Google\Protobuf\Internal\GPBUtil;

/**
 * Extra network settings.
 * Only applicable in the App Engine flexible environment.
 *
 * Generated from protobuf message <code>google.appengine.v1.Network</code>
 */
class Network extends \Google\Protobuf\Internal\Message
{
    /**
     * List of ports, or port pairs, to forward from the virtual machine to the
     * application container.
     * Only applicable in the App Engine flexible environment.
     *
     * Generated from protobuf field <code>repeated string forwarded_ports = 1;</code>
     */
    private $forwarded_ports;
    /**
     * Tag to apply to the instance during creation.
     * Only applicable in the App Engine flexible environment.
     *
     * Generated from protobuf field <code>string instance_tag = 2;</code>
     */
    private $instance_tag = '';
    /**
     * Google Compute Engine network where the virtual machines are created.
     * Specify the short name, not the resource path.
     * Defaults to `default`.
     *
     * Generated from protobuf field <code>string name = 3;</code>
     */
    private $name = '';
    /**
     * Google Cloud Platform sub-network where the virtual machines are created.
     * Specify the short name, not the resource path.
     * If a subnetwork name is specified, a network name will also be required
     * unless it is for the default network.
     * * If the network that the instance is being created in is a Legacy network,
     * then the IP address is allocated from the IPv4Range.
     * * If the network that the instance is being created in is an auto Subnet
     * Mode Network, then only network name should be specified (not the
     * subnetwork_name) and the IP address is created from the IPCidrRange of the
     * subnetwork that exists in that zone for that network.
     * * If the network that the instance is being created in is a custom Subnet
     * Mode Network, then the subnetwork_name must be specified and the
     * IP address is created from the IPCidrRange of the subnetwork.
     * If specified, the subnetwork must exist in the same region as the
     * App Engine flexible environment application.
     *
     * Generated from protobuf field <code>string subnetwork_name = 4;</code>
     */
    private $subnetwork_name = '';
    /**
     * Enable session affinity.
     * Only applicable in the App Engine flexible environment.
     *
     * Generated from protobuf field <code>bool session_affinity = 5;</code>
     */
    private $session_affinity = false;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type array<string>|\Google\Protobuf\Internal\RepeatedField $forwarded_ports
     *           List of ports, or port pairs, to forward from the virtual machine to the
     *           application container.
     *           Only applicable in the App Engine flexible environment.
     *     @type string $instance_tag
     *           Tag to apply to the instance during creation.
     *           Only applicable in the App Engine flexible environment.
     *     @type string $name
     *           Google Compute Engine network where the virtual machines are created.
     *           Specify the short name, not the resource path.
     *           Defaults to `default`.
     *     @type string $subnetwork_name
     *           Google Cloud Platform sub-network where the virtual machines are created.
     *           Specify the short name, not the resource path.
     *           If a subnetwork name is specified, a network name will also be required
     *           unless it is for the default network.
     *           * If the network that the instance is being created in is a Legacy network,
     *           then the IP address is allocated from the IPv4Range.
     *           * If the network that the instance is being created in is an auto Subnet
     *           Mode Network, then only network name should be specified (not the
     *           subnetwork_name) and the IP address is created from the IPCidrRange of the
     *           subnetwork that exists in that zone for that network.
     *           * If the network that the instance is being created in is a custom Subnet
     *           Mode Network, then the subnetwork_name must be specified and the
     *           IP address is created from the IPCidrRange of the subnetwork.
     *           If specified, the subnetwork must exist in the same region as the
     *           App Engine flexible environment application.
     *     @type bool $session_affinity
     *           Enable session affinity.
     *           Only applicable in the App Engine flexible environment.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Appengine\V1\Version::initOnce();
        parent::__construct($data);
    }

    /**
     * List of ports, or port pairs, to forward from the virtual machine to the
     * application container.
     * Only applicable in the App Engine flexible environment.
     *
     * Generated from protobuf field <code>repeated string forwarded_ports = 1;</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getForwardedPorts()
    {
        return $this->forwarded_ports;
    }

    /**
     * List of ports, or port pairs, to forward from the virtual machine to the
     * application container.
     * Only applicable in the App Engine flexible environment.
     *
     * Generated from protobuf field <code>repeated string forwarded_ports = 1;</code>
     * @param array<string>|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setForwardedPorts($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING);
        $this->forwarded_ports = $arr;

        return $this;
    }

    /**
     * Tag to apply to the instance during creation.
     * Only applicable in the App Engine flexible environment.
     *
     * Generated from protobuf field <code>string instance_tag = 2;</code>
     * @return string
     */
    public function getInstanceTag()
    {
        return $this->instance_tag;
    }

    /**
     * Tag to apply to the instance during creation.
     * Only applicable in the App Engine flexible environment.
     *
     * Generated from protobuf field <code>string instance_tag = 2;</code>
     * @param string $var
     * @return $this
     */
    public function setInstanceTag($var)
    {
        GPBUtil::checkString($var, True);
        $this->instance_tag = $var;

        return $this;
    }

    /**
     * Google Compute Engine network where the virtual machines are created.
     * Specify the short name, not the resource path.
     * Defaults to `default`.
     *
     * Generated from protobuf field <code>string name = 3;</code>
     * @return string
     */
    public function getName()
    {
        return $this->name;
    }

    /**
     * Google Compute Engine network where the virtual machines are created.
     * Specify the short name, not the resource path.
     * Defaults to `default`.
     *
     * Generated from protobuf field <code>string name = 3;</code>
     * @param string $var
     * @return $this
     */
    public function setName($var)
    {
        GPBUtil::checkString($var, True);
        $this->name = $var;

        return $this;
    }

    /**
     * Google Cloud Platform sub-network where the virtual machines are created.
     * Specify the short name, not the resource path.
     * If a subnetwork name is specified, a network name will also be required
     * unless it is for the default network.
     * * If the network that the instance is being created in is a Legacy network,
     * then the IP address is allocated from the IPv4Range.
     * * If the network that the instance is being created in is an auto Subnet
     * Mode Network, then only network name should be specified (not the
     * subnetwork_name) and the IP address is created from the IPCidrRange of the
     * subnetwork that exists in that zone for that network.
     * * If the network that the instance is being created in is a custom Subnet
     * Mode Network, then the subnetwork_name must be specified and the
     * IP address is created from the IPCidrRange of the subnetwork.
     * If specified, the subnetwork must exist in the same region as the
     * App Engine flexible environment application.
     *
     * Generated from protobuf field <code>string subnetwork_name = 4;</code>
     * @return string
     */
    public function getSubnetworkName()
    {
        return $this->subnetwork_name;
    }

    /**
     * Google Cloud Platform sub-network where the virtual machines are created.
     * Specify the short name, not the resource path.
     * If a subnetwork name is specified, a network name will also be required
     * unless it is for the default network.
     * * If the network that the instance is being created in is a Legacy network,
     * then the IP address is allocated from the IPv4Range.
     * * If the network that the instance is being created in is an auto Subnet
     * Mode Network, then only network name should be specified (not the
     * subnetwork_name) and the IP address is created from the IPCidrRange of the
     * subnetwork that exists in that zone for that network.
     * * If the network that the instance is being created in is a custom Subnet
     * Mode Network, then the subnetwork_name must be specified and the
     * IP address is created from the IPCidrRange of the subnetwork.
     * If specified, the subnetwork must exist in the same region as the
     * App Engine flexible environment application.
     *
     * Generated from protobuf field <code>string subnetwork_name = 4;</code>
     * @param string $var
     * @return $this
     */
    public function setSubnetworkName($var)
    {
        GPBUtil::checkString($var, True);
        $this->subnetwork_name = $var;

        return $this;
    }

    /**
     * Enable session affinity.
     * Only applicable in the App Engine flexible environment.
     *
     * Generated from protobuf field <code>bool session_affinity = 5;</code>
     * @return bool
     */
    public function getSessionAffinity()
    {
        return $this->session_affinity;
    }

    /**
     * Enable session affinity.
     * Only applicable in the App Engine flexible environment.
     *
     * Generated from protobuf field <code>bool session_affinity = 5;</code>
     * @param bool $var
     * @return $this
     */
    public function setSessionAffinity($var)
    {
        GPBUtil::checkBool($var);
        $this->session_affinity = $var;

        return $this;
    }

}

