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

namespace Google\Cloud\VpcAccess\V1;

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

/**
 * Definition of a Serverless VPC Access connector.
 *
 * Generated from protobuf message <code>google.cloud.vpcaccess.v1.Connector</code>
 */
class Connector extends \Google\Protobuf\Internal\Message
{
    /**
     * The resource name in the format `projects/&#42;&#47;locations/&#42;&#47;connectors/&#42;`.
     *
     * Generated from protobuf field <code>string name = 1;</code>
     */
    private $name = '';
    /**
     * Name of a VPC network.
     *
     * Generated from protobuf field <code>string network = 2;</code>
     */
    private $network = '';
    /**
     * The range of internal addresses that follows RFC 4632 notation.
     * Example: `10.132.0.0/28`.
     *
     * Generated from protobuf field <code>string ip_cidr_range = 3;</code>
     */
    private $ip_cidr_range = '';
    /**
     * Output only. State of the VPC access connector.
     *
     * Generated from protobuf field <code>.google.cloud.vpcaccess.v1.Connector.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    private $state = 0;
    /**
     * Minimum throughput of the connector in Mbps. Default and min is 200.
     *
     * Generated from protobuf field <code>int32 min_throughput = 5;</code>
     */
    private $min_throughput = 0;
    /**
     * Maximum throughput of the connector in Mbps. Default is 300, max is 1000.
     *
     * Generated from protobuf field <code>int32 max_throughput = 6;</code>
     */
    private $max_throughput = 0;
    /**
     * Output only. List of projects using the connector.
     *
     * Generated from protobuf field <code>repeated string connected_projects = 7 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    private $connected_projects;
    /**
     * The subnet in which to house the VPC Access Connector.
     *
     * Generated from protobuf field <code>.google.cloud.vpcaccess.v1.Connector.Subnet subnet = 8;</code>
     */
    private $subnet = null;
    /**
     * Machine type of VM Instance underlying connector. Default is e2-micro
     *
     * Generated from protobuf field <code>string machine_type = 10;</code>
     */
    private $machine_type = '';
    /**
     * Minimum value of instances in autoscaling group underlying the connector.
     *
     * Generated from protobuf field <code>int32 min_instances = 11;</code>
     */
    private $min_instances = 0;
    /**
     * Maximum value of instances in autoscaling group underlying the connector.
     *
     * Generated from protobuf field <code>int32 max_instances = 12;</code>
     */
    private $max_instances = 0;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $name
     *           The resource name in the format `projects/&#42;&#47;locations/&#42;&#47;connectors/&#42;`.
     *     @type string $network
     *           Name of a VPC network.
     *     @type string $ip_cidr_range
     *           The range of internal addresses that follows RFC 4632 notation.
     *           Example: `10.132.0.0/28`.
     *     @type int $state
     *           Output only. State of the VPC access connector.
     *     @type int $min_throughput
     *           Minimum throughput of the connector in Mbps. Default and min is 200.
     *     @type int $max_throughput
     *           Maximum throughput of the connector in Mbps. Default is 300, max is 1000.
     *     @type array<string>|\Google\Protobuf\Internal\RepeatedField $connected_projects
     *           Output only. List of projects using the connector.
     *     @type \Google\Cloud\VpcAccess\V1\Connector\Subnet $subnet
     *           The subnet in which to house the VPC Access Connector.
     *     @type string $machine_type
     *           Machine type of VM Instance underlying connector. Default is e2-micro
     *     @type int $min_instances
     *           Minimum value of instances in autoscaling group underlying the connector.
     *     @type int $max_instances
     *           Maximum value of instances in autoscaling group underlying the connector.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Vpcaccess\V1\VpcAccess::initOnce();
        parent::__construct($data);
    }

    /**
     * The resource name in the format `projects/&#42;&#47;locations/&#42;&#47;connectors/&#42;`.
     *
     * Generated from protobuf field <code>string name = 1;</code>
     * @return string
     */
    public function getName()
    {
        return $this->name;
    }

    /**
     * The resource name in the format `projects/&#42;&#47;locations/&#42;&#47;connectors/&#42;`.
     *
     * Generated from protobuf field <code>string name = 1;</code>
     * @param string $var
     * @return $this
     */
    public function setName($var)
    {
        GPBUtil::checkString($var, True);
        $this->name = $var;

        return $this;
    }

    /**
     * Name of a VPC network.
     *
     * Generated from protobuf field <code>string network = 2;</code>
     * @return string
     */
    public function getNetwork()
    {
        return $this->network;
    }

    /**
     * Name of a VPC network.
     *
     * Generated from protobuf field <code>string network = 2;</code>
     * @param string $var
     * @return $this
     */
    public function setNetwork($var)
    {
        GPBUtil::checkString($var, True);
        $this->network = $var;

        return $this;
    }

    /**
     * The range of internal addresses that follows RFC 4632 notation.
     * Example: `10.132.0.0/28`.
     *
     * Generated from protobuf field <code>string ip_cidr_range = 3;</code>
     * @return string
     */
    public function getIpCidrRange()
    {
        return $this->ip_cidr_range;
    }

    /**
     * The range of internal addresses that follows RFC 4632 notation.
     * Example: `10.132.0.0/28`.
     *
     * Generated from protobuf field <code>string ip_cidr_range = 3;</code>
     * @param string $var
     * @return $this
     */
    public function setIpCidrRange($var)
    {
        GPBUtil::checkString($var, True);
        $this->ip_cidr_range = $var;

        return $this;
    }

    /**
     * Output only. State of the VPC access connector.
     *
     * Generated from protobuf field <code>.google.cloud.vpcaccess.v1.Connector.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return int
     */
    public function getState()
    {
        return $this->state;
    }

    /**
     * Output only. State of the VPC access connector.
     *
     * Generated from protobuf field <code>.google.cloud.vpcaccess.v1.Connector.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param int $var
     * @return $this
     */
    public function setState($var)
    {
        GPBUtil::checkEnum($var, \Google\Cloud\VpcAccess\V1\Connector\State::class);
        $this->state = $var;

        return $this;
    }

    /**
     * Minimum throughput of the connector in Mbps. Default and min is 200.
     *
     * Generated from protobuf field <code>int32 min_throughput = 5;</code>
     * @return int
     */
    public function getMinThroughput()
    {
        return $this->min_throughput;
    }

    /**
     * Minimum throughput of the connector in Mbps. Default and min is 200.
     *
     * Generated from protobuf field <code>int32 min_throughput = 5;</code>
     * @param int $var
     * @return $this
     */
    public function setMinThroughput($var)
    {
        GPBUtil::checkInt32($var);
        $this->min_throughput = $var;

        return $this;
    }

    /**
     * Maximum throughput of the connector in Mbps. Default is 300, max is 1000.
     *
     * Generated from protobuf field <code>int32 max_throughput = 6;</code>
     * @return int
     */
    public function getMaxThroughput()
    {
        return $this->max_throughput;
    }

    /**
     * Maximum throughput of the connector in Mbps. Default is 300, max is 1000.
     *
     * Generated from protobuf field <code>int32 max_throughput = 6;</code>
     * @param int $var
     * @return $this
     */
    public function setMaxThroughput($var)
    {
        GPBUtil::checkInt32($var);
        $this->max_throughput = $var;

        return $this;
    }

    /**
     * Output only. List of projects using the connector.
     *
     * Generated from protobuf field <code>repeated string connected_projects = 7 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getConnectedProjects()
    {
        return $this->connected_projects;
    }

    /**
     * Output only. List of projects using the connector.
     *
     * Generated from protobuf field <code>repeated string connected_projects = 7 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param array<string>|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setConnectedProjects($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING);
        $this->connected_projects = $arr;

        return $this;
    }

    /**
     * The subnet in which to house the VPC Access Connector.
     *
     * Generated from protobuf field <code>.google.cloud.vpcaccess.v1.Connector.Subnet subnet = 8;</code>
     * @return \Google\Cloud\VpcAccess\V1\Connector\Subnet|null
     */
    public function getSubnet()
    {
        return $this->subnet;
    }

    public function hasSubnet()
    {
        return isset($this->subnet);
    }

    public function clearSubnet()
    {
        unset($this->subnet);
    }

    /**
     * The subnet in which to house the VPC Access Connector.
     *
     * Generated from protobuf field <code>.google.cloud.vpcaccess.v1.Connector.Subnet subnet = 8;</code>
     * @param \Google\Cloud\VpcAccess\V1\Connector\Subnet $var
     * @return $this
     */
    public function setSubnet($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\VpcAccess\V1\Connector\Subnet::class);
        $this->subnet = $var;

        return $this;
    }

    /**
     * Machine type of VM Instance underlying connector. Default is e2-micro
     *
     * Generated from protobuf field <code>string machine_type = 10;</code>
     * @return string
     */
    public function getMachineType()
    {
        return $this->machine_type;
    }

    /**
     * Machine type of VM Instance underlying connector. Default is e2-micro
     *
     * Generated from protobuf field <code>string machine_type = 10;</code>
     * @param string $var
     * @return $this
     */
    public function setMachineType($var)
    {
        GPBUtil::checkString($var, True);
        $this->machine_type = $var;

        return $this;
    }

    /**
     * Minimum value of instances in autoscaling group underlying the connector.
     *
     * Generated from protobuf field <code>int32 min_instances = 11;</code>
     * @return int
     */
    public function getMinInstances()
    {
        return $this->min_instances;
    }

    /**
     * Minimum value of instances in autoscaling group underlying the connector.
     *
     * Generated from protobuf field <code>int32 min_instances = 11;</code>
     * @param int $var
     * @return $this
     */
    public function setMinInstances($var)
    {
        GPBUtil::checkInt32($var);
        $this->min_instances = $var;

        return $this;
    }

    /**
     * Maximum value of instances in autoscaling group underlying the connector.
     *
     * Generated from protobuf field <code>int32 max_instances = 12;</code>
     * @return int
     */
    public function getMaxInstances()
    {
        return $this->max_instances;
    }

    /**
     * Maximum value of instances in autoscaling group underlying the connector.
     *
     * Generated from protobuf field <code>int32 max_instances = 12;</code>
     * @param int $var
     * @return $this
     */
    public function setMaxInstances($var)
    {
        GPBUtil::checkInt32($var);
        $this->max_instances = $var;

        return $this;
    }

}

