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

namespace Google\Cloud\BackupDR\V1;

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

/**
 * DataSourceGcpResource is used for protected resources that are Google Cloud
 * Resources. This name is easeier to understand than GcpResourceDataSource or
 * GcpDataSourceResource
 *
 * Generated from protobuf message <code>google.cloud.backupdr.v1.DataSourceGcpResource</code>
 */
class DataSourceGcpResource extends \Google\Protobuf\Internal\Message
{
    /**
     * Output only. Full resource pathname URL of the source Google Cloud
     * resource.
     *
     * Generated from protobuf field <code>string gcp_resourcename = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    protected $gcp_resourcename = '';
    /**
     * Location of the resource: <region>/<zone>/"global"/"unspecified".
     *
     * Generated from protobuf field <code>string location = 2;</code>
     */
    protected $location = '';
    /**
     * The type of the Google Cloud resource. Use the Unified Resource Type,
     * eg. compute.googleapis.com/Instance.
     *
     * Generated from protobuf field <code>string type = 3;</code>
     */
    protected $type = '';
    protected $gcp_resource_properties;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $gcp_resourcename
     *           Output only. Full resource pathname URL of the source Google Cloud
     *           resource.
     *     @type string $location
     *           Location of the resource: <region>/<zone>/"global"/"unspecified".
     *     @type string $type
     *           The type of the Google Cloud resource. Use the Unified Resource Type,
     *           eg. compute.googleapis.com/Instance.
     *     @type \Google\Cloud\BackupDR\V1\ComputeInstanceDataSourceProperties $compute_instance_datasource_properties
     *           ComputeInstanceDataSourceProperties has a subset of Compute Instance
     *           properties that are useful at the Datasource level.
     *     @type \Google\Cloud\BackupDR\V1\CloudSqlInstanceDataSourceProperties $cloud_sql_instance_datasource_properties
     *           Output only. CloudSqlInstanceDataSourceProperties has a subset of Cloud
     *           SQL Instance properties that are useful at the Datasource level.
     *     @type \Google\Cloud\BackupDR\V1\DiskDataSourceProperties $disk_datasource_properties
     *           DiskDataSourceProperties has a subset of Disk properties that are useful
     *           at the Datasource level.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Backupdr\V1\Backupvault::initOnce();
        parent::__construct($data);
    }

    /**
     * Output only. Full resource pathname URL of the source Google Cloud
     * resource.
     *
     * Generated from protobuf field <code>string gcp_resourcename = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return string
     */
    public function getGcpResourcename()
    {
        return $this->gcp_resourcename;
    }

    /**
     * Output only. Full resource pathname URL of the source Google Cloud
     * resource.
     *
     * Generated from protobuf field <code>string gcp_resourcename = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param string $var
     * @return $this
     */
    public function setGcpResourcename($var)
    {
        GPBUtil::checkString($var, True);
        $this->gcp_resourcename = $var;

        return $this;
    }

    /**
     * Location of the resource: <region>/<zone>/"global"/"unspecified".
     *
     * Generated from protobuf field <code>string location = 2;</code>
     * @return string
     */
    public function getLocation()
    {
        return $this->location;
    }

    /**
     * Location of the resource: <region>/<zone>/"global"/"unspecified".
     *
     * Generated from protobuf field <code>string location = 2;</code>
     * @param string $var
     * @return $this
     */
    public function setLocation($var)
    {
        GPBUtil::checkString($var, True);
        $this->location = $var;

        return $this;
    }

    /**
     * The type of the Google Cloud resource. Use the Unified Resource Type,
     * eg. compute.googleapis.com/Instance.
     *
     * Generated from protobuf field <code>string type = 3;</code>
     * @return string
     */
    public function getType()
    {
        return $this->type;
    }

    /**
     * The type of the Google Cloud resource. Use the Unified Resource Type,
     * eg. compute.googleapis.com/Instance.
     *
     * Generated from protobuf field <code>string type = 3;</code>
     * @param string $var
     * @return $this
     */
    public function setType($var)
    {
        GPBUtil::checkString($var, True);
        $this->type = $var;

        return $this;
    }

    /**
     * ComputeInstanceDataSourceProperties has a subset of Compute Instance
     * properties that are useful at the Datasource level.
     *
     * Generated from protobuf field <code>.google.cloud.backupdr.v1.ComputeInstanceDataSourceProperties compute_instance_datasource_properties = 4;</code>
     * @return \Google\Cloud\BackupDR\V1\ComputeInstanceDataSourceProperties|null
     */
    public function getComputeInstanceDatasourceProperties()
    {
        return $this->readOneof(4);
    }

    public function hasComputeInstanceDatasourceProperties()
    {
        return $this->hasOneof(4);
    }

    /**
     * ComputeInstanceDataSourceProperties has a subset of Compute Instance
     * properties that are useful at the Datasource level.
     *
     * Generated from protobuf field <code>.google.cloud.backupdr.v1.ComputeInstanceDataSourceProperties compute_instance_datasource_properties = 4;</code>
     * @param \Google\Cloud\BackupDR\V1\ComputeInstanceDataSourceProperties $var
     * @return $this
     */
    public function setComputeInstanceDatasourceProperties($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\BackupDR\V1\ComputeInstanceDataSourceProperties::class);
        $this->writeOneof(4, $var);

        return $this;
    }

    /**
     * Output only. CloudSqlInstanceDataSourceProperties has a subset of Cloud
     * SQL Instance properties that are useful at the Datasource level.
     *
     * Generated from protobuf field <code>.google.cloud.backupdr.v1.CloudSqlInstanceDataSourceProperties cloud_sql_instance_datasource_properties = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return \Google\Cloud\BackupDR\V1\CloudSqlInstanceDataSourceProperties|null
     */
    public function getCloudSqlInstanceDatasourceProperties()
    {
        return $this->readOneof(5);
    }

    public function hasCloudSqlInstanceDatasourceProperties()
    {
        return $this->hasOneof(5);
    }

    /**
     * Output only. CloudSqlInstanceDataSourceProperties has a subset of Cloud
     * SQL Instance properties that are useful at the Datasource level.
     *
     * Generated from protobuf field <code>.google.cloud.backupdr.v1.CloudSqlInstanceDataSourceProperties cloud_sql_instance_datasource_properties = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param \Google\Cloud\BackupDR\V1\CloudSqlInstanceDataSourceProperties $var
     * @return $this
     */
    public function setCloudSqlInstanceDatasourceProperties($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\BackupDR\V1\CloudSqlInstanceDataSourceProperties::class);
        $this->writeOneof(5, $var);

        return $this;
    }

    /**
     * DiskDataSourceProperties has a subset of Disk properties that are useful
     * at the Datasource level.
     *
     * Generated from protobuf field <code>.google.cloud.backupdr.v1.DiskDataSourceProperties disk_datasource_properties = 7;</code>
     * @return \Google\Cloud\BackupDR\V1\DiskDataSourceProperties|null
     */
    public function getDiskDatasourceProperties()
    {
        return $this->readOneof(7);
    }

    public function hasDiskDatasourceProperties()
    {
        return $this->hasOneof(7);
    }

    /**
     * DiskDataSourceProperties has a subset of Disk properties that are useful
     * at the Datasource level.
     *
     * Generated from protobuf field <code>.google.cloud.backupdr.v1.DiskDataSourceProperties disk_datasource_properties = 7;</code>
     * @param \Google\Cloud\BackupDR\V1\DiskDataSourceProperties $var
     * @return $this
     */
    public function setDiskDatasourceProperties($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\BackupDR\V1\DiskDataSourceProperties::class);
        $this->writeOneof(7, $var);

        return $this;
    }

    /**
     * @return string
     */
    public function getGcpResourceProperties()
    {
        return $this->whichOneof("gcp_resource_properties");
    }

}

