"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.OperationsResultsImpl = 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 OperationsResults operations. */
class OperationsResultsImpl {
    /**
     * Initialize a new instance of the class OperationsResults class.
     * @param client Reference to the service client
     */
    constructor(client) {
        this.client = client;
    }
    /**
     * Returns operation results for long running operations executing DELETE or PATCH on the resource.
     * @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.OperationsResultsImpl = OperationsResultsImpl;
// Operation Specifications
const serializer = coreClient.createSerializer(Mappers, /* isXml */ false);
const getOperationSpec = {
    path: "/subscriptions/{subscriptionId}/providers/Microsoft.ApiManagement/locations/{location}/operationResults/{operationId}",
    httpMethod: "GET",
    responses: {
        200: {},
        202: {
            headersMapper: Mappers.OperationsResultsGetHeaders,
        },
        default: {
            bodyMapper: Mappers.ErrorResponse,
        },
    },
    queryParameters: [Parameters.apiVersion],
    urlParameters: [
        Parameters.$host,
        Parameters.subscriptionId,
        Parameters.location1,
        Parameters.operationId1,
    ],
    headerParameters: [Parameters.accept],
    serializer,
};
//# sourceMappingURL=operationsResults.js.map