/* * 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 { OperationStatuses } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; import { DevCenterClient } from "../devCenterClient"; import { OperationStatusesGetOptionalParams, OperationStatusesGetResponse, } from "../models"; /** Class containing OperationStatuses operations. */ export class OperationStatusesImpl implements OperationStatuses { private readonly client: DevCenterClient; /** * Initialize a new instance of the class OperationStatuses class. * @param client Reference to the service client */ constructor(client: DevCenterClient) { this.client = client; } /** * Gets the current status of an async operation. * @param location The Azure region * @param operationId The ID of an ongoing async operation * @param options The options parameters. */ get( location: string, operationId: string, options?: OperationStatusesGetOptionalParams, ): Promise { return this.client.sendOperationRequest( { location, operationId, options }, getOperationSpec, ); } } // Operation Specifications const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); const getOperationSpec: coreClient.OperationSpec = { path: "/subscriptions/{subscriptionId}/providers/Microsoft.DevCenter/locations/{location}/operationStatuses/{operationId}", httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.OperationStatus, }, 202: { bodyMapper: Mappers.OperationStatus, headersMapper: Mappers.OperationStatusesGetHeaders, }, default: { bodyMapper: Mappers.ErrorResponse, }, }, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.subscriptionId, Parameters.location, Parameters.operationId, ], headerParameters: [Parameters.accept], serializer, };