vayu-ts 0.3.4 → 0.3.7

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 (172) hide show
  1. package/dist/openapi/apis/AuthApi.js +8 -4
  2. package/dist/openapi/apis/CatalogProductsApi.js +46 -23
  3. package/dist/openapi/apis/CloudUsageSubmissionApi.js +8 -4
  4. package/dist/openapi/apis/ContractsApi.js +48 -22
  5. package/dist/openapi/apis/CreditsApi.js +24 -12
  6. package/dist/openapi/apis/CustomFieldsApi.d.ts +89 -0
  7. package/dist/openapi/apis/CustomFieldsApi.js +377 -0
  8. package/dist/openapi/apis/CustomersApi.js +124 -52
  9. package/dist/openapi/apis/EventsApi.d.ts +116 -1
  10. package/dist/openapi/apis/EventsApi.js +605 -25
  11. package/dist/openapi/apis/InvoicesApi.js +26 -13
  12. package/dist/openapi/apis/MeasurementsApi.js +36 -18
  13. package/dist/openapi/apis/MetersApi.js +38 -19
  14. package/dist/openapi/apis/PlansApi.d.ts +56 -0
  15. package/dist/openapi/apis/PlansApi.js +225 -0
  16. package/dist/openapi/apis/ProductConsumptionsApi.js +12 -4
  17. package/dist/openapi/apis/WebhooksApi.js +12 -4
  18. package/dist/openapi/index.d.ts +1 -1
  19. package/dist/openapi/index.js +3 -1
  20. package/dist/openapi/models/BillingInterval.d.ts +18 -0
  21. package/dist/openapi/models/BillingInterval.js +22 -0
  22. package/dist/openapi/models/ConflictErrorResponse.d.ts +42 -0
  23. package/dist/openapi/models/ConflictErrorResponse.js +52 -0
  24. package/dist/openapi/models/Contact.js +1 -1
  25. package/dist/openapi/models/CreateContractRequest.d.ts +6 -0
  26. package/dist/openapi/models/CreateContractRequest.js +12 -0
  27. package/dist/openapi/models/CreateCustomFieldRequest.d.ts +71 -0
  28. package/dist/openapi/models/CreateCustomFieldRequest.js +90 -0
  29. package/dist/openapi/models/CreateCustomFieldResponse.d.ts +32 -0
  30. package/dist/openapi/models/CreateCustomFieldResponse.js +32 -0
  31. package/dist/openapi/models/CreateCustomFieldResponseCustomField.d.ts +74 -0
  32. package/dist/openapi/models/CreateCustomFieldResponseCustomField.js +108 -0
  33. package/dist/openapi/models/CreateCustomerRequest.d.ts +20 -0
  34. package/dist/openapi/models/CreateCustomerRequest.js +30 -0
  35. package/dist/openapi/models/CreateCustomerResponseCustomer.d.ts +20 -0
  36. package/dist/openapi/models/CreateCustomerResponseCustomer.js +30 -0
  37. package/dist/openapi/models/CustomFieldEntities.d.ts +20 -0
  38. package/dist/openapi/models/CustomFieldEntities.js +24 -0
  39. package/dist/openapi/models/CustomFieldValueTypes.d.ts +2 -1
  40. package/dist/openapi/models/CustomFieldValueTypes.js +1 -0
  41. package/dist/openapi/models/DeleteContractResponseContract.d.ts +6 -0
  42. package/dist/openapi/models/DeleteContractResponseContract.js +12 -0
  43. package/dist/openapi/models/DeleteCustomFieldResponse.d.ts +32 -0
  44. package/dist/openapi/models/DeleteCustomFieldResponse.js +32 -0
  45. package/dist/openapi/models/DeleteCustomFieldResponseCustomField.d.ts +75 -0
  46. package/dist/openapi/models/DeleteCustomFieldResponseCustomField.js +114 -0
  47. package/dist/openapi/models/DeleteCustomerResponseCustomer.d.ts +20 -0
  48. package/dist/openapi/models/DeleteCustomerResponseCustomer.js +30 -0
  49. package/dist/openapi/models/DeletePlanResponse.d.ts +32 -0
  50. package/dist/openapi/models/DeletePlanResponse.js +32 -0
  51. package/dist/openapi/models/DeletePlanResponsePlan.d.ts +42 -0
  52. package/dist/openapi/models/DeletePlanResponsePlan.js +68 -0
  53. package/dist/openapi/models/EventsDryRunResponseObjectMeterWithValuesInner.d.ts +1 -1
  54. package/dist/openapi/models/GetContractResponseContract.d.ts +6 -0
  55. package/dist/openapi/models/GetContractResponseContract.js +12 -0
  56. package/dist/openapi/models/GetCustomFieldResponse.d.ts +32 -0
  57. package/dist/openapi/models/GetCustomFieldResponse.js +32 -0
  58. package/dist/openapi/models/GetCustomerByNameResponseCustomer.d.ts +20 -0
  59. package/dist/openapi/models/GetCustomerByNameResponseCustomer.js +30 -0
  60. package/dist/openapi/models/GetPlanResponse.d.ts +32 -0
  61. package/dist/openapi/models/GetPlanResponse.js +32 -0
  62. package/dist/openapi/models/GetPlanResponsePlan.d.ts +41 -0
  63. package/dist/openapi/models/GetPlanResponsePlan.js +62 -0
  64. package/dist/openapi/models/InternalServerErrorResponse.d.ts +42 -0
  65. package/dist/openapi/models/InternalServerErrorResponse.js +52 -0
  66. package/dist/openapi/models/ListCustomFieldsResponse.d.ts +35 -0
  67. package/dist/openapi/models/ListCustomFieldsResponse.js +50 -0
  68. package/dist/openapi/models/ListPlansResponse.d.ts +35 -0
  69. package/dist/openapi/models/ListPlansResponse.js +50 -0
  70. package/dist/openapi/models/NotFoundErrorResponse.d.ts +42 -0
  71. package/dist/openapi/models/NotFoundErrorResponse.js +52 -0
  72. package/dist/openapi/models/NotificationEventType.d.ts +5 -1
  73. package/dist/openapi/models/NotificationEventType.js +4 -0
  74. package/dist/openapi/models/ObjectSerializer.d.ts +51 -0
  75. package/dist/openapi/models/ObjectSerializer.js +176 -0
  76. package/dist/openapi/models/PlanBillingData.d.ts +41 -0
  77. package/dist/openapi/models/PlanBillingData.js +59 -0
  78. package/dist/openapi/models/PlanDuration.d.ts +30 -0
  79. package/dist/openapi/models/PlanDuration.js +25 -0
  80. package/dist/openapi/models/PlanStatus.d.ts +19 -0
  81. package/dist/openapi/models/PlanStatus.js +23 -0
  82. package/dist/openapi/models/ProductGroupCommitment.d.ts +8 -0
  83. package/dist/openapi/models/ProductGroupCommitment.js +12 -1
  84. package/dist/openapi/models/ProductGroupProductsInnerCommitment.d.ts +8 -0
  85. package/dist/openapi/models/ProductGroupProductsInnerCommitment.js +12 -1
  86. package/dist/openapi/models/ProductGroupProductsInnerCommitmentScheduling.d.ts +4 -4
  87. package/dist/openapi/models/ProductGroupProductsInnerCommitmentScheduling.js +2 -2
  88. package/dist/openapi/models/ProductGroupProductsInnerCommitmentSchedulingDuration.d.ts +41 -0
  89. package/dist/openapi/models/ProductGroupProductsInnerCommitmentSchedulingDuration.js +48 -0
  90. package/dist/openapi/models/ProductGroupProductsInnerPricing.d.ts +3 -1
  91. package/dist/openapi/models/ProductGroupProductsInnerPricingOneOf.d.ts +6 -0
  92. package/dist/openapi/models/ProductGroupProductsInnerPricingOneOf.js +12 -0
  93. package/dist/openapi/models/ProductGroupProductsInnerPricingOneOf1.d.ts +2 -0
  94. package/dist/openapi/models/ProductGroupProductsInnerPricingOneOf1.js +6 -0
  95. package/dist/openapi/models/ProductGroupProductsInnerPricingOneOf2.d.ts +2 -0
  96. package/dist/openapi/models/ProductGroupProductsInnerPricingOneOf2.js +6 -0
  97. package/dist/openapi/models/ProductGroupProductsInnerPricingOneOf5.d.ts +42 -0
  98. package/dist/openapi/models/ProductGroupProductsInnerPricingOneOf5.js +48 -0
  99. package/dist/openapi/models/ProductGroupProductsInnerPricingOneOf6.d.ts +42 -0
  100. package/dist/openapi/models/ProductGroupProductsInnerPricingOneOf6.js +48 -0
  101. package/dist/openapi/models/ProductGroupProductsInnerPricingOneOfDiscount.d.ts +53 -0
  102. package/dist/openapi/models/ProductGroupProductsInnerPricingOneOfDiscount.js +58 -0
  103. package/dist/openapi/models/QueryEventsResponse.d.ts +3 -3
  104. package/dist/openapi/models/QueryEventsResponse.js +18 -0
  105. package/dist/openapi/models/RateLimitErrorResponse.d.ts +42 -0
  106. package/dist/openapi/models/RateLimitErrorResponse.js +52 -0
  107. package/dist/openapi/models/RequestTooLongErrorResponse.d.ts +42 -0
  108. package/dist/openapi/models/RequestTooLongErrorResponse.js +52 -0
  109. package/dist/openapi/models/UnauthorizedErrorResponse.d.ts +42 -0
  110. package/dist/openapi/models/UnauthorizedErrorResponse.js +52 -0
  111. package/dist/openapi/models/UnlimitedDuration.d.ts +14 -0
  112. package/dist/openapi/models/UnlimitedDuration.js +18 -0
  113. package/dist/openapi/models/UpdateCustomFieldRequest.d.ts +71 -0
  114. package/dist/openapi/models/UpdateCustomFieldRequest.js +90 -0
  115. package/dist/openapi/models/UpdateCustomFieldResponse.d.ts +32 -0
  116. package/dist/openapi/models/UpdateCustomFieldResponse.js +32 -0
  117. package/dist/openapi/models/UpdateCustomerRequest.d.ts +20 -0
  118. package/dist/openapi/models/UpdateCustomerRequest.js +30 -0
  119. package/dist/openapi/models/V2DeleteEventResponse.d.ts +32 -0
  120. package/dist/openapi/models/V2DeleteEventResponse.js +32 -0
  121. package/dist/openapi/models/V2DeleteEventsByRefsRequest.d.ts +31 -0
  122. package/dist/openapi/models/V2DeleteEventsByRefsRequest.js +32 -0
  123. package/dist/openapi/models/V2DeleteEventsByRefsResponse.d.ts +35 -0
  124. package/dist/openapi/models/V2DeleteEventsByRefsResponse.js +32 -0
  125. package/dist/openapi/models/V2EventsDryRunRequest.d.ts +32 -0
  126. package/dist/openapi/models/V2EventsDryRunRequest.js +32 -0
  127. package/dist/openapi/models/V2EventsDryRunResponse.d.ts +32 -0
  128. package/dist/openapi/models/V2EventsDryRunResponse.js +32 -0
  129. package/dist/openapi/models/V2GetEventResponse.d.ts +32 -0
  130. package/dist/openapi/models/V2GetEventResponse.js +32 -0
  131. package/dist/openapi/models/V2QueryEventsAggregationRequest.d.ts +45 -0
  132. package/dist/openapi/models/V2QueryEventsAggregationRequest.js +70 -0
  133. package/dist/openapi/models/V2QueryEventsAggregationRequestMetersInner.d.ts +39 -0
  134. package/dist/openapi/models/V2QueryEventsAggregationRequestMetersInner.js +62 -0
  135. package/dist/openapi/models/V2QueryEventsAggregationRequestMetersInnerAggregation.d.ts +35 -0
  136. package/dist/openapi/models/V2QueryEventsAggregationRequestMetersInnerAggregation.js +44 -0
  137. package/dist/openapi/models/V2QueryEventsAggregationRequestMetersInnerAggregationFieldArithmetic.d.ts +38 -0
  138. package/dist/openapi/models/V2QueryEventsAggregationRequestMetersInnerAggregationFieldArithmetic.js +45 -0
  139. package/dist/openapi/models/V2QueryEventsAggregationRequestMetersInnerFiltersInner.d.ts +43 -0
  140. package/dist/openapi/models/V2QueryEventsAggregationRequestMetersInnerFiltersInner.js +54 -0
  141. package/dist/openapi/models/V2QueryEventsAggregationRequestMetersInnerFiltersInnerValue.d.ts +30 -0
  142. package/dist/openapi/models/V2QueryEventsAggregationRequestMetersInnerFiltersInnerValue.js +25 -0
  143. package/dist/openapi/models/V2QueryEventsAggregationRequestMetersInnerSqlFullQuery.d.ts +34 -0
  144. package/dist/openapi/models/V2QueryEventsAggregationRequestMetersInnerSqlFullQuery.js +38 -0
  145. package/dist/openapi/models/V2QueryEventsAggregationRequestPeriod.d.ts +32 -0
  146. package/dist/openapi/models/V2QueryEventsAggregationRequestPeriod.js +38 -0
  147. package/dist/openapi/models/V2QueryEventsAggregationResponse.d.ts +42 -0
  148. package/dist/openapi/models/V2QueryEventsAggregationResponse.js +52 -0
  149. package/dist/openapi/models/V2QueryEventsAggregationResponseDataPointsInner.d.ts +34 -0
  150. package/dist/openapi/models/V2QueryEventsAggregationResponseDataPointsInner.js +38 -0
  151. package/dist/openapi/models/V2QueryEventsResponse.d.ts +35 -0
  152. package/dist/openapi/models/V2QueryEventsResponse.js +50 -0
  153. package/dist/openapi/models/V2SendEventsRequest.d.ts +32 -0
  154. package/dist/openapi/models/V2SendEventsRequest.js +32 -0
  155. package/dist/openapi/models/V2SendEventsResponse.d.ts +40 -0
  156. package/dist/openapi/models/V2SendEventsResponse.js +38 -0
  157. package/dist/openapi/models/ValidationErrorResponse.d.ts +51 -0
  158. package/dist/openapi/models/ValidationErrorResponse.js +60 -0
  159. package/dist/openapi/models/ValidationErrorResponseParamsInner.d.ts +38 -0
  160. package/dist/openapi/models/ValidationErrorResponseParamsInner.js +38 -0
  161. package/dist/openapi/models/WebhookSubscribeRequest.d.ts +1 -0
  162. package/dist/openapi/models/WebhookSubscribeRequest.js +6 -0
  163. package/dist/openapi/models/all.d.ts +51 -0
  164. package/dist/openapi/models/all.js +51 -0
  165. package/dist/openapi/types/ObservableAPI.d.ts +235 -2
  166. package/dist/openapi/types/ObservableAPI.js +476 -5
  167. package/dist/openapi/types/PromiseAPI.d.ts +231 -2
  168. package/dist/openapi/types/PromiseAPI.js +320 -18
  169. package/dist/sdk/clients/EventsClient.js +1 -1
  170. package/dist/sdk/clients/WebhooksClient.d.ts +2 -0
  171. package/dist/sdk/clients/WebhooksClient.js +14 -0
  172. package/package.json +1 -1
