"use strict";

var _typeof = require("@babel/runtime/helpers/typeof");
Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.VerificationMethod = exports.Service = exports.LinkedResource = exports.LinkedEntity = exports.LinkedClaim = exports.IidMetadata = exports.Context = exports.AccordedRight = void 0;
var _timestamp = require("../../../google/protobuf/timestamp");
var _m0 = _interopRequireWildcard(require("protobufjs/minimal"));
var _helpers = require("../../../helpers");
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, "default": e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
//@ts-nocheck

function createBaseContext() {
  return {
    key: "",
    val: ""
  };
}
var Context = exports.Context = {
  encode: function encode(message) {
    var writer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _m0.Writer.create();
    if (message.key !== "") {
      writer.uint32(10).string(message.key);
    }
    if (message.val !== "") {
      writer.uint32(18).string(message.val);
    }
    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 = createBaseContext();
    while (reader.pos < end) {
      var tag = reader.uint32();
      switch (tag >>> 3) {
        case 1:
          message.key = reader.string();
          break;
        case 2:
          message.val = reader.string();
          break;
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromJSON: function fromJSON(object) {
    return {
      key: (0, _helpers.isSet)(object.key) ? String(object.key) : "",
      val: (0, _helpers.isSet)(object.val) ? String(object.val) : ""
    };
  },
  toJSON: function toJSON(message) {
    var obj = {};
    message.key !== undefined && (obj.key = message.key);
    message.val !== undefined && (obj.val = message.val);
    return obj;
  },
  fromPartial: function fromPartial(object) {
    var _object$key, _object$val;
    var message = createBaseContext();
    message.key = (_object$key = object.key) !== null && _object$key !== void 0 ? _object$key : "";
    message.val = (_object$val = object.val) !== null && _object$val !== void 0 ? _object$val : "";
    return message;
  }
};
function createBaseAccordedRight() {
  return {
    type: "",
    id: "",
    mechanism: "",
    message: "",
    service: ""
  };
}
var AccordedRight = exports.AccordedRight = {
  encode: function encode(message) {
    var writer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _m0.Writer.create();
    if (message.type !== "") {
      writer.uint32(10).string(message.type);
    }
    if (message.id !== "") {
      writer.uint32(18).string(message.id);
    }
    if (message.mechanism !== "") {
      writer.uint32(26).string(message.mechanism);
    }
    if (message.message !== "") {
      writer.uint32(34).string(message.message);
    }
    if (message.service !== "") {
      writer.uint32(42).string(message.service);
    }
    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 = createBaseAccordedRight();
    while (reader.pos < end) {
      var tag = reader.uint32();
      switch (tag >>> 3) {
        case 1:
          message.type = reader.string();
          break;
        case 2:
          message.id = reader.string();
          break;
        case 3:
          message.mechanism = reader.string();
          break;
        case 4:
          message.message = reader.string();
          break;
        case 5:
          message.service = reader.string();
          break;
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromJSON: function fromJSON(object) {
    return {
      type: (0, _helpers.isSet)(object.type) ? String(object.type) : "",
      id: (0, _helpers.isSet)(object.id) ? String(object.id) : "",
      mechanism: (0, _helpers.isSet)(object.mechanism) ? String(object.mechanism) : "",
      message: (0, _helpers.isSet)(object.message) ? String(object.message) : "",
      service: (0, _helpers.isSet)(object.service) ? String(object.service) : ""
    };
  },
  toJSON: function toJSON(message) {
    var obj = {};
    message.type !== undefined && (obj.type = message.type);
    message.id !== undefined && (obj.id = message.id);
    message.mechanism !== undefined && (obj.mechanism = message.mechanism);
    message.message !== undefined && (obj.message = message.message);
    message.service !== undefined && (obj.service = message.service);
    return obj;
  },
  fromPartial: function fromPartial(object) {
    var _object$type, _object$id, _object$mechanism, _object$message, _object$service;
    var message = createBaseAccordedRight();
    message.type = (_object$type = object.type) !== null && _object$type !== void 0 ? _object$type : "";
    message.id = (_object$id = object.id) !== null && _object$id !== void 0 ? _object$id : "";
    message.mechanism = (_object$mechanism = object.mechanism) !== null && _object$mechanism !== void 0 ? _object$mechanism : "";
    message.message = (_object$message = object.message) !== null && _object$message !== void 0 ? _object$message : "";
    message.service = (_object$service = object.service) !== null && _object$service !== void 0 ? _object$service : "";
    return message;
  }
};
function createBaseLinkedResource() {
  return {
    type: "",
    id: "",
    description: "",
    mediaType: "",
    serviceEndpoint: "",
    proof: "",
    encrypted: "",
    right: ""
  };
}
var LinkedResource = exports.LinkedResource = {
  encode: function encode(message) {
    var writer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _m0.Writer.create();
    if (message.type !== "") {
      writer.uint32(10).string(message.type);
    }
    if (message.id !== "") {
      writer.uint32(18).string(message.id);
    }
    if (message.description !== "") {
      writer.uint32(26).string(message.description);
    }
    if (message.mediaType !== "") {
      writer.uint32(34).string(message.mediaType);
    }
    if (message.serviceEndpoint !== "") {
      writer.uint32(42).string(message.serviceEndpoint);
    }
    if (message.proof !== "") {
      writer.uint32(50).string(message.proof);
    }
    if (message.encrypted !== "") {
      writer.uint32(58).string(message.encrypted);
    }
    if (message.right !== "") {
      writer.uint32(66).string(message.right);
    }
    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 = createBaseLinkedResource();
    while (reader.pos < end) {
      var tag = reader.uint32();
      switch (tag >>> 3) {
        case 1:
          message.type = reader.string();
          break;
        case 2:
          message.id = reader.string();
          break;
        case 3:
          message.description = reader.string();
          break;
        case 4:
          message.mediaType = reader.string();
          break;
        case 5:
          message.serviceEndpoint = reader.string();
          break;
        case 6:
          message.proof = reader.string();
          break;
        case 7:
          message.encrypted = reader.string();
          break;
        case 8:
          message.right = reader.string();
          break;
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromJSON: function fromJSON(object) {
    return {
      type: (0, _helpers.isSet)(object.type) ? String(object.type) : "",
      id: (0, _helpers.isSet)(object.id) ? String(object.id) : "",
      description: (0, _helpers.isSet)(object.description) ? String(object.description) : "",
      mediaType: (0, _helpers.isSet)(object.mediaType) ? String(object.mediaType) : "",
      serviceEndpoint: (0, _helpers.isSet)(object.serviceEndpoint) ? String(object.serviceEndpoint) : "",
      proof: (0, _helpers.isSet)(object.proof) ? String(object.proof) : "",
      encrypted: (0, _helpers.isSet)(object.encrypted) ? String(object.encrypted) : "",
      right: (0, _helpers.isSet)(object.right) ? String(object.right) : ""
    };
  },
  toJSON: function toJSON(message) {
    var obj = {};
    message.type !== undefined && (obj.type = message.type);
    message.id !== undefined && (obj.id = message.id);
    message.description !== undefined && (obj.description = message.description);
    message.mediaType !== undefined && (obj.mediaType = message.mediaType);
    message.serviceEndpoint !== undefined && (obj.serviceEndpoint = message.serviceEndpoint);
    message.proof !== undefined && (obj.proof = message.proof);
    message.encrypted !== undefined && (obj.encrypted = message.encrypted);
    message.right !== undefined && (obj.right = message.right);
    return obj;
  },
  fromPartial: function fromPartial(object) {
    var _object$type2, _object$id2, _object$description, _object$mediaType, _object$serviceEndpoi, _object$proof, _object$encrypted, _object$right;
    var message = createBaseLinkedResource();
    message.type = (_object$type2 = object.type) !== null && _object$type2 !== void 0 ? _object$type2 : "";
    message.id = (_object$id2 = object.id) !== null && _object$id2 !== void 0 ? _object$id2 : "";
    message.description = (_object$description = object.description) !== null && _object$description !== void 0 ? _object$description : "";
    message.mediaType = (_object$mediaType = object.mediaType) !== null && _object$mediaType !== void 0 ? _object$mediaType : "";
    message.serviceEndpoint = (_object$serviceEndpoi = object.serviceEndpoint) !== null && _object$serviceEndpoi !== void 0 ? _object$serviceEndpoi : "";
    message.proof = (_object$proof = object.proof) !== null && _object$proof !== void 0 ? _object$proof : "";
    message.encrypted = (_object$encrypted = object.encrypted) !== null && _object$encrypted !== void 0 ? _object$encrypted : "";
    message.right = (_object$right = object.right) !== null && _object$right !== void 0 ? _object$right : "";
    return message;
  }
};
function createBaseLinkedClaim() {
  return {
    type: "",
    id: "",
    description: "",
    serviceEndpoint: "",
    proof: "",
    encrypted: "",
    right: ""
  };
}
var LinkedClaim = exports.LinkedClaim = {
  encode: function encode(message) {
    var writer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _m0.Writer.create();
    if (message.type !== "") {
      writer.uint32(10).string(message.type);
    }
    if (message.id !== "") {
      writer.uint32(18).string(message.id);
    }
    if (message.description !== "") {
      writer.uint32(26).string(message.description);
    }
    if (message.serviceEndpoint !== "") {
      writer.uint32(34).string(message.serviceEndpoint);
    }
    if (message.proof !== "") {
      writer.uint32(42).string(message.proof);
    }
    if (message.encrypted !== "") {
      writer.uint32(50).string(message.encrypted);
    }
    if (message.right !== "") {
      writer.uint32(58).string(message.right);
    }
    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 = createBaseLinkedClaim();
    while (reader.pos < end) {
      var tag = reader.uint32();
      switch (tag >>> 3) {
        case 1:
          message.type = reader.string();
          break;
        case 2:
          message.id = reader.string();
          break;
        case 3:
          message.description = reader.string();
          break;
        case 4:
          message.serviceEndpoint = reader.string();
          break;
        case 5:
          message.proof = reader.string();
          break;
        case 6:
          message.encrypted = reader.string();
          break;
        case 7:
          message.right = reader.string();
          break;
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromJSON: function fromJSON(object) {
    return {
      type: (0, _helpers.isSet)(object.type) ? String(object.type) : "",
      id: (0, _helpers.isSet)(object.id) ? String(object.id) : "",
      description: (0, _helpers.isSet)(object.description) ? String(object.description) : "",
      serviceEndpoint: (0, _helpers.isSet)(object.serviceEndpoint) ? String(object.serviceEndpoint) : "",
      proof: (0, _helpers.isSet)(object.proof) ? String(object.proof) : "",
      encrypted: (0, _helpers.isSet)(object.encrypted) ? String(object.encrypted) : "",
      right: (0, _helpers.isSet)(object.right) ? String(object.right) : ""
    };
  },
  toJSON: function toJSON(message) {
    var obj = {};
    message.type !== undefined && (obj.type = message.type);
    message.id !== undefined && (obj.id = message.id);
    message.description !== undefined && (obj.description = message.description);
    message.serviceEndpoint !== undefined && (obj.serviceEndpoint = message.serviceEndpoint);
    message.proof !== undefined && (obj.proof = message.proof);
    message.encrypted !== undefined && (obj.encrypted = message.encrypted);
    message.right !== undefined && (obj.right = message.right);
    return obj;
  },
  fromPartial: function fromPartial(object) {
    var _object$type3, _object$id3, _object$description2, _object$serviceEndpoi2, _object$proof2, _object$encrypted2, _object$right2;
    var message = createBaseLinkedClaim();
    message.type = (_object$type3 = object.type) !== null && _object$type3 !== void 0 ? _object$type3 : "";
    message.id = (_object$id3 = object.id) !== null && _object$id3 !== void 0 ? _object$id3 : "";
    message.description = (_object$description2 = object.description) !== null && _object$description2 !== void 0 ? _object$description2 : "";
    message.serviceEndpoint = (_object$serviceEndpoi2 = object.serviceEndpoint) !== null && _object$serviceEndpoi2 !== void 0 ? _object$serviceEndpoi2 : "";
    message.proof = (_object$proof2 = object.proof) !== null && _object$proof2 !== void 0 ? _object$proof2 : "";
    message.encrypted = (_object$encrypted2 = object.encrypted) !== null && _object$encrypted2 !== void 0 ? _object$encrypted2 : "";
    message.right = (_object$right2 = object.right) !== null && _object$right2 !== void 0 ? _object$right2 : "";
    return message;
  }
};
function createBaseLinkedEntity() {
  return {
    type: "",
    id: "",
    relationship: "",
    service: ""
  };
}
var LinkedEntity = exports.LinkedEntity = {
  encode: function encode(message) {
    var writer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _m0.Writer.create();
    if (message.type !== "") {
      writer.uint32(10).string(message.type);
    }
    if (message.id !== "") {
      writer.uint32(18).string(message.id);
    }
    if (message.relationship !== "") {
      writer.uint32(26).string(message.relationship);
    }
    if (message.service !== "") {
      writer.uint32(34).string(message.service);
    }
    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 = createBaseLinkedEntity();
    while (reader.pos < end) {
      var tag = reader.uint32();
      switch (tag >>> 3) {
        case 1:
          message.type = reader.string();
          break;
        case 2:
          message.id = reader.string();
          break;
        case 3:
          message.relationship = reader.string();
          break;
        case 4:
          message.service = reader.string();
          break;
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromJSON: function fromJSON(object) {
    return {
      type: (0, _helpers.isSet)(object.type) ? String(object.type) : "",
      id: (0, _helpers.isSet)(object.id) ? String(object.id) : "",
      relationship: (0, _helpers.isSet)(object.relationship) ? String(object.relationship) : "",
      service: (0, _helpers.isSet)(object.service) ? String(object.service) : ""
    };
  },
  toJSON: function toJSON(message) {
    var obj = {};
    message.type !== undefined && (obj.type = message.type);
    message.id !== undefined && (obj.id = message.id);
    message.relationship !== undefined && (obj.relationship = message.relationship);
    message.service !== undefined && (obj.service = message.service);
    return obj;
  },
  fromPartial: function fromPartial(object) {
    var _object$type4, _object$id4, _object$relationship, _object$service2;
    var message = createBaseLinkedEntity();
    message.type = (_object$type4 = object.type) !== null && _object$type4 !== void 0 ? _object$type4 : "";
    message.id = (_object$id4 = object.id) !== null && _object$id4 !== void 0 ? _object$id4 : "";
    message.relationship = (_object$relationship = object.relationship) !== null && _object$relationship !== void 0 ? _object$relationship : "";
    message.service = (_object$service2 = object.service) !== null && _object$service2 !== void 0 ? _object$service2 : "";
    return message;
  }
};
function createBaseVerificationMethod() {
  return {
    id: "",
    type: "",
    controller: "",
    blockchainAccountID: undefined,
    publicKeyHex: undefined,
    publicKeyMultibase: undefined,
    publicKeyBase58: undefined
  };
}
var VerificationMethod = exports.VerificationMethod = {
  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.type !== "") {
      writer.uint32(18).string(message.type);
    }
    if (message.controller !== "") {
      writer.uint32(26).string(message.controller);
    }
    if (message.blockchainAccountID !== undefined) {
      writer.uint32(34).string(message.blockchainAccountID);
    }
    if (message.publicKeyHex !== undefined) {
      writer.uint32(42).string(message.publicKeyHex);
    }
    if (message.publicKeyMultibase !== undefined) {
      writer.uint32(50).string(message.publicKeyMultibase);
    }
    if (message.publicKeyBase58 !== undefined) {
      writer.uint32(58).string(message.publicKeyBase58);
    }
    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 = createBaseVerificationMethod();
    while (reader.pos < end) {
      var tag = reader.uint32();
      switch (tag >>> 3) {
        case 1:
          message.id = reader.string();
          break;
        case 2:
          message.type = reader.string();
          break;
        case 3:
          message.controller = reader.string();
          break;
        case 4:
          message.blockchainAccountID = reader.string();
          break;
        case 5:
          message.publicKeyHex = reader.string();
          break;
        case 6:
          message.publicKeyMultibase = reader.string();
          break;
        case 7:
          message.publicKeyBase58 = 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) : "",
      type: (0, _helpers.isSet)(object.type) ? String(object.type) : "",
      controller: (0, _helpers.isSet)(object.controller) ? String(object.controller) : "",
      blockchainAccountID: (0, _helpers.isSet)(object.blockchainAccountID) ? String(object.blockchainAccountID) : undefined,
      publicKeyHex: (0, _helpers.isSet)(object.publicKeyHex) ? String(object.publicKeyHex) : undefined,
      publicKeyMultibase: (0, _helpers.isSet)(object.publicKeyMultibase) ? String(object.publicKeyMultibase) : undefined,
      publicKeyBase58: (0, _helpers.isSet)(object.publicKeyBase58) ? String(object.publicKeyBase58) : undefined
    };
  },
  toJSON: function toJSON(message) {
    var obj = {};
    message.id !== undefined && (obj.id = message.id);
    message.type !== undefined && (obj.type = message.type);
    message.controller !== undefined && (obj.controller = message.controller);
    message.blockchainAccountID !== undefined && (obj.blockchainAccountID = message.blockchainAccountID);
    message.publicKeyHex !== undefined && (obj.publicKeyHex = message.publicKeyHex);
    message.publicKeyMultibase !== undefined && (obj.publicKeyMultibase = message.publicKeyMultibase);
    message.publicKeyBase58 !== undefined && (obj.publicKeyBase58 = message.publicKeyBase58);
    return obj;
  },
  fromPartial: function fromPartial(object) {
    var _object$id5, _object$type5, _object$controller, _object$blockchainAcc, _object$publicKeyHex, _object$publicKeyMult, _object$publicKeyBase;
    var message = createBaseVerificationMethod();
    message.id = (_object$id5 = object.id) !== null && _object$id5 !== void 0 ? _object$id5 : "";
    message.type = (_object$type5 = object.type) !== null && _object$type5 !== void 0 ? _object$type5 : "";
    message.controller = (_object$controller = object.controller) !== null && _object$controller !== void 0 ? _object$controller : "";
    message.blockchainAccountID = (_object$blockchainAcc = object.blockchainAccountID) !== null && _object$blockchainAcc !== void 0 ? _object$blockchainAcc : undefined;
    message.publicKeyHex = (_object$publicKeyHex = object.publicKeyHex) !== null && _object$publicKeyHex !== void 0 ? _object$publicKeyHex : undefined;
    message.publicKeyMultibase = (_object$publicKeyMult = object.publicKeyMultibase) !== null && _object$publicKeyMult !== void 0 ? _object$publicKeyMult : undefined;
    message.publicKeyBase58 = (_object$publicKeyBase = object.publicKeyBase58) !== null && _object$publicKeyBase !== void 0 ? _object$publicKeyBase : undefined;
    return message;
  }
};
function createBaseService() {
  return {
    id: "",
    type: "",
    serviceEndpoint: ""
  };
}
var Service = exports.Service = {
  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.type !== "") {
      writer.uint32(18).string(message.type);
    }
    if (message.serviceEndpoint !== "") {
      writer.uint32(26).string(message.serviceEndpoint);
    }
    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 = createBaseService();
    while (reader.pos < end) {
      var tag = reader.uint32();
      switch (tag >>> 3) {
        case 1:
          message.id = reader.string();
          break;
        case 2:
          message.type = reader.string();
          break;
        case 3:
          message.serviceEndpoint = 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) : "",
      type: (0, _helpers.isSet)(object.type) ? String(object.type) : "",
      serviceEndpoint: (0, _helpers.isSet)(object.serviceEndpoint) ? String(object.serviceEndpoint) : ""
    };
  },
  toJSON: function toJSON(message) {
    var obj = {};
    message.id !== undefined && (obj.id = message.id);
    message.type !== undefined && (obj.type = message.type);
    message.serviceEndpoint !== undefined && (obj.serviceEndpoint = message.serviceEndpoint);
    return obj;
  },
  fromPartial: function fromPartial(object) {
    var _object$id6, _object$type6, _object$serviceEndpoi3;
    var message = createBaseService();
    message.id = (_object$id6 = object.id) !== null && _object$id6 !== void 0 ? _object$id6 : "";
    message.type = (_object$type6 = object.type) !== null && _object$type6 !== void 0 ? _object$type6 : "";
    message.serviceEndpoint = (_object$serviceEndpoi3 = object.serviceEndpoint) !== null && _object$serviceEndpoi3 !== void 0 ? _object$serviceEndpoi3 : "";
    return message;
  }
};
function createBaseIidMetadata() {
  return {
    versionId: "",
    created: undefined,
    updated: undefined,
    deactivated: false
  };
}
var IidMetadata = exports.IidMetadata = {
  encode: function encode(message) {
    var writer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _m0.Writer.create();
    if (message.versionId !== "") {
      writer.uint32(10).string(message.versionId);
    }
    if (message.created !== undefined) {
      _timestamp.Timestamp.encode(message.created, writer.uint32(18).fork()).ldelim();
    }
    if (message.updated !== undefined) {
      _timestamp.Timestamp.encode(message.updated, writer.uint32(26).fork()).ldelim();
    }
    if (message.deactivated === true) {
      writer.uint32(32).bool(message.deactivated);
    }
    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 = createBaseIidMetadata();
    while (reader.pos < end) {
      var tag = reader.uint32();
      switch (tag >>> 3) {
        case 1:
          message.versionId = reader.string();
          break;
        case 2:
          message.created = _timestamp.Timestamp.decode(reader, reader.uint32());
          break;
        case 3:
          message.updated = _timestamp.Timestamp.decode(reader, reader.uint32());
          break;
        case 4:
          message.deactivated = reader.bool();
          break;
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromJSON: function fromJSON(object) {
    return {
      versionId: (0, _helpers.isSet)(object.versionId) ? String(object.versionId) : "",
      created: (0, _helpers.isSet)(object.created) ? (0, _helpers.fromJsonTimestamp)(object.created) : undefined,
      updated: (0, _helpers.isSet)(object.updated) ? (0, _helpers.fromJsonTimestamp)(object.updated) : undefined,
      deactivated: (0, _helpers.isSet)(object.deactivated) ? Boolean(object.deactivated) : false
    };
  },
  toJSON: function toJSON(message) {
    var obj = {};
    message.versionId !== undefined && (obj.versionId = message.versionId);
    message.created !== undefined && (obj.created = (0, _helpers.fromTimestamp)(message.created).toISOString());
    message.updated !== undefined && (obj.updated = (0, _helpers.fromTimestamp)(message.updated).toISOString());
    message.deactivated !== undefined && (obj.deactivated = message.deactivated);
    return obj;
  },
  fromPartial: function fromPartial(object) {
    var _object$versionId, _object$deactivated;
    var message = createBaseIidMetadata();
    message.versionId = (_object$versionId = object.versionId) !== null && _object$versionId !== void 0 ? _object$versionId : "";
    message.created = object.created !== undefined && object.created !== null ? _timestamp.Timestamp.fromPartial(object.created) : undefined;
    message.updated = object.updated !== undefined && object.updated !== null ? _timestamp.Timestamp.fromPartial(object.updated) : undefined;
    message.deactivated = (_object$deactivated = object.deactivated) !== null && _object$deactivated !== void 0 ? _object$deactivated : false;
    return message;
  }
};