/*
 * 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 { __asyncDelegator, __asyncGenerator, __asyncValues, __await } from "tslib";
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";
/// <reference lib="esnext.asynciterable" />
/** Class containing Tag operations. */
export class TagImpl {
    /**
     * Initialize a new instance of the class Tag class.
     * @param client Reference to the service client
     */
    constructor(client) {
        this.client = client;
    }
    /**
     * Lists all Tags associated with the Operation.
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param serviceName The name of the API Management service.
     * @param apiId API revision identifier. Must be unique in the current API Management service instance.
     *              Non-current revision has ;rev=n as a suffix where n is the revision number.
     * @param operationId Operation identifier within an API. Must be unique in the current API Management
     *                    service instance.
     * @param options The options parameters.
     */
    listByOperation(resourceGroupName, serviceName, apiId, operationId, options) {
        const iter = this.listByOperationPagingAll(resourceGroupName, serviceName, apiId, operationId, options);
        return {
            next() {
                return iter.next();
            },
            [Symbol.asyncIterator]() {
                return this;
            },
            byPage: (settings) => {
                if (settings === null || settings === void 0 ? void 0 : settings.maxPageSize) {
                    throw new Error("maxPageSize is not supported by this operation.");
                }
                return this.listByOperationPagingPage(resourceGroupName, serviceName, apiId, operationId, options, settings);
            },
        };
    }
    listByOperationPagingPage(resourceGroupName, serviceName, apiId, operationId, options, settings) {
        return __asyncGenerator(this, arguments, function* listByOperationPagingPage_1() {
            let result;
            let continuationToken = settings === null || settings === void 0 ? void 0 : settings.continuationToken;
            if (!continuationToken) {
                result = yield __await(this._listByOperation(resourceGroupName, serviceName, apiId, operationId, options));
                let page = result.value || [];
                continuationToken = result.nextLink;
                setContinuationToken(page, continuationToken);
                yield yield __await(page);
            }
            while (continuationToken) {
                result = yield __await(this._listByOperationNext(resourceGroupName, serviceName, apiId, operationId, continuationToken, options));
                continuationToken = result.nextLink;
                let page = result.value || [];
                setContinuationToken(page, continuationToken);
                yield yield __await(page);
            }
        });
    }
    listByOperationPagingAll(resourceGroupName, serviceName, apiId, operationId, options) {
        return __asyncGenerator(this, arguments, function* listByOperationPagingAll_1() {
            var _a, e_1, _b, _c;
            try {
                for (var _d = true, _e = __asyncValues(this.listByOperationPagingPage(resourceGroupName, serviceName, apiId, operationId, options)), _f; _f = yield __await(_e.next()), _a = _f.done, !_a; _d = true) {
                    _c = _f.value;
                    _d = false;
                    const page = _c;
                    yield __await(yield* __asyncDelegator(__asyncValues(page)));
                }
            }
            catch (e_1_1) { e_1 = { error: e_1_1 }; }
            finally {
                try {
                    if (!_d && !_a && (_b = _e.return)) yield __await(_b.call(_e));
                }
                finally { if (e_1) throw e_1.error; }
            }
        });
    }
    /**
     * Lists all Tags associated with the API.
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param serviceName The name of the API Management service.
     * @param apiId API revision identifier. Must be unique in the current API Management service instance.
     *              Non-current revision has ;rev=n as a suffix where n is the revision number.
     * @param options The options parameters.
     */
    listByApi(resourceGroupName, serviceName, apiId, options) {
        const iter = this.listByApiPagingAll(resourceGroupName, serviceName, apiId, options);
        return {
            next() {
                return iter.next();
            },
            [Symbol.asyncIterator]() {
                return this;
            },
            byPage: (settings) => {
                if (settings === null || settings === void 0 ? void 0 : settings.maxPageSize) {
                    throw new Error("maxPageSize is not supported by this operation.");
                }
                return this.listByApiPagingPage(resourceGroupName, serviceName, apiId, options, settings);
            },
        };
    }
    listByApiPagingPage(resourceGroupName, serviceName, apiId, options, settings) {
        return __asyncGenerator(this, arguments, function* listByApiPagingPage_1() {
            let result;
            let continuationToken = settings === null || settings === void 0 ? void 0 : settings.continuationToken;
            if (!continuationToken) {
                result = yield __await(this._listByApi(resourceGroupName, serviceName, apiId, options));
                let page = result.value || [];
                continuationToken = result.nextLink;
                setContinuationToken(page, continuationToken);
                yield yield __await(page);
            }
            while (continuationToken) {
                result = yield __await(this._listByApiNext(resourceGroupName, serviceName, apiId, continuationToken, options));
                continuationToken = result.nextLink;
                let page = result.value || [];
                setContinuationToken(page, continuationToken);
                yield yield __await(page);
            }
        });
    }
    listByApiPagingAll(resourceGroupName, serviceName, apiId, options) {
        return __asyncGenerator(this, arguments, function* listByApiPagingAll_1() {
            var _a, e_2, _b, _c;
            try {
                for (var _d = true, _e = __asyncValues(this.listByApiPagingPage(resourceGroupName, serviceName, apiId, options)), _f; _f = yield __await(_e.next()), _a = _f.done, !_a; _d = true) {
                    _c = _f.value;
                    _d = false;
                    const page = _c;
                    yield __await(yield* __asyncDelegator(__asyncValues(page)));
                }
            }
            catch (e_2_1) { e_2 = { error: e_2_1 }; }
            finally {
                try {
                    if (!_d && !_a && (_b = _e.return)) yield __await(_b.call(_e));
                }
                finally { if (e_2) throw e_2.error; }
            }
        });
    }
    /**
     * Lists all Tags associated with the Product.
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param serviceName The name of the API Management service.
     * @param productId Product identifier. Must be unique in the current API Management service instance.
     * @param options The options parameters.
     */
    listByProduct(resourceGroupName, serviceName, productId, options) {
        const iter = this.listByProductPagingAll(resourceGroupName, serviceName, productId, options);
        return {
            next() {
                return iter.next();
            },
            [Symbol.asyncIterator]() {
                return this;
            },
            byPage: (settings) => {
                if (settings === null || settings === void 0 ? void 0 : settings.maxPageSize) {
                    throw new Error("maxPageSize is not supported by this operation.");
                }
                return this.listByProductPagingPage(resourceGroupName, serviceName, productId, options, settings);
            },
        };
    }
    listByProductPagingPage(resourceGroupName, serviceName, productId, options, settings) {
        return __asyncGenerator(this, arguments, function* listByProductPagingPage_1() {
            let result;
            let continuationToken = settings === null || settings === void 0 ? void 0 : settings.continuationToken;
            if (!continuationToken) {
                result = yield __await(this._listByProduct(resourceGroupName, serviceName, productId, options));
                let page = result.value || [];
                continuationToken = result.nextLink;
                setContinuationToken(page, continuationToken);
                yield yield __await(page);
            }
            while (continuationToken) {
                result = yield __await(this._listByProductNext(resourceGroupName, serviceName, productId, continuationToken, options));
                continuationToken = result.nextLink;
                let page = result.value || [];
                setContinuationToken(page, continuationToken);
                yield yield __await(page);
            }
        });
    }
    listByProductPagingAll(resourceGroupName, serviceName, productId, options) {
        return __asyncGenerator(this, arguments, function* listByProductPagingAll_1() {
            var _a, e_3, _b, _c;
            try {
                for (var _d = true, _e = __asyncValues(this.listByProductPagingPage(resourceGroupName, serviceName, productId, options)), _f; _f = yield __await(_e.next()), _a = _f.done, !_a; _d = true) {
                    _c = _f.value;
                    _d = false;
                    const page = _c;
                    yield __await(yield* __asyncDelegator(__asyncValues(page)));
                }
            }
            catch (e_3_1) { e_3 = { error: e_3_1 }; }
            finally {
                try {
                    if (!_d && !_a && (_b = _e.return)) yield __await(_b.call(_e));
                }
                finally { if (e_3) throw e_3.error; }
            }
        });
    }
    /**
     * Lists a collection of tags defined within a service instance.
     * @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.
     */
    listByService(resourceGroupName, serviceName, options) {
        const iter = this.listByServicePagingAll(resourceGroupName, serviceName, options);
        return {
            next() {
                return iter.next();
            },
            [Symbol.asyncIterator]() {
                return this;
            },
            byPage: (settings) => {
                if (settings === null || settings === void 0 ? void 0 : settings.maxPageSize) {
                    throw new Error("maxPageSize is not supported by this operation.");
                }
                return this.listByServicePagingPage(resourceGroupName, serviceName, options, settings);
            },
        };
    }
    listByServicePagingPage(resourceGroupName, serviceName, options, settings) {
        return __asyncGenerator(this, arguments, function* listByServicePagingPage_1() {
            let result;
            let continuationToken = settings === null || settings === void 0 ? void 0 : settings.continuationToken;
            if (!continuationToken) {
                result = yield __await(this._listByService(resourceGroupName, serviceName, options));
                let page = result.value || [];
                continuationToken = result.nextLink;
                setContinuationToken(page, continuationToken);
                yield yield __await(page);
            }
            while (continuationToken) {
                result = yield __await(this._listByServiceNext(resourceGroupName, serviceName, continuationToken, options));
                continuationToken = result.nextLink;
                let page = result.value || [];
                setContinuationToken(page, continuationToken);
                yield yield __await(page);
            }
        });
    }
    listByServicePagingAll(resourceGroupName, serviceName, options) {
        return __asyncGenerator(this, arguments, function* listByServicePagingAll_1() {
            var _a, e_4, _b, _c;
            try {
                for (var _d = true, _e = __asyncValues(this.listByServicePagingPage(resourceGroupName, serviceName, options)), _f; _f = yield __await(_e.next()), _a = _f.done, !_a; _d = true) {
                    _c = _f.value;
                    _d = false;
                    const page = _c;
                    yield __await(yield* __asyncDelegator(__asyncValues(page)));
                }
            }
            catch (e_4_1) { e_4 = { error: e_4_1 }; }
            finally {
                try {
                    if (!_d && !_a && (_b = _e.return)) yield __await(_b.call(_e));
                }
                finally { if (e_4) throw e_4.error; }
            }
        });
    }
    /**
     * Lists all Tags associated with the Operation.
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param serviceName The name of the API Management service.
     * @param apiId API revision identifier. Must be unique in the current API Management service instance.
     *              Non-current revision has ;rev=n as a suffix where n is the revision number.
     * @param operationId Operation identifier within an API. Must be unique in the current API Management
     *                    service instance.
     * @param options The options parameters.
     */
    _listByOperation(resourceGroupName, serviceName, apiId, operationId, options) {
        return this.client.sendOperationRequest({ resourceGroupName, serviceName, apiId, operationId, options }, listByOperationOperationSpec);
    }
    /**
     * Gets the entity state version of the tag specified by its identifier.
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param serviceName The name of the API Management service.
     * @param apiId API revision identifier. Must be unique in the current API Management service instance.
     *              Non-current revision has ;rev=n as a suffix where n is the revision number.
     * @param operationId Operation identifier within an API. Must be unique in the current API Management
     *                    service instance.
     * @param tagId Tag identifier. Must be unique in the current API Management service instance.
     * @param options The options parameters.
     */
    getEntityStateByOperation(resourceGroupName, serviceName, apiId, operationId, tagId, options) {
        return this.client.sendOperationRequest({ resourceGroupName, serviceName, apiId, operationId, tagId, options }, getEntityStateByOperationOperationSpec);
    }
    /**
     * Get tag associated with the Operation.
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param serviceName The name of the API Management service.
     * @param apiId API revision identifier. Must be unique in the current API Management service instance.
     *              Non-current revision has ;rev=n as a suffix where n is the revision number.
     * @param operationId Operation identifier within an API. Must be unique in the current API Management
     *                    service instance.
     * @param tagId Tag identifier. Must be unique in the current API Management service instance.
     * @param options The options parameters.
     */
    getByOperation(resourceGroupName, serviceName, apiId, operationId, tagId, options) {
        return this.client.sendOperationRequest({ resourceGroupName, serviceName, apiId, operationId, tagId, options }, getByOperationOperationSpec);
    }
    /**
     * Assign tag to the Operation.
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param serviceName The name of the API Management service.
     * @param apiId API revision identifier. Must be unique in the current API Management service instance.
     *              Non-current revision has ;rev=n as a suffix where n is the revision number.
     * @param operationId Operation identifier within an API. Must be unique in the current API Management
     *                    service instance.
     * @param tagId Tag identifier. Must be unique in the current API Management service instance.
     * @param options The options parameters.
     */
    assignToOperation(resourceGroupName, serviceName, apiId, operationId, tagId, options) {
        return this.client.sendOperationRequest({ resourceGroupName, serviceName, apiId, operationId, tagId, options }, assignToOperationOperationSpec);
    }
    /**
     * Detach the tag from the Operation.
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param serviceName The name of the API Management service.
     * @param apiId API revision identifier. Must be unique in the current API Management service instance.
     *              Non-current revision has ;rev=n as a suffix where n is the revision number.
     * @param operationId Operation identifier within an API. Must be unique in the current API Management
     *                    service instance.
     * @param tagId Tag identifier. Must be unique in the current API Management service instance.
     * @param options The options parameters.
     */
    detachFromOperation(resourceGroupName, serviceName, apiId, operationId, tagId, options) {
        return this.client.sendOperationRequest({ resourceGroupName, serviceName, apiId, operationId, tagId, options }, detachFromOperationOperationSpec);
    }
    /**
     * Lists all Tags associated with the API.
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param serviceName The name of the API Management service.
     * @param apiId API revision identifier. Must be unique in the current API Management service instance.
     *              Non-current revision has ;rev=n as a suffix where n is the revision number.
     * @param options The options parameters.
     */
    _listByApi(resourceGroupName, serviceName, apiId, options) {
        return this.client.sendOperationRequest({ resourceGroupName, serviceName, apiId, options }, listByApiOperationSpec);
    }
    /**
     * Gets the entity state version of the tag specified by its identifier.
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param serviceName The name of the API Management service.
     * @param apiId API revision identifier. Must be unique in the current API Management service instance.
     *              Non-current revision has ;rev=n as a suffix where n is the revision number.
     * @param tagId Tag identifier. Must be unique in the current API Management service instance.
     * @param options The options parameters.
     */
    getEntityStateByApi(resourceGroupName, serviceName, apiId, tagId, options) {
        return this.client.sendOperationRequest({ resourceGroupName, serviceName, apiId, tagId, options }, getEntityStateByApiOperationSpec);
    }
    /**
     * Get tag associated with the API.
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param serviceName The name of the API Management service.
     * @param apiId API revision identifier. Must be unique in the current API Management service instance.
     *              Non-current revision has ;rev=n as a suffix where n is the revision number.
     * @param tagId Tag identifier. Must be unique in the current API Management service instance.
     * @param options The options parameters.
     */
    getByApi(resourceGroupName, serviceName, apiId, tagId, options) {
        return this.client.sendOperationRequest({ resourceGroupName, serviceName, apiId, tagId, options }, getByApiOperationSpec);
    }
    /**
     * Assign tag to the Api.
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param serviceName The name of the API Management service.
     * @param apiId API revision identifier. Must be unique in the current API Management service instance.
     *              Non-current revision has ;rev=n as a suffix where n is the revision number.
     * @param tagId Tag identifier. Must be unique in the current API Management service instance.
     * @param options The options parameters.
     */
    assignToApi(resourceGroupName, serviceName, apiId, tagId, options) {
        return this.client.sendOperationRequest({ resourceGroupName, serviceName, apiId, tagId, options }, assignToApiOperationSpec);
    }
    /**
     * Detach the tag from the Api.
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param serviceName The name of the API Management service.
     * @param apiId API revision identifier. Must be unique in the current API Management service instance.
     *              Non-current revision has ;rev=n as a suffix where n is the revision number.
     * @param tagId Tag identifier. Must be unique in the current API Management service instance.
     * @param options The options parameters.
     */
    detachFromApi(resourceGroupName, serviceName, apiId, tagId, options) {
        return this.client.sendOperationRequest({ resourceGroupName, serviceName, apiId, tagId, options }, detachFromApiOperationSpec);
    }
    /**
     * Lists all Tags associated with the Product.
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param serviceName The name of the API Management service.
     * @param productId Product identifier. Must be unique in the current API Management service instance.
     * @param options The options parameters.
     */
    _listByProduct(resourceGroupName, serviceName, productId, options) {
        return this.client.sendOperationRequest({ resourceGroupName, serviceName, productId, options }, listByProductOperationSpec);
    }
    /**
     * Gets the entity state version of the tag specified by its identifier.
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param serviceName The name of the API Management service.
     * @param productId Product identifier. Must be unique in the current API Management service instance.
     * @param tagId Tag identifier. Must be unique in the current API Management service instance.
     * @param options The options parameters.
     */
    getEntityStateByProduct(resourceGroupName, serviceName, productId, tagId, options) {
        return this.client.sendOperationRequest({ resourceGroupName, serviceName, productId, tagId, options }, getEntityStateByProductOperationSpec);
    }
    /**
     * Get tag associated with the Product.
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param serviceName The name of the API Management service.
     * @param productId Product identifier. Must be unique in the current API Management service instance.
     * @param tagId Tag identifier. Must be unique in the current API Management service instance.
     * @param options The options parameters.
     */
    getByProduct(resourceGroupName, serviceName, productId, tagId, options) {
        return this.client.sendOperationRequest({ resourceGroupName, serviceName, productId, tagId, options }, getByProductOperationSpec);
    }
    /**
     * Assign tag to the Product.
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param serviceName The name of the API Management service.
     * @param productId Product identifier. Must be unique in the current API Management service instance.
     * @param tagId Tag identifier. Must be unique in the current API Management service instance.
     * @param options The options parameters.
     */
    assignToProduct(resourceGroupName, serviceName, productId, tagId, options) {
        return this.client.sendOperationRequest({ resourceGroupName, serviceName, productId, tagId, options }, assignToProductOperationSpec);
    }
    /**
     * Detach the tag from the Product.
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param serviceName The name of the API Management service.
     * @param productId Product identifier. Must be unique in the current API Management service instance.
     * @param tagId Tag identifier. Must be unique in the current API Management service instance.
     * @param options The options parameters.
     */
    detachFromProduct(resourceGroupName, serviceName, productId, tagId, options) {
        return this.client.sendOperationRequest({ resourceGroupName, serviceName, productId, tagId, options }, detachFromProductOperationSpec);
    }
    /**
     * Lists a collection of tags defined within a service instance.
     * @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.
     */
    _listByService(resourceGroupName, serviceName, options) {
        return this.client.sendOperationRequest({ resourceGroupName, serviceName, options }, listByServiceOperationSpec);
    }
    /**
     * Gets the entity state version of the tag specified by its identifier.
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param serviceName The name of the API Management service.
     * @param tagId Tag identifier. Must be unique in the current API Management service instance.
     * @param options The options parameters.
     */
    getEntityState(resourceGroupName, serviceName, tagId, options) {
        return this.client.sendOperationRequest({ resourceGroupName, serviceName, tagId, options }, getEntityStateOperationSpec);
    }
    /**
     * Gets the details of the tag specified by its identifier.
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param serviceName The name of the API Management service.
     * @param tagId Tag identifier. Must be unique in the current API Management service instance.
     * @param options The options parameters.
     */
    get(resourceGroupName, serviceName, tagId, options) {
        return this.client.sendOperationRequest({ resourceGroupName, serviceName, tagId, options }, getOperationSpec);
    }
    /**
     * Creates a tag.
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param serviceName The name of the API Management service.
     * @param tagId Tag identifier. Must be unique in the current API Management service instance.
     * @param parameters Create parameters.
     * @param options The options parameters.
     */
    createOrUpdate(resourceGroupName, serviceName, tagId, parameters, options) {
        return this.client.sendOperationRequest({ resourceGroupName, serviceName, tagId, parameters, options }, createOrUpdateOperationSpec);
    }
    /**
     * Updates the details of the tag specified by its identifier.
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param serviceName The name of the API Management service.
     * @param tagId Tag identifier. Must be unique in the current API Management service instance.
     * @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 parameters.
     * @param options The options parameters.
     */
    update(resourceGroupName, serviceName, tagId, ifMatch, parameters, options) {
        return this.client.sendOperationRequest({ resourceGroupName, serviceName, tagId, ifMatch, parameters, options }, updateOperationSpec);
    }
    /**
     * Deletes specific tag of the API Management service instance.
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param serviceName The name of the API Management service.
     * @param tagId Tag identifier. Must be unique in the current API Management service instance.
     * @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 options The options parameters.
     */
    delete(resourceGroupName, serviceName, tagId, ifMatch, options) {
        return this.client.sendOperationRequest({ resourceGroupName, serviceName, tagId, ifMatch, options }, deleteOperationSpec);
    }
    /**
     * ListByOperationNext
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param serviceName The name of the API Management service.
     * @param apiId API revision identifier. Must be unique in the current API Management service instance.
     *              Non-current revision has ;rev=n as a suffix where n is the revision number.
     * @param operationId Operation identifier within an API. Must be unique in the current API Management
     *                    service instance.
     * @param nextLink The nextLink from the previous successful call to the ListByOperation method.
     * @param options The options parameters.
     */
    _listByOperationNext(resourceGroupName, serviceName, apiId, operationId, nextLink, options) {
        return this.client.sendOperationRequest({ resourceGroupName, serviceName, apiId, operationId, nextLink, options }, listByOperationNextOperationSpec);
    }
    /**
     * ListByApiNext
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param serviceName The name of the API Management service.
     * @param apiId API revision identifier. Must be unique in the current API Management service instance.
     *              Non-current revision has ;rev=n as a suffix where n is the revision number.
     * @param nextLink The nextLink from the previous successful call to the ListByApi method.
     * @param options The options parameters.
     */
    _listByApiNext(resourceGroupName, serviceName, apiId, nextLink, options) {
        return this.client.sendOperationRequest({ resourceGroupName, serviceName, apiId, nextLink, options }, listByApiNextOperationSpec);
    }
    /**
     * ListByProductNext
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param serviceName The name of the API Management service.
     * @param productId Product identifier. Must be unique in the current API Management service instance.
     * @param nextLink The nextLink from the previous successful call to the ListByProduct method.
     * @param options The options parameters.
     */
    _listByProductNext(resourceGroupName, serviceName, productId, nextLink, options) {
        return this.client.sendOperationRequest({ resourceGroupName, serviceName, productId, nextLink, options }, listByProductNextOperationSpec);
    }
    /**
     * ListByServiceNext
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param serviceName The name of the API Management service.
     * @param nextLink The nextLink from the previous successful call to the ListByService method.
     * @param options The options parameters.
     */
    _listByServiceNext(resourceGroupName, serviceName, nextLink, options) {
        return this.client.sendOperationRequest({ resourceGroupName, serviceName, nextLink, options }, listByServiceNextOperationSpec);
    }
}
// Operation Specifications
const serializer = coreClient.createSerializer(Mappers, /* isXml */ false);
const listByOperationOperationSpec = {
    path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/operations/{operationId}/tags",
    httpMethod: "GET",
    responses: {
        200: {
            bodyMapper: Mappers.TagCollection,
        },
        default: {
            bodyMapper: Mappers.ErrorResponse,
        },
    },
    queryParameters: [
        Parameters.apiVersion,
        Parameters.filter,
        Parameters.top,
        Parameters.skip,
    ],
    urlParameters: [
        Parameters.$host,
        Parameters.resourceGroupName,
        Parameters.subscriptionId,
        Parameters.serviceName,
        Parameters.apiId,
        Parameters.operationId,
    ],
    headerParameters: [Parameters.accept],
    serializer,
};
const getEntityStateByOperationOperationSpec = {
    path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/operations/{operationId}/tags/{tagId}",
    httpMethod: "HEAD",
    responses: {
        200: {
            headersMapper: Mappers.TagGetEntityStateByOperationHeaders,
        },
        default: {
            bodyMapper: Mappers.ErrorResponse,
        },
    },
    queryParameters: [Parameters.apiVersion],
    urlParameters: [
        Parameters.$host,
        Parameters.resourceGroupName,
        Parameters.subscriptionId,
        Parameters.serviceName,
        Parameters.apiId,
        Parameters.operationId,
        Parameters.tagId,
    ],
    headerParameters: [Parameters.accept],
    serializer,
};
const getByOperationOperationSpec = {
    path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/operations/{operationId}/tags/{tagId}",
    httpMethod: "GET",
    responses: {
        200: {
            bodyMapper: Mappers.TagContract,
            headersMapper: Mappers.TagGetByOperationHeaders,
        },
        default: {
            bodyMapper: Mappers.ErrorResponse,
        },
    },
    queryParameters: [Parameters.apiVersion],
    urlParameters: [
        Parameters.$host,
        Parameters.resourceGroupName,
        Parameters.subscriptionId,
        Parameters.serviceName,
        Parameters.apiId,
        Parameters.operationId,
        Parameters.tagId,
    ],
    headerParameters: [Parameters.accept],
    serializer,
};
const assignToOperationOperationSpec = {
    path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/operations/{operationId}/tags/{tagId}",
    httpMethod: "PUT",
    responses: {
        200: {
            bodyMapper: Mappers.TagContract,
        },
        201: {
            bodyMapper: Mappers.TagContract,
        },
        default: {
            bodyMapper: Mappers.ErrorResponse,
        },
    },
    queryParameters: [Parameters.apiVersion],
    urlParameters: [
        Parameters.$host,
        Parameters.resourceGroupName,
        Parameters.subscriptionId,
        Parameters.serviceName,
        Parameters.apiId,
        Parameters.operationId,
        Parameters.tagId,
    ],
    headerParameters: [Parameters.accept],
    serializer,
};
const detachFromOperationOperationSpec = {
    path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/operations/{operationId}/tags/{tagId}",
    httpMethod: "DELETE",
    responses: {
        200: {},
        204: {},
        default: {
            bodyMapper: Mappers.ErrorResponse,
        },
    },
    queryParameters: [Parameters.apiVersion],
    urlParameters: [
        Parameters.$host,
        Parameters.resourceGroupName,
        Parameters.subscriptionId,
        Parameters.serviceName,
        Parameters.apiId,
        Parameters.operationId,
        Parameters.tagId,
    ],
    headerParameters: [Parameters.accept],
    serializer,
};
const listByApiOperationSpec = {
    path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/tags",
    httpMethod: "GET",
    responses: {
        200: {
            bodyMapper: Mappers.TagCollection,
        },
        default: {
            bodyMapper: Mappers.ErrorResponse,
        },
    },
    queryParameters: [
        Parameters.apiVersion,
        Parameters.filter,
        Parameters.top,
        Parameters.skip,
    ],
    urlParameters: [
        Parameters.$host,
        Parameters.resourceGroupName,
        Parameters.subscriptionId,
        Parameters.serviceName,
        Parameters.apiId,
    ],
    headerParameters: [Parameters.accept],
    serializer,
};
const getEntityStateByApiOperationSpec = {
    path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/tags/{tagId}",
    httpMethod: "HEAD",
    responses: {
        200: {
            headersMapper: Mappers.TagGetEntityStateByApiHeaders,
        },
        default: {
            bodyMapper: Mappers.ErrorResponse,
        },
    },
    queryParameters: [Parameters.apiVersion],
    urlParameters: [
        Parameters.$host,
        Parameters.resourceGroupName,
        Parameters.subscriptionId,
        Parameters.serviceName,
        Parameters.apiId,
        Parameters.tagId,
    ],
    headerParameters: [Parameters.accept],
    serializer,
};
const getByApiOperationSpec = {
    path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/tags/{tagId}",
    httpMethod: "GET",
    responses: {
        200: {
            bodyMapper: Mappers.TagContract,
            headersMapper: Mappers.TagGetByApiHeaders,
        },
        default: {
            bodyMapper: Mappers.ErrorResponse,
        },
    },
    queryParameters: [Parameters.apiVersion],
    urlParameters: [
        Parameters.$host,
        Parameters.resourceGroupName,
        Parameters.subscriptionId,
        Parameters.serviceName,
        Parameters.apiId,
        Parameters.tagId,
    ],
    headerParameters: [Parameters.accept],
    serializer,
};
const assignToApiOperationSpec = {
    path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/tags/{tagId}",
    httpMethod: "PUT",
    responses: {
        200: {
            bodyMapper: Mappers.TagContract,
            headersMapper: Mappers.TagAssignToApiHeaders,
        },
        201: {
            bodyMapper: Mappers.TagContract,
            headersMapper: Mappers.TagAssignToApiHeaders,
        },
        default: {
            bodyMapper: Mappers.ErrorResponse,
        },
    },
    queryParameters: [Parameters.apiVersion],
    urlParameters: [
        Parameters.$host,
        Parameters.resourceGroupName,
        Parameters.subscriptionId,
        Parameters.serviceName,
        Parameters.apiId,
        Parameters.tagId,
    ],
    headerParameters: [Parameters.accept],
    serializer,
};
const detachFromApiOperationSpec = {
    path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/tags/{tagId}",
    httpMethod: "DELETE",
    responses: {
        200: {},
        204: {},
        default: {
            bodyMapper: Mappers.ErrorResponse,
        },
    },
    queryParameters: [Parameters.apiVersion],
    urlParameters: [
        Parameters.$host,
        Parameters.resourceGroupName,
        Parameters.subscriptionId,
        Parameters.serviceName,
        Parameters.apiId,
        Parameters.tagId,
    ],
    headerParameters: [Parameters.accept],
    serializer,
};
const listByProductOperationSpec = {
    path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}/tags",
    httpMethod: "GET",
    responses: {
        200: {
            bodyMapper: Mappers.TagCollection,
        },
        default: {
            bodyMapper: Mappers.ErrorResponse,
        },
    },
    queryParameters: [
        Parameters.apiVersion,
        Parameters.filter,
        Parameters.top,
        Parameters.skip,
    ],
    urlParameters: [
        Parameters.$host,
        Parameters.resourceGroupName,
        Parameters.subscriptionId,
        Parameters.serviceName,
        Parameters.productId,
    ],
    headerParameters: [Parameters.accept],
    serializer,
};
const getEntityStateByProductOperationSpec = {
    path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}/tags/{tagId}",
    httpMethod: "HEAD",
    responses: {
        200: {
            headersMapper: Mappers.TagGetEntityStateByProductHeaders,
        },
        default: {
            bodyMapper: Mappers.ErrorResponse,
        },
    },
    queryParameters: [Parameters.apiVersion],
    urlParameters: [
        Parameters.$host,
        Parameters.resourceGroupName,
        Parameters.subscriptionId,
        Parameters.serviceName,
        Parameters.tagId,
        Parameters.productId,
    ],
    headerParameters: [Parameters.accept],
    serializer,
};
const getByProductOperationSpec = {
    path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}/tags/{tagId}",
    httpMethod: "GET",
    responses: {
        200: {
            bodyMapper: Mappers.TagContract,
            headersMapper: Mappers.TagGetByProductHeaders,
        },
        default: {
            bodyMapper: Mappers.ErrorResponse,
        },
    },
    queryParameters: [Parameters.apiVersion],
    urlParameters: [
        Parameters.$host,
        Parameters.resourceGroupName,
        Parameters.subscriptionId,
        Parameters.serviceName,
        Parameters.tagId,
        Parameters.productId,
    ],
    headerParameters: [Parameters.accept],
    serializer,
};
const assignToProductOperationSpec = {
    path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}/tags/{tagId}",
    httpMethod: "PUT",
    responses: {
        200: {
            bodyMapper: Mappers.TagContract,
        },
        201: {
            bodyMapper: Mappers.TagContract,
        },
        default: {
            bodyMapper: Mappers.ErrorResponse,
        },
    },
    queryParameters: [Parameters.apiVersion],
    urlParameters: [
        Parameters.$host,
        Parameters.resourceGroupName,
        Parameters.subscriptionId,
        Parameters.serviceName,
        Parameters.tagId,
        Parameters.productId,
    ],
    headerParameters: [Parameters.accept],
    serializer,
};
const detachFromProductOperationSpec = {
    path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}/tags/{tagId}",
    httpMethod: "DELETE",
    responses: {
        200: {},
        204: {},
        default: {
            bodyMapper: Mappers.ErrorResponse,
        },
    },
    queryParameters: [Parameters.apiVersion],
    urlParameters: [
        Parameters.$host,
        Parameters.resourceGroupName,
        Parameters.subscriptionId,
        Parameters.serviceName,
        Parameters.tagId,
        Parameters.productId,
    ],
    headerParameters: [Parameters.accept],
    serializer,
};
const listByServiceOperationSpec = {
    path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tags",
    httpMethod: "GET",
    responses: {
        200: {
            bodyMapper: Mappers.TagCollection,
        },
        default: {
            bodyMapper: Mappers.ErrorResponse,
        },
    },
    queryParameters: [
        Parameters.apiVersion,
        Parameters.filter,
        Parameters.top,
        Parameters.skip,
        Parameters.scope,
    ],
    urlParameters: [
        Parameters.$host,
        Parameters.resourceGroupName,
        Parameters.subscriptionId,
        Parameters.serviceName,
    ],
    headerParameters: [Parameters.accept],
    serializer,
};
const getEntityStateOperationSpec = {
    path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tags/{tagId}",
    httpMethod: "HEAD",
    responses: {
        200: {
            headersMapper: Mappers.TagGetEntityStateHeaders,
        },
        default: {
            bodyMapper: Mappers.ErrorResponse,
        },
    },
    queryParameters: [Parameters.apiVersion],
    urlParameters: [
        Parameters.$host,
        Parameters.resourceGroupName,
        Parameters.subscriptionId,
        Parameters.serviceName,
        Parameters.tagId,
    ],
    headerParameters: [Parameters.accept],
    serializer,
};
const getOperationSpec = {
    path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tags/{tagId}",
    httpMethod: "GET",
    responses: {
        200: {
            bodyMapper: Mappers.TagContract,
            headersMapper: Mappers.TagGetHeaders,
        },
        default: {
            bodyMapper: Mappers.ErrorResponse,
        },
    },
    queryParameters: [Parameters.apiVersion],
    urlParameters: [
        Parameters.$host,
        Parameters.resourceGroupName,
        Parameters.subscriptionId,
        Parameters.serviceName,
        Parameters.tagId,
    ],
    headerParameters: [Parameters.accept],
    serializer,
};
const createOrUpdateOperationSpec = {
    path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tags/{tagId}",
    httpMethod: "PUT",
    responses: {
        200: {
            bodyMapper: Mappers.TagContract,
            headersMapper: Mappers.TagCreateOrUpdateHeaders,
        },
        201: {
            bodyMapper: Mappers.TagContract,
            headersMapper: Mappers.TagCreateOrUpdateHeaders,
        },
        default: {
            bodyMapper: Mappers.ErrorResponse,
        },
    },
    requestBody: Parameters.parameters8,
    queryParameters: [Parameters.apiVersion],
    urlParameters: [
        Parameters.$host,
        Parameters.resourceGroupName,
        Parameters.subscriptionId,
        Parameters.serviceName,
        Parameters.tagId,
    ],
    headerParameters: [
        Parameters.contentType,
        Parameters.accept,
        Parameters.ifMatch,
    ],
    mediaType: "json",
    serializer,
};
const updateOperationSpec = {
    path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tags/{tagId}",
    httpMethod: "PATCH",
    responses: {
        200: {
            bodyMapper: Mappers.TagContract,
            headersMapper: Mappers.TagUpdateHeaders,
        },
        default: {
            bodyMapper: Mappers.ErrorResponse,
        },
    },
    requestBody: Parameters.parameters8,
    queryParameters: [Parameters.apiVersion],
    urlParameters: [
        Parameters.$host,
        Parameters.resourceGroupName,
        Parameters.subscriptionId,
        Parameters.serviceName,
        Parameters.tagId,
    ],
    headerParameters: [
        Parameters.contentType,
        Parameters.accept,
        Parameters.ifMatch1,
    ],
    mediaType: "json",
    serializer,
};
const deleteOperationSpec = {
    path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tags/{tagId}",
    httpMethod: "DELETE",
    responses: {
        200: {},
        204: {},
        default: {
            bodyMapper: Mappers.ErrorResponse,
        },
    },
    queryParameters: [Parameters.apiVersion],
    urlParameters: [
        Parameters.$host,
        Parameters.resourceGroupName,
        Parameters.subscriptionId,
        Parameters.serviceName,
        Parameters.tagId,
    ],
    headerParameters: [Parameters.accept, Parameters.ifMatch1],
    serializer,
};
const listByOperationNextOperationSpec = {
    path: "{nextLink}",
    httpMethod: "GET",
    responses: {
        200: {
            bodyMapper: Mappers.TagCollection,
        },
        default: {
            bodyMapper: Mappers.ErrorResponse,
        },
    },
    urlParameters: [
        Parameters.$host,
        Parameters.resourceGroupName,
        Parameters.subscriptionId,
        Parameters.nextLink,
        Parameters.serviceName,
        Parameters.apiId,
        Parameters.operationId,
    ],
    headerParameters: [Parameters.accept],
    serializer,
};
const listByApiNextOperationSpec = {
    path: "{nextLink}",
    httpMethod: "GET",
    responses: {
        200: {
            bodyMapper: Mappers.TagCollection,
        },
        default: {
            bodyMapper: Mappers.ErrorResponse,
        },
    },
    urlParameters: [
        Parameters.$host,
        Parameters.resourceGroupName,
        Parameters.subscriptionId,
        Parameters.nextLink,
        Parameters.serviceName,
        Parameters.apiId,
    ],
    headerParameters: [Parameters.accept],
    serializer,
};
const listByProductNextOperationSpec = {
    path: "{nextLink}",
    httpMethod: "GET",
    responses: {
        200: {
            bodyMapper: Mappers.TagCollection,
        },
        default: {
            bodyMapper: Mappers.ErrorResponse,
        },
    },
    urlParameters: [
        Parameters.$host,
        Parameters.resourceGroupName,
        Parameters.subscriptionId,
        Parameters.nextLink,
        Parameters.serviceName,
        Parameters.productId,
    ],
    headerParameters: [Parameters.accept],
    serializer,
};
const listByServiceNextOperationSpec = {
    path: "{nextLink}",
    httpMethod: "GET",
    responses: {
        200: {
            bodyMapper: Mappers.TagCollection,
        },
        default: {
            bodyMapper: Mappers.ErrorResponse,
        },
    },
    urlParameters: [
        Parameters.$host,
        Parameters.resourceGroupName,
        Parameters.subscriptionId,
        Parameters.nextLink,
        Parameters.serviceName,
    ],
    headerParameters: [Parameters.accept],
    serializer,
};
//# sourceMappingURL=tag.js.map