@@ -124,19 +124,24 @@ class InvoicesApiResponseProcessor {
124
124
  return new http_1.HttpInfo(response.httpStatusCode, response.headers, response.body, body);
125
125
  }
126
126
  if ((0, util_1.isCodeInRange)("400", response.httpStatusCode)) {
127
- throw new exception_1.ApiException(response.httpStatusCode, "Bad Request", undefined, response.headers);
127
+ const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(await response.body.text(), contentType), "ValidationErrorResponse", "");
128
+ throw new exception_1.ApiException(response.httpStatusCode, "Bad Request", body, response.headers);
128
129
  }
129
130
  if ((0, util_1.isCodeInRange)("401", response.httpStatusCode)) {
130
- throw new exception_1.ApiException(response.httpStatusCode, "Unauthorized", undefined, response.headers);
131
+ const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(await response.body.text(), contentType), "UnauthorizedErrorResponse", "");
132
+ throw new exception_1.ApiException(response.httpStatusCode, "Unauthorized", body, response.headers);
131
133
  }
132
134
  if ((0, util_1.isCodeInRange)("404", response.httpStatusCode)) {
133
- throw new exception_1.ApiException(response.httpStatusCode, "Not Found", undefined, response.headers);
135
+ const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(await response.body.text(), contentType), "NotFoundErrorResponse", "");
136
+ throw new exception_1.ApiException(response.httpStatusCode, "Not Found", body, response.headers);
134
137
  }
