/* eslint-disable */
import _m0 from "protobufjs/minimal";
import { ConnectionChannelID } from "./connection_channel_id";
import { ConsumerClientID } from "./consumer_client_id";
import { MonitoringInfo } from "./monitoring_info";
import { Params } from "./params";
export const protobufPackage = "tendermint.spn.monitoringp";
function createBaseQueryGetConsumerClientIDRequest() {
    return {};
}
export const QueryGetConsumerClientIDRequest = {
    encode(_, writer = _m0.Writer.create()) {
        return writer;
    },
    decode(input, length) {
        const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
        let end = length === undefined ? reader.len : reader.pos + length;
        const message = createBaseQueryGetConsumerClientIDRequest();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                default:
                    reader.skipType(tag & 7);
                    break;
            }
        }
        return message;
    },
    fromJSON(_) {
        return {};
    },
    toJSON(_) {
        const obj = {};
        return obj;
    },
    fromPartial(_) {
        const message = createBaseQueryGetConsumerClientIDRequest();
        return message;
    },
};
function createBaseQueryGetConsumerClientIDResponse() {
    return { ConsumerClientID: undefined };
}
export const QueryGetConsumerClientIDResponse = {
    encode(message, writer = _m0.Writer.create()) {
        if (message.ConsumerClientID !== undefined) {
            ConsumerClientID.encode(message.ConsumerClientID, writer.uint32(10).fork()).ldelim();
        }
        return writer;
    },
    decode(input, length) {
        const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
        let end = length === undefined ? reader.len : reader.pos + length;
        const message = createBaseQueryGetConsumerClientIDResponse();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1:
                    message.ConsumerClientID = ConsumerClientID.decode(reader, reader.uint32());
                    break;
                default:
                    reader.skipType(tag & 7);
                    break;
            }
        }
        return message;
    },
    fromJSON(object) {
        return {
            ConsumerClientID: isSet(object.ConsumerClientID) ? ConsumerClientID.fromJSON(object.ConsumerClientID) : undefined,
        };
    },
    toJSON(message) {
        const obj = {};
        message.ConsumerClientID !== undefined && (obj.ConsumerClientID = message.ConsumerClientID
            ? ConsumerClientID.toJSON(message.ConsumerClientID)
            : undefined);
        return obj;
    },
    fromPartial(object) {
        const message = createBaseQueryGetConsumerClientIDResponse();
        message.ConsumerClientID = (object.ConsumerClientID !== undefined && object.ConsumerClientID !== null)
            ? ConsumerClientID.fromPartial(object.ConsumerClientID)
            : undefined;
        return message;
    },
};
function createBaseQueryGetConnectionChannelIDRequest() {
    return {};
}
export const QueryGetConnectionChannelIDRequest = {
    encode(_, writer = _m0.Writer.create()) {
        return writer;
    },
    decode(input, length) {
        const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
        let end = length === undefined ? reader.len : reader.pos + length;
        const message = createBaseQueryGetConnectionChannelIDRequest();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                default:
                    reader.skipType(tag & 7);
                    break;
            }
        }
        return message;
    },
    fromJSON(_) {
        return {};
    },
    toJSON(_) {
        const obj = {};
        return obj;
    },
    fromPartial(_) {
        const message = createBaseQueryGetConnectionChannelIDRequest();
        return message;
    },
};
function createBaseQueryGetConnectionChannelIDResponse() {
    return { ConnectionChannelID: undefined };
}
export const QueryGetConnectionChannelIDResponse = {
    encode(message, writer = _m0.Writer.create()) {
        if (message.ConnectionChannelID !== undefined) {
            ConnectionChannelID.encode(message.ConnectionChannelID, writer.uint32(10).fork()).ldelim();
        }
        return writer;
    },
    decode(input, length) {
        const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
        let end = length === undefined ? reader.len : reader.pos + length;
        const message = createBaseQueryGetConnectionChannelIDResponse();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1:
                    message.ConnectionChannelID = ConnectionChannelID.decode(reader, reader.uint32());
                    break;
                default:
                    reader.skipType(tag & 7);
                    break;
            }
        }
        return message;
    },
    fromJSON(object) {
        return {
            ConnectionChannelID: isSet(object.ConnectionChannelID)
                ? ConnectionChannelID.fromJSON(object.ConnectionChannelID)
                : undefined,
        };
    },
    toJSON(message) {
        const obj = {};
        message.ConnectionChannelID !== undefined && (obj.ConnectionChannelID = message.ConnectionChannelID
            ? ConnectionChannelID.toJSON(message.ConnectionChannelID)
            : undefined);
        return obj;
    },
    fromPartial(object) {
        const message = createBaseQueryGetConnectionChannelIDResponse();
        message.ConnectionChannelID = (object.ConnectionChannelID !== undefined && object.ConnectionChannelID !== null)
            ? ConnectionChannelID.fromPartial(object.ConnectionChannelID)
            : undefined;
        return message;
    },
};
function createBaseQueryGetMonitoringInfoRequest() {
    return {};
}
export const QueryGetMonitoringInfoRequest = {
    encode(_, writer = _m0.Writer.create()) {
        return writer;
    },
    decode(input, length) {
        const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
        let end = length === undefined ? reader.len : reader.pos + length;
        const message = createBaseQueryGetMonitoringInfoRequest();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                default:
                    reader.skipType(tag & 7);
                    break;
            }
        }
        return message;
    },
    fromJSON(_) {
        return {};
    },
    toJSON(_) {
        const obj = {};
        return obj;
    },
    fromPartial(_) {
        const message = createBaseQueryGetMonitoringInfoRequest();
        return message;
    },
};
function createBaseQueryGetMonitoringInfoResponse() {
    return { MonitoringInfo: undefined };
}
export const QueryGetMonitoringInfoResponse = {
    encode(message, writer = _m0.Writer.create()) {
        if (message.MonitoringInfo !== undefined) {
            MonitoringInfo.encode(message.MonitoringInfo, writer.uint32(10).fork()).ldelim();
        }
        return writer;
    },
    decode(input, length) {
        const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
        let end = length === undefined ? reader.len : reader.pos + length;
        const message = createBaseQueryGetMonitoringInfoResponse();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1:
                    message.MonitoringInfo = MonitoringInfo.decode(reader, reader.uint32());
                    break;
                default:
                    reader.skipType(tag & 7);
                    break;
            }
        }
        return message;
    },
    fromJSON(object) {
        return {
            MonitoringInfo: isSet(object.MonitoringInfo) ? MonitoringInfo.fromJSON(object.MonitoringInfo) : undefined,
        };
    },
    toJSON(message) {
        const obj = {};
        message.MonitoringInfo !== undefined
            && (obj.MonitoringInfo = message.MonitoringInfo ? MonitoringInfo.toJSON(message.MonitoringInfo) : undefined);
        return obj;
    },
    fromPartial(object) {
        const message = createBaseQueryGetMonitoringInfoResponse();
        message.MonitoringInfo = (object.MonitoringInfo !== undefined && object.MonitoringInfo !== null)
            ? MonitoringInfo.fromPartial(object.MonitoringInfo)
            : undefined;
        return message;
    },
};
function createBaseQueryParamsRequest() {
    return {};
}
export const QueryParamsRequest = {
    encode(_, writer = _m0.Writer.create()) {
        return writer;
    },
    decode(input, length) {
        const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
        let end = length === undefined ? reader.len : reader.pos + length;
        const message = createBaseQueryParamsRequest();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                default:
                    reader.skipType(tag & 7);
                    break;
            }
        }
        return message;
    },
    fromJSON(_) {
        return {};
    },
    toJSON(_) {
        const obj = {};
        return obj;
    },
    fromPartial(_) {
        const message = createBaseQueryParamsRequest();
        return message;
    },
};
function createBaseQueryParamsResponse() {
    return { params: undefined };
}
export const QueryParamsResponse = {
    encode(message, writer = _m0.Writer.create()) {
        if (message.params !== undefined) {
            Params.encode(message.params, writer.uint32(10).fork()).ldelim();
        }
        return writer;
    },
    decode(input, length) {
        const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
        let end = length === undefined ? reader.len : reader.pos + length;
        const message = createBaseQueryParamsResponse();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1:
                    message.params = Params.decode(reader, reader.uint32());
                    break;
                default:
                    reader.skipType(tag & 7);
                    break;
            }
        }
        return message;
    },
    fromJSON(object) {
        return { params: isSet(object.params) ? Params.fromJSON(object.params) : undefined };
    },
    toJSON(message) {
        const obj = {};
        message.params !== undefined && (obj.params = message.params ? Params.toJSON(message.params) : undefined);
        return obj;
    },
    fromPartial(object) {
        const message = createBaseQueryParamsResponse();
        message.params = (object.params !== undefined && object.params !== null)
            ? Params.fromPartial(object.params)
            : undefined;
        return message;
    },
};
export class QueryClientImpl {
    rpc;
    constructor(rpc) {
        this.rpc = rpc;
        this.ConsumerClientID = this.ConsumerClientID.bind(this);
        this.ConnectionChannelID = this.ConnectionChannelID.bind(this);
        this.MonitoringInfo = this.MonitoringInfo.bind(this);
        this.Params = this.Params.bind(this);
    }
    ConsumerClientID(request) {
        const data = QueryGetConsumerClientIDRequest.encode(request).finish();
        const promise = this.rpc.request("tendermint.spn.monitoringp.Query", "ConsumerClientID", data);
        return promise.then((data) => QueryGetConsumerClientIDResponse.decode(new _m0.Reader(data)));
    }
    ConnectionChannelID(request) {
        const data = QueryGetConnectionChannelIDRequest.encode(request).finish();
        const promise = this.rpc.request("tendermint.spn.monitoringp.Query", "ConnectionChannelID", data);
        return promise.then((data) => QueryGetConnectionChannelIDResponse.decode(new _m0.Reader(data)));
    }
    MonitoringInfo(request) {
        const data = QueryGetMonitoringInfoRequest.encode(request).finish();
        const promise = this.rpc.request("tendermint.spn.monitoringp.Query", "MonitoringInfo", data);
        return promise.then((data) => QueryGetMonitoringInfoResponse.decode(new _m0.Reader(data)));
    }
    Params(request) {
        const data = QueryParamsRequest.encode(request).finish();
        const promise = this.rpc.request("tendermint.spn.monitoringp.Query", "Params", data);
        return promise.then((data) => QueryParamsResponse.decode(new _m0.Reader(data)));
    }
}
function isSet(value) {
    return value !== null && value !== undefined;
}
//# sourceMappingURL=query.js.map