/* * 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 implements LongRunningOperation { constructor( private sendOperationFn: (args: any, spec: any) => Promise>, private args: Record, private spec: { readonly requestBody?: unknown; readonly path?: string; readonly httpMethod: string; } & Record, public requestPath: string = spec.path!, public requestMethod: string = spec.httpMethod ) {} public async sendInitialRequest(): Promise> { return this.sendOperationFn(this.args, this.spec); } public async sendPollRequest(path: string): Promise> { const { requestBody, ...restSpec } = this.spec; return this.sendOperationFn(this.args, { ...restSpec, path, httpMethod: "GET" }); } }