135
138
  if ((0, util_1.isCodeInRange)("429", response.httpStatusCode)) {
136
- throw new exception_1.ApiException(response.httpStatusCode, "Too Many Requests", undefined, response.headers);
139
+ const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(await response.body.text(), contentType), "RateLimitErrorResponse", "");
140
+ throw new exception_1.ApiException(response.httpStatusCode, "Too Many Requests", body, response.headers);
137
141
  }
138
142
  if ((0, util_1.isCodeInRange)("500", response.httpStatusCode)) {
139
- throw new exception_1.ApiException(response.httpStatusCode, "Internal Server Error", undefined, response.headers);
143
+ const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(await response.body.text(), contentType), "InternalServerErrorResponse", "");
144
+ throw new exception_1.ApiException(response.httpStatusCode, "Internal Server Error", body, response.headers);
140
145
  }
141
146
  // Work around for missing responses in specification, e.g. for petstore.yaml
142
147
  if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) {
@@ -159,16 +164,20 @@ class InvoicesApiResponseProcessor {
159
164
  return new http_1.HttpInfo(response.httpStatusCode, response.headers, response.body, body);
160
165
  }
161
166
  if ((0, util_1.isCodeInRange)("400", response.httpStatusCode)) {
162
- throw new exception_1.ApiException(response.httpStatusCode, "Bad Request", undefined, response.headers);
167
+ const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(await response.body.text(), contentType), "ValidationErrorResponse", "");
168
+ throw new exception_1.ApiException(response.httpStatusCode, "Bad Request", body, response.headers);
163
169
  }
164
170
  if ((0, util_1.isCodeInRange)("401", response.httpStatusCode)) {
165
- throw new exception_1.ApiException(response.httpStatusCode, "Unauthorized", undefined, response.headers);
171
+ const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(await response.body.text(), contentType), "UnauthorizedErrorResponse", "");
172
+ throw new exception_1.ApiException(response.httpStatusCode, "Unauthorized", body, response.headers);
166
173
  }
167
174
  if ((0, util_1.isCodeInRange)("429", response.httpStatusCode)) {
168
- throw new exception_1.ApiException(response.httpStatusCode, "Too Many Requests", undefined, response.headers);
175
+ const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(await response.body.text(), contentType), "RateLimitErrorResponse", "");
176
+ throw new exception_1.ApiException(response.httpStatusCode, "Too Many Requests", body, response.headers);
169
177
  }
170
178
  if ((0, util_1.isCodeInRange)("500", response.httpStatusCode)) {
171
- throw new exception_1.ApiException(response.httpStatusCode, "Internal Server Error", undefined, response.headers);
179
+ const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(await response.body.text(), contentType), "InternalServerErrorResponse", "");
180
+ throw new exception_1.ApiException(response.httpStatusCode, "Internal Server Error", body, response.headers);
172
181
  }
173
182
  // Work around for missing responses in specification, e.g. for petstore.yaml
174
183
  if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) {
@@ -191,16 +200,20 @@ class InvoicesApiResponseProcessor {
191
200
  return new http_1.HttpInfo(response.httpStatusCode, response.headers, response.body, body);
192
201
  }
193
202
  if ((0, util_1.isCodeInRange)("400", response.httpStatusCode)) {
194
- throw new exception_1.ApiException(response.httpStatusCode, "Bad Request", undefined, response.headers);
203
+ const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(await response.body.text(), contentType), "ValidationErrorResponse", "");
204
+ throw new exception_1.ApiException(response.httpStatusCode, "Bad Request", body, response.headers);
195
205
  }
