<?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;

/**
 * StatusCondition describes why a cluster or a node pool has a certain status
 * (e.g., ERROR or DEGRADED).
 *
 * Generated from protobuf message <code>google.container.v1.StatusCondition</code>
 */
class StatusCondition extends \Google\Protobuf\Internal\Message
{
    /**
     * Machine-friendly representation of the condition
     * Deprecated. Use canonical_code instead.
     *
     * Generated from protobuf field <code>.google.container.v1.StatusCondition.Code code = 1 [deprecated = true];</code>
     * @deprecated
     */
    protected $code = 0;
    /**
     * Human-friendly representation of the condition
     *
     * Generated from protobuf field <code>string message = 2;</code>
     */
    private $message = '';
    /**
     * Canonical code of the condition.
     *
     * Generated from protobuf field <code>.google.rpc.Code canonical_code = 3;</code>
     */
    private $canonical_code = 0;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type int $code
     *           Machine-friendly representation of the condition
     *           Deprecated. Use canonical_code instead.
     *     @type string $message
     *           Human-friendly representation of the condition
     *     @type int $canonical_code
     *           Canonical code of the condition.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Container\V1\ClusterService::initOnce();
        parent::__construct($data);
    }

    /**
     * Machine-friendly representation of the condition
     * Deprecated. Use canonical_code instead.
     *
     * Generated from protobuf field <code>.google.container.v1.StatusCondition.Code code = 1 [deprecated = true];</code>
     * @return int
     * @deprecated
     */
    public function getCode()
    {
        @trigger_error('code is deprecated.', E_USER_DEPRECATED);
        return $this->code;
    }

    /**
     * Machine-friendly representation of the condition
     * Deprecated. Use canonical_code instead.
     *
     * Generated from protobuf field <code>.google.container.v1.StatusCondition.Code code = 1 [deprecated = true];</code>
     * @param int $var
     * @return $this
     * @deprecated
     */
    public function setCode($var)
    {
        @trigger_error('code is deprecated.', E_USER_DEPRECATED);
        GPBUtil::checkEnum($var, \Google\Cloud\Container\V1\StatusCondition\Code::class);
        $this->code = $var;

        return $this;
    }

    /**
     * Human-friendly representation of the condition
     *
     * Generated from protobuf field <code>string message = 2;</code>
     * @return string
     */
    public function getMessage()
    {
        return $this->message;
    }

    /**
     * Human-friendly representation of the condition
     *
     * Generated from protobuf field <code>string message = 2;</code>
     * @param string $var
     * @return $this
     */
    public function setMessage($var)
    {
        GPBUtil::checkString($var, True);
        $this->message = $var;

        return $this;
    }

    /**
     * Canonical code of the condition.
     *
     * Generated from protobuf field <code>.google.rpc.Code canonical_code = 3;</code>
     * @return int
     */
    public function getCanonicalCode()
    {
        return $this->canonical_code;
    }

    /**
     * Canonical code of the condition.
     *
     * Generated from protobuf field <code>.google.rpc.Code canonical_code = 3;</code>
     * @param int $var
     * @return $this
     */
    public function setCanonicalCode($var)
    {
        GPBUtil::checkEnum($var, \Google\Rpc\Code::class);
        $this->canonical_code = $var;

        return $this;
    }

}

