@azure/arm-hybridkubernetes 2.1.1-alpha.20250327.1 → 3.0.0-beta.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 (157) hide show
  1. package/CHANGELOG.md +52 -8
  2. package/LICENSE +1 -1
  3. package/README.md +6 -7
  4. package/dist/browser/connectedKubernetesClient.d.ts +5 -4
  5. package/dist/browser/connectedKubernetesClient.d.ts.map +1 -1
  6. package/dist/browser/connectedKubernetesClient.js +16 -19
  7. package/dist/browser/connectedKubernetesClient.js.map +1 -1
  8. package/dist/browser/lroImpl.d.ts +7 -12
  9. package/dist/browser/lroImpl.d.ts.map +1 -1
  10. package/dist/browser/lroImpl.js +11 -15
  11. package/dist/browser/lroImpl.js.map +1 -1
  12. package/dist/browser/models/index.d.ts +282 -57
  13. package/dist/browser/models/index.d.ts.map +1 -1
  14. package/dist/browser/models/index.js +36 -0
  15. package/dist/browser/models/index.js.map +1 -1
  16. package/dist/browser/models/mappers.d.ts +12 -1
  17. package/dist/browser/models/mappers.d.ts.map +1 -1
  18. package/dist/browser/models/mappers.js +631 -221
  19. package/dist/browser/models/mappers.js.map +1 -1
  20. package/dist/browser/models/parameters.d.ts +1 -1
  21. package/dist/browser/models/parameters.d.ts.map +1 -1
  22. package/dist/browser/models/parameters.js +31 -31
  23. package/dist/browser/models/parameters.js.map +1 -1
  24. package/dist/browser/operations/connectedClusterOperations.d.ts +12 -12
  25. package/dist/browser/operations/connectedClusterOperations.d.ts.map +1 -1
  26. package/dist/browser/operations/connectedClusterOperations.js +80 -82
  27. package/dist/browser/operations/connectedClusterOperations.js.map +1 -1
  28. package/dist/browser/operations/operations.d.ts +4 -4
  29. package/dist/browser/operations/operations.d.ts.map +1 -1
  30. package/dist/browser/operations/operations.js +9 -10
  31. package/dist/browser/operations/operations.js.map +1 -1
  32. package/dist/browser/operationsInterfaces/connectedClusterOperations.d.ts +10 -10
  33. package/dist/browser/operationsInterfaces/connectedClusterOperations.d.ts.map +1 -1
  34. package/dist/browser/operationsInterfaces/connectedClusterOperations.js.map +1 -1
  35. package/dist/browser/operationsInterfaces/operations.d.ts +2 -2
  36. package/dist/browser/operationsInterfaces/operations.d.ts.map +1 -1
  37. package/dist/browser/operationsInterfaces/operations.js.map +1 -1
  38. package/dist/browser/pagingHelper.d.ts +4 -4
  39. package/dist/browser/pagingHelper.d.ts.map +1 -1
  40. package/dist/browser/pagingHelper.js +4 -4
  41. package/dist/browser/pagingHelper.js.map +1 -1
  42. package/dist/commonjs/connectedKubernetesClient.d.ts +5 -4
  43. package/dist/commonjs/connectedKubernetesClient.d.ts.map +1 -1
  44. package/dist/commonjs/connectedKubernetesClient.js +16 -19
  45. package/dist/commonjs/connectedKubernetesClient.js.map +1 -1
  46. package/dist/commonjs/lroImpl.d.ts +7 -12
  47. package/dist/commonjs/lroImpl.d.ts.map +1 -1
  48. package/dist/commonjs/lroImpl.js +12 -17
  49. package/dist/commonjs/lroImpl.js.map +1 -1
  50. package/dist/commonjs/models/index.d.ts +282 -57
  51. package/dist/commonjs/models/index.d.ts.map +1 -1
  52. package/dist/commonjs/models/index.js +37 -1
  53. package/dist/commonjs/models/index.js.map +1 -1
  54. package/dist/commonjs/models/mappers.d.ts +12 -1
  55. package/dist/commonjs/models/mappers.d.ts.map +1 -1
  56. package/dist/commonjs/models/mappers.js +632 -222
  57. package/dist/commonjs/models/mappers.js.map +1 -1
  58. package/dist/commonjs/models/parameters.d.ts +1 -1
  59. package/dist/commonjs/models/parameters.d.ts.map +1 -1
  60. package/dist/commonjs/models/parameters.js +30 -30
  61. package/dist/commonjs/models/parameters.js.map +1 -1
  62. package/dist/commonjs/operations/connectedClusterOperations.d.ts +12 -12
  63. package/dist/commonjs/operations/connectedClusterOperations.d.ts.map +1 -1
  64. package/dist/commonjs/operations/connectedClusterOperations.js +78 -80
  65. package/dist/commonjs/operations/connectedClusterOperations.js.map +1 -1
  66. package/dist/commonjs/operations/operations.d.ts +4 -4
  67. package/dist/commonjs/operations/operations.d.ts.map +1 -1
  68. package/dist/commonjs/operations/operations.js +9 -10
  69. package/dist/commonjs/operations/operations.js.map +1 -1
  70. package/dist/commonjs/operationsInterfaces/connectedClusterOperations.d.ts +10 -10
  71. package/dist/commonjs/operationsInterfaces/connectedClusterOperations.d.ts.map +1 -1
  72. package/dist/commonjs/operationsInterfaces/connectedClusterOperations.js.map +1 -1
  73. package/dist/commonjs/operationsInterfaces/operations.d.ts +2 -2
  74. package/dist/commonjs/operationsInterfaces/operations.d.ts.map +1 -1
  75. package/dist/commonjs/operationsInterfaces/operations.js.map +1 -1
  76. package/dist/commonjs/pagingHelper.d.ts +4 -4
  77. package/dist/commonjs/pagingHelper.d.ts.map +1 -1
  78. package/dist/commonjs/pagingHelper.js +4 -4
  79. package/dist/commonjs/pagingHelper.js.map +1 -1
  80. package/dist/esm/connectedKubernetesClient.d.ts +5 -4
  81. package/dist/esm/connectedKubernetesClient.d.ts.map +1 -1
  82. package/dist/esm/connectedKubernetesClient.js +16 -19
  83. package/dist/esm/connectedKubernetesClient.js.map +1 -1
  84. package/dist/esm/lroImpl.d.ts +7 -12
  85. package/dist/esm/lroImpl.d.ts.map +1 -1
  86. package/dist/esm/lroImpl.js +11 -15
  87. package/dist/esm/lroImpl.js.map +1 -1
  88. package/dist/esm/models/index.d.ts +282 -57
  89. package/dist/esm/models/index.d.ts.map +1 -1
  90. package/dist/esm/models/index.js +36 -0
  91. package/dist/esm/models/index.js.map +1 -1
  92. package/dist/esm/models/mappers.d.ts +12 -1
  93. package/dist/esm/models/mappers.d.ts.map +1 -1
  94. package/dist/esm/models/mappers.js +631 -221
  95. package/dist/esm/models/mappers.js.map +1 -1
  96. package/dist/esm/models/parameters.d.ts +1 -1
  97. package/dist/esm/models/parameters.d.ts.map +1 -1
  98. package/dist/esm/models/parameters.js +31 -31
  99. package/dist/esm/models/parameters.js.map +1 -1
  100. package/dist/esm/operations/connectedClusterOperations.d.ts +12 -12
  101. package/dist/esm/operations/connectedClusterOperations.d.ts.map +1 -1
  102. package/dist/esm/operations/connectedClusterOperations.js +80 -82
  103. package/dist/esm/operations/connectedClusterOperations.js.map +1 -1
  104. package/dist/esm/operations/operations.d.ts +4 -4
  105. package/dist/esm/operations/operations.d.ts.map +1 -1
  106. package/dist/esm/operations/operations.js +9 -10
  107. package/dist/esm/operations/operations.js.map +1 -1
  108. package/dist/esm/operationsInterfaces/connectedClusterOperations.d.ts +10 -10
  109. package/dist/esm/operationsInterfaces/connectedClusterOperations.d.ts.map +1 -1
  110. package/dist/esm/operationsInterfaces/connectedClusterOperations.js.map +1 -1
  111. package/dist/esm/operationsInterfaces/operations.d.ts +2 -2
  112. package/dist/esm/operationsInterfaces/operations.d.ts.map +1 -1
  113. package/dist/esm/operationsInterfaces/operations.js.map +1 -1
  114. package/dist/esm/pagingHelper.d.ts +4 -4
  115. package/dist/esm/pagingHelper.d.ts.map +1 -1
  116. package/dist/esm/pagingHelper.js +4 -4
  117. package/dist/esm/pagingHelper.js.map +1 -1
  118. package/dist/react-native/connectedKubernetesClient.d.ts +5 -4
  119. package/dist/react-native/connectedKubernetesClient.d.ts.map +1 -1
  120. package/dist/react-native/connectedKubernetesClient.js +16 -19
  121. package/dist/react-native/connectedKubernetesClient.js.map +1 -1
  122. package/dist/react-native/lroImpl.d.ts +7 -12
  123. package/dist/react-native/lroImpl.d.ts.map +1 -1
  124. package/dist/react-native/lroImpl.js +11 -15
  125. package/dist/react-native/lroImpl.js.map +1 -1
  126. package/dist/react-native/models/index.d.ts +282 -57
  127. package/dist/react-native/models/index.d.ts.map +1 -1
  128. package/dist/react-native/models/index.js +36 -0
  129. package/dist/react-native/models/index.js.map +1 -1
  130. package/dist/react-native/models/mappers.d.ts +12 -1
  131. package/dist/react-native/models/mappers.d.ts.map +1 -1
  132. package/dist/react-native/models/mappers.js +631 -221
  133. package/dist/react-native/models/mappers.js.map +1 -1
  134. package/dist/react-native/models/parameters.d.ts +1 -1
  135. package/dist/react-native/models/parameters.d.ts.map +1 -1
  136. package/dist/react-native/models/parameters.js +31 -31
  137. package/dist/react-native/models/parameters.js.map +1 -1
  138. package/dist/react-native/operations/connectedClusterOperations.d.ts +12 -12
  139. package/dist/react-native/operations/connectedClusterOperations.d.ts.map +1 -1
  140. package/dist/react-native/operations/connectedClusterOperations.js +80 -82
  141. package/dist/react-native/operations/connectedClusterOperations.js.map +1 -1
  142. package/dist/react-native/operations/operations.d.ts +4 -4
  143. package/dist/react-native/operations/operations.d.ts.map +1 -1
  144. package/dist/react-native/operations/operations.js +9 -10
  145. package/dist/react-native/operations/operations.js.map +1 -1
  146. package/dist/react-native/operationsInterfaces/connectedClusterOperations.d.ts +10 -10
  147. package/dist/react-native/operationsInterfaces/connectedClusterOperations.d.ts.map +1 -1
  148. package/dist/react-native/operationsInterfaces/connectedClusterOperations.js.map +1 -1
  149. package/dist/react-native/operationsInterfaces/operations.d.ts +2 -2
  150. package/dist/react-native/operationsInterfaces/operations.d.ts.map +1 -1
  151. package/dist/react-native/operationsInterfaces/operations.js.map +1 -1
  152. package/dist/react-native/pagingHelper.d.ts +4 -4
  153. package/dist/react-native/pagingHelper.d.ts.map +1 -1
  154. package/dist/react-native/pagingHelper.js +4 -4
  155. package/dist/react-native/pagingHelper.js.map +1 -1
  156. package/package.json +35 -34
  157. package/review/arm-hybridkubernetes.api.md +156 -23
