@quantcdn/quant-client 2.0.12 → 3.0.0

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 (108) hide show
  1. package/README.md +49 -72
  2. package/dist/api/apis.d.ts +30 -0
  3. package/dist/api/apis.js +48 -0
  4. package/dist/api/applicationsApi.d.ts +104 -0
  5. package/dist/api/applicationsApi.js +431 -0
  6. package/dist/api/commandsApi.d.ts +80 -0
  7. package/dist/api/commandsApi.js +316 -0
  8. package/dist/api/composeApi.d.ts +66 -0
  9. package/dist/api/composeApi.js +236 -0
  10. package/dist/api/containersApi.d.ts +67 -0
  11. package/dist/api/containersApi.js +236 -0
  12. package/dist/api/cronApi.d.ts +151 -0
  13. package/dist/api/cronApi.js +681 -0
  14. package/dist/api/environmentsApi.d.ts +194 -0
  15. package/dist/api/environmentsApi.js +861 -0
  16. package/dist/api/sSHAccessApi.d.ts +50 -0
  17. package/dist/api/sSHAccessApi.js +162 -0
  18. package/dist/api/scalingPolicyApi.d.ts +82 -0
  19. package/dist/api/scalingPolicyApi.js +307 -0
  20. package/dist/api/variablesApi.d.ts +83 -0
  21. package/dist/api/variablesApi.js +313 -0
  22. package/dist/api/volumesApi.d.ts +97 -0
  23. package/dist/api/volumesApi.js +405 -0
  24. package/dist/api.d.ts +2 -0
  25. package/dist/api.js +19 -0
  26. package/dist/model/application.d.ts +38 -0
  27. package/dist/model/application.js +93 -0
  28. package/dist/model/command.d.ts +34 -0
  29. package/dist/model/command.js +73 -0
  30. package/dist/model/compose.d.ts +32 -0
  31. package/dist/model/compose.js +58 -0
  32. package/dist/model/configuration.d.ts +26 -0
  33. package/dist/model/configuration.js +30 -0
  34. package/dist/model/container.d.ts +38 -0
  35. package/dist/model/container.js +78 -0
  36. package/dist/model/containerEnvironmentInner.d.ts +26 -0
  37. package/dist/model/containerEnvironmentInner.js +33 -0
  38. package/dist/model/containerImageReference.d.ts +28 -0
  39. package/dist/model/containerImageReference.js +43 -0
  40. package/dist/model/containerMountPointsInner.d.ts +27 -0
  41. package/dist/model/containerMountPointsInner.js +38 -0
  42. package/dist/model/createApplicationRequest.d.ts +28 -0
  43. package/dist/model/createApplicationRequest.js +43 -0
  44. package/dist/model/createCommandRequest.d.ts +25 -0
  45. package/dist/model/createCommandRequest.js +28 -0
  46. package/dist/model/createCronJob422Response.d.ts +26 -0
  47. package/dist/model/createCronJob422Response.js +33 -0
  48. package/dist/model/createCronJobRequest.d.ts +30 -0
  49. package/dist/model/createCronJobRequest.js +56 -0
  50. package/dist/model/createEnvironmentRequest.d.ts +34 -0
  51. package/dist/model/createEnvironmentRequest.js +53 -0
  52. package/dist/model/cron.d.ts +27 -0
  53. package/dist/model/cron.js +38 -0
  54. package/dist/model/cronRun.d.ts +48 -0
  55. package/dist/model/cronRun.js +89 -0
  56. package/dist/model/environment.d.ts +45 -0
  57. package/dist/model/environment.js +103 -0
  58. package/dist/model/getEcrLoginCredentials200Response.d.ts +28 -0
  59. package/dist/model/getEcrLoginCredentials200Response.js +43 -0
  60. package/dist/model/getScalingPolicies200Response.d.ts +26 -0
  61. package/dist/model/getScalingPolicies200Response.js +28 -0
  62. package/dist/model/getSshAccessCredentials200Response.d.ts +34 -0
  63. package/dist/model/getSshAccessCredentials200Response.js +68 -0
  64. package/dist/model/getSshAccessCredentials200ResponseCredentials.d.ts +28 -0
  65. package/dist/model/getSshAccessCredentials200ResponseCredentials.js +43 -0
  66. package/dist/model/models.d.ts +78 -0
  67. package/dist/model/models.js +352 -0
  68. package/dist/model/scalingPolicy.d.ts +35 -0
  69. package/dist/model/scalingPolicy.js +51 -0
  70. package/dist/model/syncOperation.d.ts +31 -0
  71. package/dist/model/syncOperation.js +58 -0
  72. package/dist/model/syncToEnvironmentRequest.d.ts +25 -0
  73. package/dist/model/syncToEnvironmentRequest.js +28 -0
  74. package/dist/model/updateComposeRequest.d.ts +26 -0
  75. package/dist/model/updateComposeRequest.js +28 -0
  76. package/dist/model/updateCronJobRequest.d.ts +29 -0
  77. package/dist/model/updateCronJobRequest.js +48 -0
  78. package/dist/model/updateEnvironmentComposeRequest.d.ts +26 -0
  79. package/dist/model/updateEnvironmentComposeRequest.js +28 -0
  80. package/dist/model/updateEnvironmentRequest.d.ts +26 -0
  81. package/dist/model/updateEnvironmentRequest.js +28 -0
  82. package/dist/model/updateEnvironmentStateRequest.d.ts +26 -0
  83. package/dist/model/updateEnvironmentStateRequest.js +33 -0
  84. package/dist/model/updateEnvironmentVariableRequest.d.ts +25 -0
  85. package/dist/model/updateEnvironmentVariableRequest.js +28 -0
  86. package/dist/model/validateCompose200Response.d.ts +27 -0
  87. package/dist/model/validateCompose200Response.js +38 -0
  88. package/dist/model/validateComposeRequest.d.ts +25 -0
  89. package/dist/model/validateComposeRequest.js +28 -0
  90. package/dist/model/variable.d.ts +26 -0
  91. package/dist/model/variable.js +33 -0
  92. package/dist/model/volume.d.ts +32 -0
  93. package/dist/model/volume.js +63 -0
  94. package/package.json +21 -40
  95. package/dist/src/client.d.ts +0 -15
  96. package/dist/src/client.js +0 -380
  97. package/dist/src/index.d.ts +0 -2
  98. package/dist/src/index.js +0 -42
  99. package/dist/src/interfaces.d.ts +0 -34
  100. package/dist/src/interfaces.js +0 -2
  101. package/dist/src/response.d.ts +0 -15
  102. package/dist/src/response.js +0 -103
  103. package/dist/src/types.d.ts +0 -68
  104. package/dist/src/types.js +0 -8
  105. package/dist/tests/client.test.d.ts +0 -1
  106. package/dist/tests/client.test.js +0 -191
  107. package/dist/tests/response.test.d.ts +0 -1
  108. package/dist/tests/response.test.js +0 -133
