oci-onesubscription 2.31.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 (209) hide show
  1. package/LICENSE.txt +89 -0
  2. package/NOTICE.txt +1 -0
  3. package/README.md +22 -0
  4. package/THIRD_PARTY_LICENSES.txt +576 -0
  5. package/index.d.ts +28 -0
  6. package/index.js +51 -0
  7. package/index.js.map +1 -0
  8. package/lib/client.d.ts +808 -0
  9. package/lib/client.js +2027 -0
  10. package/lib/client.js.map +1 -0
  11. package/lib/model/aggregated-computed-usage-summary.d.ts +82 -0
  12. package/lib/model/aggregated-computed-usage-summary.js +81 -0
  13. package/lib/model/aggregated-computed-usage-summary.js.map +1 -0
  14. package/lib/model/billing-schedule-product.d.ts +32 -0
  15. package/lib/model/billing-schedule-product.js +30 -0
  16. package/lib/model/billing-schedule-product.js.map +1 -0
  17. package/lib/model/billing-schedule-summary.d.ts +94 -0
  18. package/lib/model/billing-schedule-summary.js +66 -0
  19. package/lib/model/billing-schedule-summary.js.map +1 -0
  20. package/lib/model/commitment-service.d.ts +53 -0
  21. package/lib/model/commitment-service.js +30 -0
  22. package/lib/model/commitment-service.js.map +1 -0
  23. package/lib/model/commitment-summary.d.ts +64 -0
  24. package/lib/model/commitment-summary.js +30 -0
  25. package/lib/model/commitment-summary.js.map +1 -0
  26. package/lib/model/commitment.d.ts +64 -0
  27. package/lib/model/commitment.js +30 -0
  28. package/lib/model/commitment.js.map +1 -0
  29. package/lib/model/computed-usage-aggregation.d.ts +82 -0
  30. package/lib/model/computed-usage-aggregation.js +79 -0
  31. package/lib/model/computed-usage-aggregation.js.map +1 -0
  32. package/lib/model/computed-usage-product.d.ts +58 -0
  33. package/lib/model/computed-usage-product.js +30 -0
  34. package/lib/model/computed-usage-product.js.map +1 -0
  35. package/lib/model/computed-usage-summary.d.ts +163 -0
  36. package/lib/model/computed-usage-summary.js +85 -0
  37. package/lib/model/computed-usage-summary.js.map +1 -0
  38. package/lib/model/computed-usage.d.ts +163 -0
  39. package/lib/model/computed-usage.js +85 -0
  40. package/lib/model/computed-usage.js.map +1 -0
  41. package/lib/model/index.d.ts +87 -0
  42. package/lib/model/index.js +110 -0
  43. package/lib/model/index.js.map +1 -0
  44. package/lib/model/invoice-line-summary.d.ts +50 -0
  45. package/lib/model/invoice-line-summary.js +56 -0
  46. package/lib/model/invoice-line-summary.js.map +1 -0
  47. package/lib/model/invoice-summary.d.ts +95 -0
  48. package/lib/model/invoice-summary.js +96 -0
  49. package/lib/model/invoice-summary.js.map +1 -0
  50. package/lib/model/invoiceline-computed-usage-summary.d.ts +74 -0
  51. package/lib/model/invoiceline-computed-usage-summary.js +81 -0
  52. package/lib/model/invoiceline-computed-usage-summary.js.map +1 -0
  53. package/lib/model/invoicing-address.d.ts +65 -0
  54. package/lib/model/invoicing-address.js +56 -0
  55. package/lib/model/invoicing-address.js.map +1 -0
  56. package/lib/model/invoicing-business-partner.d.ts +68 -0
  57. package/lib/model/invoicing-business-partner.js +30 -0
  58. package/lib/model/invoicing-business-partner.js.map +1 -0
  59. package/lib/model/invoicing-currency.d.ts +38 -0
  60. package/lib/model/invoicing-currency.js +30 -0
  61. package/lib/model/invoicing-currency.js.map +1 -0
  62. package/lib/model/invoicing-location.d.ts +58 -0
  63. package/lib/model/invoicing-location.js +30 -0
  64. package/lib/model/invoicing-location.js.map +1 -0
  65. package/lib/model/invoicing-organization.d.ts +33 -0
  66. package/lib/model/invoicing-organization.js +30 -0
  67. package/lib/model/invoicing-organization.js.map +1 -0
  68. package/lib/model/invoicing-payment-term.d.ts +63 -0
  69. package/lib/model/invoicing-payment-term.js +30 -0
  70. package/lib/model/invoicing-payment-term.js.map +1 -0
  71. package/lib/model/invoicing-product.d.ts +53 -0
  72. package/lib/model/invoicing-product.js +30 -0
  73. package/lib/model/invoicing-product.js.map +1 -0
  74. package/lib/model/invoicing-user.d.ts +63 -0
  75. package/lib/model/invoicing-user.js +30 -0
  76. package/lib/model/invoicing-user.js.map +1 -0
  77. package/lib/model/organization-subscription-summary.d.ts +60 -0
  78. package/lib/model/organization-subscription-summary.js +58 -0
  79. package/lib/model/organization-subscription-summary.js.map +1 -0
  80. package/lib/model/orgnization-subs-currency.d.ts +38 -0
  81. package/lib/model/orgnization-subs-currency.js +30 -0
  82. package/lib/model/orgnization-subs-currency.js.map +1 -0
  83. package/lib/model/rate-card-product.d.ts +53 -0
  84. package/lib/model/rate-card-product.js +30 -0
  85. package/lib/model/rate-card-product.js.map +1 -0
  86. package/lib/model/rate-card-summary.d.ts +66 -0
  87. package/lib/model/rate-card-summary.js +70 -0
  88. package/lib/model/rate-card-summary.js.map +1 -0
  89. package/lib/model/rate-card-tier.d.ts +38 -0
  90. package/lib/model/rate-card-tier.js +30 -0
  91. package/lib/model/rate-card-tier.js.map +1 -0
  92. package/lib/model/subscribed-service-address.d.ts +65 -0
  93. package/lib/model/subscribed-service-address.js +58 -0
  94. package/lib/model/subscribed-service-address.js.map +1 -0
  95. package/lib/model/subscribed-service-business-partner.d.ts +68 -0
  96. package/lib/model/subscribed-service-business-partner.js +30 -0
  97. package/lib/model/subscribed-service-business-partner.js.map +1 -0
  98. package/lib/model/subscribed-service-location.d.ts +58 -0
  99. package/lib/model/subscribed-service-location.js +30 -0
  100. package/lib/model/subscribed-service-location.js.map +1 -0
  101. package/lib/model/subscribed-service-payment-term.d.ts +63 -0
  102. package/lib/model/subscribed-service-payment-term.js +30 -0
  103. package/lib/model/subscribed-service-payment-term.js.map +1 -0
  104. package/lib/model/subscribed-service-summary.d.ts +507 -0
  105. package/lib/model/subscribed-service-summary.js +146 -0
  106. package/lib/model/subscribed-service-summary.js.map +1 -0
  107. package/lib/model/subscribed-service-user.d.ts +63 -0
  108. package/lib/model/subscribed-service-user.js +30 -0
  109. package/lib/model/subscribed-service-user.js.map +1 -0
  110. package/lib/model/subscribed-service.d.ts +517 -0
  111. package/lib/model/subscribed-service.js +166 -0
  112. package/lib/model/subscribed-service.js.map +1 -0
  113. package/lib/model/subscription-currency.d.ts +38 -0
  114. package/lib/model/subscription-currency.js +30 -0
  115. package/lib/model/subscription-currency.js.map +1 -0
  116. package/lib/model/subscription-product.d.ts +43 -0
  117. package/lib/model/subscription-product.js +30 -0
  118. package/lib/model/subscription-product.js.map +1 -0
  119. package/lib/model/subscription-subscribed-service.d.ts +146 -0
  120. package/lib/model/subscription-subscribed-service.js +66 -0
  121. package/lib/model/subscription-subscribed-service.js.map +1 -0
  122. package/lib/model/subscription-summary.d.ts +60 -0
  123. package/lib/model/subscription-summary.js +66 -0
  124. package/lib/model/subscription-summary.js.map +1 -0
  125. package/lib/request/get-commitment-request.d.ts +27 -0
  126. package/lib/request/get-commitment-request.js +15 -0
  127. package/lib/request/get-commitment-request.js.map +1 -0
  128. package/lib/request/get-computed-usage-request.d.ts +39 -0
  129. package/lib/request/get-computed-usage-request.js +15 -0
  130. package/lib/request/get-computed-usage-request.js.map +1 -0
  131. package/lib/request/get-subscribed-service-request.d.ts +40 -0
  132. package/lib/request/get-subscribed-service-request.js +15 -0
  133. package/lib/request/get-subscribed-service-request.js.map +1 -0
  134. package/lib/request/index.d.ts +39 -0
  135. package/lib/request/index.js +56 -0
  136. package/lib/request/index.js.map +1 -0
  137. package/lib/request/list-aggregated-computed-usages-request.d.ts +72 -0
  138. package/lib/request/list-aggregated-computed-usages-request.js +26 -0
  139. package/lib/request/list-aggregated-computed-usages-request.js.map +1 -0
  140. package/lib/request/list-billing-schedules-request.d.ts +69 -0
  141. package/lib/request/list-billing-schedules-request.js +29 -0
  142. package/lib/request/list-billing-schedules-request.js.map +1 -0
  143. package/lib/request/list-commitments-request.d.ts +64 -0
  144. package/lib/request/list-commitments-request.js +29 -0
  145. package/lib/request/list-commitments-request.js.map +1 -0
  146. package/lib/request/list-computed-usages-request.d.ts +85 -0
  147. package/lib/request/list-computed-usages-request.js +30 -0
  148. package/lib/request/list-computed-usages-request.js.map +1 -0
  149. package/lib/request/list-invoiceline-computed-usages-request.d.ts +72 -0
  150. package/lib/request/list-invoiceline-computed-usages-request.js +29 -0
  151. package/lib/request/list-invoiceline-computed-usages-request.js.map +1 -0
  152. package/lib/request/list-invoices-request.d.ts +81 -0
  153. package/lib/request/list-invoices-request.js +29 -0
  154. package/lib/request/list-invoices-request.js.map +1 -0
  155. package/lib/request/list-organization-subscriptions-request.d.ts +59 -0
  156. package/lib/request/list-organization-subscriptions-request.js +29 -0
  157. package/lib/request/list-organization-subscriptions-request.js.map +1 -0
  158. package/lib/request/list-rate-cards-request.d.ts +75 -0
  159. package/lib/request/list-rate-cards-request.js +29 -0
  160. package/lib/request/list-rate-cards-request.js.map +1 -0
  161. package/lib/request/list-subscribed-services-request.d.ts +73 -0
  162. package/lib/request/list-subscribed-services-request.js +29 -0
  163. package/lib/request/list-subscribed-services-request.js.map +1 -0
  164. package/lib/request/list-subscriptions-request.d.ts +75 -0
  165. package/lib/request/list-subscriptions-request.js +29 -0
  166. package/lib/request/list-subscriptions-request.js.map +1 -0
  167. package/lib/response/get-commitment-response.d.ts +25 -0
  168. package/lib/response/get-commitment-response.js +15 -0
  169. package/lib/response/get-commitment-response.js.map +1 -0
  170. package/lib/response/get-computed-usage-response.d.ts +25 -0
  171. package/lib/response/get-computed-usage-response.js +15 -0
  172. package/lib/response/get-computed-usage-response.js.map +1 -0
  173. package/lib/response/get-subscribed-service-response.d.ts +25 -0
  174. package/lib/response/get-subscribed-service-response.js +15 -0
  175. package/lib/response/get-subscribed-service-response.js.map +1 -0
  176. package/lib/response/index.d.ts +39 -0
  177. package/lib/response/index.js +16 -0
  178. package/lib/response/index.js.map +1 -0
  179. package/lib/response/list-aggregated-computed-usages-response.d.ts +32 -0
  180. package/lib/response/list-aggregated-computed-usages-response.js +15 -0
  181. package/lib/response/list-aggregated-computed-usages-response.js.map +1 -0
  182. package/lib/response/list-billing-schedules-response.d.ts +32 -0
  183. package/lib/response/list-billing-schedules-response.js +15 -0
  184. package/lib/response/list-billing-schedules-response.js.map +1 -0
  185. package/lib/response/list-commitments-response.d.ts +32 -0
  186. package/lib/response/list-commitments-response.js +15 -0
  187. package/lib/response/list-commitments-response.js.map +1 -0
  188. package/lib/response/list-computed-usages-response.d.ts +32 -0
  189. package/lib/response/list-computed-usages-response.js +15 -0
  190. package/lib/response/list-computed-usages-response.js.map +1 -0
  191. package/lib/response/list-invoiceline-computed-usages-response.d.ts +32 -0
  192. package/lib/response/list-invoiceline-computed-usages-response.js +15 -0
  193. package/lib/response/list-invoiceline-computed-usages-response.js.map +1 -0
  194. package/lib/response/list-invoices-response.d.ts +32 -0
  195. package/lib/response/list-invoices-response.js +15 -0
  196. package/lib/response/list-invoices-response.js.map +1 -0
  197. package/lib/response/list-organization-subscriptions-response.d.ts +32 -0
  198. package/lib/response/list-organization-subscriptions-response.js +15 -0
  199. package/lib/response/list-organization-subscriptions-response.js.map +1 -0
  200. package/lib/response/list-rate-cards-response.d.ts +27 -0
  201. package/lib/response/list-rate-cards-response.js +15 -0
  202. package/lib/response/list-rate-cards-response.js.map +1 -0
  203. package/lib/response/list-subscribed-services-response.d.ts +32 -0
  204. package/lib/response/list-subscribed-services-response.js +15 -0
  205. package/lib/response/list-subscribed-services-response.js.map +1 -0
  206. package/lib/response/list-subscriptions-response.d.ts +32 -0
  207. package/lib/response/list-subscriptions-response.js +15 -0
  208. package/lib/response/list-subscriptions-response.js.map +1 -0
  209. package/package.json +29 -0
