/*
 * 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 SignUpSettings operations. */
export class SignUpSettingsImpl {
    /**
     * Initialize a new instance of the class SignUpSettings class.
     * @param client Reference to the service client
     */
    constructor(client) {
        this.client = client;
    }
    /**
     * Gets the entity state (Etag) version of the SignUpSettings.
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param serviceName The name of the API Management service.
     * @param options The options parameters.
     */
    getEntityTag(resourceGroupName, serviceName, options) {
        return this.client.sendOperationRequest({ resourceGroupName, serviceName, options }, getEntityTagOperationSpec);
    }
    /**
     * Get Sign Up Settings for the Portal
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param serviceName The name of the API Management service.
     * @param options The options parameters.
     */
    get(resourceGroupName, serviceName, options) {
        return this.client.sendOperationRequest({ resourceGroupName, serviceName, options }, getOperationSpec);
    }
    /**
     * Update Sign-Up settings.
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param serviceName The name of the API Management service.
     * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header
     *                response of the GET request or it should be * for unconditional update.
     * @param parameters Update Sign-Up settings.
     * @param options The options parameters.
     */
    update(resourceGroupName, serviceName, ifMatch, parameters, options) {
        return this.client.sendOperationRequest({ resourceGroupName, serviceName, ifMatch, parameters, options }, updateOperationSpec);
    }
    /**
     * Create or Update Sign-Up settings.
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param serviceName The name of the API Management service.
     * @param parameters Create or update parameters.
     * @param options The options parameters.
     */
    createOrUpdate(resourceGroupName, serviceName, parameters, options) {
        return this.client.sendOperationRequest({ resourceGroupName, serviceName, parameters, options }, createOrUpdateOperationSpec);
    }
}
// Operation Specifications
const serializer = coreClient.createSerializer(Mappers, /* isXml */ false);
const getEntityTagOperationSpec = {
    path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/portalsettings/signup",
    httpMethod: "HEAD",
    responses: {
        200: {
            headersMapper: Mappers.SignUpSettingsGetEntityTagHeaders,
        },
        default: {
            bodyMapper: Mappers.ErrorResponse,
        },
    },
    queryParameters: [Parameters.apiVersion],
    urlParameters: [
        Parameters.$host,
        Parameters.resourceGroupName,
        Parameters.subscriptionId,
        Parameters.serviceName,
    ],
    headerParameters: [Parameters.accept],
    serializer,
};
const getOperationSpec = {
    path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/portalsettings/signup",
    httpMethod: "GET",
    responses: {
        200: {
            bodyMapper: Mappers.PortalSignupSettings,
            headersMapper: Mappers.SignUpSettingsGetHeaders,
        },
        default: {
            bodyMapper: Mappers.ErrorResponse,
        },
    },
    queryParameters: [Parameters.apiVersion],
    urlParameters: [
        Parameters.$host,
        Parameters.resourceGroupName,
        Parameters.subscriptionId,
        Parameters.serviceName,
    ],
    headerParameters: [Parameters.accept],
    serializer,
};
const updateOperationSpec = {
    path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/portalsettings/signup",
    httpMethod: "PATCH",
    responses: {
        204: {},
        default: {
            bodyMapper: Mappers.ErrorResponse,
        },
    },
    requestBody: Parameters.parameters71,
    queryParameters: [Parameters.apiVersion],
    urlParameters: [
        Parameters.$host,
        Parameters.resourceGroupName,
        Parameters.subscriptionId,
        Parameters.serviceName,
    ],
    headerParameters: [
        Parameters.contentType,
        Parameters.accept,
        Parameters.ifMatch1,
    ],
    mediaType: "json",
    serializer,
};
const createOrUpdateOperationSpec = {
    path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/portalsettings/signup",
    httpMethod: "PUT",
    responses: {
        200: {
            bodyMapper: Mappers.PortalSignupSettings,
        },
        default: {
            bodyMapper: Mappers.ErrorResponse,
        },
    },
    requestBody: Parameters.parameters71,
    queryParameters: [Parameters.apiVersion],
    urlParameters: [
        Parameters.$host,
        Parameters.resourceGroupName,
        Parameters.subscriptionId,
        Parameters.serviceName,
    ],
    headerParameters: [
        Parameters.contentType,
        Parameters.accept,
        Parameters.ifMatch,
    ],
    mediaType: "json",
    serializer,
};
//# sourceMappingURL=signUpSettings.js.map