<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# NO CHECKED-IN PROTOBUF GENCODE
# source: common/v1/grpc_status.proto

namespace RoadRunner\Common\DTO\V1;

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

/**
 * The `Status` type defines a logical error model that is suitable for
 * different programming environments, including REST APIs and RPC APIs.
 *
 * Generated from protobuf message <code>common.v1.Status</code>
 */
class Status extends \Google\Protobuf\Internal\Message
{
    /**
     * A simple error code that can be easily handled by the client. The
     * actual error code is defined by `google.rpc.Code`.
     *
     * Generated from protobuf field <code>int32 code = 1;</code>
     */
    protected $code = 0;
    /**
     * A developer-facing human-readable error message in English. It should
     * both explain the error and offer an actionable resolution to it.
     *
     * Generated from protobuf field <code>string message = 2;</code>
     */
    protected $message = '';
    /**
     * Additional error information that the client code can use to handle
     * the error, such as retry info or a help link.
     *
     * Generated from protobuf field <code>repeated .google.protobuf.Any details = 3;</code>
     */
    private $details;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type int $code
     *           A simple error code that can be easily handled by the client. The
     *           actual error code is defined by `google.rpc.Code`.
     *     @type string $message
     *           A developer-facing human-readable error message in English. It should
     *           both explain the error and offer an actionable resolution to it.
     *     @type \Google\Protobuf\Any[] $details
     *           Additional error information that the client code can use to handle
     *           the error, such as retry info or a help link.
     * }
     */
    public function __construct($data = NULL) {
        \RoadRunner\Common\DTO\V1\GPBMetadata\GrpcStatus::initOnce();
        parent::__construct($data);
    }

    /**
     * A simple error code that can be easily handled by the client. The
     * actual error code is defined by `google.rpc.Code`.
     *
     * Generated from protobuf field <code>int32 code = 1;</code>
     * @return int
     */
    public function getCode()
    {
        return $this->code;
    }

    /**
     * A simple error code that can be easily handled by the client. The
     * actual error code is defined by `google.rpc.Code`.
     *
     * Generated from protobuf field <code>int32 code = 1;</code>
     * @param int $var
     * @return $this
     */
    public function setCode($var)
    {
        GPBUtil::checkInt32($var);
        $this->code = $var;

        return $this;
    }

    /**
     * A developer-facing human-readable error message in English. It should
     * both explain the error and offer an actionable resolution to it.
     *
     * Generated from protobuf field <code>string message = 2;</code>
     * @return string
     */
    public function getMessage()
    {
        return $this->message;
    }

    /**
     * A developer-facing human-readable error message in English. It should
     * both explain the error and offer an actionable resolution to it.
     *
     * 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;
    }

    /**
     * Additional error information that the client code can use to handle
     * the error, such as retry info or a help link.
     *
     * Generated from protobuf field <code>repeated .google.protobuf.Any details = 3;</code>
     * @return RepeatedField<\Google\Protobuf\Any>
     */
    public function getDetails()
    {
        return $this->details;
    }

    /**
     * Additional error information that the client code can use to handle
     * the error, such as retry info or a help link.
     *
     * Generated from protobuf field <code>repeated .google.protobuf.Any details = 3;</code>
     * @param \Google\Protobuf\Any[] $var
     * @return $this
     */
    public function setDetails($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Any::class);
        $this->details = $arr;

        return $this;
    }

}