package/CHANGELOG.md CHANGED
@@ -1,15 +1,59 @@
1
1
  # Release History
2
-
3
- ## 2.1.1 (Unreleased)
4
-
2
+
3
+ ## 3.0.0-beta.1 (2025-03-28)
4
+ Compared with version 2.1.0
5
+
5
6
  ### Features Added
6
7
 
7
- ### Breaking Changes
8
+ - Added operation ConnectedClusterOperations.beginCreateOrReplace
9
+ - Added operation ConnectedClusterOperations.beginCreateOrReplaceAndWait
10
+ - Added Interface AadProfile
11
+ - Added Interface AgentError
12
+ - Added Interface ArcAgentProfile
13
+ - Added Interface ArcAgentryConfigurations
14
+ - Added Interface ConnectedClusterCreateOrReplaceOptionalParams
15
+ - Added Interface ConnectedClusterPatchProperties
16
+ - Added Interface ConnectedClusterProperties
17
+ - Added Interface Gateway
18
+ - Added Interface OidcIssuerProfile
19
+ - Added Interface SecurityProfile
20
+ - Added Interface SecurityProfileWorkloadIdentity
21
+ - Added Interface SystemComponent
22
+ - Added Type Alias AutoUpgradeOptions
23
+ - Added Type Alias AzureHybridBenefit
24
+ - Added Type Alias ConnectedClusterCreateOrReplaceResponse
25
+ - Added Type Alias ConnectedClusterKind
26
+ - Added Type Alias PrivateLinkState
27
+ - Interface ConnectedCluster has a new optional parameter kind
28
+ - Interface HybridConnectionConfig has a new optional parameter relayTid
29
+ - Interface HybridConnectionConfig has a new optional parameter relayType
30
+ - Added Enum KnownAutoUpgradeOptions
31
+ - Added Enum KnownAzureHybridBenefit
32
+ - Added Enum KnownConnectedClusterKind
33
+ - Added Enum KnownPrivateLinkState
34
+ - Enum KnownConnectivityStatus has a new value AgentNotInstalled
8
35
 
