@pairsystems/goodmem-client 1.0.3 → 1.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (40) hide show
  1. package/README.md +205 -15
  2. package/dist/api/AdministrationApi.js +158 -0
  3. package/dist/api/LLMsApi.js +263 -0
  4. package/dist/api/MemoriesApi.js +53 -6
  5. package/dist/api/SystemApi.js +39 -5
  6. package/dist/index.js +175 -0
  7. package/dist/model/ActiveLicenseMetadata.js +140 -0
  8. package/dist/model/AdminDrainRequest.js +105 -0
  9. package/dist/model/AdminDrainResponse.js +132 -0
  10. package/dist/model/AdminPurgeJobsRequest.js +117 -0
  11. package/dist/model/AdminPurgeJobsResponse.js +138 -0
  12. package/dist/model/AdminReloadLicenseResponse.js +115 -0
  13. package/dist/model/ApiKeyAuth.js +131 -0
  14. package/dist/model/BackgroundJobAttempt.js +242 -0
  15. package/dist/model/BackgroundJobSummary.js +215 -0
  16. package/dist/model/BatchMemoryRetrievalRequest.js +9 -0
  17. package/dist/model/CreateLLMResponse.js +146 -0
  18. package/dist/model/CredentialKind.js +63 -0
  19. package/dist/model/EmbedderCreationRequest.js +11 -12
  20. package/dist/model/EndpointAuthentication.js +149 -0
  21. package/dist/model/GcpAdcAuth.js +104 -0
  22. package/dist/model/LLMCapabilities.js +132 -0
  23. package/dist/model/LLMCreationRequest.js +317 -0
  24. package/dist/model/LLMProviderType.js +83 -0
  25. package/dist/model/LLMResponse.js +366 -0
  26. package/dist/model/LLMSamplingParams.js +145 -0
  27. package/dist/model/LLMUpdateRequest.js +275 -0
  28. package/dist/model/ListLLMsResponse.js +132 -0
  29. package/dist/model/Memory.js +36 -0
  30. package/dist/model/PostProcessor.js +4 -4
  31. package/dist/model/ProcessingHistory.js +126 -0
  32. package/dist/model/ProviderType.js +15 -0
  33. package/dist/model/RerankerCreationRequest.js +7 -6
  34. package/dist/model/SecretReference.js +101 -0
  35. package/dist/model/SpaceKey.js +13 -0
  36. package/dist/model/SystemInfoResponse.js +192 -0
  37. package/dist/model/UpdateEmbedderRequest.js +7 -6
  38. package/dist/model/UpdateRerankerRequest.js +7 -6
  39. package/dist/streaming.js +246 -43
  40. package/package.json +2 -1
