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

namespace Google\Cloud\BackupDR\V1;

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

/**
 * A BackupPlanAssociation represents a single BackupPlanAssociation which
 * contains details like workload, backup plan etc
 *
 * Generated from protobuf message <code>google.cloud.backupdr.v1.BackupPlanAssociation</code>
 */
class BackupPlanAssociation extends \Google\Protobuf\Internal\Message
{
    /**
     * Output only. Identifier. The resource name of BackupPlanAssociation in
     * below format Format :
     * projects/{project}/locations/{location}/backupPlanAssociations/{backupPlanAssociationId}
     *
     * Generated from protobuf field <code>string name = 1 [(.google.api.field_behavior) = IDENTIFIER, (.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    protected $name = '';
    /**
     * Required. Immutable. Resource type of workload on which backupplan is
     * applied
     *
     * Generated from protobuf field <code>string resource_type = 2 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = REQUIRED];</code>
     */
    protected $resource_type = '';
    /**
     * Required. Immutable. Resource name of workload on which the backup plan is
     * applied.
     * The format can either be the resource name (e.g.,
     * "projects/my-project/zones/us-central1-a/instances/my-instance") or the
     * full resource URI (e.g.,
     * "https://www.googleapis.com/compute/v1/projects/my-project/zones/us-central1-a/instances/my-instance").
     *
     * Generated from protobuf field <code>string resource = 3 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = REQUIRED];</code>
     */
    protected $resource = '';
    /**
     * Required. Resource name of backup plan which needs to be applied on
     * workload. Format:
     * projects/{project}/locations/{location}/backupPlans/{backupPlanId}
     *
     * Generated from protobuf field <code>string backup_plan = 4 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {</code>
     */
    protected $backup_plan = '';
    /**
     * Output only. The time when the instance was created.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    protected $create_time = null;
    /**
     * Output only. The time when the instance was updated.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    protected $update_time = null;
    /**
     * Output only. The BackupPlanAssociation resource state.
     *
     * Generated from protobuf field <code>.google.cloud.backupdr.v1.BackupPlanAssociation.State state = 7 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    protected $state = 0;
    /**
     * Output only. The config info related to backup rules.
     *
     * Generated from protobuf field <code>repeated .google.cloud.backupdr.v1.RuleConfigInfo rules_config_info = 8 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    private $rules_config_info;
    /**
     * Output only. Resource name of data source which will be used as storage
     * location for backups taken. Format :
     * projects/{project}/locations/{location}/backupVaults/{backupvault}/dataSources/{datasource}
     *
     * Generated from protobuf field <code>string data_source = 9 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    protected $data_source = '';
    /**
     * Output only. The user friendly revision ID of the `BackupPlanRevision`.
     * Example: v0, v1, v2, etc.
     *
     * Generated from protobuf field <code>string backup_plan_revision_id = 11 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    protected $backup_plan_revision_id = '';
    /**
     * Output only. The resource id of the `BackupPlanRevision`.
     * Format:
     * `projects/{project}/locations/{location}/backupPlans/{backup_plan}/revisions/{revision_id}`
     *
     * Generated from protobuf field <code>string backup_plan_revision_name = 12 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    protected $backup_plan_revision_name = '';
    protected $resource_properties;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $name
     *           Output only. Identifier. The resource name of BackupPlanAssociation in
     *           below format Format :
     *           projects/{project}/locations/{location}/backupPlanAssociations/{backupPlanAssociationId}
     *     @type string $resource_type
     *           Required. Immutable. Resource type of workload on which backupplan is
     *           applied
     *     @type string $resource
     *           Required. Immutable. Resource name of workload on which the backup plan is
     *           applied.
     *           The format can either be the resource name (e.g.,
     *           "projects/my-project/zones/us-central1-a/instances/my-instance") or the
     *           full resource URI (e.g.,
     *           "https://www.googleapis.com/compute/v1/projects/my-project/zones/us-central1-a/instances/my-instance").
     *     @type string $backup_plan
     *           Required. Resource name of backup plan which needs to be applied on
     *           workload. Format:
     *           projects/{project}/locations/{location}/backupPlans/{backupPlanId}
     *     @type \Google\Protobuf\Timestamp $create_time
     *           Output only. The time when the instance was created.
     *     @type \Google\Protobuf\Timestamp $update_time
     *           Output only. The time when the instance was updated.
     *     @type int $state
     *           Output only. The BackupPlanAssociation resource state.
     *     @type \Google\Cloud\BackupDR\V1\RuleConfigInfo[] $rules_config_info
     *           Output only. The config info related to backup rules.
     *     @type string $data_source
     *           Output only. Resource name of data source which will be used as storage
     *           location for backups taken. Format :
     *           projects/{project}/locations/{location}/backupVaults/{backupvault}/dataSources/{datasource}
     *     @type \Google\Cloud\BackupDR\V1\CloudSqlInstanceBackupPlanAssociationProperties $cloud_sql_instance_backup_plan_association_properties
     *           Output only. Cloud SQL instance's backup plan association properties.
     *     @type string $backup_plan_revision_id
     *           Output only. The user friendly revision ID of the `BackupPlanRevision`.
     *           Example: v0, v1, v2, etc.
     *     @type string $backup_plan_revision_name
     *           Output only. The resource id of the `BackupPlanRevision`.
     *           Format:
     *           `projects/{project}/locations/{location}/backupPlans/{backup_plan}/revisions/{revision_id}`
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Backupdr\V1\Backupplanassociation::initOnce();
        parent::__construct($data);
    }

    /**
     * Output only. Identifier. The resource name of BackupPlanAssociation in
     * below format Format :
     * projects/{project}/locations/{location}/backupPlanAssociations/{backupPlanAssociationId}
     *
     * Generated from protobuf field <code>string name = 1 [(.google.api.field_behavior) = IDENTIFIER, (.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return string
     */
    public function getName()
    {
        return $this->name;
    }

