// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
import { setContinuationToken } from "../pagingHelper.js";
import * as coreClient from "@azure/core-client";
import * as Mappers from "../models/mappers.js";
import * as Parameters from "../models/parameters.js";
import { createHttpPoller } from "@azure/core-lro";
import { createLroSpec } from "../lroImpl.js";
/// <reference lib="esnext.asynciterable" />
/** Class containing SyncGroups operations. */
export class SyncGroupsImpl {
    client;
    /**
     * Initialize a new instance of the class SyncGroups class.
     * @param client Reference to the service client
     */
    constructor(client) {
        this.client = client;
    }
    /**
     * Gets a collection of sync database ids.
     * @param locationName The name of the region where the resource is located.
     * @param options The options parameters.
     */
    listSyncDatabaseIds(locationName, options) {
        const iter = this.listSyncDatabaseIdsPagingAll(locationName, options);
        return {
            next() {
                return iter.next();
            },
            [Symbol.asyncIterator]() {
                return this;
            },
            byPage: (settings) => {
                if (settings?.maxPageSize) {
                    throw new Error("maxPageSize is not supported by this operation.");
                }
                return this.listSyncDatabaseIdsPagingPage(locationName, options, settings);
            },
        };
    }
    async *listSyncDatabaseIdsPagingPage(locationName, options, settings) {
        let result;
        let continuationToken = settings?.continuationToken;
        if (!continuationToken) {
            result = await this._listSyncDatabaseIds(locationName, options);
            let page = result.value || [];
            continuationToken = result.nextLink;
            setContinuationToken(page, continuationToken);
            yield page;
        }
        while (continuationToken) {
            result = await this._listSyncDatabaseIdsNext(locationName, continuationToken, options);
            continuationToken = result.nextLink;
            let page = result.value || [];
            setContinuationToken(page, continuationToken);
            yield page;
        }
    }
    async *listSyncDatabaseIdsPagingAll(locationName, options) {
        for await (const page of this.listSyncDatabaseIdsPagingPage(locationName, options)) {
            yield* page;
        }
    }
    /**
     * Gets a collection of hub database schemas.
     * @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 databaseName The name of the database on which the sync group is hosted.
     * @param syncGroupName The name of the sync group.
     * @param options The options parameters.
     */
    listHubSchemas(resourceGroupName, serverName, databaseName, syncGroupName, options) {
        const iter = this.listHubSchemasPagingAll(resourceGroupName, serverName, databaseName, syncGroupName, options);
        return {
            next() {
                return iter.next();
            },
            [Symbol.asyncIterator]() {
                return this;
            },
            byPage: (settings) => {
                if (settings?.maxPageSize) {
                    throw new Error("maxPageSize is not supported by this operation.");
                }
                return this.listHubSchemasPagingPage(resourceGroupName, serverName, databaseName, syncGroupName, options, settings);
            },
        };
    }
    async *listHubSchemasPagingPage(resourceGroupName, serverName, databaseName, syncGroupName, options, settings) {
        let result;
        let continuationToken = settings?.continuationToken;
        if (!continuationToken) {
            result = await this._listHubSchemas(resourceGroupName, serverName, databaseName, syncGroupName, options);
            let page = result.value || [];
            continuationToken = result.nextLink;
            setContinuationToken(page, continuationToken);
            yield page;
        }
        while (continuationToken) {
            result = await this._listHubSchemasNext(resourceGroupName, serverName, databaseName, syncGroupName, continuationToken, options);
            continuationToken = result.nextLink;
            let page = result.value || [];
            setContinuationToken(page, continuationToken);
            yield page;
        }
    }
    async *listHubSchemasPagingAll(resourceGroupName, serverName, databaseName, syncGroupName, options) {
        for await (const page of this.listHubSchemasPagingPage(resourceGroupName, serverName, databaseName, syncGroupName, options)) {
            yield* page;
        }
    }
    /**
     * Gets a collection of sync group logs.
     * @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 databaseName The name of the database on which the sync group is hosted.
     * @param syncGroupName The name of the sync group.
     * @param startTime Get logs generated after this time.
     * @param endTime Get logs generated before this time.
     * @param typeParam The types of logs to retrieve.
     * @param options The options parameters.
     */
    listLogs(resourceGroupName, serverName, databaseName, syncGroupName, startTime, endTime, typeParam, options) {
        const iter = this.listLogsPagingAll(resourceGroupName, serverName, databaseName, syncGroupName, startTime, endTime, typeParam, options);
        return {
            next() {
                return iter.next();
            },
            [Symbol.asyncIterator]() {
                return this;
            },
            byPage: (settings) => {
                if (settings?.maxPageSize) {
                    throw new Error("maxPageSize is not supported by this operation.");
                }
                return this.listLogsPagingPage(resourceGroupName, serverName, databaseName, syncGroupName, startTime, endTime, typeParam, options, settings);
            },
        };
    }
    async *listLogsPagingPage(resourceGroupName, serverName, databaseName, syncGroupName, startTime, endTime, typeParam, options, settings) {
        let result;
        let continuationToken = settings?.continuationToken;
        if (!continuationToken) {
            result = await this._listLogs(resourceGroupName, serverName, databaseName, syncGroupName, startTime, endTime, typeParam, options);
            let page = result.value || [];
            continuationToken = result.nextLink;
            setContinuationToken(page, continuationToken);
            yield page;
        }
        while (continuationToken) {
            result = await this._listLogsNext(resourceGroupName, serverName, databaseName, syncGroupName, continuationToken, options);
            continuationToken = result.nextLink;
            let page = result.value || [];
            setContinuationToken(page, continuationToken);
            yield page;
        }
    }
    async *listLogsPagingAll(resourceGroupName, serverName, databaseName, syncGroupName, startTime, endTime, typeParam, options) {
        for await (const page of this.listLogsPagingPage(resourceGroupName, serverName, databaseName, syncGroupName, startTime, endTime, typeParam, options)) {
            yield* page;
        }
    }
    /**
     * Lists sync groups under a hub database.
     * @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 databaseName The name of the database on which the sync group is hosted.
     * @param options The options parameters.
     */
    listByDatabase(resourceGroupName, serverName, databaseName, options) {
        const iter = this.listByDatabasePagingAll(resourceGroupName, serverName, databaseName, options);
        return {
            next() {
                return iter.next();
            },
            [Symbol.asyncIterator]() {
                return this;
            },
            byPage: (settings) => {
                if (settings?.maxPageSize) {
                    throw new Error("maxPageSize is not supported by this operation.");
                }
                return this.listByDatabasePagingPage(resourceGroupName, serverName, databaseName, options, settings);
            },
        };
    }
    async *listByDatabasePagingPage(resourceGroupName, serverName, databaseName, options, settings) {
        let result;
        let continuationToken = settings?.continuationToken;
        if (!continuationToken) {
            result = await this._listByDatabase(resourceGroupName, serverName, databaseName, options);
            let page = result.value || [];
            continuationToken = result.nextLink;
            setContinuationToken(page, continuationToken);
            yield page;
        }
        while (continuationToken) {
            result = await this._listByDatabaseNext(resourceGroupName, serverName, databaseName, continuationToken, options);
            continuationToken = result.nextLink;
            let page = result.value || [];
            setContinuationToken(page, continuationToken);
            yield page;
        }
    }
    async *listByDatabasePagingAll(resourceGroupName, serverName, databaseName, options) {
        for await (const page of this.listByDatabasePagingPage(resourceGroupName, serverName, databaseName, options)) {
            yield* page;
        }
    }
    /**
     * Gets a collection of sync database ids.
     * @param locationName The name of the region where the resource is located.
     * @param options The options parameters.
     */
    _listSyncDatabaseIds(locationName, options) {
        return this.client.sendOperationRequest({ locationName, options }, listSyncDatabaseIdsOperationSpec);
    }
    /**
     * Refreshes a hub database schema.
     * @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 databaseName The name of the database on which the sync group is hosted.
     * @param syncGroupName The name of the sync group.
     * @param options The options parameters.
     */
    async beginRefreshHubSchema(resourceGroupName, serverName, databaseName, syncGroupName, options) {
        const directSendOperation = async (args, spec) => {
            return this.client.sendOperationRequest(args, spec);
        };
        const sendOperationFn = async (args, spec) => {
            let currentRawResponse = undefined;
            const providedCallback = args.options?.onResponse;
            const callback = (rawResponse, flatResponse) => {
                currentRawResponse = rawResponse;
                providedCallback?.(rawResponse, flatResponse);
            };
            const updatedArgs = {
                ...args,
                options: {
                    ...args.options,
                    onResponse: callback,
                },
            };
            const flatResponse = await directSendOperation(updatedArgs, spec);
            return {
                flatResponse,
                rawResponse: {
                    statusCode: currentRawResponse.status,
                    body: currentRawResponse.parsedBody,
                    headers: currentRawResponse.headers.toJSON(),
                },
            };
        };
        const lro = createLroSpec({
            sendOperationFn,
            args: {
                resourceGroupName,
                serverName,
                databaseName,
                syncGroupName,
                options,
            },
            spec: refreshHubSchemaOperationSpec,
        });
        const poller = await createHttpPoller(lro, {
            restoreFrom: options?.resumeFrom,
            intervalInMs: options?.updateIntervalInMs,
        });
        await poller.poll();
        return poller;
    }
    /**
     * Refreshes a hub database schema.
     * @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 databaseName The name of the database on which the sync group is hosted.
     * @param syncGroupName The name of the sync group.
     * @param options The options parameters.
     */
    async beginRefreshHubSchemaAndWait(resourceGroupName, serverName, databaseName, syncGroupName, options) {
        const poller = await this.beginRefreshHubSchema(resourceGroupName, serverName, databaseName, syncGroupName, options);
        return poller.pollUntilDone();
    }
    /**
     * Gets a collection of hub database schemas.
     * @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 databaseName The name of the database on which the sync group is hosted.
     * @param syncGroupName The name of the sync group.
     * @param options The options parameters.
     */
    _listHubSchemas(resourceGroupName, serverName, databaseName, syncGroupName, options) {
        return this.client.sendOperationRequest({ resourceGroupName, serverName, databaseName, syncGroupName, options }, listHubSchemasOperationSpec);
    }
    /**
     * Gets a collection of sync group logs.
     * @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 databaseName The name of the database on which the sync group is hosted.
     * @param syncGroupName The name of the sync group.
     * @param startTime Get logs generated after this time.
     * @param endTime Get logs generated before this time.
     * @param typeParam The types of logs to retrieve.
     * @param options The options parameters.
     */
    _listLogs(resourceGroupName, serverName, databaseName, syncGroupName, startTime, endTime, typeParam, options) {
        return this.client.sendOperationRequest({
            resourceGroupName,
            serverName,
            databaseName,
            syncGroupName,
            startTime,
            endTime,
            typeParam,
            options,
        }, listLogsOperationSpec);
    }
    /**
     * Cancels a sync group synchronization.
     * @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 databaseName The name of the database on which the sync group is hosted.
     * @param syncGroupName The name of the sync group.
     * @param options The options parameters.
     */
    cancelSync(resourceGroupName, serverName, databaseName, syncGroupName, options) {
        return this.client.sendOperationRequest({ resourceGroupName, serverName, databaseName, syncGroupName, options }, cancelSyncOperationSpec);
    }
    /**
     * Triggers a sync group synchronization.
     * @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 databaseName The name of the database on which the sync group is hosted.
     * @param syncGroupName The name of the sync group.
     * @param options The options parameters.
     */
    triggerSync(resourceGroupName, serverName, databaseName, syncGroupName, options) {
        return this.client.sendOperationRequest({ resourceGroupName, serverName, databaseName, syncGroupName, options }, triggerSyncOperationSpec);
    }
    /**
     * Gets a sync group.
     * @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 databaseName The name of the database on which the sync group is hosted.
     * @param syncGroupName The name of the sync group.
     * @param options The options parameters.
     */
    get(resourceGroupName, serverName, databaseName, syncGroupName, options) {
        return this.client.sendOperationRequest({ resourceGroupName, serverName, databaseName, syncGroupName, options }, getOperationSpec);
    }
    /**
     * Creates or updates a sync group.
     * @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 databaseName The name of the database on which the sync group is hosted.
     * @param syncGroupName The name of the sync group.
     * @param parameters The requested sync group resource state.
     * @param options The options parameters.
     */
    async beginCreateOrUpdate(resourceGroupName, serverName, databaseName, syncGroupName, parameters, options) {
        const directSendOperation = async (args, spec) => {
            return this.client.sendOperationRequest(args, spec);
        };
        const sendOperationFn = async (args, spec) => {
            let currentRawResponse = undefined;
            const providedCallback = args.options?.onResponse;
            const callback = (rawResponse, flatResponse) => {
                currentRawResponse = rawResponse;
                providedCallback?.(rawResponse, flatResponse);
            };
            const updatedArgs = {
                ...args,
                options: {
                    ...args.options,
                    onResponse: callback,
                },
            };
            const flatResponse = await directSendOperation(updatedArgs, spec);
            return {
                flatResponse,
                rawResponse: {
                    statusCode: currentRawResponse.status,
                    body: currentRawResponse.parsedBody,
                    headers: currentRawResponse.headers.toJSON(),
                },
            };
        };
        const lro = createLroSpec({
            sendOperationFn,
            args: {
                resourceGroupName,
                serverName,
                databaseName,
                syncGroupName,
                parameters,
                options,
            },
            spec: createOrUpdateOperationSpec,
        });
        const poller = await createHttpPoller(lro, {
            restoreFrom: options?.resumeFrom,
            intervalInMs: options?.updateIntervalInMs,
        });
        await poller.poll();
        return poller;
    }
    /**
     * Creates or updates a sync group.
     * @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 databaseName The name of the database on which the sync group is hosted.
     * @param syncGroupName The name of the sync group.
     * @param parameters The requested sync group resource state.
     * @param options The options parameters.
     */
    async beginCreateOrUpdateAndWait(resourceGroupName, serverName, databaseName, syncGroupName, parameters, options) {
        const poller = await this.beginCreateOrUpdate(resourceGroupName, serverName, databaseName, syncGroupName, parameters, options);
        return poller.pollUntilDone();
    }
    /**
     * Deletes a sync group.
     * @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 databaseName The name of the database on which the sync group is hosted.
     * @param syncGroupName The name of the sync group.
     * @param options The options parameters.
     */
    async beginDelete(resourceGroupName, serverName, databaseName, syncGroupName, options) {
        const directSendOperation = async (args, spec) => {
            return this.client.sendOperationRequest(args, spec);
        };
        const sendOperationFn = async (args, spec) => {
            let currentRawResponse = undefined;
            const providedCallback = args.options?.onResponse;
            const callback = (rawResponse, flatResponse) => {
                currentRawResponse = rawResponse;
                providedCallback?.(rawResponse, flatResponse);
            };
            const updatedArgs = {
                ...args,
                options: {
                    ...args.options,
                    onResponse: callback,
                },
            };
            const flatResponse = await directSendOperation(updatedArgs, spec);
            return {
                flatResponse,
                rawResponse: {
                    statusCode: currentRawResponse.status,
                    body: currentRawResponse.parsedBody,
                    headers: currentRawResponse.headers.toJSON(),
                },
            };
        };
        const lro = createLroSpec({
            sendOperationFn,
            args: {
                resourceGroupName,
                serverName,
                databaseName,
                syncGroupName,
                options,
            },
            spec: deleteOperationSpec,
        });
        const poller = await createHttpPoller(lro, {
            restoreFrom: options?.resumeFrom,
            intervalInMs: options?.updateIntervalInMs,
        });
        await poller.poll();
        return poller;
    }
    /**
     * Deletes a sync group.
     * @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 databaseName The name of the database on which the sync group is hosted.
     * @param syncGroupName The name of the sync group.
     * @param options The options parameters.
     */
    async beginDeleteAndWait(resourceGroupName, serverName, databaseName, syncGroupName, options) {
        const poller = await this.beginDelete(resourceGroupName, serverName, databaseName, syncGroupName, options);
        return poller.pollUntilDone();
    }
    /**
     * Updates a sync group.
     * @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 databaseName The name of the database on which the sync group is hosted.
     * @param syncGroupName The name of the sync group.
     * @param parameters The requested sync group resource state.
     * @param options The options parameters.
     */
    async beginUpdate(resourceGroupName, serverName, databaseName, syncGroupName, parameters, options) {
        const directSendOperation = async (args, spec) => {
            return this.client.sendOperationRequest(args, spec);
        };
        const sendOperationFn = async (args, spec) => {
            let currentRawResponse = undefined;
            const providedCallback = args.options?.onResponse;
            const callback = (rawResponse, flatResponse) => {
                currentRawResponse = rawResponse;
                providedCallback?.(rawResponse, flatResponse);
            };
            const updatedArgs = {
                ...args,
                options: {
                    ...args.options,
                    onResponse: callback,
                },
            };
            const flatResponse = await directSendOperation(updatedArgs, spec);
            return {
                flatResponse,
                rawResponse: {
                    statusCode: currentRawResponse.status,
                    body: currentRawResponse.parsedBody,
                    headers: currentRawResponse.headers.toJSON(),
                },
            };
        };
        const lro = createLroSpec({
            sendOperationFn,
            args: {
                resourceGroupName,
                serverName,
                databaseName,
                syncGroupName,
                parameters,
                options,
            },
            spec: updateOperationSpec,
        });
        const poller = await createHttpPoller(lro, {
            restoreFrom: options?.resumeFrom,
            intervalInMs: options?.updateIntervalInMs,
        });
        await poller.poll();
        return poller;
    }
    /**
     * Updates a sync group.
     * @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 databaseName The name of the database on which the sync group is hosted.
     * @param syncGroupName The name of the sync group.
     * @param parameters The requested sync group resource state.
     * @param options The options parameters.
     */
    async beginUpdateAndWait(resourceGroupName, serverName, databaseName, syncGroupName, parameters, options) {
        const poller = await this.beginUpdate(resourceGroupName, serverName, databaseName, syncGroupName, parameters, options);
        return poller.pollUntilDone();
    }
    /**
     * Lists sync groups under a hub database.
     * @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 databaseName The name of the database on which the sync group is hosted.
     * @param options The options parameters.
     */
    _listByDatabase(resourceGroupName, serverName, databaseName, options) {
        return this.client.sendOperationRequest({ resourceGroupName, serverName, databaseName, options }, listByDatabaseOperationSpec);
    }
    /**
     * ListSyncDatabaseIdsNext
     * @param locationName The name of the region where the resource is located.
     * @param nextLink The nextLink from the previous successful call to the ListSyncDatabaseIds method.
     * @param options The options parameters.
     */
    _listSyncDatabaseIdsNext(locationName, nextLink, options) {
        return this.client.sendOperationRequest({ locationName, nextLink, options }, listSyncDatabaseIdsNextOperationSpec);
    }
    /**
     * ListHubSchemasNext
     * @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 databaseName The name of the database on which the sync group is hosted.
     * @param syncGroupName The name of the sync group.
     * @param nextLink The nextLink from the previous successful call to the ListHubSchemas method.
     * @param options The options parameters.
     */
    _listHubSchemasNext(resourceGroupName, serverName, databaseName, syncGroupName, nextLink, options) {
        return this.client.sendOperationRequest({
            resourceGroupName,
            serverName,
            databaseName,
            syncGroupName,
            nextLink,
            options,
        }, listHubSchemasNextOperationSpec);
    }
    /**
     * ListLogsNext
     * @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 databaseName The name of the database on which the sync group is hosted.
     * @param syncGroupName The name of the sync group.
     * @param nextLink The nextLink from the previous successful call to the ListLogs method.
     * @param options The options parameters.
     */
    _listLogsNext(resourceGroupName, serverName, databaseName, syncGroupName, nextLink, options) {
        return this.client.sendOperationRequest({
            resourceGroupName,
            serverName,
            databaseName,
            syncGroupName,
            nextLink,
            options,
        }, listLogsNextOperationSpec);
    }
    /**
     * ListByDatabaseNext
     * @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 databaseName The name of the database on which the sync group is hosted.
     * @param nextLink The nextLink from the previous successful call to the ListByDatabase method.
     * @param options The options parameters.
     */
    _listByDatabaseNext(resourceGroupName, serverName, databaseName, nextLink, options) {
        return this.client.sendOperationRequest({ resourceGroupName, serverName, databaseName, nextLink, options }, listByDatabaseNextOperationSpec);
    }
}
// Operation Specifications
const serializer = coreClient.createSerializer(Mappers, /* isXml */ false);
const listSyncDatabaseIdsOperationSpec = {
    path: "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/syncDatabaseIds",
    httpMethod: "GET",
    responses: {
        200: {
            bodyMapper: Mappers.SyncDatabaseIdListResult,
        },
        default: {},
    },
    queryParameters: [Parameters.apiVersion3],
    urlParameters: [Parameters.$host, Parameters.subscriptionId, Parameters.locationName],
    headerParameters: [Parameters.accept],
    serializer,
};
const refreshHubSchemaOperationSpec = {
    path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/refreshHubSchema",
    httpMethod: "POST",
    responses: { 200: {}, 201: {}, 202: {}, 204: {}, default: {} },
    queryParameters: [Parameters.apiVersion3],
    urlParameters: [
        Parameters.$host,
        Parameters.subscriptionId,
        Parameters.resourceGroupName,
        Parameters.serverName,
        Parameters.databaseName,
        Parameters.syncGroupName,
    ],
    serializer,
};
const listHubSchemasOperationSpec = {
    path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/hubSchemas",
    httpMethod: "GET",
    responses: {
        200: {
            bodyMapper: Mappers.SyncFullSchemaPropertiesListResult,
        },
        default: {},
    },
    queryParameters: [Parameters.apiVersion3],
    urlParameters: [
        Parameters.$host,
        Parameters.subscriptionId,
        Parameters.resourceGroupName,
        Parameters.serverName,
        Parameters.databaseName,
        Parameters.syncGroupName,
    ],
    headerParameters: [Parameters.accept],
    serializer,
};
const listLogsOperationSpec = {
    path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/logs",
    httpMethod: "GET",
    responses: {
        200: {
            bodyMapper: Mappers.SyncGroupLogListResult,
        },
        default: {},
    },
    queryParameters: [
        Parameters.apiVersion3,
        Parameters.startTime1,
        Parameters.endTime1,
        Parameters.typeParam,
        Parameters.continuationToken,
    ],
    urlParameters: [
        Parameters.$host,
        Parameters.subscriptionId,
        Parameters.resourceGroupName,
        Parameters.serverName,
        Parameters.databaseName,
        Parameters.syncGroupName,
    ],
    headerParameters: [Parameters.accept],
    serializer,
};
const cancelSyncOperationSpec = {
    path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/cancelSync",
    httpMethod: "POST",
    responses: { 200: {}, default: {} },
    queryParameters: [Parameters.apiVersion3],
    urlParameters: [
        Parameters.$host,
        Parameters.subscriptionId,
        Parameters.resourceGroupName,
        Parameters.serverName,
        Parameters.databaseName,
        Parameters.syncGroupName,
    ],
    serializer,
};
const triggerSyncOperationSpec = {
    path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/triggerSync",
    httpMethod: "POST",
    responses: { 200: {}, default: {} },
    queryParameters: [Parameters.apiVersion3],
    urlParameters: [
        Parameters.$host,
        Parameters.subscriptionId,
        Parameters.resourceGroupName,
        Parameters.serverName,
        Parameters.databaseName,
        Parameters.syncGroupName,
    ],
    serializer,
};
const getOperationSpec = {
    path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}",
    httpMethod: "GET",
    responses: {
        200: {
            bodyMapper: Mappers.SyncGroup,
        },
        default: {},
    },
    queryParameters: [Parameters.apiVersion3],
    urlParameters: [
        Parameters.$host,
        Parameters.subscriptionId,
        Parameters.resourceGroupName,
        Parameters.serverName,
        Parameters.databaseName,
        Parameters.syncGroupName,
    ],
    headerParameters: [Parameters.accept],
    serializer,
};
const createOrUpdateOperationSpec = {
    path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}",
    httpMethod: "PUT",
    responses: {
        200: {
            bodyMapper: Mappers.SyncGroup,
        },
        201: {
            bodyMapper: Mappers.SyncGroup,
        },
        202: {
            bodyMapper: Mappers.SyncGroup,
        },
        204: {
            bodyMapper: Mappers.SyncGroup,
        },
        default: {},
    },
    requestBody: Parameters.parameters53,
    queryParameters: [Parameters.apiVersion3],
    urlParameters: [
        Parameters.$host,
        Parameters.subscriptionId,
        Parameters.resourceGroupName,
        Parameters.serverName,
        Parameters.databaseName,
        Parameters.syncGroupName,
    ],
    headerParameters: [Parameters.contentType, Parameters.accept],
    mediaType: "json",
    serializer,
};
const deleteOperationSpec = {
    path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}",
    httpMethod: "DELETE",
    responses: { 200: {}, 201: {}, 202: {}, 204: {}, default: {} },
    queryParameters: [Parameters.apiVersion3],
    urlParameters: [
        Parameters.$host,
        Parameters.subscriptionId,
        Parameters.resourceGroupName,
        Parameters.serverName,
        Parameters.databaseName,
        Parameters.syncGroupName,
    ],
    serializer,
};
const updateOperationSpec = {
    path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}",
    httpMethod: "PATCH",
    responses: {
        200: {
            bodyMapper: Mappers.SyncGroup,
        },
        201: {
            bodyMapper: Mappers.SyncGroup,
        },
        202: {
            bodyMapper: Mappers.SyncGroup,
        },
        204: {
            bodyMapper: Mappers.SyncGroup,
        },
        default: {},
    },
    requestBody: Parameters.parameters53,
    queryParameters: [Parameters.apiVersion3],
    urlParameters: [
        Parameters.$host,
        Parameters.subscriptionId,
        Parameters.resourceGroupName,
        Parameters.serverName,
        Parameters.databaseName,
        Parameters.syncGroupName,
    ],
    headerParameters: [Parameters.contentType, Parameters.accept],
    mediaType: "json",
    serializer,
};
const listByDatabaseOperationSpec = {
    path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups",
    httpMethod: "GET",
    responses: {
        200: {
            bodyMapper: Mappers.SyncGroupListResult,
        },
        default: {},
    },
    queryParameters: [Parameters.apiVersion3],
    urlParameters: [
        Parameters.$host,
        Parameters.subscriptionId,
        Parameters.resourceGroupName,
        Parameters.serverName,
        Parameters.databaseName,
    ],
    headerParameters: [Parameters.accept],
    serializer,
};
const listSyncDatabaseIdsNextOperationSpec = {
    path: "{nextLink}",
    httpMethod: "GET",
    responses: {
        200: {
            bodyMapper: Mappers.SyncDatabaseIdListResult,
        },
        default: {},
    },
    urlParameters: [
        Parameters.$host,
        Parameters.subscriptionId,
        Parameters.nextLink,
        Parameters.locationName,
    ],
    headerParameters: [Parameters.accept],
    serializer,
};
const listHubSchemasNextOperationSpec = {
    path: "{nextLink}",
    httpMethod: "GET",
    responses: {
        200: {
            bodyMapper: Mappers.SyncFullSchemaPropertiesListResult,
        },
        default: {},
    },
    urlParameters: [
        Parameters.$host,
        Parameters.subscriptionId,
        Parameters.resourceGroupName,
        Parameters.serverName,
        Parameters.databaseName,
        Parameters.nextLink,
        Parameters.syncGroupName,
    ],
    headerParameters: [Parameters.accept],
    serializer,
};
const listLogsNextOperationSpec = {
    path: "{nextLink}",
    httpMethod: "GET",
    responses: {
        200: {
            bodyMapper: Mappers.SyncGroupLogListResult,
        },
        default: {},
    },
    urlParameters: [
        Parameters.$host,
        Parameters.subscriptionId,
        Parameters.resourceGroupName,
        Parameters.serverName,
        Parameters.databaseName,
        Parameters.nextLink,
        Parameters.syncGroupName,
    ],
    headerParameters: [Parameters.accept],
    serializer,
};
const listByDatabaseNextOperationSpec = {
    path: "{nextLink}",
    httpMethod: "GET",
    responses: {
        200: {
            bodyMapper: Mappers.SyncGroupListResult,
        },
        default: {},
    },
    urlParameters: [
        Parameters.$host,
        Parameters.subscriptionId,
        Parameters.resourceGroupName,
        Parameters.serverName,
        Parameters.databaseName,
        Parameters.nextLink,
    ],
    headerParameters: [Parameters.accept],
    serializer,
};
//# sourceMappingURL=syncGroups.js.map