196
206
  if ((0, util_1.isCodeInRange)("401", response.httpStatusCode)) {
197
- throw new exception_1.ApiException(response.httpStatusCode, "Unauthorized", undefined, response.headers);
207
+ const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(await response.body.text(), contentType), "UnauthorizedErrorResponse", "");
208
+ throw new exception_1.ApiException(response.httpStatusCode, "Unauthorized", body, response.headers);
198
209
  }
199
210
  if ((0, util_1.isCodeInRange)("429", response.httpStatusCode)) {
200
- throw new exception_1.ApiException(response.httpStatusCode, "Too Many Requests", undefined, response.headers);
211
+ const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(await response.body.text(), contentType), "RateLimitErrorResponse", "");
212
+ throw new exception_1.ApiException(response.httpStatusCode, "Too Many Requests", body, response.headers);
201
213
  }
202
214
  if ((0, util_1.isCodeInRange)("500", response.httpStatusCode)) {
203
- throw new exception_1.ApiException(response.httpStatusCode, "Internal Server Error", undefined, response.headers);
215
+ const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(await response.body.text(), contentType), "InternalServerErrorResponse", "");
216
+ throw new exception_1.ApiException(response.httpStatusCode, "Internal Server Error", body, response.headers);
204
217
  }
205
218
  // Work around for missing responses in specification, e.g. for petstore.yaml
206
219
  if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) {
@@ -154,16 +154,20 @@ class MeasurementsApiResponseProcessor {
154
154
  return new http_1.HttpInfo(response.httpStatusCode, response.headers, response.body, body);
155
155
  }
156
156
  if ((0, util_1.isCodeInRange)("400", response.httpStatusCode)) {
157
- throw new exception_1.ApiException(response.httpStatusCode, "Bad Request", undefined, response.headers);
157
+ const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(await response.body.text(), contentType), "ValidationErrorResponse", "");
158
+ throw new exception_1.ApiException(response.httpStatusCode, "Bad Request", body, response.headers);
158
159
  }
159
160
  if ((0, util_1.isCodeInRange)("401", response.httpStatusCode)) {
160
- throw new exception_1.ApiException(response.httpStatusCode, "Unauthorized", undefined, response.headers);
161
+ const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(await response.body.text(), contentType), "UnauthorizedErrorResponse", "");
162
+ throw new exception_1.ApiException(response.httpStatusCode, "Unauthorized", body, response.headers);
161
163
  }
162
164
  if ((0, util_1.isCodeInRange)("429", response.httpStatusCode)) {
163
- throw new exception_1.ApiException(response.httpStatusCode, "Too Many Requests", undefined, response.headers);
165
+ const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(await response.body.text(), contentType), "RateLimitErrorResponse", "");
166
+ throw new exception_1.ApiException(response.httpStatusCode, "Too Many Requests", body, response.headers);
164
167
  }
165
168
  if ((0, util_1.isCodeInRange)("500", response.httpStatusCode)) {
166
- throw new exception_1.ApiException(response.httpStatusCode, "Internal Server Error", undefined, response.headers);
169
+ const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(await response.body.text(), contentType), "InternalServerErrorResponse", "");
170
+ throw new exception_1.ApiException(response.httpStatusCode, "Internal Server Error", body, response.headers);
167
171
  }
168
172
  // Work around for missing responses in specification, e.g. for petstore.yaml
169
173
  if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) {
@@ -186,19 +190,24 @@ class MeasurementsApiResponseProcessor {
186
190
  return new http_1.HttpInfo(response.httpStatusCode, response.headers, response.body, body);
187
191
  }
188
192
  if ((0, util_1.isCodeInRange)("400", response.httpStatusCode)) {
189
- throw new exception_1.ApiException(response.httpStatusCode, "Bad Request", undefined, response.headers);
193
+ const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(await response.body.text(), contentType), "ValidationErrorResponse", "");
194
+ throw new exception_1.ApiException(response.httpStatusCode, "Bad Request", body, response.headers);
190
195
  }
191
196
  if ((0, util_1.isCodeInRange)("401", response.httpStatusCode)) {
192
- throw new exception_1.ApiException(response.httpStatusCode, "Unauthorized", undefined, response.headers);
197
+ const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(await response.body.text(), contentType), "UnauthorizedErrorResponse", "");
198
+ throw new exception_1.ApiException(response.httpStatusCode, "Unauthorized", body, response.headers);
193
199
  }
194
200
  if ((0, util_1.isCodeInRange)("404", response.httpStatusCode)) {
195
- throw new exception_1.ApiException(response.httpStatusCode, "Not Found", undefined, response.headers);
201
+ const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(await response.body.text(), contentType), "NotFoundErrorResponse", "");
202
+ throw new exception_1.ApiException(response.httpStatusCode, "Not Found", body, response.headers);
196
203
  }
197
204
  if ((0, util_1.isCodeInRange)("429", response.httpStatusCode)) {
198
- throw new exception_1.ApiException(response.httpStatusCode, "Too Many Requests", undefined, response.headers);
205
+ const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(await response.body.text(), contentType), "RateLimitErrorResponse", "");
206
+ throw new exception_1.ApiException(response.httpStatusCode, "Too Many Requests", body, response.headers);
199
207
  }
200
208
  if ((0, util_1.isCodeInRange)("500", response.httpStatusCode)) {
201
- throw new exception_1.ApiException(response.httpStatusCode, "Internal Server Error", undefined, response.headers);
209
+ const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(await response.body.text(), contentType), "InternalServerErrorResponse", "");
210
+ throw new exception_1.ApiException(response.httpStatusCode, "Internal Server Error", body, response.headers);
202
211
  }
203
212
  // Work around for missing responses in specification, e.g. for petstore.yaml
204
213
  if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) {
@@ -221,19 +230,24 @@ class MeasurementsApiResponseProcessor {
221
230
  return new http_1.HttpInfo(response.httpStatusCode, response.headers, response.body, body);
222
231
  }
223
232
  if ((0, util_1.isCodeInRange)("400", response.httpStatusCode)) {
224
- throw new exception_1.ApiException(response.httpStatusCode, "Bad Request", undefined, response.headers);
233
+ const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(await response.body.text(), contentType), "ValidationErrorResponse", "");
234
+ throw new exception_1.ApiException(response.httpStatusCode, "Bad Request", body, response.headers);
225
235
  }
226
236
  if ((0, util_1.isCodeInRange)("401", response.httpStatusCode)) {
227
- throw new exception_1.ApiException(response.httpStatusCode, "Unauthorized", undefined, response.headers);
237
+ const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(await response.body.text(), contentType), "UnauthorizedErrorResponse", "");
238
+ throw new exception_1.ApiException(response.httpStatusCode, "Unauthorized", body, response.headers);
228
239
  }
