"use strict";

var _typeof = require("@babel/runtime/helpers/typeof");
Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.Verification = exports.MsgUpdateIidDocumentResponse = exports.MsgUpdateIidDocument = exports.MsgSetVerificationRelationshipsResponse = exports.MsgSetVerificationRelationships = exports.MsgRevokeVerificationResponse = exports.MsgRevokeVerification = exports.MsgDeleteServiceResponse = exports.MsgDeleteService = exports.MsgDeleteLinkedResourceResponse = exports.MsgDeleteLinkedResource = exports.MsgDeleteLinkedEntityResponse = exports.MsgDeleteLinkedEntity = exports.MsgDeleteLinkedClaimResponse = exports.MsgDeleteLinkedClaim = exports.MsgDeleteIidContextResponse = exports.MsgDeleteIidContext = exports.MsgDeleteControllerResponse = exports.MsgDeleteController = exports.MsgDeleteAccordedRightResponse = exports.MsgDeleteAccordedRight = exports.MsgDeactivateIIDResponse = exports.MsgDeactivateIID = exports.MsgCreateIidDocumentResponse = exports.MsgCreateIidDocument = exports.MsgAddVerificationResponse = exports.MsgAddVerification = exports.MsgAddServiceResponse = exports.MsgAddService = exports.MsgAddLinkedResourceResponse = exports.MsgAddLinkedResource = exports.MsgAddLinkedEntityResponse = exports.MsgAddLinkedEntity = exports.MsgAddLinkedClaimResponse = exports.MsgAddLinkedClaim = exports.MsgAddIidContextResponse = exports.MsgAddIidContext = exports.MsgAddControllerResponse = exports.MsgAddController = exports.MsgAddAccordedRightResponse = exports.MsgAddAccordedRight = 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
/**
 * Verification is a message that allows to assign a verification method
 * to one or more verification relationships
 */

/**
 * Verification is a message that allows to assign a verification method
 * to one or more verification relationships
 */

/** MsgCreateDidDocument defines a SDK message for creating a new did. */

/** MsgCreateDidDocument defines a SDK message for creating a new did. */

/**
 * Updates the entity with all the fields, so if field empty will be updated
 * with default go type, aka never null
 */

/**
 * Updates the entity with all the fields, so if field empty will be updated
 * with default go type, aka never null
 */

