"use strict";

var _typeof = require("@babel/runtime/helpers/typeof");
Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.Module = void 0;
var _duration = require("../../../../google/protobuf/duration");
var _helpers = require("../../../../helpers");
var _m0 = _interopRequireWildcard(require("protobufjs/minimal"));
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, "default": e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
//@ts-nocheck

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

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

function createBaseModule() {
  return {
    maxExecutionPeriod: undefined,
    maxMetadataLen: _helpers.Long.UZERO
  };
}
var Module = exports.Module = {
  encode: function encode(message) {
    var writer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _m0.Writer.create();
    if (message.maxExecutionPeriod !== undefined) {
      _duration.Duration.encode(message.maxExecutionPeriod, writer.uint32(10).fork()).ldelim();
    }
    if (!message.maxMetadataLen.isZero()) {
      writer.uint32(16).uint64(message.maxMetadataLen);
    }
    return writer;
  },
  decode: function decode(input, length) {
    var reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
    var end = length === undefined ? reader.len : reader.pos + length;
    var message = createBaseModule();
    while (reader.pos < end) {
      var tag = reader.uint32();
      switch (tag >>> 3) {
        case 1:
          message.maxExecutionPeriod = _duration.Duration.decode(reader, reader.uint32());
          break;
        case 2:
          message.maxMetadataLen = reader.uint64();
          break;
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromJSON: function fromJSON(object) {
    return {
      maxExecutionPeriod: (0, _helpers.isSet)(object.maxExecutionPeriod) ? _duration.Duration.fromJSON(object.maxExecutionPeriod) : undefined,
      maxMetadataLen: (0, _helpers.isSet)(object.maxMetadataLen) ? _helpers.Long.fromValue(object.maxMetadataLen) : _helpers.Long.UZERO
    };
  },
  toJSON: function toJSON(message) {
    var obj = {};
    message.maxExecutionPeriod !== undefined && (obj.maxExecutionPeriod = message.maxExecutionPeriod ? _duration.Duration.toJSON(message.maxExecutionPeriod) : undefined);
    message.maxMetadataLen !== undefined && (obj.maxMetadataLen = (message.maxMetadataLen || _helpers.Long.UZERO).toString());
    return obj;
  },
  fromPartial: function fromPartial(object) {
    var message = createBaseModule();
    message.maxExecutionPeriod = object.maxExecutionPeriod !== undefined && object.maxExecutionPeriod !== null ? _duration.Duration.fromPartial(object.maxExecutionPeriod) : undefined;
    message.maxMetadataLen = object.maxMetadataLen !== undefined && object.maxMetadataLen !== null ? _helpers.Long.fromValue(object.maxMetadataLen) : _helpers.Long.UZERO;
    return message;
  }
};