"use strict";

var _typeof = require("@babel/runtime/helpers/typeof");
Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.PaymentWithdrawnEvent = exports.PaymentWithdrawCreatedEvent = exports.IntentUpdatedEvent = exports.IntentSubmittedEvent = exports.CollectionUpdatedEvent = exports.CollectionCreatedEvent = exports.ClaimUpdatedEvent = exports.ClaimSubmittedEvent = exports.ClaimEvaluatedEvent = exports.ClaimDisputedEvent = exports.ClaimAuthorizationCreatedEvent = void 0;
var _claims = require("./claims");
var _authz = require("./authz");
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
/** CollectionCreatedEvent is an event triggered on a Collection creation */

/** CollectionCreatedEvent is an event triggered on a Collection creation */

/** CollectionUpdatedEvent is an event triggered on a Collection update */

/** CollectionUpdatedEvent is an event triggered on a Collection update */

/** CollectionCreatedEvent is an event triggered on a Claim submission */

/** CollectionCreatedEvent is an event triggered on a Claim submission */

/** ClaimUpdatedEvent is an event triggered on a Claim update */

/** ClaimUpdatedEvent is an event triggered on a Claim update */

/** ClaimEvaluatedEvent is an event triggered on a Claim evaluation */

/** ClaimEvaluatedEvent is an event triggered on a Claim evaluation */

/** ClaimDisputedEvent is an event triggered on a Claim dispute */

/** ClaimDisputedEvent is an event triggered on a Claim dispute */

/** ClaimDisputedEvent is an event triggered on a Claim dispute */

/** ClaimDisputedEvent is an event triggered on a Claim dispute */

/** ClaimDisputedEvent is an event triggered on a Claim dispute */

/** ClaimDisputedEvent is an event triggered on a Claim dispute */

/** IntentSubmittedEvent is an event triggered on an Intent submission */

/** IntentSubmittedEvent is an event triggered on an Intent submission */

/** IntentUpdatedEvent is an event triggered on an Intent update */

/** IntentUpdatedEvent is an event triggered on an Intent update */

/**
 * ClaimAuthorizationCreatedEvent is an event triggered on a Claim authorization
 * creation
 */

/**
 * ClaimAuthorizationCreatedEvent is an event triggered on a Claim authorization
 * creation
 */

