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

namespace Google\Cloud\Commerce\Consumer\Procurement\V1;

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

/**
 * A change made on a line item.
 *
 * Generated from protobuf message <code>google.cloud.commerce.consumer.procurement.v1.LineItemChange</code>
 */
class LineItemChange extends \Google\Protobuf\Internal\Message
{
    /**
     * Output only. Change ID.
     * All changes made within one order update operation have the same change_id.
     *
     * Generated from protobuf field <code>string change_id = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    protected $change_id = '';
    /**
     * Required. Type of the change to make.
     *
     * Generated from protobuf field <code>.google.cloud.commerce.consumer.procurement.v1.LineItemChangeType change_type = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    protected $change_type = 0;
    /**
     * Output only. Line item info before the change.
     *
     * Generated from protobuf field <code>.google.cloud.commerce.consumer.procurement.v1.LineItemInfo old_line_item_info = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    protected $old_line_item_info = null;
    /**
     * Line item info after the change.
     *
     * Generated from protobuf field <code>.google.cloud.commerce.consumer.procurement.v1.LineItemInfo new_line_item_info = 4;</code>
     */
    protected $new_line_item_info = null;
    /**
     * Output only. State of the change.
     *
     * Generated from protobuf field <code>.google.cloud.commerce.consumer.procurement.v1.LineItemChangeState change_state = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    protected $change_state = 0;
    /**
     * Output only. Provider-supplied message explaining the LineItemChange's
     * state. Mainly used to communicate progress and ETA for provisioning in the
     * case of `PENDING_APPROVAL`, and to explain why the change request was
     * denied or canceled in the case of `REJECTED` and `CANCELED` states.
     *
     * Generated from protobuf field <code>string state_reason = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    protected $state_reason = '';
    /**
     * Output only. Predefined enum types for why this line item change is in
     * current state. For example, a line item change's state could be
     * `LINE_ITEM_CHANGE_STATE_COMPLETED` because of end-of-term expiration,
     * immediate cancellation initiated by the user, or system-initiated
     * cancellation.
     *
     * Generated from protobuf field <code>.google.cloud.commerce.consumer.procurement.v1.LineItemChangeStateReasonType change_state_reason_type = 10 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    protected $change_state_reason_type = 0;
    /**
     * Output only. A time at which the change became or will become (in case of
     * pending change) effective.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp change_effective_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    protected $change_effective_time = null;
    /**
     * Output only. The time when change was initiated.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp create_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    protected $create_time = null;
    /**
     * Output only. The time when change was updated, e.g. approved/rejected by
     * partners or cancelled by the user.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp update_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    protected $update_time = null;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $change_id
     *           Output only. Change ID.
     *           All changes made within one order update operation have the same change_id.
     *     @type int $change_type
     *           Required. Type of the change to make.
     *     @type \Google\Cloud\Commerce\Consumer\Procurement\V1\LineItemInfo $old_line_item_info
     *           Output only. Line item info before the change.
     *     @type \Google\Cloud\Commerce\Consumer\Procurement\V1\LineItemInfo $new_line_item_info
     *           Line item info after the change.
     *     @type int $change_state
     *           Output only. State of the change.
     *     @type string $state_reason
     *           Output only. Provider-supplied message explaining the LineItemChange's
     *           state. Mainly used to communicate progress and ETA for provisioning in the
     *           case of `PENDING_APPROVAL`, and to explain why the change request was
     *           denied or canceled in the case of `REJECTED` and `CANCELED` states.
     *     @type int $change_state_reason_type
     *           Output only. Predefined enum types for why this line item change is in
     *           current state. For example, a line item change's state could be
     *           `LINE_ITEM_CHANGE_STATE_COMPLETED` because of end-of-term expiration,
     *           immediate cancellation initiated by the user, or system-initiated
     *           cancellation.
     *     @type \Google\Protobuf\Timestamp $change_effective_time
     *           Output only. A time at which the change became or will become (in case of
     *           pending change) effective.
     *     @type \Google\Protobuf\Timestamp $create_time
     *           Output only. The time when change was initiated.
     *     @type \Google\Protobuf\Timestamp $update_time
     *           Output only. The time when change was updated, e.g. approved/rejected by
     *           partners or cancelled by the user.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Commerce\Consumer\Procurement\V1\Order::initOnce();
        parent::__construct($data);
    }

    /**
     * Output only. Change ID.
     * All changes made within one order update operation have the same change_id.
     *
     * Generated from protobuf field <code>string change_id = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return string
     */
    public function getChangeId()
    {
        return $this->change_id;
    }

