// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
import * as coreClient from "@azure/core-client";
import * as Mappers from "../models/mappers.js";
import * as Parameters from "../models/parameters.js";
/** Class containing SqlAgent operations. */
export class SqlAgentImpl {
    client;
    /**
     * Initialize a new instance of the class SqlAgent class.
     * @param client Reference to the service client
     */
    constructor(client) {
        this.client = client;
    }
    /**
     * Gets current instance sql agent configuration.
     * @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 managedInstanceName The name of the managed instance.
     * @param options The options parameters.
     */
    get(resourceGroupName, managedInstanceName, options) {
        return this.client.sendOperationRequest({ resourceGroupName, managedInstanceName, options }, getOperationSpec);
    }
    /**
     * Puts new sql agent configuration to instance.
     * @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 managedInstanceName The name of the managed instance.
     * @param parameters A recoverable managed database resource.
     * @param options The options parameters.
     */
    createOrUpdate(resourceGroupName, managedInstanceName, parameters, options) {
        return this.client.sendOperationRequest({ resourceGroupName, managedInstanceName, parameters, options }, createOrUpdateOperationSpec);
    }
}
// Operation Specifications
const serializer = coreClient.createSerializer(Mappers, /* isXml */ false);
const getOperationSpec = {
    path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/sqlAgent/current",
    httpMethod: "GET",
    responses: {
        200: {
            bodyMapper: Mappers.SqlAgentConfiguration,
        },
        default: {},
    },
    queryParameters: [Parameters.apiVersion3],
    urlParameters: [
        Parameters.$host,
        Parameters.subscriptionId,
        Parameters.resourceGroupName,
        Parameters.managedInstanceName,
    ],
    headerParameters: [Parameters.accept],
    serializer,
};
const createOrUpdateOperationSpec = {
    path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/sqlAgent/current",
    httpMethod: "PUT",
    responses: {
        200: {
            bodyMapper: Mappers.SqlAgentConfiguration,
        },
        default: {},
    },
    requestBody: Parameters.parameters51,
    queryParameters: [Parameters.apiVersion3],
    urlParameters: [
        Parameters.$host,
        Parameters.subscriptionId,
        Parameters.resourceGroupName,
        Parameters.managedInstanceName,
    ],
    headerParameters: [Parameters.contentType, Parameters.accept],
    mediaType: "json",
    serializer,
};
//# sourceMappingURL=sqlAgent.js.map