function createBaseCollectionCreatedEvent() {
  return {
    collection: undefined
  };
}
var CollectionCreatedEvent = exports.CollectionCreatedEvent = {
  encode: function encode(message) {
    var writer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _m0.Writer.create();
    if (message.collection !== undefined) {
      _claims.Collection.encode(message.collection, writer.uint32(10).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 = createBaseCollectionCreatedEvent();
    while (reader.pos < end) {
      var tag = reader.uint32();
      switch (tag >>> 3) {
        case 1:
          message.collection = _claims.Collection.decode(reader, reader.uint32());
          break;
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromJSON: function fromJSON(object) {
    return {
      collection: (0, _helpers.isSet)(object.collection) ? _claims.Collection.fromJSON(object.collection) : undefined
    };
  },
  toJSON: function toJSON(message) {
    var obj = {};
    message.collection !== undefined && (obj.collection = message.collection ? _claims.Collection.toJSON(message.collection) : undefined);
    return obj;
  },
  fromPartial: function fromPartial(object) {
    var message = createBaseCollectionCreatedEvent();
    message.collection = object.collection !== undefined && object.collection !== null ? _claims.Collection.fromPartial(object.collection) : undefined;
    return message;
  }
};
function createBaseCollectionUpdatedEvent() {
  return {
    collection: undefined
  };
}
var CollectionUpdatedEvent = exports.CollectionUpdatedEvent = {
  encode: function encode(message) {
    var writer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _m0.Writer.create();
    if (message.collection !== undefined) {
      _claims.Collection.encode(message.collection, writer.uint32(10).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 = createBaseCollectionUpdatedEvent();
    while (reader.pos < end) {
      var tag = reader.uint32();
      switch (tag >>> 3) {
        case 1:
          message.collection = _claims.Collection.decode(reader, reader.uint32());
          break;
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromJSON: function fromJSON(object) {
    return {
      collection: (0, _helpers.isSet)(object.collection) ? _claims.Collection.fromJSON(object.collection) : undefined
    };
  },
  toJSON: function toJSON(message) {
    var obj = {};
    message.collection !== undefined && (obj.collection = message.collection ? _claims.Collection.toJSON(message.collection) : undefined);
    return obj;
  },
  fromPartial: function fromPartial(object) {
    var message = createBaseCollectionUpdatedEvent();
    message.collection = object.collection !== undefined && object.collection !== null ? _claims.Collection.fromPartial(object.collection) : undefined;
    return message;
  }
};
function createBaseClaimSubmittedEvent() {
  return {
    claim: undefined
  };
}
var ClaimSubmittedEvent = exports.ClaimSubmittedEvent = {
  encode: function encode(message) {
    var writer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _m0.Writer.create();
    if (message.claim !== undefined) {
      _claims.Claim.encode(message.claim, writer.uint32(10).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 = createBaseClaimSubmittedEvent();
    while (reader.pos < end) {
      var tag = reader.uint32();
      switch (tag >>> 3) {
        case 1:
          message.claim = _claims.Claim.decode(reader, reader.uint32());
          break;
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromJSON: function fromJSON(object) {
    return {
      claim: (0, _helpers.isSet)(object.claim) ? _claims.Claim.fromJSON(object.claim) : undefined
    };
  },
  toJSON: function toJSON(message) {
    var obj = {};
    message.claim !== undefined && (obj.claim = message.claim ? _claims.Claim.toJSON(message.claim) : undefined);
    return obj;
  },
  fromPartial: function fromPartial(object) {
    var message = createBaseClaimSubmittedEvent();
    message.claim = object.claim !== undefined && object.claim !== null ? _claims.Claim.fromPartial(object.claim) : undefined;
    return message;
  }
};
function createBaseClaimUpdatedEvent() {
  return {
    claim: undefined
  };
}
var ClaimUpdatedEvent = exports.ClaimUpdatedEvent = {
  encode: function encode(message) {
    var writer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _m0.Writer.create();
    if (message.claim !== undefined) {
      _claims.Claim.encode(message.claim, writer.uint32(10).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 = createBaseClaimUpdatedEvent();
    while (reader.pos < end) {
      var tag = reader.uint32();
      switch (tag >>> 3) {
        case 1:
          message.claim = _claims.Claim.decode(reader, reader.uint32());
          break;
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromJSON: function fromJSON(object) {
    return {
      claim: (0, _helpers.isSet)(object.claim) ? _claims.Claim.fromJSON(object.claim) : undefined
    };
  },
  toJSON: function toJSON(message) {
    var obj = {};
    message.claim !== undefined && (obj.claim = message.claim ? _claims.Claim.toJSON(message.claim) : undefined);
    return obj;
  },
  fromPartial: function fromPartial(object) {
    var message = createBaseClaimUpdatedEvent();
    message.claim = object.claim !== undefined && object.claim !== null ? _claims.Claim.fromPartial(object.claim) : undefined;
    return message;
  }
};
function createBaseClaimEvaluatedEvent() {
  return {
    evaluation: undefined
  };
}
var ClaimEvaluatedEvent = exports.ClaimEvaluatedEvent = {
  encode: function encode(message) {
    var writer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _m0.Writer.create();
    if (message.evaluation !== undefined) {
      _claims.Evaluation.encode(message.evaluation, writer.uint32(10).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 = createBaseClaimEvaluatedEvent();
    while (reader.pos < end) {
      var tag = reader.uint32();
      switch (tag >>> 3) {
        case 1:
          message.evaluation = _claims.Evaluation.decode(reader, reader.uint32());
          break;
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromJSON: function fromJSON(object) {
    return {
      evaluation: (0, _helpers.isSet)(object.evaluation) ? _claims.Evaluation.fromJSON(object.evaluation) : undefined
    };
  },
  toJSON: function toJSON(message) {
    var obj = {};
    message.evaluation !== undefined && (obj.evaluation = message.evaluation ? _claims.Evaluation.toJSON(message.evaluation) : undefined);
    return obj;
  },
  fromPartial: function fromPartial(object) {
    var message = createBaseClaimEvaluatedEvent();
    message.evaluation = object.evaluation !== undefined && object.evaluation !== null ? _claims.Evaluation.fromPartial(object.evaluation) : undefined;
    return message;
  }
};
function createBaseClaimDisputedEvent() {
  return {
    dispute: undefined
  };
}
var ClaimDisputedEvent = exports.ClaimDisputedEvent = {
  encode: function encode(message) {
    var writer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _m0.Writer.create();
    if (message.dispute !== undefined) {
      _claims.Dispute.encode(message.dispute, writer.uint32(10).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 = createBaseClaimDisputedEvent();
    while (reader.pos < end) {
      var tag = reader.uint32();
      switch (tag >>> 3) {
        case 1:
          message.dispute = _claims.Dispute.decode(reader, reader.uint32());
          break;
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromJSON: function fromJSON(object) {
    return {
      dispute: (0, _helpers.isSet)(object.dispute) ? _claims.Dispute.fromJSON(object.dispute) : undefined
    };
  },
  toJSON: function toJSON(message) {
    var obj = {};
    message.dispute !== undefined && (obj.dispute = message.dispute ? _claims.Dispute.toJSON(message.dispute) : undefined);
    return obj;
  },
  fromPartial: function fromPartial(object) {
    var message = createBaseClaimDisputedEvent();
    message.dispute = object.dispute !== undefined && object.dispute !== null ? _claims.Dispute.fromPartial(object.dispute) : undefined;
    return message;
  }
};
function createBasePaymentWithdrawnEvent() {
  return {
    withdraw: undefined,
    cw20Outputs: [],
    cw1155Payments: []
  };
}
var PaymentWithdrawnEvent = exports.PaymentWithdrawnEvent = {
  encode: function encode(message) {
    var writer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _m0.Writer.create();
    if (message.withdraw !== undefined) {
      _authz.WithdrawPaymentConstraints.encode(message.withdraw, writer.uint32(10).fork()).ldelim();
    }
    var _iterator = _createForOfIteratorHelper(message.cw20Outputs),
      _step;
    try {
      for (_iterator.s(); !(_step = _iterator.n()).done;) {
        var v = _step.value;
        _claims.CW20Output.encode(v, writer.uint32(18).fork()).ldelim();
      }
    } catch (err) {
      _iterator.e(err);
    } finally {
      _iterator.f();
    }
    var _iterator2 = _createForOfIteratorHelper(message.cw1155Payments),
      _step2;
    try {
      for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
        var _v = _step2.value;
        _claims.CW1155IntentPayment.encode(_v, writer.uint32(26).fork()).ldelim();
      }
    } 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 = createBasePaymentWithdrawnEvent();
    while (reader.pos < end) {
      var tag = reader.uint32();
      switch (tag >>> 3) {
        case 1:
          message.withdraw = _authz.WithdrawPaymentConstraints.decode(reader, reader.uint32());
          break;
        case 2:
          message.cw20Outputs.push(_claims.CW20Output.decode(reader, reader.uint32()));
          break;
        case 3:
          message.cw1155Payments.push(_claims.CW1155IntentPayment.decode(reader, reader.uint32()));
          break;
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromJSON: function fromJSON(object) {
    return {
      withdraw: (0, _helpers.isSet)(object.withdraw) ? _authz.WithdrawPaymentConstraints.fromJSON(object.withdraw) : undefined,
      cw20Outputs: Array.isArray(object === null || object === void 0 ? void 0 : object.cw20Outputs) ? object.cw20Outputs.map(function (e) {
        return _claims.CW20Output.fromJSON(e);
      }) : [],
      cw1155Payments: Array.isArray(object === null || object === void 0 ? void 0 : object.cw1155Payments) ? object.cw1155Payments.map(function (e) {
        return _claims.CW1155IntentPayment.fromJSON(e);
      }) : []
    };
  },
  toJSON: function toJSON(message) {
    var obj = {};
    message.withdraw !== undefined && (obj.withdraw = message.withdraw ? _authz.WithdrawPaymentConstraints.toJSON(message.withdraw) : undefined);
    if (message.cw20Outputs) {
      obj.cw20Outputs = message.cw20Outputs.map(function (e) {
        return e ? _claims.CW20Output.toJSON(e) : undefined;
      });
    } else {
      obj.cw20Outputs = [];
    }
    if (message.cw1155Payments) {
      obj.cw1155Payments = message.cw1155Payments.map(function (e) {
        return e ? _claims.CW1155IntentPayment.toJSON(e) : undefined;
      });
    } else {
      obj.cw1155Payments = [];
    }
    return obj;
  },
  fromPartial: function fromPartial(object) {
    var _object$cw20Outputs, _object$cw1155Payment;
    var message = createBasePaymentWithdrawnEvent();
    message.withdraw = object.withdraw !== undefined && object.withdraw !== null ? _authz.WithdrawPaymentConstraints.fromPartial(object.withdraw) : undefined;
    message.cw20Outputs = ((_object$cw20Outputs = object.cw20Outputs) === null || _object$cw20Outputs === void 0 ? void 0 : _object$cw20Outputs.map(function (e) {
      return _claims.CW20Output.fromPartial(e);
    })) || [];
    message.cw1155Payments = ((_object$cw1155Payment = object.cw1155Payments) === null || _object$cw1155Payment === void 0 ? void 0 : _object$cw1155Payment.map(function (e) {
      return _claims.CW1155IntentPayment.fromPartial(e);
    })) || [];
    return message;
  }
};
function createBasePaymentWithdrawCreatedEvent() {
  return {
    withdraw: undefined
  };
}
var PaymentWithdrawCreatedEvent = exports.PaymentWithdrawCreatedEvent = {
  encode: function encode(message) {
    var writer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _m0.Writer.create();
    if (message.withdraw !== undefined) {
      _authz.WithdrawPaymentConstraints.encode(message.withdraw, writer.uint32(10).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 = createBasePaymentWithdrawCreatedEvent();
    while (reader.pos < end) {
      var tag = reader.uint32();
      switch (tag >>> 3) {
        case 1:
          message.withdraw = _authz.WithdrawPaymentConstraints.decode(reader, reader.uint32());
          break;
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromJSON: function fromJSON(object) {
    return {
      withdraw: (0, _helpers.isSet)(object.withdraw) ? _authz.WithdrawPaymentConstraints.fromJSON(object.withdraw) : undefined
    };
  },
  toJSON: function toJSON(message) {
    var obj = {};
    message.withdraw !== undefined && (obj.withdraw = message.withdraw ? _authz.WithdrawPaymentConstraints.toJSON(message.withdraw) : undefined);
    return obj;
  },
  fromPartial: function fromPartial(object) {
    var message = createBasePaymentWithdrawCreatedEvent();
    message.withdraw = object.withdraw !== undefined && object.withdraw !== null ? _authz.WithdrawPaymentConstraints.fromPartial(object.withdraw) : undefined;
    return message;
  }
};
function createBaseIntentSubmittedEvent() {
  return {
    intent: undefined
  };
}
var IntentSubmittedEvent = exports.IntentSubmittedEvent = {
  encode: function encode(message) {
    var writer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _m0.Writer.create();
    if (message.intent !== undefined) {
      _claims.Intent.encode(message.intent, writer.uint32(10).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 = createBaseIntentSubmittedEvent();
    while (reader.pos < end) {
      var tag = reader.uint32();
      switch (tag >>> 3) {
        case 1:
          message.intent = _claims.Intent.decode(reader, reader.uint32());
          break;
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromJSON: function fromJSON(object) {
    return {
      intent: (0, _helpers.isSet)(object.intent) ? _claims.Intent.fromJSON(object.intent) : undefined
    };
  },
  toJSON: function toJSON(message) {
    var obj = {};
    message.intent !== undefined && (obj.intent = message.intent ? _claims.Intent.toJSON(message.intent) : undefined);
    return obj;
  },
  fromPartial: function fromPartial(object) {
    var message = createBaseIntentSubmittedEvent();
    message.intent = object.intent !== undefined && object.intent !== null ? _claims.Intent.fromPartial(object.intent) : undefined;
    return message;
  }
};
function createBaseIntentUpdatedEvent() {
  return {
    intent: undefined
  };
}
var IntentUpdatedEvent = exports.IntentUpdatedEvent = {
  encode: function encode(message) {
    var writer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _m0.Writer.create();
    if (message.intent !== undefined) {
      _claims.Intent.encode(message.intent, writer.uint32(10).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 = createBaseIntentUpdatedEvent();
    while (reader.pos < end) {
      var tag = reader.uint32();
      switch (tag >>> 3) {
        case 1:
          message.intent = _claims.Intent.decode(reader, reader.uint32());
          break;
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromJSON: function fromJSON(object) {
    return {
      intent: (0, _helpers.isSet)(object.intent) ? _claims.Intent.fromJSON(object.intent) : undefined
    };
  },
  toJSON: function toJSON(message) {
    var obj = {};
    message.intent !== undefined && (obj.intent = message.intent ? _claims.Intent.toJSON(message.intent) : undefined);
    return obj;
  },
  fromPartial: function fromPartial(object) {
    var message = createBaseIntentUpdatedEvent();
    message.intent = object.intent !== undefined && object.intent !== null ? _claims.Intent.fromPartial(object.intent) : undefined;
    return message;
  }
};
function createBaseClaimAuthorizationCreatedEvent() {
  return {
    creator: "",
    creatorDid: "",
    grantee: "",
    admin: "",
    collectionId: "",
    authType: ""
  };
}
var ClaimAuthorizationCreatedEvent = exports.ClaimAuthorizationCreatedEvent = {
  encode: function encode(message) {
    var writer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _m0.Writer.create();
    if (message.creator !== "") {
      writer.uint32(10).string(message.creator);
    }
    if (message.creatorDid !== "") {
      writer.uint32(18).string(message.creatorDid);
    }
    if (message.grantee !== "") {
      writer.uint32(26).string(message.grantee);
    }
    if (message.admin !== "") {
      writer.uint32(34).string(message.admin);
    }
    if (message.collectionId !== "") {
      writer.uint32(42).string(message.collectionId);
    }
    if (message.authType !== "") {
      writer.uint32(50).string(message.authType);
    }
    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 = createBaseClaimAuthorizationCreatedEvent();
    while (reader.pos < end) {
      var tag = reader.uint32();
      switch (tag >>> 3) {
        case 1:
          message.creator = reader.string();
          break;
        case 2:
          message.creatorDid = reader.string();
          break;
        case 3:
          message.grantee = reader.string();
          break;
        case 4:
          message.admin = reader.string();
          break;
        case 5:
          message.collectionId = reader.string();
          break;
        case 6:
          message.authType = reader.string();
          break;
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromJSON: function fromJSON(object) {
    return {
      creator: (0, _helpers.isSet)(object.creator) ? String(object.creator) : "",
      creatorDid: (0, _helpers.isSet)(object.creatorDid) ? String(object.creatorDid) : "",
      grantee: (0, _helpers.isSet)(object.grantee) ? String(object.grantee) : "",
      admin: (0, _helpers.isSet)(object.admin) ? String(object.admin) : "",
      collectionId: (0, _helpers.isSet)(object.collectionId) ? String(object.collectionId) : "",
      authType: (0, _helpers.isSet)(object.authType) ? String(object.authType) : ""
    };
  },
  toJSON: function toJSON(message) {
    var obj = {};
    message.creator !== undefined && (obj.creator = message.creator);
    message.creatorDid !== undefined && (obj.creatorDid = message.creatorDid);
    message.grantee !== undefined && (obj.grantee = message.grantee);
    message.admin !== undefined && (obj.admin = message.admin);
    message.collectionId !== undefined && (obj.collectionId = message.collectionId);
    message.authType !== undefined && (obj.authType = message.authType);
    return obj;
  },
  fromPartial: function fromPartial(object) {
    var _object$creator, _object$creatorDid, _object$grantee, _object$admin, _object$collectionId, _object$authType;
    var message = createBaseClaimAuthorizationCreatedEvent();
    message.creator = (_object$creator = object.creator) !== null && _object$creator !== void 0 ? _object$creator : "";
    message.creatorDid = (_object$creatorDid = object.creatorDid) !== null && _object$creatorDid !== void 0 ? _object$creatorDid : "";
    message.grantee = (_object$grantee = object.grantee) !== null && _object$grantee !== void 0 ? _object$grantee : "";
    message.admin = (_object$admin = object.admin) !== null && _object$admin !== void 0 ? _object$admin : "";
    message.collectionId = (_object$collectionId = object.collectionId) !== null && _object$collectionId !== void 0 ? _object$collectionId : "";
    message.authType = (_object$authType = object.authType) !== null && _object$authType !== void 0 ? _object$authType : "";
    return message;
  }
};