    /**
     * Output only. Change ID.
     * All changes made within one order update operation have the same change_id.
     *
     * Generated from protobuf field <code>string change_id = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param string $var
     * @return $this
     */
    public function setChangeId($var)
    {
        GPBUtil::checkString($var, True);
        $this->change_id = $var;

        return $this;
    }

    /**
     * Required. Type of the change to make.
     *
     * Generated from protobuf field <code>.google.cloud.commerce.consumer.procurement.v1.LineItemChangeType change_type = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return int
     */
    public function getChangeType()
    {
        return $this->change_type;
    }

    /**
     * Required. Type of the change to make.
     *
     * Generated from protobuf field <code>.google.cloud.commerce.consumer.procurement.v1.LineItemChangeType change_type = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param int $var
     * @return $this
     */
    public function setChangeType($var)
    {
        GPBUtil::checkEnum($var, \Google\Cloud\Commerce\Consumer\Procurement\V1\LineItemChangeType::class);
        $this->change_type = $var;

        return $this;
    }

    /**
     * Output only. Line item info before the change.
     *
     * Generated from protobuf field <code>.google.cloud.commerce.consumer.procurement.v1.LineItemInfo old_line_item_info = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return \Google\Cloud\Commerce\Consumer\Procurement\V1\LineItemInfo|null
     */
    public function getOldLineItemInfo()
    {
        return $this->old_line_item_info;
    }

    public function hasOldLineItemInfo()
    {
        return isset($this->old_line_item_info);
    }

    public function clearOldLineItemInfo()
    {
        unset($this->old_line_item_info);
    }

    /**
     * Output only. Line item info before the change.
     *
     * Generated from protobuf field <code>.google.cloud.commerce.consumer.procurement.v1.LineItemInfo old_line_item_info = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param \Google\Cloud\Commerce\Consumer\Procurement\V1\LineItemInfo $var
     * @return $this
     */
    public function setOldLineItemInfo($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Commerce\Consumer\Procurement\V1\LineItemInfo::class);
        $this->old_line_item_info = $var;