@@ -0,0 +1,68 @@
1
+ "use strict";
2
+ /**
3
+ * QuantCloud API
4
+ * QuantCloud API
5
+ *
6
+ * The version of the OpenAPI document: 1.0.0
7
+ *
8
+ *
9
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
10
+ * https://openapi-generator.tech
11
+ * Do not edit the class manually.
12
+ */
13
+ Object.defineProperty(exports, "__esModule", { value: true });
14
+ exports.GetSshAccessCredentials200Response = void 0;
15
+ class GetSshAccessCredentials200Response {
16
+ static getAttributeTypeMap() {
17
+ return GetSshAccessCredentials200Response.attributeTypeMap;
18
+ }
19
+ }
20
+ exports.GetSshAccessCredentials200Response = GetSshAccessCredentials200Response;
21
+ GetSshAccessCredentials200Response.discriminator = undefined;
22
+ GetSshAccessCredentials200Response.attributeTypeMap = [
23
+ {
24
+ "name": "success",
25
+ "baseName": "success",
26
+ "type": "boolean"
27
+ },
28
+ {
29
+ "name": "credentials",
30
+ "baseName": "credentials",
31
+ "type": "GetSshAccessCredentials200ResponseCredentials"
32
+ },
33
+ {
34
+ "name": "clusterName",
35
+ "baseName": "clusterName",
36
+ "type": "string"
37
+ },
38
+ {
39
+ "name": "taskArn",
40
+ "baseName": "taskArn",
41
+ "type": "string"
42
+ },
43
+ {
44
+ "name": "taskId",
45
+ "baseName": "taskId",
46
+ "type": "string"
47
+ },
48
+ {
49
+ "name": "containerNames",
50
+ "baseName": "containerNames",
51
+ "type": "Array<string>"
52
+ },
53
+ {
54
+ "name": "region",
55
+ "baseName": "region",
56
+ "type": "string"
57
+ },
58
+ {
59
+ "name": "expiresIn",
60
+ "baseName": "expiresIn",
61
+ "type": "number"
62
+ },
63
+ {
64
+ "name": "organizationScope",
65
+ "baseName": "organizationScope",
66
+ "type": "string"
67
+ }
68
+ ];
@@ -0,0 +1,28 @@
1
+ /**
2
+ * QuantCloud API
3
+ * QuantCloud API
4
+ *
5
+ * The version of the OpenAPI document: 1.0.0
6
+ *
7
+ *
8
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9
+ * https://openapi-generator.tech
10
+ * Do not edit the class manually.
11
+ */
12
+ export declare class GetSshAccessCredentials200ResponseCredentials {
13
+ 'accessKeyId'?: string;
14
+ 'secretAccessKey'?: string;
15
+ 'sessionToken'?: string;
16
+ 'expiration'?: Date;
17
+ static discriminator: string | undefined;
18
+ static attributeTypeMap: Array<{
19
+ name: string;
20
+ baseName: string;
21
+ type: string;
22
+ }>;
23
+ static getAttributeTypeMap(): {
24
+ name: string;
25
+ baseName: string;
26
+ type: string;
27
+ }[];
28
+ }
@@ -0,0 +1,43 @@
1
+ "use strict";
2
+ /**
3
+ * QuantCloud API
4
+ * QuantCloud API
5
+ *
6
+ * The version of the OpenAPI document: 1.0.0
7
+ *
8
+ *
9
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
10
+ * https://openapi-generator.tech
11
+ * Do not edit the class manually.
12
+ */
13
+ Object.defineProperty(exports, "__esModule", { value: true });
14
+ exports.GetSshAccessCredentials200ResponseCredentials = void 0;
15
+ class GetSshAccessCredentials200ResponseCredentials {
16
+ static getAttributeTypeMap() {
17
+ return GetSshAccessCredentials200ResponseCredentials.attributeTypeMap;
18
+ }
19
+ }
20
+ exports.GetSshAccessCredentials200ResponseCredentials = GetSshAccessCredentials200ResponseCredentials;
21
+ GetSshAccessCredentials200ResponseCredentials.discriminator = undefined;
22
+ GetSshAccessCredentials200ResponseCredentials.attributeTypeMap = [
23
+ {
24
+ "name": "accessKeyId",
25
+ "baseName": "accessKeyId",
26
+ "type": "string"
27
+ },
28
+ {
29
+ "name": "secretAccessKey",
30
+ "baseName": "secretAccessKey",
31
+ "type": "string"
32
+ },
33
+ {
34
+ "name": "sessionToken",
35
+ "baseName": "sessionToken",
36
+ "type": "string"
37
+ },
38
+ {
39
+ "name": "expiration",
40
+ "baseName": "expiration",
41
+ "type": "Date"
42
+ }
43
+ ];
@@ -0,0 +1,78 @@
1
+ /// <reference types="node" />
2
+ /// <reference types="node" />
3
+ /// <reference types="node" />
4
+ import localVarRequest from 'request';
5
+ export * from './application';
6
+ export * from './command';
7
+ export * from './compose';
8
+ export * from './container';
9
+ export * from './containerEnvironmentInner';
10
+ export * from './containerImageReference';
11
+ export * from './containerMountPointsInner';
12
+ export * from './createCommandRequest';
13
+ export * from './createCronJob422Response';
14
+ export * from './createCronJobRequest';
15
+ export * from './createEnvironmentRequest';
16
+ export * from './cron';
17
+ export * from './cronRun';
18
+ export * from './environment';
19
+ export * from './getEcrLoginCredentials200Response';
20
+ export * from './getSshAccessCredentials200Response';
21
+ export * from './getSshAccessCredentials200ResponseCredentials';
22
+ export * from './scalingPolicy';
23
+ export * from './syncOperation';
24
+ export * from './syncToEnvironmentRequest';
25
+ export * from './updateCronJobRequest';
26
+ export * from './updateEnvironmentRequest';
27
+ export * from './updateEnvironmentStateRequest';
28
+ export * from './updateEnvironmentVariableRequest';
29
+ export * from './validateCompose200Response';
30
+ export * from './validateComposeRequest';
31
+ export * from './variable';
32
+ export * from './volume';
33
+ import * as fs from 'fs';
34
+ export interface RequestDetailedFile {
35
+ value: Buffer;
36
+ options?: {
37
+ filename?: string;
38
+ contentType?: string;
39
+ };
40
+ }
41
+ export type RequestFile = string | Buffer | fs.ReadStream | RequestDetailedFile;
42
+ export declare class ObjectSerializer {
43
+ static findCorrectType(data: any, expectedType: string): any;
44
+ static serialize(data: any, type: string): any;
45
+ static deserialize(data: any, type: string): any;
46
+ }
47
+ export interface Authentication {
48
+ /**
49
+ * Apply authentication settings to header and query params.
50
+ */
51
+ applyToRequest(requestOptions: localVarRequest.Options): Promise<void> | void;
52
+ }
53
+ export declare class HttpBasicAuth implements Authentication {
54
+ username: string;
55
+ password: string;
56
+ applyToRequest(requestOptions: localVarRequest.Options): void;
57
+ }
58
+ export declare class HttpBearerAuth implements Authentication {
59
+ accessToken: string | (() => string);
60
+ applyToRequest(requestOptions: localVarRequest.Options): void;
61
+ }
62
+ export declare class ApiKeyAuth implements Authentication {
63
+ private location;
64
+ private paramName;
65
+ apiKey: string;
66
+ constructor(location: string, paramName: string);
67
+ applyToRequest(requestOptions: localVarRequest.Options): void;
68
+ }
69
+ export declare class OAuth implements Authentication {
70
+ accessToken: string;
71
+ applyToRequest(requestOptions: localVarRequest.Options): void;
72
+ }
73
+ export declare class VoidAuth implements Authentication {
74
+ username: string;
75
+ password: string;
76
+ applyToRequest(_: localVarRequest.Options): void;
77
+ }
78
+ export type Interceptor = (requestOptions: localVarRequest.Options) => (Promise<void> | void);
@@ -0,0 +1,352 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ exports.VoidAuth = exports.OAuth = exports.ApiKeyAuth = exports.HttpBearerAuth = exports.HttpBasicAuth = exports.ObjectSerializer = void 0;
18
+ __exportStar(require("./application"), exports);
19
+ __exportStar(require("./command"), exports);
20
+ __exportStar(require("./compose"), exports);
21
+ __exportStar(require("./container"), exports);
22
+ __exportStar(require("./containerEnvironmentInner"), exports);
23
+ __exportStar(require("./containerImageReference"), exports);
24
+ __exportStar(require("./containerMountPointsInner"), exports);
25
+ __exportStar(require("./createCommandRequest"), exports);
26
+ __exportStar(require("./createCronJob422Response"), exports);
27
+ __exportStar(require("./createCronJobRequest"), exports);
28
+ __exportStar(require("./createEnvironmentRequest"), exports);
29
+ __exportStar(require("./cron"), exports);
30
+ __exportStar(require("./cronRun"), exports);
31
+ __exportStar(require("./environment"), exports);
32
+ __exportStar(require("./getEcrLoginCredentials200Response"), exports);
33
+ __exportStar(require("./getSshAccessCredentials200Response"), exports);
34
+ __exportStar(require("./getSshAccessCredentials200ResponseCredentials"), exports);
35
+ __exportStar(require("./scalingPolicy"), exports);
36
+ __exportStar(require("./syncOperation"), exports);
37
+ __exportStar(require("./syncToEnvironmentRequest"), exports);
38
+ __exportStar(require("./updateCronJobRequest"), exports);
39
+ __exportStar(require("./updateEnvironmentRequest"), exports);
40
+ __exportStar(require("./updateEnvironmentStateRequest"), exports);
41
+ __exportStar(require("./updateEnvironmentVariableRequest"), exports);
42
+ __exportStar(require("./validateCompose200Response"), exports);
43
+ __exportStar(require("./validateComposeRequest"), exports);
44
+ __exportStar(require("./variable"), exports);
45
+ __exportStar(require("./volume"), exports);
46
+ const application_1 = require("./application");
47
+ const command_1 = require("./command");
48
+ const compose_1 = require("./compose");
49
+ const container_1 = require("./container");
50
+ const containerEnvironmentInner_1 = require("./containerEnvironmentInner");
51
+ const containerImageReference_1 = require("./containerImageReference");
52
+ const containerMountPointsInner_1 = require("./containerMountPointsInner");
53
+ const createCommandRequest_1 = require("./createCommandRequest");
54
+ const createCronJob422Response_1 = require("./createCronJob422Response");
55
+ const createCronJobRequest_1 = require("./createCronJobRequest");
56
+ const createEnvironmentRequest_1 = require("./createEnvironmentRequest");
57
+ const cron_1 = require("./cron");
58
+ const cronRun_1 = require("./cronRun");
59
+ const environment_1 = require("./environment");
60
+ const getEcrLoginCredentials200Response_1 = require("./getEcrLoginCredentials200Response");
61
+ const getSshAccessCredentials200Response_1 = require("./getSshAccessCredentials200Response");
62
+ const getSshAccessCredentials200ResponseCredentials_1 = require("./getSshAccessCredentials200ResponseCredentials");
63
+ const scalingPolicy_1 = require("./scalingPolicy");
64
+ const syncOperation_1 = require("./syncOperation");
65
+ const syncToEnvironmentRequest_1 = require("./syncToEnvironmentRequest");
66
+ const updateCronJobRequest_1 = require("./updateCronJobRequest");
67
+ const updateEnvironmentRequest_1 = require("./updateEnvironmentRequest");
68
+ const updateEnvironmentStateRequest_1 = require("./updateEnvironmentStateRequest");
69
+ const updateEnvironmentVariableRequest_1 = require("./updateEnvironmentVariableRequest");
70
+ const validateCompose200Response_1 = require("./validateCompose200Response");
71
+ const validateComposeRequest_1 = require("./validateComposeRequest");
72
+ const variable_1 = require("./variable");
73
+ const volume_1 = require("./volume");
74
+ /* tslint:disable:no-unused-variable */
75
+ let primitives = [
76
+ "string",
77
+ "boolean",
78
+ "double",
79
+ "integer",
80
+ "long",
81
+ "float",
82
+ "number",
83
+ "any"
84
+ ];
85
+ let enumsMap = {
86
+ "CronRun.RunTypeEnum": cronRun_1.CronRun.RunTypeEnum,
87
+ "CronRun.StatusEnum": cronRun_1.CronRun.StatusEnum,
88
+ "ScalingPolicy.MetricEnum": scalingPolicy_1.ScalingPolicy.MetricEnum,
89
+ };
90
+ let typeMap = {
91
+ "Application": application_1.Application,
92
+ "Command": command_1.Command,
93
+ "Compose": compose_1.Compose,
94
+ "Container": container_1.Container,
95
+ "ContainerEnvironmentInner": containerEnvironmentInner_1.ContainerEnvironmentInner,
96
+ "ContainerImageReference": containerImageReference_1.ContainerImageReference,
97
+ "ContainerMountPointsInner": containerMountPointsInner_1.ContainerMountPointsInner,
98
+ "CreateCommandRequest": createCommandRequest_1.CreateCommandRequest,
99
+ "CreateCronJob422Response": createCronJob422Response_1.CreateCronJob422Response,
100
+ "CreateCronJobRequest": createCronJobRequest_1.CreateCronJobRequest,
101
+ "CreateEnvironmentRequest": createEnvironmentRequest_1.CreateEnvironmentRequest,
102
+ "Cron": cron_1.Cron,
103
+ "CronRun": cronRun_1.CronRun,
104
+ "Environment": environment_1.Environment,
105
+ "GetEcrLoginCredentials200Response": getEcrLoginCredentials200Response_1.GetEcrLoginCredentials200Response,
106
+ "GetSshAccessCredentials200Response": getSshAccessCredentials200Response_1.GetSshAccessCredentials200Response,
107
+ "GetSshAccessCredentials200ResponseCredentials": getSshAccessCredentials200ResponseCredentials_1.GetSshAccessCredentials200ResponseCredentials,
108
+ "ScalingPolicy": scalingPolicy_1.ScalingPolicy,
109
+ "SyncOperation": syncOperation_1.SyncOperation,
110
+ "SyncToEnvironmentRequest": syncToEnvironmentRequest_1.SyncToEnvironmentRequest,
111
+ "UpdateCronJobRequest": updateCronJobRequest_1.UpdateCronJobRequest,
112
+ "UpdateEnvironmentRequest": updateEnvironmentRequest_1.UpdateEnvironmentRequest,
113
+ "UpdateEnvironmentStateRequest": updateEnvironmentStateRequest_1.UpdateEnvironmentStateRequest,
114
+ "UpdateEnvironmentVariableRequest": updateEnvironmentVariableRequest_1.UpdateEnvironmentVariableRequest,
115
+ "ValidateCompose200Response": validateCompose200Response_1.ValidateCompose200Response,
116
+ "ValidateComposeRequest": validateComposeRequest_1.ValidateComposeRequest,
117
+ "Variable": variable_1.Variable,
118
+ "Volume": volume_1.Volume,
119
+ };
120
+ // Check if a string starts with another string without using es6 features
121
+ function startsWith(str, match) {
122
+ return str.substring(0, match.length) === match;
123
+ }
124
+ // Check if a string ends with another string without using es6 features
125
+ function endsWith(str, match) {
126
+ return str.length >= match.length && str.substring(str.length - match.length) === match;
127
+ }
128
+ const nullableSuffix = " | null";
129
+ const optionalSuffix = " | undefined";
130
+ const arrayPrefix = "Array<";
131
+ const arraySuffix = ">";
132
+ const mapPrefix = "{ [key: string]: ";
133
+ const mapSuffix = "; }";
134
+ class ObjectSerializer {
135
+ static findCorrectType(data, expectedType) {
136
+ if (data == undefined) {
137
+ return expectedType;
138
+ }
139
+ else if (primitives.indexOf(expectedType.toLowerCase()) !== -1) {
140
+ return expectedType;
141
+ }
142
+ else if (expectedType === "Date") {
143
+ return expectedType;
144
+ }
145
+ else {
146
+ if (enumsMap[expectedType]) {
147
+ return expectedType;
148
+ }
149
+ if (!typeMap[expectedType]) {
150
+ return expectedType; // w/e we don't know the type
151
+ }
152
+ // Check the discriminator
153
+ let discriminatorProperty = typeMap[expectedType].discriminator;
154
+ if (discriminatorProperty == null) {
155
+ return expectedType; // the type does not have a discriminator. use it.
156
+ }
157
+ else {
158
+ if (data[discriminatorProperty]) {
159
+ var discriminatorType = data[discriminatorProperty];
160
+ if (typeMap[discriminatorType]) {
161
+ return discriminatorType; // use the type given in the discriminator
162
+ }
163
+ else {
164
+ return expectedType; // discriminator did not map to a type
165
+ }
166
+ }
167
+ else {
168
+ return expectedType; // discriminator was not present (or an empty string)
169
+ }
170
+ }
171
+ }
172
+ }
173
+ static serialize(data, type) {
174
+ if (data == undefined) {
175
+ return data;
176
+ }
177
+ else if (primitives.indexOf(type.toLowerCase()) !== -1) {
178
+ return data;
179
+ }
180
+ else if (endsWith(type, nullableSuffix)) {
181
+ let subType = type.slice(0, -nullableSuffix.length); // Type | null => Type
182
+ return ObjectSerializer.serialize(data, subType);
183
+ }
184
+ else if (endsWith(type, optionalSuffix)) {
185
+ let subType = type.slice(0, -optionalSuffix.length); // Type | undefined => Type
186
+ return ObjectSerializer.serialize(data, subType);
187
+ }
188
+ else if (startsWith(type, arrayPrefix)) {
189
+ let subType = type.slice(arrayPrefix.length, -arraySuffix.length); // Array<Type> => Type
190
+ let transformedData = [];
191
+ for (let index = 0; index < data.length; index++) {
192
+ let datum = data[index];
193
+ transformedData.push(ObjectSerializer.serialize(datum, subType));
194
+ }
195
+ return transformedData;
196
+ }
197
+ else if (startsWith(type, mapPrefix)) {
198
+ let subType = type.slice(mapPrefix.length, -mapSuffix.length); // { [key: string]: Type; } => Type
199
+ let transformedData = {};
200
+ for (let key in data) {
201
+ transformedData[key] = ObjectSerializer.serialize(data[key], subType);
202
+ }
203
+ return transformedData;
204
+ }
205
+ else if (type === "Date") {
206
+ return data.toISOString();
207
+ }
208
+ else {
209
+ if (enumsMap[type]) {
210
+ return data;
211
+ }
212
+ if (!typeMap[type]) { // in case we dont know the type
213
+ return data;
214
+ }
215
+ // Get the actual type of this object
216
+ type = this.findCorrectType(data, type);
217
+ // get the map for the correct type.
218
+ let attributeTypes = typeMap[type].getAttributeTypeMap();
219
+ let instance = {};
220
+ for (let index = 0; index < attributeTypes.length; index++) {
221
+ let attributeType = attributeTypes[index];
222
+ instance[attributeType.baseName] = ObjectSerializer.serialize(data[attributeType.name], attributeType.type);
223
+ }
224
+ return instance;
225
+ }
226
+ }
227
+ static deserialize(data, type) {
228
+ // polymorphism may change the actual type.
229
+ type = ObjectSerializer.findCorrectType(data, type);
230
+ if (data == undefined) {
231
+ return data;
232
+ }
233
+ else if (primitives.indexOf(type.toLowerCase()) !== -1) {
234
+ return data;
235
+ }
236
+ else if (endsWith(type, nullableSuffix)) {
237
+ let subType = type.slice(0, -nullableSuffix.length); // Type | null => Type
238
+ return ObjectSerializer.deserialize(data, subType);
239
+ }
240
+ else if (endsWith(type, optionalSuffix)) {
241
+ let subType = type.slice(0, -optionalSuffix.length); // Type | undefined => Type
242
+ return ObjectSerializer.deserialize(data, subType);
243
+ }
244
+ else if (startsWith(type, arrayPrefix)) {
245
+ let subType = type.slice(arrayPrefix.length, -arraySuffix.length); // Array<Type> => Type
246
+ let transformedData = [];
247
+ for (let index = 0; index < data.length; index++) {
248
+ let datum = data[index];
249
+ transformedData.push(ObjectSerializer.deserialize(datum, subType));
250
+ }
251
+ return transformedData;
252
+ }
253
+ else if (startsWith(type, mapPrefix)) {
254
+ let subType = type.slice(mapPrefix.length, -mapSuffix.length); // { [key: string]: Type; } => Type
255
+ let transformedData = {};
256
+ for (let key in data) {
257
+ transformedData[key] = ObjectSerializer.deserialize(data[key], subType);
258
+ }
259
+ return transformedData;
260
+ }
261
+ else if (type === "Date") {
262
+ return new Date(data);
263
+ }
264
+ else {
265
+ if (enumsMap[type]) { // is Enum
266
+ return data;
267
+ }
268
+ if (!typeMap[type]) { // dont know the type
269
+ return data;
270
+ }
271
+ let instance = new typeMap[type]();
272
+ let attributeTypes = typeMap[type].getAttributeTypeMap();
273
+ for (let index = 0; index < attributeTypes.length; index++) {
274
+ let attributeType = attributeTypes[index];
275
+ instance[attributeType.name] = ObjectSerializer.deserialize(data[attributeType.baseName], attributeType.type);
276
+ }
277
+ return instance;
278
+ }
279
+ }
280
+ }
281
+ exports.ObjectSerializer = ObjectSerializer;
282
+ class HttpBasicAuth {
283
+ constructor() {
284
+ this.username = '';
285
+ this.password = '';
286
+ }
287
+ applyToRequest(requestOptions) {
288
+ requestOptions.auth = {
289
+ username: this.username, password: this.password
290
+ };
291
+ }
292
+ }
293
+ exports.HttpBasicAuth = HttpBasicAuth;
294
+ class HttpBearerAuth {
295
+ constructor() {
296
+ this.accessToken = '';
297
+ }
298
+ applyToRequest(requestOptions) {
299
+ if (requestOptions && requestOptions.headers) {
300
+ const accessToken = typeof this.accessToken === 'function'
301
+ ? this.accessToken()
302
+ : this.accessToken;
303
+ requestOptions.headers["Authorization"] = "Bearer " + accessToken;
304
+ }
305
+ }
306
+ }
307
+ exports.HttpBearerAuth = HttpBearerAuth;
308
+ class ApiKeyAuth {
309
+ constructor(location, paramName) {
310
+ this.location = location;
311
+ this.paramName = paramName;
312
+ this.apiKey = '';
313
+ }
314
+ applyToRequest(requestOptions) {
315
+ if (this.location == "query") {
316
+ requestOptions.qs[this.paramName] = this.apiKey;
317
+ }
318
+ else if (this.location == "header" && requestOptions && requestOptions.headers) {
319
+ requestOptions.headers[this.paramName] = this.apiKey;
320
+ }
321
+ else if (this.location == 'cookie' && requestOptions && requestOptions.headers) {
322
+ if (requestOptions.headers['Cookie']) {
323
+ requestOptions.headers['Cookie'] += '; ' + this.paramName + '=' + encodeURIComponent(this.apiKey);
324
+ }
325
+ else {
326
+ requestOptions.headers['Cookie'] = this.paramName + '=' + encodeURIComponent(this.apiKey);
327
+ }
328
+ }
329
+ }
330
+ }
331
+ exports.ApiKeyAuth = ApiKeyAuth;
332
+ class OAuth {
333
+ constructor() {
334
+ this.accessToken = '';
335
+ }
336
+ applyToRequest(requestOptions) {
337
+ if (requestOptions && requestOptions.headers) {
338
+ requestOptions.headers["Authorization"] = "Bearer " + this.accessToken;
339
+ }
340
+ }
341
+ }
342
+ exports.OAuth = OAuth;
343
+ class VoidAuth {
344
+ constructor() {
345
+ this.username = '';
346
+ this.password = '';
347
+ }
348
+ applyToRequest(_) {
349
+ // Do nothing
350
+ }
351
+ }
352
+ exports.VoidAuth = VoidAuth;
@@ -0,0 +1,35 @@
1
+ /**
2
+ * QuantCloud API
3
+ * QuantCloud API
4
+ *
5
+ * The version of the OpenAPI document: 1.0.0
6
+ *
7
+ *
8
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9
+ * https://openapi-generator.tech
10
+ * Do not edit the class manually.
11
+ */
12
+ export declare class ScalingPolicy {
13
+ 'metric'?: ScalingPolicy.MetricEnum;
14
+ 'targetValue'?: number;
15
+ 'scaleInCooldownSeconds'?: number;
16
+ 'scaleOutCooldownSeconds'?: number;
17
+ static discriminator: string | undefined;
18
+ static attributeTypeMap: Array<{
19
+ name: string;
20
+ baseName: string;
21
+ type: string;
22
+ }>;
23
+ static getAttributeTypeMap(): {
24
+ name: string;
25
+ baseName: string;
26
+ type: string;
27
+ }[];
28
+ }
29
+ export declare namespace ScalingPolicy {
30
+ enum MetricEnum {
31
+ CpuUtilization,
32
+ MemoryUtilization,
33
+ Rps
34
+ }
35
+ }
@@ -0,0 +1,51 @@
1
+ "use strict";
2
+ /**
3
+ * QuantCloud API
4
+ * QuantCloud API
5
+ *
6
+ * The version of the OpenAPI document: 1.0.0
7
+ *
8
+ *
9
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
10
+ * https://openapi-generator.tech
11
+ * Do not edit the class manually.
12
+ */
13
+ Object.defineProperty(exports, "__esModule", { value: true });
14
+ exports.ScalingPolicy = void 0;
15
+ class ScalingPolicy {
16
+ static getAttributeTypeMap() {
17
+ return ScalingPolicy.attributeTypeMap;
18
+ }
19
+ }
20
+ exports.ScalingPolicy = ScalingPolicy;
21
+ ScalingPolicy.discriminator = undefined;
22
+ ScalingPolicy.attributeTypeMap = [
23
+ {
24
+ "name": "metric",
25
+ "baseName": "metric",
26
+ "type": "ScalingPolicy.MetricEnum"
27
+ },
28
+ {
29
+ "name": "targetValue",
30
+ "baseName": "targetValue",
31
+ "type": "number"
32
+ },
33
+ {
34
+ "name": "scaleInCooldownSeconds",
35
+ "baseName": "scaleInCooldownSeconds",
36
+ "type": "number"
37
+ },
38
+ {
39
+ "name": "scaleOutCooldownSeconds",
40
+ "baseName": "scaleOutCooldownSeconds",
41
+ "type": "number"
42
+ }
43
+ ];
44
+ (function (ScalingPolicy) {
45
+ let MetricEnum;
46
+ (function (MetricEnum) {
47
+ MetricEnum[MetricEnum["CpuUtilization"] = 'CPUUtilization'] = "CpuUtilization";
48
+ MetricEnum[MetricEnum["MemoryUtilization"] = 'MemoryUtilization'] = "MemoryUtilization";
49
+ MetricEnum[MetricEnum["Rps"] = 'RPS'] = "Rps";
50
+ })(MetricEnum = ScalingPolicy.MetricEnum || (ScalingPolicy.MetricEnum = {}));
51
+ })(ScalingPolicy = exports.ScalingPolicy || (exports.ScalingPolicy = {}));