function createBaseVerification() {
  return {
    relationships: [],
    method: undefined,
    context: []
  };
}
var Verification = exports.Verification = {
  encode: function encode(message) {
    var writer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _m0.Writer.create();
    var _iterator = _createForOfIteratorHelper(message.relationships),
      _step;
    try {
      for (_iterator.s(); !(_step = _iterator.n()).done;) {
        var v = _step.value;
        writer.uint32(10).string(v);
      }
    } catch (err) {
      _iterator.e(err);
    } finally {
      _iterator.f();
    }
    if (message.method !== undefined) {
      _types.VerificationMethod.encode(message.method, writer.uint32(18).fork()).ldelim();
    }
    var _iterator2 = _createForOfIteratorHelper(message.context),
      _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 = createBaseVerification();
    while (reader.pos < end) {
      var tag = reader.uint32();
      switch (tag >>> 3) {
        case 1:
          message.relationships.push(reader.string());
          break;
        case 2:
          message.method = _types.VerificationMethod.decode(reader, reader.uint32());
          break;
        case 3:
          message.context.push(reader.string());
          break;
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromJSON: function fromJSON(object) {
    return {
      relationships: Array.isArray(object === null || object === void 0 ? void 0 : object.relationships) ? object.relationships.map(function (e) {
        return String(e);
      }) : [],
      method: (0, _helpers.isSet)(object.method) ? _types.VerificationMethod.fromJSON(object.method) : undefined,
      context: Array.isArray(object === null || object === void 0 ? void 0 : object.context) ? object.context.map(function (e) {
        return String(e);
      }) : []
    };
  },
  toJSON: function toJSON(message) {
    var obj = {};
    if (message.relationships) {
      obj.relationships = message.relationships.map(function (e) {
        return e;
      });
    } else {
      obj.relationships = [];
    }
    message.method !== undefined && (obj.method = message.method ? _types.VerificationMethod.toJSON(message.method) : undefined);
    if (message.context) {
      obj.context = message.context.map(function (e) {
        return e;
      });
    } else {
      obj.context = [];
    }
    return obj;
  },
  fromPartial: function fromPartial(object) {
    var _object$relationships, _object$context;
    var message = createBaseVerification();
    message.relationships = ((_object$relationships = object.relationships) === null || _object$relationships === void 0 ? void 0 : _object$relationships.map(function (e) {
      return e;
    })) || [];
    message.method = object.method !== undefined && object.method !== null ? _types.VerificationMethod.fromPartial(object.method) : undefined;
    message.context = ((_object$context = object.context) === null || _object$context === void 0 ? void 0 : _object$context.map(function (e) {
      return e;
    })) || [];
    return message;
  }
};
function createBaseMsgCreateIidDocument() {
  return {
    id: "",
    controllers: [],
    context: [],
    verifications: [],
    services: [],
    accordedRight: [],
    linkedResource: [],
    linkedEntity: [],
    alsoKnownAs: "",
    signer: "",
    linkedClaim: []
  };
}
var MsgCreateIidDocument = exports.MsgCreateIidDocument = {
  encode: function encode(message) {
    var writer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _m0.Writer.create();
    if (message.id !== "") {
      writer.uint32(10).string(message.id);
    }
    var _iterator3 = _createForOfIteratorHelper(message.controllers),
      _step3;
    try {
      for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
        var v = _step3.value;
        writer.uint32(18).string(v);
      }
    } catch (err) {
      _iterator3.e(err);
    } finally {
      _iterator3.f();
    }
    var _iterator4 = _createForOfIteratorHelper(message.context),
      _step4;
    try {
      for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
        var _v2 = _step4.value;
        _types.Context.encode(_v2, writer.uint32(26).fork()).ldelim();
      }
    } catch (err) {
      _iterator4.e(err);
    } finally {
      _iterator4.f();
    }
    var _iterator5 = _createForOfIteratorHelper(message.verifications),
      _step5;
    try {
      for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {
        var _v3 = _step5.value;
        Verification.encode(_v3, writer.uint32(34).fork()).ldelim();
      }
    } catch (err) {
      _iterator5.e(err);
    } finally {
      _iterator5.f();
    }
    var _iterator6 = _createForOfIteratorHelper(message.services),
      _step6;
    try {
      for (_iterator6.s(); !(_step6 = _iterator6.n()).done;) {
        var _v4 = _step6.value;
        _types.Service.encode(_v4, writer.uint32(42).fork()).ldelim();
      }
    } catch (err) {
      _iterator6.e(err);
    } finally {
      _iterator6.f();
    }
    var _iterator7 = _createForOfIteratorHelper(message.accordedRight),
      _step7;
    try {
      for (_iterator7.s(); !(_step7 = _iterator7.n()).done;) {
        var _v5 = _step7.value;
        _types.AccordedRight.encode(_v5, writer.uint32(50).fork()).ldelim();
      }
    } catch (err) {
      _iterator7.e(err);
    } finally {
      _iterator7.f();
    }
    var _iterator8 = _createForOfIteratorHelper(message.linkedResource),
      _step8;
    try {
      for (_iterator8.s(); !(_step8 = _iterator8.n()).done;) {
        var _v6 = _step8.value;
        _types.LinkedResource.encode(_v6, writer.uint32(58).fork()).ldelim();
      }
    } catch (err) {
      _iterator8.e(err);
    } finally {
      _iterator8.f();
    }
    var _iterator9 = _createForOfIteratorHelper(message.linkedEntity),
      _step9;
    try {
      for (_iterator9.s(); !(_step9 = _iterator9.n()).done;) {
        var _v7 = _step9.value;
        _types.LinkedEntity.encode(_v7, writer.uint32(66).fork()).ldelim();
      }
    } catch (err) {
      _iterator9.e(err);
    } finally {
      _iterator9.f();
    }
    if (message.alsoKnownAs !== "") {
      writer.uint32(74).string(message.alsoKnownAs);
    }
    if (message.signer !== "") {
      writer.uint32(82).string(message.signer);
    }
    var _iterator0 = _createForOfIteratorHelper(message.linkedClaim),
      _step0;
    try {
      for (_iterator0.s(); !(_step0 = _iterator0.n()).done;) {
        var _v8 = _step0.value;
        _types.LinkedClaim.encode(_v8, writer.uint32(90).fork()).ldelim();
      }
    } catch (err) {
      _iterator0.e(err);
    } finally {
      _iterator0.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 = createBaseMsgCreateIidDocument();
    while (reader.pos < end) {
      var tag = reader.uint32();
      switch (tag >>> 3) {
        case 1:
          message.id = reader.string();
          break;
        case 2:
          message.controllers.push(reader.string());
          break;
        case 3:
          message.context.push(_types.Context.decode(reader, reader.uint32()));
          break;
        case 4:
          message.verifications.push(Verification.decode(reader, reader.uint32()));
          break;
        case 5:
          message.services.push(_types.Service.decode(reader, reader.uint32()));
          break;
        case 6:
          message.accordedRight.push(_types.AccordedRight.decode(reader, reader.uint32()));
          break;
        case 7:
          message.linkedResource.push(_types.LinkedResource.decode(reader, reader.uint32()));
          break;
        case 8:
          message.linkedEntity.push(_types.LinkedEntity.decode(reader, reader.uint32()));
          break;
        case 9:
          message.alsoKnownAs = reader.string();
          break;
        case 10:
          message.signer = reader.string();
          break;
        case 11:
          message.linkedClaim.push(_types.LinkedClaim.decode(reader, reader.uint32()));
          break;
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromJSON: function fromJSON(object) {
    return {
      id: (0, _helpers.isSet)(object.id) ? String(object.id) : "",
      controllers: Array.isArray(object === null || object === void 0 ? void 0 : object.controllers) ? object.controllers.map(function (e) {
        return String(e);
      }) : [],
      context: Array.isArray(object === null || object === void 0 ? void 0 : object.context) ? object.context.map(function (e) {
        return _types.Context.fromJSON(e);
      }) : [],
      verifications: Array.isArray(object === null || object === void 0 ? void 0 : object.verifications) ? object.verifications.map(function (e) {
        return Verification.fromJSON(e);
      }) : [],
      services: Array.isArray(object === null || object === void 0 ? void 0 : object.services) ? object.services.map(function (e) {
        return _types.Service.fromJSON(e);
      }) : [],
      accordedRight: Array.isArray(object === null || object === void 0 ? void 0 : object.accordedRight) ? object.accordedRight.map(function (e) {
        return _types.AccordedRight.fromJSON(e);
      }) : [],
      linkedResource: Array.isArray(object === null || object === void 0 ? void 0 : object.linkedResource) ? object.linkedResource.map(function (e) {
        return _types.LinkedResource.fromJSON(e);
      }) : [],
      linkedEntity: Array.isArray(object === null || object === void 0 ? void 0 : object.linkedEntity) ? object.linkedEntity.map(function (e) {
        return _types.LinkedEntity.fromJSON(e);
      }) : [],
      alsoKnownAs: (0, _helpers.isSet)(object.alsoKnownAs) ? String(object.alsoKnownAs) : "",
      signer: (0, _helpers.isSet)(object.signer) ? String(object.signer) : "",
      linkedClaim: Array.isArray(object === null || object === void 0 ? void 0 : object.linkedClaim) ? object.linkedClaim.map(function (e) {
        return _types.LinkedClaim.fromJSON(e);
      }) : []
    };
  },
  toJSON: function toJSON(message) {
    var obj = {};
    message.id !== undefined && (obj.id = message.id);
    if (message.controllers) {
      obj.controllers = message.controllers.map(function (e) {
        return e;
      });
    } else {
      obj.controllers = [];
    }
    if (message.context) {
      obj.context = message.context.map(function (e) {
        return e ? _types.Context.toJSON(e) : undefined;
      });
    } else {
      obj.context = [];
    }
    if (message.verifications) {
      obj.verifications = message.verifications.map(function (e) {
        return e ? Verification.toJSON(e) : undefined;
      });
    } else {
      obj.verifications = [];
    }
    if (message.services) {
      obj.services = message.services.map(function (e) {
        return e ? _types.Service.toJSON(e) : undefined;
      });
    } else {
      obj.services = [];
    }
    if (message.accordedRight) {
      obj.accordedRight = message.accordedRight.map(function (e) {
        return e ? _types.AccordedRight.toJSON(e) : undefined;
      });
    } else {
      obj.accordedRight = [];
    }
    if (message.linkedResource) {
      obj.linkedResource = message.linkedResource.map(function (e) {
        return e ? _types.LinkedResource.toJSON(e) : undefined;
      });
    } else {
      obj.linkedResource = [];
    }
    if (message.linkedEntity) {
      obj.linkedEntity = message.linkedEntity.map(function (e) {
        return e ? _types.LinkedEntity.toJSON(e) : undefined;
      });
    } else {
      obj.linkedEntity = [];
    }
    message.alsoKnownAs !== undefined && (obj.alsoKnownAs = message.alsoKnownAs);
    message.signer !== undefined && (obj.signer = message.signer);
    if (message.linkedClaim) {
      obj.linkedClaim = message.linkedClaim.map(function (e) {
        return e ? _types.LinkedClaim.toJSON(e) : undefined;
      });
    } else {
      obj.linkedClaim = [];
    }
    return obj;
  },
  fromPartial: function fromPartial(object) {
    var _object$id, _object$controllers, _object$context2, _object$verifications, _object$services, _object$accordedRight, _object$linkedResourc, _object$linkedEntity, _object$alsoKnownAs, _object$signer, _object$linkedClaim;
    var message = createBaseMsgCreateIidDocument();
    message.id = (_object$id = object.id) !== null && _object$id !== void 0 ? _object$id : "";
    message.controllers = ((_object$controllers = object.controllers) === null || _object$controllers === void 0 ? void 0 : _object$controllers.map(function (e) {
      return e;
    })) || [];
    message.context = ((_object$context2 = object.context) === null || _object$context2 === void 0 ? void 0 : _object$context2.map(function (e) {
      return _types.Context.fromPartial(e);
    })) || [];
    message.verifications = ((_object$verifications = object.verifications) === null || _object$verifications === void 0 ? void 0 : _object$verifications.map(function (e) {
      return Verification.fromPartial(e);
    })) || [];
    message.services = ((_object$services = object.services) === null || _object$services === void 0 ? void 0 : _object$services.map(function (e) {
      return _types.Service.fromPartial(e);
    })) || [];
    message.accordedRight = ((_object$accordedRight = object.accordedRight) === null || _object$accordedRight === void 0 ? void 0 : _object$accordedRight.map(function (e) {
      return _types.AccordedRight.fromPartial(e);
    })) || [];
    message.linkedResource = ((_object$linkedResourc = object.linkedResource) === null || _object$linkedResourc === void 0 ? void 0 : _object$linkedResourc.map(function (e) {
      return _types.LinkedResource.fromPartial(e);
    })) || [];
    message.linkedEntity = ((_object$linkedEntity = object.linkedEntity) === null || _object$linkedEntity === void 0 ? void 0 : _object$linkedEntity.map(function (e) {
      return _types.LinkedEntity.fromPartial(e);
    })) || [];
    message.alsoKnownAs = (_object$alsoKnownAs = object.alsoKnownAs) !== null && _object$alsoKnownAs !== void 0 ? _object$alsoKnownAs : "";
    message.signer = (_object$signer = object.signer) !== null && _object$signer !== void 0 ? _object$signer : "";
    message.linkedClaim = ((_object$linkedClaim = object.linkedClaim) === null || _object$linkedClaim === void 0 ? void 0 : _object$linkedClaim.map(function (e) {
      return _types.LinkedClaim.fromPartial(e);
    })) || [];
    return message;
  }
};
function createBaseMsgCreateIidDocumentResponse() {
  return {};
}
var MsgCreateIidDocumentResponse = exports.MsgCreateIidDocumentResponse = {
  encode: function encode(_) {
    var writer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _m0.Writer.create();
    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 = createBaseMsgCreateIidDocumentResponse();
    while (reader.pos < end) {
      var tag = reader.uint32();
      switch (tag >>> 3) {
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromJSON: function fromJSON(_) {
    return {};
  },
  toJSON: function toJSON(_) {
    var obj = {};
    return obj;
  },
  fromPartial: function fromPartial(_) {
    var message = createBaseMsgCreateIidDocumentResponse();
    return message;
  }
};
function createBaseMsgUpdateIidDocument() {
  return {
    id: "",
    controllers: [],
    context: [],
    verifications: [],
    services: [],
    accordedRight: [],
    linkedResource: [],
    linkedEntity: [],
    alsoKnownAs: "",
    signer: "",
    linkedClaim: []
  };
}
var MsgUpdateIidDocument = exports.MsgUpdateIidDocument = {
  encode: function encode(message) {
    var writer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _m0.Writer.create();
    if (message.id !== "") {
      writer.uint32(10).string(message.id);
    }
    var _iterator1 = _createForOfIteratorHelper(message.controllers),
      _step1;
    try {
      for (_iterator1.s(); !(_step1 = _iterator1.n()).done;) {
        var v = _step1.value;
        writer.uint32(18).string(v);
      }
    } catch (err) {
      _iterator1.e(err);
    } finally {
      _iterator1.f();
    }
    var _iterator10 = _createForOfIteratorHelper(message.context),
      _step10;
    try {
      for (_iterator10.s(); !(_step10 = _iterator10.n()).done;) {
        var _v9 = _step10.value;
        _types.Context.encode(_v9, writer.uint32(26).fork()).ldelim();
      }
    } catch (err) {
      _iterator10.e(err);
    } finally {
      _iterator10.f();
    }
    var _iterator11 = _createForOfIteratorHelper(message.verifications),
      _step11;
    try {
      for (_iterator11.s(); !(_step11 = _iterator11.n()).done;) {
        var _v0 = _step11.value;
        Verification.encode(_v0, writer.uint32(34).fork()).ldelim();
      }
    } catch (err) {
      _iterator11.e(err);
    } finally {
      _iterator11.f();
    }
    var _iterator12 = _createForOfIteratorHelper(message.services),
      _step12;
    try {
      for (_iterator12.s(); !(_step12 = _iterator12.n()).done;) {
        var _v1 = _step12.value;
        _types.Service.encode(_v1, writer.uint32(42).fork()).ldelim();
      }
    } catch (err) {
      _iterator12.e(err);
    } finally {
      _iterator12.f();
    }
    var _iterator13 = _createForOfIteratorHelper(message.accordedRight),
      _step13;
    try {
      for (_iterator13.s(); !(_step13 = _iterator13.n()).done;) {
        var _v10 = _step13.value;
        _types.AccordedRight.encode(_v10, writer.uint32(50).fork()).ldelim();
      }
    } catch (err) {
      _iterator13.e(err);
    } finally {
      _iterator13.f();
    }
    var _iterator14 = _createForOfIteratorHelper(message.linkedResource),
      _step14;
    try {
      for (_iterator14.s(); !(_step14 = _iterator14.n()).done;) {
        var _v11 = _step14.value;
        _types.LinkedResource.encode(_v11, writer.uint32(58).fork()).ldelim();
      }
    } catch (err) {
      _iterator14.e(err);
    } finally {
      _iterator14.f();
    }
    var _iterator15 = _createForOfIteratorHelper(message.linkedEntity),
      _step15;
    try {
      for (_iterator15.s(); !(_step15 = _iterator15.n()).done;) {
        var _v12 = _step15.value;
        _types.LinkedEntity.encode(_v12, writer.uint32(66).fork()).ldelim();
      }
    } catch (err) {
      _iterator15.e(err);
    } finally {
      _iterator15.f();
    }
    if (message.alsoKnownAs !== "") {
      writer.uint32(74).string(message.alsoKnownAs);
    }
    if (message.signer !== "") {
      writer.uint32(82).string(message.signer);
    }
    var _iterator16 = _createForOfIteratorHelper(message.linkedClaim),
      _step16;
    try {
      for (_iterator16.s(); !(_step16 = _iterator16.n()).done;) {
        var _v13 = _step16.value;
        _types.LinkedClaim.encode(_v13, writer.uint32(90).fork()).ldelim();
      }
    } catch (err) {
      _iterator16.e(err);
    } finally {
      _iterator16.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 = createBaseMsgUpdateIidDocument();
    while (reader.pos < end) {
      var tag = reader.uint32();
      switch (tag >>> 3) {
        case 1:
          message.id = reader.string();
          break;
        case 2:
          message.controllers.push(reader.string());
          break;
        case 3:
          message.context.push(_types.Context.decode(reader, reader.uint32()));
          break;
        case 4:
          message.verifications.push(Verification.decode(reader, reader.uint32()));
          break;
        case 5:
          message.services.push(_types.Service.decode(reader, reader.uint32()));
          break;
        case 6:
          message.accordedRight.push(_types.AccordedRight.decode(reader, reader.uint32()));
          break;
        case 7:
          message.linkedResource.push(_types.LinkedResource.decode(reader, reader.uint32()));
          break;
        case 8:
          message.linkedEntity.push(_types.LinkedEntity.decode(reader, reader.uint32()));
          break;
        case 9:
          message.alsoKnownAs = reader.string();
          break;
        case 10:
          message.signer = reader.string();
          break;
        case 11:
          message.linkedClaim.push(_types.LinkedClaim.decode(reader, reader.uint32()));
          break;
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromJSON: function fromJSON(object) {
    return {
      id: (0, _helpers.isSet)(object.id) ? String(object.id) : "",
      controllers: Array.isArray(object === null || object === void 0 ? void 0 : object.controllers) ? object.controllers.map(function (e) {
        return String(e);
      }) : [],
      context: Array.isArray(object === null || object === void 0 ? void 0 : object.context) ? object.context.map(function (e) {
        return _types.Context.fromJSON(e);
      }) : [],
      verifications: Array.isArray(object === null || object === void 0 ? void 0 : object.verifications) ? object.verifications.map(function (e) {
        return Verification.fromJSON(e);
      }) : [],
      services: Array.isArray(object === null || object === void 0 ? void 0 : object.services) ? object.services.map(function (e) {
        return _types.Service.fromJSON(e);
      }) : [],
      accordedRight: Array.isArray(object === null || object === void 0 ? void 0 : object.accordedRight) ? object.accordedRight.map(function (e) {
        return _types.AccordedRight.fromJSON(e);
      }) : [],
      linkedResource: Array.isArray(object === null || object === void 0 ? void 0 : object.linkedResource) ? object.linkedResource.map(function (e) {
        return _types.LinkedResource.fromJSON(e);
      }) : [],
      linkedEntity: Array.isArray(object === null || object === void 0 ? void 0 : object.linkedEntity) ? object.linkedEntity.map(function (e) {
        return _types.LinkedEntity.fromJSON(e);
      }) : [],
      alsoKnownAs: (0, _helpers.isSet)(object.alsoKnownAs) ? String(object.alsoKnownAs) : "",
      signer: (0, _helpers.isSet)(object.signer) ? String(object.signer) : "",
      linkedClaim: Array.isArray(object === null || object === void 0 ? void 0 : object.linkedClaim) ? object.linkedClaim.map(function (e) {
        return _types.LinkedClaim.fromJSON(e);
      }) : []
    };
  },
  toJSON: function toJSON(message) {
    var obj = {};
    message.id !== undefined && (obj.id = message.id);
    if (message.controllers) {
      obj.controllers = message.controllers.map(function (e) {
        return e;
      });
    } else {
      obj.controllers = [];
    }
    if (message.context) {
      obj.context = message.context.map(function (e) {
        return e ? _types.Context.toJSON(e) : undefined;
      });
    } else {
      obj.context = [];
    }
    if (message.verifications) {
      obj.verifications = message.verifications.map(function (e) {
        return e ? Verification.toJSON(e) : undefined;
      });
    } else {
      obj.verifications = [];
    }
    if (message.services) {
      obj.services = message.services.map(function (e) {
        return e ? _types.Service.toJSON(e) : undefined;
      });
    } else {
      obj.services = [];
    }
    if (message.accordedRight) {
      obj.accordedRight = message.accordedRight.map(function (e) {
        return e ? _types.AccordedRight.toJSON(e) : undefined;
      });
    } else {
      obj.accordedRight = [];
    }
    if (message.linkedResource) {
      obj.linkedResource = message.linkedResource.map(function (e) {
        return e ? _types.LinkedResource.toJSON(e) : undefined;
      });
    } else {
      obj.linkedResource = [];
    }
    if (message.linkedEntity) {
      obj.linkedEntity = message.linkedEntity.map(function (e) {
        return e ? _types.LinkedEntity.toJSON(e) : undefined;
      });
    } else {
      obj.linkedEntity = [];
    }
    message.alsoKnownAs !== undefined && (obj.alsoKnownAs = message.alsoKnownAs);
    message.signer !== undefined && (obj.signer = message.signer);
    if (message.linkedClaim) {
      obj.linkedClaim = message.linkedClaim.map(function (e) {
        return e ? _types.LinkedClaim.toJSON(e) : undefined;
      });
    } else {
      obj.linkedClaim = [];
    }
    return obj;
  },
  fromPartial: function fromPartial(object) {
    var _object$id2, _object$controllers2, _object$context3, _object$verifications2, _object$services2, _object$accordedRight2, _object$linkedResourc2, _object$linkedEntity2, _object$alsoKnownAs2, _object$signer2, _object$linkedClaim2;
    var message = createBaseMsgUpdateIidDocument();
    message.id = (_object$id2 = object.id) !== null && _object$id2 !== void 0 ? _object$id2 : "";
    message.controllers = ((_object$controllers2 = object.controllers) === null || _object$controllers2 === void 0 ? void 0 : _object$controllers2.map(function (e) {
      return e;
    })) || [];
    message.context = ((_object$context3 = object.context) === null || _object$context3 === void 0 ? void 0 : _object$context3.map(function (e) {
      return _types.Context.fromPartial(e);
    })) || [];
    message.verifications = ((_object$verifications2 = object.verifications) === null || _object$verifications2 === void 0 ? void 0 : _object$verifications2.map(function (e) {
      return Verification.fromPartial(e);
    })) || [];
    message.services = ((_object$services2 = object.services) === null || _object$services2 === void 0 ? void 0 : _object$services2.map(function (e) {
      return _types.Service.fromPartial(e);
    })) || [];
    message.accordedRight = ((_object$accordedRight2 = object.accordedRight) === null || _object$accordedRight2 === void 0 ? void 0 : _object$accordedRight2.map(function (e) {
      return _types.AccordedRight.fromPartial(e);
    })) || [];
    message.linkedResource = ((_object$linkedResourc2 = object.linkedResource) === null || _object$linkedResourc2 === void 0 ? void 0 : _object$linkedResourc2.map(function (e) {
      return _types.LinkedResource.fromPartial(e);
    })) || [];
    message.linkedEntity = ((_object$linkedEntity2 = object.linkedEntity) === null || _object$linkedEntity2 === void 0 ? void 0 : _object$linkedEntity2.map(function (e) {
      return _types.LinkedEntity.fromPartial(e);
    })) || [];
    message.alsoKnownAs = (_object$alsoKnownAs2 = object.alsoKnownAs) !== null && _object$alsoKnownAs2 !== void 0 ? _object$alsoKnownAs2 : "";
    message.signer = (_object$signer2 = object.signer) !== null && _object$signer2 !== void 0 ? _object$signer2 : "";
    message.linkedClaim = ((_object$linkedClaim2 = object.linkedClaim) === null || _object$linkedClaim2 === void 0 ? void 0 : _object$linkedClaim2.map(function (e) {
      return _types.LinkedClaim.fromPartial(e);
    })) || [];
    return message;
  }
};
function createBaseMsgUpdateIidDocumentResponse() {
  return {};
}
var MsgUpdateIidDocumentResponse = exports.MsgUpdateIidDocumentResponse = {
  encode: function encode(_) {
    var writer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _m0.Writer.create();
    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 = createBaseMsgUpdateIidDocumentResponse();
    while (reader.pos < end) {
      var tag = reader.uint32();
      switch (tag >>> 3) {
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromJSON: function fromJSON(_) {
    return {};
  },
  toJSON: function toJSON(_) {
    var obj = {};
    return obj;
  },
  fromPartial: function fromPartial(_) {
    var message = createBaseMsgUpdateIidDocumentResponse();
    return message;
  }
};
function createBaseMsgAddVerification() {
  return {
    id: "",
    verification: undefined,
    signer: ""
  };
}
var MsgAddVerification = exports.MsgAddVerification = {
  encode: function encode(message) {
    var writer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _m0.Writer.create();
    if (message.id !== "") {
      writer.uint32(10).string(message.id);
    }
    if (message.verification !== undefined) {
      Verification.encode(message.verification, writer.uint32(18).fork()).ldelim();
    }
    if (message.signer !== "") {
      writer.uint32(26).string(message.signer);
    }
    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 = createBaseMsgAddVerification();
    while (reader.pos < end) {
      var tag = reader.uint32();
      switch (tag >>> 3) {
        case 1:
          message.id = reader.string();
          break;
        case 2:
          message.verification = Verification.decode(reader, reader.uint32());
          break;
        case 3:
          message.signer = reader.string();
          break;
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromJSON: function fromJSON(object) {
    return {
      id: (0, _helpers.isSet)(object.id) ? String(object.id) : "",
      verification: (0, _helpers.isSet)(object.verification) ? Verification.fromJSON(object.verification) : undefined,
      signer: (0, _helpers.isSet)(object.signer) ? String(object.signer) : ""
    };
  },
  toJSON: function toJSON(message) {
    var obj = {};
    message.id !== undefined && (obj.id = message.id);
    message.verification !== undefined && (obj.verification = message.verification ? Verification.toJSON(message.verification) : undefined);
    message.signer !== undefined && (obj.signer = message.signer);
    return obj;
  },
  fromPartial: function fromPartial(object) {
    var _object$id3, _object$signer3;
    var message = createBaseMsgAddVerification();
    message.id = (_object$id3 = object.id) !== null && _object$id3 !== void 0 ? _object$id3 : "";
    message.verification = object.verification !== undefined && object.verification !== null ? Verification.fromPartial(object.verification) : undefined;
    message.signer = (_object$signer3 = object.signer) !== null && _object$signer3 !== void 0 ? _object$signer3 : "";
    return message;
  }
};
function createBaseMsgAddVerificationResponse() {
  return {};
}
var MsgAddVerificationResponse = exports.MsgAddVerificationResponse = {
  encode: function encode(_) {
    var writer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _m0.Writer.create();
    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 = createBaseMsgAddVerificationResponse();
    while (reader.pos < end) {
      var tag = reader.uint32();
      switch (tag >>> 3) {
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromJSON: function fromJSON(_) {
    return {};
  },
  toJSON: function toJSON(_) {
    var obj = {};
    return obj;
  },
  fromPartial: function fromPartial(_) {
    var message = createBaseMsgAddVerificationResponse();
    return message;
  }
};
function createBaseMsgSetVerificationRelationships() {
  return {
    id: "",
    methodId: "",
    relationships: [],
    signer: ""
  };
}
var MsgSetVerificationRelationships = exports.MsgSetVerificationRelationships = {
  encode: function encode(message) {
    var writer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _m0.Writer.create();
    if (message.id !== "") {
      writer.uint32(10).string(message.id);
    }
    if (message.methodId !== "") {
      writer.uint32(18).string(message.methodId);
    }
    var _iterator17 = _createForOfIteratorHelper(message.relationships),
      _step17;
    try {
      for (_iterator17.s(); !(_step17 = _iterator17.n()).done;) {
        var v = _step17.value;
        writer.uint32(26).string(v);
      }
    } catch (err) {
      _iterator17.e(err);
    } finally {
      _iterator17.f();
    }
    if (message.signer !== "") {
      writer.uint32(34).string(message.signer);
    }
    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 = createBaseMsgSetVerificationRelationships();
    while (reader.pos < end) {
      var tag = reader.uint32();
      switch (tag >>> 3) {
        case 1:
          message.id = reader.string();
          break;
        case 2:
          message.methodId = reader.string();
          break;
        case 3:
          message.relationships.push(reader.string());
          break;
        case 4:
          message.signer = reader.string();
          break;
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromJSON: function fromJSON(object) {
    return {
      id: (0, _helpers.isSet)(object.id) ? String(object.id) : "",
      methodId: (0, _helpers.isSet)(object.methodId) ? String(object.methodId) : "",
      relationships: Array.isArray(object === null || object === void 0 ? void 0 : object.relationships) ? object.relationships.map(function (e) {
        return String(e);
      }) : [],
      signer: (0, _helpers.isSet)(object.signer) ? String(object.signer) : ""
    };
  },
  toJSON: function toJSON(message) {
    var obj = {};
    message.id !== undefined && (obj.id = message.id);
    message.methodId !== undefined && (obj.methodId = message.methodId);
    if (message.relationships) {
      obj.relationships = message.relationships.map(function (e) {
        return e;
      });
    } else {
      obj.relationships = [];
    }
    message.signer !== undefined && (obj.signer = message.signer);
    return obj;
  },
  fromPartial: function fromPartial(object) {
    var _object$id4, _object$methodId, _object$relationships2, _object$signer4;
    var message = createBaseMsgSetVerificationRelationships();
    message.id = (_object$id4 = object.id) !== null && _object$id4 !== void 0 ? _object$id4 : "";
    message.methodId = (_object$methodId = object.methodId) !== null && _object$methodId !== void 0 ? _object$methodId : "";
    message.relationships = ((_object$relationships2 = object.relationships) === null || _object$relationships2 === void 0 ? void 0 : _object$relationships2.map(function (e) {
      return e;
    })) || [];
    message.signer = (_object$signer4 = object.signer) !== null && _object$signer4 !== void 0 ? _object$signer4 : "";
    return message;
  }
};
function createBaseMsgSetVerificationRelationshipsResponse() {
  return {};
}
var MsgSetVerificationRelationshipsResponse = exports.MsgSetVerificationRelationshipsResponse = {
  encode: function encode(_) {
    var writer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _m0.Writer.create();
    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 = createBaseMsgSetVerificationRelationshipsResponse();
    while (reader.pos < end) {
      var tag = reader.uint32();
      switch (tag >>> 3) {
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromJSON: function fromJSON(_) {
    return {};
  },
  toJSON: function toJSON(_) {
    var obj = {};
    return obj;
  },
  fromPartial: function fromPartial(_) {
    var message = createBaseMsgSetVerificationRelationshipsResponse();
    return message;
  }
};
function createBaseMsgRevokeVerification() {
  return {
    id: "",
    methodId: "",
    signer: ""
  };
}
var MsgRevokeVerification = exports.MsgRevokeVerification = {
  encode: function encode(message) {
    var writer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _m0.Writer.create();
    if (message.id !== "") {
      writer.uint32(10).string(message.id);
    }
    if (message.methodId !== "") {
      writer.uint32(18).string(message.methodId);
    }
    if (message.signer !== "") {
      writer.uint32(26).string(message.signer);
    }
    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 = createBaseMsgRevokeVerification();
    while (reader.pos < end) {
      var tag = reader.uint32();
      switch (tag >>> 3) {
        case 1:
          message.id = reader.string();
          break;
        case 2:
          message.methodId = reader.string();
          break;
        case 3:
          message.signer = reader.string();
          break;
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromJSON: function fromJSON(object) {
    return {
      id: (0, _helpers.isSet)(object.id) ? String(object.id) : "",
      methodId: (0, _helpers.isSet)(object.methodId) ? String(object.methodId) : "",
      signer: (0, _helpers.isSet)(object.signer) ? String(object.signer) : ""
    };
  },
  toJSON: function toJSON(message) {
    var obj = {};
    message.id !== undefined && (obj.id = message.id);
    message.methodId !== undefined && (obj.methodId = message.methodId);
    message.signer !== undefined && (obj.signer = message.signer);
    return obj;
  },
  fromPartial: function fromPartial(object) {
    var _object$id5, _object$methodId2, _object$signer5;
    var message = createBaseMsgRevokeVerification();
    message.id = (_object$id5 = object.id) !== null && _object$id5 !== void 0 ? _object$id5 : "";
    message.methodId = (_object$methodId2 = object.methodId) !== null && _object$methodId2 !== void 0 ? _object$methodId2 : "";
    message.signer = (_object$signer5 = object.signer) !== null && _object$signer5 !== void 0 ? _object$signer5 : "";
    return message;
  }
};
function createBaseMsgRevokeVerificationResponse() {
  return {};
}
var MsgRevokeVerificationResponse = exports.MsgRevokeVerificationResponse = {
  encode: function encode(_) {
    var writer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _m0.Writer.create();
    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 = createBaseMsgRevokeVerificationResponse();
    while (reader.pos < end) {
      var tag = reader.uint32();
      switch (tag >>> 3) {
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromJSON: function fromJSON(_) {
    return {};
  },
  toJSON: function toJSON(_) {
    var obj = {};
    return obj;
  },
  fromPartial: function fromPartial(_) {
    var message = createBaseMsgRevokeVerificationResponse();
    return message;
  }
};
function createBaseMsgAddService() {
  return {
    id: "",
    serviceData: undefined,
    signer: ""
  };
}
var MsgAddService = exports.MsgAddService = {
  encode: function encode(message) {
    var writer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _m0.Writer.create();
    if (message.id !== "") {
      writer.uint32(10).string(message.id);
    }
    if (message.serviceData !== undefined) {
      _types.Service.encode(message.serviceData, writer.uint32(18).fork()).ldelim();
    }
    if (message.signer !== "") {
      writer.uint32(26).string(message.signer);
    }
    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 = createBaseMsgAddService();
    while (reader.pos < end) {
      var tag = reader.uint32();
      switch (tag >>> 3) {
        case 1:
          message.id = reader.string();
          break;
        case 2:
          message.serviceData = _types.Service.decode(reader, reader.uint32());
          break;
        case 3:
          message.signer = reader.string();
          break;
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromJSON: function fromJSON(object) {
    return {
      id: (0, _helpers.isSet)(object.id) ? String(object.id) : "",
      serviceData: (0, _helpers.isSet)(object.serviceData) ? _types.Service.fromJSON(object.serviceData) : undefined,
      signer: (0, _helpers.isSet)(object.signer) ? String(object.signer) : ""
    };
  },
  toJSON: function toJSON(message) {
    var obj = {};
    message.id !== undefined && (obj.id = message.id);
    message.serviceData !== undefined && (obj.serviceData = message.serviceData ? _types.Service.toJSON(message.serviceData) : undefined);
    message.signer !== undefined && (obj.signer = message.signer);
    return obj;
  },
  fromPartial: function fromPartial(object) {
    var _object$id6, _object$signer6;
    var message = createBaseMsgAddService();
    message.id = (_object$id6 = object.id) !== null && _object$id6 !== void 0 ? _object$id6 : "";
    message.serviceData = object.serviceData !== undefined && object.serviceData !== null ? _types.Service.fromPartial(object.serviceData) : undefined;
    message.signer = (_object$signer6 = object.signer) !== null && _object$signer6 !== void 0 ? _object$signer6 : "";
    return message;
  }
};
function createBaseMsgAddServiceResponse() {
  return {};
}
var MsgAddServiceResponse = exports.MsgAddServiceResponse = {
  encode: function encode(_) {
    var writer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _m0.Writer.create();
    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 = createBaseMsgAddServiceResponse();
    while (reader.pos < end) {
      var tag = reader.uint32();
      switch (tag >>> 3) {
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromJSON: function fromJSON(_) {
    return {};
  },
  toJSON: function toJSON(_) {
    var obj = {};
    return obj;
  },
  fromPartial: function fromPartial(_) {
    var message = createBaseMsgAddServiceResponse();
    return message;
  }
};
function createBaseMsgDeleteService() {
  return {
    id: "",
    serviceId: "",
    signer: ""
  };
}
var MsgDeleteService = exports.MsgDeleteService = {
  encode: function encode(message) {
    var writer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _m0.Writer.create();
    if (message.id !== "") {
      writer.uint32(10).string(message.id);
    }
    if (message.serviceId !== "") {
      writer.uint32(18).string(message.serviceId);
    }
    if (message.signer !== "") {
      writer.uint32(26).string(message.signer);
    }
    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 = createBaseMsgDeleteService();
    while (reader.pos < end) {
      var tag = reader.uint32();
      switch (tag >>> 3) {
        case 1:
          message.id = reader.string();
          break;
        case 2:
          message.serviceId = reader.string();
          break;
        case 3:
          message.signer = reader.string();
          break;
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromJSON: function fromJSON(object) {
    return {
      id: (0, _helpers.isSet)(object.id) ? String(object.id) : "",
      serviceId: (0, _helpers.isSet)(object.serviceId) ? String(object.serviceId) : "",
      signer: (0, _helpers.isSet)(object.signer) ? String(object.signer) : ""
    };
  },
  toJSON: function toJSON(message) {
    var obj = {};
    message.id !== undefined && (obj.id = message.id);
    message.serviceId !== undefined && (obj.serviceId = message.serviceId);
    message.signer !== undefined && (obj.signer = message.signer);
    return obj;
  },
  fromPartial: function fromPartial(object) {
    var _object$id7, _object$serviceId, _object$signer7;
    var message = createBaseMsgDeleteService();
    message.id = (_object$id7 = object.id) !== null && _object$id7 !== void 0 ? _object$id7 : "";
    message.serviceId = (_object$serviceId = object.serviceId) !== null && _object$serviceId !== void 0 ? _object$serviceId : "";
    message.signer = (_object$signer7 = object.signer) !== null && _object$signer7 !== void 0 ? _object$signer7 : "";
    return message;
  }
};
function createBaseMsgDeleteServiceResponse() {
  return {};
}
var MsgDeleteServiceResponse = exports.MsgDeleteServiceResponse = {
  encode: function encode(_) {
    var writer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _m0.Writer.create();
    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 = createBaseMsgDeleteServiceResponse();
    while (reader.pos < end) {
      var tag = reader.uint32();
      switch (tag >>> 3) {
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromJSON: function fromJSON(_) {
    return {};
  },
  toJSON: function toJSON(_) {
    var obj = {};
    return obj;
  },
  fromPartial: function fromPartial(_) {
    var message = createBaseMsgDeleteServiceResponse();
    return message;
  }
};
function createBaseMsgAddController() {
  return {
    id: "",
    controllerDid: "",
    signer: ""
  };
}
var MsgAddController = exports.MsgAddController = {
  encode: function encode(message) {
    var writer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _m0.Writer.create();
    if (message.id !== "") {
      writer.uint32(10).string(message.id);
    }
    if (message.controllerDid !== "") {
      writer.uint32(18).string(message.controllerDid);
    }
    if (message.signer !== "") {
      writer.uint32(26).string(message.signer);
    }
    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 = createBaseMsgAddController();
    while (reader.pos < end) {
      var tag = reader.uint32();
      switch (tag >>> 3) {
        case 1:
          message.id = reader.string();
          break;
        case 2:
          message.controllerDid = reader.string();
          break;
        case 3:
          message.signer = reader.string();
          break;
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromJSON: function fromJSON(object) {
    return {
      id: (0, _helpers.isSet)(object.id) ? String(object.id) : "",
      controllerDid: (0, _helpers.isSet)(object.controllerDid) ? String(object.controllerDid) : "",
      signer: (0, _helpers.isSet)(object.signer) ? String(object.signer) : ""
    };
  },
  toJSON: function toJSON(message) {
    var obj = {};
    message.id !== undefined && (obj.id = message.id);
    message.controllerDid !== undefined && (obj.controllerDid = message.controllerDid);
    message.signer !== undefined && (obj.signer = message.signer);
    return obj;
  },
  fromPartial: function fromPartial(object) {
    var _object$id8, _object$controllerDid, _object$signer8;
    var message = createBaseMsgAddController();
    message.id = (_object$id8 = object.id) !== null && _object$id8 !== void 0 ? _object$id8 : "";
    message.controllerDid = (_object$controllerDid = object.controllerDid) !== null && _object$controllerDid !== void 0 ? _object$controllerDid : "";
    message.signer = (_object$signer8 = object.signer) !== null && _object$signer8 !== void 0 ? _object$signer8 : "";
    return message;
  }
};
function createBaseMsgAddControllerResponse() {
  return {};
}
var MsgAddControllerResponse = exports.MsgAddControllerResponse = {
  encode: function encode(_) {
    var writer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _m0.Writer.create();
    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 = createBaseMsgAddControllerResponse();
    while (reader.pos < end) {
      var tag = reader.uint32();
      switch (tag >>> 3) {
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromJSON: function fromJSON(_) {
    return {};
  },
  toJSON: function toJSON(_) {
    var obj = {};
    return obj;
  },
  fromPartial: function fromPartial(_) {
    var message = createBaseMsgAddControllerResponse();
    return message;
  }
};
function createBaseMsgDeleteController() {
  return {
    id: "",
    controllerDid: "",
    signer: ""
  };
}
var MsgDeleteController = exports.MsgDeleteController = {
  encode: function encode(message) {
    var writer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _m0.Writer.create();
    if (message.id !== "") {
      writer.uint32(10).string(message.id);
    }
    if (message.controllerDid !== "") {
      writer.uint32(18).string(message.controllerDid);
    }
    if (message.signer !== "") {
      writer.uint32(26).string(message.signer);
    }
    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 = createBaseMsgDeleteController();
    while (reader.pos < end) {
      var tag = reader.uint32();
      switch (tag >>> 3) {
        case 1:
          message.id = reader.string();
          break;
        case 2:
          message.controllerDid = reader.string();
          break;
        case 3:
          message.signer = reader.string();
          break;
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromJSON: function fromJSON(object) {
    return {
      id: (0, _helpers.isSet)(object.id) ? String(object.id) : "",
      controllerDid: (0, _helpers.isSet)(object.controllerDid) ? String(object.controllerDid) : "",
      signer: (0, _helpers.isSet)(object.signer) ? String(object.signer) : ""
    };
  },
  toJSON: function toJSON(message) {
    var obj = {};
    message.id !== undefined && (obj.id = message.id);
    message.controllerDid !== undefined && (obj.controllerDid = message.controllerDid);
    message.signer !== undefined && (obj.signer = message.signer);
    return obj;
  },
  fromPartial: function fromPartial(object) {
    var _object$id9, _object$controllerDid2, _object$signer9;
    var message = createBaseMsgDeleteController();
    message.id = (_object$id9 = object.id) !== null && _object$id9 !== void 0 ? _object$id9 : "";
    message.controllerDid = (_object$controllerDid2 = object.controllerDid) !== null && _object$controllerDid2 !== void 0 ? _object$controllerDid2 : "";
    message.signer = (_object$signer9 = object.signer) !== null && _object$signer9 !== void 0 ? _object$signer9 : "";
    return message;
  }
};
function createBaseMsgDeleteControllerResponse() {
  return {};
}
var MsgDeleteControllerResponse = exports.MsgDeleteControllerResponse = {
  encode: function encode(_) {
    var writer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _m0.Writer.create();
    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 = createBaseMsgDeleteControllerResponse();
    while (reader.pos < end) {
      var tag = reader.uint32();
      switch (tag >>> 3) {
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromJSON: function fromJSON(_) {
    return {};
  },
  toJSON: function toJSON(_) {
    var obj = {};
    return obj;
  },
  fromPartial: function fromPartial(_) {
    var message = createBaseMsgDeleteControllerResponse();
    return message;
  }
};
function createBaseMsgAddLinkedResource() {
  return {
    id: "",
    linkedResource: undefined,
    signer: ""
  };
}
var MsgAddLinkedResource = exports.MsgAddLinkedResource = {
  encode: function encode(message) {
    var writer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _m0.Writer.create();
    if (message.id !== "") {
      writer.uint32(10).string(message.id);
    }
    if (message.linkedResource !== undefined) {
      _types.LinkedResource.encode(message.linkedResource, writer.uint32(18).fork()).ldelim();
    }
    if (message.signer !== "") {
      writer.uint32(26).string(message.signer);
    }
    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 = createBaseMsgAddLinkedResource();
    while (reader.pos < end) {
      var tag = reader.uint32();
      switch (tag >>> 3) {
        case 1:
          message.id = reader.string();
          break;
        case 2:
          message.linkedResource = _types.LinkedResource.decode(reader, reader.uint32());
          break;
        case 3:
          message.signer = reader.string();
          break;
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromJSON: function fromJSON(object) {
    return {
      id: (0, _helpers.isSet)(object.id) ? String(object.id) : "",
      linkedResource: (0, _helpers.isSet)(object.linkedResource) ? _types.LinkedResource.fromJSON(object.linkedResource) : undefined,
      signer: (0, _helpers.isSet)(object.signer) ? String(object.signer) : ""
    };
  },
  toJSON: function toJSON(message) {
    var obj = {};
    message.id !== undefined && (obj.id = message.id);
    message.linkedResource !== undefined && (obj.linkedResource = message.linkedResource ? _types.LinkedResource.toJSON(message.linkedResource) : undefined);
    message.signer !== undefined && (obj.signer = message.signer);
    return obj;
  },
  fromPartial: function fromPartial(object) {
    var _object$id0, _object$signer0;
    var message = createBaseMsgAddLinkedResource();
    message.id = (_object$id0 = object.id) !== null && _object$id0 !== void 0 ? _object$id0 : "";
    message.linkedResource = object.linkedResource !== undefined && object.linkedResource !== null ? _types.LinkedResource.fromPartial(object.linkedResource) : undefined;
    message.signer = (_object$signer0 = object.signer) !== null && _object$signer0 !== void 0 ? _object$signer0 : "";
    return message;
  }
};
function createBaseMsgDeleteLinkedResource() {
  return {
    id: "",
    resourceId: "",
    signer: ""
  };
}
var MsgDeleteLinkedResource = exports.MsgDeleteLinkedResource = {
  encode: function encode(message) {
    var writer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _m0.Writer.create();
    if (message.id !== "") {
      writer.uint32(10).string(message.id);
    }
    if (message.resourceId !== "") {
      writer.uint32(18).string(message.resourceId);
    }
    if (message.signer !== "") {
      writer.uint32(26).string(message.signer);
    }
    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 = createBaseMsgDeleteLinkedResource();
    while (reader.pos < end) {
      var tag = reader.uint32();
      switch (tag >>> 3) {
        case 1:
          message.id = reader.string();
          break;
        case 2:
          message.resourceId = reader.string();
          break;
        case 3:
          message.signer = reader.string();
          break;
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromJSON: function fromJSON(object) {
    return {
      id: (0, _helpers.isSet)(object.id) ? String(object.id) : "",
      resourceId: (0, _helpers.isSet)(object.resourceId) ? String(object.resourceId) : "",
      signer: (0, _helpers.isSet)(object.signer) ? String(object.signer) : ""
    };
  },
  toJSON: function toJSON(message) {
    var obj = {};
    message.id !== undefined && (obj.id = message.id);
    message.resourceId !== undefined && (obj.resourceId = message.resourceId);
    message.signer !== undefined && (obj.signer = message.signer);
    return obj;
  },
  fromPartial: function fromPartial(object) {
    var _object$id1, _object$resourceId, _object$signer1;
    var message = createBaseMsgDeleteLinkedResource();
    message.id = (_object$id1 = object.id) !== null && _object$id1 !== void 0 ? _object$id1 : "";
    message.resourceId = (_object$resourceId = object.resourceId) !== null && _object$resourceId !== void 0 ? _object$resourceId : "";
    message.signer = (_object$signer1 = object.signer) !== null && _object$signer1 !== void 0 ? _object$signer1 : "";
    return message;
  }
};
function createBaseMsgAddLinkedClaim() {
  return {
    id: "",
    linkedClaim: undefined,
    signer: ""
  };
}
var MsgAddLinkedClaim = exports.MsgAddLinkedClaim = {
  encode: function encode(message) {
    var writer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _m0.Writer.create();
    if (message.id !== "") {
      writer.uint32(10).string(message.id);
    }
    if (message.linkedClaim !== undefined) {
      _types.LinkedClaim.encode(message.linkedClaim, writer.uint32(18).fork()).ldelim();
    }
    if (message.signer !== "") {
      writer.uint32(26).string(message.signer);
    }
    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 = createBaseMsgAddLinkedClaim();
    while (reader.pos < end) {
      var tag = reader.uint32();
      switch (tag >>> 3) {
        case 1:
          message.id = reader.string();
          break;
        case 2:
          message.linkedClaim = _types.LinkedClaim.decode(reader, reader.uint32());
          break;
        case 3:
          message.signer = reader.string();
          break;
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromJSON: function fromJSON(object) {
    return {
      id: (0, _helpers.isSet)(object.id) ? String(object.id) : "",
      linkedClaim: (0, _helpers.isSet)(object.linkedClaim) ? _types.LinkedClaim.fromJSON(object.linkedClaim) : undefined,
      signer: (0, _helpers.isSet)(object.signer) ? String(object.signer) : ""
    };
  },
  toJSON: function toJSON(message) {
    var obj = {};
    message.id !== undefined && (obj.id = message.id);
    message.linkedClaim !== undefined && (obj.linkedClaim = message.linkedClaim ? _types.LinkedClaim.toJSON(message.linkedClaim) : undefined);
    message.signer !== undefined && (obj.signer = message.signer);
    return obj;
  },
  fromPartial: function fromPartial(object) {
    var _object$id10, _object$signer10;
    var message = createBaseMsgAddLinkedClaim();
    message.id = (_object$id10 = object.id) !== null && _object$id10 !== void 0 ? _object$id10 : "";
    message.linkedClaim = object.linkedClaim !== undefined && object.linkedClaim !== null ? _types.LinkedClaim.fromPartial(object.linkedClaim) : undefined;
    message.signer = (_object$signer10 = object.signer) !== null && _object$signer10 !== void 0 ? _object$signer10 : "";
    return message;
  }
};
function createBaseMsgDeleteLinkedClaim() {
  return {
    id: "",
    claimId: "",
    signer: ""
  };
}
var MsgDeleteLinkedClaim = exports.MsgDeleteLinkedClaim = {
  encode: function encode(message) {
    var writer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _m0.Writer.create();
    if (message.id !== "") {
      writer.uint32(10).string(message.id);
    }
    if (message.claimId !== "") {
      writer.uint32(18).string(message.claimId);
    }
    if (message.signer !== "") {
      writer.uint32(26).string(message.signer);
    }
    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 = createBaseMsgDeleteLinkedClaim();
    while (reader.pos < end) {
      var tag = reader.uint32();
      switch (tag >>> 3) {
        case 1:
          message.id = reader.string();
          break;
        case 2:
          message.claimId = reader.string();
          break;
        case 3:
          message.signer = reader.string();
          break;
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromJSON: function fromJSON(object) {
    return {
      id: (0, _helpers.isSet)(object.id) ? String(object.id) : "",
      claimId: (0, _helpers.isSet)(object.claimId) ? String(object.claimId) : "",
      signer: (0, _helpers.isSet)(object.signer) ? String(object.signer) : ""
    };
  },
  toJSON: function toJSON(message) {
    var obj = {};
    message.id !== undefined && (obj.id = message.id);
    message.claimId !== undefined && (obj.claimId = message.claimId);
    message.signer !== undefined && (obj.signer = message.signer);
    return obj;
  },
  fromPartial: function fromPartial(object) {
    var _object$id11, _object$claimId, _object$signer11;
    var message = createBaseMsgDeleteLinkedClaim();
    message.id = (_object$id11 = object.id) !== null && _object$id11 !== void 0 ? _object$id11 : "";
    message.claimId = (_object$claimId = object.claimId) !== null && _object$claimId !== void 0 ? _object$claimId : "";
    message.signer = (_object$signer11 = object.signer) !== null && _object$signer11 !== void 0 ? _object$signer11 : "";
    return message;
  }
};
function createBaseMsgAddLinkedEntity() {
  return {
    id: "",
    linkedEntity: undefined,
    signer: ""
  };
}
var MsgAddLinkedEntity = exports.MsgAddLinkedEntity = {
  encode: function encode(message) {
    var writer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _m0.Writer.create();
    if (message.id !== "") {
      writer.uint32(10).string(message.id);
    }
    if (message.linkedEntity !== undefined) {
      _types.LinkedEntity.encode(message.linkedEntity, writer.uint32(18).fork()).ldelim();
    }
    if (message.signer !== "") {
      writer.uint32(26).string(message.signer);
    }
    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 = createBaseMsgAddLinkedEntity();
    while (reader.pos < end) {
      var tag = reader.uint32();
      switch (tag >>> 3) {
        case 1:
          message.id = reader.string();
          break;
        case 2:
          message.linkedEntity = _types.LinkedEntity.decode(reader, reader.uint32());
          break;
        case 3:
          message.signer = reader.string();
          break;
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromJSON: function fromJSON(object) {
    return {
      id: (0, _helpers.isSet)(object.id) ? String(object.id) : "",
      linkedEntity: (0, _helpers.isSet)(object.linkedEntity) ? _types.LinkedEntity.fromJSON(object.linkedEntity) : undefined,
      signer: (0, _helpers.isSet)(object.signer) ? String(object.signer) : ""
    };
  },
  toJSON: function toJSON(message) {
    var obj = {};
    message.id !== undefined && (obj.id = message.id);
    message.linkedEntity !== undefined && (obj.linkedEntity = message.linkedEntity ? _types.LinkedEntity.toJSON(message.linkedEntity) : undefined);
    message.signer !== undefined && (obj.signer = message.signer);
    return obj;
  },
  fromPartial: function fromPartial(object) {
    var _object$id12, _object$signer12;
    var message = createBaseMsgAddLinkedEntity();
    message.id = (_object$id12 = object.id) !== null && _object$id12 !== void 0 ? _object$id12 : "";
    message.linkedEntity = object.linkedEntity !== undefined && object.linkedEntity !== null ? _types.LinkedEntity.fromPartial(object.linkedEntity) : undefined;
    message.signer = (_object$signer12 = object.signer) !== null && _object$signer12 !== void 0 ? _object$signer12 : "";
    return message;
  }
};
function createBaseMsgDeleteLinkedEntity() {
  return {
    id: "",
    entityId: "",
    signer: ""
  };
}
var MsgDeleteLinkedEntity = exports.MsgDeleteLinkedEntity = {
  encode: function encode(message) {
    var writer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _m0.Writer.create();
    if (message.id !== "") {
      writer.uint32(10).string(message.id);
    }
    if (message.entityId !== "") {
      writer.uint32(18).string(message.entityId);
    }
    if (message.signer !== "") {
      writer.uint32(26).string(message.signer);
    }
    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 = createBaseMsgDeleteLinkedEntity();
    while (reader.pos < end) {
      var tag = reader.uint32();
      switch (tag >>> 3) {
        case 1:
          message.id = reader.string();
          break;
        case 2:
          message.entityId = reader.string();
          break;
        case 3:
          message.signer = reader.string();
          break;
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromJSON: function fromJSON(object) {
    return {
      id: (0, _helpers.isSet)(object.id) ? String(object.id) : "",
      entityId: (0, _helpers.isSet)(object.entityId) ? String(object.entityId) : "",
      signer: (0, _helpers.isSet)(object.signer) ? String(object.signer) : ""
    };
  },
  toJSON: function toJSON(message) {
    var obj = {};
    message.id !== undefined && (obj.id = message.id);
    message.entityId !== undefined && (obj.entityId = message.entityId);
    message.signer !== undefined && (obj.signer = message.signer);
    return obj;
  },
  fromPartial: function fromPartial(object) {
    var _object$id13, _object$entityId, _object$signer13;
    var message = createBaseMsgDeleteLinkedEntity();
    message.id = (_object$id13 = object.id) !== null && _object$id13 !== void 0 ? _object$id13 : "";
    message.entityId = (_object$entityId = object.entityId) !== null && _object$entityId !== void 0 ? _object$entityId : "";
    message.signer = (_object$signer13 = object.signer) !== null && _object$signer13 !== void 0 ? _object$signer13 : "";
    return message;
  }
};
function createBaseMsgAddAccordedRight() {
  return {
    id: "",
    accordedRight: undefined,
    signer: ""
  };
}
var MsgAddAccordedRight = exports.MsgAddAccordedRight = {
  encode: function encode(message) {
    var writer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _m0.Writer.create();
    if (message.id !== "") {
      writer.uint32(10).string(message.id);
    }
    if (message.accordedRight !== undefined) {
      _types.AccordedRight.encode(message.accordedRight, writer.uint32(18).fork()).ldelim();
    }
    if (message.signer !== "") {
      writer.uint32(26).string(message.signer);
    }
    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 = createBaseMsgAddAccordedRight();
    while (reader.pos < end) {
      var tag = reader.uint32();
      switch (tag >>> 3) {
        case 1:
          message.id = reader.string();
          break;
        case 2:
          message.accordedRight = _types.AccordedRight.decode(reader, reader.uint32());
          break;
        case 3:
          message.signer = reader.string();
          break;
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromJSON: function fromJSON(object) {
    return {
      id: (0, _helpers.isSet)(object.id) ? String(object.id) : "",
      accordedRight: (0, _helpers.isSet)(object.accordedRight) ? _types.AccordedRight.fromJSON(object.accordedRight) : undefined,
      signer: (0, _helpers.isSet)(object.signer) ? String(object.signer) : ""
    };
  },
  toJSON: function toJSON(message) {
    var obj = {};
    message.id !== undefined && (obj.id = message.id);
    message.accordedRight !== undefined && (obj.accordedRight = message.accordedRight ? _types.AccordedRight.toJSON(message.accordedRight) : undefined);
    message.signer !== undefined && (obj.signer = message.signer);
    return obj;
  },
  fromPartial: function fromPartial(object) {
    var _object$id14, _object$signer14;
    var message = createBaseMsgAddAccordedRight();
    message.id = (_object$id14 = object.id) !== null && _object$id14 !== void 0 ? _object$id14 : "";
    message.accordedRight = object.accordedRight !== undefined && object.accordedRight !== null ? _types.AccordedRight.fromPartial(object.accordedRight) : undefined;
    message.signer = (_object$signer14 = object.signer) !== null && _object$signer14 !== void 0 ? _object$signer14 : "";
    return message;
  }
};
function createBaseMsgDeleteAccordedRight() {
  return {
    id: "",
    rightId: "",
    signer: ""
  };
}
var MsgDeleteAccordedRight = exports.MsgDeleteAccordedRight = {
  encode: function encode(message) {
    var writer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _m0.Writer.create();
    if (message.id !== "") {
      writer.uint32(10).string(message.id);
    }
    if (message.rightId !== "") {
      writer.uint32(18).string(message.rightId);
    }
    if (message.signer !== "") {
      writer.uint32(26).string(message.signer);
    }
    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 = createBaseMsgDeleteAccordedRight();
    while (reader.pos < end) {
      var tag = reader.uint32();
      switch (tag >>> 3) {
        case 1:
          message.id = reader.string();
          break;
        case 2:
          message.rightId = reader.string();
          break;
        case 3:
          message.signer = reader.string();
          break;
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromJSON: function fromJSON(object) {
    return {
      id: (0, _helpers.isSet)(object.id) ? String(object.id) : "",
      rightId: (0, _helpers.isSet)(object.rightId) ? String(object.rightId) : "",
      signer: (0, _helpers.isSet)(object.signer) ? String(object.signer) : ""
    };
  },
  toJSON: function toJSON(message) {
    var obj = {};
    message.id !== undefined && (obj.id = message.id);
    message.rightId !== undefined && (obj.rightId = message.rightId);
    message.signer !== undefined && (obj.signer = message.signer);
    return obj;
  },
  fromPartial: function fromPartial(object) {
    var _object$id15, _object$rightId, _object$signer15;
    var message = createBaseMsgDeleteAccordedRight();
    message.id = (_object$id15 = object.id) !== null && _object$id15 !== void 0 ? _object$id15 : "";
    message.rightId = (_object$rightId = object.rightId) !== null && _object$rightId !== void 0 ? _object$rightId : "";
    message.signer = (_object$signer15 = object.signer) !== null && _object$signer15 !== void 0 ? _object$signer15 : "";
    return message;
  }
};
function createBaseMsgAddIidContext() {
  return {
    id: "",
    context: undefined,
    signer: ""
  };
}
var MsgAddIidContext = exports.MsgAddIidContext = {
  encode: function encode(message) {
    var writer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _m0.Writer.create();
    if (message.id !== "") {
      writer.uint32(10).string(message.id);
    }
    if (message.context !== undefined) {
      _types.Context.encode(message.context, writer.uint32(18).fork()).ldelim();
    }
    if (message.signer !== "") {
      writer.uint32(26).string(message.signer);
    }
    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 = createBaseMsgAddIidContext();
    while (reader.pos < end) {
      var tag = reader.uint32();
      switch (tag >>> 3) {
        case 1:
          message.id = reader.string();
          break;
        case 2:
          message.context = _types.Context.decode(reader, reader.uint32());
          break;
        case 3:
          message.signer = reader.string();
          break;
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromJSON: function fromJSON(object) {
    return {
      id: (0, _helpers.isSet)(object.id) ? String(object.id) : "",
      context: (0, _helpers.isSet)(object.context) ? _types.Context.fromJSON(object.context) : undefined,
      signer: (0, _helpers.isSet)(object.signer) ? String(object.signer) : ""
    };
  },
  toJSON: function toJSON(message) {
    var obj = {};
    message.id !== undefined && (obj.id = message.id);
    message.context !== undefined && (obj.context = message.context ? _types.Context.toJSON(message.context) : undefined);
    message.signer !== undefined && (obj.signer = message.signer);
    return obj;
  },
  fromPartial: function fromPartial(object) {
    var _object$id16, _object$signer16;
    var message = createBaseMsgAddIidContext();
    message.id = (_object$id16 = object.id) !== null && _object$id16 !== void 0 ? _object$id16 : "";
    message.context = object.context !== undefined && object.context !== null ? _types.Context.fromPartial(object.context) : undefined;
    message.signer = (_object$signer16 = object.signer) !== null && _object$signer16 !== void 0 ? _object$signer16 : "";
    return message;
  }
};
function createBaseMsgDeactivateIID() {
  return {
    id: "",
    state: false,
    signer: ""
  };
}
var MsgDeactivateIID = exports.MsgDeactivateIID = {
  encode: function encode(message) {
    var writer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _m0.Writer.create();
    if (message.id !== "") {
      writer.uint32(10).string(message.id);
    }
    if (message.state === true) {
      writer.uint32(16).bool(message.state);
    }
    if (message.signer !== "") {
      writer.uint32(26).string(message.signer);
    }
    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 = createBaseMsgDeactivateIID();
    while (reader.pos < end) {
      var tag = reader.uint32();
      switch (tag >>> 3) {
        case 1:
          message.id = reader.string();
          break;
        case 2:
          message.state = reader.bool();
          break;
        case 3:
          message.signer = reader.string();
          break;
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromJSON: function fromJSON(object) {
    return {
      id: (0, _helpers.isSet)(object.id) ? String(object.id) : "",
      state: (0, _helpers.isSet)(object.state) ? Boolean(object.state) : false,
      signer: (0, _helpers.isSet)(object.signer) ? String(object.signer) : ""
    };
  },
  toJSON: function toJSON(message) {
    var obj = {};
    message.id !== undefined && (obj.id = message.id);
    message.state !== undefined && (obj.state = message.state);
    message.signer !== undefined && (obj.signer = message.signer);
    return obj;
  },
  fromPartial: function fromPartial(object) {
    var _object$id17, _object$state, _object$signer17;
    var message = createBaseMsgDeactivateIID();
    message.id = (_object$id17 = object.id) !== null && _object$id17 !== void 0 ? _object$id17 : "";
    message.state = (_object$state = object.state) !== null && _object$state !== void 0 ? _object$state : false;
    message.signer = (_object$signer17 = object.signer) !== null && _object$signer17 !== void 0 ? _object$signer17 : "";
    return message;
  }
};
function createBaseMsgDeleteIidContext() {
  return {
    id: "",
    contextKey: "",
    signer: ""
  };
}
var MsgDeleteIidContext = exports.MsgDeleteIidContext = {
  encode: function encode(message) {
    var writer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _m0.Writer.create();
    if (message.id !== "") {
      writer.uint32(10).string(message.id);
    }
    if (message.contextKey !== "") {
      writer.uint32(18).string(message.contextKey);
    }
    if (message.signer !== "") {
      writer.uint32(26).string(message.signer);
    }
    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 = createBaseMsgDeleteIidContext();
    while (reader.pos < end) {
      var tag = reader.uint32();
      switch (tag >>> 3) {
        case 1:
          message.id = reader.string();
          break;
        case 2:
          message.contextKey = reader.string();
          break;
        case 3:
          message.signer = reader.string();
          break;
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromJSON: function fromJSON(object) {
    return {
      id: (0, _helpers.isSet)(object.id) ? String(object.id) : "",
      contextKey: (0, _helpers.isSet)(object.contextKey) ? String(object.contextKey) : "",
      signer: (0, _helpers.isSet)(object.signer) ? String(object.signer) : ""
    };
  },
  toJSON: function toJSON(message) {
    var obj = {};
    message.id !== undefined && (obj.id = message.id);
    message.contextKey !== undefined && (obj.contextKey = message.contextKey);
    message.signer !== undefined && (obj.signer = message.signer);
    return obj;
  },
  fromPartial: function fromPartial(object) {
    var _object$id18, _object$contextKey, _object$signer18;
    var message = createBaseMsgDeleteIidContext();
    message.id = (_object$id18 = object.id) !== null && _object$id18 !== void 0 ? _object$id18 : "";
    message.contextKey = (_object$contextKey = object.contextKey) !== null && _object$contextKey !== void 0 ? _object$contextKey : "";
    message.signer = (_object$signer18 = object.signer) !== null && _object$signer18 !== void 0 ? _object$signer18 : "";
    return message;
  }
};
function createBaseMsgAddLinkedResourceResponse() {
  return {};
}
var MsgAddLinkedResourceResponse = exports.MsgAddLinkedResourceResponse = {
  encode: function encode(_) {
    var writer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _m0.Writer.create();
    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 = createBaseMsgAddLinkedResourceResponse();
    while (reader.pos < end) {
      var tag = reader.uint32();
      switch (tag >>> 3) {
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromJSON: function fromJSON(_) {
    return {};
  },
  toJSON: function toJSON(_) {
    var obj = {};
    return obj;
  },
  fromPartial: function fromPartial(_) {
    var message = createBaseMsgAddLinkedResourceResponse();
    return message;
  }
};
function createBaseMsgDeleteLinkedResourceResponse() {
  return {};
}
var MsgDeleteLinkedResourceResponse = exports.MsgDeleteLinkedResourceResponse = {
  encode: function encode(_) {
    var writer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _m0.Writer.create();
    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 = createBaseMsgDeleteLinkedResourceResponse();
    while (reader.pos < end) {
      var tag = reader.uint32();
      switch (tag >>> 3) {
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromJSON: function fromJSON(_) {
    return {};
  },
  toJSON: function toJSON(_) {
    var obj = {};
    return obj;
  },
  fromPartial: function fromPartial(_) {
    var message = createBaseMsgDeleteLinkedResourceResponse();
    return message;
  }
};
function createBaseMsgAddLinkedClaimResponse() {
  return {};
}
var MsgAddLinkedClaimResponse = exports.MsgAddLinkedClaimResponse = {
  encode: function encode(_) {
    var writer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _m0.Writer.create();
    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 = createBaseMsgAddLinkedClaimResponse();
    while (reader.pos < end) {
      var tag = reader.uint32();
      switch (tag >>> 3) {
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromJSON: function fromJSON(_) {
    return {};
  },
  toJSON: function toJSON(_) {
    var obj = {};
    return obj;
  },
  fromPartial: function fromPartial(_) {
    var message = createBaseMsgAddLinkedClaimResponse();
    return message;
  }
};
function createBaseMsgDeleteLinkedClaimResponse() {
  return {};
}
var MsgDeleteLinkedClaimResponse = exports.MsgDeleteLinkedClaimResponse = {
  encode: function encode(_) {
    var writer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _m0.Writer.create();
    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 = createBaseMsgDeleteLinkedClaimResponse();
    while (reader.pos < end) {
      var tag = reader.uint32();
      switch (tag >>> 3) {
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromJSON: function fromJSON(_) {
    return {};
  },
  toJSON: function toJSON(_) {
    var obj = {};
    return obj;
  },
  fromPartial: function fromPartial(_) {
    var message = createBaseMsgDeleteLinkedClaimResponse();
    return message;
  }
};
function createBaseMsgAddLinkedEntityResponse() {
  return {};
}
var MsgAddLinkedEntityResponse = exports.MsgAddLinkedEntityResponse = {
  encode: function encode(_) {
    var writer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _m0.Writer.create();
    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 = createBaseMsgAddLinkedEntityResponse();
    while (reader.pos < end) {
      var tag = reader.uint32();
      switch (tag >>> 3) {
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromJSON: function fromJSON(_) {
    return {};
  },
  toJSON: function toJSON(_) {
    var obj = {};
    return obj;
  },
  fromPartial: function fromPartial(_) {
    var message = createBaseMsgAddLinkedEntityResponse();
    return message;
  }
};
function createBaseMsgDeleteLinkedEntityResponse() {
  return {};
}
var MsgDeleteLinkedEntityResponse = exports.MsgDeleteLinkedEntityResponse = {
  encode: function encode(_) {
    var writer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _m0.Writer.create();
    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 = createBaseMsgDeleteLinkedEntityResponse();
    while (reader.pos < end) {
      var tag = reader.uint32();
      switch (tag >>> 3) {
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromJSON: function fromJSON(_) {
    return {};
  },
  toJSON: function toJSON(_) {
    var obj = {};
    return obj;
  },
  fromPartial: function fromPartial(_) {
    var message = createBaseMsgDeleteLinkedEntityResponse();
    return message;
  }
};
function createBaseMsgAddAccordedRightResponse() {
  return {};
}
var MsgAddAccordedRightResponse = exports.MsgAddAccordedRightResponse = {
  encode: function encode(_) {
    var writer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _m0.Writer.create();
    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 = createBaseMsgAddAccordedRightResponse();
    while (reader.pos < end) {
      var tag = reader.uint32();
      switch (tag >>> 3) {
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromJSON: function fromJSON(_) {
    return {};
  },
  toJSON: function toJSON(_) {
    var obj = {};
    return obj;
  },
  fromPartial: function fromPartial(_) {
    var message = createBaseMsgAddAccordedRightResponse();
    return message;
  }
};
function createBaseMsgDeleteAccordedRightResponse() {
  return {};
}
var MsgDeleteAccordedRightResponse = exports.MsgDeleteAccordedRightResponse = {
  encode: function encode(_) {
    var writer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _m0.Writer.create();
    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 = createBaseMsgDeleteAccordedRightResponse();
    while (reader.pos < end) {
      var tag = reader.uint32();
      switch (tag >>> 3) {
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromJSON: function fromJSON(_) {
    return {};
  },
  toJSON: function toJSON(_) {
    var obj = {};
    return obj;
  },
  fromPartial: function fromPartial(_) {
    var message = createBaseMsgDeleteAccordedRightResponse();
    return message;
  }
};
function createBaseMsgAddIidContextResponse() {
  return {};
}
var MsgAddIidContextResponse = exports.MsgAddIidContextResponse = {
  encode: function encode(_) {
    var writer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _m0.Writer.create();
    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 = createBaseMsgAddIidContextResponse();
    while (reader.pos < end) {
      var tag = reader.uint32();
      switch (tag >>> 3) {
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromJSON: function fromJSON(_) {
    return {};
  },
  toJSON: function toJSON(_) {
    var obj = {};
    return obj;
  },
  fromPartial: function fromPartial(_) {
    var message = createBaseMsgAddIidContextResponse();
    return message;
  }
};
function createBaseMsgDeleteIidContextResponse() {
  return {};
}
var MsgDeleteIidContextResponse = exports.MsgDeleteIidContextResponse = {
  encode: function encode(_) {
    var writer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _m0.Writer.create();
    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 = createBaseMsgDeleteIidContextResponse();
    while (reader.pos < end) {
      var tag = reader.uint32();
      switch (tag >>> 3) {
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromJSON: function fromJSON(_) {
    return {};
  },
  toJSON: function toJSON(_) {
    var obj = {};
    return obj;
  },
  fromPartial: function fromPartial(_) {
    var message = createBaseMsgDeleteIidContextResponse();
    return message;
  }
};
function createBaseMsgDeactivateIIDResponse() {
  return {};
}
var MsgDeactivateIIDResponse = exports.MsgDeactivateIIDResponse = {
  encode: function encode(_) {
    var writer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _m0.Writer.create();
    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 = createBaseMsgDeactivateIIDResponse();
    while (reader.pos < end) {
      var tag = reader.uint32();
      switch (tag >>> 3) {
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromJSON: function fromJSON(_) {
    return {};
  },
  toJSON: function toJSON(_) {
    var obj = {};
    return obj;
  },
  fromPartial: function fromPartial(_) {
    var message = createBaseMsgDeactivateIIDResponse();
    return message;
  }
};