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

namespace Google\Cloud\GkeMultiCloud\V1;

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

/**
 * Metadata about a long-running operation.
 *
 * Generated from protobuf message <code>google.cloud.gkemulticloud.v1.OperationMetadata</code>
 */
class OperationMetadata extends \Google\Protobuf\Internal\Message
{
    /**
     * Output only. The time at which this operation was created.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    protected $create_time = null;
    /**
     * Output only. The time at which this operation was completed.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    protected $end_time = null;
    /**
     * Output only. The name of the resource associated to this operation.
     *
     * Generated from protobuf field <code>string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    protected $target = '';
    /**
     * Output only. Human-readable status of the operation, if any.
     *
     * Generated from protobuf field <code>string status_detail = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    protected $status_detail = '';
    /**
     * Output only. Human-readable status of any error that occurred during the
     * operation.
     *
     * Generated from protobuf field <code>string error_detail = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    protected $error_detail = '';
    /**
     * Output only. The verb associated with the API method which triggered this
     * operation. Possible values are "create", "delete", "update" and "import".
     *
     * Generated from protobuf field <code>string verb = 7 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    protected $verb = '';
    /**
     * Output only. Identifies whether cancellation has been requested for the
     * operation. Operations that have successfully been cancelled have
     * [google.longrunning.Operation.error][google.longrunning.Operation.error]
     * value with a [google.rpc.Status.code][google.rpc.Status.code] of 1,
     * corresponding to `Code.CANCELLED`.
     *
     * Generated from protobuf field <code>bool requested_cancellation = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    protected $requested_cancellation = false;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type \Google\Protobuf\Timestamp $create_time
     *           Output only. The time at which this operation was created.
     *     @type \Google\Protobuf\Timestamp $end_time
     *           Output only. The time at which this operation was completed.
     *     @type string $target
     *           Output only. The name of the resource associated to this operation.
     *     @type string $status_detail
     *           Output only. Human-readable status of the operation, if any.
     *     @type string $error_detail
     *           Output only. Human-readable status of any error that occurred during the
     *           operation.
     *     @type string $verb
     *           Output only. The verb associated with the API method which triggered this
     *           operation. Possible values are "create", "delete", "update" and "import".
     *     @type bool $requested_cancellation
     *           Output only. Identifies whether cancellation has been requested for the
     *           operation. Operations that have successfully been cancelled have
     *           [google.longrunning.Operation.error][google.longrunning.Operation.error]
     *           value with a [google.rpc.Status.code][google.rpc.Status.code] of 1,
     *           corresponding to `Code.CANCELLED`.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Gkemulticloud\V1\CommonResources::initOnce();
        parent::__construct($data);
    }

    /**
     * Output only. The time at which this operation was created.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp create_time = 1 [(.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 at which this operation was created.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp create_time = 1 [(.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 at which this operation was completed.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return \Google\Protobuf\Timestamp|null
     */
    public function getEndTime()
    {
        return $this->end_time;
    }

    public function hasEndTime()
    {
        return isset($this->end_time);
    }

    public function clearEndTime()
    {
        unset($this->end_time);
    }

    /**
     * Output only. The time at which this operation was completed.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param \Google\Protobuf\Timestamp $var
     * @return $this
     */
    public function setEndTime($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class);
        $this->end_time = $var;

        return $this;
    }

    /**
     * Output only. The name of the resource associated to this operation.
     *
     * Generated from protobuf field <code>string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return string
     */
    public function getTarget()
    {
        return $this->target;
    }

    /**
     * Output only. The name of the resource associated to this operation.
     *
     * Generated from protobuf field <code>string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param string $var
     * @return $this
     */
    public function setTarget($var)
    {
        GPBUtil::checkString($var, True);
        $this->target = $var;

        return $this;
    }

    /**
     * Output only. Human-readable status of the operation, if any.
     *
     * Generated from protobuf field <code>string status_detail = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return string
     */
    public function getStatusDetail()
    {
        return $this->status_detail;
    }

    /**
     * Output only. Human-readable status of the operation, if any.
     *
     * Generated from protobuf field <code>string status_detail = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param string $var
     * @return $this
     */
    public function setStatusDetail($var)
    {
        GPBUtil::checkString($var, True);
        $this->status_detail = $var;

        return $this;
    }

    /**
     * Output only. Human-readable status of any error that occurred during the
     * operation.
     *
     * Generated from protobuf field <code>string error_detail = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return string
     */
    public function getErrorDetail()
    {
        return $this->error_detail;
    }

    /**
     * Output only. Human-readable status of any error that occurred during the
     * operation.
     *
     * Generated from protobuf field <code>string error_detail = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param string $var
     * @return $this
     */
    public function setErrorDetail($var)
    {
        GPBUtil::checkString($var, True);
        $this->error_detail = $var;

        return $this;
    }

    /**
     * Output only. The verb associated with the API method which triggered this
     * operation. Possible values are "create", "delete", "update" and "import".
     *
     * Generated from protobuf field <code>string verb = 7 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return string
     */
    public function getVerb()
    {
        return $this->verb;
    }

    /**
     * Output only. The verb associated with the API method which triggered this
     * operation. Possible values are "create", "delete", "update" and "import".
     *
     * Generated from protobuf field <code>string verb = 7 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param string $var
     * @return $this
     */
    public function setVerb($var)
    {
        GPBUtil::checkString($var, True);
        $this->verb = $var;

        return $this;
    }

    /**
     * Output only. Identifies whether cancellation has been requested for the
     * operation. Operations that have successfully been cancelled have
     * [google.longrunning.Operation.error][google.longrunning.Operation.error]
     * value with a [google.rpc.Status.code][google.rpc.Status.code] of 1,
     * corresponding to `Code.CANCELLED`.
     *
     * Generated from protobuf field <code>bool requested_cancellation = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return bool
     */
    public function getRequestedCancellation()
    {
        return $this->requested_cancellation;
    }

    /**
     * Output only. Identifies whether cancellation has been requested for the
     * operation. Operations that have successfully been cancelled have
     * [google.longrunning.Operation.error][google.longrunning.Operation.error]
     * value with a [google.rpc.Status.code][google.rpc.Status.code] of 1,
     * corresponding to `Code.CANCELLED`.
     *
     * Generated from protobuf field <code>bool requested_cancellation = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param bool $var
     * @return $this
     */
    public function setRequestedCancellation($var)
    {
        GPBUtil::checkBool($var);
        $this->requested_cancellation = $var;

        return $this;
    }

}

