<?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\RepeatedField;
use Google\Protobuf\Internal\GPBUtil;

/**
 * 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 backupplan is
     * applied
     *
     * 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 = '';

    /**
     * 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 backupplan is
     *           applied
     *     @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 array<\Google\Cloud\BackupDR\V1\RuleConfigInfo>|\Google\Protobuf\Internal\RepeatedField $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}
     * }
     */
    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 backupplan is
     * applied
     *
     * 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 backupplan is
     * applied
     *
     * 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 \Google\Protobuf\Internal\RepeatedField
     */
    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 array<\Google\Cloud\BackupDR\V1\RuleConfigInfo>|\Google\Protobuf\Internal\RepeatedField $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;
    }

}

