oci-resourcescheduler 2.86.3

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 (182) 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 +22 -0
  6. package/index.js +45 -0
  7. package/index.js.map +1 -0
  8. package/lib/client.d.ts +215 -0
  9. package/lib/client.js +1060 -0
  10. package/lib/client.js.map +1 -0
  11. package/lib/model/action-type.d.ts +32 -0
  12. package/lib/model/action-type.js +43 -0
  13. package/lib/model/action-type.js.map +1 -0
  14. package/lib/model/compartment-id-resource-filter.d.ts +32 -0
  15. package/lib/model/compartment-id-resource-filter.js +54 -0
  16. package/lib/model/compartment-id-resource-filter.js.map +1 -0
  17. package/lib/model/create-schedule-details.d.ts +100 -0
  18. package/lib/model/create-schedule-details.js +81 -0
  19. package/lib/model/create-schedule-details.js.map +1 -0
  20. package/lib/model/defined-tag-filter-value.d.ts +33 -0
  21. package/lib/model/defined-tag-filter-value.js +29 -0
  22. package/lib/model/defined-tag-filter-value.js.map +1 -0
  23. package/lib/model/defined-tags-resource-filter.d.ts +28 -0
  24. package/lib/model/defined-tags-resource-filter.js +66 -0
  25. package/lib/model/defined-tags-resource-filter.js.map +1 -0
  26. package/lib/model/index.d.ts +66 -0
  27. package/lib/model/index.js +89 -0
  28. package/lib/model/index.js.map +1 -0
  29. package/lib/model/lifecycle-state-resource-filter.d.ts +28 -0
  30. package/lib/model/lifecycle-state-resource-filter.js +54 -0
  31. package/lib/model/lifecycle-state-resource-filter.js.map +1 -0
  32. package/lib/model/operation-status.d.ts +34 -0
  33. package/lib/model/operation-status.js +45 -0
  34. package/lib/model/operation-status.js.map +1 -0
  35. package/lib/model/operation-type.d.ts +31 -0
  36. package/lib/model/operation-type.js +42 -0
  37. package/lib/model/operation-type.js.map +1 -0
  38. package/lib/model/resource-filter.d.ts +22 -0
  39. package/lib/model/resource-filter.js +84 -0
  40. package/lib/model/resource-filter.js.map +1 -0
  41. package/lib/model/resource-type-collection.d.ts +27 -0
  42. package/lib/model/resource-type-collection.js +61 -0
  43. package/lib/model/resource-type-collection.js.map +1 -0
  44. package/lib/model/resource-type-resource-filter.d.ts +28 -0
  45. package/lib/model/resource-type-resource-filter.js +54 -0
  46. package/lib/model/resource-type-resource-filter.js.map +1 -0
  47. package/lib/model/resource-type.d.ts +27 -0
  48. package/lib/model/resource-type.js +29 -0
  49. package/lib/model/resource-type.js.map +1 -0
  50. package/lib/model/resource.d.ts +42 -0
  51. package/lib/model/resource.js +29 -0
  52. package/lib/model/resource.js.map +1 -0
  53. package/lib/model/schedule-collection.d.ts +26 -0
  54. package/lib/model/schedule-collection.js +61 -0
  55. package/lib/model/schedule-collection.js.map +1 -0
  56. package/lib/model/schedule-summary.d.ts +161 -0
  57. package/lib/model/schedule-summary.js +91 -0
  58. package/lib/model/schedule-summary.js.map +1 -0
  59. package/lib/model/schedule.d.ts +177 -0
  60. package/lib/model/schedule.js +106 -0
  61. package/lib/model/schedule.js.map +1 -0
  62. package/lib/model/sort-order.d.ts +25 -0
  63. package/lib/model/sort-order.js +36 -0
  64. package/lib/model/sort-order.js.map +1 -0
  65. package/lib/model/time-created-resource-filter.d.ts +42 -0
  66. package/lib/model/time-created-resource-filter.js +65 -0
  67. package/lib/model/time-created-resource-filter.js.map +1 -0
  68. package/lib/model/update-schedule-details.d.ts +96 -0
  69. package/lib/model/update-schedule-details.js +81 -0
  70. package/lib/model/update-schedule-details.js.map +1 -0
  71. package/lib/model/work-request-error-collection.d.ts +26 -0
  72. package/lib/model/work-request-error-collection.js +61 -0
  73. package/lib/model/work-request-error-collection.js.map +1 -0
  74. package/lib/model/work-request-error.d.ts +37 -0
  75. package/lib/model/work-request-error.js +29 -0
  76. package/lib/model/work-request-error.js.map +1 -0
  77. package/lib/model/work-request-log-entry-collection.d.ts +26 -0
  78. package/lib/model/work-request-log-entry-collection.js +61 -0
  79. package/lib/model/work-request-log-entry-collection.js.map +1 -0
  80. package/lib/model/work-request-log-entry.d.ts +31 -0
  81. package/lib/model/work-request-log-entry.js +29 -0
  82. package/lib/model/work-request-log-entry.js.map +1 -0
  83. package/lib/model/work-request-resource.d.ts +42 -0
  84. package/lib/model/work-request-resource.js +29 -0
  85. package/lib/model/work-request-resource.js.map +1 -0
  86. package/lib/model/work-request-summary-collection.d.ts +26 -0
  87. package/lib/model/work-request-summary-collection.js +61 -0
  88. package/lib/model/work-request-summary-collection.js.map +1 -0
  89. package/lib/model/work-request-summary.d.ts +73 -0
  90. package/lib/model/work-request-summary.js +61 -0
  91. package/lib/model/work-request-summary.js.map +1 -0
  92. package/lib/model/work-request.d.ts +76 -0
  93. package/lib/model/work-request.js +61 -0
  94. package/lib/model/work-request.js.map +1 -0
  95. package/lib/request/activate-schedule-request.d.ts +47 -0
  96. package/lib/request/activate-schedule-request.js +15 -0
  97. package/lib/request/activate-schedule-request.js.map +1 -0
  98. package/lib/request/cancel-work-request-request.d.ts +38 -0
  99. package/lib/request/cancel-work-request-request.js +15 -0
  100. package/lib/request/cancel-work-request-request.js.map +1 -0
  101. package/lib/request/create-schedule-request.d.ts +40 -0
  102. package/lib/request/create-schedule-request.js +15 -0
  103. package/lib/request/create-schedule-request.js.map +1 -0
  104. package/lib/request/deactivate-schedule-request.d.ts +47 -0
  105. package/lib/request/deactivate-schedule-request.js +15 -0
  106. package/lib/request/deactivate-schedule-request.js.map +1 -0
  107. package/lib/request/delete-schedule-request.d.ts +38 -0
  108. package/lib/request/delete-schedule-request.js +15 -0
  109. package/lib/request/delete-schedule-request.js.map +1 -0
  110. package/lib/request/get-schedule-request.d.ts +30 -0
  111. package/lib/request/get-schedule-request.js +15 -0
  112. package/lib/request/get-schedule-request.js.map +1 -0
  113. package/lib/request/get-work-request-request.d.ts +30 -0
  114. package/lib/request/get-work-request-request.js +15 -0
  115. package/lib/request/get-work-request-request.js.map +1 -0
  116. package/lib/request/index.d.ts +38 -0
  117. package/lib/request/index.js +43 -0
  118. package/lib/request/index.js.map +1 -0
  119. package/lib/request/list-resource-types-request.d.ts +44 -0
  120. package/lib/request/list-resource-types-request.js +15 -0
  121. package/lib/request/list-resource-types-request.js.map +1 -0
  122. package/lib/request/list-schedules-request.d.ts +77 -0
  123. package/lib/request/list-schedules-request.js +26 -0
  124. package/lib/request/list-schedules-request.js.map +1 -0
  125. package/lib/request/list-work-request-errors-request.d.ts +59 -0
  126. package/lib/request/list-work-request-errors-request.js +23 -0
  127. package/lib/request/list-work-request-errors-request.js.map +1 -0
  128. package/lib/request/list-work-request-logs-request.d.ts +59 -0
  129. package/lib/request/list-work-request-logs-request.js +23 -0
  130. package/lib/request/list-work-request-logs-request.js.map +1 -0
  131. package/lib/request/list-work-requests-request.d.ts +75 -0
  132. package/lib/request/list-work-requests-request.js +23 -0
  133. package/lib/request/list-work-requests-request.js.map +1 -0
  134. package/lib/request/update-schedule-request.d.ts +43 -0
  135. package/lib/request/update-schedule-request.js +15 -0
  136. package/lib/request/update-schedule-request.js.map +1 -0
  137. package/lib/response/activate-schedule-response.d.ts +30 -0
  138. package/lib/response/activate-schedule-response.js +15 -0
  139. package/lib/response/activate-schedule-response.js.map +1 -0
  140. package/lib/response/cancel-work-request-response.d.ts +20 -0
  141. package/lib/response/cancel-work-request-response.js +15 -0
  142. package/lib/response/cancel-work-request-response.js.map +1 -0
  143. package/lib/response/create-schedule-response.d.ts +44 -0
  144. package/lib/response/create-schedule-response.js +15 -0
  145. package/lib/response/create-schedule-response.js.map +1 -0
  146. package/lib/response/deactivate-schedule-response.d.ts +30 -0
  147. package/lib/response/deactivate-schedule-response.js +15 -0
  148. package/lib/response/deactivate-schedule-response.js.map +1 -0
  149. package/lib/response/delete-schedule-response.d.ts +20 -0
  150. package/lib/response/delete-schedule-response.js +15 -0
  151. package/lib/response/delete-schedule-response.js.map +1 -0
  152. package/lib/response/get-schedule-response.d.ts +30 -0
  153. package/lib/response/get-schedule-response.js +15 -0
  154. package/lib/response/get-schedule-response.js.map +1 -0
  155. package/lib/response/get-work-request-response.d.ts +34 -0
  156. package/lib/response/get-work-request-response.js +15 -0
  157. package/lib/response/get-work-request-response.js.map +1 -0
  158. package/lib/response/index.d.ts +38 -0
  159. package/lib/response/index.js +15 -0
  160. package/lib/response/index.js.map +1 -0
  161. package/lib/response/list-resource-types-response.d.ts +31 -0
  162. package/lib/response/list-resource-types-response.js +15 -0
  163. package/lib/response/list-resource-types-response.js.map +1 -0
  164. package/lib/response/list-schedules-response.d.ts +31 -0
  165. package/lib/response/list-schedules-response.js +15 -0
  166. package/lib/response/list-schedules-response.js.map +1 -0
  167. package/lib/response/list-work-request-errors-response.d.ts +31 -0
  168. package/lib/response/list-work-request-errors-response.js +15 -0
  169. package/lib/response/list-work-request-errors-response.js.map +1 -0
  170. package/lib/response/list-work-request-logs-response.d.ts +31 -0
  171. package/lib/response/list-work-request-logs-response.js +15 -0
  172. package/lib/response/list-work-request-logs-response.js.map +1 -0
  173. package/lib/response/list-work-requests-response.d.ts +31 -0
  174. package/lib/response/list-work-requests-response.js +15 -0
  175. package/lib/response/list-work-requests-response.js.map +1 -0
  176. package/lib/response/update-schedule-response.d.ts +26 -0
  177. package/lib/response/update-schedule-response.js +15 -0
  178. package/lib/response/update-schedule-response.js.map +1 -0
  179. package/lib/schedule-waiter.d.ts +36 -0
  180. package/lib/schedule-waiter.js +76 -0
  181. package/lib/schedule-waiter.js.map +1 -0
  182. package/package.json +29 -0
