oci-queue 2.50.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 (242) 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 +23 -0
  6. package/index.js +46 -0
  7. package/index.js.map +1 -0
  8. package/lib/client.d.ts +283 -0
  9. package/lib/client.js +1357 -0
  10. package/lib/client.js.map +1 -0
  11. package/lib/model/action-type.d.ts +31 -0
  12. package/lib/model/action-type.js +42 -0
  13. package/lib/model/action-type.js.map +1 -0
  14. package/lib/model/change-queue-compartment-details.d.ts +27 -0
  15. package/lib/model/change-queue-compartment-details.js +29 -0
  16. package/lib/model/change-queue-compartment-details.js.map +1 -0
  17. package/lib/model/create-queue-details.d.ts +67 -0
  18. package/lib/model/create-queue-details.js +29 -0
  19. package/lib/model/create-queue-details.js.map +1 -0
  20. package/lib/model/delete-messages-details-entry.d.ts +25 -0
  21. package/lib/model/delete-messages-details-entry.js +29 -0
  22. package/lib/model/delete-messages-details-entry.js.map +1 -0
  23. package/lib/model/delete-messages-details.d.ts +26 -0
  24. package/lib/model/delete-messages-details.js +61 -0
  25. package/lib/model/delete-messages-details.js.map +1 -0
  26. package/lib/model/delete-messages-result-entry.d.ts +32 -0
  27. package/lib/model/delete-messages-result-entry.js +29 -0
  28. package/lib/model/delete-messages-result-entry.js.map +1 -0
  29. package/lib/model/delete-messages-result.d.ts +38 -0
  30. package/lib/model/delete-messages-result.js +61 -0
  31. package/lib/model/delete-messages-result.js.map +1 -0
  32. package/lib/model/get-message.d.ts +47 -0
  33. package/lib/model/get-message.js +29 -0
  34. package/lib/model/get-message.js.map +1 -0
  35. package/lib/model/get-messages.d.ts +26 -0
  36. package/lib/model/get-messages.js +61 -0
  37. package/lib/model/get-messages.js.map +1 -0
  38. package/lib/model/index.d.ts +86 -0
  39. package/lib/model/index.js +109 -0
  40. package/lib/model/index.js.map +1 -0
  41. package/lib/model/operation-status.d.ts +32 -0
  42. package/lib/model/operation-status.js +43 -0
  43. package/lib/model/operation-status.js.map +1 -0
  44. package/lib/model/operation-type.d.ts +31 -0
  45. package/lib/model/operation-type.js +42 -0
  46. package/lib/model/operation-type.js.map +1 -0
  47. package/lib/model/purge-queue-details.d.ts +34 -0
  48. package/lib/model/purge-queue-details.js +35 -0
  49. package/lib/model/purge-queue-details.js.map +1 -0
  50. package/lib/model/put-message.d.ts +25 -0
  51. package/lib/model/put-message.js +29 -0
  52. package/lib/model/put-message.js.map +1 -0
  53. package/lib/model/put-messages-details-entry.d.ts +25 -0
  54. package/lib/model/put-messages-details-entry.js +29 -0
  55. package/lib/model/put-messages-details-entry.js.map +1 -0
  56. package/lib/model/put-messages-details.d.ts +26 -0
  57. package/lib/model/put-messages-details.js +61 -0
  58. package/lib/model/put-messages-details.js.map +1 -0
  59. package/lib/model/put-messages.d.ts +26 -0
  60. package/lib/model/put-messages.js +61 -0
  61. package/lib/model/put-messages.js.map +1 -0
  62. package/lib/model/queue-collection.d.ts +26 -0
  63. package/lib/model/queue-collection.js +61 -0
  64. package/lib/model/queue-collection.js.map +1 -0
  65. package/lib/model/queue-stats.d.ts +24 -0
  66. package/lib/model/queue-stats.js +55 -0
  67. package/lib/model/queue-stats.js.map +1 -0
  68. package/lib/model/queue-summary.d.ts +81 -0
  69. package/lib/model/queue-summary.js +29 -0
  70. package/lib/model/queue-summary.js.map +1 -0
  71. package/lib/model/queue.d.ts +114 -0
  72. package/lib/model/queue.js +43 -0
  73. package/lib/model/queue.js.map +1 -0
  74. package/lib/model/sort-order.d.ts +23 -0
  75. package/lib/model/sort-order.js +34 -0
  76. package/lib/model/sort-order.js.map +1 -0
  77. package/lib/model/stats.d.ts +33 -0
  78. package/lib/model/stats.js +29 -0
  79. package/lib/model/stats.js.map +1 -0
  80. package/lib/model/update-message-details.d.ts +25 -0
  81. package/lib/model/update-message-details.js +29 -0
  82. package/lib/model/update-message-details.js.map +1 -0
  83. package/lib/model/update-messages-details-entry.d.ts +29 -0
  84. package/lib/model/update-messages-details-entry.js +29 -0
  85. package/lib/model/update-messages-details-entry.js.map +1 -0
  86. package/lib/model/update-messages-details.d.ts +26 -0
  87. package/lib/model/update-messages-details.js +61 -0
  88. package/lib/model/update-messages-details.js.map +1 -0
  89. package/lib/model/update-messages-result-entry.d.ts +40 -0
  90. package/lib/model/update-messages-result-entry.js +29 -0
  91. package/lib/model/update-messages-result-entry.js.map +1 -0
  92. package/lib/model/update-messages-result.d.ts +38 -0
  93. package/lib/model/update-messages-result.js +61 -0
  94. package/lib/model/update-messages-result.js.map +1 -0
  95. package/lib/model/update-queue-details.d.ts +62 -0
  96. package/lib/model/update-queue-details.js +29 -0
  97. package/lib/model/update-queue-details.js.map +1 -0
  98. package/lib/model/updated-message.d.ts +29 -0
  99. package/lib/model/updated-message.js +29 -0
  100. package/lib/model/updated-message.js.map +1 -0
  101. package/lib/model/work-request-error-collection.d.ts +26 -0
  102. package/lib/model/work-request-error-collection.js +61 -0
  103. package/lib/model/work-request-error-collection.js.map +1 -0
  104. package/lib/model/work-request-error.d.ts +35 -0
  105. package/lib/model/work-request-error.js +29 -0
  106. package/lib/model/work-request-error.js.map +1 -0
  107. package/lib/model/work-request-log-entry-collection.d.ts +26 -0
  108. package/lib/model/work-request-log-entry-collection.js +61 -0
  109. package/lib/model/work-request-log-entry-collection.js.map +1 -0
  110. package/lib/model/work-request-log-entry.d.ts +29 -0
  111. package/lib/model/work-request-log-entry.js +29 -0
  112. package/lib/model/work-request-log-entry.js.map +1 -0
  113. package/lib/model/work-request-resource.d.ts +42 -0
  114. package/lib/model/work-request-resource.js +29 -0
  115. package/lib/model/work-request-resource.js.map +1 -0
  116. package/lib/model/work-request-summary-collection.d.ts +26 -0
  117. package/lib/model/work-request-summary-collection.js +61 -0
  118. package/lib/model/work-request-summary-collection.js.map +1 -0
  119. package/lib/model/work-request-summary.d.ts +67 -0
  120. package/lib/model/work-request-summary.js +61 -0
  121. package/lib/model/work-request-summary.js.map +1 -0
  122. package/lib/model/work-request.d.ts +67 -0
  123. package/lib/model/work-request.js +61 -0
  124. package/lib/model/work-request.js.map +1 -0
  125. package/lib/queueadmin-waiter.d.ts +36 -0
  126. package/lib/queueadmin-waiter.js +76 -0
  127. package/lib/queueadmin-waiter.js.map +1 -0
  128. package/lib/request/change-queue-compartment-request.d.ts +40 -0
  129. package/lib/request/change-queue-compartment-request.js +15 -0
  130. package/lib/request/change-queue-compartment-request.js.map +1 -0
  131. package/lib/request/create-queue-request.d.ts +36 -0
  132. package/lib/request/create-queue-request.js +15 -0
  133. package/lib/request/create-queue-request.js.map +1 -0
  134. package/lib/request/delete-message-request.d.ts +30 -0
  135. package/lib/request/delete-message-request.js +15 -0
  136. package/lib/request/delete-message-request.js.map +1 -0
  137. package/lib/request/delete-messages-request.d.ts +31 -0
  138. package/lib/request/delete-messages-request.js +15 -0
  139. package/lib/request/delete-messages-request.js.map +1 -0
  140. package/lib/request/delete-queue-request.d.ts +35 -0
  141. package/lib/request/delete-queue-request.js +15 -0
  142. package/lib/request/delete-queue-request.js.map +1 -0
  143. package/lib/request/get-messages-request.d.ts +48 -0
  144. package/lib/request/get-messages-request.js +15 -0
  145. package/lib/request/get-messages-request.js.map +1 -0
  146. package/lib/request/get-queue-request.d.ts +26 -0
  147. package/lib/request/get-queue-request.js +15 -0
  148. package/lib/request/get-queue-request.js.map +1 -0
  149. package/lib/request/get-stats-request.d.ts +26 -0
  150. package/lib/request/get-stats-request.js +15 -0
  151. package/lib/request/get-stats-request.js.map +1 -0
  152. package/lib/request/get-work-request-request.d.ts +26 -0
  153. package/lib/request/get-work-request-request.js +15 -0
  154. package/lib/request/get-work-request-request.js.map +1 -0
  155. package/lib/request/index.d.ts +48 -0
  156. package/lib/request/index.js +37 -0
  157. package/lib/request/index.js.map +1 -0
  158. package/lib/request/list-queues-request.d.ts +62 -0
  159. package/lib/request/list-queues-request.js +24 -0
  160. package/lib/request/list-queues-request.js.map +1 -0
  161. package/lib/request/list-work-request-errors-request.d.ts +34 -0
  162. package/lib/request/list-work-request-errors-request.js +15 -0
  163. package/lib/request/list-work-request-errors-request.js.map +1 -0
  164. package/lib/request/list-work-request-logs-request.d.ts +34 -0
  165. package/lib/request/list-work-request-logs-request.js +15 -0
  166. package/lib/request/list-work-request-logs-request.js.map +1 -0
  167. package/lib/request/list-work-requests-request.d.ts +38 -0
  168. package/lib/request/list-work-requests-request.js +15 -0
  169. package/lib/request/list-work-requests-request.js.map +1 -0
  170. package/lib/request/purge-queue-request.d.ts +40 -0
  171. package/lib/request/purge-queue-request.js +15 -0
  172. package/lib/request/purge-queue-request.js.map +1 -0
  173. package/lib/request/put-messages-request.d.ts +31 -0
  174. package/lib/request/put-messages-request.js +15 -0
  175. package/lib/request/put-messages-request.js.map +1 -0
  176. package/lib/request/update-message-request.d.ts +35 -0
  177. package/lib/request/update-message-request.js +15 -0
  178. package/lib/request/update-message-request.js.map +1 -0
  179. package/lib/request/update-messages-request.d.ts +31 -0
  180. package/lib/request/update-messages-request.js +15 -0
  181. package/lib/request/update-messages-request.js.map +1 -0
  182. package/lib/request/update-queue-request.d.ts +40 -0
  183. package/lib/request/update-queue-request.js +15 -0
  184. package/lib/request/update-queue-request.js.map +1 -0
  185. package/lib/response/change-queue-compartment-response.d.ts +25 -0
  186. package/lib/response/change-queue-compartment-response.js +15 -0
  187. package/lib/response/change-queue-compartment-response.js.map +1 -0
  188. package/lib/response/create-queue-response.d.ts +25 -0
  189. package/lib/response/create-queue-response.js +15 -0
  190. package/lib/response/create-queue-response.js.map +1 -0
  191. package/lib/response/delete-message-response.d.ts +20 -0
  192. package/lib/response/delete-message-response.js +15 -0
  193. package/lib/response/delete-message-response.js.map +1 -0
  194. package/lib/response/delete-messages-response.d.ts +25 -0
  195. package/lib/response/delete-messages-response.js +15 -0
  196. package/lib/response/delete-messages-response.js.map +1 -0
  197. package/lib/response/delete-queue-response.d.ts +25 -0
  198. package/lib/response/delete-queue-response.js +15 -0
  199. package/lib/response/delete-queue-response.js.map +1 -0
  200. package/lib/response/get-messages-response.d.ts +25 -0
  201. package/lib/response/get-messages-response.js +15 -0
  202. package/lib/response/get-messages-response.js.map +1 -0
  203. package/lib/response/get-queue-response.d.ts +30 -0
  204. package/lib/response/get-queue-response.js +15 -0
  205. package/lib/response/get-queue-response.js.map +1 -0
  206. package/lib/response/get-stats-response.d.ts +25 -0
  207. package/lib/response/get-stats-response.js +15 -0
  208. package/lib/response/get-stats-response.js.map +1 -0
  209. package/lib/response/get-work-request-response.d.ts +29 -0
  210. package/lib/response/get-work-request-response.js +15 -0
  211. package/lib/response/get-work-request-response.js.map +1 -0
  212. package/lib/response/index.d.ts +48 -0
  213. package/lib/response/index.js +15 -0
  214. package/lib/response/index.js.map +1 -0
  215. package/lib/response/list-queues-response.d.ts +32 -0
  216. package/lib/response/list-queues-response.js +15 -0
  217. package/lib/response/list-queues-response.js.map +1 -0
  218. package/lib/response/list-work-request-errors-response.d.ts +32 -0
  219. package/lib/response/list-work-request-errors-response.js +15 -0
  220. package/lib/response/list-work-request-errors-response.js.map +1 -0
  221. package/lib/response/list-work-request-logs-response.d.ts +32 -0
  222. package/lib/response/list-work-request-logs-response.js +15 -0
  223. package/lib/response/list-work-request-logs-response.js.map +1 -0
  224. package/lib/response/list-work-requests-response.d.ts +32 -0
  225. package/lib/response/list-work-requests-response.js +15 -0
  226. package/lib/response/list-work-requests-response.js.map +1 -0
  227. package/lib/response/purge-queue-response.d.ts +25 -0
  228. package/lib/response/purge-queue-response.js +15 -0
  229. package/lib/response/purge-queue-response.js.map +1 -0
  230. package/lib/response/put-messages-response.d.ts +25 -0
  231. package/lib/response/put-messages-response.js +15 -0
  232. package/lib/response/put-messages-response.js.map +1 -0
  233. package/lib/response/update-message-response.d.ts +25 -0
  234. package/lib/response/update-message-response.js +15 -0
  235. package/lib/response/update-message-response.js.map +1 -0
  236. package/lib/response/update-messages-response.d.ts +25 -0
  237. package/lib/response/update-messages-response.js +15 -0
  238. package/lib/response/update-messages-response.js.map +1 -0
  239. package/lib/response/update-queue-response.d.ts +25 -0
  240. package/lib/response/update-queue-response.js +15 -0
  241. package/lib/response/update-queue-response.js.map +1 -0
  242. package/package.json +29 -0
