/* * 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 { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; import { setContinuationToken } from "../pagingHelper"; import { NetworkConnections } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; import { DevCenterClient } from "../devCenterClient"; import { SimplePollerLike, OperationState, createHttpPoller, } from "@azure/core-lro"; import { createLroSpec } from "../lroImpl"; import { NetworkConnection, NetworkConnectionsListBySubscriptionNextOptionalParams, NetworkConnectionsListBySubscriptionOptionalParams, NetworkConnectionsListBySubscriptionResponse, NetworkConnectionsListByResourceGroupNextOptionalParams, NetworkConnectionsListByResourceGroupOptionalParams, NetworkConnectionsListByResourceGroupResponse, HealthCheckStatusDetails, NetworkConnectionsListHealthDetailsOptionalParams, NetworkConnectionsListHealthDetailsResponse, OutboundEnvironmentEndpoint, NetworkConnectionsListOutboundNetworkDependenciesEndpointsNextOptionalParams, NetworkConnectionsListOutboundNetworkDependenciesEndpointsOptionalParams, NetworkConnectionsListOutboundNetworkDependenciesEndpointsResponse, NetworkConnectionsGetOptionalParams, NetworkConnectionsGetResponse, NetworkConnectionsCreateOrUpdateOptionalParams, NetworkConnectionsCreateOrUpdateResponse, NetworkConnectionUpdate, NetworkConnectionsUpdateOptionalParams, NetworkConnectionsUpdateResponse, NetworkConnectionsDeleteOptionalParams, NetworkConnectionsDeleteResponse, NetworkConnectionsGetHealthDetailsOptionalParams, NetworkConnectionsGetHealthDetailsResponse, NetworkConnectionsRunHealthChecksOptionalParams, NetworkConnectionsRunHealthChecksResponse, NetworkConnectionsListBySubscriptionNextResponse, NetworkConnectionsListByResourceGroupNextResponse, NetworkConnectionsListOutboundNetworkDependenciesEndpointsNextResponse, } from "../models"; /// /** Class containing NetworkConnections operations. */ export class NetworkConnectionsImpl implements NetworkConnections { private readonly client: DevCenterClient; /** * Initialize a new instance of the class NetworkConnections class. * @param client Reference to the service client */ constructor(client: DevCenterClient) { this.client = client; } /** * Lists network connections in a subscription * @param options The options parameters. */ public listBySubscription( options?: NetworkConnectionsListBySubscriptionOptionalParams, ): PagedAsyncIterableIterator { const iter = this.listBySubscriptionPagingAll(options); return { next() { return iter.next(); }, [Symbol.asyncIterator]() { return this; }, byPage: (settings?: PageSettings) => { if (settings?.maxPageSize) { throw new Error("maxPageSize is not supported by this operation."); } return this.listBySubscriptionPagingPage(options, settings); }, }; } private async *listBySubscriptionPagingPage( options?: NetworkConnectionsListBySubscriptionOptionalParams, settings?: PageSettings, ): AsyncIterableIterator { let result: NetworkConnectionsListBySubscriptionResponse; let continuationToken = settings?.continuationToken; if (!continuationToken) { result = await this._listBySubscription(options); let page = result.value || []; continuationToken = result.nextLink; setContinuationToken(page, continuationToken); yield page; } while (continuationToken) { result = await this._listBySubscriptionNext(continuationToken, options); continuationToken = result.nextLink; let page = result.value || []; setContinuationToken(page, continuationToken); yield page; } } private async *listBySubscriptionPagingAll( options?: NetworkConnectionsListBySubscriptionOptionalParams, ): AsyncIterableIterator { for await (const page of this.listBySubscriptionPagingPage(options)) { yield* page; } } /** * Lists network connections in a resource group * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param options The options parameters. */ public listByResourceGroup( resourceGroupName: string, options?: NetworkConnectionsListByResourceGroupOptionalParams, ): PagedAsyncIterableIterator { const iter = this.listByResourceGroupPagingAll(resourceGroupName, options); return { next() { return iter.next(); }, [Symbol.asyncIterator]() { return this; }, byPage: (settings?: PageSettings) => { if (settings?.maxPageSize) { throw new Error("maxPageSize is not supported by this operation."); } return this.listByResourceGroupPagingPage( resourceGroupName, options, settings, ); }, }; } private async *listByResourceGroupPagingPage( resourceGroupName: string, options?: NetworkConnectionsListByResourceGroupOptionalParams, settings?: PageSettings, ): AsyncIterableIterator { let result: NetworkConnectionsListByResourceGroupResponse; let continuationToken = settings?.continuationToken; if (!continuationToken) { result = await this._listByResourceGroup(resourceGroupName, options); let page = result.value || []; continuationToken = result.nextLink; setContinuationToken(page, continuationToken); yield page; } while (continuationToken) { result = await this._listByResourceGroupNext( resourceGroupName, continuationToken, options, ); continuationToken = result.nextLink; let page = result.value || []; setContinuationToken(page, continuationToken); yield page; } } private async *listByResourceGroupPagingAll( resourceGroupName: string, options?: NetworkConnectionsListByResourceGroupOptionalParams, ): AsyncIterableIterator { for await (const page of this.listByResourceGroupPagingPage( resourceGroupName, options, )) { yield* page; } } /** * Lists health check status details * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param networkConnectionName Name of the Network Connection that can be applied to a Pool. * @param options The options parameters. */ public listHealthDetails( resourceGroupName: string, networkConnectionName: string, options?: NetworkConnectionsListHealthDetailsOptionalParams, ): PagedAsyncIterableIterator { const iter = this.listHealthDetailsPagingAll( resourceGroupName, networkConnectionName, options, ); return { next() { return iter.next(); }, [Symbol.asyncIterator]() { return this; }, byPage: (settings?: PageSettings) => { if (settings?.maxPageSize) { throw new Error("maxPageSize is not supported by this operation."); } return this.listHealthDetailsPagingPage( resourceGroupName, networkConnectionName, options, settings, ); }, }; } private async *listHealthDetailsPagingPage( resourceGroupName: string, networkConnectionName: string, options?: NetworkConnectionsListHealthDetailsOptionalParams, _settings?: PageSettings, ): AsyncIterableIterator { let result: NetworkConnectionsListHealthDetailsResponse; result = await this._listHealthDetails( resourceGroupName, networkConnectionName, options, ); yield result.value || []; } private async *listHealthDetailsPagingAll( resourceGroupName: string, networkConnectionName: string, options?: NetworkConnectionsListHealthDetailsOptionalParams, ): AsyncIterableIterator { for await (const page of this.listHealthDetailsPagingPage( resourceGroupName, networkConnectionName, options, )) { yield* page; } } /** * Lists the endpoints that agents may call as part of Dev Box service administration. These FQDNs * should be allowed for outbound access in order for the Dev Box service to function. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param networkConnectionName Name of the Network Connection that can be applied to a Pool. * @param options The options parameters. */ public listOutboundNetworkDependenciesEndpoints( resourceGroupName: string, networkConnectionName: string, options?: NetworkConnectionsListOutboundNetworkDependenciesEndpointsOptionalParams, ): PagedAsyncIterableIterator { const iter = this.listOutboundNetworkDependenciesEndpointsPagingAll( resourceGroupName, networkConnectionName, options, ); return { next() { return iter.next(); }, [Symbol.asyncIterator]() { return this; }, byPage: (settings?: PageSettings) => { if (settings?.maxPageSize) { throw new Error("maxPageSize is not supported by this operation."); } return this.listOutboundNetworkDependenciesEndpointsPagingPage( resourceGroupName, networkConnectionName, options, settings, ); }, }; } private async *listOutboundNetworkDependenciesEndpointsPagingPage( resourceGroupName: string, networkConnectionName: string, options?: NetworkConnectionsListOutboundNetworkDependenciesEndpointsOptionalParams, settings?: PageSettings, ): AsyncIterableIterator { let result: NetworkConnectionsListOutboundNetworkDependenciesEndpointsResponse; let continuationToken = settings?.continuationToken; if (!continuationToken) { result = await this._listOutboundNetworkDependenciesEndpoints( resourceGroupName, networkConnectionName, options, ); let page = result.value || []; continuationToken = result.nextLink; setContinuationToken(page, continuationToken); yield page; } while (continuationToken) { result = await this._listOutboundNetworkDependenciesEndpointsNext( resourceGroupName, networkConnectionName, continuationToken, options, ); continuationToken = result.nextLink; let page = result.value || []; setContinuationToken(page, continuationToken); yield page; } } private async *listOutboundNetworkDependenciesEndpointsPagingAll( resourceGroupName: string, networkConnectionName: string, options?: NetworkConnectionsListOutboundNetworkDependenciesEndpointsOptionalParams, ): AsyncIterableIterator { for await (const page of this.listOutboundNetworkDependenciesEndpointsPagingPage( resourceGroupName, networkConnectionName, options, )) { yield* page; } } /** * Lists network connections in a subscription * @param options The options parameters. */ private _listBySubscription( options?: NetworkConnectionsListBySubscriptionOptionalParams, ): Promise { return this.client.sendOperationRequest( { options }, listBySubscriptionOperationSpec, ); } /** * Lists network connections in a resource group * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param options The options parameters. */ private _listByResourceGroup( resourceGroupName: string, options?: NetworkConnectionsListByResourceGroupOptionalParams, ): Promise { return this.client.sendOperationRequest( { resourceGroupName, options }, listByResourceGroupOperationSpec, ); } /** * Gets a network connection resource * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param networkConnectionName Name of the Network Connection that can be applied to a Pool. * @param options The options parameters. */ get( resourceGroupName: string, networkConnectionName: string, options?: NetworkConnectionsGetOptionalParams, ): Promise { return this.client.sendOperationRequest( { resourceGroupName, networkConnectionName, options }, getOperationSpec, ); } /** * Creates or updates a Network Connections resource * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param networkConnectionName Name of the Network Connection that can be applied to a Pool. * @param body Represents network connection * @param options The options parameters. */ async beginCreateOrUpdate( resourceGroupName: string, networkConnectionName: string, body: NetworkConnection, options?: NetworkConnectionsCreateOrUpdateOptionalParams, ): Promise< SimplePollerLike< OperationState, NetworkConnectionsCreateOrUpdateResponse > > { const directSendOperation = async ( args: coreClient.OperationArguments, spec: coreClient.OperationSpec, ): Promise => { return this.client.sendOperationRequest(args, spec); }; const sendOperationFn = async ( args: coreClient.OperationArguments, spec: coreClient.OperationSpec, ) => { let currentRawResponse: coreClient.FullOperationResponse | undefined = undefined; const providedCallback = args.options?.onResponse; const callback: coreClient.RawResponseCallback = ( rawResponse: coreClient.FullOperationResponse, flatResponse: unknown, ) => { 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, networkConnectionName, body, options }, spec: createOrUpdateOperationSpec, }); const poller = await createHttpPoller< NetworkConnectionsCreateOrUpdateResponse, OperationState >(lro, { restoreFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs, resourceLocationConfig: "azure-async-operation", }); await poller.poll(); return poller; } /** * Creates or updates a Network Connections resource * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param networkConnectionName Name of the Network Connection that can be applied to a Pool. * @param body Represents network connection * @param options The options parameters. */ async beginCreateOrUpdateAndWait( resourceGroupName: string, networkConnectionName: string, body: NetworkConnection, options?: NetworkConnectionsCreateOrUpdateOptionalParams, ): Promise { const poller = await this.beginCreateOrUpdate( resourceGroupName, networkConnectionName, body, options, ); return poller.pollUntilDone(); } /** * Partially updates a Network Connection * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param networkConnectionName Name of the Network Connection that can be applied to a Pool. * @param body Represents network connection * @param options The options parameters. */ async beginUpdate( resourceGroupName: string, networkConnectionName: string, body: NetworkConnectionUpdate, options?: NetworkConnectionsUpdateOptionalParams, ): Promise< SimplePollerLike< OperationState, NetworkConnectionsUpdateResponse > > { const directSendOperation = async ( args: coreClient.OperationArguments, spec: coreClient.OperationSpec, ): Promise => { return this.client.sendOperationRequest(args, spec); }; const sendOperationFn = async ( args: coreClient.OperationArguments, spec: coreClient.OperationSpec, ) => { let currentRawResponse: coreClient.FullOperationResponse | undefined = undefined; const providedCallback = args.options?.onResponse; const callback: coreClient.RawResponseCallback = ( rawResponse: coreClient.FullOperationResponse, flatResponse: unknown, ) => { 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, networkConnectionName, body, options }, spec: updateOperationSpec, }); const poller = await createHttpPoller< NetworkConnectionsUpdateResponse, OperationState >(lro, { restoreFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs, resourceLocationConfig: "azure-async-operation", }); await poller.poll(); return poller; } /** * Partially updates a Network Connection * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param networkConnectionName Name of the Network Connection that can be applied to a Pool. * @param body Represents network connection * @param options The options parameters. */ async beginUpdateAndWait( resourceGroupName: string, networkConnectionName: string, body: NetworkConnectionUpdate, options?: NetworkConnectionsUpdateOptionalParams, ): Promise { const poller = await this.beginUpdate( resourceGroupName, networkConnectionName, body, options, ); return poller.pollUntilDone(); } /** * Deletes a Network Connections resource * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param networkConnectionName Name of the Network Connection that can be applied to a Pool. * @param options The options parameters. */ async beginDelete( resourceGroupName: string, networkConnectionName: string, options?: NetworkConnectionsDeleteOptionalParams, ): Promise< SimplePollerLike< OperationState, NetworkConnectionsDeleteResponse > > { const directSendOperation = async ( args: coreClient.OperationArguments, spec: coreClient.OperationSpec, ): Promise => { return this.client.sendOperationRequest(args, spec); }; const sendOperationFn = async ( args: coreClient.OperationArguments, spec: coreClient.OperationSpec, ) => { let currentRawResponse: coreClient.FullOperationResponse | undefined = undefined; const providedCallback = args.options?.onResponse; const callback: coreClient.RawResponseCallback = ( rawResponse: coreClient.FullOperationResponse, flatResponse: unknown, ) => { 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, networkConnectionName, options }, spec: deleteOperationSpec, }); const poller = await createHttpPoller< NetworkConnectionsDeleteResponse, OperationState >(lro, { restoreFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs, resourceLocationConfig: "azure-async-operation", }); await poller.poll(); return poller; } /** * Deletes a Network Connections resource * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param networkConnectionName Name of the Network Connection that can be applied to a Pool. * @param options The options parameters. */ async beginDeleteAndWait( resourceGroupName: string, networkConnectionName: string, options?: NetworkConnectionsDeleteOptionalParams, ): Promise { const poller = await this.beginDelete( resourceGroupName, networkConnectionName, options, ); return poller.pollUntilDone(); } /** * Lists health check status details * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param networkConnectionName Name of the Network Connection that can be applied to a Pool. * @param options The options parameters. */ private _listHealthDetails( resourceGroupName: string, networkConnectionName: string, options?: NetworkConnectionsListHealthDetailsOptionalParams, ): Promise { return this.client.sendOperationRequest( { resourceGroupName, networkConnectionName, options }, listHealthDetailsOperationSpec, ); } /** * Gets health check status details. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param networkConnectionName Name of the Network Connection that can be applied to a Pool. * @param options The options parameters. */ getHealthDetails( resourceGroupName: string, networkConnectionName: string, options?: NetworkConnectionsGetHealthDetailsOptionalParams, ): Promise { return this.client.sendOperationRequest( { resourceGroupName, networkConnectionName, options }, getHealthDetailsOperationSpec, ); } /** * Triggers a new health check run. The execution and health check result can be tracked via the * network Connection health check details * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param networkConnectionName Name of the Network Connection that can be applied to a Pool. * @param options The options parameters. */ async beginRunHealthChecks( resourceGroupName: string, networkConnectionName: string, options?: NetworkConnectionsRunHealthChecksOptionalParams, ): Promise< SimplePollerLike< OperationState, NetworkConnectionsRunHealthChecksResponse > > { const directSendOperation = async ( args: coreClient.OperationArguments, spec: coreClient.OperationSpec, ): Promise => { return this.client.sendOperationRequest(args, spec); }; const sendOperationFn = async ( args: coreClient.OperationArguments, spec: coreClient.OperationSpec, ) => { let currentRawResponse: coreClient.FullOperationResponse | undefined = undefined; const providedCallback = args.options?.onResponse; const callback: coreClient.RawResponseCallback = ( rawResponse: coreClient.FullOperationResponse, flatResponse: unknown, ) => { 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, networkConnectionName, options }, spec: runHealthChecksOperationSpec, }); const poller = await createHttpPoller< NetworkConnectionsRunHealthChecksResponse, OperationState >(lro, { restoreFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs, resourceLocationConfig: "azure-async-operation", }); await poller.poll(); return poller; } /** * Triggers a new health check run. The execution and health check result can be tracked via the * network Connection health check details * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param networkConnectionName Name of the Network Connection that can be applied to a Pool. * @param options The options parameters. */ async beginRunHealthChecksAndWait( resourceGroupName: string, networkConnectionName: string, options?: NetworkConnectionsRunHealthChecksOptionalParams, ): Promise { const poller = await this.beginRunHealthChecks( resourceGroupName, networkConnectionName, options, ); return poller.pollUntilDone(); } /** * Lists the endpoints that agents may call as part of Dev Box service administration. These FQDNs * should be allowed for outbound access in order for the Dev Box service to function. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param networkConnectionName Name of the Network Connection that can be applied to a Pool. * @param options The options parameters. */ private _listOutboundNetworkDependenciesEndpoints( resourceGroupName: string, networkConnectionName: string, options?: NetworkConnectionsListOutboundNetworkDependenciesEndpointsOptionalParams, ): Promise { return this.client.sendOperationRequest( { resourceGroupName, networkConnectionName, options }, listOutboundNetworkDependenciesEndpointsOperationSpec, ); } /** * ListBySubscriptionNext * @param nextLink The nextLink from the previous successful call to the ListBySubscription method. * @param options The options parameters. */ private _listBySubscriptionNext( nextLink: string, options?: NetworkConnectionsListBySubscriptionNextOptionalParams, ): Promise { return this.client.sendOperationRequest( { nextLink, options }, listBySubscriptionNextOperationSpec, ); } /** * ListByResourceGroupNext * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param nextLink The nextLink from the previous successful call to the ListByResourceGroup method. * @param options The options parameters. */ private _listByResourceGroupNext( resourceGroupName: string, nextLink: string, options?: NetworkConnectionsListByResourceGroupNextOptionalParams, ): Promise { return this.client.sendOperationRequest( { resourceGroupName, nextLink, options }, listByResourceGroupNextOperationSpec, ); } /** * ListOutboundNetworkDependenciesEndpointsNext * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param networkConnectionName Name of the Network Connection that can be applied to a Pool. * @param nextLink The nextLink from the previous successful call to the * ListOutboundNetworkDependenciesEndpoints method. * @param options The options parameters. */ private _listOutboundNetworkDependenciesEndpointsNext( resourceGroupName: string, networkConnectionName: string, nextLink: string, options?: NetworkConnectionsListOutboundNetworkDependenciesEndpointsNextOptionalParams, ): Promise { return this.client.sendOperationRequest( { resourceGroupName, networkConnectionName, nextLink, options }, listOutboundNetworkDependenciesEndpointsNextOperationSpec, ); } } // Operation Specifications const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); const listBySubscriptionOperationSpec: coreClient.OperationSpec = { path: "/subscriptions/{subscriptionId}/providers/Microsoft.DevCenter/networkConnections", httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.NetworkConnectionListResult, }, default: { bodyMapper: Mappers.ErrorResponse, }, }, queryParameters: [Parameters.apiVersion, Parameters.top], urlParameters: [Parameters.$host, Parameters.subscriptionId], headerParameters: [Parameters.accept], serializer, }; const listByResourceGroupOperationSpec: coreClient.OperationSpec = { path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/networkConnections", httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.NetworkConnectionListResult, }, default: { bodyMapper: Mappers.ErrorResponse, }, }, queryParameters: [Parameters.apiVersion, Parameters.top], urlParameters: [ Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, ], headerParameters: [Parameters.accept], serializer, }; const getOperationSpec: coreClient.OperationSpec = { path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/networkConnections/{networkConnectionName}", httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.NetworkConnection, }, default: { bodyMapper: Mappers.ErrorResponse, }, }, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.networkConnectionName, ], headerParameters: [Parameters.accept], serializer, }; const createOrUpdateOperationSpec: coreClient.OperationSpec = { path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/networkConnections/{networkConnectionName}", httpMethod: "PUT", responses: { 200: { bodyMapper: Mappers.NetworkConnection, }, 201: { bodyMapper: Mappers.NetworkConnection, }, 202: { bodyMapper: Mappers.NetworkConnection, }, 204: { bodyMapper: Mappers.NetworkConnection, }, default: { bodyMapper: Mappers.ErrorResponse, }, }, requestBody: Parameters.body18, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.networkConnectionName, ], headerParameters: [Parameters.accept, Parameters.contentType], mediaType: "json", serializer, }; const updateOperationSpec: coreClient.OperationSpec = { path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/networkConnections/{networkConnectionName}", httpMethod: "PATCH", responses: { 200: { bodyMapper: Mappers.NetworkConnection, }, 201: { bodyMapper: Mappers.NetworkConnection, }, 202: { bodyMapper: Mappers.NetworkConnection, }, 204: { bodyMapper: Mappers.NetworkConnection, }, default: { bodyMapper: Mappers.ErrorResponse, }, }, requestBody: Parameters.body19, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.networkConnectionName, ], headerParameters: [Parameters.accept, Parameters.contentType], mediaType: "json", serializer, }; const deleteOperationSpec: coreClient.OperationSpec = { path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/networkConnections/{networkConnectionName}", httpMethod: "DELETE", responses: { 200: { headersMapper: Mappers.NetworkConnectionsDeleteHeaders, }, 201: { headersMapper: Mappers.NetworkConnectionsDeleteHeaders, }, 202: { headersMapper: Mappers.NetworkConnectionsDeleteHeaders, }, 204: { headersMapper: Mappers.NetworkConnectionsDeleteHeaders, }, default: { bodyMapper: Mappers.ErrorResponse, }, }, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.networkConnectionName, ], headerParameters: [Parameters.accept], serializer, }; const listHealthDetailsOperationSpec: coreClient.OperationSpec = { path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/networkConnections/{networkConnectionName}/healthChecks", httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.HealthCheckStatusDetailsListResult, }, default: { bodyMapper: Mappers.ErrorResponse, }, }, queryParameters: [Parameters.apiVersion, Parameters.top], urlParameters: [ Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.networkConnectionName, ], headerParameters: [Parameters.accept], serializer, }; const getHealthDetailsOperationSpec: coreClient.OperationSpec = { path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/networkConnections/{networkConnectionName}/healthChecks/latest", httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.HealthCheckStatusDetails, }, default: { bodyMapper: Mappers.ErrorResponse, }, }, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.networkConnectionName, ], headerParameters: [Parameters.accept], serializer, }; const runHealthChecksOperationSpec: coreClient.OperationSpec = { path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/networkConnections/{networkConnectionName}/runHealthChecks", httpMethod: "POST", responses: { 200: { headersMapper: Mappers.NetworkConnectionsRunHealthChecksHeaders, }, 201: { headersMapper: Mappers.NetworkConnectionsRunHealthChecksHeaders, }, 202: { headersMapper: Mappers.NetworkConnectionsRunHealthChecksHeaders, }, 204: { headersMapper: Mappers.NetworkConnectionsRunHealthChecksHeaders, }, default: { bodyMapper: Mappers.ErrorResponse, }, }, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.networkConnectionName, ], headerParameters: [Parameters.accept], serializer, }; const listOutboundNetworkDependenciesEndpointsOperationSpec: coreClient.OperationSpec = { path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/networkConnections/{networkConnectionName}/outboundNetworkDependenciesEndpoints", httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.OutboundEnvironmentEndpointCollection, }, default: { bodyMapper: Mappers.ErrorResponse, }, }, queryParameters: [Parameters.apiVersion, Parameters.top], urlParameters: [ Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.networkConnectionName, ], headerParameters: [Parameters.accept], serializer, }; const listBySubscriptionNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.NetworkConnectionListResult, }, default: { bodyMapper: Mappers.ErrorResponse, }, }, urlParameters: [ Parameters.$host, Parameters.subscriptionId, Parameters.nextLink, ], headerParameters: [Parameters.accept], serializer, }; const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.NetworkConnectionListResult, }, default: { bodyMapper: Mappers.ErrorResponse, }, }, urlParameters: [ Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.nextLink, ], headerParameters: [Parameters.accept], serializer, }; const listOutboundNetworkDependenciesEndpointsNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.OutboundEnvironmentEndpointCollection, }, default: { bodyMapper: Mappers.ErrorResponse, }, }, urlParameters: [ Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.nextLink, Parameters.networkConnectionName, ], headerParameters: [Parameters.accept], serializer, };