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

namespace Google\Cloud\Container\V1;

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

/**
 * This operation resource represents operations that may have happened or are
 * happening on the cluster. All fields are output only.
 *
 * Generated from protobuf message <code>google.container.v1.Operation</code>
 */
class Operation extends \Google\Protobuf\Internal\Message
{
    /**
     * The server-assigned ID for the operation.
     *
     * Generated from protobuf field <code>string name = 1;</code>
     */
    private $name = '';
    /**
     * The name of the Google Compute Engine
     * [zone](https://cloud.google.com/compute/docs/zones#available) in which the operation
     * is taking place.
     * This field is deprecated, use location instead.
     *
     * Generated from protobuf field <code>string zone = 2 [deprecated = true];</code>
     */
    private $zone = '';
    /**
     * The operation type.
     *
     * Generated from protobuf field <code>.google.container.v1.Operation.Type operation_type = 3;</code>
     */
    private $operation_type = 0;
    /**
     * The current status of the operation.
     *
     * Generated from protobuf field <code>.google.container.v1.Operation.Status status = 4;</code>
     */
    private $status = 0;
    /**
     * Detailed operation progress, if available.
     *
     * Generated from protobuf field <code>string detail = 8;</code>
     */
    private $detail = '';
    /**
     * If an error has occurred, a textual description of the error.
     *
     * Generated from protobuf field <code>string status_message = 5;</code>
     */
    private $status_message = '';
    /**
     * Server-defined URL for the resource.
     *
     * Generated from protobuf field <code>string self_link = 6;</code>
     */
    private $self_link = '';
    /**
     * Server-defined URL for the target of the operation.
     *
     * Generated from protobuf field <code>string target_link = 7;</code>
     */
    private $target_link = '';
    /**
     * [Output only] The name of the Google Compute Engine
     * [zone](https://cloud.google.com/compute/docs/regions-zones/regions-zones#available) or
     * [region](https://cloud.google.com/compute/docs/regions-zones/regions-zones#available) in which
     * the cluster resides.
     *
     * Generated from protobuf field <code>string location = 9;</code>
     */
    private $location = '';
    /**
     * [Output only] The time the operation started, in
     * [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text format.
     *
     * Generated from protobuf field <code>string start_time = 10;</code>
     */
    private $start_time = '';
    /**
     * [Output only] The time the operation completed, in
     * [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text format.
     *
     * Generated from protobuf field <code>string end_time = 11;</code>
     */
    private $end_time = '';
    /**
     * Which conditions caused the current cluster state.
     *
     * Generated from protobuf field <code>repeated .google.container.v1.StatusCondition cluster_conditions = 13;</code>
     */
    private $cluster_conditions;
    /**
     * Which conditions caused the current node pool state.
     *
     * Generated from protobuf field <code>repeated .google.container.v1.StatusCondition nodepool_conditions = 14;</code>
     */
    private $nodepool_conditions;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $name
     *           The server-assigned ID for the operation.
     *     @type string $zone
     *           The name of the Google Compute Engine
     *           [zone](https://cloud.google.com/compute/docs/zones#available) in which the operation
     *           is taking place.
     *           This field is deprecated, use location instead.
     *     @type int $operation_type
     *           The operation type.
     *     @type int $status
     *           The current status of the operation.
     *     @type string $detail
     *           Detailed operation progress, if available.
     *     @type string $status_message
     *           If an error has occurred, a textual description of the error.
     *     @type string $self_link
     *           Server-defined URL for the resource.
     *     @type string $target_link
     *           Server-defined URL for the target of the operation.
     *     @type string $location
     *           [Output only] The name of the Google Compute Engine
     *           [zone](https://cloud.google.com/compute/docs/regions-zones/regions-zones#available) or
     *           [region](https://cloud.google.com/compute/docs/regions-zones/regions-zones#available) in which
     *           the cluster resides.
     *     @type string $start_time
     *           [Output only] The time the operation started, in
     *           [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text format.
     *     @type string $end_time
     *           [Output only] The time the operation completed, in
     *           [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text format.
     *     @type \Google\Cloud\Container\V1\StatusCondition[]|\Google\Protobuf\Internal\RepeatedField $cluster_conditions
     *           Which conditions caused the current cluster state.
     *     @type \Google\Cloud\Container\V1\StatusCondition[]|\Google\Protobuf\Internal\RepeatedField $nodepool_conditions
     *           Which conditions caused the current node pool state.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Container\V1\ClusterService::initOnce();
        parent::__construct($data);
    }

    /**
     * The server-assigned ID for the operation.
     *
     * Generated from protobuf field <code>string name = 1;</code>
     * @return string
     */
    public function getName()
    {
        return $this->name;
    }

    /**
     * The server-assigned ID for the operation.
     *
     * Generated from protobuf field <code>string name = 1;</code>
     * @param string $var
     * @return $this
     */
    public function setName($var)
    {
        GPBUtil::checkString($var, True);
        $this->name = $var;

        return $this;
    }

    /**
     * The name of the Google Compute Engine
     * [zone](https://cloud.google.com/compute/docs/zones#available) in which the operation
     * is taking place.
     * This field is deprecated, use location instead.
     *
     * Generated from protobuf field <code>string zone = 2 [deprecated = true];</code>
     * @return string
     */
    public function getZone()
    {
        return $this->zone;
    }

    /**
     * The name of the Google Compute Engine
     * [zone](https://cloud.google.com/compute/docs/zones#available) in which the operation
     * is taking place.
     * This field is deprecated, use location instead.
     *
     * Generated from protobuf field <code>string zone = 2 [deprecated = true];</code>
     * @param string $var
     * @return $this
     */
    public function setZone($var)
    {
        GPBUtil::checkString($var, True);
        $this->zone = $var;

        return $this;
    }

    /**
     * The operation type.
     *
     * Generated from protobuf field <code>.google.container.v1.Operation.Type operation_type = 3;</code>
     * @return int
     */
    public function getOperationType()
    {
        return $this->operation_type;
    }

    /**
     * The operation type.
     *
     * Generated from protobuf field <code>.google.container.v1.Operation.Type operation_type = 3;</code>
     * @param int $var
     * @return $this
     */
    public function setOperationType($var)
    {
        GPBUtil::checkEnum($var, \Google\Cloud\Container\V1\Operation_Type::class);
        $this->operation_type = $var;

        return $this;
    }

    /**
     * The current status of the operation.
     *
     * Generated from protobuf field <code>.google.container.v1.Operation.Status status = 4;</code>
     * @return int
     */
    public function getStatus()
    {
        return $this->status;
    }

    /**
     * The current status of the operation.
     *
     * Generated from protobuf field <code>.google.container.v1.Operation.Status status = 4;</code>
     * @param int $var
     * @return $this
     */
    public function setStatus($var)
    {
        GPBUtil::checkEnum($var, \Google\Cloud\Container\V1\Operation_Status::class);
        $this->status = $var;

        return $this;
    }

    /**
     * Detailed operation progress, if available.
     *
     * Generated from protobuf field <code>string detail = 8;</code>
     * @return string
     */
    public function getDetail()
    {
        return $this->detail;
    }

    /**
     * Detailed operation progress, if available.
     *
     * Generated from protobuf field <code>string detail = 8;</code>
     * @param string $var
     * @return $this
     */
    public function setDetail($var)
    {
        GPBUtil::checkString($var, True);
        $this->detail = $var;

        return $this;
    }

    /**
     * If an error has occurred, a textual description of the error.
     *
     * Generated from protobuf field <code>string status_message = 5;</code>
     * @return string
     */
    public function getStatusMessage()
    {
        return $this->status_message;
    }

    /**
     * If an error has occurred, a textual description of the error.
     *
     * Generated from protobuf field <code>string status_message = 5;</code>
     * @param string $var
     * @return $this
     */
    public function setStatusMessage($var)
    {
        GPBUtil::checkString($var, True);
        $this->status_message = $var;

        return $this;
    }

    /**
     * Server-defined URL for the resource.
     *
     * Generated from protobuf field <code>string self_link = 6;</code>
     * @return string
     */
    public function getSelfLink()
    {
        return $this->self_link;
    }

    /**
     * Server-defined URL for the resource.
     *
     * Generated from protobuf field <code>string self_link = 6;</code>
     * @param string $var
     * @return $this
     */
    public function setSelfLink($var)
    {
        GPBUtil::checkString($var, True);
        $this->self_link = $var;

        return $this;
    }

    /**
     * Server-defined URL for the target of the operation.
     *
     * Generated from protobuf field <code>string target_link = 7;</code>
     * @return string
     */
    public function getTargetLink()
    {
        return $this->target_link;
    }

    /**
     * Server-defined URL for the target of the operation.
     *
     * Generated from protobuf field <code>string target_link = 7;</code>
     * @param string $var
     * @return $this
     */
    public function setTargetLink($var)
    {
        GPBUtil::checkString($var, True);
        $this->target_link = $var;

        return $this;
    }

    /**
     * [Output only] The name of the Google Compute Engine
     * [zone](https://cloud.google.com/compute/docs/regions-zones/regions-zones#available) or
     * [region](https://cloud.google.com/compute/docs/regions-zones/regions-zones#available) in which
     * the cluster resides.
     *
     * Generated from protobuf field <code>string location = 9;</code>
     * @return string
     */
    public function getLocation()
    {
        return $this->location;
    }

    /**
     * [Output only] The name of the Google Compute Engine
     * [zone](https://cloud.google.com/compute/docs/regions-zones/regions-zones#available) or
     * [region](https://cloud.google.com/compute/docs/regions-zones/regions-zones#available) in which
     * the cluster resides.
     *
     * Generated from protobuf field <code>string location = 9;</code>
     * @param string $var
     * @return $this
     */
    public function setLocation($var)
    {
        GPBUtil::checkString($var, True);
        $this->location = $var;

        return $this;
    }

    /**
     * [Output only] The time the operation started, in
     * [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text format.
     *
     * Generated from protobuf field <code>string start_time = 10;</code>
     * @return string
     */
    public function getStartTime()
    {
        return $this->start_time;
    }

    /**
     * [Output only] The time the operation started, in
     * [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text format.
     *
     * Generated from protobuf field <code>string start_time = 10;</code>
     * @param string $var
     * @return $this
     */
    public function setStartTime($var)
    {
        GPBUtil::checkString($var, True);
        $this->start_time = $var;

        return $this;
    }

    /**
     * [Output only] The time the operation completed, in
     * [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text format.
     *
     * Generated from protobuf field <code>string end_time = 11;</code>
     * @return string
     */
    public function getEndTime()
    {
        return $this->end_time;
    }

    /**
     * [Output only] The time the operation completed, in
     * [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text format.
     *
     * Generated from protobuf field <code>string end_time = 11;</code>
     * @param string $var
     * @return $this
     */
    public function setEndTime($var)
    {
        GPBUtil::checkString($var, True);
        $this->end_time = $var;

        return $this;
    }

    /**
     * Which conditions caused the current cluster state.
     *
     * Generated from protobuf field <code>repeated .google.container.v1.StatusCondition cluster_conditions = 13;</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getClusterConditions()
    {
        return $this->cluster_conditions;
    }

    /**
     * Which conditions caused the current cluster state.
     *
     * Generated from protobuf field <code>repeated .google.container.v1.StatusCondition cluster_conditions = 13;</code>
     * @param \Google\Cloud\Container\V1\StatusCondition[]|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setClusterConditions($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Container\V1\StatusCondition::class);
        $this->cluster_conditions = $arr;

        return $this;
    }

    /**
     * Which conditions caused the current node pool state.
     *
     * Generated from protobuf field <code>repeated .google.container.v1.StatusCondition nodepool_conditions = 14;</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getNodepoolConditions()
    {
        return $this->nodepool_conditions;
    }

    /**
     * Which conditions caused the current node pool state.
     *
     * Generated from protobuf field <code>repeated .google.container.v1.StatusCondition nodepool_conditions = 14;</code>
     * @param \Google\Cloud\Container\V1\StatusCondition[]|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setNodepoolConditions($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Container\V1\StatusCondition::class);
        $this->nodepool_conditions = $arr;

        return $this;
    }

}