229
240
  if ((0, util_1.isCodeInRange)("404", response.httpStatusCode)) {
230
- throw new exception_1.ApiException(response.httpStatusCode, "Not Found", undefined, response.headers);
241
+ const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(await response.body.text(), contentType), "NotFoundErrorResponse", "");
242
+ throw new exception_1.ApiException(response.httpStatusCode, "Not Found", body, response.headers);
231
243
  }
232
244
  if ((0, util_1.isCodeInRange)("429", response.httpStatusCode)) {
233
- throw new exception_1.ApiException(response.httpStatusCode, "Too Many Requests", undefined, response.headers);
245
+ const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(await response.body.text(), contentType), "RateLimitErrorResponse", "");
246
+ throw new exception_1.ApiException(response.httpStatusCode, "Too Many Requests", body, response.headers);
234
247
  }
235
248
  if ((0, util_1.isCodeInRange)("500", response.httpStatusCode)) {
236
- throw new exception_1.ApiException(response.httpStatusCode, "Internal Server Error", undefined, response.headers);
249
+ const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(await response.body.text(), contentType), "InternalServerErrorResponse", "");
250
+ throw new exception_1.ApiException(response.httpStatusCode, "Internal Server Error", body, response.headers);
237
251
  }
238
252
  // Work around for missing responses in specification, e.g. for petstore.yaml
239
253
  if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) {
@@ -256,16 +270,20 @@ class MeasurementsApiResponseProcessor {
256
270
  return new http_1.HttpInfo(response.httpStatusCode, response.headers, response.body, body);
257
271
  }
258
272
  if ((0, util_1.isCodeInRange)("400", response.httpStatusCode)) {
259
- throw new exception_1.ApiException(response.httpStatusCode, "Bad Request", undefined, response.headers);
273
+ const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(await response.body.text(), contentType), "ValidationErrorResponse", "");
274
+ throw new exception_1.ApiException(response.httpStatusCode, "Bad Request", body, response.headers);
260
275
  }
261
276
  if ((0, util_1.isCodeInRange)("401", response.httpStatusCode)) {
262
- throw new exception_1.ApiException(response.httpStatusCode, "Unauthorized", undefined, response.headers);
277
+ const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(await response.body.text(), contentType), "UnauthorizedErrorResponse", "");
278
+ throw new exception_1.ApiException(response.httpStatusCode, "Unauthorized", body, response.headers);
263
279
  }
264
280
  if ((0, util_1.isCodeInRange)("429", response.httpStatusCode)) {
265
- throw new exception_1.ApiException(response.httpStatusCode, "Too Many Requests", undefined, response.headers);
281
+ const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(await response.body.text(), contentType), "RateLimitErrorResponse", "");
282
+ throw new exception_1.ApiException(response.httpStatusCode, "Too Many Requests", body, response.headers);
266
283
  }
267
284
  if ((0, util_1.isCodeInRange)("500", response.httpStatusCode)) {
268
- throw new exception_1.ApiException(response.httpStatusCode, "Internal Server Error", undefined, response.headers);
285
+ const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(await response.body.text(), contentType), "InternalServerErrorResponse", "");
286
+ throw new exception_1.ApiException(response.httpStatusCode, "Internal Server Error", body, response.headers);
269
287
  }
270
288
  // Work around for missing responses in specification, e.g. for petstore.yaml
271
289
  if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) {
@@ -160,19 +160,24 @@ class MetersApiResponseProcessor {
160
160
  return new http_1.HttpInfo(response.httpStatusCode, response.headers, response.body, body);
161
161
  }
162
162
  if ((0, util_1.isCodeInRange)("400", response.httpStatusCode)) {
163
- throw new exception_1.ApiException(response.httpStatusCode, "Bad Request", undefined, response.headers);
163
+ const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(await response.body.text(), contentType), "ValidationErrorResponse", "");
164
+ throw new exception_1.ApiException(response.httpStatusCode, "Bad Request", body, response.headers);
164
165
  }
165
166
  if ((0, util_1.isCodeInRange)("401", response.httpStatusCode)) {
166
- throw new exception_1.ApiException(response.httpStatusCode, "Unauthorized", undefined, response.headers);
167
+ const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(await response.body.text(), contentType), "UnauthorizedErrorResponse", "");
168
+ throw new exception_1.ApiException(response.httpStatusCode, "Unauthorized", body, response.headers);
167
169
  }
168
170
  if ((0, util_1.isCodeInRange)("404", response.httpStatusCode)) {
169
- throw new exception_1.ApiException(response.httpStatusCode, "Not Found", undefined, response.headers);
171
+ const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(await response.body.text(), contentType), "NotFoundErrorResponse", "");
172
+ throw new exception_1.ApiException(response.httpStatusCode, "Not Found", body, response.headers);
170
173
  }
171
174
  if ((0, util_1.isCodeInRange)("429", response.httpStatusCode)) {
172
- throw new exception_1.ApiException(response.httpStatusCode, "Too Many Requests", undefined, response.headers);
175
+ const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(await response.body.text(), contentType), "RateLimitErrorResponse", "");
176
+ throw new exception_1.ApiException(response.httpStatusCode, "Too Many Requests", body, response.headers);
173
177
  }
174
178
  if ((0, util_1.isCodeInRange)("500", response.httpStatusCode)) {
175
- throw new exception_1.ApiException(response.httpStatusCode, "Internal Server Error", undefined, response.headers);
179
+ const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(await response.body.text(), contentType), "InternalServerErrorResponse", "");
180
+ throw new exception_1.ApiException(response.httpStatusCode, "Internal Server Error", body, response.headers);
176
181
  }
177
182
  // Work around for missing responses in specification, e.g. for petstore.yaml
178
183
  if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) {
@@ -195,19 +200,24 @@ class MetersApiResponseProcessor {
195
200
  return new http_1.HttpInfo(response.httpStatusCode, response.headers, response.body, body);
196
201
  }
197
202
  if ((0, util_1.isCodeInRange)("400", response.httpStatusCode)) {
198
- throw new exception_1.ApiException(response.httpStatusCode, "Bad Request", undefined, response.headers);
203
+ const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(await response.body.text(), contentType), "ValidationErrorResponse", "");
204
+ throw new exception_1.ApiException(response.httpStatusCode, "Bad Request", body, response.headers);
199
205
  }
200
206
  if ((0, util_1.isCodeInRange)("401", response.httpStatusCode)) {
201
- throw new exception_1.ApiException(response.httpStatusCode, "Unauthorized", undefined, response.headers);
207
+ const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(await response.body.text(), contentType), "UnauthorizedErrorResponse", "");
208
+ throw new exception_1.ApiException(response.httpStatusCode, "Unauthorized", body, response.headers);
202
209
  }
203
210
  if ((0, util_1.isCodeInRange)("404", response.httpStatusCode)) {
204
- throw new exception_1.ApiException(response.httpStatusCode, "Not Found", undefined, response.headers);
211
+ const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(await response.body.text(), contentType), "NotFoundErrorResponse", "");
212
+ throw new exception_1.ApiException(response.httpStatusCode, "Not Found", body, response.headers);
205
213
  }
