"use strict";

var _typeof = require("@babel/runtime/helpers/typeof");
Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.MsgTripCircuitBreakerResponse = exports.MsgTripCircuitBreaker = exports.MsgResetCircuitBreakerResponse = exports.MsgResetCircuitBreaker = exports.MsgAuthorizeCircuitBreakerResponse = exports.MsgAuthorizeCircuitBreaker = void 0;
var _types = require("./types");
var _m0 = _interopRequireWildcard(require("protobufjs/minimal"));
var _helpers = require("../../../helpers");
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); }
function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; } //@ts-nocheck
/** MsgAuthorizeCircuitBreaker defines the Msg/AuthorizeCircuitBreaker request type. */

/** MsgAuthorizeCircuitBreaker defines the Msg/AuthorizeCircuitBreaker request type. */

/** MsgAuthorizeCircuitBreakerResponse defines the Msg/AuthorizeCircuitBreaker response type. */

/** MsgAuthorizeCircuitBreakerResponse defines the Msg/AuthorizeCircuitBreaker response type. */

/** MsgTripCircuitBreaker defines the Msg/TripCircuitBreaker request type. */

/** MsgTripCircuitBreaker defines the Msg/TripCircuitBreaker request type. */

/** MsgTripCircuitBreakerResponse defines the Msg/TripCircuitBreaker response type. */

/** MsgTripCircuitBreakerResponse defines the Msg/TripCircuitBreaker response type. */

/** MsgResetCircuitBreaker defines the Msg/ResetCircuitBreaker request type. */

/** MsgResetCircuitBreaker defines the Msg/ResetCircuitBreaker request type. */

/** MsgResetCircuitBreakerResponse defines the Msg/ResetCircuitBreaker response type. */

/** MsgResetCircuitBreakerResponse defines the Msg/ResetCircuitBreaker response type. */