9
- ### Bugs Fixed
10
-
11
- ### Other Changes
36
+ ### Breaking Changes
12
37
 
38
+ - Removed operation ConnectedClusterOperations.beginCreate
39
+ - Removed operation ConnectedClusterOperations.beginCreateAndWait
40
+ - Class ConnectedKubernetesClient has a new signature
41
+ - Interface ConnectedCluster no longer has parameter agentPublicKeyCertificate
42
+ - Interface ConnectedCluster no longer has parameter agentVersion
43
+ - Interface ConnectedCluster no longer has parameter connectivityStatus
44
+ - Interface ConnectedCluster no longer has parameter distribution
45
+ - Interface ConnectedCluster no longer has parameter infrastructure
46
+ - Interface ConnectedCluster no longer has parameter kubernetesVersion
47
+ - Interface ConnectedCluster no longer has parameter lastConnectivityTime
48
+ - Interface ConnectedCluster no longer has parameter managedIdentityCertificateExpirationTime
49
+ - Interface ConnectedCluster no longer has parameter offering
50
+ - Interface ConnectedCluster no longer has parameter provisioningState
51
+ - Interface ConnectedCluster no longer has parameter totalCoreCount
52
+ - Interface ConnectedCluster no longer has parameter totalNodeCount
53
+ - Interface ConnectedCluster has a new required parameter properties
54
+ - Type of parameter properties of interface ConnectedClusterPatch is changed from Record<string, unknown> to ConnectedClusterPatchProperties
55
+
56
+
13
57
  ## 2.1.0 (2022-11-25)
14
58
 
15
59
  ### Features Added