206
214
  if ((0, util_1.isCodeInRange)("429", response.httpStatusCode)) {
207
- throw new exception_1.ApiException(response.httpStatusCode, "Too Many Requests", undefined, response.headers);
215
+ const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(await response.body.text(), contentType), "RateLimitErrorResponse", "");
216
+ throw new exception_1.ApiException(response.httpStatusCode, "Too Many Requests", body, response.headers);
208
217
  }
209
218
  if ((0, util_1.isCodeInRange)("500", response.httpStatusCode)) {
210
- throw new exception_1.ApiException(response.httpStatusCode, "Internal Server Error", undefined, response.headers);
219
+ const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(await response.body.text(), contentType), "InternalServerErrorResponse", "");
220
+ throw new exception_1.ApiException(response.httpStatusCode, "Internal Server Error", body, response.headers);
211
221
  }
212
222
  // Work around for missing responses in specification, e.g. for petstore.yaml
213
223
  if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) {
@@ -230,16 +240,20 @@ class MetersApiResponseProcessor {
230
240
  return new http_1.HttpInfo(response.httpStatusCode, response.headers, response.body, body);
231
241
  }
232
242
  if ((0, util_1.isCodeInRange)("400", response.httpStatusCode)) {
233
- throw new exception_1.ApiException(response.httpStatusCode, "Bad Request", undefined, response.headers);
243
+ const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(await response.body.text(), contentType), "ValidationErrorResponse", "");
244
+ throw new exception_1.ApiException(response.httpStatusCode, "Bad Request", body, response.headers);
234
245
  }
235
246
  if ((0, util_1.isCodeInRange)("401", response.httpStatusCode)) {
236
- throw new exception_1.ApiException(response.httpStatusCode, "Unauthorized", undefined, response.headers);
247
+ const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(await response.body.text(), contentType), "UnauthorizedErrorResponse", "");
248
+ throw new exception_1.ApiException(response.httpStatusCode, "Unauthorized", body, response.headers);
237
249
  }
238
250
  if ((0, util_1.isCodeInRange)("429", response.httpStatusCode)) {
239
- throw new exception_1.ApiException(response.httpStatusCode, "Too Many Requests", undefined, response.headers);
251
+ const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(await response.body.text(), contentType), "RateLimitErrorResponse", "");
252
+ throw new exception_1.ApiException(response.httpStatusCode, "Too Many Requests", body, response.headers);
240
253
  }
241
254
  if ((0, util_1.isCodeInRange)("500", response.httpStatusCode)) {
242
- throw new exception_1.ApiException(response.httpStatusCode, "Internal Server Error", undefined, response.headers);
255
+ const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(await response.body.text(), contentType), "InternalServerErrorResponse", "");
256
+ throw new exception_1.ApiException(response.httpStatusCode, "Internal Server Error", body, response.headers);
243
257
  }
244
258
  // Work around for missing responses in specification, e.g. for petstore.yaml
245
259
  if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) {
@@ -262,19 +276,24 @@ class MetersApiResponseProcessor {
262
276
  return new http_1.HttpInfo(response.httpStatusCode, response.headers, response.body, body);
263
277
  }
264
278
  if ((0, util_1.isCodeInRange)("400", response.httpStatusCode)) {
265
- throw new exception_1.ApiException(response.httpStatusCode, "Bad Request", undefined, response.headers);
279
+ const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(await response.body.text(), contentType), "ValidationErrorResponse", "");
280
+ throw new exception_1.ApiException(response.httpStatusCode, "Bad Request", body, response.headers);
266
281
  }
267
282
  if ((0, util_1.isCodeInRange)("401", response.httpStatusCode)) {
268
- throw new exception_1.ApiException(response.httpStatusCode, "Unauthorized", undefined, response.headers);
283
+ const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(await response.body.text(), contentType), "UnauthorizedErrorResponse", "");
284
+ throw new exception_1.ApiException(response.httpStatusCode, "Unauthorized", body, response.headers);
269
285
  }
270
286
  if ((0, util_1.isCodeInRange)("404", response.httpStatusCode)) {
271
- throw new exception_1.ApiException(response.httpStatusCode, "Not Found", undefined, response.headers);
287
+ const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(await response.body.text(), contentType), "NotFoundErrorResponse", "");
288
+ throw new exception_1.ApiException(response.httpStatusCode, "Not Found", body, response.headers);
272
289
  }
273
290
  if ((0, util_1.isCodeInRange)("429", response.httpStatusCode)) {
274
- throw new exception_1.ApiException(response.httpStatusCode, "Too Many Requests", undefined, response.headers);
291
+ const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(await response.body.text(), contentType), "RateLimitErrorResponse", "");
292
+ throw new exception_1.ApiException(response.httpStatusCode, "Too Many Requests", body, response.headers);
275
293
  }
276
294
  if ((0, util_1.isCodeInRange)("500", response.httpStatusCode)) {
277
- throw new exception_1.ApiException(response.httpStatusCode, "Internal Server Error", undefined, response.headers);
295
+ const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(await response.body.text(), contentType), "InternalServerErrorResponse", "");
296
+ throw new exception_1.ApiException(response.httpStatusCode, "Internal Server Error", body, response.headers);
278
297
  }
279
298
  // Work around for missing responses in specification, e.g. for petstore.yaml
