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

namespace Google\Cloud\Compute\V1;

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

/**
 *
 * Generated from protobuf message <code>google.cloud.compute.v1.Warnings</code>
 */
class Warnings extends \Google\Protobuf\Internal\Message
{
    /**
     * [Output Only] A warning code, if applicable. For example, Compute
     * Engine returns NO_RESULTS_ON_PAGE if there
     * are no results in the response.
     * Check the Code enum for the list of possible values.
     *
     * Generated from protobuf field <code>optional string code = 3059181;</code>
     */
    protected $code = null;
    /**
     * [Output Only] Metadata about this warning in key:
     * value format. For example:
     * "data": [
     *   {
     *    "key": "scope",
     *    "value": "zones/us-east1-d"
     *   }
     *
     * Generated from protobuf field <code>repeated .google.cloud.compute.v1.Data data = 3076010;</code>
     */
    private $data;
    /**
     * [Output Only] A human-readable description of the warning code.
     *
     * Generated from protobuf field <code>optional string message = 418054151;</code>
     */
    protected $message = null;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $code
     *           [Output Only] A warning code, if applicable. For example, Compute
     *           Engine returns NO_RESULTS_ON_PAGE if there
     *           are no results in the response.
     *           Check the Code enum for the list of possible values.
     *     @type array<\Google\Cloud\Compute\V1\Data>|\Google\Protobuf\Internal\RepeatedField $data
     *           [Output Only] Metadata about this warning in key:
     *           value format. For example:
     *           "data": [
     *             {
     *              "key": "scope",
     *              "value": "zones/us-east1-d"
     *             }
     *     @type string $message
     *           [Output Only] A human-readable description of the warning code.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce();
        parent::__construct($data);
    }

    /**
     * [Output Only] A warning code, if applicable. For example, Compute
     * Engine returns NO_RESULTS_ON_PAGE if there
     * are no results in the response.
     * Check the Code enum for the list of possible values.
     *
     * Generated from protobuf field <code>optional string code = 3059181;</code>
     * @return string
     */
    public function getCode()
    {
        return isset($this->code) ? $this->code : '';
    }

    public function hasCode()
    {
        return isset($this->code);
    }

    public function clearCode()
    {
        unset($this->code);
    }

    /**
     * [Output Only] A warning code, if applicable. For example, Compute
     * Engine returns NO_RESULTS_ON_PAGE if there
     * are no results in the response.
     * Check the Code enum for the list of possible values.
     *
     * Generated from protobuf field <code>optional string code = 3059181;</code>
     * @param string $var
     * @return $this
     */
    public function setCode($var)
    {
        GPBUtil::checkString($var, True);
        $this->code = $var;

        return $this;
    }

    /**
     * [Output Only] Metadata about this warning in key:
     * value format. For example:
     * "data": [
     *   {
     *    "key": "scope",
     *    "value": "zones/us-east1-d"
     *   }
     *
     * Generated from protobuf field <code>repeated .google.cloud.compute.v1.Data data = 3076010;</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getData()
    {
        return $this->data;
    }

    /**
     * [Output Only] Metadata about this warning in key:
     * value format. For example:
     * "data": [
     *   {
     *    "key": "scope",
     *    "value": "zones/us-east1-d"
     *   }
     *
     * Generated from protobuf field <code>repeated .google.cloud.compute.v1.Data data = 3076010;</code>
     * @param array<\Google\Cloud\Compute\V1\Data>|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setData($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\Data::class);
        $this->data = $arr;

        return $this;
    }

    /**
     * [Output Only] A human-readable description of the warning code.
     *
     * Generated from protobuf field <code>optional string message = 418054151;</code>
     * @return string
     */
    public function getMessage()
    {
        return isset($this->message) ? $this->message : '';
    }

    public function hasMessage()
    {
        return isset($this->message);
    }

    public function clearMessage()
    {
        unset($this->message);
    }

    /**
     * [Output Only] A human-readable description of the warning code.
     *
     * Generated from protobuf field <code>optional string message = 418054151;</code>
     * @param string $var
     * @return $this
     */
    public function setMessage($var)
    {
        GPBUtil::checkString($var, True);
        $this->message = $var;

        return $this;
    }

}