    /**
     * Output only. Identifier. The resource name of BackupPlanAssociation in
     * below format Format :
     * projects/{project}/locations/{location}/backupPlanAssociations/{backupPlanAssociationId}
     *
     * Generated from protobuf field <code>string name = 1 [(.google.api.field_behavior) = IDENTIFIER, (.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;
    }

    /**
     * Required. Immutable. Resource type of workload on which backupplan is
     * applied
     *
     * Generated from protobuf field <code>string resource_type = 2 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = REQUIRED];</code>
     * @return string
     */
    public function getResourceType()
    {
        return $this->resource_type;
    }

    /**
     * Required. Immutable. Resource type of workload on which backupplan is
     * applied
     *
     * Generated from protobuf field <code>string resource_type = 2 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = REQUIRED];</code>
     * @param string $var
     * @return $this
     */
    public function setResourceType($var)
    {
        GPBUtil::checkString($var, True);
        $this->resource_type = $var;

        return $this;
    }

    /**
     * Required. Immutable. Resource name of workload on which the backup plan is
     * applied.
     * The format can either be the resource name (e.g.,
     * "projects/my-project/zones/us-central1-a/instances/my-instance") or the
     * full resource URI (e.g.,
     * "https://www.googleapis.com/compute/v1/projects/my-project/zones/us-central1-a/instances/my-instance").
     *
     * Generated from protobuf field <code>string resource = 3 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = REQUIRED];</code>
     * @return string
     */
    public function getResource()
    {
        return $this->resource;
    }

    /**
     * Required. Immutable. Resource name of workload on which the backup plan is
     * applied.
     * The format can either be the resource name (e.g.,
     * "projects/my-project/zones/us-central1-a/instances/my-instance") or the
     * full resource URI (e.g.,
     * "https://www.googleapis.com/compute/v1/projects/my-project/zones/us-central1-a/instances/my-instance").
     *
     * Generated from protobuf field <code>string resource = 3 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = REQUIRED];</code>
     * @param string $var
     * @return $this
     */
    public function setResource($var)
    {
        GPBUtil::checkString($var, True);
        $this->resource = $var;

        return $this;
    }

    /**
     * Required. Resource name of backup plan which needs to be applied on
     * workload. Format:
     * projects/{project}/locations/{location}/backupPlans/{backupPlanId}
     *
     * Generated from protobuf field <code>string backup_plan = 4 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {</code>
     * @return string
     */
    public function getBackupPlan()
    {
        return $this->backup_plan;
    }

    /**
     * Required. Resource name of backup plan which needs to be applied on
     * workload. Format:
     * projects/{project}/locations/{location}/backupPlans/{backupPlanId}
     *
     * Generated from protobuf field <code>string backup_plan = 4 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {</code>
     * @param string $var
     * @return $this
     */
    public function setBackupPlan($var)
    {
        GPBUtil::checkString($var, True);
        $this->backup_plan = $var;

        return $this;
    }

    /**
     * Output only. The time when the instance was created.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp create_time = 5 [(.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 time when the instance was created.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp create_time = 5 [(.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 time when the instance was updated.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp update_time = 6 [(.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 time when the instance was updated.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp update_time = 6 [(.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;
    }

    /**
     * Output only. The BackupPlanAssociation resource state.
     *
     * Generated from protobuf field <code>.google.cloud.backupdr.v1.BackupPlanAssociation.State state = 7 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return int
     */
    public function getState()
    {
        return $this->state;
    }

