"use strict";
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
Object.defineProperty(exports, "__esModule", { value: true });
exports.ServerAutomaticTuningOperationsImpl = 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 ServerAutomaticTuningOperations operations. */
class ServerAutomaticTuningOperationsImpl {
    client;
    /**
     * Initialize a new instance of the class ServerAutomaticTuningOperations class.
     * @param client Reference to the service client
     */
    constructor(client) {
        this.client = client;
    }
    /**
     * Retrieves server automatic tuning options.
     * @param resourceGroupName The name of the resource group that contains the resource. You can obtain
     *                          this value from the Azure Resource Manager API or the portal.
     * @param serverName The name of the server.
     * @param options The options parameters.
     */
    get(resourceGroupName, serverName, options) {
        return this.client.sendOperationRequest({ resourceGroupName, serverName, options }, getOperationSpec);
    }
    /**
     * Update automatic tuning options on server.
     * @param resourceGroupName The name of the resource group that contains the resource. You can obtain
     *                          this value from the Azure Resource Manager API or the portal.
     * @param serverName The name of the server.
     * @param parameters The requested automatic tuning resource state.
     * @param options The options parameters.
     */
    update(resourceGroupName, serverName, parameters, options) {
        return this.client.sendOperationRequest({ resourceGroupName, serverName, parameters, options }, updateOperationSpec);
    }
}
exports.ServerAutomaticTuningOperationsImpl = ServerAutomaticTuningOperationsImpl;
// Operation Specifications
const serializer = coreClient.createSerializer(Mappers, /* isXml */ false);
const getOperationSpec = {
    path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/automaticTuning/current",
    httpMethod: "GET",
    responses: {
        200: {
            bodyMapper: Mappers.ServerAutomaticTuning,
        },
        default: {},
    },
    queryParameters: [Parameters.apiVersion3],
    urlParameters: [
        Parameters.$host,
        Parameters.subscriptionId,
        Parameters.resourceGroupName,
        Parameters.serverName,
    ],
    headerParameters: [Parameters.accept],
    serializer,
};
const updateOperationSpec = {
    path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/automaticTuning/current",
    httpMethod: "PATCH",
    responses: {
        200: {
            bodyMapper: Mappers.ServerAutomaticTuning,
        },
        default: {},
    },
    requestBody: Parameters.parameters42,
    queryParameters: [Parameters.apiVersion3],
    urlParameters: [
        Parameters.$host,
        Parameters.subscriptionId,
        Parameters.resourceGroupName,
        Parameters.serverName,
    ],
    headerParameters: [Parameters.contentType, Parameters.accept],
    mediaType: "json",
    serializer,
};
//# sourceMappingURL=serverAutomaticTuningOperations.js.map