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

namespace Google\Cloud\AppEngine\V1;

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

/**
 * Metadata for the given [google.longrunning.Operation][google.longrunning.Operation].
 *
 * Generated from protobuf message <code>google.appengine.v1.OperationMetadataV1</code>
 */
class OperationMetadataV1 extends \Google\Protobuf\Internal\Message
{
    /**
     * API method that initiated this operation. Example:
     * `google.appengine.v1.Versions.CreateVersion`.
     * \@OutputOnly
     *
     * Generated from protobuf field <code>string method = 1;</code>
     */
    protected $method = '';
    /**
     * Time that this operation was created.
     * \@OutputOnly
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp insert_time = 2;</code>
     */
    protected $insert_time = null;
    /**
     * Time that this operation completed.
     * \@OutputOnly
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp end_time = 3;</code>
     */
    protected $end_time = null;
    /**
     * User who requested this operation.
     * \@OutputOnly
     *
     * Generated from protobuf field <code>string user = 4;</code>
     */
    protected $user = '';
    /**
     * Name of the resource that this operation is acting on. Example:
     * `apps/myapp/services/default`.
     * \@OutputOnly
     *
     * Generated from protobuf field <code>string target = 5;</code>
     */
    protected $target = '';
    /**
     * Ephemeral message that may change every time the operation is polled.
     * \@OutputOnly
     *
     * Generated from protobuf field <code>string ephemeral_message = 6;</code>
     */
    protected $ephemeral_message = '';
    /**
     * Durable messages that persist on every operation poll.
     * \@OutputOnly
     *
     * Generated from protobuf field <code>repeated string warning = 7;</code>
     */
    private $warning;
    protected $method_metadata;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $method
     *           API method that initiated this operation. Example:
     *           `google.appengine.v1.Versions.CreateVersion`.
     *           \@OutputOnly
     *     @type \Google\Protobuf\Timestamp $insert_time
     *           Time that this operation was created.
     *           \@OutputOnly
     *     @type \Google\Protobuf\Timestamp $end_time
     *           Time that this operation completed.
     *           \@OutputOnly
     *     @type string $user
     *           User who requested this operation.
     *           \@OutputOnly
     *     @type string $target
     *           Name of the resource that this operation is acting on. Example:
     *           `apps/myapp/services/default`.
     *           \@OutputOnly
     *     @type string $ephemeral_message
     *           Ephemeral message that may change every time the operation is polled.
     *           \@OutputOnly
     *     @type string[] $warning
     *           Durable messages that persist on every operation poll.
     *           \@OutputOnly
     *     @type \Google\Cloud\AppEngine\V1\CreateVersionMetadataV1 $create_version_metadata
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Appengine\V1\Operation::initOnce();
        parent::__construct($data);
    }

    /**
     * API method that initiated this operation. Example:
     * `google.appengine.v1.Versions.CreateVersion`.
     * \@OutputOnly
     *
     * Generated from protobuf field <code>string method = 1;</code>
     * @return string
     */
    public function getMethod()
    {
        return $this->method;
    }

    /**
     * API method that initiated this operation. Example:
     * `google.appengine.v1.Versions.CreateVersion`.
     * \@OutputOnly
     *
     * Generated from protobuf field <code>string method = 1;</code>
     * @param string $var
     * @return $this
     */
    public function setMethod($var)
    {
        GPBUtil::checkString($var, True);
        $this->method = $var;

        return $this;
    }

    /**
     * Time that this operation was created.
     * \@OutputOnly
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp insert_time = 2;</code>
     * @return \Google\Protobuf\Timestamp|null
     */
    public function getInsertTime()
    {
        return $this->insert_time;
    }

    public function hasInsertTime()
    {
        return isset($this->insert_time);
    }

    public function clearInsertTime()
    {
        unset($this->insert_time);
    }

    /**
     * Time that this operation was created.
     * \@OutputOnly
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp insert_time = 2;</code>
     * @param \Google\Protobuf\Timestamp $var
     * @return $this
     */
    public function setInsertTime($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class);
        $this->insert_time = $var;

        return $this;
    }

    /**
     * Time that this operation completed.
     * \@OutputOnly
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp end_time = 3;</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);
    }

    /**
     * Time that this operation completed.
     * \@OutputOnly
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp end_time = 3;</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;
    }

    /**
     * User who requested this operation.
     * \@OutputOnly
     *
     * Generated from protobuf field <code>string user = 4;</code>
     * @return string
     */
    public function getUser()
    {
        return $this->user;
    }

    /**
     * User who requested this operation.
     * \@OutputOnly
     *
     * Generated from protobuf field <code>string user = 4;</code>
     * @param string $var
     * @return $this
     */
    public function setUser($var)
    {
        GPBUtil::checkString($var, True);
        $this->user = $var;

        return $this;
    }

    /**
     * Name of the resource that this operation is acting on. Example:
     * `apps/myapp/services/default`.
     * \@OutputOnly
     *
     * Generated from protobuf field <code>string target = 5;</code>
     * @return string
     */
    public function getTarget()
    {
        return $this->target;
    }

    /**
     * Name of the resource that this operation is acting on. Example:
     * `apps/myapp/services/default`.
     * \@OutputOnly
     *
     * Generated from protobuf field <code>string target = 5;</code>
     * @param string $var
     * @return $this
     */
    public function setTarget($var)
    {
        GPBUtil::checkString($var, True);
        $this->target = $var;

        return $this;
    }

    /**
     * Ephemeral message that may change every time the operation is polled.
     * \@OutputOnly
     *
     * Generated from protobuf field <code>string ephemeral_message = 6;</code>
     * @return string
     */
    public function getEphemeralMessage()
    {
        return $this->ephemeral_message;
    }

    /**
     * Ephemeral message that may change every time the operation is polled.
     * \@OutputOnly
     *
     * Generated from protobuf field <code>string ephemeral_message = 6;</code>
     * @param string $var
     * @return $this
     */
    public function setEphemeralMessage($var)
    {
        GPBUtil::checkString($var, True);
        $this->ephemeral_message = $var;

        return $this;
    }

    /**
     * Durable messages that persist on every operation poll.
     * \@OutputOnly
     *
     * Generated from protobuf field <code>repeated string warning = 7;</code>
     * @return RepeatedField<string>
     */
    public function getWarning()
    {
        return $this->warning;
    }

    /**
     * Durable messages that persist on every operation poll.
     * \@OutputOnly
     *
     * Generated from protobuf field <code>repeated string warning = 7;</code>
     * @param string[] $var
     * @return $this
     */
    public function setWarning($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING);
        $this->warning = $arr;

        return $this;
    }

    /**
     * Generated from protobuf field <code>.google.appengine.v1.CreateVersionMetadataV1 create_version_metadata = 8;</code>
     * @return \Google\Cloud\AppEngine\V1\CreateVersionMetadataV1|null
     */
    public function getCreateVersionMetadata()
    {
        return $this->readOneof(8);
    }

    public function hasCreateVersionMetadata()
    {
        return $this->hasOneof(8);
    }

    /**
     * Generated from protobuf field <code>.google.appengine.v1.CreateVersionMetadataV1 create_version_metadata = 8;</code>
     * @param \Google\Cloud\AppEngine\V1\CreateVersionMetadataV1 $var
     * @return $this
     */
    public function setCreateVersionMetadata($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\AppEngine\V1\CreateVersionMetadataV1::class);
        $this->writeOneof(8, $var);

        return $this;
    }

    /**
     * @return string
     */
    public function getMethodMetadata()
    {
        return $this->whichOneof("method_metadata");
    }

}