    /**
     * Output only. The BackupPlanAssociation resource state.
     *
     * Generated from protobuf field <code>.google.cloud.backupdr.v1.BackupPlanAssociation.State state = 7 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param int $var
     * @return $this
     */
    public function setState($var)
    {
        GPBUtil::checkEnum($var, \Google\Cloud\BackupDR\V1\BackupPlanAssociation\State::class);
        $this->state = $var;

        return $this;
    }

    /**
     * Output only. The config info related to backup rules.
     *
     * Generated from protobuf field <code>repeated .google.cloud.backupdr.v1.RuleConfigInfo rules_config_info = 8 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return RepeatedField<\Google\Cloud\BackupDR\V1\RuleConfigInfo>
     */
    public function getRulesConfigInfo()
    {
        return $this->rules_config_info;
    }

    /**
     * Output only. The config info related to backup rules.
     *
     * Generated from protobuf field <code>repeated .google.cloud.backupdr.v1.RuleConfigInfo rules_config_info = 8 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param \Google\Cloud\BackupDR\V1\RuleConfigInfo[] $var
     * @return $this
     */
    public function setRulesConfigInfo($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\BackupDR\V1\RuleConfigInfo::class);
        $this->rules_config_info = $arr;

        return $this;
    }

    /**
     * Output only. Resource name of data source which will be used as storage
     * location for backups taken. Format :
     * projects/{project}/locations/{location}/backupVaults/{backupvault}/dataSources/{datasource}
     *
     * Generated from protobuf field <code>string data_source = 9 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return string
     */
    public function getDataSource()
    {
        return $this->data_source;
    }

    /**
     * Output only. Resource name of data source which will be used as storage
     * location for backups taken. Format :
     * projects/{project}/locations/{location}/backupVaults/{backupvault}/dataSources/{datasource}
     *
     * Generated from protobuf field <code>string data_source = 9 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param string $var
     * @return $this
     */
    public function setDataSource($var)
    {
        GPBUtil::checkString($var, True);
        $this->data_source = $var;

        return $this;
    }

    /**
     * Output only. Cloud SQL instance's backup plan association properties.
     *
     * Generated from protobuf field <code>.google.cloud.backupdr.v1.CloudSqlInstanceBackupPlanAssociationProperties cloud_sql_instance_backup_plan_association_properties = 10 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return \Google\Cloud\BackupDR\V1\CloudSqlInstanceBackupPlanAssociationProperties|null
     */
    public function getCloudSqlInstanceBackupPlanAssociationProperties()
    {
        return $this->readOneof(10);
    }

    public function hasCloudSqlInstanceBackupPlanAssociationProperties()
    {
        return $this->hasOneof(10);
    }

    /**
     * Output only. Cloud SQL instance's backup plan association properties.
     *
     * Generated from protobuf field <code>.google.cloud.backupdr.v1.CloudSqlInstanceBackupPlanAssociationProperties cloud_sql_instance_backup_plan_association_properties = 10 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param \Google\Cloud\BackupDR\V1\CloudSqlInstanceBackupPlanAssociationProperties $var
     * @return $this
     */
    public function setCloudSqlInstanceBackupPlanAssociationProperties($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\BackupDR\V1\CloudSqlInstanceBackupPlanAssociationProperties::class);
        $this->writeOneof(10, $var);

        return $this;
    }

    /**
     * Output only. The user friendly revision ID of the `BackupPlanRevision`.
     * Example: v0, v1, v2, etc.
     *
     * Generated from protobuf field <code>string backup_plan_revision_id = 11 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return string
     */
    public function getBackupPlanRevisionId()
    {
        return $this->backup_plan_revision_id;
    }

    /**
     * Output only. The user friendly revision ID of the `BackupPlanRevision`.
     * Example: v0, v1, v2, etc.
     *
     * Generated from protobuf field <code>string backup_plan_revision_id = 11 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param string $var
     * @return $this
     */
    public function setBackupPlanRevisionId($var)
    {
        GPBUtil::checkString($var, True);
        $this->backup_plan_revision_id = $var;

        return $this;
    }

    /**
     * Output only. The resource id of the `BackupPlanRevision`.
     * Format:
     * `projects/{project}/locations/{location}/backupPlans/{backup_plan}/revisions/{revision_id}`
     *
     * Generated from protobuf field <code>string backup_plan_revision_name = 12 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return string
     */
    public function getBackupPlanRevisionName()
    {
        return $this->backup_plan_revision_name;
    }

    /**
     * Output only. The resource id of the `BackupPlanRevision`.
     * Format:
     * `projects/{project}/locations/{location}/backupPlans/{backup_plan}/revisions/{revision_id}`
     *
     * Generated from protobuf field <code>string backup_plan_revision_name = 12 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param string $var
     * @return $this
     */
    public function setBackupPlanRevisionName($var)
    {
        GPBUtil::checkString($var, True);
        $this->backup_plan_revision_name = $var;

        return $this;
    }

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

}