package/lib/client.js ADDED
@@ -0,0 +1,1357 @@
1
+ "use strict";
2
+ /**
3
+ * Queue API
4
+ * A description of the Queue API
5
+ * OpenAPI spec version: 20210201
6
+ *
7
+ *
8
+ * NOTE: This class is auto generated by OracleSDKGenerator.
9
+ * Do not edit the class manually.
10
+ *
11
+ * Copyright (c) 2020, 2022, 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.QueueAdminClient = exports.QueueAdminApiKeys = exports.QueueClient = exports.QueueApiKeys = void 0;
44
+ const common = require("oci-common");
45
+ const model = __importStar(require("./model"));
46
+ const queueadmin_waiter_1 = require("./queueadmin-waiter");
47
+ const oci_common_1 = require("oci-common");
48
+ // ===============================================
49
+ // This file is autogenerated - Please do not edit
50
+ // ===============================================
51
+ var QueueApiKeys;
52
+ (function (QueueApiKeys) {
53
+ })(QueueApiKeys = exports.QueueApiKeys || (exports.QueueApiKeys = {}));
54
+ /**
55
+ * This service client uses {@link common.CircuitBreaker.DefaultConfiguration} for all the operations by default if no circuit breaker configuration is defined by the user.
56
+ */
57
+ class QueueClient {
58
+ constructor(params, clientConfiguration) {
59
+ this["_endpoint"] = "";
60
+ this["_defaultHeaders"] = {};
61
+ this._circuitBreaker = null;
62
+ this._httpOptions = undefined;
63
+ this.targetService = "Queue";
64
+ const requestSigner = params.authenticationDetailsProvider
65
+ ? new common.DefaultRequestSigner(params.authenticationDetailsProvider)
66
+ : null;
67
+ if (clientConfiguration) {
68
+ this._clientConfiguration = clientConfiguration;
69
+ this._circuitBreaker = clientConfiguration.circuitBreaker
70
+ ? clientConfiguration.circuitBreaker.circuit
71
+ : null;
72
+ this._httpOptions = clientConfiguration.httpOptions
73
+ ? clientConfiguration.httpOptions
74
+ : undefined;
75
+ }
76
+ // if circuit breaker is not created, check if circuit breaker system is enabled to use default circuit breaker
77
+ const specCircuitBreakerEnabled = true;
78
+ if (!this._circuitBreaker &&
79
+ common.utils.isCircuitBreakerSystemEnabled(clientConfiguration) &&
80
+ (specCircuitBreakerEnabled || common.CircuitBreaker.DefaultCircuitBreakerOverriden)) {
81
+ this._circuitBreaker = new common.CircuitBreaker().circuit;
82
+ }
83
+ this._httpClient =
84
+ params.httpClient ||
85
+ new common.FetchHttpClient(requestSigner, this._circuitBreaker, this._httpOptions);
86
+ if (params.authenticationDetailsProvider &&
87
+ common.isRegionProvider(params.authenticationDetailsProvider)) {
88
+ const provider = params.authenticationDetailsProvider;
89
+ if (provider.getRegion()) {
90
+ this.region = provider.getRegion();
91
+ }
92
+ }
93
+ }
94
+ /**
95
+ * Get the endpoint that is being used to call (ex, https://www.example.com).
96
+ */
97
+ get endpoint() {
98
+ return this._endpoint;
99
+ }
100
+ /**
101
+ * Sets the endpoint to call (ex, https://www.example.com).
102
+ * @param endpoint The endpoint of the service.
103
+ */
104
+ set endpoint(endpoint) {
105
+ this._endpoint = endpoint;
106
+ this._endpoint = this._endpoint + "/20210201";
107
+ if (this.logger)
108
+ this.logger.info(`QueueClient endpoint set to ${this._endpoint}`);
109
+ }
110
+ get logger() {
111
+ return common.LOG.logger;
112
+ }
113
+ /**
114
+ * Sets the region to call (ex, Region.US_PHOENIX_1).
115
+ * Note, this will call {@link #endpoint(String) endpoint} after resolving the endpoint.
116
+ * @param region The region of the service.
117
+ */
118
+ set region(region) {
119
+ this.endpoint = common.EndpointBuilder.createEndpointFromRegion(QueueClient.serviceEndpointTemplate, region, QueueClient.endpointServiceName);
120
+ }
121
+ /**
122
+ * Sets the regionId to call (ex, 'us-phoenix-1').
123
+ *
124
+ * Note, this will first try to map the region ID to a known Region and call {@link #region(Region) region}.
125
+ * If no known Region could be determined, it will create an endpoint assuming its in default Realm OC1
126
+ * and then call {@link #endpoint(String) endpoint}.
127
+ * @param regionId The public region ID.
128
+ */
129
+ set regionId(regionId) {
130
+ this.endpoint = common.EndpointBuilder.createEndpointFromRegionId(QueueClient.serviceEndpointTemplate, regionId, QueueClient.endpointServiceName);
131
+ }
132
+ /**
133
+ * Deletes from the queue the message represented by the receipt.
134
+ * This operation uses {@link common.OciSdkDefaultRetryConfiguration} by default if no retry configuration is defined by the user.
135
+ * @param DeleteMessageRequest
136
+ * @return DeleteMessageResponse
137
+ * @throws OciError when an error occurs
138
+ * @example Click {@link https://docs.cloud.oracle.com/en-us/iaas/tools/typescript-sdk-examples/2.50.0/queue/DeleteMessage.ts.html |here} to see how to use DeleteMessage API.
139
+ */
140
+ deleteMessage(deleteMessageRequest) {
141
+ return __awaiter(this, void 0, void 0, function* () {
142
+ if (this.logger)
143
+ this.logger.debug("Calling operation QueueClient#deleteMessage.");
144
+ const operationName = "deleteMessage";
145
+ const apiReferenceLink = "";
146
+ const pathParams = {
147
+ "{queueId}": deleteMessageRequest.queueId,
148
+ "{messageReceipt}": deleteMessageRequest.messageReceipt
149
+ };
150
+ const queryParams = {};
151
+ let headerParams = {
152
+ "Content-Type": common.Constants.APPLICATION_JSON,
153
+ "opc-request-id": deleteMessageRequest.opcRequestId
154
+ };
155
+ const specRetryConfiguration = common.OciSdkDefaultRetryConfiguration;
156
+ const retrier = oci_common_1.GenericRetrier.createPreferredRetrier(this._clientConfiguration ? this._clientConfiguration.retryConfiguration : undefined, deleteMessageRequest.retryConfiguration, specRetryConfiguration);
157
+ if (this.logger)
158
+ retrier.logger = this.logger;
159
+ const request = yield oci_common_1.composeRequest({
160
+ baseEndpoint: this._endpoint,
161
+ defaultHeaders: this._defaultHeaders,
162
+ path: "/queues/{queueId}/messages/{messageReceipt}",
163
+ method: "DELETE",
164
+ pathParams: pathParams,
165
+ headerParams: headerParams,
166
+ queryParams: queryParams
167
+ });
168
+ try {
169
+ const response = yield retrier.makeServiceCall(this._httpClient, request, this.targetService, operationName, apiReferenceLink);
170
+ const sdkResponse = oci_common_1.composeResponse({
171
+ responseObject: {},
172
+ responseHeaders: [
173
+ {
174
+ value: response.headers.get("opc-request-id"),
175
+ key: "opcRequestId",
176
+ dataType: "string"
177
+ }
178
+ ]
179
+ });
180
+ return sdkResponse;
181
+ }
182
+ catch (err) {
183
+ throw err;
184
+ }
185
+ });
186
+ }
187
+ /**
188
+ * Deletes multiple messages from the queue.
189
+ * This operation uses {@link common.OciSdkDefaultRetryConfiguration} by default if no retry configuration is defined by the user.
190
+ * @param DeleteMessagesRequest
191
+ * @return DeleteMessagesResponse
192
+ * @throws OciError when an error occurs
193
+ * @example Click {@link https://docs.cloud.oracle.com/en-us/iaas/tools/typescript-sdk-examples/2.50.0/queue/DeleteMessages.ts.html |here} to see how to use DeleteMessages API.
194
+ */
195
+ deleteMessages(deleteMessagesRequest) {
196
+ return __awaiter(this, void 0, void 0, function* () {
197
+ if (this.logger)
198
+ this.logger.debug("Calling operation QueueClient#deleteMessages.");
199
+ const operationName = "deleteMessages";
200
+ const apiReferenceLink = "";
201
+ const pathParams = {
202
+ "{queueId}": deleteMessagesRequest.queueId
203
+ };
204
+ const queryParams = {};
205
+ let headerParams = {
206
+ "Content-Type": common.Constants.APPLICATION_JSON,
207
+ "opc-request-id": deleteMessagesRequest.opcRequestId
208
+ };
209
+ const specRetryConfiguration = common.OciSdkDefaultRetryConfiguration;
210
+ const retrier = oci_common_1.GenericRetrier.createPreferredRetrier(this._clientConfiguration ? this._clientConfiguration.retryConfiguration : undefined, deleteMessagesRequest.retryConfiguration, specRetryConfiguration);
211
+ if (this.logger)
212
+ retrier.logger = this.logger;
213
+ const request = yield oci_common_1.composeRequest({
214
+ baseEndpoint: this._endpoint,
215
+ defaultHeaders: this._defaultHeaders,
216
+ path: "/queues/{queueId}/messages/actions/deleteMessages",
217
+ method: "POST",
218
+ bodyContent: common.ObjectSerializer.serialize(deleteMessagesRequest.deleteMessagesDetails, "DeleteMessagesDetails", model.DeleteMessagesDetails.getJsonObj),
219
+ pathParams: pathParams,
220
+ headerParams: headerParams,
221
+ queryParams: queryParams
222
+ });
223
+ try {
224
+ const response = yield retrier.makeServiceCall(this._httpClient, request, this.targetService, operationName, apiReferenceLink);
225
+ const sdkResponse = oci_common_1.composeResponse({
226
+ responseObject: {},
227
+ body: yield response.json(),
228
+ bodyKey: "deleteMessagesResult",
229
+ bodyModel: model.DeleteMessagesResult,
230
+ type: "model.DeleteMessagesResult",
231
+ responseHeaders: [
232
+ {
233
+ value: response.headers.get("opc-request-id"),
234
+ key: "opcRequestId",
235
+ dataType: "string"
236
+ }
237
+ ]
238
+ });
239
+ return sdkResponse;
240
+ }
241
+ catch (err) {
242
+ throw err;
243
+ }
244
+ });
245
+ }
246
+ /**
247
+ * Consumes message from the queue.
248
+ * This operation does not retry by default if the user has not defined a retry configuration.
249
+ * @param GetMessagesRequest
250
+ * @return GetMessagesResponse
251
+ * @throws OciError when an error occurs
252
+ * @example Click {@link https://docs.cloud.oracle.com/en-us/iaas/tools/typescript-sdk-examples/2.50.0/queue/GetMessages.ts.html |here} to see how to use GetMessages API.
253
+ */
254
+ getMessages(getMessagesRequest) {
255
+ return __awaiter(this, void 0, void 0, function* () {
256
+ if (this.logger)
257
+ this.logger.debug("Calling operation QueueClient#getMessages.");
258
+ const operationName = "getMessages";
259
+ const apiReferenceLink = "";
260
+ const pathParams = {
261
+ "{queueId}": getMessagesRequest.queueId
262
+ };
263
+ const queryParams = {
264
+ "visibilityInSeconds": getMessagesRequest.visibilityInSeconds,
265
+ "timeoutInSeconds": getMessagesRequest.timeoutInSeconds,
266
+ "limit": getMessagesRequest.limit
267
+ };
268
+ let headerParams = {
269
+ "Content-Type": common.Constants.APPLICATION_JSON,
270
+ "opc-request-id": getMessagesRequest.opcRequestId
271
+ };
272
+ const specRetryConfiguration = common.NoRetryConfigurationDetails;
273
+ const retrier = oci_common_1.GenericRetrier.createPreferredRetrier(this._clientConfiguration ? this._clientConfiguration.retryConfiguration : undefined, getMessagesRequest.retryConfiguration, specRetryConfiguration);
274
+ if (this.logger)
275
+ retrier.logger = this.logger;
276
+ const request = yield oci_common_1.composeRequest({
277
+ baseEndpoint: this._endpoint,
278
+ defaultHeaders: this._defaultHeaders,
279
+ path: "/queues/{queueId}/messages",
280
+ method: "GET",
281
+ pathParams: pathParams,
282
+ headerParams: headerParams,
283
+ queryParams: queryParams
284
+ });
285
+ try {
286
+ const response = yield retrier.makeServiceCall(this._httpClient, request, this.targetService, operationName, apiReferenceLink);
287
+ const sdkResponse = oci_common_1.composeResponse({
288
+ responseObject: {},
289
+ body: yield response.json(),
290
+ bodyKey: "getMessages",
291
+ bodyModel: model.GetMessages,
292
+ type: "model.GetMessages",
293
+ responseHeaders: [
294
+ {
295
+ value: response.headers.get("opc-request-id"),
296
+ key: "opcRequestId",
297
+ dataType: "string"
298
+ }
299
+ ]
300
+ });
301
+ return sdkResponse;
302
+ }
303
+ catch (err) {
304
+ throw err;
305
+ }
306
+ });
307
+ }
308
+ /**
309
+ * Gets the statistics for the queue and its dead letter queue.
310
+ * This operation uses {@link common.OciSdkDefaultRetryConfiguration} by default if no retry configuration is defined by the user.
311
+ * @param GetStatsRequest
312
+ * @return GetStatsResponse
313
+ * @throws OciError when an error occurs
314
+ * @example Click {@link https://docs.cloud.oracle.com/en-us/iaas/tools/typescript-sdk-examples/2.50.0/queue/GetStats.ts.html |here} to see how to use GetStats API.
315
+ */
316
+ getStats(getStatsRequest) {
317
+ return __awaiter(this, void 0, void 0, function* () {
318
+ if (this.logger)
319
+ this.logger.debug("Calling operation QueueClient#getStats.");
320
+ const operationName = "getStats";
321
+ const apiReferenceLink = "";
322
+ const pathParams = {
323
+ "{queueId}": getStatsRequest.queueId
324
+ };
325
+ const queryParams = {};
326
+ let headerParams = {
327
+ "Content-Type": common.Constants.APPLICATION_JSON,
328
+ "opc-request-id": getStatsRequest.opcRequestId
329
+ };
330
+ const specRetryConfiguration = common.OciSdkDefaultRetryConfiguration;
331
+ const retrier = oci_common_1.GenericRetrier.createPreferredRetrier(this._clientConfiguration ? this._clientConfiguration.retryConfiguration : undefined, getStatsRequest.retryConfiguration, specRetryConfiguration);
332
+ if (this.logger)
333
+ retrier.logger = this.logger;
334
+ const request = yield oci_common_1.composeRequest({
335
+ baseEndpoint: this._endpoint,
336
+ defaultHeaders: this._defaultHeaders,
337
+ path: "/queues/{queueId}/stats",
338
+ method: "GET",
339
+ pathParams: pathParams,
340
+ headerParams: headerParams,
341
+ queryParams: queryParams
342
+ });
343
+ try {
344
+ const response = yield retrier.makeServiceCall(this._httpClient, request, this.targetService, operationName, apiReferenceLink);
345
+ const sdkResponse = oci_common_1.composeResponse({
346
+ responseObject: {},
347
+ body: yield response.json(),
348
+ bodyKey: "queueStats",
349
+ bodyModel: model.QueueStats,
350
+ type: "model.QueueStats",
351
+ responseHeaders: [
352
+ {
353
+ value: response.headers.get("opc-request-id"),
354
+ key: "opcRequestId",
355
+ dataType: "string"
356
+ }
357
+ ]
358
+ });
359
+ return sdkResponse;
360
+ }
361
+ catch (err) {
362
+ throw err;
363
+ }
364
+ });
365
+ }
366
+ /**
367
+ * Puts messages in the queue
368
+ * This operation does not retry by default if the user has not defined a retry configuration.
369
+ * @param PutMessagesRequest
370
+ * @return PutMessagesResponse
371
+ * @throws OciError when an error occurs
372
+ * @example Click {@link https://docs.cloud.oracle.com/en-us/iaas/tools/typescript-sdk-examples/2.50.0/queue/PutMessages.ts.html |here} to see how to use PutMessages API.
373
+ */
374
+ putMessages(putMessagesRequest) {
375
+ return __awaiter(this, void 0, void 0, function* () {
376
+ if (this.logger)
377
+ this.logger.debug("Calling operation QueueClient#putMessages.");
378
+ const operationName = "putMessages";
379
+ const apiReferenceLink = "";
380
+ const pathParams = {
381
+ "{queueId}": putMessagesRequest.queueId
382
+ };
383
+ const queryParams = {};
384
+ let headerParams = {
385
+ "Content-Type": common.Constants.APPLICATION_JSON,
386
+ "opc-request-id": putMessagesRequest.opcRequestId
387
+ };
388
+ const specRetryConfiguration = common.NoRetryConfigurationDetails;
389
+ const retrier = oci_common_1.GenericRetrier.createPreferredRetrier(this._clientConfiguration ? this._clientConfiguration.retryConfiguration : undefined, putMessagesRequest.retryConfiguration, specRetryConfiguration);
390
+ if (this.logger)
391
+ retrier.logger = this.logger;
392
+ const request = yield oci_common_1.composeRequest({
393
+ baseEndpoint: this._endpoint,
394
+ defaultHeaders: this._defaultHeaders,
395
+ path: "/queues/{queueId}/messages",
396
+ method: "POST",
397
+ bodyContent: common.ObjectSerializer.serialize(putMessagesRequest.putMessagesDetails, "PutMessagesDetails", model.PutMessagesDetails.getJsonObj),
398
+ pathParams: pathParams,
399
+ headerParams: headerParams,
400
+ queryParams: queryParams
401
+ });
402
+ try {
403
+ const response = yield retrier.makeServiceCall(this._httpClient, request, this.targetService, operationName, apiReferenceLink);
404
+ const sdkResponse = oci_common_1.composeResponse({
405
+ responseObject: {},
406
+ body: yield response.json(),
407
+ bodyKey: "putMessages",
408
+ bodyModel: model.PutMessages,
409
+ type: "model.PutMessages",
410
+ responseHeaders: [
411
+ {
412
+ value: response.headers.get("opc-request-id"),
413
+ key: "opcRequestId",
414
+ dataType: "string"
415
+ }
416
+ ]
417
+ });
418
+ return sdkResponse;
419
+ }
420
+ catch (err) {
421
+ throw err;
422
+ }
423
+ });
424
+ }
425
+ /**
426
+ * Updates the visibility of the message represented by the receipt.
427
+ * This operation uses {@link common.OciSdkDefaultRetryConfiguration} by default if no retry configuration is defined by the user.
428
+ * @param UpdateMessageRequest
429
+ * @return UpdateMessageResponse
430
+ * @throws OciError when an error occurs
431
+ * @example Click {@link https://docs.cloud.oracle.com/en-us/iaas/tools/typescript-sdk-examples/2.50.0/queue/UpdateMessage.ts.html |here} to see how to use UpdateMessage API.
432
+ */
433
+ updateMessage(updateMessageRequest) {
434
+ return __awaiter(this, void 0, void 0, function* () {
435
+ if (this.logger)
436
+ this.logger.debug("Calling operation QueueClient#updateMessage.");
437
+ const operationName = "updateMessage";
438
+ const apiReferenceLink = "";
439
+ const pathParams = {
440
+ "{queueId}": updateMessageRequest.queueId,
441
+ "{messageReceipt}": updateMessageRequest.messageReceipt
442
+ };
443
+ const queryParams = {};
444
+ let headerParams = {
445
+ "Content-Type": common.Constants.APPLICATION_JSON,
446
+ "opc-request-id": updateMessageRequest.opcRequestId
447
+ };
448
+ const specRetryConfiguration = common.OciSdkDefaultRetryConfiguration;
449
+ const retrier = oci_common_1.GenericRetrier.createPreferredRetrier(this._clientConfiguration ? this._clientConfiguration.retryConfiguration : undefined, updateMessageRequest.retryConfiguration, specRetryConfiguration);
450
+ if (this.logger)
451
+ retrier.logger = this.logger;
452
+ const request = yield oci_common_1.composeRequest({
453
+ baseEndpoint: this._endpoint,
454
+ defaultHeaders: this._defaultHeaders,
455
+ path: "/queues/{queueId}/messages/{messageReceipt}",
456
+ method: "PUT",
457
+ bodyContent: common.ObjectSerializer.serialize(updateMessageRequest.updateMessageDetails, "UpdateMessageDetails", model.UpdateMessageDetails.getJsonObj),
458
+ pathParams: pathParams,
459
+ headerParams: headerParams,
460
+ queryParams: queryParams
461
+ });
462
+ try {
463
+ const response = yield retrier.makeServiceCall(this._httpClient, request, this.targetService, operationName, apiReferenceLink);
464
+ const sdkResponse = oci_common_1.composeResponse({
465
+ responseObject: {},
466
+ body: yield response.json(),
467
+ bodyKey: "updatedMessage",
468
+ bodyModel: model.UpdatedMessage,
469
+ type: "model.UpdatedMessage",
470
+ responseHeaders: [
471
+ {
472
+ value: response.headers.get("opc-request-id"),
473
+ key: "opcRequestId",
474
+ dataType: "string"
475
+ }
476
+ ]
477
+ });
478
+ return sdkResponse;
479
+ }
480
+ catch (err) {
481
+ throw err;
482
+ }
483
+ });
484
+ }
485
+ /**
486
+ * Updates multiple messages in the queue.
487
+ * This operation uses {@link common.OciSdkDefaultRetryConfiguration} by default if no retry configuration is defined by the user.
488
+ * @param UpdateMessagesRequest
489
+ * @return UpdateMessagesResponse
490
+ * @throws OciError when an error occurs
491
+ * @example Click {@link https://docs.cloud.oracle.com/en-us/iaas/tools/typescript-sdk-examples/2.50.0/queue/UpdateMessages.ts.html |here} to see how to use UpdateMessages API.
492
+ */
493
+ updateMessages(updateMessagesRequest) {
494
+ return __awaiter(this, void 0, void 0, function* () {
495
+ if (this.logger)
496
+ this.logger.debug("Calling operation QueueClient#updateMessages.");
497
+ const operationName = "updateMessages";
498
+ const apiReferenceLink = "";
499
+ const pathParams = {
500
+ "{queueId}": updateMessagesRequest.queueId
501
+ };
502
+ const queryParams = {};
503
+ let headerParams = {
504
+ "Content-Type": common.Constants.APPLICATION_JSON,
505
+ "opc-request-id": updateMessagesRequest.opcRequestId
506
+ };
507
+ const specRetryConfiguration = common.OciSdkDefaultRetryConfiguration;
508
+ const retrier = oci_common_1.GenericRetrier.createPreferredRetrier(this._clientConfiguration ? this._clientConfiguration.retryConfiguration : undefined, updateMessagesRequest.retryConfiguration, specRetryConfiguration);
509
+ if (this.logger)
510
+ retrier.logger = this.logger;
511
+ const request = yield oci_common_1.composeRequest({
512
+ baseEndpoint: this._endpoint,
513
+ defaultHeaders: this._defaultHeaders,
514
+ path: "/queues/{queueId}/messages/actions/updateMessages",
515
+ method: "POST",
516
+ bodyContent: common.ObjectSerializer.serialize(updateMessagesRequest.updateMessagesDetails, "UpdateMessagesDetails", model.UpdateMessagesDetails.getJsonObj),
517
+ pathParams: pathParams,
518
+ headerParams: headerParams,
519
+ queryParams: queryParams
520
+ });
521
+ try {
522
+ const response = yield retrier.makeServiceCall(this._httpClient, request, this.targetService, operationName, apiReferenceLink);
523
+ const sdkResponse = oci_common_1.composeResponse({
524
+ responseObject: {},
525
+ body: yield response.json(),
526
+ bodyKey: "updateMessagesResult",
527
+ bodyModel: model.UpdateMessagesResult,
528
+ type: "model.UpdateMessagesResult",
529
+ responseHeaders: [
530
+ {
531
+ value: response.headers.get("opc-request-id"),
532
+ key: "opcRequestId",
533
+ dataType: "string"
534
+ }
535
+ ]
536
+ });
537
+ return sdkResponse;
538
+ }
539
+ catch (err) {
540
+ throw err;
541
+ }
542
+ });
543
+ }
544
+ }
545
+ exports.QueueClient = QueueClient;
546
+ QueueClient.serviceEndpointTemplate = "https://messaging.{region}.oci.{secondLevelDomain}";
547
+ QueueClient.endpointServiceName = "";
548
+ var QueueAdminApiKeys;
549
+ (function (QueueAdminApiKeys) {
550
+ })(QueueAdminApiKeys = exports.QueueAdminApiKeys || (exports.QueueAdminApiKeys = {}));
551
+ /**
552
+ * This service client uses {@link common.CircuitBreaker.DefaultConfiguration} for all the operations by default if no circuit breaker configuration is defined by the user.
553
+ */
554
+ class QueueAdminClient {
555
+ constructor(params, clientConfiguration) {
556
+ this["_endpoint"] = "";
557
+ this["_defaultHeaders"] = {};
558
+ this._circuitBreaker = null;
559
+ this._httpOptions = undefined;
560
+ this.targetService = "QueueAdmin";
561
+ const requestSigner = params.authenticationDetailsProvider
562
+ ? new common.DefaultRequestSigner(params.authenticationDetailsProvider)
563
+ : null;
564
+ if (clientConfiguration) {
565
+ this._clientConfiguration = clientConfiguration;
566
+ this._circuitBreaker = clientConfiguration.circuitBreaker
567
+ ? clientConfiguration.circuitBreaker.circuit
568
+ : null;
569
+ this._httpOptions = clientConfiguration.httpOptions
570
+ ? clientConfiguration.httpOptions
571
+ : undefined;
572
+ }
573
+ // if circuit breaker is not created, check if circuit breaker system is enabled to use default circuit breaker
574
+ const specCircuitBreakerEnabled = true;
575
+ if (!this._circuitBreaker &&
576
+ common.utils.isCircuitBreakerSystemEnabled(clientConfiguration) &&
577
+ (specCircuitBreakerEnabled || common.CircuitBreaker.DefaultCircuitBreakerOverriden)) {
578
+ this._circuitBreaker = new common.CircuitBreaker().circuit;
579
+ }
580
+ this._httpClient =
581
+ params.httpClient ||
582
+ new common.FetchHttpClient(requestSigner, this._circuitBreaker, this._httpOptions);
583
+ if (params.authenticationDetailsProvider &&
584
+ common.isRegionProvider(params.authenticationDetailsProvider)) {
585
+ const provider = params.authenticationDetailsProvider;
586
+ if (provider.getRegion()) {
587
+ this.region = provider.getRegion();
588
+ }
589
+ }
590
+ }
591
+ /**
592
+ * Get the endpoint that is being used to call (ex, https://www.example.com).
593
+ */
594
+ get endpoint() {
595
+ return this._endpoint;
596
+ }
597
+ /**
598
+ * Sets the endpoint to call (ex, https://www.example.com).
599
+ * @param endpoint The endpoint of the service.
600
+ */
601
+ set endpoint(endpoint) {
602
+ this._endpoint = endpoint;
603
+ this._endpoint = this._endpoint + "/20210201";
604
+ if (this.logger)
605
+ this.logger.info(`QueueAdminClient endpoint set to ${this._endpoint}`);
606
+ }
607
+ get logger() {
608
+ return common.LOG.logger;
609
+ }
610
+ /**
611
+ * Sets the region to call (ex, Region.US_PHOENIX_1).
612
+ * Note, this will call {@link #endpoint(String) endpoint} after resolving the endpoint.
613
+ * @param region The region of the service.
614
+ */
615
+ set region(region) {
616
+ this.endpoint = common.EndpointBuilder.createEndpointFromRegion(QueueAdminClient.serviceEndpointTemplate, region, QueueAdminClient.endpointServiceName);
617
+ }
618
+ /**
619
+ * Sets the regionId to call (ex, 'us-phoenix-1').
620
+ *
621
+ * Note, this will first try to map the region ID to a known Region and call {@link #region(Region) region}.
622
+ * If no known Region could be determined, it will create an endpoint assuming its in default Realm OC1
623
+ * and then call {@link #endpoint(String) endpoint}.
624
+ * @param regionId The public region ID.
625
+ */
626
+ set regionId(regionId) {
627
+ this.endpoint = common.EndpointBuilder.createEndpointFromRegionId(QueueAdminClient.serviceEndpointTemplate, regionId, QueueAdminClient.endpointServiceName);
628
+ }
629
+ /**
630
+ * Creates a new QueueAdminWaiter for resources for this service.
631
+ *
632
+ * @param config The waiter configuration for termination and delay strategy
633
+ * @return The service waiters.
634
+ */
635
+ createWaiters(config) {
636
+ this._waiters = new queueadmin_waiter_1.QueueAdminWaiter(this, config);
637
+ return this._waiters;
638
+ }
639
+ /**
640
+ * Gets the waiters available for resources for this service.
641
+ *
642
+ * @return The service waiters.
643
+ */
644
+ getWaiters() {
645
+ if (this._waiters) {
646
+ return this._waiters;
647
+ }
648
+ throw Error("Waiters do not exist. Please create waiters.");
649
+ }
650
+ /**
651
+ * Moves a Queue resource from one compartment identifier to another. When provided, If-Match is checked against ETag values of the resource.
652
+ * This operation uses {@link common.OciSdkDefaultRetryConfiguration} by default if no retry configuration is defined by the user.
653
+ * @param ChangeQueueCompartmentRequest
654
+ * @return ChangeQueueCompartmentResponse
655
+ * @throws OciError when an error occurs
656
+ * @example Click {@link https://docs.cloud.oracle.com/en-us/iaas/tools/typescript-sdk-examples/2.50.0/queue/ChangeQueueCompartment.ts.html |here} to see how to use ChangeQueueCompartment API.
657
+ */
658
+ changeQueueCompartment(changeQueueCompartmentRequest) {
659
+ return __awaiter(this, void 0, void 0, function* () {
660
+ if (this.logger)
661
+ this.logger.debug("Calling operation QueueAdminClient#changeQueueCompartment.");
662
+ const operationName = "changeQueueCompartment";
663
+ const apiReferenceLink = "";
664
+ const pathParams = {
665
+ "{queueId}": changeQueueCompartmentRequest.queueId
666
+ };
667
+ const queryParams = {};
668
+ let headerParams = {
669
+ "Content-Type": common.Constants.APPLICATION_JSON,
670
+ "if-match": changeQueueCompartmentRequest.ifMatch,
671
+ "opc-request-id": changeQueueCompartmentRequest.opcRequestId
672
+ };
673
+ const specRetryConfiguration = common.OciSdkDefaultRetryConfiguration;
674
+ const retrier = oci_common_1.GenericRetrier.createPreferredRetrier(this._clientConfiguration ? this._clientConfiguration.retryConfiguration : undefined, changeQueueCompartmentRequest.retryConfiguration, specRetryConfiguration);
675
+ if (this.logger)
676
+ retrier.logger = this.logger;
677
+ const request = yield oci_common_1.composeRequest({
678
+ baseEndpoint: this._endpoint,
679
+ defaultHeaders: this._defaultHeaders,
680
+ path: "/queues/{queueId}/actions/changeCompartment",
681
+ method: "POST",
682
+ bodyContent: common.ObjectSerializer.serialize(changeQueueCompartmentRequest.changeQueueCompartmentDetails, "ChangeQueueCompartmentDetails", model.ChangeQueueCompartmentDetails.getJsonObj),
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
+ responseHeaders: [
692
+ {
693
+ value: response.headers.get("opc-work-request-id"),
694
+ key: "opcWorkRequestId",
695
+ dataType: "string"
696
+ },
697
+ {
698
+ value: response.headers.get("opc-request-id"),
699
+ key: "opcRequestId",
700
+ dataType: "string"
701
+ }
702
+ ]
703
+ });
704
+ return sdkResponse;
705
+ }
706
+ catch (err) {
707
+ throw err;
708
+ }
709
+ });
710
+ }
711
+ /**
712
+ * Creates a new Queue.
713
+ *
714
+ * This operation uses {@link common.OciSdkDefaultRetryConfiguration} by default if no retry configuration is defined by the user.
715
+ * @param CreateQueueRequest
716
+ * @return CreateQueueResponse
717
+ * @throws OciError when an error occurs
718
+ * @example Click {@link https://docs.cloud.oracle.com/en-us/iaas/tools/typescript-sdk-examples/2.50.0/queue/CreateQueue.ts.html |here} to see how to use CreateQueue API.
719
+ */
720
+ createQueue(createQueueRequest) {
721
+ return __awaiter(this, void 0, void 0, function* () {
722
+ if (this.logger)
723
+ this.logger.debug("Calling operation QueueAdminClient#createQueue.");
724
+ const operationName = "createQueue";
725
+ const apiReferenceLink = "";
726
+ const pathParams = {};
727
+ const queryParams = {};
728
+ let headerParams = {
729
+ "Content-Type": common.Constants.APPLICATION_JSON,
730
+ "opc-retry-token": createQueueRequest.opcRetryToken,
731
+ "opc-request-id": createQueueRequest.opcRequestId
732
+ };
733
+ const specRetryConfiguration = common.OciSdkDefaultRetryConfiguration;
734
+ const retrier = oci_common_1.GenericRetrier.createPreferredRetrier(this._clientConfiguration ? this._clientConfiguration.retryConfiguration : undefined, createQueueRequest.retryConfiguration, specRetryConfiguration);
735
+ if (this.logger)
736
+ retrier.logger = this.logger;
737
+ const request = yield oci_common_1.composeRequest({
738
+ baseEndpoint: this._endpoint,
739
+ defaultHeaders: this._defaultHeaders,
740
+ path: "/queues",
741
+ method: "POST",
742
+ bodyContent: common.ObjectSerializer.serialize(createQueueRequest.createQueueDetails, "CreateQueueDetails", model.CreateQueueDetails.getJsonObj),
743
+ pathParams: pathParams,
744
+ headerParams: headerParams,
745
+ queryParams: queryParams
746
+ });
747
+ try {
748
+ const response = yield retrier.makeServiceCall(this._httpClient, request, this.targetService, operationName, apiReferenceLink);
749
+ const sdkResponse = oci_common_1.composeResponse({
750
+ responseObject: {},
751
+ responseHeaders: [
752
+ {
753
+ value: response.headers.get("opc-work-request-id"),
754
+ key: "opcWorkRequestId",
755
+ dataType: "string"
756
+ },
757
+ {
758
+ value: response.headers.get("opc-request-id"),
759
+ key: "opcRequestId",
760
+ dataType: "string"
761
+ }
762
+ ]
763
+ });
764
+ return sdkResponse;
765
+ }
766
+ catch (err) {
767
+ throw err;
768
+ }
769
+ });
770
+ }
771
+ /**
772
+ * Deletes a Queue resource by identifier
773
+ * This operation uses {@link common.OciSdkDefaultRetryConfiguration} by default if no retry configuration is defined by the user.
774
+ * @param DeleteQueueRequest
775
+ * @return DeleteQueueResponse
776
+ * @throws OciError when an error occurs
777
+ * @example Click {@link https://docs.cloud.oracle.com/en-us/iaas/tools/typescript-sdk-examples/2.50.0/queue/DeleteQueue.ts.html |here} to see how to use DeleteQueue API.
778
+ */
779
+ deleteQueue(deleteQueueRequest) {
780
+ return __awaiter(this, void 0, void 0, function* () {
781
+ if (this.logger)
782
+ this.logger.debug("Calling operation QueueAdminClient#deleteQueue.");
783
+ const operationName = "deleteQueue";
784
+ const apiReferenceLink = "";
785
+ const pathParams = {
786
+ "{queueId}": deleteQueueRequest.queueId
787
+ };
788
+ const queryParams = {};
789
+ let headerParams = {
790
+ "Content-Type": common.Constants.APPLICATION_JSON,
791
+ "if-match": deleteQueueRequest.ifMatch,
792
+ "opc-request-id": deleteQueueRequest.opcRequestId
793
+ };
794
+ const specRetryConfiguration = common.OciSdkDefaultRetryConfiguration;
795
+ const retrier = oci_common_1.GenericRetrier.createPreferredRetrier(this._clientConfiguration ? this._clientConfiguration.retryConfiguration : undefined, deleteQueueRequest.retryConfiguration, specRetryConfiguration);
796
+ if (this.logger)
797
+ retrier.logger = this.logger;
798
+ const request = yield oci_common_1.composeRequest({
799
+ baseEndpoint: this._endpoint,
800
+ defaultHeaders: this._defaultHeaders,
801
+ path: "/queues/{queueId}",
802
+ method: "DELETE",
803
+ pathParams: pathParams,
804
+ headerParams: headerParams,
805
+ queryParams: queryParams
806
+ });
807
+ try {
808
+ const response = yield retrier.makeServiceCall(this._httpClient, request, this.targetService, operationName, apiReferenceLink);
809
+ const sdkResponse = oci_common_1.composeResponse({
810
+ responseObject: {},
811
+ responseHeaders: [
812
+ {
813
+ value: response.headers.get("opc-work-request-id"),
814
+ key: "opcWorkRequestId",
815
+ dataType: "string"
816
+ },
817
+ {
818
+ value: response.headers.get("opc-request-id"),
819
+ key: "opcRequestId",
820
+ dataType: "string"
821
+ }
822
+ ]
823
+ });
824
+ return sdkResponse;
825
+ }
826
+ catch (err) {
827
+ throw err;
828
+ }
829
+ });
830
+ }
831
+ /**
832
+ * Gets a Queue by identifier
833
+ * This operation uses {@link common.OciSdkDefaultRetryConfiguration} by default if no retry configuration is defined by the user.
834
+ * @param GetQueueRequest
835
+ * @return GetQueueResponse
836
+ * @throws OciError when an error occurs
837
+ * @example Click {@link https://docs.cloud.oracle.com/en-us/iaas/tools/typescript-sdk-examples/2.50.0/queue/GetQueue.ts.html |here} to see how to use GetQueue API.
838
+ */
839
+ getQueue(getQueueRequest) {
840
+ return __awaiter(this, void 0, void 0, function* () {
841
+ if (this.logger)
842
+ this.logger.debug("Calling operation QueueAdminClient#getQueue.");
843
+ const operationName = "getQueue";
844
+ const apiReferenceLink = "";
845
+ const pathParams = {
846
+ "{queueId}": getQueueRequest.queueId
847
+ };
848
+ const queryParams = {};
849
+ let headerParams = {
850
+ "Content-Type": common.Constants.APPLICATION_JSON,
851
+ "opc-request-id": getQueueRequest.opcRequestId
852
+ };
853
+ const specRetryConfiguration = common.OciSdkDefaultRetryConfiguration;
854
+ const retrier = oci_common_1.GenericRetrier.createPreferredRetrier(this._clientConfiguration ? this._clientConfiguration.retryConfiguration : undefined, getQueueRequest.retryConfiguration, specRetryConfiguration);
855
+ if (this.logger)
856
+ retrier.logger = this.logger;
857
+ const request = yield oci_common_1.composeRequest({
858
+ baseEndpoint: this._endpoint,
859
+ defaultHeaders: this._defaultHeaders,
860
+ path: "/queues/{queueId}",
861
+ method: "GET",
862
+ pathParams: pathParams,
863
+ headerParams: headerParams,
864
+ queryParams: queryParams
865
+ });
866
+ try {
867
+ const response = yield retrier.makeServiceCall(this._httpClient, request, this.targetService, operationName, apiReferenceLink);
868
+ const sdkResponse = oci_common_1.composeResponse({
869
+ responseObject: {},
870
+ body: yield response.json(),
871
+ bodyKey: "queue",
872
+ bodyModel: model.Queue,
873
+ type: "model.Queue",
874
+ responseHeaders: [
875
+ {
876
+ value: response.headers.get("etag"),
877
+ key: "etag",
878
+ dataType: "string"
879
+ },
880
+ {
881
+ value: response.headers.get("opc-request-id"),
882
+ key: "opcRequestId",
883
+ dataType: "string"
884
+ }
885
+ ]
886
+ });
887
+ return sdkResponse;
888
+ }
889
+ catch (err) {
890
+ throw err;
891
+ }
892
+ });
893
+ }
894
+ /**
895
+ * Gets the status of the work request with the given ID.
896
+ * This operation uses {@link common.OciSdkDefaultRetryConfiguration} by default if no retry configuration is defined by the user.
897
+ * @param GetWorkRequestRequest
898
+ * @return GetWorkRequestResponse
899
+ * @throws OciError when an error occurs
900
+ * @example Click {@link https://docs.cloud.oracle.com/en-us/iaas/tools/typescript-sdk-examples/2.50.0/queue/GetWorkRequest.ts.html |here} to see how to use GetWorkRequest API.
901
+ */
902
+ getWorkRequest(getWorkRequestRequest) {
903
+ return __awaiter(this, void 0, void 0, function* () {
904
+ if (this.logger)
905
+ this.logger.debug("Calling operation QueueAdminClient#getWorkRequest.");
906
+ const operationName = "getWorkRequest";
907
+ const apiReferenceLink = "";
908
+ const pathParams = {
909
+ "{workRequestId}": getWorkRequestRequest.workRequestId
910
+ };
911
+ const queryParams = {};
912
+ let headerParams = {
913
+ "Content-Type": common.Constants.APPLICATION_JSON,
914
+ "opc-request-id": getWorkRequestRequest.opcRequestId
915
+ };
916
+ const specRetryConfiguration = common.OciSdkDefaultRetryConfiguration;
917
+ const retrier = oci_common_1.GenericRetrier.createPreferredRetrier(this._clientConfiguration ? this._clientConfiguration.retryConfiguration : undefined, getWorkRequestRequest.retryConfiguration, specRetryConfiguration);
918
+ if (this.logger)
919
+ retrier.logger = this.logger;
920
+ const request = yield oci_common_1.composeRequest({
921
+ baseEndpoint: this._endpoint,
922
+ defaultHeaders: this._defaultHeaders,
923
+ path: "/workRequests/{workRequestId}",
924
+ method: "GET",
925
+ pathParams: pathParams,
926
+ headerParams: headerParams,
927
+ queryParams: queryParams
928
+ });
929
+ try {
930
+ const response = yield retrier.makeServiceCall(this._httpClient, request, this.targetService, operationName, apiReferenceLink);
931
+ const sdkResponse = oci_common_1.composeResponse({
932
+ responseObject: {},
933
+ body: yield response.json(),
934
+ bodyKey: "workRequest",
935
+ bodyModel: model.WorkRequest,
936
+ type: "model.WorkRequest",
937
+ responseHeaders: [
938
+ {
939
+ value: response.headers.get("opc-request-id"),
940
+ key: "opcRequestId",
941
+ dataType: "string"
942
+ },
943
+ {
944
+ value: response.headers.get("retry-after"),
945
+ key: "retryAfter",
946
+ dataType: "number"
947
+ }
948
+ ]
949
+ });
950
+ return sdkResponse;
951
+ }
952
+ catch (err) {
953
+ throw err;
954
+ }
955
+ });
956
+ }
957
+ /**
958
+ * Returns a list of Queues.
959
+ *
960
+ * This operation uses {@link common.OciSdkDefaultRetryConfiguration} by default if no retry configuration is defined by the user.
961
+ * @param ListQueuesRequest
962
+ * @return ListQueuesResponse
963
+ * @throws OciError when an error occurs
964
+ * @example Click {@link https://docs.cloud.oracle.com/en-us/iaas/tools/typescript-sdk-examples/2.50.0/queue/ListQueues.ts.html |here} to see how to use ListQueues API.
965
+ */
966
+ listQueues(listQueuesRequest) {
967
+ return __awaiter(this, void 0, void 0, function* () {
968
+ if (this.logger)
969
+ this.logger.debug("Calling operation QueueAdminClient#listQueues.");
970
+ const operationName = "listQueues";
971
+ const apiReferenceLink = "";
972
+ const pathParams = {};
973
+ const queryParams = {
974
+ "compartmentId": listQueuesRequest.compartmentId,
975
+ "lifecycleState": listQueuesRequest.lifecycleState,
976
+ "displayName": listQueuesRequest.displayName,
977
+ "id": listQueuesRequest.id,
978
+ "limit": listQueuesRequest.limit,
979
+ "page": listQueuesRequest.page,
980
+ "sortOrder": listQueuesRequest.sortOrder,
981
+ "sortBy": listQueuesRequest.sortBy
982
+ };
983
+ let headerParams = {
984
+ "Content-Type": common.Constants.APPLICATION_JSON,
985
+ "opc-request-id": listQueuesRequest.opcRequestId
986
+ };
987
+ const specRetryConfiguration = common.OciSdkDefaultRetryConfiguration;
988
+ const retrier = oci_common_1.GenericRetrier.createPreferredRetrier(this._clientConfiguration ? this._clientConfiguration.retryConfiguration : undefined, listQueuesRequest.retryConfiguration, specRetryConfiguration);
989
+ if (this.logger)
990
+ retrier.logger = this.logger;
991
+ const request = yield oci_common_1.composeRequest({
992
+ baseEndpoint: this._endpoint,
993
+ defaultHeaders: this._defaultHeaders,
994
+ path: "/queues",
995
+ method: "GET",
996
+ pathParams: pathParams,
997
+ headerParams: headerParams,
998
+ queryParams: queryParams
999
+ });
1000
+ try {
1001
+ const response = yield retrier.makeServiceCall(this._httpClient, request, this.targetService, operationName, apiReferenceLink);
1002
+ const sdkResponse = oci_common_1.composeResponse({
1003
+ responseObject: {},
1004
+ body: yield response.json(),
1005
+ bodyKey: "queueCollection",
1006
+ bodyModel: model.QueueCollection,
1007
+ type: "model.QueueCollection",
1008
+ responseHeaders: [
1009
+ {
1010
+ value: response.headers.get("opc-request-id"),
1011
+ key: "opcRequestId",
1012
+ dataType: "string"
1013
+ },
1014
+ {
1015
+ value: response.headers.get("opc-next-page"),
1016
+ key: "opcNextPage",
1017
+ dataType: "string"
1018
+ }
1019
+ ]
1020
+ });
1021
+ return sdkResponse;
1022
+ }
1023
+ catch (err) {
1024
+ throw err;
1025
+ }
1026
+ });
1027
+ }
1028
+ /**
1029
+ * Return a (paginated) list of errors for a given work request.
1030
+ *
1031
+ * This operation uses {@link common.OciSdkDefaultRetryConfiguration} by default if no retry configuration is defined by the user.
1032
+ * @param ListWorkRequestErrorsRequest
1033
+ * @return ListWorkRequestErrorsResponse
1034
+ * @throws OciError when an error occurs
1035
+ * @example Click {@link https://docs.cloud.oracle.com/en-us/iaas/tools/typescript-sdk-examples/2.50.0/queue/ListWorkRequestErrors.ts.html |here} to see how to use ListWorkRequestErrors API.
1036
+ */
1037
+ listWorkRequestErrors(listWorkRequestErrorsRequest) {
1038
+ return __awaiter(this, void 0, void 0, function* () {
1039
+ if (this.logger)
1040
+ this.logger.debug("Calling operation QueueAdminClient#listWorkRequestErrors.");
1041
+ const operationName = "listWorkRequestErrors";
1042
+ const apiReferenceLink = "";
1043
+ const pathParams = {
1044
+ "{workRequestId}": listWorkRequestErrorsRequest.workRequestId
1045
+ };
1046
+ const queryParams = {
1047
+ "page": listWorkRequestErrorsRequest.page,
1048
+ "limit": listWorkRequestErrorsRequest.limit
1049
+ };
1050
+ let headerParams = {
1051
+ "Content-Type": common.Constants.APPLICATION_JSON,
1052
+ "opc-request-id": listWorkRequestErrorsRequest.opcRequestId
1053
+ };
1054
+ const specRetryConfiguration = common.OciSdkDefaultRetryConfiguration;
1055
+ const retrier = oci_common_1.GenericRetrier.createPreferredRetrier(this._clientConfiguration ? this._clientConfiguration.retryConfiguration : undefined, listWorkRequestErrorsRequest.retryConfiguration, specRetryConfiguration);
1056
+ if (this.logger)
1057
+ retrier.logger = this.logger;
1058
+ const request = yield oci_common_1.composeRequest({
1059
+ baseEndpoint: this._endpoint,
1060
+ defaultHeaders: this._defaultHeaders,
1061
+ path: "/workRequests/{workRequestId}/errors",
1062
+ method: "GET",
1063
+ pathParams: pathParams,
1064
+ headerParams: headerParams,
1065
+ queryParams: queryParams
1066
+ });
1067
+ try {
1068
+ const response = yield retrier.makeServiceCall(this._httpClient, request, this.targetService, operationName, apiReferenceLink);
1069
+ const sdkResponse = oci_common_1.composeResponse({
1070
+ responseObject: {},
1071
+ body: yield response.json(),
1072
+ bodyKey: "workRequestErrorCollection",
1073
+ bodyModel: model.WorkRequestErrorCollection,
1074
+ type: "model.WorkRequestErrorCollection",
1075
+ responseHeaders: [
1076
+ {
1077
+ value: response.headers.get("opc-next-page"),
1078
+ key: "opcNextPage",
1079
+ dataType: "string"
1080
+ },
1081
+ {
1082
+ value: response.headers.get("opc-request-id"),
1083
+ key: "opcRequestId",
1084
+ dataType: "string"
1085
+ }
1086
+ ]
1087
+ });
1088
+ return sdkResponse;
1089
+ }
1090
+ catch (err) {
1091
+ throw err;
1092
+ }
1093
+ });
1094
+ }
1095
+ /**
1096
+ * Return a (paginated) list of logs for a given work request.
1097
+ *
1098
+ * This operation uses {@link common.OciSdkDefaultRetryConfiguration} by default if no retry configuration is defined by the user.
1099
+ * @param ListWorkRequestLogsRequest
1100
+ * @return ListWorkRequestLogsResponse
1101
+ * @throws OciError when an error occurs
1102
+ * @example Click {@link https://docs.cloud.oracle.com/en-us/iaas/tools/typescript-sdk-examples/2.50.0/queue/ListWorkRequestLogs.ts.html |here} to see how to use ListWorkRequestLogs API.
1103
+ */
1104
+ listWorkRequestLogs(listWorkRequestLogsRequest) {
1105
+ return __awaiter(this, void 0, void 0, function* () {
1106
+ if (this.logger)
1107
+ this.logger.debug("Calling operation QueueAdminClient#listWorkRequestLogs.");
1108
+ const operationName = "listWorkRequestLogs";
1109
+ const apiReferenceLink = "";
1110
+ const pathParams = {
1111
+ "{workRequestId}": listWorkRequestLogsRequest.workRequestId
1112
+ };
1113
+ const queryParams = {
1114
+ "page": listWorkRequestLogsRequest.page,
1115
+ "limit": listWorkRequestLogsRequest.limit
1116
+ };
1117
+ let headerParams = {
1118
+ "Content-Type": common.Constants.APPLICATION_JSON,
1119
+ "opc-request-id": listWorkRequestLogsRequest.opcRequestId
1120
+ };
1121
+ const specRetryConfiguration = common.OciSdkDefaultRetryConfiguration;
1122
+ const retrier = oci_common_1.GenericRetrier.createPreferredRetrier(this._clientConfiguration ? this._clientConfiguration.retryConfiguration : undefined, listWorkRequestLogsRequest.retryConfiguration, specRetryConfiguration);
1123
+ if (this.logger)
1124
+ retrier.logger = this.logger;
1125
+ const request = yield oci_common_1.composeRequest({
1126
+ baseEndpoint: this._endpoint,
1127
+ defaultHeaders: this._defaultHeaders,
1128
+ path: "/workRequests/{workRequestId}/logs",
1129
+ method: "GET",
1130
+ pathParams: pathParams,
1131
+ headerParams: headerParams,
1132
+ queryParams: queryParams
1133
+ });
1134
+ try {
1135
+ const response = yield retrier.makeServiceCall(this._httpClient, request, this.targetService, operationName, apiReferenceLink);
1136
+ const sdkResponse = oci_common_1.composeResponse({
1137
+ responseObject: {},
1138
+ body: yield response.json(),
1139
+ bodyKey: "workRequestLogEntryCollection",
1140
+ bodyModel: model.WorkRequestLogEntryCollection,
1141
+ type: "model.WorkRequestLogEntryCollection",
1142
+ responseHeaders: [
1143
+ {
1144
+ value: response.headers.get("opc-next-page"),
1145
+ key: "opcNextPage",
1146
+ dataType: "string"
1147
+ },
1148
+ {
1149
+ value: response.headers.get("opc-request-id"),
1150
+ key: "opcRequestId",
1151
+ dataType: "string"
1152
+ }
1153
+ ]
1154
+ });
1155
+ return sdkResponse;
1156
+ }
1157
+ catch (err) {
1158
+ throw err;
1159
+ }
1160
+ });
1161
+ }
1162
+ /**
1163
+ * Lists the work requests in a compartment.
1164
+ *
1165
+ * This operation uses {@link common.OciSdkDefaultRetryConfiguration} by default if no retry configuration is defined by the user.
1166
+ * @param ListWorkRequestsRequest
1167
+ * @return ListWorkRequestsResponse
1168
+ * @throws OciError when an error occurs
1169
+ * @example Click {@link https://docs.cloud.oracle.com/en-us/iaas/tools/typescript-sdk-examples/2.50.0/queue/ListWorkRequests.ts.html |here} to see how to use ListWorkRequests API.
1170
+ */
1171
+ listWorkRequests(listWorkRequestsRequest) {
1172
+ return __awaiter(this, void 0, void 0, function* () {
1173
+ if (this.logger)
1174
+ this.logger.debug("Calling operation QueueAdminClient#listWorkRequests.");
1175
+ const operationName = "listWorkRequests";
1176
+ const apiReferenceLink = "";
1177
+ const pathParams = {};
1178
+ const queryParams = {
1179
+ "compartmentId": listWorkRequestsRequest.compartmentId,
1180
+ "workRequestId": listWorkRequestsRequest.workRequestId,
1181
+ "page": listWorkRequestsRequest.page,
1182
+ "limit": listWorkRequestsRequest.limit
1183
+ };
1184
+ let headerParams = {
1185
+ "Content-Type": common.Constants.APPLICATION_JSON,
1186
+ "opc-request-id": listWorkRequestsRequest.opcRequestId
1187
+ };
1188
+ const specRetryConfiguration = common.OciSdkDefaultRetryConfiguration;
1189
+ const retrier = oci_common_1.GenericRetrier.createPreferredRetrier(this._clientConfiguration ? this._clientConfiguration.retryConfiguration : undefined, listWorkRequestsRequest.retryConfiguration, specRetryConfiguration);
1190
+ if (this.logger)
1191
+ retrier.logger = this.logger;
1192
+ const request = yield oci_common_1.composeRequest({
1193
+ baseEndpoint: this._endpoint,
1194
+ defaultHeaders: this._defaultHeaders,
1195
+ path: "/workRequests",
1196
+ method: "GET",
1197
+ pathParams: pathParams,
1198
+ headerParams: headerParams,
1199
+ queryParams: queryParams
1200
+ });
1201
+ try {
1202
+ const response = yield retrier.makeServiceCall(this._httpClient, request, this.targetService, operationName, apiReferenceLink);
1203
+ const sdkResponse = oci_common_1.composeResponse({
1204
+ responseObject: {},
1205
+ body: yield response.json(),
1206
+ bodyKey: "workRequestSummaryCollection",
1207
+ bodyModel: model.WorkRequestSummaryCollection,
1208
+ type: "model.WorkRequestSummaryCollection",
1209
+ responseHeaders: [
1210
+ {
1211
+ value: response.headers.get("opc-request-id"),
1212
+ key: "opcRequestId",
1213
+ dataType: "string"
1214
+ },
1215
+ {
1216
+ value: response.headers.get("opc-next-page"),
1217
+ key: "opcNextPage",
1218
+ dataType: "string"
1219
+ }
1220
+ ]
1221
+ });
1222
+ return sdkResponse;
1223
+ }
1224
+ catch (err) {
1225
+ throw err;
1226
+ }
1227
+ });
1228
+ }
1229
+ /**
1230
+ * Deletes all messages present in the queue at the time of invocation. Only one concurrent purge operation is supported for any given queue.
1231
+ * However multiple concurrent purge operations are supported for different queues.
1232
+ *
1233
+ * This operation uses {@link common.OciSdkDefaultRetryConfiguration} by default if no retry configuration is defined by the user.
1234
+ * @param PurgeQueueRequest
1235
+ * @return PurgeQueueResponse
1236
+ * @throws OciError when an error occurs
1237
+ * @example Click {@link https://docs.cloud.oracle.com/en-us/iaas/tools/typescript-sdk-examples/2.50.0/queue/PurgeQueue.ts.html |here} to see how to use PurgeQueue API.
1238
+ */
1239
+ purgeQueue(purgeQueueRequest) {
1240
+ return __awaiter(this, void 0, void 0, function* () {
1241
+ if (this.logger)
1242
+ this.logger.debug("Calling operation QueueAdminClient#purgeQueue.");
1243
+ const operationName = "purgeQueue";
1244
+ const apiReferenceLink = "";
1245
+ const pathParams = {
1246
+ "{queueId}": purgeQueueRequest.queueId
1247
+ };
1248
+ const queryParams = {};
1249
+ let headerParams = {
1250
+ "Content-Type": common.Constants.APPLICATION_JSON,
1251
+ "if-match": purgeQueueRequest.ifMatch,
1252
+ "opc-request-id": purgeQueueRequest.opcRequestId
1253
+ };
1254
+ const specRetryConfiguration = common.OciSdkDefaultRetryConfiguration;
1255
+ const retrier = oci_common_1.GenericRetrier.createPreferredRetrier(this._clientConfiguration ? this._clientConfiguration.retryConfiguration : undefined, purgeQueueRequest.retryConfiguration, specRetryConfiguration);
1256
+ if (this.logger)
1257
+ retrier.logger = this.logger;
1258
+ const request = yield oci_common_1.composeRequest({
1259
+ baseEndpoint: this._endpoint,
1260
+ defaultHeaders: this._defaultHeaders,
1261
+ path: "/queues/{queueId}/actions/purge",
1262
+ method: "POST",
1263
+ bodyContent: common.ObjectSerializer.serialize(purgeQueueRequest.purgeQueueDetails, "PurgeQueueDetails", model.PurgeQueueDetails.getJsonObj),
1264
+ pathParams: pathParams,
1265
+ headerParams: headerParams,
1266
+ queryParams: queryParams
1267
+ });
1268
+ try {
1269
+ const response = yield retrier.makeServiceCall(this._httpClient, request, this.targetService, operationName, apiReferenceLink);
1270
+ const sdkResponse = oci_common_1.composeResponse({
1271
+ responseObject: {},
1272
+ responseHeaders: [
1273
+ {
1274
+ value: response.headers.get("opc-work-request-id"),
1275
+ key: "opcWorkRequestId",
1276
+ dataType: "string"
1277
+ },
1278
+ {
1279
+ value: response.headers.get("opc-request-id"),
1280
+ key: "opcRequestId",
1281
+ dataType: "string"
1282
+ }
1283
+ ]
1284
+ });
1285
+ return sdkResponse;
1286
+ }
1287
+ catch (err) {
1288
+ throw err;
1289
+ }
1290
+ });
1291
+ }
1292
+ /**
1293
+ * Updates the Queue
1294
+ * This operation uses {@link common.OciSdkDefaultRetryConfiguration} by default if no retry configuration is defined by the user.
1295
+ * @param UpdateQueueRequest
1296
+ * @return UpdateQueueResponse
1297
+ * @throws OciError when an error occurs
1298
+ * @example Click {@link https://docs.cloud.oracle.com/en-us/iaas/tools/typescript-sdk-examples/2.50.0/queue/UpdateQueue.ts.html |here} to see how to use UpdateQueue API.
1299
+ */
1300
+ updateQueue(updateQueueRequest) {
1301
+ return __awaiter(this, void 0, void 0, function* () {
1302
+ if (this.logger)
1303
+ this.logger.debug("Calling operation QueueAdminClient#updateQueue.");
1304
+ const operationName = "updateQueue";
1305
+ const apiReferenceLink = "";
1306
+ const pathParams = {
1307
+ "{queueId}": updateQueueRequest.queueId
1308
+ };
1309
+ const queryParams = {};
1310
+ let headerParams = {
1311
+ "Content-Type": common.Constants.APPLICATION_JSON,
1312
+ "if-match": updateQueueRequest.ifMatch,
1313
+ "opc-request-id": updateQueueRequest.opcRequestId
1314
+ };
1315
+ const specRetryConfiguration = common.OciSdkDefaultRetryConfiguration;
1316
+ const retrier = oci_common_1.GenericRetrier.createPreferredRetrier(this._clientConfiguration ? this._clientConfiguration.retryConfiguration : undefined, updateQueueRequest.retryConfiguration, specRetryConfiguration);
1317
+ if (this.logger)
1318
+ retrier.logger = this.logger;
1319
+ const request = yield oci_common_1.composeRequest({
1320
+ baseEndpoint: this._endpoint,
1321
+ defaultHeaders: this._defaultHeaders,
1322
+ path: "/queues/{queueId}",
1323
+ method: "PUT",
1324
+ bodyContent: common.ObjectSerializer.serialize(updateQueueRequest.updateQueueDetails, "UpdateQueueDetails", model.UpdateQueueDetails.getJsonObj),
1325
+ pathParams: pathParams,
1326
+ headerParams: headerParams,
1327
+ queryParams: queryParams
1328
+ });
1329
+ try {
1330
+ const response = yield retrier.makeServiceCall(this._httpClient, request, this.targetService, operationName, apiReferenceLink);
1331
+ const sdkResponse = oci_common_1.composeResponse({
1332
+ responseObject: {},
1333
+ responseHeaders: [
1334
+ {
1335
+ value: response.headers.get("opc-work-request-id"),
1336
+ key: "opcWorkRequestId",
1337
+ dataType: "string"
1338
+ },
1339
+ {
1340
+ value: response.headers.get("opc-request-id"),
1341
+ key: "opcRequestId",
1342
+ dataType: "string"
1343
+ }
1344
+ ]
1345
+ });
1346
+ return sdkResponse;
1347
+ }
1348
+ catch (err) {
1349
+ throw err;
1350
+ }
1351
+ });
1352
+ }
1353
+ }
1354
+ exports.QueueAdminClient = QueueAdminClient;
1355
+ QueueAdminClient.serviceEndpointTemplate = "https://messaging.{region}.oci.{secondLevelDomain}";
1356
+ QueueAdminClient.endpointServiceName = "";
1357
+ //# sourceMappingURL=client.js.map