<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: websitelog.proto

namespace Gateway\Data\Rawlog;

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

/**
 * Generated from protobuf message <code>gateway.data.rawlog.WebsiteLog</code>
 */
class WebsiteLog extends \Google\Protobuf\Internal\Message
{
    /**
     * 请求时间，精确到毫秒
     *
     * Generated from protobuf field <code>int64 request_time_ms = 1;</code>
     */
    private $request_time_ms = 0;
    /**
     * 请求的响应时间，精确到毫秒
     *
     * Generated from protobuf field <code>int64 response_time_ms = 2;</code>
     */
    private $response_time_ms = 0;
    /**
     * 事件标识
     *
     * Generated from protobuf field <code>string action = 3;</code>
     */
    private $action = '';
    /**
     * 日志接收时间
     *
     * Generated from protobuf field <code>int64 recv_time_ms = 6;</code>
     */
    private $recv_time_ms = 0;
    /**
     * 前端ip？
     *
     * Generated from protobuf field <code>string remote_host = 8;</code>
     */
    private $remote_host = '';
    /**
     * 日志唯一性标识？
     *
     * Generated from protobuf field <code>string checksum = 9;</code>
     */
    private $checksum = '';
    /**
     * 以下为 request 的内容
     *
     * Generated from protobuf field <code>.gateway.data.rawlog.AppMeta app_meta = 101;</code>
     */
    private $app_meta = null;
    /**
     * API 版本号
     *
     * Generated from protobuf field <code>string api_version = 102;</code>
     */
    private $api_version = '';
    /**
     * 用户相关的ID, 唯一标识用户
     *
     * Generated from protobuf field <code>.gateway.data.rawlog.UID uid = 103;</code>
     */
    private $uid = null;
    /**
     * (来自API组的需求) request_id
     *
     * Generated from protobuf field <code>string reqid = 104;</code>
     */
    private $reqid = '';
    /**
     *request.ip / request.clientInfo.deviceInfo.ip
     *
     * Generated from protobuf field <code>string ip = 105;</code>
     */
    private $ip = '';
    /**
     *request.net
     *
     * Generated from protobuf field <code>string net_type = 106;</code>
     */
    private $net_type = '';
    /**
     * 其它常用 request 参数待补充
     *
     * Generated from protobuf field <code>map<string, string> request_context = 199;</code>
     */
    private $request_context;
    /**
     * 以下为 response 的内容
     *
     * Generated from protobuf field <code>string status = 201;</code>
     */
    private $status = '';
    /**
     * 具体状态code
     *
     * Generated from protobuf field <code>int32 code = 202;</code>
     */
    private $code = 0;
    /**
     * 错误原因
     *
     * Generated from protobuf field <code>string reason = 203;</code>
     */
    private $reason = '';
    /**
     * 其它常用 response 参数待补充
     *
     * Generated from protobuf field <code>map<string, string> response_context = 299;</code>
     */
    private $response_context;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type int|string $request_time_ms
     *           请求时间，精确到毫秒
     *     @type int|string $response_time_ms
     *           请求的响应时间，精确到毫秒
     *     @type string $action
     *           事件标识
     *     @type int|string $recv_time_ms
     *           日志接收时间
     *     @type string $remote_host
     *           前端ip？
     *     @type string $checksum
     *           日志唯一性标识？
     *     @type \Gateway\Data\Rawlog\AppMeta $app_meta
     *           以下为 request 的内容
     *     @type string $api_version
     *           API 版本号
     *     @type \Gateway\Data\Rawlog\UID $uid
     *           用户相关的ID, 唯一标识用户
     *     @type string $reqid
     *           (来自API组的需求) request_id
     *     @type string $ip
     *          request.ip / request.clientInfo.deviceInfo.ip
     *     @type string $net_type
     *          request.net
     *     @type array|\Google\Protobuf\Internal\MapField $request_context
     *           其它常用 request 参数待补充
     *     @type string $status
     *           以下为 response 的内容
     *     @type int $code
     *           具体状态code
     *     @type string $reason
     *           错误原因
     *     @type array|\Google\Protobuf\Internal\MapField $response_context
     *           其它常用 response 参数待补充
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Websitelog::initOnce();
        parent::__construct($data);
    }

    /**
     * 请求时间，精确到毫秒
     *
     * Generated from protobuf field <code>int64 request_time_ms = 1;</code>
     * @return int|string
     */
    public function getRequestTimeMs()
    {
        return $this->request_time_ms;
    }

    /**
     * 请求时间，精确到毫秒
     *
     * Generated from protobuf field <code>int64 request_time_ms = 1;</code>
     * @param int|string $var
     * @return $this
     */
    public function setRequestTimeMs($var)
    {
        GPBUtil::checkInt64($var);
        $this->request_time_ms = $var;

        return $this;
    }

    /**
     * 请求的响应时间，精确到毫秒
     *
     * Generated from protobuf field <code>int64 response_time_ms = 2;</code>
     * @return int|string
     */
    public function getResponseTimeMs()
    {
        return $this->response_time_ms;
    }

    /**
     * 请求的响应时间，精确到毫秒
     *
     * Generated from protobuf field <code>int64 response_time_ms = 2;</code>
     * @param int|string $var
     * @return $this
     */
    public function setResponseTimeMs($var)
    {
        GPBUtil::checkInt64($var);
        $this->response_time_ms = $var;

        return $this;
    }

    /**
     * 事件标识
     *
     * Generated from protobuf field <code>string action = 3;</code>
     * @return string
     */
    public function getAction()
    {
        return $this->action;
    }

    /**
     * 事件标识
     *
     * Generated from protobuf field <code>string action = 3;</code>
     * @param string $var
     * @return $this
     */
    public function setAction($var)
    {
        GPBUtil::checkString($var, True);
        $this->action = $var;

        return $this;
    }

    /**
     * 日志接收时间
     *
     * Generated from protobuf field <code>int64 recv_time_ms = 6;</code>
     * @return int|string
     */
    public function getRecvTimeMs()
    {
        return $this->recv_time_ms;
    }

    /**
     * 日志接收时间
     *
     * Generated from protobuf field <code>int64 recv_time_ms = 6;</code>
     * @param int|string $var
     * @return $this
     */
    public function setRecvTimeMs($var)
    {
        GPBUtil::checkInt64($var);
        $this->recv_time_ms = $var;

        return $this;
    }

    /**
     * 前端ip？
     *
     * Generated from protobuf field <code>string remote_host = 8;</code>
     * @return string
     */
    public function getRemoteHost()
    {
        return $this->remote_host;
    }

    /**
     * 前端ip？
     *
     * Generated from protobuf field <code>string remote_host = 8;</code>
     * @param string $var
     * @return $this
     */
    public function setRemoteHost($var)
    {
        GPBUtil::checkString($var, True);
        $this->remote_host = $var;

        return $this;
    }

    /**
     * 日志唯一性标识？
     *
     * Generated from protobuf field <code>string checksum = 9;</code>
     * @return string
     */
    public function getChecksum()
    {
        return $this->checksum;
    }

    /**
     * 日志唯一性标识？
     *
     * Generated from protobuf field <code>string checksum = 9;</code>
     * @param string $var
     * @return $this
     */
    public function setChecksum($var)
    {
        GPBUtil::checkString($var, True);
        $this->checksum = $var;

        return $this;
    }

    /**
     * 以下为 request 的内容
     *
     * Generated from protobuf field <code>.gateway.data.rawlog.AppMeta app_meta = 101;</code>
     * @return \Gateway\Data\Rawlog\AppMeta
     */
    public function getAppMeta()
    {
        return $this->app_meta;
    }

    /**
     * 以下为 request 的内容
     *
     * Generated from protobuf field <code>.gateway.data.rawlog.AppMeta app_meta = 101;</code>
     * @param \Gateway\Data\Rawlog\AppMeta $var
     * @return $this
     */
    public function setAppMeta($var)
    {
        GPBUtil::checkMessage($var, \Gateway\Data\Rawlog\AppMeta::class);
        $this->app_meta = $var;

        return $this;
    }

    /**
     * API 版本号
     *
     * Generated from protobuf field <code>string api_version = 102;</code>
     * @return string
     */
    public function getApiVersion()
    {
        return $this->api_version;
    }

    /**
     * API 版本号
     *
     * Generated from protobuf field <code>string api_version = 102;</code>
     * @param string $var
     * @return $this
     */
    public function setApiVersion($var)
    {
        GPBUtil::checkString($var, True);
        $this->api_version = $var;

        return $this;
    }

    /**
     * 用户相关的ID, 唯一标识用户
     *
     * Generated from protobuf field <code>.gateway.data.rawlog.UID uid = 103;</code>
     * @return \Gateway\Data\Rawlog\UID
     */
    public function getUid()
    {
        return $this->uid;
    }

    /**
     * 用户相关的ID, 唯一标识用户
     *
     * Generated from protobuf field <code>.gateway.data.rawlog.UID uid = 103;</code>
     * @param \Gateway\Data\Rawlog\UID $var
     * @return $this
     */
    public function setUid($var)
    {
        GPBUtil::checkMessage($var, \Gateway\Data\Rawlog\UID::class);
        $this->uid = $var;

        return $this;
    }

    /**
     * (来自API组的需求) request_id
     *
     * Generated from protobuf field <code>string reqid = 104;</code>
     * @return string
     */
    public function getReqid()
    {
        return $this->reqid;
    }

    /**
     * (来自API组的需求) request_id
     *
     * Generated from protobuf field <code>string reqid = 104;</code>
     * @param string $var
     * @return $this
     */
    public function setReqid($var)
    {
        GPBUtil::checkString($var, True);
        $this->reqid = $var;

        return $this;
    }

    /**
     *request.ip / request.clientInfo.deviceInfo.ip
     *
     * Generated from protobuf field <code>string ip = 105;</code>
     * @return string
     */
    public function getIp()
    {
        return $this->ip;
    }

    /**
     *request.ip / request.clientInfo.deviceInfo.ip
     *
     * Generated from protobuf field <code>string ip = 105;</code>
     * @param string $var
     * @return $this
     */
    public function setIp($var)
    {
        GPBUtil::checkString($var, True);
        $this->ip = $var;

        return $this;
    }

    /**
     *request.net
     *
     * Generated from protobuf field <code>string net_type = 106;</code>
     * @return string
     */
    public function getNetType()
    {
        return $this->net_type;
    }

    /**
     *request.net
     *
     * Generated from protobuf field <code>string net_type = 106;</code>
     * @param string $var
     * @return $this
     */
    public function setNetType($var)
    {
        GPBUtil::checkString($var, True);
        $this->net_type = $var;

        return $this;
    }

    /**
     * 其它常用 request 参数待补充
     *
     * Generated from protobuf field <code>map<string, string> request_context = 199;</code>
     * @return \Google\Protobuf\Internal\MapField
     */
    public function getRequestContext()
    {
        return $this->request_context;
    }

    /**
     * 其它常用 request 参数待补充
     *
     * Generated from protobuf field <code>map<string, string> request_context = 199;</code>
     * @param array|\Google\Protobuf\Internal\MapField $var
     * @return $this
     */
    public function setRequestContext($var)
    {
        $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING);
        $this->request_context = $arr;

        return $this;
    }

    /**
     * 以下为 response 的内容
     *
     * Generated from protobuf field <code>string status = 201;</code>
     * @return string
     */
    public function getStatus()
    {
        return $this->status;
    }

    /**
     * 以下为 response 的内容
     *
     * Generated from protobuf field <code>string status = 201;</code>
     * @param string $var
     * @return $this
     */
    public function setStatus($var)
    {
        GPBUtil::checkString($var, True);
        $this->status = $var;

        return $this;
    }

    /**
     * 具体状态code
     *
     * Generated from protobuf field <code>int32 code = 202;</code>
     * @return int
     */
    public function getCode()
    {
        return $this->code;
    }

    /**
     * 具体状态code
     *
     * Generated from protobuf field <code>int32 code = 202;</code>
     * @param int $var
     * @return $this
     */
    public function setCode($var)
    {
        GPBUtil::checkInt32($var);
        $this->code = $var;

        return $this;
    }

    /**
     * 错误原因
     *
     * Generated from protobuf field <code>string reason = 203;</code>
     * @return string
     */
    public function getReason()
    {
        return $this->reason;
    }

    /**
     * 错误原因
     *
     * Generated from protobuf field <code>string reason = 203;</code>
     * @param string $var
     * @return $this
     */
    public function setReason($var)
    {
        GPBUtil::checkString($var, True);
        $this->reason = $var;

        return $this;
    }

    /**
     * 其它常用 response 参数待补充
     *
     * Generated from protobuf field <code>map<string, string> response_context = 299;</code>
     * @return \Google\Protobuf\Internal\MapField
     */
    public function getResponseContext()
    {
        return $this->response_context;
    }

    /**
     * 其它常用 response 参数待补充
     *
     * Generated from protobuf field <code>map<string, string> response_context = 299;</code>
     * @param array|\Google\Protobuf\Internal\MapField $var
     * @return $this
     */
    public function setResponseContext($var)
    {
        $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING);
        $this->response_context = $arr;

        return $this;
    }

}

