forked from Azure/azure-sdk-for-js
-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CodeGen from PR 20391 in Azure/azure-rest-api-specs
Merge 07c5cc8b6e69c847e0d7696953eac629a273d50f into 6b08774c89877269e73e11ac3ecbd1bd4e14f5a0
- Loading branch information
SDKAuto
committed
Aug 29, 2022
1 parent
480e82c
commit ac5c609
Showing
14 changed files
with
1,318 additions
and
95 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
{ | ||
"commit": "64496bd64b0376dc4b45e3193a39f7bcdd4b28da", | ||
"commit": "58a401347d81064ca84529643260e2ce1d7fba13", | ||
"readme": "specification/securityinsights/resource-manager/readme.md", | ||
"autorest_command": "autorest --version=3.7.3 --typescript --modelerfour.lenient-model-deduplication --azure-arm --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=D:\\Git\\azure-sdk-for-js ..\\azure-rest-api-specs\\specification\\securityinsights\\resource-manager\\readme.md --use=@autorest/[email protected].20220707.1 --generate-sample=true", | ||
"autorest_command": "autorest --version=3.8.4 --typescript --modelerfour.lenient-model-deduplication --azure-arm --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=/mnt/vss/_work/1/s/azure-sdk-for-js ../azure-rest-api-specs/specification/securityinsights/resource-manager/readme.md --use=@autorest/[email protected]", | ||
"repository_url": "https://github.com/Azure/azure-rest-api-specs.git", | ||
"release_tool": "@azure-tools/[email protected].0", | ||
"use": "@autorest/[email protected].20220707.1" | ||
"release_tool": "@azure-tools/[email protected].2", | ||
"use": "@autorest/[email protected]" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
/* | ||
* Copyright (c) Microsoft Corporation. | ||
* Licensed under the MIT License. | ||
* | ||
* Code generated by Microsoft (R) AutoRest Code Generator. | ||
* Changes may cause incorrect behavior and will be lost if the code is regenerated. | ||
*/ | ||
|
||
import { LongRunningOperation, LroResponse } from "@azure/core-lro"; | ||
|
||
export class LroImpl<T> implements LongRunningOperation<T> { | ||
constructor( | ||
private sendOperationFn: (args: any, spec: any) => Promise<LroResponse<T>>, | ||
private args: Record<string, unknown>, | ||
private spec: { | ||
readonly requestBody?: unknown; | ||
readonly path?: string; | ||
readonly httpMethod: string; | ||
} & Record<string, any>, | ||
public requestPath: string = spec.path!, | ||
public requestMethod: string = spec.httpMethod | ||
) {} | ||
public async sendInitialRequest(): Promise<LroResponse<T>> { | ||
return this.sendOperationFn(this.args, this.spec); | ||
} | ||
public async sendPollRequest(path: string): Promise<LroResponse<T>> { | ||
const { requestBody, ...restSpec } = this.spec; | ||
return this.sendOperationFn(this.args, { | ||
...restSpec, | ||
path, | ||
httpMethod: "GET" | ||
}); | ||
} | ||
} |
Oops, something went wrong.