package/lib/client.js ADDED
@@ -0,0 +1,2027 @@
1
+ "use strict";
2
+ /**
3
+ * OneSubscription APIs
4
+ * OneSubscription APIs
5
+
6
+ * OpenAPI spec version: 20190111
7
+ * Contact: kuaskum_org_ww@oracle.com
8
+ *
9
+ * NOTE: This class is auto generated by OracleSDKGenerator.
10
+ * Do not edit the class manually.
11
+ *
12
+ * Copyright (c) 2020, 2022, Oracle and/or its affiliates. All rights reserved.
13
+ * This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license.
14
+ */
15
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
16
+ if (k2 === undefined) k2 = k;
17
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
18
+ }) : (function(o, m, k, k2) {
19
+ if (k2 === undefined) k2 = k;
20
+ o[k2] = m[k];
21
+ }));
22
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
23
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
24
+ }) : function(o, v) {
25
+ o["default"] = v;
26
+ });
27
+ var __importStar = (this && this.__importStar) || function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
35
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
36
+ return new (P || (P = Promise))(function (resolve, reject) {
37
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
38
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
39
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
40
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
41
+ });
42
+ };
43
+ Object.defineProperty(exports, "__esModule", { value: true });
44
+ exports.SubscriptionClient = exports.SubscriptionApiKeys = exports.SubscribedServiceClient = exports.SubscribedServiceApiKeys = exports.RatecardClient = exports.RatecardApiKeys = exports.OrganizationSubscriptionClient = exports.OrganizationSubscriptionApiKeys = exports.InvoiceSummaryClient = exports.InvoiceSummaryApiKeys = exports.ComputedUsageClient = exports.ComputedUsageApiKeys = exports.CommitmentClient = exports.CommitmentApiKeys = exports.BillingScheduleClient = exports.BillingScheduleApiKeys = void 0;
45
+ const common = require("oci-common");
46
+ const model = __importStar(require("./model"));
47
+ const oci_common_1 = require("oci-common");
48
+ const oci_common_2 = require("oci-common");
49
+ // ===============================================
50
+ // This file is autogenerated - Please do not edit
51
+ // ===============================================
52
+ var BillingScheduleApiKeys;
53
+ (function (BillingScheduleApiKeys) {
54
+ })(BillingScheduleApiKeys = exports.BillingScheduleApiKeys || (exports.BillingScheduleApiKeys = {}));
55
+ /**
56
+ * This service client uses {@link common.CircuitBreaker.DefaultConfiguration} for all the operations by default if no circuit breaker configuration is defined by the user.
57
+ */
58
+ class BillingScheduleClient {
59
+ constructor(params, clientConfiguration) {
60
+ this["_endpoint"] = "";
61
+ this["_defaultHeaders"] = {};
62
+ this._circuitBreaker = null;
63
+ this._httpOptions = undefined;
64
+ this.targetService = "BillingSchedule";
65
+ const requestSigner = params.authenticationDetailsProvider
66
+ ? new common.DefaultRequestSigner(params.authenticationDetailsProvider)
67
+ : null;
68
+ if (clientConfiguration) {
69
+ this._clientConfiguration = clientConfiguration;
70
+ this._circuitBreaker = clientConfiguration.circuitBreaker
71
+ ? clientConfiguration.circuitBreaker.circuit
72
+ : null;
73
+ this._httpOptions = clientConfiguration.httpOptions
74
+ ? clientConfiguration.httpOptions
75
+ : undefined;
76
+ }
77
+ // if circuit breaker is not created, check if circuit breaker system is enabled to use default circuit breaker
78
+ const specCircuitBreakerEnabled = true;
79
+ if (!this._circuitBreaker &&
80
+ common.utils.isCircuitBreakerSystemEnabled(clientConfiguration) &&
81
+ (specCircuitBreakerEnabled || common.CircuitBreaker.DefaultCircuitBreakerOverriden)) {
82
+ this._circuitBreaker = new common.CircuitBreaker().circuit;
83
+ }
84
+ this._httpClient =
85
+ params.httpClient ||
86
+ new common.FetchHttpClient(requestSigner, this._circuitBreaker, this._httpOptions);
87
+ if (params.authenticationDetailsProvider &&
88
+ common.isRegionProvider(params.authenticationDetailsProvider)) {
89
+ const provider = params.authenticationDetailsProvider;
90
+ if (provider.getRegion()) {
91
+ this.region = provider.getRegion();
92
+ }
93
+ }
94
+ }
95
+ /**
96
+ * Get the endpoint that is being used to call (ex, https://www.example.com).
97
+ */
98
+ get endpoint() {
99
+ return this._endpoint;
100
+ }
101
+ /**
102
+ * Sets the endpoint to call (ex, https://www.example.com).
103
+ * @param endpoint The endpoint of the service.
104
+ */
105
+ set endpoint(endpoint) {
106
+ this._endpoint = endpoint;
107
+ this._endpoint = this._endpoint + "/20190111";
108
+ if (this.logger)
109
+ this.logger.info(`BillingScheduleClient endpoint set to ${this._endpoint}`);
110
+ }
111
+ get logger() {
112
+ return common.LOG.logger;
113
+ }
114
+ /**
115
+ * Sets the region to call (ex, Region.US_PHOENIX_1).
116
+ * Note, this will call {@link #endpoint(String) endpoint} after resolving the endpoint.
117
+ * @param region The region of the service.
118
+ */
119
+ set region(region) {
120
+ this.endpoint = common.EndpointBuilder.createEndpointFromRegion(BillingScheduleClient.serviceEndpointTemplate, region, BillingScheduleClient.endpointServiceName);
121
+ }
122
+ /**
123
+ * Sets the regionId to call (ex, 'us-phoenix-1').
124
+ *
125
+ * Note, this will first try to map the region ID to a known Region and call {@link #region(Region) region}.
126
+ * If no known Region could be determined, it will create an endpoint assuming its in default Realm OC1
127
+ * and then call {@link #endpoint(String) endpoint}.
128
+ * @param regionId The public region ID.
129
+ */
130
+ set regionId(regionId) {
131
+ this.endpoint = common.EndpointBuilder.createEndpointFromRegionId(BillingScheduleClient.serviceEndpointTemplate, regionId, BillingScheduleClient.endpointServiceName);
132
+ }
133
+ /**
134
+ * This list API returns all billing schedules for given subscription id and
135
+ * for a particular Subscribed Service if provided
136
+ *
137
+ * This operation does not retry by default if the user has not defined a retry configuration.
138
+ * @param ListBillingSchedulesRequest
139
+ * @return ListBillingSchedulesResponse
140
+ * @throws OciError when an error occurs
141
+ * @example Click {@link https://docs.cloud.oracle.com/en-us/iaas/tools/typescript-sdk-examples/2.31.0/onesubscription/ListBillingSchedules.ts.html |here} to see how to use ListBillingSchedules API.
142
+ */
143
+ listBillingSchedules(listBillingSchedulesRequest) {
144
+ return __awaiter(this, void 0, void 0, function* () {
145
+ if (this.logger)
146
+ this.logger.debug("Calling operation BillingScheduleClient#listBillingSchedules.");
147
+ const operationName = "listBillingSchedules";
148
+ const apiReferenceLink = "";
149
+ const pathParams = {};
150
+ const queryParams = {
151
+ "compartmentId": listBillingSchedulesRequest.compartmentId,
152
+ "subscriptionId": listBillingSchedulesRequest.subscriptionId,
153
+ "subscribedServiceId": listBillingSchedulesRequest.subscribedServiceId,
154
+ "limit": listBillingSchedulesRequest.limit,
155
+ "page": listBillingSchedulesRequest.page,
156
+ "sortOrder": listBillingSchedulesRequest.sortOrder,
157
+ "sortBy": listBillingSchedulesRequest.sortBy
158
+ };
159
+ let headerParams = {
160
+ "Content-Type": common.Constants.APPLICATION_JSON,
161
+ "opc-request-id": listBillingSchedulesRequest.opcRequestId
162
+ };
163
+ const specRetryConfiguration = common.NoRetryConfigurationDetails;
164
+ const retrier = oci_common_2.GenericRetrier.createPreferredRetrier(this._clientConfiguration ? this._clientConfiguration.retryConfiguration : undefined, listBillingSchedulesRequest.retryConfiguration, specRetryConfiguration);
165
+ if (this.logger)
166
+ retrier.logger = this.logger;
167
+ const request = yield oci_common_2.composeRequest({
168
+ baseEndpoint: this._endpoint,
169
+ defaultHeaders: this._defaultHeaders,
170
+ path: "/billingSchedules",
171
+ method: "GET",
172
+ pathParams: pathParams,
173
+ headerParams: headerParams,
174
+ queryParams: queryParams
175
+ });
176
+ try {
177
+ const response = yield retrier.makeServiceCall(this._httpClient, request, this.targetService, operationName, apiReferenceLink);
178
+ const sdkResponse = oci_common_2.composeResponse({
179
+ responseObject: {},
180
+ body: yield response.json(),
181
+ bodyKey: "items",
182
+ bodyModel: model.BillingScheduleSummary,
183
+ type: "Array<model.BillingScheduleSummary>",
184
+ responseHeaders: [
185
+ {
186
+ value: response.headers.get("opc-next-page"),
187
+ key: "opcNextPage",
188
+ dataType: "string"
189
+ },
190
+ {
191
+ value: response.headers.get("opc-request-id"),
192
+ key: "opcRequestId",
193
+ dataType: "string"
194
+ }
195
+ ]
196
+ });
197
+ return sdkResponse;
198
+ }
199
+ catch (err) {
200
+ throw err;
201
+ }
202
+ });
203
+ }
204
+ /**
205
+ * NOTE: This function is deprecated in favor of listBillingSchedulesRecordIterator function.
206
+ * Creates a new async iterator which will iterate over the models.BillingScheduleSummary objects
207
+ * contained in responses from the listBillingSchedules operation. This iterator will fetch more data from the
208
+ * server as needed.
209
+ *
210
+ * @param request a request which can be sent to the service operation
211
+ */
212
+ listAllBillingSchedules(request) {
213
+ return oci_common_1.paginateRecords(request, req => this.listBillingSchedules(req));
214
+ }
215
+ /**
216
+ * NOTE: This function is deprecated in favor of listBillingSchedulesResponseIterator function.
217
+ * Creates a new async iterator which will iterate over the responses received from the listBillingSchedules operation. This iterator
218
+ * will fetch more data from the server as needed.
219
+ *
220
+ * @param request a request which can be sent to the service operation
221
+ */
222
+ listAllBillingSchedulesResponses(request) {
223
+ return oci_common_1.paginateResponses(request, req => this.listBillingSchedules(req));
224
+ }
225
+ /**
226
+ * Creates a new async iterator which will iterate over the models.BillingScheduleSummary objects
227
+ * contained in responses from the listBillingSchedules operation. This iterator will fetch more data from the
228
+ * server as needed.
229
+ *
230
+ * @param request a request which can be sent to the service operation
231
+ */
232
+ listBillingSchedulesRecordIterator(request) {
233
+ return oci_common_1.paginateRecords(request, req => this.listBillingSchedules(req));
234
+ }
235
+ /**
236
+ * Creates a new async iterator which will iterate over the responses received from the listBillingSchedules operation. This iterator
237
+ * will fetch more data from the server as needed.
238
+ *
239
+ * @param request a request which can be sent to the service operation
240
+ */
241
+ listBillingSchedulesResponseIterator(request) {
242
+ return oci_common_1.paginateResponses(request, req => this.listBillingSchedules(req));
243
+ }
244
+ }
245
+ exports.BillingScheduleClient = BillingScheduleClient;
246
+ BillingScheduleClient.serviceEndpointTemplate = "https://identity.{region}.oci.{secondLevelDomain}";
247
+ BillingScheduleClient.endpointServiceName = "";
248
+ var CommitmentApiKeys;
249
+ (function (CommitmentApiKeys) {
250
+ })(CommitmentApiKeys = exports.CommitmentApiKeys || (exports.CommitmentApiKeys = {}));
251
+ /**
252
+ * This service client uses {@link common.CircuitBreaker.DefaultConfiguration} for all the operations by default if no circuit breaker configuration is defined by the user.
253
+ */
254
+ class CommitmentClient {
255
+ constructor(params, clientConfiguration) {
256
+ this["_endpoint"] = "";
257
+ this["_defaultHeaders"] = {};
258
+ this._circuitBreaker = null;
259
+ this._httpOptions = undefined;
260
+ this.targetService = "Commitment";
261
+ const requestSigner = params.authenticationDetailsProvider
262
+ ? new common.DefaultRequestSigner(params.authenticationDetailsProvider)
263
+ : null;
264
+ if (clientConfiguration) {
265
+ this._clientConfiguration = clientConfiguration;
266
+ this._circuitBreaker = clientConfiguration.circuitBreaker
267
+ ? clientConfiguration.circuitBreaker.circuit
268
+ : null;
269
+ this._httpOptions = clientConfiguration.httpOptions
270
+ ? clientConfiguration.httpOptions
271
+ : undefined;
272
+ }
273
+ // if circuit breaker is not created, check if circuit breaker system is enabled to use default circuit breaker
274
+ const specCircuitBreakerEnabled = true;
275
+ if (!this._circuitBreaker &&
276
+ common.utils.isCircuitBreakerSystemEnabled(clientConfiguration) &&
277
+ (specCircuitBreakerEnabled || common.CircuitBreaker.DefaultCircuitBreakerOverriden)) {
278
+ this._circuitBreaker = new common.CircuitBreaker().circuit;
279
+ }
280
+ this._httpClient =
281
+ params.httpClient ||
282
+ new common.FetchHttpClient(requestSigner, this._circuitBreaker, this._httpOptions);
283
+ if (params.authenticationDetailsProvider &&
284
+ common.isRegionProvider(params.authenticationDetailsProvider)) {
285
+ const provider = params.authenticationDetailsProvider;
286
+ if (provider.getRegion()) {
287
+ this.region = provider.getRegion();
288
+ }
289
+ }
290
+ }
291
+ /**
292
+ * Get the endpoint that is being used to call (ex, https://www.example.com).
293
+ */
294
+ get endpoint() {
295
+ return this._endpoint;
296
+ }
297
+ /**
298
+ * Sets the endpoint to call (ex, https://www.example.com).
299
+ * @param endpoint The endpoint of the service.
300
+ */
301
+ set endpoint(endpoint) {
302
+ this._endpoint = endpoint;
303
+ this._endpoint = this._endpoint + "/20190111";
304
+ if (this.logger)
305
+ this.logger.info(`CommitmentClient endpoint set to ${this._endpoint}`);
306
+ }
307
+ get logger() {
308
+ return common.LOG.logger;
309
+ }
310
+ /**
311
+ * Sets the region to call (ex, Region.US_PHOENIX_1).
312
+ * Note, this will call {@link #endpoint(String) endpoint} after resolving the endpoint.
313
+ * @param region The region of the service.
314
+ */
315
+ set region(region) {
316
+ this.endpoint = common.EndpointBuilder.createEndpointFromRegion(CommitmentClient.serviceEndpointTemplate, region, CommitmentClient.endpointServiceName);
317
+ }
318
+ /**
319
+ * Sets the regionId to call (ex, 'us-phoenix-1').
320
+ *
321
+ * Note, this will first try to map the region ID to a known Region and call {@link #region(Region) region}.
322
+ * If no known Region could be determined, it will create an endpoint assuming its in default Realm OC1
323
+ * and then call {@link #endpoint(String) endpoint}.
324
+ * @param regionId The public region ID.
325
+ */
326
+ set regionId(regionId) {
327
+ this.endpoint = common.EndpointBuilder.createEndpointFromRegionId(CommitmentClient.serviceEndpointTemplate, regionId, CommitmentClient.endpointServiceName);
328
+ }
329
+ /**
330
+ * This API returns the commitment details corresponding to the id provided
331
+ *
332
+ * This operation does not retry by default if the user has not defined a retry configuration.
333
+ * @param GetCommitmentRequest
334
+ * @return GetCommitmentResponse
335
+ * @throws OciError when an error occurs
336
+ * @example Click {@link https://docs.cloud.oracle.com/en-us/iaas/tools/typescript-sdk-examples/2.31.0/onesubscription/GetCommitment.ts.html |here} to see how to use GetCommitment API.
337
+ */
338
+ getCommitment(getCommitmentRequest) {
339
+ return __awaiter(this, void 0, void 0, function* () {
340
+ if (this.logger)
341
+ this.logger.debug("Calling operation CommitmentClient#getCommitment.");
342
+ const operationName = "getCommitment";
343
+ const apiReferenceLink = "";
344
+ const pathParams = {
345
+ "{commitmentId}": getCommitmentRequest.commitmentId
346
+ };
347
+ const queryParams = {};
348
+ let headerParams = {
349
+ "Content-Type": common.Constants.APPLICATION_JSON,
350
+ "opc-request-id": getCommitmentRequest.opcRequestId
351
+ };
352
+ const specRetryConfiguration = common.NoRetryConfigurationDetails;
353
+ const retrier = oci_common_2.GenericRetrier.createPreferredRetrier(this._clientConfiguration ? this._clientConfiguration.retryConfiguration : undefined, getCommitmentRequest.retryConfiguration, specRetryConfiguration);
354
+ if (this.logger)
355
+ retrier.logger = this.logger;
356
+ const request = yield oci_common_2.composeRequest({
357
+ baseEndpoint: this._endpoint,
358
+ defaultHeaders: this._defaultHeaders,
359
+ path: "/commitments/{commitmentId}",
360
+ method: "GET",
361
+ pathParams: pathParams,
362
+ headerParams: headerParams,
363
+ queryParams: queryParams
364
+ });
365
+ try {
366
+ const response = yield retrier.makeServiceCall(this._httpClient, request, this.targetService, operationName, apiReferenceLink);
367
+ const sdkResponse = oci_common_2.composeResponse({
368
+ responseObject: {},
369
+ body: yield response.json(),
370
+ bodyKey: "commitment",
371
+ bodyModel: model.Commitment,
372
+ type: "model.Commitment",
373
+ responseHeaders: [
374
+ {
375
+ value: response.headers.get("opc-request-id"),
376
+ key: "opcRequestId",
377
+ dataType: "string"
378
+ }
379
+ ]
380
+ });
381
+ return sdkResponse;
382
+ }
383
+ catch (err) {
384
+ throw err;
385
+ }
386
+ });
387
+ }
388
+ /**
389
+ * This list API returns all commitments for a particular Subscribed Service
390
+ *
391
+ * This operation does not retry by default if the user has not defined a retry configuration.
392
+ * @param ListCommitmentsRequest
393
+ * @return ListCommitmentsResponse
394
+ * @throws OciError when an error occurs
395
+ * @example Click {@link https://docs.cloud.oracle.com/en-us/iaas/tools/typescript-sdk-examples/2.31.0/onesubscription/ListCommitments.ts.html |here} to see how to use ListCommitments API.
396
+ */
397
+ listCommitments(listCommitmentsRequest) {
398
+ return __awaiter(this, void 0, void 0, function* () {
399
+ if (this.logger)
400
+ this.logger.debug("Calling operation CommitmentClient#listCommitments.");
401
+ const operationName = "listCommitments";
402
+ const apiReferenceLink = "";
403
+ const pathParams = {};
404
+ const queryParams = {
405
+ "subscribedServiceId": listCommitmentsRequest.subscribedServiceId,
406
+ "compartmentId": listCommitmentsRequest.compartmentId,
407
+ "limit": listCommitmentsRequest.limit,
408
+ "page": listCommitmentsRequest.page,
409
+ "sortOrder": listCommitmentsRequest.sortOrder,
410
+ "sortBy": listCommitmentsRequest.sortBy
411
+ };
412
+ let headerParams = {
413
+ "Content-Type": common.Constants.APPLICATION_JSON,
414
+ "opc-request-id": listCommitmentsRequest.opcRequestId
415
+ };
416
+ const specRetryConfiguration = common.NoRetryConfigurationDetails;
417
+ const retrier = oci_common_2.GenericRetrier.createPreferredRetrier(this._clientConfiguration ? this._clientConfiguration.retryConfiguration : undefined, listCommitmentsRequest.retryConfiguration, specRetryConfiguration);
418
+ if (this.logger)
419
+ retrier.logger = this.logger;
420
+ const request = yield oci_common_2.composeRequest({
421
+ baseEndpoint: this._endpoint,
422
+ defaultHeaders: this._defaultHeaders,
423
+ path: "/commitments",
424
+ method: "GET",
425
+ pathParams: pathParams,
426
+ headerParams: headerParams,
427
+ queryParams: queryParams
428
+ });
429
+ try {
430
+ const response = yield retrier.makeServiceCall(this._httpClient, request, this.targetService, operationName, apiReferenceLink);
431
+ const sdkResponse = oci_common_2.composeResponse({
432
+ responseObject: {},
433
+ body: yield response.json(),
434
+ bodyKey: "items",
435
+ bodyModel: model.CommitmentSummary,
436
+ type: "Array<model.CommitmentSummary>",
437
+ responseHeaders: [
438
+ {
439
+ value: response.headers.get("opc-next-page"),
440
+ key: "opcNextPage",
441
+ dataType: "string"
442
+ },
443
+ {
444
+ value: response.headers.get("opc-request-id"),
445
+ key: "opcRequestId",
446
+ dataType: "string"
447
+ }
448
+ ]
449
+ });
450
+ return sdkResponse;
451
+ }
452
+ catch (err) {
453
+ throw err;
454
+ }
455
+ });
456
+ }
457
+ /**
458
+ * NOTE: This function is deprecated in favor of listCommitmentsRecordIterator function.
459
+ * Creates a new async iterator which will iterate over the models.CommitmentSummary objects
460
+ * contained in responses from the listCommitments operation. This iterator will fetch more data from the
461
+ * server as needed.
462
+ *
463
+ * @param request a request which can be sent to the service operation
464
+ */
465
+ listAllCommitments(request) {
466
+ return oci_common_1.paginateRecords(request, req => this.listCommitments(req));
467
+ }
468
+ /**
469
+ * NOTE: This function is deprecated in favor of listCommitmentsResponseIterator function.
470
+ * Creates a new async iterator which will iterate over the responses received from the listCommitments operation. This iterator
471
+ * will fetch more data from the server as needed.
472
+ *
473
+ * @param request a request which can be sent to the service operation
474
+ */
475
+ listAllCommitmentsResponses(request) {
476
+ return oci_common_1.paginateResponses(request, req => this.listCommitments(req));
477
+ }
478
+ /**
479
+ * Creates a new async iterator which will iterate over the models.CommitmentSummary objects
480
+ * contained in responses from the listCommitments operation. This iterator will fetch more data from the
481
+ * server as needed.
482
+ *
483
+ * @param request a request which can be sent to the service operation
484
+ */
485
+ listCommitmentsRecordIterator(request) {
486
+ return oci_common_1.paginateRecords(request, req => this.listCommitments(req));
487
+ }
488
+ /**
489
+ * Creates a new async iterator which will iterate over the responses received from the listCommitments operation. This iterator
490
+ * will fetch more data from the server as needed.
491
+ *
492
+ * @param request a request which can be sent to the service operation
493
+ */
494
+ listCommitmentsResponseIterator(request) {
495
+ return oci_common_1.paginateResponses(request, req => this.listCommitments(req));
496
+ }
497
+ }
498
+ exports.CommitmentClient = CommitmentClient;
499
+ CommitmentClient.serviceEndpointTemplate = "https://identity.{region}.oci.{secondLevelDomain}";
500
+ CommitmentClient.endpointServiceName = "";
501
+ var ComputedUsageApiKeys;
502
+ (function (ComputedUsageApiKeys) {
503
+ })(ComputedUsageApiKeys = exports.ComputedUsageApiKeys || (exports.ComputedUsageApiKeys = {}));
504
+ /**
505
+ * This service client uses {@link common.CircuitBreaker.DefaultConfiguration} for all the operations by default if no circuit breaker configuration is defined by the user.
506
+ */
507
+ class ComputedUsageClient {
508
+ constructor(params, clientConfiguration) {
509
+ this["_endpoint"] = "";
510
+ this["_defaultHeaders"] = {};
511
+ this._circuitBreaker = null;
512
+ this._httpOptions = undefined;
513
+ this.targetService = "ComputedUsage";
514
+ const requestSigner = params.authenticationDetailsProvider
515
+ ? new common.DefaultRequestSigner(params.authenticationDetailsProvider)
516
+ : null;
517
+ if (clientConfiguration) {
518
+ this._clientConfiguration = clientConfiguration;
519
+ this._circuitBreaker = clientConfiguration.circuitBreaker
520
+ ? clientConfiguration.circuitBreaker.circuit
521
+ : null;
522
+ this._httpOptions = clientConfiguration.httpOptions
523
+ ? clientConfiguration.httpOptions
524
+ : undefined;
525
+ }
526
+ // if circuit breaker is not created, check if circuit breaker system is enabled to use default circuit breaker
527
+ const specCircuitBreakerEnabled = true;
528
+ if (!this._circuitBreaker &&
529
+ common.utils.isCircuitBreakerSystemEnabled(clientConfiguration) &&
530
+ (specCircuitBreakerEnabled || common.CircuitBreaker.DefaultCircuitBreakerOverriden)) {
531
+ this._circuitBreaker = new common.CircuitBreaker().circuit;
532
+ }
533
+ this._httpClient =
534
+ params.httpClient ||
535
+ new common.FetchHttpClient(requestSigner, this._circuitBreaker, this._httpOptions);
536
+ if (params.authenticationDetailsProvider &&
537
+ common.isRegionProvider(params.authenticationDetailsProvider)) {
538
+ const provider = params.authenticationDetailsProvider;
539
+ if (provider.getRegion()) {
540
+ this.region = provider.getRegion();
541
+ }
542
+ }
543
+ }
544
+ /**
545
+ * Get the endpoint that is being used to call (ex, https://www.example.com).
546
+ */
547
+ get endpoint() {
548
+ return this._endpoint;
549
+ }
550
+ /**
551
+ * Sets the endpoint to call (ex, https://www.example.com).
552
+ * @param endpoint The endpoint of the service.
553
+ */
554
+ set endpoint(endpoint) {
555
+ this._endpoint = endpoint;
556
+ this._endpoint = this._endpoint + "/20190111";
557
+ if (this.logger)
558
+ this.logger.info(`ComputedUsageClient endpoint set to ${this._endpoint}`);
559
+ }
560
+ get logger() {
561
+ return common.LOG.logger;
562
+ }
563
+ /**
564
+ * Sets the region to call (ex, Region.US_PHOENIX_1).
565
+ * Note, this will call {@link #endpoint(String) endpoint} after resolving the endpoint.
566
+ * @param region The region of the service.
567
+ */
568
+ set region(region) {
569
+ this.endpoint = common.EndpointBuilder.createEndpointFromRegion(ComputedUsageClient.serviceEndpointTemplate, region, ComputedUsageClient.endpointServiceName);
570
+ }
571
+ /**
572
+ * Sets the regionId to call (ex, 'us-phoenix-1').
573
+ *
574
+ * Note, this will first try to map the region ID to a known Region and call {@link #region(Region) region}.
575
+ * If no known Region could be determined, it will create an endpoint assuming its in default Realm OC1
576
+ * and then call {@link #endpoint(String) endpoint}.
577
+ * @param regionId The public region ID.
578
+ */
579
+ set regionId(regionId) {
580
+ this.endpoint = common.EndpointBuilder.createEndpointFromRegionId(ComputedUsageClient.serviceEndpointTemplate, regionId, ComputedUsageClient.endpointServiceName);
581
+ }
582
+ /**
583
+ * This is an API which returns Computed Usage corresponding to the id passed
584
+ *
585
+ * This operation does not retry by default if the user has not defined a retry configuration.
586
+ * @param GetComputedUsageRequest
587
+ * @return GetComputedUsageResponse
588
+ * @throws OciError when an error occurs
589
+ * @example Click {@link https://docs.cloud.oracle.com/en-us/iaas/tools/typescript-sdk-examples/2.31.0/onesubscription/GetComputedUsage.ts.html |here} to see how to use GetComputedUsage API.
590
+ */
591
+ getComputedUsage(getComputedUsageRequest) {
592
+ return __awaiter(this, void 0, void 0, function* () {
593
+ if (this.logger)
594
+ this.logger.debug("Calling operation ComputedUsageClient#getComputedUsage.");
595
+ const operationName = "getComputedUsage";
596
+ const apiReferenceLink = "";
597
+ const pathParams = {
598
+ "{computedUsageId}": getComputedUsageRequest.computedUsageId
599
+ };
600
+ const queryParams = {
601
+ "compartmentId": getComputedUsageRequest.compartmentId,
602
+ "fields": getComputedUsageRequest.fields
603
+ };
604
+ let headerParams = {
605
+ "Content-Type": common.Constants.APPLICATION_JSON,
606
+ "opc-request-id": getComputedUsageRequest.opcRequestId
607
+ };
608
+ const specRetryConfiguration = common.NoRetryConfigurationDetails;
609
+ const retrier = oci_common_2.GenericRetrier.createPreferredRetrier(this._clientConfiguration ? this._clientConfiguration.retryConfiguration : undefined, getComputedUsageRequest.retryConfiguration, specRetryConfiguration);
610
+ if (this.logger)
611
+ retrier.logger = this.logger;
612
+ const request = yield oci_common_2.composeRequest({
613
+ baseEndpoint: this._endpoint,
614
+ defaultHeaders: this._defaultHeaders,
615
+ path: "/computedUsages/{computedUsageId}",
616
+ method: "GET",
617
+ pathParams: pathParams,
618
+ headerParams: headerParams,
619
+ queryParams: queryParams
620
+ });
621
+ try {
622
+ const response = yield retrier.makeServiceCall(this._httpClient, request, this.targetService, operationName, apiReferenceLink);
623
+ const sdkResponse = oci_common_2.composeResponse({
624
+ responseObject: {},
625
+ body: yield response.json(),
626
+ bodyKey: "computedUsage",
627
+ bodyModel: model.ComputedUsage,
628
+ type: "model.ComputedUsage",
629
+ responseHeaders: [
630
+ {
631
+ value: response.headers.get("opc-request-id"),
632
+ key: "opcRequestId",
633
+ dataType: "string"
634
+ }
635
+ ]
636
+ });
637
+ return sdkResponse;
638
+ }
639
+ catch (err) {
640
+ throw err;
641
+ }
642
+ });
643
+ }
644
+ /**
645
+ * This is a collection API which returns a list of aggregated computed usage details (there can be multiple Parent Products under a given SubID each of which is represented under Subscription Service Line # in SPM).
646
+ *
647
+ * This operation does not retry by default if the user has not defined a retry configuration.
648
+ * @param ListAggregatedComputedUsagesRequest
649
+ * @return ListAggregatedComputedUsagesResponse
650
+ * @throws OciError when an error occurs
651
+ * @example Click {@link https://docs.cloud.oracle.com/en-us/iaas/tools/typescript-sdk-examples/2.31.0/onesubscription/ListAggregatedComputedUsages.ts.html |here} to see how to use ListAggregatedComputedUsages API.
652
+ */
653
+ listAggregatedComputedUsages(listAggregatedComputedUsagesRequest) {
654
+ return __awaiter(this, void 0, void 0, function* () {
655
+ if (this.logger)
656
+ this.logger.debug("Calling operation ComputedUsageClient#listAggregatedComputedUsages.");
657
+ const operationName = "listAggregatedComputedUsages";
658
+ const apiReferenceLink = "";
659
+ const pathParams = {};
660
+ const queryParams = {
661
+ "compartmentId": listAggregatedComputedUsagesRequest.compartmentId,
662
+ "subscriptionId": listAggregatedComputedUsagesRequest.subscriptionId,
663
+ "timeFrom": listAggregatedComputedUsagesRequest.timeFrom,
664
+ "timeTo": listAggregatedComputedUsagesRequest.timeTo,
665
+ "parentProduct": listAggregatedComputedUsagesRequest.parentProduct,
666
+ "grouping": listAggregatedComputedUsagesRequest.grouping,
667
+ "limit": listAggregatedComputedUsagesRequest.limit,
668
+ "page": listAggregatedComputedUsagesRequest.page
669
+ };
670
+ let headerParams = {
671
+ "Content-Type": common.Constants.APPLICATION_JSON,
672
+ "opc-request-id": listAggregatedComputedUsagesRequest.opcRequestId
673
+ };
674
+ const specRetryConfiguration = common.NoRetryConfigurationDetails;
675
+ const retrier = oci_common_2.GenericRetrier.createPreferredRetrier(this._clientConfiguration ? this._clientConfiguration.retryConfiguration : undefined, listAggregatedComputedUsagesRequest.retryConfiguration, specRetryConfiguration);
676
+ if (this.logger)
677
+ retrier.logger = this.logger;
678
+ const request = yield oci_common_2.composeRequest({
679
+ baseEndpoint: this._endpoint,
680
+ defaultHeaders: this._defaultHeaders,
681
+ path: "/aggregatedComputedUsages",
682
+ method: "GET",
683
+ pathParams: pathParams,
684
+ headerParams: headerParams,
685
+ queryParams: queryParams
686
+ });
687
+ try {
688
+ const response = yield retrier.makeServiceCall(this._httpClient, request, this.targetService, operationName, apiReferenceLink);
689
+ const sdkResponse = oci_common_2.composeResponse({
690
+ responseObject: {},
691
+ body: yield response.json(),
692
+ bodyKey: "items",
693
+ bodyModel: model.AggregatedComputedUsageSummary,
694
+ type: "Array<model.AggregatedComputedUsageSummary>",
695
+ responseHeaders: [
696
+ {
697
+ value: response.headers.get("opc-next-page"),
698
+ key: "opcNextPage",
699
+ dataType: "string"
700
+ },
701
+ {
702
+ value: response.headers.get("opc-request-id"),
703
+ key: "opcRequestId",
704
+ dataType: "string"
705
+ }
706
+ ]
707
+ });
708
+ return sdkResponse;
709
+ }
710
+ catch (err) {
711
+ throw err;
712
+ }
713
+ });
714
+ }
715
+ /**
716
+ * NOTE: This function is deprecated in favor of listAggregatedComputedUsagesRecordIterator function.
717
+ * Creates a new async iterator which will iterate over the models.AggregatedComputedUsageSummary objects
718
+ * contained in responses from the listAggregatedComputedUsages operation. This iterator will fetch more data from the
719
+ * server as needed.
720
+ *
721
+ * @param request a request which can be sent to the service operation
722
+ */
723
+ listAllAggregatedComputedUsages(request) {
724
+ return oci_common_1.paginateRecords(request, req => this.listAggregatedComputedUsages(req));
725
+ }
726
+ /**
727
+ * NOTE: This function is deprecated in favor of listAggregatedComputedUsagesResponseIterator function.
728
+ * Creates a new async iterator which will iterate over the responses received from the listAggregatedComputedUsages operation. This iterator
729
+ * will fetch more data from the server as needed.
730
+ *
731
+ * @param request a request which can be sent to the service operation
732
+ */
733
+ listAllAggregatedComputedUsagesResponses(request) {
734
+ return oci_common_1.paginateResponses(request, req => this.listAggregatedComputedUsages(req));
735
+ }
736
+ /**
737
+ * Creates a new async iterator which will iterate over the models.AggregatedComputedUsageSummary objects
738
+ * contained in responses from the listAggregatedComputedUsages operation. This iterator will fetch more data from the
739
+ * server as needed.
740
+ *
741
+ * @param request a request which can be sent to the service operation
742
+ */
743
+ listAggregatedComputedUsagesRecordIterator(request) {
744
+ return oci_common_1.paginateRecords(request, req => this.listAggregatedComputedUsages(req));
745
+ }
746
+ /**
747
+ * Creates a new async iterator which will iterate over the responses received from the listAggregatedComputedUsages operation. This iterator
748
+ * will fetch more data from the server as needed.
749
+ *
750
+ * @param request a request which can be sent to the service operation
751
+ */
752
+ listAggregatedComputedUsagesResponseIterator(request) {
753
+ return oci_common_1.paginateResponses(request, req => this.listAggregatedComputedUsages(req));
754
+ }
755
+ /**
756
+ * This is a collection API which returns a list of Computed Usages for given filters.
757
+ *
758
+ * This operation does not retry by default if the user has not defined a retry configuration.
759
+ * @param ListComputedUsagesRequest
760
+ * @return ListComputedUsagesResponse
761
+ * @throws OciError when an error occurs
762
+ * @example Click {@link https://docs.cloud.oracle.com/en-us/iaas/tools/typescript-sdk-examples/2.31.0/onesubscription/ListComputedUsages.ts.html |here} to see how to use ListComputedUsages API.
763
+ */
764
+ listComputedUsages(listComputedUsagesRequest) {
765
+ return __awaiter(this, void 0, void 0, function* () {
766
+ if (this.logger)
767
+ this.logger.debug("Calling operation ComputedUsageClient#listComputedUsages.");
768
+ const operationName = "listComputedUsages";
769
+ const apiReferenceLink = "";
770
+ const pathParams = {};
771
+ const queryParams = {
772
+ "compartmentId": listComputedUsagesRequest.compartmentId,
773
+ "subscriptionId": listComputedUsagesRequest.subscriptionId,
774
+ "timeFrom": listComputedUsagesRequest.timeFrom,
775
+ "timeTo": listComputedUsagesRequest.timeTo,
776
+ "parentProduct": listComputedUsagesRequest.parentProduct,
777
+ "computedProduct": listComputedUsagesRequest.computedProduct,
778
+ "limit": listComputedUsagesRequest.limit,
779
+ "page": listComputedUsagesRequest.page,
780
+ "sortOrder": listComputedUsagesRequest.sortOrder,
781
+ "sortBy": listComputedUsagesRequest.sortBy
782
+ };
783
+ let headerParams = {
784
+ "Content-Type": common.Constants.APPLICATION_JSON,
785
+ "opc-request-id": listComputedUsagesRequest.opcRequestId
786
+ };
787
+ const specRetryConfiguration = common.NoRetryConfigurationDetails;
788
+ const retrier = oci_common_2.GenericRetrier.createPreferredRetrier(this._clientConfiguration ? this._clientConfiguration.retryConfiguration : undefined, listComputedUsagesRequest.retryConfiguration, specRetryConfiguration);
789
+ if (this.logger)
790
+ retrier.logger = this.logger;
791
+ const request = yield oci_common_2.composeRequest({
792
+ baseEndpoint: this._endpoint,
793
+ defaultHeaders: this._defaultHeaders,
794
+ path: "/computedUsages",
795
+ method: "GET",
796
+ pathParams: pathParams,
797
+ headerParams: headerParams,
798
+ queryParams: queryParams
799
+ });
800
+ try {
801
+ const response = yield retrier.makeServiceCall(this._httpClient, request, this.targetService, operationName, apiReferenceLink);
802
+ const sdkResponse = oci_common_2.composeResponse({
803
+ responseObject: {},
804
+ body: yield response.json(),
805
+ bodyKey: "items",
806
+ bodyModel: model.ComputedUsageSummary,
807
+ type: "Array<model.ComputedUsageSummary>",
808
+ responseHeaders: [
809
+ {
810
+ value: response.headers.get("opc-next-page"),
811
+ key: "opcNextPage",
812
+ dataType: "string"
813
+ },
814
+ {
815
+ value: response.headers.get("opc-request-id"),
816
+ key: "opcRequestId",
817
+ dataType: "string"
818
+ }
819
+ ]
820
+ });
821
+ return sdkResponse;
822
+ }
823
+ catch (err) {
824
+ throw err;
825
+ }
826
+ });
827
+ }
828
+ /**
829
+ * NOTE: This function is deprecated in favor of listComputedUsagesRecordIterator function.
830
+ * Creates a new async iterator which will iterate over the models.ComputedUsageSummary objects
831
+ * contained in responses from the listComputedUsages operation. This iterator will fetch more data from the
832
+ * server as needed.
833
+ *
834
+ * @param request a request which can be sent to the service operation
835
+ */
836
+ listAllComputedUsages(request) {
837
+ return oci_common_1.paginateRecords(request, req => this.listComputedUsages(req));
838
+ }
839
+ /**
840
+ * NOTE: This function is deprecated in favor of listComputedUsagesResponseIterator function.
841
+ * Creates a new async iterator which will iterate over the responses received from the listComputedUsages operation. This iterator
842
+ * will fetch more data from the server as needed.
843
+ *
844
+ * @param request a request which can be sent to the service operation
845
+ */
846
+ listAllComputedUsagesResponses(request) {
847
+ return oci_common_1.paginateResponses(request, req => this.listComputedUsages(req));
848
+ }
849
+ /**
850
+ * Creates a new async iterator which will iterate over the models.ComputedUsageSummary objects
851
+ * contained in responses from the listComputedUsages operation. This iterator will fetch more data from the
852
+ * server as needed.
853
+ *
854
+ * @param request a request which can be sent to the service operation
855
+ */
856
+ listComputedUsagesRecordIterator(request) {
857
+ return oci_common_1.paginateRecords(request, req => this.listComputedUsages(req));
858
+ }
859
+ /**
860
+ * Creates a new async iterator which will iterate over the responses received from the listComputedUsages operation. This iterator
861
+ * will fetch more data from the server as needed.
862
+ *
863
+ * @param request a request which can be sent to the service operation
864
+ */
865
+ listComputedUsagesResponseIterator(request) {
866
+ return oci_common_1.paginateResponses(request, req => this.listComputedUsages(req));
867
+ }
868
+ }
869
+ exports.ComputedUsageClient = ComputedUsageClient;
870
+ ComputedUsageClient.serviceEndpointTemplate = "https://identity.{region}.oci.{secondLevelDomain}";
871
+ ComputedUsageClient.endpointServiceName = "";
872
+ var InvoiceSummaryApiKeys;
873
+ (function (InvoiceSummaryApiKeys) {
874
+ })(InvoiceSummaryApiKeys = exports.InvoiceSummaryApiKeys || (exports.InvoiceSummaryApiKeys = {}));
875
+ /**
876
+ * This service client uses {@link common.CircuitBreaker.DefaultConfiguration} for all the operations by default if no circuit breaker configuration is defined by the user.
877
+ */
878
+ class InvoiceSummaryClient {
879
+ constructor(params, clientConfiguration) {
880
+ this["_endpoint"] = "";
881
+ this["_defaultHeaders"] = {};
882
+ this._circuitBreaker = null;
883
+ this._httpOptions = undefined;
884
+ this.targetService = "InvoiceSummary";
885
+ const requestSigner = params.authenticationDetailsProvider
886
+ ? new common.DefaultRequestSigner(params.authenticationDetailsProvider)
887
+ : null;
888
+ if (clientConfiguration) {
889
+ this._clientConfiguration = clientConfiguration;
890
+ this._circuitBreaker = clientConfiguration.circuitBreaker
891
+ ? clientConfiguration.circuitBreaker.circuit
892
+ : null;
893
+ this._httpOptions = clientConfiguration.httpOptions
894
+ ? clientConfiguration.httpOptions
895
+ : undefined;
896
+ }
897
+ // if circuit breaker is not created, check if circuit breaker system is enabled to use default circuit breaker
898
+ const specCircuitBreakerEnabled = true;
899
+ if (!this._circuitBreaker &&
900
+ common.utils.isCircuitBreakerSystemEnabled(clientConfiguration) &&
901
+ (specCircuitBreakerEnabled || common.CircuitBreaker.DefaultCircuitBreakerOverriden)) {
902
+ this._circuitBreaker = new common.CircuitBreaker().circuit;
903
+ }
904
+ this._httpClient =
905
+ params.httpClient ||
906
+ new common.FetchHttpClient(requestSigner, this._circuitBreaker, this._httpOptions);
907
+ if (params.authenticationDetailsProvider &&
908
+ common.isRegionProvider(params.authenticationDetailsProvider)) {
909
+ const provider = params.authenticationDetailsProvider;
910
+ if (provider.getRegion()) {
911
+ this.region = provider.getRegion();
912
+ }
913
+ }
914
+ }
915
+ /**
916
+ * Get the endpoint that is being used to call (ex, https://www.example.com).
917
+ */
918
+ get endpoint() {
919
+ return this._endpoint;
920
+ }
921
+ /**
922
+ * Sets the endpoint to call (ex, https://www.example.com).
923
+ * @param endpoint The endpoint of the service.
924
+ */
925
+ set endpoint(endpoint) {
926
+ this._endpoint = endpoint;
927
+ this._endpoint = this._endpoint + "/20190111";
928
+ if (this.logger)
929
+ this.logger.info(`InvoiceSummaryClient endpoint set to ${this._endpoint}`);
930
+ }
931
+ get logger() {
932
+ return common.LOG.logger;
933
+ }
934
+ /**
935
+ * Sets the region to call (ex, Region.US_PHOENIX_1).
936
+ * Note, this will call {@link #endpoint(String) endpoint} after resolving the endpoint.
937
+ * @param region The region of the service.
938
+ */
939
+ set region(region) {
940
+ this.endpoint = common.EndpointBuilder.createEndpointFromRegion(InvoiceSummaryClient.serviceEndpointTemplate, region, InvoiceSummaryClient.endpointServiceName);
941
+ }
942
+ /**
943
+ * Sets the regionId to call (ex, 'us-phoenix-1').
944
+ *
945
+ * Note, this will first try to map the region ID to a known Region and call {@link #region(Region) region}.
946
+ * If no known Region could be determined, it will create an endpoint assuming its in default Realm OC1
947
+ * and then call {@link #endpoint(String) endpoint}.
948
+ * @param regionId The public region ID.
949
+ */
950
+ set regionId(regionId) {
951
+ this.endpoint = common.EndpointBuilder.createEndpointFromRegionId(InvoiceSummaryClient.serviceEndpointTemplate, regionId, InvoiceSummaryClient.endpointServiceName);
952
+ }
953
+ /**
954
+ * This is a collection API which returns a list of Invoiced Computed Usages for given Invoiceline id.
955
+ *
956
+ * This operation does not retry by default if the user has not defined a retry configuration.
957
+ * @param ListInvoicelineComputedUsagesRequest
958
+ * @return ListInvoicelineComputedUsagesResponse
959
+ * @throws OciError when an error occurs
960
+ * @example Click {@link https://docs.cloud.oracle.com/en-us/iaas/tools/typescript-sdk-examples/2.31.0/onesubscription/ListInvoicelineComputedUsages.ts.html |here} to see how to use ListInvoicelineComputedUsages API.
961
+ */
962
+ listInvoicelineComputedUsages(listInvoicelineComputedUsagesRequest) {
963
+ return __awaiter(this, void 0, void 0, function* () {
964
+ if (this.logger)
965
+ this.logger.debug("Calling operation InvoiceSummaryClient#listInvoicelineComputedUsages.");
966
+ const operationName = "listInvoicelineComputedUsages";
967
+ const apiReferenceLink = "";
968
+ const pathParams = {};
969
+ const queryParams = {
970
+ "compartmentId": listInvoicelineComputedUsagesRequest.compartmentId,
971
+ "invoiceLineId": listInvoicelineComputedUsagesRequest.invoiceLineId,
972
+ "sortOrder": listInvoicelineComputedUsagesRequest.sortOrder,
973
+ "sortBy": listInvoicelineComputedUsagesRequest.sortBy,
974
+ "limit": listInvoicelineComputedUsagesRequest.limit,
975
+ "page": listInvoicelineComputedUsagesRequest.page,
976
+ "fields": listInvoicelineComputedUsagesRequest.fields
977
+ };
978
+ let headerParams = {
979
+ "Content-Type": common.Constants.APPLICATION_JSON,
980
+ "opc-request-id": listInvoicelineComputedUsagesRequest.opcRequestId
981
+ };
982
+ const specRetryConfiguration = common.NoRetryConfigurationDetails;
983
+ const retrier = oci_common_2.GenericRetrier.createPreferredRetrier(this._clientConfiguration ? this._clientConfiguration.retryConfiguration : undefined, listInvoicelineComputedUsagesRequest.retryConfiguration, specRetryConfiguration);
984
+ if (this.logger)
985
+ retrier.logger = this.logger;
986
+ const request = yield oci_common_2.composeRequest({
987
+ baseEndpoint: this._endpoint,
988
+ defaultHeaders: this._defaultHeaders,
989
+ path: "/invoiceLineComputedUsages",
990
+ method: "GET",
991
+ pathParams: pathParams,
992
+ headerParams: headerParams,
993
+ queryParams: queryParams
994
+ });
995
+ try {
996
+ const response = yield retrier.makeServiceCall(this._httpClient, request, this.targetService, operationName, apiReferenceLink);
997
+ const sdkResponse = oci_common_2.composeResponse({
998
+ responseObject: {},
999
+ body: yield response.json(),
1000
+ bodyKey: "items",
1001
+ bodyModel: model.InvoicelineComputedUsageSummary,
1002
+ type: "Array<model.InvoicelineComputedUsageSummary>",
1003
+ responseHeaders: [
1004
+ {
1005
+ value: response.headers.get("opc-next-page"),
1006
+ key: "opcNextPage",
1007
+ dataType: "string"
1008
+ },
1009
+ {
1010
+ value: response.headers.get("opc-request-id"),
1011
+ key: "opcRequestId",
1012
+ dataType: "string"
1013
+ }
1014
+ ]
1015
+ });
1016
+ return sdkResponse;
1017
+ }
1018
+ catch (err) {
1019
+ throw err;
1020
+ }
1021
+ });
1022
+ }
1023
+ /**
1024
+ * NOTE: This function is deprecated in favor of listInvoicelineComputedUsagesRecordIterator function.
1025
+ * Creates a new async iterator which will iterate over the models.InvoicelineComputedUsageSummary objects
1026
+ * contained in responses from the listInvoicelineComputedUsages operation. This iterator will fetch more data from the
1027
+ * server as needed.
1028
+ *
1029
+ * @param request a request which can be sent to the service operation
1030
+ */
1031
+ listAllInvoicelineComputedUsages(request) {
1032
+ return oci_common_1.paginateRecords(request, req => this.listInvoicelineComputedUsages(req));
1033
+ }
1034
+ /**
1035
+ * NOTE: This function is deprecated in favor of listInvoicelineComputedUsagesResponseIterator function.
1036
+ * Creates a new async iterator which will iterate over the responses received from the listInvoicelineComputedUsages operation. This iterator
1037
+ * will fetch more data from the server as needed.
1038
+ *
1039
+ * @param request a request which can be sent to the service operation
1040
+ */
1041
+ listAllInvoicelineComputedUsagesResponses(request) {
1042
+ return oci_common_1.paginateResponses(request, req => this.listInvoicelineComputedUsages(req));
1043
+ }
1044
+ /**
1045
+ * Creates a new async iterator which will iterate over the models.InvoicelineComputedUsageSummary objects
1046
+ * contained in responses from the listInvoicelineComputedUsages operation. This iterator will fetch more data from the
1047
+ * server as needed.
1048
+ *
1049
+ * @param request a request which can be sent to the service operation
1050
+ */
1051
+ listInvoicelineComputedUsagesRecordIterator(request) {
1052
+ return oci_common_1.paginateRecords(request, req => this.listInvoicelineComputedUsages(req));
1053
+ }
1054
+ /**
1055
+ * Creates a new async iterator which will iterate over the responses received from the listInvoicelineComputedUsages operation. This iterator
1056
+ * will fetch more data from the server as needed.
1057
+ *
1058
+ * @param request a request which can be sent to the service operation
1059
+ */
1060
+ listInvoicelineComputedUsagesResponseIterator(request) {
1061
+ return oci_common_1.paginateResponses(request, req => this.listInvoicelineComputedUsages(req));
1062
+ }
1063
+ /**
1064
+ * This is a collection API which returns a list of Invoices for given filters.
1065
+ *
1066
+ * This operation does not retry by default if the user has not defined a retry configuration.
1067
+ * @param ListInvoicesRequest
1068
+ * @return ListInvoicesResponse
1069
+ * @throws OciError when an error occurs
1070
+ * @example Click {@link https://docs.cloud.oracle.com/en-us/iaas/tools/typescript-sdk-examples/2.31.0/onesubscription/ListInvoices.ts.html |here} to see how to use ListInvoices API.
1071
+ */
1072
+ listInvoices(listInvoicesRequest) {
1073
+ return __awaiter(this, void 0, void 0, function* () {
1074
+ if (this.logger)
1075
+ this.logger.debug("Calling operation InvoiceSummaryClient#listInvoices.");
1076
+ const operationName = "listInvoices";
1077
+ const apiReferenceLink = "";
1078
+ const pathParams = {};
1079
+ const queryParams = {
1080
+ "compartmentId": listInvoicesRequest.compartmentId,
1081
+ "arCustomerTransactionId": listInvoicesRequest.arCustomerTransactionId,
1082
+ "timeFrom": listInvoicesRequest.timeFrom,
1083
+ "timeTo": listInvoicesRequest.timeTo,
1084
+ "sortOrder": listInvoicesRequest.sortOrder,
1085
+ "sortBy": listInvoicesRequest.sortBy,
1086
+ "limit": listInvoicesRequest.limit,
1087
+ "page": listInvoicesRequest.page,
1088
+ "fields": listInvoicesRequest.fields
1089
+ };
1090
+ let headerParams = {
1091
+ "Content-Type": common.Constants.APPLICATION_JSON,
1092
+ "opc-request-id": listInvoicesRequest.opcRequestId
1093
+ };
1094
+ const specRetryConfiguration = common.NoRetryConfigurationDetails;
1095
+ const retrier = oci_common_2.GenericRetrier.createPreferredRetrier(this._clientConfiguration ? this._clientConfiguration.retryConfiguration : undefined, listInvoicesRequest.retryConfiguration, specRetryConfiguration);
1096
+ if (this.logger)
1097
+ retrier.logger = this.logger;
1098
+ const request = yield oci_common_2.composeRequest({
1099
+ baseEndpoint: this._endpoint,
1100
+ defaultHeaders: this._defaultHeaders,
1101
+ path: "/invoice",
1102
+ method: "GET",
1103
+ pathParams: pathParams,
1104
+ headerParams: headerParams,
1105
+ queryParams: queryParams
1106
+ });
1107
+ try {
1108
+ const response = yield retrier.makeServiceCall(this._httpClient, request, this.targetService, operationName, apiReferenceLink);
1109
+ const sdkResponse = oci_common_2.composeResponse({
1110
+ responseObject: {},
1111
+ body: yield response.json(),
1112
+ bodyKey: "items",
1113
+ bodyModel: model.InvoiceSummary,
1114
+ type: "Array<model.InvoiceSummary>",
1115
+ responseHeaders: [
1116
+ {
1117
+ value: response.headers.get("opc-next-page"),
1118
+ key: "opcNextPage",
1119
+ dataType: "string"
1120
+ },
1121
+ {
1122
+ value: response.headers.get("opc-request-id"),
1123
+ key: "opcRequestId",
1124
+ dataType: "string"
1125
+ }
1126
+ ]
1127
+ });
1128
+ return sdkResponse;
1129
+ }
1130
+ catch (err) {
1131
+ throw err;
1132
+ }
1133
+ });
1134
+ }
1135
+ /**
1136
+ * NOTE: This function is deprecated in favor of listInvoicesRecordIterator function.
1137
+ * Creates a new async iterator which will iterate over the models.InvoiceSummary objects
1138
+ * contained in responses from the listInvoices operation. This iterator will fetch more data from the
1139
+ * server as needed.
1140
+ *
1141
+ * @param request a request which can be sent to the service operation
1142
+ */
1143
+ listAllInvoices(request) {
1144
+ return oci_common_1.paginateRecords(request, req => this.listInvoices(req));
1145
+ }
1146
+ /**
1147
+ * NOTE: This function is deprecated in favor of listInvoicesResponseIterator function.
1148
+ * Creates a new async iterator which will iterate over the responses received from the listInvoices operation. This iterator
1149
+ * will fetch more data from the server as needed.
1150
+ *
1151
+ * @param request a request which can be sent to the service operation
1152
+ */
1153
+ listAllInvoicesResponses(request) {
1154
+ return oci_common_1.paginateResponses(request, req => this.listInvoices(req));
1155
+ }
1156
+ /**
1157
+ * Creates a new async iterator which will iterate over the models.InvoiceSummary objects
1158
+ * contained in responses from the listInvoices operation. This iterator will fetch more data from the
1159
+ * server as needed.
1160
+ *
1161
+ * @param request a request which can be sent to the service operation
1162
+ */
1163
+ listInvoicesRecordIterator(request) {
1164
+ return oci_common_1.paginateRecords(request, req => this.listInvoices(req));
1165
+ }
1166
+ /**
1167
+ * Creates a new async iterator which will iterate over the responses received from the listInvoices operation. This iterator
1168
+ * will fetch more data from the server as needed.
1169
+ *
1170
+ * @param request a request which can be sent to the service operation
1171
+ */
1172
+ listInvoicesResponseIterator(request) {
1173
+ return oci_common_1.paginateResponses(request, req => this.listInvoices(req));
1174
+ }
1175
+ }
1176
+ exports.InvoiceSummaryClient = InvoiceSummaryClient;
1177
+ InvoiceSummaryClient.serviceEndpointTemplate = "https://identity.{region}.oci.{secondLevelDomain}";
1178
+ InvoiceSummaryClient.endpointServiceName = "";
1179
+ var OrganizationSubscriptionApiKeys;
1180
+ (function (OrganizationSubscriptionApiKeys) {
1181
+ })(OrganizationSubscriptionApiKeys = exports.OrganizationSubscriptionApiKeys || (exports.OrganizationSubscriptionApiKeys = {}));
1182
+ /**
1183
+ * This service client uses {@link common.CircuitBreaker.DefaultConfiguration} for all the operations by default if no circuit breaker configuration is defined by the user.
1184
+ */
1185
+ class OrganizationSubscriptionClient {
1186
+ constructor(params, clientConfiguration) {
1187
+ this["_endpoint"] = "";
1188
+ this["_defaultHeaders"] = {};
1189
+ this._circuitBreaker = null;
1190
+ this._httpOptions = undefined;
1191
+ this.targetService = "OrganizationSubscription";
1192
+ const requestSigner = params.authenticationDetailsProvider
1193
+ ? new common.DefaultRequestSigner(params.authenticationDetailsProvider)
1194
+ : null;
1195
+ if (clientConfiguration) {
1196
+ this._clientConfiguration = clientConfiguration;
1197
+ this._circuitBreaker = clientConfiguration.circuitBreaker
1198
+ ? clientConfiguration.circuitBreaker.circuit
1199
+ : null;
1200
+ this._httpOptions = clientConfiguration.httpOptions
1201
+ ? clientConfiguration.httpOptions
1202
+ : undefined;
1203
+ }
1204
+ // if circuit breaker is not created, check if circuit breaker system is enabled to use default circuit breaker
1205
+ const specCircuitBreakerEnabled = true;
1206
+ if (!this._circuitBreaker &&
1207
+ common.utils.isCircuitBreakerSystemEnabled(clientConfiguration) &&
1208
+ (specCircuitBreakerEnabled || common.CircuitBreaker.DefaultCircuitBreakerOverriden)) {
1209
+ this._circuitBreaker = new common.CircuitBreaker().circuit;
1210
+ }
1211
+ this._httpClient =
1212
+ params.httpClient ||
1213
+ new common.FetchHttpClient(requestSigner, this._circuitBreaker, this._httpOptions);
1214
+ if (params.authenticationDetailsProvider &&
1215
+ common.isRegionProvider(params.authenticationDetailsProvider)) {
1216
+ const provider = params.authenticationDetailsProvider;
1217
+ if (provider.getRegion()) {
1218
+ this.region = provider.getRegion();
1219
+ }
1220
+ }
1221
+ }
1222
+ /**
1223
+ * Get the endpoint that is being used to call (ex, https://www.example.com).
1224
+ */
1225
+ get endpoint() {
1226
+ return this._endpoint;
1227
+ }
1228
+ /**
1229
+ * Sets the endpoint to call (ex, https://www.example.com).
1230
+ * @param endpoint The endpoint of the service.
1231
+ */
1232
+ set endpoint(endpoint) {
1233
+ this._endpoint = endpoint;
1234
+ this._endpoint = this._endpoint + "/20190111";
1235
+ if (this.logger)
1236
+ this.logger.info(`OrganizationSubscriptionClient endpoint set to ${this._endpoint}`);
1237
+ }
1238
+ get logger() {
1239
+ return common.LOG.logger;
1240
+ }
1241
+ /**
1242
+ * Sets the region to call (ex, Region.US_PHOENIX_1).
1243
+ * Note, this will call {@link #endpoint(String) endpoint} after resolving the endpoint.
1244
+ * @param region The region of the service.
1245
+ */
1246
+ set region(region) {
1247
+ this.endpoint = common.EndpointBuilder.createEndpointFromRegion(OrganizationSubscriptionClient.serviceEndpointTemplate, region, OrganizationSubscriptionClient.endpointServiceName);
1248
+ }
1249
+ /**
1250
+ * Sets the regionId to call (ex, 'us-phoenix-1').
1251
+ *
1252
+ * Note, this will first try to map the region ID to a known Region and call {@link #region(Region) region}.
1253
+ * If no known Region could be determined, it will create an endpoint assuming its in default Realm OC1
1254
+ * and then call {@link #endpoint(String) endpoint}.
1255
+ * @param regionId The public region ID.
1256
+ */
1257
+ set regionId(regionId) {
1258
+ this.endpoint = common.EndpointBuilder.createEndpointFromRegionId(OrganizationSubscriptionClient.serviceEndpointTemplate, regionId, OrganizationSubscriptionClient.endpointServiceName);
1259
+ }
1260
+ /**
1261
+ * API that returns data for the list of subscription ids returned from Organizations API
1262
+ *
1263
+ * This operation does not retry by default if the user has not defined a retry configuration.
1264
+ * @param ListOrganizationSubscriptionsRequest
1265
+ * @return ListOrganizationSubscriptionsResponse
1266
+ * @throws OciError when an error occurs
1267
+ * @example Click {@link https://docs.cloud.oracle.com/en-us/iaas/tools/typescript-sdk-examples/2.31.0/onesubscription/ListOrganizationSubscriptions.ts.html |here} to see how to use ListOrganizationSubscriptions API.
1268
+ */
1269
+ listOrganizationSubscriptions(listOrganizationSubscriptionsRequest) {
1270
+ return __awaiter(this, void 0, void 0, function* () {
1271
+ if (this.logger)
1272
+ this.logger.debug("Calling operation OrganizationSubscriptionClient#listOrganizationSubscriptions.");
1273
+ const operationName = "listOrganizationSubscriptions";
1274
+ const apiReferenceLink = "";
1275
+ const pathParams = {};
1276
+ const queryParams = {
1277
+ "compartmentId": listOrganizationSubscriptionsRequest.compartmentId,
1278
+ "limit": listOrganizationSubscriptionsRequest.limit,
1279
+ "page": listOrganizationSubscriptionsRequest.page,
1280
+ "sortOrder": listOrganizationSubscriptionsRequest.sortOrder,
1281
+ "sortBy": listOrganizationSubscriptionsRequest.sortBy
1282
+ };
1283
+ let headerParams = {
1284
+ "Content-Type": common.Constants.APPLICATION_JSON,
1285
+ "opc-request-id": listOrganizationSubscriptionsRequest.opcRequestId
1286
+ };
1287
+ const specRetryConfiguration = common.NoRetryConfigurationDetails;
1288
+ const retrier = oci_common_2.GenericRetrier.createPreferredRetrier(this._clientConfiguration ? this._clientConfiguration.retryConfiguration : undefined, listOrganizationSubscriptionsRequest.retryConfiguration, specRetryConfiguration);
1289
+ if (this.logger)
1290
+ retrier.logger = this.logger;
1291
+ const request = yield oci_common_2.composeRequest({
1292
+ baseEndpoint: this._endpoint,
1293
+ defaultHeaders: this._defaultHeaders,
1294
+ path: "/organizationSubscription",
1295
+ method: "GET",
1296
+ pathParams: pathParams,
1297
+ headerParams: headerParams,
1298
+ queryParams: queryParams
1299
+ });
1300
+ try {
1301
+ const response = yield retrier.makeServiceCall(this._httpClient, request, this.targetService, operationName, apiReferenceLink);
1302
+ const sdkResponse = oci_common_2.composeResponse({
1303
+ responseObject: {},
1304
+ body: yield response.json(),
1305
+ bodyKey: "items",
1306
+ bodyModel: model.OrganizationSubscriptionSummary,
1307
+ type: "Array<model.OrganizationSubscriptionSummary>",
1308
+ responseHeaders: [
1309
+ {
1310
+ value: response.headers.get("opc-next-page"),
1311
+ key: "opcNextPage",
1312
+ dataType: "string"
1313
+ },
1314
+ {
1315
+ value: response.headers.get("opc-request-id"),
1316
+ key: "opcRequestId",
1317
+ dataType: "string"
1318
+ }
1319
+ ]
1320
+ });
1321
+ return sdkResponse;
1322
+ }
1323
+ catch (err) {
1324
+ throw err;
1325
+ }
1326
+ });
1327
+ }
1328
+ /**
1329
+ * NOTE: This function is deprecated in favor of listOrganizationSubscriptionsRecordIterator function.
1330
+ * Creates a new async iterator which will iterate over the models.OrganizationSubscriptionSummary objects
1331
+ * contained in responses from the listOrganizationSubscriptions operation. This iterator will fetch more data from the
1332
+ * server as needed.
1333
+ *
1334
+ * @param request a request which can be sent to the service operation
1335
+ */
1336
+ listAllOrganizationSubscriptions(request) {
1337
+ return oci_common_1.paginateRecords(request, req => this.listOrganizationSubscriptions(req));
1338
+ }
1339
+ /**
1340
+ * NOTE: This function is deprecated in favor of listOrganizationSubscriptionsResponseIterator function.
1341
+ * Creates a new async iterator which will iterate over the responses received from the listOrganizationSubscriptions operation. This iterator
1342
+ * will fetch more data from the server as needed.
1343
+ *
1344
+ * @param request a request which can be sent to the service operation
1345
+ */
1346
+ listAllOrganizationSubscriptionsResponses(request) {
1347
+ return oci_common_1.paginateResponses(request, req => this.listOrganizationSubscriptions(req));
1348
+ }
1349
+ /**
1350
+ * Creates a new async iterator which will iterate over the models.OrganizationSubscriptionSummary objects
1351
+ * contained in responses from the listOrganizationSubscriptions operation. This iterator will fetch more data from the
1352
+ * server as needed.
1353
+ *
1354
+ * @param request a request which can be sent to the service operation
1355
+ */
1356
+ listOrganizationSubscriptionsRecordIterator(request) {
1357
+ return oci_common_1.paginateRecords(request, req => this.listOrganizationSubscriptions(req));
1358
+ }
1359
+ /**
1360
+ * Creates a new async iterator which will iterate over the responses received from the listOrganizationSubscriptions operation. This iterator
1361
+ * will fetch more data from the server as needed.
1362
+ *
1363
+ * @param request a request which can be sent to the service operation
1364
+ */
1365
+ listOrganizationSubscriptionsResponseIterator(request) {
1366
+ return oci_common_1.paginateResponses(request, req => this.listOrganizationSubscriptions(req));
1367
+ }
1368
+ }
1369
+ exports.OrganizationSubscriptionClient = OrganizationSubscriptionClient;
1370
+ OrganizationSubscriptionClient.serviceEndpointTemplate = "https://identity.{region}.oci.{secondLevelDomain}";
1371
+ OrganizationSubscriptionClient.endpointServiceName = "";
1372
+ var RatecardApiKeys;
1373
+ (function (RatecardApiKeys) {
1374
+ })(RatecardApiKeys = exports.RatecardApiKeys || (exports.RatecardApiKeys = {}));
1375
+ /**
1376
+ * This service client uses {@link common.CircuitBreaker.DefaultConfiguration} for all the operations by default if no circuit breaker configuration is defined by the user.
1377
+ */
1378
+ class RatecardClient {
1379
+ constructor(params, clientConfiguration) {
1380
+ this["_endpoint"] = "";
1381
+ this["_defaultHeaders"] = {};
1382
+ this._circuitBreaker = null;
1383
+ this._httpOptions = undefined;
1384
+ this.targetService = "Ratecard";
1385
+ const requestSigner = params.authenticationDetailsProvider
1386
+ ? new common.DefaultRequestSigner(params.authenticationDetailsProvider)
1387
+ : null;
1388
+ if (clientConfiguration) {
1389
+ this._clientConfiguration = clientConfiguration;
1390
+ this._circuitBreaker = clientConfiguration.circuitBreaker
1391
+ ? clientConfiguration.circuitBreaker.circuit
1392
+ : null;
1393
+ this._httpOptions = clientConfiguration.httpOptions
1394
+ ? clientConfiguration.httpOptions
1395
+ : undefined;
1396
+ }
1397
+ // if circuit breaker is not created, check if circuit breaker system is enabled to use default circuit breaker
1398
+ const specCircuitBreakerEnabled = true;
1399
+ if (!this._circuitBreaker &&
1400
+ common.utils.isCircuitBreakerSystemEnabled(clientConfiguration) &&
1401
+ (specCircuitBreakerEnabled || common.CircuitBreaker.DefaultCircuitBreakerOverriden)) {
1402
+ this._circuitBreaker = new common.CircuitBreaker().circuit;
1403
+ }
1404
+ this._httpClient =
1405
+ params.httpClient ||
1406
+ new common.FetchHttpClient(requestSigner, this._circuitBreaker, this._httpOptions);
1407
+ if (params.authenticationDetailsProvider &&
1408
+ common.isRegionProvider(params.authenticationDetailsProvider)) {
1409
+ const provider = params.authenticationDetailsProvider;
1410
+ if (provider.getRegion()) {
1411
+ this.region = provider.getRegion();
1412
+ }
1413
+ }
1414
+ }
1415
+ /**
1416
+ * Get the endpoint that is being used to call (ex, https://www.example.com).
1417
+ */
1418
+ get endpoint() {
1419
+ return this._endpoint;
1420
+ }
1421
+ /**
1422
+ * Sets the endpoint to call (ex, https://www.example.com).
1423
+ * @param endpoint The endpoint of the service.
1424
+ */
1425
+ set endpoint(endpoint) {
1426
+ this._endpoint = endpoint;
1427
+ this._endpoint = this._endpoint + "/20190111";
1428
+ if (this.logger)
1429
+ this.logger.info(`RatecardClient endpoint set to ${this._endpoint}`);
1430
+ }
1431
+ get logger() {
1432
+ return common.LOG.logger;
1433
+ }
1434
+ /**
1435
+ * Sets the region to call (ex, Region.US_PHOENIX_1).
1436
+ * Note, this will call {@link #endpoint(String) endpoint} after resolving the endpoint.
1437
+ * @param region The region of the service.
1438
+ */
1439
+ set region(region) {
1440
+ this.endpoint = common.EndpointBuilder.createEndpointFromRegion(RatecardClient.serviceEndpointTemplate, region, RatecardClient.endpointServiceName);
1441
+ }
1442
+ /**
1443
+ * Sets the regionId to call (ex, 'us-phoenix-1').
1444
+ *
1445
+ * Note, this will first try to map the region ID to a known Region and call {@link #region(Region) region}.
1446
+ * If no known Region could be determined, it will create an endpoint assuming its in default Realm OC1
1447
+ * and then call {@link #endpoint(String) endpoint}.
1448
+ * @param regionId The public region ID.
1449
+ */
1450
+ set regionId(regionId) {
1451
+ this.endpoint = common.EndpointBuilder.createEndpointFromRegionId(RatecardClient.serviceEndpointTemplate, regionId, RatecardClient.endpointServiceName);
1452
+ }
1453
+ /**
1454
+ * List API that returns all ratecards for given Subscription Id and Account ID (if provided) and
1455
+ * for a particular date range
1456
+ *
1457
+ * This operation does not retry by default if the user has not defined a retry configuration.
1458
+ * @param ListRateCardsRequest
1459
+ * @return ListRateCardsResponse
1460
+ * @throws OciError when an error occurs
1461
+ * @example Click {@link https://docs.cloud.oracle.com/en-us/iaas/tools/typescript-sdk-examples/2.31.0/onesubscription/ListRateCards.ts.html |here} to see how to use ListRateCards API.
1462
+ */
1463
+ listRateCards(listRateCardsRequest) {
1464
+ return __awaiter(this, void 0, void 0, function* () {
1465
+ if (this.logger)
1466
+ this.logger.debug("Calling operation RatecardClient#listRateCards.");
1467
+ const operationName = "listRateCards";
1468
+ const apiReferenceLink = "";
1469
+ const pathParams = {};
1470
+ const queryParams = {
1471
+ "subscriptionId": listRateCardsRequest.subscriptionId,
1472
+ "timeFrom": listRateCardsRequest.timeFrom,
1473
+ "timeTo": listRateCardsRequest.timeTo,
1474
+ "partNumber": listRateCardsRequest.partNumber,
1475
+ "limit": listRateCardsRequest.limit,
1476
+ "page": listRateCardsRequest.page,
1477
+ "sortOrder": listRateCardsRequest.sortOrder,
1478
+ "sortBy": listRateCardsRequest.sortBy,
1479
+ "compartmentId": listRateCardsRequest.compartmentId
1480
+ };
1481
+ let headerParams = {
1482
+ "Content-Type": common.Constants.APPLICATION_JSON,
1483
+ "opc-request-id": listRateCardsRequest.opcRequestId
1484
+ };
1485
+ const specRetryConfiguration = common.NoRetryConfigurationDetails;
1486
+ const retrier = oci_common_2.GenericRetrier.createPreferredRetrier(this._clientConfiguration ? this._clientConfiguration.retryConfiguration : undefined, listRateCardsRequest.retryConfiguration, specRetryConfiguration);
1487
+ if (this.logger)
1488
+ retrier.logger = this.logger;
1489
+ const request = yield oci_common_2.composeRequest({
1490
+ baseEndpoint: this._endpoint,
1491
+ defaultHeaders: this._defaultHeaders,
1492
+ path: "/ratecards",
1493
+ method: "GET",
1494
+ pathParams: pathParams,
1495
+ headerParams: headerParams,
1496
+ queryParams: queryParams
1497
+ });
1498
+ try {
1499
+ const response = yield retrier.makeServiceCall(this._httpClient, request, this.targetService, operationName, apiReferenceLink);
1500
+ const sdkResponse = oci_common_2.composeResponse({
1501
+ responseObject: {},
1502
+ body: yield response.json(),
1503
+ bodyKey: "items",
1504
+ bodyModel: model.RateCardSummary,
1505
+ type: "Array<model.RateCardSummary>",
1506
+ responseHeaders: [
1507
+ {
1508
+ value: response.headers.get("opc-next-page"),
1509
+ key: "opcNextPage",
1510
+ dataType: "string"
1511
+ },
1512
+ {
1513
+ value: response.headers.get("opc-request-id"),
1514
+ key: "opcRequestId",
1515
+ dataType: "string"
1516
+ }
1517
+ ]
1518
+ });
1519
+ return sdkResponse;
1520
+ }
1521
+ catch (err) {
1522
+ throw err;
1523
+ }
1524
+ });
1525
+ }
1526
+ /**
1527
+ * NOTE: This function is deprecated in favor of listRateCardsRecordIterator function.
1528
+ * Creates a new async iterator which will iterate over the models.RateCardSummary objects
1529
+ * contained in responses from the listRateCards operation. This iterator will fetch more data from the
1530
+ * server as needed.
1531
+ *
1532
+ * @param request a request which can be sent to the service operation
1533
+ */
1534
+ listAllRateCards(request) {
1535
+ return oci_common_1.paginateRecords(request, req => this.listRateCards(req));
1536
+ }
1537
+ /**
1538
+ * NOTE: This function is deprecated in favor of listRateCardsResponseIterator function.
1539
+ * Creates a new async iterator which will iterate over the responses received from the listRateCards operation. This iterator
1540
+ * will fetch more data from the server as needed.
1541
+ *
1542
+ * @param request a request which can be sent to the service operation
1543
+ */
1544
+ listAllRateCardsResponses(request) {
1545
+ return oci_common_1.paginateResponses(request, req => this.listRateCards(req));
1546
+ }
1547
+ /**
1548
+ * Creates a new async iterator which will iterate over the models.RateCardSummary objects
1549
+ * contained in responses from the listRateCards operation. This iterator will fetch more data from the
1550
+ * server as needed.
1551
+ *
1552
+ * @param request a request which can be sent to the service operation
1553
+ */
1554
+ listRateCardsRecordIterator(request) {
1555
+ return oci_common_1.paginateRecords(request, req => this.listRateCards(req));
1556
+ }
1557
+ /**
1558
+ * Creates a new async iterator which will iterate over the responses received from the listRateCards operation. This iterator
1559
+ * will fetch more data from the server as needed.
1560
+ *
1561
+ * @param request a request which can be sent to the service operation
1562
+ */
1563
+ listRateCardsResponseIterator(request) {
1564
+ return oci_common_1.paginateResponses(request, req => this.listRateCards(req));
1565
+ }
1566
+ }
1567
+ exports.RatecardClient = RatecardClient;
1568
+ RatecardClient.serviceEndpointTemplate = "https://identity.{region}.oci.{secondLevelDomain}";
1569
+ RatecardClient.endpointServiceName = "";
1570
+ var SubscribedServiceApiKeys;
1571
+ (function (SubscribedServiceApiKeys) {
1572
+ })(SubscribedServiceApiKeys = exports.SubscribedServiceApiKeys || (exports.SubscribedServiceApiKeys = {}));
1573
+ /**
1574
+ * This service client uses {@link common.CircuitBreaker.DefaultConfiguration} for all the operations by default if no circuit breaker configuration is defined by the user.
1575
+ */
1576
+ class SubscribedServiceClient {
1577
+ constructor(params, clientConfiguration) {
1578
+ this["_endpoint"] = "";
1579
+ this["_defaultHeaders"] = {};
1580
+ this._circuitBreaker = null;
1581
+ this._httpOptions = undefined;
1582
+ this.targetService = "SubscribedService";
1583
+ const requestSigner = params.authenticationDetailsProvider
1584
+ ? new common.DefaultRequestSigner(params.authenticationDetailsProvider)
1585
+ : null;
1586
+ if (clientConfiguration) {
1587
+ this._clientConfiguration = clientConfiguration;
1588
+ this._circuitBreaker = clientConfiguration.circuitBreaker
1589
+ ? clientConfiguration.circuitBreaker.circuit
1590
+ : null;
1591
+ this._httpOptions = clientConfiguration.httpOptions
1592
+ ? clientConfiguration.httpOptions
1593
+ : undefined;
1594
+ }
1595
+ // if circuit breaker is not created, check if circuit breaker system is enabled to use default circuit breaker
1596
+ const specCircuitBreakerEnabled = true;
1597
+ if (!this._circuitBreaker &&
1598
+ common.utils.isCircuitBreakerSystemEnabled(clientConfiguration) &&
1599
+ (specCircuitBreakerEnabled || common.CircuitBreaker.DefaultCircuitBreakerOverriden)) {
1600
+ this._circuitBreaker = new common.CircuitBreaker().circuit;
1601
+ }
1602
+ this._httpClient =
1603
+ params.httpClient ||
1604
+ new common.FetchHttpClient(requestSigner, this._circuitBreaker, this._httpOptions);
1605
+ if (params.authenticationDetailsProvider &&
1606
+ common.isRegionProvider(params.authenticationDetailsProvider)) {
1607
+ const provider = params.authenticationDetailsProvider;
1608
+ if (provider.getRegion()) {
1609
+ this.region = provider.getRegion();
1610
+ }
1611
+ }
1612
+ }
1613
+ /**
1614
+ * Get the endpoint that is being used to call (ex, https://www.example.com).
1615
+ */
1616
+ get endpoint() {
1617
+ return this._endpoint;
1618
+ }
1619
+ /**
1620
+ * Sets the endpoint to call (ex, https://www.example.com).
1621
+ * @param endpoint The endpoint of the service.
1622
+ */
1623
+ set endpoint(endpoint) {
1624
+ this._endpoint = endpoint;
1625
+ this._endpoint = this._endpoint + "/20190111";
1626
+ if (this.logger)
1627
+ this.logger.info(`SubscribedServiceClient endpoint set to ${this._endpoint}`);
1628
+ }
1629
+ get logger() {
1630
+ return common.LOG.logger;
1631
+ }
1632
+ /**
1633
+ * Sets the region to call (ex, Region.US_PHOENIX_1).
1634
+ * Note, this will call {@link #endpoint(String) endpoint} after resolving the endpoint.
1635
+ * @param region The region of the service.
1636
+ */
1637
+ set region(region) {
1638
+ this.endpoint = common.EndpointBuilder.createEndpointFromRegion(SubscribedServiceClient.serviceEndpointTemplate, region, SubscribedServiceClient.endpointServiceName);
1639
+ }
1640
+ /**
1641
+ * Sets the regionId to call (ex, 'us-phoenix-1').
1642
+ *
1643
+ * Note, this will first try to map the region ID to a known Region and call {@link #region(Region) region}.
1644
+ * If no known Region could be determined, it will create an endpoint assuming its in default Realm OC1
1645
+ * and then call {@link #endpoint(String) endpoint}.
1646
+ * @param regionId The public region ID.
1647
+ */
1648
+ set regionId(regionId) {
1649
+ this.endpoint = common.EndpointBuilder.createEndpointFromRegionId(SubscribedServiceClient.serviceEndpointTemplate, regionId, SubscribedServiceClient.endpointServiceName);
1650
+ }
1651
+ /**
1652
+ * This API returns the subscribed service details corresponding to the id provided
1653
+ *
1654
+ * This operation does not retry by default if the user has not defined a retry configuration.
1655
+ * @param GetSubscribedServiceRequest
1656
+ * @return GetSubscribedServiceResponse
1657
+ * @throws OciError when an error occurs
1658
+ * @example Click {@link https://docs.cloud.oracle.com/en-us/iaas/tools/typescript-sdk-examples/2.31.0/onesubscription/GetSubscribedService.ts.html |here} to see how to use GetSubscribedService API.
1659
+ */
1660
+ getSubscribedService(getSubscribedServiceRequest) {
1661
+ return __awaiter(this, void 0, void 0, function* () {
1662
+ if (this.logger)
1663
+ this.logger.debug("Calling operation SubscribedServiceClient#getSubscribedService.");
1664
+ const operationName = "getSubscribedService";
1665
+ const apiReferenceLink = "";
1666
+ const pathParams = {
1667
+ "{subscribedServiceId}": getSubscribedServiceRequest.subscribedServiceId
1668
+ };
1669
+ const queryParams = {
1670
+ "fields": getSubscribedServiceRequest.fields
1671
+ };
1672
+ let headerParams = {
1673
+ "Content-Type": common.Constants.APPLICATION_JSON,
1674
+ "opc-request-id": getSubscribedServiceRequest.opcRequestId
1675
+ };
1676
+ const specRetryConfiguration = common.NoRetryConfigurationDetails;
1677
+ const retrier = oci_common_2.GenericRetrier.createPreferredRetrier(this._clientConfiguration ? this._clientConfiguration.retryConfiguration : undefined, getSubscribedServiceRequest.retryConfiguration, specRetryConfiguration);
1678
+ if (this.logger)
1679
+ retrier.logger = this.logger;
1680
+ const request = yield oci_common_2.composeRequest({
1681
+ baseEndpoint: this._endpoint,
1682
+ defaultHeaders: this._defaultHeaders,
1683
+ path: "/subscribedServices/{subscribedServiceId}",
1684
+ method: "GET",
1685
+ pathParams: pathParams,
1686
+ headerParams: headerParams,
1687
+ queryParams: queryParams
1688
+ });
1689
+ try {
1690
+ const response = yield retrier.makeServiceCall(this._httpClient, request, this.targetService, operationName, apiReferenceLink);
1691
+ const sdkResponse = oci_common_2.composeResponse({
1692
+ responseObject: {},
1693
+ body: yield response.json(),
1694
+ bodyKey: "subscribedService",
1695
+ bodyModel: model.SubscribedService,
1696
+ type: "model.SubscribedService",
1697
+ responseHeaders: [
1698
+ {
1699
+ value: response.headers.get("opc-request-id"),
1700
+ key: "opcRequestId",
1701
+ dataType: "string"
1702
+ }
1703
+ ]
1704
+ });
1705
+ return sdkResponse;
1706
+ }
1707
+ catch (err) {
1708
+ throw err;
1709
+ }
1710
+ });
1711
+ }
1712
+ /**
1713
+ * This list API returns all subscribed services for given Subscription ID
1714
+ *
1715
+ * This operation does not retry by default if the user has not defined a retry configuration.
1716
+ * @param ListSubscribedServicesRequest
1717
+ * @return ListSubscribedServicesResponse
1718
+ * @throws OciError when an error occurs
1719
+ * @example Click {@link https://docs.cloud.oracle.com/en-us/iaas/tools/typescript-sdk-examples/2.31.0/onesubscription/ListSubscribedServices.ts.html |here} to see how to use ListSubscribedServices API.
1720
+ */
1721
+ listSubscribedServices(listSubscribedServicesRequest) {
1722
+ return __awaiter(this, void 0, void 0, function* () {
1723
+ if (this.logger)
1724
+ this.logger.debug("Calling operation SubscribedServiceClient#listSubscribedServices.");
1725
+ const operationName = "listSubscribedServices";
1726
+ const apiReferenceLink = "";
1727
+ const pathParams = {};
1728
+ const queryParams = {
1729
+ "compartmentId": listSubscribedServicesRequest.compartmentId,
1730
+ "subscriptionId": listSubscribedServicesRequest.subscriptionId,
1731
+ "orderLineId": listSubscribedServicesRequest.orderLineId,
1732
+ "status": listSubscribedServicesRequest.status,
1733
+ "limit": listSubscribedServicesRequest.limit,
1734
+ "page": listSubscribedServicesRequest.page,
1735
+ "sortOrder": listSubscribedServicesRequest.sortOrder,
1736
+ "sortBy": listSubscribedServicesRequest.sortBy
1737
+ };
1738
+ let headerParams = {
1739
+ "Content-Type": common.Constants.APPLICATION_JSON,
1740
+ "opc-request-id": listSubscribedServicesRequest.opcRequestId
1741
+ };
1742
+ const specRetryConfiguration = common.NoRetryConfigurationDetails;
1743
+ const retrier = oci_common_2.GenericRetrier.createPreferredRetrier(this._clientConfiguration ? this._clientConfiguration.retryConfiguration : undefined, listSubscribedServicesRequest.retryConfiguration, specRetryConfiguration);
1744
+ if (this.logger)
1745
+ retrier.logger = this.logger;
1746
+ const request = yield oci_common_2.composeRequest({
1747
+ baseEndpoint: this._endpoint,
1748
+ defaultHeaders: this._defaultHeaders,
1749
+ path: "/subscribedServices",
1750
+ method: "GET",
1751
+ pathParams: pathParams,
1752
+ headerParams: headerParams,
1753
+ queryParams: queryParams
1754
+ });
1755
+ try {
1756
+ const response = yield retrier.makeServiceCall(this._httpClient, request, this.targetService, operationName, apiReferenceLink);
1757
+ const sdkResponse = oci_common_2.composeResponse({
1758
+ responseObject: {},
1759
+ body: yield response.json(),
1760
+ bodyKey: "items",
1761
+ bodyModel: model.SubscribedServiceSummary,
1762
+ type: "Array<model.SubscribedServiceSummary>",
1763
+ responseHeaders: [
1764
+ {
1765
+ value: response.headers.get("opc-next-page"),
1766
+ key: "opcNextPage",
1767
+ dataType: "string"
1768
+ },
1769
+ {
1770
+ value: response.headers.get("opc-request-id"),
1771
+ key: "opcRequestId",
1772
+ dataType: "string"
1773
+ }
1774
+ ]
1775
+ });
1776
+ return sdkResponse;
1777
+ }
1778
+ catch (err) {
1779
+ throw err;
1780
+ }
1781
+ });
1782
+ }
1783
+ /**
1784
+ * NOTE: This function is deprecated in favor of listSubscribedServicesRecordIterator function.
1785
+ * Creates a new async iterator which will iterate over the models.SubscribedServiceSummary objects
1786
+ * contained in responses from the listSubscribedServices operation. This iterator will fetch more data from the
1787
+ * server as needed.
1788
+ *
1789
+ * @param request a request which can be sent to the service operation
1790
+ */
1791
+ listAllSubscribedServices(request) {
1792
+ return oci_common_1.paginateRecords(request, req => this.listSubscribedServices(req));
1793
+ }
1794
+ /**
1795
+ * NOTE: This function is deprecated in favor of listSubscribedServicesResponseIterator function.
1796
+ * Creates a new async iterator which will iterate over the responses received from the listSubscribedServices operation. This iterator
1797
+ * will fetch more data from the server as needed.
1798
+ *
1799
+ * @param request a request which can be sent to the service operation
1800
+ */
1801
+ listAllSubscribedServicesResponses(request) {
1802
+ return oci_common_1.paginateResponses(request, req => this.listSubscribedServices(req));
1803
+ }
1804
+ /**
1805
+ * Creates a new async iterator which will iterate over the models.SubscribedServiceSummary objects
1806
+ * contained in responses from the listSubscribedServices operation. This iterator will fetch more data from the
1807
+ * server as needed.
1808
+ *
1809
+ * @param request a request which can be sent to the service operation
1810
+ */
1811
+ listSubscribedServicesRecordIterator(request) {
1812
+ return oci_common_1.paginateRecords(request, req => this.listSubscribedServices(req));
1813
+ }
1814
+ /**
1815
+ * Creates a new async iterator which will iterate over the responses received from the listSubscribedServices operation. This iterator
1816
+ * will fetch more data from the server as needed.
1817
+ *
1818
+ * @param request a request which can be sent to the service operation
1819
+ */
1820
+ listSubscribedServicesResponseIterator(request) {
1821
+ return oci_common_1.paginateResponses(request, req => this.listSubscribedServices(req));
1822
+ }
1823
+ }
1824
+ exports.SubscribedServiceClient = SubscribedServiceClient;
1825
+ SubscribedServiceClient.serviceEndpointTemplate = "https://identity.{region}.oci.{secondLevelDomain}";
1826
+ SubscribedServiceClient.endpointServiceName = "";
1827
+ var SubscriptionApiKeys;
1828
+ (function (SubscriptionApiKeys) {
1829
+ })(SubscriptionApiKeys = exports.SubscriptionApiKeys || (exports.SubscriptionApiKeys = {}));
1830
+ /**
1831
+ * This service client uses {@link common.CircuitBreaker.DefaultConfiguration} for all the operations by default if no circuit breaker configuration is defined by the user.
1832
+ */
1833
+ class SubscriptionClient {
1834
+ constructor(params, clientConfiguration) {
1835
+ this["_endpoint"] = "";
1836
+ this["_defaultHeaders"] = {};
1837
+ this._circuitBreaker = null;
1838
+ this._httpOptions = undefined;
1839
+ this.targetService = "Subscription";
1840
+ const requestSigner = params.authenticationDetailsProvider
1841
+ ? new common.DefaultRequestSigner(params.authenticationDetailsProvider)
1842
+ : null;
1843
+ if (clientConfiguration) {
1844
+ this._clientConfiguration = clientConfiguration;
1845
+ this._circuitBreaker = clientConfiguration.circuitBreaker
1846
+ ? clientConfiguration.circuitBreaker.circuit
1847
+ : null;
1848
+ this._httpOptions = clientConfiguration.httpOptions
1849
+ ? clientConfiguration.httpOptions
1850
+ : undefined;
1851
+ }
1852
+ // if circuit breaker is not created, check if circuit breaker system is enabled to use default circuit breaker
1853
+ const specCircuitBreakerEnabled = true;
1854
+ if (!this._circuitBreaker &&
1855
+ common.utils.isCircuitBreakerSystemEnabled(clientConfiguration) &&
1856
+ (specCircuitBreakerEnabled || common.CircuitBreaker.DefaultCircuitBreakerOverriden)) {
1857
+ this._circuitBreaker = new common.CircuitBreaker().circuit;
1858
+ }
1859
+ this._httpClient =
1860
+ params.httpClient ||
1861
+ new common.FetchHttpClient(requestSigner, this._circuitBreaker, this._httpOptions);
1862
+ if (params.authenticationDetailsProvider &&
1863
+ common.isRegionProvider(params.authenticationDetailsProvider)) {
1864
+ const provider = params.authenticationDetailsProvider;
1865
+ if (provider.getRegion()) {
1866
+ this.region = provider.getRegion();
1867
+ }
1868
+ }
1869
+ }
1870
+ /**
1871
+ * Get the endpoint that is being used to call (ex, https://www.example.com).
1872
+ */
1873
+ get endpoint() {
1874
+ return this._endpoint;
1875
+ }
1876
+ /**
1877
+ * Sets the endpoint to call (ex, https://www.example.com).
1878
+ * @param endpoint The endpoint of the service.
1879
+ */
1880
+ set endpoint(endpoint) {
1881
+ this._endpoint = endpoint;
1882
+ this._endpoint = this._endpoint + "/20190111";
1883
+ if (this.logger)
1884
+ this.logger.info(`SubscriptionClient endpoint set to ${this._endpoint}`);
1885
+ }
1886
+ get logger() {
1887
+ return common.LOG.logger;
1888
+ }
1889
+ /**
1890
+ * Sets the region to call (ex, Region.US_PHOENIX_1).
1891
+ * Note, this will call {@link #endpoint(String) endpoint} after resolving the endpoint.
1892
+ * @param region The region of the service.
1893
+ */
1894
+ set region(region) {
1895
+ this.endpoint = common.EndpointBuilder.createEndpointFromRegion(SubscriptionClient.serviceEndpointTemplate, region, SubscriptionClient.endpointServiceName);
1896
+ }
1897
+ /**
1898
+ * Sets the regionId to call (ex, 'us-phoenix-1').
1899
+ *
1900
+ * Note, this will first try to map the region ID to a known Region and call {@link #region(Region) region}.
1901
+ * If no known Region could be determined, it will create an endpoint assuming its in default Realm OC1
1902
+ * and then call {@link #endpoint(String) endpoint}.
1903
+ * @param regionId The public region ID.
1904
+ */
1905
+ set regionId(regionId) {
1906
+ this.endpoint = common.EndpointBuilder.createEndpointFromRegionId(SubscriptionClient.serviceEndpointTemplate, regionId, SubscriptionClient.endpointServiceName);
1907
+ }
1908
+ /**
1909
+ * This list API returns all subscriptions for a given plan number or subscription id or buyer email
1910
+ * and provides additional parameters to include ratecard and commitment details.
1911
+ * This API expects exactly one of the above mentioned parameters as input. If more than one parameters are provided the API will throw
1912
+ * a 400 - invalid parameters exception and if no parameters are provided it will throw a 400 - missing parameter exception
1913
+ *
1914
+ * This operation does not retry by default if the user has not defined a retry configuration.
1915
+ * @param ListSubscriptionsRequest
1916
+ * @return ListSubscriptionsResponse
1917
+ * @throws OciError when an error occurs
1918
+ * @example Click {@link https://docs.cloud.oracle.com/en-us/iaas/tools/typescript-sdk-examples/2.31.0/onesubscription/ListSubscriptions.ts.html |here} to see how to use ListSubscriptions API.
1919
+ */
1920
+ listSubscriptions(listSubscriptionsRequest) {
1921
+ return __awaiter(this, void 0, void 0, function* () {
1922
+ if (this.logger)
1923
+ this.logger.debug("Calling operation SubscriptionClient#listSubscriptions.");
1924
+ const operationName = "listSubscriptions";
1925
+ const apiReferenceLink = "";
1926
+ const pathParams = {};
1927
+ const queryParams = {
1928
+ "compartmentId": listSubscriptionsRequest.compartmentId,
1929
+ "planNumber": listSubscriptionsRequest.planNumber,
1930
+ "subscriptionId": listSubscriptionsRequest.subscriptionId,
1931
+ "buyerEmail": listSubscriptionsRequest.buyerEmail,
1932
+ "isCommitInfoRequired": listSubscriptionsRequest.isCommitInfoRequired,
1933
+ "limit": listSubscriptionsRequest.limit,
1934
+ "page": listSubscriptionsRequest.page,
1935
+ "sortOrder": listSubscriptionsRequest.sortOrder,
1936
+ "sortBy": listSubscriptionsRequest.sortBy
1937
+ };
1938
+ let headerParams = {
1939
+ "Content-Type": common.Constants.APPLICATION_JSON,
1940
+ "opc-request-id": listSubscriptionsRequest.opcRequestId
1941
+ };
1942
+ const specRetryConfiguration = common.NoRetryConfigurationDetails;
1943
+ const retrier = oci_common_2.GenericRetrier.createPreferredRetrier(this._clientConfiguration ? this._clientConfiguration.retryConfiguration : undefined, listSubscriptionsRequest.retryConfiguration, specRetryConfiguration);
1944
+ if (this.logger)
1945
+ retrier.logger = this.logger;
1946
+ const request = yield oci_common_2.composeRequest({
1947
+ baseEndpoint: this._endpoint,
1948
+ defaultHeaders: this._defaultHeaders,
1949
+ path: "/subscriptions",
1950
+ method: "GET",
1951
+ pathParams: pathParams,
1952
+ headerParams: headerParams,
1953
+ queryParams: queryParams
1954
+ });
1955
+ try {
1956
+ const response = yield retrier.makeServiceCall(this._httpClient, request, this.targetService, operationName, apiReferenceLink);
1957
+ const sdkResponse = oci_common_2.composeResponse({
1958
+ responseObject: {},
1959
+ body: yield response.json(),
1960
+ bodyKey: "items",
1961
+ bodyModel: model.SubscriptionSummary,
1962
+ type: "Array<model.SubscriptionSummary>",
1963
+ responseHeaders: [
1964
+ {
1965
+ value: response.headers.get("opc-next-page"),
1966
+ key: "opcNextPage",
1967
+ dataType: "string"
1968
+ },
1969
+ {
1970
+ value: response.headers.get("opc-request-id"),
1971
+ key: "opcRequestId",
1972
+ dataType: "string"
1973
+ }
1974
+ ]
1975
+ });
1976
+ return sdkResponse;
1977
+ }
1978
+ catch (err) {
1979
+ throw err;
1980
+ }
1981
+ });
1982
+ }
1983
+ /**
1984
+ * NOTE: This function is deprecated in favor of listSubscriptionsRecordIterator function.
1985
+ * Creates a new async iterator which will iterate over the models.SubscriptionSummary objects
1986
+ * contained in responses from the listSubscriptions operation. This iterator will fetch more data from the
1987
+ * server as needed.
1988
+ *
1989
+ * @param request a request which can be sent to the service operation
1990
+ */
1991
+ listAllSubscriptions(request) {
1992
+ return oci_common_1.paginateRecords(request, req => this.listSubscriptions(req));
1993
+ }
1994
+ /**
1995
+ * NOTE: This function is deprecated in favor of listSubscriptionsResponseIterator function.
1996
+ * Creates a new async iterator which will iterate over the responses received from the listSubscriptions operation. This iterator
1997
+ * will fetch more data from the server as needed.
1998
+ *
1999
+ * @param request a request which can be sent to the service operation
2000
+ */
2001
+ listAllSubscriptionsResponses(request) {
2002
+ return oci_common_1.paginateResponses(request, req => this.listSubscriptions(req));
2003
+ }
2004
+ /**
2005
+ * Creates a new async iterator which will iterate over the models.SubscriptionSummary objects
2006
+ * contained in responses from the listSubscriptions operation. This iterator will fetch more data from the
2007
+ * server as needed.
2008
+ *
2009
+ * @param request a request which can be sent to the service operation
2010
+ */
2011
+ listSubscriptionsRecordIterator(request) {
2012
+ return oci_common_1.paginateRecords(request, req => this.listSubscriptions(req));
2013
+ }
2014
+ /**
2015
+ * Creates a new async iterator which will iterate over the responses received from the listSubscriptions operation. This iterator
2016
+ * will fetch more data from the server as needed.
2017
+ *
2018
+ * @param request a request which can be sent to the service operation
2019
+ */
2020
+ listSubscriptionsResponseIterator(request) {
2021
+ return oci_common_1.paginateResponses(request, req => this.listSubscriptions(req));
2022
+ }
2023
+ }
2024
+ exports.SubscriptionClient = SubscriptionClient;
2025
+ SubscriptionClient.serviceEndpointTemplate = "https://identity.{region}.oci.{secondLevelDomain}";
2026
+ SubscriptionClient.endpointServiceName = "";
2027
+ //# sourceMappingURL=client.js.map