/* * 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"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; /// /** Class containing CertificateOrdersDiagnostics operations. */ export class CertificateOrdersDiagnosticsImpl { /** * Initialize a new instance of the class CertificateOrdersDiagnostics class. * @param client Reference to the service client */ constructor(client) { this.client = client; } /** * Description for Microsoft.CertificateRegistration to get the list of detectors for this RP. * @param resourceGroupName Name of the resource group to which the resource belongs. * @param certificateOrderName The certificate order name for which the response is needed. * @param options The options parameters. */ listAppServiceCertificateOrderDetectorResponse(resourceGroupName, certificateOrderName, options) { const iter = this.listAppServiceCertificateOrderDetectorResponsePagingAll(resourceGroupName, certificateOrderName, 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.listAppServiceCertificateOrderDetectorResponsePagingPage(resourceGroupName, certificateOrderName, options, settings); } }; } listAppServiceCertificateOrderDetectorResponsePagingPage(resourceGroupName, certificateOrderName, options, settings) { return __asyncGenerator(this, arguments, function* listAppServiceCertificateOrderDetectorResponsePagingPage_1() { let result; let continuationToken = settings === null || settings === void 0 ? void 0 : settings.continuationToken; if (!continuationToken) { result = yield __await(this._listAppServiceCertificateOrderDetectorResponse(resourceGroupName, certificateOrderName, options)); let page = result.value || []; continuationToken = result.nextLink; setContinuationToken(page, continuationToken); yield yield __await(page); } while (continuationToken) { result = yield __await(this._listAppServiceCertificateOrderDetectorResponseNext(resourceGroupName, certificateOrderName, continuationToken, options)); continuationToken = result.nextLink; let page = result.value || []; setContinuationToken(page, continuationToken); yield yield __await(page); } }); } listAppServiceCertificateOrderDetectorResponsePagingAll(resourceGroupName, certificateOrderName, options) { return __asyncGenerator(this, arguments, function* listAppServiceCertificateOrderDetectorResponsePagingAll_1() { var e_1, _a; try { for (var _b = __asyncValues(this.listAppServiceCertificateOrderDetectorResponsePagingPage(resourceGroupName, certificateOrderName, options)), _c; _c = yield __await(_b.next()), !_c.done;) { const page = _c.value; yield __await(yield* __asyncDelegator(__asyncValues(page))); } } catch (e_1_1) { e_1 = { error: e_1_1 }; } finally { try { if (_c && !_c.done && (_a = _b.return)) yield __await(_a.call(_b)); } finally { if (e_1) throw e_1.error; } } }); } /** * Description for Microsoft.CertificateRegistration to get the list of detectors for this RP. * @param resourceGroupName Name of the resource group to which the resource belongs. * @param certificateOrderName The certificate order name for which the response is needed. * @param options The options parameters. */ _listAppServiceCertificateOrderDetectorResponse(resourceGroupName, certificateOrderName, options) { return this.client.sendOperationRequest({ resourceGroupName, certificateOrderName, options }, listAppServiceCertificateOrderDetectorResponseOperationSpec); } /** * Description for Microsoft.CertificateRegistration call to get a detector response from App Lens. * @param resourceGroupName Name of the resource group to which the resource belongs. * @param certificateOrderName The certificate order name for which the response is needed. * @param detectorName The detector name which needs to be run. * @param options The options parameters. */ getAppServiceCertificateOrderDetectorResponse(resourceGroupName, certificateOrderName, detectorName, options) { return this.client.sendOperationRequest({ resourceGroupName, certificateOrderName, detectorName, options }, getAppServiceCertificateOrderDetectorResponseOperationSpec); } /** * ListAppServiceCertificateOrderDetectorResponseNext * @param resourceGroupName Name of the resource group to which the resource belongs. * @param certificateOrderName The certificate order name for which the response is needed. * @param nextLink The nextLink from the previous successful call to the * ListAppServiceCertificateOrderDetectorResponse method. * @param options The options parameters. */ _listAppServiceCertificateOrderDetectorResponseNext(resourceGroupName, certificateOrderName, nextLink, options) { return this.client.sendOperationRequest({ resourceGroupName, certificateOrderName, nextLink, options }, listAppServiceCertificateOrderDetectorResponseNextOperationSpec); } } // Operation Specifications const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); const listAppServiceCertificateOrderDetectorResponseOperationSpec = { path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CertificateRegistration/certificateOrders/{certificateOrderName}/detectors", httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.DetectorResponseCollection }, default: { bodyMapper: Mappers.DefaultErrorResponse } }, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.certificateOrderName ], headerParameters: [Parameters.accept], serializer }; const getAppServiceCertificateOrderDetectorResponseOperationSpec = { path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CertificateRegistration/certificateOrders/{certificateOrderName}/detectors/{detectorName}", httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.DetectorResponse }, default: { bodyMapper: Mappers.DefaultErrorResponse } }, queryParameters: [ Parameters.apiVersion, Parameters.startTime, Parameters.endTime, Parameters.timeGrain ], urlParameters: [ Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.certificateOrderName, Parameters.detectorName ], headerParameters: [Parameters.accept], serializer }; const listAppServiceCertificateOrderDetectorResponseNextOperationSpec = { path: "{nextLink}", httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.DetectorResponseCollection }, default: { bodyMapper: Mappers.DefaultErrorResponse } }, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.certificateOrderName, Parameters.nextLink ], headerParameters: [Parameters.accept], serializer }; //# sourceMappingURL=certificateOrdersDiagnostics.js.map