        return $this;
    }

    /**
     * Line item info after the change.
     *
     * Generated from protobuf field <code>.google.cloud.commerce.consumer.procurement.v1.LineItemInfo new_line_item_info = 4;</code>
     * @return \Google\Cloud\Commerce\Consumer\Procurement\V1\LineItemInfo|null
     */
    public function getNewLineItemInfo()
    {
        return $this->new_line_item_info;
    }

    public function hasNewLineItemInfo()
    {
        return isset($this->new_line_item_info);
    }

    public function clearNewLineItemInfo()
    {
        unset($this->new_line_item_info);
    }

    /**
     * Line item info after the change.
     *
     * Generated from protobuf field <code>.google.cloud.commerce.consumer.procurement.v1.LineItemInfo new_line_item_info = 4;</code>
     * @param \Google\Cloud\Commerce\Consumer\Procurement\V1\LineItemInfo $var
     * @return $this
     */
    public function setNewLineItemInfo($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Commerce\Consumer\Procurement\V1\LineItemInfo::class);
        $this->new_line_item_info = $var;

        return $this;
    }

    /**
     * Output only. State of the change.
     *
     * Generated from protobuf field <code>.google.cloud.commerce.consumer.procurement.v1.LineItemChangeState change_state = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return int
     */
    public function getChangeState()
    {
        return $this->change_state;
    }

    /**
     * Output only. State of the change.
     *
     * Generated from protobuf field <code>.google.cloud.commerce.consumer.procurement.v1.LineItemChangeState change_state = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param int $var
     * @return $this
     */
    public function setChangeState($var)
    {
        GPBUtil::checkEnum($var, \Google\Cloud\Commerce\Consumer\Procurement\V1\LineItemChangeState::class);
        $this->change_state = $var;

        return $this;
    }

    /**
     * Output only. Provider-supplied message explaining the LineItemChange's
     * state. Mainly used to communicate progress and ETA for provisioning in the
     * case of `PENDING_APPROVAL`, and to explain why the change request was
     * denied or canceled in the case of `REJECTED` and `CANCELED` states.
     *
     * Generated from protobuf field <code>string state_reason = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return string
     */
    public function getStateReason()
    {
        return $this->state_reason;
    }

    /**
     * Output only. Provider-supplied message explaining the LineItemChange's
     * state. Mainly used to communicate progress and ETA for provisioning in the
     * case of `PENDING_APPROVAL`, and to explain why the change request was
     * denied or canceled in the case of `REJECTED` and `CANCELED` states.
     *
     * Generated from protobuf field <code>string state_reason = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param string $var
     * @return $this
     */
    public function setStateReason($var)
    {
        GPBUtil::checkString($var, True);
        $this->state_reason = $var;

        return $this;
    }

    /**
     * Output only. Predefined enum types for why this line item change is in
     * current state. For example, a line item change's state could be
     * `LINE_ITEM_CHANGE_STATE_COMPLETED` because of end-of-term expiration,
     * immediate cancellation initiated by the user, or system-initiated
     * cancellation.
     *
     * Generated from protobuf field <code>.google.cloud.commerce.consumer.procurement.v1.LineItemChangeStateReasonType change_state_reason_type = 10 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return int
     */
    public function getChangeStateReasonType()
    {
        return $this->change_state_reason_type;
    }

    /**
     * Output only. Predefined enum types for why this line item change is in
     * current state. For example, a line item change's state could be
     * `LINE_ITEM_CHANGE_STATE_COMPLETED` because of end-of-term expiration,
     * immediate cancellation initiated by the user, or system-initiated
     * cancellation.
     *
     * Generated from protobuf field <code>.google.cloud.commerce.consumer.procurement.v1.LineItemChangeStateReasonType change_state_reason_type = 10 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param int $var
     * @return $this
     */
    public function setChangeStateReasonType($var)
    {
        GPBUtil::checkEnum($var, \Google\Cloud\Commerce\Consumer\Procurement\V1\LineItemChangeStateReasonType::class);
        $this->change_state_reason_type = $var;

        return $this;
    }

    /**
     * Output only. A time at which the change became or will become (in case of
     * pending change) effective.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp change_effective_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return \Google\Protobuf\Timestamp|null
     */
    public function getChangeEffectiveTime()
    {
        return $this->change_effective_time;
    }

    public function hasChangeEffectiveTime()
    {
        return isset($this->change_effective_time);
    }

    public function clearChangeEffectiveTime()
    {
        unset($this->change_effective_time);
    }

    /**
     * Output only. A time at which the change became or will become (in case of
     * pending change) effective.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp change_effective_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param \Google\Protobuf\Timestamp $var
     * @return $this
     */
    public function setChangeEffectiveTime($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class);
        $this->change_effective_time = $var;

        return $this;
    }

    /**
     * Output only. The time when change was initiated.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp create_time = 8 [(.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 change was initiated.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp create_time = 8 [(.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 change was updated, e.g. approved/rejected by
     * partners or cancelled by the user.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp update_time = 9 [(.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 change was updated, e.g. approved/rejected by
     * partners or cancelled by the user.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp update_time = 9 [(.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;
    }

}

