<?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
     *
     * Generated from protobuf field <code>.google.container.v1.StatusCondition.Code code = 1;</code>
     */
    private $code = 0;
    /**
     * Human-friendly representation of the condition
     *
     * Generated from protobuf field <code>string message = 2;</code>
     */
    private $message = '';

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

    /**
     * Machine-friendly representation of the condition
     *
     * Generated from protobuf field <code>.google.container.v1.StatusCondition.Code code = 1;</code>
     * @return int
     */
    public function getCode()
    {
        return $this->code;
    }

    /**
     * Machine-friendly representation of the condition
     *
     * Generated from protobuf field <code>.google.container.v1.StatusCondition.Code code = 1;</code>
     * @param int $var
     * @return $this
     */
    public function setCode($var)
    {
        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;
    }

}