@@ -31,4 +75,4 @@ To understand the detail of the change, please refer to [Changelog](https://aka.
31
75
 
32
76
  To migrate the existing applications to the latest version, please refer to [Migration Guide](https://aka.ms/js-track2-migration-guide).
33
77
 
34
- To learn more, please refer to our documentation [Quick Start](https://aka.ms/azsdk/js/mgmt/quickstart ).
78
+ To learn more, please refer to our documentation [Quick Start](https://aka.ms/azsdk/js/mgmt/quickstart).
package/LICENSE CHANGED
@@ -18,4 +18,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
18
  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
19
  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
20
  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
21
+ SOFTWARE.
package/README.md CHANGED
@@ -2,11 +2,11 @@
2
2
 
3
3
  This package contains an isomorphic SDK (runs both in Node.js and in browsers) for Azure ConnectedKubernetes client.
4
4
 
5
- Azure Connected Cluster Resource Provider API for adopting any Kubernetes Cluster
5
+ Azure Connected Cluster Resource Provider API for onboarding a Kubernetes Cluster to Azure Arc
6
6
 
7
7
  [Source code](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/hybridkubernetes/arm-hybridkubernetes) |
8
8
  [Package (NPM)](https://www.npmjs.com/package/@azure/arm-hybridkubernetes) |
9
- [API reference documentation](https://learn.microsoft.com/javascript/api/@azure/arm-hybridkubernetes) |
9
+ [API reference documentation](https://learn.microsoft.com/javascript/api/@azure/arm-hybridkubernetes?view=azure-node-preview) |
10
10
  [Samples](https://github.com/Azure-Samples/azure-samples-js-management)
11
11
 
12
12
  ## Getting started
@@ -44,7 +44,6 @@ npm install @azure/identity
44
44
  ```
45
45
 
46
46
  You will also need to **register a new AAD application and grant access to Azure ConnectedKubernetes** by assigning the suitable role to your service principal (note: roles such as `"Owner"` will not grant the necessary permissions).
47
- Set the values of the client ID, tenant ID, and client secret of the AAD application as environment variables: `AZURE_CLIENT_ID`, `AZURE_TENANT_ID`, `AZURE_CLIENT_SECRET`.
48
47
 
49
48
  For more information about how to create an Azure AD Application check out [this guide](https://learn.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal).
50
49
 
@@ -64,16 +63,15 @@ For browser environments, use the `InteractiveBrowserCredential` from the `@azur
64
63
  import { InteractiveBrowserCredential } from "@azure/identity";
65
64
  import { ConnectedKubernetesClient } from "@azure/arm-hybridkubernetes";
66
65
 
67
- const subscriptionId = "00000000-0000-0000-0000-000000000000";
68
66
  const credential = new InteractiveBrowserCredential({
69
67
  tenantId: "<YOUR_TENANT_ID>",
70
- clientId: "<YOUR_CLIENT_ID>",
71
- });
68
+ clientId: "<YOUR_CLIENT_ID>"
69
+ });
70
+ const subscriptionId = "00000000-0000-0000-0000-000000000000";
72
71
  const client = new ConnectedKubernetesClient(credential, subscriptionId);
73
72
  ```
74
73
 
75
74
  ### JavaScript Bundle
76
-
77
75
  To use this client library in the browser, first you need to use a bundler. For details on how to do this, please refer to our [bundling documentation](https://aka.ms/AzureSDKBundling).
78
76
 
79
77
  ## Key concepts
@@ -108,6 +106,7 @@ If you'd like to contribute to this library, please read the [contributing guide
108
106
 
109
107
  - [Microsoft Azure SDK for JavaScript](https://github.com/Azure/azure-sdk-for-js)
110
108
 
109
+
111
110
  [azure_cli]: https://learn.microsoft.com/cli/azure
112
111
  [azure_sub]: https://azure.microsoft.com/free/
113
112
  [azure_sub]: https://azure.microsoft.com/free/
@@ -1,11 +1,11 @@
1
1
  import * as coreClient from "@azure/core-client";
2
- import * as coreAuth from "@azure/core-auth";
3
- import { ConnectedClusterOperations, Operations } from "./operationsInterfaces/index.js";
4
- import { ConnectedKubernetesClientOptionalParams } from "./models/index.js";
2
+ import type * as coreAuth from "@azure/core-auth";
3
+ import type { ConnectedClusterOperations, Operations } from "./operationsInterfaces/index.js";
4
+ import type { ConnectedKubernetesClientOptionalParams } from "./models/index.js";
5
5
  export declare class ConnectedKubernetesClient extends coreClient.ServiceClient {
6
6
  $host: string;
7
7
  apiVersion: string;
8
- subscriptionId: string;
8
+ subscriptionId?: string;
9
9
  /**
10
10
  * Initializes a new instance of the ConnectedKubernetesClient class.
11
11
  * @param credentials Subscription credentials which uniquely identify client subscription.
@@ -13,6 +13,7 @@ export declare class ConnectedKubernetesClient extends coreClient.ServiceClient
13
13
  * @param options The parameter options
14
14
  */
15
15
  constructor(credentials: coreAuth.TokenCredential, subscriptionId: string, options?: ConnectedKubernetesClientOptionalParams);
16
+ constructor(credentials: coreAuth.TokenCredential, options?: ConnectedKubernetesClientOptionalParams);
16
17
  /** A function that adds a policy that sets the api-version (or equivalent) to reflect the library version. */
17
18
  private addCustomApiVersionPolicy;
18
19
  connectedClusterOperations: ConnectedClusterOperations;
@@ -1 +1 @@
1
- {"version":3,"file":"connectedKubernetesClient.d.ts","sourceRoot":"","sources":["../../src/connectedKubernetesClient.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,UAAU,MAAM,oBAAoB,CAAC;AAOjD,OAAO,KAAK,QAAQ,MAAM,kBAAkB,CAAC;AAE7C,OAAO,EAAE,0BAA0B,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAC;AACzF,OAAO,EAAE,uCAAuC,EAAE,MAAM,mBAAmB,CAAC;AAE5E,qBAAa,yBAA0B,SAAQ,UAAU,CAAC,aAAa;IACrE,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;IACnB,cAAc,EAAE,MAAM,CAAC;IAEvB;;;;;OAKG;gBAED,WAAW,EAAE,QAAQ,CAAC,eAAe,EACrC,cAAc,EAAE,MAAM,EACtB,OAAO,CAAC,EAAE,uCAAuC;IA6EnD,8GAA8G;IAC9G,OAAO,CAAC,yBAAyB;IA2BjC,0BAA0B,EAAE,0BAA0B,CAAC;IACvD,UAAU,EAAE,UAAU,CAAC;CACxB"}
1
+ {"version":3,"file":"connectedKubernetesClient.d.ts","sourceRoot":"","sources":["../../src/connectedKubernetesClient.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,UAAU,MAAM,oBAAoB,CAAC;AAGjD,OAAO,KAAK,KAAK,QAAQ,MAAM,kBAAkB,CAAC;AAElD,OAAO,KAAK,EAAE,0BAA0B,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAC9F,OAAO,KAAK,EAAE,uCAAuC,EAAE,MAAM,mBAAmB,CAAC;AAEjF,qBAAa,yBAA0B,SAAQ,UAAU,CAAC,aAAa;IACrE,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;IACnB,cAAc,CAAC,EAAE,MAAM,CAAC;IAExB;;;;;OAKG;gBAED,WAAW,EAAE,QAAQ,CAAC,eAAe,EACrC,cAAc,EAAE,MAAM,EACtB,OAAO,CAAC,EAAE,uCAAuC;gBAGjD,WAAW,EAAE,QAAQ,CAAC,eAAe,EACrC,OAAO,CAAC,EAAE,uCAAuC;IAoFnD,8GAA8G;IAC9G,OAAO,CAAC,yBAAyB;IAwBjC,0BAA0B,EAAE,0BAA0B,CAAC;IACvD,UAAU,EAAE,UAAU,CAAC;CACxB"}
@@ -9,19 +9,17 @@ import * as coreClient from "@azure/core-client";
9
9
  import * as coreRestPipeline from "@azure/core-rest-pipeline";
10
10
  import { ConnectedClusterOperationsImpl, OperationsImpl } from "./operations/index.js";
11
11
  export class ConnectedKubernetesClient extends coreClient.ServiceClient {
12
- /**
13
- * Initializes a new instance of the ConnectedKubernetesClient class.
14
- * @param credentials Subscription credentials which uniquely identify client subscription.
15
- * @param subscriptionId The ID of the target subscription.
16
- * @param options The parameter options
17
- */
18
- constructor(credentials, subscriptionId, options) {
12
+ constructor(credentials, subscriptionIdOrOptions, options) {
19
13
  var _a, _b, _c;
20
14
  if (credentials === undefined) {
21
15
  throw new Error("'credentials' cannot be null");
22
16
  }
23
- if (subscriptionId === undefined) {
24
- throw new Error("'subscriptionId' cannot be null");
17
+ let subscriptionId;
18
+ if (typeof subscriptionIdOrOptions === "string") {
19
+ subscriptionId = subscriptionIdOrOptions;
20
+ }
21
+ else if (typeof subscriptionIdOrOptions === "object") {
22
+ options = subscriptionIdOrOptions;
25
23
  }
26
24
  // Initializing default values for options
27
25
  if (!options) {
@@ -29,42 +27,41 @@ export class ConnectedKubernetesClient extends coreClient.ServiceClient {
29
27
  }
30
28
  const defaults = {
31
29
  requestContentType: "application/json; charset=utf-8",
32
- credential: credentials
30
+ credential: credentials,
33
31
  };
34
- const packageDetails = `azsdk-js-arm-hybridkubernetes/2.1.1`;
32
+ const packageDetails = `azsdk-js-arm-hybridkubernetes/3.0.0-beta.1`;
35
33
  const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix
36
34
  ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`
37
35
  : `${packageDetails}`;
38
36
  const optionsWithDefaults = Object.assign(Object.assign(Object.assign({}, defaults), options), { userAgentOptions: {
39
- userAgentPrefix
37
+ userAgentPrefix,
40
38
  }, endpoint: (_b = (_a = options.endpoint) !== null && _a !== void 0 ? _a : options.baseUri) !== null && _b !== void 0 ? _b : "https://management.azure.com" });
41
39
  super(optionsWithDefaults);
42
40
  let bearerTokenAuthenticationPolicyFound = false;
43
41
  if ((options === null || options === void 0 ? void 0 : options.pipeline) && options.pipeline.getOrderedPolicies().length > 0) {
44
42
  const pipelinePolicies = options.pipeline.getOrderedPolicies();
45
- bearerTokenAuthenticationPolicyFound = pipelinePolicies.some((pipelinePolicy) => pipelinePolicy.name ===
46
- coreRestPipeline.bearerTokenAuthenticationPolicyName);
43
+ bearerTokenAuthenticationPolicyFound = pipelinePolicies.some((pipelinePolicy) => pipelinePolicy.name === coreRestPipeline.bearerTokenAuthenticationPolicyName);
47
44
  }
48
45
  if (!options ||
49
46
  !options.pipeline ||
50
47
  options.pipeline.getOrderedPolicies().length == 0 ||
51
48
  !bearerTokenAuthenticationPolicyFound) {
52
49
  this.pipeline.removePolicy({
53
- name: coreRestPipeline.bearerTokenAuthenticationPolicyName
50
+ name: coreRestPipeline.bearerTokenAuthenticationPolicyName,
54
51
  });
55
52
  this.pipeline.addPolicy(coreRestPipeline.bearerTokenAuthenticationPolicy({
56
53
  credential: credentials,
57
54
  scopes: (_c = optionsWithDefaults.credentialScopes) !== null && _c !== void 0 ? _c : `${optionsWithDefaults.endpoint}/.default`,
58
55
  challengeCallbacks: {
59
- authorizeRequestOnChallenge: coreClient.authorizeRequestOnClaimChallenge
60
- }
56
+ authorizeRequestOnChallenge: coreClient.authorizeRequestOnClaimChallenge,
57
+ },
61
58
  }));
62
59
  }
63
60
  // Parameter assignments
64
61
  this.subscriptionId = subscriptionId;
65
62
  // Assigning values to Constant parameters
66
63
  this.$host = options.$host || "https://management.azure.com";
67
- this.apiVersion = options.apiVersion || "2021-10-01";
64
+ this.apiVersion = options.apiVersion || "2024-12-01-preview";
68
65
  this.connectedClusterOperations = new ConnectedClusterOperationsImpl(this);
69
66
  this.operations = new OperationsImpl(this);
70
67
  this.addCustomApiVersionPolicy(options.apiVersion);
@@ -90,7 +87,7 @@ export class ConnectedKubernetesClient extends coreClient.ServiceClient {
90
87
  request.url = param[0] + "?" + newParams.join("&");
91
88
  }
92
89
  return next(request);
93
- }
90
+ },
94
91
  };
95
92
  this.pipeline.addPolicy(apiVersionPolicy);
96
93
  }
@@ -1 +1 @@
1
- {"version":3,"file":"connectedKubernetesClient.js","sourceRoot":"","sources":["../../src/connectedKubernetesClient.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,UAAU,MAAM,oBAAoB,CAAC;AACjD,OAAO,KAAK,gBAAgB,MAAM,2BAA2B,CAAC;AAO9D,OAAO,EAAE,8BAA8B,EAAE,cAAc,EAAE,MAAM,uBAAuB,C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AM,gBAAgB,GAAG;YACvB,IAAI,EAAE,wBAAwB;YAC9B,KAAK,CAAC,WAAW,CACf,OAAwB,EACxB,IAAiB;gBAEjB,MAAM,KAAK,GAAG,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;gBACrC,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;oBACrB,MAAM,SAAS,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE;wBACjD,IAAI,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC;4BACrC,OAAO,cAAc,GAAG,UAAU,CAAC;wBACrC,CAAC;6BAAM,CAAC;4BACN,OAAO,IAAI,CAAC;wBACd,CAAC;oBACH,CAAC,CAAC,CAAC;oBACH,OAAO,CAAC,GAAG,GAAG,KAAK,CAAC,CAAC,CAAC,GAAG,GAAG,GAAG,SAAS,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;gBACrD,CAAC;gBACD,OAAO,IAAI,CAAC,OAAO,CAAC,CAAC;YACvB,CAAC;SACF,CAAC;QACF,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,gBAAgB,CAAC,CAAC;IAC5C,CAAC;CAIF","sourcesContent":["/*\n * Copyright (c) Microsoft Corporation.\n * Licensed under the MIT License.\n *\n * Code generated by Microsoft (R) AutoRest Code Generator.\n * Changes may cause incorrect behavior and will be lost if the code is regenerated.\n */\n\nimport * as coreClient from \"@azure/core-client\";\nimport * as coreRestPipeline from \"@azure/core-rest-pipeline\";\nimport {\n PipelineRequest,\n PipelineResponse,\n SendRequest\n} from \"@azure/core-rest-pipeline\";\nimport * as coreAuth from \"@azure/core-auth\";\nimport { ConnectedClusterOperationsImpl, OperationsImpl } from \"./operations/index.js\";\nimport { ConnectedClusterOperations, Operations } from \"./operationsInterfaces/index.js\";\nimport { ConnectedKubernetesClientOptionalParams } from \"./models/index.js\";\n\nexport class ConnectedKubernetesClient extends coreClient.ServiceClient {\n $host: string;\n apiVersion: string;\n subscriptionId: string;\n\n /**\n * Initializes a new instance of the ConnectedKubernetesClient class.\n * @param credentials Subscription credentials which uniquely identify client subscription.\n * @param subscriptionId The ID of the target subscription.\n * @param options The parameter options\n */\n constructor(\n credentials: coreAuth.TokenCredential,\n subscriptionId: string,\n options?: ConnectedKubernetesClientOptionalParams\n ) {\n if (credentials === undefined) {\n throw new Error(\"'credentials' cannot be null\");\n }\n if (subscriptionId === undefined) {\n throw new Error(\"'subscriptionId' cannot be null\");\n }\n\n // Initializing default values for options\n if (!options) {\n options = {};\n }\n const defaults: ConnectedKubernetesClientOptionalParams = {\n requestContentType: \"application/json; charset=utf-8\",\n credential: credentials\n };\n\n const packageDetails = `azsdk-js-arm-hybridkubernetes/2.1.1`;\n const userAgentPrefix =\n options.userAgentOptions && options.userAgentOptions.userAgentPrefix\n ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`\n : `${packageDetails}`;\n\n const optionsWithDefaults = {\n ...defaults,\n ...options,\n userAgentOptions: {\n userAgentPrefix\n },\n endpoint:\n options.endpoint ?? options.baseUri ?? \"https://management.azure.com\"\n };\n super(optionsWithDefaults);\n\n let bearerTokenAuthenticationPolicyFound: boolean = false;\n if (options?.pipeline && options.pipeline.getOrderedPolicies().length > 0) {\n const pipelinePolicies: coreRestPipeline.PipelinePolicy[] = options.pipeline.getOrderedPolicies();\n bearerTokenAuthenticationPolicyFound = pipelinePolicies.some(\n (pipelinePolicy) =>\n pipelinePolicy.name ===\n coreRestPipeline.bearerTokenAuthenticationPolicyName\n );\n }\n if (\n !options ||\n !options.pipeline ||\n options.pipeline.getOrderedPolicies().length == 0 ||\n !bearerTokenAuthenticationPolicyFound\n ) {\n this.pipeline.removePolicy({\n name: coreRestPipeline.bearerTokenAuthenticationPolicyName\n });\n this.pipeline.addPolicy(\n coreRestPipeline.bearerTokenAuthenticationPolicy({\n credential: credentials,\n scopes:\n optionsWithDefaults.credentialScopes ??\n `${optionsWithDefaults.endpoint}/.default`,\n challengeCallbacks: {\n authorizeRequestOnChallenge:\n coreClient.authorizeRequestOnClaimChallenge\n }\n })\n );\n }\n // Parameter assignments\n this.subscriptionId = subscriptionId;\n\n // Assigning values to Constant parameters\n this.$host = options.$host || \"https://management.azure.com\";\n this.apiVersion = options.apiVersion || \"2021-10-01\";\n this.connectedClusterOperations = new ConnectedClusterOperationsImpl(this);\n this.operations = new OperationsImpl(this);\n this.addCustomApiVersionPolicy(options.apiVersion);\n }\n\n /** A function that adds a policy that sets the api-version (or equivalent) to reflect the library version. */\n private addCustomApiVersionPolicy(apiVersion?: string) {\n if (!apiVersion) {\n return;\n }\n const apiVersionPolicy = {\n name: \"CustomApiVersionPolicy\",\n async sendRequest(\n request: PipelineRequest,\n next: SendRequest\n ): Promise<PipelineResponse> {\n const param = request.url.split(\"?\");\n if (param.length > 1) {\n const newParams = param[1].split(\"&\").map((item) => {\n if (item.indexOf(\"api-version\") > -1) {\n return \"api-version=\" + apiVersion;\n } else {\n return item;\n }\n });\n request.url = param[0] + \"?\" + newParams.join(\"&\");\n }\n return next(request);\n }\n };\n this.pipeline.addPolicy(apiVersionPolicy);\n }\n\n connectedClusterOperations: ConnectedClusterOperations;\n operations: Operations;\n}\n"]}
1
+ {"version":3,"file":"connectedKubernetesClient.js","sourceRoot":"","sources":["../../src/connectedKubernetesClient.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,UAAU,MAAM,oBAAoB,CAAC;AACjD,OAAO,KAAK,gBAAgB,MAAM,2BAA2B,CAAC;AAG9D,OAAO,EAAE,8BAA8B,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAIvF,MAAM,OAAO,yBAA0B,SAAQ,UAAU,CAAC,aAAa;IAoBrE,YACE,WAAqC,EACrC,uBAA0E,EAC1E,OAAiD;;QAEjD,IAAI,WAAW,KAAK,SAAS,EAAE,CAAC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C9B,KAAK,CAAC,WAAW,CAAC,OAAwB,EAAE,IAAiB;gBAC3D,MAAM,KAAK,GAAG,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;gBACrC,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;oBACrB,MAAM,SAAS,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE;wBACjD,IAAI,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC;4BACrC,OAAO,cAAc,GAAG,UAAU,CAAC;wBACrC,CAAC;6BAAM,CAAC;4BACN,OAAO,IAAI,CAAC;wBACd,CAAC;oBACH,CAAC,CAAC,CAAC;oBACH,OAAO,CAAC,GAAG,GAAG,KAAK,CAAC,CAAC,CAAC,GAAG,GAAG,GAAG,SAAS,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;gBACrD,CAAC;gBACD,OAAO,IAAI,CAAC,OAAO,CAAC,CAAC;YACvB,CAAC;SACF,CAAC;QACF,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,gBAAgB,CAAC,CAAC;IAC5C,CAAC;CAIF","sourcesContent":["/*\n * Copyright (c) Microsoft Corporation.\n * Licensed under the MIT License.\n *\n * Code generated by Microsoft (R) AutoRest Code Generator.\n * Changes may cause incorrect behavior and will be lost if the code is regenerated.\n */\n\nimport * as coreClient from \"@azure/core-client\";\nimport * as coreRestPipeline from \"@azure/core-rest-pipeline\";\nimport type { PipelineRequest, PipelineResponse, SendRequest } from \"@azure/core-rest-pipeline\";\nimport type * as coreAuth from \"@azure/core-auth\";\nimport { ConnectedClusterOperationsImpl, OperationsImpl } from \"./operations/index.js\";\nimport type { ConnectedClusterOperations, Operations } from \"./operationsInterfaces/index.js\";\nimport type { ConnectedKubernetesClientOptionalParams } from \"./models/index.js\";\n\nexport class ConnectedKubernetesClient extends coreClient.ServiceClient {\n $host: string;\n apiVersion: string;\n subscriptionId?: string;\n\n /**\n * Initializes a new instance of the ConnectedKubernetesClient class.\n * @param credentials Subscription credentials which uniquely identify client subscription.\n * @param subscriptionId The ID of the target subscription.\n * @param options The parameter options\n */\n constructor(\n credentials: coreAuth.TokenCredential,\n subscriptionId: string,\n options?: ConnectedKubernetesClientOptionalParams,\n );\n constructor(\n credentials: coreAuth.TokenCredential,\n options?: ConnectedKubernetesClientOptionalParams,\n );\n constructor(\n credentials: coreAuth.TokenCredential,\n subscriptionIdOrOptions?: ConnectedKubernetesClientOptionalParams | string,\n options?: ConnectedKubernetesClientOptionalParams,\n ) {\n if (credentials === undefined) {\n throw new Error(\"'credentials' cannot be null\");\n }\n\n let subscriptionId: string | undefined;\n\n if (typeof subscriptionIdOrOptions === \"string\") {\n subscriptionId = subscriptionIdOrOptions;\n } else if (typeof subscriptionIdOrOptions === \"object\") {\n options = subscriptionIdOrOptions;\n }\n\n // Initializing default values for options\n if (!options) {\n options = {};\n }\n const defaults: ConnectedKubernetesClientOptionalParams = {\n requestContentType: \"application/json; charset=utf-8\",\n credential: credentials,\n };\n\n const packageDetails = `azsdk-js-arm-hybridkubernetes/3.0.0-beta.1`;\n const userAgentPrefix =\n options.userAgentOptions && options.userAgentOptions.userAgentPrefix\n ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`\n : `${packageDetails}`;\n\n const optionsWithDefaults = {\n ...defaults,\n ...options,\n userAgentOptions: {\n userAgentPrefix,\n },\n endpoint: options.endpoint ?? options.baseUri ?? \"https://management.azure.com\",\n };\n super(optionsWithDefaults);\n\n let bearerTokenAuthenticationPolicyFound: boolean = false;\n if (options?.pipeline && options.pipeline.getOrderedPolicies().length > 0) {\n const pipelinePolicies: coreRestPipeline.PipelinePolicy[] =\n options.pipeline.getOrderedPolicies();\n bearerTokenAuthenticationPolicyFound = pipelinePolicies.some(\n (pipelinePolicy) =>\n pipelinePolicy.name === coreRestPipeline.bearerTokenAuthenticationPolicyName,\n );\n }\n if (\n !options ||\n !options.pipeline ||\n options.pipeline.getOrderedPolicies().length == 0 ||\n !bearerTokenAuthenticationPolicyFound\n ) {\n this.pipeline.removePolicy({\n name: coreRestPipeline.bearerTokenAuthenticationPolicyName,\n });\n this.pipeline.addPolicy(\n coreRestPipeline.bearerTokenAuthenticationPolicy({\n credential: credentials,\n scopes:\n optionsWithDefaults.credentialScopes ?? `${optionsWithDefaults.endpoint}/.default`,\n challengeCallbacks: {\n authorizeRequestOnChallenge: coreClient.authorizeRequestOnClaimChallenge,\n },\n }),\n );\n }\n // Parameter assignments\n this.subscriptionId = subscriptionId;\n\n // Assigning values to Constant parameters\n this.$host = options.$host || \"https://management.azure.com\";\n this.apiVersion = options.apiVersion || \"2024-12-01-preview\";\n this.connectedClusterOperations = new ConnectedClusterOperationsImpl(this);\n this.operations = new OperationsImpl(this);\n this.addCustomApiVersionPolicy(options.apiVersion);\n }\n\n /** A function that adds a policy that sets the api-version (or equivalent) to reflect the library version. */\n private addCustomApiVersionPolicy(apiVersion?: string) {\n if (!apiVersion) {\n return;\n }\n const apiVersionPolicy = {\n name: \"CustomApiVersionPolicy\",\n async sendRequest(request: PipelineRequest, next: SendRequest): Promise<PipelineResponse> {\n const param = request.url.split(\"?\");\n if (param.length > 1) {\n const newParams = param[1].split(\"&\").map((item) => {\n if (item.indexOf(\"api-version\") > -1) {\n return \"api-version=\" + apiVersion;\n } else {\n return item;\n }\n });\n request.url = param[0] + \"?\" + newParams.join(\"&\");\n }\n return next(request);\n },\n };\n this.pipeline.addPolicy(apiVersionPolicy);\n }\n\n connectedClusterOperations: ConnectedClusterOperations;\n operations: Operations;\n}\n"]}
@@ -1,16 +1,11 @@
1
- import { LongRunningOperation, LroResponse } from "@azure/core-lro";
2
- export declare class LroImpl<T> implements LongRunningOperation<T> {
3
- private sendOperationFn;
4
- private args;
5
- private spec;
6
- requestPath: string;
7
- requestMethod: string;
8
- constructor(sendOperationFn: (args: any, spec: any) => Promise<LroResponse<T>>, args: Record<string, unknown>, spec: {
1
+ import type { LongRunningOperation, LroResponse } from "@azure/core-lro";
2
+ export declare function createLroSpec<T>(inputs: {
3
+ sendOperationFn: (args: any, spec: any) => Promise<LroResponse<T>>;
4
+ args: Record<string, unknown>;
5
+ spec: {
9
6
  readonly requestBody?: unknown;
10
7
  readonly path?: string;
11
8
  readonly httpMethod: string;
12
- } & Record<string, any>, requestPath?: string, requestMethod?: string);
13
- sendInitialRequest(): Promise<LroResponse<T>>;
14
- sendPollRequest(path: string): Promise<LroResponse<T>>;
15
- }
9
+ } & Record<string, any>;
10
+ }): LongRunningOperation<T>;
16
11
  //# sourceMappingURL=lroImpl.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"lroImpl.d.ts","sourceRoot":"","sources":["../../src/lroImpl.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,oBAAoB,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAEpE,qBAAa,OAAO,CAAC,CAAC,CAAE,YAAW,oBAAoB,CAAC,CAAC,CAAC;IAEtD,OAAO,CAAC,eAAe;IACvB,OAAO,CAAC,IAAI;IACZ,OAAO,CAAC,IAAI;IAKL,WAAW,EAAE,MAAM;IACnB,aAAa,EAAE,MAAM;gBARpB,eAAe,EAAE,CAAC,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,KAAK,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,EAClE,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC7B,IAAI,EAAE;QACZ,QAAQ,CAAC,WAAW,CAAC,EAAE,OAAO,CAAC;QAC/B,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;QACvB,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;KAC7B,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAChB,WAAW,GAAE,MAAmB,EAChC,aAAa,GAAE,MAAwB;IAEnC,kBAAkB,IAAI,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;IAG7C,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;CAQpE"}
1
+ {"version":3,"file":"lroImpl.d.ts","sourceRoot":"","sources":["../../src/lroImpl.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,oBAAoB,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAEzE,wBAAgB,aAAa,CAAC,CAAC,EAAE,MAAM,EAAE;IACvC,eAAe,EAAE,CAAC,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,KAAK,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC;IACnE,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC9B,IAAI,EAAE;QACJ,QAAQ,CAAC,WAAW,CAAC,EAAE,OAAO,CAAC;QAC/B,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;QACvB,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;KAC7B,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CACzB,GAAG,oBAAoB,CAAC,CAAC,CAAC,CAgB1B"}
@@ -6,20 +6,16 @@
6
6
  * Changes may cause incorrect behavior and will be lost if the code is regenerated.
7
7
  */
8
8
  import { __rest } from "tslib";
9
- export class LroImpl {
10
- constructor(sendOperationFn, args, spec, requestPath = spec.path, requestMethod = spec.httpMethod) {
11
- this.sendOperationFn = sendOperationFn;
12
- this.args = args;
13
- this.spec = spec;
14
- this.requestPath = requestPath;
15
- this.requestMethod = requestMethod;
16
- }
17
- async sendInitialRequest() {
18
- return this.sendOperationFn(this.args, this.spec);
19
- }
20
- async sendPollRequest(path) {
21
- const _a = this.spec, { requestBody } = _a, restSpec = __rest(_a, ["requestBody"]);
22
- return this.sendOperationFn(this.args, Object.assign(Object.assign({}, restSpec), { path, httpMethod: "GET" }));
23
- }
9
+ export function createLroSpec(inputs) {
10
+ const { args, spec, sendOperationFn } = inputs;
11
+ return {
12
+ requestMethod: spec.httpMethod,
13
+ requestPath: spec.path,
14
+ sendInitialRequest: () => sendOperationFn(args, spec),
15
+ sendPollRequest: (path, options) => {
16
+ const { requestBody } = spec, restSpec = __rest(spec, ["requestBody"]);
17
+ return sendOperationFn(args, Object.assign(Object.assign({}, restSpec), { httpMethod: "GET", path, abortSignal: options === null || options === void 0 ? void 0 : options.abortSignal }));
18
+ },
19
+ };
24
20
  }
25
21
  //# sourceMappingURL=lroImpl.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"lroImpl.js","sourceRoot":"","sources":["../../src/lroImpl.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;;AAIH,MAAM,OAAO,OAAO;IAClB,YACU,eAAkE,EAClE,IAA6B,EAC7B,IAIe,EAChB,cAAsB,IAAI,CAAC,IAAK,EAChC,gBAAwB,IAAI,CAAC,UAAU;QARtC,oBAAe,GAAf,eAAe,CAAmD;QAClE,SAAI,GAAJ,IAAI,CAAyB;QAC7B,SAAI,GAAJ,IAAI,CAIW;QAChB,gBAAW,GAAX,WAAW,CAAqB;QAChC,kBAAa,GAAb,aAAa,CAA0B;IAC7C,CAAC;IACG,KAAK,CAAC,kBAAkB;QAC7B,OAAO,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC;IACpD,CAAC;IACM,KAAK,CAAC,eAAe,CAAC,IAAY;QACvC,MAAM,KAA+B,IAAI,CAAC,IAAI,EAAxC,EAAE,WAAW,OAA2B,EAAtB,QAAQ,cAA1B,eAA4B,CAAY,CAAC;QAC/C,OAAO,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,IAAI,kCAChC,QAAQ,KACX,IAAI,EACJ,UAAU,EAAE,KAAK,IACjB,CAAC;IACL,CAAC;CACF","sourcesContent":["/*\n * Copyright (c) Microsoft Corporation.\n * Licensed under the MIT License.\n *\n * Code generated by Microsoft (R) AutoRest Code Generator.\n * Changes may cause incorrect behavior and will be lost if the code is regenerated.\n */\n\nimport { LongRunningOperation, LroResponse } from \"@azure/core-lro\";\n\nexport class LroImpl<T> implements LongRunningOperation<T> {\n constructor(\n private sendOperationFn: (args: any, spec: any) => Promise<LroResponse<T>>,\n private args: Record<string, unknown>,\n private spec: {\n readonly requestBody?: unknown;\n readonly path?: string;\n readonly httpMethod: string;\n } & Record<string, any>,\n public requestPath: string = spec.path!,\n public requestMethod: string = spec.httpMethod\n ) {}\n public async sendInitialRequest(): Promise<LroResponse<T>> {\n return this.sendOperationFn(this.args, this.spec);\n }\n public async sendPollRequest(path: string): Promise<LroResponse<T>> {\n const { requestBody, ...restSpec } = this.spec;\n return this.sendOperationFn(this.args, {\n ...restSpec,\n path,\n httpMethod: \"GET\"\n });\n }\n}\n"]}
1
+ {"version":3,"file":"lroImpl.js","sourceRoot":"","sources":["../../src/lroImpl.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;;AAKH,MAAM,UAAU,aAAa,CAAI,MAQhC;IACC,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,eAAe,EAAE,GAAG,MAAM,CAAC;IAC/C,OAAO;QACL,aAAa,EAAE,IAAI,CAAC,UAAU;QAC9B,WAAW,EAAE,IAAI,CAAC,IAAK;QACvB,kBAAkB,EAAE,GAAG,EAAE,CAAC,eAAe,CAAC,IAAI,EAAE,IAAI,CAAC;QACrD,eAAe,EAAE,CAAC,IAAY,EAAE,OAA2C,EAAE,EAAE;YAC7E,MAAM,EAAE,WAAW,KAAkB,IAAI,EAAjB,QAAQ,UAAK,IAAI,EAAnC,eAA4B,CAAO,CAAC;YAC1C,OAAO,eAAe,CAAC,IAAI,kCACtB,QAAQ,KACX,UAAU,EAAE,KAAK,EACjB,IAAI,EACJ,WAAW,EAAE,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,WAAW,IACjC,CAAC;QACL,CAAC;KACF,CAAC;AACJ,CAAC","sourcesContent":["/*\n * Copyright (c) Microsoft Corporation.\n * Licensed under the MIT License.\n *\n * Code generated by Microsoft (R) AutoRest Code Generator.\n * Changes may cause incorrect behavior and will be lost if the code is regenerated.\n */\n\nimport type { AbortSignalLike } from \"@azure/abort-controller\";\nimport type { LongRunningOperation, LroResponse } from \"@azure/core-lro\";\n\nexport function createLroSpec<T>(inputs: {\n sendOperationFn: (args: any, spec: any) => Promise<LroResponse<T>>;\n args: Record<string, unknown>;\n spec: {\n readonly requestBody?: unknown;\n readonly path?: string;\n readonly httpMethod: string;\n } & Record<string, any>;\n}): LongRunningOperation<T> {\n const { args, spec, sendOperationFn } = inputs;\n return {\n requestMethod: spec.httpMethod,\n requestPath: spec.path!,\n sendInitialRequest: () => sendOperationFn(args, spec),\n sendPollRequest: (path: string, options?: { abortSignal?: AbortSignalLike }) => {\n const { requestBody, ...restSpec } = spec;\n return sendOperationFn(args, {\n ...restSpec,\n httpMethod: \"GET\",\n path,\n abortSignal: options?.abortSignal,\n });\n },\n };\n}\n"]}