oci-multicloud 2.114.1

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 (179) 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 +27 -0
  6. package/index.js +50 -0
  7. package/index.js.map +1 -0
  8. package/lib/client.d.ts +574 -0
  9. package/lib/client.js +1465 -0
  10. package/lib/client.js.map +1 -0
  11. package/lib/model/action-kind-header.d.ts +23 -0
  12. package/lib/model/action-kind-header.js +34 -0
  13. package/lib/model/action-kind-header.js.map +1 -0
  14. package/lib/model/aws-cloud-service-provider-metadata-item.d.ts +29 -0
  15. package/lib/model/aws-cloud-service-provider-metadata-item.js +54 -0
  16. package/lib/model/aws-cloud-service-provider-metadata-item.js.map +1 -0
  17. package/lib/model/azure-cloud-service-provider-metadata-item.d.ts +33 -0
  18. package/lib/model/azure-cloud-service-provider-metadata-item.js +54 -0
  19. package/lib/model/azure-cloud-service-provider-metadata-item.js.map +1 -0
  20. package/lib/model/cloud-service-provider-metadata-item.d.ts +37 -0
  21. package/lib/model/cloud-service-provider-metadata-item.js +76 -0
  22. package/lib/model/cloud-service-provider-metadata-item.js.map +1 -0
  23. package/lib/model/cloud-service-provider-network-metadata-item.d.ts +46 -0
  24. package/lib/model/cloud-service-provider-network-metadata-item.js +29 -0
  25. package/lib/model/cloud-service-provider-network-metadata-item.js.map +1 -0
  26. package/lib/model/csp-zone-key-reference-id.d.ts +33 -0
  27. package/lib/model/csp-zone-key-reference-id.js +29 -0
  28. package/lib/model/csp-zone-key-reference-id.js.map +1 -0
  29. package/lib/model/external-location-detail.d.ts +47 -0
  30. package/lib/model/external-location-detail.js +57 -0
  31. package/lib/model/external-location-detail.js.map +1 -0
  32. package/lib/model/external-location-mapping-metadatum-summary-collection.d.ts +27 -0
  33. package/lib/model/external-location-mapping-metadatum-summary-collection.js +61 -0
  34. package/lib/model/external-location-mapping-metadatum-summary-collection.js.map +1 -0
  35. package/lib/model/external-location-mapping-metadatum-summary.d.ts +71 -0
  36. package/lib/model/external-location-mapping-metadatum-summary.js +57 -0
  37. package/lib/model/external-location-mapping-metadatum-summary.js.map +1 -0
  38. package/lib/model/external-location-summaries-metadatum-summary-collection.d.ts +27 -0
  39. package/lib/model/external-location-summaries-metadatum-summary-collection.js +61 -0
  40. package/lib/model/external-location-summaries-metadatum-summary-collection.js.map +1 -0
  41. package/lib/model/external-location-summaries-metadatum-summary.d.ts +60 -0
  42. package/lib/model/external-location-summaries-metadatum-summary.js +57 -0
  43. package/lib/model/external-location-summaries-metadatum-summary.js.map +1 -0
  44. package/lib/model/external-location-summary.d.ts +29 -0
  45. package/lib/model/external-location-summary.js +29 -0
  46. package/lib/model/external-location-summary.js.map +1 -0
  47. package/lib/model/external-location.d.ts +42 -0
  48. package/lib/model/external-location.js +29 -0
  49. package/lib/model/external-location.js.map +1 -0
  50. package/lib/model/external-locations-metadatum-collection.d.ts +27 -0
  51. package/lib/model/external-locations-metadatum-collection.js +61 -0
  52. package/lib/model/external-locations-metadatum-collection.js.map +1 -0
  53. package/lib/model/external-locations-metadatum-summary.d.ts +72 -0
  54. package/lib/model/external-locations-metadatum-summary.js +57 -0
  55. package/lib/model/external-locations-metadatum-summary.js.map +1 -0
  56. package/lib/model/gcp-cloud-service-provider-metadata-item.d.ts +29 -0
  57. package/lib/model/gcp-cloud-service-provider-metadata-item.js +54 -0
  58. package/lib/model/gcp-cloud-service-provider-metadata-item.js.map +1 -0
  59. package/lib/model/index.d.ts +78 -0
  60. package/lib/model/index.js +101 -0
  61. package/lib/model/index.js.map +1 -0
  62. package/lib/model/multi-cloud-metadata-collection.d.ts +26 -0
  63. package/lib/model/multi-cloud-metadata-collection.js +61 -0
  64. package/lib/model/multi-cloud-metadata-collection.js.map +1 -0
  65. package/lib/model/multi-cloud-metadata-summary.d.ts +70 -0
  66. package/lib/model/multi-cloud-metadata-summary.js +29 -0
  67. package/lib/model/multi-cloud-metadata-summary.js.map +1 -0
  68. package/lib/model/multi-cloud-metadata.d.ts +70 -0
  69. package/lib/model/multi-cloud-metadata.js +29 -0
  70. package/lib/model/multi-cloud-metadata.js.map +1 -0
  71. package/lib/model/network-anchor-collection.d.ts +26 -0
  72. package/lib/model/network-anchor-collection.js +61 -0
  73. package/lib/model/network-anchor-collection.js.map +1 -0
  74. package/lib/model/network-anchor-summary.d.ts +98 -0
  75. package/lib/model/network-anchor-summary.js +29 -0
  76. package/lib/model/network-anchor-summary.js.map +1 -0
  77. package/lib/model/network-anchor.d.ts +131 -0
  78. package/lib/model/network-anchor.js +87 -0
  79. package/lib/model/network-anchor.js.map +1 -0
  80. package/lib/model/oci-dns.d.ts +25 -0
  81. package/lib/model/oci-dns.js +29 -0
  82. package/lib/model/oci-dns.js.map +1 -0
  83. package/lib/model/oci-network-metadata.d.ts +74 -0
  84. package/lib/model/oci-network-metadata.js +83 -0
  85. package/lib/model/oci-network-metadata.js.map +1 -0
  86. package/lib/model/oci-network-subnet.d.ts +42 -0
  87. package/lib/model/oci-network-subnet.js +39 -0
  88. package/lib/model/oci-network-subnet.js.map +1 -0
  89. package/lib/model/oci-vcn.d.ts +49 -0
  90. package/lib/model/oci-vcn.js +29 -0
  91. package/lib/model/oci-vcn.js.map +1 -0
  92. package/lib/model/om-hub-cp.d.ts +23 -0
  93. package/lib/model/om-hub-cp.js +55 -0
  94. package/lib/model/om-hub-cp.js.map +1 -0
  95. package/lib/model/properties.d.ts +25 -0
  96. package/lib/model/properties.js +29 -0
  97. package/lib/model/properties.js.map +1 -0
  98. package/lib/model/resource-anchor-collection.d.ts +26 -0
  99. package/lib/model/resource-anchor-collection.js +61 -0
  100. package/lib/model/resource-anchor-collection.js.map +1 -0
  101. package/lib/model/resource-anchor-summary.d.ts +94 -0
  102. package/lib/model/resource-anchor-summary.js +29 -0
  103. package/lib/model/resource-anchor-summary.js.map +1 -0
  104. package/lib/model/resource-anchor.d.ts +144 -0
  105. package/lib/model/resource-anchor.js +81 -0
  106. package/lib/model/resource-anchor.js.map +1 -0
  107. package/lib/model/sort-order.d.ts +30 -0
  108. package/lib/model/sort-order.js +41 -0
  109. package/lib/model/sort-order.js.map +1 -0
  110. package/lib/model/subscription-type.d.ts +29 -0
  111. package/lib/model/subscription-type.js +40 -0
  112. package/lib/model/subscription-type.js.map +1 -0
  113. package/lib/omhubnetworkanchor-waiter.d.ts +29 -0
  114. package/lib/omhubnetworkanchor-waiter.js +65 -0
  115. package/lib/omhubnetworkanchor-waiter.js.map +1 -0
  116. package/lib/omhubresourceanchor-waiter.d.ts +29 -0
  117. package/lib/omhubresourceanchor-waiter.js +65 -0
  118. package/lib/omhubresourceanchor-waiter.js.map +1 -0
  119. package/lib/request/get-multi-cloud-metadata-request.d.ts +34 -0
  120. package/lib/request/get-multi-cloud-metadata-request.js +15 -0
  121. package/lib/request/get-multi-cloud-metadata-request.js.map +1 -0
  122. package/lib/request/get-network-anchor-request.d.ts +43 -0
  123. package/lib/request/get-network-anchor-request.js +15 -0
  124. package/lib/request/get-network-anchor-request.js.map +1 -0
  125. package/lib/request/get-resource-anchor-request.d.ts +39 -0
  126. package/lib/request/get-resource-anchor-request.js +15 -0
  127. package/lib/request/get-resource-anchor-request.js.map +1 -0
  128. package/lib/request/index.d.ts +30 -0
  129. package/lib/request/index.js +47 -0
  130. package/lib/request/index.js.map +1 -0
  131. package/lib/request/list-external-location-details-metadata-request.d.ts +80 -0
  132. package/lib/request/list-external-location-details-metadata-request.js +28 -0
  133. package/lib/request/list-external-location-details-metadata-request.js.map +1 -0
  134. package/lib/request/list-external-location-mapping-metadata-request.d.ts +69 -0
  135. package/lib/request/list-external-location-mapping-metadata-request.js +24 -0
  136. package/lib/request/list-external-location-mapping-metadata-request.js.map +1 -0
  137. package/lib/request/list-external-location-summaries-metadata-request.d.ts +76 -0
  138. package/lib/request/list-external-location-summaries-metadata-request.js +28 -0
  139. package/lib/request/list-external-location-summaries-metadata-request.js.map +1 -0
  140. package/lib/request/list-multi-cloud-metadata-request.d.ts +61 -0
  141. package/lib/request/list-multi-cloud-metadata-request.js +24 -0
  142. package/lib/request/list-multi-cloud-metadata-request.js.map +1 -0
  143. package/lib/request/list-network-anchors-request.d.ts +95 -0
  144. package/lib/request/list-network-anchors-request.js +24 -0
  145. package/lib/request/list-network-anchors-request.js.map +1 -0
  146. package/lib/request/list-resource-anchors-request.d.ts +91 -0
  147. package/lib/request/list-resource-anchors-request.js +24 -0
  148. package/lib/request/list-resource-anchors-request.js.map +1 -0
  149. package/lib/response/get-multi-cloud-metadata-response.d.ts +30 -0
  150. package/lib/response/get-multi-cloud-metadata-response.js +15 -0
  151. package/lib/response/get-multi-cloud-metadata-response.js.map +1 -0
  152. package/lib/response/get-network-anchor-response.d.ts +30 -0
  153. package/lib/response/get-network-anchor-response.js +15 -0
  154. package/lib/response/get-network-anchor-response.js.map +1 -0
  155. package/lib/response/get-resource-anchor-response.d.ts +30 -0
  156. package/lib/response/get-resource-anchor-response.js +15 -0
  157. package/lib/response/get-resource-anchor-response.js.map +1 -0
  158. package/lib/response/index.d.ts +30 -0
  159. package/lib/response/index.js +15 -0
  160. package/lib/response/index.js.map +1 -0
  161. package/lib/response/list-external-location-details-metadata-response.d.ts +31 -0
  162. package/lib/response/list-external-location-details-metadata-response.js +15 -0
  163. package/lib/response/list-external-location-details-metadata-response.js.map +1 -0
  164. package/lib/response/list-external-location-mapping-metadata-response.d.ts +31 -0
  165. package/lib/response/list-external-location-mapping-metadata-response.js +15 -0
  166. package/lib/response/list-external-location-mapping-metadata-response.js.map +1 -0
  167. package/lib/response/list-external-location-summaries-metadata-response.d.ts +31 -0
  168. package/lib/response/list-external-location-summaries-metadata-response.js +15 -0
  169. package/lib/response/list-external-location-summaries-metadata-response.js.map +1 -0
  170. package/lib/response/list-multi-cloud-metadata-response.d.ts +31 -0
  171. package/lib/response/list-multi-cloud-metadata-response.js +15 -0
  172. package/lib/response/list-multi-cloud-metadata-response.js.map +1 -0
  173. package/lib/response/list-network-anchors-response.d.ts +31 -0
  174. package/lib/response/list-network-anchors-response.js +15 -0
  175. package/lib/response/list-network-anchors-response.js.map +1 -0
  176. package/lib/response/list-resource-anchors-response.d.ts +31 -0
  177. package/lib/response/list-resource-anchors-response.js +15 -0
  178. package/lib/response/list-resource-anchors-response.js.map +1 -0
  179. package/package.json +29 -0
