import * as $protobuf from "protobufjs";
import Long = require("long");
/** Properties of a ClientMsg. */
export interface IClientMsg {

    /** ClientMsg serviceTid */
    serviceTid?: (ServiceTypeId|null);

    /** ClientMsg serviceName */
    serviceName?: (string|null);

    /** ClientMsg userId */
    userId?: (Long|null);

    /** ClientMsg msgId */
    msgId?: (number|null);

    /** ClientMsg data */
    data?: (Uint8Array|null);
}

/** Represents a ClientMsg. */
export class ClientMsg implements IClientMsg {

    /**
     * Constructs a new ClientMsg.
     * @param [properties] Properties to set
     */
    constructor(properties?: IClientMsg);

    /** ClientMsg serviceTid. */
    public serviceTid: ServiceTypeId;

    /** ClientMsg serviceName. */
    public serviceName: string;

    /** ClientMsg userId. */
    public userId: Long;

    /** ClientMsg msgId. */
    public msgId: number;

    /** ClientMsg data. */
    public data: Uint8Array;

    /**
     * Creates a new ClientMsg instance using the specified properties.
     * @param [properties] Properties to set
     * @returns ClientMsg instance
     */
    public static create(properties?: IClientMsg): ClientMsg;

    /**
     * Encodes the specified ClientMsg message. Does not implicitly {@link ClientMsg.verify|verify} messages.
     * @param message ClientMsg message or plain object to encode
     * @param [writer] Writer to encode to
     * @returns Writer
     */
    public static encode(message: IClientMsg, writer?: $protobuf.Writer): $protobuf.Writer;

    /**
     * Encodes the specified ClientMsg message, length delimited. Does not implicitly {@link ClientMsg.verify|verify} messages.
     * @param message ClientMsg message or plain object to encode
     * @param [writer] Writer to encode to
     * @returns Writer
     */
    public static encodeDelimited(message: IClientMsg, writer?: $protobuf.Writer): $protobuf.Writer;

    /**
     * Decodes a ClientMsg message from the specified reader or buffer.
     * @param reader Reader or buffer to decode from
     * @param [length] Message length if known beforehand
     * @returns ClientMsg
     * @throws {Error} If the payload is not a reader or valid buffer
     * @throws {$protobuf.util.ProtocolError} If required fields are missing
     */
    public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ClientMsg;

    /**
     * Decodes a ClientMsg message from the specified reader or buffer, length delimited.
     * @param reader Reader or buffer to decode from
     * @returns ClientMsg
     * @throws {Error} If the payload is not a reader or valid buffer
     * @throws {$protobuf.util.ProtocolError} If required fields are missing
     */
    public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ClientMsg;

    /**
     * Verifies a ClientMsg message.
     * @param message Plain object to verify
     * @returns `null` if valid, otherwise the reason why it is not
     */
    public static verify(message: { [k: string]: any }): (string|null);

    /**
     * Creates a ClientMsg message from a plain object. Also converts values to their respective internal types.
     * @param object Plain object
     * @returns ClientMsg
     */
    public static fromObject(object: { [k: string]: any }): ClientMsg;

    /**
     * Creates a plain object from a ClientMsg message. Also converts values to other types if specified.
     * @param message ClientMsg
     * @param [options] Conversion options
     * @returns Plain object
     */
    public static toObject(message: ClientMsg, options?: $protobuf.IConversionOptions): { [k: string]: any };

    /**
     * Converts this ClientMsg to JSON.
     * @returns JSON object
     */
    public toJSON(): { [k: string]: any };

    /**
     * Gets the default type url for ClientMsg
     * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
     * @returns The default type url
     */
    public static getTypeUrl(typeUrlPrefix?: string): string;
}

/** ServiceTypeId enum. */
export enum ServiceTypeId {
    STI_Unknown = 0,
    STI_Login = 10000,
    STI_Chat = 10005,
    STI_Match = 10010,
    STI_Lobby = 10015,
    STI_Admin = 10020,
    STI_Gate = 20000,
    STI_ColorGame = 20005,
    STI_DB = 30000
}
