//@ts-nocheck
import * as _m0 from "protobufjs/minimal";
import { isSet } from "../../../../helpers";
/** Module is the config object of the bank module. */

/** Module is the config object of the bank module. */

function createBaseModule() {
  return {
    blockedModuleAccountsOverride: [],
    authority: "",
    restrictionsOrder: []
  };
}
export const Module = {
  encode(message, writer = _m0.Writer.create()) {
    for (const v of message.blockedModuleAccountsOverride) {
      writer.uint32(10).string(v);
    }
    if (message.authority !== "") {
      writer.uint32(18).string(message.authority);
    }
    for (const v of message.restrictionsOrder) {
      writer.uint32(26).string(v);
    }
    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 = createBaseModule();
    while (reader.pos < end) {
      const tag = reader.uint32();
      switch (tag >>> 3) {
        case 1:
          message.blockedModuleAccountsOverride.push(reader.string());
          break;
        case 2:
          message.authority = reader.string();
          break;
        case 3:
          message.restrictionsOrder.push(reader.string());
          break;
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromJSON(object) {
    return {
      blockedModuleAccountsOverride: Array.isArray(object === null || object === void 0 ? void 0 : object.blockedModuleAccountsOverride) ? object.blockedModuleAccountsOverride.map(e => String(e)) : [],
      authority: isSet(object.authority) ? String(object.authority) : "",
      restrictionsOrder: Array.isArray(object === null || object === void 0 ? void 0 : object.restrictionsOrder) ? object.restrictionsOrder.map(e => String(e)) : []
    };
  },
  toJSON(message) {
    const obj = {};
    if (message.blockedModuleAccountsOverride) {
      obj.blockedModuleAccountsOverride = message.blockedModuleAccountsOverride.map(e => e);
    } else {
      obj.blockedModuleAccountsOverride = [];
    }
    message.authority !== undefined && (obj.authority = message.authority);
    if (message.restrictionsOrder) {
      obj.restrictionsOrder = message.restrictionsOrder.map(e => e);
    } else {
      obj.restrictionsOrder = [];
    }
    return obj;
  },
  fromPartial(object) {
    var _object$blockedModule, _object$authority, _object$restrictionsO;
    const message = createBaseModule();
    message.blockedModuleAccountsOverride = ((_object$blockedModule = object.blockedModuleAccountsOverride) === null || _object$blockedModule === void 0 ? void 0 : _object$blockedModule.map(e => e)) || [];
    message.authority = (_object$authority = object.authority) !== null && _object$authority !== void 0 ? _object$authority : "";
    message.restrictionsOrder = ((_object$restrictionsO = object.restrictionsOrder) === null || _object$restrictionsO === void 0 ? void 0 : _object$restrictionsO.map(e => e)) || [];
    return message;
  }
};