function createBaseMsgAuthorizeCircuitBreaker() {
  return {
    granter: "",
    grantee: "",
    permissions: undefined
  };
}
var MsgAuthorizeCircuitBreaker = exports.MsgAuthorizeCircuitBreaker = {
  encode: function encode(message) {
    var writer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _m0.Writer.create();
    if (message.granter !== "") {
      writer.uint32(10).string(message.granter);
    }
    if (message.grantee !== "") {
      writer.uint32(18).string(message.grantee);
    }
    if (message.permissions !== undefined) {
      _types.Permissions.encode(message.permissions, writer.uint32(26).fork()).ldelim();
    }
    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 = createBaseMsgAuthorizeCircuitBreaker();
    while (reader.pos < end) {
      var tag = reader.uint32();
      switch (tag >>> 3) {
        case 1:
          message.granter = reader.string();
          break;
        case 2:
          message.grantee = reader.string();
          break;
        case 3:
          message.permissions = _types.Permissions.decode(reader, reader.uint32());
          break;
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromJSON: function fromJSON(object) {
    return {
      granter: (0, _helpers.isSet)(object.granter) ? String(object.granter) : "",
      grantee: (0, _helpers.isSet)(object.grantee) ? String(object.grantee) : "",
      permissions: (0, _helpers.isSet)(object.permissions) ? _types.Permissions.fromJSON(object.permissions) : undefined
    };
  },
  toJSON: function toJSON(message) {
    var obj = {};
    message.granter !== undefined && (obj.granter = message.granter);
    message.grantee !== undefined && (obj.grantee = message.grantee);
    message.permissions !== undefined && (obj.permissions = message.permissions ? _types.Permissions.toJSON(message.permissions) : undefined);
    return obj;
  },
  fromPartial: function fromPartial(object) {
    var _object$granter, _object$grantee;
    var message = createBaseMsgAuthorizeCircuitBreaker();
    message.granter = (_object$granter = object.granter) !== null && _object$granter !== void 0 ? _object$granter : "";
    message.grantee = (_object$grantee = object.grantee) !== null && _object$grantee !== void 0 ? _object$grantee : "";
    message.permissions = object.permissions !== undefined && object.permissions !== null ? _types.Permissions.fromPartial(object.permissions) : undefined;
    return message;
  }
};
function createBaseMsgAuthorizeCircuitBreakerResponse() {
  return {
    success: false
  };
}
var MsgAuthorizeCircuitBreakerResponse = exports.MsgAuthorizeCircuitBreakerResponse = {
  encode: function encode(message) {
    var writer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _m0.Writer.create();
    if (message.success === true) {
      writer.uint32(8).bool(message.success);
    }
    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 = createBaseMsgAuthorizeCircuitBreakerResponse();
    while (reader.pos < end) {
      var tag = reader.uint32();
      switch (tag >>> 3) {
        case 1:
          message.success = reader.bool();
          break;
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromJSON: function fromJSON(object) {
    return {
      success: (0, _helpers.isSet)(object.success) ? Boolean(object.success) : false
    };
  },
  toJSON: function toJSON(message) {
    var obj = {};
    message.success !== undefined && (obj.success = message.success);
    return obj;
  },
  fromPartial: function fromPartial(object) {
    var _object$success;
    var message = createBaseMsgAuthorizeCircuitBreakerResponse();
    message.success = (_object$success = object.success) !== null && _object$success !== void 0 ? _object$success : false;
    return message;
  }
};
function createBaseMsgTripCircuitBreaker() {
  return {
    authority: "",
    msgTypeUrls: []
  };
}
var MsgTripCircuitBreaker = exports.MsgTripCircuitBreaker = {
  encode: function encode(message) {
    var writer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _m0.Writer.create();
    if (message.authority !== "") {
      writer.uint32(10).string(message.authority);
    }
    var _iterator = _createForOfIteratorHelper(message.msgTypeUrls),
      _step;
    try {
      for (_iterator.s(); !(_step = _iterator.n()).done;) {
        var v = _step.value;
        writer.uint32(18).string(v);
      }
    } catch (err) {
      _iterator.e(err);
    } finally {
      _iterator.f();
    }
    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 = createBaseMsgTripCircuitBreaker();
    while (reader.pos < end) {
      var tag = reader.uint32();
      switch (tag >>> 3) {
        case 1:
          message.authority = reader.string();
          break;
        case 2:
          message.msgTypeUrls.push(reader.string());
          break;
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromJSON: function fromJSON(object) {
    return {
      authority: (0, _helpers.isSet)(object.authority) ? String(object.authority) : "",
      msgTypeUrls: Array.isArray(object === null || object === void 0 ? void 0 : object.msgTypeUrls) ? object.msgTypeUrls.map(function (e) {
        return String(e);
      }) : []
    };
  },
  toJSON: function toJSON(message) {
    var obj = {};
    message.authority !== undefined && (obj.authority = message.authority);
    if (message.msgTypeUrls) {
      obj.msgTypeUrls = message.msgTypeUrls.map(function (e) {
        return e;
      });
    } else {
      obj.msgTypeUrls = [];
    }
    return obj;
  },
  fromPartial: function fromPartial(object) {
    var _object$authority, _object$msgTypeUrls;
    var message = createBaseMsgTripCircuitBreaker();
    message.authority = (_object$authority = object.authority) !== null && _object$authority !== void 0 ? _object$authority : "";
    message.msgTypeUrls = ((_object$msgTypeUrls = object.msgTypeUrls) === null || _object$msgTypeUrls === void 0 ? void 0 : _object$msgTypeUrls.map(function (e) {
      return e;
    })) || [];
    return message;
  }
};
function createBaseMsgTripCircuitBreakerResponse() {
  return {
    success: false
  };
}
var MsgTripCircuitBreakerResponse = exports.MsgTripCircuitBreakerResponse = {
  encode: function encode(message) {
    var writer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _m0.Writer.create();
    if (message.success === true) {
      writer.uint32(8).bool(message.success);
    }
    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 = createBaseMsgTripCircuitBreakerResponse();
    while (reader.pos < end) {
      var tag = reader.uint32();
      switch (tag >>> 3) {
        case 1:
          message.success = reader.bool();
          break;
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromJSON: function fromJSON(object) {
    return {
      success: (0, _helpers.isSet)(object.success) ? Boolean(object.success) : false
    };
  },
  toJSON: function toJSON(message) {
    var obj = {};
    message.success !== undefined && (obj.success = message.success);
    return obj;
  },
  fromPartial: function fromPartial(object) {
    var _object$success2;
    var message = createBaseMsgTripCircuitBreakerResponse();
    message.success = (_object$success2 = object.success) !== null && _object$success2 !== void 0 ? _object$success2 : false;
    return message;
  }
};
function createBaseMsgResetCircuitBreaker() {
  return {
    authority: "",
    msgTypeUrls: []
  };
}
var MsgResetCircuitBreaker = exports.MsgResetCircuitBreaker = {
  encode: function encode(message) {
    var writer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _m0.Writer.create();
    if (message.authority !== "") {
      writer.uint32(10).string(message.authority);
    }
    var _iterator2 = _createForOfIteratorHelper(message.msgTypeUrls),
      _step2;
    try {
      for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
        var v = _step2.value;
        writer.uint32(26).string(v);
      }
    } catch (err) {
      _iterator2.e(err);
    } finally {
      _iterator2.f();
    }
    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 = createBaseMsgResetCircuitBreaker();
    while (reader.pos < end) {
      var tag = reader.uint32();
      switch (tag >>> 3) {
        case 1:
          message.authority = reader.string();
          break;
        case 3:
          message.msgTypeUrls.push(reader.string());
          break;
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromJSON: function fromJSON(object) {
    return {
      authority: (0, _helpers.isSet)(object.authority) ? String(object.authority) : "",
      msgTypeUrls: Array.isArray(object === null || object === void 0 ? void 0 : object.msgTypeUrls) ? object.msgTypeUrls.map(function (e) {
        return String(e);
      }) : []
    };
  },
  toJSON: function toJSON(message) {
    var obj = {};
    message.authority !== undefined && (obj.authority = message.authority);
    if (message.msgTypeUrls) {
      obj.msgTypeUrls = message.msgTypeUrls.map(function (e) {
        return e;
      });
    } else {
      obj.msgTypeUrls = [];
    }
    return obj;
  },
  fromPartial: function fromPartial(object) {
    var _object$authority2, _object$msgTypeUrls2;
    var message = createBaseMsgResetCircuitBreaker();
    message.authority = (_object$authority2 = object.authority) !== null && _object$authority2 !== void 0 ? _object$authority2 : "";
    message.msgTypeUrls = ((_object$msgTypeUrls2 = object.msgTypeUrls) === null || _object$msgTypeUrls2 === void 0 ? void 0 : _object$msgTypeUrls2.map(function (e) {
      return e;
    })) || [];
    return message;
  }
};
function createBaseMsgResetCircuitBreakerResponse() {
  return {
    success: false
  };
}
var MsgResetCircuitBreakerResponse = exports.MsgResetCircuitBreakerResponse = {
  encode: function encode(message) {
    var writer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _m0.Writer.create();
    if (message.success === true) {
      writer.uint32(8).bool(message.success);
    }
    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 = createBaseMsgResetCircuitBreakerResponse();
    while (reader.pos < end) {
      var tag = reader.uint32();
      switch (tag >>> 3) {
        case 1:
          message.success = reader.bool();
          break;
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromJSON: function fromJSON(object) {
    return {
      success: (0, _helpers.isSet)(object.success) ? Boolean(object.success) : false
    };
  },
  toJSON: function toJSON(message) {
    var obj = {};
    message.success !== undefined && (obj.success = message.success);
    return obj;
  },
  fromPartial: function fromPartial(object) {
    var _object$success3;
    var message = createBaseMsgResetCircuitBreakerResponse();
    message.success = (_object$success3 = object.success) !== null && _object$success3 !== void 0 ? _object$success3 : false;
    return message;
  }
};