//@ts-nocheck
import { Params } from "./params";
import { AccountAuthenticator } from "./models";
import { Long, isSet } from "../../../helpers";
import * as _m0 from "protobufjs/minimal";
/** QueryParamsRequest is request type for the Query/Params RPC method. */

/** QueryParamsRequest is request type for the Query/Params RPC method. */

/** QueryParamsResponse is response type for the Query/Params RPC method. */

/** QueryParamsResponse is response type for the Query/Params RPC method. */

/** MsgGetAuthenticatorsRequest defines the Msg/GetAuthenticators request type. */

/** MsgGetAuthenticatorsRequest defines the Msg/GetAuthenticators request type. */

/** MsgGetAuthenticatorsResponse defines the Msg/GetAuthenticators response type. */

/** MsgGetAuthenticatorsResponse defines the Msg/GetAuthenticators response type. */

/** MsgGetAuthenticatorRequest defines the Msg/GetAuthenticator request type. */

/** MsgGetAuthenticatorRequest defines the Msg/GetAuthenticator request type. */

/** MsgGetAuthenticatorResponse defines the Msg/GetAuthenticator response type. */

/** MsgGetAuthenticatorResponse defines the Msg/GetAuthenticator response type. */

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;
  }
};
function createBaseGetAuthenticatorsRequest() {
  return {
    account: ""
  };
}
export const GetAuthenticatorsRequest = {
  encode(message, writer = _m0.Writer.create()) {
    if (message.account !== "") {
      writer.uint32(10).string(message.account);
    }
    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 = createBaseGetAuthenticatorsRequest();
    while (reader.pos < end) {
      const tag = reader.uint32();
      switch (tag >>> 3) {
        case 1:
          message.account = reader.string();
          break;
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromJSON(object) {
    return {
      account: isSet(object.account) ? String(object.account) : ""
    };
  },
  toJSON(message) {
    const obj = {};
    message.account !== undefined && (obj.account = message.account);
    return obj;
  },
  fromPartial(object) {
    var _object$account;
    const message = createBaseGetAuthenticatorsRequest();
    message.account = (_object$account = object.account) !== null && _object$account !== void 0 ? _object$account : "";
    return message;
  }
};
function createBaseGetAuthenticatorsResponse() {
  return {
    accountAuthenticators: []
  };
}
export const GetAuthenticatorsResponse = {
  encode(message, writer = _m0.Writer.create()) {
    for (const v of message.accountAuthenticators) {
      AccountAuthenticator.encode(v, 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 = createBaseGetAuthenticatorsResponse();
    while (reader.pos < end) {
      const tag = reader.uint32();
      switch (tag >>> 3) {
        case 1:
          message.accountAuthenticators.push(AccountAuthenticator.decode(reader, reader.uint32()));
          break;
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromJSON(object) {
    return {
      accountAuthenticators: Array.isArray(object === null || object === void 0 ? void 0 : object.accountAuthenticators) ? object.accountAuthenticators.map(e => AccountAuthenticator.fromJSON(e)) : []
    };
  },
  toJSON(message) {
    const obj = {};
    if (message.accountAuthenticators) {
      obj.accountAuthenticators = message.accountAuthenticators.map(e => e ? AccountAuthenticator.toJSON(e) : undefined);
    } else {
      obj.accountAuthenticators = [];
    }
    return obj;
  },
  fromPartial(object) {
    var _object$accountAuthen;
    const message = createBaseGetAuthenticatorsResponse();
    message.accountAuthenticators = ((_object$accountAuthen = object.accountAuthenticators) === null || _object$accountAuthen === void 0 ? void 0 : _object$accountAuthen.map(e => AccountAuthenticator.fromPartial(e))) || [];
    return message;
  }
};
function createBaseGetAuthenticatorRequest() {
  return {
    account: "",
    authenticatorId: Long.UZERO
  };
}
export const GetAuthenticatorRequest = {
  encode(message, writer = _m0.Writer.create()) {
    if (message.account !== "") {
      writer.uint32(10).string(message.account);
    }
    if (!message.authenticatorId.isZero()) {
      writer.uint32(16).uint64(message.authenticatorId);
    }
    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 = createBaseGetAuthenticatorRequest();
    while (reader.pos < end) {
      const tag = reader.uint32();
      switch (tag >>> 3) {
        case 1:
          message.account = reader.string();
          break;
        case 2:
          message.authenticatorId = reader.uint64();
          break;
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromJSON(object) {
    return {
      account: isSet(object.account) ? String(object.account) : "",
      authenticatorId: isSet(object.authenticatorId) ? Long.fromValue(object.authenticatorId) : Long.UZERO
    };
  },
  toJSON(message) {
    const obj = {};
    message.account !== undefined && (obj.account = message.account);
    message.authenticatorId !== undefined && (obj.authenticatorId = (message.authenticatorId || Long.UZERO).toString());
    return obj;
  },
  fromPartial(object) {
    var _object$account2;
    const message = createBaseGetAuthenticatorRequest();
    message.account = (_object$account2 = object.account) !== null && _object$account2 !== void 0 ? _object$account2 : "";
    message.authenticatorId = object.authenticatorId !== undefined && object.authenticatorId !== null ? Long.fromValue(object.authenticatorId) : Long.UZERO;
    return message;
  }
};
function createBaseGetAuthenticatorResponse() {
  return {
    accountAuthenticator: undefined
  };
}
export const GetAuthenticatorResponse = {
  encode(message, writer = _m0.Writer.create()) {
    if (message.accountAuthenticator !== undefined) {
      AccountAuthenticator.encode(message.accountAuthenticator, 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 = createBaseGetAuthenticatorResponse();
    while (reader.pos < end) {
      const tag = reader.uint32();
      switch (tag >>> 3) {
        case 1:
          message.accountAuthenticator = AccountAuthenticator.decode(reader, reader.uint32());
          break;
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromJSON(object) {
    return {
      accountAuthenticator: isSet(object.accountAuthenticator) ? AccountAuthenticator.fromJSON(object.accountAuthenticator) : undefined
    };
  },
  toJSON(message) {
    const obj = {};
    message.accountAuthenticator !== undefined && (obj.accountAuthenticator = message.accountAuthenticator ? AccountAuthenticator.toJSON(message.accountAuthenticator) : undefined);
    return obj;
  },
  fromPartial(object) {
    const message = createBaseGetAuthenticatorResponse();
    message.accountAuthenticator = object.accountAuthenticator !== undefined && object.accountAuthenticator !== null ? AccountAuthenticator.fromPartial(object.accountAuthenticator) : undefined;
    return message;
  }
};