@@ -0,0 +1,117 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports["default"] = void 0;
7
+ var _ApiClient = _interopRequireDefault(require("../ApiClient"));
8
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
9
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
10
+ function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
11
+ function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
12
+ function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
13
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
14
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } /**
15
+ *
16
+ * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
17
+ *
18
+ * The version of the OpenAPI document:
19
+ *
20
+ *
21
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
22
+ * https://openapi-generator.tech
23
+ * Do not edit the class manually.
24
+ *
25
+ */
26
+ /**
27
+ * The AdminPurgeJobsRequest model module.
28
+ * @module model/AdminPurgeJobsRequest
29
+ * @version 1.0.0
30
+ */
31
+ var AdminPurgeJobsRequest = /*#__PURE__*/function () {
32
+ /**
33
+ * Constructs a new <code>AdminPurgeJobsRequest</code>.
34
+ * @alias module:model/AdminPurgeJobsRequest
35
+ */
36
+ function AdminPurgeJobsRequest() {
37
+ _classCallCheck(this, AdminPurgeJobsRequest);
38
+ AdminPurgeJobsRequest.initialize(this);
39
+ }
40
+
41
+ /**
42
+ * Initializes the fields of this object.
43
+ * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
44
+ * Only for internal use.
45
+ */
46
+ return _createClass(AdminPurgeJobsRequest, null, [{
47
+ key: "initialize",
48
+ value: function initialize(obj) {}
49
+
50
+ /**
51
+ * Constructs a <code>AdminPurgeJobsRequest</code> from a plain JavaScript object, optionally creating a new instance.
52
+ * Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
53
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
54
+ * @param {module:model/AdminPurgeJobsRequest} obj Optional instance to populate.
55
+ * @return {module:model/AdminPurgeJobsRequest} The populated <code>AdminPurgeJobsRequest</code> instance.
56
+ */
57
+ }, {
58
+ key: "constructFromObject",
59
+ value: function constructFromObject(data, obj) {
60
+ if (data) {
61
+ obj = obj || new AdminPurgeJobsRequest();
62
+ if (data.hasOwnProperty('olderThan')) {
63
+ obj['olderThan'] = _ApiClient["default"].convertToType(data['olderThan'], 'String');
64
+ }
65
+ if (data.hasOwnProperty('statuses')) {
66
+ obj['statuses'] = _ApiClient["default"].convertToType(data['statuses'], ['String']);
67
+ }
68
+ if (data.hasOwnProperty('dryRun')) {
69
+ obj['dryRun'] = _ApiClient["default"].convertToType(data['dryRun'], 'Boolean');
70
+ }
71
+ if (data.hasOwnProperty('limit')) {
72
+ obj['limit'] = _ApiClient["default"].convertToType(data['limit'], 'Number');
73
+ }
74
+ }
75
+ return obj;
76
+ }
77
+
78
+ /**
79
+ * Validates the JSON data with respect to <code>AdminPurgeJobsRequest</code>.
80
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
81
+ * @return {boolean} to indicate whether the JSON data is valid with respect to <code>AdminPurgeJobsRequest</code>.
82
+ */
83
+ }, {
84
+ key: "validateJSON",
85
+ value: function validateJSON(data) {
86
+ // ensure the json data is a string
87
+ if (data['olderThan'] && !(typeof data['olderThan'] === 'string' || data['olderThan'] instanceof String)) {
88
+ throw new Error("Expected the field `olderThan` to be a primitive type in the JSON string but got " + data['olderThan']);
89
+ }
90
+ // ensure the json data is an array
91
+ if (!Array.isArray(data['statuses'])) {
92
+ throw new Error("Expected the field `statuses` to be an array in the JSON data but got " + data['statuses']);
93
+ }
94
+ return true;
95
+ }
96
+ }]);
97
+ }();
98
+ /**
99
+ * @member {String} olderThan
100
+ */
101
+ AdminPurgeJobsRequest.prototype['olderThan'] = undefined;
102
+
103
+ /**
104
+ * @member {Array.<String>} statuses
105
+ */
106
+ AdminPurgeJobsRequest.prototype['statuses'] = undefined;
107
+
108
+ /**
109
+ * @member {Boolean} dryRun
110
+ */
111
+ AdminPurgeJobsRequest.prototype['dryRun'] = undefined;
112
+
113
+ /**
114
+ * @member {Number} limit
115
+ */
116
+ AdminPurgeJobsRequest.prototype['limit'] = undefined;
117
+ var _default = exports["default"] = AdminPurgeJobsRequest;
@@ -0,0 +1,138 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports["default"] = void 0;
7
+ var _ApiClient = _interopRequireDefault(require("../ApiClient"));
8
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
9
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
10
+ 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; } } }; }
11
+ 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; } }
12
+ 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; }
13
+ function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
14
+ function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
15
+ function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
16
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
17
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } /**
18
+ *
19
+ * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
20
+ *
21
+ * The version of the OpenAPI document:
22
+ *
23
+ *
24
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
25
+ * https://openapi-generator.tech
26
+ * Do not edit the class manually.
27
+ *
28
+ */
29
+ /**
30
+ * The AdminPurgeJobsResponse model module.
31
+ * @module model/AdminPurgeJobsResponse
32
+ * @version 1.0.0
33
+ */
34
+ var AdminPurgeJobsResponse = /*#__PURE__*/function () {
35
+ /**
36
+ * Constructs a new <code>AdminPurgeJobsResponse</code>.
37
+ * @alias module:model/AdminPurgeJobsResponse
38
+ * @param jobsPurged {Number}
39
+ * @param attemptsPurged {Number}
40
+ * @param referencesPurged {Number}
41
+ * @param dryRun {Boolean}
42
+ */
43
+ function AdminPurgeJobsResponse(jobsPurged, attemptsPurged, referencesPurged, dryRun) {
44
+ _classCallCheck(this, AdminPurgeJobsResponse);
45
+ AdminPurgeJobsResponse.initialize(this, jobsPurged, attemptsPurged, referencesPurged, dryRun);
46
+ }
47
+
48
+ /**
49
+ * Initializes the fields of this object.
50
+ * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
51
+ * Only for internal use.
52
+ */
53
+ return _createClass(AdminPurgeJobsResponse, null, [{
54
+ key: "initialize",
55
+ value: function initialize(obj, jobsPurged, attemptsPurged, referencesPurged, dryRun) {
56
+ obj['jobsPurged'] = jobsPurged;
57
+ obj['attemptsPurged'] = attemptsPurged;
58
+ obj['referencesPurged'] = referencesPurged;
59
+ obj['dryRun'] = dryRun;
60
+ }
61
+
62
+ /**
63
+ * Constructs a <code>AdminPurgeJobsResponse</code> from a plain JavaScript object, optionally creating a new instance.
64
+ * Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
65
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
66
+ * @param {module:model/AdminPurgeJobsResponse} obj Optional instance to populate.
67
+ * @return {module:model/AdminPurgeJobsResponse} The populated <code>AdminPurgeJobsResponse</code> instance.
68
+ */
69
+ }, {
70
+ key: "constructFromObject",
71
+ value: function constructFromObject(data, obj) {
72
+ if (data) {
73
+ obj = obj || new AdminPurgeJobsResponse();
74
+ if (data.hasOwnProperty('jobsPurged')) {
75
+ obj['jobsPurged'] = _ApiClient["default"].convertToType(data['jobsPurged'], 'Number');
76
+ }
77
+ if (data.hasOwnProperty('attemptsPurged')) {
78
+ obj['attemptsPurged'] = _ApiClient["default"].convertToType(data['attemptsPurged'], 'Number');
79
+ }
80
+ if (data.hasOwnProperty('referencesPurged')) {
81
+ obj['referencesPurged'] = _ApiClient["default"].convertToType(data['referencesPurged'], 'Number');
82
+ }
83
+ if (data.hasOwnProperty('dryRun')) {
84
+ obj['dryRun'] = _ApiClient["default"].convertToType(data['dryRun'], 'Boolean');
85
+ }
86
+ }
87
+ return obj;
88
+ }
89
+
90
+ /**
91
+ * Validates the JSON data with respect to <code>AdminPurgeJobsResponse</code>.
92
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
93
+ * @return {boolean} to indicate whether the JSON data is valid with respect to <code>AdminPurgeJobsResponse</code>.
94
+ */
95
+ }, {
96
+ key: "validateJSON",
97
+ value: function validateJSON(data) {
98
+ // check to make sure all required properties are present in the JSON string
99
+ var _iterator = _createForOfIteratorHelper(AdminPurgeJobsResponse.RequiredProperties),
100
+ _step;
101
+ try {
102
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
103
+ var property = _step.value;
104
+ if (!data.hasOwnProperty(property)) {
105
+ throw new Error("The required field `" + property + "` is not found in the JSON data: " + JSON.stringify(data));
106
+ }
107
+ }
108
+ } catch (err) {
109
+ _iterator.e(err);
110
+ } finally {
111
+ _iterator.f();
112
+ }
113
+ return true;
114
+ }
115
+ }]);
116
+ }();
117
+ AdminPurgeJobsResponse.RequiredProperties = ["jobsPurged", "attemptsPurged", "referencesPurged", "dryRun"];
118
+
119
+ /**
120
+ * @member {Number} jobsPurged
121
+ */
122
+ AdminPurgeJobsResponse.prototype['jobsPurged'] = undefined;
123
+
124
+ /**
125
+ * @member {Number} attemptsPurged
126
+ */
127
+ AdminPurgeJobsResponse.prototype['attemptsPurged'] = undefined;
128
+
129
+ /**
130
+ * @member {Number} referencesPurged
131
+ */
132
+ AdminPurgeJobsResponse.prototype['referencesPurged'] = undefined;
133
+
134
+ /**
135
+ * @member {Boolean} dryRun
136
+ */
137
+ AdminPurgeJobsResponse.prototype['dryRun'] = undefined;
138
+ var _default = exports["default"] = AdminPurgeJobsResponse;
@@ -0,0 +1,115 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports["default"] = void 0;
7
+ var _ApiClient = _interopRequireDefault(require("../ApiClient"));
8
+ var _ActiveLicenseMetadata = _interopRequireDefault(require("./ActiveLicenseMetadata"));
9
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
10
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
11
+ function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
12
+ function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
13
+ function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
14
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
15
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } /**
16
+ *
17
+ * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
18
+ *
19
+ * The version of the OpenAPI document:
20
+ *
21
+ *
22
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
23
+ * https://openapi-generator.tech
24
+ * Do not edit the class manually.
25
+ *
26
+ */
27
+ /**
28
+ * The AdminReloadLicenseResponse model module.
29
+ * @module model/AdminReloadLicenseResponse
30
+ * @version 1.0.0
31
+ */
32
+ var AdminReloadLicenseResponse = /*#__PURE__*/function () {
33
+ /**
34
+ * Constructs a new <code>AdminReloadLicenseResponse</code>.
35
+ * @alias module:model/AdminReloadLicenseResponse
36
+ */
37
+ function AdminReloadLicenseResponse() {
38
+ _classCallCheck(this, AdminReloadLicenseResponse);
39
+ AdminReloadLicenseResponse.initialize(this);
40
+ }
41
+
42
+ /**
43
+ * Initializes the fields of this object.
44
+ * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
45
+ * Only for internal use.
46
+ */
47
+ return _createClass(AdminReloadLicenseResponse, null, [{
48
+ key: "initialize",
49
+ value: function initialize(obj) {}
50
+
51
+ /**
52
+ * Constructs a <code>AdminReloadLicenseResponse</code> from a plain JavaScript object, optionally creating a new instance.
53
+ * Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
54
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
55
+ * @param {module:model/AdminReloadLicenseResponse} obj Optional instance to populate.
56
+ * @return {module:model/AdminReloadLicenseResponse} The populated <code>AdminReloadLicenseResponse</code> instance.
57
+ */
58
+ }, {
59
+ key: "constructFromObject",
60
+ value: function constructFromObject(data, obj) {
61
+ if (data) {
62
+ obj = obj || new AdminReloadLicenseResponse();
63
+ if (data.hasOwnProperty('status')) {
64
+ obj['status'] = _ApiClient["default"].convertToType(data['status'], 'String');
65
+ }
66
+ if (data.hasOwnProperty('message')) {
67
+ obj['message'] = _ApiClient["default"].convertToType(data['message'], 'String');
68
+ }
69
+ if (data.hasOwnProperty('activeLicense')) {
70
+ obj['activeLicense'] = _ActiveLicenseMetadata["default"].constructFromObject(data['activeLicense']);
71
+ }
72
+ }
73
+ return obj;
74
+ }
75
+
76
+ /**
77
+ * Validates the JSON data with respect to <code>AdminReloadLicenseResponse</code>.
78
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
79
+ * @return {boolean} to indicate whether the JSON data is valid with respect to <code>AdminReloadLicenseResponse</code>.
80
+ */
81
+ }, {
82
+ key: "validateJSON",
83
+ value: function validateJSON(data) {
84
+ // ensure the json data is a string
85
+ if (data['status'] && !(typeof data['status'] === 'string' || data['status'] instanceof String)) {
86
+ throw new Error("Expected the field `status` to be a primitive type in the JSON string but got " + data['status']);
87
+ }
88
+ // ensure the json data is a string
89
+ if (data['message'] && !(typeof data['message'] === 'string' || data['message'] instanceof String)) {
90
+ throw new Error("Expected the field `message` to be a primitive type in the JSON string but got " + data['message']);
91
+ }
92
+ // validate the optional field `activeLicense`
93
+ if (data['activeLicense']) {
94
+ // data not null
95
+ _ActiveLicenseMetadata["default"].validateJSON(data['activeLicense']);
96
+ }
97
+ return true;
98
+ }
99
+ }]);
100
+ }();
101
+ /**
102
+ * @member {String} status
103
+ */
104
+ AdminReloadLicenseResponse.prototype['status'] = undefined;
105
+
106
+ /**
107
+ * @member {String} message
108
+ */
109
+ AdminReloadLicenseResponse.prototype['message'] = undefined;
110
+
111
+ /**
112
+ * @member {module:model/ActiveLicenseMetadata} activeLicense
113
+ */
114
+ AdminReloadLicenseResponse.prototype['activeLicense'] = undefined;
115
+ var _default = exports["default"] = AdminReloadLicenseResponse;
@@ -0,0 +1,131 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports["default"] = void 0;
7
+ var _ApiClient = _interopRequireDefault(require("../ApiClient"));
8
+ var _SecretReference = _interopRequireDefault(require("./SecretReference"));
9
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
10
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
11
+ function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
12
+ function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
13
+ function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
14
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
15
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } /**
16
+ *
17
+ * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
18
+ *
19
+ * The version of the OpenAPI document:
20
+ *
21
+ *
22
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
23
+ * https://openapi-generator.tech
24
+ * Do not edit the class manually.
25
+ *
26
+ */
27
+ /**
28
+ * The ApiKeyAuth model module.
29
+ * @module model/ApiKeyAuth
30
+ * @version 1.0.0
31
+ */
32
+ var ApiKeyAuth = /*#__PURE__*/function () {
33
+ /**
34
+ * Constructs a new <code>ApiKeyAuth</code>.
35
+ * Configuration for classic API-key authentication.
36
+ * @alias module:model/ApiKeyAuth
37
+ */
38
+ function ApiKeyAuth() {
39
+ _classCallCheck(this, ApiKeyAuth);
40
+ ApiKeyAuth.initialize(this);
41
+ }
42
+
43
+ /**
44
+ * Initializes the fields of this object.
45
+ * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
46
+ * Only for internal use.
47
+ */
48
+ return _createClass(ApiKeyAuth, null, [{
49
+ key: "initialize",
50
+ value: function initialize(obj) {}
51
+
52
+ /**
53
+ * Constructs a <code>ApiKeyAuth</code> from a plain JavaScript object, optionally creating a new instance.
54
+ * Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
55
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
56
+ * @param {module:model/ApiKeyAuth} obj Optional instance to populate.
57
+ * @return {module:model/ApiKeyAuth} The populated <code>ApiKeyAuth</code> instance.
58
+ */
59
+ }, {
60
+ key: "constructFromObject",
61
+ value: function constructFromObject(data, obj) {
62
+ if (data) {
63
+ obj = obj || new ApiKeyAuth();
64
+ if (data.hasOwnProperty('inlineSecret')) {
65
+ obj['inlineSecret'] = _ApiClient["default"].convertToType(data['inlineSecret'], 'String');
66
+ }
67
+ if (data.hasOwnProperty('secretRef')) {
68
+ obj['secretRef'] = _SecretReference["default"].constructFromObject(data['secretRef']);
69
+ }
70
+ if (data.hasOwnProperty('headerName')) {
71
+ obj['headerName'] = _ApiClient["default"].convertToType(data['headerName'], 'String');
72
+ }
73
+ if (data.hasOwnProperty('prefix')) {
74
+ obj['prefix'] = _ApiClient["default"].convertToType(data['prefix'], 'String');
75
+ }
76
+ }
77
+ return obj;
78
+ }
79
+
80
+ /**
81
+ * Validates the JSON data with respect to <code>ApiKeyAuth</code>.
82
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
83
+ * @return {boolean} to indicate whether the JSON data is valid with respect to <code>ApiKeyAuth</code>.
84
+ */
85
+ }, {
86
+ key: "validateJSON",
87
+ value: function validateJSON(data) {
88
+ // ensure the json data is a string
89
+ if (data['inlineSecret'] && !(typeof data['inlineSecret'] === 'string' || data['inlineSecret'] instanceof String)) {
90
+ throw new Error("Expected the field `inlineSecret` to be a primitive type in the JSON string but got " + data['inlineSecret']);
91
+ }
92
+ // validate the optional field `secretRef`
93
+ if (data['secretRef']) {
94
+ // data not null
95
+ _SecretReference["default"].validateJSON(data['secretRef']);
96
+ }
97
+ // ensure the json data is a string
98
+ if (data['headerName'] && !(typeof data['headerName'] === 'string' || data['headerName'] instanceof String)) {
99
+ throw new Error("Expected the field `headerName` to be a primitive type in the JSON string but got " + data['headerName']);
100
+ }
101
+ // ensure the json data is a string
102
+ if (data['prefix'] && !(typeof data['prefix'] === 'string' || data['prefix'] instanceof String)) {
103
+ throw new Error("Expected the field `prefix` to be a primitive type in the JSON string but got " + data['prefix']);
104
+ }
105
+ return true;
106
+ }
107
+ }]);
108
+ }();
109
+ /**
110
+ * Secret stored directly in GoodMem (mutually exclusive with secretRef)
111
+ * @member {String} inlineSecret
112
+ */
113
+ ApiKeyAuth.prototype['inlineSecret'] = undefined;
114
+
115
+ /**
116
+ * @member {module:model/SecretReference} secretRef
117
+ */
118
+ ApiKeyAuth.prototype['secretRef'] = undefined;
119
+
120
+ /**
121
+ * Desired HTTP header to carry the credential (defaults to Authorization)
122
+ * @member {String} headerName
123
+ */
124
+ ApiKeyAuth.prototype['headerName'] = undefined;
125
+
126
+ /**
127
+ * Optional prefix prepended to the secret (e.g., \"Bearer \")
128
+ * @member {String} prefix
129
+ */
130
+ ApiKeyAuth.prototype['prefix'] = undefined;
131
+ var _default = exports["default"] = ApiKeyAuth;