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

/**
 * Provides a localized error message that is safe to return to the user which can be attached to an RPC error.
 *
 * Generated from protobuf message <code>google.cloud.compute.v1.LocalizedMessage</code>
 */
class LocalizedMessage extends \Google\Protobuf\Internal\Message
{
    /**
     * The locale used following the specification defined at https://www.rfc-editor.org/rfc/bcp/bcp47.txt. Examples are: "en-US", "fr-CH", "es-MX"
     *
     * Generated from protobuf field <code>optional string locale = 513150554;</code>
     */
    private $locale = null;
    /**
     * The localized error message in the above locale.
     *
     * Generated from protobuf field <code>optional string message = 418054151;</code>
     */
    private $message = null;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $locale
     *           The locale used following the specification defined at https://www.rfc-editor.org/rfc/bcp/bcp47.txt. Examples are: "en-US", "fr-CH", "es-MX"
     *     @type string $message
     *           The localized error message in the above locale.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce();
        parent::__construct($data);
    }

    /**
     * The locale used following the specification defined at https://www.rfc-editor.org/rfc/bcp/bcp47.txt. Examples are: "en-US", "fr-CH", "es-MX"
     *
     * Generated from protobuf field <code>optional string locale = 513150554;</code>
     * @return string
     */
    public function getLocale()
    {
        return isset($this->locale) ? $this->locale : '';
    }

    public function hasLocale()
    {
        return isset($this->locale);
    }

    public function clearLocale()
    {
        unset($this->locale);
    }

    /**
     * The locale used following the specification defined at https://www.rfc-editor.org/rfc/bcp/bcp47.txt. Examples are: "en-US", "fr-CH", "es-MX"
     *
     * Generated from protobuf field <code>optional string locale = 513150554;</code>
     * @param string $var
     * @return $this
     */
    public function setLocale($var)
    {
        GPBUtil::checkString($var, True);
        $this->locale = $var;

        return $this;
    }

    /**
     * The localized error message in the above locale.
     *
     * 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);
    }

    /**
     * The localized error message in the above locale.
     *
     * 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;
    }

}

