"use strict";

var _typeof = require("@babel/runtime/helpers/typeof");
Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.IidDocumentUpdatedEvent = exports.IidDocumentCreatedEvent = void 0;
var _iid = require("./iid");
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); }
//@ts-nocheck

/** IidDocumentCreatedEvent is triggered when a new IidDocument is created. */

/** IidDocumentCreatedEvent is triggered when a new IidDocument is created. */

/** DidDocumentUpdatedEvent is an event triggered on a DID document update */

/** DidDocumentUpdatedEvent is an event triggered on a DID document update */

function createBaseIidDocumentCreatedEvent() {
  return {
    iidDocument: undefined
  };
}
var IidDocumentCreatedEvent = exports.IidDocumentCreatedEvent = {
  encode: function encode(message) {
    var writer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _m0.Writer.create();
    if (message.iidDocument !== undefined) {
      _iid.IidDocument.encode(message.iidDocument, 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 = createBaseIidDocumentCreatedEvent();
    while (reader.pos < end) {
      var tag = reader.uint32();
      switch (tag >>> 3) {
        case 1:
          message.iidDocument = _iid.IidDocument.decode(reader, reader.uint32());
          break;
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromJSON: function fromJSON(object) {
    return {
      iidDocument: (0, _helpers.isSet)(object.iidDocument) ? _iid.IidDocument.fromJSON(object.iidDocument) : undefined
    };
  },
  toJSON: function toJSON(message) {
    var obj = {};
    message.iidDocument !== undefined && (obj.iidDocument = message.iidDocument ? _iid.IidDocument.toJSON(message.iidDocument) : undefined);
    return obj;
  },
  fromPartial: function fromPartial(object) {
    var message = createBaseIidDocumentCreatedEvent();
    message.iidDocument = object.iidDocument !== undefined && object.iidDocument !== null ? _iid.IidDocument.fromPartial(object.iidDocument) : undefined;
    return message;
  }
};
function createBaseIidDocumentUpdatedEvent() {
  return {
    iidDocument: undefined
  };
}
var IidDocumentUpdatedEvent = exports.IidDocumentUpdatedEvent = {
  encode: function encode(message) {
    var writer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _m0.Writer.create();
    if (message.iidDocument !== undefined) {
      _iid.IidDocument.encode(message.iidDocument, 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 = createBaseIidDocumentUpdatedEvent();
    while (reader.pos < end) {
      var tag = reader.uint32();
      switch (tag >>> 3) {
        case 1:
          message.iidDocument = _iid.IidDocument.decode(reader, reader.uint32());
          break;
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromJSON: function fromJSON(object) {
    return {
      iidDocument: (0, _helpers.isSet)(object.iidDocument) ? _iid.IidDocument.fromJSON(object.iidDocument) : undefined
    };
  },
  toJSON: function toJSON(message) {
    var obj = {};
    message.iidDocument !== undefined && (obj.iidDocument = message.iidDocument ? _iid.IidDocument.toJSON(message.iidDocument) : undefined);
    return obj;
  },
  fromPartial: function fromPartial(object) {
    var message = createBaseIidDocumentUpdatedEvent();
    message.iidDocument = object.iidDocument !== undefined && object.iidDocument !== null ? _iid.IidDocument.fromPartial(object.iidDocument) : undefined;
    return message;
  }
};