package/lib/client.js ADDED
@@ -0,0 +1,1465 @@
1
+ "use strict";
2
+ /**
3
+ * Oracle Multicloud API
4
+ * Use the Oracle Multicloud API to retrieve resource anchors and network anchors, and the metadata mappings related a Cloud Service Provider. For more information, see <link to docs>.
5
+ * OpenAPI spec version: 20180828
6
+ *
7
+ *
8
+ * NOTE: This class is auto generated by OracleSDKGenerator.
9
+ * Do not edit the class manually.
10
+ *
11
+ * Copyright (c) 2020, 2025, 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.OmhubResourceAnchorClient = exports.OmhubResourceAnchorApiKeys = exports.OmhubNetworkAnchorClient = exports.OmhubNetworkAnchorApiKeys = exports.MultiCloudsMetadataClient = exports.MultiCloudsMetadataApiKeys = exports.MetadataClient = exports.MetadataApiKeys = void 0;
44
+ const common = require("oci-common");
45
+ const model = __importStar(require("./model"));
46
+ const omhubnetworkanchor_waiter_1 = require("./omhubnetworkanchor-waiter");
47
+ const omhubresourceanchor_waiter_1 = require("./omhubresourceanchor-waiter");
48
+ const oci_common_1 = require("oci-common");
49
+ const Breaker = require("opossum");
50
+ // ===============================================
51
+ // This file is autogenerated - Please do not edit
52
+ // ===============================================
53
+ var MetadataApiKeys;
54
+ (function (MetadataApiKeys) {
55
+ })(MetadataApiKeys = exports.MetadataApiKeys || (exports.MetadataApiKeys = {}));
56
+ /**
57
+ * This service client uses {@link common.CircuitBreaker.DefaultConfiguration} for all the operations by default if no circuit breaker configuration is defined by the user.
58
+ */
59
+ class MetadataClient {
60
+ constructor(params, clientConfiguration) {
61
+ this["_realmSpecificEndpointTemplateEnabled"] = undefined;
62
+ this["_endpoint"] = "";
63
+ this["_defaultHeaders"] = {};
64
+ this._circuitBreaker = null;
65
+ this._httpOptions = undefined;
66
+ this._bodyDuplexMode = undefined;
67
+ this.targetService = "Metadata";
68
+ this._regionId = "";
69
+ this._lastSetRegionOrRegionId = "";
70
+ const requestSigner = params.authenticationDetailsProvider
71
+ ? new common.DefaultRequestSigner(params.authenticationDetailsProvider)
72
+ : null;
73
+ this._authProvider = params.authenticationDetailsProvider;
74
+ if (clientConfiguration) {
75
+ this._clientConfiguration = clientConfiguration;
76
+ this._circuitBreaker = clientConfiguration.circuitBreaker
77
+ ? clientConfiguration.circuitBreaker.circuit
78
+ : null;
79
+ this._httpOptions = clientConfiguration.httpOptions
80
+ ? clientConfiguration.httpOptions
81
+ : undefined;
82
+ this._bodyDuplexMode = clientConfiguration.bodyDuplexMode
83
+ ? clientConfiguration.bodyDuplexMode
84
+ : undefined;
85
+ }
86
+ if (!oci_common_1.developerToolConfiguration.isServiceEnabled("multicloud")) {
87
+ 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 : ";
88
+ throw errmsg.concat("multicloud");
89
+ }
90
+ // if circuit breaker is not created, check if circuit breaker system is enabled to use default circuit breaker
91
+ const specCircuitBreakerEnabled = true;
92
+ if (!this._circuitBreaker &&
93
+ common.utils.isCircuitBreakerSystemEnabled(clientConfiguration) &&
94
+ (specCircuitBreakerEnabled || common.CircuitBreaker.DefaultCircuitBreakerOverriden)) {
95
+ this._circuitBreaker = new common.CircuitBreaker().circuit;
96
+ }
97
+ this._httpClient =
98
+ params.httpClient ||
99
+ new common.FetchHttpClient(requestSigner, this._circuitBreaker, this._httpOptions, this._bodyDuplexMode);
100
+ if (params.authenticationDetailsProvider &&
101
+ common.isRegionProvider(params.authenticationDetailsProvider)) {
102
+ const provider = params.authenticationDetailsProvider;
103
+ if (provider.getRegion()) {
104
+ this.region = provider.getRegion();
105
+ }
106
+ }
107
+ }
108
+ /**
109
+ * Get the endpoint that is being used to call (ex, https://www.example.com).
110
+ */
111
+ get endpoint() {
112
+ return this._endpoint;
113
+ }
114
+ /**
115
+ * Sets the endpoint to call (ex, https://www.example.com).
116
+ * @param endpoint The endpoint of the service.
117
+ */
118
+ set endpoint(endpoint) {
119
+ this._endpoint = endpoint;
120
+ this._endpoint = this._endpoint + "/20180828";
121
+ if (this.logger)
122
+ this.logger.info(`MetadataClient endpoint set to ${this._endpoint}`);
123
+ }
124
+ get logger() {
125
+ return common.LOG.logger;
126
+ }
127
+ /**
128
+ * Determines whether realm specific endpoint should be used or not.
129
+ * Set realmSpecificEndpointTemplateEnabled to "true" if the user wants to enable use of realm specific endpoint template, otherwise set it to "false"
130
+ * @param realmSpecificEndpointTemplateEnabled flag to enable the use of realm specific endpoint template
131
+ */
132
+ set useRealmSpecificEndpointTemplate(realmSpecificEndpointTemplateEnabled) {
133
+ this._realmSpecificEndpointTemplateEnabled = realmSpecificEndpointTemplateEnabled;
134
+ if (this.logger)
135
+ this.logger.info(`realmSpecificEndpointTemplateEnabled set to ${this._realmSpecificEndpointTemplateEnabled}`);
136
+ if (this._lastSetRegionOrRegionId === common.Region.REGION_STRING) {
137
+ this.endpoint = common.EndpointBuilder.createEndpointFromRegion(MetadataClient.serviceEndpointTemplate, this._region, MetadataClient.endpointServiceName);
138
+ }
139
+ else if (this._lastSetRegionOrRegionId === common.Region.REGION_ID_STRING) {
140
+ this.endpoint = common.EndpointBuilder.createEndpointFromRegionId(MetadataClient.serviceEndpointTemplate, this._regionId, MetadataClient.endpointServiceName);
141
+ }
142
+ }
143
+ /**
144
+ * Sets the region to call (ex, Region.US_PHOENIX_1).
145
+ * Note, this will call {@link #endpoint(String) endpoint} after resolving the endpoint.
146
+ * @param region The region of the service.
147
+ */
148
+ set region(region) {
149
+ this._region = region;
150
+ this.endpoint = common.EndpointBuilder.createEndpointFromRegion(MetadataClient.serviceEndpointTemplate, region, MetadataClient.endpointServiceName);
151
+ this._lastSetRegionOrRegionId = common.Region.REGION_STRING;
152
+ }
153
+ /**
154
+ * Sets the regionId to call (ex, 'us-phoenix-1').
155
+ *
156
+ * Note, this will first try to map the region ID to a known Region and call {@link #region(Region) region}.
157
+ * If no known Region could be determined, it will create an endpoint assuming its in default Realm OC1
158
+ * and then call {@link #endpoint(String) endpoint}.
159
+ * @param regionId The public region ID.
160
+ */
161
+ set regionId(regionId) {
162
+ this._regionId = regionId;
163
+ this.endpoint = common.EndpointBuilder.createEndpointFromRegionId(MetadataClient.serviceEndpointTemplate, regionId, MetadataClient.endpointServiceName);
164
+ this._lastSetRegionOrRegionId = common.Region.REGION_ID_STRING;
165
+ }
166
+ /**
167
+ * Shutdown the circuit breaker used by the client when it is no longer needed
168
+ */
169
+ shutdownCircuitBreaker() {
170
+ if (this._circuitBreaker) {
171
+ this._circuitBreaker.shutdown();
172
+ }
173
+ }
174
+ /**
175
+ * Close the provider if possible which in turn shuts down any associated circuit breaker
176
+ */
177
+ closeProvider() {
178
+ if (this._authProvider) {
179
+ if (this._authProvider instanceof common.AbstractRequestingAuthenticationDetailsProvider)
180
+ (this._authProvider).closeProvider();
181
+ }
182
+ }
183
+ /**
184
+ * Close the client once it is no longer needed
185
+ */
186
+ close() {
187
+ this.shutdownCircuitBreaker();
188
+ this.closeProvider();
189
+ }
190
+ /**
191
+ * List externalLocationDetail metadata from OCI to Cloud Service Provider for regions, Availability Zones, and Cluster Placement Group ID.
192
+ * examples:
193
+ * application-json: |
194
+ * [
195
+ * {
196
+ * \"externalLocation\": {
197
+ * \"cspRegion\": \"East US\",
198
+ * \"cspPhysicalAz\": \"az1-xyz\",
199
+ * \"cspPhysicalAzDisplayName\": \"(US) East US 2\",
200
+ * \"cspLogicalAz\": \"az1\",
201
+ * \"serviceName\": \"ORACLEDBATAZURE\",
202
+ * \"cspZoneKeyReferenceId\": {
203
+ * \"keyName\": \"AzureSubscriptionId or AwsAccountId, GcpProjectName\",
204
+ * \"keyValue\": \"azure-subscriptionId-1 or aws-account-id-1, gcp-project-id-1\"
205
+ * }
206
+ * },
207
+ * \"ociPhysicalAd\": \"ad1-xyb\",
208
+ * \"ociLogicalAd\": \"ad2\",
209
+ * \"ociRegion\": \"us-ashburn-1\",
210
+ * \"cpgId\": \"cpg-1\"
211
+ * },
212
+ * {
213
+ * \"externalLocation\": {
214
+ * \"cspRegion\": \"East US\",
215
+ * \"cspPhysicalAz\": \"az2-abc\",
216
+ * \"cspPhysicalAzDisplayName\": \"(US) East US 2\",
217
+ * \"cspLogicalAz\": \"az2\",
218
+ * \"serviceName\": \"ORACLEDBATAZURE\",
219
+ * \"cspZoneKeyReferenceId\": {
220
+ * \"keyName\": \"AzureSubscriptionId or AwsAccountId, GcpProjectName\",
221
+ * \"keyValue\": \"azure-subscriptionId-2 or aws-account-id-2, gcp-project-id-2\"
222
+ * }
223
+ * },
224
+ * \"ociPhysicalAd\": \"ad2-xby\",
225
+ * \"ociLogicalAd\": \"ad1\",
226
+ * \"ociRegion\": \"us-ashburn-1\",
227
+ * \"cpgId\": \"cpg-2\"
228
+ * },
229
+ * {
230
+ * \"externalLocation\": {
231
+ * \"cspRegion\": \"East US\",
232
+ * \"cspPhysicalAz\": \"az3-abz\",
233
+ * \"cspPhysicalAzDisplayName\": \"(US) East US 2\",
234
+ * \"cspLogicalAz\": \"az3\",
235
+ * \"serviceName\": \"ORACLEDBATAZURE\",
236
+ * \"cspZoneKeyReferenceId\": {
237
+ * \"keyName\": \"AzureSubscriptionId or AwsAccountId, GcpProjectName\",
238
+ * \"keyValue\": \"azure-subscriptionId-3 or aws-account-id-3, gcp-project-id-3\"
239
+ * }
240
+ * },
241
+ * \"ociPhysicalAd\": \"ad3-cde\",
242
+ * \"ociLogicalAd\": \"ad3\",
243
+ * \"ociRegion\": \"us-ashburn-1\",
244
+ * \"cpgId\": \"cpg-3\"
245
+ * },
246
+ * {
247
+ * \"externalLocation\": {
248
+ * \"cspRegion\": \"East US 2\",
249
+ * \"cspPhysicalAz\": \"az1-def\",
250
+ * \"cspPhysicalAzDisplayName\": \"(US) East US 2\",
251
+ * \"cspLogicalAz\": \"az1\",
252
+ * \"serviceName\": \"ORACLEDBATAZURE\",
253
+ * \"cspZoneKeyReferenceId\": {
254
+ * \"keyName\": \"AzureSubscriptionId or AwsAccountId, GcpProjectName\",
255
+ * \"keyValue\": \"azure-subscriptionId-4 or aws-account-id-4, gcp-project-id-4\"
256
+ * }
257
+ * },
258
+ * \"ociPhysicalAd\": \"ad1-bce\",
259
+ * \"ociLogicalAd\": \"ad2\",
260
+ * \"ociRegion\": \"us-ashburn-1\",
261
+ * \"cpgId\": \"cpg-4\"
262
+ * },
263
+ * {
264
+ * \"externalLocation\": {
265
+ * \"cspRegion\": \"East US 2\",
266
+ * \"cspPhysicalAz\": \"az2-uvw\",
267
+ * \"cspPhysicalAzDisplayName\": \"(US) East US 2\",
268
+ * \"cspLogicalAz\": \"az2\",
269
+ * \"serviceName\": \"ORACLEDBATAZURE\",
270
+ * \"cspZoneKeyReferenceId\": {
271
+ * \"keyName\": \"AzureSubscriptionId or AwsAccountId, GcpProjectName\",
272
+ * \"keyValue\": \"azure-subscriptionId-3 or aws-account-id-3, gcp-project-id-3\"
273
+ * }
274
+ * },
275
+ * \"ociPhysicalAd\": \"ad2-ftc\",
276
+ * \"ociLogicalAd\": \"ad1\",
277
+ * \"ociRegion\": \"us-ashburn-1\",
278
+ * \"cpgId\": \"cpg-5\"
279
+ * },
280
+ * {
281
+ * \"externalLocation\": {
282
+ * \"cspRegion\": \"East US 2\",
283
+ * \"cspPhysicalAz\": \"az3-uvw\",
284
+ * \"cspPhysicalAzDisplayName\": \"(US) East US 2\",
285
+ * \"cspLogicalAz\": \"az3\",
286
+ * \"serviceName\": \"ORACLEDBATAZURE\",
287
+ * \"cspZoneKeyReferenceId\": {
288
+ * \"keyName\": \"AzureSubscriptionId or AwsAccountId, GcpProjectName\",
289
+ * \"keyValue\": \"azure-subscriptionId-3 or aws-account-id-3, gcp-project-id-3\"
290
+ * }
291
+ * },
292
+ * \"ociPhysicalAd\": \"ad3-stc\",
293
+ * \"ociLogicalAd\": \"ad3\",
294
+ * \"ociRegion\": \"us-ashburn-1\",
295
+ * \"cpgId\": \"cpg-6\"
296
+ * }
297
+ * ]
298
+ *
299
+ * This operation uses {@link common.OciSdkDefaultRetryConfiguration} by default if no retry configuration is defined by the user.
300
+ * @param ListExternalLocationDetailsMetadataRequest
301
+ * @return ListExternalLocationDetailsMetadataResponse
302
+ * @throws OciError when an error occurs
303
+ * @example Click {@link https://docs.oracle.com/en-us/iaas/tools/typescript-sdk-examples/latest/multicloud/ListExternalLocationDetailsMetadata.ts.html |here} to see how to use ListExternalLocationDetailsMetadata API.
304
+ */
305
+ listExternalLocationDetailsMetadata(listExternalLocationDetailsMetadataRequest) {
306
+ return __awaiter(this, void 0, void 0, function* () {
307
+ if (this.logger)
308
+ this.logger.debug("Calling operation MetadataClient#listExternalLocationDetailsMetadata.");
309
+ const operationName = "listExternalLocationDetailsMetadata";
310
+ const apiReferenceLink = "";
311
+ const pathParams = {};
312
+ const queryParams = {
313
+ "subscriptionId": listExternalLocationDetailsMetadataRequest.subscriptionId,
314
+ "entityType": listExternalLocationDetailsMetadataRequest.entityType,
315
+ "compartmentId": listExternalLocationDetailsMetadataRequest.compartmentId,
316
+ "linkedCompartmentId": listExternalLocationDetailsMetadataRequest.linkedCompartmentId,
317
+ "subscriptionServiceName": listExternalLocationDetailsMetadataRequest.subscriptionServiceName,
318
+ "limit": listExternalLocationDetailsMetadataRequest.limit,
319
+ "page": listExternalLocationDetailsMetadataRequest.page,
320
+ "sortOrder": listExternalLocationDetailsMetadataRequest.sortOrder,
321
+ "sortBy": listExternalLocationDetailsMetadataRequest.sortBy
322
+ };
323
+ let headerParams = {
324
+ "Content-Type": common.Constants.APPLICATION_JSON,
325
+ "opc-request-id": listExternalLocationDetailsMetadataRequest.opcRequestId
326
+ };
327
+ const specRetryConfiguration = common.OciSdkDefaultRetryConfiguration;
328
+ const retrier = oci_common_1.GenericRetrier.createPreferredRetrier(this._clientConfiguration ? this._clientConfiguration.retryConfiguration : undefined, listExternalLocationDetailsMetadataRequest.retryConfiguration, specRetryConfiguration);
329
+ if (this.logger)
330
+ retrier.logger = this.logger;
331
+ const request = yield oci_common_1.composeRequest({
332
+ baseEndpoint: this._endpoint,
333
+ defaultHeaders: this._defaultHeaders,
334
+ path: "/externalLocationsMetadata",
335
+ method: "GET",
336
+ pathParams: pathParams,
337
+ headerParams: headerParams,
338
+ queryParams: queryParams
339
+ });
340
+ try {
341
+ const response = yield retrier.makeServiceCall(this._httpClient, request, this.targetService, operationName, apiReferenceLink);
342
+ const sdkResponse = oci_common_1.composeResponse({
343
+ responseObject: {},
344
+ body: yield response.json(),
345
+ bodyKey: "externalLocationsMetadatumCollection",
346
+ bodyModel: model.ExternalLocationsMetadatumCollection,
347
+ type: "model.ExternalLocationsMetadatumCollection",
348
+ responseHeaders: [
349
+ {
350
+ value: response.headers.get("opc-request-id"),
351
+ key: "opcRequestId",
352
+ dataType: "string"
353
+ },
354
+ {
355
+ value: response.headers.get("opc-next-page"),
356
+ key: "opcNextPage",
357
+ dataType: "string"
358
+ }
359
+ ]
360
+ });
361
+ return sdkResponse;
362
+ }
363
+ catch (err) {
364
+ throw err;
365
+ }
366
+ });
367
+ }
368
+ /**
369
+ * List externalLocation metadata from OCI to the Cloud Service Provider for regions, Physical Availability Zones.
370
+ * examples:
371
+ * application-json: |
372
+ * [
373
+ * {
374
+ * \"externalLocation\": {
375
+ * \"cspRegion\": \"eastus\",
376
+ * \"cspPhysicalAz\": \"eastus-az1\",
377
+ * \"cspPhysicalAzDisplayName\": \"(US) East US 1\",
378
+ * \"serviceName\": \"ORACLEDBATAZURE\"
379
+ * },
380
+ * \"ociPhysicalAd\": \"iad-ad-1\",
381
+ * \"ociLogicalAd\": \"ad1\",
382
+ * \"ociRegion\": \"us-ashburn-1\"
383
+ * },
384
+ * {
385
+ * \"externalLocation\": {
386
+ * \"cspRegion\": \"eastus\",
387
+ * \"cspPhysicalAz\": \"eastus-az1\",
388
+ * \"cspPhysicalAzDisplayName\": \"(US) East US 1\",
389
+ * \"serviceName\": \"ORACLEDBATAZURE\"
390
+ * },
391
+ * \"ociPhysicalAd\": \"iad-ad-1\",
392
+ * \"ociLogicalAd\": \"ad1\",
393
+ * \"ociRegion\": \"us-ashburn-1\"
394
+ * },
395
+ * {
396
+ * \"externalLocation\": {
397
+ * \"cspRegion\": \"eastus2\",
398
+ * \"cspPhysicalAz\": \"eastus2-az3\",
399
+ * \"cspPhysicalAzDisplayName\": \"(US) East US 1\",
400
+ * \"serviceName\": \"ORACLEDBATAZURE\"
401
+ * },
402
+ * \"ociPhysicalAd\": \"iad-ad-2\",
403
+ * \"ociLogicalAd\": \"ad1\",
404
+ * \"ociRegion\": \"us-ashburn-1\"
405
+ * },
406
+ * {
407
+ * \"externalLocation\": {
408
+ * \"cspRegion\": \"eastus\",
409
+ * \"cspPhysicalAz\": \"eastus-az3\"
410
+ * \"cspPhysicalAzDisplayName\": \"(US) East US 1\",
411
+ * \"serviceName\": \"ORACLEDBATAZURE\"
412
+ * },
413
+ * \"ociPhysicalAd\": \"iad-ad-333\",
414
+ * \"ociLogicalAd\": \"ad1\",
415
+ * \"ociRegion\": \"us-ashburn-1\"
416
+ * }
417
+ * ]
418
+ *
419
+ * This operation uses {@link common.OciSdkDefaultRetryConfiguration} by default if no retry configuration is defined by the user.
420
+ * @param ListExternalLocationMappingMetadataRequest
421
+ * @return ListExternalLocationMappingMetadataResponse
422
+ * @throws OciError when an error occurs
423
+ * @example Click {@link https://docs.oracle.com/en-us/iaas/tools/typescript-sdk-examples/latest/multicloud/ListExternalLocationMappingMetadata.ts.html |here} to see how to use ListExternalLocationMappingMetadata API.
424
+ */
425
+ listExternalLocationMappingMetadata(listExternalLocationMappingMetadataRequest) {
426
+ return __awaiter(this, void 0, void 0, function* () {
427
+ if (this.logger)
428
+ this.logger.debug("Calling operation MetadataClient#listExternalLocationMappingMetadata.");
429
+ const operationName = "listExternalLocationMappingMetadata";
430
+ const apiReferenceLink = "";
431
+ const pathParams = {};
432
+ const queryParams = {
433
+ "subscriptionId": listExternalLocationMappingMetadataRequest.subscriptionId,
434
+ "subscriptionServiceName": listExternalLocationMappingMetadataRequest.subscriptionServiceName,
435
+ "compartmentId": listExternalLocationMappingMetadataRequest.compartmentId,
436
+ "limit": listExternalLocationMappingMetadataRequest.limit,
437
+ "page": listExternalLocationMappingMetadataRequest.page,
438
+ "sortOrder": listExternalLocationMappingMetadataRequest.sortOrder,
439
+ "sortBy": listExternalLocationMappingMetadataRequest.sortBy
440
+ };
441
+ let headerParams = {
442
+ "Content-Type": common.Constants.APPLICATION_JSON,
443
+ "opc-request-id": listExternalLocationMappingMetadataRequest.opcRequestId
444
+ };
445
+ const specRetryConfiguration = common.OciSdkDefaultRetryConfiguration;
446
+ const retrier = oci_common_1.GenericRetrier.createPreferredRetrier(this._clientConfiguration ? this._clientConfiguration.retryConfiguration : undefined, listExternalLocationMappingMetadataRequest.retryConfiguration, specRetryConfiguration);
447
+ if (this.logger)
448
+ retrier.logger = this.logger;
449
+ const request = yield oci_common_1.composeRequest({
450
+ baseEndpoint: this._endpoint,
451
+ defaultHeaders: this._defaultHeaders,
452
+ path: "/externalLocationMappingMetadata",
453
+ method: "GET",
454
+ pathParams: pathParams,
455
+ headerParams: headerParams,
456
+ queryParams: queryParams
457
+ });
458
+ try {
459
+ const response = yield retrier.makeServiceCall(this._httpClient, request, this.targetService, operationName, apiReferenceLink);
460
+ const sdkResponse = oci_common_1.composeResponse({
461
+ responseObject: {},
462
+ body: yield response.json(),
463
+ bodyKey: "externalLocationMappingMetadatumSummaryCollection",
464
+ bodyModel: model.ExternalLocationMappingMetadatumSummaryCollection,
465
+ type: "model.ExternalLocationMappingMetadatumSummaryCollection",
466
+ responseHeaders: [
467
+ {
468
+ value: response.headers.get("opc-request-id"),
469
+ key: "opcRequestId",
470
+ dataType: "string"
471
+ },
472
+ {
473
+ value: response.headers.get("opc-next-page"),
474
+ key: "opcNextPage",
475
+ dataType: "string"
476
+ }
477
+ ]
478
+ });
479
+ return sdkResponse;
480
+ }
481
+ catch (err) {
482
+ throw err;
483
+ }
484
+ });
485
+ }
486
+ /**
487
+ * List externalLocationSummary metadata from OCI Region to the Cloud Service Provider region across all regions.
488
+ * examples:
489
+ * application-json: |
490
+ * [
491
+ * {
492
+ * \"externalLocation\": {
493
+ * \"cspRegion\": \"East US\"
494
+ * },
495
+ * \"ociRegion\": \"us-ashburn-1\"
496
+ * },
497
+ * {
498
+ * \"externalLocation\": {
499
+ * \"cspRegion\": \"East US 2\"
500
+ * },
501
+ * \"ociRegion\": \"us-ashburn-1\"
502
+ * },
503
+ * {
504
+ * \"externalLocation\": {
505
+ * \"cspRegion\": \"Germany West Central\"
506
+ * },
507
+ * \"ociRegion\": \"eu-frankfurt-1\",
508
+ * }
509
+ * ]
510
+ *
511
+ * This operation uses {@link common.OciSdkDefaultRetryConfiguration} by default if no retry configuration is defined by the user.
512
+ * @param ListExternalLocationSummariesMetadataRequest
513
+ * @return ListExternalLocationSummariesMetadataResponse
514
+ * @throws OciError when an error occurs
515
+ * @example Click {@link https://docs.oracle.com/en-us/iaas/tools/typescript-sdk-examples/latest/multicloud/ListExternalLocationSummariesMetadata.ts.html |here} to see how to use ListExternalLocationSummariesMetadata API.
516
+ */
517
+ listExternalLocationSummariesMetadata(listExternalLocationSummariesMetadataRequest) {
518
+ return __awaiter(this, void 0, void 0, function* () {
519
+ if (this.logger)
520
+ this.logger.debug("Calling operation MetadataClient#listExternalLocationSummariesMetadata.");
521
+ const operationName = "listExternalLocationSummariesMetadata";
522
+ const apiReferenceLink = "";
523
+ const pathParams = {};
524
+ const queryParams = {
525
+ "subscriptionId": listExternalLocationSummariesMetadataRequest.subscriptionId,
526
+ "subscriptionServiceName": listExternalLocationSummariesMetadataRequest.subscriptionServiceName,
527
+ "entityType": listExternalLocationSummariesMetadataRequest.entityType,
528
+ "compartmentId": listExternalLocationSummariesMetadataRequest.compartmentId,
529
+ "limit": listExternalLocationSummariesMetadataRequest.limit,
530
+ "page": listExternalLocationSummariesMetadataRequest.page,
531
+ "sortOrder": listExternalLocationSummariesMetadataRequest.sortOrder,
532
+ "sortBy": listExternalLocationSummariesMetadataRequest.sortBy
533
+ };
534
+ let headerParams = {
535
+ "Content-Type": common.Constants.APPLICATION_JSON,
536
+ "opc-request-id": listExternalLocationSummariesMetadataRequest.opcRequestId
537
+ };
538
+ const specRetryConfiguration = common.OciSdkDefaultRetryConfiguration;
539
+ const retrier = oci_common_1.GenericRetrier.createPreferredRetrier(this._clientConfiguration ? this._clientConfiguration.retryConfiguration : undefined, listExternalLocationSummariesMetadataRequest.retryConfiguration, specRetryConfiguration);
540
+ if (this.logger)
541
+ retrier.logger = this.logger;
542
+ const request = yield oci_common_1.composeRequest({
543
+ baseEndpoint: this._endpoint,
544
+ defaultHeaders: this._defaultHeaders,
545
+ path: "/externalLocationSummariesMetadata",
546
+ method: "GET",
547
+ pathParams: pathParams,
548
+ headerParams: headerParams,
549
+ queryParams: queryParams
550
+ });
551
+ try {
552
+ const response = yield retrier.makeServiceCall(this._httpClient, request, this.targetService, operationName, apiReferenceLink);
553
+ const sdkResponse = oci_common_1.composeResponse({
554
+ responseObject: {},
555
+ body: yield response.json(),
556
+ bodyKey: "externalLocationSummariesMetadatumSummaryCollection",
557
+ bodyModel: model.ExternalLocationSummariesMetadatumSummaryCollection,
558
+ type: "model.ExternalLocationSummariesMetadatumSummaryCollection",
559
+ responseHeaders: [
560
+ {
561
+ value: response.headers.get("opc-request-id"),
562
+ key: "opcRequestId",
563
+ dataType: "string"
564
+ },
565
+ {
566
+ value: response.headers.get("opc-next-page"),
567
+ key: "opcNextPage",
568
+ dataType: "string"
569
+ }
570
+ ]
571
+ });
572
+ return sdkResponse;
573
+ }
574
+ catch (err) {
575
+ throw err;
576
+ }
577
+ });
578
+ }
579
+ }
580
+ exports.MetadataClient = MetadataClient;
581
+ MetadataClient.serviceEndpointTemplate = "https://multicloud.{region}.oci.{secondLevelDomain}";
582
+ MetadataClient.endpointServiceName = "";
583
+ var MultiCloudsMetadataApiKeys;
584
+ (function (MultiCloudsMetadataApiKeys) {
585
+ })(MultiCloudsMetadataApiKeys = exports.MultiCloudsMetadataApiKeys || (exports.MultiCloudsMetadataApiKeys = {}));
586
+ /**
587
+ * This service client uses {@link common.CircuitBreaker.DefaultConfiguration} for all the operations by default if no circuit breaker configuration is defined by the user.
588
+ */
589
+ class MultiCloudsMetadataClient {
590
+ constructor(params, clientConfiguration) {
591
+ this["_realmSpecificEndpointTemplateEnabled"] = undefined;
592
+ this["_endpoint"] = "";
593
+ this["_defaultHeaders"] = {};
594
+ this._circuitBreaker = null;
595
+ this._httpOptions = undefined;
596
+ this._bodyDuplexMode = undefined;
597
+ this.targetService = "MultiCloudsMetadata";
598
+ this._regionId = "";
599
+ this._lastSetRegionOrRegionId = "";
600
+ const requestSigner = params.authenticationDetailsProvider
601
+ ? new common.DefaultRequestSigner(params.authenticationDetailsProvider)
602
+ : null;
603
+ this._authProvider = params.authenticationDetailsProvider;
604
+ if (clientConfiguration) {
605
+ this._clientConfiguration = clientConfiguration;
606
+ this._circuitBreaker = clientConfiguration.circuitBreaker
607
+ ? clientConfiguration.circuitBreaker.circuit
608
+ : null;
609
+ this._httpOptions = clientConfiguration.httpOptions
610
+ ? clientConfiguration.httpOptions
611
+ : undefined;
612
+ this._bodyDuplexMode = clientConfiguration.bodyDuplexMode
613
+ ? clientConfiguration.bodyDuplexMode
614
+ : undefined;
615
+ }
616
+ if (!oci_common_1.developerToolConfiguration.isServiceEnabled("multicloud")) {
617
+ 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 : ";
618
+ throw errmsg.concat("multicloud");
619
+ }
620
+ // if circuit breaker is not created, check if circuit breaker system is enabled to use default circuit breaker
621
+ const specCircuitBreakerEnabled = true;
622
+ if (!this._circuitBreaker &&
623
+ common.utils.isCircuitBreakerSystemEnabled(clientConfiguration) &&
624
+ (specCircuitBreakerEnabled || common.CircuitBreaker.DefaultCircuitBreakerOverriden)) {
625
+ this._circuitBreaker = new common.CircuitBreaker().circuit;
626
+ }
627
+ this._httpClient =
628
+ params.httpClient ||
629
+ new common.FetchHttpClient(requestSigner, this._circuitBreaker, this._httpOptions, this._bodyDuplexMode);
630
+ if (params.authenticationDetailsProvider &&
631
+ common.isRegionProvider(params.authenticationDetailsProvider)) {
632
+ const provider = params.authenticationDetailsProvider;
633
+ if (provider.getRegion()) {
634
+ this.region = provider.getRegion();
635
+ }
636
+ }
637
+ }
638
+ /**
639
+ * Get the endpoint that is being used to call (ex, https://www.example.com).
640
+ */
641
+ get endpoint() {
642
+ return this._endpoint;
643
+ }
644
+ /**
645
+ * Sets the endpoint to call (ex, https://www.example.com).
646
+ * @param endpoint The endpoint of the service.
647
+ */
648
+ set endpoint(endpoint) {
649
+ this._endpoint = endpoint;
650
+ this._endpoint = this._endpoint + "/20180828";
651
+ if (this.logger)
652
+ this.logger.info(`MultiCloudsMetadataClient endpoint set to ${this._endpoint}`);
653
+ }
654
+ get logger() {
655
+ return common.LOG.logger;
656
+ }
657
+ /**
658
+ * Determines whether realm specific endpoint should be used or not.
659
+ * Set realmSpecificEndpointTemplateEnabled to "true" if the user wants to enable use of realm specific endpoint template, otherwise set it to "false"
660
+ * @param realmSpecificEndpointTemplateEnabled flag to enable the use of realm specific endpoint template
661
+ */
662
+ set useRealmSpecificEndpointTemplate(realmSpecificEndpointTemplateEnabled) {
663
+ this._realmSpecificEndpointTemplateEnabled = realmSpecificEndpointTemplateEnabled;
664
+ if (this.logger)
665
+ this.logger.info(`realmSpecificEndpointTemplateEnabled set to ${this._realmSpecificEndpointTemplateEnabled}`);
666
+ if (this._lastSetRegionOrRegionId === common.Region.REGION_STRING) {
667
+ this.endpoint = common.EndpointBuilder.createEndpointFromRegion(MultiCloudsMetadataClient.serviceEndpointTemplate, this._region, MultiCloudsMetadataClient.endpointServiceName);
668
+ }
669
+ else if (this._lastSetRegionOrRegionId === common.Region.REGION_ID_STRING) {
670
+ this.endpoint = common.EndpointBuilder.createEndpointFromRegionId(MultiCloudsMetadataClient.serviceEndpointTemplate, this._regionId, MultiCloudsMetadataClient.endpointServiceName);
671
+ }
672
+ }
673
+ /**
674
+ * Sets the region to call (ex, Region.US_PHOENIX_1).
675
+ * Note, this will call {@link #endpoint(String) endpoint} after resolving the endpoint.
676
+ * @param region The region of the service.
677
+ */
678
+ set region(region) {
679
+ this._region = region;
680
+ this.endpoint = common.EndpointBuilder.createEndpointFromRegion(MultiCloudsMetadataClient.serviceEndpointTemplate, region, MultiCloudsMetadataClient.endpointServiceName);
681
+ this._lastSetRegionOrRegionId = common.Region.REGION_STRING;
682
+ }
683
+ /**
684
+ * Sets the regionId to call (ex, 'us-phoenix-1').
685
+ *
686
+ * Note, this will first try to map the region ID to a known Region and call {@link #region(Region) region}.
687
+ * If no known Region could be determined, it will create an endpoint assuming its in default Realm OC1
688
+ * and then call {@link #endpoint(String) endpoint}.
689
+ * @param regionId The public region ID.
690
+ */
691
+ set regionId(regionId) {
692
+ this._regionId = regionId;
693
+ this.endpoint = common.EndpointBuilder.createEndpointFromRegionId(MultiCloudsMetadataClient.serviceEndpointTemplate, regionId, MultiCloudsMetadataClient.endpointServiceName);
694
+ this._lastSetRegionOrRegionId = common.Region.REGION_ID_STRING;
695
+ }
696
+ /**
697
+ * Shutdown the circuit breaker used by the client when it is no longer needed
698
+ */
699
+ shutdownCircuitBreaker() {
700
+ if (this._circuitBreaker) {
701
+ this._circuitBreaker.shutdown();
702
+ }
703
+ }
704
+ /**
705
+ * Close the provider if possible which in turn shuts down any associated circuit breaker
706
+ */
707
+ closeProvider() {
708
+ if (this._authProvider) {
709
+ if (this._authProvider instanceof common.AbstractRequestingAuthenticationDetailsProvider)
710
+ (this._authProvider).closeProvider();
711
+ }
712
+ }
713
+ /**
714
+ * Close the client once it is no longer needed
715
+ */
716
+ close() {
717
+ this.shutdownCircuitBreaker();
718
+ this.closeProvider();
719
+ }
720
+ /**
721
+ * Gets information about multicloud base compartment
722
+ * This operation uses {@link common.OciSdkDefaultRetryConfiguration} by default if no retry configuration is defined by the user.
723
+ * @param GetMultiCloudMetadataRequest
724
+ * @return GetMultiCloudMetadataResponse
725
+ * @throws OciError when an error occurs
726
+ * @example Click {@link https://docs.oracle.com/en-us/iaas/tools/typescript-sdk-examples/latest/multicloud/GetMultiCloudMetadata.ts.html |here} to see how to use GetMultiCloudMetadata API.
727
+ */
728
+ getMultiCloudMetadata(getMultiCloudMetadataRequest) {
729
+ return __awaiter(this, void 0, void 0, function* () {
730
+ if (this.logger)
731
+ this.logger.debug("Calling operation MultiCloudsMetadataClient#getMultiCloudMetadata.");
732
+ const operationName = "getMultiCloudMetadata";
733
+ const apiReferenceLink = "";
734
+ const pathParams = {
735
+ "{subscriptionId}": getMultiCloudMetadataRequest.subscriptionId
736
+ };
737
+ const queryParams = {
738
+ "compartmentId": getMultiCloudMetadataRequest.compartmentId
739
+ };
740
+ let headerParams = {
741
+ "Content-Type": common.Constants.APPLICATION_JSON,
742
+ "opc-request-id": getMultiCloudMetadataRequest.opcRequestId
743
+ };
744
+ const specRetryConfiguration = common.OciSdkDefaultRetryConfiguration;
745
+ const retrier = oci_common_1.GenericRetrier.createPreferredRetrier(this._clientConfiguration ? this._clientConfiguration.retryConfiguration : undefined, getMultiCloudMetadataRequest.retryConfiguration, specRetryConfiguration);
746
+ if (this.logger)
747
+ retrier.logger = this.logger;
748
+ const request = yield oci_common_1.composeRequest({
749
+ baseEndpoint: this._endpoint,
750
+ defaultHeaders: this._defaultHeaders,
751
+ path: "/omHub/multiCloudsMetadata/{subscriptionId}",
752
+ method: "GET",
753
+ pathParams: pathParams,
754
+ headerParams: headerParams,
755
+ queryParams: queryParams
756
+ });
757
+ try {
758
+ const response = yield retrier.makeServiceCall(this._httpClient, request, this.targetService, operationName, apiReferenceLink);
759
+ const sdkResponse = oci_common_1.composeResponse({
760
+ responseObject: {},
761
+ body: yield response.json(),
762
+ bodyKey: "multiCloudMetadata",
763
+ bodyModel: model.MultiCloudMetadata,
764
+ type: "model.MultiCloudMetadata",
765
+ responseHeaders: [
766
+ {
767
+ value: response.headers.get("etag"),
768
+ key: "etag",
769
+ dataType: "string"
770
+ },
771
+ {
772
+ value: response.headers.get("opc-request-id"),
773
+ key: "opcRequestId",
774
+ dataType: "string"
775
+ }
776
+ ]
777
+ });
778
+ return sdkResponse;
779
+ }
780
+ catch (err) {
781
+ throw err;
782
+ }
783
+ });
784
+ }
785
+ /**
786
+ * Gets a list of multicloud metadata with multicloud base compartment and subscription across Cloud Service Providers.
787
+ *
788
+ * This operation uses {@link common.OciSdkDefaultRetryConfiguration} by default if no retry configuration is defined by the user.
789
+ * @param ListMultiCloudMetadataRequest
790
+ * @return ListMultiCloudMetadataResponse
791
+ * @throws OciError when an error occurs
792
+ * @example Click {@link https://docs.oracle.com/en-us/iaas/tools/typescript-sdk-examples/latest/multicloud/ListMultiCloudMetadata.ts.html |here} to see how to use ListMultiCloudMetadata API.
793
+ */
794
+ listMultiCloudMetadata(listMultiCloudMetadataRequest) {
795
+ return __awaiter(this, void 0, void 0, function* () {
796
+ if (this.logger)
797
+ this.logger.debug("Calling operation MultiCloudsMetadataClient#listMultiCloudMetadata.");
798
+ const operationName = "listMultiCloudMetadata";
799
+ const apiReferenceLink = "";
800
+ const pathParams = {};
801
+ const queryParams = {
802
+ "compartmentId": listMultiCloudMetadataRequest.compartmentId,
803
+ "limit": listMultiCloudMetadataRequest.limit,
804
+ "page": listMultiCloudMetadataRequest.page,
805
+ "sortOrder": listMultiCloudMetadataRequest.sortOrder,
806
+ "sortBy": listMultiCloudMetadataRequest.sortBy
807
+ };
808
+ let headerParams = {
809
+ "Content-Type": common.Constants.APPLICATION_JSON,
810
+ "opc-request-id": listMultiCloudMetadataRequest.opcRequestId
811
+ };
812
+ const specRetryConfiguration = common.OciSdkDefaultRetryConfiguration;
813
+ const retrier = oci_common_1.GenericRetrier.createPreferredRetrier(this._clientConfiguration ? this._clientConfiguration.retryConfiguration : undefined, listMultiCloudMetadataRequest.retryConfiguration, specRetryConfiguration);
814
+ if (this.logger)
815
+ retrier.logger = this.logger;
816
+ const request = yield oci_common_1.composeRequest({
817
+ baseEndpoint: this._endpoint,
818
+ defaultHeaders: this._defaultHeaders,
819
+ path: "/omHub/multiCloudsMetadata",
820
+ method: "GET",
821
+ pathParams: pathParams,
822
+ headerParams: headerParams,
823
+ queryParams: queryParams
824
+ });
825
+ try {
826
+ const response = yield retrier.makeServiceCall(this._httpClient, request, this.targetService, operationName, apiReferenceLink);
827
+ const sdkResponse = oci_common_1.composeResponse({
828
+ responseObject: {},
829
+ body: yield response.json(),
830
+ bodyKey: "multiCloudMetadataCollection",
831
+ bodyModel: model.MultiCloudMetadataCollection,
832
+ type: "model.MultiCloudMetadataCollection",
833
+ responseHeaders: [
834
+ {
835
+ value: response.headers.get("opc-request-id"),
836
+ key: "opcRequestId",
837
+ dataType: "string"
838
+ },
839
+ {
840
+ value: response.headers.get("opc-next-page"),
841
+ key: "opcNextPage",
842
+ dataType: "string"
843
+ }
844
+ ]
845
+ });
846
+ return sdkResponse;
847
+ }
848
+ catch (err) {
849
+ throw err;
850
+ }
851
+ });
852
+ }
853
+ }
854
+ exports.MultiCloudsMetadataClient = MultiCloudsMetadataClient;
855
+ MultiCloudsMetadataClient.serviceEndpointTemplate = "https://multicloud.{region}.oci.{secondLevelDomain}";
856
+ MultiCloudsMetadataClient.endpointServiceName = "";
857
+ var OmhubNetworkAnchorApiKeys;
858
+ (function (OmhubNetworkAnchorApiKeys) {
859
+ })(OmhubNetworkAnchorApiKeys = exports.OmhubNetworkAnchorApiKeys || (exports.OmhubNetworkAnchorApiKeys = {}));
860
+ /**
861
+ * This service client uses {@link common.CircuitBreaker.DefaultConfiguration} for all the operations by default if no circuit breaker configuration is defined by the user.
862
+ */
863
+ class OmhubNetworkAnchorClient {
864
+ constructor(params, clientConfiguration) {
865
+ this["_realmSpecificEndpointTemplateEnabled"] = undefined;
866
+ this["_endpoint"] = "";
867
+ this["_defaultHeaders"] = {};
868
+ this._circuitBreaker = null;
869
+ this._httpOptions = undefined;
870
+ this._bodyDuplexMode = undefined;
871
+ this.targetService = "OmhubNetworkAnchor";
872
+ this._regionId = "";
873
+ this._lastSetRegionOrRegionId = "";
874
+ const requestSigner = params.authenticationDetailsProvider
875
+ ? new common.DefaultRequestSigner(params.authenticationDetailsProvider)
876
+ : null;
877
+ this._authProvider = params.authenticationDetailsProvider;
878
+ if (clientConfiguration) {
879
+ this._clientConfiguration = clientConfiguration;
880
+ this._circuitBreaker = clientConfiguration.circuitBreaker
881
+ ? clientConfiguration.circuitBreaker.circuit
882
+ : null;
883
+ this._httpOptions = clientConfiguration.httpOptions
884
+ ? clientConfiguration.httpOptions
885
+ : undefined;
886
+ this._bodyDuplexMode = clientConfiguration.bodyDuplexMode
887
+ ? clientConfiguration.bodyDuplexMode
888
+ : undefined;
889
+ }
890
+ if (!oci_common_1.developerToolConfiguration.isServiceEnabled("multicloud")) {
891
+ 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 : ";
892
+ throw errmsg.concat("multicloud");
893
+ }
894
+ // if circuit breaker is not created, check if circuit breaker system is enabled to use default circuit breaker
895
+ const specCircuitBreakerEnabled = true;
896
+ if (!this._circuitBreaker &&
897
+ common.utils.isCircuitBreakerSystemEnabled(clientConfiguration) &&
898
+ (specCircuitBreakerEnabled || common.CircuitBreaker.DefaultCircuitBreakerOverriden)) {
899
+ this._circuitBreaker = new common.CircuitBreaker().circuit;
900
+ }
901
+ this._httpClient =
902
+ params.httpClient ||
903
+ new common.FetchHttpClient(requestSigner, this._circuitBreaker, this._httpOptions, this._bodyDuplexMode);
904
+ if (params.authenticationDetailsProvider &&
905
+ common.isRegionProvider(params.authenticationDetailsProvider)) {
906
+ const provider = params.authenticationDetailsProvider;
907
+ if (provider.getRegion()) {
908
+ this.region = provider.getRegion();
909
+ }
910
+ }
911
+ }
912
+ /**
913
+ * Get the endpoint that is being used to call (ex, https://www.example.com).
914
+ */
915
+ get endpoint() {
916
+ return this._endpoint;
917
+ }
918
+ /**
919
+ * Sets the endpoint to call (ex, https://www.example.com).
920
+ * @param endpoint The endpoint of the service.
921
+ */
922
+ set endpoint(endpoint) {
923
+ this._endpoint = endpoint;
924
+ this._endpoint = this._endpoint + "/20180828";
925
+ if (this.logger)
926
+ this.logger.info(`OmhubNetworkAnchorClient endpoint set to ${this._endpoint}`);
927
+ }
928
+ get logger() {
929
+ return common.LOG.logger;
930
+ }
931
+ /**
932
+ * Determines whether realm specific endpoint should be used or not.
933
+ * Set realmSpecificEndpointTemplateEnabled to "true" if the user wants to enable use of realm specific endpoint template, otherwise set it to "false"
934
+ * @param realmSpecificEndpointTemplateEnabled flag to enable the use of realm specific endpoint template
935
+ */
936
+ set useRealmSpecificEndpointTemplate(realmSpecificEndpointTemplateEnabled) {
937
+ this._realmSpecificEndpointTemplateEnabled = realmSpecificEndpointTemplateEnabled;
938
+ if (this.logger)
939
+ this.logger.info(`realmSpecificEndpointTemplateEnabled set to ${this._realmSpecificEndpointTemplateEnabled}`);
940
+ if (this._lastSetRegionOrRegionId === common.Region.REGION_STRING) {
941
+ this.endpoint = common.EndpointBuilder.createEndpointFromRegion(OmhubNetworkAnchorClient.serviceEndpointTemplate, this._region, OmhubNetworkAnchorClient.endpointServiceName);
942
+ }
943
+ else if (this._lastSetRegionOrRegionId === common.Region.REGION_ID_STRING) {
944
+ this.endpoint = common.EndpointBuilder.createEndpointFromRegionId(OmhubNetworkAnchorClient.serviceEndpointTemplate, this._regionId, OmhubNetworkAnchorClient.endpointServiceName);
945
+ }
946
+ }
947
+ /**
948
+ * Sets the region to call (ex, Region.US_PHOENIX_1).
949
+ * Note, this will call {@link #endpoint(String) endpoint} after resolving the endpoint.
950
+ * @param region The region of the service.
951
+ */
952
+ set region(region) {
953
+ this._region = region;
954
+ this.endpoint = common.EndpointBuilder.createEndpointFromRegion(OmhubNetworkAnchorClient.serviceEndpointTemplate, region, OmhubNetworkAnchorClient.endpointServiceName);
955
+ this._lastSetRegionOrRegionId = common.Region.REGION_STRING;
956
+ }
957
+ /**
958
+ * Sets the regionId to call (ex, 'us-phoenix-1').
959
+ *
960
+ * Note, this will first try to map the region ID to a known Region and call {@link #region(Region) region}.
961
+ * If no known Region could be determined, it will create an endpoint assuming its in default Realm OC1
962
+ * and then call {@link #endpoint(String) endpoint}.
963
+ * @param regionId The public region ID.
964
+ */
965
+ set regionId(regionId) {
966
+ this._regionId = regionId;
967
+ this.endpoint = common.EndpointBuilder.createEndpointFromRegionId(OmhubNetworkAnchorClient.serviceEndpointTemplate, regionId, OmhubNetworkAnchorClient.endpointServiceName);
968
+ this._lastSetRegionOrRegionId = common.Region.REGION_ID_STRING;
969
+ }
970
+ /**
971
+ * Creates a new OmhubNetworkAnchorWaiter for resources for this service.
972
+ *
973
+ * @param config The waiter configuration for termination and delay strategy
974
+ * @return The service waiters.
975
+ */
976
+ createWaiters(config) {
977
+ this._waiters = new omhubnetworkanchor_waiter_1.OmhubNetworkAnchorWaiter(this, config);
978
+ return this._waiters;
979
+ }
980
+ /**
981
+ * Gets the waiters available for resources for this service.
982
+ *
983
+ * @return The service waiters.
984
+ */
985
+ getWaiters() {
986
+ if (this._waiters) {
987
+ return this._waiters;
988
+ }
989
+ throw Error("Waiters do not exist. Please create waiters.");
990
+ }
991
+ /**
992
+ * Shutdown the circuit breaker used by the client when it is no longer needed
993
+ */
994
+ shutdownCircuitBreaker() {
995
+ if (this._circuitBreaker) {
996
+ this._circuitBreaker.shutdown();
997
+ }
998
+ }
999
+ /**
1000
+ * Close the provider if possible which in turn shuts down any associated circuit breaker
1001
+ */
1002
+ closeProvider() {
1003
+ if (this._authProvider) {
1004
+ if (this._authProvider instanceof common.AbstractRequestingAuthenticationDetailsProvider)
1005
+ (this._authProvider).closeProvider();
1006
+ }
1007
+ }
1008
+ /**
1009
+ * Close the client once it is no longer needed
1010
+ */
1011
+ close() {
1012
+ this.shutdownCircuitBreaker();
1013
+ this.closeProvider();
1014
+ }
1015
+ /**
1016
+ * Gets information about a NetworkAnchor.
1017
+ * This operation uses {@link common.OciSdkDefaultRetryConfiguration} by default if no retry configuration is defined by the user.
1018
+ * @param GetNetworkAnchorRequest
1019
+ * @return GetNetworkAnchorResponse
1020
+ * @throws OciError when an error occurs
1021
+ * @example Click {@link https://docs.oracle.com/en-us/iaas/tools/typescript-sdk-examples/latest/multicloud/GetNetworkAnchor.ts.html |here} to see how to use GetNetworkAnchor API.
1022
+ */
1023
+ getNetworkAnchor(getNetworkAnchorRequest) {
1024
+ return __awaiter(this, void 0, void 0, function* () {
1025
+ if (this.logger)
1026
+ this.logger.debug("Calling operation OmhubNetworkAnchorClient#getNetworkAnchor.");
1027
+ const operationName = "getNetworkAnchor";
1028
+ const apiReferenceLink = "";
1029
+ const pathParams = {
1030
+ "{networkAnchorId}": getNetworkAnchorRequest.networkAnchorId
1031
+ };
1032
+ const queryParams = {
1033
+ "subscriptionServiceName": getNetworkAnchorRequest.subscriptionServiceName,
1034
+ "subscriptionId": getNetworkAnchorRequest.subscriptionId,
1035
+ "externalLocation": getNetworkAnchorRequest.externalLocation
1036
+ };
1037
+ let headerParams = {
1038
+ "Content-Type": common.Constants.APPLICATION_JSON,
1039
+ "opc-request-id": getNetworkAnchorRequest.opcRequestId
1040
+ };
1041
+ const specRetryConfiguration = common.OciSdkDefaultRetryConfiguration;
1042
+ const retrier = oci_common_1.GenericRetrier.createPreferredRetrier(this._clientConfiguration ? this._clientConfiguration.retryConfiguration : undefined, getNetworkAnchorRequest.retryConfiguration, specRetryConfiguration);
1043
+ if (this.logger)
1044
+ retrier.logger = this.logger;
1045
+ const request = yield oci_common_1.composeRequest({
1046
+ baseEndpoint: this._endpoint,
1047
+ defaultHeaders: this._defaultHeaders,
1048
+ path: "/networkAnchors/{networkAnchorId}",
1049
+ method: "GET",
1050
+ pathParams: pathParams,
1051
+ headerParams: headerParams,
1052
+ queryParams: queryParams
1053
+ });
1054
+ try {
1055
+ const response = yield retrier.makeServiceCall(this._httpClient, request, this.targetService, operationName, apiReferenceLink);
1056
+ const sdkResponse = oci_common_1.composeResponse({
1057
+ responseObject: {},
1058
+ body: yield response.json(),
1059
+ bodyKey: "networkAnchor",
1060
+ bodyModel: model.NetworkAnchor,
1061
+ type: "model.NetworkAnchor",
1062
+ responseHeaders: [
1063
+ {
1064
+ value: response.headers.get("etag"),
1065
+ key: "etag",
1066
+ dataType: "string"
1067
+ },
1068
+ {
1069
+ value: response.headers.get("opc-request-id"),
1070
+ key: "opcRequestId",
1071
+ dataType: "string"
1072
+ }
1073
+ ]
1074
+ });
1075
+ return sdkResponse;
1076
+ }
1077
+ catch (err) {
1078
+ throw err;
1079
+ }
1080
+ });
1081
+ }
1082
+ /**
1083
+ * Gets a list of NetworkAnchors.
1084
+ *
1085
+ * This operation uses {@link common.OciSdkDefaultRetryConfiguration} by default if no retry configuration is defined by the user.
1086
+ * @param ListNetworkAnchorsRequest
1087
+ * @return ListNetworkAnchorsResponse
1088
+ * @throws OciError when an error occurs
1089
+ * @example Click {@link https://docs.oracle.com/en-us/iaas/tools/typescript-sdk-examples/latest/multicloud/ListNetworkAnchors.ts.html |here} to see how to use ListNetworkAnchors API.
1090
+ */
1091
+ listNetworkAnchors(listNetworkAnchorsRequest) {
1092
+ return __awaiter(this, void 0, void 0, function* () {
1093
+ if (this.logger)
1094
+ this.logger.debug("Calling operation OmhubNetworkAnchorClient#listNetworkAnchors.");
1095
+ const operationName = "listNetworkAnchors";
1096
+ const apiReferenceLink = "";
1097
+ const pathParams = {};
1098
+ const queryParams = {
1099
+ "compartmentId": listNetworkAnchorsRequest.compartmentId,
1100
+ "subscriptionId": listNetworkAnchorsRequest.subscriptionId,
1101
+ "subscriptionServiceName": listNetworkAnchorsRequest.subscriptionServiceName,
1102
+ "lifecycleState": listNetworkAnchorsRequest.lifecycleState,
1103
+ "displayName": listNetworkAnchorsRequest.displayName,
1104
+ "externalLocation": listNetworkAnchorsRequest.externalLocation,
1105
+ "networkAnchorOciSubnetId": listNetworkAnchorsRequest.networkAnchorOciSubnetId,
1106
+ "networkAnchorOciVcnId": listNetworkAnchorsRequest.networkAnchorOciVcnId,
1107
+ "id": listNetworkAnchorsRequest.id,
1108
+ "limit": listNetworkAnchorsRequest.limit,
1109
+ "page": listNetworkAnchorsRequest.page,
1110
+ "sortOrder": listNetworkAnchorsRequest.sortOrder,
1111
+ "sortBy": listNetworkAnchorsRequest.sortBy
1112
+ };
1113
+ let headerParams = {
1114
+ "Content-Type": common.Constants.APPLICATION_JSON,
1115
+ "opc-request-id": listNetworkAnchorsRequest.opcRequestId
1116
+ };
1117
+ const specRetryConfiguration = common.OciSdkDefaultRetryConfiguration;
1118
+ const retrier = oci_common_1.GenericRetrier.createPreferredRetrier(this._clientConfiguration ? this._clientConfiguration.retryConfiguration : undefined, listNetworkAnchorsRequest.retryConfiguration, specRetryConfiguration);
1119
+ if (this.logger)
1120
+ retrier.logger = this.logger;
1121
+ const request = yield oci_common_1.composeRequest({
1122
+ baseEndpoint: this._endpoint,
1123
+ defaultHeaders: this._defaultHeaders,
1124
+ path: "/networkAnchors",
1125
+ method: "GET",
1126
+ pathParams: pathParams,
1127
+ headerParams: headerParams,
1128
+ queryParams: queryParams
1129
+ });
1130
+ try {
1131
+ const response = yield retrier.makeServiceCall(this._httpClient, request, this.targetService, operationName, apiReferenceLink);
1132
+ const sdkResponse = oci_common_1.composeResponse({
1133
+ responseObject: {},
1134
+ body: yield response.json(),
1135
+ bodyKey: "networkAnchorCollection",
1136
+ bodyModel: model.NetworkAnchorCollection,
1137
+ type: "model.NetworkAnchorCollection",
1138
+ responseHeaders: [
1139
+ {
1140
+ value: response.headers.get("opc-request-id"),
1141
+ key: "opcRequestId",
1142
+ dataType: "string"
1143
+ },
1144
+ {
1145
+ value: response.headers.get("opc-next-page"),
1146
+ key: "opcNextPage",
1147
+ dataType: "string"
1148
+ }
1149
+ ]
1150
+ });
1151
+ return sdkResponse;
1152
+ }
1153
+ catch (err) {
1154
+ throw err;
1155
+ }
1156
+ });
1157
+ }
1158
+ }
1159
+ exports.OmhubNetworkAnchorClient = OmhubNetworkAnchorClient;
1160
+ OmhubNetworkAnchorClient.serviceEndpointTemplate = "https://multicloud.{region}.oci.{secondLevelDomain}";
1161
+ OmhubNetworkAnchorClient.endpointServiceName = "";
1162
+ var OmhubResourceAnchorApiKeys;
1163
+ (function (OmhubResourceAnchorApiKeys) {
1164
+ })(OmhubResourceAnchorApiKeys = exports.OmhubResourceAnchorApiKeys || (exports.OmhubResourceAnchorApiKeys = {}));
1165
+ /**
1166
+ * This service client uses {@link common.CircuitBreaker.DefaultConfiguration} for all the operations by default if no circuit breaker configuration is defined by the user.
1167
+ */
1168
+ class OmhubResourceAnchorClient {
1169
+ constructor(params, clientConfiguration) {
1170
+ this["_realmSpecificEndpointTemplateEnabled"] = undefined;
1171
+ this["_endpoint"] = "";
1172
+ this["_defaultHeaders"] = {};
1173
+ this._circuitBreaker = null;
1174
+ this._httpOptions = undefined;
1175
+ this._bodyDuplexMode = undefined;
1176
+ this.targetService = "OmhubResourceAnchor";
1177
+ this._regionId = "";
1178
+ this._lastSetRegionOrRegionId = "";
1179
+ const requestSigner = params.authenticationDetailsProvider
1180
+ ? new common.DefaultRequestSigner(params.authenticationDetailsProvider)
1181
+ : null;
1182
+ this._authProvider = params.authenticationDetailsProvider;
1183
+ if (clientConfiguration) {
1184
+ this._clientConfiguration = clientConfiguration;
1185
+ this._circuitBreaker = clientConfiguration.circuitBreaker
1186
+ ? clientConfiguration.circuitBreaker.circuit
1187
+ : null;
1188
+ this._httpOptions = clientConfiguration.httpOptions
1189
+ ? clientConfiguration.httpOptions
1190
+ : undefined;
1191
+ this._bodyDuplexMode = clientConfiguration.bodyDuplexMode
1192
+ ? clientConfiguration.bodyDuplexMode
1193
+ : undefined;
1194
+ }
1195
+ if (!oci_common_1.developerToolConfiguration.isServiceEnabled("multicloud")) {
1196
+ 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 : ";
1197
+ throw errmsg.concat("multicloud");
1198
+ }
1199
+ // if circuit breaker is not created, check if circuit breaker system is enabled to use default circuit breaker
1200
+ const specCircuitBreakerEnabled = true;
1201
+ if (!this._circuitBreaker &&
1202
+ common.utils.isCircuitBreakerSystemEnabled(clientConfiguration) &&
1203
+ (specCircuitBreakerEnabled || common.CircuitBreaker.DefaultCircuitBreakerOverriden)) {
1204
+ this._circuitBreaker = new common.CircuitBreaker().circuit;
1205
+ }
1206
+ this._httpClient =
1207
+ params.httpClient ||
1208
+ new common.FetchHttpClient(requestSigner, this._circuitBreaker, this._httpOptions, this._bodyDuplexMode);
1209
+ if (params.authenticationDetailsProvider &&
1210
+ common.isRegionProvider(params.authenticationDetailsProvider)) {
1211
+ const provider = params.authenticationDetailsProvider;
1212
+ if (provider.getRegion()) {
1213
+ this.region = provider.getRegion();
1214
+ }
1215
+ }
1216
+ }
1217
+ /**
1218
+ * Get the endpoint that is being used to call (ex, https://www.example.com).
1219
+ */
1220
+ get endpoint() {
1221
+ return this._endpoint;
1222
+ }
1223
+ /**
1224
+ * Sets the endpoint to call (ex, https://www.example.com).
1225
+ * @param endpoint The endpoint of the service.
1226
+ */
1227
+ set endpoint(endpoint) {
1228
+ this._endpoint = endpoint;
1229
+ this._endpoint = this._endpoint + "/20180828";
1230
+ if (this.logger)
1231
+ this.logger.info(`OmhubResourceAnchorClient endpoint set to ${this._endpoint}`);
1232
+ }
1233
+ get logger() {
1234
+ return common.LOG.logger;
1235
+ }
1236
+ /**
1237
+ * Determines whether realm specific endpoint should be used or not.
1238
+ * Set realmSpecificEndpointTemplateEnabled to "true" if the user wants to enable use of realm specific endpoint template, otherwise set it to "false"
1239
+ * @param realmSpecificEndpointTemplateEnabled flag to enable the use of realm specific endpoint template
1240
+ */
1241
+ set useRealmSpecificEndpointTemplate(realmSpecificEndpointTemplateEnabled) {
1242
+ this._realmSpecificEndpointTemplateEnabled = realmSpecificEndpointTemplateEnabled;
1243
+ if (this.logger)
1244
+ this.logger.info(`realmSpecificEndpointTemplateEnabled set to ${this._realmSpecificEndpointTemplateEnabled}`);
1245
+ if (this._lastSetRegionOrRegionId === common.Region.REGION_STRING) {
1246
+ this.endpoint = common.EndpointBuilder.createEndpointFromRegion(OmhubResourceAnchorClient.serviceEndpointTemplate, this._region, OmhubResourceAnchorClient.endpointServiceName);
1247
+ }
1248
+ else if (this._lastSetRegionOrRegionId === common.Region.REGION_ID_STRING) {
1249
+ this.endpoint = common.EndpointBuilder.createEndpointFromRegionId(OmhubResourceAnchorClient.serviceEndpointTemplate, this._regionId, OmhubResourceAnchorClient.endpointServiceName);
1250
+ }
1251
+ }
1252
+ /**
1253
+ * Sets the region to call (ex, Region.US_PHOENIX_1).
1254
+ * Note, this will call {@link #endpoint(String) endpoint} after resolving the endpoint.
1255
+ * @param region The region of the service.
1256
+ */
1257
+ set region(region) {
1258
+ this._region = region;
1259
+ this.endpoint = common.EndpointBuilder.createEndpointFromRegion(OmhubResourceAnchorClient.serviceEndpointTemplate, region, OmhubResourceAnchorClient.endpointServiceName);
1260
+ this._lastSetRegionOrRegionId = common.Region.REGION_STRING;
1261
+ }
1262
+ /**
1263
+ * Sets the regionId to call (ex, 'us-phoenix-1').
1264
+ *
1265
+ * Note, this will first try to map the region ID to a known Region and call {@link #region(Region) region}.
1266
+ * If no known Region could be determined, it will create an endpoint assuming its in default Realm OC1
1267
+ * and then call {@link #endpoint(String) endpoint}.
1268
+ * @param regionId The public region ID.
1269
+ */
1270
+ set regionId(regionId) {
1271
+ this._regionId = regionId;
1272
+ this.endpoint = common.EndpointBuilder.createEndpointFromRegionId(OmhubResourceAnchorClient.serviceEndpointTemplate, regionId, OmhubResourceAnchorClient.endpointServiceName);
1273
+ this._lastSetRegionOrRegionId = common.Region.REGION_ID_STRING;
1274
+ }
1275
+ /**
1276
+ * Creates a new OmhubResourceAnchorWaiter for resources for this service.
1277
+ *
1278
+ * @param config The waiter configuration for termination and delay strategy
1279
+ * @return The service waiters.
1280
+ */
1281
+ createWaiters(config) {
1282
+ this._waiters = new omhubresourceanchor_waiter_1.OmhubResourceAnchorWaiter(this, config);
1283
+ return this._waiters;
1284
+ }
1285
+ /**
1286
+ * Gets the waiters available for resources for this service.
1287
+ *
1288
+ * @return The service waiters.
1289
+ */
1290
+ getWaiters() {
1291
+ if (this._waiters) {
1292
+ return this._waiters;
1293
+ }
1294
+ throw Error("Waiters do not exist. Please create waiters.");
1295
+ }
1296
+ /**
1297
+ * Shutdown the circuit breaker used by the client when it is no longer needed
1298
+ */
1299
+ shutdownCircuitBreaker() {
1300
+ if (this._circuitBreaker) {
1301
+ this._circuitBreaker.shutdown();
1302
+ }
1303
+ }
1304
+ /**
1305
+ * Close the provider if possible which in turn shuts down any associated circuit breaker
1306
+ */
1307
+ closeProvider() {
1308
+ if (this._authProvider) {
1309
+ if (this._authProvider instanceof common.AbstractRequestingAuthenticationDetailsProvider)
1310
+ (this._authProvider).closeProvider();
1311
+ }
1312
+ }
1313
+ /**
1314
+ * Close the client once it is no longer needed
1315
+ */
1316
+ close() {
1317
+ this.shutdownCircuitBreaker();
1318
+ this.closeProvider();
1319
+ }
1320
+ /**
1321
+ * Gets information about a ResourceAnchor.
1322
+ * This operation uses {@link common.OciSdkDefaultRetryConfiguration} by default if no retry configuration is defined by the user.
1323
+ * @param GetResourceAnchorRequest
1324
+ * @return GetResourceAnchorResponse
1325
+ * @throws OciError when an error occurs
1326
+ * @example Click {@link https://docs.oracle.com/en-us/iaas/tools/typescript-sdk-examples/latest/multicloud/GetResourceAnchor.ts.html |here} to see how to use GetResourceAnchor API.
1327
+ */
1328
+ getResourceAnchor(getResourceAnchorRequest) {
1329
+ return __awaiter(this, void 0, void 0, function* () {
1330
+ if (this.logger)
1331
+ this.logger.debug("Calling operation OmhubResourceAnchorClient#getResourceAnchor.");
1332
+ const operationName = "getResourceAnchor";
1333
+ const apiReferenceLink = "";
1334
+ const pathParams = {
1335
+ "{resourceAnchorId}": getResourceAnchorRequest.resourceAnchorId
1336
+ };
1337
+ const queryParams = {
1338
+ "subscriptionServiceName": getResourceAnchorRequest.subscriptionServiceName,
1339
+ "subscriptionId": getResourceAnchorRequest.subscriptionId
1340
+ };
1341
+ let headerParams = {
1342
+ "Content-Type": common.Constants.APPLICATION_JSON,
1343
+ "opc-request-id": getResourceAnchorRequest.opcRequestId
1344
+ };
1345
+ const specRetryConfiguration = common.OciSdkDefaultRetryConfiguration;
1346
+ const retrier = oci_common_1.GenericRetrier.createPreferredRetrier(this._clientConfiguration ? this._clientConfiguration.retryConfiguration : undefined, getResourceAnchorRequest.retryConfiguration, specRetryConfiguration);
1347
+ if (this.logger)
1348
+ retrier.logger = this.logger;
1349
+ const request = yield oci_common_1.composeRequest({
1350
+ baseEndpoint: this._endpoint,
1351
+ defaultHeaders: this._defaultHeaders,
1352
+ path: "/resourceAnchors/{resourceAnchorId}",
1353
+ method: "GET",
1354
+ pathParams: pathParams,
1355
+ headerParams: headerParams,
1356
+ queryParams: queryParams
1357
+ });
1358
+ try {
1359
+ const response = yield retrier.makeServiceCall(this._httpClient, request, this.targetService, operationName, apiReferenceLink);
1360
+ const sdkResponse = oci_common_1.composeResponse({
1361
+ responseObject: {},
1362
+ body: yield response.json(),
1363
+ bodyKey: "resourceAnchor",
1364
+ bodyModel: model.ResourceAnchor,
1365
+ type: "model.ResourceAnchor",
1366
+ responseHeaders: [
1367
+ {
1368
+ value: response.headers.get("etag"),
1369
+ key: "etag",
1370
+ dataType: "string"
1371
+ },
1372
+ {
1373
+ value: response.headers.get("opc-request-id"),
1374
+ key: "opcRequestId",
1375
+ dataType: "string"
1376
+ }
1377
+ ]
1378
+ });
1379
+ return sdkResponse;
1380
+ }
1381
+ catch (err) {
1382
+ throw err;
1383
+ }
1384
+ });
1385
+ }
1386
+ /**
1387
+ * Gets a list of ResourceAnchors.
1388
+ *
1389
+ * This operation uses {@link common.OciSdkDefaultRetryConfiguration} by default if no retry configuration is defined by the user.
1390
+ * @param ListResourceAnchorsRequest
1391
+ * @return ListResourceAnchorsResponse
1392
+ * @throws OciError when an error occurs
1393
+ * @example Click {@link https://docs.oracle.com/en-us/iaas/tools/typescript-sdk-examples/latest/multicloud/ListResourceAnchors.ts.html |here} to see how to use ListResourceAnchors API.
1394
+ */
1395
+ listResourceAnchors(listResourceAnchorsRequest) {
1396
+ return __awaiter(this, void 0, void 0, function* () {
1397
+ if (this.logger)
1398
+ this.logger.debug("Calling operation OmhubResourceAnchorClient#listResourceAnchors.");
1399
+ const operationName = "listResourceAnchors";
1400
+ const apiReferenceLink = "";
1401
+ const pathParams = {};
1402
+ const queryParams = {
1403
+ "compartmentId": listResourceAnchorsRequest.compartmentId,
1404
+ "linkedCompartmentId": listResourceAnchorsRequest.linkedCompartmentId,
1405
+ "lifecycleState": listResourceAnchorsRequest.lifecycleState,
1406
+ "displayName": listResourceAnchorsRequest.displayName,
1407
+ "id": listResourceAnchorsRequest.id,
1408
+ "limit": listResourceAnchorsRequest.limit,
1409
+ "page": listResourceAnchorsRequest.page,
1410
+ "sortOrder": listResourceAnchorsRequest.sortOrder,
1411
+ "sortBy": listResourceAnchorsRequest.sortBy,
1412
+ "isCompartmentIdInSubtree": listResourceAnchorsRequest.isCompartmentIdInSubtree,
1413
+ "subscriptionServiceName": listResourceAnchorsRequest.subscriptionServiceName,
1414
+ "subscriptionId": listResourceAnchorsRequest.subscriptionId
1415
+ };
1416
+ let headerParams = {
1417
+ "Content-Type": common.Constants.APPLICATION_JSON,
1418
+ "opc-request-id": listResourceAnchorsRequest.opcRequestId
1419
+ };
1420
+ const specRetryConfiguration = common.OciSdkDefaultRetryConfiguration;
1421
+ const retrier = oci_common_1.GenericRetrier.createPreferredRetrier(this._clientConfiguration ? this._clientConfiguration.retryConfiguration : undefined, listResourceAnchorsRequest.retryConfiguration, specRetryConfiguration);
1422
+ if (this.logger)
1423
+ retrier.logger = this.logger;
1424
+ const request = yield oci_common_1.composeRequest({
1425
+ baseEndpoint: this._endpoint,
1426
+ defaultHeaders: this._defaultHeaders,
1427
+ path: "/resourceAnchors",
1428
+ method: "GET",
1429
+ pathParams: pathParams,
1430
+ headerParams: headerParams,
1431
+ queryParams: queryParams
1432
+ });
1433
+ try {
1434
+ const response = yield retrier.makeServiceCall(this._httpClient, request, this.targetService, operationName, apiReferenceLink);
1435
+ const sdkResponse = oci_common_1.composeResponse({
1436
+ responseObject: {},
1437
+ body: yield response.json(),
1438
+ bodyKey: "resourceAnchorCollection",
1439
+ bodyModel: model.ResourceAnchorCollection,
1440
+ type: "model.ResourceAnchorCollection",
1441
+ responseHeaders: [
1442
+ {
1443
+ value: response.headers.get("opc-request-id"),
1444
+ key: "opcRequestId",
1445
+ dataType: "string"
1446
+ },
1447
+ {
1448
+ value: response.headers.get("opc-next-page"),
1449
+ key: "opcNextPage",
1450
+ dataType: "string"
1451
+ }
1452
+ ]
1453
+ });
1454
+ return sdkResponse;
1455
+ }
1456
+ catch (err) {
1457
+ throw err;
1458
+ }
1459
+ });
1460
+ }
1461
+ }
1462
+ exports.OmhubResourceAnchorClient = OmhubResourceAnchorClient;
1463
+ OmhubResourceAnchorClient.serviceEndpointTemplate = "https://multicloud.{region}.oci.{secondLevelDomain}";
1464
+ OmhubResourceAnchorClient.endpointServiceName = "";
1465
+ //# sourceMappingURL=client.js.map