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

namespace Google\Cloud\Config\V1;

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

/**
 * A resource change represents a change to a resource in the state file.
 *
 * Generated from protobuf message <code>google.cloud.config.v1.ResourceChange</code>
 */
class ResourceChange extends \Google\Protobuf\Internal\Message
{
    /**
     * Identifier. The name of the resource change.
     * Format:
     * 'projects/{project_id}/locations/{location}/previews/{preview}/resourceChanges/{resource_change}'.
     *
     * Generated from protobuf field <code>string name = 1 [(.google.api.field_behavior) = IDENTIFIER];</code>
     */
    protected $name = '';
    /**
     * Output only. Terraform info of the resource change.
     *
     * Generated from protobuf field <code>.google.cloud.config.v1.ResourceChangeTerraformInfo terraform_info = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    protected $terraform_info = null;
    /**
     * Output only. The intent of the resource change.
     *
     * Generated from protobuf field <code>.google.cloud.config.v1.ResourceChange.Intent intent = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    protected $intent = 0;
    /**
     * Output only. The property changes of the resource change.
     *
     * Generated from protobuf field <code>repeated .google.cloud.config.v1.PropertyChange property_changes = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    private $property_changes;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $name
     *           Identifier. The name of the resource change.
     *           Format:
     *           'projects/{project_id}/locations/{location}/previews/{preview}/resourceChanges/{resource_change}'.
     *     @type \Google\Cloud\Config\V1\ResourceChangeTerraformInfo $terraform_info
     *           Output only. Terraform info of the resource change.
     *     @type int $intent
     *           Output only. The intent of the resource change.
     *     @type \Google\Cloud\Config\V1\PropertyChange[] $property_changes
     *           Output only. The property changes of the resource change.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Config\V1\Config::initOnce();
        parent::__construct($data);
    }

    /**
     * Identifier. The name of the resource change.
     * Format:
     * 'projects/{project_id}/locations/{location}/previews/{preview}/resourceChanges/{resource_change}'.
     *
     * Generated from protobuf field <code>string name = 1 [(.google.api.field_behavior) = IDENTIFIER];</code>
     * @return string
     */
    public function getName()
    {
        return $this->name;
    }

    /**
     * Identifier. The name of the resource change.
     * Format:
     * 'projects/{project_id}/locations/{location}/previews/{preview}/resourceChanges/{resource_change}'.
     *
     * Generated from protobuf field <code>string name = 1 [(.google.api.field_behavior) = IDENTIFIER];</code>
     * @param string $var
     * @return $this
     */
    public function setName($var)
    {
        GPBUtil::checkString($var, True);
        $this->name = $var;

        return $this;
    }

    /**
     * Output only. Terraform info of the resource change.
     *
     * Generated from protobuf field <code>.google.cloud.config.v1.ResourceChangeTerraformInfo terraform_info = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return \Google\Cloud\Config\V1\ResourceChangeTerraformInfo|null
     */
    public function getTerraformInfo()
    {
        return $this->terraform_info;
    }

    public function hasTerraformInfo()
    {
        return isset($this->terraform_info);
    }

    public function clearTerraformInfo()
    {
        unset($this->terraform_info);
    }

    /**
     * Output only. Terraform info of the resource change.
     *
     * Generated from protobuf field <code>.google.cloud.config.v1.ResourceChangeTerraformInfo terraform_info = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param \Google\Cloud\Config\V1\ResourceChangeTerraformInfo $var
     * @return $this
     */
    public function setTerraformInfo($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Config\V1\ResourceChangeTerraformInfo::class);
        $this->terraform_info = $var;

        return $this;
    }

    /**
     * Output only. The intent of the resource change.
     *
     * Generated from protobuf field <code>.google.cloud.config.v1.ResourceChange.Intent intent = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return int
     */
    public function getIntent()
    {
        return $this->intent;
    }

    /**
     * Output only. The intent of the resource change.
     *
     * Generated from protobuf field <code>.google.cloud.config.v1.ResourceChange.Intent intent = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param int $var
     * @return $this
     */
    public function setIntent($var)
    {
        GPBUtil::checkEnum($var, \Google\Cloud\Config\V1\ResourceChange\Intent::class);
        $this->intent = $var;

        return $this;
    }

    /**
     * Output only. The property changes of the resource change.
     *
     * Generated from protobuf field <code>repeated .google.cloud.config.v1.PropertyChange property_changes = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return RepeatedField<\Google\Cloud\Config\V1\PropertyChange>
     */
    public function getPropertyChanges()
    {
        return $this->property_changes;
    }

    /**
     * Output only. The property changes of the resource change.
     *
     * Generated from protobuf field <code>repeated .google.cloud.config.v1.PropertyChange property_changes = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param \Google\Cloud\Config\V1\PropertyChange[] $var
     * @return $this
     */
    public function setPropertyChanges($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Config\V1\PropertyChange::class);
        $this->property_changes = $arr;

        return $this;
    }

}

