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

namespace Google\Cloud\Optimization\V1;

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

/**
 * The long running operation metadata for async model related methods.
 *
 * Generated from protobuf message <code>google.cloud.optimization.v1.AsyncModelMetadata</code>
 */
class AsyncModelMetadata extends \Google\Protobuf\Internal\Message
{
    /**
     * The state of the current operation.
     *
     * Generated from protobuf field <code>.google.cloud.optimization.v1.AsyncModelMetadata.State state = 1;</code>
     */
    protected $state = 0;
    /**
     * A message providing more details about the current state of the operation.
     * For example, the error message if the operation is failed.
     *
     * Generated from protobuf field <code>string state_message = 2;</code>
     */
    protected $state_message = '';
    /**
     * The creation time of the operation.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp create_time = 3;</code>
     */
    protected $create_time = null;
    /**
     * The last update time of the operation.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp update_time = 4;</code>
     */
    protected $update_time = null;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type int $state
     *           The state of the current operation.
     *     @type string $state_message
     *           A message providing more details about the current state of the operation.
     *           For example, the error message if the operation is failed.
     *     @type \Google\Protobuf\Timestamp $create_time
     *           The creation time of the operation.
     *     @type \Google\Protobuf\Timestamp $update_time
     *           The last update time of the operation.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Optimization\V1\AsyncModel::initOnce();
        parent::__construct($data);
    }

    /**
     * The state of the current operation.
     *
     * Generated from protobuf field <code>.google.cloud.optimization.v1.AsyncModelMetadata.State state = 1;</code>
     * @return int
     */
    public function getState()
    {
        return $this->state;
    }

    /**
     * The state of the current operation.
     *
     * Generated from protobuf field <code>.google.cloud.optimization.v1.AsyncModelMetadata.State state = 1;</code>
     * @param int $var
     * @return $this
     */
    public function setState($var)
    {
        GPBUtil::checkEnum($var, \Google\Cloud\Optimization\V1\AsyncModelMetadata\State::class);
        $this->state = $var;

        return $this;
    }

    /**
     * A message providing more details about the current state of the operation.
     * For example, the error message if the operation is failed.
     *
     * Generated from protobuf field <code>string state_message = 2;</code>
     * @return string
     */
    public function getStateMessage()
    {
        return $this->state_message;
    }

    /**
     * A message providing more details about the current state of the operation.
     * For example, the error message if the operation is failed.
     *
     * Generated from protobuf field <code>string state_message = 2;</code>
     * @param string $var
     * @return $this
     */
    public function setStateMessage($var)
    {
        GPBUtil::checkString($var, True);
        $this->state_message = $var;

        return $this;
    }

    /**
     * The creation time of the operation.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp create_time = 3;</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);
    }

    /**
     * The creation time of the operation.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp create_time = 3;</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;
    }

    /**
     * The last update time of the operation.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp update_time = 4;</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);
    }

    /**
     * The last update time of the operation.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp update_time = 4;</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;
    }

}

