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

namespace Google\Cloud\NetworkConnectivity\V1\ServiceConnectionMap;

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

/**
 * PSC connection details on consumer side.
 *
 * Generated from protobuf message <code>google.cloud.networkconnectivity.v1.ServiceConnectionMap.ConsumerPscConnection</code>
 */
class ConsumerPscConnection extends \Google\Protobuf\Internal\Message
{
    /**
     * The URI of a service attachment which is the target of the PSC
     * connection.
     *
     * Generated from protobuf field <code>string service_attachment_uri = 1;</code>
     */
    protected $service_attachment_uri = '';
    /**
     * The state of the PSC connection.
     *
     * Generated from protobuf field <code>.google.cloud.networkconnectivity.v1.ServiceConnectionMap.ConsumerPscConnection.State state = 2;</code>
     */
    protected $state = 0;
    /**
     * The consumer project whose PSC forwarding rule is connected to the
     * service attachments in this service connection map.
     *
     * Generated from protobuf field <code>string project = 3;</code>
     */
    protected $project = '';
    /**
     * The consumer network whose PSC forwarding rule is connected to the
     * service attachments in this service connection map.
     * Note that the network could be on a different project (shared VPC).
     *
     * Generated from protobuf field <code>string network = 4;</code>
     */
    protected $network = '';
    /**
     * The PSC connection id of the PSC forwarding rule connected
     * to the service attachments in this service connection map.
     *
     * Generated from protobuf field <code>string psc_connection_id = 5;</code>
     */
    protected $psc_connection_id = '';
    /**
     * The IP literal allocated on the consumer network for the PSC forwarding
     * rule that is created to connect to the producer service attachment in
     * this service connection map.
     *
     * Generated from protobuf field <code>string ip = 6;</code>
     */
    protected $ip = '';
    /**
     * The error type indicates whether the error is consumer facing, producer
     * facing or system internal.
     *
     * Generated from protobuf field <code>.google.cloud.networkconnectivity.v1.ConnectionErrorType error_type = 7 [deprecated = true];</code>
     * @deprecated
     */
    protected $error_type = 0;
    /**
     * The most recent error during operating this connection.
     *
     * Generated from protobuf field <code>.google.rpc.Status error = 8 [deprecated = true];</code>
     * @deprecated
     */
    protected $error = null;
    /**
     * The last Compute Engine operation to setup PSC connection.
     *
     * Generated from protobuf field <code>string gce_operation = 9;</code>
     */
    protected $gce_operation = '';
    /**
     * The URI of the consumer forwarding rule created.
     * Example:
     * projects/{projectNumOrId}/regions/us-east1/networks/{resourceId}.
     *
     * Generated from protobuf field <code>string forwarding_rule = 10;</code>
     */
    protected $forwarding_rule = '';
    /**
     * Output only. The error info for the latest error during operating this
     * connection.
     *
     * Generated from protobuf field <code>.google.rpc.ErrorInfo error_info = 11 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    protected $error_info = null;
    /**
     * Output only. The URI of the selected subnetwork selected to allocate IP
     * address for this connection.
     *
     * Generated from protobuf field <code>string selected_subnetwork = 12 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    protected $selected_subnetwork = '';
    /**
     * Immutable. Deprecated. Use producer_instance_metadata instead.
     * An immutable identifier for the producer instance.
     *
     * Generated from protobuf field <code>string producer_instance_id = 13 [deprecated = true, (.google.api.field_behavior) = IMMUTABLE];</code>
     * @deprecated
     */
    protected $producer_instance_id = '';
    /**
     * Immutable. An immutable map for the producer instance metadata.
     *
     * Generated from protobuf field <code>map<string, string> producer_instance_metadata = 14 [(.google.api.field_behavior) = IMMUTABLE];</code>
     */
    private $producer_instance_metadata;
    /**
     * The requested IP version for the PSC connection.
     *
     * Generated from protobuf field <code>optional .google.cloud.networkconnectivity.v1.IPVersion ip_version = 15;</code>
     */
    protected $ip_version = null;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $service_attachment_uri
     *           The URI of a service attachment which is the target of the PSC
     *           connection.
     *     @type int $state
     *           The state of the PSC connection.
     *     @type string $project
     *           The consumer project whose PSC forwarding rule is connected to the
     *           service attachments in this service connection map.
     *     @type string $network
     *           The consumer network whose PSC forwarding rule is connected to the
     *           service attachments in this service connection map.
     *           Note that the network could be on a different project (shared VPC).
     *     @type string $psc_connection_id
     *           The PSC connection id of the PSC forwarding rule connected
     *           to the service attachments in this service connection map.
     *     @type string $ip
     *           The IP literal allocated on the consumer network for the PSC forwarding
     *           rule that is created to connect to the producer service attachment in
     *           this service connection map.
     *     @type int $error_type
     *           The error type indicates whether the error is consumer facing, producer
     *           facing or system internal.
     *     @type \Google\Rpc\Status $error
     *           The most recent error during operating this connection.
     *     @type string $gce_operation
     *           The last Compute Engine operation to setup PSC connection.
     *     @type string $forwarding_rule
     *           The URI of the consumer forwarding rule created.
     *           Example:
     *           projects/{projectNumOrId}/regions/us-east1/networks/{resourceId}.
     *     @type \Google\Rpc\ErrorInfo $error_info
     *           Output only. The error info for the latest error during operating this
     *           connection.
     *     @type string $selected_subnetwork
     *           Output only. The URI of the selected subnetwork selected to allocate IP
     *           address for this connection.
     *     @type string $producer_instance_id
     *           Immutable. Deprecated. Use producer_instance_metadata instead.
     *           An immutable identifier for the producer instance.
     *     @type array|\Google\Protobuf\Internal\MapField $producer_instance_metadata
     *           Immutable. An immutable map for the producer instance metadata.
     *     @type int $ip_version
     *           The requested IP version for the PSC connection.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Networkconnectivity\V1\CrossNetworkAutomation::initOnce();
        parent::__construct($data);
    }

    /**
     * The URI of a service attachment which is the target of the PSC
     * connection.
     *
     * Generated from protobuf field <code>string service_attachment_uri = 1;</code>
     * @return string
     */
    public function getServiceAttachmentUri()
    {
        return $this->service_attachment_uri;
    }

    /**
     * The URI of a service attachment which is the target of the PSC
     * connection.
     *
     * Generated from protobuf field <code>string service_attachment_uri = 1;</code>
     * @param string $var
     * @return $this
     */
    public function setServiceAttachmentUri($var)
    {
        GPBUtil::checkString($var, True);
        $this->service_attachment_uri = $var;

        return $this;
    }

    /**
     * The state of the PSC connection.
     *
     * Generated from protobuf field <code>.google.cloud.networkconnectivity.v1.ServiceConnectionMap.ConsumerPscConnection.State state = 2;</code>
     * @return int
     */
    public function getState()
    {
        return $this->state;
    }

    /**
     * The state of the PSC connection.
     *
     * Generated from protobuf field <code>.google.cloud.networkconnectivity.v1.ServiceConnectionMap.ConsumerPscConnection.State state = 2;</code>
     * @param int $var
     * @return $this
     */
    public function setState($var)
    {
        GPBUtil::checkEnum($var, \Google\Cloud\NetworkConnectivity\V1\ServiceConnectionMap\ConsumerPscConnection\State::class);
        $this->state = $var;

        return $this;
    }

    /**
     * The consumer project whose PSC forwarding rule is connected to the
     * service attachments in this service connection map.
     *
     * Generated from protobuf field <code>string project = 3;</code>
     * @return string
     */
    public function getProject()
    {
        return $this->project;
    }

    /**
     * The consumer project whose PSC forwarding rule is connected to the
     * service attachments in this service connection map.
     *
     * Generated from protobuf field <code>string project = 3;</code>
     * @param string $var
     * @return $this
     */
    public function setProject($var)
    {
        GPBUtil::checkString($var, True);
        $this->project = $var;

        return $this;
    }

    /**
     * The consumer network whose PSC forwarding rule is connected to the
     * service attachments in this service connection map.
     * Note that the network could be on a different project (shared VPC).
     *
     * Generated from protobuf field <code>string network = 4;</code>
     * @return string
     */
    public function getNetwork()
    {
        return $this->network;
    }

    /**
     * The consumer network whose PSC forwarding rule is connected to the
     * service attachments in this service connection map.
     * Note that the network could be on a different project (shared VPC).
     *
     * Generated from protobuf field <code>string network = 4;</code>
     * @param string $var
     * @return $this
     */
    public function setNetwork($var)
    {
        GPBUtil::checkString($var, True);
        $this->network = $var;

        return $this;
    }

    /**
     * The PSC connection id of the PSC forwarding rule connected
     * to the service attachments in this service connection map.
     *
     * Generated from protobuf field <code>string psc_connection_id = 5;</code>
     * @return string
     */
    public function getPscConnectionId()
    {
        return $this->psc_connection_id;
    }

    /**
     * The PSC connection id of the PSC forwarding rule connected
     * to the service attachments in this service connection map.
     *
     * Generated from protobuf field <code>string psc_connection_id = 5;</code>
     * @param string $var
     * @return $this
     */
    public function setPscConnectionId($var)
    {
        GPBUtil::checkString($var, True);
        $this->psc_connection_id = $var;

        return $this;
    }

    /**
     * The IP literal allocated on the consumer network for the PSC forwarding
     * rule that is created to connect to the producer service attachment in
     * this service connection map.
     *
     * Generated from protobuf field <code>string ip = 6;</code>
     * @return string
     */
    public function getIp()
    {
        return $this->ip;
    }

    /**
     * The IP literal allocated on the consumer network for the PSC forwarding
     * rule that is created to connect to the producer service attachment in
     * this service connection map.
     *
     * Generated from protobuf field <code>string ip = 6;</code>
     * @param string $var
     * @return $this
     */
    public function setIp($var)
    {
        GPBUtil::checkString($var, True);
        $this->ip = $var;

        return $this;
    }

    /**
     * The error type indicates whether the error is consumer facing, producer
     * facing or system internal.
     *
     * Generated from protobuf field <code>.google.cloud.networkconnectivity.v1.ConnectionErrorType error_type = 7 [deprecated = true];</code>
     * @return int
     * @deprecated
     */
    public function getErrorType()
    {
        if ($this->error_type !== 0) {
            @trigger_error('error_type is deprecated.', E_USER_DEPRECATED);
        }
        return $this->error_type;
    }

    /**
     * The error type indicates whether the error is consumer facing, producer
     * facing or system internal.
     *
     * Generated from protobuf field <code>.google.cloud.networkconnectivity.v1.ConnectionErrorType error_type = 7 [deprecated = true];</code>
     * @param int $var
     * @return $this
     * @deprecated
     */
    public function setErrorType($var)
    {
        @trigger_error('error_type is deprecated.', E_USER_DEPRECATED);
        GPBUtil::checkEnum($var, \Google\Cloud\NetworkConnectivity\V1\ConnectionErrorType::class);
        $this->error_type = $var;

        return $this;
    }

    /**
     * The most recent error during operating this connection.
     *
     * Generated from protobuf field <code>.google.rpc.Status error = 8 [deprecated = true];</code>
     * @return \Google\Rpc\Status|null
     * @deprecated
     */
    public function getError()
    {
        if (isset($this->error)) {
            @trigger_error('error is deprecated.', E_USER_DEPRECATED);
        }
        return $this->error;
    }

    public function hasError()
    {
        if (isset($this->error)) {
            @trigger_error('error is deprecated.', E_USER_DEPRECATED);
        }
        return isset($this->error);
    }

    public function clearError()
    {
        @trigger_error('error is deprecated.', E_USER_DEPRECATED);
        unset($this->error);
    }

    /**
     * The most recent error during operating this connection.
     *
     * Generated from protobuf field <code>.google.rpc.Status error = 8 [deprecated = true];</code>
     * @param \Google\Rpc\Status $var
     * @return $this
     * @deprecated
     */
    public function setError($var)
    {
        @trigger_error('error is deprecated.', E_USER_DEPRECATED);
        GPBUtil::checkMessage($var, \Google\Rpc\Status::class);
        $this->error = $var;

        return $this;
    }

    /**
     * The last Compute Engine operation to setup PSC connection.
     *
     * Generated from protobuf field <code>string gce_operation = 9;</code>
     * @return string
     */
    public function getGceOperation()
    {
        return $this->gce_operation;
    }

    /**
     * The last Compute Engine operation to setup PSC connection.
     *
     * Generated from protobuf field <code>string gce_operation = 9;</code>
     * @param string $var
     * @return $this
     */
    public function setGceOperation($var)
    {
        GPBUtil::checkString($var, True);
        $this->gce_operation = $var;

        return $this;
    }

    /**
     * The URI of the consumer forwarding rule created.
     * Example:
     * projects/{projectNumOrId}/regions/us-east1/networks/{resourceId}.
     *
     * Generated from protobuf field <code>string forwarding_rule = 10;</code>
     * @return string
     */
    public function getForwardingRule()
    {
        return $this->forwarding_rule;
    }

    /**
     * The URI of the consumer forwarding rule created.
     * Example:
     * projects/{projectNumOrId}/regions/us-east1/networks/{resourceId}.
     *
     * Generated from protobuf field <code>string forwarding_rule = 10;</code>
     * @param string $var
     * @return $this
     */
    public function setForwardingRule($var)
    {
        GPBUtil::checkString($var, True);
        $this->forwarding_rule = $var;

        return $this;
    }

    /**
     * Output only. The error info for the latest error during operating this
     * connection.
     *
     * Generated from protobuf field <code>.google.rpc.ErrorInfo error_info = 11 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return \Google\Rpc\ErrorInfo|null
     */
    public function getErrorInfo()
    {
        return $this->error_info;
    }

    public function hasErrorInfo()
    {
        return isset($this->error_info);
    }

    public function clearErrorInfo()
    {
        unset($this->error_info);
    }

    /**
     * Output only. The error info for the latest error during operating this
     * connection.
     *
     * Generated from protobuf field <code>.google.rpc.ErrorInfo error_info = 11 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param \Google\Rpc\ErrorInfo $var
     * @return $this
     */
    public function setErrorInfo($var)
    {
        GPBUtil::checkMessage($var, \Google\Rpc\ErrorInfo::class);
        $this->error_info = $var;

        return $this;
    }

    /**
     * Output only. The URI of the selected subnetwork selected to allocate IP
     * address for this connection.
     *
     * Generated from protobuf field <code>string selected_subnetwork = 12 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return string
     */
    public function getSelectedSubnetwork()
    {
        return $this->selected_subnetwork;
    }

    /**
     * Output only. The URI of the selected subnetwork selected to allocate IP
     * address for this connection.
     *
     * Generated from protobuf field <code>string selected_subnetwork = 12 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param string $var
     * @return $this
     */
    public function setSelectedSubnetwork($var)
    {
        GPBUtil::checkString($var, True);
        $this->selected_subnetwork = $var;

        return $this;
    }

    /**
     * Immutable. Deprecated. Use producer_instance_metadata instead.
     * An immutable identifier for the producer instance.
     *
     * Generated from protobuf field <code>string producer_instance_id = 13 [deprecated = true, (.google.api.field_behavior) = IMMUTABLE];</code>
     * @return string
     * @deprecated
     */
    public function getProducerInstanceId()
    {
        if ($this->producer_instance_id !== '') {
            @trigger_error('producer_instance_id is deprecated.', E_USER_DEPRECATED);
        }
        return $this->producer_instance_id;
    }

    /**
     * Immutable. Deprecated. Use producer_instance_metadata instead.
     * An immutable identifier for the producer instance.
     *
     * Generated from protobuf field <code>string producer_instance_id = 13 [deprecated = true, (.google.api.field_behavior) = IMMUTABLE];</code>
     * @param string $var
     * @return $this
     * @deprecated
     */
    public function setProducerInstanceId($var)
    {
        @trigger_error('producer_instance_id is deprecated.', E_USER_DEPRECATED);
        GPBUtil::checkString($var, True);
        $this->producer_instance_id = $var;

        return $this;
    }

    /**
     * Immutable. An immutable map for the producer instance metadata.
     *
     * Generated from protobuf field <code>map<string, string> producer_instance_metadata = 14 [(.google.api.field_behavior) = IMMUTABLE];</code>
     * @return \Google\Protobuf\Internal\MapField
     */
    public function getProducerInstanceMetadata()
    {
        return $this->producer_instance_metadata;
    }

    /**
     * Immutable. An immutable map for the producer instance metadata.
     *
     * Generated from protobuf field <code>map<string, string> producer_instance_metadata = 14 [(.google.api.field_behavior) = IMMUTABLE];</code>
     * @param array|\Google\Protobuf\Internal\MapField $var
     * @return $this
     */
    public function setProducerInstanceMetadata($var)
    {
        $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING);
        $this->producer_instance_metadata = $arr;

        return $this;
    }

    /**
     * The requested IP version for the PSC connection.
     *
     * Generated from protobuf field <code>optional .google.cloud.networkconnectivity.v1.IPVersion ip_version = 15;</code>
     * @return int
     */
    public function getIpVersion()
    {
        return isset($this->ip_version) ? $this->ip_version : 0;
    }

    public function hasIpVersion()
    {
        return isset($this->ip_version);
    }

    public function clearIpVersion()
    {
        unset($this->ip_version);
    }

    /**
     * The requested IP version for the PSC connection.
     *
     * Generated from protobuf field <code>optional .google.cloud.networkconnectivity.v1.IPVersion ip_version = 15;</code>
     * @param int $var
     * @return $this
     */
    public function setIpVersion($var)
    {
        GPBUtil::checkEnum($var, \Google\Cloud\NetworkConnectivity\V1\IPVersion::class);
        $this->ip_version = $var;

        return $this;
    }

}