package/lib/client.js ADDED
@@ -0,0 +1,1060 @@
1
+ "use strict";
2
+ /**
3
+ * Resource Scheduler API
4
+ * Use the Resource scheduler API to manage schedules, to perform actions on a collection of resources.
5
+ * OpenAPI spec version: 20240430
6
+ *
7
+ *
8
+ * NOTE: This class is auto generated by OracleSDKGenerator.
9
+ * Do not edit the class manually.
10
+ *
11
+ * Copyright (c) 2020, 2024, Oracle and/or its affiliates. All rights reserved.
12
+ * 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.
13
+ */
14
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
15
+ if (k2 === undefined) k2 = k;
16
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
17
+ }) : (function(o, m, k, k2) {
18
+ if (k2 === undefined) k2 = k;
19
+ o[k2] = m[k];
20
+ }));
21
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
22
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
23
+ }) : function(o, v) {
24
+ o["default"] = v;
25
+ });
26
+ var __importStar = (this && this.__importStar) || function (mod) {
27
+ if (mod && mod.__esModule) return mod;
28
+ var result = {};
29
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
30
+ __setModuleDefault(result, mod);
31
+ return result;
32
+ };
33
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
34
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
35
+ return new (P || (P = Promise))(function (resolve, reject) {
36
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
37
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
38
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
39
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
40
+ });
41
+ };
42
+ Object.defineProperty(exports, "__esModule", { value: true });
43
+ exports.ScheduleClient = exports.ScheduleApiKeys = void 0;
44
+ const common = require("oci-common");
45
+ const model = __importStar(require("./model"));
46
+ const schedule_waiter_1 = require("./schedule-waiter");
47
+ const oci_common_1 = require("oci-common");
48
+ const Breaker = require("opossum");
49
+ // ===============================================
50
+ // This file is autogenerated - Please do not edit
51
+ // ===============================================
52
+ var ScheduleApiKeys;
53
+ (function (ScheduleApiKeys) {
54
+ })(ScheduleApiKeys = exports.ScheduleApiKeys || (exports.ScheduleApiKeys = {}));
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 ScheduleClient {
59
+ constructor(params, clientConfiguration) {
60
+ this["_realmSpecificEndpointTemplateEnabled"] = undefined;
61
+ this["_endpoint"] = "";
62
+ this["_defaultHeaders"] = {};
63
+ this._circuitBreaker = null;
64
+ this._httpOptions = undefined;
65
+ this._bodyDuplexMode = undefined;
66
+ this.targetService = "Schedule";
67
+ this._regionId = "";
68
+ this._lastSetRegionOrRegionId = "";
69
+ const requestSigner = params.authenticationDetailsProvider
70
+ ? new common.DefaultRequestSigner(params.authenticationDetailsProvider)
71
+ : null;
72
+ if (clientConfiguration) {
73
+ this._clientConfiguration = clientConfiguration;
74
+ this._circuitBreaker = clientConfiguration.circuitBreaker
75
+ ? clientConfiguration.circuitBreaker.circuit
76
+ : null;
77
+ this._httpOptions = clientConfiguration.httpOptions
78
+ ? clientConfiguration.httpOptions
79
+ : undefined;
80
+ this._bodyDuplexMode = clientConfiguration.bodyDuplexMode
81
+ ? clientConfiguration.bodyDuplexMode
82
+ : undefined;
83
+ }
84
+ if (!oci_common_1.developerToolConfiguration.isServiceEnabled("resourcescheduler")) {
85
+ let errmsg = "The developerToolConfiguration configuration disabled this service, this behavior is controlled by developerToolConfiguration.ociEnabledServiceSet variable. Please check if your local developer_tool_configuration file has configured the service you're targeting or contact the cloud provider on the availability of this service : ";
86
+ throw errmsg.concat("resourcescheduler");
87
+ }
88
+ // if circuit breaker is not created, check if circuit breaker system is enabled to use default circuit breaker
89
+ const specCircuitBreakerEnabled = true;
90
+ if (!this._circuitBreaker &&
91
+ common.utils.isCircuitBreakerSystemEnabled(clientConfiguration) &&
92
+ (specCircuitBreakerEnabled || common.CircuitBreaker.DefaultCircuitBreakerOverriden)) {
93
+ this._circuitBreaker = new common.CircuitBreaker().circuit;
94
+ }
95
+ this._httpClient =
96
+ params.httpClient ||
97
+ new common.FetchHttpClient(requestSigner, this._circuitBreaker, this._httpOptions, this._bodyDuplexMode);
98
+ if (params.authenticationDetailsProvider &&
99
+ common.isRegionProvider(params.authenticationDetailsProvider)) {
100
+ const provider = params.authenticationDetailsProvider;
101
+ if (provider.getRegion()) {
102
+ this.region = provider.getRegion();
103
+ }
104
+ }
105
+ }
106
+ /**
107
+ * Get the endpoint that is being used to call (ex, https://www.example.com).
108
+ */
109
+ get endpoint() {
110
+ return this._endpoint;
111
+ }
112
+ /**
113
+ * Sets the endpoint to call (ex, https://www.example.com).
114
+ * @param endpoint The endpoint of the service.
115
+ */
116
+ set endpoint(endpoint) {
117
+ this._endpoint = endpoint;
118
+ this._endpoint = this._endpoint + "/20240430";
119
+ if (this.logger)
120
+ this.logger.info(`ScheduleClient endpoint set to ${this._endpoint}`);
121
+ }
122
+ get logger() {
123
+ return common.LOG.logger;
124
+ }
125
+ /**
126
+ * Determines whether realm specific endpoint should be used or not.
127
+ * Set realmSpecificEndpointTemplateEnabled to "true" if the user wants to enable use of realm specific endpoint template, otherwise set it to "false"
128
+ * @param realmSpecificEndpointTemplateEnabled flag to enable the use of realm specific endpoint template
129
+ */
130
+ set useRealmSpecificEndpointTemplate(realmSpecificEndpointTemplateEnabled) {
131
+ this._realmSpecificEndpointTemplateEnabled = realmSpecificEndpointTemplateEnabled;
132
+ if (this.logger)
133
+ this.logger.info(`realmSpecificEndpointTemplateEnabled set to ${this._realmSpecificEndpointTemplateEnabled}`);
134
+ if (this._lastSetRegionOrRegionId === common.Region.REGION_STRING) {
135
+ this.endpoint = common.EndpointBuilder.createEndpointFromRegion(ScheduleClient.serviceEndpointTemplate, this._region, ScheduleClient.endpointServiceName);
136
+ }
137
+ else if (this._lastSetRegionOrRegionId === common.Region.REGION_ID_STRING) {
138
+ this.endpoint = common.EndpointBuilder.createEndpointFromRegionId(ScheduleClient.serviceEndpointTemplate, this._regionId, ScheduleClient.endpointServiceName);
139
+ }
140
+ }
141
+ /**
142
+ * Sets the region to call (ex, Region.US_PHOENIX_1).
143
+ * Note, this will call {@link #endpoint(String) endpoint} after resolving the endpoint.
144
+ * @param region The region of the service.
145
+ */
146
+ set region(region) {
147
+ this._region = region;
148
+ this.endpoint = common.EndpointBuilder.createEndpointFromRegion(ScheduleClient.serviceEndpointTemplate, region, ScheduleClient.endpointServiceName);
149
+ this._lastSetRegionOrRegionId = common.Region.REGION_STRING;
150
+ }
151
+ /**
152
+ * Sets the regionId to call (ex, 'us-phoenix-1').
153
+ *
154
+ * Note, this will first try to map the region ID to a known Region and call {@link #region(Region) region}.
155
+ * If no known Region could be determined, it will create an endpoint assuming its in default Realm OC1
156
+ * and then call {@link #endpoint(String) endpoint}.
157
+ * @param regionId The public region ID.
158
+ */
159
+ set regionId(regionId) {
160
+ this._regionId = regionId;
161
+ this.endpoint = common.EndpointBuilder.createEndpointFromRegionId(ScheduleClient.serviceEndpointTemplate, regionId, ScheduleClient.endpointServiceName);
162
+ this._lastSetRegionOrRegionId = common.Region.REGION_ID_STRING;
163
+ }
164
+ /**
165
+ * Creates a new ScheduleWaiter for resources for this service.
166
+ *
167
+ * @param config The waiter configuration for termination and delay strategy
168
+ * @return The service waiters.
169
+ */
170
+ createWaiters(config) {
171
+ this._waiters = new schedule_waiter_1.ScheduleWaiter(this, config);
172
+ return this._waiters;
173
+ }
174
+ /**
175
+ * Gets the waiters available for resources for this service.
176
+ *
177
+ * @return The service waiters.
178
+ */
179
+ getWaiters() {
180
+ if (this._waiters) {
181
+ return this._waiters;
182
+ }
183
+ throw Error("Waiters do not exist. Please create waiters.");
184
+ }
185
+ /**
186
+ * Shutdown the circuit breaker used by the client when it is no longer needed
187
+ */
188
+ shutdownCircuitBreaker() {
189
+ if (this._circuitBreaker) {
190
+ this._circuitBreaker.shutdown();
191
+ }
192
+ }
193
+ /**
194
+ * Close the client once it is no longer needed
195
+ */
196
+ close() {
197
+ this.shutdownCircuitBreaker();
198
+ }
199
+ /**
200
+ * This API activates a schedule.
201
+ * This operation uses {@link common.OciSdkDefaultRetryConfiguration} by default if no retry configuration is defined by the user.
202
+ * @param ActivateScheduleRequest
203
+ * @return ActivateScheduleResponse
204
+ * @throws OciError when an error occurs
205
+ * @example Click {@link https://docs.cloud.oracle.com/en-us/iaas/tools/typescript-sdk-examples/2.86.3/resourcescheduler/ActivateSchedule.ts.html |here} to see how to use ActivateSchedule API.
206
+ */
207
+ activateSchedule(activateScheduleRequest) {
208
+ return __awaiter(this, void 0, void 0, function* () {
209
+ if (this.logger)
210
+ this.logger.debug("Calling operation ScheduleClient#activateSchedule.");
211
+ const operationName = "activateSchedule";
212
+ const apiReferenceLink = "";
213
+ const pathParams = {
214
+ "{scheduleId}": activateScheduleRequest.scheduleId
215
+ };
216
+ const queryParams = {};
217
+ let headerParams = {
218
+ "Content-Type": common.Constants.APPLICATION_JSON,
219
+ "if-match": activateScheduleRequest.ifMatch,
220
+ "opc-request-id": activateScheduleRequest.opcRequestId,
221
+ "opc-retry-token": activateScheduleRequest.opcRetryToken
222
+ };
223
+ const specRetryConfiguration = common.OciSdkDefaultRetryConfiguration;
224
+ const retrier = oci_common_1.GenericRetrier.createPreferredRetrier(this._clientConfiguration ? this._clientConfiguration.retryConfiguration : undefined, activateScheduleRequest.retryConfiguration, specRetryConfiguration);
225
+ if (this.logger)
226
+ retrier.logger = this.logger;
227
+ const request = yield oci_common_1.composeRequest({
228
+ baseEndpoint: this._endpoint,
229
+ defaultHeaders: this._defaultHeaders,
230
+ path: "/schedules/{scheduleId}/actions/activateSchedule",
231
+ method: "POST",
232
+ pathParams: pathParams,
233
+ headerParams: headerParams,
234
+ queryParams: queryParams
235
+ });
236
+ try {
237
+ const response = yield retrier.makeServiceCall(this._httpClient, request, this.targetService, operationName, apiReferenceLink);
238
+ const sdkResponse = oci_common_1.composeResponse({
239
+ responseObject: {},
240
+ body: yield response.json(),
241
+ bodyKey: "schedule",
242
+ bodyModel: model.Schedule,
243
+ type: "model.Schedule",
244
+ responseHeaders: [
245
+ {
246
+ value: response.headers.get("opc-request-id"),
247
+ key: "opcRequestId",
248
+ dataType: "string"
249
+ },
250
+ {
251
+ value: response.headers.get("etag"),
252
+ key: "etag",
253
+ dataType: "string"
254
+ }
255
+ ]
256
+ });
257
+ return sdkResponse;
258
+ }
259
+ catch (err) {
260
+ throw err;
261
+ }
262
+ });
263
+ }
264
+ /**
265
+ * This API cancels a work request.
266
+ * This operation uses {@link common.OciSdkDefaultRetryConfiguration} by default if no retry configuration is defined by the user.
267
+ * @param CancelWorkRequestRequest
268
+ * @return CancelWorkRequestResponse
269
+ * @throws OciError when an error occurs
270
+ * @example Click {@link https://docs.cloud.oracle.com/en-us/iaas/tools/typescript-sdk-examples/2.86.3/resourcescheduler/CancelWorkRequest.ts.html |here} to see how to use CancelWorkRequest API.
271
+ */
272
+ cancelWorkRequest(cancelWorkRequestRequest) {
273
+ return __awaiter(this, void 0, void 0, function* () {
274
+ if (this.logger)
275
+ this.logger.debug("Calling operation ScheduleClient#cancelWorkRequest.");
276
+ const operationName = "cancelWorkRequest";
277
+ const apiReferenceLink = "";
278
+ const pathParams = {
279
+ "{workRequestId}": cancelWorkRequestRequest.workRequestId
280
+ };
281
+ const queryParams = {};
282
+ let headerParams = {
283
+ "Content-Type": common.Constants.APPLICATION_JSON,
284
+ "if-match": cancelWorkRequestRequest.ifMatch,
285
+ "opc-request-id": cancelWorkRequestRequest.opcRequestId
286
+ };
287
+ const specRetryConfiguration = common.OciSdkDefaultRetryConfiguration;
288
+ const retrier = oci_common_1.GenericRetrier.createPreferredRetrier(this._clientConfiguration ? this._clientConfiguration.retryConfiguration : undefined, cancelWorkRequestRequest.retryConfiguration, specRetryConfiguration);
289
+ if (this.logger)
290
+ retrier.logger = this.logger;
291
+ const request = yield oci_common_1.composeRequest({
292
+ baseEndpoint: this._endpoint,
293
+ defaultHeaders: this._defaultHeaders,
294
+ path: "/workRequests/{workRequestId}",
295
+ method: "DELETE",
296
+ pathParams: pathParams,
297
+ headerParams: headerParams,
298
+ queryParams: queryParams
299
+ });
300
+ try {
301
+ const response = yield retrier.makeServiceCall(this._httpClient, request, this.targetService, operationName, apiReferenceLink);
302
+ const sdkResponse = oci_common_1.composeResponse({
303
+ responseObject: {},
304
+ responseHeaders: [
305
+ {
306
+ value: response.headers.get("opc-request-id"),
307
+ key: "opcRequestId",
308
+ dataType: "string"
309
+ }
310
+ ]
311
+ });
312
+ return sdkResponse;
313
+ }
314
+ catch (err) {
315
+ throw err;
316
+ }
317
+ });
318
+ }
319
+ /**
320
+ * Creates a Schedule
321
+ *
322
+ * This operation uses {@link common.OciSdkDefaultRetryConfiguration} by default if no retry configuration is defined by the user.
323
+ * @param CreateScheduleRequest
324
+ * @return CreateScheduleResponse
325
+ * @throws OciError when an error occurs
326
+ * @example Click {@link https://docs.cloud.oracle.com/en-us/iaas/tools/typescript-sdk-examples/2.86.3/resourcescheduler/CreateSchedule.ts.html |here} to see how to use CreateSchedule API.
327
+ */
328
+ createSchedule(createScheduleRequest) {
329
+ return __awaiter(this, void 0, void 0, function* () {
330
+ if (this.logger)
331
+ this.logger.debug("Calling operation ScheduleClient#createSchedule.");
332
+ const operationName = "createSchedule";
333
+ const apiReferenceLink = "";
334
+ const pathParams = {};
335
+ const queryParams = {};
336
+ let headerParams = {
337
+ "Content-Type": common.Constants.APPLICATION_JSON,
338
+ "opc-retry-token": createScheduleRequest.opcRetryToken,
339
+ "opc-request-id": createScheduleRequest.opcRequestId
340
+ };
341
+ const specRetryConfiguration = common.OciSdkDefaultRetryConfiguration;
342
+ const retrier = oci_common_1.GenericRetrier.createPreferredRetrier(this._clientConfiguration ? this._clientConfiguration.retryConfiguration : undefined, createScheduleRequest.retryConfiguration, specRetryConfiguration);
343
+ if (this.logger)
344
+ retrier.logger = this.logger;
345
+ const request = yield oci_common_1.composeRequest({
346
+ baseEndpoint: this._endpoint,
347
+ defaultHeaders: this._defaultHeaders,
348
+ path: "/schedules",
349
+ method: "POST",
350
+ bodyContent: common.ObjectSerializer.serialize(createScheduleRequest.createScheduleDetails, "CreateScheduleDetails", model.CreateScheduleDetails.getJsonObj),
351
+ pathParams: pathParams,
352
+ headerParams: headerParams,
353
+ queryParams: queryParams
354
+ });
355
+ try {
356
+ const response = yield retrier.makeServiceCall(this._httpClient, request, this.targetService, operationName, apiReferenceLink);
357
+ const sdkResponse = oci_common_1.composeResponse({
358
+ responseObject: {},
359
+ body: yield response.json(),
360
+ bodyKey: "schedule",
361
+ bodyModel: model.Schedule,
362
+ type: "model.Schedule",
363
+ responseHeaders: [
364
+ {
365
+ value: response.headers.get("location"),
366
+ key: "location",
367
+ dataType: "string"
368
+ },
369
+ {
370
+ value: response.headers.get("content-location"),
371
+ key: "contentLocation",
372
+ dataType: "string"
373
+ },
374
+ {
375
+ value: response.headers.get("etag"),
376
+ key: "etag",
377
+ dataType: "string"
378
+ },
379
+ {
380
+ value: response.headers.get("opc-work-request-id"),
381
+ key: "opcWorkRequestId",
382
+ dataType: "string"
383
+ },
384
+ {
385
+ value: response.headers.get("opc-request-id"),
386
+ key: "opcRequestId",
387
+ dataType: "string"
388
+ }
389
+ ]
390
+ });
391
+ return sdkResponse;
392
+ }
393
+ catch (err) {
394
+ throw err;
395
+ }
396
+ });
397
+ }
398
+ /**
399
+ * This API deactivates a schedule.
400
+ * This operation uses {@link common.OciSdkDefaultRetryConfiguration} by default if no retry configuration is defined by the user.
401
+ * @param DeactivateScheduleRequest
402
+ * @return DeactivateScheduleResponse
403
+ * @throws OciError when an error occurs
404
+ * @example Click {@link https://docs.cloud.oracle.com/en-us/iaas/tools/typescript-sdk-examples/2.86.3/resourcescheduler/DeactivateSchedule.ts.html |here} to see how to use DeactivateSchedule API.
405
+ */
406
+ deactivateSchedule(deactivateScheduleRequest) {
407
+ return __awaiter(this, void 0, void 0, function* () {
408
+ if (this.logger)
409
+ this.logger.debug("Calling operation ScheduleClient#deactivateSchedule.");
410
+ const operationName = "deactivateSchedule";
411
+ const apiReferenceLink = "";
412
+ const pathParams = {
413
+ "{scheduleId}": deactivateScheduleRequest.scheduleId
414
+ };
415
+ const queryParams = {};
416
+ let headerParams = {
417
+ "Content-Type": common.Constants.APPLICATION_JSON,
418
+ "if-match": deactivateScheduleRequest.ifMatch,
419
+ "opc-request-id": deactivateScheduleRequest.opcRequestId,
420
+ "opc-retry-token": deactivateScheduleRequest.opcRetryToken
421
+ };
422
+ const specRetryConfiguration = common.OciSdkDefaultRetryConfiguration;
423
+ const retrier = oci_common_1.GenericRetrier.createPreferredRetrier(this._clientConfiguration ? this._clientConfiguration.retryConfiguration : undefined, deactivateScheduleRequest.retryConfiguration, specRetryConfiguration);
424
+ if (this.logger)
425
+ retrier.logger = this.logger;
426
+ const request = yield oci_common_1.composeRequest({
427
+ baseEndpoint: this._endpoint,
428
+ defaultHeaders: this._defaultHeaders,
429
+ path: "/schedules/{scheduleId}/actions/deactivateSchedule",
430
+ method: "POST",
431
+ pathParams: pathParams,
432
+ headerParams: headerParams,
433
+ queryParams: queryParams
434
+ });
435
+ try {
436
+ const response = yield retrier.makeServiceCall(this._httpClient, request, this.targetService, operationName, apiReferenceLink);
437
+ const sdkResponse = oci_common_1.composeResponse({
438
+ responseObject: {},
439
+ body: yield response.json(),
440
+ bodyKey: "schedule",
441
+ bodyModel: model.Schedule,
442
+ type: "model.Schedule",
443
+ responseHeaders: [
444
+ {
445
+ value: response.headers.get("opc-request-id"),
446
+ key: "opcRequestId",
447
+ dataType: "string"
448
+ },
449
+ {
450
+ value: response.headers.get("etag"),
451
+ key: "etag",
452
+ dataType: "string"
453
+ }
454
+ ]
455
+ });
456
+ return sdkResponse;
457
+ }
458
+ catch (err) {
459
+ throw err;
460
+ }
461
+ });
462
+ }
463
+ /**
464
+ * This API deletes a schedule.
465
+ * This operation uses {@link common.OciSdkDefaultRetryConfiguration} by default if no retry configuration is defined by the user.
466
+ * @param DeleteScheduleRequest
467
+ * @return DeleteScheduleResponse
468
+ * @throws OciError when an error occurs
469
+ * @example Click {@link https://docs.cloud.oracle.com/en-us/iaas/tools/typescript-sdk-examples/2.86.3/resourcescheduler/DeleteSchedule.ts.html |here} to see how to use DeleteSchedule API.
470
+ */
471
+ deleteSchedule(deleteScheduleRequest) {
472
+ return __awaiter(this, void 0, void 0, function* () {
473
+ if (this.logger)
474
+ this.logger.debug("Calling operation ScheduleClient#deleteSchedule.");
475
+ const operationName = "deleteSchedule";
476
+ const apiReferenceLink = "";
477
+ const pathParams = {
478
+ "{scheduleId}": deleteScheduleRequest.scheduleId
479
+ };
480
+ const queryParams = {};
481
+ let headerParams = {
482
+ "Content-Type": common.Constants.APPLICATION_JSON,
483
+ "if-match": deleteScheduleRequest.ifMatch,
484
+ "opc-request-id": deleteScheduleRequest.opcRequestId
485
+ };
486
+ const specRetryConfiguration = common.OciSdkDefaultRetryConfiguration;
487
+ const retrier = oci_common_1.GenericRetrier.createPreferredRetrier(this._clientConfiguration ? this._clientConfiguration.retryConfiguration : undefined, deleteScheduleRequest.retryConfiguration, specRetryConfiguration);
488
+ if (this.logger)
489
+ retrier.logger = this.logger;
490
+ const request = yield oci_common_1.composeRequest({
491
+ baseEndpoint: this._endpoint,
492
+ defaultHeaders: this._defaultHeaders,
493
+ path: "/schedules/{scheduleId}",
494
+ method: "DELETE",
495
+ pathParams: pathParams,
496
+ headerParams: headerParams,
497
+ queryParams: queryParams
498
+ });
499
+ try {
500
+ const response = yield retrier.makeServiceCall(this._httpClient, request, this.targetService, operationName, apiReferenceLink);
501
+ const sdkResponse = oci_common_1.composeResponse({
502
+ responseObject: {},
503
+ responseHeaders: [
504
+ {
505
+ value: response.headers.get("opc-request-id"),
506
+ key: "opcRequestId",
507
+ dataType: "string"
508
+ }
509
+ ]
510
+ });
511
+ return sdkResponse;
512
+ }
513
+ catch (err) {
514
+ throw err;
515
+ }
516
+ });
517
+ }
518
+ /**
519
+ * This API gets information about a schedule.
520
+ * This operation uses {@link common.OciSdkDefaultRetryConfiguration} by default if no retry configuration is defined by the user.
521
+ * @param GetScheduleRequest
522
+ * @return GetScheduleResponse
523
+ * @throws OciError when an error occurs
524
+ * @example Click {@link https://docs.cloud.oracle.com/en-us/iaas/tools/typescript-sdk-examples/2.86.3/resourcescheduler/GetSchedule.ts.html |here} to see how to use GetSchedule API.
525
+ */
526
+ getSchedule(getScheduleRequest) {
527
+ return __awaiter(this, void 0, void 0, function* () {
528
+ if (this.logger)
529
+ this.logger.debug("Calling operation ScheduleClient#getSchedule.");
530
+ const operationName = "getSchedule";
531
+ const apiReferenceLink = "";
532
+ const pathParams = {
533
+ "{scheduleId}": getScheduleRequest.scheduleId
534
+ };
535
+ const queryParams = {};
536
+ let headerParams = {
537
+ "Content-Type": common.Constants.APPLICATION_JSON,
538
+ "opc-request-id": getScheduleRequest.opcRequestId
539
+ };
540
+ const specRetryConfiguration = common.OciSdkDefaultRetryConfiguration;
541
+ const retrier = oci_common_1.GenericRetrier.createPreferredRetrier(this._clientConfiguration ? this._clientConfiguration.retryConfiguration : undefined, getScheduleRequest.retryConfiguration, specRetryConfiguration);
542
+ if (this.logger)
543
+ retrier.logger = this.logger;
544
+ const request = yield oci_common_1.composeRequest({
545
+ baseEndpoint: this._endpoint,
546
+ defaultHeaders: this._defaultHeaders,
547
+ path: "/schedules/{scheduleId}",
548
+ method: "GET",
549
+ pathParams: pathParams,
550
+ headerParams: headerParams,
551
+ queryParams: queryParams
552
+ });
553
+ try {
554
+ const response = yield retrier.makeServiceCall(this._httpClient, request, this.targetService, operationName, apiReferenceLink);
555
+ const sdkResponse = oci_common_1.composeResponse({
556
+ responseObject: {},
557
+ body: yield response.json(),
558
+ bodyKey: "schedule",
559
+ bodyModel: model.Schedule,
560
+ type: "model.Schedule",
561
+ responseHeaders: [
562
+ {
563
+ value: response.headers.get("etag"),
564
+ key: "etag",
565
+ dataType: "string"
566
+ },
567
+ {
568
+ value: response.headers.get("opc-request-id"),
569
+ key: "opcRequestId",
570
+ dataType: "string"
571
+ }
572
+ ]
573
+ });
574
+ return sdkResponse;
575
+ }
576
+ catch (err) {
577
+ throw err;
578
+ }
579
+ });
580
+ }
581
+ /**
582
+ * This API gets the details of a work request.
583
+ * This operation uses {@link common.OciSdkDefaultRetryConfiguration} by default if no retry configuration is defined by the user.
584
+ * @param GetWorkRequestRequest
585
+ * @return GetWorkRequestResponse
586
+ * @throws OciError when an error occurs
587
+ * @example Click {@link https://docs.cloud.oracle.com/en-us/iaas/tools/typescript-sdk-examples/2.86.3/resourcescheduler/GetWorkRequest.ts.html |here} to see how to use GetWorkRequest API.
588
+ */
589
+ getWorkRequest(getWorkRequestRequest) {
590
+ return __awaiter(this, void 0, void 0, function* () {
591
+ if (this.logger)
592
+ this.logger.debug("Calling operation ScheduleClient#getWorkRequest.");
593
+ const operationName = "getWorkRequest";
594
+ const apiReferenceLink = "";
595
+ const pathParams = {
596
+ "{workRequestId}": getWorkRequestRequest.workRequestId
597
+ };
598
+ const queryParams = {};
599
+ let headerParams = {
600
+ "Content-Type": common.Constants.APPLICATION_JSON,
601
+ "opc-request-id": getWorkRequestRequest.opcRequestId
602
+ };
603
+ const specRetryConfiguration = common.OciSdkDefaultRetryConfiguration;
604
+ const retrier = oci_common_1.GenericRetrier.createPreferredRetrier(this._clientConfiguration ? this._clientConfiguration.retryConfiguration : undefined, getWorkRequestRequest.retryConfiguration, specRetryConfiguration);
605
+ if (this.logger)
606
+ retrier.logger = this.logger;
607
+ const request = yield oci_common_1.composeRequest({
608
+ baseEndpoint: this._endpoint,
609
+ defaultHeaders: this._defaultHeaders,
610
+ path: "/workRequests/{workRequestId}",
611
+ method: "GET",
612
+ pathParams: pathParams,
613
+ headerParams: headerParams,
614
+ queryParams: queryParams
615
+ });
616
+ try {
617
+ const response = yield retrier.makeServiceCall(this._httpClient, request, this.targetService, operationName, apiReferenceLink);
618
+ const sdkResponse = oci_common_1.composeResponse({
619
+ responseObject: {},
620
+ body: yield response.json(),
621
+ bodyKey: "workRequest",
622
+ bodyModel: model.WorkRequest,
623
+ type: "model.WorkRequest",
624
+ responseHeaders: [
625
+ {
626
+ value: response.headers.get("etag"),
627
+ key: "etag",
628
+ dataType: "string"
629
+ },
630
+ {
631
+ value: response.headers.get("opc-request-id"),
632
+ key: "opcRequestId",
633
+ dataType: "string"
634
+ },
635
+ {
636
+ value: response.headers.get("retry-after"),
637
+ key: "retryAfter",
638
+ dataType: "number"
639
+ }
640
+ ]
641
+ });
642
+ return sdkResponse;
643
+ }
644
+ catch (err) {
645
+ throw err;
646
+ }
647
+ });
648
+ }
649
+ /**
650
+ * This API gets a list of schedule resource types.
651
+ *
652
+ * This operation uses {@link common.OciSdkDefaultRetryConfiguration} by default if no retry configuration is defined by the user.
653
+ * @param ListResourceTypesRequest
654
+ * @return ListResourceTypesResponse
655
+ * @throws OciError when an error occurs
656
+ * @example Click {@link https://docs.cloud.oracle.com/en-us/iaas/tools/typescript-sdk-examples/2.86.3/resourcescheduler/ListResourceTypes.ts.html |here} to see how to use ListResourceTypes API.
657
+ */
658
+ listResourceTypes(listResourceTypesRequest) {
659
+ return __awaiter(this, void 0, void 0, function* () {
660
+ if (this.logger)
661
+ this.logger.debug("Calling operation ScheduleClient#listResourceTypes.");
662
+ const operationName = "listResourceTypes";
663
+ const apiReferenceLink = "";
664
+ const pathParams = {};
665
+ const queryParams = {
666
+ "compartmentId": listResourceTypesRequest.compartmentId,
667
+ "limit": listResourceTypesRequest.limit,
668
+ "page": listResourceTypesRequest.page
669
+ };
670
+ let headerParams = {
671
+ "Content-Type": common.Constants.APPLICATION_JSON,
672
+ "opc-request-id": listResourceTypesRequest.opcRequestId
673
+ };
674
+ const specRetryConfiguration = common.OciSdkDefaultRetryConfiguration;
675
+ const retrier = oci_common_1.GenericRetrier.createPreferredRetrier(this._clientConfiguration ? this._clientConfiguration.retryConfiguration : undefined, listResourceTypesRequest.retryConfiguration, specRetryConfiguration);
676
+ if (this.logger)
677
+ retrier.logger = this.logger;
678
+ const request = yield oci_common_1.composeRequest({
679
+ baseEndpoint: this._endpoint,
680
+ defaultHeaders: this._defaultHeaders,
681
+ path: "/schedules/resourceTypes",
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_1.composeResponse({
690
+ responseObject: {},
691
+ body: yield response.json(),
692
+ bodyKey: "resourceTypeCollection",
693
+ bodyModel: model.ResourceTypeCollection,
694
+ type: "model.ResourceTypeCollection",
695
+ responseHeaders: [
696
+ {
697
+ value: response.headers.get("opc-request-id"),
698
+ key: "opcRequestId",
699
+ dataType: "string"
700
+ },
701
+ {
702
+ value: response.headers.get("opc-next-page"),
703
+ key: "opcNextPage",
704
+ dataType: "string"
705
+ }
706
+ ]
707
+ });
708
+ return sdkResponse;
709
+ }
710
+ catch (err) {
711
+ throw err;
712
+ }
713
+ });
714
+ }
715
+ /**
716
+ * This API gets a list of schedules
717
+ *
718
+ * This operation uses {@link common.OciSdkDefaultRetryConfiguration} by default if no retry configuration is defined by the user.
719
+ * @param ListSchedulesRequest
720
+ * @return ListSchedulesResponse
721
+ * @throws OciError when an error occurs
722
+ * @example Click {@link https://docs.cloud.oracle.com/en-us/iaas/tools/typescript-sdk-examples/2.86.3/resourcescheduler/ListSchedules.ts.html |here} to see how to use ListSchedules API.
723
+ */
724
+ listSchedules(listSchedulesRequest) {
725
+ return __awaiter(this, void 0, void 0, function* () {
726
+ if (this.logger)
727
+ this.logger.debug("Calling operation ScheduleClient#listSchedules.");
728
+ const operationName = "listSchedules";
729
+ const apiReferenceLink = "";
730
+ const pathParams = {};
731
+ const queryParams = {
732
+ "compartmentId": listSchedulesRequest.compartmentId,
733
+ "lifecycleState": listSchedulesRequest.lifecycleState,
734
+ "displayName": listSchedulesRequest.displayName,
735
+ "scheduleId": listSchedulesRequest.scheduleId,
736
+ "limit": listSchedulesRequest.limit,
737
+ "page": listSchedulesRequest.page,
738
+ "sortBy": listSchedulesRequest.sortBy,
739
+ "sortOrder": listSchedulesRequest.sortOrder
740
+ };
741
+ let headerParams = {
742
+ "Content-Type": common.Constants.APPLICATION_JSON,
743
+ "opc-request-id": listSchedulesRequest.opcRequestId
744
+ };
745
+ const specRetryConfiguration = common.OciSdkDefaultRetryConfiguration;
746
+ const retrier = oci_common_1.GenericRetrier.createPreferredRetrier(this._clientConfiguration ? this._clientConfiguration.retryConfiguration : undefined, listSchedulesRequest.retryConfiguration, specRetryConfiguration);
747
+ if (this.logger)
748
+ retrier.logger = this.logger;
749
+ const request = yield oci_common_1.composeRequest({
750
+ baseEndpoint: this._endpoint,
751
+ defaultHeaders: this._defaultHeaders,
752
+ path: "/schedules",
753
+ method: "GET",
754
+ pathParams: pathParams,
755
+ headerParams: headerParams,
756
+ queryParams: queryParams
757
+ });
758
+ try {
759
+ const response = yield retrier.makeServiceCall(this._httpClient, request, this.targetService, operationName, apiReferenceLink);
760
+ const sdkResponse = oci_common_1.composeResponse({
761
+ responseObject: {},
762
+ body: yield response.json(),
763
+ bodyKey: "scheduleCollection",
764
+ bodyModel: model.ScheduleCollection,
765
+ type: "model.ScheduleCollection",
766
+ responseHeaders: [
767
+ {
768
+ value: response.headers.get("opc-request-id"),
769
+ key: "opcRequestId",
770
+ dataType: "string"
771
+ },
772
+ {
773
+ value: response.headers.get("opc-next-page"),
774
+ key: "opcNextPage",
775
+ dataType: "string"
776
+ }
777
+ ]
778
+ });
779
+ return sdkResponse;
780
+ }
781
+ catch (err) {
782
+ throw err;
783
+ }
784
+ });
785
+ }
786
+ /**
787
+ * This API lists the errors for a work request.
788
+ *
789
+ * This operation uses {@link common.OciSdkDefaultRetryConfiguration} by default if no retry configuration is defined by the user.
790
+ * @param ListWorkRequestErrorsRequest
791
+ * @return ListWorkRequestErrorsResponse
792
+ * @throws OciError when an error occurs
793
+ * @example Click {@link https://docs.cloud.oracle.com/en-us/iaas/tools/typescript-sdk-examples/2.86.3/resourcescheduler/ListWorkRequestErrors.ts.html |here} to see how to use ListWorkRequestErrors API.
794
+ */
795
+ listWorkRequestErrors(listWorkRequestErrorsRequest) {
796
+ return __awaiter(this, void 0, void 0, function* () {
797
+ if (this.logger)
798
+ this.logger.debug("Calling operation ScheduleClient#listWorkRequestErrors.");
799
+ const operationName = "listWorkRequestErrors";
800
+ const apiReferenceLink = "";
801
+ const pathParams = {
802
+ "{workRequestId}": listWorkRequestErrorsRequest.workRequestId
803
+ };
804
+ const queryParams = {
805
+ "page": listWorkRequestErrorsRequest.page,
806
+ "limit": listWorkRequestErrorsRequest.limit,
807
+ "sortBy": listWorkRequestErrorsRequest.sortBy,
808
+ "sortOrder": listWorkRequestErrorsRequest.sortOrder
809
+ };
810
+ let headerParams = {
811
+ "Content-Type": common.Constants.APPLICATION_JSON,
812
+ "opc-request-id": listWorkRequestErrorsRequest.opcRequestId
813
+ };
814
+ const specRetryConfiguration = common.OciSdkDefaultRetryConfiguration;
815
+ const retrier = oci_common_1.GenericRetrier.createPreferredRetrier(this._clientConfiguration ? this._clientConfiguration.retryConfiguration : undefined, listWorkRequestErrorsRequest.retryConfiguration, specRetryConfiguration);
816
+ if (this.logger)
817
+ retrier.logger = this.logger;
818
+ const request = yield oci_common_1.composeRequest({
819
+ baseEndpoint: this._endpoint,
820
+ defaultHeaders: this._defaultHeaders,
821
+ path: "/workRequests/{workRequestId}/errors",
822
+ method: "GET",
823
+ pathParams: pathParams,
824
+ headerParams: headerParams,
825
+ queryParams: queryParams
826
+ });
827
+ try {
828
+ const response = yield retrier.makeServiceCall(this._httpClient, request, this.targetService, operationName, apiReferenceLink);
829
+ const sdkResponse = oci_common_1.composeResponse({
830
+ responseObject: {},
831
+ body: yield response.json(),
832
+ bodyKey: "workRequestErrorCollection",
833
+ bodyModel: model.WorkRequestErrorCollection,
834
+ type: "model.WorkRequestErrorCollection",
835
+ responseHeaders: [
836
+ {
837
+ value: response.headers.get("opc-next-page"),
838
+ key: "opcNextPage",
839
+ dataType: "string"
840
+ },
841
+ {
842
+ value: response.headers.get("opc-request-id"),
843
+ key: "opcRequestId",
844
+ dataType: "string"
845
+ }
846
+ ]
847
+ });
848
+ return sdkResponse;
849
+ }
850
+ catch (err) {
851
+ throw err;
852
+ }
853
+ });
854
+ }
855
+ /**
856
+ * Lists the logs for a work request.
857
+ *
858
+ * This operation uses {@link common.OciSdkDefaultRetryConfiguration} by default if no retry configuration is defined by the user.
859
+ * @param ListWorkRequestLogsRequest
860
+ * @return ListWorkRequestLogsResponse
861
+ * @throws OciError when an error occurs
862
+ * @example Click {@link https://docs.cloud.oracle.com/en-us/iaas/tools/typescript-sdk-examples/2.86.3/resourcescheduler/ListWorkRequestLogs.ts.html |here} to see how to use ListWorkRequestLogs API.
863
+ */
864
+ listWorkRequestLogs(listWorkRequestLogsRequest) {
865
+ return __awaiter(this, void 0, void 0, function* () {
866
+ if (this.logger)
867
+ this.logger.debug("Calling operation ScheduleClient#listWorkRequestLogs.");
868
+ const operationName = "listWorkRequestLogs";
869
+ const apiReferenceLink = "";
870
+ const pathParams = {
871
+ "{workRequestId}": listWorkRequestLogsRequest.workRequestId
872
+ };
873
+ const queryParams = {
874
+ "page": listWorkRequestLogsRequest.page,
875
+ "limit": listWorkRequestLogsRequest.limit,
876
+ "sortBy": listWorkRequestLogsRequest.sortBy,
877
+ "sortOrder": listWorkRequestLogsRequest.sortOrder
878
+ };
879
+ let headerParams = {
880
+ "Content-Type": common.Constants.APPLICATION_JSON,
881
+ "opc-request-id": listWorkRequestLogsRequest.opcRequestId
882
+ };
883
+ const specRetryConfiguration = common.OciSdkDefaultRetryConfiguration;
884
+ const retrier = oci_common_1.GenericRetrier.createPreferredRetrier(this._clientConfiguration ? this._clientConfiguration.retryConfiguration : undefined, listWorkRequestLogsRequest.retryConfiguration, specRetryConfiguration);
885
+ if (this.logger)
886
+ retrier.logger = this.logger;
887
+ const request = yield oci_common_1.composeRequest({
888
+ baseEndpoint: this._endpoint,
889
+ defaultHeaders: this._defaultHeaders,
890
+ path: "/workRequests/{workRequestId}/logs",
891
+ method: "GET",
892
+ pathParams: pathParams,
893
+ headerParams: headerParams,
894
+ queryParams: queryParams
895
+ });
896
+ try {
897
+ const response = yield retrier.makeServiceCall(this._httpClient, request, this.targetService, operationName, apiReferenceLink);
898
+ const sdkResponse = oci_common_1.composeResponse({
899
+ responseObject: {},
900
+ body: yield response.json(),
901
+ bodyKey: "workRequestLogEntryCollection",
902
+ bodyModel: model.WorkRequestLogEntryCollection,
903
+ type: "model.WorkRequestLogEntryCollection",
904
+ responseHeaders: [
905
+ {
906
+ value: response.headers.get("opc-next-page"),
907
+ key: "opcNextPage",
908
+ dataType: "string"
909
+ },
910
+ {
911
+ value: response.headers.get("opc-request-id"),
912
+ key: "opcRequestId",
913
+ dataType: "string"
914
+ }
915
+ ]
916
+ });
917
+ return sdkResponse;
918
+ }
919
+ catch (err) {
920
+ throw err;
921
+ }
922
+ });
923
+ }
924
+ /**
925
+ * Lists the cloud scheduler work requests in a compartment.
926
+ * This operation uses {@link common.OciSdkDefaultRetryConfiguration} by default if no retry configuration is defined by the user.
927
+ * @param ListWorkRequestsRequest
928
+ * @return ListWorkRequestsResponse
929
+ * @throws OciError when an error occurs
930
+ * @example Click {@link https://docs.cloud.oracle.com/en-us/iaas/tools/typescript-sdk-examples/2.86.3/resourcescheduler/ListWorkRequests.ts.html |here} to see how to use ListWorkRequests API.
931
+ */
932
+ listWorkRequests(listWorkRequestsRequest) {
933
+ return __awaiter(this, void 0, void 0, function* () {
934
+ if (this.logger)
935
+ this.logger.debug("Calling operation ScheduleClient#listWorkRequests.");
936
+ const operationName = "listWorkRequests";
937
+ const apiReferenceLink = "";
938
+ const pathParams = {};
939
+ const queryParams = {
940
+ "compartmentId": listWorkRequestsRequest.compartmentId,
941
+ "workRequestId": listWorkRequestsRequest.workRequestId,
942
+ "status": listWorkRequestsRequest.status,
943
+ "resourceId": listWorkRequestsRequest.resourceId,
944
+ "page": listWorkRequestsRequest.page,
945
+ "limit": listWorkRequestsRequest.limit,
946
+ "sortOrder": listWorkRequestsRequest.sortOrder,
947
+ "sortBy": listWorkRequestsRequest.sortBy,
948
+ "scheduleId": listWorkRequestsRequest.scheduleId
949
+ };
950
+ let headerParams = {
951
+ "Content-Type": common.Constants.APPLICATION_JSON,
952
+ "opc-request-id": listWorkRequestsRequest.opcRequestId
953
+ };
954
+ const specRetryConfiguration = common.OciSdkDefaultRetryConfiguration;
955
+ const retrier = oci_common_1.GenericRetrier.createPreferredRetrier(this._clientConfiguration ? this._clientConfiguration.retryConfiguration : undefined, listWorkRequestsRequest.retryConfiguration, specRetryConfiguration);
956
+ if (this.logger)
957
+ retrier.logger = this.logger;
958
+ const request = yield oci_common_1.composeRequest({
959
+ baseEndpoint: this._endpoint,
960
+ defaultHeaders: this._defaultHeaders,
961
+ path: "/workRequests",
962
+ method: "GET",
963
+ pathParams: pathParams,
964
+ headerParams: headerParams,
965
+ queryParams: queryParams
966
+ });
967
+ try {
968
+ const response = yield retrier.makeServiceCall(this._httpClient, request, this.targetService, operationName, apiReferenceLink);
969
+ const sdkResponse = oci_common_1.composeResponse({
970
+ responseObject: {},
971
+ body: yield response.json(),
972
+ bodyKey: "workRequestSummaryCollection",
973
+ bodyModel: model.WorkRequestSummaryCollection,
974
+ type: "model.WorkRequestSummaryCollection",
975
+ responseHeaders: [
976
+ {
977
+ value: response.headers.get("opc-request-id"),
978
+ key: "opcRequestId",
979
+ dataType: "string"
980
+ },
981
+ {
982
+ value: response.headers.get("opc-next-page"),
983
+ key: "opcNextPage",
984
+ dataType: "string"
985
+ }
986
+ ]
987
+ });
988
+ return sdkResponse;
989
+ }
990
+ catch (err) {
991
+ throw err;
992
+ }
993
+ });
994
+ }
995
+ /**
996
+ * The API updates a schedule
997
+ * This operation uses {@link common.OciSdkDefaultRetryConfiguration} by default if no retry configuration is defined by the user.
998
+ * @param UpdateScheduleRequest
999
+ * @return UpdateScheduleResponse
1000
+ * @throws OciError when an error occurs
1001
+ * @example Click {@link https://docs.cloud.oracle.com/en-us/iaas/tools/typescript-sdk-examples/2.86.3/resourcescheduler/UpdateSchedule.ts.html |here} to see how to use UpdateSchedule API.
1002
+ */
1003
+ updateSchedule(updateScheduleRequest) {
1004
+ return __awaiter(this, void 0, void 0, function* () {
1005
+ if (this.logger)
1006
+ this.logger.debug("Calling operation ScheduleClient#updateSchedule.");
1007
+ const operationName = "updateSchedule";
1008
+ const apiReferenceLink = "";
1009
+ const pathParams = {
1010
+ "{scheduleId}": updateScheduleRequest.scheduleId
1011
+ };
1012
+ const queryParams = {};
1013
+ let headerParams = {
1014
+ "Content-Type": common.Constants.APPLICATION_JSON,
1015
+ "if-match": updateScheduleRequest.ifMatch,
1016
+ "opc-request-id": updateScheduleRequest.opcRequestId
1017
+ };
1018
+ const specRetryConfiguration = common.OciSdkDefaultRetryConfiguration;
1019
+ const retrier = oci_common_1.GenericRetrier.createPreferredRetrier(this._clientConfiguration ? this._clientConfiguration.retryConfiguration : undefined, updateScheduleRequest.retryConfiguration, specRetryConfiguration);
1020
+ if (this.logger)
1021
+ retrier.logger = this.logger;
1022
+ const request = yield oci_common_1.composeRequest({
1023
+ baseEndpoint: this._endpoint,
1024
+ defaultHeaders: this._defaultHeaders,
1025
+ path: "/schedules/{scheduleId}",
1026
+ method: "PUT",
1027
+ bodyContent: common.ObjectSerializer.serialize(updateScheduleRequest.updateScheduleDetails, "UpdateScheduleDetails", model.UpdateScheduleDetails.getJsonObj),
1028
+ pathParams: pathParams,
1029
+ headerParams: headerParams,
1030
+ queryParams: queryParams
1031
+ });
1032
+ try {
1033
+ const response = yield retrier.makeServiceCall(this._httpClient, request, this.targetService, operationName, apiReferenceLink);
1034
+ const sdkResponse = oci_common_1.composeResponse({
1035
+ responseObject: {},
1036
+ responseHeaders: [
1037
+ {
1038
+ value: response.headers.get("opc-work-request-id"),
1039
+ key: "opcWorkRequestId",
1040
+ dataType: "string"
1041
+ },
1042
+ {
1043
+ value: response.headers.get("opc-request-id"),
1044
+ key: "opcRequestId",
1045
+ dataType: "string"
1046
+ }
1047
+ ]
1048
+ });
1049
+ return sdkResponse;
1050
+ }
1051
+ catch (err) {
1052
+ throw err;
1053
+ }
1054
+ });
1055
+ }
1056
+ }
1057
+ exports.ScheduleClient = ScheduleClient;
1058
+ ScheduleClient.serviceEndpointTemplate = "https://resource-scheduler.{region}.oci.{secondLevelDomain}";
1059
+ ScheduleClient.endpointServiceName = "";
1060
+ //# sourceMappingURL=client.js.map