"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.ListImplementationsResponse = exports.ListImplementationsRequest = exports.ListAllInterfacesResponse = exports.ListAllInterfacesRequest = void 0;
var _binary = require("../../../../binary");
var _helpers = require("../../../../helpers");
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, 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 normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
/** ListAllInterfacesRequest is the request type of the ListAllInterfaces RPC. */

/** ListAllInterfacesRequest is the request type of the ListAllInterfaces RPC. */

/** ListAllInterfacesRequest is the request type of the ListAllInterfaces RPC. */

/** ListAllInterfacesResponse is the response type of the ListAllInterfaces RPC. */

/** ListAllInterfacesResponse is the response type of the ListAllInterfaces RPC. */

/** ListAllInterfacesResponse is the response type of the ListAllInterfaces RPC. */

/**
 * ListImplementationsRequest is the request type of the ListImplementations
 * RPC.
 */

/**
 * ListImplementationsRequest is the request type of the ListImplementations
 * RPC.
 */

/**
 * ListImplementationsRequest is the request type of the ListImplementations
 * RPC.
 */

/**
 * ListImplementationsResponse is the response type of the ListImplementations
 * RPC.
 */

/**
 * ListImplementationsResponse is the response type of the ListImplementations
 * RPC.
 */

/**
 * ListImplementationsResponse is the response type of the ListImplementations
 * RPC.
 */

