/*
 * 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 * as coreClient from "@azure/core-client";
import * as Mappers from "../models/mappers.js";
import * as Parameters from "../models/parameters.js";
/** Class containing Skillsets operations. */
export class SkillsetsImpl {
    client;
    /**
     * Initialize a new instance of the class Skillsets class.
     * @param client Reference to the service client
     */
    constructor(client) {
        this.client = client;
    }
    /**
     * Creates a new skillset in a search service or updates the skillset if it already exists.
     * @param skillsetName The name of the skillset to create or update.
     * @param skillset The skillset containing one or more skills to create or update in a search service.
     * @param options The options parameters.
     */
    createOrUpdate(skillsetName, skillset, options) {
        return this.client.sendOperationRequest({ skillsetName, skillset, options }, createOrUpdateOperationSpec);
    }
    /**
     * Deletes a skillset in a search service.
     * @param skillsetName The name of the skillset to delete.
     * @param options The options parameters.
     */
    delete(skillsetName, options) {
        return this.client.sendOperationRequest({ skillsetName, options }, deleteOperationSpec);
    }
    /**
     * Retrieves a skillset in a search service.
     * @param skillsetName The name of the skillset to retrieve.
     * @param options The options parameters.
     */
    get(skillsetName, options) {
        return this.client.sendOperationRequest({ skillsetName, options }, getOperationSpec);
    }
    /**
     * List all skillsets in a search service.
     * @param options The options parameters.
     */
    list(options) {
        return this.client.sendOperationRequest({ options }, listOperationSpec);
    }
    /**
     * Creates a new skillset in a search service.
     * @param skillset The skillset containing one or more skills to create in a search service.
     * @param options The options parameters.
     */
    create(skillset, options) {
        return this.client.sendOperationRequest({ skillset, options }, createOperationSpec);
    }
}
// Operation Specifications
const serializer = coreClient.createSerializer(Mappers, /* isXml */ false);
const createOrUpdateOperationSpec = {
    path: "/skillsets('{skillsetName}')",
    httpMethod: "PUT",
    responses: {
        200: {
            bodyMapper: Mappers.SearchIndexerSkillset,
        },
        201: {
            bodyMapper: Mappers.SearchIndexerSkillset,
        },
        default: {
            bodyMapper: Mappers.ErrorResponse,
        },
    },
    requestBody: Parameters.skillset,
    queryParameters: [Parameters.apiVersion],
    urlParameters: [Parameters.endpoint, Parameters.skillsetName],
    headerParameters: [
        Parameters.contentType,
        Parameters.accept,
        Parameters.ifMatch,
        Parameters.ifNoneMatch,
        Parameters.prefer,
    ],
    mediaType: "json",
    serializer,
};
const deleteOperationSpec = {
    path: "/skillsets('{skillsetName}')",
    httpMethod: "DELETE",
    responses: {
        204: {},
        404: {},
        default: {
            bodyMapper: Mappers.ErrorResponse,
        },
    },
    queryParameters: [Parameters.apiVersion],
    urlParameters: [Parameters.endpoint, Parameters.skillsetName],
    headerParameters: [
        Parameters.accept,
        Parameters.ifMatch,
        Parameters.ifNoneMatch,
    ],
    serializer,
};
const getOperationSpec = {
    path: "/skillsets('{skillsetName}')",
    httpMethod: "GET",
    responses: {
        200: {
            bodyMapper: Mappers.SearchIndexerSkillset,
        },
        default: {
            bodyMapper: Mappers.ErrorResponse,
        },
    },
    queryParameters: [Parameters.apiVersion],
    urlParameters: [Parameters.endpoint, Parameters.skillsetName],
    headerParameters: [Parameters.accept],
    serializer,
};
const listOperationSpec = {
    path: "/skillsets",
    httpMethod: "GET",
    responses: {
        200: {
            bodyMapper: Mappers.ListSkillsetsResult,
        },
        default: {
            bodyMapper: Mappers.ErrorResponse,
        },
    },
    queryParameters: [Parameters.apiVersion, Parameters.select],
    urlParameters: [Parameters.endpoint],
    headerParameters: [Parameters.accept],
    serializer,
};
const createOperationSpec = {
    path: "/skillsets",
    httpMethod: "POST",
    responses: {
        201: {
            bodyMapper: Mappers.SearchIndexerSkillset,
        },
        default: {
            bodyMapper: Mappers.ErrorResponse,
        },
    },
    requestBody: Parameters.skillset,
    queryParameters: [Parameters.apiVersion],
    urlParameters: [Parameters.endpoint],
    headerParameters: [Parameters.contentType, Parameters.accept],
    mediaType: "json",
    serializer,
};
//# sourceMappingURL=skillsets.js.map