280
299
  if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) {
@@ -0,0 +1,56 @@
1
+ import { BaseAPIRequestFactory } from './baseapi';
2
+ import { Configuration } from '../configuration';
3
+ import { RequestContext, ResponseContext, HttpInfo } from '../http/http';
4
+ import { DeletePlanResponse } from '../models/DeletePlanResponse';
5
+ import { GetPlanResponse } from '../models/GetPlanResponse';
6
+ import { ListPlansResponse } from '../models/ListPlansResponse';
7
+ /**
8
+ * no description
9
+ */
10
+ export declare class PlansApiRequestFactory extends BaseAPIRequestFactory {
11
+ /**
12
+ * Delete a Plan by id.
13
+ * Delete Plan
14
+ * @param planId
15
+ */
16
+ deletePlan(planId: string, _options?: Configuration): Promise<RequestContext>;
17
+ /**
18
+ * Get a Plan by id.
19
+ * Get Plan
20
+ * @param planId
21
+ */
22
+ getPlan(planId: string, _options?: Configuration): Promise<RequestContext>;
23
+ /**
24
+ * Get a list of Plans.
25
+ * List Plans
26
+ * @param limit
27
+ * @param cursor
28
+ */
29
+ listPlans(limit?: number, cursor?: string, _options?: Configuration): Promise<RequestContext>;
30
+ }
31
+ export declare class PlansApiResponseProcessor {
32
+ /**
33
+ * Unwraps the actual response sent by the server from the response context and deserializes the response content
34
+ * to the expected objects
35
+ *
36
+ * @params response Response returned by the server for a request to deletePlan
37
+ * @throws ApiException if the response code was not in [200, 299]
38
+ */
39
+ deletePlanWithHttpInfo(response: ResponseContext): Promise<HttpInfo<DeletePlanResponse>>;
40
+ /**
41
+ * Unwraps the actual response sent by the server from the response context and deserializes the response content
42
+ * to the expected objects
43
+ *
44
+ * @params response Response returned by the server for a request to getPlan
45
+ * @throws ApiException if the response code was not in [200, 299]
46
+ */
47
+ getPlanWithHttpInfo(response: ResponseContext): Promise<HttpInfo<GetPlanResponse>>;
48
+ /**
49
+ * Unwraps the actual response sent by the server from the response context and deserializes the response content
50
+ * to the expected objects
51
+ *
52
+ * @params response Response returned by the server for a request to listPlans
53
+ * @throws ApiException if the response code was not in [200, 299]
54
+ */
55
+ listPlansWithHttpInfo(response: ResponseContext): Promise<HttpInfo<ListPlansResponse>>;
56
+ }
@@ -0,0 +1,225 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PlansApiResponseProcessor = exports.PlansApiRequestFactory = void 0;
4
+ // TODO: better import syntax?
5
+ const baseapi_1 = require("./baseapi");
6
+ const http_1 = require("../http/http");
7
+ const ObjectSerializer_1 = require("../models/ObjectSerializer");
8
+ const exception_1 = require("./exception");
9
+ const util_1 = require("../util");
10
+ /**
11
+ * no description
12
+ */
13
+ class PlansApiRequestFactory extends baseapi_1.BaseAPIRequestFactory {
14
+ /**
15
+ * Delete a Plan by id.
16
+ * Delete Plan
17
+ * @param planId
18
+ */
19
+ async deletePlan(planId, _options) {
20
+ let _config = _options || this.configuration;
21
+ // verify required parameter 'planId' is not null or undefined
22
+ if (planId === null || planId === undefined) {
23
+ throw new baseapi_1.RequiredError("PlansApi", "deletePlan", "planId");
24
+ }
25
+ // Path Params
26
+ const localVarPath = '/plans/{planId}'
27
+ .replace('{' + 'planId' + '}', encodeURIComponent(String(planId)));
28
+ // Make Request Context
29
+ const requestContext = _config.baseServer.makeRequestContext(localVarPath, http_1.HttpMethod.DELETE);
30
+ requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8");
31
+ let authMethod;
32
+ // Apply auth methods
33
+ authMethod = _config.authMethods["BearerAuthorizer"];
34
+ if (authMethod?.applySecurityAuthentication) {
35
+ await authMethod?.applySecurityAuthentication(requestContext);
36
+ }
37
+ const defaultAuth = _options?.authMethods?.default || this.configuration?.authMethods?.default;
38
+ if (defaultAuth?.applySecurityAuthentication) {
39
+ await defaultAuth?.applySecurityAuthentication(requestContext);
40
+ }
41
+ return requestContext;
42
+ }
43
+ /**
44
+ * Get a Plan by id.
45
+ * Get Plan
46
+ * @param planId
47
+ */
48
+ async getPlan(planId, _options) {
49
+ let _config = _options || this.configuration;
50
+ // verify required parameter 'planId' is not null or undefined
51
+ if (planId === null || planId === undefined) {
52
+ throw new baseapi_1.RequiredError("PlansApi", "getPlan", "planId");
53
+ }
54
+ // Path Params
55
+ const localVarPath = '/plans/{planId}'
56
+ .replace('{' + 'planId' + '}', encodeURIComponent(String(planId)));
57
+ // Make Request Context
58
+ const requestContext = _config.baseServer.makeRequestContext(localVarPath, http_1.HttpMethod.GET);
59
+ requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8");
60
+ let authMethod;
61
+ // Apply auth methods
62
+ authMethod = _config.authMethods["BearerAuthorizer"];
63
+ if (authMethod?.applySecurityAuthentication) {
64
+ await authMethod?.applySecurityAuthentication(requestContext);
65
+ }
66
+ const defaultAuth = _options?.authMethods?.default || this.configuration?.authMethods?.default;
67
+ if (defaultAuth?.applySecurityAuthentication) {
68
+ await defaultAuth?.applySecurityAuthentication(requestContext);
69
+ }
70
+ return requestContext;
71
+ }
72
+ /**
73
+ * Get a list of Plans.
74
+ * List Plans
75
+ * @param limit
76
+ * @param cursor
77
+ */
78
+ async listPlans(limit, cursor, _options) {
79
+ let _config = _options || this.configuration;
80
+ // Path Params
81
+ const localVarPath = '/plans';
82
+ // Make Request Context
83
+ const requestContext = _config.baseServer.makeRequestContext(localVarPath, http_1.HttpMethod.GET);
84
+ requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8");
85
+ // Query Params
86
+ if (limit !== undefined) {
87
+ requestContext.setQueryParam("limit", ObjectSerializer_1.ObjectSerializer.serialize(limit, "number", ""));
88
+ }
89
+ // Query Params
90
+ if (cursor !== undefined) {
91
+ requestContext.setQueryParam("cursor", ObjectSerializer_1.ObjectSerializer.serialize(cursor, "string", ""));
92
+ }
93
+ let authMethod;
94
+ // Apply auth methods
95
+ authMethod = _config.authMethods["BearerAuthorizer"];
96
+ if (authMethod?.applySecurityAuthentication) {
97
+ await authMethod?.applySecurityAuthentication(requestContext);
98
+ }
99
+ const defaultAuth = _options?.authMethods?.default || this.configuration?.authMethods?.default;
100
+ if (defaultAuth?.applySecurityAuthentication) {
101
+ await defaultAuth?.applySecurityAuthentication(requestContext);
102
+ }
103
+ return requestContext;
104
+ }
105
+ }
106
+ exports.PlansApiRequestFactory = PlansApiRequestFactory;
107
+ class PlansApiResponseProcessor {
108
+ /**
109
+ * Unwraps the actual response sent by the server from the response context and deserializes the response content
110
+ * to the expected objects
111
+ *
112
+ * @params response Response returned by the server for a request to deletePlan
113
+ * @throws ApiException if the response code was not in [200, 299]
114
+ */
115
+ async deletePlanWithHttpInfo(response) {
116
+ const contentType = ObjectSerializer_1.ObjectSerializer.normalizeMediaType(response.headers["content-type"]);
117
+ if ((0, util_1.isCodeInRange)("200", response.httpStatusCode)) {
118
+ const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(await response.body.text(), contentType), "DeletePlanResponse", "");
119
+ return new http_1.HttpInfo(response.httpStatusCode, response.headers, response.body, body);
120
+ }
121
+ if ((0, util_1.isCodeInRange)("400", response.httpStatusCode)) {
122
+ const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(await response.body.text(), contentType), "ValidationErrorResponse", "");
123
+ throw new exception_1.ApiException(response.httpStatusCode, "Bad Request", body, response.headers);
124
+ }
125
+ if ((0, util_1.isCodeInRange)("401", response.httpStatusCode)) {
126
+ const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(await response.body.text(), contentType), "UnauthorizedErrorResponse", "");
127
+ throw new exception_1.ApiException(response.httpStatusCode, "Unauthorized", body, response.headers);
128
+ }
129
+ if ((0, util_1.isCodeInRange)("404", response.httpStatusCode)) {
130
+ const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(await response.body.text(), contentType), "NotFoundErrorResponse", "");
131
+ throw new exception_1.ApiException(response.httpStatusCode, "Not Found", body, response.headers);
132
+ }
133
+ if ((0, util_1.isCodeInRange)("429", response.httpStatusCode)) {
134
+ const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(await response.body.text(), contentType), "RateLimitErrorResponse", "");
135
+ throw new exception_1.ApiException(response.httpStatusCode, "Too Many Requests", body, response.headers);
136
+ }
137
+ if ((0, util_1.isCodeInRange)("500", response.httpStatusCode)) {
138
+ const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(await response.body.text(), contentType), "InternalServerErrorResponse", "");
139
+ throw new exception_1.ApiException(response.httpStatusCode, "Internal Server Error", body, response.headers);
140
+ }
141
+ // Work around for missing responses in specification, e.g. for petstore.yaml
142
+ if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) {
143
+ const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(await response.body.text(), contentType), "DeletePlanResponse", "");
144
+ return new http_1.HttpInfo(response.httpStatusCode, response.headers, response.body, body);
145
+ }
146
+ throw new exception_1.ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers);
147
+ }
148
+ /**
149
+ * Unwraps the actual response sent by the server from the response context and deserializes the response content
150
+ * to the expected objects
151
+ *
152
+ * @params response Response returned by the server for a request to getPlan
153
+ * @throws ApiException if the response code was not in [200, 299]
154
+ */
155
+ async getPlanWithHttpInfo(response) {
156
+ const contentType = ObjectSerializer_1.ObjectSerializer.normalizeMediaType(response.headers["content-type"]);
157
+ if ((0, util_1.isCodeInRange)("200", response.httpStatusCode)) {
158
+ const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(await response.body.text(), contentType), "GetPlanResponse", "");
159
+ return new http_1.HttpInfo(response.httpStatusCode, response.headers, response.body, body);
160
+ }
161
+ if ((0, util_1.isCodeInRange)("400", response.httpStatusCode)) {
162
+ const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(await response.body.text(), contentType), "ValidationErrorResponse", "");
163
+ throw new exception_1.ApiException(response.httpStatusCode, "Bad Request", body, response.headers);
164
+ }
165
+ if ((0, util_1.isCodeInRange)("401", response.httpStatusCode)) {
166
+ const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(await response.body.text(), contentType), "UnauthorizedErrorResponse", "");
167
+ throw new exception_1.ApiException(response.httpStatusCode, "Unauthorized", body, response.headers);
168
+ }
169
+ if ((0, util_1.isCodeInRange)("404", response.httpStatusCode)) {
170
+ const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(await response.body.text(), contentType), "NotFoundErrorResponse", "");
171
+ throw new exception_1.ApiException(response.httpStatusCode, "Not Found", body, response.headers);
172
+ }
173
+ if ((0, util_1.isCodeInRange)("429", response.httpStatusCode)) {
174
+ const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(await response.body.text(), contentType), "RateLimitErrorResponse", "");
175
+ throw new exception_1.ApiException(response.httpStatusCode, "Too Many Requests", body, response.headers);
176
+ }
177
+ if ((0, util_1.isCodeInRange)("500", response.httpStatusCode)) {
178
+ const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(await response.body.text(), contentType), "InternalServerErrorResponse", "");
179
+ throw new exception_1.ApiException(response.httpStatusCode, "Internal Server Error", body, response.headers);
180
+ }
181
+ // Work around for missing responses in specification, e.g. for petstore.yaml
182
+ if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) {
183
+ const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(await response.body.text(), contentType), "GetPlanResponse", "");
184
+ return new http_1.HttpInfo(response.httpStatusCode, response.headers, response.body, body);
185
+ }
186
+ throw new exception_1.ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers);
187
+ }
188
+ /**
189
+ * Unwraps the actual response sent by the server from the response context and deserializes the response content
190
+ * to the expected objects
191
+ *
192
+ * @params response Response returned by the server for a request to listPlans
193
+ * @throws ApiException if the response code was not in [200, 299]
194
+ */
195
+ async listPlansWithHttpInfo(response) {
196
+ const contentType = ObjectSerializer_1.ObjectSerializer.normalizeMediaType(response.headers["content-type"]);
197
+ if ((0, util_1.isCodeInRange)("200", response.httpStatusCode)) {
198
+ const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(await response.body.text(), contentType), "ListPlansResponse", "");
199
+ return new http_1.HttpInfo(response.httpStatusCode, response.headers, response.body, body);
200
+ }
201
+ if ((0, util_1.isCodeInRange)("400", response.httpStatusCode)) {
202
+ const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(await response.body.text(), contentType), "ValidationErrorResponse", "");
203
+ throw new exception_1.ApiException(response.httpStatusCode, "Bad Request", body, response.headers);
204
+ }
205
+ if ((0, util_1.isCodeInRange)("401", response.httpStatusCode)) {
206
+ const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(await response.body.text(), contentType), "UnauthorizedErrorResponse", "");
207
+ throw new exception_1.ApiException(response.httpStatusCode, "Unauthorized", body, response.headers);
208
+ }
209
+ if ((0, util_1.isCodeInRange)("429", response.httpStatusCode)) {
210
+ const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(await response.body.text(), contentType), "RateLimitErrorResponse", "");
211
+ throw new exception_1.ApiException(response.httpStatusCode, "Too Many Requests", body, response.headers);
212
+ }
213
+ if ((0, util_1.isCodeInRange)("500", response.httpStatusCode)) {
214
+ const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(await response.body.text(), contentType), "InternalServerErrorResponse", "");
215
+ throw new exception_1.ApiException(response.httpStatusCode, "Internal Server Error", body, response.headers);
216
+ }
217
+ // Work around for missing responses in specification, e.g. for petstore.yaml
218
+ if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) {
219
+ const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(await response.body.text(), contentType), "ListPlansResponse", "");
220
+ return new http_1.HttpInfo(response.httpStatusCode, response.headers, response.body, body);
221
+ }
222
+ throw new exception_1.ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers);
223
+ }
224
+ }
225
+ exports.PlansApiResponseProcessor = PlansApiResponseProcessor;