function createBaseListAllInterfacesRequest() {
  return {};
}
var ListAllInterfacesRequest = exports.ListAllInterfacesRequest = {
  typeUrl: "/cosmos.base.reflection.v1beta1.ListAllInterfacesRequest",
  encode: function encode(_) {
    var writer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _binary.BinaryWriter.create();
    return writer;
  },
  fromJSON: function fromJSON(_) {
    return {};
  },
  fromPartial: function fromPartial(_) {
    var message = createBaseListAllInterfacesRequest();
    return message;
  },
  fromAmino: function fromAmino(_) {
    var message = createBaseListAllInterfacesRequest();
    return message;
  },
  toAmino: function toAmino(_) {
    var obj = {};
    return obj;
  },
  fromAminoMsg: function fromAminoMsg(object) {
    return ListAllInterfacesRequest.fromAmino(object.value);
  },
  toAminoMsg: function toAminoMsg(message) {
    return {
      type: "cosmos-sdk/ListAllInterfacesRequest",
      value: ListAllInterfacesRequest.toAmino(message)
    };
  },
  fromProtoMsg: function fromProtoMsg(message) {
    return ListAllInterfacesRequest.decode(message.value);
  },
  toProto: function toProto(message) {
    return ListAllInterfacesRequest.encode(message).finish();
  },
  toProtoMsg: function toProtoMsg(message) {
    return {
      typeUrl: "/cosmos.base.reflection.v1beta1.ListAllInterfacesRequest",
      value: ListAllInterfacesRequest.encode(message).finish()
    };
  }
};
function createBaseListAllInterfacesResponse() {
  return {
    interfaceNames: []
  };
}
var ListAllInterfacesResponse = exports.ListAllInterfacesResponse = {
  typeUrl: "/cosmos.base.reflection.v1beta1.ListAllInterfacesResponse",
  encode: function encode(message) {
    var writer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _binary.BinaryWriter.create();
    var _iterator = _createForOfIteratorHelper(message.interfaceNames),
      _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();
    }
    return writer;
  },
  fromJSON: function fromJSON(object) {
    return {
      interfaceNames: Array.isArray(object === null || object === void 0 ? void 0 : object.interfaceNames) ? object.interfaceNames.map(function (e) {
        return String(e);
      }) : []
    };
  },
  fromPartial: function fromPartial(object) {
    var _object$interfaceName;
    var message = createBaseListAllInterfacesResponse();
    message.interfaceNames = ((_object$interfaceName = object.interfaceNames) === null || _object$interfaceName === void 0 ? void 0 : _object$interfaceName.map(function (e) {
      return e;
    })) || [];
    return message;
  },
  fromAmino: function fromAmino(object) {
    var _object$interface_nam;
    var message = createBaseListAllInterfacesResponse();
    message.interfaceNames = ((_object$interface_nam = object.interface_names) === null || _object$interface_nam === void 0 ? void 0 : _object$interface_nam.map(function (e) {
      return e;
    })) || [];
    return message;
  },
  toAmino: function toAmino(message) {
    var obj = {};
    if (message.interfaceNames) {
      obj.interface_names = message.interfaceNames.map(function (e) {
        return e;
      });
    } else {
      obj.interface_names = message.interfaceNames;
    }
    return obj;
  },
  fromAminoMsg: function fromAminoMsg(object) {
    return ListAllInterfacesResponse.fromAmino(object.value);
  },
  toAminoMsg: function toAminoMsg(message) {
    return {
      type: "cosmos-sdk/ListAllInterfacesResponse",
      value: ListAllInterfacesResponse.toAmino(message)
    };
  },
  fromProtoMsg: function fromProtoMsg(message) {
    return ListAllInterfacesResponse.decode(message.value);
  },
  toProto: function toProto(message) {
    return ListAllInterfacesResponse.encode(message).finish();
  },
  toProtoMsg: function toProtoMsg(message) {
    return {
      typeUrl: "/cosmos.base.reflection.v1beta1.ListAllInterfacesResponse",
      value: ListAllInterfacesResponse.encode(message).finish()
    };
  }
};
function createBaseListImplementationsRequest() {
  return {
    interfaceName: ""
  };
}
var ListImplementationsRequest = exports.ListImplementationsRequest = {
  typeUrl: "/cosmos.base.reflection.v1beta1.ListImplementationsRequest",
  encode: function encode(message) {
    var writer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _binary.BinaryWriter.create();
    if (message.interfaceName !== "") {
      writer.uint32(10).string(message.interfaceName);
    }
    return writer;
  },
  fromJSON: function fromJSON(object) {
    return {
      interfaceName: (0, _helpers.isSet)(object.interfaceName) ? String(object.interfaceName) : ""
    };
  },
  fromPartial: function fromPartial(object) {
    var _object$interfaceName2;
    var message = createBaseListImplementationsRequest();
    message.interfaceName = (_object$interfaceName2 = object.interfaceName) !== null && _object$interfaceName2 !== void 0 ? _object$interfaceName2 : "";
    return message;
  },
  fromAmino: function fromAmino(object) {
    var message = createBaseListImplementationsRequest();
    if (object.interface_name !== undefined && object.interface_name !== null) {
      message.interfaceName = object.interface_name;
    }
    return message;
  },
  toAmino: function toAmino(message) {
    var obj = {};
    obj.interface_name = message.interfaceName === "" ? undefined : message.interfaceName;
    return obj;
  },
  fromAminoMsg: function fromAminoMsg(object) {
    return ListImplementationsRequest.fromAmino(object.value);
  },
  toAminoMsg: function toAminoMsg(message) {
    return {
      type: "cosmos-sdk/ListImplementationsRequest",
      value: ListImplementationsRequest.toAmino(message)
    };
  },
  fromProtoMsg: function fromProtoMsg(message) {
    return ListImplementationsRequest.decode(message.value);
  },
  toProto: function toProto(message) {
    return ListImplementationsRequest.encode(message).finish();
  },
  toProtoMsg: function toProtoMsg(message) {
    return {
      typeUrl: "/cosmos.base.reflection.v1beta1.ListImplementationsRequest",
      value: ListImplementationsRequest.encode(message).finish()
    };
  }
};
function createBaseListImplementationsResponse() {
  return {
    implementationMessageNames: []
  };
}
var ListImplementationsResponse = exports.ListImplementationsResponse = {
  typeUrl: "/cosmos.base.reflection.v1beta1.ListImplementationsResponse",
  encode: function encode(message) {
    var writer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _binary.BinaryWriter.create();
    var _iterator2 = _createForOfIteratorHelper(message.implementationMessageNames),
      _step2;
    try {
      for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
        var v = _step2.value;
        writer.uint32(10).string(v);
      }
    } catch (err) {
      _iterator2.e(err);
    } finally {
      _iterator2.f();
    }
    return writer;
  },
  fromJSON: function fromJSON(object) {
    return {
      implementationMessageNames: Array.isArray(object === null || object === void 0 ? void 0 : object.implementationMessageNames) ? object.implementationMessageNames.map(function (e) {
        return String(e);
      }) : []
    };
  },
  fromPartial: function fromPartial(object) {
    var _object$implementatio;
    var message = createBaseListImplementationsResponse();
    message.implementationMessageNames = ((_object$implementatio = object.implementationMessageNames) === null || _object$implementatio === void 0 ? void 0 : _object$implementatio.map(function (e) {
      return e;
    })) || [];
    return message;
  },
  fromAmino: function fromAmino(object) {
    var _object$implementatio2;
    var message = createBaseListImplementationsResponse();
    message.implementationMessageNames = ((_object$implementatio2 = object.implementation_message_names) === null || _object$implementatio2 === void 0 ? void 0 : _object$implementatio2.map(function (e) {
      return e;
    })) || [];
    return message;
  },
  toAmino: function toAmino(message) {
    var obj = {};
    if (message.implementationMessageNames) {
      obj.implementation_message_names = message.implementationMessageNames.map(function (e) {
        return e;
      });
    } else {
      obj.implementation_message_names = message.implementationMessageNames;
    }
    return obj;
  },
  fromAminoMsg: function fromAminoMsg(object) {
    return ListImplementationsResponse.fromAmino(object.value);
  },
  toAminoMsg: function toAminoMsg(message) {
    return {
      type: "cosmos-sdk/ListImplementationsResponse",
      value: ListImplementationsResponse.toAmino(message)
    };
  },
  fromProtoMsg: function fromProtoMsg(message) {
    return ListImplementationsResponse.decode(message.value);
  },
  toProto: function toProto(message) {
    return ListImplementationsResponse.encode(message).finish();
  },
  toProtoMsg: function toProtoMsg(message) {
    return {
      typeUrl: "/cosmos.base.reflection.v1beta1.ListImplementationsResponse",
      value: ListImplementationsResponse.encode(message).finish()
    };
  }
};