//@ts-nocheck
import { IidDocument } from "./iid";
import * as _m0 from "protobufjs/minimal";
import { isSet } from "../../../helpers";
/** 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
  };
}
export const IidDocumentCreatedEvent = {
  encode(message, writer = _m0.Writer.create()) {
    if (message.iidDocument !== undefined) {
      IidDocument.encode(message.iidDocument, writer.uint32(10).fork()).ldelim();
    }
    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 = createBaseIidDocumentCreatedEvent();
    while (reader.pos < end) {
      const tag = reader.uint32();
      switch (tag >>> 3) {
        case 1:
          message.iidDocument = IidDocument.decode(reader, reader.uint32());
          break;
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromJSON(object) {
    return {
      iidDocument: isSet(object.iidDocument) ? IidDocument.fromJSON(object.iidDocument) : undefined
    };
  },
  toJSON(message) {
    const obj = {};
    message.iidDocument !== undefined && (obj.iidDocument = message.iidDocument ? IidDocument.toJSON(message.iidDocument) : undefined);
    return obj;
  },
  fromPartial(object) {
    const message = createBaseIidDocumentCreatedEvent();
    message.iidDocument = object.iidDocument !== undefined && object.iidDocument !== null ? IidDocument.fromPartial(object.iidDocument) : undefined;
    return message;
  }
};
function createBaseIidDocumentUpdatedEvent() {
  return {
    iidDocument: undefined
  };
}
export const IidDocumentUpdatedEvent = {
  encode(message, writer = _m0.Writer.create()) {
    if (message.iidDocument !== undefined) {
      IidDocument.encode(message.iidDocument, writer.uint32(10).fork()).ldelim();
    }
    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 = createBaseIidDocumentUpdatedEvent();
    while (reader.pos < end) {
      const tag = reader.uint32();
      switch (tag >>> 3) {
        case 1:
          message.iidDocument = IidDocument.decode(reader, reader.uint32());
          break;
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromJSON(object) {
    return {
      iidDocument: isSet(object.iidDocument) ? IidDocument.fromJSON(object.iidDocument) : undefined
    };
  },
  toJSON(message) {
    const obj = {};
    message.iidDocument !== undefined && (obj.iidDocument = message.iidDocument ? IidDocument.toJSON(message.iidDocument) : undefined);
    return obj;
  },
  fromPartial(object) {
    const message = createBaseIidDocumentUpdatedEvent();
    message.iidDocument = object.iidDocument !== undefined && object.iidDocument !== null ? IidDocument.fromPartial(object.iidDocument) : undefined;
    return message;
  }
};