"use strict";
/*
 * 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.
 */
Object.defineProperty(exports, "__esModule", { value: true });
exports.OperationStatusImpl = void 0;
const tslib_1 = require("tslib");
const coreClient = tslib_1.__importStar(require("@azure/core-client"));
const Mappers = tslib_1.__importStar(require("../models/mappers.js"));
const Parameters = tslib_1.__importStar(require("../models/parameters.js"));
/** Class containing OperationStatus operations. */
class OperationStatusImpl {
    /**
     * Initialize a new instance of the class OperationStatus class.
     * @param client Reference to the service client
     */
    constructor(client) {
        this.client = client;
    }
    /**
     * Returns the current status of an async operation.
     * @param location The name of the Azure region.
     * @param operationId The ID of an ongoing async operation.
     * @param options The options parameters.
     */
    get(location, operationId, options) {
        return this.client.sendOperationRequest({ location, operationId, options }, getOperationSpec);
    }
}
exports.OperationStatusImpl = OperationStatusImpl;
// Operation Specifications
const serializer = coreClient.createSerializer(Mappers, /* isXml */ false);
const getOperationSpec = {
    path: "/subscriptions/{subscriptionId}/providers/Microsoft.ApiManagement/locations/{location}/operationStatuses/{operationId}",
    httpMethod: "GET",
    responses: {
        200: {
            bodyMapper: Mappers.OperationStatusResult,
        },
        default: {
            bodyMapper: Mappers.ErrorResponse,
        },
    },
    queryParameters: [Parameters.apiVersion],
    urlParameters: [
        Parameters.$host,
        Parameters.subscriptionId,
        Parameters.location1,
        Parameters.operationId1,
    ],
    headerParameters: [Parameters.accept],
    serializer,
};
//# sourceMappingURL=operationStatus.js.map