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

namespace Google\Cloud\Datastream\V1;

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

/**
 * The PrivateConnection resource is used to establish private connectivity
 * between Datastream and a customer's network.
 *
 * Generated from protobuf message <code>google.cloud.datastream.v1.PrivateConnection</code>
 */
class PrivateConnection extends \Google\Protobuf\Internal\Message
{
    /**
     * Output only. The resource's name.
     *
     * Generated from protobuf field <code>string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    private $name = '';
    /**
     * Output only. The create time of the resource.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    private $create_time = null;
    /**
     * Output only. The update time of the resource.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    private $update_time = null;
    /**
     * Labels.
     *
     * Generated from protobuf field <code>map<string, string> labels = 4;</code>
     */
    private $labels;
    /**
     * Required. Display name.
     *
     * Generated from protobuf field <code>string display_name = 5 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    private $display_name = '';
    /**
     * Output only. The state of the Private Connection.
     *
     * Generated from protobuf field <code>.google.cloud.datastream.v1.PrivateConnection.State state = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    private $state = 0;
    /**
     * Output only. In case of error, the details of the error in a user-friendly format.
     *
     * Generated from protobuf field <code>.google.cloud.datastream.v1.Error error = 7 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    private $error = null;
    /**
     * VPC Peering Config.
     *
     * Generated from protobuf field <code>.google.cloud.datastream.v1.VpcPeeringConfig vpc_peering_config = 100;</code>
     */
    private $vpc_peering_config = null;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $name
     *           Output only. The resource's name.
     *     @type \Google\Protobuf\Timestamp $create_time
     *           Output only. The create time of the resource.
     *     @type \Google\Protobuf\Timestamp $update_time
     *           Output only. The update time of the resource.
     *     @type array|\Google\Protobuf\Internal\MapField $labels
     *           Labels.
     *     @type string $display_name
     *           Required. Display name.
     *     @type int $state
     *           Output only. The state of the Private Connection.
     *     @type \Google\Cloud\Datastream\V1\Error $error
     *           Output only. In case of error, the details of the error in a user-friendly format.
     *     @type \Google\Cloud\Datastream\V1\VpcPeeringConfig $vpc_peering_config
     *           VPC Peering Config.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Datastream\V1\DatastreamResources::initOnce();
        parent::__construct($data);
    }

    /**
     * Output only. The resource's name.
     *
     * Generated from protobuf field <code>string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return string
     */
    public function getName()
    {
        return $this->name;
    }

    /**
     * Output only. The resource's name.
     *
     * Generated from protobuf field <code>string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param string $var
     * @return $this
     */
    public function setName($var)
    {
        GPBUtil::checkString($var, True);
        $this->name = $var;

        return $this;
    }

    /**
     * Output only. The create time of the resource.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return \Google\Protobuf\Timestamp|null
     */
    public function getCreateTime()
    {
        return $this->create_time;
    }

    public function hasCreateTime()
    {
        return isset($this->create_time);
    }

    public function clearCreateTime()
    {
        unset($this->create_time);
    }

    /**
     * Output only. The create time of the resource.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param \Google\Protobuf\Timestamp $var
     * @return $this
     */
    public function setCreateTime($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class);
        $this->create_time = $var;

        return $this;
    }

    /**
     * Output only. The update time of the resource.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return \Google\Protobuf\Timestamp|null
     */
    public function getUpdateTime()
    {
        return $this->update_time;
    }

    public function hasUpdateTime()
    {
        return isset($this->update_time);
    }

    public function clearUpdateTime()
    {
        unset($this->update_time);
    }

    /**
     * Output only. The update time of the resource.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param \Google\Protobuf\Timestamp $var
     * @return $this
     */
    public function setUpdateTime($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class);
        $this->update_time = $var;

        return $this;
    }

    /**
     * Labels.
     *
     * Generated from protobuf field <code>map<string, string> labels = 4;</code>
     * @return \Google\Protobuf\Internal\MapField
     */
    public function getLabels()
    {
        return $this->labels;
    }

    /**
     * Labels.
     *
     * Generated from protobuf field <code>map<string, string> labels = 4;</code>
     * @param array|\Google\Protobuf\Internal\MapField $var
     * @return $this
     */
    public function setLabels($var)
    {
        $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING);
        $this->labels = $arr;

        return $this;
    }

    /**
     * Required. Display name.
     *
     * Generated from protobuf field <code>string display_name = 5 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return string
     */
    public function getDisplayName()
    {
        return $this->display_name;
    }

    /**
     * Required. Display name.
     *
     * Generated from protobuf field <code>string display_name = 5 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param string $var
     * @return $this
     */
    public function setDisplayName($var)
    {
        GPBUtil::checkString($var, True);
        $this->display_name = $var;

        return $this;
    }

    /**
     * Output only. The state of the Private Connection.
     *
     * Generated from protobuf field <code>.google.cloud.datastream.v1.PrivateConnection.State state = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return int
     */
    public function getState()
    {
        return $this->state;
    }

    /**
     * Output only. The state of the Private Connection.
     *
     * Generated from protobuf field <code>.google.cloud.datastream.v1.PrivateConnection.State state = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param int $var
     * @return $this
     */
    public function setState($var)
    {
        GPBUtil::checkEnum($var, \Google\Cloud\Datastream\V1\PrivateConnection\State::class);
        $this->state = $var;

        return $this;
    }

    /**
     * Output only. In case of error, the details of the error in a user-friendly format.
     *
     * Generated from protobuf field <code>.google.cloud.datastream.v1.Error error = 7 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return \Google\Cloud\Datastream\V1\Error|null
     */
    public function getError()
    {
        return $this->error;
    }

    public function hasError()
    {
        return isset($this->error);
    }

    public function clearError()
    {
        unset($this->error);
    }

    /**
     * Output only. In case of error, the details of the error in a user-friendly format.
     *
     * Generated from protobuf field <code>.google.cloud.datastream.v1.Error error = 7 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param \Google\Cloud\Datastream\V1\Error $var
     * @return $this
     */
    public function setError($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Datastream\V1\Error::class);
        $this->error = $var;

        return $this;
    }

    /**
     * VPC Peering Config.
     *
     * Generated from protobuf field <code>.google.cloud.datastream.v1.VpcPeeringConfig vpc_peering_config = 100;</code>
     * @return \Google\Cloud\Datastream\V1\VpcPeeringConfig|null
     */
    public function getVpcPeeringConfig()
    {
        return $this->vpc_peering_config;
    }

    public function hasVpcPeeringConfig()
    {
        return isset($this->vpc_peering_config);
    }

    public function clearVpcPeeringConfig()
    {
        unset($this->vpc_peering_config);
    }

    /**
     * VPC Peering Config.
     *
     * Generated from protobuf field <code>.google.cloud.datastream.v1.VpcPeeringConfig vpc_peering_config = 100;</code>
     * @param \Google\Cloud\Datastream\V1\VpcPeeringConfig $var
     * @return $this
     */
    public function setVpcPeeringConfig($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Datastream\V1\VpcPeeringConfig::class);
        $this->vpc_peering_config = $var;

        return $this;
    }

}

