From e87523c8dfc4a141c2a265055628d5c55451445f Mon Sep 17 00:00:00 2001 From: "Jiao Di (MSFT)" Date: Thu, 29 Jan 2026 11:55:29 +0800 Subject: [PATCH 01/10] fix --- .../src/modular/buildClassicalClient.ts | 31 ++++- .../typespec-ts/src/modular/buildRootIndex.ts | 11 +- .../helpers/classicalOperationHelpers.ts | 120 ++++++++++++------ .../src/modular/helpers/operationHelpers.ts | 10 +- 4 files changed, 129 insertions(+), 43 deletions(-) diff --git a/packages/typespec-ts/src/modular/buildClassicalClient.ts b/packages/typespec-ts/src/modular/buildClassicalClient.ts index 1d143c2735..11aae5e186 100644 --- a/packages/typespec-ts/src/modular/buildClassicalClient.ts +++ b/packages/typespec-ts/src/modular/buildClassicalClient.ts @@ -37,7 +37,10 @@ import { } from "../utils/operationUtil.js"; import { useContext } from "../contextManager.js"; import { refkey } from "../framework/refkey.js"; -import { SimplePollerHelpers } from "./static-helpers-metadata.js"; +import { + PagingHelpers, + SimplePollerHelpers +} from "./static-helpers-metadata.js"; import { AzurePollingDependencies } from "./external-dependencies.js"; export function buildClassicalClient( @@ -253,7 +256,11 @@ function generateMethod( }); // add LRO helper methods if applicable - if (context.rlcOptions?.compatibilityLro && declaration?.isLro) { + if ( + context.rlcOptions?.compatibilityLro && + declaration?.isLro && + !declaration?.isLroPaging + ) { const operationStateReference = resolveReference( AzurePollingDependencies.OperationState ); @@ -291,6 +298,26 @@ function generateMethod( parameters: methodParams, statements: `return await ${declarationRefKey}(${methodParamStr});` }); + } // For LRO+Paging operations, use different return types and implementation + else if (context.rlcOptions?.compatibilityLro && declaration?.isLroPaging) { + const itemType = declaration?.lropagingFinalReturnType ?? "any"; + const pagedAsyncIterableIteratorReference = resolveReference( + PagingHelpers.PagedAsyncIterableIterator + ); + const beginListAndWaitName = normalizeName( + `beginList_${methodName}_andWait`, + NameType.Method + ); + // add begin and wait method for LRO+Paging - directly returns paged iterator + res.push({ + isAsync: false, + docs: [`@deprecated use ${methodName} instead`], + name: beginListAndWaitName, + kind: StructureKind.Method, + returnType: `${pagedAsyncIterableIteratorReference}<${itemType}>`, + parameters: methodParams, + statements: `return ${declarationRefKey}(${methodParamStr});` + }); } return res; diff --git a/packages/typespec-ts/src/modular/buildRootIndex.ts b/packages/typespec-ts/src/modular/buildRootIndex.ts index c507f9891c..72117efcbc 100644 --- a/packages/typespec-ts/src/modular/buildRootIndex.ts +++ b/packages/typespec-ts/src/modular/buildRootIndex.ts @@ -18,7 +18,10 @@ import { join } from "path/posix"; import { useContext } from "../contextManager.js"; import { reportDiagnostic } from "../lib.js"; import { NoTarget } from "@typespec/compiler"; -import { isLroOnlyOperation } from "./helpers/operationHelpers.js"; +import { + isLroAndPagingOperation, + isLroOnlyOperation +} from "./helpers/operationHelpers.js"; import { SdkContext } from "../utils/interfaces.js"; export function buildRootIndex( @@ -212,9 +215,15 @@ function exportSimplePollerLike( const hasLro = Array.from(methodMap.values()).some((operations) => { return operations.some(isLroOnlyOperation); }); + const hasLroPaging = Array.from(methodMap.values()).some((operations) => { + return operations.some(isLroAndPagingOperation); + }); if (!hasLro || context.rlcOptions?.compatibilityLro !== true) { return; } + if (!hasLroPaging || context.rlcOptions?.compatibilityLro !== true) { + return; + } const helperFile = project.getSourceFile( `${srcPath}/${ subfolder && subfolder !== "" ? subfolder + "/" : "" diff --git a/packages/typespec-ts/src/modular/helpers/classicalOperationHelpers.ts b/packages/typespec-ts/src/modular/helpers/classicalOperationHelpers.ts index 9c586ccc0f..32cfa2456b 100644 --- a/packages/typespec-ts/src/modular/helpers/classicalOperationHelpers.ts +++ b/packages/typespec-ts/src/modular/helpers/classicalOperationHelpers.ts @@ -19,7 +19,10 @@ import { ServiceOperation } from "../../utils/operationUtil.js"; import { refkey } from "../../framework/refkey.js"; import { resolveReference } from "../../framework/reference.js"; import { addDeclaration } from "../../framework/declaration.js"; -import { SimplePollerHelpers } from "../static-helpers-metadata.js"; +import { + SimplePollerHelpers, + PagingHelpers +} from "../static-helpers-metadata.js"; import { AzurePollingDependencies } from "../external-dependencies.js"; interface OperationDeclarationInfo { @@ -33,6 +36,10 @@ interface OperationDeclarationInfo { isLro?: boolean; // only set when isLro is true lroFinalReturnType?: string; + // set to true for LRO+Paging operations + isLroPaging?: boolean; + // only set when isLroPaging is true + lropagingFinalReturnType?: string; } export function getClassicalOperation( @@ -82,7 +89,9 @@ export function getClassicalOperation( oriName: operation.oriName, declarationRefKey: resolveReference(refkey(operation, "api")), isLro: declaration.isLro, - lroFinalReturnType: declaration.lroFinalReturnType + lroFinalReturnType: declaration.lroFinalReturnType, + isLroPaging: declaration.isLroPaging, + lropagingFinalReturnType: declaration.lropagingFinalReturnType }); return declaration; }); @@ -146,29 +155,48 @@ export function getClassicalOperation( docs: d.docs }); // add LRO helper methods if applicable - if (dpgContext.rlcOptions?.compatibilityLro && operationInfo?.isLro) { + if ( + dpgContext.rlcOptions?.compatibilityLro && + (operationInfo?.isLro || operationInfo?.isLroPaging) + ) { const operationStateReference = resolveReference( AzurePollingDependencies.OperationState ); const simplePollerLikeReference = resolveReference( SimplePollerHelpers.SimplePollerLike ); - const returnType = operationInfo?.lroFinalReturnType ?? "void"; const beginName = `begin_${getClassicalMethodName(d)}`; const beginAndWaitName = `${beginName}_andWait`; - properties.push({ - kind: StructureKind.PropertySignature, - name: `${normalizeName(beginName, NameType.Method)}`, - type: `(${paramStr}) => Promise<${simplePollerLikeReference}<${operationStateReference}<${returnType}>, ${returnType}>>`, - docs: [`@deprecated use ${getClassicalMethodName(d)} instead`] - }); - properties.push({ - kind: StructureKind.PropertySignature, - name: `${normalizeName(beginAndWaitName, NameType.Method)}`, - type: `(${paramStr}) => Promise<${returnType}>`, - docs: [`@deprecated use ${getClassicalMethodName(d)} instead`] - }); + if (operationInfo?.isLroPaging) { + // LRO+Paging operation + const itemType = operationInfo?.lropagingFinalReturnType ?? "any"; + const pagedAsyncIterableIteratorReference = resolveReference( + PagingHelpers.PagedAsyncIterableIterator + ); + const beginListAndWaitName = `beginList_${getClassicalMethodName(d)}_andWait`; + properties.push({ + kind: StructureKind.PropertySignature, + name: `${normalizeName(beginListAndWaitName, NameType.Method)}`, + type: `(${paramStr}) => ${pagedAsyncIterableIteratorReference}<${itemType}>`, + docs: [`@deprecated use ${getClassicalMethodName(d)} instead`] + }); + } else { + // Regular LRO operation + const returnType = operationInfo?.lroFinalReturnType ?? "void"; + properties.push({ + kind: StructureKind.PropertySignature, + name: `${normalizeName(beginName, NameType.Method)}`, + type: `(${paramStr}) => Promise<${simplePollerLikeReference}<${operationStateReference}<${returnType}>, ${returnType}>>`, + docs: [`@deprecated use ${getClassicalMethodName(d)} instead`] + }); + properties.push({ + kind: StructureKind.PropertySignature, + name: `${normalizeName(beginAndWaitName, NameType.Method)}`, + type: `(${paramStr}) => Promise<${returnType}>`, + docs: [`@deprecated use ${getClassicalMethodName(d)} instead`] + }); + } } }); } @@ -237,35 +265,49 @@ export function getClassicalOperation( // add LRO helper methods if applicable if ( dpgContext.rlcOptions?.compatibilityLro && - operationInfo?.isLro + (operationInfo?.isLro || operationInfo?.isLroPaging) ) { const getSimplePollerReference = resolveReference( SimplePollerHelpers.getSimplePoller ); const beginName = `begin_${getClassicalMethodName(d)}`; const beginAndWaitName = `${beginName}_andWait`; - ret.push( - `${normalizeName( - beginName, - NameType.Method - )}: async (${classicalParamStr}) => { - const poller = ${operationInfo?.declarationRefKey}(${ - apiParamStr - }); - await poller.submitted(); - return ${getSimplePollerReference}(poller); - }` - ); - ret.push( - `${normalizeName( - beginAndWaitName, - NameType.Method - )}: async (${classicalParamStr}) => { - return await ${operationInfo?.declarationRefKey}(${ - apiParamStr - }); - }` - ); + const beginListAndWaitName = `beginList_${getClassicalMethodName(d)}_andWait`; + + if (operationInfo?.isLroPaging) { + ret.push( + `${normalizeName( + beginListAndWaitName, + NameType.Method + )}: (${classicalParamStr}) => { + return ${operationInfo?.declarationRefKey}(${apiParamStr}); + }` + ); + } else { + // Regular LRO operation + ret.push( + `${normalizeName( + beginName, + NameType.Method + )}: async (${classicalParamStr}) => { + const poller = ${operationInfo?.declarationRefKey}(${ + apiParamStr + }); + await poller.submitted(); + return ${getSimplePollerReference}(poller); + }` + ); + ret.push( + `${normalizeName( + beginAndWaitName, + NameType.Method + )}: async (${classicalParamStr}) => { + return await ${operationInfo?.declarationRefKey}(${ + apiParamStr + }); + }` + ); + } } return ret.join(","); }) diff --git a/packages/typespec-ts/src/modular/helpers/operationHelpers.ts b/packages/typespec-ts/src/modular/helpers/operationHelpers.ts index b731804f17..ba8e65a072 100644 --- a/packages/typespec-ts/src/modular/helpers/operationHelpers.ts +++ b/packages/typespec-ts/src/modular/helpers/operationHelpers.ts @@ -553,6 +553,8 @@ export function getOperationFunction( propertyName?: string; isLro?: boolean; lroFinalReturnType?: string; + isLroPaging?: boolean; + lropagingFinalReturnType?: string; } { const operation = method[1]; // Extract required parameters @@ -714,7 +716,11 @@ function getLroAndPagingOperationFunction( method: [string[], SdkLroPagingServiceMethod], clientType: string, optionalParamName: string = "options" -): FunctionDeclarationStructure & { propertyName?: string } { +): FunctionDeclarationStructure & { + isLroPaging?: boolean; + propertyName?: string; + lropagingFinalReturnType?: string; +} { const operation = method[1]; const parameters = getOperationSignatureParameters( context, @@ -771,6 +777,8 @@ function getLroAndPagingOperationFunction( ], isAsync: false, isExported: true, + isLroPaging: true, + lropagingFinalReturnType: returnType.type, name, propertyName: normalizeName(operation.name, NameType.Property), parameters, From 7867428f3232ad3a5a6caa658255a21bca271105 Mon Sep 17 00:00:00 2001 From: "Jiao Di (MSFT)" Date: Thu, 29 Jan 2026 14:31:11 +0800 Subject: [PATCH 02/10] add case --- .../AppService/generated/typespec-ts/LICENSE | 21 + .../generated/typespec-ts/README.md | 111 + .../generated/typespec-ts/api-extractor.json | 18 + .../generated/typespec-ts/eslint.config.mjs | 14 + .../generated/typespec-ts/package.json | 249 + .../typespec-ts/review/arm-appservice.api.md | 1868 ++ .../generated/typespec-ts/rollup.config.js | 117 + .../appServiceEnvironmentResources/index.ts | 9 + .../operations.ts | 235 + .../appServiceEnvironmentResources/options.ts | 22 + .../index.ts | 5 + .../operations.ts | 74 + .../options.ts | 7 + .../src/api/globalOperationGroup/index.ts | 5 + .../api/globalOperationGroup/operations.ts | 67 + .../src/api/globalOperationGroup/options.ts | 7 + .../generated/typespec-ts/src/api/index.ts | 38 + .../typespec-ts/src/api/operations.ts | 703 + .../typespec-ts/src/api/operations/index.ts | 5 + .../src/api/operations/operations.ts | 70 + .../typespec-ts/src/api/operations/options.ts | 7 + .../generated/typespec-ts/src/api/options.ts | 63 + .../src/api/providerOperationGroup/index.ts | 19 + .../api/providerOperationGroup/operations.ts | 340 + .../src/api/providerOperationGroup/options.ts | 39 + .../recommendationsOperationGroup/index.ts | 9 + .../operations.ts | 160 + .../recommendationsOperationGroup/options.ts | 18 + .../api/staticSitesOperationGroup/index.ts | 5 + .../staticSitesOperationGroup/operations.ts | 70 + .../api/staticSitesOperationGroup/options.ts | 7 + .../src/api/webSiteManagementContext.ts | 64 + .../appServiceEnvironmentResources/index.ts | 109 + .../index.ts | 32 + .../src/classic/globalOperationGroup/index.ts | 34 + .../typespec-ts/src/classic/index.ts | 10 + .../src/classic/operations/index.ts | 28 + .../classic/providerOperationGroup/index.ts | 82 + .../recommendationsOperationGroup/index.ts | 53 + .../staticSitesOperationGroup/index.ts | 38 + .../generated/typespec-ts/src/index.ts | 254 + .../generated/typespec-ts/src/logger.ts | 5 + .../generated/typespec-ts/src/models/index.ts | 197 + .../typespec-ts/src/models/models.ts | 5057 +++++ .../src/static-helpers/cloudSettingHelpers.ts | 42 + .../src/static-helpers/pagingHelpers.ts | 245 + .../src/static-helpers/pollingHelpers.ts | 126 + .../serialization/check-prop-undefined.ts | 17 + .../src/static-helpers/urlTemplate.ts | 227 + .../src/webSiteManagementClient.ts | 248 + .../generated/typespec-ts/tsconfig.json | 23 + .../spec/AppServiceEnvironmentResource.tsp | 109 + .../test/AppService/spec/back-compatible.tsp | 322 + .../test/AppService/spec/client.tsp | 180 + .../test/AppService/spec/main.tsp | 51 + .../test/AppService/spec/models.tsp | 15732 ++++++++++++++++ .../test/AppService/spec/routes.tsp | 516 + .../test/AppService/tspconfig.yaml | 10 + .../2025-03-30/ArtifactManifestCreate.json | 79 + .../2025-03-30/ArtifactManifestDelete.json | 20 + .../2025-03-30/ArtifactManifestGet.json | 38 + .../ArtifactManifestListByArtifactStore.json | 41 + .../ArtifactManifestListCredential.json | 26 + .../ArtifactManifestUpdateState.json | 27 + .../ArtifactManifestUpdateTags.json | 48 + .../ArtifactStoreAddNFCEndPoints.json | 25 + .../ArtifactStoreApprovePrivateEndPoints.json | 25 + .../2025-03-30/ArtifactStoreCreate.json | 58 + .../ArtifactStoreCreateContainer.json | 61 + .../ArtifactStoreCreateStorage.json | 61 + .../2025-03-30/ArtifactStoreDelete.json | 19 + .../ArtifactStoreDeleteNFCEndPoints.json | 25 + .../examples/2025-03-30/ArtifactStoreGet.json | 30 + .../ArtifactStoreListNFCEndPoints.json | 31 + .../ArtifactStoreListPrivateEndPoints.json | 31 + .../ArtifactStoreRemovePrivateEndPoints.json | 25 + .../2025-03-30/ArtifactStoreUpdateTags.json | 40 + .../ArtifactStoresListByPublisherName.json | 33 + .../VirtualNetworkFunctionCreate.json | 76 + ...etworkFunctionDefinitionVersionCreate.json | 228 + ...etworkFunctionDefinitionVersionDelete.json | 20 + ...alNetworkFunctionDefinitionVersionGet.json | 87 + .../VirtualNetworkFunctionDelete.json | 19 + .../AzureCore/VirtualNetworkFunctionGet.json | 33 + .../VirtualNetworkFunctionCreate.json | 72 + ...etworkFunctionDefinitionVersionCreate.json | 228 + ...etworkFunctionDefinitionVersionDelete.json | 20 + ...alNetworkFunctionDefinitionVersionGet.json | 87 + .../VirtualNetworkFunctionDelete.json | 19 + .../VirtualNetworkFunctionGet.json | 33 + .../examples/2025-03-30/ComponentGet.json | 59 + .../ComponentListByNetworkFunction.json | 63 + .../ConfigurationGroupSchemaCreate.json | 62 + .../ConfigurationGroupSchemaDelete.json | 19 + .../ConfigurationGroupSchemaGet.json | 34 + ...urationGroupSchemaListByPublisherName.json | 37 + .../ConfigurationGroupSchemaUpdateTags.json | 44 + ...gurationGroupSchemaVersionUpdateState.json | 26 + .../ConfigurationGroupValueCreate.json | 83 + .../ConfigurationGroupValueCreateSecret.json | 81 + .../ConfigurationGroupValueDelete.json | 18 + ...nfigurationGroupValueFirstPartyCreate.json | 81 + .../ConfigurationGroupValueGet.json | 42 + ...gurationGroupValueListByResourceGroup.json | 43 + ...igurationGroupValueListBySubscription.json | 46 + .../ConfigurationGroupValueUpdateTags.json | 51 + .../examples/2025-03-30/GetOperations.json | 26 + .../2025-03-30/NetworkFunctionCreate.json | 88 + .../NetworkFunctionCreateSecret.json | 86 + .../NetworkFunctionDefinitionGroupCreate.json | 34 + .../NetworkFunctionDefinitionGroupDelete.json | 19 + .../NetworkFunctionDefinitionGroupGet.json | 24 + ...workFunctionDefinitionGroupUpdateTags.json | 32 + ...onDefinitionGroupsListByPublisherName.json | 25 + ...etworkFunctionDefinitionVersionCreate.json | 198 + ...etworkFunctionDefinitionVersionDelete.json | 20 + .../NetworkFunctionDefinitionVersionGet.json | 65 + ...nListByNetworkFunctionDefinitionGroup.json | 80 + ...kFunctionDefinitionVersionUpdateState.json | 27 + ...rkFunctionDefinitionVersionUpdateTags.json | 75 + .../2025-03-30/NetworkFunctionDelete.json | 19 + .../NetworkFunctionFirstPartyCreate.json | 86 + .../2025-03-30/NetworkFunctionGet.json | 41 + .../NetworkFunctionListByResourceGroup.json | 45 + .../NetworkFunctionListBySubscription.json | 44 + .../2025-03-30/NetworkFunctionUpdateTags.json | 51 + .../NetworkFunctionsExecuteRequest.json | 27 + .../NetworkServiceDesignGroupCreate.json | 38 + .../NetworkServiceDesignGroupDelete.json | 19 + .../NetworkServiceDesignGroupGet.json | 24 + .../NetworkServiceDesignGroupUpdateTags.json | 34 + ...erviceDesignGroupsListByPublisherName.json | 27 + .../NetworkServiceDesignVersionCreate.json | 117 + .../NetworkServiceDesignVersionDelete.json | 20 + .../NetworkServiceDesignVersionGet.json | 56 + ...ersionListByNetworkServiceDesignGroup.json | 53 + ...etworkServiceDesignVersionUpdateState.json | 27 + ...NetworkServiceDesignVersionUpdateTags.json | 60 + .../examples/2025-03-30/PublisherCreate.json | 42 + .../examples/2025-03-30/PublisherDelete.json | 18 + .../examples/2025-03-30/PublisherGet.json | 24 + .../PublisherListByResourceGroup.json | 37 + .../PublisherListBySubscription.json | 36 + .../2025-03-30/PublisherUpdateTags.json | 34 + .../ArtifactChangeState.json | 37 + .../PureProxyArtifact/ArtifactGet.json | 41 + .../PureProxyArtifact/ArtifactList.json | 30 + .../examples/2025-03-30/SiteCreate.json | 118 + .../examples/2025-03-30/SiteDelete.json | 18 + .../examples/2025-03-30/SiteGet.json | 52 + .../2025-03-30/SiteListByResourceGroup.json | 40 + .../2025-03-30/SiteListBySubscription.json | 40 + .../2025-03-30/SiteNetworkServiceCreate.json | 112 + .../2025-03-30/SiteNetworkServiceDelete.json | 18 + .../SiteNetworkServiceFirstPartyCreate.json | 110 + .../2025-03-30/SiteNetworkServiceGet.json | 52 + ...SiteNetworkServiceListByResourceGroup.json | 55 + .../SiteNetworkServiceListBySubscription.json | 54 + .../SiteNetworkServiceUpdateTags.json | 63 + ...workServicesCancelOngoingPUTOperation.json | 21 + .../examples/2025-03-30/SiteUpdateTags.json | 48 + .../generated/typespec-ts/LICENSE | 21 + .../generated/typespec-ts/README.md | 111 + .../generated/typespec-ts/api-extractor.json | 18 + .../generated/typespec-ts/eslint.config.mjs | 14 + .../generated/typespec-ts/package.json | 401 + .../review/arm-hybridnetwork.api.md | 1992 ++ .../generated/typespec-ts/rollup.config.js | 117 + .../generated/typespec-ts/sample.env | 1 + .../artifactManifestsCreateOrUpdateSample.ts | 39 + .../artifactManifestsDeleteSample.ts | 24 + .../samples-dev/artifactManifestsGetSample.ts | 30 + ...ifactManifestsListByArtifactStoreSample.ts | 33 + .../artifactManifestsListCredentialSample.ts | 30 + .../artifactManifestsUpdateSample.ts | 31 + .../artifactManifestsUpdateStateSample.ts | 31 + ...dNetworkFabricControllerEndPointsSample.ts | 35 + ...factStoresApprovePrivateEndPointsSample.ts | 30 + .../artifactStoresCreateOrUpdateSample.ts | 93 + ...eNetworkFabricControllerEndPointsSample.ts | 35 + .../samples-dev/artifactStoresDeleteSample.ts | 24 + .../samples-dev/artifactStoresGetSample.ts | 25 + .../artifactStoresListByPublisherSample.ts | 29 + ...kFabricControllerPrivateEndPointsSample.ts | 29 + ...rtifactStoresListPrivateEndPointsSample.ts | 29 + ...ifactStoresRemovePrivateEndPointsSample.ts | 30 + .../samples-dev/artifactStoresUpdateSample.ts | 27 + .../samples-dev/componentsGetSample.ts | 25 + .../componentsListByNetworkFunctionSample.ts | 29 + ...urationGroupSchemasCreateOrUpdateSample.ts | 37 + .../configurationGroupSchemasDeleteSample.ts | 28 + .../configurationGroupSchemasGetSample.ts | 29 + ...rationGroupSchemasListByPublisherSample.ts | 32 + .../configurationGroupSchemasUpdateSample.ts | 30 + ...figurationGroupSchemasUpdateStateSample.ts | 30 + ...gurationGroupValuesCreateOrUpdateSample.ts | 100 + .../configurationGroupValuesDeleteSample.ts | 24 + .../configurationGroupValuesGetSample.ts | 25 + ...ionGroupValuesListByResourceGroupSample.ts | 29 + ...tionGroupValuesListBySubscriptionSample.ts | 29 + ...onfigurationGroupValuesUpdateTagsSample.ts | 29 + ...ionDefinitionGroupsCreateOrUpdateSample.ts | 30 + ...orkFunctionDefinitionGroupsDeleteSample.ts | 28 + ...etworkFunctionDefinitionGroupsGetSample.ts | 29 + ...onDefinitionGroupsListByPublisherSample.ts | 32 + ...orkFunctionDefinitionGroupsUpdateSample.ts | 30 + ...nDefinitionVersionsCreateOrUpdateSample.ts | 235 + ...kFunctionDefinitionVersionsDeleteSample.ts | 67 + ...workFunctionDefinitionVersionsGetSample.ts | 70 + ...tByNetworkFunctionDefinitionGroupSample.ts | 33 + ...kFunctionDefinitionVersionsUpdateSample.ts | 31 + ...tionDefinitionVersionsUpdateStateSample.ts | 31 + .../networkFunctionsCreateOrUpdateSample.ts | 168 + .../networkFunctionsDeleteSample.ts | 52 + .../networkFunctionsExecuteRequestSample.ts | 33 + .../samples-dev/networkFunctionsGetSample.ts | 55 + ...tworkFunctionsListByResourceGroupSample.ts | 29 + ...etworkFunctionsListBySubscriptionSample.ts | 29 + .../networkFunctionsUpdateTagsSample.ts | 27 + ...ServiceDesignGroupsCreateOrUpdateSample.ts | 30 + .../networkServiceDesignGroupsDeleteSample.ts | 28 + .../networkServiceDesignGroupsGetSample.ts | 29 + ...erviceDesignGroupsListByPublisherSample.ts | 32 + .../networkServiceDesignGroupsUpdateSample.ts | 30 + ...rviceDesignVersionsCreateOrUpdateSample.ts | 42 + ...etworkServiceDesignVersionsDeleteSample.ts | 29 + .../networkServiceDesignVersionsGetSample.ts | 30 + ...nsListByNetworkServiceDesignGroupSample.ts | 33 + ...etworkServiceDesignVersionsUpdateSample.ts | 31 + ...kServiceDesignVersionsUpdateStateSample.ts | 31 + .../samples-dev/operationsListSample.ts | 29 + .../samples-dev/proxyArtifactGetSample.ts | 34 + .../samples-dev/proxyArtifactListSample.ts | 33 + .../proxyArtifactUpdateStateSample.ts | 32 + .../publishersCreateOrUpdateSample.ts | 27 + .../samples-dev/publishersDeleteSample.ts | 24 + .../samples-dev/publishersGetSample.ts | 25 + .../publishersListByResourceGroupSample.ts | 29 + .../publishersListBySubscriptionSample.ts | 29 + .../samples-dev/publishersUpdateSample.ts | 27 + ...iteNetworkServicesCancelOperationSample.ts | 29 + ...siteNetworkServicesCreateOrUpdateSample.ts | 82 + .../siteNetworkServicesDeleteSample.ts | 24 + .../siteNetworkServicesGetSample.ts | 25 + ...etworkServicesListByResourceGroupSample.ts | 29 + ...NetworkServicesListBySubscriptionSample.ts | 29 + .../siteNetworkServicesUpdateTagsSample.ts | 27 + .../samples-dev/sitesCreateOrUpdateSample.ts | 46 + .../samples-dev/sitesDeleteSample.ts | 24 + .../typespec-ts/samples-dev/sitesGetSample.ts | 25 + .../sitesListByResourceGroupSample.ts | 29 + .../sitesListBySubscriptionSample.ts | 29 + .../samples-dev/sitesUpdateTagsSample.ts | 27 + .../src/api/artifactManifests/index.ts | 21 + .../src/api/artifactManifests/operations.ts | 508 + .../src/api/artifactManifests/options.ts | 34 + .../src/api/artifactStores/index.ts | 29 + .../src/api/artifactStores/operations.ts | 791 + .../src/api/artifactStores/options.ts | 61 + .../typespec-ts/src/api/components/index.ts | 8 + .../src/api/components/operations.ts | 138 + .../typespec-ts/src/api/components/options.ts | 10 + .../api/configurationGroupSchemas/index.ts | 19 + .../configurationGroupSchemas/operations.ts | 422 + .../api/configurationGroupSchemas/options.ts | 31 + .../src/api/configurationGroupValues/index.ts | 19 + .../configurationGroupValues/operations.ts | 364 + .../api/configurationGroupValues/options.ts | 28 + .../src/api/hybridNetworkManagementContext.ts | 64 + .../generated/typespec-ts/src/api/index.ts | 8 + .../networkFunctionDefinitionGroups/index.ts | 11 + .../operations.ts | 343 + .../options.ts | 25 + .../index.ts | 19 + .../operations.ts | 459 + .../options.ts | 31 + .../src/api/networkFunctions/index.ts | 21 + .../src/api/networkFunctions/operations.ts | 415 + .../src/api/networkFunctions/options.ts | 34 + .../api/networkServiceDesignGroups/index.ts | 11 + .../networkServiceDesignGroups/operations.ts | 343 + .../api/networkServiceDesignGroups/options.ts | 25 + .../api/networkServiceDesignVersions/index.ts | 19 + .../operations.ts | 456 + .../networkServiceDesignVersions/options.ts | 31 + .../typespec-ts/src/api/operations/index.ts | 5 + .../src/api/operations/operations.ts | 70 + .../typespec-ts/src/api/operations/options.ts | 7 + .../src/api/proxyArtifact/index.ts | 9 + .../src/api/proxyArtifact/operations.ts | 237 + .../src/api/proxyArtifact/options.ts | 16 + .../typespec-ts/src/api/publishers/index.ts | 19 + .../src/api/publishers/operations.ts | 346 + .../typespec-ts/src/api/publishers/options.ts | 34 + .../src/api/siteNetworkServices/index.ts | 21 + .../src/api/siteNetworkServices/operations.ts | 408 + .../src/api/siteNetworkServices/options.ts | 34 + .../typespec-ts/src/api/sites/index.ts | 19 + .../typespec-ts/src/api/sites/operations.ts | 345 + .../typespec-ts/src/api/sites/options.ts | 28 + .../src/classic/artifactManifests/index.ts | 377 + .../src/classic/artifactStores/index.ts | 586 + .../src/classic/components/index.ts | 52 + .../configurationGroupSchemas/index.ts | 310 + .../classic/configurationGroupValues/index.ts | 182 + .../typespec-ts/src/classic/index.ts | 18 + .../networkFunctionDefinitionGroups/index.ts | 231 + .../index.ts | 372 + .../src/classic/networkFunctions/index.ts | 240 + .../networkServiceDesignGroups/index.ts | 223 + .../networkServiceDesignVersions/index.ts | 366 + .../src/classic/operations/index.ts | 28 + .../src/classic/proxyArtifact/index.ts | 162 + .../src/classic/publishers/index.ts | 161 + .../src/classic/siteNetworkServices/index.ts | 216 + .../typespec-ts/src/classic/sites/index.ts | 161 + .../src/hybridNetworkManagementClient.ts | 132 + .../generated/typespec-ts/src/index.ts | 354 + .../generated/typespec-ts/src/logger.ts | 5 + .../generated/typespec-ts/src/models/index.ts | 212 + .../typespec-ts/src/models/models.ts | 5731 ++++++ .../typespec-ts/src/restorePollerHelpers.ts | 337 + .../src/static-helpers/cloudSettingHelpers.ts | 42 + .../src/static-helpers/pagingHelpers.ts | 245 + .../src/static-helpers/pollingHelpers.ts | 126 + .../src/static-helpers/simplePollerHelpers.ts | 119 + .../src/static-helpers/urlTemplate.ts | 227 + .../generated/typespec-ts/tsconfig.json | 26 + .../spec/ArtifactManifest.tsp | 100 + .../spec/ArtifactStore.tsp | 261 + .../spec/Component.tsp | 42 + .../spec/ConfigurationGroupSchema.tsp | 100 + .../spec/ConfigurationGroupValue.tsp | 87 + .../spec/NetworkFunction.tsp | 118 + .../spec/NetworkFunctionDefinitionGroup.tsp | 82 + .../spec/NetworkFunctionDefinitionVersion.tsp | 100 + .../spec/NetworkServiceDesignGroup.tsp | 82 + .../spec/NetworkServiceDesignVersion.tsp | 102 + .../spec/Publisher.tsp | 87 + .../HybridNetwork.Management/spec/Site.tsp | 77 + .../spec/SiteNetworkService.tsp | 88 + .../spec/back-compatible.tsp | 118 + .../HybridNetwork.Management/spec/client.tsp | 106 + .../HybridNetwork.Management/spec/main.tsp | 58 + .../HybridNetwork.Management/spec/models.tsp | 2566 +++ .../HybridNetwork.Management/spec/routes.tsp | 36 + .../HybridNetwork.Management/tspconfig.yaml | 10 + 347 files changed, 61014 insertions(+) create mode 100644 packages/typespec-test/test/AppService/generated/typespec-ts/LICENSE create mode 100644 packages/typespec-test/test/AppService/generated/typespec-ts/README.md create mode 100644 packages/typespec-test/test/AppService/generated/typespec-ts/api-extractor.json create mode 100644 packages/typespec-test/test/AppService/generated/typespec-ts/eslint.config.mjs create mode 100644 packages/typespec-test/test/AppService/generated/typespec-ts/package.json create mode 100644 packages/typespec-test/test/AppService/generated/typespec-ts/review/arm-appservice.api.md create mode 100644 packages/typespec-test/test/AppService/generated/typespec-ts/rollup.config.js create mode 100644 packages/typespec-test/test/AppService/generated/typespec-ts/src/api/appServiceEnvironmentResources/index.ts create mode 100644 packages/typespec-test/test/AppService/generated/typespec-ts/src/api/appServiceEnvironmentResources/operations.ts create mode 100644 packages/typespec-test/test/AppService/generated/typespec-ts/src/api/appServiceEnvironmentResources/options.ts create mode 100644 packages/typespec-test/test/AppService/generated/typespec-ts/src/api/getUsagesInLocationOperationGroup/index.ts create mode 100644 packages/typespec-test/test/AppService/generated/typespec-ts/src/api/getUsagesInLocationOperationGroup/operations.ts create mode 100644 packages/typespec-test/test/AppService/generated/typespec-ts/src/api/getUsagesInLocationOperationGroup/options.ts create mode 100644 packages/typespec-test/test/AppService/generated/typespec-ts/src/api/globalOperationGroup/index.ts create mode 100644 packages/typespec-test/test/AppService/generated/typespec-ts/src/api/globalOperationGroup/operations.ts create mode 100644 packages/typespec-test/test/AppService/generated/typespec-ts/src/api/globalOperationGroup/options.ts create mode 100644 packages/typespec-test/test/AppService/generated/typespec-ts/src/api/index.ts create mode 100644 packages/typespec-test/test/AppService/generated/typespec-ts/src/api/operations.ts create mode 100644 packages/typespec-test/test/AppService/generated/typespec-ts/src/api/operations/index.ts create mode 100644 packages/typespec-test/test/AppService/generated/typespec-ts/src/api/operations/operations.ts create mode 100644 packages/typespec-test/test/AppService/generated/typespec-ts/src/api/operations/options.ts create mode 100644 packages/typespec-test/test/AppService/generated/typespec-ts/src/api/options.ts create mode 100644 packages/typespec-test/test/AppService/generated/typespec-ts/src/api/providerOperationGroup/index.ts create mode 100644 packages/typespec-test/test/AppService/generated/typespec-ts/src/api/providerOperationGroup/operations.ts create mode 100644 packages/typespec-test/test/AppService/generated/typespec-ts/src/api/providerOperationGroup/options.ts create mode 100644 packages/typespec-test/test/AppService/generated/typespec-ts/src/api/recommendationsOperationGroup/index.ts create mode 100644 packages/typespec-test/test/AppService/generated/typespec-ts/src/api/recommendationsOperationGroup/operations.ts create mode 100644 packages/typespec-test/test/AppService/generated/typespec-ts/src/api/recommendationsOperationGroup/options.ts create mode 100644 packages/typespec-test/test/AppService/generated/typespec-ts/src/api/staticSitesOperationGroup/index.ts create mode 100644 packages/typespec-test/test/AppService/generated/typespec-ts/src/api/staticSitesOperationGroup/operations.ts create mode 100644 packages/typespec-test/test/AppService/generated/typespec-ts/src/api/staticSitesOperationGroup/options.ts create mode 100644 packages/typespec-test/test/AppService/generated/typespec-ts/src/api/webSiteManagementContext.ts create mode 100644 packages/typespec-test/test/AppService/generated/typespec-ts/src/classic/appServiceEnvironmentResources/index.ts create mode 100644 packages/typespec-test/test/AppService/generated/typespec-ts/src/classic/getUsagesInLocationOperationGroup/index.ts create mode 100644 packages/typespec-test/test/AppService/generated/typespec-ts/src/classic/globalOperationGroup/index.ts create mode 100644 packages/typespec-test/test/AppService/generated/typespec-ts/src/classic/index.ts create mode 100644 packages/typespec-test/test/AppService/generated/typespec-ts/src/classic/operations/index.ts create mode 100644 packages/typespec-test/test/AppService/generated/typespec-ts/src/classic/providerOperationGroup/index.ts create mode 100644 packages/typespec-test/test/AppService/generated/typespec-ts/src/classic/recommendationsOperationGroup/index.ts create mode 100644 packages/typespec-test/test/AppService/generated/typespec-ts/src/classic/staticSitesOperationGroup/index.ts create mode 100644 packages/typespec-test/test/AppService/generated/typespec-ts/src/index.ts create mode 100644 packages/typespec-test/test/AppService/generated/typespec-ts/src/logger.ts create mode 100644 packages/typespec-test/test/AppService/generated/typespec-ts/src/models/index.ts create mode 100644 packages/typespec-test/test/AppService/generated/typespec-ts/src/models/models.ts create mode 100644 packages/typespec-test/test/AppService/generated/typespec-ts/src/static-helpers/cloudSettingHelpers.ts create mode 100644 packages/typespec-test/test/AppService/generated/typespec-ts/src/static-helpers/pagingHelpers.ts create mode 100644 packages/typespec-test/test/AppService/generated/typespec-ts/src/static-helpers/pollingHelpers.ts create mode 100644 packages/typespec-test/test/AppService/generated/typespec-ts/src/static-helpers/serialization/check-prop-undefined.ts create mode 100644 packages/typespec-test/test/AppService/generated/typespec-ts/src/static-helpers/urlTemplate.ts create mode 100644 packages/typespec-test/test/AppService/generated/typespec-ts/src/webSiteManagementClient.ts create mode 100644 packages/typespec-test/test/AppService/generated/typespec-ts/tsconfig.json create mode 100644 packages/typespec-test/test/AppService/spec/AppServiceEnvironmentResource.tsp create mode 100644 packages/typespec-test/test/AppService/spec/back-compatible.tsp create mode 100644 packages/typespec-test/test/AppService/spec/client.tsp create mode 100644 packages/typespec-test/test/AppService/spec/main.tsp create mode 100644 packages/typespec-test/test/AppService/spec/models.tsp create mode 100644 packages/typespec-test/test/AppService/spec/routes.tsp create mode 100644 packages/typespec-test/test/AppService/tspconfig.yaml create mode 100644 packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ArtifactManifestCreate.json create mode 100644 packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ArtifactManifestDelete.json create mode 100644 packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ArtifactManifestGet.json create mode 100644 packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ArtifactManifestListByArtifactStore.json create mode 100644 packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ArtifactManifestListCredential.json create mode 100644 packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ArtifactManifestUpdateState.json create mode 100644 packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ArtifactManifestUpdateTags.json create mode 100644 packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ArtifactStoreAddNFCEndPoints.json create mode 100644 packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ArtifactStoreApprovePrivateEndPoints.json create mode 100644 packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ArtifactStoreCreate.json create mode 100644 packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ArtifactStoreCreateContainer.json create mode 100644 packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ArtifactStoreCreateStorage.json create mode 100644 packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ArtifactStoreDelete.json create mode 100644 packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ArtifactStoreDeleteNFCEndPoints.json create mode 100644 packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ArtifactStoreGet.json create mode 100644 packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ArtifactStoreListNFCEndPoints.json create mode 100644 packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ArtifactStoreListPrivateEndPoints.json create mode 100644 packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ArtifactStoreRemovePrivateEndPoints.json create mode 100644 packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ArtifactStoreUpdateTags.json create mode 100644 packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ArtifactStoresListByPublisherName.json create mode 100644 packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/AzureCore/VirtualNetworkFunctionCreate.json create mode 100644 packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/AzureCore/VirtualNetworkFunctionDefinitionVersionCreate.json create mode 100644 packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/AzureCore/VirtualNetworkFunctionDefinitionVersionDelete.json create mode 100644 packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/AzureCore/VirtualNetworkFunctionDefinitionVersionGet.json create mode 100644 packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/AzureCore/VirtualNetworkFunctionDelete.json create mode 100644 packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/AzureCore/VirtualNetworkFunctionGet.json create mode 100644 packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/AzureOperatorNexus/VirtualNetworkFunctionCreate.json create mode 100644 packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/AzureOperatorNexus/VirtualNetworkFunctionDefinitionVersionCreate.json create mode 100644 packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/AzureOperatorNexus/VirtualNetworkFunctionDefinitionVersionDelete.json create mode 100644 packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/AzureOperatorNexus/VirtualNetworkFunctionDefinitionVersionGet.json create mode 100644 packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/AzureOperatorNexus/VirtualNetworkFunctionDelete.json create mode 100644 packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/AzureOperatorNexus/VirtualNetworkFunctionGet.json create mode 100644 packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ComponentGet.json create mode 100644 packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ComponentListByNetworkFunction.json create mode 100644 packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ConfigurationGroupSchemaCreate.json create mode 100644 packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ConfigurationGroupSchemaDelete.json create mode 100644 packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ConfigurationGroupSchemaGet.json create mode 100644 packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ConfigurationGroupSchemaListByPublisherName.json create mode 100644 packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ConfigurationGroupSchemaUpdateTags.json create mode 100644 packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ConfigurationGroupSchemaVersionUpdateState.json create mode 100644 packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ConfigurationGroupValueCreate.json create mode 100644 packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ConfigurationGroupValueCreateSecret.json create mode 100644 packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ConfigurationGroupValueDelete.json create mode 100644 packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ConfigurationGroupValueFirstPartyCreate.json create mode 100644 packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ConfigurationGroupValueGet.json create mode 100644 packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ConfigurationGroupValueListByResourceGroup.json create mode 100644 packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ConfigurationGroupValueListBySubscription.json create mode 100644 packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ConfigurationGroupValueUpdateTags.json create mode 100644 packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/GetOperations.json create mode 100644 packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkFunctionCreate.json create mode 100644 packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkFunctionCreateSecret.json create mode 100644 packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkFunctionDefinitionGroupCreate.json create mode 100644 packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkFunctionDefinitionGroupDelete.json create mode 100644 packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkFunctionDefinitionGroupGet.json create mode 100644 packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkFunctionDefinitionGroupUpdateTags.json create mode 100644 packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkFunctionDefinitionGroupsListByPublisherName.json create mode 100644 packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkFunctionDefinitionVersionCreate.json create mode 100644 packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkFunctionDefinitionVersionDelete.json create mode 100644 packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkFunctionDefinitionVersionGet.json create mode 100644 packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkFunctionDefinitionVersionListByNetworkFunctionDefinitionGroup.json create mode 100644 packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkFunctionDefinitionVersionUpdateState.json create mode 100644 packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkFunctionDefinitionVersionUpdateTags.json create mode 100644 packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkFunctionDelete.json create mode 100644 packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkFunctionFirstPartyCreate.json create mode 100644 packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkFunctionGet.json create mode 100644 packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkFunctionListByResourceGroup.json create mode 100644 packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkFunctionListBySubscription.json create mode 100644 packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkFunctionUpdateTags.json create mode 100644 packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkFunctionsExecuteRequest.json create mode 100644 packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkServiceDesignGroupCreate.json create mode 100644 packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkServiceDesignGroupDelete.json create mode 100644 packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkServiceDesignGroupGet.json create mode 100644 packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkServiceDesignGroupUpdateTags.json create mode 100644 packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkServiceDesignGroupsListByPublisherName.json create mode 100644 packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkServiceDesignVersionCreate.json create mode 100644 packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkServiceDesignVersionDelete.json create mode 100644 packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkServiceDesignVersionGet.json create mode 100644 packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkServiceDesignVersionListByNetworkServiceDesignGroup.json create mode 100644 packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkServiceDesignVersionUpdateState.json create mode 100644 packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkServiceDesignVersionUpdateTags.json create mode 100644 packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/PublisherCreate.json create mode 100644 packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/PublisherDelete.json create mode 100644 packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/PublisherGet.json create mode 100644 packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/PublisherListByResourceGroup.json create mode 100644 packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/PublisherListBySubscription.json create mode 100644 packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/PublisherUpdateTags.json create mode 100644 packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/PureProxyArtifact/ArtifactChangeState.json create mode 100644 packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/PureProxyArtifact/ArtifactGet.json create mode 100644 packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/PureProxyArtifact/ArtifactList.json create mode 100644 packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/SiteCreate.json create mode 100644 packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/SiteDelete.json create mode 100644 packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/SiteGet.json create mode 100644 packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/SiteListByResourceGroup.json create mode 100644 packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/SiteListBySubscription.json create mode 100644 packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/SiteNetworkServiceCreate.json create mode 100644 packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/SiteNetworkServiceDelete.json create mode 100644 packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/SiteNetworkServiceFirstPartyCreate.json create mode 100644 packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/SiteNetworkServiceGet.json create mode 100644 packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/SiteNetworkServiceListByResourceGroup.json create mode 100644 packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/SiteNetworkServiceListBySubscription.json create mode 100644 packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/SiteNetworkServiceUpdateTags.json create mode 100644 packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/SiteNetworkServicesCancelOngoingPUTOperation.json create mode 100644 packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/SiteUpdateTags.json create mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/LICENSE create mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/README.md create mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/api-extractor.json create mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/eslint.config.mjs create mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/package.json create mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/review/arm-hybridnetwork.api.md create mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/rollup.config.js create mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/sample.env create mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/artifactManifestsCreateOrUpdateSample.ts create mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/artifactManifestsDeleteSample.ts create mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/artifactManifestsGetSample.ts create mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/artifactManifestsListByArtifactStoreSample.ts create mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/artifactManifestsListCredentialSample.ts create mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/artifactManifestsUpdateSample.ts create mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/artifactManifestsUpdateStateSample.ts create mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/artifactStoresAddNetworkFabricControllerEndPointsSample.ts create mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/artifactStoresApprovePrivateEndPointsSample.ts create mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/artifactStoresCreateOrUpdateSample.ts create mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/artifactStoresDeleteNetworkFabricControllerEndPointsSample.ts create mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/artifactStoresDeleteSample.ts create mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/artifactStoresGetSample.ts create mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/artifactStoresListByPublisherSample.ts create mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/artifactStoresListNetworkFabricControllerPrivateEndPointsSample.ts create mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/artifactStoresListPrivateEndPointsSample.ts create mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/artifactStoresRemovePrivateEndPointsSample.ts create mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/artifactStoresUpdateSample.ts create mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/componentsGetSample.ts create mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/componentsListByNetworkFunctionSample.ts create mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/configurationGroupSchemasCreateOrUpdateSample.ts create mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/configurationGroupSchemasDeleteSample.ts create mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/configurationGroupSchemasGetSample.ts create mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/configurationGroupSchemasListByPublisherSample.ts create mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/configurationGroupSchemasUpdateSample.ts create mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/configurationGroupSchemasUpdateStateSample.ts create mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/configurationGroupValuesCreateOrUpdateSample.ts create mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/configurationGroupValuesDeleteSample.ts create mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/configurationGroupValuesGetSample.ts create mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/configurationGroupValuesListByResourceGroupSample.ts create mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/configurationGroupValuesListBySubscriptionSample.ts create mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/configurationGroupValuesUpdateTagsSample.ts create mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/networkFunctionDefinitionGroupsCreateOrUpdateSample.ts create mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/networkFunctionDefinitionGroupsDeleteSample.ts create mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/networkFunctionDefinitionGroupsGetSample.ts create mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/networkFunctionDefinitionGroupsListByPublisherSample.ts create mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/networkFunctionDefinitionGroupsUpdateSample.ts create mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/networkFunctionDefinitionVersionsCreateOrUpdateSample.ts create mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/networkFunctionDefinitionVersionsDeleteSample.ts create mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/networkFunctionDefinitionVersionsGetSample.ts create mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/networkFunctionDefinitionVersionsListByNetworkFunctionDefinitionGroupSample.ts create mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/networkFunctionDefinitionVersionsUpdateSample.ts create mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/networkFunctionDefinitionVersionsUpdateStateSample.ts create mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/networkFunctionsCreateOrUpdateSample.ts create mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/networkFunctionsDeleteSample.ts create mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/networkFunctionsExecuteRequestSample.ts create mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/networkFunctionsGetSample.ts create mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/networkFunctionsListByResourceGroupSample.ts create mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/networkFunctionsListBySubscriptionSample.ts create mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/networkFunctionsUpdateTagsSample.ts create mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/networkServiceDesignGroupsCreateOrUpdateSample.ts create mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/networkServiceDesignGroupsDeleteSample.ts create mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/networkServiceDesignGroupsGetSample.ts create mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/networkServiceDesignGroupsListByPublisherSample.ts create mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/networkServiceDesignGroupsUpdateSample.ts create mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/networkServiceDesignVersionsCreateOrUpdateSample.ts create mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/networkServiceDesignVersionsDeleteSample.ts create mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/networkServiceDesignVersionsGetSample.ts create mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/networkServiceDesignVersionsListByNetworkServiceDesignGroupSample.ts create mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/networkServiceDesignVersionsUpdateSample.ts create mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/networkServiceDesignVersionsUpdateStateSample.ts create mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/operationsListSample.ts create mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/proxyArtifactGetSample.ts create mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/proxyArtifactListSample.ts create mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/proxyArtifactUpdateStateSample.ts create mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/publishersCreateOrUpdateSample.ts create mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/publishersDeleteSample.ts create mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/publishersGetSample.ts create mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/publishersListByResourceGroupSample.ts create mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/publishersListBySubscriptionSample.ts create mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/publishersUpdateSample.ts create mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/siteNetworkServicesCancelOperationSample.ts create mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/siteNetworkServicesCreateOrUpdateSample.ts create mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/siteNetworkServicesDeleteSample.ts create mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/siteNetworkServicesGetSample.ts create mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/siteNetworkServicesListByResourceGroupSample.ts create mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/siteNetworkServicesListBySubscriptionSample.ts create mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/siteNetworkServicesUpdateTagsSample.ts create mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/sitesCreateOrUpdateSample.ts create mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/sitesDeleteSample.ts create mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/sitesGetSample.ts create mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/sitesListByResourceGroupSample.ts create mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/sitesListBySubscriptionSample.ts create mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/sitesUpdateTagsSample.ts create mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/artifactManifests/index.ts create mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/artifactManifests/operations.ts create mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/artifactManifests/options.ts create mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/artifactStores/index.ts create mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/artifactStores/operations.ts create mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/artifactStores/options.ts create mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/components/index.ts create mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/components/operations.ts create mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/components/options.ts create mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/configurationGroupSchemas/index.ts create mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/configurationGroupSchemas/operations.ts create mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/configurationGroupSchemas/options.ts create mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/configurationGroupValues/index.ts create mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/configurationGroupValues/operations.ts create mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/configurationGroupValues/options.ts create mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/hybridNetworkManagementContext.ts create mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/index.ts create mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/networkFunctionDefinitionGroups/index.ts create mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/networkFunctionDefinitionGroups/operations.ts create mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/networkFunctionDefinitionGroups/options.ts create mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/networkFunctionDefinitionVersions/index.ts create mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/networkFunctionDefinitionVersions/operations.ts create mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/networkFunctionDefinitionVersions/options.ts create mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/networkFunctions/index.ts create mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/networkFunctions/operations.ts create mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/networkFunctions/options.ts create mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/networkServiceDesignGroups/index.ts create mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/networkServiceDesignGroups/operations.ts create mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/networkServiceDesignGroups/options.ts create mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/networkServiceDesignVersions/index.ts create mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/networkServiceDesignVersions/operations.ts create mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/networkServiceDesignVersions/options.ts create mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/operations/index.ts create mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/operations/operations.ts create mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/operations/options.ts create mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/proxyArtifact/index.ts create mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/proxyArtifact/operations.ts create mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/proxyArtifact/options.ts create mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/publishers/index.ts create mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/publishers/operations.ts create mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/publishers/options.ts create mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/siteNetworkServices/index.ts create mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/siteNetworkServices/operations.ts create mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/siteNetworkServices/options.ts create mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/sites/index.ts create mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/sites/operations.ts create mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/sites/options.ts create mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/classic/artifactManifests/index.ts create mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/classic/artifactStores/index.ts create mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/classic/components/index.ts create mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/classic/configurationGroupSchemas/index.ts create mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/classic/configurationGroupValues/index.ts create mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/classic/index.ts create mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/classic/networkFunctionDefinitionGroups/index.ts create mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/classic/networkFunctionDefinitionVersions/index.ts create mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/classic/networkFunctions/index.ts create mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/classic/networkServiceDesignGroups/index.ts create mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/classic/networkServiceDesignVersions/index.ts create mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/classic/operations/index.ts create mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/classic/proxyArtifact/index.ts create mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/classic/publishers/index.ts create mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/classic/siteNetworkServices/index.ts create mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/classic/sites/index.ts create mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/hybridNetworkManagementClient.ts create mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/index.ts create mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/logger.ts create mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/models/index.ts create mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/models/models.ts create mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/restorePollerHelpers.ts create mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/static-helpers/cloudSettingHelpers.ts create mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/static-helpers/pagingHelpers.ts create mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/static-helpers/pollingHelpers.ts create mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/static-helpers/simplePollerHelpers.ts create mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/static-helpers/urlTemplate.ts create mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/tsconfig.json create mode 100644 packages/typespec-test/test/HybridNetwork.Management/spec/ArtifactManifest.tsp create mode 100644 packages/typespec-test/test/HybridNetwork.Management/spec/ArtifactStore.tsp create mode 100644 packages/typespec-test/test/HybridNetwork.Management/spec/Component.tsp create mode 100644 packages/typespec-test/test/HybridNetwork.Management/spec/ConfigurationGroupSchema.tsp create mode 100644 packages/typespec-test/test/HybridNetwork.Management/spec/ConfigurationGroupValue.tsp create mode 100644 packages/typespec-test/test/HybridNetwork.Management/spec/NetworkFunction.tsp create mode 100644 packages/typespec-test/test/HybridNetwork.Management/spec/NetworkFunctionDefinitionGroup.tsp create mode 100644 packages/typespec-test/test/HybridNetwork.Management/spec/NetworkFunctionDefinitionVersion.tsp create mode 100644 packages/typespec-test/test/HybridNetwork.Management/spec/NetworkServiceDesignGroup.tsp create mode 100644 packages/typespec-test/test/HybridNetwork.Management/spec/NetworkServiceDesignVersion.tsp create mode 100644 packages/typespec-test/test/HybridNetwork.Management/spec/Publisher.tsp create mode 100644 packages/typespec-test/test/HybridNetwork.Management/spec/Site.tsp create mode 100644 packages/typespec-test/test/HybridNetwork.Management/spec/SiteNetworkService.tsp create mode 100644 packages/typespec-test/test/HybridNetwork.Management/spec/back-compatible.tsp create mode 100644 packages/typespec-test/test/HybridNetwork.Management/spec/client.tsp create mode 100644 packages/typespec-test/test/HybridNetwork.Management/spec/main.tsp create mode 100644 packages/typespec-test/test/HybridNetwork.Management/spec/models.tsp create mode 100644 packages/typespec-test/test/HybridNetwork.Management/spec/routes.tsp create mode 100644 packages/typespec-test/test/HybridNetwork.Management/tspconfig.yaml diff --git a/packages/typespec-test/test/AppService/generated/typespec-ts/LICENSE b/packages/typespec-test/test/AppService/generated/typespec-ts/LICENSE new file mode 100644 index 0000000000..63447fd8bb --- /dev/null +++ b/packages/typespec-test/test/AppService/generated/typespec-ts/LICENSE @@ -0,0 +1,21 @@ +Copyright (c) Microsoft Corporation. + +MIT License + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file diff --git a/packages/typespec-test/test/AppService/generated/typespec-ts/README.md b/packages/typespec-test/test/AppService/generated/typespec-ts/README.md new file mode 100644 index 0000000000..9d339701f0 --- /dev/null +++ b/packages/typespec-test/test/AppService/generated/typespec-ts/README.md @@ -0,0 +1,111 @@ +# Azure WebApps API client library for JavaScript + +This package contains an isomorphic SDK (runs both in Node.js and in browsers) for Azure WebApps API client. + + + +Key links: + +- [Package (NPM)](https://www.npmjs.com/package/@azure/arm-appservice) +- [API reference documentation](https://learn.microsoft.com/javascript/api/@azure/arm-appservice) + +## Getting started + +### Currently supported environments + +- [LTS versions of Node.js](https://github.com/nodejs/release#release-schedule) +- Latest versions of Safari, Chrome, Edge and Firefox. + +See our [support policy](https://github.com/Azure/azure-sdk-for-js/blob/main/SUPPORT.md) for more details. + +### Prerequisites + +- An [Azure subscription][azure_sub]. + +### Install the `@azure/arm-appservice` package + +Install the Azure WebApps API client library for JavaScript with `npm`: + +```bash +npm install @azure/arm-appservice +``` + +### Create and authenticate a `WebSiteManagementClient` + +To create a client object to access the Azure WebApps API API, you will need the `endpoint` of your Azure WebApps API resource and a `credential`. The Azure WebApps API client can use Azure Active Directory credentials to authenticate. +You can find the endpoint for your Azure WebApps API resource in the [Azure Portal][azure_portal]. + +You can authenticate with Azure Active Directory using a credential from the [@azure/identity][azure_identity] library or [an existing AAD Token](https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/identity/identity/samples/AzureIdentityExamples.md#authenticating-with-a-pre-fetched-access-token). + +To use the [DefaultAzureCredential][defaultazurecredential] provider shown below, or other credential providers provided with the Azure SDK, please install the `@azure/identity` package: + +```bash +npm install @azure/identity +``` + +You will also need to **register a new AAD application and grant access to Azure WebApps API** by assigning the suitable role to your service principal (note: roles such as `"Owner"` will not grant the necessary permissions). + +For more information about how to create an Azure AD Application check out [this guide](https://learn.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal). + +Using Node.js and Node-like environments, you can use the `DefaultAzureCredential` class to authenticate the client. + +```ts +import { WebSiteManagementClient } from "@azure/arm-appservice"; +import { DefaultAzureCredential } from "@azure/identity"; + +const subscriptionId = "00000000-0000-0000-0000-000000000000"; +const client = new WebSiteManagementClient(new DefaultAzureCredential(), subscriptionId); +``` + +For browser environments, use the `InteractiveBrowserCredential` from the `@azure/identity` package to authenticate. + +```ts +import { InteractiveBrowserCredential } from "@azure/identity"; +import { WebSiteManagementClient } from "@azure/arm-appservice"; + +const credential = new InteractiveBrowserCredential({ + tenantId: "", + clientId: "", + }); + +const subscriptionId = "00000000-0000-0000-0000-000000000000"; +const client = new WebSiteManagementClient(credential, subscriptionId); +``` + + +### JavaScript Bundle +To use this client library in the browser, first you need to use a bundler. For details on how to do this, please refer to our [bundling documentation](https://aka.ms/AzureSDKBundling). + +## Key concepts + +### WebSiteManagementClient + +`WebSiteManagementClient` is the primary interface for developers using the Azure WebApps API client library. Explore the methods on this client object to understand the different features of the Azure WebApps API service that you can access. + +## Troubleshooting + +### Logging + +Enabling logging may help uncover useful information about failures. In order to see a log of HTTP requests and responses, set the `AZURE_LOG_LEVEL` environment variable to `info`. Alternatively, logging can be enabled at runtime by calling `setLogLevel` in the `@azure/logger`: + +```ts +import { setLogLevel } from "@azure/logger"; + +setLogLevel("info"); +``` + +For more detailed instructions on how to enable logs, you can look at the [@azure/logger package docs](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/core/logger). + + +## Contributing + +If you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/main/CONTRIBUTING.md) to learn more about how to build and test the code. + +## Related projects + +- [Microsoft Azure SDK for JavaScript](https://github.com/Azure/azure-sdk-for-js) + +[azure_sub]: https://azure.microsoft.com/free/ +[azure_portal]: https://portal.azure.com +[azure_identity]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/identity/identity +[defaultazurecredential]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/identity/identity#defaultazurecredential diff --git a/packages/typespec-test/test/AppService/generated/typespec-ts/api-extractor.json b/packages/typespec-test/test/AppService/generated/typespec-ts/api-extractor.json new file mode 100644 index 0000000000..155dac59bc --- /dev/null +++ b/packages/typespec-test/test/AppService/generated/typespec-ts/api-extractor.json @@ -0,0 +1,18 @@ +{ + "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", + "mainEntryPointFilePath": "dist/esm/index.d.ts", + "docModel": { "enabled": true }, + "apiReport": { "enabled": true, "reportFolder": "./review" }, + "dtsRollup": { + "enabled": true, + "untrimmedFilePath": "", + "publicTrimmedFilePath": "dist/arm-appservice.d.ts" + }, + "messages": { + "tsdocMessageReporting": { "default": { "logLevel": "none" } }, + "extractorMessageReporting": { + "ae-missing-release-tag": { "logLevel": "none" }, + "ae-unresolved-link": { "logLevel": "none" } + } + } +} diff --git a/packages/typespec-test/test/AppService/generated/typespec-ts/eslint.config.mjs b/packages/typespec-test/test/AppService/generated/typespec-ts/eslint.config.mjs new file mode 100644 index 0000000000..9396819633 --- /dev/null +++ b/packages/typespec-test/test/AppService/generated/typespec-ts/eslint.config.mjs @@ -0,0 +1,14 @@ +import azsdkEslint from "@azure/eslint-plugin-azure-sdk"; + +export default azsdkEslint.config([ + { + rules: { + "@azure/azure-sdk/ts-modules-only-named": "warn", + "@azure/azure-sdk/ts-package-json-types": "warn", + "@azure/azure-sdk/ts-package-json-engine-is-present": "warn", + "@azure/azure-sdk/ts-package-json-files-required": "off", + "@azure/azure-sdk/ts-package-json-main-is-cjs": "off", + "tsdoc/syntax": "warn" + } + } +]); diff --git a/packages/typespec-test/test/AppService/generated/typespec-ts/package.json b/packages/typespec-test/test/AppService/generated/typespec-ts/package.json new file mode 100644 index 0000000000..da4349aedb --- /dev/null +++ b/packages/typespec-test/test/AppService/generated/typespec-ts/package.json @@ -0,0 +1,249 @@ +{ + "name": "@azure/arm-appservice", + "version": "1.0.0-beta.1", + "description": "A generated SDK for WebSiteManagementClient.", + "engines": { + "node": ">=20.0.0" + }, + "sideEffects": false, + "autoPublish": false, + "tshy": { + "exports": { + "./package.json": "./package.json", + ".": "./src/index.ts", + "./api": "./src/api/index.ts", + "./api/staticSitesOperationGroup": "src/api/staticSitesOperationGroup/index.ts", + "./api/getUsagesInLocationOperationGroup": "src/api/getUsagesInLocationOperationGroup/index.ts", + "./api/recommendationsOperationGroup": "src/api/recommendationsOperationGroup/index.ts", + "./api/providerOperationGroup": "src/api/providerOperationGroup/index.ts", + "./api/globalOperationGroup": "src/api/globalOperationGroup/index.ts", + "./api/appServiceEnvironmentResources": "src/api/appServiceEnvironmentResources/index.ts", + "./api/operations": "src/api/operations/index.ts", + "./models": "./src/models/index.ts" + }, + "dialects": ["esm", "commonjs"], + "esmDialects": ["browser", "react-native"], + "selfLink": false + }, + "type": "module", + "browser": "./dist/browser/index.js", + "react-native": "./dist/react-native/index.js", + "keywords": ["node", "azure", "cloud", "typescript", "browser", "isomorphic"], + "author": "Microsoft Corporation", + "license": "MIT", + "files": ["dist/", "!dist/**/*.d.*ts.map", "README.md", "LICENSE"], + "dependencies": { + "@azure/core-util": "^1.9.2", + "@azure-rest/core-client": "^2.3.1", + "@azure/core-auth": "^1.6.0", + "@azure/core-rest-pipeline": "^1.5.0", + "@azure/logger": "^1.0.0", + "tslib": "^2.6.2", + "@azure/core-lro": "^3.1.0", + "@azure/abort-controller": "^2.1.2" + }, + "devDependencies": { + "dotenv": "^16.0.0", + "@types/node": "^20.0.0", + "eslint": "^9.9.0", + "typescript": "~5.8.2", + "tshy": "^2.0.0", + "@microsoft/api-extractor": "^7.40.3", + "rimraf": "^5.0.5", + "mkdirp": "^3.0.1" + }, + "scripts": { + "clean": "rimraf --glob dist dist-browser dist-esm test-dist temp types *.tgz *.log", + "extract-api": "rimraf review && mkdirp ./review && api-extractor run --local", + "pack": "npm pack 2>&1", + "lint": "eslint package.json api-extractor.json src", + "lint:fix": "eslint package.json api-extractor.json src --fix --fix-type [problem,suggestion]", + "build": "npm run clean && tshy && npm run extract-api" + }, + "exports": { + "./package.json": "./package.json", + ".": { + "browser": { + "types": "./dist/browser/index.d.ts", + "default": "./dist/browser/index.js" + }, + "react-native": { + "types": "./dist/react-native/index.d.ts", + "default": "./dist/react-native/index.js" + }, + "import": { + "types": "./dist/esm/index.d.ts", + "default": "./dist/esm/index.js" + }, + "require": { + "types": "./dist/commonjs/index.d.ts", + "default": "./dist/commonjs/index.js" + } + }, + "./api": { + "browser": { + "types": "./dist/browser/api/index.d.ts", + "default": "./dist/browser/api/index.js" + }, + "react-native": { + "types": "./dist/react-native/api/index.d.ts", + "default": "./dist/react-native/api/index.js" + }, + "import": { + "types": "./dist/esm/api/index.d.ts", + "default": "./dist/esm/api/index.js" + }, + "require": { + "types": "./dist/commonjs/api/index.d.ts", + "default": "./dist/commonjs/api/index.js" + } + }, + "./api/staticSitesOperationGroup": { + "browser": { + "types": "./dist/browser/api/staticSitesOperationGroup/index.d.ts", + "default": "./dist/browser/api/staticSitesOperationGroup/index.js" + }, + "react-native": { + "types": "./dist/react-native/api/staticSitesOperationGroup/index.d.ts", + "default": "./dist/react-native/api/staticSitesOperationGroup/index.js" + }, + "import": { + "types": "./dist/esm/api/staticSitesOperationGroup/index.d.ts", + "default": "./dist/esm/api/staticSitesOperationGroup/index.js" + }, + "require": { + "types": "./dist/commonjs/api/staticSitesOperationGroup/index.d.ts", + "default": "./dist/commonjs/api/staticSitesOperationGroup/index.js" + } + }, + "./api/getUsagesInLocationOperationGroup": { + "browser": { + "types": "./dist/browser/api/getUsagesInLocationOperationGroup/index.d.ts", + "default": "./dist/browser/api/getUsagesInLocationOperationGroup/index.js" + }, + "react-native": { + "types": "./dist/react-native/api/getUsagesInLocationOperationGroup/index.d.ts", + "default": "./dist/react-native/api/getUsagesInLocationOperationGroup/index.js" + }, + "import": { + "types": "./dist/esm/api/getUsagesInLocationOperationGroup/index.d.ts", + "default": "./dist/esm/api/getUsagesInLocationOperationGroup/index.js" + }, + "require": { + "types": "./dist/commonjs/api/getUsagesInLocationOperationGroup/index.d.ts", + "default": "./dist/commonjs/api/getUsagesInLocationOperationGroup/index.js" + } + }, + "./api/recommendationsOperationGroup": { + "browser": { + "types": "./dist/browser/api/recommendationsOperationGroup/index.d.ts", + "default": "./dist/browser/api/recommendationsOperationGroup/index.js" + }, + "react-native": { + "types": "./dist/react-native/api/recommendationsOperationGroup/index.d.ts", + "default": "./dist/react-native/api/recommendationsOperationGroup/index.js" + }, + "import": { + "types": "./dist/esm/api/recommendationsOperationGroup/index.d.ts", + "default": "./dist/esm/api/recommendationsOperationGroup/index.js" + }, + "require": { + "types": "./dist/commonjs/api/recommendationsOperationGroup/index.d.ts", + "default": "./dist/commonjs/api/recommendationsOperationGroup/index.js" + } + }, + "./api/providerOperationGroup": { + "browser": { + "types": "./dist/browser/api/providerOperationGroup/index.d.ts", + "default": "./dist/browser/api/providerOperationGroup/index.js" + }, + "react-native": { + "types": "./dist/react-native/api/providerOperationGroup/index.d.ts", + "default": "./dist/react-native/api/providerOperationGroup/index.js" + }, + "import": { + "types": "./dist/esm/api/providerOperationGroup/index.d.ts", + "default": "./dist/esm/api/providerOperationGroup/index.js" + }, + "require": { + "types": "./dist/commonjs/api/providerOperationGroup/index.d.ts", + "default": "./dist/commonjs/api/providerOperationGroup/index.js" + } + }, + "./api/globalOperationGroup": { + "browser": { + "types": "./dist/browser/api/globalOperationGroup/index.d.ts", + "default": "./dist/browser/api/globalOperationGroup/index.js" + }, + "react-native": { + "types": "./dist/react-native/api/globalOperationGroup/index.d.ts", + "default": "./dist/react-native/api/globalOperationGroup/index.js" + }, + "import": { + "types": "./dist/esm/api/globalOperationGroup/index.d.ts", + "default": "./dist/esm/api/globalOperationGroup/index.js" + }, + "require": { + "types": "./dist/commonjs/api/globalOperationGroup/index.d.ts", + "default": "./dist/commonjs/api/globalOperationGroup/index.js" + } + }, + "./api/appServiceEnvironmentResources": { + "browser": { + "types": "./dist/browser/api/appServiceEnvironmentResources/index.d.ts", + "default": "./dist/browser/api/appServiceEnvironmentResources/index.js" + }, + "react-native": { + "types": "./dist/react-native/api/appServiceEnvironmentResources/index.d.ts", + "default": "./dist/react-native/api/appServiceEnvironmentResources/index.js" + }, + "import": { + "types": "./dist/esm/api/appServiceEnvironmentResources/index.d.ts", + "default": "./dist/esm/api/appServiceEnvironmentResources/index.js" + }, + "require": { + "types": "./dist/commonjs/api/appServiceEnvironmentResources/index.d.ts", + "default": "./dist/commonjs/api/appServiceEnvironmentResources/index.js" + } + }, + "./api/operations": { + "browser": { + "types": "./dist/browser/api/operations/index.d.ts", + "default": "./dist/browser/api/operations/index.js" + }, + "react-native": { + "types": "./dist/react-native/api/operations/index.d.ts", + "default": "./dist/react-native/api/operations/index.js" + }, + "import": { + "types": "./dist/esm/api/operations/index.d.ts", + "default": "./dist/esm/api/operations/index.js" + }, + "require": { + "types": "./dist/commonjs/api/operations/index.d.ts", + "default": "./dist/commonjs/api/operations/index.js" + } + }, + "./models": { + "browser": { + "types": "./dist/browser/models/index.d.ts", + "default": "./dist/browser/models/index.js" + }, + "react-native": { + "types": "./dist/react-native/models/index.d.ts", + "default": "./dist/react-native/models/index.js" + }, + "import": { + "types": "./dist/esm/models/index.d.ts", + "default": "./dist/esm/models/index.js" + }, + "require": { + "types": "./dist/commonjs/models/index.d.ts", + "default": "./dist/commonjs/models/index.js" + } + } + }, + "main": "./dist/commonjs/index.js", + "types": "./dist/commonjs/index.d.ts", + "module": "./dist/esm/index.js" +} diff --git a/packages/typespec-test/test/AppService/generated/typespec-ts/review/arm-appservice.api.md b/packages/typespec-test/test/AppService/generated/typespec-ts/review/arm-appservice.api.md new file mode 100644 index 0000000000..991fddb787 --- /dev/null +++ b/packages/typespec-test/test/AppService/generated/typespec-ts/review/arm-appservice.api.md @@ -0,0 +1,1868 @@ +## API Report File for "@azure/arm-appservice" + +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). + +```ts + +import { ClientOptions } from '@azure-rest/core-client'; +import { OperationOptions } from '@azure-rest/core-client'; +import { Pipeline } from '@azure/core-rest-pipeline'; +import { TokenCredential } from '@azure/core-auth'; + +// @public +export interface ApiDefinitionInfo { + url?: string; +} + +// @public +export interface ApiManagementConfig { + id?: string; +} + +// @public +export interface AppInsightsWebAppStackSettings { + readonly isDefaultOff?: boolean; + readonly isSupported?: boolean; +} + +// @public +export interface ApplicationStack { + dependency?: string; + display?: string; + frameworks?: ApplicationStack[]; + isDeprecated?: ApplicationStack[]; + majorVersions?: StackMajorVersion[]; + name?: string; +} + +// @public +export interface ApplicationStackResource extends ProxyOnlyResource { + dependency?: string; + display?: string; + frameworks?: ApplicationStack[]; + isDeprecated?: ApplicationStack[]; + majorVersions?: StackMajorVersion[]; + namePropertiesName?: string; +} + +// @public +export interface AppServiceEnvironment { + clusterSettings?: NameValuePair[]; + dedicatedHostCount?: number; + dnsSuffix?: string; + frontEndScaleFactor?: number; + readonly hasLinuxWorkers?: boolean; + internalLoadBalancingMode?: LoadBalancingMode; + ipsslAddressCount?: number; + readonly maximumNumberOfMachines?: number; + readonly multiRoleCount?: number; + multiSize?: string; + readonly provisioningState?: ProvisioningState; + readonly status?: HostingEnvironmentStatus; + readonly suspended?: boolean; + readonly upgradeAvailability?: UpgradeAvailability; + upgradePreference?: UpgradePreference; + userWhitelistedIpRanges?: string[]; + virtualNetwork: VirtualNetworkProfile; + zoneRedundant?: boolean; +} + +// @public +export interface AppServiceEnvironmentResourcesChangeVnetOptionalParams extends OperationOptions { + updateIntervalInMs?: number; +} + +// @public +export interface AppServiceEnvironmentResourcesOperations { + // @deprecated (undocumented) + beginListChangeVnetAndWait: (resourceGroupName: string, name: string, body: VirtualNetworkProfile, options?: AppServiceEnvironmentResourcesChangeVnetOptionalParams) => PagedAsyncIterableIterator; + // @deprecated (undocumented) + beginListResumeAndWait: (resourceGroupName: string, name: string, options?: AppServiceEnvironmentResourcesResumeOptionalParams) => PagedAsyncIterableIterator; + // @deprecated (undocumented) + beginListSuspendAndWait: (resourceGroupName: string, name: string, options?: AppServiceEnvironmentResourcesSuspendOptionalParams) => PagedAsyncIterableIterator; + changeVnet: (resourceGroupName: string, name: string, body: VirtualNetworkProfile, options?: AppServiceEnvironmentResourcesChangeVnetOptionalParams) => PagedAsyncIterableIterator; + resume: (resourceGroupName: string, name: string, options?: AppServiceEnvironmentResourcesResumeOptionalParams) => PagedAsyncIterableIterator; + suspend: (resourceGroupName: string, name: string, options?: AppServiceEnvironmentResourcesSuspendOptionalParams) => PagedAsyncIterableIterator; +} + +// @public +export interface AppServiceEnvironmentResourcesResumeOptionalParams extends OperationOptions { + updateIntervalInMs?: number; +} + +// @public +export interface AppServiceEnvironmentResourcesSuspendOptionalParams extends OperationOptions { + updateIntervalInMs?: number; +} + +// @public +export type AppServicePlanRestrictions = "None" | "Free" | "Shared" | "Basic" | "Standard" | "Premium"; + +// @public +export interface AseRegion extends ProxyOnlyResource { + availableOS?: string[]; + availableSku?: string[]; + readonly dedicatedHost?: boolean; + readonly displayName?: string; + readonly standard?: boolean; + readonly zoneRedundant?: boolean; +} + +// @public +export interface AseRegionProperties { + availableOS?: string[]; + availableSku?: string[]; + readonly dedicatedHost?: boolean; + readonly displayName?: string; + readonly standard?: boolean; + readonly zoneRedundant?: boolean; +} + +// @public +export type AuthenticationType = string; + +// @public +export type AutoGeneratedDomainNameLabelScope = "TenantReuse" | "SubscriptionReuse" | "ResourceGroupReuse" | "NoReuse"; + +// @public +export interface AutoHealActions { + actionType?: AutoHealActionType; + customAction?: AutoHealCustomAction; + minProcessExecutionTime?: string; +} + +// @public +export type AutoHealActionType = "Recycle" | "LogEvent" | "CustomAction"; + +// @public +export interface AutoHealCustomAction { + exe?: string; + parameters?: string; +} + +// @public +export interface AutoHealRules { + actions?: AutoHealActions; + triggers?: AutoHealTriggers; +} + +// @public +export interface AutoHealTriggers { + privateBytesInKB?: number; + requests?: RequestsBasedTrigger; + slowRequests?: SlowRequestsBasedTrigger; + slowRequestsWithPath?: SlowRequestsBasedTrigger[]; + statusCodes?: StatusCodesBasedTrigger[]; + statusCodesRange?: StatusCodesRangeBasedTrigger[]; +} + +// @public +export enum AzureClouds { + AZURE_CHINA_CLOUD = "AZURE_CHINA_CLOUD", + AZURE_PUBLIC_CLOUD = "AZURE_PUBLIC_CLOUD", + AZURE_US_GOVERNMENT = "AZURE_US_GOVERNMENT" +} + +// @public +export interface AzureStorageInfoValue { + accessKey?: string; + accountName?: string; + mountPath?: string; + protocol?: AzureStorageProtocol; + shareName?: string; + readonly state?: AzureStorageState; + type?: AzureStorageType; +} + +// @public +export type AzureStorageProtocol = string; + +// @public +export type AzureStorageState = "Ok" | "InvalidCredentials" | "InvalidShare" | "NotValidated"; + +// @public +export type AzureStorageType = "AzureFiles" | "AzureBlob"; + +// @public +export type AzureSupportedClouds = `${AzureClouds}`; + +// @public +export interface BillingMeter extends ProxyOnlyResource { + billingLocation?: string; + friendlyName?: string; + meterId?: string; + multiplier?: number; + osType?: string; + resourceType?: string; + shortName?: string; +} + +// @public +export interface BillingMeterProperties { + billingLocation?: string; + friendlyName?: string; + meterId?: string; + multiplier?: number; + osType?: string; + resourceType?: string; + shortName?: string; +} + +// @public +export interface Capability { + name?: string; + reason?: string; + value?: string; +} + +// @public +export type Channels = "Notification" | "Api" | "Email" | "Webhook" | "All"; + +// @public +export interface CheckNameAvailabilityOptionalParams extends OperationOptions { +} + +// @public +export type CheckNameResourceTypes = string; + +// @public +export type ClientCertMode = "Required" | "Optional" | "OptionalInteractiveUser"; + +// @public +export interface CloningInfo { + appSettingsOverrides?: Record; + cloneCustomHostNames?: boolean; + cloneSourceControl?: boolean; + configureLoadBalancing?: boolean; + correlationId?: string; + hostingEnvironment?: string; + overwrite?: boolean; + sourceWebAppId: string; + sourceWebAppLocation?: string; + trafficManagerProfileId?: string; + trafficManagerProfileName?: string; +} + +// @public +export type ConnectionStringType = "MySql" | "SQLServer" | "SQLAzure" | "Custom" | "NotificationHub" | "ServiceBus" | "EventHub" | "ApiHub" | "DocDb" | "RedisCache" | "PostgreSQL"; + +// @public +export interface ConnStringInfo { + connectionString?: string; + name?: string; + type?: ConnectionStringType; +} + +// @public +export type ContinuablePage = TPage & { + continuationToken?: string; +}; + +// @public +export interface CorsSettings { + allowedOrigins?: string[]; + supportCredentials?: boolean; +} + +// @public +export type CreatedByType = string; + +// @public +export interface CsmMoveResourceEnvelope { + // (undocumented) + resources?: string[]; + // (undocumented) + targetResourceGroup?: string; +} + +// @public +export interface CsmOperationDescription { + display?: CsmOperationDisplay; + // (undocumented) + isDataAction?: boolean; + // (undocumented) + name?: string; + // (undocumented) + origin?: string; + properties?: CsmOperationDescriptionProperties; +} + +// @public +export interface CsmOperationDescriptionProperties { + serviceSpecification?: ServiceSpecification; +} + +// @public +export interface CsmOperationDisplay { + // (undocumented) + description?: string; + // (undocumented) + operation?: string; + // (undocumented) + provider?: string; + // (undocumented) + resource?: string; +} + +// @public +export interface CsmUsageQuota { + currentValue?: number; + limit?: number; + name?: LocalizableString; + nextResetTime?: Date; + unit?: string; +} + +// @public +export interface CustomHostnameSites extends ProxyOnlyResource { + // (undocumented) + customHostname?: string; + // (undocumented) + region?: string; +} + +// @public +export interface CustomHostnameSitesProperties { + // (undocumented) + customHostname?: string; + // (undocumented) + region?: string; +} + +// @public +export interface DaprConfig { + appId?: string; + appPort?: number; + enableApiLogging?: boolean; + enabled?: boolean; + httpMaxRequestSize?: number; + httpReadBufferSize?: number; + logLevel?: DaprLogLevel; +} + +// @public +export type DaprLogLevel = string; + +// @public +export type DefaultAction = string; + +// @public +export interface DefaultErrorResponse { + readonly error?: DefaultErrorResponseError; +} + +// @public +export interface DefaultErrorResponseError { + readonly code?: string; + // (undocumented) + details?: DefaultErrorResponseErrorDetailsItem[]; + readonly innererror?: string; + readonly message?: string; + readonly target?: string; +} + +// @public +export interface DefaultErrorResponseErrorDetailsItem { + readonly code?: string; + readonly message?: string; + readonly target?: string; +} + +// @public +export interface DeploymentLocations { + hostingEnvironmentDeploymentInfos?: HostingEnvironmentDeploymentInfo[]; + hostingEnvironments?: AppServiceEnvironment[]; + locations?: GeoRegion[]; +} + +// @public +export interface Dimension { + // (undocumented) + displayName?: string; + // (undocumented) + internalName?: string; + // (undocumented) + name?: string; + // (undocumented) + toBeExportedForShoebox?: boolean; +} + +// @public +export interface DnlResourceNameAvailability { + // (undocumented) + hostName?: string; + message?: string; + nameAvailable?: boolean; + reason?: InAvailabilityReasonType; +} + +// @public +export interface DnlResourceNameAvailabilityRequest { + autoGeneratedDomainNameLabelScope?: string; + name: string; + resourceGroupName?: string; + type: CheckNameResourceTypes; +} + +// @public +export interface Experiments { + rampUpRules?: RampUpRule[]; +} + +// @public +export interface ExtendedLocation { + name?: string; + readonly type?: string; +} + +// @public +export type FtpsState = string; + +// @public +export interface FunctionAppConfig { + deployment?: FunctionsDeployment; + runtime?: FunctionsRuntime; + scaleAndConcurrency?: FunctionsScaleAndConcurrency; + siteUpdateStrategy?: FunctionsSiteUpdateStrategy; +} + +// @public +export interface FunctionAppMajorVersion { + readonly displayText?: string; + readonly minorVersions?: FunctionAppMinorVersion[]; + readonly value?: string; +} + +// @public +export interface FunctionAppMinorVersion { + readonly displayText?: string; + readonly stackSettings?: FunctionAppRuntimes; + readonly value?: string; +} + +// @public +export interface FunctionAppRuntimes { + readonly linuxRuntimeSettings?: FunctionAppRuntimeSettings; + readonly windowsRuntimeSettings?: FunctionAppRuntimeSettings; +} + +// @public +export interface FunctionAppRuntimeSettings { + readonly appInsightsSettings?: AppInsightsWebAppStackSettings; + readonly appSettingsDictionary?: Record; + readonly endOfLifeDate?: Date; + readonly gitHubActionSettings?: GitHubActionWebAppStackSettings; + readonly isAutoUpdate?: boolean; + readonly isDefault?: boolean; + readonly isDeprecated?: boolean; + readonly isEarlyAccess?: boolean; + readonly isHidden?: boolean; + readonly isPreview?: boolean; + readonly remoteDebuggingSupported?: boolean; + readonly runtimeVersion?: string; + readonly siteConfigPropertiesDictionary?: SiteConfigPropertiesDictionary; + readonly supportedFunctionsExtensionVersions?: string[]; +} + +// @public +export interface FunctionAppStack extends ProxyOnlyResource { + readonly displayText?: string; + readonly location?: string; + readonly majorVersions?: FunctionAppMajorVersion[]; + readonly preferredOs?: StackPreferredOs; + readonly value?: string; +} + +// @public +export interface FunctionAppStackProperties { + readonly displayText?: string; + readonly majorVersions?: FunctionAppMajorVersion[]; + readonly preferredOs?: StackPreferredOs; + readonly value?: string; +} + +// @public +export interface FunctionsAlwaysReadyConfig { + instanceCount?: number; + name?: string; +} + +// @public +export interface FunctionsDeployment { + storage?: FunctionsDeploymentStorage; +} + +// @public +export interface FunctionsDeploymentStorage { + authentication?: FunctionsDeploymentStorageAuthentication; + type?: FunctionsDeploymentStorageType; + value?: string; +} + +// @public +export interface FunctionsDeploymentStorageAuthentication { + storageAccountConnectionStringName?: string; + type?: AuthenticationType; + userAssignedIdentityResourceId?: string; +} + +// @public +export type FunctionsDeploymentStorageType = string; + +// @public +export interface FunctionsRuntime { + name?: RuntimeName; + version?: string | null; +} + +// @public +export interface FunctionsScaleAndConcurrency { + alwaysReady?: FunctionsAlwaysReadyConfig[]; + instanceMemoryMB?: number; + maximumInstanceCount?: number; + triggers?: FunctionsScaleAndConcurrencyTriggers; +} + +// @public +export interface FunctionsScaleAndConcurrencyTriggers { + http?: FunctionsScaleAndConcurrencyTriggersHttp; +} + +// @public +export interface FunctionsScaleAndConcurrencyTriggersHttp { + perInstanceConcurrency?: number; +} + +// @public +export interface FunctionsSiteUpdateStrategy { + type?: SiteUpdateStrategyType; +} + +// @public +export interface GeoRegion extends ProxyOnlyResource { + readonly description?: string; + readonly displayName?: string; + readonly orgDomain?: string; +} + +// @public +export interface GeoRegionProperties { + readonly description?: string; + readonly displayName?: string; + readonly orgDomain?: string; +} + +// @public +export interface GetSubscriptionDeploymentLocationsOptionalParams extends OperationOptions { +} + +// @public +export interface GetUsagesInLocationOperationGroupListOptionalParams extends OperationOptions { +} + +// @public +export interface GetUsagesInLocationOperationGroupOperations { + list: (location: string, options?: GetUsagesInLocationOperationGroupListOptionalParams) => PagedAsyncIterableIterator; +} + +// @public +export interface GitHubActionWebAppStackSettings { + readonly isSupported?: boolean; + readonly supportedVersion?: string; +} + +// @public +export interface GlobalCsmSkuDescription { + capabilities?: Capability[]; + capacity?: SkuCapacity; + family?: string; + locations?: string[]; + name?: string; + size?: string; + tier?: string; +} + +// @public +export interface GlobalOperationGroupGetSubscriptionOperationWithAsyncResponseOptionalParams extends OperationOptions { +} + +// @public +export interface GlobalOperationGroupOperations { + getSubscriptionOperationWithAsyncResponse: (location: string, operationId: string, options?: GlobalOperationGroupGetSubscriptionOperationWithAsyncResponseOptionalParams) => Promise; +} + +// @public +export interface HandlerMapping { + arguments?: string; + extension?: string; + scriptProcessor?: string; +} + +// @public +export interface HostingEnvironmentDeploymentInfo { + location?: string; + name?: string; +} + +// @public +export interface HostingEnvironmentProfile { + id?: string; + readonly name?: string; + readonly type?: string; +} + +// @public +export type HostingEnvironmentStatus = "Preparing" | "Ready" | "Scaling" | "Deleting"; + +// @public +export interface HostNameSslState { + hostType?: HostType; + name?: string; + sslState?: SslState; + thumbprint?: string; + toUpdate?: boolean; + virtualIP?: string; +} + +// @public +export type HostType = "Standard" | "Repository"; + +// @public +export type InAvailabilityReasonType = string; + +// @public +export type IpFilterTag = string; + +// @public +export type IPMode = "IPv4" | "IPv6" | "IPv4AndIPv6"; + +// @public +export interface IpSecurityRestriction { + action?: string; + description?: string; + headers?: Record; + ipAddress?: string; + name?: string; + priority?: number; + subnetMask?: string; + subnetTrafficTag?: number; + tag?: IpFilterTag; + vnetSubnetResourceId?: string; + vnetTrafficTag?: number; +} + +// @public +export enum KnownAuthenticationType { + StorageAccountConnectionString = "StorageAccountConnectionString", + SystemAssignedIdentity = "SystemAssignedIdentity", + UserAssignedIdentity = "UserAssignedIdentity" +} + +// @public +export enum KnownAzureStorageProtocol { + Http = "Http", + Nfs = "Nfs", + Smb = "Smb" +} + +// @public +export enum KnownCheckNameResourceTypes { + HostingEnvironment = "HostingEnvironment", + MicrosoftWebHostingEnvironments = "Microsoft.Web/hostingEnvironments", + MicrosoftWebPublishingUsers = "Microsoft.Web/publishingUsers", + MicrosoftWebSites = "Microsoft.Web/sites", + MicrosoftWebSitesSlots = "Microsoft.Web/sites/slots", + PublishingUser = "PublishingUser", + Site = "Site", + Slot = "Slot" +} + +// @public +export enum KnownCreatedByType { + Application = "Application", + Key = "Key", + ManagedIdentity = "ManagedIdentity", + User = "User" +} + +// @public +export enum KnownDaprLogLevel { + Debug = "debug", + Error = "error", + Info = "info", + Warn = "warn" +} + +// @public +export enum KnownDefaultAction { + Allow = "Allow", + Deny = "Deny" +} + +// @public +export enum KnownFtpsState { + AllAllowed = "AllAllowed", + Disabled = "Disabled", + FtpsOnly = "FtpsOnly" +} + +// @public +export enum KnownFunctionsDeploymentStorageType { + BlobContainer = "blobContainer" +} + +// @public +export enum KnownInAvailabilityReasonType { + AlreadyExists = "AlreadyExists", + Invalid = "Invalid" +} + +// @public +export enum KnownIpFilterTag { + Default = "Default", + ServiceTag = "ServiceTag", + XffProxy = "XffProxy" +} + +// @public +export enum KnownLoadBalancingMode { + None = "None", + Publishing = "Publishing", + Web = "Web", + WebPublishing = "Web, Publishing" +} + +// @public +export enum KnownProviderOsTypeSelected { + All = "All", + Linux = "Linux", + LinuxFunctions = "LinuxFunctions", + Windows = "Windows", + WindowsFunctions = "WindowsFunctions" +} + +// @public +export enum KnownProviderStackOsType { + All = "All", + Linux = "Linux", + Windows = "Windows" +} + +// @public +export enum KnownResourceScopeType { + ServerFarm = "ServerFarm", + Subscription = "Subscription", + WebSite = "WebSite" +} + +// @public +export enum KnownRuntimeName { + Custom = "custom", + DotnetIsolated = "dotnet-isolated", + Java = "java", + Node = "node", + Powershell = "powershell", + Python = "python" +} + +// @public +export enum KnownScmType { + BitbucketGit = "BitbucketGit", + BitbucketHg = "BitbucketHg", + CodePlexGit = "CodePlexGit", + CodePlexHg = "CodePlexHg", + Dropbox = "Dropbox", + ExternalGit = "ExternalGit", + ExternalHg = "ExternalHg", + GitHub = "GitHub", + LocalGit = "LocalGit", + None = "None", + OneDrive = "OneDrive", + Tfs = "Tfs", + VSO = "VSO", + Vstsrm = "VSTSRM" +} + +// @public +export enum KnownSiteUpdateStrategyType { + Recreate = "Recreate", + RollingUpdate = "RollingUpdate" +} + +// @public +export enum KnownSkuName { + Basic = "Basic", + Dynamic = "Dynamic", + ElasticIsolated = "ElasticIsolated", + ElasticPremium = "ElasticPremium", + FlexConsumption = "FlexConsumption", + Free = "Free", + Isolated = "Isolated", + IsolatedV2 = "IsolatedV2", + Premium = "Premium", + PremiumContainer = "PremiumContainer", + PremiumV2 = "PremiumV2", + PremiumV3 = "PremiumV3", + Shared = "Shared", + Standard = "Standard" +} + +// @public +export enum KnownSupportedTlsVersions { + One0 = "1.0", + One1 = "1.1", + One2 = "1.2", + One3 = "1.3" +} + +// @public +export enum KnownTlsCipherSuites { + TLSAES128GCMSHA256 = "TLS_AES_128_GCM_SHA256", + TLSAES256GCMSHA384 = "TLS_AES_256_GCM_SHA384", + TLSEcdheEcdsaWithAES128CBCSHA256 = "TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256", + TLSEcdheEcdsaWithAES128GCMSHA256 = "TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256", + TLSEcdheEcdsaWithAES256GCMSHA384 = "TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384", + TLSEcdheRSAWithAES128CBCSHA = "TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA", + TLSEcdheRSAWithAES128CBCSHA256 = "TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256", + TLSEcdheRSAWithAES128GCMSHA256 = "TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256", + TLSEcdheRSAWithAES256CBCSHA = "TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA", + TLSEcdheRSAWithAES256CBCSHA384 = "TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384", + TLSEcdheRSAWithAES256GCMSHA384 = "TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384", + TLSRSAWithAES128CBCSHA = "TLS_RSA_WITH_AES_128_CBC_SHA", + TLSRSAWithAES128CBCSHA256 = "TLS_RSA_WITH_AES_128_CBC_SHA256", + TLSRSAWithAES128GCMSHA256 = "TLS_RSA_WITH_AES_128_GCM_SHA256", + TLSRSAWithAES256CBCSHA = "TLS_RSA_WITH_AES_256_CBC_SHA", + TLSRSAWithAES256CBCSHA256 = "TLS_RSA_WITH_AES_256_CBC_SHA256", + TLSRSAWithAES256GCMSHA384 = "TLS_RSA_WITH_AES_256_GCM_SHA384" +} + +// @public +export enum KnownUpgradeAvailability { + None = "None", + Ready = "Ready" +} + +// @public +export enum KnownUpgradePreference { + Early = "Early", + Late = "Late", + Manual = "Manual", + None = "None" +} + +// @public +export enum KnownValidateResourceTypes { + MicrosoftWebHostingEnvironments = "Microsoft.Web/hostingEnvironments", + ServerFarm = "ServerFarm", + Site = "Site" +} + +// @public +export enum KnownVersions { + V20250301 = "2025-03-01", + V20250501 = "2025-05-01" +} + +// @public +export interface LinuxJavaContainerSettings { + readonly endOfLifeDate?: Date; + readonly isAutoUpdate?: boolean; + readonly isDeprecated?: boolean; + readonly isEarlyAccess?: boolean; + readonly isHidden?: boolean; + readonly isPreview?: boolean; + readonly java11Runtime?: string; + readonly java8Runtime?: string; +} + +// @public +export interface ListAseRegionsOptionalParams extends OperationOptions { +} + +// @public +export interface ListBillingMetersOptionalParams extends OperationOptions { + billingLocation?: string; + osType?: string; +} + +// @public +export interface ListCustomHostNameSitesOptionalParams extends OperationOptions { + hostname?: string; +} + +// @public +export interface ListGeoRegionsOptionalParams extends OperationOptions { + customModeWorkersEnabled?: boolean; + linuxDynamicWorkersEnabled?: boolean; + linuxWorkersEnabled?: boolean; + sku?: SkuName; + xenonWorkersEnabled?: boolean; +} + +// @public +export interface ListPremierAddOnOffersOptionalParams extends OperationOptions { +} + +// @public +export interface ListSkusOptionalParams extends OperationOptions { +} + +// @public +export type LoadBalancingMode = string; + +// @public +export interface LocalizableString { + localizedValue?: string; + value?: string; +} + +// @public +export interface LogSpecification { + // (undocumented) + blobDuration?: string; + // (undocumented) + displayName?: string; + // (undocumented) + logFilterPattern?: string; + // (undocumented) + name?: string; +} + +// @public +export type ManagedPipelineMode = "Integrated" | "Classic"; + +// @public +export interface ManagedServiceIdentity { + readonly principalId?: string; + readonly tenantId?: string; + type?: ManagedServiceIdentityType; + userAssignedIdentities?: Record; +} + +// @public +export type ManagedServiceIdentityType = "SystemAssigned" | "UserAssigned" | "SystemAssigned, UserAssigned" | "None"; + +// @public +export interface MetricAvailability { + // (undocumented) + blobDuration?: string; + // (undocumented) + timeGrain?: string; +} + +// @public +export interface MetricSpecification { + // (undocumented) + aggregationType?: string; + // (undocumented) + availabilities?: MetricAvailability[]; + // (undocumented) + category?: string; + // (undocumented) + dimensions?: Dimension[]; + // (undocumented) + displayDescription?: string; + // (undocumented) + displayName?: string; + // (undocumented) + enableRegionalMdmAccount?: boolean; + // (undocumented) + fillGapWithZero?: boolean; + // (undocumented) + isInternal?: boolean; + // (undocumented) + metricFilterPattern?: string; + // (undocumented) + name?: string; + // (undocumented) + sourceMdmAccount?: string; + // (undocumented) + sourceMdmNamespace?: string; + // (undocumented) + supportedAggregationTypes?: string[]; + // (undocumented) + supportedTimeGrainTypes?: string[]; + // (undocumented) + supportsInstanceLevelAggregation?: boolean; + // (undocumented) + unit?: string; +} + +// @public +export interface MoveOptionalParams extends OperationOptions { +} + +// @public +export interface NameValuePair { + name?: string; + value?: string; +} + +// @public +export type NotificationLevel = "Critical" | "Warning" | "Information" | "NonUrgentSuggestion"; + +// @public +export interface OperationsListOptionalParams extends OperationOptions { +} + +// @public +export interface OperationsOperations { + list: (options?: OperationsListOptionalParams) => PagedAsyncIterableIterator; +} + +// @public +export interface OutboundVnetRouting { + allTraffic?: boolean; + applicationTraffic?: boolean; + backupRestoreTraffic?: boolean; + contentShareTraffic?: boolean; + imagePullTraffic?: boolean; +} + +// @public +export interface PagedAsyncIterableIterator { + [Symbol.asyncIterator](): PagedAsyncIterableIterator; + byPage: (settings?: TPageSettings) => AsyncIterableIterator>; + next(): Promise>; +} + +// @public +export interface PageSettings { + continuationToken?: string; +} + +// @public +export interface PremierAddOnOffer extends ProxyOnlyResource { + legalTermsUrl?: string; + marketplaceOffer?: string; + marketplacePublisher?: string; + privacyPolicyUrl?: string; + product?: string; + promoCodeRequired?: boolean; + quota?: number; + sku?: string; + vendor?: string; + webHostingPlanRestrictions?: AppServicePlanRestrictions; +} + +// @public +export interface PremierAddOnOfferProperties { + legalTermsUrl?: string; + marketplaceOffer?: string; + marketplacePublisher?: string; + privacyPolicyUrl?: string; + product?: string; + promoCodeRequired?: boolean; + quota?: number; + sku?: string; + vendor?: string; + webHostingPlanRestrictions?: AppServicePlanRestrictions; +} + +// @public +export interface ProviderOperationGroupGetAvailableStacksOnPremOptionalParams extends OperationOptions { + // (undocumented) + osTypeSelected?: ProviderOsTypeSelected; +} + +// @public +export interface ProviderOperationGroupGetAvailableStacksOptionalParams extends OperationOptions { + // (undocumented) + osTypeSelected?: ProviderOsTypeSelected; +} + +// @public +export interface ProviderOperationGroupGetFunctionAppStacksForLocationOptionalParams extends OperationOptions { + stackOsType?: ProviderStackOsType; +} + +// @public +export interface ProviderOperationGroupGetFunctionAppStacksOptionalParams extends OperationOptions { + stackOsType?: ProviderStackOsType; +} + +// @public +export interface ProviderOperationGroupGetWebAppStacksForLocationOptionalParams extends OperationOptions { + stackOsType?: ProviderStackOsType; +} + +// @public +export interface ProviderOperationGroupGetWebAppStacksOptionalParams extends OperationOptions { + stackOsType?: ProviderStackOsType; +} + +// @public +export interface ProviderOperationGroupOperations { + getAvailableStacks: (options?: ProviderOperationGroupGetAvailableStacksOptionalParams) => PagedAsyncIterableIterator; + getAvailableStacksOnPrem: (options?: ProviderOperationGroupGetAvailableStacksOnPremOptionalParams) => PagedAsyncIterableIterator; + getFunctionAppStacks: (options?: ProviderOperationGroupGetFunctionAppStacksOptionalParams) => PagedAsyncIterableIterator; + getFunctionAppStacksForLocation: (location: string, options?: ProviderOperationGroupGetFunctionAppStacksForLocationOptionalParams) => PagedAsyncIterableIterator; + getWebAppStacks: (options?: ProviderOperationGroupGetWebAppStacksOptionalParams) => PagedAsyncIterableIterator; + getWebAppStacksForLocation: (location: string, options?: ProviderOperationGroupGetWebAppStacksForLocationOptionalParams) => PagedAsyncIterableIterator; +} + +// @public +export type ProviderOsTypeSelected = string; + +// @public +export type ProviderStackOsType = string; + +// @public +export type ProvisioningState = "Succeeded" | "Failed" | "Canceled" | "InProgress" | "Deleting"; + +// @public +export interface ProxyOnlyResource { + readonly id?: string; + kind?: string; + readonly name?: string; + readonly type?: string; +} + +// @public +export interface PushSettings extends ProxyOnlyResource { + dynamicTagsJson?: string; + isPushEnabled?: boolean; + tagsRequiringAuth?: string; + tagWhitelistJson?: string; +} + +// @public +export interface PushSettingsProperties { + dynamicTagsJson?: string; + isPushEnabled: boolean; + tagsRequiringAuth?: string; + tagWhitelistJson?: string; +} + +// @public +export interface RampUpRule { + actionHostName?: string; + changeDecisionCallbackUrl?: string; + changeIntervalInMinutes?: number; + changeStep?: number; + maxReroutePercentage?: number; + minReroutePercentage?: number; + name?: string; + reroutePercentage?: number; +} + +// @public +export interface Recommendation extends ProxyOnlyResource { + actionName?: string; + bladeName?: string; + readonly categoryTags?: string[]; + channels?: Channels; + creationTime?: Date; + displayName?: string; + enabled?: number; + endTime?: Date; + extensionName?: string; + forwardLink?: string; + isDynamic?: boolean; + level?: NotificationLevel; + message?: string; + nextNotificationTime?: Date; + notificationExpirationTime?: Date; + notifiedTime?: Date; + recommendationId?: string; + resourceId?: string; + resourceScope?: ResourceScopeType; + ruleName?: string; + score?: number; + startTime?: Date; + states?: string[]; +} + +// @public +export interface RecommendationProperties { + actionName?: string; + bladeName?: string; + readonly categoryTags?: string[]; + channels?: Channels; + creationTime?: Date; + displayName?: string; + enabled?: number; + endTime?: Date; + extensionName?: string; + forwardLink?: string; + isDynamic?: boolean; + level?: NotificationLevel; + message?: string; + nextNotificationTime?: Date; + notificationExpirationTime?: Date; + notifiedTime?: Date; + recommendationId?: string; + resourceId?: string; + resourceScope?: ResourceScopeType; + ruleName?: string; + score?: number; + startTime?: Date; + states?: string[]; +} + +// @public +export interface RecommendationsOperationGroupDisableRecommendationForSubscriptionOptionalParams extends OperationOptions { +} + +// @public +export interface RecommendationsOperationGroupListOptionalParams extends OperationOptions { + featured?: boolean; + filter?: string; +} + +// @public +export interface RecommendationsOperationGroupOperations { + disableRecommendationForSubscription: (name: string, options?: RecommendationsOperationGroupDisableRecommendationForSubscriptionOptionalParams) => Promise; + list: (options?: RecommendationsOperationGroupListOptionalParams) => PagedAsyncIterableIterator; + resetAllFilters: (options?: RecommendationsOperationGroupResetAllFiltersOptionalParams) => Promise; +} + +// @public +export interface RecommendationsOperationGroupResetAllFiltersOptionalParams extends OperationOptions { +} + +// @public +export type RedundancyMode = "None" | "Manual" | "Failover" | "ActiveActive" | "GeoRedundant"; + +// @public +export interface RegionalCheckNameAvailabilityOptionalParams extends OperationOptions { +} + +// @public +export interface RequestsBasedTrigger { + count?: number; + timeInterval?: string; +} + +// @public +export interface ResourceConfig { + cpu?: number; + memory?: string; +} + +// @public +export interface ResourceNameAvailability { + message?: string; + nameAvailable?: boolean; + reason?: InAvailabilityReasonType; +} + +// @public +export interface ResourceNameAvailabilityRequest { + environmentId?: string; + isFqdn?: boolean; + name: string; + type: CheckNameResourceTypes; +} + +// @public +export type ResourceScopeType = string; + +// @public +export type RuntimeName = string; + +// @public +export type ScmType = string; + +// @public +export interface ServiceSpecification { + // (undocumented) + logSpecifications?: LogSpecification[]; + // (undocumented) + metricSpecifications?: MetricSpecification[]; +} + +// @public +export interface Site { + // (undocumented) + extendedLocation: ExtendedLocation; + // (undocumented) + id: string; + // (undocumented) + identity: ManagedServiceIdentity; + // (undocumented) + kind: string; + // (undocumented) + location: string; + // (undocumented) + name: string; + // (undocumented) + properties: SiteProperties; + // (undocumented) + systemData: SystemData; + // (undocumented) + tags: Record; + // (undocumented) + type: string; +} + +// @public +export type SiteAvailabilityState = "Normal" | "Limited" | "DisasterRecoveryMode"; + +// @public +export interface SiteConfig { + acrUseManagedIdentityCreds?: boolean; + acrUserManagedIdentityID?: string; + alwaysOn?: boolean; + apiDefinition?: ApiDefinitionInfo; + apiManagementConfig?: ApiManagementConfig; + appCommandLine?: string; + appSettings?: NameValuePair[]; + autoHealEnabled?: boolean; + autoHealRules?: AutoHealRules; + autoSwapSlotName?: string; + azureStorageAccounts?: Record; + connectionStrings?: ConnStringInfo[]; + cors?: CorsSettings; + defaultDocuments?: string[]; + detailedErrorLoggingEnabled?: boolean; + documentRoot?: string; + elasticWebAppScaleLimit?: number; + experiments?: Experiments; + ftpsState?: FtpsState; + functionAppScaleLimit?: number; + functionsRuntimeScaleMonitoringEnabled?: boolean; + handlerMappings?: HandlerMapping[]; + healthCheckPath?: string; + http20Enabled?: boolean; + http20ProxyFlag?: number; + httpLoggingEnabled?: boolean; + ipSecurityRestrictions?: IpSecurityRestriction[]; + ipSecurityRestrictionsDefaultAction?: DefaultAction; + javaContainer?: string; + javaContainerVersion?: string; + javaVersion?: string; + keyVaultReferenceIdentity?: string; + limits?: SiteLimits; + linuxFxVersion?: string; + loadBalancing?: SiteLoadBalancing; + localMySqlEnabled?: boolean; + logsDirectorySizeLimit?: number; + readonly machineKey?: SiteMachineKey; + managedPipelineMode?: ManagedPipelineMode; + managedServiceIdentityId?: number; + metadata?: NameValuePair[]; + minimumElasticInstanceCount?: number; + minTlsCipherSuite?: TlsCipherSuites; + minTlsVersion?: SupportedTlsVersions; + netFrameworkVersion?: string; + nodeVersion?: string; + numberOfWorkers?: number; + phpVersion?: string; + powerShellVersion?: string; + preWarmedInstanceCount?: number; + publicNetworkAccess?: string; + publishingUsername?: string; + push?: PushSettings; + pythonVersion?: string; + remoteDebuggingEnabled?: boolean; + remoteDebuggingVersion?: string; + requestTracingEnabled?: boolean; + requestTracingExpirationTime?: Date; + scmIpSecurityRestrictions?: IpSecurityRestriction[]; + scmIpSecurityRestrictionsDefaultAction?: DefaultAction; + scmIpSecurityRestrictionsUseMain?: boolean; + scmMinTlsVersion?: SupportedTlsVersions; + scmType?: ScmType; + tracingOptions?: string; + use32BitWorkerProcess?: boolean; + virtualApplications?: VirtualApplication[]; + vnetName?: string; + vnetPrivatePortsCount?: number; + vnetRouteAllEnabled?: boolean; + websiteTimeZone?: string; + webSocketsEnabled?: boolean; + windowsFxVersion?: string; + xManagedServiceIdentityId?: number; +} + +// @public +export interface SiteConfigPropertiesDictionary { + readonly javaVersion?: string; + readonly linuxFxVersion?: string; + readonly powerShellVersion?: string; + readonly use32BitWorkerProcess?: boolean; +} + +// @public +export interface SiteDnsConfig { + dnsAltServer?: string; + readonly dnsLegacySortOrder?: boolean; + dnsMaxCacheTimeout?: number; + dnsRetryAttemptCount?: number; + dnsRetryAttemptTimeout?: number; + dnsServers?: string[]; +} + +// @public +export interface SiteLimits { + maxDiskSizeInMb?: number; + maxMemoryInMb?: number; + maxPercentageCpu?: number; +} + +// @public +export type SiteLoadBalancing = "WeightedRoundRobin" | "LeastRequests" | "LeastResponseTime" | "WeightedTotalTraffic" | "RequestHash" | "PerSiteRoundRobin" | "LeastRequestsWithTieBreaker"; + +// @public +export interface SiteMachineKey { + decryption?: string; + decryptionKey?: string; + validation?: string; + validationKey?: string; +} + +// @public +export interface SiteProperties { + autoGeneratedDomainNameLabelScope?: AutoGeneratedDomainNameLabelScope; + readonly availabilityState?: SiteAvailabilityState; + clientAffinityEnabled?: boolean; + clientAffinityPartitioningEnabled?: boolean; + clientAffinityProxyEnabled?: boolean; + clientCertEnabled?: boolean; + clientCertExclusionPaths?: string; + clientCertMode?: ClientCertMode; + cloningInfo?: CloningInfo; + containerSize?: number; + customDomainVerificationId?: string; + dailyMemoryTimeQuota?: number; + daprConfig?: DaprConfig; + readonly defaultHostName?: string; + dnsConfiguration?: SiteDnsConfig; + enabled?: boolean; + readonly enabledHostNames?: string[]; + endToEndEncryptionEnabled?: boolean; + functionAppConfig?: FunctionAppConfig; + hostingEnvironmentProfile?: HostingEnvironmentProfile; + readonly hostNames?: string[]; + hostNamesDisabled?: boolean; + hostNameSslStates?: HostNameSslState[]; + httpsOnly?: boolean; + hyperV?: boolean; + readonly inProgressOperationId?: string; + ipMode?: IPMode; + readonly isDefaultContainer?: boolean; + isXenon?: boolean; + keyVaultReferenceIdentity?: string; + readonly lastModifiedTimeUtc?: Date; + managedEnvironmentId?: string; + readonly maxNumberOfWorkers?: number; + readonly outboundIpAddresses?: string; + outboundVnetRouting?: OutboundVnetRouting; + readonly possibleOutboundIpAddresses?: string; + publicNetworkAccess?: string; + redundancyMode?: RedundancyMode; + readonly repositorySiteName?: string; + reserved?: boolean; + resourceConfig?: ResourceConfig; + readonly resourceGroup?: string; + scmSiteAlsoStopped?: boolean; + serverFarmId?: string; + siteConfig?: SiteConfig; + readonly sku?: string; + readonly slotSwapStatus?: SlotSwapStatus; + sshEnabled?: boolean; + readonly state?: string; + storageAccountRequired?: boolean; + readonly suspendedTill?: Date; + readonly targetSwapSlot?: string; + readonly trafficManagerHostNames?: string[]; + readonly usageState?: UsageState; + virtualNetworkSubnetId?: string; + workloadProfileName?: string; +} + +// @public +export type SiteUpdateStrategyType = string; + +// @public +export interface SkuCapacity { + default?: number; + elasticMaximum?: number; + maximum?: number; + minimum?: number; + scaleType?: string; +} + +// @public +export interface SkuInfos { + resourceType?: string; + skus?: GlobalCsmSkuDescription[]; +} + +// @public +export type SkuName = string; + +// @public +export interface SlotSwapStatus { + readonly destinationSlotName?: string; + readonly sourceSlotName?: string; + readonly timestampUtc?: Date; +} + +// @public +export interface SlowRequestsBasedTrigger { + count?: number; + path?: string; + timeInterval?: string; + timeTaken?: string; +} + +// @public +export type SslState = "Disabled" | "SniEnabled" | "IpBasedEnabled"; + +// @public +export interface StackMajorVersion { + applicationInsights?: boolean; + appSettingsDictionary?: Record; + displayVersion?: string; + isDefault?: boolean; + isDeprecated?: boolean; + isHidden?: boolean; + isPreview?: boolean; + minorVersions?: StackMinorVersion[]; + runtimeVersion?: string; + siteConfigPropertiesDictionary?: Record; +} + +// @public +export interface StackMinorVersion { + displayVersion?: string; + isDefault?: boolean; + isRemoteDebuggingEnabled?: boolean; + runtimeVersion?: string; +} + +// @public +export type StackPreferredOs = "Windows" | "Linux"; + +// @public +export interface StaticSiteBuildProperties { + apiBuildCommand?: string; + apiLocation?: string; + appArtifactLocation?: string; + appBuildCommand?: string; + appLocation?: string; + githubActionSecretNameOverride?: string; + outputLocation?: string; + skipGithubActionWorkflowGeneration?: boolean; +} + +// @public +export interface StaticSitesOperationGroupOperations { + previewWorkflow: (location: string, body: StaticSitesWorkflowPreviewRequest, options?: StaticSitesOperationGroupPreviewWorkflowOptionalParams) => Promise; +} + +// @public +export interface StaticSitesOperationGroupPreviewWorkflowOptionalParams extends OperationOptions { +} + +// @public +export interface StaticSitesWorkflowPreview extends ProxyOnlyResource { + readonly contents?: string; + readonly path?: string; +} + +// @public +export interface StaticSitesWorkflowPreviewProperties { + readonly contents?: string; + readonly path?: string; +} + +// @public +export interface StaticSitesWorkflowPreviewRequest extends ProxyOnlyResource { + branch?: string; + buildProperties?: StaticSiteBuildProperties; + repositoryUrl?: string; +} + +// @public +export interface StaticSitesWorkflowPreviewRequestProperties { + branch?: string; + buildProperties?: StaticSiteBuildProperties; + repositoryUrl?: string; +} + +// @public +export interface StatusCodesBasedTrigger { + count?: number; + path?: string; + status?: number; + subStatus?: number; + timeInterval?: string; + win32Status?: number; +} + +// @public +export interface StatusCodesRangeBasedTrigger { + count?: number; + // (undocumented) + path?: string; + statusCodes?: string; + timeInterval?: string; +} + +// @public +export type SupportedTlsVersions = string; + +// @public +export interface SystemData { + createdAt?: Date; + createdBy?: string; + createdByType?: CreatedByType; + lastModifiedAt?: Date; + lastModifiedBy?: string; + lastModifiedByType?: CreatedByType; +} + +// @public +export type TlsCipherSuites = string; + +// @public +export type UpgradeAvailability = string; + +// @public +export type UpgradePreference = string; + +// @public +export type UsageState = "Normal" | "Exceeded"; + +// @public +export interface UserAssignedIdentity { + readonly clientId?: string; + readonly principalId?: string; +} + +// @public +export interface ValidateMoveOptionalParams extends OperationOptions { +} + +// @public +export interface ValidateOptionalParams extends OperationOptions { +} + +// @public +export interface ValidateProperties { + appServiceEnvironment?: AppServiceEnvironment; + capacity?: number; + containerImagePlatform?: string; + containerImageRepository?: string; + containerImageTag?: string; + containerRegistryBaseUrl?: string; + containerRegistryPassword?: string; + containerRegistryUsername?: string; + hostingEnvironment?: string; + isSpot?: boolean; + isXenon?: boolean; + needLinuxWorkers?: boolean; + serverFarmId?: string; + skuName?: string; +} + +// @public +export interface ValidateRequest { + appServiceEnvironment?: AppServiceEnvironment; + capacity?: number; + containerImagePlatform?: string; + containerImageRepository?: string; + containerImageTag?: string; + containerRegistryBaseUrl?: string; + containerRegistryPassword?: string; + containerRegistryUsername?: string; + hostingEnvironment?: string; + isSpot?: boolean; + isXenon?: boolean; + location: string; + name: string; + needLinuxWorkers?: boolean; + serverFarmId?: string; + skuName?: string; + type: ValidateResourceTypes; +} + +// @public +export type ValidateResourceTypes = string; + +// @public +export interface ValidateResponse { + error?: ValidateResponseError; + status?: string; +} + +// @public +export interface ValidateResponseError { + code?: string; + message?: string; +} + +// @public +export interface VerifyHostingEnvironmentVnetOptionalParams extends OperationOptions { +} + +// @public +export interface VirtualApplication { + physicalPath?: string; + preloadEnabled?: boolean; + virtualDirectories?: VirtualDirectory[]; + virtualPath?: string; +} + +// @public +export interface VirtualDirectory { + physicalPath?: string; + virtualPath?: string; +} + +// @public +export interface VirtualNetworkProfile { + id: string; + readonly name?: string; + subnet?: string; + readonly type?: string; +} + +// @public +export interface VnetParameters extends ProxyOnlyResource { + subnetResourceId?: string; + vnetName?: string; + vnetResourceGroup?: string; + vnetSubnetName?: string; +} + +// @public +export interface VnetParametersProperties { + subnetResourceId?: string; + vnetName?: string; + vnetResourceGroup?: string; + vnetSubnetName?: string; +} + +// @public +export interface VnetValidationFailureDetails extends ProxyOnlyResource { + failed?: boolean; + failedTests?: VnetValidationTestFailure[]; + message?: string; + warnings?: VnetValidationTestFailure[]; +} + +// @public +export interface VnetValidationFailureDetailsProperties { + failed?: boolean; + failedTests?: VnetValidationTestFailure[]; + message?: string; + warnings?: VnetValidationTestFailure[]; +} + +// @public +export interface VnetValidationTestFailure extends ProxyOnlyResource { + details?: string; + testName?: string; +} + +// @public +export interface VnetValidationTestFailureProperties { + details?: string; + testName?: string; +} + +// @public +export interface WebAppMajorVersion { + readonly displayText?: string; + readonly minorVersions?: WebAppMinorVersion[]; + readonly value?: string; +} + +// @public +export interface WebAppMinorVersion { + readonly displayText?: string; + readonly stackSettings?: WebAppRuntimes; + readonly value?: string; +} + +// @public +export interface WebAppRuntimes { + readonly linuxContainerSettings?: LinuxJavaContainerSettings; + readonly linuxRuntimeSettings?: WebAppRuntimeSettings; + readonly windowsContainerSettings?: WindowsJavaContainerSettings; + readonly windowsRuntimeSettings?: WebAppRuntimeSettings; +} + +// @public +export interface WebAppRuntimeSettings { + readonly appInsightsSettings?: AppInsightsWebAppStackSettings; + readonly endOfLifeDate?: Date; + readonly gitHubActionSettings?: GitHubActionWebAppStackSettings; + readonly isAutoUpdate?: boolean; + readonly isDeprecated?: boolean; + readonly isEarlyAccess?: boolean; + readonly isHidden?: boolean; + readonly isPreview?: boolean; + readonly remoteDebuggingSupported?: boolean; + readonly runtimeVersion?: string; +} + +// @public +export interface WebAppStack extends ProxyOnlyResource { + readonly displayText?: string; + readonly location?: string; + readonly majorVersions?: WebAppMajorVersion[]; + readonly preferredOs?: StackPreferredOs; + readonly value?: string; +} + +// @public +export interface WebAppStackProperties { + readonly displayText?: string; + readonly majorVersions?: WebAppMajorVersion[]; + readonly preferredOs?: StackPreferredOs; + readonly value?: string; +} + +// @public (undocumented) +export class WebSiteManagementClient { + constructor(credential: TokenCredential, options?: WebSiteManagementClientOptionalParams); + constructor(credential: TokenCredential, subscriptionId: string, options?: WebSiteManagementClientOptionalParams); + readonly appServiceEnvironmentResources: AppServiceEnvironmentResourcesOperations; + checkNameAvailability(body: ResourceNameAvailabilityRequest, options?: CheckNameAvailabilityOptionalParams): Promise; + getSubscriptionDeploymentLocations(options?: GetSubscriptionDeploymentLocationsOptionalParams): Promise; + readonly getUsagesInLocationOperationGroup: GetUsagesInLocationOperationGroupOperations; + readonly globalOperationGroup: GlobalOperationGroupOperations; + listAseRegions(options?: ListAseRegionsOptionalParams): PagedAsyncIterableIterator; + listBillingMeters(options?: ListBillingMetersOptionalParams): PagedAsyncIterableIterator; + listCustomHostNameSites(options?: ListCustomHostNameSitesOptionalParams): PagedAsyncIterableIterator; + listGeoRegions(options?: ListGeoRegionsOptionalParams): PagedAsyncIterableIterator; + listPremierAddOnOffers(options?: ListPremierAddOnOffersOptionalParams): PagedAsyncIterableIterator; + listSkus(options?: ListSkusOptionalParams): Promise; + move(resourceGroupName: string, moveResourceEnvelope: CsmMoveResourceEnvelope, options?: MoveOptionalParams): Promise; + readonly operations: OperationsOperations; + readonly pipeline: Pipeline; + readonly providerOperationGroup: ProviderOperationGroupOperations; + readonly recommendationsOperationGroup: RecommendationsOperationGroupOperations; + regionalCheckNameAvailability(location: string, body: DnlResourceNameAvailabilityRequest, options?: RegionalCheckNameAvailabilityOptionalParams): Promise; + readonly staticSitesOperationGroup: StaticSitesOperationGroupOperations; + validate(resourceGroupName: string, validateRequest: ValidateRequest, options?: ValidateOptionalParams): Promise; + validateMove(resourceGroupName: string, moveResourceEnvelope: CsmMoveResourceEnvelope, options?: ValidateMoveOptionalParams): Promise; + verifyHostingEnvironmentVnet(body: VnetParameters, options?: VerifyHostingEnvironmentVnetOptionalParams): Promise; +} + +// @public +export interface WebSiteManagementClientOptionalParams extends ClientOptions { + apiVersion?: string; + cloudSetting?: AzureSupportedClouds; +} + +// @public +export interface WindowsJavaContainerSettings { + readonly endOfLifeDate?: Date; + readonly isAutoUpdate?: boolean; + readonly isDeprecated?: boolean; + readonly isEarlyAccess?: boolean; + readonly isHidden?: boolean; + readonly isPreview?: boolean; + readonly javaContainer?: string; + readonly javaContainerVersion?: string; +} + +// (No @packageDocumentation comment for this package) + +``` diff --git a/packages/typespec-test/test/AppService/generated/typespec-ts/rollup.config.js b/packages/typespec-test/test/AppService/generated/typespec-ts/rollup.config.js new file mode 100644 index 0000000000..92fab887b9 --- /dev/null +++ b/packages/typespec-test/test/AppService/generated/typespec-ts/rollup.config.js @@ -0,0 +1,117 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import nodeResolve from "@rollup/plugin-node-resolve"; +import cjs from "@rollup/plugin-commonjs"; +import sourcemaps from "rollup-plugin-sourcemaps"; +import multiEntry from "@rollup/plugin-multi-entry"; +import json from "@rollup/plugin-json"; + +import nodeBuiltins from "builtin-modules"; + +// #region Warning Handler + +/** + * A function that can determine whether a rollup warning should be ignored. If + * the function returns `true`, then the warning will not be displayed. + */ + +function ignoreNiseSinonEval(warning) { + return ( + warning.code === "EVAL" && + warning.id && + (warning.id.includes("node_modules/nise") || warning.id.includes("node_modules/sinon")) === true + ); +} + +function ignoreChaiCircularDependency(warning) { + return ( + warning.code === "CIRCULAR_DEPENDENCY" && + warning.importer && + warning.importer.includes("node_modules/chai") === true + ); +} + +const warningInhibitors = [ignoreChaiCircularDependency, ignoreNiseSinonEval]; + +/** + * Construct a warning handler for the shared rollup configuration + * that ignores certain warnings that are not relevant to testing. + */ +function makeOnWarnForTesting() { + return (warning, warn) => { + // If every inhibitor returns false (i.e. no inhibitors), then show the warning + if (warningInhibitors.every((inhib) => !inhib(warning))) { + warn(warning); + } + }; +} + +// #endregion + +function makeBrowserTestConfig() { + const config = { + input: { + include: ["dist-esm/test/**/*.spec.js"], + exclude: ["dist-esm/test/**/node/**"], + }, + output: { + file: `dist-test/index.browser.js`, + format: "umd", + sourcemap: true, + }, + preserveSymlinks: false, + plugins: [ + multiEntry({ exports: false }), + nodeResolve({ + mainFields: ["module", "browser"], + }), + cjs(), + json(), + sourcemaps(), + //viz({ filename: "dist-test/browser-stats.html", sourcemap: true }) + ], + onwarn: makeOnWarnForTesting(), + // Disable tree-shaking of test code. In rollup-plugin-node-resolve@5.0.0, + // rollup started respecting the "sideEffects" field in package.json. Since + // our package.json sets "sideEffects=false", this also applies to test + // code, which causes all tests to be removed by tree-shaking. + treeshake: false, + }; + + return config; +} + +const defaultConfigurationOptions = { + disableBrowserBundle: false, +}; + +export function makeConfig(pkg, options) { + options = { + ...defaultConfigurationOptions, + ...(options || {}), + }; + + const baseConfig = { + // Use the package's module field if it has one + input: pkg["module"] || "dist-esm/src/index.js", + external: [ + ...nodeBuiltins, + ...Object.keys(pkg.dependencies), + ...Object.keys(pkg.devDependencies), + ], + output: { file: "dist/index.js", format: "cjs", sourcemap: true }, + preserveSymlinks: false, + plugins: [sourcemaps(), nodeResolve()], + }; + + const config = [baseConfig]; + + if (!options.disableBrowserBundle) { + config.push(makeBrowserTestConfig()); + } + + return config; +} + +export default makeConfig(require("./package.json")); diff --git a/packages/typespec-test/test/AppService/generated/typespec-ts/src/api/appServiceEnvironmentResources/index.ts b/packages/typespec-test/test/AppService/generated/typespec-ts/src/api/appServiceEnvironmentResources/index.ts new file mode 100644 index 0000000000..63cf04e9dc --- /dev/null +++ b/packages/typespec-test/test/AppService/generated/typespec-ts/src/api/appServiceEnvironmentResources/index.ts @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +export { suspend, resume, changeVnet } from "./operations.js"; +export { + AppServiceEnvironmentResourcesSuspendOptionalParams, + AppServiceEnvironmentResourcesResumeOptionalParams, + AppServiceEnvironmentResourcesChangeVnetOptionalParams, +} from "./options.js"; diff --git a/packages/typespec-test/test/AppService/generated/typespec-ts/src/api/appServiceEnvironmentResources/operations.ts b/packages/typespec-test/test/AppService/generated/typespec-ts/src/api/appServiceEnvironmentResources/operations.ts new file mode 100644 index 0000000000..4d13949dba --- /dev/null +++ b/packages/typespec-test/test/AppService/generated/typespec-ts/src/api/appServiceEnvironmentResources/operations.ts @@ -0,0 +1,235 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { WebSiteManagementContext as Client } from "../index.js"; +import { + defaultErrorResponseDeserializer, + VirtualNetworkProfile, + virtualNetworkProfileSerializer, + _WebAppCollection, + _webAppCollectionDeserializer, + Site, +} from "../../models/models.js"; +import { + PagedAsyncIterableIterator, + buildPagedAsyncIterator, +} from "../../static-helpers/pagingHelpers.js"; +import { getLongRunningPoller } from "../../static-helpers/pollingHelpers.js"; +import { expandUrlTemplate } from "../../static-helpers/urlTemplate.js"; +import { + AppServiceEnvironmentResourcesSuspendOptionalParams, + AppServiceEnvironmentResourcesResumeOptionalParams, + AppServiceEnvironmentResourcesChangeVnetOptionalParams, +} from "./options.js"; +import { + StreamableMethod, + PathUncheckedResponse, + createRestError, + operationOptionsToRequestParameters, +} from "@azure-rest/core-client"; +import { PollerLike, OperationState } from "@azure/core-lro"; + +export function _suspendSend( + context: Client, + resourceGroupName: string, + name: string, + options: AppServiceEnvironmentResourcesSuspendOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/suspend{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + name: name, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context + .path(path) + .post({ + ...operationOptionsToRequestParameters(options), + headers: { accept: "application/json", ...options.requestOptions?.headers }, + }); +} + +export async function _suspendDeserialize( + result: PathUncheckedResponse, +): Promise<_WebAppCollection> { + const expectedStatuses = ["200", "202", "201"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = defaultErrorResponseDeserializer(result.body); + throw error; + } + + return _webAppCollectionDeserializer(result.body); +} + +/** Description for Suspend an App Service Environment. */ +export function suspend( + context: Client, + resourceGroupName: string, + name: string, + options: AppServiceEnvironmentResourcesSuspendOptionalParams = { requestOptions: {} }, +): PagedAsyncIterableIterator { + const initialPagingPoller = getLongRunningPoller( + context, + async (result: PathUncheckedResponse) => result, + ["200", "202", "201"], + { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => _suspendSend(context, resourceGroupName, name, options), + resourceLocationConfig: "location", + }, + ) as PollerLike, PathUncheckedResponse>; + + return buildPagedAsyncIterator( + context, + async () => await initialPagingPoller, + _suspendDeserialize, + ["200", "202", "201"], + { itemName: "value", nextLinkName: "nextLink" }, + ); +} + +export function _resumeSend( + context: Client, + resourceGroupName: string, + name: string, + options: AppServiceEnvironmentResourcesResumeOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/resume{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + name: name, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context + .path(path) + .post({ + ...operationOptionsToRequestParameters(options), + headers: { accept: "application/json", ...options.requestOptions?.headers }, + }); +} + +export async function _resumeDeserialize( + result: PathUncheckedResponse, +): Promise<_WebAppCollection> { + const expectedStatuses = ["200", "202", "201"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = defaultErrorResponseDeserializer(result.body); + throw error; + } + + return _webAppCollectionDeserializer(result.body); +} + +/** Description for Resume an App Service Environment. */ +export function resume( + context: Client, + resourceGroupName: string, + name: string, + options: AppServiceEnvironmentResourcesResumeOptionalParams = { requestOptions: {} }, +): PagedAsyncIterableIterator { + const initialPagingPoller = getLongRunningPoller( + context, + async (result: PathUncheckedResponse) => result, + ["200", "202", "201"], + { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => _resumeSend(context, resourceGroupName, name, options), + resourceLocationConfig: "location", + }, + ) as PollerLike, PathUncheckedResponse>; + + return buildPagedAsyncIterator( + context, + async () => await initialPagingPoller, + _resumeDeserialize, + ["200", "202", "201"], + { itemName: "value", nextLinkName: "nextLink" }, + ); +} + +export function _changeVnetSend( + context: Client, + resourceGroupName: string, + name: string, + body: VirtualNetworkProfile, + options: AppServiceEnvironmentResourcesChangeVnetOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/changeVirtualNetwork{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + name: name, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context + .path(path) + .post({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + headers: { accept: "application/json", ...options.requestOptions?.headers }, + body: virtualNetworkProfileSerializer(body), + }); +} + +export async function _changeVnetDeserialize( + result: PathUncheckedResponse, +): Promise<_WebAppCollection> { + const expectedStatuses = ["200", "202", "201"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = defaultErrorResponseDeserializer(result.body); + throw error; + } + + return _webAppCollectionDeserializer(result.body); +} + +/** Description for Move an App Service Environment to a different VNET. */ +export function changeVnet( + context: Client, + resourceGroupName: string, + name: string, + body: VirtualNetworkProfile, + options: AppServiceEnvironmentResourcesChangeVnetOptionalParams = { requestOptions: {} }, +): PagedAsyncIterableIterator { + const initialPagingPoller = getLongRunningPoller( + context, + async (result: PathUncheckedResponse) => result, + ["200", "202", "201"], + { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => _changeVnetSend(context, resourceGroupName, name, body, options), + resourceLocationConfig: "location", + }, + ) as PollerLike, PathUncheckedResponse>; + + return buildPagedAsyncIterator( + context, + async () => await initialPagingPoller, + _changeVnetDeserialize, + ["200", "202", "201"], + { itemName: "value", nextLinkName: "nextLink" }, + ); +} diff --git a/packages/typespec-test/test/AppService/generated/typespec-ts/src/api/appServiceEnvironmentResources/options.ts b/packages/typespec-test/test/AppService/generated/typespec-ts/src/api/appServiceEnvironmentResources/options.ts new file mode 100644 index 0000000000..f069bd0494 --- /dev/null +++ b/packages/typespec-test/test/AppService/generated/typespec-ts/src/api/appServiceEnvironmentResources/options.ts @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { OperationOptions } from "@azure-rest/core-client"; + +/** Optional parameters. */ +export interface AppServiceEnvironmentResourcesSuspendOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface AppServiceEnvironmentResourcesResumeOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface AppServiceEnvironmentResourcesChangeVnetOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} diff --git a/packages/typespec-test/test/AppService/generated/typespec-ts/src/api/getUsagesInLocationOperationGroup/index.ts b/packages/typespec-test/test/AppService/generated/typespec-ts/src/api/getUsagesInLocationOperationGroup/index.ts new file mode 100644 index 0000000000..a58bb5d761 --- /dev/null +++ b/packages/typespec-test/test/AppService/generated/typespec-ts/src/api/getUsagesInLocationOperationGroup/index.ts @@ -0,0 +1,5 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +export { list } from "./operations.js"; +export { GetUsagesInLocationOperationGroupListOptionalParams } from "./options.js"; diff --git a/packages/typespec-test/test/AppService/generated/typespec-ts/src/api/getUsagesInLocationOperationGroup/operations.ts b/packages/typespec-test/test/AppService/generated/typespec-ts/src/api/getUsagesInLocationOperationGroup/operations.ts new file mode 100644 index 0000000000..a7cb7c64f1 --- /dev/null +++ b/packages/typespec-test/test/AppService/generated/typespec-ts/src/api/getUsagesInLocationOperationGroup/operations.ts @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { WebSiteManagementContext as Client } from "../index.js"; +import { + defaultErrorResponseDeserializer, + _CsmUsageQuotaCollection, + _csmUsageQuotaCollectionDeserializer, + CsmUsageQuota, +} from "../../models/models.js"; +import { + PagedAsyncIterableIterator, + buildPagedAsyncIterator, +} from "../../static-helpers/pagingHelpers.js"; +import { expandUrlTemplate } from "../../static-helpers/urlTemplate.js"; +import { GetUsagesInLocationOperationGroupListOptionalParams } from "./options.js"; +import { + StreamableMethod, + PathUncheckedResponse, + createRestError, + operationOptionsToRequestParameters, +} from "@azure-rest/core-client"; + +export function _listSend( + context: Client, + location: string, + options: GetUsagesInLocationOperationGroupListOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/providers/Microsoft.Web/locations/{location}/usages{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + location: location, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context + .path(path) + .get({ + ...operationOptionsToRequestParameters(options), + headers: { accept: "application/json", ...options.requestOptions?.headers }, + }); +} + +export async function _listDeserialize( + result: PathUncheckedResponse, +): Promise<_CsmUsageQuotaCollection> { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = defaultErrorResponseDeserializer(result.body); + throw error; + } + + return _csmUsageQuotaCollectionDeserializer(result.body); +} + +/** List usages in cores for all skus used by a subscription in a given location, for a specific quota type. */ +export function list( + context: Client, + location: string, + options: GetUsagesInLocationOperationGroupListOptionalParams = { requestOptions: {} }, +): PagedAsyncIterableIterator { + return buildPagedAsyncIterator( + context, + () => _listSend(context, location, options), + _listDeserialize, + ["200"], + { itemName: "value", nextLinkName: "nextLink" }, + ); +} diff --git a/packages/typespec-test/test/AppService/generated/typespec-ts/src/api/getUsagesInLocationOperationGroup/options.ts b/packages/typespec-test/test/AppService/generated/typespec-ts/src/api/getUsagesInLocationOperationGroup/options.ts new file mode 100644 index 0000000000..9b7c675d92 --- /dev/null +++ b/packages/typespec-test/test/AppService/generated/typespec-ts/src/api/getUsagesInLocationOperationGroup/options.ts @@ -0,0 +1,7 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { OperationOptions } from "@azure-rest/core-client"; + +/** Optional parameters. */ +export interface GetUsagesInLocationOperationGroupListOptionalParams extends OperationOptions {} diff --git a/packages/typespec-test/test/AppService/generated/typespec-ts/src/api/globalOperationGroup/index.ts b/packages/typespec-test/test/AppService/generated/typespec-ts/src/api/globalOperationGroup/index.ts new file mode 100644 index 0000000000..f95941b185 --- /dev/null +++ b/packages/typespec-test/test/AppService/generated/typespec-ts/src/api/globalOperationGroup/index.ts @@ -0,0 +1,5 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +export { getSubscriptionOperationWithAsyncResponse } from "./operations.js"; +export { GlobalOperationGroupGetSubscriptionOperationWithAsyncResponseOptionalParams } from "./options.js"; diff --git a/packages/typespec-test/test/AppService/generated/typespec-ts/src/api/globalOperationGroup/operations.ts b/packages/typespec-test/test/AppService/generated/typespec-ts/src/api/globalOperationGroup/operations.ts new file mode 100644 index 0000000000..5931a4541e --- /dev/null +++ b/packages/typespec-test/test/AppService/generated/typespec-ts/src/api/globalOperationGroup/operations.ts @@ -0,0 +1,67 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { WebSiteManagementContext as Client } from "../index.js"; +import { defaultErrorResponseDeserializer } from "../../models/models.js"; +import { expandUrlTemplate } from "../../static-helpers/urlTemplate.js"; +import { GlobalOperationGroupGetSubscriptionOperationWithAsyncResponseOptionalParams } from "./options.js"; +import { + StreamableMethod, + PathUncheckedResponse, + createRestError, + operationOptionsToRequestParameters, +} from "@azure-rest/core-client"; + +export function _getSubscriptionOperationWithAsyncResponseSend( + context: Client, + location: string, + operationId: string, + options: GlobalOperationGroupGetSubscriptionOperationWithAsyncResponseOptionalParams = { + requestOptions: {}, + }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/providers/Microsoft.Web/locations/{location}/operations/{operationId}{?api%2Dversion}", + { + location: location, + operationId: operationId, + subscriptionId: context.subscriptionId, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).get({ ...operationOptionsToRequestParameters(options) }); +} + +export async function _getSubscriptionOperationWithAsyncResponseDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["204"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = defaultErrorResponseDeserializer(result.body); + throw error; + } + + return; +} + +/** Description for Gets an operation in a subscription and given region */ +export async function getSubscriptionOperationWithAsyncResponse( + context: Client, + location: string, + operationId: string, + options: GlobalOperationGroupGetSubscriptionOperationWithAsyncResponseOptionalParams = { + requestOptions: {}, + }, +): Promise { + const result = await _getSubscriptionOperationWithAsyncResponseSend( + context, + location, + operationId, + options, + ); + return _getSubscriptionOperationWithAsyncResponseDeserialize(result); +} diff --git a/packages/typespec-test/test/AppService/generated/typespec-ts/src/api/globalOperationGroup/options.ts b/packages/typespec-test/test/AppService/generated/typespec-ts/src/api/globalOperationGroup/options.ts new file mode 100644 index 0000000000..1281fb15b6 --- /dev/null +++ b/packages/typespec-test/test/AppService/generated/typespec-ts/src/api/globalOperationGroup/options.ts @@ -0,0 +1,7 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { OperationOptions } from "@azure-rest/core-client"; + +/** Optional parameters. */ +export interface GlobalOperationGroupGetSubscriptionOperationWithAsyncResponseOptionalParams extends OperationOptions {} diff --git a/packages/typespec-test/test/AppService/generated/typespec-ts/src/api/index.ts b/packages/typespec-test/test/AppService/generated/typespec-ts/src/api/index.ts new file mode 100644 index 0000000000..a0af5a7367 --- /dev/null +++ b/packages/typespec-test/test/AppService/generated/typespec-ts/src/api/index.ts @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +export { + move, + verifyHostingEnvironmentVnet, + listSkus, + listPremierAddOnOffers, + regionalCheckNameAvailability, + listGeoRegions, + listCustomHostNameSites, + checkNameAvailability, + listBillingMeters, + listAseRegions, + getSubscriptionDeploymentLocations, + validate, + validateMove, +} from "./operations.js"; +export { + MoveOptionalParams, + VerifyHostingEnvironmentVnetOptionalParams, + ListSkusOptionalParams, + ListPremierAddOnOffersOptionalParams, + RegionalCheckNameAvailabilityOptionalParams, + ListGeoRegionsOptionalParams, + ListCustomHostNameSitesOptionalParams, + CheckNameAvailabilityOptionalParams, + ListBillingMetersOptionalParams, + ListAseRegionsOptionalParams, + GetSubscriptionDeploymentLocationsOptionalParams, + ValidateOptionalParams, + ValidateMoveOptionalParams, +} from "./options.js"; +export { + createWebSiteManagement, + WebSiteManagementContext, + WebSiteManagementClientOptionalParams, +} from "./webSiteManagementContext.js"; diff --git a/packages/typespec-test/test/AppService/generated/typespec-ts/src/api/operations.ts b/packages/typespec-test/test/AppService/generated/typespec-ts/src/api/operations.ts new file mode 100644 index 0000000000..55cd9e4bd7 --- /dev/null +++ b/packages/typespec-test/test/AppService/generated/typespec-ts/src/api/operations.ts @@ -0,0 +1,703 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { WebSiteManagementContext as Client } from "./index.js"; +import { + CsmMoveResourceEnvelope, + csmMoveResourceEnvelopeSerializer, + defaultErrorResponseDeserializer, + ValidateRequest, + validateRequestSerializer, + ValidateResponse, + validateResponseDeserializer, + DeploymentLocations, + deploymentLocationsDeserializer, + GeoRegion, + _AseRegionCollection, + _aseRegionCollectionDeserializer, + AseRegion, + _BillingMeterCollection, + _billingMeterCollectionDeserializer, + BillingMeter, + ResourceNameAvailabilityRequest, + resourceNameAvailabilityRequestSerializer, + ResourceNameAvailability, + resourceNameAvailabilityDeserializer, + _CustomHostnameSitesCollection, + _customHostnameSitesCollectionDeserializer, + CustomHostnameSites, + _GeoRegionCollection, + _geoRegionCollectionDeserializer, + DnlResourceNameAvailabilityRequest, + dnlResourceNameAvailabilityRequestSerializer, + DnlResourceNameAvailability, + dnlResourceNameAvailabilityDeserializer, + _PremierAddOnOfferCollection, + _premierAddOnOfferCollectionDeserializer, + PremierAddOnOffer, + SkuInfos, + skuInfosDeserializer, + VnetParameters, + vnetParametersSerializer, + VnetValidationFailureDetails, + vnetValidationFailureDetailsDeserializer, +} from "../models/models.js"; +import { + PagedAsyncIterableIterator, + buildPagedAsyncIterator, +} from "../static-helpers/pagingHelpers.js"; +import { expandUrlTemplate } from "../static-helpers/urlTemplate.js"; +import { + MoveOptionalParams, + VerifyHostingEnvironmentVnetOptionalParams, + ListSkusOptionalParams, + ListPremierAddOnOffersOptionalParams, + RegionalCheckNameAvailabilityOptionalParams, + ListGeoRegionsOptionalParams, + ListCustomHostNameSitesOptionalParams, + CheckNameAvailabilityOptionalParams, + ListBillingMetersOptionalParams, + ListAseRegionsOptionalParams, + GetSubscriptionDeploymentLocationsOptionalParams, + ValidateOptionalParams, + ValidateMoveOptionalParams, +} from "./options.js"; +import { + StreamableMethod, + PathUncheckedResponse, + createRestError, + operationOptionsToRequestParameters, +} from "@azure-rest/core-client"; + +export function _moveSend( + context: Client, + resourceGroupName: string, + moveResourceEnvelope: CsmMoveResourceEnvelope, + options: MoveOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/moveResources{?api%2Dversion}", + { + resourceGroupName: resourceGroupName, + subscriptionId: context.subscriptionId, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context + .path(path) + .post({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + body: csmMoveResourceEnvelopeSerializer(moveResourceEnvelope), + }); +} + +export async function _moveDeserialize(result: PathUncheckedResponse): Promise { + const expectedStatuses = ["204"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = defaultErrorResponseDeserializer(result.body); + throw error; + } + + return; +} + +/** Description for Move resources between resource groups. */ +export async function move( + context: Client, + resourceGroupName: string, + moveResourceEnvelope: CsmMoveResourceEnvelope, + options: MoveOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _moveSend(context, resourceGroupName, moveResourceEnvelope, options); + return _moveDeserialize(result); +} + +export function _verifyHostingEnvironmentVnetSend( + context: Client, + body: VnetParameters, + options: VerifyHostingEnvironmentVnetOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/providers/Microsoft.Web/verifyHostingEnvironmentVnet{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context + .path(path) + .post({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + headers: { accept: "application/json", ...options.requestOptions?.headers }, + body: vnetParametersSerializer(body), + }); +} + +export async function _verifyHostingEnvironmentVnetDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = defaultErrorResponseDeserializer(result.body); + throw error; + } + + return vnetValidationFailureDetailsDeserializer(result.body); +} + +/** Description for Verifies if this VNET is compatible with an App Service Environment by analyzing the Network Security Group rules. */ +export async function verifyHostingEnvironmentVnet( + context: Client, + body: VnetParameters, + options: VerifyHostingEnvironmentVnetOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _verifyHostingEnvironmentVnetSend(context, body, options); + return _verifyHostingEnvironmentVnetDeserialize(result); +} + +export function _listSkusSend( + context: Client, + options: ListSkusOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/providers/Microsoft.Web/skus{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context + .path(path) + .get({ + ...operationOptionsToRequestParameters(options), + headers: { accept: "application/json", ...options.requestOptions?.headers }, + }); +} + +export async function _listSkusDeserialize(result: PathUncheckedResponse): Promise { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = defaultErrorResponseDeserializer(result.body); + throw error; + } + + return skuInfosDeserializer(result.body); +} + +/** Description for List all SKUs. */ +export async function listSkus( + context: Client, + options: ListSkusOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _listSkusSend(context, options); + return _listSkusDeserialize(result); +} + +export function _listPremierAddOnOffersSend( + context: Client, + options: ListPremierAddOnOffersOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/providers/Microsoft.Web/premieraddonoffers{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context + .path(path) + .get({ + ...operationOptionsToRequestParameters(options), + headers: { accept: "application/json", ...options.requestOptions?.headers }, + }); +} + +export async function _listPremierAddOnOffersDeserialize( + result: PathUncheckedResponse, +): Promise<_PremierAddOnOfferCollection> { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = defaultErrorResponseDeserializer(result.body); + throw error; + } + + return _premierAddOnOfferCollectionDeserializer(result.body); +} + +/** Description for List all premier add-on offers. */ +export function listPremierAddOnOffers( + context: Client, + options: ListPremierAddOnOffersOptionalParams = { requestOptions: {} }, +): PagedAsyncIterableIterator { + return buildPagedAsyncIterator( + context, + () => _listPremierAddOnOffersSend(context, options), + _listPremierAddOnOffersDeserialize, + ["200"], + { itemName: "value", nextLinkName: "nextLink" }, + ); +} + +export function _regionalCheckNameAvailabilitySend( + context: Client, + location: string, + body: DnlResourceNameAvailabilityRequest, + options: RegionalCheckNameAvailabilityOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/providers/Microsoft.Web/locations/{location}/checknameavailability{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + location: location, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context + .path(path) + .post({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + headers: { accept: "application/json", ...options.requestOptions?.headers }, + body: dnlResourceNameAvailabilityRequestSerializer(body), + }); +} + +export async function _regionalCheckNameAvailabilityDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = defaultErrorResponseDeserializer(result.body); + throw error; + } + + return dnlResourceNameAvailabilityDeserializer(result.body); +} + +/** Check if a resource name is available for DNL sites. */ +export async function regionalCheckNameAvailability( + context: Client, + location: string, + body: DnlResourceNameAvailabilityRequest, + options: RegionalCheckNameAvailabilityOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _regionalCheckNameAvailabilitySend(context, location, body, options); + return _regionalCheckNameAvailabilityDeserialize(result); +} + +export function _listGeoRegionsSend( + context: Client, + options: ListGeoRegionsOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/providers/Microsoft.Web/geoRegions{?api%2Dversion,sku,linuxWorkersEnabled,xenonWorkersEnabled,linuxDynamicWorkersEnabled,customModeWorkersEnabled}", + { + subscriptionId: context.subscriptionId, + "api%2Dversion": context.apiVersion, + sku: options?.sku, + linuxWorkersEnabled: options?.linuxWorkersEnabled, + xenonWorkersEnabled: options?.xenonWorkersEnabled, + linuxDynamicWorkersEnabled: options?.linuxDynamicWorkersEnabled, + customModeWorkersEnabled: options?.customModeWorkersEnabled, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context + .path(path) + .get({ + ...operationOptionsToRequestParameters(options), + headers: { accept: "application/json", ...options.requestOptions?.headers }, + }); +} + +export async function _listGeoRegionsDeserialize( + result: PathUncheckedResponse, +): Promise<_GeoRegionCollection> { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = defaultErrorResponseDeserializer(result.body); + throw error; + } + + return _geoRegionCollectionDeserializer(result.body); +} + +/** Description for Get a list of available geographical regions. */ +export function listGeoRegions( + context: Client, + options: ListGeoRegionsOptionalParams = { requestOptions: {} }, +): PagedAsyncIterableIterator { + return buildPagedAsyncIterator( + context, + () => _listGeoRegionsSend(context, options), + _listGeoRegionsDeserialize, + ["200"], + { itemName: "value", nextLinkName: "nextLink" }, + ); +} + +export function _listCustomHostNameSitesSend( + context: Client, + options: ListCustomHostNameSitesOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/providers/Microsoft.Web/customhostnameSites{?api%2Dversion,hostname}", + { + subscriptionId: context.subscriptionId, + "api%2Dversion": context.apiVersion, + hostname: options?.hostname, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context + .path(path) + .get({ + ...operationOptionsToRequestParameters(options), + headers: { accept: "application/json", ...options.requestOptions?.headers }, + }); +} + +export async function _listCustomHostNameSitesDeserialize( + result: PathUncheckedResponse, +): Promise<_CustomHostnameSitesCollection> { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = defaultErrorResponseDeserializer(result.body); + throw error; + } + + return _customHostnameSitesCollectionDeserializer(result.body); +} + +/** Get custom hostnames under this subscription */ +export function listCustomHostNameSites( + context: Client, + options: ListCustomHostNameSitesOptionalParams = { requestOptions: {} }, +): PagedAsyncIterableIterator { + return buildPagedAsyncIterator( + context, + () => _listCustomHostNameSitesSend(context, options), + _listCustomHostNameSitesDeserialize, + ["200"], + { itemName: "value", nextLinkName: "nextLink" }, + ); +} + +export function _checkNameAvailabilitySend( + context: Client, + body: ResourceNameAvailabilityRequest, + options: CheckNameAvailabilityOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/providers/Microsoft.Web/checknameavailability{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context + .path(path) + .post({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + headers: { accept: "application/json", ...options.requestOptions?.headers }, + body: resourceNameAvailabilityRequestSerializer(body), + }); +} + +export async function _checkNameAvailabilityDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = defaultErrorResponseDeserializer(result.body); + throw error; + } + + return resourceNameAvailabilityDeserializer(result.body); +} + +/** Description for Check if a resource name is available. */ +export async function checkNameAvailability( + context: Client, + body: ResourceNameAvailabilityRequest, + options: CheckNameAvailabilityOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _checkNameAvailabilitySend(context, body, options); + return _checkNameAvailabilityDeserialize(result); +} + +export function _listBillingMetersSend( + context: Client, + options: ListBillingMetersOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/providers/Microsoft.Web/billingMeters{?api%2Dversion,billingLocation,osType}", + { + subscriptionId: context.subscriptionId, + "api%2Dversion": context.apiVersion, + billingLocation: options?.billingLocation, + osType: options?.osType, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context + .path(path) + .get({ + ...operationOptionsToRequestParameters(options), + headers: { accept: "application/json", ...options.requestOptions?.headers }, + }); +} + +export async function _listBillingMetersDeserialize( + result: PathUncheckedResponse, +): Promise<_BillingMeterCollection> { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = defaultErrorResponseDeserializer(result.body); + throw error; + } + + return _billingMeterCollectionDeserializer(result.body); +} + +/** Description for Gets a list of meters for a given location. */ +export function listBillingMeters( + context: Client, + options: ListBillingMetersOptionalParams = { requestOptions: {} }, +): PagedAsyncIterableIterator { + return buildPagedAsyncIterator( + context, + () => _listBillingMetersSend(context, options), + _listBillingMetersDeserialize, + ["200"], + { itemName: "value", nextLinkName: "nextLink" }, + ); +} + +export function _listAseRegionsSend( + context: Client, + options: ListAseRegionsOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/providers/Microsoft.Web/aseRegions{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context + .path(path) + .get({ + ...operationOptionsToRequestParameters(options), + headers: { accept: "application/json", ...options.requestOptions?.headers }, + }); +} + +export async function _listAseRegionsDeserialize( + result: PathUncheckedResponse, +): Promise<_AseRegionCollection> { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = defaultErrorResponseDeserializer(result.body); + throw error; + } + + return _aseRegionCollectionDeserializer(result.body); +} + +/** Description for get a list of available ASE regions and its supported Skus. */ +export function listAseRegions( + context: Client, + options: ListAseRegionsOptionalParams = { requestOptions: {} }, +): PagedAsyncIterableIterator { + return buildPagedAsyncIterator( + context, + () => _listAseRegionsSend(context, options), + _listAseRegionsDeserialize, + ["200"], + { itemName: "value", nextLinkName: "nextLink" }, + ); +} + +export function _getSubscriptionDeploymentLocationsSend( + context: Client, + options: GetSubscriptionDeploymentLocationsOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/providers/Microsoft.Web/deploymentLocations{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context + .path(path) + .get({ + ...operationOptionsToRequestParameters(options), + headers: { accept: "application/json", ...options.requestOptions?.headers }, + }); +} + +export async function _getSubscriptionDeploymentLocationsDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = defaultErrorResponseDeserializer(result.body); + throw error; + } + + return deploymentLocationsDeserializer(result.body); +} + +/** Description for Gets list of available geo regions plus ministamps */ +export async function getSubscriptionDeploymentLocations( + context: Client, + options: GetSubscriptionDeploymentLocationsOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _getSubscriptionDeploymentLocationsSend(context, options); + return _getSubscriptionDeploymentLocationsDeserialize(result); +} + +export function _validateSend( + context: Client, + resourceGroupName: string, + validateRequest: ValidateRequest, + options: ValidateOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/validate{?api%2Dversion}", + { + resourceGroupName: resourceGroupName, + subscriptionId: context.subscriptionId, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context + .path(path) + .post({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + headers: { accept: "application/json", ...options.requestOptions?.headers }, + body: validateRequestSerializer(validateRequest), + }); +} + +export async function _validateDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = defaultErrorResponseDeserializer(result.body); + throw error; + } + + return validateResponseDeserializer(result.body); +} + +/** Description for Validate if a resource can be created. */ +export async function validate( + context: Client, + resourceGroupName: string, + validateRequest: ValidateRequest, + options: ValidateOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _validateSend(context, resourceGroupName, validateRequest, options); + return _validateDeserialize(result); +} + +export function _validateMoveSend( + context: Client, + resourceGroupName: string, + moveResourceEnvelope: CsmMoveResourceEnvelope, + options: ValidateMoveOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/validateMoveResources{?api%2Dversion}", + { + resourceGroupName: resourceGroupName, + subscriptionId: context.subscriptionId, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context + .path(path) + .post({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + body: csmMoveResourceEnvelopeSerializer(moveResourceEnvelope), + }); +} + +export async function _validateMoveDeserialize(result: PathUncheckedResponse): Promise { + const expectedStatuses = ["204"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = defaultErrorResponseDeserializer(result.body); + throw error; + } + + return; +} + +/** Description for Validate whether a resource can be moved. */ +export async function validateMove( + context: Client, + resourceGroupName: string, + moveResourceEnvelope: CsmMoveResourceEnvelope, + options: ValidateMoveOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _validateMoveSend(context, resourceGroupName, moveResourceEnvelope, options); + return _validateMoveDeserialize(result); +} diff --git a/packages/typespec-test/test/AppService/generated/typespec-ts/src/api/operations/index.ts b/packages/typespec-test/test/AppService/generated/typespec-ts/src/api/operations/index.ts new file mode 100644 index 0000000000..24a804d14f --- /dev/null +++ b/packages/typespec-test/test/AppService/generated/typespec-ts/src/api/operations/index.ts @@ -0,0 +1,5 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +export { list } from "./operations.js"; +export { OperationsListOptionalParams } from "./options.js"; diff --git a/packages/typespec-test/test/AppService/generated/typespec-ts/src/api/operations/operations.ts b/packages/typespec-test/test/AppService/generated/typespec-ts/src/api/operations/operations.ts new file mode 100644 index 0000000000..292d6d6f55 --- /dev/null +++ b/packages/typespec-test/test/AppService/generated/typespec-ts/src/api/operations/operations.ts @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { WebSiteManagementContext as Client } from "../index.js"; +import { + defaultErrorResponseDeserializer, + _CsmOperationCollection, + _csmOperationCollectionDeserializer, + CsmOperationDescription, +} from "../../models/models.js"; +import { + PagedAsyncIterableIterator, + buildPagedAsyncIterator, +} from "../../static-helpers/pagingHelpers.js"; +import { expandUrlTemplate } from "../../static-helpers/urlTemplate.js"; +import { OperationsListOptionalParams } from "./options.js"; +import { + StreamableMethod, + PathUncheckedResponse, + createRestError, + operationOptionsToRequestParameters, +} from "@azure-rest/core-client"; + +export function _listSend( + context: Client, + options: OperationsListOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/providers/Microsoft.Web/operations{?api%2Dversion}", + { + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context + .path(path) + .get({ + ...operationOptionsToRequestParameters(options), + headers: { accept: "application/json", ...options.requestOptions?.headers }, + }); +} + +export async function _listDeserialize( + result: PathUncheckedResponse, +): Promise<_CsmOperationCollection> { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = defaultErrorResponseDeserializer(result.body); + throw error; + } + + return _csmOperationCollectionDeserializer(result.body); +} + +/** List the operations for the provider */ +export function list( + context: Client, + options: OperationsListOptionalParams = { requestOptions: {} }, +): PagedAsyncIterableIterator { + return buildPagedAsyncIterator( + context, + () => _listSend(context, options), + _listDeserialize, + ["200"], + { itemName: "value", nextLinkName: "nextLink" }, + ); +} diff --git a/packages/typespec-test/test/AppService/generated/typespec-ts/src/api/operations/options.ts b/packages/typespec-test/test/AppService/generated/typespec-ts/src/api/operations/options.ts new file mode 100644 index 0000000000..c461016ad1 --- /dev/null +++ b/packages/typespec-test/test/AppService/generated/typespec-ts/src/api/operations/options.ts @@ -0,0 +1,7 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { OperationOptions } from "@azure-rest/core-client"; + +/** Optional parameters. */ +export interface OperationsListOptionalParams extends OperationOptions {} diff --git a/packages/typespec-test/test/AppService/generated/typespec-ts/src/api/options.ts b/packages/typespec-test/test/AppService/generated/typespec-ts/src/api/options.ts new file mode 100644 index 0000000000..340bec2a6f --- /dev/null +++ b/packages/typespec-test/test/AppService/generated/typespec-ts/src/api/options.ts @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { SkuName } from "../models/models.js"; +import { OperationOptions } from "@azure-rest/core-client"; + +/** Optional parameters. */ +export interface MoveOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface VerifyHostingEnvironmentVnetOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface ListSkusOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface ListPremierAddOnOffersOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface RegionalCheckNameAvailabilityOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface ListGeoRegionsOptionalParams extends OperationOptions { + /** Name of SKU used to filter the regions. */ + sku?: SkuName; + /** Specify true if you want to filter to only regions that support Linux workers. */ + linuxWorkersEnabled?: boolean; + /** Specify true if you want to filter to only regions that support Xenon workers. */ + xenonWorkersEnabled?: boolean; + /** Specify true if you want to filter to only regions that support Linux Consumption Workers. */ + linuxDynamicWorkersEnabled?: boolean; + /** Specify true if you want to filter to only regions that support App Service Plans with IsCustomMode set to true. */ + customModeWorkersEnabled?: boolean; +} + +/** Optional parameters. */ +export interface ListCustomHostNameSitesOptionalParams extends OperationOptions { + /** Specific hostname */ + hostname?: string; +} + +/** Optional parameters. */ +export interface CheckNameAvailabilityOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface ListBillingMetersOptionalParams extends OperationOptions { + /** Azure Location of billable resource */ + billingLocation?: string; + /** App Service OS type meters used for */ + osType?: string; +} + +/** Optional parameters. */ +export interface ListAseRegionsOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface GetSubscriptionDeploymentLocationsOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface ValidateOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface ValidateMoveOptionalParams extends OperationOptions {} diff --git a/packages/typespec-test/test/AppService/generated/typespec-ts/src/api/providerOperationGroup/index.ts b/packages/typespec-test/test/AppService/generated/typespec-ts/src/api/providerOperationGroup/index.ts new file mode 100644 index 0000000000..b360ac43b0 --- /dev/null +++ b/packages/typespec-test/test/AppService/generated/typespec-ts/src/api/providerOperationGroup/index.ts @@ -0,0 +1,19 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +export { + getAvailableStacksOnPrem, + getWebAppStacks, + getWebAppStacksForLocation, + getFunctionAppStacksForLocation, + getFunctionAppStacks, + getAvailableStacks, +} from "./operations.js"; +export { + ProviderOperationGroupGetAvailableStacksOnPremOptionalParams, + ProviderOperationGroupGetWebAppStacksOptionalParams, + ProviderOperationGroupGetWebAppStacksForLocationOptionalParams, + ProviderOperationGroupGetFunctionAppStacksForLocationOptionalParams, + ProviderOperationGroupGetFunctionAppStacksOptionalParams, + ProviderOperationGroupGetAvailableStacksOptionalParams, +} from "./options.js"; diff --git a/packages/typespec-test/test/AppService/generated/typespec-ts/src/api/providerOperationGroup/operations.ts b/packages/typespec-test/test/AppService/generated/typespec-ts/src/api/providerOperationGroup/operations.ts new file mode 100644 index 0000000000..93d9c04aca --- /dev/null +++ b/packages/typespec-test/test/AppService/generated/typespec-ts/src/api/providerOperationGroup/operations.ts @@ -0,0 +1,340 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { WebSiteManagementContext as Client } from "../index.js"; +import { + defaultErrorResponseDeserializer, + _ApplicationStackCollection, + _applicationStackCollectionDeserializer, + ApplicationStackResource, + _FunctionAppStackCollection, + _functionAppStackCollectionDeserializer, + FunctionAppStack, + _WebAppStackCollection, + _webAppStackCollectionDeserializer, + WebAppStack, +} from "../../models/models.js"; +import { + PagedAsyncIterableIterator, + buildPagedAsyncIterator, +} from "../../static-helpers/pagingHelpers.js"; +import { expandUrlTemplate } from "../../static-helpers/urlTemplate.js"; +import { + ProviderOperationGroupGetAvailableStacksOnPremOptionalParams, + ProviderOperationGroupGetWebAppStacksOptionalParams, + ProviderOperationGroupGetWebAppStacksForLocationOptionalParams, + ProviderOperationGroupGetFunctionAppStacksForLocationOptionalParams, + ProviderOperationGroupGetFunctionAppStacksOptionalParams, + ProviderOperationGroupGetAvailableStacksOptionalParams, +} from "./options.js"; +import { + StreamableMethod, + PathUncheckedResponse, + createRestError, + operationOptionsToRequestParameters, +} from "@azure-rest/core-client"; + +export function _getAvailableStacksOnPremSend( + context: Client, + options: ProviderOperationGroupGetAvailableStacksOnPremOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/providers/Microsoft.Web/availableStacks{?api%2Dversion,osTypeSelected}", + { + subscriptionId: context.subscriptionId, + "api%2Dversion": context.apiVersion, + osTypeSelected: options?.osTypeSelected, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context + .path(path) + .get({ + ...operationOptionsToRequestParameters(options), + headers: { accept: "application/json", ...options.requestOptions?.headers }, + }); +} + +export async function _getAvailableStacksOnPremDeserialize( + result: PathUncheckedResponse, +): Promise<_ApplicationStackCollection> { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = defaultErrorResponseDeserializer(result.body); + throw error; + } + + return _applicationStackCollectionDeserializer(result.body); +} + +/** Description for Get available application frameworks and their versions */ +export function getAvailableStacksOnPrem( + context: Client, + options: ProviderOperationGroupGetAvailableStacksOnPremOptionalParams = { requestOptions: {} }, +): PagedAsyncIterableIterator { + return buildPagedAsyncIterator( + context, + () => _getAvailableStacksOnPremSend(context, options), + _getAvailableStacksOnPremDeserialize, + ["200"], + { itemName: "value", nextLinkName: "nextLink" }, + ); +} + +export function _getWebAppStacksSend( + context: Client, + options: ProviderOperationGroupGetWebAppStacksOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/providers/Microsoft.Web/webAppStacks{?api%2Dversion,stackOsType}", + { + "api%2Dversion": context.apiVersion, + stackOsType: options?.stackOsType, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context + .path(path) + .get({ + ...operationOptionsToRequestParameters(options), + headers: { accept: "application/json", ...options.requestOptions?.headers }, + }); +} + +export async function _getWebAppStacksDeserialize( + result: PathUncheckedResponse, +): Promise<_WebAppStackCollection> { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = defaultErrorResponseDeserializer(result.body); + throw error; + } + + return _webAppStackCollectionDeserializer(result.body); +} + +/** Description for Get available Web app frameworks and their versions */ +export function getWebAppStacks( + context: Client, + options: ProviderOperationGroupGetWebAppStacksOptionalParams = { requestOptions: {} }, +): PagedAsyncIterableIterator { + return buildPagedAsyncIterator( + context, + () => _getWebAppStacksSend(context, options), + _getWebAppStacksDeserialize, + ["200"], + { itemName: "value", nextLinkName: "nextLink" }, + ); +} + +export function _getWebAppStacksForLocationSend( + context: Client, + location: string, + options: ProviderOperationGroupGetWebAppStacksForLocationOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/providers/Microsoft.Web/locations/{location}/webAppStacks{?api%2Dversion,stackOsType}", + { + location: location, + "api%2Dversion": context.apiVersion, + stackOsType: options?.stackOsType, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context + .path(path) + .get({ + ...operationOptionsToRequestParameters(options), + headers: { accept: "application/json", ...options.requestOptions?.headers }, + }); +} + +export async function _getWebAppStacksForLocationDeserialize( + result: PathUncheckedResponse, +): Promise<_WebAppStackCollection> { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = defaultErrorResponseDeserializer(result.body); + throw error; + } + + return _webAppStackCollectionDeserializer(result.body); +} + +/** Description for Get available Web app frameworks and their versions for location */ +export function getWebAppStacksForLocation( + context: Client, + location: string, + options: ProviderOperationGroupGetWebAppStacksForLocationOptionalParams = { requestOptions: {} }, +): PagedAsyncIterableIterator { + return buildPagedAsyncIterator( + context, + () => _getWebAppStacksForLocationSend(context, location, options), + _getWebAppStacksForLocationDeserialize, + ["200"], + { itemName: "value", nextLinkName: "nextLink" }, + ); +} + +export function _getFunctionAppStacksForLocationSend( + context: Client, + location: string, + options: ProviderOperationGroupGetFunctionAppStacksForLocationOptionalParams = { + requestOptions: {}, + }, +): StreamableMethod { + const path = expandUrlTemplate( + "/providers/Microsoft.Web/locations/{location}/functionAppStacks{?api%2Dversion,stackOsType}", + { + location: location, + "api%2Dversion": context.apiVersion, + stackOsType: options?.stackOsType, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context + .path(path) + .get({ + ...operationOptionsToRequestParameters(options), + headers: { accept: "application/json", ...options.requestOptions?.headers }, + }); +} + +export async function _getFunctionAppStacksForLocationDeserialize( + result: PathUncheckedResponse, +): Promise<_FunctionAppStackCollection> { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = defaultErrorResponseDeserializer(result.body); + throw error; + } + + return _functionAppStackCollectionDeserializer(result.body); +} + +/** Description for Get available Function app frameworks and their versions for location */ +export function getFunctionAppStacksForLocation( + context: Client, + location: string, + options: ProviderOperationGroupGetFunctionAppStacksForLocationOptionalParams = { + requestOptions: {}, + }, +): PagedAsyncIterableIterator { + return buildPagedAsyncIterator( + context, + () => _getFunctionAppStacksForLocationSend(context, location, options), + _getFunctionAppStacksForLocationDeserialize, + ["200"], + { itemName: "value", nextLinkName: "nextLink" }, + ); +} + +export function _getFunctionAppStacksSend( + context: Client, + options: ProviderOperationGroupGetFunctionAppStacksOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/providers/Microsoft.Web/functionAppStacks{?api%2Dversion,stackOsType}", + { + "api%2Dversion": context.apiVersion, + stackOsType: options?.stackOsType, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context + .path(path) + .get({ + ...operationOptionsToRequestParameters(options), + headers: { accept: "application/json", ...options.requestOptions?.headers }, + }); +} + +export async function _getFunctionAppStacksDeserialize( + result: PathUncheckedResponse, +): Promise<_FunctionAppStackCollection> { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = defaultErrorResponseDeserializer(result.body); + throw error; + } + + return _functionAppStackCollectionDeserializer(result.body); +} + +/** Description for Get available Function app frameworks and their versions */ +export function getFunctionAppStacks( + context: Client, + options: ProviderOperationGroupGetFunctionAppStacksOptionalParams = { requestOptions: {} }, +): PagedAsyncIterableIterator { + return buildPagedAsyncIterator( + context, + () => _getFunctionAppStacksSend(context, options), + _getFunctionAppStacksDeserialize, + ["200"], + { itemName: "value", nextLinkName: "nextLink" }, + ); +} + +export function _getAvailableStacksSend( + context: Client, + options: ProviderOperationGroupGetAvailableStacksOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/providers/Microsoft.Web/availableStacks{?api%2Dversion,osTypeSelected}", + { + "api%2Dversion": context.apiVersion, + osTypeSelected: options?.osTypeSelected, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context + .path(path) + .get({ + ...operationOptionsToRequestParameters(options), + headers: { accept: "application/json", ...options.requestOptions?.headers }, + }); +} + +export async function _getAvailableStacksDeserialize( + result: PathUncheckedResponse, +): Promise<_ApplicationStackCollection> { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = defaultErrorResponseDeserializer(result.body); + throw error; + } + + return _applicationStackCollectionDeserializer(result.body); +} + +/** Description for Get available application frameworks and their versions */ +export function getAvailableStacks( + context: Client, + options: ProviderOperationGroupGetAvailableStacksOptionalParams = { requestOptions: {} }, +): PagedAsyncIterableIterator { + return buildPagedAsyncIterator( + context, + () => _getAvailableStacksSend(context, options), + _getAvailableStacksDeserialize, + ["200"], + { itemName: "value", nextLinkName: "nextLink" }, + ); +} diff --git a/packages/typespec-test/test/AppService/generated/typespec-ts/src/api/providerOperationGroup/options.ts b/packages/typespec-test/test/AppService/generated/typespec-ts/src/api/providerOperationGroup/options.ts new file mode 100644 index 0000000000..dac44c4abe --- /dev/null +++ b/packages/typespec-test/test/AppService/generated/typespec-ts/src/api/providerOperationGroup/options.ts @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ProviderOsTypeSelected, ProviderStackOsType } from "../../models/models.js"; +import { OperationOptions } from "@azure-rest/core-client"; + +/** Optional parameters. */ +export interface ProviderOperationGroupGetAvailableStacksOnPremOptionalParams extends OperationOptions { + osTypeSelected?: ProviderOsTypeSelected; +} + +/** Optional parameters. */ +export interface ProviderOperationGroupGetWebAppStacksOptionalParams extends OperationOptions { + /** Stack OS Type */ + stackOsType?: ProviderStackOsType; +} + +/** Optional parameters. */ +export interface ProviderOperationGroupGetWebAppStacksForLocationOptionalParams extends OperationOptions { + /** Stack OS Type */ + stackOsType?: ProviderStackOsType; +} + +/** Optional parameters. */ +export interface ProviderOperationGroupGetFunctionAppStacksForLocationOptionalParams extends OperationOptions { + /** Stack OS Type */ + stackOsType?: ProviderStackOsType; +} + +/** Optional parameters. */ +export interface ProviderOperationGroupGetFunctionAppStacksOptionalParams extends OperationOptions { + /** Stack OS Type */ + stackOsType?: ProviderStackOsType; +} + +/** Optional parameters. */ +export interface ProviderOperationGroupGetAvailableStacksOptionalParams extends OperationOptions { + osTypeSelected?: ProviderOsTypeSelected; +} diff --git a/packages/typespec-test/test/AppService/generated/typespec-ts/src/api/recommendationsOperationGroup/index.ts b/packages/typespec-test/test/AppService/generated/typespec-ts/src/api/recommendationsOperationGroup/index.ts new file mode 100644 index 0000000000..0df8b2d3cc --- /dev/null +++ b/packages/typespec-test/test/AppService/generated/typespec-ts/src/api/recommendationsOperationGroup/index.ts @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +export { disableRecommendationForSubscription, resetAllFilters, list } from "./operations.js"; +export { + RecommendationsOperationGroupDisableRecommendationForSubscriptionOptionalParams, + RecommendationsOperationGroupResetAllFiltersOptionalParams, + RecommendationsOperationGroupListOptionalParams, +} from "./options.js"; diff --git a/packages/typespec-test/test/AppService/generated/typespec-ts/src/api/recommendationsOperationGroup/operations.ts b/packages/typespec-test/test/AppService/generated/typespec-ts/src/api/recommendationsOperationGroup/operations.ts new file mode 100644 index 0000000000..06eb45b7b1 --- /dev/null +++ b/packages/typespec-test/test/AppService/generated/typespec-ts/src/api/recommendationsOperationGroup/operations.ts @@ -0,0 +1,160 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { WebSiteManagementContext as Client } from "../index.js"; +import { + defaultErrorResponseDeserializer, + _RecommendationCollection, + _recommendationCollectionDeserializer, + Recommendation, +} from "../../models/models.js"; +import { + PagedAsyncIterableIterator, + buildPagedAsyncIterator, +} from "../../static-helpers/pagingHelpers.js"; +import { expandUrlTemplate } from "../../static-helpers/urlTemplate.js"; +import { + RecommendationsOperationGroupDisableRecommendationForSubscriptionOptionalParams, + RecommendationsOperationGroupResetAllFiltersOptionalParams, + RecommendationsOperationGroupListOptionalParams, +} from "./options.js"; +import { + StreamableMethod, + PathUncheckedResponse, + createRestError, + operationOptionsToRequestParameters, +} from "@azure-rest/core-client"; + +export function _disableRecommendationForSubscriptionSend( + context: Client, + name: string, + options: RecommendationsOperationGroupDisableRecommendationForSubscriptionOptionalParams = { + requestOptions: {}, + }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/providers/Microsoft.Web/recommendations/{name}/disable{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + name: name, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).post({ ...operationOptionsToRequestParameters(options) }); +} + +export async function _disableRecommendationForSubscriptionDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = defaultErrorResponseDeserializer(result.body); + throw error; + } + + return; +} + +/** Description for Disables the specified rule so it will not apply to a subscription in the future. */ +export async function disableRecommendationForSubscription( + context: Client, + name: string, + options: RecommendationsOperationGroupDisableRecommendationForSubscriptionOptionalParams = { + requestOptions: {}, + }, +): Promise { + const result = await _disableRecommendationForSubscriptionSend(context, name, options); + return _disableRecommendationForSubscriptionDeserialize(result); +} + +export function _resetAllFiltersSend( + context: Client, + options: RecommendationsOperationGroupResetAllFiltersOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/providers/Microsoft.Web/recommendations/reset{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).post({ ...operationOptionsToRequestParameters(options) }); +} + +export async function _resetAllFiltersDeserialize(result: PathUncheckedResponse): Promise { + const expectedStatuses = ["204"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = defaultErrorResponseDeserializer(result.body); + throw error; + } + + return; +} + +/** Description for Reset all recommendation opt-out settings for a subscription. */ +export async function resetAllFilters( + context: Client, + options: RecommendationsOperationGroupResetAllFiltersOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _resetAllFiltersSend(context, options); + return _resetAllFiltersDeserialize(result); +} + +export function _listSend( + context: Client, + options: RecommendationsOperationGroupListOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/providers/Microsoft.Web/recommendations{?api%2Dversion,featured,%24filter}", + { + subscriptionId: context.subscriptionId, + "api%2Dversion": context.apiVersion, + featured: options?.featured, + "%24filter": options?.filter, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context + .path(path) + .get({ + ...operationOptionsToRequestParameters(options), + headers: { accept: "application/json", ...options.requestOptions?.headers }, + }); +} + +export async function _listDeserialize( + result: PathUncheckedResponse, +): Promise<_RecommendationCollection> { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = defaultErrorResponseDeserializer(result.body); + throw error; + } + + return _recommendationCollectionDeserializer(result.body); +} + +/** Description for List all recommendations for a subscription. */ +export function list( + context: Client, + options: RecommendationsOperationGroupListOptionalParams = { requestOptions: {} }, +): PagedAsyncIterableIterator { + return buildPagedAsyncIterator( + context, + () => _listSend(context, options), + _listDeserialize, + ["200"], + { itemName: "value", nextLinkName: "nextLink" }, + ); +} diff --git a/packages/typespec-test/test/AppService/generated/typespec-ts/src/api/recommendationsOperationGroup/options.ts b/packages/typespec-test/test/AppService/generated/typespec-ts/src/api/recommendationsOperationGroup/options.ts new file mode 100644 index 0000000000..74dfab8949 --- /dev/null +++ b/packages/typespec-test/test/AppService/generated/typespec-ts/src/api/recommendationsOperationGroup/options.ts @@ -0,0 +1,18 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { OperationOptions } from "@azure-rest/core-client"; + +/** Optional parameters. */ +export interface RecommendationsOperationGroupDisableRecommendationForSubscriptionOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface RecommendationsOperationGroupResetAllFiltersOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface RecommendationsOperationGroupListOptionalParams extends OperationOptions { + /** Specify true to return only the most critical recommendations. The default is false, which returns all recommendations. */ + featured?: boolean; + /** Filter is specified by using OData syntax. Example: $filter=channel eq 'Api' or channel eq 'Notification' and startTime eq 2014-01-01T00:00:00Z and endTime eq 2014-12-31T23:59:59Z and timeGrain eq duration'[PT1H|PT1M|P1D] */ + filter?: string; +} diff --git a/packages/typespec-test/test/AppService/generated/typespec-ts/src/api/staticSitesOperationGroup/index.ts b/packages/typespec-test/test/AppService/generated/typespec-ts/src/api/staticSitesOperationGroup/index.ts new file mode 100644 index 0000000000..9bcc636afa --- /dev/null +++ b/packages/typespec-test/test/AppService/generated/typespec-ts/src/api/staticSitesOperationGroup/index.ts @@ -0,0 +1,5 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +export { previewWorkflow } from "./operations.js"; +export { StaticSitesOperationGroupPreviewWorkflowOptionalParams } from "./options.js"; diff --git a/packages/typespec-test/test/AppService/generated/typespec-ts/src/api/staticSitesOperationGroup/operations.ts b/packages/typespec-test/test/AppService/generated/typespec-ts/src/api/staticSitesOperationGroup/operations.ts new file mode 100644 index 0000000000..c269dc8223 --- /dev/null +++ b/packages/typespec-test/test/AppService/generated/typespec-ts/src/api/staticSitesOperationGroup/operations.ts @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { WebSiteManagementContext as Client } from "../index.js"; +import { + defaultErrorResponseDeserializer, + StaticSitesWorkflowPreviewRequest, + staticSitesWorkflowPreviewRequestSerializer, + StaticSitesWorkflowPreview, + staticSitesWorkflowPreviewDeserializer, +} from "../../models/models.js"; +import { expandUrlTemplate } from "../../static-helpers/urlTemplate.js"; +import { StaticSitesOperationGroupPreviewWorkflowOptionalParams } from "./options.js"; +import { + StreamableMethod, + PathUncheckedResponse, + createRestError, + operationOptionsToRequestParameters, +} from "@azure-rest/core-client"; + +export function _previewWorkflowSend( + context: Client, + location: string, + body: StaticSitesWorkflowPreviewRequest, + options: StaticSitesOperationGroupPreviewWorkflowOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/providers/Microsoft.Web/locations/{location}/previewStaticSiteWorkflowFile{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + location: location, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context + .path(path) + .post({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + headers: { accept: "application/json", ...options.requestOptions?.headers }, + body: staticSitesWorkflowPreviewRequestSerializer(body), + }); +} + +export async function _previewWorkflowDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = defaultErrorResponseDeserializer(result.body); + throw error; + } + + return staticSitesWorkflowPreviewDeserializer(result.body); +} + +/** Description for Generates a preview workflow file for the static site */ +export async function previewWorkflow( + context: Client, + location: string, + body: StaticSitesWorkflowPreviewRequest, + options: StaticSitesOperationGroupPreviewWorkflowOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _previewWorkflowSend(context, location, body, options); + return _previewWorkflowDeserialize(result); +} diff --git a/packages/typespec-test/test/AppService/generated/typespec-ts/src/api/staticSitesOperationGroup/options.ts b/packages/typespec-test/test/AppService/generated/typespec-ts/src/api/staticSitesOperationGroup/options.ts new file mode 100644 index 0000000000..eac5ddb416 --- /dev/null +++ b/packages/typespec-test/test/AppService/generated/typespec-ts/src/api/staticSitesOperationGroup/options.ts @@ -0,0 +1,7 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { OperationOptions } from "@azure-rest/core-client"; + +/** Optional parameters. */ +export interface StaticSitesOperationGroupPreviewWorkflowOptionalParams extends OperationOptions {} diff --git a/packages/typespec-test/test/AppService/generated/typespec-ts/src/api/webSiteManagementContext.ts b/packages/typespec-test/test/AppService/generated/typespec-ts/src/api/webSiteManagementContext.ts new file mode 100644 index 0000000000..8a310ff3ab --- /dev/null +++ b/packages/typespec-test/test/AppService/generated/typespec-ts/src/api/webSiteManagementContext.ts @@ -0,0 +1,64 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { logger } from "../logger.js"; +import { KnownVersions } from "../models/models.js"; +import { AzureSupportedClouds, getArmEndpoint } from "../static-helpers/cloudSettingHelpers.js"; +import { Client, ClientOptions, getClient } from "@azure-rest/core-client"; +import { TokenCredential } from "@azure/core-auth"; + +export interface WebSiteManagementContext extends Client { + /** The API version to use for this operation. */ + /** Known values of {@link KnownVersions} that the service accepts. */ + apiVersion: string; + /** The ID of the target subscription. The value must be an UUID. */ + subscriptionId: string; +} + +/** Optional parameters for the client. */ +export interface WebSiteManagementClientOptionalParams extends ClientOptions { + /** The API version to use for this operation. */ + /** Known values of {@link KnownVersions} that the service accepts. */ + apiVersion?: string; + /** Specifies the Azure cloud environment for the client. */ + cloudSetting?: AzureSupportedClouds; +} + +export function createWebSiteManagement( + credential: TokenCredential, + subscriptionId: string, + options: WebSiteManagementClientOptionalParams = {}, +): WebSiteManagementContext { + const endpointUrl = + options.endpoint ?? getArmEndpoint(options.cloudSetting) ?? "https://management.azure.com"; + const prefixFromOptions = options?.userAgentOptions?.userAgentPrefix; + const userAgentInfo = `azsdk-js-arm-appservice/1.0.0-beta.1`; + const userAgentPrefix = prefixFromOptions + ? `${prefixFromOptions} azsdk-js-api ${userAgentInfo}` + : `azsdk-js-api ${userAgentInfo}`; + const { apiVersion: _, ...updatedOptions } = { + ...options, + userAgentOptions: { userAgentPrefix }, + loggingOptions: { logger: options.loggingOptions?.logger ?? logger.info }, + credentials: { scopes: options.credentials?.scopes ?? [`${endpointUrl}/.default`] }, + }; + const clientContext = getClient(endpointUrl, credential, updatedOptions); + clientContext.pipeline.removePolicy({ name: "ApiVersionPolicy" }); + const apiVersion = options.apiVersion ?? "2025-05-01"; + clientContext.pipeline.addPolicy({ + name: "ClientApiVersionPolicy", + sendRequest: (req, next) => { + // Use the apiVersion defined in request url directly + // Append one if there is no apiVersion and we have one at client options + const url = new URL(req.url); + if (!url.searchParams.get("api-version")) { + req.url = `${req.url}${ + Array.from(url.searchParams.keys()).length > 0 ? "&" : "?" + }api-version=${apiVersion}`; + } + + return next(req); + }, + }); + return { ...clientContext, apiVersion, subscriptionId } as WebSiteManagementContext; +} diff --git a/packages/typespec-test/test/AppService/generated/typespec-ts/src/classic/appServiceEnvironmentResources/index.ts b/packages/typespec-test/test/AppService/generated/typespec-ts/src/classic/appServiceEnvironmentResources/index.ts new file mode 100644 index 0000000000..d1374e61be --- /dev/null +++ b/packages/typespec-test/test/AppService/generated/typespec-ts/src/classic/appServiceEnvironmentResources/index.ts @@ -0,0 +1,109 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { WebSiteManagementContext } from "../../api/webSiteManagementContext.js"; +import { + suspend, + resume, + changeVnet, +} from "../../api/appServiceEnvironmentResources/operations.js"; +import { + AppServiceEnvironmentResourcesSuspendOptionalParams, + AppServiceEnvironmentResourcesResumeOptionalParams, + AppServiceEnvironmentResourcesChangeVnetOptionalParams, +} from "../../api/appServiceEnvironmentResources/options.js"; +import { VirtualNetworkProfile, Site } from "../../models/models.js"; +import { PagedAsyncIterableIterator } from "../../static-helpers/pagingHelpers.js"; + +/** Interface representing a AppServiceEnvironmentResources operations. */ +export interface AppServiceEnvironmentResourcesOperations { + /** Description for Suspend an App Service Environment. */ + suspend: ( + resourceGroupName: string, + name: string, + options?: AppServiceEnvironmentResourcesSuspendOptionalParams, + ) => PagedAsyncIterableIterator; + /** @deprecated use suspend instead */ + beginListSuspendAndWait: ( + resourceGroupName: string, + name: string, + options?: AppServiceEnvironmentResourcesSuspendOptionalParams, + ) => PagedAsyncIterableIterator; + /** Description for Resume an App Service Environment. */ + resume: ( + resourceGroupName: string, + name: string, + options?: AppServiceEnvironmentResourcesResumeOptionalParams, + ) => PagedAsyncIterableIterator; + /** @deprecated use resume instead */ + beginListResumeAndWait: ( + resourceGroupName: string, + name: string, + options?: AppServiceEnvironmentResourcesResumeOptionalParams, + ) => PagedAsyncIterableIterator; + /** Description for Move an App Service Environment to a different VNET. */ + changeVnet: ( + resourceGroupName: string, + name: string, + body: VirtualNetworkProfile, + options?: AppServiceEnvironmentResourcesChangeVnetOptionalParams, + ) => PagedAsyncIterableIterator; + /** @deprecated use changeVnet instead */ + beginListChangeVnetAndWait: ( + resourceGroupName: string, + name: string, + body: VirtualNetworkProfile, + options?: AppServiceEnvironmentResourcesChangeVnetOptionalParams, + ) => PagedAsyncIterableIterator; +} + +function _getAppServiceEnvironmentResources(context: WebSiteManagementContext) { + return { + suspend: ( + resourceGroupName: string, + name: string, + options?: AppServiceEnvironmentResourcesSuspendOptionalParams, + ) => suspend(context, resourceGroupName, name, options), + beginListSuspendAndWait: ( + resourceGroupName: string, + name: string, + options?: AppServiceEnvironmentResourcesSuspendOptionalParams, + ) => { + return suspend(context, resourceGroupName, name, options); + }, + resume: ( + resourceGroupName: string, + name: string, + options?: AppServiceEnvironmentResourcesResumeOptionalParams, + ) => resume(context, resourceGroupName, name, options), + beginListResumeAndWait: ( + resourceGroupName: string, + name: string, + options?: AppServiceEnvironmentResourcesResumeOptionalParams, + ) => { + return resume(context, resourceGroupName, name, options); + }, + changeVnet: ( + resourceGroupName: string, + name: string, + body: VirtualNetworkProfile, + options?: AppServiceEnvironmentResourcesChangeVnetOptionalParams, + ) => changeVnet(context, resourceGroupName, name, body, options), + beginListChangeVnetAndWait: ( + resourceGroupName: string, + name: string, + body: VirtualNetworkProfile, + options?: AppServiceEnvironmentResourcesChangeVnetOptionalParams, + ) => { + return changeVnet(context, resourceGroupName, name, body, options); + }, + }; +} + +export function _getAppServiceEnvironmentResourcesOperations( + context: WebSiteManagementContext, +): AppServiceEnvironmentResourcesOperations { + return { + ..._getAppServiceEnvironmentResources(context), + }; +} diff --git a/packages/typespec-test/test/AppService/generated/typespec-ts/src/classic/getUsagesInLocationOperationGroup/index.ts b/packages/typespec-test/test/AppService/generated/typespec-ts/src/classic/getUsagesInLocationOperationGroup/index.ts new file mode 100644 index 0000000000..d12c45c502 --- /dev/null +++ b/packages/typespec-test/test/AppService/generated/typespec-ts/src/classic/getUsagesInLocationOperationGroup/index.ts @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { WebSiteManagementContext } from "../../api/webSiteManagementContext.js"; +import { list } from "../../api/getUsagesInLocationOperationGroup/operations.js"; +import { GetUsagesInLocationOperationGroupListOptionalParams } from "../../api/getUsagesInLocationOperationGroup/options.js"; +import { CsmUsageQuota } from "../../models/models.js"; +import { PagedAsyncIterableIterator } from "../../static-helpers/pagingHelpers.js"; + +/** Interface representing a GetUsagesInLocationOperationGroup operations. */ +export interface GetUsagesInLocationOperationGroupOperations { + /** List usages in cores for all skus used by a subscription in a given location, for a specific quota type. */ + list: ( + location: string, + options?: GetUsagesInLocationOperationGroupListOptionalParams, + ) => PagedAsyncIterableIterator; +} + +function _getGetUsagesInLocationOperationGroup(context: WebSiteManagementContext) { + return { + list: (location: string, options?: GetUsagesInLocationOperationGroupListOptionalParams) => + list(context, location, options), + }; +} + +export function _getGetUsagesInLocationOperationGroupOperations( + context: WebSiteManagementContext, +): GetUsagesInLocationOperationGroupOperations { + return { + ..._getGetUsagesInLocationOperationGroup(context), + }; +} diff --git a/packages/typespec-test/test/AppService/generated/typespec-ts/src/classic/globalOperationGroup/index.ts b/packages/typespec-test/test/AppService/generated/typespec-ts/src/classic/globalOperationGroup/index.ts new file mode 100644 index 0000000000..2897b39c02 --- /dev/null +++ b/packages/typespec-test/test/AppService/generated/typespec-ts/src/classic/globalOperationGroup/index.ts @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { WebSiteManagementContext } from "../../api/webSiteManagementContext.js"; +import { getSubscriptionOperationWithAsyncResponse } from "../../api/globalOperationGroup/operations.js"; +import { GlobalOperationGroupGetSubscriptionOperationWithAsyncResponseOptionalParams } from "../../api/globalOperationGroup/options.js"; + +/** Interface representing a GlobalOperationGroup operations. */ +export interface GlobalOperationGroupOperations { + /** Description for Gets an operation in a subscription and given region */ + getSubscriptionOperationWithAsyncResponse: ( + location: string, + operationId: string, + options?: GlobalOperationGroupGetSubscriptionOperationWithAsyncResponseOptionalParams, + ) => Promise; +} + +function _getGlobalOperationGroup(context: WebSiteManagementContext) { + return { + getSubscriptionOperationWithAsyncResponse: ( + location: string, + operationId: string, + options?: GlobalOperationGroupGetSubscriptionOperationWithAsyncResponseOptionalParams, + ) => getSubscriptionOperationWithAsyncResponse(context, location, operationId, options), + }; +} + +export function _getGlobalOperationGroupOperations( + context: WebSiteManagementContext, +): GlobalOperationGroupOperations { + return { + ..._getGlobalOperationGroup(context), + }; +} diff --git a/packages/typespec-test/test/AppService/generated/typespec-ts/src/classic/index.ts b/packages/typespec-test/test/AppService/generated/typespec-ts/src/classic/index.ts new file mode 100644 index 0000000000..254f0288ce --- /dev/null +++ b/packages/typespec-test/test/AppService/generated/typespec-ts/src/classic/index.ts @@ -0,0 +1,10 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +export { AppServiceEnvironmentResourcesOperations } from "./appServiceEnvironmentResources/index.js"; +export { GetUsagesInLocationOperationGroupOperations } from "./getUsagesInLocationOperationGroup/index.js"; +export { GlobalOperationGroupOperations } from "./globalOperationGroup/index.js"; +export { OperationsOperations } from "./operations/index.js"; +export { ProviderOperationGroupOperations } from "./providerOperationGroup/index.js"; +export { RecommendationsOperationGroupOperations } from "./recommendationsOperationGroup/index.js"; +export { StaticSitesOperationGroupOperations } from "./staticSitesOperationGroup/index.js"; diff --git a/packages/typespec-test/test/AppService/generated/typespec-ts/src/classic/operations/index.ts b/packages/typespec-test/test/AppService/generated/typespec-ts/src/classic/operations/index.ts new file mode 100644 index 0000000000..c95aa183dc --- /dev/null +++ b/packages/typespec-test/test/AppService/generated/typespec-ts/src/classic/operations/index.ts @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { WebSiteManagementContext } from "../../api/webSiteManagementContext.js"; +import { list } from "../../api/operations/operations.js"; +import { OperationsListOptionalParams } from "../../api/operations/options.js"; +import { CsmOperationDescription } from "../../models/models.js"; +import { PagedAsyncIterableIterator } from "../../static-helpers/pagingHelpers.js"; + +/** Interface representing a Operations operations. */ +export interface OperationsOperations { + /** List the operations for the provider */ + list: ( + options?: OperationsListOptionalParams, + ) => PagedAsyncIterableIterator; +} + +function _getOperations(context: WebSiteManagementContext) { + return { + list: (options?: OperationsListOptionalParams) => list(context, options), + }; +} + +export function _getOperationsOperations(context: WebSiteManagementContext): OperationsOperations { + return { + ..._getOperations(context), + }; +} diff --git a/packages/typespec-test/test/AppService/generated/typespec-ts/src/classic/providerOperationGroup/index.ts b/packages/typespec-test/test/AppService/generated/typespec-ts/src/classic/providerOperationGroup/index.ts new file mode 100644 index 0000000000..3cae8e056a --- /dev/null +++ b/packages/typespec-test/test/AppService/generated/typespec-ts/src/classic/providerOperationGroup/index.ts @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { WebSiteManagementContext } from "../../api/webSiteManagementContext.js"; +import { + getAvailableStacksOnPrem, + getWebAppStacks, + getWebAppStacksForLocation, + getFunctionAppStacksForLocation, + getFunctionAppStacks, + getAvailableStacks, +} from "../../api/providerOperationGroup/operations.js"; +import { + ProviderOperationGroupGetAvailableStacksOnPremOptionalParams, + ProviderOperationGroupGetWebAppStacksOptionalParams, + ProviderOperationGroupGetWebAppStacksForLocationOptionalParams, + ProviderOperationGroupGetFunctionAppStacksForLocationOptionalParams, + ProviderOperationGroupGetFunctionAppStacksOptionalParams, + ProviderOperationGroupGetAvailableStacksOptionalParams, +} from "../../api/providerOperationGroup/options.js"; +import { ApplicationStackResource, FunctionAppStack, WebAppStack } from "../../models/models.js"; +import { PagedAsyncIterableIterator } from "../../static-helpers/pagingHelpers.js"; + +/** Interface representing a ProviderOperationGroup operations. */ +export interface ProviderOperationGroupOperations { + /** Description for Get available application frameworks and their versions */ + getAvailableStacksOnPrem: ( + options?: ProviderOperationGroupGetAvailableStacksOnPremOptionalParams, + ) => PagedAsyncIterableIterator; + /** Description for Get available Web app frameworks and their versions */ + getWebAppStacks: ( + options?: ProviderOperationGroupGetWebAppStacksOptionalParams, + ) => PagedAsyncIterableIterator; + /** Description for Get available Web app frameworks and their versions for location */ + getWebAppStacksForLocation: ( + location: string, + options?: ProviderOperationGroupGetWebAppStacksForLocationOptionalParams, + ) => PagedAsyncIterableIterator; + /** Description for Get available Function app frameworks and their versions for location */ + getFunctionAppStacksForLocation: ( + location: string, + options?: ProviderOperationGroupGetFunctionAppStacksForLocationOptionalParams, + ) => PagedAsyncIterableIterator; + /** Description for Get available Function app frameworks and their versions */ + getFunctionAppStacks: ( + options?: ProviderOperationGroupGetFunctionAppStacksOptionalParams, + ) => PagedAsyncIterableIterator; + /** Description for Get available application frameworks and their versions */ + getAvailableStacks: ( + options?: ProviderOperationGroupGetAvailableStacksOptionalParams, + ) => PagedAsyncIterableIterator; +} + +function _getProviderOperationGroup(context: WebSiteManagementContext) { + return { + getAvailableStacksOnPrem: ( + options?: ProviderOperationGroupGetAvailableStacksOnPremOptionalParams, + ) => getAvailableStacksOnPrem(context, options), + getWebAppStacks: (options?: ProviderOperationGroupGetWebAppStacksOptionalParams) => + getWebAppStacks(context, options), + getWebAppStacksForLocation: ( + location: string, + options?: ProviderOperationGroupGetWebAppStacksForLocationOptionalParams, + ) => getWebAppStacksForLocation(context, location, options), + getFunctionAppStacksForLocation: ( + location: string, + options?: ProviderOperationGroupGetFunctionAppStacksForLocationOptionalParams, + ) => getFunctionAppStacksForLocation(context, location, options), + getFunctionAppStacks: (options?: ProviderOperationGroupGetFunctionAppStacksOptionalParams) => + getFunctionAppStacks(context, options), + getAvailableStacks: (options?: ProviderOperationGroupGetAvailableStacksOptionalParams) => + getAvailableStacks(context, options), + }; +} + +export function _getProviderOperationGroupOperations( + context: WebSiteManagementContext, +): ProviderOperationGroupOperations { + return { + ..._getProviderOperationGroup(context), + }; +} diff --git a/packages/typespec-test/test/AppService/generated/typespec-ts/src/classic/recommendationsOperationGroup/index.ts b/packages/typespec-test/test/AppService/generated/typespec-ts/src/classic/recommendationsOperationGroup/index.ts new file mode 100644 index 0000000000..fc16942036 --- /dev/null +++ b/packages/typespec-test/test/AppService/generated/typespec-ts/src/classic/recommendationsOperationGroup/index.ts @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { WebSiteManagementContext } from "../../api/webSiteManagementContext.js"; +import { + disableRecommendationForSubscription, + resetAllFilters, + list, +} from "../../api/recommendationsOperationGroup/operations.js"; +import { + RecommendationsOperationGroupDisableRecommendationForSubscriptionOptionalParams, + RecommendationsOperationGroupResetAllFiltersOptionalParams, + RecommendationsOperationGroupListOptionalParams, +} from "../../api/recommendationsOperationGroup/options.js"; +import { Recommendation } from "../../models/models.js"; +import { PagedAsyncIterableIterator } from "../../static-helpers/pagingHelpers.js"; + +/** Interface representing a RecommendationsOperationGroup operations. */ +export interface RecommendationsOperationGroupOperations { + /** Description for Disables the specified rule so it will not apply to a subscription in the future. */ + disableRecommendationForSubscription: ( + name: string, + options?: RecommendationsOperationGroupDisableRecommendationForSubscriptionOptionalParams, + ) => Promise; + /** Description for Reset all recommendation opt-out settings for a subscription. */ + resetAllFilters: ( + options?: RecommendationsOperationGroupResetAllFiltersOptionalParams, + ) => Promise; + /** Description for List all recommendations for a subscription. */ + list: ( + options?: RecommendationsOperationGroupListOptionalParams, + ) => PagedAsyncIterableIterator; +} + +function _getRecommendationsOperationGroup(context: WebSiteManagementContext) { + return { + disableRecommendationForSubscription: ( + name: string, + options?: RecommendationsOperationGroupDisableRecommendationForSubscriptionOptionalParams, + ) => disableRecommendationForSubscription(context, name, options), + resetAllFilters: (options?: RecommendationsOperationGroupResetAllFiltersOptionalParams) => + resetAllFilters(context, options), + list: (options?: RecommendationsOperationGroupListOptionalParams) => list(context, options), + }; +} + +export function _getRecommendationsOperationGroupOperations( + context: WebSiteManagementContext, +): RecommendationsOperationGroupOperations { + return { + ..._getRecommendationsOperationGroup(context), + }; +} diff --git a/packages/typespec-test/test/AppService/generated/typespec-ts/src/classic/staticSitesOperationGroup/index.ts b/packages/typespec-test/test/AppService/generated/typespec-ts/src/classic/staticSitesOperationGroup/index.ts new file mode 100644 index 0000000000..03b013db04 --- /dev/null +++ b/packages/typespec-test/test/AppService/generated/typespec-ts/src/classic/staticSitesOperationGroup/index.ts @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { WebSiteManagementContext } from "../../api/webSiteManagementContext.js"; +import { previewWorkflow } from "../../api/staticSitesOperationGroup/operations.js"; +import { StaticSitesOperationGroupPreviewWorkflowOptionalParams } from "../../api/staticSitesOperationGroup/options.js"; +import { + StaticSitesWorkflowPreviewRequest, + StaticSitesWorkflowPreview, +} from "../../models/models.js"; + +/** Interface representing a StaticSitesOperationGroup operations. */ +export interface StaticSitesOperationGroupOperations { + /** Description for Generates a preview workflow file for the static site */ + previewWorkflow: ( + location: string, + body: StaticSitesWorkflowPreviewRequest, + options?: StaticSitesOperationGroupPreviewWorkflowOptionalParams, + ) => Promise; +} + +function _getStaticSitesOperationGroup(context: WebSiteManagementContext) { + return { + previewWorkflow: ( + location: string, + body: StaticSitesWorkflowPreviewRequest, + options?: StaticSitesOperationGroupPreviewWorkflowOptionalParams, + ) => previewWorkflow(context, location, body, options), + }; +} + +export function _getStaticSitesOperationGroupOperations( + context: WebSiteManagementContext, +): StaticSitesOperationGroupOperations { + return { + ..._getStaticSitesOperationGroup(context), + }; +} diff --git a/packages/typespec-test/test/AppService/generated/typespec-ts/src/index.ts b/packages/typespec-test/test/AppService/generated/typespec-ts/src/index.ts new file mode 100644 index 0000000000..d2138c5e75 --- /dev/null +++ b/packages/typespec-test/test/AppService/generated/typespec-ts/src/index.ts @@ -0,0 +1,254 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { AzureClouds, AzureSupportedClouds } from "./static-helpers/cloudSettingHelpers.js"; +import { + PageSettings, + ContinuablePage, + PagedAsyncIterableIterator, +} from "./static-helpers/pagingHelpers.js"; + +export { WebSiteManagementClient } from "./webSiteManagementClient.js"; +export { + CsmMoveResourceEnvelope, + DefaultErrorResponse, + DefaultErrorResponseError, + DefaultErrorResponseErrorDetailsItem, + ValidateRequest, + KnownValidateResourceTypes, + ValidateResourceTypes, + ValidateProperties, + AppServiceEnvironment, + ProvisioningState, + HostingEnvironmentStatus, + VirtualNetworkProfile, + KnownLoadBalancingMode, + LoadBalancingMode, + NameValuePair, + KnownUpgradePreference, + UpgradePreference, + KnownUpgradeAvailability, + UpgradeAvailability, + ValidateResponse, + ValidateResponseError, + DeploymentLocations, + GeoRegion, + GeoRegionProperties, + HostingEnvironmentDeploymentInfo, + ProxyOnlyResource, + AseRegion, + AseRegionProperties, + BillingMeter, + BillingMeterProperties, + ResourceNameAvailabilityRequest, + KnownCheckNameResourceTypes, + CheckNameResourceTypes, + ResourceNameAvailability, + KnownInAvailabilityReasonType, + InAvailabilityReasonType, + CustomHostnameSites, + CustomHostnameSitesProperties, + DnlResourceNameAvailabilityRequest, + DnlResourceNameAvailability, + PremierAddOnOffer, + PremierAddOnOfferProperties, + AppServicePlanRestrictions, + SkuInfos, + GlobalCsmSkuDescription, + SkuCapacity, + Capability, + VnetParameters, + VnetParametersProperties, + VnetValidationFailureDetails, + VnetValidationFailureDetailsProperties, + VnetValidationTestFailure, + VnetValidationTestFailureProperties, + CsmOperationDescription, + CsmOperationDisplay, + CsmOperationDescriptionProperties, + ServiceSpecification, + MetricSpecification, + Dimension, + MetricAvailability, + LogSpecification, + Site, + SiteProperties, + UsageState, + SiteAvailabilityState, + HostNameSslState, + SslState, + HostType, + SiteDnsConfig, + OutboundVnetRouting, + SiteConfig, + ConnStringInfo, + ConnectionStringType, + SiteMachineKey, + HandlerMapping, + KnownScmType, + ScmType, + ManagedPipelineMode, + VirtualApplication, + VirtualDirectory, + SiteLoadBalancing, + Experiments, + RampUpRule, + SiteLimits, + AutoHealRules, + AutoHealTriggers, + RequestsBasedTrigger, + StatusCodesBasedTrigger, + SlowRequestsBasedTrigger, + StatusCodesRangeBasedTrigger, + AutoHealActions, + AutoHealActionType, + AutoHealCustomAction, + CorsSettings, + PushSettings, + PushSettingsProperties, + ApiDefinitionInfo, + ApiManagementConfig, + IpSecurityRestriction, + KnownIpFilterTag, + IpFilterTag, + KnownDefaultAction, + DefaultAction, + KnownSupportedTlsVersions, + SupportedTlsVersions, + KnownTlsCipherSuites, + TlsCipherSuites, + KnownFtpsState, + FtpsState, + AzureStorageInfoValue, + AzureStorageType, + AzureStorageState, + KnownAzureStorageProtocol, + AzureStorageProtocol, + FunctionAppConfig, + FunctionsDeployment, + FunctionsDeploymentStorage, + KnownFunctionsDeploymentStorageType, + FunctionsDeploymentStorageType, + FunctionsDeploymentStorageAuthentication, + KnownAuthenticationType, + AuthenticationType, + FunctionsRuntime, + KnownRuntimeName, + RuntimeName, + FunctionsScaleAndConcurrency, + FunctionsAlwaysReadyConfig, + FunctionsScaleAndConcurrencyTriggers, + FunctionsScaleAndConcurrencyTriggersHttp, + FunctionsSiteUpdateStrategy, + KnownSiteUpdateStrategyType, + SiteUpdateStrategyType, + DaprConfig, + KnownDaprLogLevel, + DaprLogLevel, + ResourceConfig, + HostingEnvironmentProfile, + ClientCertMode, + IPMode, + CloningInfo, + SlotSwapStatus, + RedundancyMode, + AutoGeneratedDomainNameLabelScope, + ManagedServiceIdentity, + ManagedServiceIdentityType, + UserAssignedIdentity, + ExtendedLocation, + SystemData, + KnownCreatedByType, + CreatedByType, + ApplicationStackResource, + ApplicationStack, + StackMajorVersion, + StackMinorVersion, + FunctionAppStack, + FunctionAppStackProperties, + FunctionAppMajorVersion, + FunctionAppMinorVersion, + FunctionAppRuntimes, + FunctionAppRuntimeSettings, + AppInsightsWebAppStackSettings, + GitHubActionWebAppStackSettings, + SiteConfigPropertiesDictionary, + StackPreferredOs, + WebAppStack, + WebAppStackProperties, + WebAppMajorVersion, + WebAppMinorVersion, + WebAppRuntimes, + WebAppRuntimeSettings, + LinuxJavaContainerSettings, + WindowsJavaContainerSettings, + Recommendation, + RecommendationProperties, + KnownResourceScopeType, + ResourceScopeType, + NotificationLevel, + Channels, + CsmUsageQuota, + LocalizableString, + StaticSitesWorkflowPreviewRequest, + StaticSitesWorkflowPreviewRequestProperties, + StaticSiteBuildProperties, + StaticSitesWorkflowPreview, + StaticSitesWorkflowPreviewProperties, + KnownSkuName, + SkuName, + KnownProviderOsTypeSelected, + ProviderOsTypeSelected, + KnownProviderStackOsType, + ProviderStackOsType, + KnownVersions, +} from "./models/index.js"; +export { + MoveOptionalParams, + VerifyHostingEnvironmentVnetOptionalParams, + ListSkusOptionalParams, + ListPremierAddOnOffersOptionalParams, + RegionalCheckNameAvailabilityOptionalParams, + ListGeoRegionsOptionalParams, + ListCustomHostNameSitesOptionalParams, + CheckNameAvailabilityOptionalParams, + ListBillingMetersOptionalParams, + ListAseRegionsOptionalParams, + GetSubscriptionDeploymentLocationsOptionalParams, + ValidateOptionalParams, + ValidateMoveOptionalParams, + WebSiteManagementClientOptionalParams, +} from "./api/index.js"; +export { + AppServiceEnvironmentResourcesSuspendOptionalParams, + AppServiceEnvironmentResourcesResumeOptionalParams, + AppServiceEnvironmentResourcesChangeVnetOptionalParams, +} from "./api/appServiceEnvironmentResources/index.js"; +export { GetUsagesInLocationOperationGroupListOptionalParams } from "./api/getUsagesInLocationOperationGroup/index.js"; +export { GlobalOperationGroupGetSubscriptionOperationWithAsyncResponseOptionalParams } from "./api/globalOperationGroup/index.js"; +export { OperationsListOptionalParams } from "./api/operations/index.js"; +export { + ProviderOperationGroupGetAvailableStacksOnPremOptionalParams, + ProviderOperationGroupGetWebAppStacksOptionalParams, + ProviderOperationGroupGetWebAppStacksForLocationOptionalParams, + ProviderOperationGroupGetFunctionAppStacksForLocationOptionalParams, + ProviderOperationGroupGetFunctionAppStacksOptionalParams, + ProviderOperationGroupGetAvailableStacksOptionalParams, +} from "./api/providerOperationGroup/index.js"; +export { + RecommendationsOperationGroupDisableRecommendationForSubscriptionOptionalParams, + RecommendationsOperationGroupResetAllFiltersOptionalParams, + RecommendationsOperationGroupListOptionalParams, +} from "./api/recommendationsOperationGroup/index.js"; +export { StaticSitesOperationGroupPreviewWorkflowOptionalParams } from "./api/staticSitesOperationGroup/index.js"; +export { + AppServiceEnvironmentResourcesOperations, + GetUsagesInLocationOperationGroupOperations, + GlobalOperationGroupOperations, + OperationsOperations, + ProviderOperationGroupOperations, + RecommendationsOperationGroupOperations, + StaticSitesOperationGroupOperations, +} from "./classic/index.js"; +export { PageSettings, ContinuablePage, PagedAsyncIterableIterator }; +export { AzureClouds, AzureSupportedClouds }; diff --git a/packages/typespec-test/test/AppService/generated/typespec-ts/src/logger.ts b/packages/typespec-test/test/AppService/generated/typespec-ts/src/logger.ts new file mode 100644 index 0000000000..84fe756c88 --- /dev/null +++ b/packages/typespec-test/test/AppService/generated/typespec-ts/src/logger.ts @@ -0,0 +1,5 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { createClientLogger } from "@azure/logger"; +export const logger = createClientLogger("arm-appservice"); diff --git a/packages/typespec-test/test/AppService/generated/typespec-ts/src/models/index.ts b/packages/typespec-test/test/AppService/generated/typespec-ts/src/models/index.ts new file mode 100644 index 0000000000..dfb57db71b --- /dev/null +++ b/packages/typespec-test/test/AppService/generated/typespec-ts/src/models/index.ts @@ -0,0 +1,197 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +export { + CsmMoveResourceEnvelope, + DefaultErrorResponse, + DefaultErrorResponseError, + DefaultErrorResponseErrorDetailsItem, + ValidateRequest, + KnownValidateResourceTypes, + ValidateResourceTypes, + ValidateProperties, + AppServiceEnvironment, + ProvisioningState, + HostingEnvironmentStatus, + VirtualNetworkProfile, + KnownLoadBalancingMode, + LoadBalancingMode, + NameValuePair, + KnownUpgradePreference, + UpgradePreference, + KnownUpgradeAvailability, + UpgradeAvailability, + ValidateResponse, + ValidateResponseError, + DeploymentLocations, + GeoRegion, + GeoRegionProperties, + HostingEnvironmentDeploymentInfo, + ProxyOnlyResource, + AseRegion, + AseRegionProperties, + BillingMeter, + BillingMeterProperties, + ResourceNameAvailabilityRequest, + KnownCheckNameResourceTypes, + CheckNameResourceTypes, + ResourceNameAvailability, + KnownInAvailabilityReasonType, + InAvailabilityReasonType, + CustomHostnameSites, + CustomHostnameSitesProperties, + DnlResourceNameAvailabilityRequest, + DnlResourceNameAvailability, + PremierAddOnOffer, + PremierAddOnOfferProperties, + AppServicePlanRestrictions, + SkuInfos, + GlobalCsmSkuDescription, + SkuCapacity, + Capability, + VnetParameters, + VnetParametersProperties, + VnetValidationFailureDetails, + VnetValidationFailureDetailsProperties, + VnetValidationTestFailure, + VnetValidationTestFailureProperties, + CsmOperationDescription, + CsmOperationDisplay, + CsmOperationDescriptionProperties, + ServiceSpecification, + MetricSpecification, + Dimension, + MetricAvailability, + LogSpecification, + Site, + SiteProperties, + UsageState, + SiteAvailabilityState, + HostNameSslState, + SslState, + HostType, + SiteDnsConfig, + OutboundVnetRouting, + SiteConfig, + ConnStringInfo, + ConnectionStringType, + SiteMachineKey, + HandlerMapping, + KnownScmType, + ScmType, + ManagedPipelineMode, + VirtualApplication, + VirtualDirectory, + SiteLoadBalancing, + Experiments, + RampUpRule, + SiteLimits, + AutoHealRules, + AutoHealTriggers, + RequestsBasedTrigger, + StatusCodesBasedTrigger, + SlowRequestsBasedTrigger, + StatusCodesRangeBasedTrigger, + AutoHealActions, + AutoHealActionType, + AutoHealCustomAction, + CorsSettings, + PushSettings, + PushSettingsProperties, + ApiDefinitionInfo, + ApiManagementConfig, + IpSecurityRestriction, + KnownIpFilterTag, + IpFilterTag, + KnownDefaultAction, + DefaultAction, + KnownSupportedTlsVersions, + SupportedTlsVersions, + KnownTlsCipherSuites, + TlsCipherSuites, + KnownFtpsState, + FtpsState, + AzureStorageInfoValue, + AzureStorageType, + AzureStorageState, + KnownAzureStorageProtocol, + AzureStorageProtocol, + FunctionAppConfig, + FunctionsDeployment, + FunctionsDeploymentStorage, + KnownFunctionsDeploymentStorageType, + FunctionsDeploymentStorageType, + FunctionsDeploymentStorageAuthentication, + KnownAuthenticationType, + AuthenticationType, + FunctionsRuntime, + KnownRuntimeName, + RuntimeName, + FunctionsScaleAndConcurrency, + FunctionsAlwaysReadyConfig, + FunctionsScaleAndConcurrencyTriggers, + FunctionsScaleAndConcurrencyTriggersHttp, + FunctionsSiteUpdateStrategy, + KnownSiteUpdateStrategyType, + SiteUpdateStrategyType, + DaprConfig, + KnownDaprLogLevel, + DaprLogLevel, + ResourceConfig, + HostingEnvironmentProfile, + ClientCertMode, + IPMode, + CloningInfo, + SlotSwapStatus, + RedundancyMode, + AutoGeneratedDomainNameLabelScope, + ManagedServiceIdentity, + ManagedServiceIdentityType, + UserAssignedIdentity, + ExtendedLocation, + SystemData, + KnownCreatedByType, + CreatedByType, + ApplicationStackResource, + ApplicationStack, + StackMajorVersion, + StackMinorVersion, + FunctionAppStack, + FunctionAppStackProperties, + FunctionAppMajorVersion, + FunctionAppMinorVersion, + FunctionAppRuntimes, + FunctionAppRuntimeSettings, + AppInsightsWebAppStackSettings, + GitHubActionWebAppStackSettings, + SiteConfigPropertiesDictionary, + StackPreferredOs, + WebAppStack, + WebAppStackProperties, + WebAppMajorVersion, + WebAppMinorVersion, + WebAppRuntimes, + WebAppRuntimeSettings, + LinuxJavaContainerSettings, + WindowsJavaContainerSettings, + Recommendation, + RecommendationProperties, + KnownResourceScopeType, + ResourceScopeType, + NotificationLevel, + Channels, + CsmUsageQuota, + LocalizableString, + StaticSitesWorkflowPreviewRequest, + StaticSitesWorkflowPreviewRequestProperties, + StaticSiteBuildProperties, + StaticSitesWorkflowPreview, + StaticSitesWorkflowPreviewProperties, + KnownSkuName, + SkuName, + KnownProviderOsTypeSelected, + ProviderOsTypeSelected, + KnownProviderStackOsType, + ProviderStackOsType, + KnownVersions, +} from "./models.js"; diff --git a/packages/typespec-test/test/AppService/generated/typespec-ts/src/models/models.ts b/packages/typespec-test/test/AppService/generated/typespec-ts/src/models/models.ts new file mode 100644 index 0000000000..edbce46eb8 --- /dev/null +++ b/packages/typespec-test/test/AppService/generated/typespec-ts/src/models/models.ts @@ -0,0 +1,5057 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { areAllPropsUndefined } from "../static-helpers/serialization/check-prop-undefined.js"; + +/** + * This file contains only generated model types and their (de)serializers. + * Disable the following rules for internal models with '_' prefix and deserializers which require 'any' for raw JSON input. + */ +/* eslint-disable @typescript-eslint/naming-convention */ +/* eslint-disable @typescript-eslint/explicit-module-boundary-types */ +/** Object with a list of the resources that need to be moved and the resource group they should be moved to. */ +export interface CsmMoveResourceEnvelope { + targetResourceGroup?: string; + resources?: string[]; +} + +export function csmMoveResourceEnvelopeSerializer(item: CsmMoveResourceEnvelope): any { + return { + targetResourceGroup: item["targetResourceGroup"], + resources: !item["resources"] + ? item["resources"] + : item["resources"].map((p: any) => { + return p; + }), + }; +} + +/** App Service error response. */ +export interface DefaultErrorResponse { + /** Error model. */ + readonly error?: DefaultErrorResponseError; +} + +export function defaultErrorResponseDeserializer(item: any): DefaultErrorResponse { + return { + error: !item["error"] ? item["error"] : defaultErrorResponseErrorDeserializer(item["error"]), + }; +} + +/** Error model. */ +export interface DefaultErrorResponseError { + /** Standardized string to programmatically identify the error. */ + readonly code?: string; + /** Detailed error description and debugging information. */ + readonly message?: string; + /** Detailed error description and debugging information. */ + readonly target?: string; + details?: DefaultErrorResponseErrorDetailsItem[]; + /** More information to debug error. */ + readonly innererror?: string; +} + +export function defaultErrorResponseErrorDeserializer(item: any): DefaultErrorResponseError { + return { + code: item["code"], + message: item["message"], + target: item["target"], + details: !item["details"] + ? item["details"] + : defaultErrorResponseErrorDetailsItemArrayDeserializer(item["details"]), + innererror: item["innererror"], + }; +} + +export function defaultErrorResponseErrorDetailsItemArrayDeserializer( + result: Array, +): any[] { + return result.map((item) => { + return defaultErrorResponseErrorDetailsItemDeserializer(item); + }); +} + +/** Detailed errors. */ +export interface DefaultErrorResponseErrorDetailsItem { + /** Standardized string to programmatically identify the error. */ + readonly code?: string; + /** Detailed error description and debugging information. */ + readonly message?: string; + /** Detailed error description and debugging information. */ + readonly target?: string; +} + +export function defaultErrorResponseErrorDetailsItemDeserializer( + item: any, +): DefaultErrorResponseErrorDetailsItem { + return { + code: item["code"], + message: item["message"], + target: item["target"], + }; +} + +/** Resource validation request content. */ +export interface ValidateRequest { + /** Resource name to verify. */ + name: string; + /** Resource type used for verification. */ + type: ValidateResourceTypes; + /** Expected location of the resource. */ + location: string; + /** ARM resource ID of an App Service plan that would host the app. */ + serverFarmId?: string; + /** Name of the target SKU for the App Service plan. */ + skuName?: string; + /** true if App Service plan is for Linux workers; otherwise, false. */ + needLinuxWorkers?: boolean; + /** true if App Service plan is for Spot instances; otherwise, false. */ + isSpot?: boolean; + /** Target capacity of the App Service plan (number of VMs). */ + capacity?: number; + /** Name of App Service Environment where app or App Service plan should be created. */ + hostingEnvironment?: string; + /** true if App Service plan is running as a windows container */ + isXenon?: boolean; + /** Base URL of the container registry */ + containerRegistryBaseUrl?: string; + /** Username for to access the container registry */ + containerRegistryUsername?: string; + /** Password for to access the container registry */ + containerRegistryPassword?: string; + /** Repository name (image name) */ + containerImageRepository?: string; + /** Image tag */ + containerImageTag?: string; + /** Platform (windows or linux) */ + containerImagePlatform?: string; + /** App Service Environment Properties */ + appServiceEnvironment?: AppServiceEnvironment; +} + +export function validateRequestSerializer(item: ValidateRequest): any { + return { + name: item["name"], + type: item["type"], + location: item["location"], + properties: _validateRequestPropertiesSerializer(item), + }; +} + +/** Resource type used for verification. */ +export enum KnownValidateResourceTypes { + /** ServerFarm */ + ServerFarm = "ServerFarm", + /** Site */ + Site = "Site", + /** Microsoft.Web/hostingEnvironments */ + MicrosoftWebHostingEnvironments = "Microsoft.Web/hostingEnvironments", +} + +/** + * Resource type used for verification. \ + * {@link KnownValidateResourceTypes} can be used interchangeably with ValidateResourceTypes, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **ServerFarm** \ + * **Site** \ + * **Microsoft.Web\/hostingEnvironments** + */ +export type ValidateResourceTypes = string; + +/** App properties used for validation. */ +export interface ValidateProperties { + /** ARM resource ID of an App Service plan that would host the app. */ + serverFarmId?: string; + /** Name of the target SKU for the App Service plan. */ + skuName?: string; + /** true if App Service plan is for Linux workers; otherwise, false. */ + needLinuxWorkers?: boolean; + /** true if App Service plan is for Spot instances; otherwise, false. */ + isSpot?: boolean; + /** Target capacity of the App Service plan (number of VMs). */ + capacity?: number; + /** Name of App Service Environment where app or App Service plan should be created. */ + hostingEnvironment?: string; + /** true if App Service plan is running as a windows container */ + isXenon?: boolean; + /** Base URL of the container registry */ + containerRegistryBaseUrl?: string; + /** Username for to access the container registry */ + containerRegistryUsername?: string; + /** Password for to access the container registry */ + containerRegistryPassword?: string; + /** Repository name (image name) */ + containerImageRepository?: string; + /** Image tag */ + containerImageTag?: string; + /** Platform (windows or linux) */ + containerImagePlatform?: string; + /** App Service Environment Properties */ + appServiceEnvironment?: AppServiceEnvironment; +} + +export function validatePropertiesSerializer(item: ValidateProperties): any { + return { + serverFarmId: item["serverFarmId"], + skuName: item["skuName"], + needLinuxWorkers: item["needLinuxWorkers"], + isSpot: item["isSpot"], + capacity: item["capacity"], + hostingEnvironment: item["hostingEnvironment"], + isXenon: item["isXenon"], + containerRegistryBaseUrl: item["containerRegistryBaseUrl"], + containerRegistryUsername: item["containerRegistryUsername"], + containerRegistryPassword: item["containerRegistryPassword"], + containerImageRepository: item["containerImageRepository"], + containerImageTag: item["containerImageTag"], + containerImagePlatform: item["containerImagePlatform"], + appServiceEnvironment: !item["appServiceEnvironment"] + ? item["appServiceEnvironment"] + : appServiceEnvironmentSerializer(item["appServiceEnvironment"]), + }; +} + +/** Description of an App Service Environment. */ +export interface AppServiceEnvironment { + /** Provisioning state of the App Service Environment. */ + readonly provisioningState?: ProvisioningState; + /** Current status of the App Service Environment. */ + readonly status?: HostingEnvironmentStatus; + /** Description of the Virtual Network. */ + virtualNetwork: VirtualNetworkProfile; + /** Specifies which endpoints to serve internally in the Virtual Network for the App Service Environment. */ + internalLoadBalancingMode?: LoadBalancingMode; + /** Front-end VM size, e.g. "Medium", "Large". */ + multiSize?: string; + /** Number of front-end instances. */ + readonly multiRoleCount?: number; + /** Number of IP SSL addresses reserved for the App Service Environment. */ + ipsslAddressCount?: number; + /** DNS suffix of the App Service Environment. */ + dnsSuffix?: string; + /** Maximum number of VMs in the App Service Environment. */ + readonly maximumNumberOfMachines?: number; + /** Scale factor for front-ends. */ + frontEndScaleFactor?: number; + /** + * true if the App Service Environment is suspended; otherwise, false. The environment can be suspended, e.g. when the management endpoint is no longer available + * (most likely because NSG blocked the incoming traffic). + */ + readonly suspended?: boolean; + /** Custom settings for changing the behavior of the App Service Environment. */ + clusterSettings?: NameValuePair[]; + /** User added ip ranges to whitelist on ASE db */ + userWhitelistedIpRanges?: string[]; + /** Flag that displays whether an ASE has linux workers or not */ + readonly hasLinuxWorkers?: boolean; + /** Upgrade Preference */ + upgradePreference?: UpgradePreference; + /** Dedicated Host Count */ + dedicatedHostCount?: number; + /** Whether or not this App Service Environment is zone-redundant. */ + zoneRedundant?: boolean; + /** Whether an upgrade is available for this App Service Environment. */ + readonly upgradeAvailability?: UpgradeAvailability; +} + +export function appServiceEnvironmentSerializer(item: AppServiceEnvironment): any { + return { + virtualNetwork: virtualNetworkProfileSerializer(item["virtualNetwork"]), + internalLoadBalancingMode: item["internalLoadBalancingMode"], + multiSize: item["multiSize"], + ipsslAddressCount: item["ipsslAddressCount"], + dnsSuffix: item["dnsSuffix"], + frontEndScaleFactor: item["frontEndScaleFactor"], + clusterSettings: !item["clusterSettings"] + ? item["clusterSettings"] + : nameValuePairArraySerializer(item["clusterSettings"]), + userWhitelistedIpRanges: !item["userWhitelistedIpRanges"] + ? item["userWhitelistedIpRanges"] + : item["userWhitelistedIpRanges"].map((p: any) => { + return p; + }), + upgradePreference: item["upgradePreference"], + dedicatedHostCount: item["dedicatedHostCount"], + zoneRedundant: item["zoneRedundant"], + }; +} + +export function appServiceEnvironmentDeserializer(item: any): AppServiceEnvironment { + return { + provisioningState: item["provisioningState"], + status: item["status"], + virtualNetwork: virtualNetworkProfileDeserializer(item["virtualNetwork"]), + internalLoadBalancingMode: item["internalLoadBalancingMode"], + multiSize: item["multiSize"], + multiRoleCount: item["multiRoleCount"], + ipsslAddressCount: item["ipsslAddressCount"], + dnsSuffix: item["dnsSuffix"], + maximumNumberOfMachines: item["maximumNumberOfMachines"], + frontEndScaleFactor: item["frontEndScaleFactor"], + suspended: item["suspended"], + clusterSettings: !item["clusterSettings"] + ? item["clusterSettings"] + : nameValuePairArrayDeserializer(item["clusterSettings"]), + userWhitelistedIpRanges: !item["userWhitelistedIpRanges"] + ? item["userWhitelistedIpRanges"] + : item["userWhitelistedIpRanges"].map((p: any) => { + return p; + }), + hasLinuxWorkers: item["hasLinuxWorkers"], + upgradePreference: item["upgradePreference"], + dedicatedHostCount: item["dedicatedHostCount"], + zoneRedundant: item["zoneRedundant"], + upgradeAvailability: item["upgradeAvailability"], + }; +} + +/** Provisioning state of the App Service Plan. */ +export type ProvisioningState = "Succeeded" | "Failed" | "Canceled" | "InProgress" | "Deleting"; +/** Current status of the App Service Environment. */ +export type HostingEnvironmentStatus = "Preparing" | "Ready" | "Scaling" | "Deleting"; + +/** Specification for using a Virtual Network. */ +export interface VirtualNetworkProfile { + /** Resource id of the Virtual Network. */ + id: string; + /** Name of the Virtual Network (read-only). */ + readonly name?: string; + /** Resource type of the Virtual Network (read-only). */ + readonly type?: string; + /** Subnet within the Virtual Network. */ + subnet?: string; +} + +export function virtualNetworkProfileSerializer(item: VirtualNetworkProfile): any { + return { id: item["id"], subnet: item["subnet"] }; +} + +export function virtualNetworkProfileDeserializer(item: any): VirtualNetworkProfile { + return { + id: item["id"], + name: item["name"], + type: item["type"], + subnet: item["subnet"], + }; +} + +/** Specifies which endpoints to serve internally in the Virtual Network for the App Service Environment. */ +export enum KnownLoadBalancingMode { + /** None */ + None = "None", + /** Web */ + Web = "Web", + /** Publishing */ + Publishing = "Publishing", + /** Web, Publishing */ + WebPublishing = "Web, Publishing", +} + +/** + * Specifies which endpoints to serve internally in the Virtual Network for the App Service Environment. \ + * {@link KnownLoadBalancingMode} can be used interchangeably with LoadBalancingMode, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **None** \ + * **Web** \ + * **Publishing** \ + * **Web, Publishing** + */ +export type LoadBalancingMode = string; + +export function nameValuePairArraySerializer(result: Array): any[] { + return result.map((item) => { + return nameValuePairSerializer(item); + }); +} + +export function nameValuePairArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return nameValuePairDeserializer(item); + }); +} + +/** Name value pair. */ +export interface NameValuePair { + /** Pair name. */ + name?: string; + /** Pair value. */ + value?: string; +} + +export function nameValuePairSerializer(item: NameValuePair): any { + return { name: item["name"], value: item["value"] }; +} + +export function nameValuePairDeserializer(item: any): NameValuePair { + return { + name: item["name"], + value: item["value"], + }; +} + +/** Upgrade Preference */ +export enum KnownUpgradePreference { + /** No preference on when this App Service Environment will be upgraded */ + None = "None", + /** This App Service Environment will be upgraded before others in the same region that have Upgrade Preference 'Late' */ + Early = "Early", + /** This App Service Environment will be upgraded after others in the same region that have Upgrade Preference 'Early' */ + Late = "Late", + /** ASEv3 only. Once an upgrade is available, this App Service Environment will wait 10 days for the upgrade to be manually initiated. After 10 days the upgrade will begin automatically */ + Manual = "Manual", +} + +/** + * Upgrade Preference \ + * {@link KnownUpgradePreference} can be used interchangeably with UpgradePreference, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **None**: No preference on when this App Service Environment will be upgraded \ + * **Early**: This App Service Environment will be upgraded before others in the same region that have Upgrade Preference 'Late' \ + * **Late**: This App Service Environment will be upgraded after others in the same region that have Upgrade Preference 'Early' \ + * **Manual**: ASEv3 only. Once an upgrade is available, this App Service Environment will wait 10 days for the upgrade to be manually initiated. After 10 days the upgrade will begin automatically + */ +export type UpgradePreference = string; + +/** Whether an upgrade is available for this App Service Environment. */ +export enum KnownUpgradeAvailability { + /** No upgrade is currently available for this App Service Environment */ + None = "None", + /** An upgrade is ready to be manually initiated on this App Service Environment */ + Ready = "Ready", +} + +/** + * Whether an upgrade is available for this App Service Environment. \ + * {@link KnownUpgradeAvailability} can be used interchangeably with UpgradeAvailability, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **None**: No upgrade is currently available for this App Service Environment \ + * **Ready**: An upgrade is ready to be manually initiated on this App Service Environment + */ +export type UpgradeAvailability = string; + +/** Describes the result of resource validation. */ +export interface ValidateResponse { + /** Result of validation. */ + status?: string; + /** Error details for the case when validation fails. */ + error?: ValidateResponseError; +} + +export function validateResponseDeserializer(item: any): ValidateResponse { + return { + status: item["status"], + error: !item["error"] ? item["error"] : validateResponseErrorDeserializer(item["error"]), + }; +} + +/** Error details for when validation fails. */ +export interface ValidateResponseError { + /** Validation error code. */ + code?: string; + /** Validation error message. */ + message?: string; +} + +export function validateResponseErrorDeserializer(item: any): ValidateResponseError { + return { + code: item["code"], + message: item["message"], + }; +} + +/** + * List of available locations (regions or App Service Environments) for + * deployment of App Service resources. + */ +export interface DeploymentLocations { + /** Available regions. */ + locations?: GeoRegion[]; + /** Available App Service Environments with full descriptions of the environments. */ + hostingEnvironments?: AppServiceEnvironment[]; + /** Available App Service Environments with basic information. */ + hostingEnvironmentDeploymentInfos?: HostingEnvironmentDeploymentInfo[]; +} + +export function deploymentLocationsDeserializer(item: any): DeploymentLocations { + return { + locations: !item["locations"] + ? item["locations"] + : geoRegionArrayDeserializer(item["locations"]), + hostingEnvironments: !item["hostingEnvironments"] + ? item["hostingEnvironments"] + : appServiceEnvironmentArrayDeserializer(item["hostingEnvironments"]), + hostingEnvironmentDeploymentInfos: !item["hostingEnvironmentDeploymentInfos"] + ? item["hostingEnvironmentDeploymentInfos"] + : hostingEnvironmentDeploymentInfoArrayDeserializer( + item["hostingEnvironmentDeploymentInfos"], + ), + }; +} + +export function geoRegionArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return geoRegionDeserializer(item); + }); +} + +/** Geographical region. */ +export interface GeoRegion extends ProxyOnlyResource { + /** Region description. */ + readonly description?: string; + /** Display name for region. */ + readonly displayName?: string; + /** Display name for region. */ + readonly orgDomain?: string; +} + +export function geoRegionDeserializer(item: any): GeoRegion { + return { + id: item["id"], + name: item["name"], + kind: item["kind"], + type: item["type"], + ...(!item["properties"] + ? item["properties"] + : _geoRegionPropertiesDeserializer(item["properties"])), + }; +} + +/** GeoRegion resource specific properties */ +export interface GeoRegionProperties { + /** Region description. */ + readonly description?: string; + /** Display name for region. */ + readonly displayName?: string; + /** Display name for region. */ + readonly orgDomain?: string; +} + +export function geoRegionPropertiesDeserializer(item: any): GeoRegionProperties { + return { + description: item["description"], + displayName: item["displayName"], + orgDomain: item["orgDomain"], + }; +} + +export function appServiceEnvironmentArraySerializer(result: Array): any[] { + return result.map((item) => { + return appServiceEnvironmentSerializer(item); + }); +} + +export function appServiceEnvironmentArrayDeserializer( + result: Array, +): any[] { + return result.map((item) => { + return appServiceEnvironmentDeserializer(item); + }); +} + +export function hostingEnvironmentDeploymentInfoArrayDeserializer( + result: Array, +): any[] { + return result.map((item) => { + return hostingEnvironmentDeploymentInfoDeserializer(item); + }); +} + +/** Information needed to create resources on an App Service Environment. */ +export interface HostingEnvironmentDeploymentInfo { + /** Name of the App Service Environment. */ + name?: string; + /** Location of the App Service Environment. */ + location?: string; +} + +export function hostingEnvironmentDeploymentInfoDeserializer( + item: any, +): HostingEnvironmentDeploymentInfo { + return { + name: item["name"], + location: item["location"], + }; +} + +/** Azure proxy only resource. This resource is not tracked by Azure Resource Manager. */ +export interface ProxyOnlyResource { + /** Resource Id. */ + readonly id?: string; + /** Resource Name. */ + readonly name?: string; + /** Kind of resource. */ + kind?: string; + /** Resource type. */ + readonly type?: string; +} + +export function proxyOnlyResourceSerializer(item: ProxyOnlyResource): any { + return { kind: item["kind"] }; +} + +export function proxyOnlyResourceDeserializer(item: any): ProxyOnlyResource { + return { + id: item["id"], + name: item["name"], + kind: item["kind"], + type: item["type"], + }; +} + +/** Collection of ASE regions. */ +export interface _AseRegionCollection { + /** The AseRegion items on this page */ + value: AseRegion[]; + /** The link to the next page of items */ + nextLink?: string; +} + +export function _aseRegionCollectionDeserializer(item: any): _AseRegionCollection { + return { + value: aseRegionArrayDeserializer(item["value"]), + nextLink: item["nextLink"], + }; +} + +export function aseRegionArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return aseRegionDeserializer(item); + }); +} + +/** ASE region. */ +export interface AseRegion extends ProxyOnlyResource { + /** Display name for region. */ + readonly displayName?: string; + /** Is region standard. */ + readonly standard?: boolean; + /** Dedicated host enabled. */ + readonly dedicatedHost?: boolean; + /** Zone redundant deployment enabled. */ + readonly zoneRedundant?: boolean; + /** Available Skus in region. */ + availableSku?: string[]; + /** Available OSs in region. */ + availableOS?: string[]; +} + +export function aseRegionDeserializer(item: any): AseRegion { + return { + id: item["id"], + name: item["name"], + kind: item["kind"], + type: item["type"], + ...(!item["properties"] + ? item["properties"] + : _aseRegionPropertiesDeserializer(item["properties"])), + }; +} + +/** ASE region resource specific properties */ +export interface AseRegionProperties { + /** Display name for region. */ + readonly displayName?: string; + /** Is region standard. */ + readonly standard?: boolean; + /** Dedicated host enabled. */ + readonly dedicatedHost?: boolean; + /** Zone redundant deployment enabled. */ + readonly zoneRedundant?: boolean; + /** Available Skus in region. */ + availableSku?: string[]; + /** Available OSs in region. */ + availableOS?: string[]; +} + +export function aseRegionPropertiesDeserializer(item: any): AseRegionProperties { + return { + displayName: item["displayName"], + standard: item["standard"], + dedicatedHost: item["dedicatedHost"], + zoneRedundant: item["zoneRedundant"], + availableSku: !item["availableSku"] + ? item["availableSku"] + : item["availableSku"].map((p: any) => { + return p; + }), + availableOS: !item["availableOS"] + ? item["availableOS"] + : item["availableOS"].map((p: any) => { + return p; + }), + }; +} + +/** Collection of Billing Meters */ +export interface _BillingMeterCollection { + /** The BillingMeter items on this page */ + value: BillingMeter[]; + /** The link to the next page of items */ + nextLink?: string; +} + +export function _billingMeterCollectionDeserializer(item: any): _BillingMeterCollection { + return { + value: billingMeterArrayDeserializer(item["value"]), + nextLink: item["nextLink"], + }; +} + +export function billingMeterArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return billingMeterDeserializer(item); + }); +} + +/** App Service billing entity that contains information about meter which the Azure billing system utilizes to charge users for services. */ +export interface BillingMeter extends ProxyOnlyResource { + /** Meter GUID onboarded in Commerce */ + meterId?: string; + /** Azure Location of billable resource */ + billingLocation?: string; + /** Short Name from App Service Azure pricing Page */ + shortName?: string; + /** Friendly name of the meter */ + friendlyName?: string; + /** App Service ResourceType meter used for */ + resourceType?: string; + /** App Service OS type meter used for */ + osType?: string; + /** Meter Multiplier */ + multiplier?: number; +} + +export function billingMeterDeserializer(item: any): BillingMeter { + return { + id: item["id"], + name: item["name"], + kind: item["kind"], + type: item["type"], + ...(!item["properties"] + ? item["properties"] + : _billingMeterPropertiesDeserializer(item["properties"])), + }; +} + +/** BillingMeter resource specific properties */ +export interface BillingMeterProperties { + /** Meter GUID onboarded in Commerce */ + meterId?: string; + /** Azure Location of billable resource */ + billingLocation?: string; + /** Short Name from App Service Azure pricing Page */ + shortName?: string; + /** Friendly name of the meter */ + friendlyName?: string; + /** App Service ResourceType meter used for */ + resourceType?: string; + /** App Service OS type meter used for */ + osType?: string; + /** Meter Multiplier */ + multiplier?: number; +} + +export function billingMeterPropertiesDeserializer(item: any): BillingMeterProperties { + return { + meterId: item["meterId"], + billingLocation: item["billingLocation"], + shortName: item["shortName"], + friendlyName: item["friendlyName"], + resourceType: item["resourceType"], + osType: item["osType"], + multiplier: item["multiplier"], + }; +} + +/** Resource name availability request content. */ +export interface ResourceNameAvailabilityRequest { + /** Resource name to verify. */ + name: string; + /** Resource type used for verification. */ + type: CheckNameResourceTypes; + /** Is fully qualified domain name. */ + isFqdn?: boolean; + /** Azure Resource Manager ID of the customer's selected Container Apps Environment on which to host the Function app. This must be of the form /subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.App/managedEnvironments/{managedEnvironmentName} */ + environmentId?: string; +} + +export function resourceNameAvailabilityRequestSerializer( + item: ResourceNameAvailabilityRequest, +): any { + return { + name: item["name"], + type: item["type"], + isFqdn: item["isFqdn"], + environmentId: item["environmentId"], + }; +} + +/** Resource type used for verification. */ +export enum KnownCheckNameResourceTypes { + /** Site */ + Site = "Site", + /** Slot */ + Slot = "Slot", + /** HostingEnvironment */ + HostingEnvironment = "HostingEnvironment", + /** PublishingUser */ + PublishingUser = "PublishingUser", + /** Microsoft.Web/sites */ + MicrosoftWebSites = "Microsoft.Web/sites", + /** Microsoft.Web/sites/slots */ + MicrosoftWebSitesSlots = "Microsoft.Web/sites/slots", + /** Microsoft.Web/hostingEnvironments */ + MicrosoftWebHostingEnvironments = "Microsoft.Web/hostingEnvironments", + /** Microsoft.Web/publishingUsers */ + MicrosoftWebPublishingUsers = "Microsoft.Web/publishingUsers", +} + +/** + * Resource type used for verification. \ + * {@link KnownCheckNameResourceTypes} can be used interchangeably with CheckNameResourceTypes, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Site** \ + * **Slot** \ + * **HostingEnvironment** \ + * **PublishingUser** \ + * **Microsoft.Web\/sites** \ + * **Microsoft.Web\/sites\/slots** \ + * **Microsoft.Web\/hostingEnvironments** \ + * **Microsoft.Web\/publishingUsers** + */ +export type CheckNameResourceTypes = string; + +/** Information regarding availability of a resource name. */ +export interface ResourceNameAvailability { + /** true indicates name is valid and available. false indicates the name is invalid, unavailable, or both. */ + nameAvailable?: boolean; + /** Invalid indicates the name provided does not match Azure App Service naming requirements. AlreadyExists indicates that the name is already in use and is therefore unavailable. */ + reason?: InAvailabilityReasonType; + /** If reason == invalid, provide the user with the reason why the given name is invalid, and provide the resource naming requirements so that the user can select a valid name. If reason == AlreadyExists, explain that resource name is already in use, and direct them to select a different name. */ + message?: string; +} + +export function resourceNameAvailabilityDeserializer(item: any): ResourceNameAvailability { + return { + nameAvailable: item["nameAvailable"], + reason: item["reason"], + message: item["message"], + }; +} + +/** Invalid indicates the name provided does not match Azure App Service naming requirements. AlreadyExists indicates that the name is already in use and is therefore unavailable. */ +export enum KnownInAvailabilityReasonType { + /** Invalid */ + Invalid = "Invalid", + /** AlreadyExists */ + AlreadyExists = "AlreadyExists", +} + +/** + * Invalid indicates the name provided does not match Azure App Service naming requirements. AlreadyExists indicates that the name is already in use and is therefore unavailable. \ + * {@link KnownInAvailabilityReasonType} can be used interchangeably with InAvailabilityReasonType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Invalid** \ + * **AlreadyExists** + */ +export type InAvailabilityReasonType = string; + +/** Collection of custom hostname sites */ +export interface _CustomHostnameSitesCollection { + /** The CustomHostnameSites items on this page */ + value: CustomHostnameSites[]; + /** The link to the next page of items */ + nextLink?: string; +} + +export function _customHostnameSitesCollectionDeserializer( + item: any, +): _CustomHostnameSitesCollection { + return { + value: customHostnameSitesArrayDeserializer(item["value"]), + nextLink: item["nextLink"], + }; +} + +export function customHostnameSitesArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return customHostnameSitesDeserializer(item); + }); +} + +/** A hostname and its assigned sites */ +export interface CustomHostnameSites extends ProxyOnlyResource { + customHostname?: string; + region?: string; +} + +export function customHostnameSitesDeserializer(item: any): CustomHostnameSites { + return { + id: item["id"], + name: item["name"], + kind: item["kind"], + type: item["type"], + ...(!item["properties"] + ? item["properties"] + : _customHostnameSitesPropertiesDeserializer(item["properties"])), + }; +} + +/** CustomHostnameSites resource specific properties */ +export interface CustomHostnameSitesProperties { + customHostname?: string; + region?: string; +} + +export function customHostnameSitesPropertiesDeserializer( + item: any, +): CustomHostnameSitesProperties { + return { + customHostname: item["customHostname"], + region: item["region"], + }; +} + +/** Collection of geographical regions. */ +export interface _GeoRegionCollection { + /** The GeoRegion items on this page */ + value: GeoRegion[]; + /** The link to the next page of items */ + nextLink?: string; +} + +export function _geoRegionCollectionDeserializer(item: any): _GeoRegionCollection { + return { + value: geoRegionArrayDeserializer(item["value"]), + nextLink: item["nextLink"], + }; +} + +/** model interface DnlResourceNameAvailabilityRequest */ +export interface DnlResourceNameAvailabilityRequest { + /** Resource group name */ + resourceGroupName?: string; + /** + * Indicates the endpoint name reuse scope.The default value is TenantReuse. + * Supported values are TenantReuse, SubscriptionReuse, ResourceGroupReuse, NoReuse + */ + autoGeneratedDomainNameLabelScope?: string; + /** Resource name to verify. */ + name: string; + /** Resource type used for verification. */ + type: CheckNameResourceTypes; +} + +export function dnlResourceNameAvailabilityRequestSerializer( + item: DnlResourceNameAvailabilityRequest, +): any { + return { + resourceGroupName: item["resourceGroupName"], + autoGeneratedDomainNameLabelScope: item["autoGeneratedDomainNameLabelScope"], + name: item["name"], + type: item["type"], + }; +} + +/** Information regarding availability of a resource name for DNL apps with regionalized default hostnames. */ +export interface DnlResourceNameAvailability { + hostName?: string; + /** true indicates name is valid and available. false indicates the name is invalid, unavailable, or both. */ + nameAvailable?: boolean; + /** Invalid indicates the name provided does not match Azure App Service naming requirements. AlreadyExists indicates that the name is already in use and is therefore unavailable. */ + reason?: InAvailabilityReasonType; + /** If reason == invalid, provide the user with the reason why the given name is invalid, and provide the resource naming requirements so that the user can select a valid name. If reason == AlreadyExists, explain that resource name is already in use, and direct them to select a different name. */ + message?: string; +} + +export function dnlResourceNameAvailabilityDeserializer(item: any): DnlResourceNameAvailability { + return { + hostName: item["hostName"], + nameAvailable: item["nameAvailable"], + reason: item["reason"], + message: item["message"], + }; +} + +/** Collection of premier add-on offers. */ +export interface _PremierAddOnOfferCollection { + /** The PremierAddOnOffer items on this page */ + value: PremierAddOnOffer[]; + /** The link to the next page of items */ + nextLink?: string; +} + +export function _premierAddOnOfferCollectionDeserializer(item: any): _PremierAddOnOfferCollection { + return { + value: premierAddOnOfferArrayDeserializer(item["value"]), + nextLink: item["nextLink"], + }; +} + +export function premierAddOnOfferArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return premierAddOnOfferDeserializer(item); + }); +} + +/** Premier add-on offer. */ +export interface PremierAddOnOffer extends ProxyOnlyResource { + /** Premier add on SKU. */ + sku?: string; + /** Premier add on offer Product. */ + product?: string; + /** Premier add on offer Vendor. */ + vendor?: string; + /** true if promotion code is required; otherwise, false. */ + promoCodeRequired?: boolean; + /** Premier add on offer Quota. */ + quota?: number; + /** App Service plans this offer is restricted to. */ + webHostingPlanRestrictions?: AppServicePlanRestrictions; + /** Privacy policy URL. */ + privacyPolicyUrl?: string; + /** Legal terms URL. */ + legalTermsUrl?: string; + /** Marketplace publisher. */ + marketplacePublisher?: string; + /** Marketplace offer. */ + marketplaceOffer?: string; +} + +export function premierAddOnOfferDeserializer(item: any): PremierAddOnOffer { + return { + id: item["id"], + name: item["name"], + kind: item["kind"], + type: item["type"], + ...(!item["properties"] + ? item["properties"] + : _premierAddOnOfferPropertiesDeserializer(item["properties"])), + }; +} + +/** PremierAddOnOffer resource specific properties */ +export interface PremierAddOnOfferProperties { + /** Premier add on SKU. */ + sku?: string; + /** Premier add on offer Product. */ + product?: string; + /** Premier add on offer Vendor. */ + vendor?: string; + /** true if promotion code is required; otherwise, false. */ + promoCodeRequired?: boolean; + /** Premier add on offer Quota. */ + quota?: number; + /** App Service plans this offer is restricted to. */ + webHostingPlanRestrictions?: AppServicePlanRestrictions; + /** Privacy policy URL. */ + privacyPolicyUrl?: string; + /** Legal terms URL. */ + legalTermsUrl?: string; + /** Marketplace publisher. */ + marketplacePublisher?: string; + /** Marketplace offer. */ + marketplaceOffer?: string; +} + +export function premierAddOnOfferPropertiesDeserializer(item: any): PremierAddOnOfferProperties { + return { + sku: item["sku"], + product: item["product"], + vendor: item["vendor"], + promoCodeRequired: item["promoCodeRequired"], + quota: item["quota"], + webHostingPlanRestrictions: item["webHostingPlanRestrictions"], + privacyPolicyUrl: item["privacyPolicyUrl"], + legalTermsUrl: item["legalTermsUrl"], + marketplacePublisher: item["marketplacePublisher"], + marketplaceOffer: item["marketplaceOffer"], + }; +} + +/** App Service plans this offer is restricted to. */ +export type AppServicePlanRestrictions = + | "None" + | "Free" + | "Shared" + | "Basic" + | "Standard" + | "Premium"; + +/** Collection of SKU information. */ +export interface SkuInfos { + /** Resource type that this SKU applies to. */ + resourceType?: string; + /** List of SKUs the subscription is able to use. */ + skus?: GlobalCsmSkuDescription[]; +} + +export function skuInfosDeserializer(item: any): SkuInfos { + return { + resourceType: item["resourceType"], + skus: !item["skus"] ? item["skus"] : globalCsmSkuDescriptionArrayDeserializer(item["skus"]), + }; +} + +export function globalCsmSkuDescriptionArrayDeserializer( + result: Array, +): any[] { + return result.map((item) => { + return globalCsmSkuDescriptionDeserializer(item); + }); +} + +/** A Global SKU Description. */ +export interface GlobalCsmSkuDescription { + /** Name of the resource SKU. */ + name?: string; + /** Service Tier of the resource SKU. */ + tier?: string; + /** Size specifier of the resource SKU. */ + size?: string; + /** Family code of the resource SKU. */ + family?: string; + /** Min, max, and default scale values of the SKU. */ + capacity?: SkuCapacity; + /** Locations of the SKU. */ + locations?: string[]; + /** Capabilities of the SKU, e.g., is traffic manager enabled? */ + capabilities?: Capability[]; +} + +export function globalCsmSkuDescriptionDeserializer(item: any): GlobalCsmSkuDescription { + return { + name: item["name"], + tier: item["tier"], + size: item["size"], + family: item["family"], + capacity: !item["capacity"] ? item["capacity"] : skuCapacityDeserializer(item["capacity"]), + locations: !item["locations"] + ? item["locations"] + : item["locations"].map((p: any) => { + return p; + }), + capabilities: !item["capabilities"] + ? item["capabilities"] + : capabilityArrayDeserializer(item["capabilities"]), + }; +} + +/** Description of the App Service plan scale options. */ +export interface SkuCapacity { + /** Minimum number of workers for this App Service plan SKU. */ + minimum?: number; + /** Maximum number of workers for this App Service plan SKU. */ + maximum?: number; + /** Maximum number of Elastic workers for this App Service plan SKU. */ + elasticMaximum?: number; + /** Default number of workers for this App Service plan SKU. */ + default?: number; + /** Available scale configurations for an App Service plan. */ + scaleType?: string; +} + +export function skuCapacityDeserializer(item: any): SkuCapacity { + return { + minimum: item["minimum"], + maximum: item["maximum"], + elasticMaximum: item["elasticMaximum"], + default: item["default"], + scaleType: item["scaleType"], + }; +} + +export function capabilityArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return capabilityDeserializer(item); + }); +} + +/** Describes the capabilities/features allowed for a specific SKU. */ +export interface Capability { + /** Name of the SKU capability. */ + name?: string; + /** Value of the SKU capability. */ + value?: string; + /** Reason of the SKU capability. */ + reason?: string; +} + +export function capabilityDeserializer(item: any): Capability { + return { + name: item["name"], + value: item["value"], + reason: item["reason"], + }; +} + +/** The required set of inputs to validate a VNET */ +export interface VnetParameters extends ProxyOnlyResource { + /** The Resource Group of the VNET to be validated */ + vnetResourceGroup?: string; + /** The name of the VNET to be validated */ + vnetName?: string; + /** The subnet name to be validated */ + vnetSubnetName?: string; + /** The ARM Resource ID of the subnet to validate */ + subnetResourceId?: string; +} + +export function vnetParametersSerializer(item: VnetParameters): any { + return { + kind: item["kind"], + properties: areAllPropsUndefined(item, [ + "vnetResourceGroup", + "vnetName", + "vnetSubnetName", + "subnetResourceId", + ]) + ? undefined + : _vnetParametersPropertiesSerializer(item), + }; +} + +/** VnetParameters resource specific properties */ +export interface VnetParametersProperties { + /** The Resource Group of the VNET to be validated */ + vnetResourceGroup?: string; + /** The name of the VNET to be validated */ + vnetName?: string; + /** The subnet name to be validated */ + vnetSubnetName?: string; + /** The ARM Resource ID of the subnet to validate */ + subnetResourceId?: string; +} + +export function vnetParametersPropertiesSerializer(item: VnetParametersProperties): any { + return { + vnetResourceGroup: item["vnetResourceGroup"], + vnetName: item["vnetName"], + vnetSubnetName: item["vnetSubnetName"], + subnetResourceId: item["subnetResourceId"], + }; +} + +/** A class that describes the reason for a validation failure. */ +export interface VnetValidationFailureDetails extends ProxyOnlyResource { + /** Text describing the validation outcome. */ + message?: string; + /** A flag describing whether or not validation failed. */ + failed?: boolean; + /** A list of tests that failed in the validation. */ + failedTests?: VnetValidationTestFailure[]; + /** A list of warnings generated during validation. */ + warnings?: VnetValidationTestFailure[]; +} + +export function vnetValidationFailureDetailsDeserializer(item: any): VnetValidationFailureDetails { + return { + id: item["id"], + name: item["name"], + kind: item["kind"], + type: item["type"], + ...(!item["properties"] + ? item["properties"] + : _vnetValidationFailureDetailsPropertiesDeserializer(item["properties"])), + }; +} + +/** VnetValidationFailureDetails resource specific properties */ +export interface VnetValidationFailureDetailsProperties { + /** Text describing the validation outcome. */ + message?: string; + /** A flag describing whether or not validation failed. */ + failed?: boolean; + /** A list of tests that failed in the validation. */ + failedTests?: VnetValidationTestFailure[]; + /** A list of warnings generated during validation. */ + warnings?: VnetValidationTestFailure[]; +} + +export function vnetValidationFailureDetailsPropertiesDeserializer( + item: any, +): VnetValidationFailureDetailsProperties { + return { + message: item["message"], + failed: item["failed"], + failedTests: !item["failedTests"] + ? item["failedTests"] + : vnetValidationTestFailureArrayDeserializer(item["failedTests"]), + warnings: !item["warnings"] + ? item["warnings"] + : vnetValidationTestFailureArrayDeserializer(item["warnings"]), + }; +} + +export function vnetValidationTestFailureArrayDeserializer( + result: Array, +): any[] { + return result.map((item) => { + return vnetValidationTestFailureDeserializer(item); + }); +} + +/** A class that describes a test that failed during NSG and UDR validation. */ +export interface VnetValidationTestFailure extends ProxyOnlyResource { + /** The name of the test that failed. */ + testName?: string; + /** The details of what caused the failure, e.g. the blocking rule name, etc. */ + details?: string; +} + +export function vnetValidationTestFailureDeserializer(item: any): VnetValidationTestFailure { + return { + id: item["id"], + name: item["name"], + kind: item["kind"], + type: item["type"], + ...(!item["properties"] + ? item["properties"] + : _vnetValidationTestFailurePropertiesDeserializer(item["properties"])), + }; +} + +/** VnetValidationTestFailure resource specific properties */ +export interface VnetValidationTestFailureProperties { + /** The name of the test that failed. */ + testName?: string; + /** The details of what caused the failure, e.g. the blocking rule name, etc. */ + details?: string; +} + +export function vnetValidationTestFailurePropertiesDeserializer( + item: any, +): VnetValidationTestFailureProperties { + return { + testName: item["testName"], + details: item["details"], + }; +} + +/** Collection of Azure resource manager operation metadata. */ +export interface _CsmOperationCollection { + /** Collection of resources. */ + value: CsmOperationDescription[]; + /** Link to next page of resources. */ + readonly nextLink?: string; +} + +export function _csmOperationCollectionDeserializer(item: any): _CsmOperationCollection { + return { + value: csmOperationDescriptionArrayDeserializer(item["value"]), + nextLink: item["nextLink"], + }; +} + +export function csmOperationDescriptionArrayDeserializer( + result: Array, +): any[] { + return result.map((item) => { + return csmOperationDescriptionDeserializer(item); + }); +} + +/** Description of an operation available for Microsoft.Web resource provider. */ +export interface CsmOperationDescription { + name?: string; + isDataAction?: boolean; + /** Meta data about operation used for display in portal. */ + display?: CsmOperationDisplay; + origin?: string; + /** Properties available for a Microsoft.Web resource provider operation. */ + properties?: CsmOperationDescriptionProperties; +} + +export function csmOperationDescriptionDeserializer(item: any): CsmOperationDescription { + return { + name: item["name"], + isDataAction: item["isDataAction"], + display: !item["display"] ? item["display"] : csmOperationDisplayDeserializer(item["display"]), + origin: item["origin"], + properties: !item["properties"] + ? item["properties"] + : csmOperationDescriptionPropertiesDeserializer(item["properties"]), + }; +} + +/** Meta data about operation used for display in portal. */ +export interface CsmOperationDisplay { + provider?: string; + resource?: string; + operation?: string; + description?: string; +} + +export function csmOperationDisplayDeserializer(item: any): CsmOperationDisplay { + return { + provider: item["provider"], + resource: item["resource"], + operation: item["operation"], + description: item["description"], + }; +} + +/** Properties available for a Microsoft.Web resource provider operation. */ +export interface CsmOperationDescriptionProperties { + /** Resource metrics service provided by Microsoft.Insights resource provider. */ + serviceSpecification?: ServiceSpecification; +} + +export function csmOperationDescriptionPropertiesDeserializer( + item: any, +): CsmOperationDescriptionProperties { + return { + serviceSpecification: !item["serviceSpecification"] + ? item["serviceSpecification"] + : serviceSpecificationDeserializer(item["serviceSpecification"]), + }; +} + +/** Resource metrics service provided by Microsoft.Insights resource provider. */ +export interface ServiceSpecification { + metricSpecifications?: MetricSpecification[]; + logSpecifications?: LogSpecification[]; +} + +export function serviceSpecificationDeserializer(item: any): ServiceSpecification { + return { + metricSpecifications: !item["metricSpecifications"] + ? item["metricSpecifications"] + : metricSpecificationArrayDeserializer(item["metricSpecifications"]), + logSpecifications: !item["logSpecifications"] + ? item["logSpecifications"] + : logSpecificationArrayDeserializer(item["logSpecifications"]), + }; +} + +export function metricSpecificationArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return metricSpecificationDeserializer(item); + }); +} + +/** Definition of a single resource metric. */ +export interface MetricSpecification { + name?: string; + displayName?: string; + displayDescription?: string; + unit?: string; + aggregationType?: string; + supportsInstanceLevelAggregation?: boolean; + enableRegionalMdmAccount?: boolean; + sourceMdmAccount?: string; + sourceMdmNamespace?: string; + metricFilterPattern?: string; + fillGapWithZero?: boolean; + isInternal?: boolean; + dimensions?: Dimension[]; + category?: string; + availabilities?: MetricAvailability[]; + supportedTimeGrainTypes?: string[]; + supportedAggregationTypes?: string[]; +} + +export function metricSpecificationDeserializer(item: any): MetricSpecification { + return { + name: item["name"], + displayName: item["displayName"], + displayDescription: item["displayDescription"], + unit: item["unit"], + aggregationType: item["aggregationType"], + supportsInstanceLevelAggregation: item["supportsInstanceLevelAggregation"], + enableRegionalMdmAccount: item["enableRegionalMdmAccount"], + sourceMdmAccount: item["sourceMdmAccount"], + sourceMdmNamespace: item["sourceMdmNamespace"], + metricFilterPattern: item["metricFilterPattern"], + fillGapWithZero: item["fillGapWithZero"], + isInternal: item["isInternal"], + dimensions: !item["dimensions"] + ? item["dimensions"] + : dimensionArrayDeserializer(item["dimensions"]), + category: item["category"], + availabilities: !item["availabilities"] + ? item["availabilities"] + : metricAvailabilityArrayDeserializer(item["availabilities"]), + supportedTimeGrainTypes: !item["supportedTimeGrainTypes"] + ? item["supportedTimeGrainTypes"] + : item["supportedTimeGrainTypes"].map((p: any) => { + return p; + }), + supportedAggregationTypes: !item["supportedAggregationTypes"] + ? item["supportedAggregationTypes"] + : item["supportedAggregationTypes"].map((p: any) => { + return p; + }), + }; +} + +export function dimensionArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return dimensionDeserializer(item); + }); +} + +/** + * Dimension of a resource metric. For e.g. instance specific HTTP requests for a web app, + * where instance name is dimension of the metric HTTP request + */ +export interface Dimension { + name?: string; + displayName?: string; + internalName?: string; + toBeExportedForShoebox?: boolean; +} + +export function dimensionDeserializer(item: any): Dimension { + return { + name: item["name"], + displayName: item["displayName"], + internalName: item["internalName"], + toBeExportedForShoebox: item["toBeExportedForShoebox"], + }; +} + +export function metricAvailabilityArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return metricAvailabilityDeserializer(item); + }); +} + +/** Retention policy of a resource metric. */ +export interface MetricAvailability { + timeGrain?: string; + blobDuration?: string; +} + +export function metricAvailabilityDeserializer(item: any): MetricAvailability { + return { + timeGrain: item["timeGrain"], + blobDuration: item["blobDuration"], + }; +} + +export function logSpecificationArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return logSpecificationDeserializer(item); + }); +} + +/** Log Definition of a single resource metric. */ +export interface LogSpecification { + name?: string; + displayName?: string; + blobDuration?: string; + logFilterPattern?: string; +} + +export function logSpecificationDeserializer(item: any): LogSpecification { + return { + name: item["name"], + displayName: item["displayName"], + blobDuration: item["blobDuration"], + logFilterPattern: item["logFilterPattern"], + }; +} + +/** Paged collection of Site items */ +export interface _WebAppCollection { + /** The Site items on this page */ + value: Site[]; + /** The link to the next page of items */ + nextLink?: string; +} + +export function _webAppCollectionDeserializer(item: any): _WebAppCollection { + return { + value: siteArrayDeserializer(item["value"]), + nextLink: item["nextLink"], + }; +} + +export function siteArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return siteDeserializer(item); + }); +} + +/** Collection of App Service apps. */ +export interface Site { + properties: SiteProperties; + name: string; + identity: ManagedServiceIdentity; + extendedLocation: ExtendedLocation; + kind: string; + tags: Record; + location: string; + id: string; + type: string; + systemData: SystemData; +} + +export function siteDeserializer(item: any): Site { + return { + properties: sitePropertiesDeserializer(item["properties"]), + name: item["name"], + identity: managedServiceIdentityDeserializer(item["identity"]), + extendedLocation: extendedLocationDeserializer(item["extendedLocation"]), + kind: item["kind"], + tags: Object.fromEntries(Object.entries(item["tags"]).map(([k, p]: [string, any]) => [k, p])), + location: item["location"], + id: item["id"], + type: item["type"], + systemData: systemDataDeserializer(item["systemData"]), + }; +} + +/** Site resource specific properties */ +export interface SiteProperties { + /** Current state of the app. */ + readonly state?: string; + /** Hostnames associated with the app. */ + readonly hostNames?: string[]; + /** Name of the repository site. */ + readonly repositorySiteName?: string; + /** State indicating whether the app has exceeded its quota usage. Read-only. */ + readonly usageState?: UsageState; + /** true if the app is enabled; otherwise, false. Setting this value to false disables the app (takes the app offline). */ + enabled?: boolean; + /** + * Enabled hostnames for the app.Hostnames need to be assigned (see HostNames) AND enabled. Otherwise, + * the app is not served on those hostnames. + */ + readonly enabledHostNames?: string[]; + /** Management information availability state for the app. */ + readonly availabilityState?: SiteAvailabilityState; + /** Hostname SSL states are used to manage the SSL bindings for app's hostnames. */ + hostNameSslStates?: HostNameSslState[]; + /** Resource ID of the associated App Service plan, formatted as: "/subscriptions/{subscriptionID}/resourceGroups/{groupName}/providers/Microsoft.Web/serverfarms/{appServicePlanName}". */ + serverFarmId?: string; + /** true if reserved; otherwise, false. */ + reserved?: boolean; + /** Obsolete: Hyper-V sandbox. */ + isXenon?: boolean; + /** Hyper-V sandbox. */ + hyperV?: boolean; + /** Last time the app was modified, in UTC. Read-only. */ + readonly lastModifiedTimeUtc?: Date; + /** Property to configure various DNS related settings for a site. */ + dnsConfiguration?: SiteDnsConfig; + /** Property to configure various outbound traffic routing options over virtual network for a site */ + outboundVnetRouting?: OutboundVnetRouting; + /** Configuration of an App Service app. This property is not returned in response to normal create and read requests since it may contain sensitive information. */ + siteConfig?: SiteConfig; + /** Configuration specific of the Azure Function app. */ + functionAppConfig?: FunctionAppConfig; + /** Dapr configuration of the app. */ + daprConfig?: DaprConfig; + /** Workload profile name for function app to execute on. */ + workloadProfileName?: string; + /** Function app resource requirements. */ + resourceConfig?: ResourceConfig; + /** Azure Traffic Manager hostnames associated with the app. Read-only. */ + readonly trafficManagerHostNames?: string[]; + /** true to stop SCM (KUDU) site when the app is stopped; otherwise, false. The default is false. */ + scmSiteAlsoStopped?: boolean; + /** Specifies which deployment slot this app will swap into. Read-only. */ + readonly targetSwapSlot?: string; + /** App Service Environment to use for the app. */ + hostingEnvironmentProfile?: HostingEnvironmentProfile; + /** true to enable client affinity; false to stop sending session affinity cookies, which route client requests in the same session to the same instance. Default is true. */ + clientAffinityEnabled?: boolean; + /** true to enable client affinity partitioning using CHIPS cookies, this will add the partitioned property to the affinity cookies; false to stop sending partitioned affinity cookies. Default is false. */ + clientAffinityPartitioningEnabled?: boolean; + /** true to override client affinity cookie domain with X-Forwarded-Host request header. false to use default domain. Default is false. */ + clientAffinityProxyEnabled?: boolean; + /** true to enable client certificate authentication (TLS mutual authentication); otherwise, false. Default is false. */ + clientCertEnabled?: boolean; + /** + * This composes with ClientCertEnabled setting. + * - ClientCertEnabled: false means ClientCert is ignored. + * - ClientCertEnabled: true and ClientCertMode: Required means ClientCert is required. + * - ClientCertEnabled: true and ClientCertMode: Optional means ClientCert is optional or accepted. + */ + clientCertMode?: ClientCertMode; + /** client certificate authentication comma-separated exclusion paths */ + clientCertExclusionPaths?: string; + /** Specifies the IP mode of the app. */ + ipMode?: IPMode; + /** Whether to use end to end encryption between the FrontEnd and the Worker */ + endToEndEncryptionEnabled?: boolean; + /** Whether to enable ssh access. */ + sshEnabled?: boolean; + /** + * true to disable the public hostnames of the app; otherwise, false. + * If true, the app is only accessible via API management process. + */ + hostNamesDisabled?: boolean; + /** Unique identifier that verifies the custom domains assigned to the app. Customer will add this id to a txt record for verification. */ + customDomainVerificationId?: string; + /** List of IP addresses that the app uses for outbound connections (e.g. database access). Includes VIPs from tenants that site can be hosted with current settings. Read-only. */ + readonly outboundIpAddresses?: string; + /** List of IP addresses that the app uses for outbound connections (e.g. database access). Includes VIPs from all tenants except dataComponent. Read-only. */ + readonly possibleOutboundIpAddresses?: string; + /** Size of the function container. */ + containerSize?: number; + /** Maximum allowed daily memory-time quota (applicable on dynamic apps only). */ + dailyMemoryTimeQuota?: number; + /** App suspended till in case memory-time quota is exceeded. */ + readonly suspendedTill?: Date; + /** + * Maximum number of workers. + * This only applies to Functions container. + */ + readonly maxNumberOfWorkers?: number; + /** If specified during app creation, the app is cloned from a source app. */ + cloningInfo?: CloningInfo; + /** Name of the resource group the app belongs to. Read-only. */ + readonly resourceGroup?: string; + /** true if the app is a default container; otherwise, false. */ + readonly isDefaultContainer?: boolean; + /** Default hostname of the app. Read-only. */ + readonly defaultHostName?: string; + /** Status of the last deployment slot swap operation. */ + readonly slotSwapStatus?: SlotSwapStatus; + /** + * HttpsOnly: configures a web site to accept only https requests. Issues redirect for + * http requests + */ + httpsOnly?: boolean; + /** Site redundancy mode */ + redundancyMode?: RedundancyMode; + /** Specifies an operation id if this site has a pending operation. */ + readonly inProgressOperationId?: string; + /** Property to allow or block all public traffic. Allowed Values: 'Enabled', 'Disabled' or an empty string. */ + publicNetworkAccess?: string; + /** Checks if Customer provided storage account is required */ + storageAccountRequired?: boolean; + /** Identity to use for Key Vault Reference authentication. */ + keyVaultReferenceIdentity?: string; + /** Specifies the scope of uniqueness for the default hostname during resource creation */ + autoGeneratedDomainNameLabelScope?: AutoGeneratedDomainNameLabelScope; + /** + * Azure Resource Manager ID of the Virtual network and subnet to be joined by Regional VNET Integration. + * This must be of the form /subscriptions/{subscriptionName}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{vnetName}/subnets/{subnetName} + */ + virtualNetworkSubnetId?: string; + /** Azure Resource Manager ID of the customer's selected Managed Environment on which to host this app. This must be of the form /subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.App/managedEnvironments/{managedEnvironmentName} */ + managedEnvironmentId?: string; + /** Current SKU of application based on associated App Service Plan. Some valid SKU values are Free, Shared, Basic, Dynamic, FlexConsumption, Standard, Premium, PremiumV2, PremiumV3, Isolated, IsolatedV2 */ + readonly sku?: string; +} + +export function sitePropertiesDeserializer(item: any): SiteProperties { + return { + state: item["state"], + hostNames: !item["hostNames"] + ? item["hostNames"] + : item["hostNames"].map((p: any) => { + return p; + }), + repositorySiteName: item["repositorySiteName"], + usageState: item["usageState"], + enabled: item["enabled"], + enabledHostNames: !item["enabledHostNames"] + ? item["enabledHostNames"] + : item["enabledHostNames"].map((p: any) => { + return p; + }), + availabilityState: item["availabilityState"], + hostNameSslStates: !item["hostNameSslStates"] + ? item["hostNameSslStates"] + : hostNameSslStateArrayDeserializer(item["hostNameSslStates"]), + serverFarmId: item["serverFarmId"], + reserved: item["reserved"], + isXenon: item["isXenon"], + hyperV: item["hyperV"], + lastModifiedTimeUtc: !item["lastModifiedTimeUtc"] + ? item["lastModifiedTimeUtc"] + : new Date(item["lastModifiedTimeUtc"]), + dnsConfiguration: !item["dnsConfiguration"] + ? item["dnsConfiguration"] + : siteDnsConfigDeserializer(item["dnsConfiguration"]), + outboundVnetRouting: !item["outboundVnetRouting"] + ? item["outboundVnetRouting"] + : outboundVnetRoutingDeserializer(item["outboundVnetRouting"]), + siteConfig: !item["siteConfig"] + ? item["siteConfig"] + : siteConfigDeserializer(item["siteConfig"]), + functionAppConfig: !item["functionAppConfig"] + ? item["functionAppConfig"] + : functionAppConfigDeserializer(item["functionAppConfig"]), + daprConfig: !item["daprConfig"] + ? item["daprConfig"] + : daprConfigDeserializer(item["daprConfig"]), + workloadProfileName: item["workloadProfileName"], + resourceConfig: !item["resourceConfig"] + ? item["resourceConfig"] + : resourceConfigDeserializer(item["resourceConfig"]), + trafficManagerHostNames: !item["trafficManagerHostNames"] + ? item["trafficManagerHostNames"] + : item["trafficManagerHostNames"].map((p: any) => { + return p; + }), + scmSiteAlsoStopped: item["scmSiteAlsoStopped"], + targetSwapSlot: item["targetSwapSlot"], + hostingEnvironmentProfile: !item["hostingEnvironmentProfile"] + ? item["hostingEnvironmentProfile"] + : hostingEnvironmentProfileDeserializer(item["hostingEnvironmentProfile"]), + clientAffinityEnabled: item["clientAffinityEnabled"], + clientAffinityPartitioningEnabled: item["clientAffinityPartitioningEnabled"], + clientAffinityProxyEnabled: item["clientAffinityProxyEnabled"], + clientCertEnabled: item["clientCertEnabled"], + clientCertMode: item["clientCertMode"], + clientCertExclusionPaths: item["clientCertExclusionPaths"], + ipMode: item["ipMode"], + endToEndEncryptionEnabled: item["endToEndEncryptionEnabled"], + sshEnabled: item["sshEnabled"], + hostNamesDisabled: item["hostNamesDisabled"], + customDomainVerificationId: item["customDomainVerificationId"], + outboundIpAddresses: item["outboundIpAddresses"], + possibleOutboundIpAddresses: item["possibleOutboundIpAddresses"], + containerSize: item["containerSize"], + dailyMemoryTimeQuota: item["dailyMemoryTimeQuota"], + suspendedTill: !item["suspendedTill"] ? item["suspendedTill"] : new Date(item["suspendedTill"]), + maxNumberOfWorkers: item["maxNumberOfWorkers"], + cloningInfo: !item["cloningInfo"] + ? item["cloningInfo"] + : cloningInfoDeserializer(item["cloningInfo"]), + resourceGroup: item["resourceGroup"], + isDefaultContainer: item["isDefaultContainer"], + defaultHostName: item["defaultHostName"], + slotSwapStatus: !item["slotSwapStatus"] + ? item["slotSwapStatus"] + : slotSwapStatusDeserializer(item["slotSwapStatus"]), + httpsOnly: item["httpsOnly"], + redundancyMode: item["redundancyMode"], + inProgressOperationId: item["inProgressOperationId"], + publicNetworkAccess: item["publicNetworkAccess"], + storageAccountRequired: item["storageAccountRequired"], + keyVaultReferenceIdentity: item["keyVaultReferenceIdentity"], + autoGeneratedDomainNameLabelScope: item["autoGeneratedDomainNameLabelScope"], + virtualNetworkSubnetId: item["virtualNetworkSubnetId"], + managedEnvironmentId: item["managedEnvironmentId"], + sku: item["sku"], + }; +} + +/** State indicating whether the app has exceeded its quota usage. Read-only. */ +export type UsageState = "Normal" | "Exceeded"; +/** Management information availability state for the app. */ +export type SiteAvailabilityState = "Normal" | "Limited" | "DisasterRecoveryMode"; + +export function hostNameSslStateArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return hostNameSslStateDeserializer(item); + }); +} + +/** SSL-enabled hostname. */ +export interface HostNameSslState { + /** Hostname. */ + name?: string; + /** SSL type. */ + sslState?: SslState; + /** Virtual IP address assigned to the hostname if IP based SSL is enabled. */ + virtualIP?: string; + /** SSL certificate thumbprint. */ + thumbprint?: string; + /** Set to true to update existing hostname. */ + toUpdate?: boolean; + /** Indicates whether the hostname is a standard or repository hostname. */ + hostType?: HostType; +} + +export function hostNameSslStateDeserializer(item: any): HostNameSslState { + return { + name: item["name"], + sslState: item["sslState"], + virtualIP: item["virtualIP"], + thumbprint: item["thumbprint"], + toUpdate: item["toUpdate"], + hostType: item["hostType"], + }; +} + +/** SSL type */ +export type SslState = "Disabled" | "SniEnabled" | "IpBasedEnabled"; +/** Indicates whether the hostname is a standard or repository hostname. */ +export type HostType = "Standard" | "Repository"; + +/** model interface SiteDnsConfig */ +export interface SiteDnsConfig { + /** List of custom DNS servers to be used by an app for lookups. Maximum 5 dns servers can be set. */ + dnsServers?: string[]; + /** Alternate DNS server to be used by apps. This property replicates the WEBSITE_DNS_ALT_SERVER app setting. */ + dnsAltServer?: string; + /** Timeout for a single dns lookup in seconds. Allowed range: 1-30. Default is 3. */ + dnsRetryAttemptTimeout?: number; + /** Total number of retries for dns lookup. Allowed range: 1-5. Default is 3. */ + dnsRetryAttemptCount?: number; + /** Custom time for DNS to be cached in seconds. Allowed range: 0-60. Default is 30 seconds. 0 means caching disabled. */ + dnsMaxCacheTimeout?: number; + /** Indicates that sites using Virtual network custom DNS servers are still sorting the list of DNS servers. Read-Only. */ + readonly dnsLegacySortOrder?: boolean; +} + +export function siteDnsConfigDeserializer(item: any): SiteDnsConfig { + return { + dnsServers: !item["dnsServers"] + ? item["dnsServers"] + : item["dnsServers"].map((p: any) => { + return p; + }), + dnsAltServer: item["dnsAltServer"], + dnsRetryAttemptTimeout: item["dnsRetryAttemptTimeout"], + dnsRetryAttemptCount: item["dnsRetryAttemptCount"], + dnsMaxCacheTimeout: item["dnsMaxCacheTimeout"], + dnsLegacySortOrder: item["dnsLegacySortOrder"], + }; +} + +/** Outbound traffic options over virtual network. */ +export interface OutboundVnetRouting { + /** Enables all other routing options defined in OutboundVnetRouting if this setting is set to true. */ + allTraffic?: boolean; + /** This causes all outbound traffic to have Virtual Network Security Groups and User Defined Routes applied. Previously called VnetRouteAllEnabled. */ + applicationTraffic?: boolean; + /** Enables accessing content over virtual network. Previously called VnetContentShareEnabled */ + contentShareTraffic?: boolean; + /** Enables pulling image over Virtual Network. Previously called VnetImagePullEnabled. */ + imagePullTraffic?: boolean; + /** Enables Backup and Restore operations over virtual network. Previously called VnetBackupRestoreEnabled */ + backupRestoreTraffic?: boolean; +} + +export function outboundVnetRoutingDeserializer(item: any): OutboundVnetRouting { + return { + allTraffic: item["allTraffic"], + applicationTraffic: item["applicationTraffic"], + contentShareTraffic: item["contentShareTraffic"], + imagePullTraffic: item["imagePullTraffic"], + backupRestoreTraffic: item["backupRestoreTraffic"], + }; +} + +/** Configuration of an App Service app. */ +export interface SiteConfig { + /** Number of workers. */ + numberOfWorkers?: number; + /** Default documents. */ + defaultDocuments?: string[]; + /** .NET Framework version. */ + netFrameworkVersion?: string; + /** Version of PHP. */ + phpVersion?: string; + /** Version of Python. */ + pythonVersion?: string; + /** Version of Node.js. */ + nodeVersion?: string; + /** Version of PowerShell. */ + powerShellVersion?: string; + /** Linux App Framework and version */ + linuxFxVersion?: string; + /** Xenon App Framework and version */ + windowsFxVersion?: string; + /** true if request tracing is enabled; otherwise, false. */ + requestTracingEnabled?: boolean; + /** Request tracing expiration time. */ + requestTracingExpirationTime?: Date; + /** true if remote debugging is enabled; otherwise, false. */ + remoteDebuggingEnabled?: boolean; + /** Remote debugging version. */ + remoteDebuggingVersion?: string; + /** true if HTTP logging is enabled; otherwise, false. */ + httpLoggingEnabled?: boolean; + /** Flag to use Managed Identity Creds for ACR pull */ + acrUseManagedIdentityCreds?: boolean; + /** If using user managed identity, the user managed identity ClientId */ + acrUserManagedIdentityID?: string; + /** HTTP logs directory size limit. */ + logsDirectorySizeLimit?: number; + /** true if detailed error logging is enabled; otherwise, false. */ + detailedErrorLoggingEnabled?: boolean; + /** Publishing user name. */ + publishingUsername?: string; + /** Application settings. This property is not returned in response to normal create and read requests since it may contain sensitive information. */ + appSettings?: NameValuePair[]; + /** Application metadata. This property cannot be retrieved, since it may contain secrets. */ + metadata?: NameValuePair[]; + /** Connection strings. This property is not returned in response to normal create and read requests since it may contain sensitive information. */ + connectionStrings?: ConnStringInfo[]; + /** Site MachineKey. */ + readonly machineKey?: SiteMachineKey; + /** Handler mappings. */ + handlerMappings?: HandlerMapping[]; + /** Document root. */ + documentRoot?: string; + /** SCM type. */ + scmType?: ScmType; + /** true to use 32-bit worker process; otherwise, false. */ + use32BitWorkerProcess?: boolean; + /** true if WebSocket is enabled; otherwise, false. */ + webSocketsEnabled?: boolean; + /** true if Always On is enabled; otherwise, false. */ + alwaysOn?: boolean; + /** Java version. */ + javaVersion?: string; + /** Java container. */ + javaContainer?: string; + /** Java container version. */ + javaContainerVersion?: string; + /** App command line to launch. */ + appCommandLine?: string; + /** Managed pipeline mode. */ + managedPipelineMode?: ManagedPipelineMode; + /** Virtual applications. */ + virtualApplications?: VirtualApplication[]; + /** Site load balancing. */ + loadBalancing?: SiteLoadBalancing; + /** This is work around for polymorphic types. */ + experiments?: Experiments; + /** Site limits. */ + limits?: SiteLimits; + /** true if Auto Heal is enabled; otherwise, false. */ + autoHealEnabled?: boolean; + /** Auto Heal rules. */ + autoHealRules?: AutoHealRules; + /** Tracing options. */ + tracingOptions?: string; + /** Virtual Network name. */ + vnetName?: string; + /** Virtual Network Route All enabled. This causes all outbound traffic to have Virtual Network Security Groups and User Defined Routes applied. */ + vnetRouteAllEnabled?: boolean; + /** The number of private ports assigned to this app. These will be assigned dynamically on runtime. */ + vnetPrivatePortsCount?: number; + /** Cross-Origin Resource Sharing (CORS) settings. */ + cors?: CorsSettings; + /** Push endpoint settings. */ + push?: PushSettings; + /** Information about the formal API definition for the app. */ + apiDefinition?: ApiDefinitionInfo; + /** Azure API management settings linked to the app. */ + apiManagementConfig?: ApiManagementConfig; + /** Auto-swap slot name. */ + autoSwapSlotName?: string; + /** true to enable local MySQL; otherwise, false. */ + localMySqlEnabled?: boolean; + /** Managed Service Identity Id */ + managedServiceIdentityId?: number; + /** Explicit Managed Service Identity Id */ + xManagedServiceIdentityId?: number; + /** Identity to use for Key Vault Reference authentication. */ + keyVaultReferenceIdentity?: string; + /** IP security restrictions for main. */ + ipSecurityRestrictions?: IpSecurityRestriction[]; + /** Default action for main access restriction if no rules are matched. */ + ipSecurityRestrictionsDefaultAction?: DefaultAction; + /** IP security restrictions for scm. */ + scmIpSecurityRestrictions?: IpSecurityRestriction[]; + /** Default action for scm access restriction if no rules are matched. */ + scmIpSecurityRestrictionsDefaultAction?: DefaultAction; + /** IP security restrictions for scm to use main. */ + scmIpSecurityRestrictionsUseMain?: boolean; + /** Http20Enabled: configures a web site to allow clients to connect over http2.0 */ + http20Enabled?: boolean; + /** Http20ProxyFlag: Configures a website to allow http2.0 to pass be proxied all the way to the app. 0 = disabled, 1 = pass through all http2 traffic, 2 = pass through gRPC only. */ + http20ProxyFlag?: number; + /** MinTlsVersion: configures the minimum version of TLS required for SSL requests */ + minTlsVersion?: SupportedTlsVersions; + /** The minimum strength TLS cipher suite allowed for an application */ + minTlsCipherSuite?: TlsCipherSuites; + /** ScmMinTlsVersion: configures the minimum version of TLS required for SSL requests for SCM site */ + scmMinTlsVersion?: SupportedTlsVersions; + /** State of FTP / FTPS service */ + ftpsState?: FtpsState; + /** + * Number of preWarmed instances. + * This setting only applies to the Consumption and Elastic Plans + */ + preWarmedInstanceCount?: number; + /** + * Maximum number of workers that a site can scale out to. + * This setting only applies to the Consumption and Elastic Premium Plans + */ + functionAppScaleLimit?: number; + /** + * Maximum number of workers that a site can scale out to. + * This setting only applies to apps in plans where ElasticScaleEnabled is true + */ + elasticWebAppScaleLimit?: number; + /** Health check path */ + healthCheckPath?: string; + /** + * Gets or sets a value indicating whether functions runtime scale monitoring is enabled. When enabled, + * the ScaleController will not monitor event sources directly, but will instead call to the + * runtime to get scale status. + */ + functionsRuntimeScaleMonitoringEnabled?: boolean; + /** Sets the time zone a site uses for generating timestamps. Compatible with Linux and Windows App Service. Setting the WEBSITE_TIME_ZONE app setting takes precedence over this config. For Linux, expects tz database values https://www.iana.org/time-zones (for a quick reference see https://en.wikipedia.org/wiki/List_of_tz_database_time_zones). For Windows, expects one of the time zones listed under HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones */ + websiteTimeZone?: string; + /** + * Number of minimum instance count for a site + * This setting only applies to the Elastic Plans + */ + minimumElasticInstanceCount?: number; + /** List of Azure Storage Accounts. */ + azureStorageAccounts?: Record; + /** Property to allow or block all public traffic. */ + publicNetworkAccess?: string; +} + +export function siteConfigDeserializer(item: any): SiteConfig { + return { + numberOfWorkers: item["numberOfWorkers"], + defaultDocuments: !item["defaultDocuments"] + ? item["defaultDocuments"] + : item["defaultDocuments"].map((p: any) => { + return p; + }), + netFrameworkVersion: item["netFrameworkVersion"], + phpVersion: item["phpVersion"], + pythonVersion: item["pythonVersion"], + nodeVersion: item["nodeVersion"], + powerShellVersion: item["powerShellVersion"], + linuxFxVersion: item["linuxFxVersion"], + windowsFxVersion: item["windowsFxVersion"], + requestTracingEnabled: item["requestTracingEnabled"], + requestTracingExpirationTime: !item["requestTracingExpirationTime"] + ? item["requestTracingExpirationTime"] + : new Date(item["requestTracingExpirationTime"]), + remoteDebuggingEnabled: item["remoteDebuggingEnabled"], + remoteDebuggingVersion: item["remoteDebuggingVersion"], + httpLoggingEnabled: item["httpLoggingEnabled"], + acrUseManagedIdentityCreds: item["acrUseManagedIdentityCreds"], + acrUserManagedIdentityID: item["acrUserManagedIdentityID"], + logsDirectorySizeLimit: item["logsDirectorySizeLimit"], + detailedErrorLoggingEnabled: item["detailedErrorLoggingEnabled"], + publishingUsername: item["publishingUsername"], + appSettings: !item["appSettings"] + ? item["appSettings"] + : nameValuePairArrayDeserializer(item["appSettings"]), + metadata: !item["metadata"] + ? item["metadata"] + : nameValuePairArrayDeserializer(item["metadata"]), + connectionStrings: !item["connectionStrings"] + ? item["connectionStrings"] + : connStringInfoArrayDeserializer(item["connectionStrings"]), + machineKey: !item["machineKey"] + ? item["machineKey"] + : siteMachineKeyDeserializer(item["machineKey"]), + handlerMappings: !item["handlerMappings"] + ? item["handlerMappings"] + : handlerMappingArrayDeserializer(item["handlerMappings"]), + documentRoot: item["documentRoot"], + scmType: item["scmType"], + use32BitWorkerProcess: item["use32BitWorkerProcess"], + webSocketsEnabled: item["webSocketsEnabled"], + alwaysOn: item["alwaysOn"], + javaVersion: item["javaVersion"], + javaContainer: item["javaContainer"], + javaContainerVersion: item["javaContainerVersion"], + appCommandLine: item["appCommandLine"], + managedPipelineMode: item["managedPipelineMode"], + virtualApplications: !item["virtualApplications"] + ? item["virtualApplications"] + : virtualApplicationArrayDeserializer(item["virtualApplications"]), + loadBalancing: item["loadBalancing"], + experiments: !item["experiments"] + ? item["experiments"] + : experimentsDeserializer(item["experiments"]), + limits: !item["limits"] ? item["limits"] : siteLimitsDeserializer(item["limits"]), + autoHealEnabled: item["autoHealEnabled"], + autoHealRules: !item["autoHealRules"] + ? item["autoHealRules"] + : autoHealRulesDeserializer(item["autoHealRules"]), + tracingOptions: item["tracingOptions"], + vnetName: item["vnetName"], + vnetRouteAllEnabled: item["vnetRouteAllEnabled"], + vnetPrivatePortsCount: item["vnetPrivatePortsCount"], + cors: !item["cors"] ? item["cors"] : corsSettingsDeserializer(item["cors"]), + push: !item["push"] ? item["push"] : pushSettingsDeserializer(item["push"]), + apiDefinition: !item["apiDefinition"] + ? item["apiDefinition"] + : apiDefinitionInfoDeserializer(item["apiDefinition"]), + apiManagementConfig: !item["apiManagementConfig"] + ? item["apiManagementConfig"] + : apiManagementConfigDeserializer(item["apiManagementConfig"]), + autoSwapSlotName: item["autoSwapSlotName"], + localMySqlEnabled: item["localMySqlEnabled"], + managedServiceIdentityId: item["managedServiceIdentityId"], + xManagedServiceIdentityId: item["xManagedServiceIdentityId"], + keyVaultReferenceIdentity: item["keyVaultReferenceIdentity"], + ipSecurityRestrictions: !item["ipSecurityRestrictions"] + ? item["ipSecurityRestrictions"] + : ipSecurityRestrictionArrayDeserializer(item["ipSecurityRestrictions"]), + ipSecurityRestrictionsDefaultAction: item["ipSecurityRestrictionsDefaultAction"], + scmIpSecurityRestrictions: !item["scmIpSecurityRestrictions"] + ? item["scmIpSecurityRestrictions"] + : ipSecurityRestrictionArrayDeserializer(item["scmIpSecurityRestrictions"]), + scmIpSecurityRestrictionsDefaultAction: item["scmIpSecurityRestrictionsDefaultAction"], + scmIpSecurityRestrictionsUseMain: item["scmIpSecurityRestrictionsUseMain"], + http20Enabled: item["http20Enabled"], + http20ProxyFlag: item["http20ProxyFlag"], + minTlsVersion: item["minTlsVersion"], + minTlsCipherSuite: item["minTlsCipherSuite"], + scmMinTlsVersion: item["scmMinTlsVersion"], + ftpsState: item["ftpsState"], + preWarmedInstanceCount: item["preWarmedInstanceCount"], + functionAppScaleLimit: item["functionAppScaleLimit"], + elasticWebAppScaleLimit: item["elasticWebAppScaleLimit"], + healthCheckPath: item["healthCheckPath"], + functionsRuntimeScaleMonitoringEnabled: item["functionsRuntimeScaleMonitoringEnabled"], + websiteTimeZone: item["websiteTimeZone"], + minimumElasticInstanceCount: item["minimumElasticInstanceCount"], + azureStorageAccounts: !item["azureStorageAccounts"] + ? item["azureStorageAccounts"] + : azureStorageInfoValueRecordDeserializer(item["azureStorageAccounts"]), + publicNetworkAccess: item["publicNetworkAccess"], + }; +} + +export function connStringInfoArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return connStringInfoDeserializer(item); + }); +} + +/** Database connection string information. */ +export interface ConnStringInfo { + /** Name of connection string. */ + name?: string; + /** Connection string value. */ + connectionString?: string; + /** Type of database. */ + type?: ConnectionStringType; +} + +export function connStringInfoDeserializer(item: any): ConnStringInfo { + return { + name: item["name"], + connectionString: item["connectionString"], + type: item["type"], + }; +} + +/** Type of database. */ +export type ConnectionStringType = + | "MySql" + | "SQLServer" + | "SQLAzure" + | "Custom" + | "NotificationHub" + | "ServiceBus" + | "EventHub" + | "ApiHub" + | "DocDb" + | "RedisCache" + | "PostgreSQL"; + +/** MachineKey of an app. */ +export interface SiteMachineKey { + /** MachineKey validation. */ + validation?: string; + /** Validation key. */ + validationKey?: string; + /** Algorithm used for decryption. */ + decryption?: string; + /** Decryption key. */ + decryptionKey?: string; +} + +export function siteMachineKeyDeserializer(item: any): SiteMachineKey { + return { + validation: item["validation"], + validationKey: item["validationKey"], + decryption: item["decryption"], + decryptionKey: item["decryptionKey"], + }; +} + +export function handlerMappingArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return handlerMappingDeserializer(item); + }); +} + +/** + * The IIS handler mappings used to define which handler processes HTTP requests with certain extension. + * For example, it is used to configure php-cgi.exe process to handle all HTTP requests with *.php extension. + */ +export interface HandlerMapping { + /** Requests with this extension will be handled using the specified FastCGI application. */ + extension?: string; + /** The absolute path to the FastCGI application. */ + scriptProcessor?: string; + /** Command-line arguments to be passed to the script processor. */ + arguments?: string; +} + +export function handlerMappingDeserializer(item: any): HandlerMapping { + return { + extension: item["extension"], + scriptProcessor: item["scriptProcessor"], + arguments: item["arguments"], + }; +} + +/** SCM type. */ +export enum KnownScmType { + /** None */ + None = "None", + /** Dropbox */ + Dropbox = "Dropbox", + /** Tfs */ + Tfs = "Tfs", + /** LocalGit */ + LocalGit = "LocalGit", + /** GitHub */ + GitHub = "GitHub", + /** CodePlexGit */ + CodePlexGit = "CodePlexGit", + /** CodePlexHg */ + CodePlexHg = "CodePlexHg", + /** BitbucketGit */ + BitbucketGit = "BitbucketGit", + /** BitbucketHg */ + BitbucketHg = "BitbucketHg", + /** ExternalGit */ + ExternalGit = "ExternalGit", + /** ExternalHg */ + ExternalHg = "ExternalHg", + /** OneDrive */ + OneDrive = "OneDrive", + /** VSO */ + VSO = "VSO", + /** VSTSRM */ + Vstsrm = "VSTSRM", +} + +/** + * SCM type. \ + * {@link KnownScmType} can be used interchangeably with ScmType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **None** \ + * **Dropbox** \ + * **Tfs** \ + * **LocalGit** \ + * **GitHub** \ + * **CodePlexGit** \ + * **CodePlexHg** \ + * **BitbucketGit** \ + * **BitbucketHg** \ + * **ExternalGit** \ + * **ExternalHg** \ + * **OneDrive** \ + * **VSO** \ + * **VSTSRM** + */ +export type ScmType = string; +/** Managed pipeline mode. */ +export type ManagedPipelineMode = "Integrated" | "Classic"; + +export function virtualApplicationArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return virtualApplicationDeserializer(item); + }); +} + +/** Virtual application in an app. */ +export interface VirtualApplication { + /** Virtual path. */ + virtualPath?: string; + /** Physical path. */ + physicalPath?: string; + /** true if preloading is enabled; otherwise, false. */ + preloadEnabled?: boolean; + /** Virtual directories for virtual application. */ + virtualDirectories?: VirtualDirectory[]; +} + +export function virtualApplicationDeserializer(item: any): VirtualApplication { + return { + virtualPath: item["virtualPath"], + physicalPath: item["physicalPath"], + preloadEnabled: item["preloadEnabled"], + virtualDirectories: !item["virtualDirectories"] + ? item["virtualDirectories"] + : virtualDirectoryArrayDeserializer(item["virtualDirectories"]), + }; +} + +export function virtualDirectoryArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return virtualDirectoryDeserializer(item); + }); +} + +/** Directory for virtual application. */ +export interface VirtualDirectory { + /** Path to virtual application. */ + virtualPath?: string; + /** Physical path. */ + physicalPath?: string; +} + +export function virtualDirectoryDeserializer(item: any): VirtualDirectory { + return { + virtualPath: item["virtualPath"], + physicalPath: item["physicalPath"], + }; +} + +/** Site load balancing. */ +export type SiteLoadBalancing = + | "WeightedRoundRobin" + | "LeastRequests" + | "LeastResponseTime" + | "WeightedTotalTraffic" + | "RequestHash" + | "PerSiteRoundRobin" + | "LeastRequestsWithTieBreaker"; + +/** Routing rules in production experiments. */ +export interface Experiments { + /** List of ramp-up rules. */ + rampUpRules?: RampUpRule[]; +} + +export function experimentsDeserializer(item: any): Experiments { + return { + rampUpRules: !item["rampUpRules"] + ? item["rampUpRules"] + : rampUpRuleArrayDeserializer(item["rampUpRules"]), + }; +} + +export function rampUpRuleArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return rampUpRuleDeserializer(item); + }); +} + +/** Routing rules for ramp up testing. This rule allows to redirect static traffic % to a slot or to gradually change routing % based on performance. */ +export interface RampUpRule { + /** Hostname of a slot to which the traffic will be redirected if decided to. E.g. myapp-stage.azurewebsites.net. */ + actionHostName?: string; + /** Percentage of the traffic which will be redirected to ActionHostName. */ + reroutePercentage?: number; + /** + * In auto ramp up scenario this is the step to add/remove from ReroutePercentage until it reaches \nMinReroutePercentage or + * MaxReroutePercentage. Site metrics are checked every N minutes specified in ChangeIntervalInMinutes.\nCustom decision algorithm + * can be provided in TiPCallback site extension which URL can be specified in ChangeDecisionCallbackUrl. + */ + changeStep?: number; + /** Specifies interval in minutes to reevaluate ReroutePercentage. */ + changeIntervalInMinutes?: number; + /** Specifies lower boundary above which ReroutePercentage will stay. */ + minReroutePercentage?: number; + /** Specifies upper boundary below which ReroutePercentage will stay. */ + maxReroutePercentage?: number; + /** Custom decision algorithm can be provided in TiPCallback site extension which URL can be specified. */ + changeDecisionCallbackUrl?: string; + /** Name of the routing rule. The recommended name would be to point to the slot which will receive the traffic in the experiment. */ + name?: string; +} + +export function rampUpRuleDeserializer(item: any): RampUpRule { + return { + actionHostName: item["actionHostName"], + reroutePercentage: item["reroutePercentage"], + changeStep: item["changeStep"], + changeIntervalInMinutes: item["changeIntervalInMinutes"], + minReroutePercentage: item["minReroutePercentage"], + maxReroutePercentage: item["maxReroutePercentage"], + changeDecisionCallbackUrl: item["changeDecisionCallbackUrl"], + name: item["name"], + }; +} + +/** Metric limits set on an app. */ +export interface SiteLimits { + /** Maximum allowed CPU usage percentage. */ + maxPercentageCpu?: number; + /** Maximum allowed memory usage in MB. */ + maxMemoryInMb?: number; + /** Maximum allowed disk size usage in MB. */ + maxDiskSizeInMb?: number; +} + +export function siteLimitsDeserializer(item: any): SiteLimits { + return { + maxPercentageCpu: item["maxPercentageCpu"], + maxMemoryInMb: item["maxMemoryInMb"], + maxDiskSizeInMb: item["maxDiskSizeInMb"], + }; +} + +/** Rules that can be defined for auto-heal. */ +export interface AutoHealRules { + /** Conditions that describe when to execute the auto-heal actions. */ + triggers?: AutoHealTriggers; + /** Actions to be executed when a rule is triggered. */ + actions?: AutoHealActions; +} + +export function autoHealRulesDeserializer(item: any): AutoHealRules { + return { + triggers: !item["triggers"] ? item["triggers"] : autoHealTriggersDeserializer(item["triggers"]), + actions: !item["actions"] ? item["actions"] : autoHealActionsDeserializer(item["actions"]), + }; +} + +/** Triggers for auto-heal. */ +export interface AutoHealTriggers { + /** A rule based on total requests. */ + requests?: RequestsBasedTrigger; + /** A rule based on private bytes. */ + privateBytesInKB?: number; + /** A rule based on status codes. */ + statusCodes?: StatusCodesBasedTrigger[]; + /** A rule based on request execution time. */ + slowRequests?: SlowRequestsBasedTrigger; + /** A rule based on multiple Slow Requests Rule with path */ + slowRequestsWithPath?: SlowRequestsBasedTrigger[]; + /** A rule based on status codes ranges. */ + statusCodesRange?: StatusCodesRangeBasedTrigger[]; +} + +export function autoHealTriggersDeserializer(item: any): AutoHealTriggers { + return { + requests: !item["requests"] + ? item["requests"] + : requestsBasedTriggerDeserializer(item["requests"]), + privateBytesInKB: item["privateBytesInKB"], + statusCodes: !item["statusCodes"] + ? item["statusCodes"] + : statusCodesBasedTriggerArrayDeserializer(item["statusCodes"]), + slowRequests: !item["slowRequests"] + ? item["slowRequests"] + : slowRequestsBasedTriggerDeserializer(item["slowRequests"]), + slowRequestsWithPath: !item["slowRequestsWithPath"] + ? item["slowRequestsWithPath"] + : slowRequestsBasedTriggerArrayDeserializer(item["slowRequestsWithPath"]), + statusCodesRange: !item["statusCodesRange"] + ? item["statusCodesRange"] + : statusCodesRangeBasedTriggerArrayDeserializer(item["statusCodesRange"]), + }; +} + +/** Trigger based on total requests. */ +export interface RequestsBasedTrigger { + /** Request Count. */ + count?: number; + /** Time interval. */ + timeInterval?: string; +} + +export function requestsBasedTriggerDeserializer(item: any): RequestsBasedTrigger { + return { + count: item["count"], + timeInterval: item["timeInterval"], + }; +} + +export function statusCodesBasedTriggerArrayDeserializer( + result: Array, +): any[] { + return result.map((item) => { + return statusCodesBasedTriggerDeserializer(item); + }); +} + +/** Trigger based on status code. */ +export interface StatusCodesBasedTrigger { + /** HTTP status code. */ + status?: number; + /** Request Sub Status. */ + subStatus?: number; + /** Win32 error code. */ + win32Status?: number; + /** Request Count. */ + count?: number; + /** Time interval. */ + timeInterval?: string; + /** Request Path */ + path?: string; +} + +export function statusCodesBasedTriggerDeserializer(item: any): StatusCodesBasedTrigger { + return { + status: item["status"], + subStatus: item["subStatus"], + win32Status: item["win32Status"], + count: item["count"], + timeInterval: item["timeInterval"], + path: item["path"], + }; +} + +/** Trigger based on request execution time. */ +export interface SlowRequestsBasedTrigger { + /** Time taken. */ + timeTaken?: string; + /** Request Path. */ + path?: string; + /** Request Count. */ + count?: number; + /** Time interval. */ + timeInterval?: string; +} + +export function slowRequestsBasedTriggerDeserializer(item: any): SlowRequestsBasedTrigger { + return { + timeTaken: item["timeTaken"], + path: item["path"], + count: item["count"], + timeInterval: item["timeInterval"], + }; +} + +export function slowRequestsBasedTriggerArrayDeserializer( + result: Array, +): any[] { + return result.map((item) => { + return slowRequestsBasedTriggerDeserializer(item); + }); +} + +export function statusCodesRangeBasedTriggerArrayDeserializer( + result: Array, +): any[] { + return result.map((item) => { + return statusCodesRangeBasedTriggerDeserializer(item); + }); +} + +/** Trigger based on range of status codes. */ +export interface StatusCodesRangeBasedTrigger { + /** HTTP status code. */ + statusCodes?: string; + path?: string; + /** Request Count. */ + count?: number; + /** Time interval. */ + timeInterval?: string; +} + +export function statusCodesRangeBasedTriggerDeserializer(item: any): StatusCodesRangeBasedTrigger { + return { + statusCodes: item["statusCodes"], + path: item["path"], + count: item["count"], + timeInterval: item["timeInterval"], + }; +} + +/** Actions which to take by the auto-heal module when a rule is triggered. */ +export interface AutoHealActions { + /** Predefined action to be taken. */ + actionType?: AutoHealActionType; + /** Custom action to be taken. */ + customAction?: AutoHealCustomAction; + /** + * Minimum time the process must execute + * before taking the action + */ + minProcessExecutionTime?: string; +} + +export function autoHealActionsDeserializer(item: any): AutoHealActions { + return { + actionType: item["actionType"], + customAction: !item["customAction"] + ? item["customAction"] + : autoHealCustomActionDeserializer(item["customAction"]), + minProcessExecutionTime: item["minProcessExecutionTime"], + }; +} + +/** Predefined action to be taken. */ +export type AutoHealActionType = "Recycle" | "LogEvent" | "CustomAction"; + +/** + * Custom action to be executed + * when an auto heal rule is triggered. + */ +export interface AutoHealCustomAction { + /** Executable to be run. */ + exe?: string; + /** Parameters for the executable. */ + parameters?: string; +} + +export function autoHealCustomActionDeserializer(item: any): AutoHealCustomAction { + return { + exe: item["exe"], + parameters: item["parameters"], + }; +} + +/** Cross-Origin Resource Sharing (CORS) settings for the app. */ +export interface CorsSettings { + /** + * Gets or sets the list of origins that should be allowed to make cross-origin + * calls (for example: http://example.com:12345). Use "*" to allow all. + */ + allowedOrigins?: string[]; + /** + * Gets or sets whether CORS requests with credentials are allowed. See + * https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS#Requests_with_credentials + * for more details. + */ + supportCredentials?: boolean; +} + +export function corsSettingsDeserializer(item: any): CorsSettings { + return { + allowedOrigins: !item["allowedOrigins"] + ? item["allowedOrigins"] + : item["allowedOrigins"].map((p: any) => { + return p; + }), + supportCredentials: item["supportCredentials"], + }; +} + +/** Push settings for the App. */ +export interface PushSettings extends ProxyOnlyResource { + /** Gets or sets a flag indicating whether the Push endpoint is enabled. */ + isPushEnabled?: boolean; + /** Gets or sets a JSON string containing a list of tags that are whitelisted for use by the push registration endpoint. */ + tagWhitelistJson?: string; + /** + * Gets or sets a JSON string containing a list of tags that require user authentication to be used in the push registration endpoint. + * Tags can consist of alphanumeric characters and the following: + * '_', '@', '#', '.', ':', '-'. + * Validation should be performed at the PushRequestHandler. + */ + tagsRequiringAuth?: string; + /** Gets or sets a JSON string containing a list of dynamic tags that will be evaluated from user claims in the push registration endpoint. */ + dynamicTagsJson?: string; +} + +export function pushSettingsDeserializer(item: any): PushSettings { + return { + id: item["id"], + name: item["name"], + kind: item["kind"], + type: item["type"], + ...(!item["properties"] + ? item["properties"] + : _pushSettingsPropertiesDeserializer(item["properties"])), + }; +} + +/** PushSettings resource specific properties */ +export interface PushSettingsProperties { + /** Gets or sets a flag indicating whether the Push endpoint is enabled. */ + isPushEnabled: boolean; + /** Gets or sets a JSON string containing a list of tags that are whitelisted for use by the push registration endpoint. */ + tagWhitelistJson?: string; + /** + * Gets or sets a JSON string containing a list of tags that require user authentication to be used in the push registration endpoint. + * Tags can consist of alphanumeric characters and the following: + * '_', '@', '#', '.', ':', '-'. + * Validation should be performed at the PushRequestHandler. + */ + tagsRequiringAuth?: string; + /** Gets or sets a JSON string containing a list of dynamic tags that will be evaluated from user claims in the push registration endpoint. */ + dynamicTagsJson?: string; +} + +export function pushSettingsPropertiesDeserializer(item: any): PushSettingsProperties { + return { + isPushEnabled: item["isPushEnabled"], + tagWhitelistJson: item["tagWhitelistJson"], + tagsRequiringAuth: item["tagsRequiringAuth"], + dynamicTagsJson: item["dynamicTagsJson"], + }; +} + +/** Information about the formal API definition for the app. */ +export interface ApiDefinitionInfo { + /** The URL of the API definition. */ + url?: string; +} + +export function apiDefinitionInfoDeserializer(item: any): ApiDefinitionInfo { + return { + url: item["url"], + }; +} + +/** Azure API management (APIM) configuration linked to the app. */ +export interface ApiManagementConfig { + /** APIM-Api Identifier. */ + id?: string; +} + +export function apiManagementConfigDeserializer(item: any): ApiManagementConfig { + return { + id: item["id"], + }; +} + +export function ipSecurityRestrictionArrayDeserializer( + result: Array, +): any[] { + return result.map((item) => { + return ipSecurityRestrictionDeserializer(item); + }); +} + +/** IP security restriction on an app. */ +export interface IpSecurityRestriction { + /** + * IP address the security restriction is valid for. + * It can be in form of pure ipv4 address (required SubnetMask property) or + * CIDR notation such as ipv4/mask (leading bit match). For CIDR, + * SubnetMask property must not be specified. + */ + ipAddress?: string; + /** Subnet mask for the range of IP addresses the restriction is valid for. */ + subnetMask?: string; + /** Virtual network resource id */ + vnetSubnetResourceId?: string; + /** (internal) Vnet traffic tag */ + vnetTrafficTag?: number; + /** (internal) Subnet traffic tag */ + subnetTrafficTag?: number; + /** Allow or Deny access for this IP range. */ + action?: string; + /** Defines what this IP filter will be used for. This is to support IP filtering on proxies. */ + tag?: IpFilterTag; + /** Priority of IP restriction rule. */ + priority?: number; + /** IP restriction rule name. */ + name?: string; + /** IP restriction rule description. */ + description?: string; + /** + * IP restriction rule headers. + * X-Forwarded-Host (https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Forwarded-Host#Examples). + * The matching logic is .. + * - If the property is null or empty (default), all hosts(or lack of) are allowed. + * - A value is compared using ordinal-ignore-case (excluding port number). + * - Subdomain wildcards are permitted but don't match the root domain. For example, *.contoso.com matches the subdomain foo.contoso.com + * but not the root domain contoso.com or multi-level foo.bar.contoso.com + * - Unicode host names are allowed but are converted to Punycode for matching. + * + * X-Forwarded-For (https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Forwarded-For#Examples). + * The matching logic is .. + * - If the property is null or empty (default), any forwarded-for chains (or lack of) are allowed. + * - If any address (excluding port number) in the chain (comma separated) matches the CIDR defined by the property. + * + * X-Azure-FDID and X-FD-HealthProbe. + * The matching logic is exact match. + */ + headers?: Record; +} + +export function ipSecurityRestrictionDeserializer(item: any): IpSecurityRestriction { + return { + ipAddress: item["ipAddress"], + subnetMask: item["subnetMask"], + vnetSubnetResourceId: item["vnetSubnetResourceId"], + vnetTrafficTag: item["vnetTrafficTag"], + subnetTrafficTag: item["subnetTrafficTag"], + action: item["action"], + tag: item["tag"], + priority: item["priority"], + name: item["name"], + description: item["description"], + headers: !item["headers"] + ? item["headers"] + : Object.fromEntries( + Object.entries(item["headers"]).map(([k, p]: [string, any]) => [ + k, + p.map((p1: any) => { + return p1; + }), + ]), + ), + }; +} + +/** Defines what this IP filter will be used for. This is to support IP filtering on proxies. */ +export enum KnownIpFilterTag { + /** Default */ + Default = "Default", + /** XffProxy */ + XffProxy = "XffProxy", + /** ServiceTag */ + ServiceTag = "ServiceTag", +} + +/** + * Defines what this IP filter will be used for. This is to support IP filtering on proxies. \ + * {@link KnownIpFilterTag} can be used interchangeably with IpFilterTag, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Default** \ + * **XffProxy** \ + * **ServiceTag** + */ +export type IpFilterTag = string; + +/** Default action for main access restriction if no rules are matched. */ +export enum KnownDefaultAction { + /** Allow */ + Allow = "Allow", + /** Deny */ + Deny = "Deny", +} + +/** + * Default action for main access restriction if no rules are matched. \ + * {@link KnownDefaultAction} can be used interchangeably with DefaultAction, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Allow** \ + * **Deny** + */ +export type DefaultAction = string; + +/** MinTlsVersion: configures the minimum version of TLS required for SSL requests */ +export enum KnownSupportedTlsVersions { + /** 1.0 */ + One0 = "1.0", + /** 1.1 */ + One1 = "1.1", + /** 1.2 */ + One2 = "1.2", + /** 1.3 */ + One3 = "1.3", +} + +/** + * MinTlsVersion: configures the minimum version of TLS required for SSL requests \ + * {@link KnownSupportedTlsVersions} can be used interchangeably with SupportedTlsVersions, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **1.0** \ + * **1.1** \ + * **1.2** \ + * **1.3** + */ +export type SupportedTlsVersions = string; + +/** The minimum strength TLS cipher suite allowed for an application */ +export enum KnownTlsCipherSuites { + /** TLS_AES_256_GCM_SHA384 */ + TLSAES256GCMSHA384 = "TLS_AES_256_GCM_SHA384", + /** TLS_AES_128_GCM_SHA256 */ + TLSAES128GCMSHA256 = "TLS_AES_128_GCM_SHA256", + /** TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384 */ + TLSEcdheEcdsaWithAES256GCMSHA384 = "TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384", + /** TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256 */ + TLSEcdheEcdsaWithAES128CBCSHA256 = "TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256", + /** TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 */ + TLSEcdheEcdsaWithAES128GCMSHA256 = "TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256", + /** TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 */ + TLSEcdheRSAWithAES256GCMSHA384 = "TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384", + /** TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 */ + TLSEcdheRSAWithAES128GCMSHA256 = "TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256", + /** TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384 */ + TLSEcdheRSAWithAES256CBCSHA384 = "TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384", + /** TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256 */ + TLSEcdheRSAWithAES128CBCSHA256 = "TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256", + /** TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA */ + TLSEcdheRSAWithAES256CBCSHA = "TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA", + /** TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA */ + TLSEcdheRSAWithAES128CBCSHA = "TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA", + /** TLS_RSA_WITH_AES_256_GCM_SHA384 */ + TLSRSAWithAES256GCMSHA384 = "TLS_RSA_WITH_AES_256_GCM_SHA384", + /** TLS_RSA_WITH_AES_128_GCM_SHA256 */ + TLSRSAWithAES128GCMSHA256 = "TLS_RSA_WITH_AES_128_GCM_SHA256", + /** TLS_RSA_WITH_AES_256_CBC_SHA256 */ + TLSRSAWithAES256CBCSHA256 = "TLS_RSA_WITH_AES_256_CBC_SHA256", + /** TLS_RSA_WITH_AES_128_CBC_SHA256 */ + TLSRSAWithAES128CBCSHA256 = "TLS_RSA_WITH_AES_128_CBC_SHA256", + /** TLS_RSA_WITH_AES_256_CBC_SHA */ + TLSRSAWithAES256CBCSHA = "TLS_RSA_WITH_AES_256_CBC_SHA", + /** TLS_RSA_WITH_AES_128_CBC_SHA */ + TLSRSAWithAES128CBCSHA = "TLS_RSA_WITH_AES_128_CBC_SHA", +} + +/** + * The minimum strength TLS cipher suite allowed for an application \ + * {@link KnownTlsCipherSuites} can be used interchangeably with TlsCipherSuites, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **TLS_AES_256_GCM_SHA384** \ + * **TLS_AES_128_GCM_SHA256** \ + * **TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384** \ + * **TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256** \ + * **TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256** \ + * **TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384** \ + * **TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256** \ + * **TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384** \ + * **TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256** \ + * **TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA** \ + * **TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA** \ + * **TLS_RSA_WITH_AES_256_GCM_SHA384** \ + * **TLS_RSA_WITH_AES_128_GCM_SHA256** \ + * **TLS_RSA_WITH_AES_256_CBC_SHA256** \ + * **TLS_RSA_WITH_AES_128_CBC_SHA256** \ + * **TLS_RSA_WITH_AES_256_CBC_SHA** \ + * **TLS_RSA_WITH_AES_128_CBC_SHA** + */ +export type TlsCipherSuites = string; + +/** State of FTP / FTPS service */ +export enum KnownFtpsState { + /** AllAllowed */ + AllAllowed = "AllAllowed", + /** FtpsOnly */ + FtpsOnly = "FtpsOnly", + /** Disabled */ + Disabled = "Disabled", +} + +/** + * State of FTP / FTPS service \ + * {@link KnownFtpsState} can be used interchangeably with FtpsState, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **AllAllowed** \ + * **FtpsOnly** \ + * **Disabled** + */ +export type FtpsState = string; + +export function azureStorageInfoValueRecordDeserializer( + item: Record, +): Record { + const result: Record = {}; + Object.keys(item).map((key) => { + result[key] = !item[key] ? item[key] : azureStorageInfoValueDeserializer(item[key]); + }); + return result; +} + +/** Azure Files or Blob Storage access information value for dictionary storage. */ +export interface AzureStorageInfoValue { + /** Type of storage. */ + type?: AzureStorageType; + /** Name of the storage account. */ + accountName?: string; + /** Name of the file share (container name, for Blob storage). */ + shareName?: string; + /** Access key for the storage account. */ + accessKey?: string; + /** Path to mount the storage within the site's runtime environment. */ + mountPath?: string; + /** State of the storage account. */ + readonly state?: AzureStorageState; + /** Mounting protocol to use for the storage account. */ + protocol?: AzureStorageProtocol; +} + +export function azureStorageInfoValueDeserializer(item: any): AzureStorageInfoValue { + return { + type: item["type"], + accountName: item["accountName"], + shareName: item["shareName"], + accessKey: item["accessKey"], + mountPath: item["mountPath"], + state: item["state"], + protocol: item["protocol"], + }; +} + +/** Type of storage. */ +export type AzureStorageType = "AzureFiles" | "AzureBlob"; +/** State of the storage account. */ +export type AzureStorageState = "Ok" | "InvalidCredentials" | "InvalidShare" | "NotValidated"; + +/** Mounting protocol to use for the storage account. */ +export enum KnownAzureStorageProtocol { + /** Smb */ + Smb = "Smb", + /** Http */ + Http = "Http", + /** Nfs */ + Nfs = "Nfs", +} + +/** + * Mounting protocol to use for the storage account. \ + * {@link KnownAzureStorageProtocol} can be used interchangeably with AzureStorageProtocol, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Smb** \ + * **Http** \ + * **Nfs** + */ +export type AzureStorageProtocol = string; + +/** Function app configuration. */ +export interface FunctionAppConfig { + /** Function app deployment configuration. */ + deployment?: FunctionsDeployment; + /** Function app runtime settings. */ + runtime?: FunctionsRuntime; + /** Function app scale and concurrency settings. */ + scaleAndConcurrency?: FunctionsScaleAndConcurrency; + /** Function app site update strategy configuration. */ + siteUpdateStrategy?: FunctionsSiteUpdateStrategy; +} + +export function functionAppConfigDeserializer(item: any): FunctionAppConfig { + return { + deployment: !item["deployment"] + ? item["deployment"] + : functionsDeploymentDeserializer(item["deployment"]), + runtime: !item["runtime"] ? item["runtime"] : functionsRuntimeDeserializer(item["runtime"]), + scaleAndConcurrency: !item["scaleAndConcurrency"] + ? item["scaleAndConcurrency"] + : functionsScaleAndConcurrencyDeserializer(item["scaleAndConcurrency"]), + siteUpdateStrategy: !item["siteUpdateStrategy"] + ? item["siteUpdateStrategy"] + : functionsSiteUpdateStrategyDeserializer(item["siteUpdateStrategy"]), + }; +} + +/** Configuration section for the function app deployment. */ +export interface FunctionsDeployment { + /** Storage for deployed package used by the function app. */ + storage?: FunctionsDeploymentStorage; +} + +export function functionsDeploymentDeserializer(item: any): FunctionsDeployment { + return { + storage: !item["storage"] + ? item["storage"] + : functionsDeploymentStorageDeserializer(item["storage"]), + }; +} + +/** Storage for deployed package used by the function app. */ +export interface FunctionsDeploymentStorage { + /** Property to select Azure Storage type. Available options: blobContainer. */ + type?: FunctionsDeploymentStorageType; + /** Property to set the URL for the selected Azure Storage type. Example: For blobContainer, the value could be https://.blob.core.windows.net/. */ + value?: string; + /** Authentication method to access the storage account for deployment. */ + authentication?: FunctionsDeploymentStorageAuthentication; +} + +export function functionsDeploymentStorageDeserializer(item: any): FunctionsDeploymentStorage { + return { + type: item["type"], + value: item["value"], + authentication: !item["authentication"] + ? item["authentication"] + : functionsDeploymentStorageAuthenticationDeserializer(item["authentication"]), + }; +} + +/** Property to select Azure Storage type. Available options: blobContainer. */ +export enum KnownFunctionsDeploymentStorageType { + /** blobContainer */ + BlobContainer = "blobContainer", +} + +/** + * Property to select Azure Storage type. Available options: blobContainer. \ + * {@link KnownFunctionsDeploymentStorageType} can be used interchangeably with FunctionsDeploymentStorageType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **blobContainer** + */ +export type FunctionsDeploymentStorageType = string; + +/** Authentication method to access the storage account for deployment. */ +export interface FunctionsDeploymentStorageAuthentication { + /** Property to select authentication type to access the selected storage account. Available options: SystemAssignedIdentity, UserAssignedIdentity, StorageAccountConnectionString. */ + type?: AuthenticationType; + /** Use this property for UserAssignedIdentity. Set the resource ID of the identity. Do not set a value for this property when using other authentication type. */ + userAssignedIdentityResourceId?: string; + /** Use this property for StorageAccountConnectionString. Set the name of the app setting that has the storage account connection string. Do not set a value for this property when using other authentication type. */ + storageAccountConnectionStringName?: string; +} + +export function functionsDeploymentStorageAuthenticationDeserializer( + item: any, +): FunctionsDeploymentStorageAuthentication { + return { + type: item["type"], + userAssignedIdentityResourceId: item["userAssignedIdentityResourceId"], + storageAccountConnectionStringName: item["storageAccountConnectionStringName"], + }; +} + +/** Property to select authentication type to access the selected storage account. Available options: SystemAssignedIdentity, UserAssignedIdentity, StorageAccountConnectionString. */ +export enum KnownAuthenticationType { + /** SystemAssignedIdentity */ + SystemAssignedIdentity = "SystemAssignedIdentity", + /** UserAssignedIdentity */ + UserAssignedIdentity = "UserAssignedIdentity", + /** StorageAccountConnectionString */ + StorageAccountConnectionString = "StorageAccountConnectionString", +} + +/** + * Property to select authentication type to access the selected storage account. Available options: SystemAssignedIdentity, UserAssignedIdentity, StorageAccountConnectionString. \ + * {@link KnownAuthenticationType} can be used interchangeably with AuthenticationType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **SystemAssignedIdentity** \ + * **UserAssignedIdentity** \ + * **StorageAccountConnectionString** + */ +export type AuthenticationType = string; + +/** Function app runtime name and version. */ +export interface FunctionsRuntime { + /** Function app runtime name. Available options: dotnet-isolated, node, java, powershell, python, custom */ + name?: RuntimeName; + /** Function app runtime version. Example: 8 (for dotnet-isolated) */ + version?: string | null; +} + +export function functionsRuntimeDeserializer(item: any): FunctionsRuntime { + return { + name: item["name"], + version: item["version"], + }; +} + +/** Function app runtime name. Available options: dotnet-isolated, node, java, powershell, python, custom */ +export enum KnownRuntimeName { + /** dotnet-isolated */ + DotnetIsolated = "dotnet-isolated", + /** node */ + Node = "node", + /** java */ + Java = "java", + /** powershell */ + Powershell = "powershell", + /** python */ + Python = "python", + /** custom */ + Custom = "custom", +} + +/** + * Function app runtime name. Available options: dotnet-isolated, node, java, powershell, python, custom \ + * {@link KnownRuntimeName} can be used interchangeably with RuntimeName, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **dotnet-isolated** \ + * **node** \ + * **java** \ + * **powershell** \ + * **python** \ + * **custom** + */ +export type RuntimeName = string; + +/** Scale and concurrency settings for the function app. */ +export interface FunctionsScaleAndConcurrency { + /** 'Always Ready' configuration for the function app. */ + alwaysReady?: FunctionsAlwaysReadyConfig[]; + /** The maximum number of instances for the function app. */ + maximumInstanceCount?: number; + /** Set the amount of memory allocated to each instance of the function app in MB. CPU and network bandwidth are allocated proportionally. */ + instanceMemoryMB?: number; + /** Scale and concurrency settings for the function app triggers. */ + triggers?: FunctionsScaleAndConcurrencyTriggers; +} + +export function functionsScaleAndConcurrencyDeserializer(item: any): FunctionsScaleAndConcurrency { + return { + alwaysReady: !item["alwaysReady"] + ? item["alwaysReady"] + : functionsAlwaysReadyConfigArrayDeserializer(item["alwaysReady"]), + maximumInstanceCount: item["maximumInstanceCount"], + instanceMemoryMB: item["instanceMemoryMB"], + triggers: !item["triggers"] + ? item["triggers"] + : functionsScaleAndConcurrencyTriggersDeserializer(item["triggers"]), + }; +} + +export function functionsAlwaysReadyConfigArrayDeserializer( + result: Array, +): any[] { + return result.map((item) => { + return functionsAlwaysReadyConfigDeserializer(item); + }); +} + +/** Sets the number of 'Always Ready' instances for a function group or a specific function. */ +export interface FunctionsAlwaysReadyConfig { + /** Either a function group or a function name is required. For additional information see https://aka.ms/flexconsumption/alwaysready. */ + name?: string; + /** Sets the number of 'Always Ready' instances for a given function group or a specific function. For additional information see https://aka.ms/flexconsumption/alwaysready. */ + instanceCount?: number; +} + +export function functionsAlwaysReadyConfigDeserializer(item: any): FunctionsAlwaysReadyConfig { + return { + name: item["name"], + instanceCount: item["instanceCount"], + }; +} + +/** Scale and concurrency settings for the function app triggers. */ +export interface FunctionsScaleAndConcurrencyTriggers { + /** Scale and concurrency settings for the HTTP trigger. */ + http?: FunctionsScaleAndConcurrencyTriggersHttp; +} + +export function functionsScaleAndConcurrencyTriggersDeserializer( + item: any, +): FunctionsScaleAndConcurrencyTriggers { + return { + http: !item["http"] + ? item["http"] + : functionsScaleAndConcurrencyTriggersHttpDeserializer(item["http"]), + }; +} + +/** Scale and concurrency settings for the HTTP trigger. */ +export interface FunctionsScaleAndConcurrencyTriggersHttp { + /** The maximum number of concurrent HTTP trigger invocations per instance. */ + perInstanceConcurrency?: number; +} + +export function functionsScaleAndConcurrencyTriggersHttpDeserializer( + item: any, +): FunctionsScaleAndConcurrencyTriggersHttp { + return { + perInstanceConcurrency: item["perInstanceConcurrency"], + }; +} + +/** Function app site update strategy configuration for deployments and site config updates. */ +export interface FunctionsSiteUpdateStrategy { + /** Function app site update strategy type. Available options: Recreate, RollingUpdate */ + type?: SiteUpdateStrategyType; +} + +export function functionsSiteUpdateStrategyDeserializer(item: any): FunctionsSiteUpdateStrategy { + return { + type: item["type"], + }; +} + +/** Function app site update strategy type. Available options: Recreate, RollingUpdate */ +export enum KnownSiteUpdateStrategyType { + /** + * If the app is under load and a deployment or site state update occurs, all pods will be removed + * and will need to be Recreated all at once. This is the default behavior. + */ + Recreate = "Recreate", + /** + * If the app is under load and a deployment or site state update occurs, pods will be drained in + * batches and gradually replaced, thus minimizing impact to throughput. + */ + RollingUpdate = "RollingUpdate", +} + +/** + * Function app site update strategy type. Available options: Recreate, RollingUpdate \ + * {@link KnownSiteUpdateStrategyType} can be used interchangeably with SiteUpdateStrategyType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Recreate**: If the app is under load and a deployment or site state update occurs, all pods will be removed + * and will need to be Recreated all at once. This is the default behavior. \ + * **RollingUpdate**: If the app is under load and a deployment or site state update occurs, pods will be drained in + * batches and gradually replaced, thus minimizing impact to throughput. + */ +export type SiteUpdateStrategyType = string; + +/** App Dapr configuration. */ +export interface DaprConfig { + /** Boolean indicating if the Dapr side car is enabled */ + enabled?: boolean; + /** Dapr application identifier */ + appId?: string; + /** Tells Dapr which port your application is listening on */ + appPort?: number; + /** Dapr max size of http header read buffer in KB to handle when sending multi-KB headers. Default is 65KB. */ + httpReadBufferSize?: number; + /** Increasing max size of request body http servers parameter in MB to handle uploading of big files. Default is 4 MB. */ + httpMaxRequestSize?: number; + /** Sets the log level for the Dapr sidecar. Allowed values are debug, info, warn, error. Default is info. */ + logLevel?: DaprLogLevel; + /** Enables API logging for the Dapr sidecar */ + enableApiLogging?: boolean; +} + +export function daprConfigDeserializer(item: any): DaprConfig { + return { + enabled: item["enabled"], + appId: item["appId"], + appPort: item["appPort"], + httpReadBufferSize: item["httpReadBufferSize"], + httpMaxRequestSize: item["httpMaxRequestSize"], + logLevel: item["logLevel"], + enableApiLogging: item["enableApiLogging"], + }; +} + +/** Sets the log level for the Dapr sidecar. Allowed values are debug, info, warn, error. Default is info. */ +export enum KnownDaprLogLevel { + /** info */ + Info = "info", + /** debug */ + Debug = "debug", + /** warn */ + Warn = "warn", + /** error */ + Error = "error", +} + +/** + * Sets the log level for the Dapr sidecar. Allowed values are debug, info, warn, error. Default is info. \ + * {@link KnownDaprLogLevel} can be used interchangeably with DaprLogLevel, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **info** \ + * **debug** \ + * **warn** \ + * **error** + */ +export type DaprLogLevel = string; + +/** Function app resource requirements. */ +export interface ResourceConfig { + /** Required CPU in cores, e.g. 0.5 */ + cpu?: number; + /** Required memory, e.g. "1Gi" */ + memory?: string; +} + +export function resourceConfigDeserializer(item: any): ResourceConfig { + return { + cpu: item["cpu"], + memory: item["memory"], + }; +} + +/** Specification for an App Service Environment to use for this resource. */ +export interface HostingEnvironmentProfile { + /** Resource ID of the App Service Environment. */ + id?: string; + /** Name of the App Service Environment. */ + readonly name?: string; + /** Resource type of the App Service Environment. */ + readonly type?: string; +} + +export function hostingEnvironmentProfileDeserializer(item: any): HostingEnvironmentProfile { + return { + id: item["id"], + name: item["name"], + type: item["type"], + }; +} + +/** + * This composes with ClientCertEnabled setting. + * - ClientCertEnabled: false means ClientCert is ignored. + * - ClientCertEnabled: true and ClientCertMode: Required means ClientCert is required. + * - ClientCertEnabled: true and ClientCertMode: Optional means ClientCert is optional or accepted. + */ +export type ClientCertMode = "Required" | "Optional" | "OptionalInteractiveUser"; +/** Specifies the IP mode of the app. */ +export type IPMode = "IPv4" | "IPv6" | "IPv4AndIPv6"; + +/** Information needed for cloning operation. */ +export interface CloningInfo { + /** + * Correlation ID of cloning operation. This ID ties multiple cloning operations + * together to use the same snapshot. + */ + correlationId?: string; + /** true to overwrite destination app; otherwise, false. */ + overwrite?: boolean; + /** true to clone custom hostnames from source app; otherwise, false. */ + cloneCustomHostNames?: boolean; + /** true to clone source control from source app; otherwise, false. */ + cloneSourceControl?: boolean; + /** + * ARM resource ID of the source app. App resource ID is of the form + * /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName} for production slots and + * /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/slots/{slotName} for other slots. + */ + sourceWebAppId: string; + /** Location of source app ex: West US or North Europe */ + sourceWebAppLocation?: string; + /** App Service Environment. */ + hostingEnvironment?: string; + /** + * Application setting overrides for cloned app. If specified, these settings override the settings cloned + * from source app. Otherwise, application settings from source app are retained. + */ + appSettingsOverrides?: Record; + /** true to configure load balancing for source and destination app. */ + configureLoadBalancing?: boolean; + /** + * ARM resource ID of the Traffic Manager profile to use, if it exists. Traffic Manager resource ID is of the form + * /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/trafficManagerProfiles/{profileName}. + */ + trafficManagerProfileId?: string; + /** Name of Traffic Manager profile to create. This is only needed if Traffic Manager profile does not already exist. */ + trafficManagerProfileName?: string; +} + +export function cloningInfoDeserializer(item: any): CloningInfo { + return { + correlationId: item["correlationId"], + overwrite: item["overwrite"], + cloneCustomHostNames: item["cloneCustomHostNames"], + cloneSourceControl: item["cloneSourceControl"], + sourceWebAppId: item["sourceWebAppId"], + sourceWebAppLocation: item["sourceWebAppLocation"], + hostingEnvironment: item["hostingEnvironment"], + appSettingsOverrides: !item["appSettingsOverrides"] + ? item["appSettingsOverrides"] + : Object.fromEntries( + Object.entries(item["appSettingsOverrides"]).map(([k, p]: [string, any]) => [k, p]), + ), + configureLoadBalancing: item["configureLoadBalancing"], + trafficManagerProfileId: item["trafficManagerProfileId"], + trafficManagerProfileName: item["trafficManagerProfileName"], + }; +} + +/** The status of the last successful slot swap operation. */ +export interface SlotSwapStatus { + /** The time the last successful slot swap completed. */ + readonly timestampUtc?: Date; + /** The source slot of the last swap operation. */ + readonly sourceSlotName?: string; + /** The destination slot of the last swap operation. */ + readonly destinationSlotName?: string; +} + +export function slotSwapStatusDeserializer(item: any): SlotSwapStatus { + return { + timestampUtc: !item["timestampUtc"] ? item["timestampUtc"] : new Date(item["timestampUtc"]), + sourceSlotName: item["sourceSlotName"], + destinationSlotName: item["destinationSlotName"], + }; +} + +/** Site redundancy mode */ +export type RedundancyMode = "None" | "Manual" | "Failover" | "ActiveActive" | "GeoRedundant"; +/** Specifies the scope of uniqueness for the default hostname during resource creation */ +export type AutoGeneratedDomainNameLabelScope = + | "TenantReuse" + | "SubscriptionReuse" + | "ResourceGroupReuse" + | "NoReuse"; + +/** Managed service identity. */ +export interface ManagedServiceIdentity { + /** Type of managed service identity. */ + type?: ManagedServiceIdentityType; + /** Tenant of managed service identity. */ + readonly tenantId?: string; + /** Principal Id of managed service identity. */ + readonly principalId?: string; + /** The list of user assigned identities associated with the resource. The user identity dictionary key references will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName} */ + userAssignedIdentities?: Record; +} + +export function managedServiceIdentityDeserializer(item: any): ManagedServiceIdentity { + return { + type: item["type"], + tenantId: item["tenantId"], + principalId: item["principalId"], + userAssignedIdentities: !item["userAssignedIdentities"] + ? item["userAssignedIdentities"] + : userAssignedIdentityRecordDeserializer(item["userAssignedIdentities"]), + }; +} + +/** Type of managed service identity. */ +export type ManagedServiceIdentityType = + | "SystemAssigned" + | "UserAssigned" + | "SystemAssigned, UserAssigned" + | "None"; + +export function userAssignedIdentityRecordDeserializer( + item: Record, +): Record { + const result: Record = {}; + Object.keys(item).map((key) => { + result[key] = !item[key] ? item[key] : userAssignedIdentityDeserializer(item[key]); + }); + return result; +} + +/** User Assigned identity. */ +export interface UserAssignedIdentity { + /** Principal Id of user assigned identity */ + readonly principalId?: string; + /** Client Id of user assigned identity */ + readonly clientId?: string; +} + +export function userAssignedIdentityDeserializer(item: any): UserAssignedIdentity { + return { + principalId: item["principalId"], + clientId: item["clientId"], + }; +} + +/** Extended Location. */ +export interface ExtendedLocation { + /** Name of extended location. */ + name?: string; + /** Type of extended location. */ + readonly type?: string; +} + +export function extendedLocationDeserializer(item: any): ExtendedLocation { + return { + name: item["name"], + type: item["type"], + }; +} + +/** Metadata pertaining to creation and last modification of the resource. */ +export interface SystemData { + /** The identity that created the resource. */ + createdBy?: string; + /** The type of identity that created the resource. */ + createdByType?: CreatedByType; + /** The timestamp of resource creation (UTC). */ + createdAt?: Date; + /** The identity that last modified the resource. */ + lastModifiedBy?: string; + /** The type of identity that last modified the resource. */ + lastModifiedByType?: CreatedByType; + /** The timestamp of resource last modification (UTC) */ + lastModifiedAt?: Date; +} + +export function systemDataDeserializer(item: any): SystemData { + return { + createdBy: item["createdBy"], + createdByType: item["createdByType"], + createdAt: !item["createdAt"] ? item["createdAt"] : new Date(item["createdAt"]), + lastModifiedBy: item["lastModifiedBy"], + lastModifiedByType: item["lastModifiedByType"], + lastModifiedAt: !item["lastModifiedAt"] + ? item["lastModifiedAt"] + : new Date(item["lastModifiedAt"]), + }; +} + +/** The kind of entity that created the resource. */ +export enum KnownCreatedByType { + /** The entity was created by a user. */ + User = "User", + /** The entity was created by an application. */ + Application = "Application", + /** The entity was created by a managed identity. */ + ManagedIdentity = "ManagedIdentity", + /** The entity was created by a key. */ + Key = "Key", +} + +/** + * The kind of entity that created the resource. \ + * {@link KnownCreatedByType} can be used interchangeably with CreatedByType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **User**: The entity was created by a user. \ + * **Application**: The entity was created by an application. \ + * **ManagedIdentity**: The entity was created by a managed identity. \ + * **Key**: The entity was created by a key. + */ +export type CreatedByType = string; + +/** Collection of Application Stacks */ +export interface _ApplicationStackCollection { + /** The ApplicationStackResource items on this page */ + value: ApplicationStackResource[]; + /** The link to the next page of items */ + nextLink?: string; +} + +export function _applicationStackCollectionDeserializer(item: any): _ApplicationStackCollection { + return { + value: applicationStackResourceArrayDeserializer(item["value"]), + nextLink: item["nextLink"], + }; +} + +export function applicationStackResourceArrayDeserializer( + result: Array, +): any[] { + return result.map((item) => { + return applicationStackResourceDeserializer(item); + }); +} + +/** ARM resource for a ApplicationStack. */ +export interface ApplicationStackResource extends ProxyOnlyResource { + /** Application stack name. */ + namePropertiesName?: string; + /** Application stack display name. */ + display?: string; + /** Application stack dependency. */ + dependency?: string; + /** List of major versions available. */ + majorVersions?: StackMajorVersion[]; + /** List of frameworks associated with application stack. */ + frameworks?: ApplicationStack[]; + /** true if this is the stack is deprecated; otherwise, false. */ + isDeprecated?: ApplicationStack[]; +} + +export function applicationStackResourceDeserializer(item: any): ApplicationStackResource { + return { + id: item["id"], + name: item["name"], + kind: item["kind"], + type: item["type"], + ...(!item["properties"] + ? item["properties"] + : _applicationStackResourcePropertiesDeserializer(item["properties"])), + }; +} + +/** Application stack. */ +export interface ApplicationStack { + /** Application stack name. */ + name?: string; + /** Application stack display name. */ + display?: string; + /** Application stack dependency. */ + dependency?: string; + /** List of major versions available. */ + majorVersions?: StackMajorVersion[]; + /** List of frameworks associated with application stack. */ + frameworks?: ApplicationStack[]; + /** true if this is the stack is deprecated; otherwise, false. */ + isDeprecated?: ApplicationStack[]; +} + +export function applicationStackDeserializer(item: any): ApplicationStack { + return { + name: item["name"], + display: item["display"], + dependency: item["dependency"], + majorVersions: !item["majorVersions"] + ? item["majorVersions"] + : stackMajorVersionArrayDeserializer(item["majorVersions"]), + frameworks: !item["frameworks"] + ? item["frameworks"] + : applicationStackArrayDeserializer(item["frameworks"]), + isDeprecated: !item["isDeprecated"] + ? item["isDeprecated"] + : applicationStackArrayDeserializer(item["isDeprecated"]), + }; +} + +export function stackMajorVersionArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return stackMajorVersionDeserializer(item); + }); +} + +/** Application stack major version. */ +export interface StackMajorVersion { + /** Application stack major version (display only). */ + displayVersion?: string; + /** Application stack major version (runtime only). */ + runtimeVersion?: string; + /** true if this is the default major version; otherwise, false. */ + isDefault?: boolean; + /** Minor versions associated with the major version. */ + minorVersions?: StackMinorVersion[]; + /** true if this supports Application Insights; otherwise, false. */ + applicationInsights?: boolean; + /** true if this stack is in Preview, otherwise false. */ + isPreview?: boolean; + /** true if this stack has been deprecated, otherwise false. */ + isDeprecated?: boolean; + /** true if this stack should be hidden for new customers on portal, otherwise false. */ + isHidden?: boolean; + /** + * + * + * + * Example: All the function apps need AppSetting: "FUNCTIONS_WORKER_RUNTIME" to be set stack name + */ + appSettingsDictionary?: Record; + /** + * + * + * + * Example: All Linux Function Apps, need Use32BitWorkerProcess to be set to 0 + */ + siteConfigPropertiesDictionary?: Record; +} + +export function stackMajorVersionDeserializer(item: any): StackMajorVersion { + return { + displayVersion: item["displayVersion"], + runtimeVersion: item["runtimeVersion"], + isDefault: item["isDefault"], + minorVersions: !item["minorVersions"] + ? item["minorVersions"] + : stackMinorVersionArrayDeserializer(item["minorVersions"]), + applicationInsights: item["applicationInsights"], + isPreview: item["isPreview"], + isDeprecated: item["isDeprecated"], + isHidden: item["isHidden"], + appSettingsDictionary: !item["appSettingsDictionary"] + ? item["appSettingsDictionary"] + : Object.fromEntries( + Object.entries(item["appSettingsDictionary"]).map(([k, p]: [string, any]) => [k, p]), + ), + siteConfigPropertiesDictionary: !item["siteConfigPropertiesDictionary"] + ? item["siteConfigPropertiesDictionary"] + : Object.fromEntries( + Object.entries(item["siteConfigPropertiesDictionary"]).map(([k, p]: [string, any]) => [ + k, + p, + ]), + ), + }; +} + +export function stackMinorVersionArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return stackMinorVersionDeserializer(item); + }); +} + +/** Application stack minor version. */ +export interface StackMinorVersion { + /** Application stack minor version (display only). */ + displayVersion?: string; + /** Application stack minor version (runtime only). */ + runtimeVersion?: string; + /** true if this is the default minor version; otherwise, false. */ + isDefault?: boolean; + /** true if this supports Remote Debugging, otherwise false. */ + isRemoteDebuggingEnabled?: boolean; +} + +export function stackMinorVersionDeserializer(item: any): StackMinorVersion { + return { + displayVersion: item["displayVersion"], + runtimeVersion: item["runtimeVersion"], + isDefault: item["isDefault"], + isRemoteDebuggingEnabled: item["isRemoteDebuggingEnabled"], + }; +} + +export function applicationStackArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return applicationStackDeserializer(item); + }); +} + +/** Collection of Function app Stacks */ +export interface _FunctionAppStackCollection { + /** The FunctionAppStack items on this page */ + value: FunctionAppStack[]; + /** The link to the next page of items */ + nextLink?: string; +} + +export function _functionAppStackCollectionDeserializer(item: any): _FunctionAppStackCollection { + return { + value: functionAppStackArrayDeserializer(item["value"]), + nextLink: item["nextLink"], + }; +} + +export function functionAppStackArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return functionAppStackDeserializer(item); + }); +} + +/** Function App Stack. */ +export interface FunctionAppStack extends ProxyOnlyResource { + /** Function App stack location. */ + readonly location?: string; + /** Function App stack (display only). */ + readonly displayText?: string; + /** Function App stack name. */ + readonly value?: string; + /** List of major versions available. */ + readonly majorVersions?: FunctionAppMajorVersion[]; + /** Function App stack preferred OS. */ + readonly preferredOs?: StackPreferredOs; +} + +export function functionAppStackDeserializer(item: any): FunctionAppStack { + return { + id: item["id"], + name: item["name"], + kind: item["kind"], + type: item["type"], + location: item["location"], + ...(!item["properties"] + ? item["properties"] + : _functionAppStackPropertiesDeserializer(item["properties"])), + }; +} + +/** FunctionAppStack resource specific properties */ +export interface FunctionAppStackProperties { + /** Function App stack (display only). */ + readonly displayText?: string; + /** Function App stack name. */ + readonly value?: string; + /** List of major versions available. */ + readonly majorVersions?: FunctionAppMajorVersion[]; + /** Function App stack preferred OS. */ + readonly preferredOs?: StackPreferredOs; +} + +export function functionAppStackPropertiesDeserializer(item: any): FunctionAppStackProperties { + return { + displayText: item["displayText"], + value: item["value"], + majorVersions: !item["majorVersions"] + ? item["majorVersions"] + : functionAppMajorVersionArrayDeserializer(item["majorVersions"]), + preferredOs: item["preferredOs"], + }; +} + +export function functionAppMajorVersionArrayDeserializer( + result: Array, +): any[] { + return result.map((item) => { + return functionAppMajorVersionDeserializer(item); + }); +} + +/** Function App stack major version. */ +export interface FunctionAppMajorVersion { + /** Function App stack major version (display only). */ + readonly displayText?: string; + /** Function App stack major version name. */ + readonly value?: string; + /** Minor versions associated with the major version. */ + readonly minorVersions?: FunctionAppMinorVersion[]; +} + +export function functionAppMajorVersionDeserializer(item: any): FunctionAppMajorVersion { + return { + displayText: item["displayText"], + value: item["value"], + minorVersions: !item["minorVersions"] + ? item["minorVersions"] + : functionAppMinorVersionArrayDeserializer(item["minorVersions"]), + }; +} + +export function functionAppMinorVersionArrayDeserializer( + result: Array, +): any[] { + return result.map((item) => { + return functionAppMinorVersionDeserializer(item); + }); +} + +/** Function App stack minor version. */ +export interface FunctionAppMinorVersion { + /** Function App stack (display only). */ + readonly displayText?: string; + /** Function App stack name. */ + readonly value?: string; + /** Settings associated with the minor version. */ + readonly stackSettings?: FunctionAppRuntimes; +} + +export function functionAppMinorVersionDeserializer(item: any): FunctionAppMinorVersion { + return { + displayText: item["displayText"], + value: item["value"], + stackSettings: !item["stackSettings"] + ? item["stackSettings"] + : functionAppRuntimesDeserializer(item["stackSettings"]), + }; +} + +/** Function App stack runtimes. */ +export interface FunctionAppRuntimes { + /** Linux-specific settings associated with the minor version. */ + readonly linuxRuntimeSettings?: FunctionAppRuntimeSettings; + /** Windows-specific settings associated with the minor version. */ + readonly windowsRuntimeSettings?: FunctionAppRuntimeSettings; +} + +export function functionAppRuntimesDeserializer(item: any): FunctionAppRuntimes { + return { + linuxRuntimeSettings: !item["linuxRuntimeSettings"] + ? item["linuxRuntimeSettings"] + : functionAppRuntimeSettingsDeserializer(item["linuxRuntimeSettings"]), + windowsRuntimeSettings: !item["windowsRuntimeSettings"] + ? item["windowsRuntimeSettings"] + : functionAppRuntimeSettingsDeserializer(item["windowsRuntimeSettings"]), + }; +} + +/** Function App runtime settings. */ +export interface FunctionAppRuntimeSettings { + /** Function App stack minor version (runtime only). */ + readonly runtimeVersion?: string; + /** true if remote debugging is supported for the stack; otherwise, false. */ + readonly remoteDebuggingSupported?: boolean; + /** Application Insights settings associated with the minor version. */ + readonly appInsightsSettings?: AppInsightsWebAppStackSettings; + /** GitHub Actions settings associated with the minor version. */ + readonly gitHubActionSettings?: GitHubActionWebAppStackSettings; + /** Application settings associated with the minor version. */ + readonly appSettingsDictionary?: Record; + /** Configuration settings associated with the minor version. */ + readonly siteConfigPropertiesDictionary?: SiteConfigPropertiesDictionary; + /** List of supported Functions extension versions. */ + readonly supportedFunctionsExtensionVersions?: string[]; + /** true if the stack is in preview; otherwise, false. */ + readonly isPreview?: boolean; + /** true if the stack is deprecated; otherwise, false. */ + readonly isDeprecated?: boolean; + /** true if the stack should be hidden; otherwise, false. */ + readonly isHidden?: boolean; + /** End-of-life date for the minor version. */ + readonly endOfLifeDate?: Date; + /** true if the stack version is auto-updated; otherwise, false. */ + readonly isAutoUpdate?: boolean; + /** true if the minor version is early-access; otherwise, false. */ + readonly isEarlyAccess?: boolean; + /** true if the minor version the default; otherwise, false. */ + readonly isDefault?: boolean; +} + +export function functionAppRuntimeSettingsDeserializer(item: any): FunctionAppRuntimeSettings { + return { + runtimeVersion: item["runtimeVersion"], + remoteDebuggingSupported: item["remoteDebuggingSupported"], + appInsightsSettings: !item["appInsightsSettings"] + ? item["appInsightsSettings"] + : appInsightsWebAppStackSettingsDeserializer(item["appInsightsSettings"]), + gitHubActionSettings: !item["gitHubActionSettings"] + ? item["gitHubActionSettings"] + : gitHubActionWebAppStackSettingsDeserializer(item["gitHubActionSettings"]), + appSettingsDictionary: !item["appSettingsDictionary"] + ? item["appSettingsDictionary"] + : Object.fromEntries( + Object.entries(item["appSettingsDictionary"]).map(([k, p]: [string, any]) => [k, p]), + ), + siteConfigPropertiesDictionary: !item["siteConfigPropertiesDictionary"] + ? item["siteConfigPropertiesDictionary"] + : siteConfigPropertiesDictionaryDeserializer(item["siteConfigPropertiesDictionary"]), + supportedFunctionsExtensionVersions: !item["supportedFunctionsExtensionVersions"] + ? item["supportedFunctionsExtensionVersions"] + : item["supportedFunctionsExtensionVersions"].map((p: any) => { + return p; + }), + isPreview: item["isPreview"], + isDeprecated: item["isDeprecated"], + isHidden: item["isHidden"], + endOfLifeDate: !item["endOfLifeDate"] ? item["endOfLifeDate"] : new Date(item["endOfLifeDate"]), + isAutoUpdate: item["isAutoUpdate"], + isEarlyAccess: item["isEarlyAccess"], + isDefault: item["isDefault"], + }; +} + +/** App Insights Web App stack settings. */ +export interface AppInsightsWebAppStackSettings { + /** true if remote Application Insights is supported for the stack; otherwise, false. */ + readonly isSupported?: boolean; + /** true if Application Insights is disabled by default for the stack; otherwise, false. */ + readonly isDefaultOff?: boolean; +} + +export function appInsightsWebAppStackSettingsDeserializer( + item: any, +): AppInsightsWebAppStackSettings { + return { + isSupported: item["isSupported"], + isDefaultOff: item["isDefaultOff"], + }; +} + +/** GitHub Actions Web App stack settings. */ +export interface GitHubActionWebAppStackSettings { + /** true if GitHub Actions is supported for the stack; otherwise, false. */ + readonly isSupported?: boolean; + /** The minor version that is supported for GitHub Actions. */ + readonly supportedVersion?: string; +} + +export function gitHubActionWebAppStackSettingsDeserializer( + item: any, +): GitHubActionWebAppStackSettings { + return { + isSupported: item["isSupported"], + supportedVersion: item["supportedVersion"], + }; +} + +/** Site config properties dictionary. */ +export interface SiteConfigPropertiesDictionary { + /** true if use32BitWorkerProcess should be set to true for the stack; otherwise, false. */ + readonly use32BitWorkerProcess?: boolean; + /** LinuxFxVersion configuration setting. */ + readonly linuxFxVersion?: string; + /** JavaVersion configuration setting. */ + readonly javaVersion?: string; + /** PowerShellVersion configuration setting. */ + readonly powerShellVersion?: string; +} + +export function siteConfigPropertiesDictionaryDeserializer( + item: any, +): SiteConfigPropertiesDictionary { + return { + use32BitWorkerProcess: item["use32BitWorkerProcess"], + linuxFxVersion: item["linuxFxVersion"], + javaVersion: item["javaVersion"], + powerShellVersion: item["powerShellVersion"], + }; +} + +/** Function App stack preferred OS. */ +export type StackPreferredOs = "Windows" | "Linux"; + +/** Collection of Web app Stacks */ +export interface _WebAppStackCollection { + /** The WebAppStack items on this page */ + value: WebAppStack[]; + /** The link to the next page of items */ + nextLink?: string; +} + +export function _webAppStackCollectionDeserializer(item: any): _WebAppStackCollection { + return { + value: webAppStackArrayDeserializer(item["value"]), + nextLink: item["nextLink"], + }; +} + +export function webAppStackArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return webAppStackDeserializer(item); + }); +} + +/** Web App stack. */ +export interface WebAppStack extends ProxyOnlyResource { + /** Web App stack location. */ + readonly location?: string; + /** Web App stack (display only). */ + readonly displayText?: string; + /** Web App stack name. */ + readonly value?: string; + /** List of major versions available. */ + readonly majorVersions?: WebAppMajorVersion[]; + /** Web App stack preferred OS. */ + readonly preferredOs?: StackPreferredOs; +} + +export function webAppStackDeserializer(item: any): WebAppStack { + return { + id: item["id"], + name: item["name"], + kind: item["kind"], + type: item["type"], + location: item["location"], + ...(!item["properties"] + ? item["properties"] + : _webAppStackPropertiesDeserializer(item["properties"])), + }; +} + +/** WebAppStack resource specific properties */ +export interface WebAppStackProperties { + /** Web App stack (display only). */ + readonly displayText?: string; + /** Web App stack name. */ + readonly value?: string; + /** List of major versions available. */ + readonly majorVersions?: WebAppMajorVersion[]; + /** Web App stack preferred OS. */ + readonly preferredOs?: StackPreferredOs; +} + +export function webAppStackPropertiesDeserializer(item: any): WebAppStackProperties { + return { + displayText: item["displayText"], + value: item["value"], + majorVersions: !item["majorVersions"] + ? item["majorVersions"] + : webAppMajorVersionArrayDeserializer(item["majorVersions"]), + preferredOs: item["preferredOs"], + }; +} + +export function webAppMajorVersionArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return webAppMajorVersionDeserializer(item); + }); +} + +/** Web App stack major version. */ +export interface WebAppMajorVersion { + /** Web App stack major version (display only). */ + readonly displayText?: string; + /** Web App stack major version name. */ + readonly value?: string; + /** Minor versions associated with the major version. */ + readonly minorVersions?: WebAppMinorVersion[]; +} + +export function webAppMajorVersionDeserializer(item: any): WebAppMajorVersion { + return { + displayText: item["displayText"], + value: item["value"], + minorVersions: !item["minorVersions"] + ? item["minorVersions"] + : webAppMinorVersionArrayDeserializer(item["minorVersions"]), + }; +} + +export function webAppMinorVersionArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return webAppMinorVersionDeserializer(item); + }); +} + +/** Web App stack minor version. */ +export interface WebAppMinorVersion { + /** Web App stack minor version (display only). */ + readonly displayText?: string; + /** Web App stack major version name. */ + readonly value?: string; + /** Settings associated with the minor version. */ + readonly stackSettings?: WebAppRuntimes; +} + +export function webAppMinorVersionDeserializer(item: any): WebAppMinorVersion { + return { + displayText: item["displayText"], + value: item["value"], + stackSettings: !item["stackSettings"] + ? item["stackSettings"] + : webAppRuntimesDeserializer(item["stackSettings"]), + }; +} + +/** Web App stack runtimes. */ +export interface WebAppRuntimes { + /** Linux-specific settings associated with the minor version. */ + readonly linuxRuntimeSettings?: WebAppRuntimeSettings; + /** Windows-specific settings associated with the minor version. */ + readonly windowsRuntimeSettings?: WebAppRuntimeSettings; + /** Linux-specific settings associated with the Java container minor version. */ + readonly linuxContainerSettings?: LinuxJavaContainerSettings; + /** Windows-specific settings associated with the Java container minor version. */ + readonly windowsContainerSettings?: WindowsJavaContainerSettings; +} + +export function webAppRuntimesDeserializer(item: any): WebAppRuntimes { + return { + linuxRuntimeSettings: !item["linuxRuntimeSettings"] + ? item["linuxRuntimeSettings"] + : webAppRuntimeSettingsDeserializer(item["linuxRuntimeSettings"]), + windowsRuntimeSettings: !item["windowsRuntimeSettings"] + ? item["windowsRuntimeSettings"] + : webAppRuntimeSettingsDeserializer(item["windowsRuntimeSettings"]), + linuxContainerSettings: !item["linuxContainerSettings"] + ? item["linuxContainerSettings"] + : linuxJavaContainerSettingsDeserializer(item["linuxContainerSettings"]), + windowsContainerSettings: !item["windowsContainerSettings"] + ? item["windowsContainerSettings"] + : windowsJavaContainerSettingsDeserializer(item["windowsContainerSettings"]), + }; +} + +/** Web App runtime settings. */ +export interface WebAppRuntimeSettings { + /** Web App stack minor version (runtime only). */ + readonly runtimeVersion?: string; + /** true if remote debugging is supported for the stack; otherwise, false. */ + readonly remoteDebuggingSupported?: boolean; + /** Application Insights settings associated with the minor version. */ + readonly appInsightsSettings?: AppInsightsWebAppStackSettings; + /** GitHub Actions settings associated with the minor version. */ + readonly gitHubActionSettings?: GitHubActionWebAppStackSettings; + /** true if the stack is in preview; otherwise, false. */ + readonly isPreview?: boolean; + /** true if the stack is deprecated; otherwise, false. */ + readonly isDeprecated?: boolean; + /** true if the stack should be hidden; otherwise, false. */ + readonly isHidden?: boolean; + /** End-of-life date for the minor version. */ + readonly endOfLifeDate?: Date; + /** true if the stack version is auto-updated; otherwise, false. */ + readonly isAutoUpdate?: boolean; + /** true if the minor version is early-access; otherwise, false. */ + readonly isEarlyAccess?: boolean; +} + +export function webAppRuntimeSettingsDeserializer(item: any): WebAppRuntimeSettings { + return { + runtimeVersion: item["runtimeVersion"], + remoteDebuggingSupported: item["remoteDebuggingSupported"], + appInsightsSettings: !item["appInsightsSettings"] + ? item["appInsightsSettings"] + : appInsightsWebAppStackSettingsDeserializer(item["appInsightsSettings"]), + gitHubActionSettings: !item["gitHubActionSettings"] + ? item["gitHubActionSettings"] + : gitHubActionWebAppStackSettingsDeserializer(item["gitHubActionSettings"]), + isPreview: item["isPreview"], + isDeprecated: item["isDeprecated"], + isHidden: item["isHidden"], + endOfLifeDate: !item["endOfLifeDate"] ? item["endOfLifeDate"] : new Date(item["endOfLifeDate"]), + isAutoUpdate: item["isAutoUpdate"], + isEarlyAccess: item["isEarlyAccess"], + }; +} + +/** Linux Java Container settings. */ +export interface LinuxJavaContainerSettings { + /** Java 11 version (runtime only). */ + readonly java11Runtime?: string; + /** Java 8 version (runtime only). */ + readonly java8Runtime?: string; + /** true if the stack is in preview; otherwise, false. */ + readonly isPreview?: boolean; + /** true if the stack is deprecated; otherwise, false. */ + readonly isDeprecated?: boolean; + /** true if the stack should be hidden; otherwise, false. */ + readonly isHidden?: boolean; + /** End-of-life date for the minor version. */ + readonly endOfLifeDate?: Date; + /** true if the stack version is auto-updated; otherwise, false. */ + readonly isAutoUpdate?: boolean; + /** true if the minor version is early-access; otherwise, false. */ + readonly isEarlyAccess?: boolean; +} + +export function linuxJavaContainerSettingsDeserializer(item: any): LinuxJavaContainerSettings { + return { + java11Runtime: item["java11Runtime"], + java8Runtime: item["java8Runtime"], + isPreview: item["isPreview"], + isDeprecated: item["isDeprecated"], + isHidden: item["isHidden"], + endOfLifeDate: !item["endOfLifeDate"] ? item["endOfLifeDate"] : new Date(item["endOfLifeDate"]), + isAutoUpdate: item["isAutoUpdate"], + isEarlyAccess: item["isEarlyAccess"], + }; +} + +/** Windows Java Container settings. */ +export interface WindowsJavaContainerSettings { + /** Java container (runtime only). */ + readonly javaContainer?: string; + /** Java container version (runtime only). */ + readonly javaContainerVersion?: string; + /** true if the stack is in preview; otherwise, false. */ + readonly isPreview?: boolean; + /** true if the stack is deprecated; otherwise, false. */ + readonly isDeprecated?: boolean; + /** true if the stack should be hidden; otherwise, false. */ + readonly isHidden?: boolean; + /** End-of-life date for the minor version. */ + readonly endOfLifeDate?: Date; + /** true if the stack version is auto-updated; otherwise, false. */ + readonly isAutoUpdate?: boolean; + /** true if the minor version is early-access; otherwise, false. */ + readonly isEarlyAccess?: boolean; +} + +export function windowsJavaContainerSettingsDeserializer(item: any): WindowsJavaContainerSettings { + return { + javaContainer: item["javaContainer"], + javaContainerVersion: item["javaContainerVersion"], + isPreview: item["isPreview"], + isDeprecated: item["isDeprecated"], + isHidden: item["isHidden"], + endOfLifeDate: !item["endOfLifeDate"] ? item["endOfLifeDate"] : new Date(item["endOfLifeDate"]), + isAutoUpdate: item["isAutoUpdate"], + isEarlyAccess: item["isEarlyAccess"], + }; +} + +/** Collection of recommendations. */ +export interface _RecommendationCollection { + /** The Recommendation items on this page */ + value: Recommendation[]; + /** The link to the next page of items */ + nextLink?: string; +} + +export function _recommendationCollectionDeserializer(item: any): _RecommendationCollection { + return { + value: recommendationArrayDeserializer(item["value"]), + nextLink: item["nextLink"], + }; +} + +export function recommendationArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return recommendationDeserializer(item); + }); +} + +/** Represents a recommendation result generated by the recommendation engine. */ +export interface Recommendation extends ProxyOnlyResource { + /** Timestamp when this instance was created. */ + creationTime?: Date; + /** A GUID value that each recommendation object is associated with. */ + recommendationId?: string; + /** Full ARM resource ID string that this recommendation object is associated with. */ + resourceId?: string; + /** Name of a resource type this recommendation applies, e.g. Subscription, ServerFarm, Site. */ + resourceScope?: ResourceScopeType; + /** Unique name of the rule. */ + ruleName?: string; + /** UI friendly name of the rule (may not be unique). */ + displayName?: string; + /** Recommendation text. */ + message?: string; + /** Level indicating how critical this recommendation can impact. */ + level?: NotificationLevel; + /** List of channels that this recommendation can apply. */ + channels?: Channels; + /** The list of category tags that this recommendation belongs to. */ + readonly categoryTags?: string[]; + /** Name of action recommended by this object. */ + actionName?: string; + /** True if this recommendation is still valid (i.e. "actionable"). False if it is invalid. */ + enabled?: number; + /** The list of states of this recommendation. If it's null then it should be considered "Active". */ + states?: string[]; + /** The beginning time in UTC of a range that the recommendation refers to. */ + startTime?: Date; + /** The end time in UTC of a range that the recommendation refers to. */ + endTime?: Date; + /** When to notify this recommendation next in UTC. Null means that this will never be notified anymore. */ + nextNotificationTime?: Date; + /** Date and time in UTC when this notification expires. */ + notificationExpirationTime?: Date; + /** Last timestamp in UTC this instance was actually notified. Null means that this recommendation hasn't been notified yet. */ + notifiedTime?: Date; + /** A metric value measured by the rule. */ + score?: number; + /** True if this is associated with a dynamically added rule */ + isDynamic?: boolean; + /** Extension name of the portal if exists. */ + extensionName?: string; + /** Deep link to a blade on the portal. */ + bladeName?: string; + /** Forward link to an external document associated with the rule. */ + forwardLink?: string; +} + +export function recommendationDeserializer(item: any): Recommendation { + return { + id: item["id"], + name: item["name"], + kind: item["kind"], + type: item["type"], + ...(!item["properties"] + ? item["properties"] + : _recommendationPropertiesDeserializer(item["properties"])), + }; +} + +/** Recommendation resource specific properties */ +export interface RecommendationProperties { + /** Timestamp when this instance was created. */ + creationTime?: Date; + /** A GUID value that each recommendation object is associated with. */ + recommendationId?: string; + /** Full ARM resource ID string that this recommendation object is associated with. */ + resourceId?: string; + /** Name of a resource type this recommendation applies, e.g. Subscription, ServerFarm, Site. */ + resourceScope?: ResourceScopeType; + /** Unique name of the rule. */ + ruleName?: string; + /** UI friendly name of the rule (may not be unique). */ + displayName?: string; + /** Recommendation text. */ + message?: string; + /** Level indicating how critical this recommendation can impact. */ + level?: NotificationLevel; + /** List of channels that this recommendation can apply. */ + channels?: Channels; + /** The list of category tags that this recommendation belongs to. */ + readonly categoryTags?: string[]; + /** Name of action recommended by this object. */ + actionName?: string; + /** True if this recommendation is still valid (i.e. "actionable"). False if it is invalid. */ + enabled?: number; + /** The list of states of this recommendation. If it's null then it should be considered "Active". */ + states?: string[]; + /** The beginning time in UTC of a range that the recommendation refers to. */ + startTime?: Date; + /** The end time in UTC of a range that the recommendation refers to. */ + endTime?: Date; + /** When to notify this recommendation next in UTC. Null means that this will never be notified anymore. */ + nextNotificationTime?: Date; + /** Date and time in UTC when this notification expires. */ + notificationExpirationTime?: Date; + /** Last timestamp in UTC this instance was actually notified. Null means that this recommendation hasn't been notified yet. */ + notifiedTime?: Date; + /** A metric value measured by the rule. */ + score?: number; + /** True if this is associated with a dynamically added rule */ + isDynamic?: boolean; + /** Extension name of the portal if exists. */ + extensionName?: string; + /** Deep link to a blade on the portal. */ + bladeName?: string; + /** Forward link to an external document associated with the rule. */ + forwardLink?: string; +} + +export function recommendationPropertiesDeserializer(item: any): RecommendationProperties { + return { + creationTime: !item["creationTime"] ? item["creationTime"] : new Date(item["creationTime"]), + recommendationId: item["recommendationId"], + resourceId: item["resourceId"], + resourceScope: item["resourceScope"], + ruleName: item["ruleName"], + displayName: item["displayName"], + message: item["message"], + level: item["level"], + channels: item["channels"], + categoryTags: !item["categoryTags"] + ? item["categoryTags"] + : item["categoryTags"].map((p: any) => { + return p; + }), + actionName: item["actionName"], + enabled: item["enabled"], + states: !item["states"] + ? item["states"] + : item["states"].map((p: any) => { + return p; + }), + startTime: !item["startTime"] ? item["startTime"] : new Date(item["startTime"]), + endTime: !item["endTime"] ? item["endTime"] : new Date(item["endTime"]), + nextNotificationTime: !item["nextNotificationTime"] + ? item["nextNotificationTime"] + : new Date(item["nextNotificationTime"]), + notificationExpirationTime: !item["notificationExpirationTime"] + ? item["notificationExpirationTime"] + : new Date(item["notificationExpirationTime"]), + notifiedTime: !item["notifiedTime"] ? item["notifiedTime"] : new Date(item["notifiedTime"]), + score: item["score"], + isDynamic: item["isDynamic"], + extensionName: item["extensionName"], + bladeName: item["bladeName"], + forwardLink: item["forwardLink"], + }; +} + +/** Name of a resource type this recommendation applies, e.g. Subscription, ServerFarm, Site. */ +export enum KnownResourceScopeType { + /** ServerFarm */ + ServerFarm = "ServerFarm", + /** Subscription */ + Subscription = "Subscription", + /** WebSite */ + WebSite = "WebSite", +} + +/** + * Name of a resource type this recommendation applies, e.g. Subscription, ServerFarm, Site. \ + * {@link KnownResourceScopeType} can be used interchangeably with ResourceScopeType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **ServerFarm** \ + * **Subscription** \ + * **WebSite** + */ +export type ResourceScopeType = string; +/** Level indicating how critical this recommendation can impact. */ +export type NotificationLevel = "Critical" | "Warning" | "Information" | "NonUrgentSuggestion"; +/** List of channels that this recommendation can apply. */ +export type Channels = "Notification" | "Api" | "Email" | "Webhook" | "All"; + +/** Paged collection of CsmUsageQuota items */ +export interface _CsmUsageQuotaCollection { + /** The CsmUsageQuota items on this page */ + value: CsmUsageQuota[]; + /** The link to the next page of items */ + nextLink?: string; +} + +export function _csmUsageQuotaCollectionDeserializer(item: any): _CsmUsageQuotaCollection { + return { + value: csmUsageQuotaArrayDeserializer(item["value"]), + nextLink: item["nextLink"], + }; +} + +export function csmUsageQuotaArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return csmUsageQuotaDeserializer(item); + }); +} + +/** Usage of the quota resource. */ +export interface CsmUsageQuota { + /** Units of measurement for the quota resource. */ + unit?: string; + /** Next reset time for the resource counter. */ + nextResetTime?: Date; + /** The current value of the resource counter. */ + currentValue?: number; + /** The resource limit. */ + limit?: number; + /** Quota name. */ + name?: LocalizableString; +} + +export function csmUsageQuotaDeserializer(item: any): CsmUsageQuota { + return { + unit: item["unit"], + nextResetTime: !item["nextResetTime"] ? item["nextResetTime"] : new Date(item["nextResetTime"]), + currentValue: item["currentValue"], + limit: item["limit"], + name: !item["name"] ? item["name"] : localizableStringDeserializer(item["name"]), + }; +} + +/** Localizable string object containing the name and a localized value. */ +export interface LocalizableString { + /** Non-localized name. */ + value?: string; + /** Localized name. */ + localizedValue?: string; +} + +export function localizableStringDeserializer(item: any): LocalizableString { + return { + value: item["value"], + localizedValue: item["localizedValue"], + }; +} + +/** Request entity for previewing the Static Site workflow */ +export interface StaticSitesWorkflowPreviewRequest extends ProxyOnlyResource { + /** URL for the repository of the static site. */ + repositoryUrl?: string; + /** The target branch in the repository. */ + branch?: string; + /** Build properties to configure on the repository. */ + buildProperties?: StaticSiteBuildProperties; +} + +export function staticSitesWorkflowPreviewRequestSerializer( + item: StaticSitesWorkflowPreviewRequest, +): any { + return { + kind: item["kind"], + properties: areAllPropsUndefined(item, ["repositoryUrl", "branch", "buildProperties"]) + ? undefined + : _staticSitesWorkflowPreviewRequestPropertiesSerializer(item), + }; +} + +/** StaticSitesWorkflowPreviewRequest resource specific properties */ +export interface StaticSitesWorkflowPreviewRequestProperties { + /** URL for the repository of the static site. */ + repositoryUrl?: string; + /** The target branch in the repository. */ + branch?: string; + /** Build properties to configure on the repository. */ + buildProperties?: StaticSiteBuildProperties; +} + +export function staticSitesWorkflowPreviewRequestPropertiesSerializer( + item: StaticSitesWorkflowPreviewRequestProperties, +): any { + return { + repositoryUrl: item["repositoryUrl"], + branch: item["branch"], + buildProperties: !item["buildProperties"] + ? item["buildProperties"] + : staticSiteBuildPropertiesSerializer(item["buildProperties"]), + }; +} + +/** Build properties for the static site. */ +export interface StaticSiteBuildProperties { + /** The path to the app code within the repository. */ + appLocation?: string; + /** The path to the api code within the repository. */ + apiLocation?: string; + /** Deprecated: The path of the app artifacts after building (deprecated in favor of OutputLocation) */ + appArtifactLocation?: string; + /** The output path of the app after building. */ + outputLocation?: string; + /** A custom command to run during deployment of the static content application. */ + appBuildCommand?: string; + /** A custom command to run during deployment of the Azure Functions API application. */ + apiBuildCommand?: string; + /** Skip Github Action workflow generation. */ + skipGithubActionWorkflowGeneration?: boolean; + /** Github Action secret name override. */ + githubActionSecretNameOverride?: string; +} + +export function staticSiteBuildPropertiesSerializer(item: StaticSiteBuildProperties): any { + return { + appLocation: item["appLocation"], + apiLocation: item["apiLocation"], + appArtifactLocation: item["appArtifactLocation"], + outputLocation: item["outputLocation"], + appBuildCommand: item["appBuildCommand"], + apiBuildCommand: item["apiBuildCommand"], + skipGithubActionWorkflowGeneration: item["skipGithubActionWorkflowGeneration"], + githubActionSecretNameOverride: item["githubActionSecretNameOverride"], + }; +} + +/** Preview for the Static Site Workflow to be generated */ +export interface StaticSitesWorkflowPreview extends ProxyOnlyResource { + /** The path for the workflow file to be generated */ + readonly path?: string; + /** The contents for the workflow file to be generated */ + readonly contents?: string; +} + +export function staticSitesWorkflowPreviewDeserializer(item: any): StaticSitesWorkflowPreview { + return { + id: item["id"], + name: item["name"], + kind: item["kind"], + type: item["type"], + ...(!item["properties"] + ? item["properties"] + : _staticSitesWorkflowPreviewPropertiesDeserializer(item["properties"])), + }; +} + +/** StaticSitesWorkflowPreview resource specific properties */ +export interface StaticSitesWorkflowPreviewProperties { + /** The path for the workflow file to be generated */ + readonly path?: string; + /** The contents for the workflow file to be generated */ + readonly contents?: string; +} + +export function staticSitesWorkflowPreviewPropertiesDeserializer( + item: any, +): StaticSitesWorkflowPreviewProperties { + return { + path: item["path"], + contents: item["contents"], + }; +} + +/** Known values of {@link SkuName} that the service accepts. */ +export enum KnownSkuName { + /** Free */ + Free = "Free", + /** Shared */ + Shared = "Shared", + /** Basic */ + Basic = "Basic", + /** Standard */ + Standard = "Standard", + /** Premium */ + Premium = "Premium", + /** Dynamic */ + Dynamic = "Dynamic", + /** Isolated */ + Isolated = "Isolated", + /** IsolatedV2 */ + IsolatedV2 = "IsolatedV2", + /** PremiumV2 */ + PremiumV2 = "PremiumV2", + /** PremiumV3 */ + PremiumV3 = "PremiumV3", + /** PremiumContainer */ + PremiumContainer = "PremiumContainer", + /** ElasticPremium */ + ElasticPremium = "ElasticPremium", + /** ElasticIsolated */ + ElasticIsolated = "ElasticIsolated", + /** FlexConsumption */ + FlexConsumption = "FlexConsumption", +} + +/** Type of SkuName */ +export type SkuName = string; + +/** Known values of {@link ProviderOsTypeSelected} that the service accepts. */ +export enum KnownProviderOsTypeSelected { + /** Windows */ + Windows = "Windows", + /** Linux */ + Linux = "Linux", + /** WindowsFunctions */ + WindowsFunctions = "WindowsFunctions", + /** LinuxFunctions */ + LinuxFunctions = "LinuxFunctions", + /** All */ + All = "All", +} + +/** Type of ProviderOsTypeSelected */ +export type ProviderOsTypeSelected = string; + +/** Known values of {@link ProviderStackOsType} that the service accepts. */ +export enum KnownProviderStackOsType { + /** Windows */ + Windows = "Windows", + /** Linux */ + Linux = "Linux", + /** All */ + All = "All", +} + +/** Type of ProviderStackOsType */ +export type ProviderStackOsType = string; + +/** The available API versions. */ +export enum KnownVersions { + /** The 2025-03-01 API version. */ + V20250301 = "2025-03-01", + /** The 2025-05-01 API version. */ + V20250501 = "2025-05-01", +} + +export function _validateRequestPropertiesSerializer(item: ValidateRequest): any { + return { + serverFarmId: item["serverFarmId"], + skuName: item["skuName"], + needLinuxWorkers: item["needLinuxWorkers"], + isSpot: item["isSpot"], + capacity: item["capacity"], + hostingEnvironment: item["hostingEnvironment"], + isXenon: item["isXenon"], + containerRegistryBaseUrl: item["containerRegistryBaseUrl"], + containerRegistryUsername: item["containerRegistryUsername"], + containerRegistryPassword: item["containerRegistryPassword"], + containerImageRepository: item["containerImageRepository"], + containerImageTag: item["containerImageTag"], + containerImagePlatform: item["containerImagePlatform"], + appServiceEnvironment: !item["appServiceEnvironment"] + ? item["appServiceEnvironment"] + : appServiceEnvironmentSerializer(item["appServiceEnvironment"]), + }; +} + +export function _geoRegionPropertiesDeserializer(item: any) { + return { + description: item["description"], + displayName: item["displayName"], + orgDomain: item["orgDomain"], + }; +} + +export function _aseRegionPropertiesDeserializer(item: any) { + return { + displayName: item["displayName"], + standard: item["standard"], + dedicatedHost: item["dedicatedHost"], + zoneRedundant: item["zoneRedundant"], + availableSku: !item["availableSku"] + ? item["availableSku"] + : item["availableSku"].map((p: any) => { + return p; + }), + availableOS: !item["availableOS"] + ? item["availableOS"] + : item["availableOS"].map((p: any) => { + return p; + }), + }; +} + +export function _billingMeterPropertiesDeserializer(item: any) { + return { + meterId: item["meterId"], + billingLocation: item["billingLocation"], + shortName: item["shortName"], + friendlyName: item["friendlyName"], + resourceType: item["resourceType"], + osType: item["osType"], + multiplier: item["multiplier"], + }; +} + +export function _customHostnameSitesPropertiesDeserializer(item: any) { + return { + customHostname: item["customHostname"], + region: item["region"], + }; +} + +export function _premierAddOnOfferPropertiesDeserializer(item: any) { + return { + sku: item["sku"], + product: item["product"], + vendor: item["vendor"], + promoCodeRequired: item["promoCodeRequired"], + quota: item["quota"], + webHostingPlanRestrictions: item["webHostingPlanRestrictions"], + privacyPolicyUrl: item["privacyPolicyUrl"], + legalTermsUrl: item["legalTermsUrl"], + marketplacePublisher: item["marketplacePublisher"], + marketplaceOffer: item["marketplaceOffer"], + }; +} + +export function _vnetParametersPropertiesSerializer(item: VnetParameters): any { + return { + vnetResourceGroup: item["vnetResourceGroup"], + vnetName: item["vnetName"], + vnetSubnetName: item["vnetSubnetName"], + subnetResourceId: item["subnetResourceId"], + }; +} + +export function _vnetValidationTestFailurePropertiesDeserializer(item: any) { + return { + testName: item["testName"], + details: item["details"], + }; +} + +export function _vnetValidationFailureDetailsPropertiesDeserializer(item: any) { + return { + message: item["message"], + failed: item["failed"], + failedTests: !item["failedTests"] + ? item["failedTests"] + : vnetValidationTestFailureArrayDeserializer(item["failedTests"]), + warnings: !item["warnings"] + ? item["warnings"] + : vnetValidationTestFailureArrayDeserializer(item["warnings"]), + }; +} + +export function _pushSettingsPropertiesDeserializer(item: any) { + return { + isPushEnabled: item["isPushEnabled"], + tagWhitelistJson: item["tagWhitelistJson"], + tagsRequiringAuth: item["tagsRequiringAuth"], + dynamicTagsJson: item["dynamicTagsJson"], + }; +} + +export function _applicationStackResourcePropertiesDeserializer(item: any) { + return { + namePropertiesName: item["name"], + display: item["display"], + dependency: item["dependency"], + majorVersions: !item["majorVersions"] + ? item["majorVersions"] + : stackMajorVersionArrayDeserializer(item["majorVersions"]), + frameworks: !item["frameworks"] + ? item["frameworks"] + : applicationStackArrayDeserializer(item["frameworks"]), + isDeprecated: !item["isDeprecated"] + ? item["isDeprecated"] + : applicationStackArrayDeserializer(item["isDeprecated"]), + }; +} + +export function _functionAppStackPropertiesDeserializer(item: any) { + return { + displayText: item["displayText"], + value: item["value"], + majorVersions: !item["majorVersions"] + ? item["majorVersions"] + : functionAppMajorVersionArrayDeserializer(item["majorVersions"]), + preferredOs: item["preferredOs"], + }; +} + +export function _webAppStackPropertiesDeserializer(item: any) { + return { + displayText: item["displayText"], + value: item["value"], + majorVersions: !item["majorVersions"] + ? item["majorVersions"] + : webAppMajorVersionArrayDeserializer(item["majorVersions"]), + preferredOs: item["preferredOs"], + }; +} + +export function _recommendationPropertiesDeserializer(item: any) { + return { + creationTime: !item["creationTime"] ? item["creationTime"] : new Date(item["creationTime"]), + recommendationId: item["recommendationId"], + resourceId: item["resourceId"], + resourceScope: item["resourceScope"], + ruleName: item["ruleName"], + displayName: item["displayName"], + message: item["message"], + level: item["level"], + channels: item["channels"], + categoryTags: !item["categoryTags"] + ? item["categoryTags"] + : item["categoryTags"].map((p: any) => { + return p; + }), + actionName: item["actionName"], + enabled: item["enabled"], + states: !item["states"] + ? item["states"] + : item["states"].map((p: any) => { + return p; + }), + startTime: !item["startTime"] ? item["startTime"] : new Date(item["startTime"]), + endTime: !item["endTime"] ? item["endTime"] : new Date(item["endTime"]), + nextNotificationTime: !item["nextNotificationTime"] + ? item["nextNotificationTime"] + : new Date(item["nextNotificationTime"]), + notificationExpirationTime: !item["notificationExpirationTime"] + ? item["notificationExpirationTime"] + : new Date(item["notificationExpirationTime"]), + notifiedTime: !item["notifiedTime"] ? item["notifiedTime"] : new Date(item["notifiedTime"]), + score: item["score"], + isDynamic: item["isDynamic"], + extensionName: item["extensionName"], + bladeName: item["bladeName"], + forwardLink: item["forwardLink"], + }; +} + +export function _staticSitesWorkflowPreviewRequestPropertiesSerializer( + item: StaticSitesWorkflowPreviewRequest, +): any { + return { + repositoryUrl: item["repositoryUrl"], + branch: item["branch"], + buildProperties: !item["buildProperties"] + ? item["buildProperties"] + : staticSiteBuildPropertiesSerializer(item["buildProperties"]), + }; +} + +export function _staticSitesWorkflowPreviewPropertiesDeserializer(item: any) { + return { + path: item["path"], + contents: item["contents"], + }; +} diff --git a/packages/typespec-test/test/AppService/generated/typespec-ts/src/static-helpers/cloudSettingHelpers.ts b/packages/typespec-test/test/AppService/generated/typespec-ts/src/static-helpers/cloudSettingHelpers.ts new file mode 100644 index 0000000000..613112c6e3 --- /dev/null +++ b/packages/typespec-test/test/AppService/generated/typespec-ts/src/static-helpers/cloudSettingHelpers.ts @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +/** + * An enum to describe Azure Cloud environments. + * @enum {string} + */ +export enum AzureClouds { + /** Azure public cloud, which is the default cloud for Azure SDKs. */ + AZURE_PUBLIC_CLOUD = "AZURE_PUBLIC_CLOUD", + /** Azure China cloud */ + AZURE_CHINA_CLOUD = "AZURE_CHINA_CLOUD", + /** Azure US government cloud */ + AZURE_US_GOVERNMENT = "AZURE_US_GOVERNMENT", +} + +/** The supported values for cloud setting as a string literal type */ +export type AzureSupportedClouds = `${AzureClouds}`; + +/** + * Gets the Azure Resource Manager endpoint URL for the specified cloud setting. + * @param cloudSetting - The Azure cloud environment setting. Use one of the AzureClouds enum values. + * @returns The ARM endpoint URL for the specified cloud, or undefined if cloudSetting is undefined. + * @throws {Error} Throws an error if an unknown cloud setting is provided. + */ +export function getArmEndpoint(cloudSetting?: AzureSupportedClouds): string | undefined { + if (cloudSetting === undefined) { + return undefined; + } + const cloudEndpoints: Record = { + AZURE_CHINA_CLOUD: "https://management.chinacloudapi.cn/", + AZURE_US_GOVERNMENT: "https://management.usgovcloudapi.net/", + AZURE_PUBLIC_CLOUD: "https://management.azure.com/", + }; + if (cloudSetting in cloudEndpoints) { + return cloudEndpoints[cloudSetting]; + } else { + throw new Error( + `Unknown cloud setting: ${cloudSetting}. Please refer to the enum AzureClouds for possible values.`, + ); + } +} diff --git a/packages/typespec-test/test/AppService/generated/typespec-ts/src/static-helpers/pagingHelpers.ts b/packages/typespec-test/test/AppService/generated/typespec-ts/src/static-helpers/pagingHelpers.ts new file mode 100644 index 0000000000..5a3472a3f0 --- /dev/null +++ b/packages/typespec-test/test/AppService/generated/typespec-ts/src/static-helpers/pagingHelpers.ts @@ -0,0 +1,245 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { Client, createRestError, PathUncheckedResponse } from "@azure-rest/core-client"; +import { RestError } from "@azure/core-rest-pipeline"; + +/** + * Options for the byPage method + */ +export interface PageSettings { + /** + * A reference to a specific page to start iterating from. + */ + continuationToken?: string; +} + +/** + * An interface that describes a page of results. + */ +export type ContinuablePage = TPage & { + /** + * The token that keeps track of where to continue the iterator + */ + continuationToken?: string; +}; + +/** + * An interface that allows async iterable iteration both to completion and by page. + */ +export interface PagedAsyncIterableIterator< + TElement, + TPage = TElement[], + TPageSettings extends PageSettings = PageSettings, +> { + /** + * The next method, part of the iteration protocol + */ + next(): Promise>; + /** + * The connection to the async iterator, part of the iteration protocol + */ + [Symbol.asyncIterator](): PagedAsyncIterableIterator; + /** + * Return an AsyncIterableIterator that works a page at a time + */ + byPage: (settings?: TPageSettings) => AsyncIterableIterator>; +} + +/** + * An interface that describes how to communicate with the service. + */ +export interface PagedResult< + TElement, + TPage = TElement[], + TPageSettings extends PageSettings = PageSettings, +> { + /** + * Link to the first page of results. + */ + firstPageLink?: string; + /** + * A method that returns a page of results. + */ + getPage: (pageLink?: string) => Promise<{ page: TPage; nextPageLink?: string } | undefined>; + /** + * a function to implement the `byPage` method on the paged async iterator. + */ + byPage?: (settings?: TPageSettings) => AsyncIterableIterator>; + + /** + * A function to extract elements from a page. + */ + toElements?: (page: TPage) => TElement[]; +} + +/** + * Options for the paging helper + */ +export interface BuildPagedAsyncIteratorOptions { + itemName?: string; + nextLinkName?: string; + nextLinkMethod?: "GET" | "POST"; +} + +/** + * Helper to paginate results in a generic way and return a PagedAsyncIterableIterator + */ +export function buildPagedAsyncIterator< + TElement, + TPage = TElement[], + TPageSettings extends PageSettings = PageSettings, + TResponse extends PathUncheckedResponse = PathUncheckedResponse, +>( + client: Client, + getInitialResponse: () => PromiseLike, + processResponseBody: (result: TResponse) => PromiseLike, + expectedStatuses: string[], + options: BuildPagedAsyncIteratorOptions = {}, +): PagedAsyncIterableIterator { + const itemName = options.itemName ?? "value"; + const nextLinkName = options.nextLinkName ?? "nextLink"; + const nextLinkMethod = options.nextLinkMethod ?? "GET"; + const pagedResult: PagedResult = { + getPage: async (pageLink?: string) => { + const result = + pageLink === undefined + ? await getInitialResponse() + : nextLinkMethod === "POST" + ? await client.pathUnchecked(pageLink).post() + : await client.pathUnchecked(pageLink).get(); + checkPagingRequest(result, expectedStatuses); + const results = await processResponseBody(result as TResponse); + const nextLink = getNextLink(results, nextLinkName); + const values = getElements(results, itemName) as TPage; + return { + page: values, + nextPageLink: nextLink, + }; + }, + byPage: (settings?: TPageSettings) => { + const { continuationToken } = settings ?? {}; + return getPageAsyncIterator(pagedResult, { + pageLink: continuationToken, + }); + }, + }; + return getPagedAsyncIterator(pagedResult); +} + +/** + * returns an async iterator that iterates over results. It also has a `byPage` + * method that returns pages of items at once. + * + * @param pagedResult - an object that specifies how to get pages. + * @returns a paged async iterator that iterates over results. + */ + +function getPagedAsyncIterator< + TElement, + TPage = TElement[], + TPageSettings extends PageSettings = PageSettings, +>( + pagedResult: PagedResult, +): PagedAsyncIterableIterator { + const iter = getItemAsyncIterator(pagedResult); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: + pagedResult?.byPage ?? + ((settings?: TPageSettings) => { + const { continuationToken } = settings ?? {}; + return getPageAsyncIterator(pagedResult, { + pageLink: continuationToken, + }); + }), + }; +} + +async function* getItemAsyncIterator( + pagedResult: PagedResult, +): AsyncIterableIterator { + const pages = getPageAsyncIterator(pagedResult); + for await (const page of pages) { + yield* page as unknown as TElement[]; + } +} + +async function* getPageAsyncIterator( + pagedResult: PagedResult, + options: { + pageLink?: string; + } = {}, +): AsyncIterableIterator> { + const { pageLink } = options; + let response = await pagedResult.getPage(pageLink ?? pagedResult.firstPageLink); + if (!response) { + return; + } + let result = response.page as ContinuablePage; + result.continuationToken = response.nextPageLink; + yield result; + while (response.nextPageLink) { + response = await pagedResult.getPage(response.nextPageLink); + if (!response) { + return; + } + result = response.page as ContinuablePage; + result.continuationToken = response.nextPageLink; + yield result; + } +} + +/** + * Gets for the value of nextLink in the body + */ +function getNextLink(body: unknown, nextLinkName?: string): string | undefined { + if (!nextLinkName) { + return undefined; + } + + const nextLink = (body as Record)[nextLinkName]; + + if (typeof nextLink !== "string" && typeof nextLink !== "undefined" && nextLink !== null) { + throw new RestError( + `Body Property ${nextLinkName} should be a string or undefined or null but got ${typeof nextLink}`, + ); + } + + if (nextLink === null) { + return undefined; + } + + return nextLink; +} + +/** + * Gets the elements of the current request in the body. + */ +function getElements(body: unknown, itemName: string): T[] { + const value = (body as Record)[itemName] as T[]; + if (!Array.isArray(value)) { + throw new RestError( + `Couldn't paginate response\n Body doesn't contain an array property with name: ${itemName}`, + ); + } + + return value ?? []; +} + +/** + * Checks if a request failed + */ +function checkPagingRequest(response: PathUncheckedResponse, expectedStatuses: string[]): void { + if (!expectedStatuses.includes(response.status)) { + throw createRestError( + `Pagination failed with unexpected statusCode ${response.status}`, + response, + ); + } +} diff --git a/packages/typespec-test/test/AppService/generated/typespec-ts/src/static-helpers/pollingHelpers.ts b/packages/typespec-test/test/AppService/generated/typespec-ts/src/static-helpers/pollingHelpers.ts new file mode 100644 index 0000000000..f01c41bab6 --- /dev/null +++ b/packages/typespec-test/test/AppService/generated/typespec-ts/src/static-helpers/pollingHelpers.ts @@ -0,0 +1,126 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { + PollerLike, + OperationState, + ResourceLocationConfig, + RunningOperation, + createHttpPoller, + OperationResponse, +} from "@azure/core-lro"; + +import { Client, PathUncheckedResponse, createRestError } from "@azure-rest/core-client"; +import { AbortSignalLike } from "@azure/abort-controller"; + +export interface GetLongRunningPollerOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** + * The signal which can be used to abort requests. + */ + abortSignal?: AbortSignalLike; + /** + * The potential location of the result of the LRO if specified by the LRO extension in the swagger. + */ + resourceLocationConfig?: ResourceLocationConfig; + /** + * The original url of the LRO + * Should not be null when restoreFrom is set + */ + initialRequestUrl?: string; + /** + * A serialized poller which can be used to resume an existing paused Long-Running-Operation. + */ + restoreFrom?: string; + /** + * The function to get the initial response + */ + getInitialResponse?: () => PromiseLike; +} +export function getLongRunningPoller( + client: Client, + processResponseBody: (result: TResponse) => Promise, + expectedStatuses: string[], + options: GetLongRunningPollerOptions, +): PollerLike, TResult> { + const { restoreFrom, getInitialResponse } = options; + if (!restoreFrom && !getInitialResponse) { + throw new Error("Either restoreFrom or getInitialResponse must be specified"); + } + let initialResponse: TResponse | undefined = undefined; + const pollAbortController = new AbortController(); + const poller: RunningOperation = { + sendInitialRequest: async () => { + if (!getInitialResponse) { + throw new Error("getInitialResponse is required when initializing a new poller"); + } + initialResponse = await getInitialResponse(); + return getLroResponse(initialResponse, expectedStatuses); + }, + sendPollRequest: async ( + path: string, + pollOptions?: { + abortSignal?: AbortSignalLike; + }, + ) => { + // The poll request would both listen to the user provided abort signal and the poller's own abort signal + function abortListener(): void { + pollAbortController.abort(); + } + const abortSignal = pollAbortController.signal; + if (options.abortSignal?.aborted) { + pollAbortController.abort(); + } else if (pollOptions?.abortSignal?.aborted) { + pollAbortController.abort(); + } else if (!abortSignal.aborted) { + options.abortSignal?.addEventListener("abort", abortListener, { + once: true, + }); + pollOptions?.abortSignal?.addEventListener("abort", abortListener, { + once: true, + }); + } + let response; + try { + response = await client.pathUnchecked(path).get({ abortSignal }); + } finally { + options.abortSignal?.removeEventListener("abort", abortListener); + pollOptions?.abortSignal?.removeEventListener("abort", abortListener); + } + + return getLroResponse(response as TResponse, expectedStatuses); + }, + }; + return createHttpPoller(poller, { + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: options?.resourceLocationConfig, + restoreFrom: options?.restoreFrom, + processResult: (result: unknown) => { + return processResponseBody(result as TResponse); + }, + }); +} +/** + * Converts a Rest Client response to a response that the LRO implementation understands + * @param response - a rest client http response + * @param deserializeFn - deserialize function to convert Rest response to modular output + * @returns - An LRO response that the LRO implementation understands + */ +function getLroResponse( + response: TResponse, + expectedStatuses: string[], +): OperationResponse { + if (!expectedStatuses.includes(response.status)) { + throw createRestError(response); + } + + return { + flatResponse: response, + rawResponse: { + ...response, + statusCode: Number.parseInt(response.status), + body: response.body, + }, + }; +} diff --git a/packages/typespec-test/test/AppService/generated/typespec-ts/src/static-helpers/serialization/check-prop-undefined.ts b/packages/typespec-test/test/AppService/generated/typespec-ts/src/static-helpers/serialization/check-prop-undefined.ts new file mode 100644 index 0000000000..50f78829e4 --- /dev/null +++ b/packages/typespec-test/test/AppService/generated/typespec-ts/src/static-helpers/serialization/check-prop-undefined.ts @@ -0,0 +1,17 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +/** + * Returns true if all specified properties of the item are undefined. + * @param item The object to check. + * @param properties The list of property names to check on the item. + * @returns True if all specified properties are undefined, otherwise false. + */ +export function areAllPropsUndefined(item: Record, properties: string[]): boolean { + for (const property of properties) { + if (item[property] !== undefined) { + return false; + } + } + return true; +} diff --git a/packages/typespec-test/test/AppService/generated/typespec-ts/src/static-helpers/urlTemplate.ts b/packages/typespec-test/test/AppService/generated/typespec-ts/src/static-helpers/urlTemplate.ts new file mode 100644 index 0000000000..c710989869 --- /dev/null +++ b/packages/typespec-test/test/AppService/generated/typespec-ts/src/static-helpers/urlTemplate.ts @@ -0,0 +1,227 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +// --------------------- +// interfaces +// --------------------- +interface ValueOptions { + isFirst: boolean; // is first value in the expression + op?: string; // operator + varValue?: any; // variable value + varName?: string; // variable name + modifier?: string; // modifier e.g * + reserved?: boolean; // if true we'll keep reserved words with not encoding +} + +export interface UrlTemplateOptions { + // if set to true, reserved characters will not be encoded + allowReserved?: boolean; +} + +// --------------------- +// helpers +// --------------------- +function encodeComponent(val: string, reserved?: boolean, op?: string): string { + return (reserved ?? op === "+") || op === "#" + ? encodeReservedComponent(val) + : encodeRFC3986URIComponent(val); +} + +function encodeReservedComponent(str: string): string { + return str + .split(/(%[0-9A-Fa-f]{2})/g) + .map((part) => (!/%[0-9A-Fa-f]/.test(part) ? encodeURI(part) : part)) + .join(""); +} + +function encodeRFC3986URIComponent(str: string): string { + return encodeURIComponent(str).replace( + /[!'()*]/g, + (c) => `%${c.charCodeAt(0).toString(16).toUpperCase()}`, + ); +} + +function isDefined(val: any): boolean { + return val !== undefined && val !== null; +} + +function getNamedAndIfEmpty(op?: string): [boolean, string] { + return [!!op && [";", "?", "&"].includes(op), !!op && ["?", "&"].includes(op) ? "=" : ""]; +} + +function getFirstOrSep(op?: string, isFirst = false): string { + if (isFirst) { + return !op || op === "+" ? "" : op; + } else if (!op || op === "+" || op === "#") { + return ","; + } else if (op === "?") { + return "&"; + } else { + return op; + } +} + +function getExpandedValue(option: ValueOptions): string { + let isFirst = option.isFirst; + const { op, varName, varValue: value, reserved } = option; + const vals: string[] = []; + const [named, ifEmpty] = getNamedAndIfEmpty(op); + + if (Array.isArray(value)) { + for (const val of value.filter(isDefined)) { + // prepare the following parts: separator, varName, value + vals.push(`${getFirstOrSep(op, isFirst)}`); + if (named && varName) { + vals.push(`${encodeURIComponent(varName)}`); + if (val === "") { + vals.push(ifEmpty); + } else { + vals.push("="); + } + } + vals.push(encodeComponent(val, reserved, op)); + isFirst = false; + } + } else if (typeof value === "object") { + for (const key of Object.keys(value)) { + const val = value[key]; + if (!isDefined(val)) { + continue; + } + // prepare the following parts: separator, key, value + vals.push(`${getFirstOrSep(op, isFirst)}`); + if (key) { + vals.push(`${encodeURIComponent(key)}`); + if (named && val === "") { + vals.push(ifEmpty); + } else { + vals.push("="); + } + } + vals.push(encodeComponent(val, reserved, op)); + isFirst = false; + } + } + return vals.join(""); +} + +function getNonExpandedValue(option: ValueOptions): string | undefined { + const { op, varName, varValue: value, isFirst, reserved } = option; + const vals: string[] = []; + const first = getFirstOrSep(op, isFirst); + const [named, ifEmpty] = getNamedAndIfEmpty(op); + if (named && varName) { + vals.push(encodeComponent(varName, reserved, op)); + if (value === "") { + if (!ifEmpty) { + vals.push(ifEmpty); + } + return !vals.join("") ? undefined : `${first}${vals.join("")}`; + } + vals.push("="); + } + + const items = []; + if (Array.isArray(value)) { + for (const val of value.filter(isDefined)) { + items.push(encodeComponent(val, reserved, op)); + } + } else if (typeof value === "object") { + for (const key of Object.keys(value)) { + if (!isDefined(value[key])) { + continue; + } + items.push(encodeRFC3986URIComponent(key)); + items.push(encodeComponent(value[key], reserved, op)); + } + } + vals.push(items.join(",")); + return !vals.join(",") ? undefined : `${first}${vals.join("")}`; +} + +function getVarValue(option: ValueOptions): string | undefined { + const { op, varName, modifier, isFirst, reserved, varValue: value } = option; + + if (!isDefined(value)) { + return undefined; + } else if (["string", "number", "boolean"].includes(typeof value)) { + let val = value.toString(); + const [named, ifEmpty] = getNamedAndIfEmpty(op); + const vals: string[] = [getFirstOrSep(op, isFirst)]; + if (named && varName) { + // No need to encode varName considering it is already encoded + vals.push(varName); + if (val === "") { + vals.push(ifEmpty); + } else { + vals.push("="); + } + } + if (modifier && modifier !== "*") { + val = val.substring(0, parseInt(modifier, 10)); + } + vals.push(encodeComponent(val, reserved, op)); + return vals.join(""); + } else if (modifier === "*") { + return getExpandedValue(option); + } else { + return getNonExpandedValue(option); + } +} + +// --------------------------------------------------------------------------------------------------- +// This is an implementation of RFC 6570 URI Template: https://datatracker.ietf.org/doc/html/rfc6570. +// --------------------------------------------------------------------------------------------------- +export function expandUrlTemplate( + template: string, + context: Record, + option?: UrlTemplateOptions, +): string { + const result = template.replace(/\{([^{}]+)\}|([^{}]+)/g, (_, expr, text) => { + if (!expr) { + return encodeReservedComponent(text); + } + let op; + if (["+", "#", ".", "/", ";", "?", "&"].includes(expr[0])) { + op = expr[0]; + expr = expr.slice(1); + } + const varList = expr.split(/,/g); + const result = []; + for (const varSpec of varList) { + const varMatch = /([^:*]*)(?::(\d+)|(\*))?/.exec(varSpec); + if (!varMatch || !varMatch[1]) { + continue; + } + const varValue = getVarValue({ + isFirst: result.length === 0, + op, + varValue: context[varMatch[1]], + varName: varMatch[1], + modifier: varMatch[2] || varMatch[3], + reserved: option?.allowReserved, + }); + if (varValue) { + result.push(varValue); + } + } + return result.join(""); + }); + + return normalizeUnreserved(result); +} + +/** + * Normalize an expanded URI by decoding percent-encoded unreserved characters. + * RFC 3986 unreserved: "-" / "." / "~" + */ +function normalizeUnreserved(uri: string): string { + return uri.replace(/%([0-9A-Fa-f]{2})/g, (match, hex) => { + const char = String.fromCharCode(parseInt(hex, 16)); + // Decode only if it's unreserved + if (/[\-.~]/.test(char)) { + return char; + } + return match; // leave other encodings intact + }); +} diff --git a/packages/typespec-test/test/AppService/generated/typespec-ts/src/webSiteManagementClient.ts b/packages/typespec-test/test/AppService/generated/typespec-ts/src/webSiteManagementClient.ts new file mode 100644 index 0000000000..f2d09827fb --- /dev/null +++ b/packages/typespec-test/test/AppService/generated/typespec-ts/src/webSiteManagementClient.ts @@ -0,0 +1,248 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { + createWebSiteManagement, + WebSiteManagementContext, + WebSiteManagementClientOptionalParams, +} from "./api/index.js"; +import { + move, + verifyHostingEnvironmentVnet, + listSkus, + listPremierAddOnOffers, + regionalCheckNameAvailability, + listGeoRegions, + listCustomHostNameSites, + checkNameAvailability, + listBillingMeters, + listAseRegions, + getSubscriptionDeploymentLocations, + validate, + validateMove, +} from "./api/operations.js"; +import { + MoveOptionalParams, + VerifyHostingEnvironmentVnetOptionalParams, + ListSkusOptionalParams, + ListPremierAddOnOffersOptionalParams, + RegionalCheckNameAvailabilityOptionalParams, + ListGeoRegionsOptionalParams, + ListCustomHostNameSitesOptionalParams, + CheckNameAvailabilityOptionalParams, + ListBillingMetersOptionalParams, + ListAseRegionsOptionalParams, + GetSubscriptionDeploymentLocationsOptionalParams, + ValidateOptionalParams, + ValidateMoveOptionalParams, +} from "./api/options.js"; +import { + AppServiceEnvironmentResourcesOperations, + _getAppServiceEnvironmentResourcesOperations, +} from "./classic/appServiceEnvironmentResources/index.js"; +import { + GetUsagesInLocationOperationGroupOperations, + _getGetUsagesInLocationOperationGroupOperations, +} from "./classic/getUsagesInLocationOperationGroup/index.js"; +import { + GlobalOperationGroupOperations, + _getGlobalOperationGroupOperations, +} from "./classic/globalOperationGroup/index.js"; +import { OperationsOperations, _getOperationsOperations } from "./classic/operations/index.js"; +import { + ProviderOperationGroupOperations, + _getProviderOperationGroupOperations, +} from "./classic/providerOperationGroup/index.js"; +import { + RecommendationsOperationGroupOperations, + _getRecommendationsOperationGroupOperations, +} from "./classic/recommendationsOperationGroup/index.js"; +import { + StaticSitesOperationGroupOperations, + _getStaticSitesOperationGroupOperations, +} from "./classic/staticSitesOperationGroup/index.js"; +import { + CsmMoveResourceEnvelope, + ValidateRequest, + ValidateResponse, + DeploymentLocations, + GeoRegion, + AseRegion, + BillingMeter, + ResourceNameAvailabilityRequest, + ResourceNameAvailability, + CustomHostnameSites, + DnlResourceNameAvailabilityRequest, + DnlResourceNameAvailability, + PremierAddOnOffer, + SkuInfos, + VnetParameters, + VnetValidationFailureDetails, +} from "./models/models.js"; +import { PagedAsyncIterableIterator } from "./static-helpers/pagingHelpers.js"; +import { TokenCredential } from "@azure/core-auth"; +import { Pipeline } from "@azure/core-rest-pipeline"; + +export { WebSiteManagementClientOptionalParams } from "./api/webSiteManagementContext.js"; + +export class WebSiteManagementClient { + private _client: WebSiteManagementContext; + /** The pipeline used by this client to make requests */ + public readonly pipeline: Pipeline; + + constructor(credential: TokenCredential, options?: WebSiteManagementClientOptionalParams); + constructor( + credential: TokenCredential, + subscriptionId: string, + options?: WebSiteManagementClientOptionalParams, + ); + constructor( + credential: TokenCredential, + subscriptionIdOrOptions?: string | WebSiteManagementClientOptionalParams, + options?: WebSiteManagementClientOptionalParams, + ) { + let subscriptionId: string | undefined; + + if (typeof subscriptionIdOrOptions === "string") { + subscriptionId = subscriptionIdOrOptions; + } else if (typeof subscriptionIdOrOptions === "object") { + options = subscriptionIdOrOptions; + } + + options = options ?? {}; + const prefixFromOptions = options?.userAgentOptions?.userAgentPrefix; + const userAgentPrefix = prefixFromOptions + ? `${prefixFromOptions} azsdk-js-client` + : `azsdk-js-client`; + this._client = createWebSiteManagement(credential, subscriptionId ?? "", { + ...options, + userAgentOptions: { userAgentPrefix }, + }); + this.pipeline = this._client.pipeline; + this.staticSitesOperationGroup = _getStaticSitesOperationGroupOperations(this._client); + this.getUsagesInLocationOperationGroup = _getGetUsagesInLocationOperationGroupOperations( + this._client, + ); + this.recommendationsOperationGroup = _getRecommendationsOperationGroupOperations(this._client); + this.providerOperationGroup = _getProviderOperationGroupOperations(this._client); + this.globalOperationGroup = _getGlobalOperationGroupOperations(this._client); + this.appServiceEnvironmentResources = _getAppServiceEnvironmentResourcesOperations( + this._client, + ); + this.operations = _getOperationsOperations(this._client); + } + + /** Description for Move resources between resource groups. */ + move( + resourceGroupName: string, + moveResourceEnvelope: CsmMoveResourceEnvelope, + options: MoveOptionalParams = { requestOptions: {} }, + ): Promise { + return move(this._client, resourceGroupName, moveResourceEnvelope, options); + } + + /** Description for Verifies if this VNET is compatible with an App Service Environment by analyzing the Network Security Group rules. */ + verifyHostingEnvironmentVnet( + body: VnetParameters, + options: VerifyHostingEnvironmentVnetOptionalParams = { requestOptions: {} }, + ): Promise { + return verifyHostingEnvironmentVnet(this._client, body, options); + } + + /** Description for List all SKUs. */ + listSkus(options: ListSkusOptionalParams = { requestOptions: {} }): Promise { + return listSkus(this._client, options); + } + + /** Description for List all premier add-on offers. */ + listPremierAddOnOffers( + options: ListPremierAddOnOffersOptionalParams = { requestOptions: {} }, + ): PagedAsyncIterableIterator { + return listPremierAddOnOffers(this._client, options); + } + + /** Check if a resource name is available for DNL sites. */ + regionalCheckNameAvailability( + location: string, + body: DnlResourceNameAvailabilityRequest, + options: RegionalCheckNameAvailabilityOptionalParams = { requestOptions: {} }, + ): Promise { + return regionalCheckNameAvailability(this._client, location, body, options); + } + + /** Description for Get a list of available geographical regions. */ + listGeoRegions( + options: ListGeoRegionsOptionalParams = { requestOptions: {} }, + ): PagedAsyncIterableIterator { + return listGeoRegions(this._client, options); + } + + /** Get custom hostnames under this subscription */ + listCustomHostNameSites( + options: ListCustomHostNameSitesOptionalParams = { requestOptions: {} }, + ): PagedAsyncIterableIterator { + return listCustomHostNameSites(this._client, options); + } + + /** Description for Check if a resource name is available. */ + checkNameAvailability( + body: ResourceNameAvailabilityRequest, + options: CheckNameAvailabilityOptionalParams = { requestOptions: {} }, + ): Promise { + return checkNameAvailability(this._client, body, options); + } + + /** Description for Gets a list of meters for a given location. */ + listBillingMeters( + options: ListBillingMetersOptionalParams = { requestOptions: {} }, + ): PagedAsyncIterableIterator { + return listBillingMeters(this._client, options); + } + + /** Description for get a list of available ASE regions and its supported Skus. */ + listAseRegions( + options: ListAseRegionsOptionalParams = { requestOptions: {} }, + ): PagedAsyncIterableIterator { + return listAseRegions(this._client, options); + } + + /** Description for Gets list of available geo regions plus ministamps */ + getSubscriptionDeploymentLocations( + options: GetSubscriptionDeploymentLocationsOptionalParams = { requestOptions: {} }, + ): Promise { + return getSubscriptionDeploymentLocations(this._client, options); + } + + /** Description for Validate if a resource can be created. */ + validate( + resourceGroupName: string, + validateRequest: ValidateRequest, + options: ValidateOptionalParams = { requestOptions: {} }, + ): Promise { + return validate(this._client, resourceGroupName, validateRequest, options); + } + + /** Description for Validate whether a resource can be moved. */ + validateMove( + resourceGroupName: string, + moveResourceEnvelope: CsmMoveResourceEnvelope, + options: ValidateMoveOptionalParams = { requestOptions: {} }, + ): Promise { + return validateMove(this._client, resourceGroupName, moveResourceEnvelope, options); + } + + /** The operation groups for staticSitesOperationGroup */ + public readonly staticSitesOperationGroup: StaticSitesOperationGroupOperations; + /** The operation groups for getUsagesInLocationOperationGroup */ + public readonly getUsagesInLocationOperationGroup: GetUsagesInLocationOperationGroupOperations; + /** The operation groups for recommendationsOperationGroup */ + public readonly recommendationsOperationGroup: RecommendationsOperationGroupOperations; + /** The operation groups for providerOperationGroup */ + public readonly providerOperationGroup: ProviderOperationGroupOperations; + /** The operation groups for globalOperationGroup */ + public readonly globalOperationGroup: GlobalOperationGroupOperations; + /** The operation groups for appServiceEnvironmentResources */ + public readonly appServiceEnvironmentResources: AppServiceEnvironmentResourcesOperations; + /** The operation groups for operations */ + public readonly operations: OperationsOperations; +} diff --git a/packages/typespec-test/test/AppService/generated/typespec-ts/tsconfig.json b/packages/typespec-test/test/AppService/generated/typespec-ts/tsconfig.json new file mode 100644 index 0000000000..031889db45 --- /dev/null +++ b/packages/typespec-test/test/AppService/generated/typespec-ts/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "target": "ES2017", + "module": "NodeNext", + "lib": [], + "declaration": true, + "declarationMap": true, + "inlineSources": true, + "sourceMap": true, + "importHelpers": true, + "strict": true, + "alwaysStrict": true, + "noUnusedLocals": true, + "noUnusedParameters": true, + "noImplicitReturns": true, + "noFallthroughCasesInSwitch": true, + "forceConsistentCasingInFileNames": true, + "moduleResolution": "NodeNext", + "allowSyntheticDefaultImports": true, + "esModuleInterop": true + }, + "include": ["src/**/*.ts"] +} diff --git a/packages/typespec-test/test/AppService/spec/AppServiceEnvironmentResource.tsp b/packages/typespec-test/test/AppService/spec/AppServiceEnvironmentResource.tsp new file mode 100644 index 0000000000..b6a1226c0d --- /dev/null +++ b/packages/typespec-test/test/AppService/spec/AppServiceEnvironmentResource.tsp @@ -0,0 +1,109 @@ +import "@azure-tools/typespec-azure-core"; +import "@azure-tools/typespec-azure-resource-manager"; +import "@typespec/openapi"; +import "@typespec/rest"; +import "./models.tsp"; + +using TypeSpec.Rest; +using Azure.ResourceManager; +using TypeSpec.Http; +using TypeSpec.OpenAPI; + +namespace Microsoft.Web; +/** + * App Service Environment ARM resource. + */ +model AppServiceEnvironmentResource + is Azure.ResourceManager.TrackedResource { + ...ResourceNameParameter< + Resource = AppServiceEnvironmentResource, + KeyName = "name", + SegmentName = "hostingEnvironments", + NamePattern = "" + >; + + /** Kind of resource. If the resource is an app, you can refer to https://github.com/Azure/app-service-linux-docs/blob/master/Things_You_Should_Know/kind_property.md#app-service-resource-kind-reference for details supported values for kind. */ + #suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-envelope-property" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + kind?: string; +} + +alias DiagnosticsOps = Azure.ResourceManager.Legacy.RoutedOperations< + { + ...ApiVersionParameter; + ...SubscriptionIdParameter; + ...ResourceGroupParameter; + }, + { + /** Name of the app. */ + @path + @segment("hostingEnvironments") + @key + name: string; + }, + ResourceRoute = #{ + route: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.Web/hostingEnvironments", + } +>; + +@armResourceOperations(#{ allowStaticRoutes: true }) +interface AppServiceEnvironmentResources { + /** + * Description for Move an App Service Environment to a different VNET. + */ + #suppress "@azure-tools/typespec-azure-resource-manager/no-response-body" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + @summary("Move an App Service Environment to a different VNET.") + @action("changeVirtualNetwork") + @list + changeVnet is Azure.ResourceManager.ArmResourceActionAsyncBase< + AppServiceEnvironmentResource, + VirtualNetworkProfile, + ArmResponse | (ArmAcceptedLroResponse> & { + @bodyRoot + _: WebAppCollection; + }), + BaseParameters = Azure.ResourceManager.Foundations.DefaultBaseParameters, + Error = DefaultErrorResponse + >; + + /** + * Description for Resume an App Service Environment. + */ + #suppress "@azure-tools/typespec-azure-resource-manager/no-response-body" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + @summary("Resume an App Service Environment.") + @list + resume is ArmResourceActionAsyncBase< + AppServiceEnvironmentResource, + void, + ArmResponse | (ArmAcceptedLroResponse> & { + @bodyRoot + _: WebAppCollection; + }), + BaseParameters = Azure.ResourceManager.Foundations.DefaultBaseParameters, + Error = DefaultErrorResponse + >; + + /** + * Description for Suspend an App Service Environment. + */ + #suppress "@azure-tools/typespec-azure-resource-manager/no-response-body" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + @summary("Suspend an App Service Environment.") + @list + suspend is ArmResourceActionAsyncBase< + AppServiceEnvironmentResource, + void, + ArmResponse | (ArmAcceptedLroResponse> & { + @bodyRoot + _: WebAppCollection; + }), + BaseParameters = Azure.ResourceManager.Foundations.DefaultBaseParameters, + Error = DefaultErrorResponse + >; +} + +@@doc(AppServiceEnvironmentResource.name, + "Name of the App Service Environment." +); +@@doc(AppServiceEnvironmentResource.properties, "Core resource properties"); +@@doc(AppServiceEnvironmentResources.changeVnet::parameters.body, + "Details for the new virtual network." +); diff --git a/packages/typespec-test/test/AppService/spec/back-compatible.tsp b/packages/typespec-test/test/AppService/spec/back-compatible.tsp new file mode 100644 index 0000000000..66a65a7f9e --- /dev/null +++ b/packages/typespec-test/test/AppService/spec/back-compatible.tsp @@ -0,0 +1,322 @@ +import "@azure-tools/typespec-client-generator-core"; + +using Azure.ClientGenerator.Core; +using Azure.ClientGenerator.Core.Legacy; +using Microsoft.Web; + +#suppress "@azure-tools/typespec-azure-core/no-legacy-usage" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +@@flattenProperty(AppServiceEnvironmentPatchResource.properties); + +#suppress "@azure-tools/typespec-azure-core/no-legacy-usage" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +@@flattenProperty(PushSettings.properties); + +#suppress "@azure-tools/typespec-azure-core/no-legacy-usage" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +@@flattenProperty(ResourceMetricDefinition.properties); + +#suppress "@azure-tools/typespec-azure-core/no-legacy-usage" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +@@flattenProperty(Microsoft.Web.Usage.properties); + +#suppress "@azure-tools/typespec-azure-core/no-legacy-usage" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +@@flattenProperty(AppServicePlanPatchResource.properties); + +#suppress "@azure-tools/typespec-azure-core/no-legacy-usage" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +@@flattenProperty(HybridConnectionKey.properties); + +#suppress "@azure-tools/typespec-azure-core/no-legacy-usage" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +@@flattenProperty(CertificatePatchResource.properties); + +#suppress "@azure-tools/typespec-azure-core/no-legacy-usage" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +@@flattenProperty(DiagnosticAnalysis.properties); + +#suppress "@azure-tools/typespec-azure-core/no-legacy-usage" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +@@flattenProperty(DiagnosticDetectorResponse.properties); + +#suppress "@azure-tools/typespec-azure-core/no-legacy-usage" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +@@flattenProperty(Snapshot.properties); + +#suppress "@azure-tools/typespec-azure-core/no-legacy-usage" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +@@flattenProperty(KubeEnvironmentPatchResource.properties); + +#suppress "@azure-tools/typespec-azure-core/no-legacy-usage" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +@@flattenProperty(ApplicationStackResource.properties); + +#suppress "@azure-tools/typespec-azure-core/no-legacy-usage" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +@@flattenProperty(FunctionAppStack.properties); + +#suppress "@azure-tools/typespec-azure-core/no-legacy-usage" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +@@flattenProperty(WebAppStack.properties); + +#suppress "@azure-tools/typespec-azure-core/no-legacy-usage" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +@@flattenProperty(Recommendation.properties); + +#suppress "@azure-tools/typespec-azure-core/no-legacy-usage" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +@@flattenProperty(BillingMeter.properties); + +#suppress "@azure-tools/typespec-azure-core/no-legacy-usage" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +@@flattenProperty(CustomHostnameSites.properties); + +@@clientName(IdentifierProperties.id, "value"); + +#suppress "@azure-tools/typespec-azure-core/no-legacy-usage" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +@@flattenProperty(GeoRegion.properties); + +#suppress "@azure-tools/typespec-azure-core/no-legacy-usage" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +@@flattenProperty(AseRegion.properties); + +#suppress "@azure-tools/typespec-azure-core/no-legacy-usage" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +@@flattenProperty(PremierAddOnOffer.properties); + +#suppress "@azure-tools/typespec-azure-core/no-legacy-usage" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +@@flattenProperty(VnetParameters.properties); + +#suppress "@azure-tools/typespec-azure-core/no-legacy-usage" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +@@flattenProperty(VnetValidationFailureDetails.properties); + +#suppress "@azure-tools/typespec-azure-core/no-legacy-usage" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +@@flattenProperty(VnetValidationTestFailure.properties); + +#suppress "@azure-tools/typespec-azure-core/no-legacy-usage" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +@@flattenProperty(ValidateRequest.properties); + +#suppress "@azure-tools/typespec-azure-core/no-legacy-usage" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +@@flattenProperty(StaticSitesWorkflowPreviewRequest.properties); + +#suppress "@azure-tools/typespec-azure-core/no-legacy-usage" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +@@flattenProperty(StaticSitesWorkflowPreview.properties); + +#suppress "@azure-tools/typespec-azure-core/no-legacy-usage" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +@@flattenProperty(RemotePrivateEndpointConnection.properties); + +#suppress "@azure-tools/typespec-azure-core/no-legacy-usage" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +@@flattenProperty(StaticSiteUserProvidedFunctionApp.properties); + +#suppress "@azure-tools/typespec-azure-core/no-legacy-usage" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +@@flattenProperty(StaticSitePatchResource.properties); + +#suppress "@azure-tools/typespec-azure-core/no-legacy-usage" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +@@flattenProperty(StaticSiteUserARMResource.properties); + +#suppress "@azure-tools/typespec-azure-core/no-legacy-usage" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +@@flattenProperty(StringDictionary.properties); + +#suppress "@azure-tools/typespec-azure-core/no-legacy-usage" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +@@flattenProperty(DatabaseConnectionPatchRequest.properties); + +#suppress "@azure-tools/typespec-azure-core/no-legacy-usage" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +@@flattenProperty(StaticSiteFunctionOverviewARMResource.properties); + +#suppress "@azure-tools/typespec-azure-core/no-legacy-usage" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +@@flattenProperty(StaticSiteZipDeploymentARMResource.properties); + +#suppress "@azure-tools/typespec-azure-core/no-legacy-usage" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +@@flattenProperty(StaticSiteUserInvitationRequestResource.properties); + +#suppress "@azure-tools/typespec-azure-core/no-legacy-usage" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +@@flattenProperty(StaticSiteUserInvitationResponseResource.properties); + +#suppress "@azure-tools/typespec-azure-core/no-legacy-usage" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +@@flattenProperty(StaticSiteCustomDomainRequestPropertiesARMResource.properties +); + +#suppress "@azure-tools/typespec-azure-core/no-legacy-usage" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +@@flattenProperty(StaticSiteResetPropertiesARMResource.properties); + +#suppress "@azure-tools/typespec-azure-core/no-legacy-usage" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +@@flattenProperty(SitePatchResource.properties); + +#suppress "@azure-tools/typespec-azure-core/no-legacy-usage" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +@@flattenProperty(CustomHostnameAnalysisResult.properties); + +#suppress "@azure-tools/typespec-azure-core/no-legacy-usage" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +@@flattenProperty(BackupRequest.properties); + +@@clientName(BackupItemProperties.id, "BackupId"); + +#suppress "@azure-tools/typespec-azure-core/no-legacy-usage" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +@@flattenProperty(RestoreRequest.properties); + +#suppress "@azure-tools/typespec-azure-core/no-legacy-usage" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +@@flattenProperty(SiteAuthSettings.properties); + +#suppress "@azure-tools/typespec-azure-core/no-legacy-usage" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +@@flattenProperty(AzureStoragePropertyDictionaryResource.properties); + +#suppress "@azure-tools/typespec-azure-core/no-legacy-usage" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +@@flattenProperty(ConnectionStringDictionary.properties); + +#suppress "@azure-tools/typespec-azure-core/no-legacy-usage" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +@@flattenProperty(SiteConfigurationSnapshotInfo.properties); + +@@clientName(ContinuousWebJobProperties.detailed_status, "detailedStatus"); +@@clientName(ContinuousWebJobProperties.log_url, "logUrl"); +@@clientName(ContinuousWebJobProperties.run_command, "runCommand"); +@@clientName(ContinuousWebJobProperties.extra_info_url, "extraInfoUrl"); +@@clientName(ContinuousWebJobProperties.web_job_type, "webJobType"); +@@clientName(ContinuousWebJobProperties.using_sdk, "usingSdk"); + +@@clientName(DeploymentProperties.author_email, "authorEmail"); +@@clientName(DeploymentProperties.start_time, "startTime"); +@@clientName(DeploymentProperties.end_time, "endTime"); + +#suppress "@azure-tools/typespec-azure-core/no-legacy-usage" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +@@flattenProperty(MSDeploy.properties); + +#suppress "@azure-tools/typespec-azure-core/no-legacy-usage" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +@@flattenProperty(MSDeployLog.properties); + +@@clientName(FunctionEnvelopeProperties.function_app_id, "functionAppId"); +@@clientName(FunctionEnvelopeProperties.script_root_path_href, + "scriptRootPathHref" +); +@@clientName(FunctionEnvelopeProperties.script_href, "scriptHref"); +@@clientName(FunctionEnvelopeProperties.config_href, "configHref"); +@@clientName(FunctionEnvelopeProperties.test_data_href, "testDataHref"); +@@clientName(FunctionEnvelopeProperties.secrets_file_href, "secretsFileHref"); +@@clientName(FunctionEnvelopeProperties.test_data, "testData"); +@@clientName(FunctionEnvelopeProperties.invoke_url_template, + "invokeUrlTemplate" +); + +@@clientName(FunctionSecrets.trigger_url, "triggerUrl"); + +@@clientName(ProcessInfoProperties.deployment_name, "deploymentName"); +@@clientName(ProcessInfoProperties.is_profile_running, "isProfileRunning"); +@@clientName(ProcessInfoProperties.is_iis_profile_running, + "isIisProfileRunning" +); +@@clientName(ProcessInfoProperties.iis_profile_timeout_in_seconds, + "iisProfileTimeoutInSeconds" +); +@@clientName(ProcessInfoProperties.open_file_handles, "openFileHandles"); +@@clientName(ProcessInfoProperties.file_name, "fileName"); +@@clientName(ProcessInfoProperties.command_line, "commandLine"); +@@clientName(ProcessInfoProperties.user_name, "userName"); +@@clientName(ProcessInfoProperties.handle_count, "handleCount"); +@@clientName(ProcessInfoProperties.module_count, "moduleCount"); +@@clientName(ProcessInfoProperties.thread_count, "threadCount"); +@@clientName(ProcessInfoProperties.start_time, "startTime"); +@@clientName(ProcessInfoProperties.total_cpu_time, "totalCpuTime"); +@@clientName(ProcessInfoProperties.user_cpu_time, "userCpuTime"); +@@clientName(ProcessInfoProperties.privileged_cpu_time, "privilegedCpuTime"); +@@clientName(ProcessInfoProperties.working_set, "workingSet"); +@@clientName(ProcessInfoProperties.peak_working_set, "peakWorkingSet"); +@@clientName(ProcessInfoProperties.private_memory, "privateMemory"); +@@clientName(ProcessInfoProperties.virtual_memory, "virtualMemory"); +@@clientName(ProcessInfoProperties.peak_virtual_memory, "peakVirtualMemory"); +@@clientName(ProcessInfoProperties.paged_system_memory, "pagedSystemMemory"); +@@clientName(ProcessInfoProperties.non_paged_system_memory, + "nonPagedSystemMemory" +); +@@clientName(ProcessInfoProperties.paged_memory, "pagedMemory"); +@@clientName(ProcessInfoProperties.peak_paged_memory, "peakPagedMemory"); +@@clientName(ProcessInfoProperties.time_stamp, "timeStamp"); +@@clientName(ProcessInfoProperties.environment_variables, + "environmentVariables" +); +@@clientName(ProcessInfoProperties.is_scm_site, "isScmSite"); +@@clientName(ProcessInfoProperties.is_webjob, "isWebjob"); + +#suppress "@azure-tools/typespec-azure-core/no-legacy-usage" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +@@flattenProperty(ProcessThreadInfo.properties); + +@@clientName(ProcessThreadInfoProperties.start_address, "startAddress"); +@@clientName(ProcessThreadInfoProperties.current_priority, "currentPriority"); +@@clientName(ProcessThreadInfoProperties.priority_level, "priorityLevel"); +@@clientName(ProcessThreadInfoProperties.base_priority, "basePriority"); +@@clientName(ProcessThreadInfoProperties.start_time, "startTime"); +@@clientName(ProcessThreadInfoProperties.total_processor_time, + "totalProcessorTime" +); +@@clientName(ProcessThreadInfoProperties.user_processor_time, + "userProcessorTime" +); +@@clientName(ProcessThreadInfoProperties.wait_reason, "waitReason"); + +@@clientName(ProcessModuleInfoProperties.base_address, "baseAddress"); +@@clientName(ProcessModuleInfoProperties.file_name, "fileName"); +@@clientName(ProcessModuleInfoProperties.file_path, "filePath"); +@@clientName(ProcessModuleInfoProperties.module_memory_size, + "moduleMemorySize" +); +@@clientName(ProcessModuleInfoProperties.file_version, "fileVersion"); +@@clientName(ProcessModuleInfoProperties.file_description, "fileDescription"); +@@clientName(ProcessModuleInfoProperties.product_version, "productVersion"); +@@clientName(ProcessModuleInfoProperties.is_debug, "isDebug"); + +#suppress "@azure-tools/typespec-azure-core/no-legacy-usage" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +@@flattenProperty(StorageMigrationOptions.properties); + +#suppress "@azure-tools/typespec-azure-core/no-legacy-usage" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +@@flattenProperty(StorageMigrationResponse.properties); + +#suppress "@azure-tools/typespec-azure-core/no-legacy-usage" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +@@flattenProperty(MigrateMySqlRequest.properties); + +#suppress "@azure-tools/typespec-azure-core/no-legacy-usage" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +@@flattenProperty(SitePhpErrorLogFlag.properties); + +#suppress "@azure-tools/typespec-azure-core/no-legacy-usage" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +@@flattenProperty(PremierAddOnPatchResource.properties); + +#suppress "@azure-tools/typespec-azure-core/no-legacy-usage" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +@@flattenProperty(DeletedAppRestoreRequest.properties); + +#suppress "@azure-tools/typespec-azure-core/no-legacy-usage" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +@@flattenProperty(SnapshotRestoreRequest.properties); + +@@clientName(SiteExtensionInfoProperties.extension_id, "extensionId"); +@@clientName(SiteExtensionInfoProperties.extension_type, "extensionType"); +@@clientName(SiteExtensionInfoProperties.extension_url, "extensionUrl"); +@@clientName(SiteExtensionInfoProperties.project_url, "projectUrl"); +@@clientName(SiteExtensionInfoProperties.icon_url, "iconUrl"); +@@clientName(SiteExtensionInfoProperties.license_url, "licenseUrl"); +@@clientName(SiteExtensionInfoProperties.feed_url, "feedUrl"); +@@clientName(SiteExtensionInfoProperties.installer_command_line_params, + "installerCommandLineParams" +); +@@clientName(SiteExtensionInfoProperties.published_date_time, + "publishedDateTime" +); +@@clientName(SiteExtensionInfoProperties.download_count, "downloadCount"); +@@clientName(SiteExtensionInfoProperties.local_is_latest_version, + "localIsLatestVersion" +); +@@clientName(SiteExtensionInfoProperties.local_path, "localPath"); +@@clientName(SiteExtensionInfoProperties.installed_date_time, + "installedDateTime" +); + +#suppress "@azure-tools/typespec-azure-core/no-legacy-usage" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +@@flattenProperty(SlotDifference.properties); + +@@clientName(TriggeredWebJobProperties.latest_run, "latestRun"); +@@clientName(TriggeredWebJobProperties.history_url, "historyUrl"); +@@clientName(TriggeredWebJobProperties.scheduler_logs_url, "schedulerLogsUrl"); +@@clientName(TriggeredWebJobProperties.run_command, "runCommand"); +@@clientName(TriggeredWebJobProperties.extra_info_url, "extraInfoUrl"); +@@clientName(TriggeredWebJobProperties.web_job_type, "webJobType"); +@@clientName(TriggeredWebJobProperties.using_sdk, "usingSdk"); + +@@clientName(TriggeredJobRun.web_job_id, "webJobId"); +@@clientName(TriggeredJobRun.web_job_name, "webJobName"); +@@clientName(TriggeredJobRun.start_time, "startTime"); +@@clientName(TriggeredJobRun.end_time, "endTime"); +@@clientName(TriggeredJobRun.output_url, "outputUrl"); +@@clientName(TriggeredJobRun.error_url, "errorUrl"); +@@clientName(TriggeredJobRun.job_name, "jobName"); + +@@clientName(WebJobProperties.run_command, "runCommand"); +@@clientName(WebJobProperties.extra_info_url, "extraInfoUrl"); +@@clientName(WebJobProperties.web_job_type, "webJobType"); +@@clientName(WebJobProperties.using_sdk, "usingSdk"); + +@@clientName(WorkflowTriggerListCallbackUrlQueries.`api-version`, "apiVersion"); + +#suppress "@azure-tools/typespec-azure-core/no-legacy-usage" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +@@flattenProperty(Workflow.properties); + +#suppress "@azure-tools/typespec-azure-core/no-legacy-usage" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +@@flattenProperty(PrivateLinkConnectionApprovalRequestResource.properties); + +#suppress "@azure-tools/typespec-azure-core/no-legacy-usage" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +@@flattenProperty(AppServiceEnvironmentResource.properties); diff --git a/packages/typespec-test/test/AppService/spec/client.tsp b/packages/typespec-test/test/AppService/spec/client.tsp new file mode 100644 index 0000000000..157a6fd7ae --- /dev/null +++ b/packages/typespec-test/test/AppService/spec/client.tsp @@ -0,0 +1,180 @@ +import "./main.tsp"; +import "@azure-tools/typespec-azure-resource-manager"; +import "@azure-tools/typespec-client-generator-core"; + +using Http; +using Azure.ClientGenerator.Core; +using Microsoft.Web; +using Azure.ResourceManager; + +// python +@@clientName(Microsoft.Web, "WebSiteManagementClient", "python, javascript"); + +@@clientName(SupportedTlsVersions.`1.0`, "ONE0", "python"); +@@clientName(SupportedTlsVersions.`1.1`, "ONE1", "python"); +@@clientName(SupportedTlsVersions.`1.2`, "ONE2", "python"); +@@clientName(SupportedTlsVersions.`1.3`, "ONE3", "python"); + +@@clientName(SupportedTlsVersions.`1.0`, "One0", "go, javascript"); +@@clientName(SupportedTlsVersions.`1.1`, "One1", "go, javascript"); +@@clientName(SupportedTlsVersions.`1.2`, "One2", "go, javascript"); +@@clientName(SupportedTlsVersions.`1.3`, "One3", "go, javascript"); + +@@clientName(TlsCipherSuites.TLS_AES_256_GCM_SHA384, + "TLS_AES256_GCM_SHA384", + "python" +); +@@clientName(TlsCipherSuites.TLS_AES_128_GCM_SHA256, + "TLS_AES128_GCM_SHA256", + "python" +); +@@clientName(TlsCipherSuites.TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384, + "TLS_ECDHE_ECDSA_WITH_AES256_GCM_SHA384", + "python" +); +@@clientName(TlsCipherSuites.TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256, + "TLS_ECDHE_ECDSA_WITH_AES128_CBC_SHA256", + "python" +); +@@clientName(TlsCipherSuites.TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256, + "TLS_ECDHE_ECDSA_WITH_AES128_GCM_SHA256", + "python" +); +@@clientName(TlsCipherSuites.TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384, + "TLS_ECDHE_RSA_WITH_AES256_GCM_SHA384", + "python" +); +@@clientName(TlsCipherSuites.TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256, + "TLS_ECDHE_RSA_WITH_AES128_GCM_SHA256", + "python" +); +@@clientName(TlsCipherSuites.TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384, + "TLS_ECDHE_RSA_WITH_AES256_CBC_SHA384", + "python" +); +@@clientName(TlsCipherSuites.TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256, + "TLS_ECDHE_RSA_WITH_AES128_CBC_SHA256", + "python" +); +@@clientName(TlsCipherSuites.TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA, + "TLS_ECDHE_RSA_WITH_AES256_CBC_SHA", + "python" +); +@@clientName(TlsCipherSuites.TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA, + "TLS_ECDHE_RSA_WITH_AES128_CBC_SHA", + "python" +); +@@clientName(TlsCipherSuites.TLS_RSA_WITH_AES_256_GCM_SHA384, + "TLS_RSA_WITH_AES256_GCM_SHA384", + "python" +); +@@clientName(TlsCipherSuites.TLS_RSA_WITH_AES_128_GCM_SHA256, + "TLS_RSA_WITH_AES128_GCM_SHA256", + "python" +); +@@clientName(TlsCipherSuites.TLS_RSA_WITH_AES_256_CBC_SHA256, + "TLS_RSA_WITH_AES256_CBC_SHA256", + "python" +); +@@clientName(TlsCipherSuites.TLS_RSA_WITH_AES_128_CBC_SHA256, + "TLS_RSA_WITH_AES128_CBC_SHA256", + "python" +); +@@clientName(TlsCipherSuites.TLS_RSA_WITH_AES_256_CBC_SHA, + "TLS_RSA_WITH_AES256_CBC_SHA", + "python" +); +@@clientName(TlsCipherSuites.TLS_RSA_WITH_AES_128_CBC_SHA, + "TLS_RSA_WITH_AES128_CBC_SHA", + "python" +); + +#suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-operation" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +op diagnosticsExecuteSiteAnalysisSlotCustomized( + ...ApiVersionParameter, + ...SubscriptionIdParameter, + ...ResourceGroupParameter, + ...Azure.ResourceManager.Legacy.Provider, + + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + @path + siteName: string, + + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + @path + diagnosticCategory: string, + + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + @path + analysisName: string, + + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + @path + slot: string, + + /** + * Start Time + */ + @query("startTime") + startTime?: utcDateTime, + + /** + * End Time + */ + @query("endTime") + endTime?: utcDateTime, + + /** + * Time Grain + */ + @pattern("PT[1-9][0-9]+[SMH]") + @query("timeGrain") + timeGrain?: string, + + @body + body: void, +): ArmResponse; + +#suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-operation" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +op diagnosticsExecuteSiteDetectorCustomized( + ...ApiVersionParameter, + ...SubscriptionIdParameter, + ...ResourceGroupParameter, + ...Azure.ResourceManager.Legacy.Provider, + + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + @path + siteName: string, + + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + @path + detectorName: string, + + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + @path + diagnosticCategory: string, + + /** + * Start Time + */ + @query("startTime") + startTime?: utcDateTime, + + /** + * End Time + */ + @query("endTime") + endTime?: utcDateTime, + + /** + * Time Grain + */ + @pattern("PT[1-9][0-9]+[SMH]") + @query("timeGrain") + timeGrain?: string, + + @body + body: void, +): ArmResponse; diff --git a/packages/typespec-test/test/AppService/spec/main.tsp b/packages/typespec-test/test/AppService/spec/main.tsp new file mode 100644 index 0000000000..28041d6ece --- /dev/null +++ b/packages/typespec-test/test/AppService/spec/main.tsp @@ -0,0 +1,51 @@ +/** + * PLEASE DO NOT REMOVE - USED FOR CONVERTER METRICS + * Generated by package: @autorest/openapi-to-typespec + * Parameters used: + * isFullCompatible: true + * guessResourceKey: false + * Version: 0.11.5 + * Date: 2025-08-05T08:47:43.934Z + */ +import "@typespec/rest"; +import "@typespec/versioning"; +import "@azure-tools/typespec-azure-core"; +import "@azure-tools/typespec-azure-resource-manager"; +import "./models.tsp"; +import "./back-compatible.tsp"; +import "./AppServiceEnvironmentResource.tsp"; +import "./routes.tsp"; + +using TypeSpec.Rest; +using TypeSpec.Http; +using Azure.ResourceManager.Foundations; +using Azure.Core; +using Azure.ResourceManager; +using TypeSpec.Versioning; + +@armProviderNamespace +@service(#{ title: "WebApps API Client" }) +@versioned(Versions) +@armCommonTypesVersion(Azure.ResourceManager.CommonTypes.Versions.v5) +namespace Microsoft.Web; + +/** + * The available API versions. + */ +enum Versions { + /** + * The 2025-03-01 API version. + */ + v2025_03_01: "2025-03-01", + + /** + * The 2025-05-01 API version. + */ + v2025_05_01: "2025-05-01", +} + +interface Operations + extends Azure.ResourceManager.Legacy.Operations< + ArmResponse, + DefaultErrorResponse + > {} diff --git a/packages/typespec-test/test/AppService/spec/models.tsp b/packages/typespec-test/test/AppService/spec/models.tsp new file mode 100644 index 0000000000..3807f5e50f --- /dev/null +++ b/packages/typespec-test/test/AppService/spec/models.tsp @@ -0,0 +1,15732 @@ +import "@typespec/versioning"; +import "@typespec/rest"; +import "@typespec/http"; +import "@azure-tools/typespec-azure-core"; +import "@azure-tools/typespec-azure-resource-manager"; + +using TypeSpec.Rest; +using TypeSpec.Http; +using Azure.ResourceManager; +using Azure.ResourceManager.Foundations; +using Azure.Core; +using Versioning; + +namespace Microsoft.Web; + +#suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +@mediaTypeHint("application/json") +scalar stringApplicationJson extends string; + +#suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +@error +model ArmBadRequestResponse { + ...TypeSpec.Http.Response<400>; +} + +#suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +@error +model ArmNotFoundResponse { + ...TypeSpec.Http.Response<404>; +} + +#suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +@error +model ArmConflictResponse { + ...TypeSpec.Http.Response<409>; +} + +#suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +@error +model ArmTooManyRequestsResponse { + ...TypeSpec.Http.Response<429>; +} + +/** + * Specifies which endpoints to serve internally in the Virtual Network for the App Service Environment. + */ +union LoadBalancingMode { + string, + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + None: "None", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + Web: "Web", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + Publishing: "Publishing", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + `Web, Publishing`: "Web, Publishing", +} + +/** + * Upgrade Preference + */ +union UpgradePreference { + string, + + /** + * No preference on when this App Service Environment will be upgraded + */ + None: "None", + + /** + * This App Service Environment will be upgraded before others in the same region that have Upgrade Preference 'Late' + */ + Early: "Early", + + /** + * This App Service Environment will be upgraded after others in the same region that have Upgrade Preference 'Early' + */ + Late: "Late", + + /** + * ASEv3 only. Once an upgrade is available, this App Service Environment will wait 10 days for the upgrade to be manually initiated. After 10 days the upgrade will begin automatically + */ + Manual: "Manual", +} + +/** + * Whether an upgrade is available for this App Service Environment. + */ +union UpgradeAvailability { + string, + + /** + * No upgrade is currently available for this App Service Environment + */ + None: "None", + + /** + * An upgrade is ready to be manually initiated on this App Service Environment + */ + Ready: "Ready", +} + +/** + * SCM type. + */ +union ScmType { + string, + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + None: "None", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + Dropbox: "Dropbox", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + Tfs: "Tfs", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + LocalGit: "LocalGit", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + GitHub: "GitHub", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + CodePlexGit: "CodePlexGit", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + CodePlexHg: "CodePlexHg", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + BitbucketGit: "BitbucketGit", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + BitbucketHg: "BitbucketHg", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + ExternalGit: "ExternalGit", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + ExternalHg: "ExternalHg", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + OneDrive: "OneDrive", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + VSO: "VSO", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + VSTSRM: "VSTSRM", +} + +/** + * Defines what this IP filter will be used for. This is to support IP filtering on proxies. + */ +union IpFilterTag { + string, + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + Default: "Default", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + XffProxy: "XffProxy", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + ServiceTag: "ServiceTag", +} + +/** + * Default action for main access restriction if no rules are matched. + */ +union DefaultAction { + string, + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + Allow: "Allow", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + Deny: "Deny", +} + +/** + * MinTlsVersion: configures the minimum version of TLS required for SSL requests + */ +union SupportedTlsVersions { + string, + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + `1.0`: "1.0", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + `1.1`: "1.1", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + `1.2`: "1.2", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + `1.3`: "1.3", +} + +/** + * The minimum strength TLS cipher suite allowed for an application + */ +union TlsCipherSuites { + string, + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + TLS_AES_256_GCM_SHA384: "TLS_AES_256_GCM_SHA384", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + TLS_AES_128_GCM_SHA256: "TLS_AES_128_GCM_SHA256", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384: "TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256: "TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256: "TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384: "TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256: "TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384: "TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256: "TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA: "TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA: "TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + TLS_RSA_WITH_AES_256_GCM_SHA384: "TLS_RSA_WITH_AES_256_GCM_SHA384", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + TLS_RSA_WITH_AES_128_GCM_SHA256: "TLS_RSA_WITH_AES_128_GCM_SHA256", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + TLS_RSA_WITH_AES_256_CBC_SHA256: "TLS_RSA_WITH_AES_256_CBC_SHA256", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + TLS_RSA_WITH_AES_128_CBC_SHA256: "TLS_RSA_WITH_AES_128_CBC_SHA256", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + TLS_RSA_WITH_AES_256_CBC_SHA: "TLS_RSA_WITH_AES_256_CBC_SHA", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + TLS_RSA_WITH_AES_128_CBC_SHA: "TLS_RSA_WITH_AES_128_CBC_SHA", +} + +/** + * State of FTP / FTPS service + */ +union FtpsState { + string, + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + AllAllowed: "AllAllowed", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + FtpsOnly: "FtpsOnly", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + Disabled: "Disabled", +} + +/** + * Mounting protocol to use for the storage account. + */ +union AzureStorageProtocol { + string, + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + Smb: "Smb", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + Http: "Http", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + Nfs: "Nfs", +} + +/** + * Property to select Azure Storage type. Available options: blobContainer. + */ +union FunctionsDeploymentStorageType { + string, + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + blobContainer: "blobContainer", +} + +/** + * Property to select authentication type to access the selected storage account. Available options: SystemAssignedIdentity, UserAssignedIdentity, StorageAccountConnectionString. + */ +union AuthenticationType { + string, + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + SystemAssignedIdentity: "SystemAssignedIdentity", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + UserAssignedIdentity: "UserAssignedIdentity", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + StorageAccountConnectionString: "StorageAccountConnectionString", +} + +/** + * Function app runtime name. Available options: dotnet-isolated, node, java, powershell, python, custom + */ +union RuntimeName { + string, + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + `dotnet-isolated`: "dotnet-isolated", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + node: "node", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + java: "java", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + powershell: "powershell", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + python: "python", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + custom: "custom", +} + +/** + * Function app site update strategy type. Available options: Recreate, RollingUpdate + */ +@added(Versions.v2025_05_01) +union SiteUpdateStrategyType { + string, + + /** + * If the app is under load and a deployment or site state update occurs, all pods will be removed + * and will need to be Recreated all at once. This is the default behavior. + */ + Recreate: "Recreate", + + /** + * If the app is under load and a deployment or site state update occurs, pods will be drained in + * batches and gradually replaced, thus minimizing impact to throughput. + */ + RollingUpdate: "RollingUpdate", +} + +/** + * Sets the log level for the Dapr sidecar. Allowed values are debug, info, warn, error. Default is info. + */ +union DaprLogLevel { + string, + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + info: "info", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + debug: "debug", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + warn: "warn", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + error: "error", +} + +/** + * The type of route this is: + * DEFAULT - By default, every app has routes to the local address ranges specified by RFC1918 + * INHERITED - Routes inherited from the real Virtual Network routes + * STATIC - Static route set on the app only + * + * These values will be used for syncing an app's routes with those from a Virtual Network. + */ +union RouteType { + string, + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + DEFAULT: "DEFAULT", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + INHERITED: "INHERITED", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + STATIC: "STATIC", +} + +#suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +union ProviderOsTypeSelected { + string, + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + Windows: "Windows", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + Linux: "Linux", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + WindowsFunctions: "WindowsFunctions", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + LinuxFunctions: "LinuxFunctions", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + All: "All", +} + +#suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +union ProviderStackOsType { + string, + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + Windows: "Windows", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + Linux: "Linux", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + All: "All", +} + +/** + * Name of a resource type this recommendation applies, e.g. Subscription, ServerFarm, Site. + */ +union ResourceScopeType { + string, + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + ServerFarm: "ServerFarm", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + Subscription: "Subscription", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + WebSite: "WebSite", +} + +/** + * Resource type used for verification. + */ +union CheckNameResourceTypes { + string, + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + Site: "Site", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + Slot: "Slot", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + HostingEnvironment: "HostingEnvironment", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + PublishingUser: "PublishingUser", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + `Microsoft.Web/sites`: "Microsoft.Web/sites", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + `Microsoft.Web/sites/slots`: "Microsoft.Web/sites/slots", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + `Microsoft.Web/hostingEnvironments`: "Microsoft.Web/hostingEnvironments", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + `Microsoft.Web/publishingUsers`: "Microsoft.Web/publishingUsers", +} + +/** + * Invalid indicates the name provided does not match Azure App Service naming requirements. AlreadyExists indicates that the name is already in use and is therefore unavailable. + */ +union InAvailabilityReasonType { + string, + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + Invalid: "Invalid", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + AlreadyExists: "AlreadyExists", +} + +#suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +union SkuName { + string, + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + Free: "Free", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + Shared: "Shared", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + Basic: "Basic", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + Standard: "Standard", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + Premium: "Premium", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + Dynamic: "Dynamic", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + Isolated: "Isolated", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + IsolatedV2: "IsolatedV2", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + PremiumV2: "PremiumV2", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + PremiumV3: "PremiumV3", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + PremiumContainer: "PremiumContainer", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + ElasticPremium: "ElasticPremium", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + ElasticIsolated: "ElasticIsolated", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + FlexConsumption: "FlexConsumption", +} + +/** + * Resource type used for verification. + */ +union ValidateResourceTypes { + string, + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + ServerFarm: "ServerFarm", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + Site: "Site", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + `Microsoft.Web/hostingEnvironments`: "Microsoft.Web/hostingEnvironments", +} + +/** + * State indicating the status of the enterprise grade CDN serving traffic to the static web app. + */ +union EnterpriseGradeCdnStatus { + string, + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + Enabled: "Enabled", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + Enabling: "Enabling", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + Disabled: "Disabled", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + Disabling: "Disabling", +} + +/** + * The status of the static site build. + */ +union BuildStatus { + string, + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + WaitingForDeployment: "WaitingForDeployment", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + Uploading: "Uploading", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + Deploying: "Deploying", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + Ready: "Ready", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + Failed: "Failed", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + Deleting: "Deleting", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + Detached: "Detached", +} + +/** + * The trigger type of the function + */ +union TriggerTypes { + string, + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + HttpTrigger: "HttpTrigger", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + Unknown: "Unknown", +} + +#suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +union BasicAuthName { + string, + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + default: "default", +} + +/** + * The status of the custom domain + */ +union CustomDomainStatus { + string, + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + RetrievingValidationToken: "RetrievingValidationToken", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + Validating: "Validating", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + Adding: "Adding", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + Ready: "Ready", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + Failed: "Failed", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + Deleting: "Deleting", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + Unhealthy: "Unhealthy", +} + +/** + * Database type (e.g. SqlAzure / MySql). + */ +union DatabaseType { + string, + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + SqlAzure: "SqlAzure", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + MySql: "MySql", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + LocalMySql: "LocalMySql", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + PostgreSql: "PostgreSql", +} + +/** + * Deployment build status. + */ +union DeploymentBuildStatus { + string, + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + TimedOut: "TimedOut", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + RuntimeFailed: "RuntimeFailed", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + BuildAborted: "BuildAborted", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + BuildFailed: "BuildFailed", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + BuildRequestReceived: "BuildRequestReceived", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + BuildPending: "BuildPending", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + BuildInProgress: "BuildInProgress", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + BuildSuccessful: "BuildSuccessful", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + PostBuildRestartRequired: "PostBuildRestartRequired", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + StartPolling: "StartPolling", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + StartPollingWithRestart: "StartPollingWithRestart", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + RuntimeStarting: "RuntimeStarting", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + RuntimeSuccessful: "RuntimeSuccessful", +} + +/** + * Name of the format. Valid values are: + * FileZilla3 + * WebDeploy -- default + * Ftp + */ +union PublishingProfileFormat { + string, + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + FileZilla3: "FileZilla3", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + WebDeploy: "WebDeploy", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + Ftp: "Ftp", +} + +/** + * The workflow state. + */ +union WorkflowState { + string, + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + NotSpecified: "NotSpecified", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + Completed: "Completed", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + Enabled: "Enabled", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + Disabled: "Disabled", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + Deleted: "Deleted", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + Suspended: "Suspended", +} + +/** + * The key type. + */ +union KeyType { + string, + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + NotSpecified: "NotSpecified", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + Primary: "Primary", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + Secondary: "Secondary", +} + +/** + * The workflow status. + */ +union WorkflowStatus { + string, + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + NotSpecified: "NotSpecified", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + Paused: "Paused", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + Running: "Running", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + Waiting: "Waiting", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + Succeeded: "Succeeded", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + Skipped: "Skipped", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + Suspended: "Suspended", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + Cancelled: "Cancelled", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + Failed: "Failed", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + Faulted: "Faulted", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + TimedOut: "TimedOut", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + Aborted: "Aborted", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + Ignored: "Ignored", +} + +/** + * The parameter type. + */ +union ParameterType { + string, + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + NotSpecified: "NotSpecified", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + String: "String", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + SecureString: "SecureString", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + Int: "Int", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + Float: "Float", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + Bool: "Bool", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + Array: "Array", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + Object: "Object", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + SecureObject: "SecureObject", +} + +/** + * The workflow trigger provisioning state. + */ +union WorkflowTriggerProvisioningState { + string, + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + NotSpecified: "NotSpecified", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + Accepted: "Accepted", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + Running: "Running", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + Ready: "Ready", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + Creating: "Creating", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + Created: "Created", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + Deleting: "Deleting", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + Deleted: "Deleted", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + Canceled: "Canceled", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + Failed: "Failed", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + Succeeded: "Succeeded", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + Moving: "Moving", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + Updating: "Updating", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + Registering: "Registering", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + Registered: "Registered", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + Unregistering: "Unregistering", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + Unregistered: "Unregistered", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + Completed: "Completed", +} + +/** + * The recurrence frequency. + */ +union RecurrenceFrequency { + string, + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + NotSpecified: "NotSpecified", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + Second: "Second", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + Minute: "Minute", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + Hour: "Hour", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + Day: "Day", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + Week: "Week", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + Month: "Month", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + Year: "Year", +} + +/** + * The workflow provisioning state. + */ +union WorkflowProvisioningState { + string, + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + NotSpecified: "NotSpecified", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + Accepted: "Accepted", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + Running: "Running", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + Ready: "Ready", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + Creating: "Creating", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + Created: "Created", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + Deleting: "Deleting", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + Deleted: "Deleted", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + Canceled: "Canceled", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + Failed: "Failed", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + Succeeded: "Succeeded", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + Moving: "Moving", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + Updating: "Updating", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + Registering: "Registering", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + Registered: "Registered", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + Unregistering: "Unregistering", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + Unregistered: "Unregistered", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + Completed: "Completed", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + Renewing: "Renewing", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + Pending: "Pending", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + Waiting: "Waiting", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + InProgress: "InProgress", +} + +/** + * Open authentication policy provider type. + */ +union OpenAuthenticationProviderType { + string, + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + AAD: "AAD", +} + +/** + * The sku name. + */ +union WorkflowSkuName { + string, + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + NotSpecified: "NotSpecified", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + Free: "Free", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + Shared: "Shared", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + Basic: "Basic", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + Standard: "Standard", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + Premium: "Premium", +} + +/** + * The workflow kind. + */ +union Kind { + string, + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + Stateful: "Stateful", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + Stateless: "Stateless", +} + +/** + * Provisioning state of the App Service Plan. + */ +#suppress "@azure-tools/typespec-azure-core/no-enum" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +enum ProvisioningState { + Succeeded, + Failed, + Canceled, + InProgress, + Deleting, +} + +/** + * Current status of the App Service Environment. + */ +#suppress "@azure-tools/typespec-azure-core/no-enum" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +enum HostingEnvironmentStatus { + Preparing, + Ready, + Scaling, + Deleting, +} + +#suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +#suppress "@azure-tools/typespec-azure-core/no-enum" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-provisioning-state" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +enum CustomDnsSuffixProvisioningState { + Succeeded, + Failed, + Degraded, + InProgress, +} + +/** + * Shared/dedicated workers. + */ +#suppress "@azure-tools/typespec-azure-core/no-enum" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +enum ComputeModeOptions { + Shared, + Dedicated, + Dynamic, +} + +/** + * Size of the machines. + */ +#suppress "@azure-tools/typespec-azure-core/no-enum" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +enum WorkerSizeOptions { + Small, + Medium, + Large, + D1, + D2, + D3, + SmallV3, + MediumV3, + LargeV3, + NestedSmall, + NestedSmallLinux, + Default, +} + +/** + * State indicating whether the app has exceeded its quota usage. Read-only. + */ +#suppress "@azure-tools/typespec-azure-core/no-enum" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +enum UsageState { + Normal, + Exceeded, +} + +/** + * Management information availability state for the app. + */ +#suppress "@azure-tools/typespec-azure-core/no-enum" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +enum SiteAvailabilityState { + Normal, + Limited, + DisasterRecoveryMode, +} + +/** + * SSL type + */ +#suppress "@azure-tools/typespec-azure-core/no-enum" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +enum SslState { + Disabled, + SniEnabled, + IpBasedEnabled, +} + +/** + * Indicates whether the hostname is a standard or repository hostname. + */ +#suppress "@azure-tools/typespec-azure-core/no-enum" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +enum HostType { + Standard, + Repository, +} + +/** + * Type of database. + */ +#suppress "@azure-tools/typespec-azure-core/no-enum" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +enum ConnectionStringType { + MySql, + SQLServer, + SQLAzure, + Custom, + NotificationHub, + ServiceBus, + EventHub, + ApiHub, + DocDb, + RedisCache, + PostgreSQL, +} + +/** + * Managed pipeline mode. + */ +#suppress "@azure-tools/typespec-azure-core/no-enum" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +enum ManagedPipelineMode { + Integrated, + Classic, +} + +/** + * Site load balancing. + */ +#suppress "@azure-tools/typespec-azure-core/no-enum" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +enum SiteLoadBalancing { + WeightedRoundRobin, + LeastRequests, + LeastResponseTime, + WeightedTotalTraffic, + RequestHash, + PerSiteRoundRobin, + LeastRequestsWithTieBreaker, +} + +/** + * Predefined action to be taken. + */ +#suppress "@azure-tools/typespec-azure-core/no-enum" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +enum AutoHealActionType { + Recycle, + LogEvent, + CustomAction, +} + +/** + * Type of storage. + */ +#suppress "@azure-tools/typespec-azure-core/no-enum" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +enum AzureStorageType { + AzureFiles, + AzureBlob, +} + +/** + * State of the storage account. + */ +#suppress "@azure-tools/typespec-azure-core/no-enum" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +enum AzureStorageState { + Ok, + InvalidCredentials, + InvalidShare, + NotValidated, +} + +/** + * This composes with ClientCertEnabled setting. + * - ClientCertEnabled: false means ClientCert is ignored. + * - ClientCertEnabled: true and ClientCertMode: Required means ClientCert is required. + * - ClientCertEnabled: true and ClientCertMode: Optional means ClientCert is optional or accepted. + */ +#suppress "@azure-tools/typespec-azure-core/no-enum" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +enum ClientCertMode { + Required, + Optional, + OptionalInteractiveUser, +} + +/** + * Specifies the IP mode of the app. + */ +#suppress "@azure-tools/typespec-azure-core/no-enum" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +enum IPMode { + IPv4, + IPv6, + IPv4AndIPv6, +} + +/** + * Site redundancy mode + */ +#suppress "@azure-tools/typespec-azure-core/no-enum" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +enum RedundancyMode { + None, + Manual, + Failover, + ActiveActive, + GeoRedundant, +} + +/** + * Specifies the scope of uniqueness for the default hostname during resource creation + */ +#suppress "@azure-tools/typespec-azure-core/no-enum" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +enum AutoGeneratedDomainNameLabelScope { + TenantReuse, + SubscriptionReuse, + ResourceGroupReuse, + NoReuse, +} + +/** + * Type of managed service identity. + */ +#suppress "@azure-tools/typespec-azure-core/no-enum" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +enum ManagedServiceIdentityType { + SystemAssigned, + UserAssigned, + `SystemAssigned, UserAssigned`, + None, +} + +/** + * The current status of the operation. + */ +#suppress "@azure-tools/typespec-azure-core/no-enum" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +enum OperationStatus { + InProgress, + Failed, + Succeeded, + TimedOut, + Created, +} + +/** + * App Service plan status. + */ +#suppress "@azure-tools/typespec-azure-core/no-enum" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +enum StatusOptions { + Ready, + Pending, + Creating, +} + +/** + * Status of the Key Vault secret. + */ +#suppress "@azure-tools/typespec-azure-core/no-enum" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +enum KeyVaultSecretStatus { + Initialized, + WaitingOnCertificateOrder, + Succeeded, + CertificateOrderFailed, + OperationNotPermittedOnKeyVault, + AzureServiceUnauthorizedToAccessKeyVault, + KeyVaultDoesNotExist, + KeyVaultSecretDoesNotExist, + UnknownError, + ExternalPrivateKey, + Unknown, +} + +/** + * Whether this detector is an Analysis Detector or not. + */ +#suppress "@azure-tools/typespec-azure-core/no-enum" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +enum DetectorType { + Detector, + Analysis, + CategoryOverview, +} + +/** + * Rendering Type + */ +#suppress "@azure-tools/typespec-azure-core/no-enum" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +enum RenderingType { + NoGraph, + Table, + TimeSeries, + TimeSeriesPerInstance, + PieChart, + DataSummary, + Email, + Insights, + DynamicInsight, + Markdown, + Detector, + DropDown, + Card, + Solution, + Guage, + Form, + ChangeSets, + ChangeAnalysisOnboarding, + ChangesView, + AppInsight, + DependencyGraph, + DownTime, + SummaryCard, + SearchComponent, + AppInsightEnablement, +} + +/** + * Level of the most severe insight generated by the detector. + */ +#suppress "@azure-tools/typespec-azure-core/no-enum" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +enum InsightStatus { + Critical, + Warning, + Info, + Success, + None, +} + +/** + * Represents the type of the Detector + */ +#suppress "@azure-tools/typespec-azure-core/no-enum" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +enum IssueType { + ServiceIncident, + AppDeployment, + AppCrash, + RuntimeIssueDetected, + AseDeployment, + UserIssue, + PlatformIssue, + Other, +} + +/** + * Type of Solution + */ +#suppress "@azure-tools/typespec-azure-core/no-enum" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +enum SolutionType { + QuickSolution, + DeepInvestigation, + BestPractices, +} + +/** + * Provisioning state of the Kubernetes Environment. + */ +#suppress "@azure-tools/typespec-azure-core/no-enum" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +enum KubeEnvironmentProvisioningState { + Succeeded, + Failed, + Canceled, + Waiting, + InitializationInProgress, + InfrastructureSetupInProgress, + InfrastructureSetupComplete, + ScheduledForDelete, + UpgradeRequested, + UpgradeFailed, +} + +#suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +#suppress "@azure-tools/typespec-azure-core/no-enum" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +enum StorageType { + LocalNode, + NetworkFileSystem, +} + +#suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +#suppress "@azure-tools/typespec-azure-core/no-enum" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +enum FrontEndServiceType { + NodePort, + LoadBalancer, +} + +/** + * Function App stack preferred OS. + */ +#suppress "@azure-tools/typespec-azure-core/no-enum" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +enum StackPreferredOs { + Windows, + Linux, +} + +/** + * Level indicating how critical this recommendation can impact. + */ +#suppress "@azure-tools/typespec-azure-core/no-enum" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +enum NotificationLevel { + Critical, + Warning, + Information, + NonUrgentSuggestion, +} + +/** + * List of channels that this recommendation can apply. + */ +#suppress "@azure-tools/typespec-azure-core/no-enum" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +enum Channels { + Notification, + Api, + Email, + Webhook, + All, +} + +/** + * App Service plans this offer is restricted to. + */ +#suppress "@azure-tools/typespec-azure-core/no-enum" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +enum AppServicePlanRestrictions { + None, + Free, + Shared, + Basic, + Standard, + Premium, +} + +/** + * State indicating whether staging environments are allowed or not allowed for a static web app. + */ +#suppress "@azure-tools/typespec-azure-core/no-enum" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +enum StagingEnvironmentPolicy { + Enabled, + Disabled, +} + +/** + * DNS verification test result. + */ +#suppress "@azure-tools/typespec-azure-core/no-enum" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +enum DnsVerificationTestResult { + Passed, + Failed, + Skipped, +} + +/** + * The unit of time for how often the backup should be executed (e.g. for weekly backup, this should be set to Day and FrequencyInterval should be set to 7) + */ +#suppress "@azure-tools/typespec-azure-core/no-enum" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +enum FrequencyUnit { + Day, + Hour, +} + +/** + * Backup status. + */ +#suppress "@azure-tools/typespec-azure-core/no-enum" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +enum BackupItemStatus { + InProgress, + Failed, + Succeeded, + TimedOut, + Created, + Skipped, + PartiallySucceeded, + DeleteInProgress, + DeleteFailed, + Deleted, +} + +/** + * Operation type. + */ +#suppress "@azure-tools/typespec-azure-core/no-enum" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +enum BackupRestoreOperationType { + Default, + Clone, + Relocation, + Snapshot, + CloudFS, +} + +/** + * The action to take when an unauthenticated client attempts to access the app. + */ +#suppress "@azure-tools/typespec-azure-core/no-enum" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +enum UnauthenticatedClientAction { + RedirectToLoginPage, + AllowAnonymous, +} + +/** + * The default authentication provider to use when multiple providers are configured. + * This setting is only needed if multiple providers are configured and the unauthenticated client + * action is set to "RedirectToLoginPage". + */ +#suppress "@azure-tools/typespec-azure-core/no-enum" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +enum BuiltInAuthenticationProvider { + AzureActiveDirectory, + Facebook, + Google, + MicrosoftAccount, + Twitter, + Github, +} + +/** + * The action to take when an unauthenticated client attempts to access the app. + */ +#suppress "@azure-tools/typespec-azure-core/no-enum" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +enum UnauthenticatedClientActionV2 { + RedirectToLoginPage, + AllowAnonymous, + Return401, + Return403, +} + +/** + * The convention used when determining the session cookie's expiration. + */ +#suppress "@azure-tools/typespec-azure-core/no-enum" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +enum CookieExpirationConvention { + FixedTime, + IdentityProviderDerived, +} + +/** + * The convention used to determine the url of the request made. + */ +#suppress "@azure-tools/typespec-azure-core/no-enum" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +enum ForwardProxyConvention { + NoProxy, + Standard, + Custom, +} + +#suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +#suppress "@azure-tools/typespec-azure-core/no-enum" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +enum ResolveStatus { + Initialized, + Resolved, + InvalidSyntax, + MSINotEnabled, + VaultNotFound, + SecretNotFound, + SecretVersionNotFound, + AccessToKeyVaultDenied, + OtherReasons, + FetchTimedOut, + UnauthorizedClient, +} + +/** + * Log level. + */ +#suppress "@azure-tools/typespec-azure-core/no-enum" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +enum LogLevel { + Off, + Verbose, + Information, + Warning, + Error, +} + +/** + * Job status. + */ +#suppress "@azure-tools/typespec-azure-core/no-enum" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +enum ContinuousWebJobStatus { + Initializing, + Starting, + Running, + PendingRestart, + Stopped, +} + +/** + * Job type. + */ +#suppress "@azure-tools/typespec-azure-core/no-enum" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +enum WebJobType { + Continuous, + Triggered, +} + +/** + * Provisioning state + */ +#suppress "@azure-tools/typespec-azure-core/no-enum" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-provisioning-state" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +enum MSDeployProvisioningState { + accepted, + running, + succeeded, + failed, + canceled, +} + +/** + * Log entry type + */ +#suppress "@azure-tools/typespec-azure-core/no-enum" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +enum MSDeployLogEntryType { + Message, + Warning, + Error, +} + +/** + * Azure resource type. + */ +#suppress "@azure-tools/typespec-azure-core/no-enum" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +enum AzureResourceType { + Website, + TrafficManager, +} + +/** + * Custom DNS record type. + */ +#suppress "@azure-tools/typespec-azure-core/no-enum" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +enum CustomHostNameDnsRecordType { + CName, + A, +} + +/** + * Hostname type. + */ +#suppress "@azure-tools/typespec-azure-core/no-enum" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +enum HostNameType { + Verified, + Managed, +} + +#suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +#suppress "@azure-tools/typespec-azure-core/no-enum" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +enum SiteRuntimeState { + READY, + STOPPED, + UNKNOWN, +} + +/** + * Name of app. + */ +#suppress "@azure-tools/typespec-azure-core/no-enum" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +enum CloneAbilityResult { + Cloneable, + PartiallyCloneable, + NotCloneable, +} + +/** + * The type of migration operation to be done + */ +#suppress "@azure-tools/typespec-azure-core/no-enum" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +enum MySqlMigrationType { + LocalToRemote, + RemoteToLocal, +} + +/** + * Public Certificate Location + */ +#suppress "@azure-tools/typespec-azure-core/no-enum" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +enum PublicCertificateLocation { + CurrentUserMy, + LocalMachineMy, + Unknown, +} + +/** + * Auth Type + */ +#suppress "@azure-tools/typespec-azure-core/no-enum" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +enum AuthType { + Anonymous, + UserCredentials, + SystemIdentity, + UserAssigned, +} + +/** + * Site extension type. + */ +#suppress "@azure-tools/typespec-azure-core/no-enum" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +enum SiteExtensionType { + Gallery, + WebRoot, +} + +/** + * Job status. + */ +#suppress "@azure-tools/typespec-azure-core/no-enum" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +enum TriggeredWebJobStatus { + Success, + Failed, + Error, +} + +/** + * Gets or sets the workflow health state. + */ +#suppress "@azure-tools/typespec-azure-core/no-enum" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +enum WorkflowHealthState { + NotSpecified, + Healthy, + Unhealthy, + Unknown, +} + +#suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +#suppress "@azure-tools/typespec-azure-core/no-enum" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +enum DaysOfWeek { + Sunday, + Monday, + Tuesday, + Wednesday, + Thursday, + Friday, + Saturday, +} + +/** + * The day of the week. + */ +#suppress "@azure-tools/typespec-azure-core/no-enum" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +enum DayOfWeek { + Sunday, + Monday, + Tuesday, + Wednesday, + Thursday, + Friday, + Saturday, +} + +/** + * Collection of App Service Environments. + */ +model AppServiceEnvironmentCollection + is Azure.Core.Page; + +/** + * Description of an App Service Environment. + */ +model AppServiceEnvironment { + /** + * Provisioning state of the App Service Environment. + */ + @visibility(Lifecycle.Read) + provisioningState?: ProvisioningState; + + /** + * Current status of the App Service Environment. + */ + @visibility(Lifecycle.Read) + status?: HostingEnvironmentStatus; + + /** + * Description of the Virtual Network. + */ + virtualNetwork: VirtualNetworkProfile; + + /** + * Specifies which endpoints to serve internally in the Virtual Network for the App Service Environment. + */ + internalLoadBalancingMode?: LoadBalancingMode; + + /** + * Front-end VM size, e.g. "Medium", "Large". + */ + multiSize?: string; + + /** + * Number of front-end instances. + */ + @visibility(Lifecycle.Read) + multiRoleCount?: int32; + + /** + * Number of IP SSL addresses reserved for the App Service Environment. + */ + ipsslAddressCount?: int32; + + /** + * DNS suffix of the App Service Environment. + */ + dnsSuffix?: string; + + /** + * Maximum number of VMs in the App Service Environment. + */ + @visibility(Lifecycle.Read) + maximumNumberOfMachines?: int32; + + /** + * Scale factor for front-ends. + */ + frontEndScaleFactor?: int32; + + /** + * true if the App Service Environment is suspended; otherwise, false. The environment can be suspended, e.g. when the management endpoint is no longer available + * (most likely because NSG blocked the incoming traffic). + */ + @visibility(Lifecycle.Read) + suspended?: boolean; + + /** + * Custom settings for changing the behavior of the App Service Environment. + */ + @identifiers(#["name"]) + clusterSettings?: NameValuePair[]; + + /** + * User added ip ranges to whitelist on ASE db + */ + userWhitelistedIpRanges?: string[]; + + /** + * Flag that displays whether an ASE has linux workers or not + */ + @visibility(Lifecycle.Read) + hasLinuxWorkers?: boolean; + + /** + * Upgrade Preference + */ + upgradePreference?: UpgradePreference = UpgradePreference.None; + + /** + * Dedicated Host Count + */ + dedicatedHostCount?: int32; + + /** + * Whether or not this App Service Environment is zone-redundant. + */ + zoneRedundant?: boolean; + + /** + * Whether an upgrade is available for this App Service Environment. + */ + @visibility(Lifecycle.Read) + upgradeAvailability?: UpgradeAvailability; +} + +/** + * Specification for using a Virtual Network. + */ +model VirtualNetworkProfile { + /** + * Resource id of the Virtual Network. + */ + id: string; + + /** + * Name of the Virtual Network (read-only). + */ + @visibility(Lifecycle.Read) + name?: string; + + /** + * Resource type of the Virtual Network (read-only). + */ + @visibility(Lifecycle.Read) + type?: string; + + /** + * Subnet within the Virtual Network. + */ + subnet?: string; +} + +/** + * Name value pair. + */ +model NameValuePair { + /** + * Pair name. + */ + name?: string; + + /** + * Pair value. + */ + value?: string; +} + +/** + * CustomDnsSuffixConfiguration resource specific properties + */ +model CustomDnsSuffixConfigurationProperties { + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + @visibility(Lifecycle.Read) + provisioningState?: CustomDnsSuffixProvisioningState; + + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + @visibility(Lifecycle.Read) + provisioningDetails?: string; + + /** + * The default custom domain suffix to use for all sites deployed on the ASE. + */ + dnsSuffix?: string; + + /** + * The URL referencing the Azure Key Vault certificate secret that should be used as the default SSL/TLS certificate for sites with the custom domain suffix. + */ + certificateUrl?: string; + + /** + * The user-assigned identity to use for resolving the key vault certificate reference. If not specified, the system-assigned ASE identity will be used if available. + */ + keyVaultReferenceIdentity?: string; +} + +/** + * Azure proxy only resource. This resource is not tracked by Azure Resource Manager. + */ +model ProxyOnlyResource { + /** + * Resource Id. + */ + @visibility(Lifecycle.Read) + id?: string; + + /** + * Resource Name. + */ + @visibility(Lifecycle.Read) + name?: string; + + /** + * Kind of resource. + */ + kind?: string; + + /** + * Resource type. + */ + @visibility(Lifecycle.Read) + type?: string; +} + +/** + * AseV3NetworkingConfiguration resource specific properties + */ +#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-provisioning-state" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +model AseV3NetworkingConfigurationProperties { + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + @visibility(Lifecycle.Read) + windowsOutboundIpAddresses?: string[]; + + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + @visibility(Lifecycle.Read) + linuxOutboundIpAddresses?: string[]; + + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + @visibility(Lifecycle.Read) + externalInboundIpAddresses?: string[]; + + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + @visibility(Lifecycle.Read) + internalInboundIpAddresses?: string[]; + + /** + * Property to enable and disable new private endpoint connection creation on ASE + */ + allowNewPrivateEndpointConnections?: boolean; + + /** + * Property to enable and disable FTP on ASEV3 + */ + ftpEnabled?: boolean; + + /** + * Property to enable and disable Remote Debug on ASEV3 + */ + remoteDebugEnabled?: boolean; + + /** + * Customer provided Inbound IP Address. Only able to be set on Ase create. + */ + inboundIpAddressOverride?: string; +} + +/** + * App Service error response. + */ +@error +model DefaultErrorResponse { + /** + * Error model. + */ + @visibility(Lifecycle.Read) + error?: DefaultErrorResponseError; +} + +/** + * Error model. + */ +@error +model DefaultErrorResponseError { + /** + * Standardized string to programmatically identify the error. + */ + @visibility(Lifecycle.Read) + code?: string; + + /** + * Detailed error description and debugging information. + */ + @visibility(Lifecycle.Read) + message?: string; + + /** + * Detailed error description and debugging information. + */ + @visibility(Lifecycle.Read) + target?: string; + + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + @identifiers(#[]) + details?: DefaultErrorResponseErrorDetailsItem[]; + + /** + * More information to debug error. + */ + @visibility(Lifecycle.Read) + innererror?: string; +} + +/** + * Detailed errors. + */ +model DefaultErrorResponseErrorDetailsItem { + /** + * Standardized string to programmatically identify the error. + */ + @visibility(Lifecycle.Read) + code?: string; + + /** + * Detailed error description and debugging information. + */ + @visibility(Lifecycle.Read) + message?: string; + + /** + * Detailed error description and debugging information. + */ + @visibility(Lifecycle.Read) + target?: string; +} + +/** + * ARM resource for a app service environment. + */ +#suppress "@azure-tools/typespec-azure-resource-manager/patch-envelope" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +model AppServiceEnvironmentPatchResource extends ProxyOnlyResource { + /** + * Core resource properties + */ + #suppress "@azure-tools/typespec-azure-core/no-private-usage" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + properties?: AppServiceEnvironment; +} + +/** + * Collection of stamp capacities. + */ +@@Azure.ResourceManager.identifiers(StampCapacityCollection.value, #["name"]); +model StampCapacityCollection is Azure.Core.Page; + +/** + * Stamp capacity information. + */ +model StampCapacity { + /** + * Name of the stamp. + */ + name?: string; + + /** + * Available capacity (# of machines, bytes of storage etc...). + */ + availableCapacity?: int64; + + /** + * Total capacity (# of machines, bytes of storage etc...). + */ + totalCapacity?: int64; + + /** + * Name of the unit. + */ + unit?: string; + + /** + * Shared/dedicated workers. + */ + computeMode?: ComputeModeOptions; + + /** + * Size of the machines. + */ + workerSize?: WorkerSizeOptions; + + /** + * Size ID of machines: + * 0 - Small + * 1 - Medium + * 2 - Large + */ + workerSizeId?: int32; + + /** + * If true, it includes basic apps. + * Basic apps are not used for capacity allocation. + */ + excludeFromCapacityAllocation?: boolean; + + /** + * true if capacity is applicable for all apps; otherwise, false. + */ + isApplicableForAllComputeModes?: boolean; + + /** + * Shared or Dedicated. + */ + siteMode?: string; + + /** + * Is this a linux stamp capacity + */ + isLinux?: boolean; +} + +/** + * AddressResponse resource specific properties + */ +#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-provisioning-state" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +model AddressResponseProperties { + /** + * Main public virtual IP. + */ + serviceIpAddress?: string; + + /** + * Virtual Network internal IP address of the App Service Environment if it is in internal load-balancing mode. + */ + internalIpAddress?: string; + + /** + * IP addresses appearing on outbound connections. + */ + outboundIpAddresses?: string[]; + + /** + * Additional virtual IPs. + */ + @identifiers(#["virtualIP"]) + vipMappings?: VirtualIPMapping[]; +} + +/** + * Virtual IP mapping. + */ +model VirtualIPMapping { + /** + * Virtual IP address. + */ + #suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + virtualIP?: string; + + /** + * Internal HTTP port. + */ + internalHttpPort?: int32; + + /** + * Internal HTTPS port. + */ + internalHttpsPort?: int32; + + /** + * Is virtual IP mapping in use. + */ + inUse?: boolean; + + /** + * name of the service that virtual IP is assigned to + */ + serviceName?: string; +} + +/** + * Site resource specific properties + */ +#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-provisioning-state" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +model SiteProperties { + /** + * Current state of the app. + */ + @visibility(Lifecycle.Read) + state?: string; + + /** + * Hostnames associated with the app. + */ + @visibility(Lifecycle.Read) + hostNames?: string[]; + + /** + * Name of the repository site. + */ + @visibility(Lifecycle.Read) + repositorySiteName?: string; + + /** + * State indicating whether the app has exceeded its quota usage. Read-only. + */ + @visibility(Lifecycle.Read) + usageState?: UsageState; + + /** + * true if the app is enabled; otherwise, false. Setting this value to false disables the app (takes the app offline). + */ + enabled?: boolean; + + /** + * Enabled hostnames for the app.Hostnames need to be assigned (see HostNames) AND enabled. Otherwise, + * the app is not served on those hostnames. + */ + @visibility(Lifecycle.Read) + enabledHostNames?: string[]; + + /** + * Management information availability state for the app. + */ + @visibility(Lifecycle.Read) + availabilityState?: SiteAvailabilityState; + + /** + * Hostname SSL states are used to manage the SSL bindings for app's hostnames. + */ + @identifiers(#["name"]) + hostNameSslStates?: HostNameSslState[]; + + /** + * Resource ID of the associated App Service plan, formatted as: "/subscriptions/{subscriptionID}/resourceGroups/{groupName}/providers/Microsoft.Web/serverfarms/{appServicePlanName}". + */ + serverFarmId?: string; + + /** + * true if reserved; otherwise, false. + */ + @visibility(Lifecycle.Read, Lifecycle.Create) + reserved?: boolean = false; + + /** + * Obsolete: Hyper-V sandbox. + */ + @visibility(Lifecycle.Read, Lifecycle.Create) + isXenon?: boolean = false; + + /** + * Hyper-V sandbox. + */ + @visibility(Lifecycle.Read, Lifecycle.Create) + hyperV?: boolean = false; + + /** + * Last time the app was modified, in UTC. Read-only. + */ + @visibility(Lifecycle.Read) + // FIXME: (utcDateTime) Please double check that this is the correct type for your scenario. + lastModifiedTimeUtc?: utcDateTime; + + /** + * Property to configure various DNS related settings for a site. + */ + dnsConfiguration?: SiteDnsConfig; + + /** + * Property to configure various outbound traffic routing options over virtual network for a site + */ + outboundVnetRouting?: OutboundVnetRouting; + + /** + * Configuration of an App Service app. This property is not returned in response to normal create and read requests since it may contain sensitive information. + */ + @visibility(Lifecycle.Create, Lifecycle.Update) + siteConfig?: SiteConfig; + + /** + * Configuration specific of the Azure Function app. + */ + functionAppConfig?: FunctionAppConfig; + + /** + * Dapr configuration of the app. + */ + daprConfig?: DaprConfig; + + /** + * Workload profile name for function app to execute on. + */ + workloadProfileName?: string; + + /** + * Function app resource requirements. + */ + resourceConfig?: ResourceConfig; + + /** + * Azure Traffic Manager hostnames associated with the app. Read-only. + */ + @visibility(Lifecycle.Read) + trafficManagerHostNames?: string[]; + + /** + * true to stop SCM (KUDU) site when the app is stopped; otherwise, false. The default is false. + */ + scmSiteAlsoStopped?: boolean = false; + + /** + * Specifies which deployment slot this app will swap into. Read-only. + */ + @visibility(Lifecycle.Read) + targetSwapSlot?: string; + + /** + * App Service Environment to use for the app. + */ + @visibility(Lifecycle.Read, Lifecycle.Create) + hostingEnvironmentProfile?: HostingEnvironmentProfile; + + /** + * true to enable client affinity; false to stop sending session affinity cookies, which route client requests in the same session to the same instance. Default is true. + */ + clientAffinityEnabled?: boolean = false; + + /** + * true to enable client affinity partitioning using CHIPS cookies, this will add the partitioned property to the affinity cookies; false to stop sending partitioned affinity cookies. Default is false. + */ + clientAffinityPartitioningEnabled?: boolean; + + /** + * true to override client affinity cookie domain with X-Forwarded-Host request header. false to use default domain. Default is false. + */ + clientAffinityProxyEnabled?: boolean; + + /** + * true to enable client certificate authentication (TLS mutual authentication); otherwise, false. Default is false. + */ + clientCertEnabled?: boolean; + + /** + * This composes with ClientCertEnabled setting. + * - ClientCertEnabled: false means ClientCert is ignored. + * - ClientCertEnabled: true and ClientCertMode: Required means ClientCert is required. + * - ClientCertEnabled: true and ClientCertMode: Optional means ClientCert is optional or accepted. + */ + clientCertMode?: ClientCertMode; + + /** + * client certificate authentication comma-separated exclusion paths + */ + clientCertExclusionPaths?: string; + + /** + * Specifies the IP mode of the app. + */ + ipMode?: IPMode; + + /** + * Whether to use end to end encryption between the FrontEnd and the Worker + */ + endToEndEncryptionEnabled?: boolean; + + /** + * Whether to enable ssh access. + */ + sshEnabled?: boolean; + + /** + * true to disable the public hostnames of the app; otherwise, false. + * If true, the app is only accessible via API management process. + */ + hostNamesDisabled?: boolean; + + /** + * Unique identifier that verifies the custom domains assigned to the app. Customer will add this id to a txt record for verification. + */ + customDomainVerificationId?: string; + + /** + * List of IP addresses that the app uses for outbound connections (e.g. database access). Includes VIPs from tenants that site can be hosted with current settings. Read-only. + */ + @visibility(Lifecycle.Read) + outboundIpAddresses?: string; + + /** + * List of IP addresses that the app uses for outbound connections (e.g. database access). Includes VIPs from all tenants except dataComponent. Read-only. + */ + @visibility(Lifecycle.Read) + possibleOutboundIpAddresses?: string; + + /** + * Size of the function container. + */ + containerSize?: int32; + + /** + * Maximum allowed daily memory-time quota (applicable on dynamic apps only). + */ + dailyMemoryTimeQuota?: int32; + + /** + * App suspended till in case memory-time quota is exceeded. + */ + @visibility(Lifecycle.Read) + // FIXME: (utcDateTime) Please double check that this is the correct type for your scenario. + suspendedTill?: utcDateTime; + + /** + * Maximum number of workers. + * This only applies to Functions container. + */ + @visibility(Lifecycle.Read) + maxNumberOfWorkers?: int32; + + /** + * If specified during app creation, the app is cloned from a source app. + */ + @visibility(Lifecycle.Create) + cloningInfo?: CloningInfo; + + /** + * Name of the resource group the app belongs to. Read-only. + */ + @visibility(Lifecycle.Read) + resourceGroup?: string; + + /** + * true if the app is a default container; otherwise, false. + */ + @visibility(Lifecycle.Read) + isDefaultContainer?: boolean; + + /** + * Default hostname of the app. Read-only. + */ + @visibility(Lifecycle.Read) + defaultHostName?: string; + + /** + * Status of the last deployment slot swap operation. + */ + @visibility(Lifecycle.Read) + slotSwapStatus?: SlotSwapStatus; + + /** + * HttpsOnly: configures a web site to accept only https requests. Issues redirect for + * http requests + */ + httpsOnly?: boolean; + + /** + * Site redundancy mode + */ + redundancyMode?: RedundancyMode; + + /** + * Specifies an operation id if this site has a pending operation. + */ + #suppress "@azure-tools/typespec-azure-core/no-format" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + @visibility(Lifecycle.Read) + @format("uuid") + inProgressOperationId?: string; + + /** + * Property to allow or block all public traffic. Allowed Values: 'Enabled', 'Disabled' or an empty string. + */ + #suppress "@azure-tools/typespec-azure-resource-manager/secret-prop" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + publicNetworkAccess?: string; + + /** + * Checks if Customer provided storage account is required + */ + storageAccountRequired?: boolean; + + /** + * Identity to use for Key Vault Reference authentication. + */ + keyVaultReferenceIdentity?: string; + + /** + * Specifies the scope of uniqueness for the default hostname during resource creation + */ + autoGeneratedDomainNameLabelScope?: AutoGeneratedDomainNameLabelScope; + + /** + * Azure Resource Manager ID of the Virtual network and subnet to be joined by Regional VNET Integration. + * This must be of the form /subscriptions/{subscriptionName}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{vnetName}/subnets/{subnetName} + */ + virtualNetworkSubnetId?: string; + + /** + * Azure Resource Manager ID of the customer's selected Managed Environment on which to host this app. This must be of the form /subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.App/managedEnvironments/{managedEnvironmentName} + */ + managedEnvironmentId?: string; + + /** + * Current SKU of application based on associated App Service Plan. Some valid SKU values are Free, Shared, Basic, Dynamic, FlexConsumption, Standard, Premium, PremiumV2, PremiumV3, Isolated, IsolatedV2 + */ + @visibility(Lifecycle.Read) + sku?: string; +} + +/** + * SSL-enabled hostname. + */ +model HostNameSslState { + /** + * Hostname. + */ + name?: string; + + /** + * SSL type. + */ + sslState?: SslState; + + /** + * Virtual IP address assigned to the hostname if IP based SSL is enabled. + */ + #suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + virtualIP?: string; + + /** + * SSL certificate thumbprint. + */ + thumbprint?: string; + + /** + * Set to true to update existing hostname. + */ + toUpdate?: boolean; + + /** + * Indicates whether the hostname is a standard or repository hostname. + */ + hostType?: HostType; +} + +#suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +model SiteDnsConfig { + /** + * List of custom DNS servers to be used by an app for lookups. Maximum 5 dns servers can be set. + */ + dnsServers?: string[]; + + /** + * Alternate DNS server to be used by apps. This property replicates the WEBSITE_DNS_ALT_SERVER app setting. + */ + dnsAltServer?: string; + + /** + * Timeout for a single dns lookup in seconds. Allowed range: 1-30. Default is 3. + */ + dnsRetryAttemptTimeout?: int32; + + /** + * Total number of retries for dns lookup. Allowed range: 1-5. Default is 3. + */ + dnsRetryAttemptCount?: int32; + + /** + * Custom time for DNS to be cached in seconds. Allowed range: 0-60. Default is 30 seconds. 0 means caching disabled. + */ + dnsMaxCacheTimeout?: int32; + + /** + * Indicates that sites using Virtual network custom DNS servers are still sorting the list of DNS servers. Read-Only. + */ + @visibility(Lifecycle.Read) + dnsLegacySortOrder?: boolean; +} + +/** + * Outbound traffic options over virtual network. + */ +model OutboundVnetRouting { + /** + * Enables all other routing options defined in OutboundVnetRouting if this setting is set to true. + */ + allTraffic?: boolean; + + /** + * This causes all outbound traffic to have Virtual Network Security Groups and User Defined Routes applied. Previously called VnetRouteAllEnabled. + */ + applicationTraffic?: boolean; + + /** + * Enables accessing content over virtual network. Previously called VnetContentShareEnabled + */ + contentShareTraffic?: boolean; + + /** + * Enables pulling image over Virtual Network. Previously called VnetImagePullEnabled. + */ + imagePullTraffic?: boolean; + + /** + * Enables Backup and Restore operations over virtual network. Previously called VnetBackupRestoreEnabled + */ + backupRestoreTraffic?: boolean; +} + +/** + * Configuration of an App Service app. + */ +#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-provisioning-state" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +model SiteConfig { + /** + * Number of workers. + */ + numberOfWorkers?: int32; + + /** + * Default documents. + */ + defaultDocuments?: string[]; + + /** + * .NET Framework version. + */ + netFrameworkVersion?: string = "v4.6"; + + /** + * Version of PHP. + */ + phpVersion?: string; + + /** + * Version of Python. + */ + pythonVersion?: string; + + /** + * Version of Node.js. + */ + nodeVersion?: string; + + /** + * Version of PowerShell. + */ + powerShellVersion?: string; + + /** + * Linux App Framework and version + */ + linuxFxVersion?: string; + + /** + * Xenon App Framework and version + */ + windowsFxVersion?: string; + + /** + * true if request tracing is enabled; otherwise, false. + */ + requestTracingEnabled?: boolean; + + /** + * Request tracing expiration time. + */ + // FIXME: (utcDateTime) Please double check that this is the correct type for your scenario. + requestTracingExpirationTime?: utcDateTime; + + /** + * true if remote debugging is enabled; otherwise, false. + */ + remoteDebuggingEnabled?: boolean; + + /** + * Remote debugging version. + */ + remoteDebuggingVersion?: string; + + /** + * true if HTTP logging is enabled; otherwise, false. + */ + httpLoggingEnabled?: boolean; + + /** + * Flag to use Managed Identity Creds for ACR pull + */ + acrUseManagedIdentityCreds?: boolean; + + /** + * If using user managed identity, the user managed identity ClientId + */ + #suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + acrUserManagedIdentityID?: string; + + /** + * HTTP logs directory size limit. + */ + logsDirectorySizeLimit?: int32; + + /** + * true if detailed error logging is enabled; otherwise, false. + */ + detailedErrorLoggingEnabled?: boolean; + + /** + * Publishing user name. + */ + publishingUsername?: string; + + /** + * Application settings. This property is not returned in response to normal create and read requests since it may contain sensitive information. + */ + @visibility(Lifecycle.Create, Lifecycle.Update) + @identifiers(#["name"]) + appSettings?: NameValuePair[]; + + /** + * Application metadata. This property cannot be retrieved, since it may contain secrets. + */ + @visibility(Lifecycle.Create, Lifecycle.Update) + @identifiers(#["name"]) + metadata?: NameValuePair[]; + + /** + * Connection strings. This property is not returned in response to normal create and read requests since it may contain sensitive information. + */ + @visibility(Lifecycle.Create, Lifecycle.Update) + @identifiers(#["name"]) + connectionStrings?: ConnStringInfo[]; + + /** + * Site MachineKey. + */ + @visibility(Lifecycle.Read) + machineKey?: SiteMachineKey; + + /** + * Handler mappings. + */ + @identifiers(#["extension"]) + handlerMappings?: HandlerMapping[]; + + /** + * Document root. + */ + documentRoot?: string; + + /** + * SCM type. + */ + scmType?: ScmType; + + /** + * true to use 32-bit worker process; otherwise, false. + */ + use32BitWorkerProcess?: boolean; + + /** + * true if WebSocket is enabled; otherwise, false. + */ + webSocketsEnabled?: boolean; + + /** + * true if Always On is enabled; otherwise, false. + */ + alwaysOn?: boolean; + + /** + * Java version. + */ + javaVersion?: string; + + /** + * Java container. + */ + javaContainer?: string; + + /** + * Java container version. + */ + javaContainerVersion?: string; + + /** + * App command line to launch. + */ + appCommandLine?: string; + + /** + * Managed pipeline mode. + */ + managedPipelineMode?: ManagedPipelineMode; + + /** + * Virtual applications. + */ + @identifiers(#["virtualPath"]) + virtualApplications?: VirtualApplication[]; + + /** + * Site load balancing. + */ + loadBalancing?: SiteLoadBalancing; + + /** + * This is work around for polymorphic types. + */ + experiments?: Experiments; + + /** + * Site limits. + */ + limits?: SiteLimits; + + /** + * true if Auto Heal is enabled; otherwise, false. + */ + autoHealEnabled?: boolean; + + /** + * Auto Heal rules. + */ + autoHealRules?: AutoHealRules; + + /** + * Tracing options. + */ + tracingOptions?: string; + + /** + * Virtual Network name. + */ + @visibility(Lifecycle.Read, Lifecycle.Create) + vnetName?: string; + + /** + * Virtual Network Route All enabled. This causes all outbound traffic to have Virtual Network Security Groups and User Defined Routes applied. + */ + vnetRouteAllEnabled?: boolean; + + /** + * The number of private ports assigned to this app. These will be assigned dynamically on runtime. + */ + vnetPrivatePortsCount?: int32; + + /** + * Cross-Origin Resource Sharing (CORS) settings. + */ + cors?: CorsSettings; + + /** + * Push endpoint settings. + */ + push?: PushSettings; + + /** + * Information about the formal API definition for the app. + */ + apiDefinition?: ApiDefinitionInfo; + + /** + * Azure API management settings linked to the app. + */ + apiManagementConfig?: ApiManagementConfig; + + /** + * Auto-swap slot name. + */ + autoSwapSlotName?: string; + + /** + * true to enable local MySQL; otherwise, false. + */ + localMySqlEnabled?: boolean = false; + + /** + * Managed Service Identity Id + */ + managedServiceIdentityId?: int32; + + /** + * Explicit Managed Service Identity Id + */ + xManagedServiceIdentityId?: int32; + + /** + * Identity to use for Key Vault Reference authentication. + */ + keyVaultReferenceIdentity?: string; + + /** + * IP security restrictions for main. + */ + @identifiers(#["name"]) + ipSecurityRestrictions?: IpSecurityRestriction[]; + + /** + * Default action for main access restriction if no rules are matched. + */ + ipSecurityRestrictionsDefaultAction?: DefaultAction; + + /** + * IP security restrictions for scm. + */ + @identifiers(#["name"]) + scmIpSecurityRestrictions?: IpSecurityRestriction[]; + + /** + * Default action for scm access restriction if no rules are matched. + */ + scmIpSecurityRestrictionsDefaultAction?: DefaultAction; + + /** + * IP security restrictions for scm to use main. + */ + scmIpSecurityRestrictionsUseMain?: boolean; + + /** + * Http20Enabled: configures a web site to allow clients to connect over http2.0 + */ + http20Enabled?: boolean = true; + + /** + * Http20ProxyFlag: Configures a website to allow http2.0 to pass be proxied all the way to the app. 0 = disabled, 1 = pass through all http2 traffic, 2 = pass through gRPC only. + */ + http20ProxyFlag?: int32 = 0; + + /** + * MinTlsVersion: configures the minimum version of TLS required for SSL requests + */ + minTlsVersion?: SupportedTlsVersions; + + /** + * The minimum strength TLS cipher suite allowed for an application + */ + minTlsCipherSuite?: TlsCipherSuites; + + /** + * ScmMinTlsVersion: configures the minimum version of TLS required for SSL requests for SCM site + */ + scmMinTlsVersion?: SupportedTlsVersions; + + /** + * State of FTP / FTPS service + */ + ftpsState?: FtpsState; + + /** + * Number of preWarmed instances. + * This setting only applies to the Consumption and Elastic Plans + */ + @maxValue(10) + @minValue(0) + preWarmedInstanceCount?: int32; + + /** + * Maximum number of workers that a site can scale out to. + * This setting only applies to the Consumption and Elastic Premium Plans + */ + @minValue(0) + functionAppScaleLimit?: int32; + + /** + * Maximum number of workers that a site can scale out to. + * This setting only applies to apps in plans where ElasticScaleEnabled is true + */ + @minValue(0) + elasticWebAppScaleLimit?: int32; + + /** + * Health check path + */ + healthCheckPath?: string; + + /** + * Gets or sets a value indicating whether functions runtime scale monitoring is enabled. When enabled, + * the ScaleController will not monitor event sources directly, but will instead call to the + * runtime to get scale status. + */ + functionsRuntimeScaleMonitoringEnabled?: boolean; + + /** + * Sets the time zone a site uses for generating timestamps. Compatible with Linux and Windows App Service. Setting the WEBSITE_TIME_ZONE app setting takes precedence over this config. For Linux, expects tz database values https://www.iana.org/time-zones (for a quick reference see https://en.wikipedia.org/wiki/List_of_tz_database_time_zones). For Windows, expects one of the time zones listed under HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones + */ + websiteTimeZone?: string; + + /** + * Number of minimum instance count for a site + * This setting only applies to the Elastic Plans + */ + @maxValue(20) + @minValue(0) + minimumElasticInstanceCount?: int32; + + /** + * List of Azure Storage Accounts. + */ + #suppress "@azure-tools/typespec-azure-resource-manager/arm-no-record" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + azureStorageAccounts?: Record; + + /** + * Property to allow or block all public traffic. + */ + #suppress "@azure-tools/typespec-azure-resource-manager/secret-prop" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + publicNetworkAccess?: string; +} + +/** + * Database connection string information. + */ +model ConnStringInfo { + /** + * Name of connection string. + */ + name?: string; + + /** + * Connection string value. + */ + connectionString?: string; + + /** + * Type of database. + */ + type?: ConnectionStringType; +} + +/** + * MachineKey of an app. + */ +model SiteMachineKey { + /** + * MachineKey validation. + */ + validation?: string; + + /** + * Validation key. + */ + #suppress "@azure-tools/typespec-azure-resource-manager/secret-prop" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + validationKey?: string; + + /** + * Algorithm used for decryption. + */ + decryption?: string; + + /** + * Decryption key. + */ + #suppress "@azure-tools/typespec-azure-resource-manager/secret-prop" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + decryptionKey?: string; +} + +/** + * The IIS handler mappings used to define which handler processes HTTP requests with certain extension. + * For example, it is used to configure php-cgi.exe process to handle all HTTP requests with *.php extension. + */ +model HandlerMapping { + /** + * Requests with this extension will be handled using the specified FastCGI application. + */ + extension?: string; + + /** + * The absolute path to the FastCGI application. + */ + scriptProcessor?: string; + + /** + * Command-line arguments to be passed to the script processor. + */ + arguments?: string; +} + +/** + * Virtual application in an app. + */ +model VirtualApplication { + /** + * Virtual path. + */ + virtualPath?: string; + + /** + * Physical path. + */ + physicalPath?: string; + + /** + * true if preloading is enabled; otherwise, false. + */ + preloadEnabled?: boolean; + + /** + * Virtual directories for virtual application. + */ + @identifiers(#["virtualPath"]) + virtualDirectories?: VirtualDirectory[]; +} + +/** + * Directory for virtual application. + */ +model VirtualDirectory { + /** + * Path to virtual application. + */ + virtualPath?: string; + + /** + * Physical path. + */ + physicalPath?: string; +} + +/** + * Routing rules in production experiments. + */ +model Experiments { + /** + * List of ramp-up rules. + */ + @identifiers(#["name"]) + rampUpRules?: RampUpRule[]; +} + +/** + * Routing rules for ramp up testing. This rule allows to redirect static traffic % to a slot or to gradually change routing % based on performance. + */ +model RampUpRule { + /** + * Hostname of a slot to which the traffic will be redirected if decided to. E.g. myapp-stage.azurewebsites.net. + */ + actionHostName?: string; + + /** + * Percentage of the traffic which will be redirected to ActionHostName. + */ + reroutePercentage?: float64; + + /** + * In auto ramp up scenario this is the step to add/remove from ReroutePercentage until it reaches \nMinReroutePercentage or + * MaxReroutePercentage. Site metrics are checked every N minutes specified in ChangeIntervalInMinutes.\nCustom decision algorithm + * can be provided in TiPCallback site extension which URL can be specified in ChangeDecisionCallbackUrl. + */ + changeStep?: float64; + + /** + * Specifies interval in minutes to reevaluate ReroutePercentage. + */ + changeIntervalInMinutes?: int32; + + /** + * Specifies lower boundary above which ReroutePercentage will stay. + */ + minReroutePercentage?: float64; + + /** + * Specifies upper boundary below which ReroutePercentage will stay. + */ + maxReroutePercentage?: float64; + + /** + * Custom decision algorithm can be provided in TiPCallback site extension which URL can be specified. + */ + changeDecisionCallbackUrl?: string; + + /** + * Name of the routing rule. The recommended name would be to point to the slot which will receive the traffic in the experiment. + */ + name?: string; +} + +/** + * Metric limits set on an app. + */ +model SiteLimits { + /** + * Maximum allowed CPU usage percentage. + */ + maxPercentageCpu?: float64; + + /** + * Maximum allowed memory usage in MB. + */ + maxMemoryInMb?: int64; + + /** + * Maximum allowed disk size usage in MB. + */ + maxDiskSizeInMb?: int64; +} + +/** + * Rules that can be defined for auto-heal. + */ +model AutoHealRules { + /** + * Conditions that describe when to execute the auto-heal actions. + */ + triggers?: AutoHealTriggers; + + /** + * Actions to be executed when a rule is triggered. + */ + actions?: AutoHealActions; +} + +/** + * Triggers for auto-heal. + */ +model AutoHealTriggers { + /** + * A rule based on total requests. + */ + requests?: RequestsBasedTrigger; + + /** + * A rule based on private bytes. + */ + #suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + privateBytesInKB?: int32; + + /** + * A rule based on status codes. + */ + @identifiers(#["path"]) + statusCodes?: StatusCodesBasedTrigger[]; + + /** + * A rule based on request execution time. + */ + slowRequests?: SlowRequestsBasedTrigger; + + /** + * A rule based on multiple Slow Requests Rule with path + */ + @identifiers(#["path"]) + slowRequestsWithPath?: SlowRequestsBasedTrigger[]; + + /** + * A rule based on status codes ranges. + */ + @identifiers(#["path"]) + statusCodesRange?: StatusCodesRangeBasedTrigger[]; +} + +/** + * Trigger based on total requests. + */ +model RequestsBasedTrigger { + /** + * Request Count. + */ + count?: int32; + + /** + * Time interval. + */ + timeInterval?: string; +} + +/** + * Trigger based on status code. + */ +model StatusCodesBasedTrigger { + /** + * HTTP status code. + */ + status?: int32; + + /** + * Request Sub Status. + */ + subStatus?: int32; + + /** + * Win32 error code. + */ + win32Status?: int32; + + /** + * Request Count. + */ + count?: int32; + + /** + * Time interval. + */ + timeInterval?: string; + + /** + * Request Path + */ + path?: string; +} + +/** + * Trigger based on request execution time. + */ +model SlowRequestsBasedTrigger { + /** + * Time taken. + */ + timeTaken?: string; + + /** + * Request Path. + */ + path?: string; + + /** + * Request Count. + */ + count?: int32; + + /** + * Time interval. + */ + timeInterval?: string; +} + +/** + * Trigger based on range of status codes. + */ +model StatusCodesRangeBasedTrigger { + /** + * HTTP status code. + */ + statusCodes?: string; + + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + path?: string; + + /** + * Request Count. + */ + count?: int32; + + /** + * Time interval. + */ + timeInterval?: string; +} + +/** + * Actions which to take by the auto-heal module when a rule is triggered. + */ +model AutoHealActions { + /** + * Predefined action to be taken. + */ + actionType?: AutoHealActionType; + + /** + * Custom action to be taken. + */ + customAction?: AutoHealCustomAction; + + /** + * Minimum time the process must execute + * before taking the action + */ + minProcessExecutionTime?: string; +} + +/** + * Custom action to be executed + * when an auto heal rule is triggered. + */ +model AutoHealCustomAction { + /** + * Executable to be run. + */ + exe?: string; + + /** + * Parameters for the executable. + */ + parameters?: string; +} + +/** + * Cross-Origin Resource Sharing (CORS) settings for the app. + */ +model CorsSettings { + /** + * Gets or sets the list of origins that should be allowed to make cross-origin + * calls (for example: http://example.com:12345). Use "*" to allow all. + */ + allowedOrigins?: string[]; + + /** + * Gets or sets whether CORS requests with credentials are allowed. See + * https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS#Requests_with_credentials + * for more details. + */ + supportCredentials?: boolean; +} + +/** + * Push settings for the App. + */ +#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +model PushSettings extends ProxyOnlyResource { + /** + * PushSettings resource specific properties + */ + #suppress "@azure-tools/typespec-azure-core/no-private-usage" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + properties?: PushSettingsProperties; +} + +/** + * PushSettings resource specific properties + */ +model PushSettingsProperties { + /** + * Gets or sets a flag indicating whether the Push endpoint is enabled. + */ + isPushEnabled: boolean; + + /** + * Gets or sets a JSON string containing a list of tags that are whitelisted for use by the push registration endpoint. + */ + tagWhitelistJson?: string; + + #suppress "@azure-tools/typespec-azure-resource-manager/secret-prop" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + @doc(""" + Gets or sets a JSON string containing a list of tags that require user authentication to be used in the push registration endpoint. + Tags can consist of alphanumeric characters and the following: + '_', '@', '#', '.', ':', '-'. + Validation should be performed at the PushRequestHandler. + """) + tagsRequiringAuth?: string; + + /** + * Gets or sets a JSON string containing a list of dynamic tags that will be evaluated from user claims in the push registration endpoint. + */ + dynamicTagsJson?: string; +} + +/** + * Information about the formal API definition for the app. + */ +model ApiDefinitionInfo { + /** + * The URL of the API definition. + */ + url?: string; +} + +/** + * Azure API management (APIM) configuration linked to the app. + */ +model ApiManagementConfig { + /** + * APIM-Api Identifier. + */ + id?: string; +} + +/** + * IP security restriction on an app. + */ +model IpSecurityRestriction { + /** + * IP address the security restriction is valid for. + * It can be in form of pure ipv4 address (required SubnetMask property) or + * CIDR notation such as ipv4/mask (leading bit match). For CIDR, + * SubnetMask property must not be specified. + */ + ipAddress?: string; + + /** + * Subnet mask for the range of IP addresses the restriction is valid for. + */ + subnetMask?: string; + + /** + * Virtual network resource id + */ + vnetSubnetResourceId?: string; + + /** + * (internal) Vnet traffic tag + */ + vnetTrafficTag?: int32; + + /** + * (internal) Subnet traffic tag + */ + subnetTrafficTag?: int32; + + /** + * Allow or Deny access for this IP range. + */ + action?: string; + + /** + * Defines what this IP filter will be used for. This is to support IP filtering on proxies. + */ + tag?: IpFilterTag; + + /** + * Priority of IP restriction rule. + */ + priority?: int32; + + /** + * IP restriction rule name. + */ + name?: string; + + /** + * IP restriction rule description. + */ + description?: string; + + /** + * IP restriction rule headers. + * X-Forwarded-Host (https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Forwarded-Host#Examples). + * The matching logic is .. + * - If the property is null or empty (default), all hosts(or lack of) are allowed. + * - A value is compared using ordinal-ignore-case (excluding port number). + * - Subdomain wildcards are permitted but don't match the root domain. For example, *.contoso.com matches the subdomain foo.contoso.com + * but not the root domain contoso.com or multi-level foo.bar.contoso.com + * - Unicode host names are allowed but are converted to Punycode for matching. + * + * X-Forwarded-For (https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Forwarded-For#Examples). + * The matching logic is .. + * - If the property is null or empty (default), any forwarded-for chains (or lack of) are allowed. + * - If any address (excluding port number) in the chain (comma separated) matches the CIDR defined by the property. + * + * X-Azure-FDID and X-FD-HealthProbe. + * The matching logic is exact match. + */ + #suppress "@azure-tools/typespec-azure-resource-manager/arm-no-record" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + headers?: Record; +} + +/** + * Azure Files or Blob Storage access information value for dictionary storage. + */ +model AzureStorageInfoValue { + /** + * Type of storage. + */ + type?: AzureStorageType; + + /** + * Name of the storage account. + */ + accountName?: string; + + /** + * Name of the file share (container name, for Blob storage). + */ + shareName?: string; + + /** + * Access key for the storage account. + */ + @secret + accessKey?: string; + + /** + * Path to mount the storage within the site's runtime environment. + */ + mountPath?: string; + + /** + * State of the storage account. + */ + @visibility(Lifecycle.Read) + state?: AzureStorageState; + + /** + * Mounting protocol to use for the storage account. + */ + protocol?: AzureStorageProtocol; +} + +/** + * Function app configuration. + */ +model FunctionAppConfig { + /** + * Function app deployment configuration. + */ + deployment?: FunctionsDeployment; + + /** + * Function app runtime settings. + */ + runtime?: FunctionsRuntime; + + /** + * Function app scale and concurrency settings. + */ + scaleAndConcurrency?: FunctionsScaleAndConcurrency; + + /** + * Function app site update strategy configuration. + */ + @added(Versions.v2025_05_01) + siteUpdateStrategy?: FunctionsSiteUpdateStrategy; +} + +/** + * Configuration section for the function app deployment. + */ +model FunctionsDeployment { + /** + * Storage for deployed package used by the function app. + */ + storage?: FunctionsDeploymentStorage; +} + +/** + * Storage for deployed package used by the function app. + */ +model FunctionsDeploymentStorage { + /** + * Property to select Azure Storage type. Available options: blobContainer. + */ + type?: FunctionsDeploymentStorageType; + + /** + * Property to set the URL for the selected Azure Storage type. Example: For blobContainer, the value could be https://.blob.core.windows.net/. + */ + value?: url; + + /** + * Authentication method to access the storage account for deployment. + */ + authentication?: FunctionsDeploymentStorageAuthentication; +} + +/** + * Authentication method to access the storage account for deployment. + */ +model FunctionsDeploymentStorageAuthentication { + /** + * Property to select authentication type to access the selected storage account. Available options: SystemAssignedIdentity, UserAssignedIdentity, StorageAccountConnectionString. + */ + type?: AuthenticationType; + + /** + * Use this property for UserAssignedIdentity. Set the resource ID of the identity. Do not set a value for this property when using other authentication type. + */ + userAssignedIdentityResourceId?: string; + + /** + * Use this property for StorageAccountConnectionString. Set the name of the app setting that has the storage account connection string. Do not set a value for this property when using other authentication type. + */ + storageAccountConnectionStringName?: string; +} + +/** + * Function app runtime name and version. + */ +model FunctionsRuntime { + /** + * Function app runtime name. Available options: dotnet-isolated, node, java, powershell, python, custom + */ + name?: RuntimeName; + + /** + * Function app runtime version. Example: 8 (for dotnet-isolated) + */ + #suppress "@azure-tools/typespec-azure-core/no-nullable" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + version?: string | null; +} + +/** + * Scale and concurrency settings for the function app. + */ +model FunctionsScaleAndConcurrency { + /** + * 'Always Ready' configuration for the function app. + */ + alwaysReady?: FunctionsAlwaysReadyConfig[]; + + /** + * The maximum number of instances for the function app. + */ + maximumInstanceCount?: int32; + + /** + * Set the amount of memory allocated to each instance of the function app in MB. CPU and network bandwidth are allocated proportionally. + */ + #suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + instanceMemoryMB?: int32; + + /** + * Scale and concurrency settings for the function app triggers. + */ + triggers?: FunctionsScaleAndConcurrencyTriggers; +} + +/** + * Function app site update strategy configuration for deployments and site config updates. + */ +@added(Versions.v2025_05_01) +model FunctionsSiteUpdateStrategy { + /** + * Function app site update strategy type. Available options: Recreate, RollingUpdate + */ + type?: SiteUpdateStrategyType; +} + +/** + * Sets the number of 'Always Ready' instances for a function group or a specific function. + */ +model FunctionsAlwaysReadyConfig { + /** + * Either a function group or a function name is required. For additional information see https://aka.ms/flexconsumption/alwaysready. + */ + name?: string; + + /** + * Sets the number of 'Always Ready' instances for a given function group or a specific function. For additional information see https://aka.ms/flexconsumption/alwaysready. + */ + instanceCount?: int32; +} + +/** + * Scale and concurrency settings for the function app triggers. + */ +model FunctionsScaleAndConcurrencyTriggers { + /** + * Scale and concurrency settings for the HTTP trigger. + */ + http?: FunctionsScaleAndConcurrencyTriggersHttp; +} + +/** + * Scale and concurrency settings for the HTTP trigger. + */ +model FunctionsScaleAndConcurrencyTriggersHttp { + /** + * The maximum number of concurrent HTTP trigger invocations per instance. + */ + perInstanceConcurrency?: int32; +} + +/** + * App Dapr configuration. + */ +model DaprConfig { + /** + * Boolean indicating if the Dapr side car is enabled + */ + enabled?: boolean = false; + + /** + * Dapr application identifier + */ + appId?: string; + + /** + * Tells Dapr which port your application is listening on + */ + appPort?: int32; + + /** + * Dapr max size of http header read buffer in KB to handle when sending multi-KB headers. Default is 65KB. + */ + httpReadBufferSize?: int32; + + /** + * Increasing max size of request body http servers parameter in MB to handle uploading of big files. Default is 4 MB. + */ + httpMaxRequestSize?: int32; + + /** + * Sets the log level for the Dapr sidecar. Allowed values are debug, info, warn, error. Default is info. + */ + logLevel?: DaprLogLevel; + + /** + * Enables API logging for the Dapr sidecar + */ + enableApiLogging?: boolean; +} + +/** + * Function app resource requirements. + */ +model ResourceConfig { + /** + * Required CPU in cores, e.g. 0.5 + */ + cpu?: float64; + + /** + * Required memory, e.g. "1Gi" + */ + memory?: string; +} + +/** + * Specification for an App Service Environment to use for this resource. + */ +model HostingEnvironmentProfile { + /** + * Resource ID of the App Service Environment. + */ + id?: string; + + /** + * Name of the App Service Environment. + */ + @visibility(Lifecycle.Read) + name?: string; + + /** + * Resource type of the App Service Environment. + */ + @visibility(Lifecycle.Read) + type?: string; +} + +/** + * Information needed for cloning operation. + */ +model CloningInfo { + /** + * Correlation ID of cloning operation. This ID ties multiple cloning operations + * together to use the same snapshot. + */ + #suppress "@azure-tools/typespec-azure-core/no-format" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + @format("uuid") + correlationId?: string; + + /** + * true to overwrite destination app; otherwise, false. + */ + overwrite?: boolean; + + /** + * true to clone custom hostnames from source app; otherwise, false. + */ + cloneCustomHostNames?: boolean; + + /** + * true to clone source control from source app; otherwise, false. + */ + cloneSourceControl?: boolean; + + /** + * ARM resource ID of the source app. App resource ID is of the form + * /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName} for production slots and + * /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/slots/{slotName} for other slots. + */ + sourceWebAppId: string; + + /** + * Location of source app ex: West US or North Europe + */ + sourceWebAppLocation?: string; + + /** + * App Service Environment. + */ + hostingEnvironment?: string; + + /** + * Application setting overrides for cloned app. If specified, these settings override the settings cloned + * from source app. Otherwise, application settings from source app are retained. + */ + #suppress "@azure-tools/typespec-azure-resource-manager/arm-no-record" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + appSettingsOverrides?: Record; + + /** + * true to configure load balancing for source and destination app. + */ + configureLoadBalancing?: boolean; + + /** + * ARM resource ID of the Traffic Manager profile to use, if it exists. Traffic Manager resource ID is of the form + * /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/trafficManagerProfiles/{profileName}. + */ + trafficManagerProfileId?: string; + + /** + * Name of Traffic Manager profile to create. This is only needed if Traffic Manager profile does not already exist. + */ + trafficManagerProfileName?: string; +} + +/** + * The status of the last successful slot swap operation. + */ +model SlotSwapStatus { + /** + * The time the last successful slot swap completed. + */ + @visibility(Lifecycle.Read) + // FIXME: (utcDateTime) Please double check that this is the correct type for your scenario. + timestampUtc?: utcDateTime; + + /** + * The source slot of the last swap operation. + */ + @visibility(Lifecycle.Read) + sourceSlotName?: string; + + /** + * The destination slot of the last swap operation. + */ + @visibility(Lifecycle.Read) + destinationSlotName?: string; +} + +/** + * Managed service identity. + */ +model ManagedServiceIdentity { + /** + * Type of managed service identity. + */ + type?: ManagedServiceIdentityType; + + /** + * Tenant of managed service identity. + */ + @visibility(Lifecycle.Read) + tenantId?: string; + + /** + * Principal Id of managed service identity. + */ + @visibility(Lifecycle.Read) + principalId?: string; + + /** + * The list of user assigned identities associated with the resource. The user identity dictionary key references will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName} + */ + #suppress "@azure-tools/typespec-azure-resource-manager/arm-no-record" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + userAssignedIdentities?: Record; +} + +/** + * User Assigned identity. + */ +model UserAssignedIdentity { + /** + * Principal Id of user assigned identity + */ + @visibility(Lifecycle.Read) + principalId?: string; + + /** + * Client Id of user assigned identity + */ + @visibility(Lifecycle.Read) + clientId?: string; +} + +/** + * Extended Location. + */ +model ExtendedLocation { + /** + * Name of extended location. + */ + name?: string; + + /** + * Type of extended location. + */ + @visibility(Lifecycle.Read) + type?: string; +} + +/** + * Diagnostics for an App Service Environment. + */ +model HostingEnvironmentDiagnostics { + /** + * Name/identifier of the diagnostics. + */ + name?: string; + + /** + * Diagnostics output. + */ + diagnosticsOutput?: string; +} + +/** + * Collection of Inbound Environment Endpoints + */ +model InboundEnvironmentEndpointCollection + is Azure.Core.Page; + +/** + * The IP Addresses and Ports that require inbound network access to and within the subnet of the App Service Environment. + */ +model InboundEnvironmentEndpoint { + /** + * Short text describing the purpose of the network traffic. + */ + description?: string; + + /** + * The IP addresses that network traffic will originate from in cidr notation. + */ + endpoints?: string[]; + + /** + * The ports that network traffic will arrive to the App Service Environment at. + */ + ports?: string[]; +} + +/** + * Worker pool of an App Service Environment. + */ +#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-provisioning-state" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +model WorkerPool { + /** + * Worker size ID for referencing this worker pool. + */ + workerSizeId?: int32; + + /** + * Shared or dedicated app hosting. + */ + computeMode?: ComputeModeOptions; + + /** + * VM size of the worker pool instances. + */ + workerSize?: string; + + /** + * Number of instances in the worker pool. + */ + workerCount?: int32; + + /** + * Names of all instances in the worker pool (read only). + */ + @visibility(Lifecycle.Read) + instanceNames?: string[]; +} + +/** + * Description of a SKU for a scalable resource. + */ +model SkuDescription { + /** + * Name of the resource SKU. + */ + name?: string; + + /** + * Service tier of the resource SKU. + */ + tier?: string; + + /** + * Size specifier of the resource SKU. + */ + size?: string; + + /** + * Family code of the resource SKU. + */ + family?: string; + + /** + * Current number of instances assigned to the resource. + */ + capacity?: int32; + + /** + * Min, max, and default scale values of the SKU. + */ + skuCapacity?: SkuCapacity; + + /** + * Locations of the SKU. + */ + locations?: string[]; + + /** + * Capabilities of the SKU, e.g., is traffic manager enabled? + */ + @identifiers(#["name"]) + capabilities?: Capability[]; +} + +/** + * Description of the App Service plan scale options. + */ +model SkuCapacity { + /** + * Minimum number of workers for this App Service plan SKU. + */ + minimum?: int32; + + /** + * Maximum number of workers for this App Service plan SKU. + */ + maximum?: int32; + + /** + * Maximum number of Elastic workers for this App Service plan SKU. + */ + elasticMaximum?: int32; + + /** + * Default number of workers for this App Service plan SKU. + */ + default?: int32; + + /** + * Available scale configurations for an App Service plan. + */ + scaleType?: string; +} + +/** + * Describes the capabilities/features allowed for a specific SKU. + */ +model Capability { + /** + * Name of the SKU capability. + */ + name?: string; + + /** + * Value of the SKU capability. + */ + value?: string; + + /** + * Reason of the SKU capability. + */ + reason?: string; +} + +/** + * Collection of metric definitions. + */ +model ResourceMetricDefinitionCollection + is Azure.Core.Page; + +/** + * Metadata for the metrics. + */ +#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +model ResourceMetricDefinition extends ProxyOnlyResource { + /** + * ResourceMetricDefinition resource specific properties + */ + #suppress "@azure-tools/typespec-azure-core/no-private-usage" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + properties?: ResourceMetricDefinitionProperties; +} + +/** + * ResourceMetricDefinition resource specific properties + */ +model ResourceMetricDefinitionProperties { + /** + * Unit of the metric. + */ + @visibility(Lifecycle.Read) + unit?: string; + + /** + * Primary aggregation type. + */ + @visibility(Lifecycle.Read) + primaryAggregationType?: string; + + /** + * List of time grains supported for the metric together with retention period. + */ + @visibility(Lifecycle.Read) + @identifiers(#[]) + metricAvailabilities?: ResourceMetricAvailability[]; + + /** + * Resource URI. + */ + @visibility(Lifecycle.Read) + resourceUri?: string; + + /** + * Resource metric definition properties. + */ + #suppress "@azure-tools/typespec-azure-resource-manager/arm-no-record" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + @visibility(Lifecycle.Read) + properties?: Record; +} + +/** + * Metrics availability and retention. + */ +model ResourceMetricAvailability { + /** + * Time grain . + */ + @visibility(Lifecycle.Read) + timeGrain?: string; + + /** + * Retention period for the current time grain. + */ + @visibility(Lifecycle.Read) + retention?: string; +} + +/** + * Collection of SKU information. + */ +@@Azure.ResourceManager.identifiers(SkuInfoCollection.value, + #["/sku/name", "resourceType"] +); +model SkuInfoCollection is Azure.Core.Page; + +/** + * SKU discovery information. + */ +model SkuInfo { + /** + * Resource type that this SKU applies to. + */ + resourceType?: string; + + /** + * Name and tier of the SKU. + */ + sku?: SkuDescription; + + /** + * Min, max, and default scale values of the SKU. + */ + capacity?: SkuCapacity; +} + +/** + * Collection of usages. + */ +model UsageCollection is Azure.Core.Page; + +/** + * Usage of the quota resource. + */ +#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +model Usage extends ProxyOnlyResource { + /** + * Usage resource specific properties + */ + #suppress "@azure-tools/typespec-azure-core/no-private-usage" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + properties?: UsageProperties; +} + +/** + * Usage resource specific properties + */ +model UsageProperties { + /** + * Friendly name shown in the UI. + */ + @visibility(Lifecycle.Read) + displayName?: string; + + /** + * Name of the quota resource. + */ + @visibility(Lifecycle.Read) + resourceName?: string; + + /** + * Units of measurement for the quota resource. + */ + @visibility(Lifecycle.Read) + unit?: string; + + /** + * The current value of the resource counter. + */ + @visibility(Lifecycle.Read) + currentValue?: int64; + + /** + * The resource limit. + */ + @visibility(Lifecycle.Read) + limit?: int64; + + /** + * Next reset time for the resource counter. + */ + @visibility(Lifecycle.Read) + // FIXME: (utcDateTime) Please double check that this is the correct type for your scenario. + nextResetTime?: utcDateTime; + + /** + * Compute mode used for this usage. + */ + @visibility(Lifecycle.Read) + computeMode?: ComputeModeOptions; + + /** + * Site mode used for this usage. + */ + @visibility(Lifecycle.Read) + siteMode?: string; +} + +/** + * An operation on a resource. + */ +model Operation { + /** + * Operation ID. + */ + id?: string; + + /** + * Operation name. + */ + name?: string; + + /** + * The current status of the operation. + */ + status?: OperationStatus; + + /** + * Any errors associate with the operation. + */ + @identifiers(#[]) + errors?: ErrorEntity[]; + + /** + * Time when operation has started. + */ + // FIXME: (utcDateTime) Please double check that this is the correct type for your scenario. + createdTime?: utcDateTime; + + /** + * Time when operation has been updated. + */ + // FIXME: (utcDateTime) Please double check that this is the correct type for your scenario. + modifiedTime?: utcDateTime; + + /** + * Time when operation will expire. + */ + // FIXME: (utcDateTime) Please double check that this is the correct type for your scenario. + expirationTime?: utcDateTime; + + /** + * Applicable only for stamp operation ids. + */ + #suppress "@azure-tools/typespec-azure-core/no-format" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + @format("uuid") + geoMasterOperationId?: string; +} + +/** + * Body of the error response returned from the API. + */ +model ErrorEntity { + /** + * Type of error. + */ + extendedCode?: string; + + /** + * Message template. + */ + messageTemplate?: string; + + /** + * Parameters for the template. + */ + parameters?: string[]; + + /** + * Inner errors. + */ + @identifiers(#[]) + innerErrors?: ErrorEntity[]; + + /** + * Error Details. + */ + @identifiers(#[]) + details?: ErrorEntity[]; + + /** + * The error target. + */ + target?: string; + + /** + * Basic error code. + */ + code?: string; + + /** + * Any details of the error. + */ + message?: string; +} + +/** + * Collection of Outbound Environment Endpoints + */ +@@Azure.ResourceManager.identifiers(OutboundEnvironmentEndpointCollection.value, + #["category"] +); +model OutboundEnvironmentEndpointCollection + is Azure.Core.Page; + +/** + * Endpoints accessed for a common purpose that the App Service Environment requires outbound network access to. + */ +model OutboundEnvironmentEndpoint { + /** + * The type of service accessed by the App Service Environment, e.g., Azure Storage, Azure SQL Database, and Azure Active Directory. + */ + category?: string; + + /** + * The endpoints that the App Service Environment reaches the service at. + */ + @identifiers(#["domainName"]) + endpoints?: EndpointDependency[]; +} + +/** + * A domain name that a service is reached at, including details of the current connection status. + */ +model EndpointDependency { + /** + * The domain name of the dependency. + */ + domainName?: string; + + /** + * The IP Addresses and Ports used when connecting to DomainName. + */ + @identifiers(#["ipAddress", "port"]) + endpointDetails?: EndpointDetail[]; +} + +/** + * Current TCP connectivity information from the App Service Environment to a single endpoint. + */ +model EndpointDetail { + /** + * An IP Address that Domain Name currently resolves to. + */ + ipAddress?: string; + + /** + * The port an endpoint is connected to. + */ + port?: int32; + + /** + * The time in milliseconds it takes for a TCP connection to be created from the App Service Environment to this IpAddress at this Port. + */ + latency?: float64; + + /** + * Whether it is possible to create a TCP connection from the App Service Environment to this IpAddress at this Port. + */ + isAccessible?: boolean; +} + +/** + * RemotePrivateEndpointConnectionARMResource resource specific properties + */ +#suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +model RemotePrivateEndpointConnectionARMResourceProperties { + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + #suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-provisioning-state" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + @visibility(Lifecycle.Read) + provisioningState?: string; + + /** + * PrivateEndpoint of a remote private endpoint connection + */ + privateEndpoint?: ArmIdWrapper; + + /** + * The state of a private link connection + */ + privateLinkServiceConnectionState?: PrivateLinkConnectionState; + + /** + * Private IPAddresses mapped to the remote private endpoint + */ + ipAddresses?: string[]; +} + +/** + * A wrapper for an ARM resource id + */ +model ArmIdWrapper { + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + @visibility(Lifecycle.Read) + id?: string; +} + +/** + * The state of a private link connection + */ +model PrivateLinkConnectionState { + /** + * Status of a private link connection + */ + status?: string; + + /** + * Description of a private link connection + */ + description?: string; + + /** + * ActionsRequired for a private link connection + */ + actionsRequired?: string; +} + +/** + * Wrapper for a collection of private link resources + */ +model PrivateLinkResourcesWrapper { + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + value: PrivateLinkResource[]; +} + +/** + * A private link resource + */ +model PrivateLinkResource { + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + id: string; + + /** + * Name of a private link resource + */ + name: string; + + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + type: string; + + /** + * Properties of a private link resource + */ + properties: PrivateLinkResourceProperties; +} + +/** + * Properties of a private link resource + */ +model PrivateLinkResourceProperties { + /** + * GroupId of a private link resource + */ + @visibility(Lifecycle.Read) + groupId?: string; + + /** + * RequiredMembers of a private link resource + */ + @visibility(Lifecycle.Read) + requiredMembers?: string[]; + + /** + * RequiredZoneNames of a private link resource + */ + @visibility(Lifecycle.Read) + requiredZoneNames?: string[]; +} + +/** + * AppServicePlan resource specific properties + */ +model AppServicePlanProperties { + /** + * Target worker tier assigned to the App Service plan. + */ + workerTierName?: string; + + /** + * App Service plan status. + */ + @visibility(Lifecycle.Read) + status?: StatusOptions; + + /** + * App Service plan subscription. + */ + @visibility(Lifecycle.Read) + subscription?: string; + + /** + * Specification for the App Service Environment to use for the App Service plan. + */ + @visibility(Lifecycle.Read, Lifecycle.Create) + hostingEnvironmentProfile?: HostingEnvironmentProfile; + + /** + * Maximum number of instances that can be assigned to this App Service plan. + */ + @visibility(Lifecycle.Read) + maximumNumberOfWorkers?: int32; + + /** + * The number of instances that are assigned to this App Service plan. + */ + @visibility(Lifecycle.Read) + numberOfWorkers?: int32; + + /** + * Geographical location for the App Service plan. + */ + @visibility(Lifecycle.Read) + geoRegion?: string; + + /** + * If true, apps assigned to this App Service plan can be scaled independently. + * If false, apps assigned to this App Service plan will scale to all instances of the plan. + */ + perSiteScaling?: boolean; + + /** + * ServerFarm supports ElasticScale. Apps in this plan will scale as if the ServerFarm was ElasticPremium sku + */ + elasticScaleEnabled?: boolean; + + /** + * Maximum number of total workers allowed for this ElasticScaleEnabled App Service Plan + */ + maximumElasticWorkerCount?: int32; + + /** + * Number of apps assigned to this App Service plan. + */ + @visibility(Lifecycle.Read) + numberOfSites?: int32; + + /** + * If true, this App Service Plan owns spot instances. + */ + isSpot?: boolean; + + /** + * The time when the server farm expires. Valid only if it is a spot server farm. + */ + // FIXME: (utcDateTime) Please double check that this is the correct type for your scenario. + spotExpirationTime?: utcDateTime; + + /** + * The time when the server farm free offer expires. + */ + // FIXME: (utcDateTime) Please double check that this is the correct type for your scenario. + freeOfferExpirationTime?: utcDateTime; + + /** + * Resource group of the App Service plan. + */ + @visibility(Lifecycle.Read) + resourceGroup?: string; + + /** + * If Linux app service plan true, false otherwise. + */ + @visibility(Lifecycle.Read, Lifecycle.Create) + reserved?: boolean; + + /** + * Obsolete: If Hyper-V container app service plan true, false otherwise. + */ + @visibility(Lifecycle.Read, Lifecycle.Create) + isXenon?: boolean; + + /** + * If Hyper-V container app service plan true, false otherwise. + */ + @visibility(Lifecycle.Read, Lifecycle.Create) + hyperV?: boolean; + + /** + * Scaling worker count. + */ + targetWorkerCount?: int32; + + /** + * Scaling worker size ID. + */ + targetWorkerSizeId?: int32; + + /** + * Provisioning state of the App Service Plan. + */ + @visibility(Lifecycle.Read) + provisioningState?: ProvisioningState; + + /** + * Specification for the Kubernetes Environment to use for the App Service plan. + */ + kubeEnvironmentProfile?: KubeEnvironmentProfile; + + /** + * If true, this App Service Plan will perform availability zone balancing. + * If false, this App Service Plan will not perform availability zone balancing. + */ + zoneRedundant?: boolean; + + /** + * If true, this App Service Plan will attempt to scale asynchronously if there are insufficient workers to scale synchronously. + * If false, this App Service Plan will only attempt sync scaling. + */ + asyncScalingEnabled?: boolean; + + /** + * Identity to use by platform for various features and integrations using managed identity. + */ + planDefaultIdentity?: DefaultIdentity; + + /** + * Whether this server farm is in custom mode. + */ + isCustomMode?: boolean; + + /** + * Registry adapters associated with this App Service plan. + */ + @identifiers(#[]) + registryAdapters?: RegistryAdapter[]; + + /** + * Install scripts associated with this App Service plan. + */ + installScripts?: InstallScript[]; + + /** + * All network settings for the server farm. + */ + network?: ServerFarmNetworkSettings; + + /** + * Storage mounts associated with this App Service plan. + */ + storageMounts?: StorageMount[]; + + /** + * If true, RDP access is enabled for this App Service plan. Only applicable for IsCustomMode ASPs. + * If false, RDP access is disabled. + */ + rdpEnabled?: boolean; +} + +/** + * Specification for a Kubernetes Environment to use for this resource. + */ +model KubeEnvironmentProfile { + /** + * Resource ID of the Kubernetes Environment. + */ + id?: string; + + /** + * Name of the Kubernetes Environment. + */ + @visibility(Lifecycle.Read) + name?: string; + + /** + * Resource type of the Kubernetes Environment. + */ + @visibility(Lifecycle.Read) + type?: string; +} + +/** + * Collection of CSM usage quotas. + */ +@@Azure.ResourceManager.identifiers(CsmUsageQuotaCollection.value, #["name"]); +model CsmUsageQuotaCollection is Azure.Core.Page; + +/** + * Usage of the quota resource. + */ +model CsmUsageQuota { + /** + * Units of measurement for the quota resource. + */ + unit?: string; + + /** + * Next reset time for the resource counter. + */ + // FIXME: (utcDateTime) Please double check that this is the correct type for your scenario. + nextResetTime?: utcDateTime; + + /** + * The current value of the resource counter. + */ + currentValue?: int64; + + /** + * The resource limit. + */ + limit?: int64; + + /** + * Quota name. + */ + name?: LocalizableString; +} + +/** + * Localizable string object containing the name and a localized value. + */ +model LocalizableString { + /** + * Non-localized name. + */ + value?: string; + + /** + * Localized name. + */ + localizedValue?: string; +} + +/** + * ARM resource for a app service plan. + */ +#suppress "@azure-tools/typespec-azure-resource-manager/patch-envelope" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +model AppServicePlanPatchResource extends ProxyOnlyResource { + /** + * AppServicePlanPatchResource resource specific properties + */ + #suppress "@azure-tools/typespec-azure-core/no-private-usage" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + properties?: AppServicePlanPatchResourceProperties; + + /** + * Managed service identity. + */ + identity?: ManagedServiceIdentity; +} + +/** + * AppServicePlanPatchResource resource specific properties + */ +model AppServicePlanPatchResourceProperties { + /** + * Target worker tier assigned to the App Service plan. + */ + workerTierName?: string; + + /** + * App Service plan status. + */ + @visibility(Lifecycle.Read) + status?: StatusOptions; + + /** + * App Service plan subscription. + */ + @visibility(Lifecycle.Read) + subscription?: string; + + /** + * Specification for the App Service Environment to use for the App Service plan. + */ + @visibility(Lifecycle.Read, Lifecycle.Create) + hostingEnvironmentProfile?: HostingEnvironmentProfile; + + /** + * Maximum number of instances that can be assigned to this App Service plan. + */ + @visibility(Lifecycle.Read) + maximumNumberOfWorkers?: int32; + + /** + * The number of instances that are assigned to this App Service plan. + */ + @visibility(Lifecycle.Read) + numberOfWorkers?: int32; + + /** + * Geographical location for the App Service plan. + */ + @visibility(Lifecycle.Read) + geoRegion?: string; + + /** + * If true, apps assigned to this App Service plan can be scaled independently. + * If false, apps assigned to this App Service plan will scale to all instances of the plan. + */ + perSiteScaling?: boolean = false; + + /** + * ServerFarm supports ElasticScale. Apps in this plan will scale as if the ServerFarm was ElasticPremium sku + */ + elasticScaleEnabled?: boolean; + + /** + * Maximum number of total workers allowed for this ElasticScaleEnabled App Service Plan + */ + maximumElasticWorkerCount?: int32; + + /** + * Number of apps assigned to this App Service plan. + */ + @visibility(Lifecycle.Read) + numberOfSites?: int32; + + /** + * If true, this App Service Plan owns spot instances. + */ + isSpot?: boolean; + + /** + * The time when the server farm expires. Valid only if it is a spot server farm. + */ + // FIXME: (utcDateTime) Please double check that this is the correct type for your scenario. + spotExpirationTime?: utcDateTime; + + /** + * The time when the server farm free offer expires. + */ + // FIXME: (utcDateTime) Please double check that this is the correct type for your scenario. + freeOfferExpirationTime?: utcDateTime; + + /** + * Resource group of the App Service plan. + */ + @visibility(Lifecycle.Read) + resourceGroup?: string; + + /** + * If Linux app service plan true, false otherwise. + */ + @visibility(Lifecycle.Read, Lifecycle.Create) + reserved?: boolean = false; + + /** + * Obsolete: If Hyper-V container app service plan true, false otherwise. + */ + @visibility(Lifecycle.Read, Lifecycle.Create) + isXenon?: boolean = false; + + /** + * If Hyper-V container app service plan true, false otherwise. + */ + @visibility(Lifecycle.Read, Lifecycle.Create) + hyperV?: boolean = false; + + /** + * Scaling worker count. + */ + targetWorkerCount?: int32; + + /** + * Scaling worker size ID. + */ + targetWorkerSizeId?: int32; + + /** + * Provisioning state of the App Service Plan. + */ + @visibility(Lifecycle.Read) + provisioningState?: ProvisioningState; + + /** + * Specification for the Kubernetes Environment to use for the App Service plan. + */ + kubeEnvironmentProfile?: KubeEnvironmentProfile; + + /** + * If true, this App Service Plan will perform availability zone balancing. + * If false, this App Service Plan will not perform availability zone balancing. + */ + zoneRedundant?: boolean = false; +} + +/** + * HybridConnection resource specific properties + */ +#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-provisioning-state" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +model HybridConnectionProperties { + /** + * The name of the Service Bus namespace. + */ + @visibility(Lifecycle.Read, Lifecycle.Create) + serviceBusNamespace?: string; + + /** + * The name of the Service Bus relay. + */ + @visibility(Lifecycle.Read, Lifecycle.Create) + relayName?: string; + + /** + * The ARM URI to the Service Bus relay. + */ + relayArmUri?: string; + + /** + * The hostname of the endpoint. + */ + hostname?: string; + + /** + * The port of the endpoint. + */ + port?: int32; + + /** + * The name of the Service Bus key which has Send permissions. This is used to authenticate to Service Bus. + */ + sendKeyName?: string; + + /** + * The value of the Service Bus key. This is used to authenticate to Service Bus. In ARM this key will not be returned + * normally, use the POST /listKeys API instead. + */ + sendKeyValue?: string; + + /** + * The suffix for the service bus endpoint. By default this is .servicebus.windows.net + */ + serviceBusSuffix?: string; +} + +/** + * Hybrid Connection key contract. This has the send key name and value for a Hybrid Connection. + */ +#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +model HybridConnectionKey extends ProxyOnlyResource { + /** + * HybridConnectionKey resource specific properties + */ + #suppress "@azure-tools/typespec-azure-core/no-private-usage" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + properties?: HybridConnectionKeyProperties; +} + +/** + * HybridConnectionKey resource specific properties + */ +model HybridConnectionKeyProperties { + /** + * The name of the send key. + */ + @visibility(Lifecycle.Read) + sendKeyName?: string; + + /** + * The value of the send key. + */ + @visibility(Lifecycle.Read) + sendKeyValue?: string; +} + +/** + * Collection of resources. + */ +model ResourceCollection { + /** Collection of resources. */ + @TypeSpec.pageItems + value: string[]; + + /** Link to next page of resources. */ + @TypeSpec.nextLink + nextLink?: string; +} + +/** + * HybridConnectionLimits resource specific properties + */ +#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-provisioning-state" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +model HybridConnectionLimitsProperties { + /** + * The current number of Hybrid Connections. + */ + @visibility(Lifecycle.Read) + current?: int32; + + /** + * The maximum number of Hybrid Connections allowed. + */ + @visibility(Lifecycle.Read) + maximum?: int32; +} + +/** + * Virtual Network information contract. + */ +#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-provisioning-state" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +model VnetInfo { + /** + * The Virtual Network's resource ID. + */ + vnetResourceId?: string; + + /** + * The client certificate thumbprint. + */ + @visibility(Lifecycle.Read) + certThumbprint?: string; + + /** + * A certificate file (.cer) blob containing the public key of the private key used to authenticate a \nPoint-To-Site VPN connection. + */ + certBlob?: string; + + /** + * true if a resync is required; otherwise, false. + */ + @visibility(Lifecycle.Read) + resyncRequired?: boolean; + + /** + * DNS servers to be used by this Virtual Network. This should be a comma-separated list of IP addresses. + */ + dnsServers?: string; + + /** + * Flag that is used to denote if this is VNET injection + */ + isSwift?: boolean; +} + +/** + * VnetRoute resource specific properties + */ +#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-provisioning-state" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +model VnetRouteProperties { + /** + * The starting address for this route. This may also include a CIDR notation, in which case the end address must not be specified. + */ + startAddress?: string; + + /** + * The ending address for this route. If the start address is specified in CIDR notation, this must be omitted. + */ + endAddress?: string; + + /** + * The type of route this is: + * DEFAULT - By default, every app has routes to the local address ranges specified by RFC1918 + * INHERITED - Routes inherited from the real Virtual Network routes + * STATIC - Static route set on the app only + * + * These values will be used for syncing an app's routes with those from a Virtual Network. + */ + routeType?: RouteType; +} + +/** + * VnetGateway resource specific properties + */ +#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-provisioning-state" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +model VnetGatewayProperties { + /** + * The Virtual Network name. + */ + @visibility(Lifecycle.Read, Lifecycle.Create) + vnetName?: string; + + /** + * The URI where the VPN package can be downloaded. + */ + @visibility(Lifecycle.Create, Lifecycle.Update) + vpnPackageUri: string; +} + +/** + * Certificate resource specific properties + */ +#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-provisioning-state" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +model CertificateProperties { + /** + * Certificate password. + */ + #suppress "@azure-tools/typespec-azure-resource-manager/secret-prop" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + password?: string; + + /** + * Friendly name of the certificate. + */ + @visibility(Lifecycle.Read) + friendlyName?: string; + + /** + * Subject name of the certificate. + */ + @visibility(Lifecycle.Read) + subjectName?: string; + + /** + * Host names the certificate applies to. + */ + hostNames?: string[]; + + /** + * Pfx blob. + */ + pfxBlob?: bytes; + + /** + * App name. + */ + @visibility(Lifecycle.Read) + siteName?: string; + + /** + * Self link. + */ + @visibility(Lifecycle.Read) + selfLink?: string; + + /** + * Certificate issuer. + */ + @visibility(Lifecycle.Read) + issuer?: string; + + /** + * Certificate issue Date. + */ + @visibility(Lifecycle.Read) + // FIXME: (utcDateTime) Please double check that this is the correct type for your scenario. + issueDate?: utcDateTime; + + /** + * Certificate expiration date. + */ + @visibility(Lifecycle.Read) + // FIXME: (utcDateTime) Please double check that this is the correct type for your scenario. + expirationDate?: utcDateTime; + + /** + * Certificate thumbprint. + */ + @visibility(Lifecycle.Read) + thumbprint?: string; + + /** + * Is the certificate valid?. + */ + @visibility(Lifecycle.Read) + valid?: boolean; + + /** + * Raw bytes of .cer file + */ + @visibility(Lifecycle.Read) + cerBlob?: bytes; + + /** + * Public key hash. + */ + @visibility(Lifecycle.Read) + publicKeyHash?: string; + + /** + * Specification for the App Service Environment to use for the certificate. + */ + @visibility(Lifecycle.Read) + hostingEnvironmentProfile?: HostingEnvironmentProfile; + + /** + * Azure Key Vault Csm resource Id. + */ + keyVaultId?: Azure.Core.armResourceIdentifier<[ + { + type: "Microsoft.KeyVault/vaults"; + } + ]>; + + /** + * Azure Key Vault secret name. + */ + keyVaultSecretName?: string; + + /** + * Status of the Key Vault secret. + */ + @visibility(Lifecycle.Read) + keyVaultSecretStatus?: KeyVaultSecretStatus; + + /** + * Resource ID of the associated App Service plan. + */ + serverFarmId?: Azure.Core.armResourceIdentifier<[ + { + type: "Microsoft.Web/serverfarms"; + } + ]>; + + /** + * CNAME of the certificate to be issued via free certificate + */ + canonicalName?: string; + + /** + * Method of domain validation for free cert + */ + domainValidationMethod?: string; +} + +/** + * ARM resource for a certificate. + */ +#suppress "@azure-tools/typespec-azure-resource-manager/patch-envelope" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +model CertificatePatchResource extends ProxyOnlyResource { + /** + * CertificatePatchResource resource specific properties + */ + #suppress "@azure-tools/typespec-azure-core/no-private-usage" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + properties?: CertificatePatchResourceProperties; +} + +/** + * CertificatePatchResource resource specific properties + */ +model CertificatePatchResourceProperties { + /** + * Certificate password. + */ + @visibility(Lifecycle.Read) + password?: string; + + /** + * Friendly name of the certificate. + */ + @visibility(Lifecycle.Read) + friendlyName?: string; + + /** + * Subject name of the certificate. + */ + @visibility(Lifecycle.Read) + subjectName?: string; + + /** + * Host names the certificate applies to. + */ + hostNames?: string[]; + + /** + * Pfx blob. + */ + pfxBlob?: bytes; + + /** + * App name. + */ + @visibility(Lifecycle.Read) + siteName?: string; + + /** + * Self link. + */ + @visibility(Lifecycle.Read) + selfLink?: string; + + /** + * Certificate issuer. + */ + @visibility(Lifecycle.Read) + issuer?: string; + + /** + * Certificate issue Date. + */ + @visibility(Lifecycle.Read) + // FIXME: (utcDateTime) Please double check that this is the correct type for your scenario. + issueDate?: utcDateTime; + + /** + * Certificate expiration date. + */ + @visibility(Lifecycle.Read) + // FIXME: (utcDateTime) Please double check that this is the correct type for your scenario. + expirationDate?: utcDateTime; + + /** + * Certificate thumbprint. + */ + @visibility(Lifecycle.Read) + thumbprint?: string; + + /** + * Is the certificate valid?. + */ + @visibility(Lifecycle.Read) + valid?: boolean; + + /** + * Raw bytes of .cer file + */ + @visibility(Lifecycle.Read) + cerBlob?: bytes; + + /** + * Public key hash. + */ + @visibility(Lifecycle.Read) + publicKeyHash?: string; + + /** + * Specification for the App Service Environment to use for the certificate. + */ + @visibility(Lifecycle.Read) + hostingEnvironmentProfile?: HostingEnvironmentProfile; + + /** + * Key Vault Csm resource Id. + */ + keyVaultId?: string; + + /** + * Key Vault secret name. + */ + keyVaultSecretName?: string; + + /** + * Status of the Key Vault secret. + */ + @visibility(Lifecycle.Read) + keyVaultSecretStatus?: KeyVaultSecretStatus; + + /** + * Resource ID of the associated App Service plan, formatted as: "/subscriptions/{subscriptionID}/resourceGroups/{groupName}/providers/Microsoft.Web/serverfarms/{appServicePlanName}". + */ + serverFarmId?: string; + + /** + * CNAME of the certificate to be issued via free certificate + */ + canonicalName?: string; + + /** + * Method of domain validation for free cert + */ + domainValidationMethod?: string; +} + +/** + * DeletedSite resource specific properties + */ +#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-provisioning-state" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +model DeletedSiteProperties { + /** + * Numeric id for the deleted site + */ + @visibility(Lifecycle.Read) + deletedSiteId?: int32; + + /** + * Time in UTC when the app was deleted. + */ + @visibility(Lifecycle.Read) + deletedTimestamp?: string; + + /** + * Subscription containing the deleted site + */ + @visibility(Lifecycle.Read) + subscription?: string; + + /** + * ResourceGroup that contained the deleted site + */ + @visibility(Lifecycle.Read) + resourceGroup?: string; + + /** + * Name of the deleted site + */ + @visibility(Lifecycle.Read) + deletedSiteName?: string; + + /** + * Slot of the deleted site + */ + @visibility(Lifecycle.Read) + slot?: string; + + /** + * Kind of site that was deleted + */ + #suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-duplicate-property" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + @visibility(Lifecycle.Read) + kind?: string; + + /** + * Geo Region of the deleted site + */ + @visibility(Lifecycle.Read) + geoRegionName?: string; +} + +/** + * DetectorResponse resource specific properties + */ +#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-provisioning-state" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +model DetectorResponseProperties { + /** + * metadata for the detector + */ + metadata?: DetectorInfo; + + /** + * Data Set + */ + @identifiers(#[]) + dataset?: DiagnosticData[]; + + /** + * Indicates status of the most severe insight. + */ + status?: Status; + + /** + * Additional configuration for different data providers to be used by the UI + */ + @identifiers(#["providerName"]) + dataProvidersMetadata?: DataProviderMetadata[]; + + /** + * Suggested utterances where the detector can be applicable. + */ + suggestedUtterances?: QueryUtterancesResults; +} + +/** + * Definition of Detector + */ +model DetectorInfo { + /** + * Id of detector + */ + @visibility(Lifecycle.Read) + id?: string; + + /** + * Name of detector + */ + @visibility(Lifecycle.Read) + name?: string; + + /** + * Short description of the detector and its purpose. + */ + @visibility(Lifecycle.Read) + description?: string; + + /** + * Author of the detector. + */ + @visibility(Lifecycle.Read) + author?: string; + + /** + * Problem category. This serves for organizing group for detectors. + */ + @visibility(Lifecycle.Read) + category?: string; + + /** + * List of Support Topics for which this detector is enabled. + */ + @visibility(Lifecycle.Read) + supportTopicList?: SupportTopic[]; + + /** + * Analysis Types for which this detector should apply to. + */ + @visibility(Lifecycle.Read) + analysisType?: string[]; + + /** + * Whether this detector is an Analysis Detector or not. + */ + @visibility(Lifecycle.Read) + type?: DetectorType; + + /** + * Defines score of a detector to power ML based matching. + */ + @visibility(Lifecycle.Read) + score?: float32; +} + +/** + * Defines a unique Support Topic + */ +model SupportTopic { + /** + * Support Topic Id + */ + @visibility(Lifecycle.Read) + id?: string; + + /** + * Unique resource Id + */ + @visibility(Lifecycle.Read) + pesId?: string; +} + +/** + * Set of data with rendering instructions + */ +model DiagnosticData { + /** + * Data in table form + */ + table?: DataTableResponseObject; + + /** + * Properties that describe how the table should be rendered + */ + renderingProperties?: Rendering; +} + +/** + * Data Table which defines columns and raw row values + */ +model DataTableResponseObject { + /** + * Name of the table + */ + tableName?: string; + + /** + * List of columns with data types + */ + @identifiers(#["columnName"]) + columns?: DataTableResponseColumn[]; + + /** + * Raw row values + */ + @identifiers(#[]) + rows?: string[][]; +} + +/** + * Column definition + */ +model DataTableResponseColumn { + /** + * Name of the column + */ + columnName?: string; + + /** + * Data type which looks like 'String' or 'Int32'. + */ + dataType?: string; + + /** + * Column Type + */ + columnType?: string; +} + +/** + * Instructions for rendering the data + */ +model Rendering { + /** + * Rendering Type + */ + type?: RenderingType; + + /** + * Title of data + */ + title?: string; + + /** + * Description of the data that will help it be interpreted + */ + description?: string; +} + +/** + * Identify the status of the most severe insight generated by the detector. + */ +model Status { + /** + * Descriptive message. + */ + message?: string; + + /** + * Level of the most severe insight generated by the detector. + */ + statusId?: InsightStatus; +} + +/** + * Additional configuration for a data providers + */ +model DataProviderMetadata { + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + providerName?: string; + + /** + * Settings for the data provider + */ + @visibility(Lifecycle.Read) + @identifiers(#["key"]) + propertyBag?: KeyValuePairStringObject[]; +} + +#suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +model KeyValuePairStringObject { + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + @visibility(Lifecycle.Read) + key?: string; + + /** + * Any object + */ + #suppress "@azure-tools/typespec-azure-core/no-unknown" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + @visibility(Lifecycle.Read) + value?: unknown; +} + +/** + * Suggested utterances where the detector can be applicable + */ +model QueryUtterancesResults { + /** + * Search Query. + */ + query?: string; + + /** + * Array of utterance results for search query. + */ + @identifiers(#[]) + results?: QueryUtterancesResult[]; +} + +/** + * Result for utterances query. + */ +model QueryUtterancesResult { + /** + * A sample utterance. + */ + sampleUtterance?: SampleUtterance; + + /** + * Score of a sample utterance. + */ + score?: float32; +} + +/** + * Sample utterance. + */ +model SampleUtterance { + /** + * Text attribute of sample utterance. + */ + text?: string; + + /** + * Links attribute of sample utterance. + */ + links?: string[]; + + /** + * Question id of sample utterance (for stackoverflow questions titles). + */ + qid?: string; +} + +/** + * DiagnosticCategory resource specific properties + */ +#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-provisioning-state" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +model DiagnosticCategoryProperties { + /** + * Description of the diagnostic category + */ + @visibility(Lifecycle.Read) + description?: string; +} + +/** + * AnalysisDefinition resource specific properties + */ +#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-provisioning-state" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +model AnalysisDefinitionProperties { + /** + * Description of the Analysis + */ + @visibility(Lifecycle.Read) + description?: string; +} + +/** + * Class representing a diagnostic analysis done on an application + */ +#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +model DiagnosticAnalysis extends ProxyOnlyResource { + /** + * DiagnosticAnalysis resource specific properties + */ + #suppress "@azure-tools/typespec-azure-core/no-private-usage" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + properties?: DiagnosticAnalysisProperties; +} + +/** + * DiagnosticAnalysis resource specific properties + */ +model DiagnosticAnalysisProperties { + /** + * Start time of the period + */ + // FIXME: (utcDateTime) Please double check that this is the correct type for your scenario. + startTime?: utcDateTime; + + /** + * End time of the period + */ + // FIXME: (utcDateTime) Please double check that this is the correct type for your scenario. + endTime?: utcDateTime; + + /** + * List of time periods. + */ + @identifiers(#[]) + abnormalTimePeriods?: AbnormalTimePeriod[]; + + /** + * Data by each detector + */ + @identifiers(#["source"]) + payload?: AnalysisData[]; + + /** + * Data by each detector for detectors that did not corelate + */ + @identifiers(#["displayName"]) + nonCorrelatedDetectors?: DetectorDefinition[]; +} + +/** + * Class representing Abnormal Time Period identified in diagnosis + */ +model AbnormalTimePeriod { + /** + * Start time of the downtime + */ + // FIXME: (utcDateTime) Please double check that this is the correct type for your scenario. + startTime?: utcDateTime; + + /** + * End time of the downtime + */ + // FIXME: (utcDateTime) Please double check that this is the correct type for your scenario. + endTime?: utcDateTime; + + /** + * List of Possible Cause of downtime + */ + @identifiers(#[]) + events?: DetectorAbnormalTimePeriod[]; + + /** + * List of proposed solutions + */ + solutions?: Solution[]; +} + +/** + * Class representing Abnormal Time Period detected. + */ +model DetectorAbnormalTimePeriod { + /** + * Start time of the correlated event + */ + // FIXME: (utcDateTime) Please double check that this is the correct type for your scenario. + startTime?: utcDateTime; + + /** + * End time of the correlated event + */ + // FIXME: (utcDateTime) Please double check that this is the correct type for your scenario. + endTime?: utcDateTime; + + /** + * Message describing the event + */ + message?: string; + + /** + * Represents the name of the Detector + */ + source?: string; + + /** + * Represents the rank of the Detector + */ + priority?: float64; + + /** + * Downtime metadata + */ + #suppress "@azure-tools/typespec-azure-resource-manager/missing-x-ms-identifiers" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + @identifiers(#["name"]) + metaData?: NameValuePair[][]; + + /** + * Represents the type of the Detector + */ + type?: IssueType; + + /** + * List of proposed solutions + */ + solutions?: Solution[]; +} + +/** + * Class Representing Solution for problems detected. + */ +model Solution { + /** + * Solution Id. + */ + id?: float64; + + /** + * Display Name of the solution + */ + displayName?: string; + + /** + * Order of the solution. + */ + order?: float64; + + /** + * Description of the solution + */ + description?: string; + + /** + * Type of Solution + */ + type?: SolutionType; + + /** + * Solution Data. + */ + #suppress "@azure-tools/typespec-azure-resource-manager/missing-x-ms-identifiers" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + @identifiers(#["name"]) + data?: NameValuePair[][]; + + /** + * Solution Metadata. + */ + #suppress "@azure-tools/typespec-azure-resource-manager/missing-x-ms-identifiers" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + @identifiers(#["name"]) + metadata?: NameValuePair[][]; +} + +/** + * Class Representing Detector Evidence used for analysis + */ +model AnalysisData { + /** + * Name of the Detector + */ + source?: string; + + /** + * Detector Definition + */ + detectorDefinition?: DetectorDefinition; + + /** + * Source Metrics + */ + @identifiers(#["name"]) + metrics?: DiagnosticMetricSet[]; + + /** + * Additional Source Data + */ + #suppress "@azure-tools/typespec-azure-resource-manager/missing-x-ms-identifiers" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + @identifiers(#["name"]) + data?: NameValuePair[][]; + + /** + * Detector Meta Data + */ + detectorMetaData?: ResponseMetaData; +} + +/** + * Class representing detector definition + */ +#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-provisioning-state" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +model DetectorDefinition { + /** + * Display name of the detector + */ + @visibility(Lifecycle.Read) + displayName?: string; + + /** + * Description of the detector + */ + @visibility(Lifecycle.Read) + description?: string; + + /** + * Detector Rank + */ + @visibility(Lifecycle.Read) + rank?: float64; + + /** + * Flag representing whether detector is enabled or not. + */ + @visibility(Lifecycle.Read) + isEnabled?: boolean; +} + +/** + * Class representing Diagnostic Metric information + */ +model DiagnosticMetricSet { + /** + * Name of the metric + */ + name?: string; + + /** + * Metric's unit + */ + unit?: string; + + /** + * Start time of the period + */ + // FIXME: (utcDateTime) Please double check that this is the correct type for your scenario. + startTime?: utcDateTime; + + /** + * End time of the period + */ + // FIXME: (utcDateTime) Please double check that this is the correct type for your scenario. + endTime?: utcDateTime; + + /** + * Presented time grain. Supported grains at the moment are PT1M, PT1H, P1D + */ + timeGrain?: string; + + /** + * Collection of metric values for the selected period based on the {Microsoft.Web.Hosting.Administration.DiagnosticMetricSet.TimeGrain} + */ + @identifiers(#[]) + values?: DiagnosticMetricSample[]; +} + +/** + * Class representing Diagnostic Metric + */ +model DiagnosticMetricSample { + /** + * Time at which metric is measured + */ + // FIXME: (utcDateTime) Please double check that this is the correct type for your scenario. + timestamp?: utcDateTime; + + /** + * Role Instance. Null if this counter is not per instance + * This is returned and should be whichever instance name we desire to be returned + * i.e. CPU and Memory return RDWORKERNAME (LargeDed..._IN_0) + * where RDWORKERNAME is Machine name below and RoleInstance name in parenthesis + */ + roleInstance?: string; + + /** + * Total value of the metric. If multiple measurements are made this will have sum of all. + */ + total?: float64; + + /** + * Maximum of the metric sampled during the time period + */ + maximum?: float64; + + /** + * Minimum of the metric sampled during the time period + */ + minimum?: float64; + + /** + * Whether the values are aggregates across all workers or not + */ + isAggregated?: boolean; +} + +#suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +model ResponseMetaData { + /** + * Source of the Data + */ + dataSource?: DataSource; +} + +/** + * Class representing data source used by the detectors + */ +model DataSource { + /** + * Instructions if any for the data source + */ + instructions?: string[]; + + /** + * Datasource Uri Links + */ + @identifiers(#["name"]) + dataSourceUri?: NameValuePair[]; +} + +/** + * Class representing Response from Diagnostic Detectors + */ +#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +model DiagnosticDetectorResponse extends ProxyOnlyResource { + /** + * DiagnosticDetectorResponse resource specific properties + */ + #suppress "@azure-tools/typespec-azure-core/no-private-usage" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + properties?: DiagnosticDetectorResponseProperties; +} + +/** + * DiagnosticDetectorResponse resource specific properties + */ +model DiagnosticDetectorResponseProperties { + /** + * Start time of the period + */ + // FIXME: (utcDateTime) Please double check that this is the correct type for your scenario. + startTime?: utcDateTime; + + /** + * End time of the period + */ + // FIXME: (utcDateTime) Please double check that this is the correct type for your scenario. + endTime?: utcDateTime; + + /** + * Flag representing Issue was detected. + */ + issueDetected?: boolean; + + /** + * Detector's definition + */ + detectorDefinition?: DetectorDefinition; + + /** + * Metrics provided by the detector + */ + @identifiers(#["name"]) + metrics?: DiagnosticMetricSet[]; + + /** + * List of Correlated events found by the detector + */ + @identifiers(#[]) + abnormalTimePeriods?: DetectorAbnormalTimePeriod[]; + + /** + * Additional Data that detector wants to send. + */ + #suppress "@azure-tools/typespec-azure-resource-manager/missing-x-ms-identifiers" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + @identifiers(#["name"]) + data?: NameValuePair[][]; + + /** + * Meta Data + */ + responseMetaData?: ResponseMetaData; +} + +/** + * A snapshot of an app. + */ +#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +model Snapshot extends ProxyOnlyResource { + /** + * Snapshot resource specific properties + */ + #suppress "@azure-tools/typespec-azure-core/no-private-usage" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + properties?: SnapshotProperties; +} + +/** + * Snapshot resource specific properties + */ +model SnapshotProperties { + /** + * The time the snapshot was taken. + */ + @visibility(Lifecycle.Read) + time?: string; +} + +/** + * KubeEnvironment resource specific properties + */ +model KubeEnvironmentProperties { + /** + * Provisioning state of the Kubernetes Environment. + */ + @visibility(Lifecycle.Read) + provisioningState?: KubeEnvironmentProvisioningState; + + /** + * Any errors that occurred during deployment or deployment validation + */ + @visibility(Lifecycle.Read) + deploymentErrors?: string; + + /** + * Only visible within Vnet/Subnet + */ + @visibility(Lifecycle.Read, Lifecycle.Create) + internalLoadBalancerEnabled?: boolean; + + /** + * Default Domain Name for the cluster + */ + @visibility(Lifecycle.Read) + defaultDomain?: string; + + /** + * Static IP of the KubeEnvironment + */ + @visibility(Lifecycle.Read, Lifecycle.Create) + staticIp?: string; + + /** + * Type of Kubernetes Environment. Only supported for Container App Environments with value as Managed + */ + @visibility(Lifecycle.Read, Lifecycle.Create) + environmentType?: string; + + /** + * Cluster configuration which determines the ARC cluster + * components types. Eg: Choosing between BuildService kind, + * FrontEnd Service ArtifactsStorageType etc. + */ + arcConfiguration?: ArcConfiguration; + + /** + * Cluster configuration which enables the log daemon to export + * app logs to a destination. Currently only "log-analytics" is + * supported + */ + appLogsConfiguration?: AppLogsConfiguration; + + /** + * Cluster configuration for Container Apps Environments to configure Dapr Instrumentation Key and VNET Configuration + */ + containerAppsConfiguration?: ContainerAppsConfiguration; + + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + #suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + @visibility(Lifecycle.Read, Lifecycle.Create) + aksResourceID?: string; +} + +#suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +model ArcConfiguration { + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + @visibility(Lifecycle.Read, Lifecycle.Create) + artifactsStorageType?: StorageType; + + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + @visibility(Lifecycle.Read, Lifecycle.Create) + artifactStorageClassName?: string; + + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + @visibility(Lifecycle.Read, Lifecycle.Create) + artifactStorageMountPath?: string; + + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + @visibility(Lifecycle.Read, Lifecycle.Create) + artifactStorageNodeName?: string; + + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + @visibility(Lifecycle.Read, Lifecycle.Create) + artifactStorageAccessMode?: string; + + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + frontEndServiceConfiguration?: FrontEndConfiguration; + + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + @secret + @visibility(Lifecycle.Create, Lifecycle.Update) + kubeConfig?: string; +} + +#suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +model FrontEndConfiguration { + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + kind?: FrontEndServiceType; +} + +#suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +model AppLogsConfiguration { + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + destination?: string; + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + logAnalyticsConfiguration?: LogAnalyticsConfiguration; +} + +#suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +model LogAnalyticsConfiguration { + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + customerId?: string; + + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + @visibility(Lifecycle.Create, Lifecycle.Update) + @secret + sharedKey?: string; +} + +#suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +model ContainerAppsConfiguration { + /** + * Azure Monitor instrumentation key used by Dapr to export Service to Service communication telemetry + */ + #suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + #suppress "@azure-tools/typespec-azure-resource-manager/secret-prop" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + @visibility(Lifecycle.Read, Lifecycle.Create) + daprAIInstrumentationKey?: string; + + /** + * IP range in CIDR notation that can be reserved for environment infrastructure IP addresses. It must not overlap with any other Subnet IP ranges. + */ + @visibility(Lifecycle.Read, Lifecycle.Create) + platformReservedCidr?: string; + + /** + * An IP address from the IP range defined by platformReservedCidr that will be reserved for the internal DNS server + */ + #suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + @visibility(Lifecycle.Read, Lifecycle.Create) + platformReservedDnsIP?: string; + + /** + * Resource ID of a subnet for control plane infrastructure components. This subnet must be in the same VNET as the subnet defined in appSubnetResourceId. Must not overlap with the IP range defined in platformReservedCidr, if defined. + */ + @visibility(Lifecycle.Read, Lifecycle.Create) + controlPlaneSubnetResourceId?: string; + + /** + * Resource ID of a subnet for control plane infrastructure components. This subnet must be in the same VNET as the subnet defined in appSubnetResourceId. Must not overlap with the IP range defined in platformReservedCidr, if defined. + */ + @visibility(Lifecycle.Read, Lifecycle.Create) + appSubnetResourceId?: string; + + /** + * CIDR notation IP range assigned to the Docker bridge network. It must not overlap with any Subnet IP ranges or the IP range defined in platformReservedCidr, if defined. + */ + @visibility(Lifecycle.Read, Lifecycle.Create) + dockerBridgeCidr?: string; +} + +/** + * ARM resource for a KubeEnvironment when patching + */ +#suppress "@azure-tools/typespec-azure-resource-manager/patch-envelope" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +model KubeEnvironmentPatchResource extends ProxyOnlyResource { + /** + * KubeEnvironmentPatchResource resource specific properties + */ + #suppress "@azure-tools/typespec-azure-core/no-private-usage" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + properties?: KubeEnvironmentPatchResourceProperties; +} + +/** + * KubeEnvironmentPatchResource resource specific properties + */ +model KubeEnvironmentPatchResourceProperties { + /** + * Provisioning state of the Kubernetes Environment. + */ + @visibility(Lifecycle.Read) + provisioningState?: KubeEnvironmentProvisioningState; + + /** + * Any errors that occurred during deployment or deployment validation + */ + @visibility(Lifecycle.Read) + deploymentErrors?: string; + + /** + * Only visible within Vnet/Subnet + */ + @visibility(Lifecycle.Read, Lifecycle.Create) + internalLoadBalancerEnabled?: boolean; + + /** + * Default Domain Name for the cluster + */ + @visibility(Lifecycle.Read) + defaultDomain?: string; + + /** + * Static IP of the KubeEnvironment + */ + @visibility(Lifecycle.Read, Lifecycle.Create) + staticIp?: string; + + /** + * Cluster configuration which determines the ARC cluster + * components types. Eg: Choosing between BuildService kind, + * FrontEnd Service ArtifactsStorageType etc. + */ + arcConfiguration?: ArcConfiguration; + + /** + * Cluster configuration which enables the log daemon to export + * app logs to a destination. Currently only "log-analytics" is + * supported + */ + appLogsConfiguration?: AppLogsConfiguration; + + /** + * Cluster configuration for Container Apps Environments to configure Dapr Instrumentation Key and VNET Configuration + */ + containerAppsConfiguration?: ContainerAppsConfiguration; + + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + #suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + @visibility(Lifecycle.Read, Lifecycle.Create) + aksResourceID?: string; +} + +/** + * Collection of Application Stacks + */ +model ApplicationStackCollection is Azure.Core.Page; + +/** + * ARM resource for a ApplicationStack. + */ +#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +model ApplicationStackResource extends ProxyOnlyResource { + /** + * Core resource properties + */ + #suppress "@azure-tools/typespec-azure-core/no-private-usage" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + properties?: ApplicationStack; +} + +/** + * Application stack. + */ +model ApplicationStack { + /** + * Application stack name. + */ + name?: string; + + /** + * Application stack display name. + */ + display?: string; + + /** + * Application stack dependency. + */ + dependency?: string; + + /** + * List of major versions available. + */ + @identifiers(#["runtimeVersion"]) + majorVersions?: StackMajorVersion[]; + + /** + * List of frameworks associated with application stack. + */ + @identifiers(#["name"]) + frameworks?: ApplicationStack[]; + + /** + * true if this is the stack is deprecated; otherwise, false. + */ + @identifiers(#["name"]) + isDeprecated?: ApplicationStack[]; +} + +/** + * Application stack major version. + */ +model StackMajorVersion { + /** + * Application stack major version (display only). + */ + displayVersion?: string; + + /** + * Application stack major version (runtime only). + */ + runtimeVersion?: string; + + /** + * true if this is the default major version; otherwise, false. + */ + isDefault?: boolean; + + /** + * Minor versions associated with the major version. + */ + @identifiers(#["runtimeVersion"]) + minorVersions?: StackMinorVersion[]; + + /** + * true if this supports Application Insights; otherwise, false. + */ + applicationInsights?: boolean; + + /** + * true if this stack is in Preview, otherwise false. + */ + isPreview?: boolean; + + /** + * true if this stack has been deprecated, otherwise false. + */ + isDeprecated?: boolean; + + /** + * true if this stack should be hidden for new customers on portal, otherwise false. + */ + isHidden?: boolean; + + /** + * + * + * + * Example: All the function apps need AppSetting: "FUNCTIONS_WORKER_RUNTIME" to be set stack name + */ + #suppress "@azure-tools/typespec-azure-resource-manager/arm-no-record" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + appSettingsDictionary?: Record; + + /** + * + * + * + * Example: All Linux Function Apps, need Use32BitWorkerProcess to be set to 0 + */ + #suppress "@azure-tools/typespec-azure-resource-manager/arm-no-record" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + siteConfigPropertiesDictionary?: Record; +} + +/** + * Application stack minor version. + */ +model StackMinorVersion { + /** + * Application stack minor version (display only). + */ + displayVersion?: string; + + /** + * Application stack minor version (runtime only). + */ + runtimeVersion?: string; + + /** + * true if this is the default minor version; otherwise, false. + */ + isDefault?: boolean; + + /** + * true if this supports Remote Debugging, otherwise false. + */ + isRemoteDebuggingEnabled?: boolean; +} + +/** + * Collection of Function app Stacks + */ +model FunctionAppStackCollection is Azure.Core.Page; + +/** + * Function App Stack. + */ +#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +model FunctionAppStack extends ProxyOnlyResource { + /** + * Function App stack location. + */ + @visibility(Lifecycle.Read) + location?: string; + + /** + * FunctionAppStack resource specific properties + */ + #suppress "@azure-tools/typespec-azure-core/no-private-usage" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + properties?: FunctionAppStackProperties; +} + +/** + * FunctionAppStack resource specific properties + */ +model FunctionAppStackProperties { + /** + * Function App stack (display only). + */ + @visibility(Lifecycle.Read) + displayText?: string; + + /** + * Function App stack name. + */ + @visibility(Lifecycle.Read) + value?: string; + + /** + * List of major versions available. + */ + @visibility(Lifecycle.Read) + @identifiers(#["value"]) + majorVersions?: FunctionAppMajorVersion[]; + + /** + * Function App stack preferred OS. + */ + @visibility(Lifecycle.Read) + preferredOs?: StackPreferredOs; +} + +/** + * Function App stack major version. + */ +model FunctionAppMajorVersion { + /** + * Function App stack major version (display only). + */ + @visibility(Lifecycle.Read) + displayText?: string; + + /** + * Function App stack major version name. + */ + @visibility(Lifecycle.Read) + value?: string; + + /** + * Minor versions associated with the major version. + */ + @visibility(Lifecycle.Read) + @identifiers(#["value"]) + minorVersions?: FunctionAppMinorVersion[]; +} + +/** + * Function App stack minor version. + */ +model FunctionAppMinorVersion { + /** + * Function App stack (display only). + */ + @visibility(Lifecycle.Read) + displayText?: string; + + /** + * Function App stack name. + */ + @visibility(Lifecycle.Read) + value?: string; + + /** + * Settings associated with the minor version. + */ + @visibility(Lifecycle.Read) + stackSettings?: FunctionAppRuntimes; +} + +/** + * Function App stack runtimes. + */ +model FunctionAppRuntimes { + /** + * Linux-specific settings associated with the minor version. + */ + @visibility(Lifecycle.Read) + linuxRuntimeSettings?: FunctionAppRuntimeSettings; + + /** + * Windows-specific settings associated with the minor version. + */ + @visibility(Lifecycle.Read) + windowsRuntimeSettings?: FunctionAppRuntimeSettings; +} + +/** + * Function App runtime settings. + */ +model FunctionAppRuntimeSettings { + /** + * Function App stack minor version (runtime only). + */ + @visibility(Lifecycle.Read) + runtimeVersion?: string; + + /** + * true if remote debugging is supported for the stack; otherwise, false. + */ + @visibility(Lifecycle.Read) + remoteDebuggingSupported?: boolean; + + /** + * Application Insights settings associated with the minor version. + */ + @visibility(Lifecycle.Read) + appInsightsSettings?: AppInsightsWebAppStackSettings; + + /** + * GitHub Actions settings associated with the minor version. + */ + @visibility(Lifecycle.Read) + gitHubActionSettings?: GitHubActionWebAppStackSettings; + + /** + * Application settings associated with the minor version. + */ + #suppress "@azure-tools/typespec-azure-resource-manager/arm-no-record" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + @visibility(Lifecycle.Read) + appSettingsDictionary?: Record; + + /** + * Configuration settings associated with the minor version. + */ + @visibility(Lifecycle.Read) + siteConfigPropertiesDictionary?: SiteConfigPropertiesDictionary; + + /** + * List of supported Functions extension versions. + */ + @visibility(Lifecycle.Read) + supportedFunctionsExtensionVersions?: string[]; + + /** + * true if the stack is in preview; otherwise, false. + */ + @visibility(Lifecycle.Read) + isPreview?: boolean; + + /** + * true if the stack is deprecated; otherwise, false. + */ + @visibility(Lifecycle.Read) + isDeprecated?: boolean; + + /** + * true if the stack should be hidden; otherwise, false. + */ + @visibility(Lifecycle.Read) + isHidden?: boolean; + + /** + * End-of-life date for the minor version. + */ + @visibility(Lifecycle.Read) + // FIXME: (utcDateTime) Please double check that this is the correct type for your scenario. + endOfLifeDate?: utcDateTime; + + /** + * true if the stack version is auto-updated; otherwise, false. + */ + @visibility(Lifecycle.Read) + isAutoUpdate?: boolean; + + /** + * true if the minor version is early-access; otherwise, false. + */ + @visibility(Lifecycle.Read) + isEarlyAccess?: boolean; + + /** + * true if the minor version the default; otherwise, false. + */ + @visibility(Lifecycle.Read) + isDefault?: boolean; +} + +/** + * App Insights Web App stack settings. + */ +model AppInsightsWebAppStackSettings { + /** + * true if remote Application Insights is supported for the stack; otherwise, false. + */ + @visibility(Lifecycle.Read) + isSupported?: boolean; + + /** + * true if Application Insights is disabled by default for the stack; otherwise, false. + */ + @visibility(Lifecycle.Read) + isDefaultOff?: boolean; +} + +/** + * GitHub Actions Web App stack settings. + */ +model GitHubActionWebAppStackSettings { + /** + * true if GitHub Actions is supported for the stack; otherwise, false. + */ + @visibility(Lifecycle.Read) + isSupported?: boolean; + + /** + * The minor version that is supported for GitHub Actions. + */ + @visibility(Lifecycle.Read) + supportedVersion?: string; +} + +/** + * Site config properties dictionary. + */ +model SiteConfigPropertiesDictionary { + /** + * true if use32BitWorkerProcess should be set to true for the stack; otherwise, false. + */ + @visibility(Lifecycle.Read) + use32BitWorkerProcess?: boolean; + + /** + * LinuxFxVersion configuration setting. + */ + @visibility(Lifecycle.Read) + linuxFxVersion?: string; + + /** + * JavaVersion configuration setting. + */ + @visibility(Lifecycle.Read) + javaVersion?: string; + + /** + * PowerShellVersion configuration setting. + */ + @visibility(Lifecycle.Read) + powerShellVersion?: string; +} + +/** + * Collection of Web app Stacks + */ +model WebAppStackCollection is Azure.Core.Page; + +/** + * Web App stack. + */ +#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +model WebAppStack extends ProxyOnlyResource { + /** + * Web App stack location. + */ + @visibility(Lifecycle.Read) + location?: string; + + /** + * WebAppStack resource specific properties + */ + #suppress "@azure-tools/typespec-azure-core/no-private-usage" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + properties?: WebAppStackProperties; +} + +/** + * WebAppStack resource specific properties + */ +model WebAppStackProperties { + /** + * Web App stack (display only). + */ + @visibility(Lifecycle.Read) + displayText?: string; + + /** + * Web App stack name. + */ + @visibility(Lifecycle.Read) + value?: string; + + /** + * List of major versions available. + */ + @visibility(Lifecycle.Read) + @identifiers(#["value"]) + majorVersions?: WebAppMajorVersion[]; + + /** + * Web App stack preferred OS. + */ + @visibility(Lifecycle.Read) + preferredOs?: StackPreferredOs; +} + +/** + * Web App stack major version. + */ +model WebAppMajorVersion { + /** + * Web App stack major version (display only). + */ + @visibility(Lifecycle.Read) + displayText?: string; + + /** + * Web App stack major version name. + */ + @visibility(Lifecycle.Read) + value?: string; + + /** + * Minor versions associated with the major version. + */ + @visibility(Lifecycle.Read) + @identifiers(#["value"]) + minorVersions?: WebAppMinorVersion[]; +} + +/** + * Web App stack minor version. + */ +model WebAppMinorVersion { + /** + * Web App stack minor version (display only). + */ + @visibility(Lifecycle.Read) + displayText?: string; + + /** + * Web App stack major version name. + */ + @visibility(Lifecycle.Read) + value?: string; + + /** + * Settings associated with the minor version. + */ + @visibility(Lifecycle.Read) + stackSettings?: WebAppRuntimes; +} + +/** + * Web App stack runtimes. + */ +model WebAppRuntimes { + /** + * Linux-specific settings associated with the minor version. + */ + @visibility(Lifecycle.Read) + linuxRuntimeSettings?: WebAppRuntimeSettings; + + /** + * Windows-specific settings associated with the minor version. + */ + @visibility(Lifecycle.Read) + windowsRuntimeSettings?: WebAppRuntimeSettings; + + /** + * Linux-specific settings associated with the Java container minor version. + */ + @visibility(Lifecycle.Read) + linuxContainerSettings?: LinuxJavaContainerSettings; + + /** + * Windows-specific settings associated with the Java container minor version. + */ + @visibility(Lifecycle.Read) + windowsContainerSettings?: WindowsJavaContainerSettings; +} + +/** + * Web App runtime settings. + */ +model WebAppRuntimeSettings { + /** + * Web App stack minor version (runtime only). + */ + @visibility(Lifecycle.Read) + runtimeVersion?: string; + + /** + * true if remote debugging is supported for the stack; otherwise, false. + */ + @visibility(Lifecycle.Read) + remoteDebuggingSupported?: boolean; + + /** + * Application Insights settings associated with the minor version. + */ + @visibility(Lifecycle.Read) + appInsightsSettings?: AppInsightsWebAppStackSettings; + + /** + * GitHub Actions settings associated with the minor version. + */ + @visibility(Lifecycle.Read) + gitHubActionSettings?: GitHubActionWebAppStackSettings; + + /** + * true if the stack is in preview; otherwise, false. + */ + @visibility(Lifecycle.Read) + isPreview?: boolean; + + /** + * true if the stack is deprecated; otherwise, false. + */ + @visibility(Lifecycle.Read) + isDeprecated?: boolean; + + /** + * true if the stack should be hidden; otherwise, false. + */ + @visibility(Lifecycle.Read) + isHidden?: boolean; + + /** + * End-of-life date for the minor version. + */ + @visibility(Lifecycle.Read) + // FIXME: (utcDateTime) Please double check that this is the correct type for your scenario. + endOfLifeDate?: utcDateTime; + + /** + * true if the stack version is auto-updated; otherwise, false. + */ + @visibility(Lifecycle.Read) + isAutoUpdate?: boolean; + + /** + * true if the minor version is early-access; otherwise, false. + */ + @visibility(Lifecycle.Read) + isEarlyAccess?: boolean; +} + +/** + * Linux Java Container settings. + */ +model LinuxJavaContainerSettings { + /** + * Java 11 version (runtime only). + */ + @visibility(Lifecycle.Read) + java11Runtime?: string; + + /** + * Java 8 version (runtime only). + */ + @visibility(Lifecycle.Read) + java8Runtime?: string; + + /** + * true if the stack is in preview; otherwise, false. + */ + @visibility(Lifecycle.Read) + isPreview?: boolean; + + /** + * true if the stack is deprecated; otherwise, false. + */ + @visibility(Lifecycle.Read) + isDeprecated?: boolean; + + /** + * true if the stack should be hidden; otherwise, false. + */ + @visibility(Lifecycle.Read) + isHidden?: boolean; + + /** + * End-of-life date for the minor version. + */ + @visibility(Lifecycle.Read) + // FIXME: (utcDateTime) Please double check that this is the correct type for your scenario. + endOfLifeDate?: utcDateTime; + + /** + * true if the stack version is auto-updated; otherwise, false. + */ + @visibility(Lifecycle.Read) + isAutoUpdate?: boolean; + + /** + * true if the minor version is early-access; otherwise, false. + */ + @visibility(Lifecycle.Read) + isEarlyAccess?: boolean; +} + +/** + * Windows Java Container settings. + */ +model WindowsJavaContainerSettings { + /** + * Java container (runtime only). + */ + @visibility(Lifecycle.Read) + javaContainer?: string; + + /** + * Java container version (runtime only). + */ + @visibility(Lifecycle.Read) + javaContainerVersion?: string; + + /** + * true if the stack is in preview; otherwise, false. + */ + @visibility(Lifecycle.Read) + isPreview?: boolean; + + /** + * true if the stack is deprecated; otherwise, false. + */ + @visibility(Lifecycle.Read) + isDeprecated?: boolean; + + /** + * true if the stack should be hidden; otherwise, false. + */ + @visibility(Lifecycle.Read) + isHidden?: boolean; + + /** + * End-of-life date for the minor version. + */ + @visibility(Lifecycle.Read) + // FIXME: (utcDateTime) Please double check that this is the correct type for your scenario. + endOfLifeDate?: utcDateTime; + + /** + * true if the stack version is auto-updated; otherwise, false. + */ + @visibility(Lifecycle.Read) + isAutoUpdate?: boolean; + + /** + * true if the minor version is early-access; otherwise, false. + */ + @visibility(Lifecycle.Read) + isEarlyAccess?: boolean; +} + +/** + * Collection of Azure resource manager operation metadata. + */ +model CsmOperationCollection { + /** + * Collection of resources. + */ + @pageItems + @identifiers(#["name"]) + value: CsmOperationDescription[]; + + /** + * Link to next page of resources. + */ + @doc("Link to next page of resources.") + @visibility(Lifecycle.Read) + @nextLink + nextLink?: string; +} + +/** + * Description of an operation available for Microsoft.Web resource provider. + */ +model CsmOperationDescription { + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + name?: string; + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + isDataAction?: boolean; + + /** + * Meta data about operation used for display in portal. + */ + display?: CsmOperationDisplay; + + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + origin?: string; + + /** + * Properties available for a Microsoft.Web resource provider operation. + */ + properties?: CsmOperationDescriptionProperties; +} + +/** + * Meta data about operation used for display in portal. + */ +model CsmOperationDisplay { + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + provider?: string; + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + resource?: string; + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + operation?: string; + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + description?: string; +} + +/** + * Properties available for a Microsoft.Web resource provider operation. + */ +model CsmOperationDescriptionProperties { + /** + * Resource metrics service provided by Microsoft.Insights resource provider. + */ + serviceSpecification?: ServiceSpecification; +} + +/** + * Resource metrics service provided by Microsoft.Insights resource provider. + */ +model ServiceSpecification { + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + @identifiers(#["name"]) + metricSpecifications?: MetricSpecification[]; + + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + @identifiers(#["name"]) + logSpecifications?: LogSpecification[]; +} + +/** + * Definition of a single resource metric. + */ +model MetricSpecification { + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + name?: string; + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + displayName?: string; + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + displayDescription?: string; + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + unit?: string; + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + aggregationType?: string; + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + supportsInstanceLevelAggregation?: boolean; + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + enableRegionalMdmAccount?: boolean; + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + sourceMdmAccount?: string; + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + sourceMdmNamespace?: string; + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + metricFilterPattern?: string; + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + fillGapWithZero?: boolean; + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + isInternal?: boolean; + + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + @identifiers(#["name"]) + dimensions?: Dimension[]; + + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + category?: string; + + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + @identifiers(#[]) + availabilities?: MetricAvailability[]; + + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + supportedTimeGrainTypes?: string[]; + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + supportedAggregationTypes?: string[]; +} + +/** + * Dimension of a resource metric. For e.g. instance specific HTTP requests for a web app, + * where instance name is dimension of the metric HTTP request + */ +model Dimension { + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + name?: string; + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + displayName?: string; + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + internalName?: string; + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + toBeExportedForShoebox?: boolean; +} + +/** + * Retention policy of a resource metric. + */ +model MetricAvailability { + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + timeGrain?: string; + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + blobDuration?: string; +} + +/** + * Log Definition of a single resource metric. + */ +model LogSpecification { + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + name?: string; + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + displayName?: string; + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + blobDuration?: string; + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + logFilterPattern?: string; +} + +/** + * Collection of recommendations. + */ +model RecommendationCollection is Azure.Core.Page; + +/** + * Represents a recommendation result generated by the recommendation engine. + */ +#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +model Recommendation extends ProxyOnlyResource { + /** + * Recommendation resource specific properties + */ + #suppress "@azure-tools/typespec-azure-core/no-private-usage" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + properties?: RecommendationProperties; +} + +/** + * Recommendation resource specific properties + */ +model RecommendationProperties { + /** + * Timestamp when this instance was created. + */ + // FIXME: (utcDateTime) Please double check that this is the correct type for your scenario. + creationTime?: utcDateTime; + + /** + * A GUID value that each recommendation object is associated with. + */ + #suppress "@azure-tools/typespec-azure-core/no-format" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + @format("uuid") + recommendationId?: string; + + /** + * Full ARM resource ID string that this recommendation object is associated with. + */ + resourceId?: string; + + /** + * Name of a resource type this recommendation applies, e.g. Subscription, ServerFarm, Site. + */ + resourceScope?: ResourceScopeType; + + /** + * Unique name of the rule. + */ + ruleName?: string; + + /** + * UI friendly name of the rule (may not be unique). + */ + displayName?: string; + + /** + * Recommendation text. + */ + message?: string; + + /** + * Level indicating how critical this recommendation can impact. + */ + level?: NotificationLevel; + + /** + * List of channels that this recommendation can apply. + */ + channels?: Channels; + + /** + * The list of category tags that this recommendation belongs to. + */ + @visibility(Lifecycle.Read) + categoryTags?: string[]; + + /** + * Name of action recommended by this object. + */ + actionName?: string; + + /** + * True if this recommendation is still valid (i.e. "actionable"). False if it is invalid. + */ + enabled?: int32; + + /** + * The list of states of this recommendation. If it's null then it should be considered "Active". + */ + states?: string[]; + + /** + * The beginning time in UTC of a range that the recommendation refers to. + */ + // FIXME: (utcDateTime) Please double check that this is the correct type for your scenario. + startTime?: utcDateTime; + + /** + * The end time in UTC of a range that the recommendation refers to. + */ + // FIXME: (utcDateTime) Please double check that this is the correct type for your scenario. + endTime?: utcDateTime; + + /** + * When to notify this recommendation next in UTC. Null means that this will never be notified anymore. + */ + // FIXME: (utcDateTime) Please double check that this is the correct type for your scenario. + nextNotificationTime?: utcDateTime; + + /** + * Date and time in UTC when this notification expires. + */ + // FIXME: (utcDateTime) Please double check that this is the correct type for your scenario. + notificationExpirationTime?: utcDateTime; + + /** + * Last timestamp in UTC this instance was actually notified. Null means that this recommendation hasn't been notified yet. + */ + // FIXME: (utcDateTime) Please double check that this is the correct type for your scenario. + notifiedTime?: utcDateTime; + + /** + * A metric value measured by the rule. + */ + score?: float64; + + /** + * True if this is associated with a dynamically added rule + */ + isDynamic?: boolean; + + /** + * Extension name of the portal if exists. + */ + extensionName?: string; + + /** + * Deep link to a blade on the portal. + */ + bladeName?: string; + + /** + * Forward link to an external document associated with the rule. + */ + forwardLink?: string; +} + +/** + * RecommendationRule resource specific properties + */ +#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-provisioning-state" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +model RecommendationRuleProperties { + /** + * Unique name of the rule. + */ + recommendationName?: string; + + /** + * UI friendly name of the rule. + */ + displayName?: string; + + /** + * Localized name of the rule (Good for UI). + */ + message?: string; + + /** + * Recommendation ID of an associated recommendation object tied to the rule, if exists. + * If such an object doesn't exist, it is set to null. + */ + #suppress "@azure-tools/typespec-azure-core/no-format" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + @format("uuid") + recommendationId?: string; + + /** + * Localized detailed description of the rule. + */ + description?: string; + + /** + * Name of action that is recommended by this rule in string. + */ + actionName?: string; + + /** + * Level of impact indicating how critical this rule is. + */ + level?: NotificationLevel; + + /** + * List of available channels that this rule applies. + */ + channels?: Channels; + + /** + * The list of category tags that this recommendation rule belongs to. + */ + @visibility(Lifecycle.Read) + categoryTags?: string[]; + + /** + * True if this is associated with a dynamically added rule + */ + isDynamic?: boolean; + + /** + * Extension name of the portal if exists. Applicable to dynamic rule only. + */ + extensionName?: string; + + /** + * Deep link to a blade on the portal. Applicable to dynamic rule only. + */ + bladeName?: string; + + /** + * Forward link to an external document associated with the rule. Applicable to dynamic rule only. + */ + forwardLink?: string; +} + +/** + * ResourceHealthMetadata resource specific properties + */ +#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-provisioning-state" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +model ResourceHealthMetadataProperties { + /** + * The category that the resource matches in the RHC Policy File + */ + category?: string; + + /** + * Is there a health signal for the resource + */ + signalAvailability?: boolean; +} + +/** + * User resource specific properties + */ +#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-provisioning-state" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +model UserProperties { + /** + * Username used for publishing. + */ + publishingUserName: string; + + /** + * Password used for publishing. + */ + @secret + publishingPassword?: string; + + /** + * Password hash used for publishing. + */ + @secret + publishingPasswordHash?: string; + + /** + * Password hash salt used for publishing. + */ + @secret + publishingPasswordHashSalt?: string; + + /** + * Url of SCM site. + */ + scmUri?: string; +} + +/** + * SourceControl resource specific properties + */ +#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-provisioning-state" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +model SourceControlProperties { + /** + * OAuth access token. + */ + #suppress "@azure-tools/typespec-azure-resource-manager/secret-prop" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + token?: string; + + /** + * OAuth access token secret. + */ + #suppress "@azure-tools/typespec-azure-resource-manager/secret-prop" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + tokenSecret?: string; + + /** + * OAuth refresh token. + */ + #suppress "@azure-tools/typespec-azure-resource-manager/secret-prop" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + refreshToken?: string; + + /** + * OAuth token expiration. + */ + // FIXME: (utcDateTime) Please double check that this is the correct type for your scenario. + expirationTime?: utcDateTime; +} + +/** + * Collection of Billing Meters + */ +model BillingMeterCollection is Azure.Core.Page; + +/** + * App Service billing entity that contains information about meter which the Azure billing system utilizes to charge users for services. + */ +#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +model BillingMeter extends ProxyOnlyResource { + /** + * BillingMeter resource specific properties + */ + #suppress "@azure-tools/typespec-azure-core/no-private-usage" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + properties?: BillingMeterProperties; +} + +/** + * BillingMeter resource specific properties + */ +model BillingMeterProperties { + /** + * Meter GUID onboarded in Commerce + */ + meterId?: string; + + /** + * Azure Location of billable resource + */ + billingLocation?: string; + + /** + * Short Name from App Service Azure pricing Page + */ + shortName?: string; + + /** + * Friendly name of the meter + */ + friendlyName?: string; + + /** + * App Service ResourceType meter used for + */ + resourceType?: string; + + /** + * App Service OS type meter used for + */ + osType?: string; + + /** + * Meter Multiplier + */ + multiplier?: float64; +} + +/** + * Resource name availability request content. + */ +model ResourceNameAvailabilityRequest { + /** + * Resource name to verify. + */ + name: string; + + /** + * Resource type used for verification. + */ + type: CheckNameResourceTypes; + + /** + * Is fully qualified domain name. + */ + isFqdn?: boolean; + + /** + * Azure Resource Manager ID of the customer's selected Container Apps Environment on which to host the Function app. This must be of the form /subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.App/managedEnvironments/{managedEnvironmentName} + */ + environmentId?: string; +} + +/** + * Information regarding availability of a resource name. + */ +model ResourceNameAvailability { + /** + * true indicates name is valid and available. false indicates the name is invalid, unavailable, or both. + */ + nameAvailable?: boolean; + + /** + * Invalid indicates the name provided does not match Azure App Service naming requirements. AlreadyExists indicates that the name is already in use and is therefore unavailable. + */ + reason?: InAvailabilityReasonType; + + /** + * If reason == invalid, provide the user with the reason why the given name is invalid, and provide the resource naming requirements so that the user can select a valid name. If reason == AlreadyExists, explain that resource name is already in use, and direct them to select a different name. + */ + message?: string; +} + +/** + * Collection of custom hostname sites + */ +model CustomHostnameSitesCollection is Azure.Core.Page; + +/** + * A hostname and its assigned sites + */ +#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +model CustomHostnameSites extends ProxyOnlyResource { + /** + * CustomHostnameSites resource specific properties + */ + #suppress "@azure-tools/typespec-azure-core/no-private-usage" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + properties?: CustomHostnameSitesProperties; +} + +/** + * CustomHostnameSites resource specific properties + */ +model CustomHostnameSitesProperties { + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + customHostname?: string; + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + region?: string; +} + +/** + * Identifier resource specific properties + */ +#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-provisioning-state" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-duplicate-property" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +model IdentifierProperties { + /** + * String representation of the identity. + */ + id?: string; +} + +/** + * List of available locations (regions or App Service Environments) for + * deployment of App Service resources. + */ +model DeploymentLocations { + /** + * Available regions. + */ + locations?: GeoRegion[]; + + /** + * Available App Service Environments with full descriptions of the environments. + */ + @identifiers(#[]) + hostingEnvironments?: AppServiceEnvironment[]; + + /** + * Available App Service Environments with basic information. + */ + @identifiers(#["name"]) + hostingEnvironmentDeploymentInfos?: HostingEnvironmentDeploymentInfo[]; +} + +/** + * Geographical region. + */ +#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +model GeoRegion extends ProxyOnlyResource { + /** + * GeoRegion resource specific properties + */ + #suppress "@azure-tools/typespec-azure-core/no-private-usage" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + properties?: GeoRegionProperties; +} + +/** + * GeoRegion resource specific properties + */ +model GeoRegionProperties { + /** + * Region description. + */ + @visibility(Lifecycle.Read) + description?: string; + + /** + * Display name for region. + */ + @visibility(Lifecycle.Read) + displayName?: string; + + /** + * Display name for region. + */ + @visibility(Lifecycle.Read) + orgDomain?: string; +} + +/** + * Information needed to create resources on an App Service Environment. + */ +model HostingEnvironmentDeploymentInfo { + /** + * Name of the App Service Environment. + */ + name?: string; + + /** + * Location of the App Service Environment. + */ + location?: string; +} + +/** + * Collection of ASE regions. + */ +model AseRegionCollection is Azure.Core.Page; + +/** + * ASE region. + */ +#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +model AseRegion extends ProxyOnlyResource { + /** + * ASE region resource specific properties + */ + #suppress "@azure-tools/typespec-azure-core/no-private-usage" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + properties?: AseRegionProperties; +} + +/** + * ASE region resource specific properties + */ +model AseRegionProperties { + /** + * Display name for region. + */ + @visibility(Lifecycle.Read) + displayName?: string; + + /** + * Is region standard. + */ + @visibility(Lifecycle.Read) + standard?: boolean; + + /** + * Dedicated host enabled. + */ + @visibility(Lifecycle.Read) + dedicatedHost?: boolean; + + /** + * Zone redundant deployment enabled. + */ + @visibility(Lifecycle.Read) + zoneRedundant?: boolean; + + /** + * Available Skus in region. + */ + availableSku?: string[]; + + /** + * Available OSs in region. + */ + #suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + availableOS?: string[]; +} + +/** + * Collection of geographical regions. + */ +model GeoRegionCollection is Azure.Core.Page; + +/** + * Identifies an object. + */ +model NameIdentifier { + /** + * Name of the object. + */ + name?: string; +} + +#suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +model DnlResourceNameAvailabilityRequest { + /** + * Resource group name + */ + resourceGroupName?: string; + + /** + * Indicates the endpoint name reuse scope.The default value is TenantReuse. + * Supported values are TenantReuse, SubscriptionReuse, ResourceGroupReuse, NoReuse + */ + autoGeneratedDomainNameLabelScope?: string; + + /** + * Resource name to verify. + */ + name: string; + + /** + * Resource type used for verification. + */ + type: CheckNameResourceTypes; +} + +/** + * Information regarding availability of a resource name for DNL apps with regionalized default hostnames. + */ +model DnlResourceNameAvailability { + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + hostName?: string; + + /** + * true indicates name is valid and available. false indicates the name is invalid, unavailable, or both. + */ + nameAvailable?: boolean; + + /** + * Invalid indicates the name provided does not match Azure App Service naming requirements. AlreadyExists indicates that the name is already in use and is therefore unavailable. + */ + reason?: InAvailabilityReasonType; + + /** + * If reason == invalid, provide the user with the reason why the given name is invalid, and provide the resource naming requirements so that the user can select a valid name. If reason == AlreadyExists, explain that resource name is already in use, and direct them to select a different name. + */ + message?: string; +} + +/** + * Collection of premier add-on offers. + */ +model PremierAddOnOfferCollection is Azure.Core.Page; + +/** + * Premier add-on offer. + */ +#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +model PremierAddOnOffer extends ProxyOnlyResource { + /** + * PremierAddOnOffer resource specific properties + */ + #suppress "@azure-tools/typespec-azure-core/no-private-usage" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + properties?: PremierAddOnOfferProperties; +} + +/** + * PremierAddOnOffer resource specific properties + */ +model PremierAddOnOfferProperties { + /** + * Premier add on SKU. + */ + sku?: string; + + /** + * Premier add on offer Product. + */ + product?: string; + + /** + * Premier add on offer Vendor. + */ + vendor?: string; + + /** + * true if promotion code is required; otherwise, false. + */ + promoCodeRequired?: boolean; + + /** + * Premier add on offer Quota. + */ + quota?: int32; + + /** + * App Service plans this offer is restricted to. + */ + webHostingPlanRestrictions?: AppServicePlanRestrictions; + + /** + * Privacy policy URL. + */ + privacyPolicyUrl?: string; + + /** + * Legal terms URL. + */ + legalTermsUrl?: string; + + /** + * Marketplace publisher. + */ + marketplacePublisher?: string; + + /** + * Marketplace offer. + */ + marketplaceOffer?: string; +} + +/** + * Collection of SKU information. + */ +model SkuInfos { + /** + * Resource type that this SKU applies to. + */ + resourceType?: string; + + /** + * List of SKUs the subscription is able to use. + */ + @identifiers(#["name"]) + skus?: GlobalCsmSkuDescription[]; +} + +/** + * A Global SKU Description. + */ +model GlobalCsmSkuDescription { + /** + * Name of the resource SKU. + */ + name?: string; + + /** + * Service Tier of the resource SKU. + */ + tier?: string; + + /** + * Size specifier of the resource SKU. + */ + size?: string; + + /** + * Family code of the resource SKU. + */ + family?: string; + + /** + * Min, max, and default scale values of the SKU. + */ + capacity?: SkuCapacity; + + /** + * Locations of the SKU. + */ + locations?: string[]; + + /** + * Capabilities of the SKU, e.g., is traffic manager enabled? + */ + @identifiers(#["name"]) + capabilities?: Capability[]; +} + +/** + * The required set of inputs to validate a VNET + */ +#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +model VnetParameters extends ProxyOnlyResource { + /** + * VnetParameters resource specific properties + */ + #suppress "@azure-tools/typespec-azure-core/no-private-usage" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + properties?: VnetParametersProperties; +} + +/** + * VnetParameters resource specific properties + */ +model VnetParametersProperties { + /** + * The Resource Group of the VNET to be validated + */ + vnetResourceGroup?: string; + + /** + * The name of the VNET to be validated + */ + vnetName?: string; + + /** + * The subnet name to be validated + */ + vnetSubnetName?: string; + + /** + * The ARM Resource ID of the subnet to validate + */ + subnetResourceId?: string; +} + +/** + * A class that describes the reason for a validation failure. + */ +#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +model VnetValidationFailureDetails extends ProxyOnlyResource { + /** + * VnetValidationFailureDetails resource specific properties + */ + #suppress "@azure-tools/typespec-azure-core/no-private-usage" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + properties?: VnetValidationFailureDetailsProperties; +} + +/** + * VnetValidationFailureDetails resource specific properties + */ +model VnetValidationFailureDetailsProperties { + /** + * Text describing the validation outcome. + */ + message?: string; + + /** + * A flag describing whether or not validation failed. + */ + failed?: boolean; + + /** + * A list of tests that failed in the validation. + */ + failedTests?: VnetValidationTestFailure[]; + + /** + * A list of warnings generated during validation. + */ + warnings?: VnetValidationTestFailure[]; +} + +/** + * A class that describes a test that failed during NSG and UDR validation. + */ +#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +model VnetValidationTestFailure extends ProxyOnlyResource { + /** + * VnetValidationTestFailure resource specific properties + */ + #suppress "@azure-tools/typespec-azure-core/no-private-usage" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + properties?: VnetValidationTestFailureProperties; +} + +/** + * VnetValidationTestFailure resource specific properties + */ +model VnetValidationTestFailureProperties { + /** + * The name of the test that failed. + */ + testName?: string; + + /** + * The details of what caused the failure, e.g. the blocking rule name, etc. + */ + details?: string; +} + +/** + * Object with a list of the resources that need to be moved and the resource group they should be moved to. + */ +model CsmMoveResourceEnvelope { + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + @maxLength(90) + @minLength(1) + @pattern(" ^[-\\w\\._\\(\\)]+[^\\.]$") + targetResourceGroup?: string; + + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + resources?: string[]; +} + +/** + * Resource validation request content. + */ +model ValidateRequest { + /** + * Resource name to verify. + */ + name: string; + + /** + * Resource type used for verification. + */ + type: ValidateResourceTypes; + + /** + * Expected location of the resource. + */ + location: string; + + /** + * Properties of the resource to validate. + */ + #suppress "@azure-tools/typespec-azure-core/no-private-usage" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + properties: ValidateProperties; +} + +/** + * App properties used for validation. + */ +model ValidateProperties { + /** + * ARM resource ID of an App Service plan that would host the app. + */ + serverFarmId?: string; + + /** + * Name of the target SKU for the App Service plan. + */ + skuName?: string; + + /** + * true if App Service plan is for Linux workers; otherwise, false. + */ + needLinuxWorkers?: boolean; + + /** + * true if App Service plan is for Spot instances; otherwise, false. + */ + isSpot?: boolean; + + /** + * Target capacity of the App Service plan (number of VMs). + */ + @minValue(1) + capacity?: int32; + + /** + * Name of App Service Environment where app or App Service plan should be created. + */ + hostingEnvironment?: string; + + /** + * true if App Service plan is running as a windows container + */ + isXenon?: boolean; + + /** + * Base URL of the container registry + */ + containerRegistryBaseUrl?: string; + + /** + * Username for to access the container registry + */ + containerRegistryUsername?: string; + + /** + * Password for to access the container registry + */ + containerRegistryPassword?: string; + + /** + * Repository name (image name) + */ + containerImageRepository?: string; + + /** + * Image tag + */ + containerImageTag?: string; + + /** + * Platform (windows or linux) + */ + containerImagePlatform?: string; + + /** + * App Service Environment Properties + */ + appServiceEnvironment?: AppServiceEnvironment; +} + +/** + * Describes the result of resource validation. + */ +model ValidateResponse { + /** + * Result of validation. + */ + status?: string; + + /** + * Error details for the case when validation fails. + */ + error?: ValidateResponseError; +} + +/** + * Error details for when validation fails. + */ +model ValidateResponseError { + /** + * Validation error code. + */ + code?: string; + + /** + * Validation error message. + */ + message?: string; +} + +/** + * Request entity for previewing the Static Site workflow + */ +#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +model StaticSitesWorkflowPreviewRequest extends ProxyOnlyResource { + /** + * StaticSitesWorkflowPreviewRequest resource specific properties + */ + #suppress "@azure-tools/typespec-azure-core/no-private-usage" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + properties?: StaticSitesWorkflowPreviewRequestProperties; +} + +/** + * StaticSitesWorkflowPreviewRequest resource specific properties + */ +model StaticSitesWorkflowPreviewRequestProperties { + /** + * URL for the repository of the static site. + */ + repositoryUrl?: string; + + /** + * The target branch in the repository. + */ + branch?: string; + + /** + * Build properties to configure on the repository. + */ + buildProperties?: StaticSiteBuildProperties; +} + +/** + * Build properties for the static site. + */ +model StaticSiteBuildProperties { + /** + * The path to the app code within the repository. + */ + appLocation?: string; + + /** + * The path to the api code within the repository. + */ + apiLocation?: string; + + /** + * Deprecated: The path of the app artifacts after building (deprecated in favor of OutputLocation) + */ + appArtifactLocation?: string; + + /** + * The output path of the app after building. + */ + outputLocation?: string; + + /** + * A custom command to run during deployment of the static content application. + */ + appBuildCommand?: string; + + /** + * A custom command to run during deployment of the Azure Functions API application. + */ + apiBuildCommand?: string; + + /** + * Skip Github Action workflow generation. + */ + skipGithubActionWorkflowGeneration?: boolean; + + /** + * Github Action secret name override. + */ + githubActionSecretNameOverride?: string; +} + +/** + * Preview for the Static Site Workflow to be generated + */ +#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +model StaticSitesWorkflowPreview extends ProxyOnlyResource { + /** + * StaticSitesWorkflowPreview resource specific properties + */ + #suppress "@azure-tools/typespec-azure-core/no-private-usage" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + properties?: StaticSitesWorkflowPreviewProperties; +} + +/** + * StaticSitesWorkflowPreview resource specific properties + */ +model StaticSitesWorkflowPreviewProperties { + /** + * The path for the workflow file to be generated + */ + @visibility(Lifecycle.Read) + path?: string; + + /** + * The contents for the workflow file to be generated + */ + @visibility(Lifecycle.Read) + contents?: string; +} + +/** + * A static site. + */ +#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-provisioning-state" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +model StaticSite { + /** + * The default autogenerated hostname for the static site. + */ + @visibility(Lifecycle.Read) + defaultHostname?: string; + + /** + * URL for the repository of the static site. + */ + repositoryUrl?: string; + + /** + * The target branch in the repository. + */ + branch?: string; + + /** + * The custom domains associated with this static site. + */ + @visibility(Lifecycle.Read) + customDomains?: string[]; + + /** + * A user's github repository token. This is used to setup the Github Actions workflow file and API secrets. + */ + #suppress "@azure-tools/typespec-azure-resource-manager/secret-prop" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + repositoryToken?: string; + + /** + * Build properties to configure on the repository. + */ + buildProperties?: StaticSiteBuildProperties; + + /** + * Private endpoint connections + */ + @visibility(Lifecycle.Read) + privateEndpointConnections?: ResponseMessageEnvelopeRemotePrivateEndpointConnection[]; + + /** + * State indicating whether staging environments are allowed or not allowed for a static web app. + */ + stagingEnvironmentPolicy?: StagingEnvironmentPolicy; + + /** + * false if config file is locked for this static web app; otherwise, true. + */ + allowConfigFileUpdates?: boolean; + + /** + * Template options for generating a new repository. + */ + templateProperties?: StaticSiteTemplateOptions; + + /** + * The content distribution endpoint for the static site. + */ + @visibility(Lifecycle.Read) + contentDistributionEndpoint?: string; + + /** + * Identity to use for Key Vault Reference authentication. + */ + @visibility(Lifecycle.Read) + keyVaultReferenceIdentity?: string; + + /** + * User provided function apps registered with the static site + */ + @visibility(Lifecycle.Read) + userProvidedFunctionApps?: StaticSiteUserProvidedFunctionApp[]; + + /** + * Backends linked to the static side + */ + @visibility(Lifecycle.Read) + @identifiers(#[]) + linkedBackends?: StaticSiteLinkedBackend[]; + + /** + * The provider that submitted the last deployment to the primary environment of the static site. + */ + provider?: string; + + /** + * State indicating the status of the enterprise grade CDN serving traffic to the static web app. + */ + enterpriseGradeCdnStatus?: EnterpriseGradeCdnStatus; + + /** + * State indicating whether public traffic are allowed or not for a static web app. Allowed Values: 'Enabled', 'Disabled' or an empty string. + */ + #suppress "@azure-tools/typespec-azure-resource-manager/secret-prop" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + publicNetworkAccess?: string; + + /** + * Database connections for the static site + */ + @visibility(Lifecycle.Read) + @identifiers(#["name"]) + databaseConnections?: DatabaseConnectionOverview[]; +} + +/** + * Message envelope that contains the common Azure resource manager properties and the resource provider specific content. + */ +model ResponseMessageEnvelopeRemotePrivateEndpointConnection { + /** + * Resource Id. Typically ID is populated only for responses to GET requests. Caller is responsible for passing in this + * value for GET requests only. + * For example: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupId}/providers/Microsoft.Web/sites/{sitename} + */ + id?: string; + + /** + * Name of resource. + */ + name?: string; + + /** + * Type of resource e.g "Microsoft.Web/sites". + */ + type?: string; + + /** + * Geographical region resource belongs to e.g. SouthCentralUS, SouthEastAsia. + */ + location?: string; + + /** + * Tags associated with resource. + */ + #suppress "@azure-tools/typespec-azure-resource-manager/arm-no-record" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + tags?: Record; + + /** + * Azure resource manager plan. + */ + plan?: ArmPlan; + + /** + * Resource specific properties. + */ + properties?: RemotePrivateEndpointConnection; + + /** + * SKU description of the resource. + */ + sku?: SkuDescription; + + /** + * Azure-AsyncOperation Status info. + */ + status?: string; + + /** + * Azure-AsyncOperation Error info. + */ + error?: ErrorEntity; + + /** + * MSI resource + */ + identity?: ManagedServiceIdentity; + + /** + * Logical Availability Zones the service is hosted in + */ + zones?: string[]; +} + +/** + * The plan object in Azure Resource Manager, represents a marketplace plan. + */ +model ArmPlan { + /** + * The name. + */ + name?: string; + + /** + * The publisher. + */ + publisher?: string; + + /** + * The product. + */ + product?: string; + + /** + * The promotion code. + */ + promotionCode?: string; + + /** + * Version of product. + */ + version?: string; +} + +/** + * A remote private endpoint connection + */ +#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +model RemotePrivateEndpointConnection extends ProxyOnlyResource { + /** + * RemotePrivateEndpointConnection resource specific properties + */ + #suppress "@azure-tools/typespec-azure-core/no-private-usage" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + properties?: RemotePrivateEndpointConnectionProperties; +} + +/** + * RemotePrivateEndpointConnection resource specific properties + */ +model RemotePrivateEndpointConnectionProperties { + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + @visibility(Lifecycle.Read) + provisioningState?: string; + + /** + * PrivateEndpoint of a remote private endpoint connection + */ + privateEndpoint?: ArmIdWrapper; + + /** + * The state of a private link connection + */ + privateLinkServiceConnectionState?: PrivateLinkConnectionState; + + /** + * Private IPAddresses mapped to the remote private endpoint + */ + ipAddresses?: string[]; +} + +/** + * Template Options for the static site. + */ +model StaticSiteTemplateOptions { + /** + * URL of the template repository. The newly generated repository will be based on this one. + */ + templateRepositoryUrl?: string; + + /** + * Owner of the newly generated repository. + */ + owner?: string; + + /** + * Name of the newly generated repository. + */ + repositoryName?: string; + + /** + * Description of the newly generated repository. + */ + description?: string; + + /** + * Whether or not the newly generated repository is a private repository. Defaults to false (i.e. public). + */ + isPrivate?: boolean; +} + +/** + * A static site user provided function. + */ +#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +model StaticSiteUserProvidedFunctionApp extends ProxyOnlyResource { + /** + * StaticSiteUserProvidedFunctionApp resource specific properties + */ + #suppress "@azure-tools/typespec-azure-core/no-private-usage" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + properties?: StaticSiteUserProvidedFunctionAppProperties; +} + +/** + * StaticSiteUserProvidedFunctionApp resource specific properties + */ +model StaticSiteUserProvidedFunctionAppProperties { + /** + * The resource id of the function app registered with the static site + */ + functionAppResourceId?: string; + + /** + * The region of the function app registered with the static site + */ + functionAppRegion?: string; + + /** + * The date and time on which the function app was registered with the static site. + */ + @visibility(Lifecycle.Read) + // FIXME: (utcDateTime) Please double check that this is the correct type for your scenario. + createdOn?: utcDateTime; +} + +/** + * Static Site Linked Backend ARM resource. + */ +model StaticSiteLinkedBackend { + /** + * The resource id of the backend linked to the static site + */ + backendResourceId?: string; + + /** + * The region of the backend linked to the static site + */ + region?: string; + + /** + * The date and time on which the backend was linked to the static site. + */ + @visibility(Lifecycle.Read) + // FIXME: (utcDateTime) Please double check that this is the correct type for your scenario. + createdOn?: utcDateTime; + + /** + * The provisioning state of the linking process. + */ + @visibility(Lifecycle.Read) + provisioningState?: string; +} + +/** + * Static Site Database Connection overview. + */ +model DatabaseConnectionOverview { + /** + * The resource id of the database. + */ + @visibility(Lifecycle.Read) + resourceId?: string; + + /** + * If present, the identity is used in conjunction with connection string to connect to the database. Use of the system-assigned managed identity is indicated with the string 'SystemAssigned', while use of a user-assigned managed identity is indicated with the resource id of the managed identity resource. + */ + @visibility(Lifecycle.Read) + connectionIdentity?: string; + + /** + * The region of the database resource. + */ + @visibility(Lifecycle.Read) + region?: string; + + /** + * A list of configuration files associated with this database connection. + */ + @visibility(Lifecycle.Read) + @identifiers(#["fileName"]) + configurationFiles?: StaticSiteDatabaseConnectionConfigurationFileOverview[]; + + /** + * If present, the name of this database connection resource. + */ + @visibility(Lifecycle.Read) + name?: string; +} + +/** + * A database connection configuration file + */ +model StaticSiteDatabaseConnectionConfigurationFileOverview { + /** + * The name of the configuration file. + */ + @visibility(Lifecycle.Read) + fileName?: string; + + /** + * The Base64 encoding of the file contents. + */ + @visibility(Lifecycle.Read) + contents?: string; + + /** + * The type of configuration file. + */ + @visibility(Lifecycle.Read) + type?: string; +} + +/** + * ARM resource for a static site when patching + */ +#suppress "@azure-tools/typespec-azure-resource-manager/patch-envelope" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +model StaticSitePatchResource extends ProxyOnlyResource { + /** + * Core resource properties + */ + #suppress "@azure-tools/typespec-azure-core/no-private-usage" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + properties?: StaticSite; +} + +/** + * Collection of static site custom users. + */ +model StaticSiteUserCollection is Azure.Core.Page; + +/** + * Static Site User ARM resource. + */ +#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +#suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +model StaticSiteUserARMResource extends ProxyOnlyResource { + /** + * StaticSiteUserARMResource resource specific properties + */ + #suppress "@azure-tools/typespec-azure-core/no-private-usage" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + properties?: StaticSiteUserARMResourceProperties; +} + +/** + * StaticSiteUserARMResource resource specific properties + */ +#suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +model StaticSiteUserARMResourceProperties { + /** + * The identity provider for the static site user. + */ + @visibility(Lifecycle.Read) + provider?: string; + + /** + * The user id for the static site user. + */ + @visibility(Lifecycle.Read) + userId?: string; + + /** + * The display name for the static site user. + */ + @visibility(Lifecycle.Read) + displayName?: string; + + /** + * The roles for the static site user, in free-form string format + */ + roles?: string; +} + +/** + * StaticSiteBuildARMResource resource specific properties + */ +#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-provisioning-state" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +#suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +model StaticSiteBuildARMResourceProperties { + /** + * An identifier for the static site build. + */ + @visibility(Lifecycle.Read) + buildId?: string; + + /** + * The source branch. + */ + @visibility(Lifecycle.Read) + sourceBranch?: string; + + /** + * The title of a pull request that a static site build is related to. + */ + @visibility(Lifecycle.Read) + pullRequestTitle?: string; + + /** + * The hostname for a static site build. + */ + @visibility(Lifecycle.Read) + hostname?: string; + + /** + * When this build was created. + */ + @visibility(Lifecycle.Read) + // FIXME: (utcDateTime) Please double check that this is the correct type for your scenario. + createdTimeUtc?: utcDateTime; + + /** + * When this build was updated. + */ + @visibility(Lifecycle.Read) + // FIXME: (utcDateTime) Please double check that this is the correct type for your scenario. + lastUpdatedOn?: utcDateTime; + + /** + * The status of the static site build. + */ + @visibility(Lifecycle.Read) + status?: BuildStatus; + + /** + * User provided function apps registered with the static site build + */ + @visibility(Lifecycle.Read) + userProvidedFunctionApps?: StaticSiteUserProvidedFunctionApp[]; + + /** + * Backends linked to the static side build + */ + @visibility(Lifecycle.Read) + @identifiers(#[]) + linkedBackends?: StaticSiteLinkedBackend[]; + + /** + * Database connections for the static site build + */ + @visibility(Lifecycle.Read) + @identifiers(#["name"]) + databaseConnections?: DatabaseConnectionOverview[]; +} + +/** + * String dictionary resource. + */ +#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +model StringDictionary extends ProxyOnlyResource { + /** + * Settings. + */ + #suppress "@azure-tools/typespec-azure-core/no-private-usage" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + #suppress "@azure-tools/typespec-azure-resource-manager/arm-no-record" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + properties?: Record; +} + +/** + * DatabaseConnection resource specific properties + */ +#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-provisioning-state" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +model DatabaseConnectionProperties { + /** + * The resource id of the database. + */ + resourceId: string; + + /** + * If present, the identity is used in conjunction with connection string to connect to the database. Use of the system-assigned managed identity is indicated with the string 'SystemAssigned', while use of a user-assigned managed identity is indicated with the resource id of the managed identity resource. + */ + connectionIdentity?: string; + + /** + * The connection string to use to connect to the database. + */ + connectionString?: string; + + /** + * The region of the database resource. + */ + region: string; + + /** + * A list of configuration files associated with this database connection. + */ + @visibility(Lifecycle.Read) + @identifiers(#["fileName"]) + configurationFiles?: StaticSiteDatabaseConnectionConfigurationFileOverview[]; +} + +/** + * Static Site Database Connection Request Properties resource when patching + */ +model DatabaseConnectionPatchRequest { + /** + * DatabaseConnectionPatchRequest resource specific properties + */ + #suppress "@azure-tools/typespec-azure-core/no-private-usage" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + properties?: DatabaseConnectionPatchRequestProperties; +} + +/** + * DatabaseConnectionPatchRequest resource specific properties + */ +model DatabaseConnectionPatchRequestProperties { + /** + * The resource id of the database. + */ + resourceId?: string; + + /** + * If present, the identity is used in conjunction with connection string to connect to the database. Use of the system-assigned managed identity is indicated with the string 'SystemAssigned', while use of a user-assigned managed identity is indicated with the resource id of the managed identity resource. + */ + connectionIdentity?: string; + + /** + * The connection string to use to connect to the database. + */ + connectionString?: string; + + /** + * The region of the database resource. + */ + region?: string; +} + +/** + * Collection of static site functions. + */ +model StaticSiteFunctionOverviewCollection + is Azure.Core.Page; + +/** + * Static Site Function Overview ARM resource. + */ +#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +#suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +model StaticSiteFunctionOverviewARMResource extends ProxyOnlyResource { + /** + * StaticSiteFunctionOverviewARMResource resource specific properties + */ + #suppress "@azure-tools/typespec-azure-core/no-private-usage" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + properties?: StaticSiteFunctionOverviewARMResourceProperties; +} + +/** + * StaticSiteFunctionOverviewARMResource resource specific properties + */ +#suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +model StaticSiteFunctionOverviewARMResourceProperties { + /** + * The name for the function + */ + @visibility(Lifecycle.Read) + functionName?: string; + + /** + * The trigger type of the function + */ + @visibility(Lifecycle.Read) + triggerType?: TriggerTypes; +} + +/** + * StaticSiteUserProvidedFunctionAppARMResource resource specific properties + */ +#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-provisioning-state" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +#suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +model StaticSiteUserProvidedFunctionAppARMResourceProperties { + /** + * The resource id of the function app registered with the static site + */ + functionAppResourceId?: string; + + /** + * The region of the function app registered with the static site + */ + functionAppRegion?: string; + + /** + * The date and time on which the function app was registered with the static site. + */ + @visibility(Lifecycle.Read) + // FIXME: (utcDateTime) Please double check that this is the correct type for your scenario. + createdOn?: utcDateTime; +} + +/** + * Static site zip deployment ARM resource. + */ +#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +#suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +model StaticSiteZipDeploymentARMResource extends ProxyOnlyResource { + /** + * Core resource properties + */ + #suppress "@azure-tools/typespec-azure-core/no-private-usage" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + properties?: StaticSiteZipDeployment; +} + +/** + * A static site zip deployment. + */ +model StaticSiteZipDeployment { + /** + * URL for the zipped app content + */ + appZipUrl?: string; + + /** + * URL for the zipped api content + */ + apiZipUrl?: string; + + /** + * A title to label the deployment + */ + deploymentTitle?: string; + + /** + * The provider submitting this deployment + */ + provider?: string; + + /** + * The language of the api content, if it exists + */ + functionLanguage?: string; +} + +/** + * StaticSiteBasicAuthPropertiesARMResource resource specific properties + */ +#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-provisioning-state" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +#suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +model StaticSiteBasicAuthPropertiesARMResourceProperties { + /** + * The password for basic auth. + */ + #suppress "@azure-tools/typespec-azure-resource-manager/secret-prop" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + password?: string; + + /** + * Url to the secret in Key Vault. + */ + secretUrl?: string; + + /** + * State indicating if basic auth is enabled and for what environments it is active. + */ + applicableEnvironmentsMode: string; + + /** + * The list of enabled environments for Basic Auth if ApplicableEnvironmentsMode is set to SpecifiedEnvironments. + */ + environments?: string[]; + + /** + * State indicating if basic auth has a secret and what type it is. + */ + @visibility(Lifecycle.Read) + secretState?: string; +} + +/** + * Static sites user roles invitation resource. + */ +#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +model StaticSiteUserInvitationRequestResource extends ProxyOnlyResource { + /** + * StaticSiteUserInvitationRequestResource resource specific properties + */ + #suppress "@azure-tools/typespec-azure-core/no-private-usage" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + properties?: StaticSiteUserInvitationRequestResourceProperties; +} + +/** + * StaticSiteUserInvitationRequestResource resource specific properties + */ +model StaticSiteUserInvitationRequestResourceProperties { + /** + * The domain name for the static site custom domain. + */ + domain?: string; + + /** + * The identity provider for the static site user. + */ + provider?: string; + + /** + * The user id for the static site user. + */ + userDetails?: string; + + /** + * The roles for the static site user, in free-form string format + */ + roles?: string; + + /** + * The number of hours the sas token stays valid + */ + numHoursToExpiration?: int32; +} + +/** + * Static sites user roles invitation link resource. + */ +#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +model StaticSiteUserInvitationResponseResource extends ProxyOnlyResource { + /** + * StaticSiteUserInvitationResponseResource resource specific properties + */ + #suppress "@azure-tools/typespec-azure-core/no-private-usage" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + properties?: StaticSiteUserInvitationResponseResourceProperties; +} + +/** + * StaticSiteUserInvitationResponseResource resource specific properties + */ +model StaticSiteUserInvitationResponseResourceProperties { + /** + * The expiration time of the invitation + */ + @visibility(Lifecycle.Read) + // FIXME: (utcDateTime) Please double check that this is the correct type for your scenario. + expiresOn?: utcDateTime; + + /** + * The url for the invitation link + */ + @visibility(Lifecycle.Read) + invitationUrl?: string; +} + +/** + * StaticSiteCustomDomainOverviewARMResource resource specific properties + */ +#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-provisioning-state" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +#suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +model StaticSiteCustomDomainOverviewARMResourceProperties { + /** + * The domain name for the static site custom domain. + */ + @visibility(Lifecycle.Read) + domainName?: string; + + /** + * The date and time on which the custom domain was created for the static site. + */ + @visibility(Lifecycle.Read) + // FIXME: (utcDateTime) Please double check that this is the correct type for your scenario. + createdOn?: utcDateTime; + + /** + * The status of the custom domain + */ + @visibility(Lifecycle.Read) + status?: CustomDomainStatus; + + /** + * The TXT record validation token + */ + #suppress "@azure-tools/typespec-azure-resource-manager/secret-prop" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + @visibility(Lifecycle.Read) + validationToken?: string; + + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + @visibility(Lifecycle.Read) + errorMessage?: string; +} + +/** + * Static Site Custom Domain Request Properties ARM resource. + */ +#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +#suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +model StaticSiteCustomDomainRequestPropertiesARMResource + extends ProxyOnlyResource { + /** + * StaticSiteCustomDomainRequestPropertiesARMResource resource specific properties + */ + #suppress "@azure-tools/typespec-azure-core/no-private-usage" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + properties?: StaticSiteCustomDomainRequestPropertiesARMResourceProperties; +} + +/** + * StaticSiteCustomDomainRequestPropertiesARMResource resource specific properties + */ +#suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +model StaticSiteCustomDomainRequestPropertiesARMResourceProperties { + /** + * Validation method for adding a custom domain + */ + validationMethod?: string = "cname-delegation"; +} + +/** + * String list resource. + */ +#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +model StringList extends ProxyOnlyResource { + /** + * List of string resources. + */ + properties?: string[]; +} + +/** + * Static Site Reset Properties ARM resource. + */ +#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +#suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +model StaticSiteResetPropertiesARMResource extends ProxyOnlyResource { + /** + * StaticSiteResetPropertiesARMResource resource specific properties + */ + #suppress "@azure-tools/typespec-azure-core/no-private-usage" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + properties?: StaticSiteResetPropertiesARMResourceProperties; +} + +/** + * StaticSiteResetPropertiesARMResource resource specific properties + */ +#suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +model StaticSiteResetPropertiesARMResourceProperties { + /** + * The token which proves admin privileges to the repository. + */ + repositoryToken?: string; + + /** + * Determines whether the repository should be updated with the new properties. + */ + shouldUpdateRepository?: boolean; +} + +/** + * StaticSiteLinkedBackendARMResource resource specific properties + */ +#suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +model StaticSiteLinkedBackendARMResourceProperties { + /** + * The resource id of the backend linked to the static site + */ + backendResourceId?: string; + + /** + * The region of the backend linked to the static site + */ + region?: string; + + /** + * The date and time on which the backend was linked to the static site. + */ + @visibility(Lifecycle.Read) + // FIXME: (utcDateTime) Please double check that this is the correct type for your scenario. + createdOn?: utcDateTime; + + /** + * The provisioning state of the linking process. + */ + #suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-provisioning-state" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + @visibility(Lifecycle.Read) + provisioningState?: string; +} + +/** + * ARM resource for a site. + */ +#suppress "@azure-tools/typespec-azure-resource-manager/patch-envelope" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +model SitePatchResource extends ProxyOnlyResource { + /** + * SitePatchResource resource specific properties + */ + #suppress "@azure-tools/typespec-azure-core/no-private-usage" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + properties?: SitePatchResourceProperties; + + /** + * Managed service identity. + */ + identity?: ManagedServiceIdentity; +} + +/** + * SitePatchResource resource specific properties + */ +model SitePatchResourceProperties { + /** + * Current state of the app. + */ + @visibility(Lifecycle.Read) + state?: string; + + /** + * Hostnames associated with the app. + */ + @visibility(Lifecycle.Read) + hostNames?: string[]; + + /** + * Name of the repository site. + */ + @visibility(Lifecycle.Read) + repositorySiteName?: string; + + /** + * State indicating whether the app has exceeded its quota usage. Read-only. + */ + @visibility(Lifecycle.Read) + usageState?: UsageState; + + /** + * true if the app is enabled; otherwise, false. Setting this value to false disables the app (takes the app offline). + */ + enabled?: boolean; + + /** + * Enabled hostnames for the app.Hostnames need to be assigned (see HostNames) AND enabled. Otherwise, + * the app is not served on those hostnames. + */ + @visibility(Lifecycle.Read) + enabledHostNames?: string[]; + + /** + * Management information availability state for the app. + */ + @visibility(Lifecycle.Read) + availabilityState?: SiteAvailabilityState; + + /** + * Hostname SSL states are used to manage the SSL bindings for app's hostnames. + */ + @identifiers(#["name"]) + hostNameSslStates?: HostNameSslState[]; + + /** + * Resource ID of the associated App Service plan, formatted as: "/subscriptions/{subscriptionID}/resourceGroups/{groupName}/providers/Microsoft.Web/serverfarms/{appServicePlanName}". + */ + serverFarmId?: string; + + /** + * true if reserved; otherwise, false. + */ + @visibility(Lifecycle.Read, Lifecycle.Create) + reserved?: boolean = false; + + /** + * Obsolete: Hyper-V sandbox. + */ + @visibility(Lifecycle.Read, Lifecycle.Create) + isXenon?: boolean = false; + + /** + * Hyper-V sandbox. + */ + @visibility(Lifecycle.Read, Lifecycle.Create) + hyperV?: boolean = false; + + /** + * Last time the app was modified, in UTC. Read-only. + */ + @visibility(Lifecycle.Read) + // FIXME: (utcDateTime) Please double check that this is the correct type for your scenario. + lastModifiedTimeUtc?: utcDateTime; + + /** + * Property to configure various DNS related settings for a site. + */ + dnsConfiguration?: SiteDnsConfig; + + /** + * Configuration of the app. + */ + siteConfig?: SiteConfig; + + /** + * Azure Traffic Manager hostnames associated with the app. Read-only. + */ + @visibility(Lifecycle.Read) + trafficManagerHostNames?: string[]; + + /** + * true to stop SCM (KUDU) site when the app is stopped; otherwise, false. The default is false. + */ + scmSiteAlsoStopped?: boolean = false; + + /** + * Specifies which deployment slot this app will swap into. Read-only. + */ + @visibility(Lifecycle.Read) + targetSwapSlot?: string; + + /** + * App Service Environment to use for the app. + */ + @visibility(Lifecycle.Read, Lifecycle.Create) + hostingEnvironmentProfile?: HostingEnvironmentProfile; + + /** + * true to enable client affinity; false to stop sending session affinity cookies, which route client requests in the same session to the same instance. Default is true. + */ + clientAffinityEnabled?: boolean; + + /** + * true to override client affinity cookie domain with X-Forwarded-Host request header. false to use default domain. Default is false. + */ + clientAffinityProxyEnabled?: boolean; + + /** + * true to enable client certificate authentication (TLS mutual authentication); otherwise, false. Default is false. + */ + clientCertEnabled?: boolean; + + /** + * This composes with ClientCertEnabled setting. + * - ClientCertEnabled: false means ClientCert is ignored. + * - ClientCertEnabled: true and ClientCertMode: Required means ClientCert is required. + * - ClientCertEnabled: true and ClientCertMode: Optional means ClientCert is optional or accepted. + */ + clientCertMode?: ClientCertMode; + + /** + * client certificate authentication comma-separated exclusion paths + */ + clientCertExclusionPaths?: string; + + /** + * true to disable the public hostnames of the app; otherwise, false.\n If true, the app is only accessible via API management process. + */ + hostNamesDisabled?: boolean; + + /** + * Unique identifier that verifies the custom domains assigned to the app. Customer will add this id to a txt record for verification. + */ + customDomainVerificationId?: string; + + /** + * List of IP addresses that the app uses for outbound connections (e.g. database access). Includes VIPs from tenants that site can be hosted with current settings. Read-only. + */ + @visibility(Lifecycle.Read) + outboundIpAddresses?: string; + + /** + * List of IP addresses that the app uses for outbound connections (e.g. database access). Includes VIPs from all tenants except dataComponent. Read-only. + */ + @visibility(Lifecycle.Read) + possibleOutboundIpAddresses?: string; + + /** + * Size of the function container. + */ + containerSize?: int32; + + /** + * Maximum allowed daily memory-time quota (applicable on dynamic apps only). + */ + dailyMemoryTimeQuota?: int32; + + /** + * App suspended till in case memory-time quota is exceeded. + */ + @visibility(Lifecycle.Read) + // FIXME: (utcDateTime) Please double check that this is the correct type for your scenario. + suspendedTill?: utcDateTime; + + /** + * Maximum number of workers. + * This only applies to Functions container. + */ + @visibility(Lifecycle.Read) + maxNumberOfWorkers?: int32; + + /** + * If specified during app creation, the app is cloned from a source app. + */ + @visibility(Lifecycle.Create) + cloningInfo?: CloningInfo; + + /** + * Name of the resource group the app belongs to. Read-only. + */ + @visibility(Lifecycle.Read) + resourceGroup?: string; + + /** + * true if the app is a default container; otherwise, false. + */ + @visibility(Lifecycle.Read) + isDefaultContainer?: boolean; + + /** + * Default hostname of the app. Read-only. + */ + @visibility(Lifecycle.Read) + defaultHostName?: string; + + /** + * Status of the last deployment slot swap operation. + */ + @visibility(Lifecycle.Read) + slotSwapStatus?: SlotSwapStatus; + + /** + * HttpsOnly: configures a web site to accept only https requests. Issues redirect for + * http requests + */ + httpsOnly?: boolean; + + /** + * Site redundancy mode + */ + redundancyMode?: RedundancyMode; + + /** + * Specifies an operation id if this site has a pending operation. + */ + #suppress "@azure-tools/typespec-azure-core/no-format" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + @visibility(Lifecycle.Read) + @format("uuid") + inProgressOperationId?: string; + + /** + * Property to allow or block all public traffic. Allowed Values: 'Enabled', 'Disabled' or an empty string. + */ + publicNetworkAccess?: string; + + /** + * Checks if Customer provided storage account is required + */ + storageAccountRequired?: boolean; + + /** + * Identity to use for Key Vault Reference authentication. + */ + keyVaultReferenceIdentity?: string; + + /** + * Azure Resource Manager ID of the Virtual network and subnet to be joined by Regional VNET Integration. + * This must be of the form /subscriptions/{subscriptionName}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{vnetName}/subnets/{subnetName} + */ + virtualNetworkSubnetId?: string; +} + +/** + * Custom domain analysis. + */ +#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +model CustomHostnameAnalysisResult extends ProxyOnlyResource { + /** + * CustomHostnameAnalysisResult resource specific properties + */ + #suppress "@azure-tools/typespec-azure-core/no-private-usage" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + properties?: CustomHostnameAnalysisResultProperties; +} + +/** + * CustomHostnameAnalysisResult resource specific properties + */ +model CustomHostnameAnalysisResultProperties { + /** + * true if hostname is already verified; otherwise, false. + */ + @visibility(Lifecycle.Read) + isHostnameAlreadyVerified?: boolean; + + /** + * DNS verification test result. + */ + @visibility(Lifecycle.Read) + customDomainVerificationTest?: DnsVerificationTestResult; + + /** + * Raw failure information if DNS verification fails. + */ + @visibility(Lifecycle.Read) + customDomainVerificationFailureInfo?: ErrorEntity; + + /** + * true if there is a conflict on a scale unit; otherwise, false. + */ + @visibility(Lifecycle.Read) + hasConflictOnScaleUnit?: boolean; + + /** + * true if there is a conflict across subscriptions; otherwise, false. + */ + @visibility(Lifecycle.Read) + hasConflictAcrossSubscription?: boolean; + + /** + * Name of the conflicting app on scale unit if it's within the same subscription. + */ + @visibility(Lifecycle.Read) + conflictingAppResourceId?: string; + + /** + * CName records controller can see for this hostname. + */ + cNameRecords?: string[]; + + /** + * TXT records controller can see for this hostname. + */ + txtRecords?: string[]; + + /** + * A records controller can see for this hostname. + */ + aRecords?: string[]; + + /** + * Alternate CName records controller can see for this hostname. + */ + #suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + alternateCNameRecords?: string[]; + + /** + * Alternate TXT records controller can see for this hostname. + */ + alternateTxtRecords?: string[]; +} + +/** + * Deployment slot parameters. + */ +model CsmSlotEntity { + /** + * Destination deployment slot during swap operation. + */ + targetSlot: string; + + /** + * true to preserve Virtual Network to the slot during swap; otherwise, false. + */ + preserveVnet: boolean; +} + +/** + * Description of a backup which will be performed. + */ +#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +model BackupRequest extends ProxyOnlyResource { + /** + * BackupRequest resource specific properties + */ + #suppress "@azure-tools/typespec-azure-core/no-private-usage" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + properties?: BackupRequestProperties; +} + +/** + * BackupRequest resource specific properties + */ +model BackupRequestProperties { + /** + * Name of the backup. + */ + backupName?: string; + + /** + * True if the backup schedule is enabled (must be included in that case), false if the backup schedule should be disabled. + */ + enabled?: boolean; + + /** + * SAS URL to the container. + */ + storageAccountUrl: string; + + /** + * Schedule for the backup if it is executed periodically. + */ + backupSchedule?: BackupSchedule; + + /** + * Databases included in the backup. + */ + @identifiers(#["name"]) + databases?: DatabaseBackupSetting[]; +} + +/** + * Description of a backup schedule. Describes how often should be the backup performed and what should be the retention policy. + */ +model BackupSchedule { + /** + * How often the backup should be executed (e.g. for weekly backup, this should be set to 7 and FrequencyUnit should be set to Day) + */ + frequencyInterval: int32 = 7; + + /** + * The unit of time for how often the backup should be executed (e.g. for weekly backup, this should be set to Day and FrequencyInterval should be set to 7) + */ + frequencyUnit: FrequencyUnit = FrequencyUnit.Day; + + /** + * True if the retention policy should always keep at least one backup in the storage account, regardless how old it is; false otherwise. + */ + keepAtLeastOneBackup: boolean = true; + + /** + * After how many days backups should be deleted. + */ + retentionPeriodInDays: int32 = 30; + + /** + * When the schedule should start working. + */ + // FIXME: (utcDateTime) Please double check that this is the correct type for your scenario. + startTime?: utcDateTime; + + /** + * Last time when this schedule was triggered. + */ + @visibility(Lifecycle.Read) + // FIXME: (utcDateTime) Please double check that this is the correct type for your scenario. + lastExecutionTime?: utcDateTime; +} + +/** + * Database backup settings. + */ +model DatabaseBackupSetting { + /** + * Database type (e.g. SqlAzure / MySql). + */ + databaseType: DatabaseType; + + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + name?: string; + + /** + * Contains a connection string name that is linked to the SiteConfig.ConnectionStrings. + * This is used during restore with overwrite connection strings options. + */ + connectionStringName?: string; + + /** + * Contains a connection string to a database which is being backed up or restored. If the restore should happen to a new database, the database name inside is the new one. + */ + connectionString?: string; +} + +/** + * BackupItem resource specific properties + */ +#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-provisioning-state" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +model BackupItemProperties { + /** + * Id of the backup. + */ + #suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-duplicate-property" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + @visibility(Lifecycle.Read) + id?: int32; + + /** + * SAS URL for the storage account container which contains this backup. + */ + @visibility(Lifecycle.Read) + storageAccountUrl?: string; + + /** + * Name of the blob which contains data for this backup. + */ + @visibility(Lifecycle.Read) + blobName?: string; + + /** + * Name of this backup. + */ + #suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-duplicate-property" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + @visibility(Lifecycle.Read) + name?: string; + + /** + * Backup status. + */ + @visibility(Lifecycle.Read) + status?: BackupItemStatus; + + /** + * Size of the backup in bytes. + */ + @visibility(Lifecycle.Read) + sizeInBytes?: int64; + + /** + * Timestamp of the backup creation. + */ + @visibility(Lifecycle.Read) + // FIXME: (utcDateTime) Please double check that this is the correct type for your scenario. + created?: utcDateTime; + + /** + * Details regarding this backup. Might contain an error message. + */ + @visibility(Lifecycle.Read) + log?: string; + + /** + * List of databases included in the backup. + */ + @visibility(Lifecycle.Read) + @identifiers(#["name"]) + databases?: DatabaseBackupSetting[]; + + /** + * True if this backup has been created due to a schedule being triggered. + */ + @visibility(Lifecycle.Read) + scheduled?: boolean; + + /** + * Timestamp of a last restore operation which used this backup. + */ + @visibility(Lifecycle.Read) + // FIXME: (utcDateTime) Please double check that this is the correct type for your scenario. + lastRestoreTimeStamp?: utcDateTime; + + /** + * Timestamp when this backup finished. + */ + @visibility(Lifecycle.Read) + // FIXME: (utcDateTime) Please double check that this is the correct type for your scenario. + finishedTimeStamp?: utcDateTime; + + /** + * Unique correlation identifier. Please use this along with the timestamp while communicating with Azure support. + */ + @visibility(Lifecycle.Read) + correlationId?: string; + + /** + * Size of the original web app which has been backed up. + */ + @visibility(Lifecycle.Read) + websiteSizeInBytes?: int64; +} + +/** + * Description of a restore request. + */ +#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +model RestoreRequest extends ProxyOnlyResource { + /** + * RestoreRequest resource specific properties + */ + #suppress "@azure-tools/typespec-azure-core/no-private-usage" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + properties?: RestoreRequestProperties; +} + +/** + * RestoreRequest resource specific properties + */ +model RestoreRequestProperties { + /** + * SAS URL to the container. + */ + storageAccountUrl: string; + + /** + * Name of a blob which contains the backup. + */ + blobName?: string; + + /** + * true if the restore operation can overwrite target app; otherwise, false. true is needed if trying to restore over an existing app. + */ + overwrite: boolean; + + /** + * Name of an app. + */ + siteName?: string; + + /** + * Collection of databases which should be restored. This list has to match the list of databases included in the backup. + */ + @identifiers(#["name"]) + databases?: DatabaseBackupSetting[]; + + /** + * Changes a logic when restoring an app with custom domains. true to remove custom domains automatically. If false, custom domains are added to \nthe app's object when it is being restored, but that might fail due to conflicts during the operation. + */ + ignoreConflictingHostNames?: boolean = false; + + /** + * Ignore the databases and only restore the site content + */ + ignoreDatabases?: boolean = false; + + /** + * Specify app service plan that will own restored site. + */ + appServicePlan?: string; + + /** + * Operation type. + */ + operationType?: BackupRestoreOperationType = BackupRestoreOperationType.Default; + + /** + * true if SiteConfig.ConnectionStrings should be set in new app; otherwise, false. + */ + adjustConnectionStrings?: boolean; + + /** + * App Service Environment name, if needed (only when restoring an app to an App Service Environment). + */ + hostingEnvironment?: string; +} + +/** + * CsmPublishingCredentialsPoliciesEntity resource specific properties + */ +#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-provisioning-state" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +model CsmPublishingCredentialsPoliciesEntityProperties { + /** + * true to allow access to a publishing method; otherwise, false. + */ + allow: boolean; +} + +/** + * Configuration settings for the Azure App Service Authentication / Authorization feature. + */ +#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +model SiteAuthSettings extends ProxyOnlyResource { + /** + * SiteAuthSettings resource specific properties + */ + #suppress "@azure-tools/typespec-azure-core/no-private-usage" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + properties?: SiteAuthSettingsProperties; +} + +/** + * SiteAuthSettings resource specific properties + */ +model SiteAuthSettingsProperties { + /** + * true if the Authentication / Authorization feature is enabled for the current app; otherwise, false. + */ + enabled?: boolean; + + /** + * The RuntimeVersion of the Authentication / Authorization feature in use for the current app. + * The setting in this value can control the behavior of certain features in the Authentication / Authorization module. + */ + runtimeVersion?: string; + + /** + * The action to take when an unauthenticated client attempts to access the app. + */ + unauthenticatedClientAction?: UnauthenticatedClientAction; + + /** + * true to durably store platform-specific security tokens that are obtained during login flows; otherwise, false. + * The default is false. + */ + tokenStoreEnabled?: boolean; + + /** + * External URLs that can be redirected to as part of logging in or logging out of the app. Note that the query string part of the URL is ignored. + * This is an advanced setting typically only needed by Windows Store application backends. + * Note that URLs within the current domain are always implicitly allowed. + */ + allowedExternalRedirectUrls?: string[]; + + /** + * The default authentication provider to use when multiple providers are configured. + * This setting is only needed if multiple providers are configured and the unauthenticated client + * action is set to "RedirectToLoginPage". + */ + defaultProvider?: BuiltInAuthenticationProvider; + + /** + * The number of hours after session token expiration that a session token can be used to + * call the token refresh API. The default is 72 hours. + */ + tokenRefreshExtensionHours?: float64; + + /** + * The Client ID of this relying party application, known as the client_id. + * This setting is required for enabling OpenID Connection authentication with Azure Active Directory or + * other 3rd party OpenID Connect providers. + * More information on OpenID Connect: http://openid.net/specs/openid-connect-core-1_0.html + */ + clientId?: string; + + /** + * The Client Secret of this relying party application (in Azure Active Directory, this is also referred to as the Key). + * This setting is optional. If no client secret is configured, the OpenID Connect implicit auth flow is used to authenticate end users. + * Otherwise, the OpenID Connect Authorization Code Flow is used to authenticate end users. + * More information on OpenID Connect: http://openid.net/specs/openid-connect-core-1_0.html + */ + #suppress "@azure-tools/typespec-azure-resource-manager/secret-prop" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + clientSecret?: string; + + /** + * The app setting name that contains the client secret of the relying party application. + */ + clientSecretSettingName?: string; + + /** + * An alternative to the client secret, that is the thumbprint of a certificate used for signing purposes. This property acts as + * a replacement for the Client Secret. It is also optional. + */ + clientSecretCertificateThumbprint?: string; + + /** + * The OpenID Connect Issuer URI that represents the entity which issues access tokens for this application. + * When using Azure Active Directory, this value is the URI of the directory tenant, e.g. `https://sts.windows.net/{tenant-guid}/`. + * This URI is a case-sensitive identifier for the token issuer. + * More information on OpenID Connect Discovery: http://openid.net/specs/openid-connect-discovery-1_0.html + */ + issuer?: string; + + /** + * Gets a value indicating whether the issuer should be a valid HTTPS url and be validated as such. + */ + validateIssuer?: boolean; + + /** + * Allowed audience values to consider when validating JSON Web Tokens issued by + * Azure Active Directory. Note that the ClientID value is always considered an + * allowed audience, regardless of this setting. + */ + allowedAudiences?: string[]; + + /** + * Login parameters to send to the OpenID Connect authorization endpoint when + * a user logs in. Each parameter must be in the form "key=value". + */ + additionalLoginParams?: string[]; + + /** + * Gets a JSON string containing the Azure AD Acl settings. + */ + aadClaimsAuthorization?: string; + + /** + * The OpenID Connect Client ID for the Google web application. + * This setting is required for enabling Google Sign-In. + * Google Sign-In documentation: https://developers.google.com/identity/sign-in/web/ + */ + googleClientId?: string; + + /** + * The client secret associated with the Google web application. + * This setting is required for enabling Google Sign-In. + * Google Sign-In documentation: https://developers.google.com/identity/sign-in/web/ + */ + #suppress "@azure-tools/typespec-azure-resource-manager/secret-prop" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + googleClientSecret?: string; + + /** + * The app setting name that contains the client secret associated with + * the Google web application. + */ + googleClientSecretSettingName?: string; + + /** + * The OAuth 2.0 scopes that will be requested as part of Google Sign-In authentication. + * This setting is optional. If not specified, "openid", "profile", and "email" are used as default scopes. + * Google Sign-In documentation: https://developers.google.com/identity/sign-in/web/ + */ + #suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + googleOAuthScopes?: string[]; + + /** + * The App ID of the Facebook app used for login. + * This setting is required for enabling Facebook Login. + * Facebook Login documentation: https://developers.facebook.com/docs/facebook-login + */ + facebookAppId?: string; + + /** + * The App Secret of the Facebook app used for Facebook Login. + * This setting is required for enabling Facebook Login. + * Facebook Login documentation: https://developers.facebook.com/docs/facebook-login + */ + #suppress "@azure-tools/typespec-azure-resource-manager/secret-prop" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + facebookAppSecret?: string; + + /** + * The app setting name that contains the app secret used for Facebook Login. + */ + facebookAppSecretSettingName?: string; + + /** + * The OAuth 2.0 scopes that will be requested as part of Facebook Login authentication. + * This setting is optional. + * Facebook Login documentation: https://developers.facebook.com/docs/facebook-login + */ + #suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + facebookOAuthScopes?: string[]; + + /** + * The Client Id of the GitHub app used for login. + * This setting is required for enabling Github login + */ + gitHubClientId?: string; + + /** + * The Client Secret of the GitHub app used for Github Login. + * This setting is required for enabling Github login. + */ + #suppress "@azure-tools/typespec-azure-resource-manager/secret-prop" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + gitHubClientSecret?: string; + + /** + * The app setting name that contains the client secret of the Github + * app used for GitHub Login. + */ + gitHubClientSecretSettingName?: string; + + /** + * The OAuth 2.0 scopes that will be requested as part of GitHub Login authentication. + * This setting is optional + */ + #suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + gitHubOAuthScopes?: string[]; + + /** + * The OAuth 1.0a consumer key of the Twitter application used for sign-in. + * This setting is required for enabling Twitter Sign-In. + * Twitter Sign-In documentation: https://dev.twitter.com/web/sign-in + */ + #suppress "@azure-tools/typespec-azure-resource-manager/secret-prop" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + twitterConsumerKey?: string; + + /** + * The OAuth 1.0a consumer secret of the Twitter application used for sign-in. + * This setting is required for enabling Twitter Sign-In. + * Twitter Sign-In documentation: https://dev.twitter.com/web/sign-in + */ + #suppress "@azure-tools/typespec-azure-resource-manager/secret-prop" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + twitterConsumerSecret?: string; + + /** + * The app setting name that contains the OAuth 1.0a consumer secret of the Twitter + * application used for sign-in. + */ + twitterConsumerSecretSettingName?: string; + + /** + * The OAuth 2.0 client ID that was created for the app used for authentication. + * This setting is required for enabling Microsoft Account authentication. + * Microsoft Account OAuth documentation: https://dev.onedrive.com/auth/msa_oauth.htm + */ + microsoftAccountClientId?: string; + + /** + * The OAuth 2.0 client secret that was created for the app used for authentication. + * This setting is required for enabling Microsoft Account authentication. + * Microsoft Account OAuth documentation: https://dev.onedrive.com/auth/msa_oauth.htm + */ + #suppress "@azure-tools/typespec-azure-resource-manager/secret-prop" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + microsoftAccountClientSecret?: string; + + /** + * The app setting name containing the OAuth 2.0 client secret that was created for the + * app used for authentication. + */ + microsoftAccountClientSecretSettingName?: string; + + /** + * The OAuth 2.0 scopes that will be requested as part of Microsoft Account authentication. + * This setting is optional. If not specified, "wl.basic" is used as the default scope. + * Microsoft Account Scopes and permissions documentation: https://msdn.microsoft.com/en-us/library/dn631845.aspx + */ + #suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + microsoftAccountOAuthScopes?: string[]; + + /** + * "true" if the auth config settings should be read from a file, + * "false" otherwise + */ + isAuthFromFile?: string; + + /** + * The path of the config file containing auth settings. + * If the path is relative, base will the site's root directory. + */ + authFilePath?: string; + + /** + * The ConfigVersion of the Authentication / Authorization feature in use for the current app. + * The setting in this value can control the behavior of the control plane for Authentication / Authorization. + */ + configVersion?: string; +} + +/** + * SiteAuthSettingsV2 resource specific properties + */ +#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-provisioning-state" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +model SiteAuthSettingsV2Properties { + /** + * The configuration settings of the platform of App Service Authentication/Authorization. + */ + platform?: AuthPlatform; + + /** + * The configuration settings that determines the validation flow of users using App Service Authentication/Authorization. + */ + globalValidation?: GlobalValidation; + + /** + * The configuration settings of each of the identity providers used to configure App Service Authentication/Authorization. + */ + identityProviders?: IdentityProviders; + + /** + * The configuration settings of the login flow of users using App Service Authentication/Authorization. + */ + login?: Login; + + /** + * The configuration settings of the HTTP requests for authentication and authorization requests made against App Service Authentication/Authorization. + */ + httpSettings?: HttpSettings; +} + +/** + * The configuration settings of the platform of App Service Authentication/Authorization. + */ +model AuthPlatform { + /** + * true if the Authentication / Authorization feature is enabled for the current app; otherwise, false. + */ + enabled?: boolean; + + /** + * The RuntimeVersion of the Authentication / Authorization feature in use for the current app. + * The setting in this value can control the behavior of certain features in the Authentication / Authorization module. + */ + runtimeVersion?: string; + + /** + * The path of the config file containing auth settings if they come from a file. + * If the path is relative, base will the site's root directory. + */ + configFilePath?: string; +} + +/** + * The configuration settings that determines the validation flow of users using App Service Authentication/Authorization. + */ +model GlobalValidation { + /** + * true if the authentication flow is required any request is made; otherwise, false. + */ + requireAuthentication?: boolean; + + /** + * The action to take when an unauthenticated client attempts to access the app. + */ + unauthenticatedClientAction?: UnauthenticatedClientActionV2; + + /** + * The default authentication provider to use when multiple providers are configured. + * This setting is only needed if multiple providers are configured and the unauthenticated client + * action is set to "RedirectToLoginPage". + */ + redirectToProvider?: string; + + /** + * The paths for which unauthenticated flow would not be redirected to the login page. + */ + excludedPaths?: string[]; +} + +/** + * The configuration settings of each of the identity providers used to configure App Service Authentication/Authorization. + */ +model IdentityProviders { + /** + * The configuration settings of the Azure Active directory provider. + */ + azureActiveDirectory?: AzureActiveDirectory; + + /** + * The configuration settings of the Facebook provider. + */ + facebook?: Facebook; + + /** + * The configuration settings of the GitHub provider. + */ + gitHub?: GitHub; + + /** + * The configuration settings of the Google provider. + */ + google?: Google; + + /** + * The configuration settings of the legacy Microsoft Account provider. + */ + legacyMicrosoftAccount?: LegacyMicrosoftAccount; + + /** + * The configuration settings of the Twitter provider. + */ + twitter?: Twitter; + + /** + * The configuration settings of the Apple provider. + */ + apple?: Apple; + + /** + * The configuration settings of the Azure Static Web Apps provider. + */ + azureStaticWebApps?: AzureStaticWebApps; + + /** + * The map of the name of the alias of each custom Open ID Connect provider to the + * configuration settings of the custom Open ID Connect provider. + */ + #suppress "@azure-tools/typespec-azure-resource-manager/arm-no-record" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + customOpenIdConnectProviders?: Record; +} + +/** + * The configuration settings of the Azure Active directory provider. + */ +model AzureActiveDirectory { + /** + * false if the Azure Active Directory provider should not be enabled despite the set registration; otherwise, true. + */ + enabled?: boolean; + + /** + * The configuration settings of the Azure Active Directory app registration. + */ + registration?: AzureActiveDirectoryRegistration; + + /** + * The configuration settings of the Azure Active Directory login flow. + */ + login?: AzureActiveDirectoryLogin; + + /** + * The configuration settings of the Azure Active Directory token validation flow. + */ + validation?: AzureActiveDirectoryValidation; + + /** + * Gets a value indicating whether the Azure AD configuration was auto-provisioned using 1st party tooling. + * This is an internal flag primarily intended to support the Azure Management Portal. Users should not + * read or write to this property. + */ + isAutoProvisioned?: boolean; +} + +/** + * The configuration settings of the Azure Active Directory app registration. + */ +model AzureActiveDirectoryRegistration { + /** + * The OpenID Connect Issuer URI that represents the entity which issues access tokens for this application. + * When using Azure Active Directory, this value is the URI of the directory tenant, e.g. `https://login.microsoftonline.com/v2.0/{tenant-guid}/`. + * This URI is a case-sensitive identifier for the token issuer. + * More information on OpenID Connect Discovery: http://openid.net/specs/openid-connect-discovery-1_0.html + */ + openIdIssuer?: string; + + /** + * The Client ID of this relying party application, known as the client_id. + * This setting is required for enabling OpenID Connection authentication with Azure Active Directory or + * other 3rd party OpenID Connect providers. + * More information on OpenID Connect: http://openid.net/specs/openid-connect-core-1_0.html + */ + clientId?: string; + + /** + * The app setting name that contains the client secret of the relying party application. + */ + clientSecretSettingName?: string; + + /** + * An alternative to the client secret, that is the thumbprint of a certificate used for signing purposes. This property acts as + * a replacement for the Client Secret. It is also optional. + */ + clientSecretCertificateThumbprint?: string; + + /** + * An alternative to the client secret thumbprint, that is the subject alternative name of a certificate used for signing purposes. This property acts as + * a replacement for the Client Secret Certificate Thumbprint. It is also optional. + */ + clientSecretCertificateSubjectAlternativeName?: string; + + /** + * An alternative to the client secret thumbprint, that is the issuer of a certificate used for signing purposes. This property acts as + * a replacement for the Client Secret Certificate Thumbprint. It is also optional. + */ + clientSecretCertificateIssuer?: string; +} + +/** + * The configuration settings of the Azure Active Directory login flow. + */ +model AzureActiveDirectoryLogin { + /** + * Login parameters to send to the OpenID Connect authorization endpoint when + * a user logs in. Each parameter must be in the form "key=value". + */ + loginParameters?: string[]; + + /** + * true if the www-authenticate provider should be omitted from the request; otherwise, false. + */ + #suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + disableWWWAuthenticate?: boolean; +} + +/** + * The configuration settings of the Azure Active Directory token validation flow. + */ +model AzureActiveDirectoryValidation { + /** + * The configuration settings of the checks that should be made while validating the JWT Claims. + */ + jwtClaimChecks?: JwtClaimChecks; + + /** + * The list of audiences that can make successful authentication/authorization requests. + */ + allowedAudiences?: string[]; + + /** + * The configuration settings of the default authorization policy. + */ + defaultAuthorizationPolicy?: DefaultAuthorizationPolicy; +} + +/** + * The configuration settings of the checks that should be made while validating the JWT Claims. + */ +model JwtClaimChecks { + /** + * The list of the allowed groups. + */ + allowedGroups?: string[]; + + /** + * The list of the allowed client applications. + */ + allowedClientApplications?: string[]; +} + +/** + * The configuration settings of the Azure Active Directory default authorization policy. + */ +model DefaultAuthorizationPolicy { + /** + * The configuration settings of the Azure Active Directory allowed principals. + */ + allowedPrincipals?: AllowedPrincipals; + + /** + * The configuration settings of the Azure Active Directory allowed applications. + */ + allowedApplications?: string[]; +} + +/** + * The configuration settings of the Azure Active Directory allowed principals. + */ +model AllowedPrincipals { + /** + * The list of the allowed groups. + */ + groups?: string[]; + + /** + * The list of the allowed identities. + */ + identities?: string[]; +} + +/** + * The configuration settings of the Facebook provider. + */ +model Facebook { + /** + * false if the Facebook provider should not be enabled despite the set registration; otherwise, true. + */ + enabled?: boolean; + + /** + * The configuration settings of the app registration for the Facebook provider. + */ + registration?: AppRegistration; + + /** + * The version of the Facebook api to be used while logging in. + */ + graphApiVersion?: string; + + /** + * The configuration settings of the login flow. + */ + login?: LoginScopes; +} + +/** + * The configuration settings of the app registration for providers that have app ids and app secrets + */ +model AppRegistration { + /** + * The App ID of the app used for login. + */ + appId?: string; + + /** + * The app setting name that contains the app secret. + */ + appSecretSettingName?: string; +} + +/** + * The configuration settings of the login flow, including the scopes that should be requested. + */ +model LoginScopes { + /** + * A list of the scopes that should be requested while authenticating. + */ + scopes?: string[]; +} + +/** + * The configuration settings of the GitHub provider. + */ +model GitHub { + /** + * false if the GitHub provider should not be enabled despite the set registration; otherwise, true. + */ + enabled?: boolean; + + /** + * The configuration settings of the app registration for the GitHub provider. + */ + registration?: ClientRegistration; + + /** + * The configuration settings of the login flow. + */ + login?: LoginScopes; +} + +/** + * The configuration settings of the app registration for providers that have client ids and client secrets + */ +model ClientRegistration { + /** + * The Client ID of the app used for login. + */ + clientId?: string; + + /** + * The app setting name that contains the client secret. + */ + clientSecretSettingName?: string; +} + +/** + * The configuration settings of the Google provider. + */ +model Google { + /** + * false if the Google provider should not be enabled despite the set registration; otherwise, true. + */ + enabled?: boolean; + + /** + * The configuration settings of the app registration for the Google provider. + */ + registration?: ClientRegistration; + + /** + * The configuration settings of the login flow. + */ + login?: LoginScopes; + + /** + * The configuration settings of the Azure Active Directory token validation flow. + */ + validation?: AllowedAudiencesValidation; +} + +/** + * The configuration settings of the Allowed Audiences validation flow. + */ +model AllowedAudiencesValidation { + /** + * The configuration settings of the allowed list of audiences from which to validate the JWT token. + */ + allowedAudiences?: string[]; +} + +/** + * The configuration settings of the legacy Microsoft Account provider. + */ +model LegacyMicrosoftAccount { + /** + * false if the legacy Microsoft Account provider should not be enabled despite the set registration; otherwise, true. + */ + enabled?: boolean; + + /** + * The configuration settings of the app registration for the legacy Microsoft Account provider. + */ + registration?: ClientRegistration; + + /** + * The configuration settings of the login flow. + */ + login?: LoginScopes; + + /** + * The configuration settings of the legacy Microsoft Account provider token validation flow. + */ + validation?: AllowedAudiencesValidation; +} + +/** + * The configuration settings of the Twitter provider. + */ +model Twitter { + /** + * false if the Twitter provider should not be enabled despite the set registration; otherwise, true. + */ + enabled?: boolean; + + /** + * The configuration settings of the app registration for the Twitter provider. + */ + registration?: TwitterRegistration; +} + +/** + * The configuration settings of the app registration for the Twitter provider. + */ +model TwitterRegistration { + /** + * The OAuth 1.0a consumer key of the Twitter application used for sign-in. + * This setting is required for enabling Twitter Sign-In. + * Twitter Sign-In documentation: https://dev.twitter.com/web/sign-in + */ + #suppress "@azure-tools/typespec-azure-resource-manager/secret-prop" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + consumerKey?: string; + + /** + * The app setting name that contains the OAuth 1.0a consumer secret of the Twitter + * application used for sign-in. + */ + consumerSecretSettingName?: string; +} + +/** + * The configuration settings of the Apple provider. + */ +model Apple { + /** + * false if the Apple provider should not be enabled despite the set registration; otherwise, true. + */ + enabled?: boolean; + + /** + * The configuration settings of the Apple registration. + */ + registration?: AppleRegistration; + + /** + * The configuration settings of the login flow. + */ + login?: LoginScopes; +} + +/** + * The configuration settings of the registration for the Apple provider + */ +model AppleRegistration { + /** + * The Client ID of the app used for login. + */ + clientId?: string; + + /** + * The app setting name that contains the client secret. + */ + clientSecretSettingName?: string; +} + +/** + * The configuration settings of the Azure Static Web Apps provider. + */ +model AzureStaticWebApps { + /** + * false if the Azure Static Web Apps provider should not be enabled despite the set registration; otherwise, true. + */ + enabled?: boolean; + + /** + * The configuration settings of the Azure Static Web Apps registration. + */ + registration?: AzureStaticWebAppsRegistration; +} + +/** + * The configuration settings of the registration for the Azure Static Web Apps provider + */ +model AzureStaticWebAppsRegistration { + /** + * The Client ID of the app used for login. + */ + clientId?: string; +} + +/** + * The configuration settings of the custom Open ID Connect provider. + */ +model CustomOpenIdConnectProvider { + /** + * false if the custom Open ID provider provider should not be enabled; otherwise, true. + */ + enabled?: boolean; + + /** + * The configuration settings of the app registration for the custom Open ID Connect provider. + */ + registration?: OpenIdConnectRegistration; + + /** + * The configuration settings of the login flow of the custom Open ID Connect provider. + */ + login?: OpenIdConnectLogin; +} + +/** + * The configuration settings of the app registration for the custom Open ID Connect provider. + */ +model OpenIdConnectRegistration { + /** + * The client id of the custom Open ID Connect provider. + */ + clientId?: string; + + /** + * The authentication credentials of the custom Open ID Connect provider. + */ + clientCredential?: OpenIdConnectClientCredential; + + /** + * The configuration settings of the endpoints used for the custom Open ID Connect provider. + */ + openIdConnectConfiguration?: OpenIdConnectConfig; +} + +/** + * The authentication client credentials of the custom Open ID Connect provider. + */ +model OpenIdConnectClientCredential { + /** + * The method that should be used to authenticate the user. + */ + method?: "ClientSecretPost"; + + /** + * The app setting that contains the client secret for the custom Open ID Connect provider. + */ + clientSecretSettingName?: string; +} + +/** + * The configuration settings of the endpoints used for the custom Open ID Connect provider. + */ +model OpenIdConnectConfig { + /** + * The endpoint to be used to make an authorization request. + */ + authorizationEndpoint?: string; + + /** + * The endpoint to be used to request a token. + */ + tokenEndpoint?: string; + + /** + * The endpoint that issues the token. + */ + issuer?: string; + + /** + * The endpoint that provides the keys necessary to validate the token. + */ + certificationUri?: string; + + /** + * The endpoint that contains all the configuration endpoints for the provider. + */ + wellKnownOpenIdConfiguration?: string; +} + +/** + * The configuration settings of the login flow of the custom Open ID Connect provider. + */ +model OpenIdConnectLogin { + /** + * The name of the claim that contains the users name. + */ + nameClaimType?: string; + + /** + * A list of the scopes that should be requested while authenticating. + */ + scopes?: string[]; +} + +/** + * The configuration settings of the login flow of users using App Service Authentication/Authorization. + */ +model Login { + /** + * The routes that specify the endpoints used for login and logout requests. + */ + routes?: LoginRoutes; + + /** + * The configuration settings of the token store. + */ + tokenStore?: TokenStore; + + /** + * true if the fragments from the request are preserved after the login request is made; otherwise, false. + */ + preserveUrlFragmentsForLogins?: boolean; + + /** + * External URLs that can be redirected to as part of logging in or logging out of the app. Note that the query string part of the URL is ignored. + * This is an advanced setting typically only needed by Windows Store application backends. + * Note that URLs within the current domain are always implicitly allowed. + */ + allowedExternalRedirectUrls?: string[]; + + /** + * The configuration settings of the session cookie's expiration. + */ + cookieExpiration?: CookieExpiration; + + /** + * The configuration settings of the nonce used in the login flow. + */ + nonce?: Nonce; +} + +/** + * The routes that specify the endpoints used for login and logout requests. + */ +model LoginRoutes { + /** + * The endpoint at which a logout request should be made. + */ + logoutEndpoint?: string; +} + +/** + * The configuration settings of the token store. + */ +model TokenStore { + /** + * true to durably store platform-specific security tokens that are obtained during login flows; otherwise, false. + * The default is false. + */ + enabled?: boolean; + + /** + * The number of hours after session token expiration that a session token can be used to + * call the token refresh API. The default is 72 hours. + */ + tokenRefreshExtensionHours?: float64; + + /** + * The configuration settings of the storage of the tokens if a file system is used. + */ + fileSystem?: FileSystemTokenStore; + + /** + * The configuration settings of the storage of the tokens if blob storage is used. + */ + azureBlobStorage?: BlobStorageTokenStore; +} + +/** + * The configuration settings of the storage of the tokens if a file system is used. + */ +model FileSystemTokenStore { + /** + * The directory in which the tokens will be stored. + */ + directory?: string; +} + +/** + * The configuration settings of the storage of the tokens if blob storage is used. + */ +model BlobStorageTokenStore { + /** + * The name of the app setting containing the SAS URL of the blob storage containing the tokens. + */ + sasUrlSettingName?: string; +} + +/** + * The configuration settings of the session cookie's expiration. + */ +model CookieExpiration { + /** + * The convention used when determining the session cookie's expiration. + */ + convention?: CookieExpirationConvention; + + /** + * The time after the request is made when the session cookie should expire. + */ + timeToExpiration?: string; +} + +/** + * The configuration settings of the nonce used in the login flow. + */ +model Nonce { + /** + * false if the nonce should not be validated while completing the login flow; otherwise, true. + */ + validateNonce?: boolean; + + /** + * The time after the request is made when the nonce should expire. + */ + nonceExpirationInterval?: string; +} + +/** + * The configuration settings of the HTTP requests for authentication and authorization requests made against App Service Authentication/Authorization. + */ +model HttpSettings { + /** + * false if the authentication/authorization responses not having the HTTPS scheme are permissible; otherwise, true. + */ + requireHttps?: boolean; + + /** + * The configuration settings of the paths HTTP requests. + */ + routes?: HttpSettingsRoutes; + + /** + * The configuration settings of a forward proxy used to make the requests. + */ + forwardProxy?: ForwardProxy; +} + +/** + * The configuration settings of the paths HTTP requests. + */ +model HttpSettingsRoutes { + /** + * The prefix that should precede all the authentication/authorization paths. + */ + apiPrefix?: string; +} + +/** + * The configuration settings of a forward proxy used to make the requests. + */ +model ForwardProxy { + /** + * The convention used to determine the url of the request made. + */ + convention?: ForwardProxyConvention; + + /** + * The name of the header containing the host of the request. + */ + customHostHeaderName?: string; + + /** + * The name of the header containing the scheme of the request. + */ + customProtoHeaderName?: string; +} + +/** + * AzureStorageInfo dictionary resource. + */ +#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +model AzureStoragePropertyDictionaryResource extends ProxyOnlyResource { + /** + * Azure storage accounts. + */ + #suppress "@azure-tools/typespec-azure-core/no-private-usage" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + #suppress "@azure-tools/typespec-azure-resource-manager/arm-no-record" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + properties?: Record; +} + +/** + * ApiKVReference resource specific properties + */ +#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-provisioning-state" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +#suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +model ApiKVReferenceProperties { + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + reference?: string; + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + status?: ResolveStatus; + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + vaultName?: string; + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + secretName?: string; + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + secretVersion?: string; + + /** + * Managed service identity. + */ + identityType?: ManagedServiceIdentity; + + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + details?: string; + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + source?: "KeyVault"; + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + activeVersion?: string; +} + +/** + * String dictionary resource. + */ +#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +model ConnectionStringDictionary extends ProxyOnlyResource { + /** + * Connection strings. + */ + #suppress "@azure-tools/typespec-azure-core/no-private-usage" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + #suppress "@azure-tools/typespec-azure-resource-manager/arm-no-record" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + properties?: Record; +} + +/** + * Database connection string value to type pair. + */ +model ConnStringValueTypePair { + /** + * Value of pair. + */ + value: string; + + /** + * Type of database. + */ + type: ConnectionStringType; +} + +/** + * SiteLogsConfig resource specific properties + */ +#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-provisioning-state" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +model SiteLogsConfigProperties { + /** + * Application logs configuration. + */ + applicationLogs?: ApplicationLogsConfig; + + /** + * HTTP logs configuration. + */ + httpLogs?: HttpLogsConfig; + + /** + * Failed requests tracing configuration. + */ + failedRequestsTracing?: EnabledConfig; + + /** + * Detailed error messages configuration. + */ + detailedErrorMessages?: EnabledConfig; +} + +/** + * Application logs configuration. + */ +model ApplicationLogsConfig { + /** + * Application logs to file system configuration. + */ + fileSystem?: FileSystemApplicationLogsConfig; + + /** + * Application logs to azure table storage configuration. + */ + azureTableStorage?: AzureTableStorageApplicationLogsConfig; + + /** + * Application logs to blob storage configuration. + */ + azureBlobStorage?: AzureBlobStorageApplicationLogsConfig; +} + +/** + * Application logs to file system configuration. + */ +model FileSystemApplicationLogsConfig { + /** + * Log level. + */ + level?: LogLevel = LogLevel.Off; +} + +/** + * Application logs to Azure table storage configuration. + */ +model AzureTableStorageApplicationLogsConfig { + /** + * Log level. + */ + level?: LogLevel; + + /** + * SAS URL to an Azure table with add/query/delete permissions. + */ + sasUrl: string; +} + +/** + * Application logs azure blob storage configuration. + */ +model AzureBlobStorageApplicationLogsConfig { + /** + * Log level. + */ + level?: LogLevel; + + /** + * SAS url to a azure blob container with read/write/list/delete permissions. + */ + sasUrl?: string; + + /** + * Retention in days. + * Remove blobs older than X days. + * 0 or lower means no retention. + */ + retentionInDays?: int32; +} + +/** + * Http logs configuration. + */ +model HttpLogsConfig { + /** + * Http logs to file system configuration. + */ + fileSystem?: FileSystemHttpLogsConfig; + + /** + * Http logs to azure blob storage configuration. + */ + azureBlobStorage?: AzureBlobStorageHttpLogsConfig; +} + +/** + * Http logs to file system configuration. + */ +model FileSystemHttpLogsConfig { + /** + * Maximum size in megabytes that http log files can use. + * When reached old log files will be removed to make space for new ones. + * Value can range between 25 and 100. + */ + @maxValue(100) + @minValue(25) + retentionInMb?: int32; + + /** + * Retention in days. + * Remove files older than X days. + * 0 or lower means no retention. + */ + retentionInDays?: int32; + + /** + * True if configuration is enabled, false if it is disabled and null if configuration is not set. + */ + enabled?: boolean; +} + +/** + * Http logs to azure blob storage configuration. + */ +model AzureBlobStorageHttpLogsConfig { + /** + * SAS url to a azure blob container with read/write/list/delete permissions. + */ + sasUrl?: string; + + /** + * Retention in days. + * Remove blobs older than X days. + * 0 or lower means no retention. + */ + retentionInDays?: int32; + + /** + * True if configuration is enabled, false if it is disabled and null if configuration is not set. + */ + enabled?: boolean; +} + +/** + * Enabled configuration. + */ +model EnabledConfig { + /** + * True if configuration is enabled, false if it is disabled and null if configuration is not set. + */ + enabled?: boolean; +} + +/** + * Names for connection strings, application settings, and external Azure storage account configuration + * identifiers to be marked as sticky to the deployment slot and not moved during a swap operation. + * This is valid for all deployment slots in an app. + */ +#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-provisioning-state" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +model SlotConfigNames { + /** + * List of connection string names. + */ + connectionStringNames?: string[]; + + /** + * List of application settings names. + */ + appSettingNames?: string[]; + + /** + * List of external Azure storage account identifiers. + */ + azureStorageConfigNames?: string[]; +} + +/** + * Collection of metadata for the app configuration snapshots that can be restored. + */ +model SiteConfigurationSnapshotInfoCollection + is Azure.Core.Page; + +/** + * A snapshot of a web app configuration. + */ +#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +model SiteConfigurationSnapshotInfo extends ProxyOnlyResource { + /** + * SiteConfigurationSnapshotInfo resource specific properties + */ + #suppress "@azure-tools/typespec-azure-core/no-private-usage" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + properties?: SiteConfigurationSnapshotInfoProperties; +} + +/** + * SiteConfigurationSnapshotInfo resource specific properties + */ +model SiteConfigurationSnapshotInfoProperties { + /** + * The time the snapshot was taken. + */ + @visibility(Lifecycle.Read) + // FIXME: (utcDateTime) Please double check that this is the correct type for your scenario. + time?: utcDateTime; + + /** + * The id of the snapshot + */ + @visibility(Lifecycle.Read) + snapshotId?: int32; +} + +/** + * ContinuousWebJob resource specific properties + */ +#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-provisioning-state" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +model ContinuousWebJobProperties { + /** + * Job status. + */ + status?: ContinuousWebJobStatus; + + /** + * Detailed status. + */ + #suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + detailed_status?: string; + + /** + * Log URL. + */ + #suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + log_url?: string; + + /** + * Run command. + */ + #suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + run_command?: string; + + /** + * Job URL. + */ + url?: string; + + /** + * Extra Info URL. + */ + #suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + extra_info_url?: string; + + /** + * Job type. + */ + #suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + web_job_type?: WebJobType; + + /** + * Error information. + */ + error?: string; + + /** + * Using SDK? + */ + #suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + using_sdk?: boolean; + + /** + * Job settings. + */ + #suppress "@azure-tools/typespec-azure-resource-manager/arm-no-record" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + settings?: Record; +} + +/** + * CsmDeploymentStatus resource specific properties + */ +#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-provisioning-state" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +model CsmDeploymentStatusProperties { + /** + * Deployment operation id. + */ + deploymentId?: string; + + /** + * Deployment build status. + */ + status?: DeploymentBuildStatus; + + /** + * Number of site instances currently being provisioned. + */ + numberOfInstancesInProgress?: int32; + + /** + * Number of site instances provisioned successfully. + */ + numberOfInstancesSuccessful?: int32; + + /** + * Number of site instances failed to provision. + */ + numberOfInstancesFailed?: int32; + + /** + * List of URLs pointing to logs for instances which failed to provision. + */ + failedInstancesLogs?: string[]; + + /** + * List of errors. + */ + @identifiers(#[]) + errors?: ErrorEntity[]; +} + +/** + * Deployment resource specific properties + */ +#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-provisioning-state" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +model DeploymentProperties { + /** + * Deployment status. + */ + status?: int32; + + /** + * Details about deployment status. + */ + message?: string; + + /** + * Who authored the deployment. + */ + author?: string; + + /** + * Who performed the deployment. + */ + deployer?: string; + + /** + * Author email. + */ + #suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + author_email?: string; + + /** + * Start time. + */ + // FIXME: (utcDateTime) Please double check that this is the correct type for your scenario. + #suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + start_time?: utcDateTime; + + /** + * End time. + */ + // FIXME: (utcDateTime) Please double check that this is the correct type for your scenario. + #suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + end_time?: utcDateTime; + + /** + * True if deployment is currently active, false if completed and null if not started. + */ + active?: boolean; + + /** + * Details on deployment. + */ + details?: string; +} + +/** + * MSDeployStatus resource specific properties + */ +#suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +model MSDeployStatusProperties { + /** + * Username of deployer + */ + @visibility(Lifecycle.Read) + deployer?: string; + + /** + * Provisioning state + */ + @visibility(Lifecycle.Read) + provisioningState?: MSDeployProvisioningState; + + /** + * Start time of deploy operation + */ + @visibility(Lifecycle.Read) + // FIXME: (utcDateTime) Please double check that this is the correct type for your scenario. + startTime?: utcDateTime; + + /** + * End time of deploy operation + */ + @visibility(Lifecycle.Read) + // FIXME: (utcDateTime) Please double check that this is the correct type for your scenario. + endTime?: utcDateTime; + + /** + * Whether the deployment operation has completed + */ + @visibility(Lifecycle.Read) + complete?: boolean; +} + +/** + * MSDeploy ARM PUT information + */ +#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +#suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +model MSDeploy extends ProxyOnlyResource { + /** Core resource properties */ + properties?: MSDeployCore; +} + +/** + * MSDeploy ARM PUT core information + */ +#suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +model MSDeployCore { + /** + * Package URI + */ + packageUri?: string; + + /** + * SQL Connection String + */ + connectionString?: string; + + /** + * Database Type + */ + dbType?: string; + + /** + * URI of MSDeploy Parameters file. Must not be set if SetParameters is used. + */ + setParametersXmlFileUri?: string; + + /** + * MSDeploy Parameters. Must not be set if SetParametersXmlFileUri is used. + */ + #suppress "@azure-tools/typespec-azure-resource-manager/arm-no-record" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + setParameters?: Record; + + /** + * Controls whether the MSDeploy operation skips the App_Data directory. + * If set to true, the existing App_Data directory on the destination + * will not be deleted, and any App_Data directory in the source will be ignored. + * Setting is false by default. + */ + skipAppData?: boolean; + + /** + * Sets the AppOffline rule while the MSDeploy operation executes. + * Setting is false by default. + */ + appOffline?: boolean; +} + +/** + * MSDeploy log + */ +#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +#suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +model MSDeployLog extends ProxyOnlyResource { + /** + * MSDeployLog resource specific properties + */ + #suppress "@azure-tools/typespec-azure-core/no-private-usage" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + properties?: MSDeployLogProperties; +} + +/** + * MSDeployLog resource specific properties + */ +#suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +model MSDeployLogProperties { + /** + * List of log entry messages + */ + @visibility(Lifecycle.Read) + @identifiers(#[]) + entries?: MSDeployLogEntry[]; +} + +/** + * MSDeploy log entry + */ +#suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +model MSDeployLogEntry { + /** + * Timestamp of log entry + */ + @visibility(Lifecycle.Read) + // FIXME: (utcDateTime) Please double check that this is the correct type for your scenario. + time?: utcDateTime; + + /** + * Log entry type + */ + @visibility(Lifecycle.Read) + type?: MSDeployLogEntryType; + + /** + * Log entry message + */ + @visibility(Lifecycle.Read) + message?: string; +} + +/** + * FunctionEnvelope resource specific properties + */ +#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-provisioning-state" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +model FunctionEnvelopeProperties { + /** + * Function App ID. + */ + #suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + function_app_id?: string; + + /** + * Script root path URI. + */ + #suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + script_root_path_href?: string; + + /** + * Script URI. + */ + #suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + script_href?: string; + + /** + * Config URI. + */ + #suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + config_href?: string; + + /** + * Test data URI. + */ + #suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + test_data_href?: string; + + /** + * Secrets file URI. + */ + #suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + secrets_file_href?: string; + + /** + * Function URI. + */ + href?: string; + + /** + * Config information. + */ + #suppress "@azure-tools/typespec-azure-core/no-unknown" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + config?: unknown; + + /** + * File list. + */ + #suppress "@azure-tools/typespec-azure-resource-manager/arm-no-record" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + files?: Record; + + /** + * Test data used when testing via the Azure Portal. + */ + #suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + test_data?: string; + + /** + * The invocation URL + */ + #suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + invoke_url_template?: string; + + /** + * The function language + */ + language?: string; + + /** + * Gets or sets a value indicating whether the function is disabled + */ + isDisabled?: boolean; +} + +/** + * Function key info. + */ +model KeyInfo { + /** + * Key name + */ + name?: string; + + /** + * Key value + */ + value?: string; +} + +/** + * Function secrets. + */ +model FunctionSecrets { + /** + * Secret key. + */ + #suppress "@azure-tools/typespec-azure-resource-manager/secret-prop" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + key?: string; + + /** + * Trigger URL. + */ + #suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + trigger_url?: string; +} + +/** + * Functions host level keys. + */ +model HostKeys { + /** + * Secret key. + */ + #suppress "@azure-tools/typespec-azure-resource-manager/secret-prop" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + masterKey?: string; + + /** + * Host level function keys. + */ + #suppress "@azure-tools/typespec-azure-resource-manager/arm-no-record" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + functionKeys?: Record; + + /** + * System keys. + */ + #suppress "@azure-tools/typespec-azure-resource-manager/arm-no-record" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + systemKeys?: Record; +} + +/** + * HostNameBinding resource specific properties + */ +#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-provisioning-state" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +model HostNameBindingProperties { + /** + * App Service app name. + */ + @visibility(Lifecycle.Read, Lifecycle.Create) + siteName?: string; + + /** + * Fully qualified ARM domain resource URI. + */ + @visibility(Lifecycle.Read, Lifecycle.Create) + domainId?: string; + + /** + * Azure resource name. + */ + @visibility(Lifecycle.Read, Lifecycle.Create) + azureResourceName?: string; + + /** + * Azure resource type. + */ + @visibility(Lifecycle.Read, Lifecycle.Create) + azureResourceType?: AzureResourceType; + + /** + * Custom DNS record type. + */ + @visibility(Lifecycle.Read, Lifecycle.Create) + customHostNameDnsRecordType?: CustomHostNameDnsRecordType; + + /** + * Hostname type. + */ + @visibility(Lifecycle.Read, Lifecycle.Create) + hostNameType?: HostNameType; + + /** + * SSL type + */ + @visibility(Lifecycle.Read, Lifecycle.Create) + sslState?: SslState; + + /** + * SSL certificate thumbprint + */ + @visibility(Lifecycle.Read, Lifecycle.Create) + thumbprint?: string; + + /** + * Virtual IP address assigned to the hostname if IP based SSL is enabled. + */ + #suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + @visibility(Lifecycle.Read) + virtualIP?: string; +} + +/** + * RelayServiceConnectionEntity resource specific properties + */ +#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-provisioning-state" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +model RelayServiceConnectionEntityProperties { + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + entityName?: string; + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + entityConnectionString?: string; + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + resourceType?: string; + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + resourceConnectionString?: string; + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + hostname?: string; + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + port?: int32; + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + biztalkUri?: string; +} + +/** + * WebSiteInstanceStatus resource specific properties + */ +#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-provisioning-state" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +model WebSiteInstanceStatusProperties { + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + state?: SiteRuntimeState; + + /** + * Link to the GetStatusApi in Kudu + */ + statusUrl?: string; + + /** + * Link to the Diagnose and Solve Portal + */ + detectorUrl?: string; + + /** + * Link to the console to web app instance + */ + consoleUrl?: string; + + /** + * Link to the console to web app instance + */ + healthCheckUrl?: string; + + /** + * Dictionary of + */ + #suppress "@azure-tools/typespec-azure-resource-manager/arm-no-record" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + containers?: Record; + + /** + * The physical zone that the instance is in + */ + physicalZone?: string; +} + +#suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +model ContainerInfo { + // FIXME: (utcDateTime) Please double check that this is the correct type for your scenario. + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + currentTimeStamp?: utcDateTime; + + // FIXME: (utcDateTime) Please double check that this is the correct type for your scenario. + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + previousTimeStamp?: utcDateTime; + + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + currentCpuStats?: ContainerCpuStatistics; + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + previousCpuStats?: ContainerCpuStatistics; + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + memoryStats?: ContainerMemoryStatistics; + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + name?: string; + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + id?: string; + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + eth0?: ContainerNetworkInterfaceStatistics; +} + +#suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +model ContainerCpuStatistics { + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + cpuUsage?: ContainerCpuUsage; + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + systemCpuUsage?: int64; + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + onlineCpuCount?: int32; + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + throttlingData?: ContainerThrottlingData; +} + +#suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +model ContainerCpuUsage { + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + totalUsage?: int64; + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + perCpuUsage?: int64[]; + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + kernelModeUsage?: int64; + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + userModeUsage?: int64; +} + +#suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +model ContainerThrottlingData { + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + periods?: int32; + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + throttledPeriods?: int32; + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + throttledTime?: int32; +} + +#suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +model ContainerMemoryStatistics { + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + usage?: int64; + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + maxUsage?: int64; + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + limit?: int64; +} + +#suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +model ContainerNetworkInterfaceStatistics { + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + rxBytes?: int64; + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + rxPackets?: int64; + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + rxErrors?: int64; + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + rxDropped?: int64; + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + txBytes?: int64; + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + txPackets?: int64; + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + txErrors?: int64; + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + txDropped?: int64; +} + +/** + * ProcessInfo resource specific properties + */ +#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-provisioning-state" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +model ProcessInfoProperties { + /** + * ARM Identifier for deployment. + */ + @visibility(Lifecycle.Read) + identifier?: int32; + + /** + * Deployment name. + */ + #suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + deployment_name?: string; + + /** + * HRef URI. + */ + href?: string; + + /** + * Minidump URI. + */ + minidump?: string; + + /** + * Is profile running? + */ + #suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + is_profile_running?: boolean; + + /** + * Is the IIS Profile running? + */ + #suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + is_iis_profile_running?: boolean; + + /** + * IIS Profile timeout (seconds). + */ + #suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + iis_profile_timeout_in_seconds?: float64; + + /** + * Parent process. + */ + parent?: string; + + /** + * Child process list. + */ + children?: string[]; + + /** + * Thread list. + */ + threads?: ProcessThreadInfo[]; + + /** + * List of open files. + */ + #suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + open_file_handles?: string[]; + + /** + * File name of this process. + */ + #suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + file_name?: string; + + /** + * Command line. + */ + #suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + command_line?: string; + + /** + * User name. + */ + #suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + user_name?: string; + + /** + * Handle count. + */ + #suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + handle_count?: int32; + + /** + * Module count. + */ + #suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + module_count?: int32; + + /** + * Thread count. + */ + #suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + thread_count?: int32; + + /** + * Start time. + */ + // FIXME: (utcDateTime) Please double check that this is the correct type for your scenario. + #suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + start_time?: utcDateTime; + + /** + * Total CPU time. + */ + #suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + total_cpu_time?: string; + + /** + * User CPU time. + */ + #suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + user_cpu_time?: string; + + /** + * Privileged CPU time. + */ + #suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + privileged_cpu_time?: string; + + /** + * Working set. + */ + #suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + working_set?: int64; + + /** + * Peak working set. + */ + #suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + peak_working_set?: int64; + + /** + * Private memory size. + */ + #suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + private_memory?: int64; + + /** + * Virtual memory size. + */ + #suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + virtual_memory?: int64; + + /** + * Peak virtual memory usage. + */ + #suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + peak_virtual_memory?: int64; + + /** + * Paged system memory. + */ + #suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + paged_system_memory?: int64; + + /** + * Non-paged system memory. + */ + #suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + non_paged_system_memory?: int64; + + /** + * Paged memory. + */ + #suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + paged_memory?: int64; + + /** + * Peak paged memory. + */ + #suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + peak_paged_memory?: int64; + + /** + * Time stamp. + */ + // FIXME: (utcDateTime) Please double check that this is the correct type for your scenario. + #suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + time_stamp?: utcDateTime; + + /** + * List of environment variables. + */ + #suppress "@azure-tools/typespec-azure-resource-manager/arm-no-record" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + #suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + environment_variables?: Record; + + /** + * Is this the SCM site? + */ + #suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + is_scm_site?: boolean; + + /** + * Is this a Web Job? + */ + #suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + is_webjob?: boolean; + + /** + * Description of process. + */ + description?: string; +} + +/** + * Process Thread Information. + */ +#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +model ProcessThreadInfo extends ProxyOnlyResource { + /** + * ProcessThreadInfo resource specific properties + */ + #suppress "@azure-tools/typespec-azure-core/no-private-usage" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + properties?: ProcessThreadInfoProperties; +} + +/** + * ProcessThreadInfo resource specific properties + */ +model ProcessThreadInfoProperties { + /** + * Site extension ID. + */ + @visibility(Lifecycle.Read) + identifier?: int32; + + /** + * HRef URI. + */ + href?: string; + + /** + * Process URI. + */ + process?: string; + + /** + * Start address. + */ + #suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + start_address?: string; + + /** + * Current thread priority. + */ + #suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + current_priority?: int32; + + /** + * Thread priority level. + */ + #suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + priority_level?: string; + + /** + * Base priority. + */ + #suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + base_priority?: int32; + + /** + * Start time. + */ + // FIXME: (utcDateTime) Please double check that this is the correct type for your scenario. + #suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + start_time?: utcDateTime; + + /** + * Total processor time. + */ + #suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + total_processor_time?: string; + + /** + * User processor time. + */ + #suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + user_processor_time?: string; + + /** + * Thread state. + */ + state?: string; + + /** + * Wait reason. + */ + #suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + wait_reason?: string; +} + +/** + * ProcessModuleInfo resource specific properties + */ +#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-provisioning-state" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +model ProcessModuleInfoProperties { + /** + * Base address. Used as module identifier in ARM resource URI. + */ + #suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + base_address?: string; + + /** + * File name. + */ + #suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + file_name?: string; + + /** + * HRef URI. + */ + href?: string; + + /** + * File path. + */ + #suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + file_path?: string; + + /** + * Module memory size. + */ + #suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + module_memory_size?: int32; + + /** + * File version. + */ + #suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + file_version?: string; + + /** + * File description. + */ + #suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + file_description?: string; + + /** + * Product name. + */ + product?: string; + + /** + * Product version. + */ + #suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + product_version?: string; + + /** + * Is debug? + */ + #suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + is_debug?: boolean; + + /** + * Module language (locale). + */ + language?: string; +} + +/** + * Collection of Kudu thread information elements. + */ +model ProcessThreadInfoCollection is Azure.Core.Page; + +/** + * Represents whether or not an app is cloneable. + */ +model SiteCloneability { + /** + * Name of app. + */ + result?: CloneAbilityResult; + + /** + * List of features enabled on app that prevent cloning. + */ + @identifiers(#["name"]) + blockingFeatures?: SiteCloneabilityCriterion[]; + + /** + * List of features enabled on app that are non-blocking but cannot be cloned. The app can still be cloned + * but the features in this list will not be set up on cloned app. + */ + @identifiers(#["name"]) + unsupportedFeatures?: SiteCloneabilityCriterion[]; + + /** + * List of blocking application characteristics. + */ + @identifiers(#["name"]) + blockingCharacteristics?: SiteCloneabilityCriterion[]; +} + +/** + * An app cloneability criterion. + */ +model SiteCloneabilityCriterion { + /** + * Name of criterion. + */ + name?: string; + + /** + * Description of criterion. + */ + description?: string; +} + +/** + * Options for app content migration. + */ +#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +model StorageMigrationOptions extends ProxyOnlyResource { + /** + * StorageMigrationOptions resource specific properties + */ + #suppress "@azure-tools/typespec-azure-core/no-private-usage" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + properties?: StorageMigrationOptionsProperties; +} + +/** + * StorageMigrationOptions resource specific properties + */ +model StorageMigrationOptionsProperties { + /** + * AzureFiles connection string. + */ + @visibility(Lifecycle.Create) + azurefilesConnectionString: string; + + /** + * AzureFiles share. + */ + @visibility(Lifecycle.Create) + azurefilesShare: string; + + /** + * trueif the app should be switched over; otherwise, false. + */ + @visibility(Lifecycle.Create) + switchSiteAfterMigration?: boolean = false; + + /** + * true if the app should be read only during copy operation; otherwise, false. + */ + @visibility(Lifecycle.Create) + blockWriteAccessToSite?: boolean = false; +} + +/** + * Response for a migration of app content request. + */ +#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +model StorageMigrationResponse extends ProxyOnlyResource { + /** + * StorageMigrationResponse resource specific properties + */ + #suppress "@azure-tools/typespec-azure-core/no-private-usage" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + properties?: StorageMigrationResponseProperties; +} + +/** + * StorageMigrationResponse resource specific properties + */ +model StorageMigrationResponseProperties { + /** + * When server starts the migration process, it will return an operation ID identifying that particular migration operation. + */ + @visibility(Lifecycle.Read) + operationId?: string; +} + +/** + * MySQL migration request. + */ +#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +model MigrateMySqlRequest extends ProxyOnlyResource { + /** + * MigrateMySqlRequest resource specific properties + */ + #suppress "@azure-tools/typespec-azure-core/no-private-usage" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + properties?: MigrateMySqlRequestProperties; +} + +/** + * MigrateMySqlRequest resource specific properties + */ +model MigrateMySqlRequestProperties { + /** + * Connection string to the remote MySQL database. + */ + connectionString: string; + + /** + * The type of migration operation to be done + */ + migrationType: MySqlMigrationType; +} + +/** + * MigrateMySqlStatus resource specific properties + */ +#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-provisioning-state" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +model MigrateMySqlStatusProperties { + /** + * Status of the migration task. + */ + @visibility(Lifecycle.Read) + migrationOperationStatus?: OperationStatus; + + /** + * Operation ID for the migration task. + */ + @visibility(Lifecycle.Read) + operationId?: string; + + /** + * True if the web app has in app MySql enabled + */ + @visibility(Lifecycle.Read) + localMySqlEnabled?: boolean; +} + +/** + * SwiftVirtualNetwork resource specific properties + */ +#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-provisioning-state" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +model SwiftVirtualNetworkProperties { + /** + * The Virtual Network subnet's resource ID. This is the subnet that this Web App will join. This subnet must have a delegation to Microsoft.Web/serverFarms defined first. + */ + subnetResourceId?: string; + + /** + * A flag that specifies if the scale unit this Web App is on supports Swift integration. + */ + swiftSupported?: boolean; +} + +/** + * NetworkFeatures resource specific properties + */ +#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-provisioning-state" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +model NetworkFeaturesProperties { + /** + * The Virtual Network name. + */ + @visibility(Lifecycle.Read) + virtualNetworkName?: string; + + /** + * The Virtual Network summary view. + */ + @visibility(Lifecycle.Read) + virtualNetworkConnection?: VnetInfo; +} + +/** + * Network trace + */ +model NetworkTrace { + /** + * Local file path for the captured network trace file. + */ + path?: string; + + /** + * Current status of the network trace operation, same as Operation.Status (InProgress/Succeeded/Failed). + */ + status?: string; + + /** + * Detailed message of a network trace operation, e.g. error message in case of failure. + */ + message?: string; +} + +/** + * Collection of performance monitor counters. + */ +model PerfMonCounterCollection is Azure.Core.Page; + +/** + * Performance monitor API response. + */ +model PerfMonResponse { + /** + * The response code. + */ + code?: string; + + /** + * The message. + */ + message?: string; + + /** + * The performance monitor counters. + */ + data?: PerfMonSet; +} + +/** + * Metric information. + */ +model PerfMonSet { + /** + * Unique key name of the counter. + */ + name?: string; + + /** + * Start time of the period. + */ + // FIXME: (utcDateTime) Please double check that this is the correct type for your scenario. + startTime?: utcDateTime; + + /** + * End time of the period. + */ + // FIXME: (utcDateTime) Please double check that this is the correct type for your scenario. + endTime?: utcDateTime; + + /** + * Presented time grain. + */ + timeGrain?: string; + + /** + * Collection of workers that are active during this time. + */ + @identifiers(#[]) + values?: PerfMonSample[]; +} + +/** + * Performance monitor sample in a set. + */ +model PerfMonSample { + /** + * Point in time for which counter was measured. + */ + // FIXME: (utcDateTime) Please double check that this is the correct type for your scenario. + time?: utcDateTime; + + /** + * Name of the server on which the measurement is made. + */ + instanceName?: string; + + /** + * Value of counter at a certain time. + */ + value?: float64; +} + +/** + * Used for getting PHP error logging flag. + */ +#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +model SitePhpErrorLogFlag extends ProxyOnlyResource { + /** + * SitePhpErrorLogFlag resource specific properties + */ + #suppress "@azure-tools/typespec-azure-core/no-private-usage" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + properties?: SitePhpErrorLogFlagProperties; +} + +/** + * SitePhpErrorLogFlag resource specific properties + */ +model SitePhpErrorLogFlagProperties { + /** + * Local log_errors setting. + */ + localLogErrors?: string; + + /** + * Master log_errors setting. + */ + masterLogErrors?: string; + + /** + * Local log_errors_max_len setting. + */ + localLogErrorsMaxLength?: string; + + /** + * Master log_errors_max_len setting. + */ + masterLogErrorsMaxLength?: string; +} + +/** + * PremierAddOn resource specific properties + */ +#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-provisioning-state" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +model PremierAddOnProperties { + /** + * Premier add on SKU. + */ + sku?: string; + + /** + * Premier add on Product. + */ + product?: string; + + /** + * Premier add on Vendor. + */ + vendor?: string; + + /** + * Premier add on Marketplace publisher. + */ + marketplacePublisher?: string; + + /** + * Premier add on Marketplace offer. + */ + marketplaceOffer?: string; +} + +/** + * ARM resource for a PremierAddOn. + */ +#suppress "@azure-tools/typespec-azure-resource-manager/patch-envelope" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +model PremierAddOnPatchResource extends ProxyOnlyResource { + /** + * PremierAddOnPatchResource resource specific properties + */ + #suppress "@azure-tools/typespec-azure-core/no-private-usage" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + properties?: PremierAddOnPatchResourceProperties; +} + +/** + * PremierAddOnPatchResource resource specific properties + */ +model PremierAddOnPatchResourceProperties { + /** + * Premier add on SKU. + */ + sku?: string; + + /** + * Premier add on Product. + */ + product?: string; + + /** + * Premier add on Vendor. + */ + vendor?: string; + + /** + * Premier add on Marketplace publisher. + */ + marketplacePublisher?: string; + + /** + * Premier add on Marketplace offer. + */ + marketplaceOffer?: string; +} + +/** + * PrivateAccess resource specific properties + */ +#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-provisioning-state" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +model PrivateAccessProperties { + /** + * Whether private access is enabled or not. + */ + enabled?: boolean; + + /** + * The Virtual Networks (and subnets) allowed to access the site privately. + */ + @identifiers(#["key"]) + virtualNetworks?: PrivateAccessVirtualNetwork[]; +} + +/** + * Description of a Virtual Network that is useable for private site access. + */ +model PrivateAccessVirtualNetwork { + /** + * The name of the Virtual Network. + */ + name?: string; + + /** + * The key (ID) of the Virtual Network. + */ + key?: int32; + + /** + * The ARM uri of the Virtual Network + */ + resourceId?: string; + + /** + * A List of subnets that access is allowed to on this Virtual Network. An empty array (but not null) is interpreted to mean that all subnets are allowed within this Virtual Network. + */ + @identifiers(#["key"]) + subnets?: PrivateAccessSubnet[]; +} + +/** + * Description of a Virtual Network subnet that is useable for private site access. + */ +model PrivateAccessSubnet { + /** + * The name of the subnet. + */ + name?: string; + + /** + * The key (ID) of the subnet. + */ + key?: int32; +} + +/** + * PublicCertificate resource specific properties + */ +#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-provisioning-state" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +model PublicCertificateProperties { + /** + * Public Certificate byte array + */ + blob?: bytes; + + /** + * Public Certificate Location + */ + publicCertificateLocation?: PublicCertificateLocation; + + /** + * Certificate Thumbprint + */ + @visibility(Lifecycle.Read) + thumbprint?: string; +} + +/** + * Publishing options for requested profile. + */ +model CsmPublishingProfileOptions { + /** + * Name of the format. Valid values are: + * FileZilla3 + * WebDeploy -- default + * Ftp + */ + format?: PublishingProfileFormat; + + /** + * Include the DisasterRecover endpoint if true + */ + includeDisasterRecoveryEndpoints?: boolean; +} + +/** + * Details about restoring a deleted app. + */ +#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +model DeletedAppRestoreRequest extends ProxyOnlyResource { + /** + * DeletedAppRestoreRequest resource specific properties + */ + #suppress "@azure-tools/typespec-azure-core/no-private-usage" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + properties?: DeletedAppRestoreRequestProperties; +} + +/** + * DeletedAppRestoreRequest resource specific properties + */ +model DeletedAppRestoreRequestProperties { + /** + * ARM resource ID of the deleted app. Example: + * /subscriptions/{subId}/providers/Microsoft.Web/deletedSites/{deletedSiteId} + */ + deletedSiteId?: string; + + /** + * If true, deleted site configuration, in addition to content, will be restored. + */ + recoverConfiguration?: boolean; + + /** + * Point in time to restore the deleted app from, formatted as a DateTime string. + * If unspecified, default value is the time that the app was deleted. + */ + snapshotTime?: string; + + /** + * If true, the snapshot is retrieved from DRSecondary endpoint. + */ + #suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + useDRSecondary?: boolean; +} + +/** + * Details about app recovery operation. + */ +#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +model SnapshotRestoreRequest extends ProxyOnlyResource { + /** + * SnapshotRestoreRequest resource specific properties + */ + #suppress "@azure-tools/typespec-azure-core/no-private-usage" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + properties?: SnapshotRestoreRequestProperties; +} + +/** + * SnapshotRestoreRequest resource specific properties + */ +model SnapshotRestoreRequestProperties { + /** + * Point in time in which the app restore should be done, formatted as a DateTime string. + */ + snapshotTime?: string; + + /** + * Optional. Specifies the web app that snapshot contents will be retrieved from. + * If empty, the targeted web app will be used as the source. + */ + recoverySource?: SnapshotRecoverySource; + + /** + * If true the restore operation can overwrite source app; otherwise, false. + */ + overwrite: boolean; + + /** + * If true, site configuration, in addition to content, will be reverted. + */ + recoverConfiguration?: boolean; + + /** + * If true, custom hostname conflicts will be ignored when recovering to a target web app. + * This setting is only necessary when RecoverConfiguration is enabled. + */ + ignoreConflictingHostNames?: boolean; + + /** + * If true, the snapshot is retrieved from DRSecondary endpoint. + */ + #suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + useDRSecondary?: boolean; +} + +/** + * Specifies the web app that snapshot contents will be retrieved from. + */ +model SnapshotRecoverySource { + /** + * Geographical location of the source web app, e.g. SouthEastAsia, SouthCentralUS + */ + location?: string; + + /** + * ARM resource ID of the source app. + * /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName} for production slots and + * /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/slots/{slotName} for other slots. + */ + id?: string; +} + +/** + * SiteContainer resource specific properties + */ +#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-provisioning-state" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +model SiteContainerProperties { + /** + * Image Name + */ + image: string; + + /** + * Target Port + */ + targetPort?: string; + + /** + * true if the container is the main site container; false otherwise. + */ + isMain: boolean; + + /** + * StartUp Command + */ + startUpCommand?: string; + + /** + * Auth Type + */ + authType?: AuthType; + + /** + * User Name + */ + userName?: string; + + /** + * Password Secret + */ + #suppress "@azure-tools/typespec-azure-resource-manager/secret-prop" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + passwordSecret?: string; + + /** + * UserManagedIdentity ClientId + */ + userManagedIdentityClientId?: string; + + /** + * Created Time + */ + @visibility(Lifecycle.Read) + // FIXME: (utcDateTime) Please double check that this is the correct type for your scenario. + createdTime?: utcDateTime; + + /** + * Last Modified Time + */ + @visibility(Lifecycle.Read) + // FIXME: (utcDateTime) Please double check that this is the correct type for your scenario. + lastModifiedTime?: utcDateTime; + + /** + * List of volume mounts + */ + @identifiers(#[]) + volumeMounts?: VolumeMount[]; + + /** + * true if all AppSettings and ConnectionStrings have to be passed to the container as environment variables; false otherwise. + */ + inheritAppSettingsAndConnectionStrings?: boolean; + + /** + * List of environment variables + */ + environmentVariables?: EnvironmentVariable[]; +} + +#suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +model VolumeMount { + /** + * Sub path in the volume where volume is mounted from. + */ + volumeSubPath: string; + + /** + * Target path on the container where volume is mounted on + */ + containerMountPath: string; + + /** + * Config Data to be mounted on the volume + */ + data?: string; + + /** + * Boolean to specify if the mount is read only on the container + */ + readOnly?: boolean; +} + +#suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +model EnvironmentVariable { + /** + * Environment variable name + */ + name: string; + + /** + * The value of this environment variable must be the name of an AppSetting. The actual value of the environment variable in container will be retrieved from the specified AppSetting at runtime. If the AppSetting is not found, the value will be set to an empty string in the container at runtime. + */ + value: string; +} +/** + * Collection of App Service apps. + */ +model Site { + properties: Microsoft.Web.SiteProperties; + name: string; + identity: Microsoft.Web.ManagedServiceIdentity; + extendedLocation: Microsoft.Web.ExtendedLocation; + kind: string; + tags: Record; + location: Azure.Core.azureLocation; + id: Azure.Core.armResourceIdentifier; + type: Azure.Core.armResourceType; + systemData: Azure.ResourceManager.CommonTypes.SystemData; +} + +model WebAppCollection is Azure.Core.Page; + +/** + * SiteExtensionInfo resource specific properties + */ +model SiteExtensionInfoProperties { + /** + * Site extension ID. + */ + #suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + extension_id?: string; + + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + title?: string; + + /** + * Site extension type. + */ + #suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + extension_type?: SiteExtensionType; + + /** + * Summary description. + */ + summary?: string; + + /** + * Detailed description. + */ + description?: string; + + /** + * Version information. + */ + version?: string; + + /** + * Extension URL. + */ + #suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + extension_url?: string; + + /** + * Project URL. + */ + #suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + project_url?: string; + + /** + * Icon URL. + */ + #suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + icon_url?: string; + + /** + * License URL. + */ + #suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + license_url?: string; + + /** + * Feed URL. + */ + #suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + feed_url?: string; + + /** + * List of authors. + */ + authors?: string[]; + + /** + * Installer command line parameters. + */ + #suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + installer_command_line_params?: string; + + /** + * Published timestamp. + */ + // FIXME: (utcDateTime) Please double check that this is the correct type for your scenario. + #suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + published_date_time?: utcDateTime; + + /** + * Count of downloads. + */ + #suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + download_count?: int32; + + /** + * true if the local version is the latest version; false otherwise. + */ + #suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + local_is_latest_version?: boolean; + + /** + * Local path. + */ + #suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + local_path?: string; + + /** + * Installed timestamp. + */ + // FIXME: (utcDateTime) Please double check that this is the correct type for your scenario. + #suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + installed_date_time?: utcDateTime; + + /** + * Provisioning state. + */ + #suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-provisioning-state" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + provisioningState?: string; + + /** + * Site Extension comment. + */ + comment?: string; +} + +/** + * Collection of slot differences. + */ +model SlotDifferenceCollection is Azure.Core.Page; + +/** + * A setting difference between two deployment slots of an app. + */ +#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +model SlotDifference extends ProxyOnlyResource { + /** + * SlotDifference resource specific properties + */ + #suppress "@azure-tools/typespec-azure-core/no-private-usage" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + properties?: SlotDifferenceProperties; +} + +/** + * SlotDifference resource specific properties + */ +model SlotDifferenceProperties { + /** + * Level of the difference: Information, Warning or Error. + */ + @visibility(Lifecycle.Read) + level?: string; + + /** + * The type of the setting: General, AppSetting or ConnectionString. + */ + @visibility(Lifecycle.Read) + settingType?: string; + + /** + * Rule that describes how to process the setting difference during a slot swap. + */ + @visibility(Lifecycle.Read) + diffRule?: string; + + /** + * Name of the setting. + */ + @visibility(Lifecycle.Read) + settingName?: string; + + /** + * Value of the setting in the current slot. + */ + @visibility(Lifecycle.Read) + valueInCurrentSlot?: string; + + /** + * Value of the setting in the target slot. + */ + @visibility(Lifecycle.Read) + valueInTargetSlot?: string; + + /** + * Description of the setting difference. + */ + @visibility(Lifecycle.Read) + description?: string; +} + +/** + * Collection of snapshots which can be used to revert an app to a previous time. + */ +model SnapshotCollection is Azure.Core.Page; + +/** + * SiteSourceControl resource specific properties + */ +#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-provisioning-state" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +model SiteSourceControlProperties { + /** + * Repository or source control URL. + */ + @visibility(Lifecycle.Read, Lifecycle.Create) + repoUrl?: string; + + /** + * Name of branch to use for deployment. + */ + @visibility(Lifecycle.Read, Lifecycle.Create) + branch?: string; + + /** + * true to limit to manual integration; false to enable continuous integration (which configures webhooks into online repos like GitHub). + */ + @visibility(Lifecycle.Read, Lifecycle.Create) + isManualIntegration?: boolean; + + /** + * true if this is deployed via GitHub action. + */ + @visibility(Lifecycle.Read, Lifecycle.Create) + isGitHubAction?: boolean; + + /** + * true to enable deployment rollback; otherwise, false. + */ + @visibility(Lifecycle.Read, Lifecycle.Create) + deploymentRollbackEnabled?: boolean; + + /** + * true for a Mercurial repository; false for a Git repository. + */ + @visibility(Lifecycle.Read, Lifecycle.Create) + isMercurial?: boolean; + + /** + * If GitHub Action is selected, than the associated configuration. + */ + gitHubActionConfiguration?: GitHubActionConfiguration; +} + +/** + * The GitHub action configuration. + */ +model GitHubActionConfiguration { + /** + * GitHub Action code configuration. + */ + codeConfiguration?: GitHubActionCodeConfiguration; + + /** + * GitHub Action container configuration. + */ + containerConfiguration?: GitHubActionContainerConfiguration; + + /** + * This will help determine the workflow configuration to select. + */ + isLinux?: boolean; + + /** + * Workflow option to determine whether the workflow file should be generated and written to the repository. + */ + generateWorkflowFile?: boolean; +} + +/** + * The GitHub action code configuration. + */ +model GitHubActionCodeConfiguration { + /** + * Runtime stack is used to determine the workflow file content for code base apps. + */ + runtimeStack?: string; + + /** + * Runtime version is used to determine what build version to set in the workflow file. + */ + runtimeVersion?: string; +} + +/** + * The GitHub action container configuration. + */ +model GitHubActionContainerConfiguration { + /** + * The server URL for the container registry where the build will be hosted. + */ + serverUrl?: string; + + /** + * The image name for the build. + */ + imageName?: string; + + /** + * The username used to upload the image to the container registry. + */ + username?: string; + + /** + * The password used to upload the image to the container registry. + */ + @secret + password?: string; +} + +/** + * TriggeredWebJob resource specific properties + */ +#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-provisioning-state" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +model TriggeredWebJobProperties { + /** + * Latest job run information. + */ + #suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + latest_run?: TriggeredJobRun; + + /** + * History URL. + */ + #suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + history_url?: string; + + /** + * Scheduler Logs URL. + */ + #suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + scheduler_logs_url?: string; + + /** + * Run command. + */ + #suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + run_command?: string; + + /** + * Job URL. + */ + url?: string; + + /** + * Extra Info URL. + */ + #suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + extra_info_url?: string; + + /** + * Job type. + */ + #suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + web_job_type?: WebJobType; + + /** + * Error information. + */ + error?: string; + + /** + * Using SDK? + */ + #suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + using_sdk?: boolean; + + /** + * Property to allow or block all public traffic. Allowed Values: 'Enabled', 'Disabled' or an empty string. + */ + #suppress "@azure-tools/typespec-azure-resource-manager/secret-prop" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + publicNetworkAccess?: string; + + /** + * Checks if Customer provided storage account is required + */ + storageAccountRequired?: boolean; + + /** + * Job settings. + */ + #suppress "@azure-tools/typespec-azure-resource-manager/arm-no-record" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + settings?: Record; +} + +/** + * Triggered Web Job Run Information. + */ +model TriggeredJobRun { + /** + * Job ID. + */ + #suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + web_job_id?: string; + + /** + * Job name. + */ + #suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + web_job_name?: string; + + /** + * Job status. + */ + status?: TriggeredWebJobStatus; + + /** + * Start time. + */ + // FIXME: (utcDateTime) Please double check that this is the correct type for your scenario. + #suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + start_time?: utcDateTime; + + /** + * End time. + */ + // FIXME: (utcDateTime) Please double check that this is the correct type for your scenario. + #suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + end_time?: utcDateTime; + + /** + * Job duration. + */ + duration?: string; + + /** + * Output URL. + */ + #suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + output_url?: string; + + /** + * Error URL. + */ + #suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + error_url?: string; + + /** + * Job URL. + */ + url?: string; + + /** + * Job name. + */ + #suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + job_name?: string; + + /** + * Job trigger. + */ + trigger?: string; +} + +/** + * TriggeredJobHistory resource specific properties + */ +#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-provisioning-state" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +model TriggeredJobHistoryProperties { + /** + * List of triggered web job runs. + */ + @identifiers(#["web_job_id"]) + runs?: TriggeredJobRun[]; +} + +/** + * WebJob resource specific properties + */ +#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-provisioning-state" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +model WebJobProperties { + /** + * Run command. + */ + #suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + run_command?: string; + + /** + * Job URL. + */ + url?: string; + + /** + * Extra Info URL. + */ + #suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + extra_info_url?: string; + + /** + * Job type. + */ + #suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + web_job_type?: WebJobType; + + /** + * Error information. + */ + error?: string; + + /** + * Using SDK? + */ + #suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + using_sdk?: boolean; + + /** + * Job settings. + */ + #suppress "@azure-tools/typespec-azure-resource-manager/arm-no-record" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + settings?: Record; +} + +/** + * The workflow filter. + */ +model WorkflowArtifacts { + /** + * Application settings of the workflow. + */ + #suppress "@azure-tools/typespec-azure-core/no-unknown" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + appSettings?: unknown; + + /** + * Files of the app. + */ + #suppress "@azure-tools/typespec-azure-resource-manager/arm-no-record" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + files?: Record; + + /** + * Files of the app to delete. + */ + filesToDelete?: string[]; +} + +/** + * Additional workflow properties. + */ +#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-provisioning-state" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +model WorkflowEnvelopeProperties { + /** + * Gets or sets the files. + */ + #suppress "@azure-tools/typespec-azure-resource-manager/arm-no-record" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + files?: Record; + + /** + * Gets or sets the state of the workflow. + */ + flowState?: WorkflowState; + + /** + * Gets or sets workflow health. + */ + health?: WorkflowHealth; +} + +/** + * Represents the workflow health. + */ +model WorkflowHealth { + /** + * Gets or sets the workflow health state. + */ + state: WorkflowHealthState; + + /** + * Gets or sets the workflow error. + */ + error?: ErrorEntity; +} + +/** + * The access key regenerate action content. + */ +model RegenerateActionParameter { + /** + * The key type. + */ + keyType?: KeyType; +} + +/** + * Error response indicates Logic service is not able to process the incoming request. The error property contains the error details. + */ +@error +model ErrorResponse { + /** + * The error properties. + */ + error?: ErrorProperties; +} + +/** + * Error properties indicate why the Logic service was not able to process the incoming request. The reason is provided in the error message. + */ +model ErrorProperties { + /** + * Error code. + */ + code?: string; + + /** + * Error message indicating why the operation failed. + */ + message?: string; +} + +/** + * The workflow run properties. + */ +#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-provisioning-state" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +model WorkflowRunProperties { + /** + * Gets the wait end time. + */ + @visibility(Lifecycle.Read) + // FIXME: (utcDateTime) Please double check that this is the correct type for your scenario. + waitEndTime?: utcDateTime; + + /** + * Gets the start time. + */ + @visibility(Lifecycle.Read) + // FIXME: (utcDateTime) Please double check that this is the correct type for your scenario. + startTime?: utcDateTime; + + /** + * Gets the end time. + */ + @visibility(Lifecycle.Read) + // FIXME: (utcDateTime) Please double check that this is the correct type for your scenario. + endTime?: utcDateTime; + + /** + * Gets the status. + */ + @visibility(Lifecycle.Read) + status?: WorkflowStatus; + + /** + * Gets the code. + */ + @visibility(Lifecycle.Read) + code?: string; + + /** + * Gets the error. + */ + #suppress "@azure-tools/typespec-azure-core/no-unknown" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + @visibility(Lifecycle.Read) + error?: unknown; + + /** + * Gets the correlation id. + */ + @visibility(Lifecycle.Read) + correlationId?: string; + + /** + * The run correlation. + */ + correlation?: Correlation; + + /** + * Gets the reference to workflow version. + */ + @visibility(Lifecycle.Read) + workflow?: ResourceReference; + + /** + * Gets the fired trigger. + */ + @visibility(Lifecycle.Read) + trigger?: WorkflowRunTrigger; + + /** + * Gets the outputs. + */ + #suppress "@azure-tools/typespec-azure-resource-manager/arm-no-record" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + @visibility(Lifecycle.Read) + outputs?: Record; + + /** + * Gets the response of the flow run. + */ + @visibility(Lifecycle.Read) + response?: WorkflowRunTrigger; +} + +/** + * The correlation property. + */ +model Correlation { + /** + * The client tracking id. + */ + clientTrackingId?: string; +} + +/** + * The resource reference. + */ +model ResourceReference { + /** + * The resource id. + */ + id?: string; + + /** + * Gets the resource name. + */ + @visibility(Lifecycle.Read) + name?: string; + + /** + * Gets the resource type. + */ + @visibility(Lifecycle.Read) + type?: string; +} + +/** + * The workflow run trigger. + */ +model WorkflowRunTrigger { + /** + * Gets the name. + */ + @visibility(Lifecycle.Read) + name?: string; + + /** + * Gets the inputs. + */ + #suppress "@azure-tools/typespec-azure-core/no-unknown" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + #suppress "@azure-tools/typespec-azure-core/no-unknown" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + @visibility(Lifecycle.Read) + inputs?: unknown; + + /** + * Gets the link to inputs. + */ + @visibility(Lifecycle.Read) + inputsLink?: ContentLink; + + /** + * Gets the outputs. + */ + #suppress "@azure-tools/typespec-azure-core/no-unknown" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + @visibility(Lifecycle.Read) + outputs?: unknown; + + /** + * Gets the link to outputs. + */ + @visibility(Lifecycle.Read) + outputsLink?: ContentLink; + + /** + * Gets the scheduled time. + */ + @visibility(Lifecycle.Read) + // FIXME: (utcDateTime) Please double check that this is the correct type for your scenario. + scheduledTime?: utcDateTime; + + /** + * Gets the start time. + */ + @visibility(Lifecycle.Read) + // FIXME: (utcDateTime) Please double check that this is the correct type for your scenario. + startTime?: utcDateTime; + + /** + * Gets the end time. + */ + @visibility(Lifecycle.Read) + // FIXME: (utcDateTime) Please double check that this is the correct type for your scenario. + endTime?: utcDateTime; + + /** + * Gets the tracking id. + */ + @visibility(Lifecycle.Read) + trackingId?: string; + + /** + * The run correlation. + */ + correlation?: Correlation; + + /** + * Gets the code. + */ + @visibility(Lifecycle.Read) + code?: string; + + /** + * Gets the status. + */ + @visibility(Lifecycle.Read) + status?: WorkflowStatus; + + /** + * Gets the error. + */ + #suppress "@azure-tools/typespec-azure-core/no-unknown" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + @visibility(Lifecycle.Read) + error?: unknown; + + /** + * Gets the tracked properties. + */ + #suppress "@azure-tools/typespec-azure-core/no-unknown" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + @visibility(Lifecycle.Read) + trackedProperties?: unknown; +} + +/** + * The content link. + */ +model ContentLink { + /** + * The content link URI. + */ + uri?: string; + + /** + * The content version. + */ + @visibility(Lifecycle.Read) + contentVersion?: string; + + /** + * The content size. + */ + @visibility(Lifecycle.Read) + contentSize?: int64; + + /** + * The content hash. + */ + @visibility(Lifecycle.Read) + contentHash?: ContentHash; + + /** + * The metadata. + */ + #suppress "@azure-tools/typespec-azure-core/no-unknown" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + @visibility(Lifecycle.Read) + metadata?: unknown; +} + +/** + * The content hash. + */ +model ContentHash { + /** + * The algorithm of the content hash. + */ + algorithm?: string; + + /** + * The value of the content hash. + */ + value?: string; +} + +/** + * The workflow output parameter. + */ +#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +model WorkflowOutputParameter extends WorkflowParameter { + /** + * Gets the error. + */ + #suppress "@azure-tools/typespec-azure-core/no-unknown" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + @visibility(Lifecycle.Read) + error?: unknown; +} + +/** + * The workflow parameters. + */ +model WorkflowParameter { + /** + * The type. + */ + type?: ParameterType; + + /** + * The value. + */ + #suppress "@azure-tools/typespec-azure-core/no-unknown" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + value?: unknown; + + /** + * The metadata. + */ + #suppress "@azure-tools/typespec-azure-core/no-unknown" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + metadata?: unknown; + + /** + * The description. + */ + description?: string; +} + +/** + * The sub resource type. + */ +model SubResource { + /** + * The resource id. + */ + @visibility(Lifecycle.Read) + id?: string; +} + +/** + * The workflow run action properties. + */ +#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-provisioning-state" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +model WorkflowRunActionProperties { + /** + * Gets the start time. + */ + @visibility(Lifecycle.Read) + // FIXME: (utcDateTime) Please double check that this is the correct type for your scenario. + startTime?: utcDateTime; + + /** + * Gets the end time. + */ + @visibility(Lifecycle.Read) + // FIXME: (utcDateTime) Please double check that this is the correct type for your scenario. + endTime?: utcDateTime; + + /** + * Gets the status. + */ + @visibility(Lifecycle.Read) + status?: WorkflowStatus; + + /** + * Gets the code. + */ + @visibility(Lifecycle.Read) + code?: string; + + /** + * Gets the error. + */ + #suppress "@azure-tools/typespec-azure-core/no-unknown" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + @visibility(Lifecycle.Read) + error?: unknown; + + /** + * Gets the tracking id. + */ + @visibility(Lifecycle.Read) + trackingId?: string; + + /** + * The correlation properties. + */ + correlation?: RunActionCorrelation; + + /** + * Gets the link to inputs. + */ + @visibility(Lifecycle.Read) + inputsLink?: ContentLink; + + /** + * Gets the link to outputs. + */ + @visibility(Lifecycle.Read) + outputsLink?: ContentLink; + + /** + * Gets the tracked properties. + */ + #suppress "@azure-tools/typespec-azure-core/no-unknown" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + @visibility(Lifecycle.Read) + trackedProperties?: unknown; + + /** + * Gets the retry histories. + */ + @identifiers(#[]) + retryHistory?: RetryHistory[]; +} + +/** + * The workflow run action correlation properties. + */ +#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +model RunActionCorrelation extends RunCorrelation { + /** + * The action tracking identifier. + */ + actionTrackingId?: string; +} + +/** + * The correlation properties. + */ +model RunCorrelation { + /** + * The client tracking identifier. + */ + clientTrackingId?: string; + + /** + * The client keywords. + */ + clientKeywords?: string[]; +} + +/** + * The retry history. + */ +model RetryHistory { + /** + * Gets the start time. + */ + // FIXME: (utcDateTime) Please double check that this is the correct type for your scenario. + startTime?: utcDateTime; + + /** + * Gets the end time. + */ + // FIXME: (utcDateTime) Please double check that this is the correct type for your scenario. + endTime?: utcDateTime; + + /** + * Gets the status code. + */ + code?: string; + + /** + * Gets the client request Id. + */ + clientRequestId?: string; + + /** + * Gets the service request Id. + */ + serviceRequestId?: string; + + /** + * Gets the error response. + */ + error?: ErrorResponse; +} + +/** + * The expression traces. + */ +model ExpressionTraces { + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + #suppress "@azure-tools/typespec-azure-core/no-unknown" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + value?: unknown; + + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + @pageItems + @identifiers(#["path"]) + inputs?: ExpressionRoot[]; + + /** + * The link used to get the next page of recommendations. + */ + @nextLink + nextLink?: string; +} + +/** + * The expression root. + */ +#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +model ExpressionRoot extends Expression { + /** + * The path. + */ + path?: string; +} + +/** + * The expression. + */ +model Expression { + /** + * The text. + */ + text?: string; + + /** + * Anything + */ + #suppress "@azure-tools/typespec-azure-core/no-unknown" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + value?: unknown; + + /** + * The sub expressions. + */ + @identifiers(#[]) + subexpressions?: Expression[]; + + /** + * The azure resource error info. + */ + error?: AzureResourceErrorInfo; +} + +/** + * The azure resource error info. + */ +#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +model AzureResourceErrorInfo extends ErrorInfo { + /** + * The error message. + */ + message: string; + + /** + * The error details. + */ + @identifiers(#["code"]) + details?: AzureResourceErrorInfo[]; +} + +/** + * The error info. + */ +model ErrorInfo { + /** + * The error code. + */ + code: string; +} + +/** + * The workflow run action repetition properties definition. + */ +#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-provisioning-state" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +model WorkflowRunActionRepetitionProperties extends OperationResult { + /** + * The repetition indexes. + */ + @identifiers(#["itemIndex"]) + repetitionIndexes?: RepetitionIndex[]; +} + +/** + * The workflow run action repetition index. + */ +model RepetitionIndex { + /** + * The scope. + */ + scopeName?: string; + + /** + * The index. + */ + itemIndex: int32; +} + +/** + * The operation result definition. + */ +#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +model OperationResult extends OperationResultProperties { + /** + * Gets the tracking id. + */ + @visibility(Lifecycle.Read) + trackingId?: string; + + /** + * Gets the inputs. + */ + #suppress "@azure-tools/typespec-azure-core/no-unknown" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + @visibility(Lifecycle.Read) + inputs?: unknown; + + /** + * Gets the link to inputs. + */ + @visibility(Lifecycle.Read) + inputsLink?: ContentLink; + + /** + * Gets the outputs. + */ + #suppress "@azure-tools/typespec-azure-core/no-unknown" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + @visibility(Lifecycle.Read) + outputs?: unknown; + + /** + * Gets the link to outputs. + */ + @visibility(Lifecycle.Read) + outputsLink?: ContentLink; + + /** + * Gets the tracked properties. + */ + #suppress "@azure-tools/typespec-azure-core/no-unknown" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + @visibility(Lifecycle.Read) + trackedProperties?: unknown; + + /** + * Gets the retry histories. + */ + @identifiers(#[]) + retryHistory?: RetryHistory[]; + + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + iterationCount?: int32; +} + +/** + * The run operation result properties. + */ +model OperationResultProperties { + /** + * The start time of the workflow scope repetition. + */ + // FIXME: (utcDateTime) Please double check that this is the correct type for your scenario. + startTime?: utcDateTime; + + /** + * The end time of the workflow scope repetition. + */ + // FIXME: (utcDateTime) Please double check that this is the correct type for your scenario. + endTime?: utcDateTime; + + /** + * The correlation properties. + */ + correlation?: RunActionCorrelation; + + /** + * The status of the workflow scope repetition. + */ + status?: WorkflowStatus; + + /** + * The workflow scope repetition code. + */ + code?: string; + + /** + * Anything + */ + #suppress "@azure-tools/typespec-azure-core/no-unknown" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + error?: unknown; +} + +/** + * The base resource type. + */ +model WorkflowResource { + /** + * The resource id. + */ + @visibility(Lifecycle.Read) + id?: string; + + /** + * Gets the resource name. + */ + @visibility(Lifecycle.Read) + name?: string; + + /** + * Gets the resource type. + */ + @visibility(Lifecycle.Read) + type?: string; + + /** + * The resource location. + */ + location?: string; + + /** + * The resource tags. + */ + #suppress "@azure-tools/typespec-azure-resource-manager/arm-no-record" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + tags?: Record; +} + +/** + * The request history. + */ +#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-provisioning-state" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +model RequestHistoryProperties { + /** + * The time the request started. + */ + // FIXME: (utcDateTime) Please double check that this is the correct type for your scenario. + startTime?: utcDateTime; + + /** + * The time the request ended. + */ + // FIXME: (utcDateTime) Please double check that this is the correct type for your scenario. + endTime?: utcDateTime; + + /** + * The request. + */ + request?: Request; + + /** + * The response. + */ + response?: Response; +} + +/** + * A request. + */ +model Request { + /** + * A list of all the headers attached to the request. + */ + #suppress "@azure-tools/typespec-azure-core/no-unknown" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + headers?: unknown; + + /** + * The destination for the request. + */ + uri?: string; + + /** + * The HTTP method used for the request. + */ + method?: string; +} + +/** + * A response. + */ +model Response { + /** + * A list of all the headers attached to the response. + */ + #suppress "@azure-tools/typespec-azure-core/no-unknown" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + headers?: unknown; + + /** + * The status code of the response. + */ + statusCode?: int32; + + /** + * Details on the location of the body content. + */ + bodyLink?: ContentLink; +} + +/** + * The workflow trigger properties. + */ +model WorkflowTriggerProperties { + /** + * Gets the provisioning state. + */ + @visibility(Lifecycle.Read) + provisioningState?: WorkflowTriggerProvisioningState; + + /** + * Gets the created time. + */ + @visibility(Lifecycle.Read) + // FIXME: (utcDateTime) Please double check that this is the correct type for your scenario. + createdTime?: utcDateTime; + + /** + * Gets the changed time. + */ + @visibility(Lifecycle.Read) + // FIXME: (utcDateTime) Please double check that this is the correct type for your scenario. + changedTime?: utcDateTime; + + /** + * Gets the state. + */ + @visibility(Lifecycle.Read) + state?: WorkflowState; + + /** + * Gets the status. + */ + @visibility(Lifecycle.Read) + status?: WorkflowStatus; + + /** + * Gets the last execution time. + */ + @visibility(Lifecycle.Read) + // FIXME: (utcDateTime) Please double check that this is the correct type for your scenario. + lastExecutionTime?: utcDateTime; + + /** + * Gets the next execution time. + */ + @visibility(Lifecycle.Read) + // FIXME: (utcDateTime) Please double check that this is the correct type for your scenario. + nextExecutionTime?: utcDateTime; + + /** + * Gets the workflow trigger recurrence. + */ + @visibility(Lifecycle.Read) + recurrence?: WorkflowTriggerRecurrence; + + /** + * Gets the reference to workflow. + */ + @visibility(Lifecycle.Read) + workflow?: ResourceReference; +} + +/** + * The workflow trigger recurrence. + */ +model WorkflowTriggerRecurrence { + /** + * The frequency. + */ + frequency?: RecurrenceFrequency; + + /** + * The interval. + */ + interval?: int32; + + /** + * The start time. + */ + startTime?: string; + + /** + * The end time. + */ + endTime?: string; + + /** + * The time zone. + */ + timeZone?: string; + + /** + * The recurrence schedule. + */ + schedule?: RecurrenceSchedule; +} + +/** + * The recurrence schedule. + */ +model RecurrenceSchedule { + /** + * The minutes. + */ + minutes?: int32[]; + + /** + * The hours. + */ + hours?: int32[]; + + /** + * The days of the week. + */ + weekDays?: DaysOfWeek[]; + + /** + * The month days. + */ + monthDays?: int32[]; + + /** + * The monthly occurrences. + */ + @identifiers(#[]) + monthlyOccurrences?: RecurrenceScheduleOccurrence[]; +} + +/** + * The recurrence schedule occurrence. + */ +model RecurrenceScheduleOccurrence { + /** + * The day of the week. + */ + day?: DayOfWeek; + + /** + * The occurrence. + */ + occurrence?: int32; +} + +/** + * The workflow trigger history properties. + */ +#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-provisioning-state" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +model WorkflowTriggerHistoryProperties { + /** + * Gets the start time. + */ + @visibility(Lifecycle.Read) + // FIXME: (utcDateTime) Please double check that this is the correct type for your scenario. + startTime?: utcDateTime; + + /** + * Gets the end time. + */ + @visibility(Lifecycle.Read) + // FIXME: (utcDateTime) Please double check that this is the correct type for your scenario. + endTime?: utcDateTime; + + /** + * The scheduled time. + */ + @visibility(Lifecycle.Read) + // FIXME: (utcDateTime) Please double check that this is the correct type for your scenario. + scheduledTime?: utcDateTime; + + /** + * Gets the status. + */ + @visibility(Lifecycle.Read) + status?: WorkflowStatus; + + /** + * Gets the code. + */ + @visibility(Lifecycle.Read) + code?: string; + + /** + * Gets the error. + */ + #suppress "@azure-tools/typespec-azure-core/no-unknown" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + @visibility(Lifecycle.Read) + error?: unknown; + + /** + * Gets the tracking id. + */ + @visibility(Lifecycle.Read) + trackingId?: string; + + /** + * The run correlation. + */ + correlation?: Correlation; + + /** + * Gets the link to input parameters. + */ + @visibility(Lifecycle.Read) + inputsLink?: ContentLink; + + /** + * Gets the link to output parameters. + */ + @visibility(Lifecycle.Read) + outputsLink?: ContentLink; + + /** + * The value indicating whether trigger was fired. + */ + @visibility(Lifecycle.Read) + fired?: boolean; + + /** + * Gets the reference to workflow run. + */ + @visibility(Lifecycle.Read) + run?: ResourceReference; +} + +/** + * The workflow trigger callback URL. + */ +model WorkflowTriggerCallbackUrl { + /** + * Gets the workflow trigger callback URL. + */ + @visibility(Lifecycle.Read) + value?: string; + + /** + * Gets the workflow trigger callback URL HTTP method. + */ + @visibility(Lifecycle.Read) + method?: string; + + /** + * Gets the workflow trigger callback URL base path. + */ + @visibility(Lifecycle.Read) + basePath?: string; + + /** + * Gets the workflow trigger callback URL relative path. + */ + @visibility(Lifecycle.Read) + relativePath?: string; + + /** + * Gets the workflow trigger callback URL relative path parameters. + */ + relativePathParameters?: string[]; + + /** + * Gets the workflow trigger callback URL query parameters. + */ + queries?: WorkflowTriggerListCallbackUrlQueries; +} + +/** + * Gets the workflow trigger callback URL query parameters. + */ +model WorkflowTriggerListCallbackUrlQueries { + /** + * The api version. + */ + #suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + `api-version`?: string; + + /** + * The SAS permissions. + */ + sp?: string; + + /** + * The SAS version. + */ + sv?: string; + + /** + * The SAS signature. + */ + sig?: string; + + /** + * The SAS timestamp. + */ + se?: string; +} + +/** + * The JSON schema. + */ +model JsonSchema { + /** + * The JSON title. + */ + title?: string; + + /** + * The JSON content. + */ + content?: string; +} + +/** + * The workflow type. + */ +#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +model Workflow extends WorkflowResource { + /** + * The workflow properties. + */ + #suppress "@azure-tools/typespec-azure-core/no-private-usage" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + properties?: WorkflowProperties; + + /** + * Managed service identity. + */ + identity?: ManagedServiceIdentity; +} + +/** + * The workflow properties. + */ +model WorkflowProperties { + /** + * Gets the provisioning state. + */ + @visibility(Lifecycle.Read) + provisioningState?: WorkflowProvisioningState; + + /** + * Gets the created time. + */ + @visibility(Lifecycle.Read) + // FIXME: (utcDateTime) Please double check that this is the correct type for your scenario. + createdTime?: utcDateTime; + + /** + * Gets the changed time. + */ + @visibility(Lifecycle.Read) + // FIXME: (utcDateTime) Please double check that this is the correct type for your scenario. + changedTime?: utcDateTime; + + /** + * The state. + */ + state?: WorkflowState; + + /** + * Gets the version. + */ + @visibility(Lifecycle.Read) + version?: string; + + /** + * Gets the access endpoint. + */ + @visibility(Lifecycle.Read) + accessEndpoint?: string; + + /** + * The endpoints configuration. + */ + endpointsConfiguration?: FlowEndpointsConfiguration; + + /** + * The access control configuration. + */ + accessControl?: FlowAccessControlConfiguration; + + /** + * The sku. + */ + @visibility(Lifecycle.Read) + sku?: WorkflowSku; + + /** + * The integration account. + */ + integrationAccount?: ResourceReference; + + /** + * The integration service environment. + */ + integrationServiceEnvironment?: ResourceReference; + + /** + * The definition. + */ + #suppress "@azure-tools/typespec-azure-core/no-unknown" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + definition?: unknown; + + /** + * The parameters. + */ + #suppress "@azure-tools/typespec-azure-resource-manager/arm-no-record" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + parameters?: Record; + + /** + * The workflow kind. + */ + kind?: Kind; +} + +/** + * The endpoints configuration. + */ +model FlowEndpointsConfiguration { + /** + * The workflow endpoints. + */ + workflow?: FlowEndpoints; + + /** + * The connector endpoints. + */ + connector?: FlowEndpoints; +} + +/** + * The flow endpoints configuration. + */ +model FlowEndpoints { + /** + * The outgoing ip address. + */ + @identifiers(#["address"]) + outgoingIpAddresses?: IpAddress[]; + + /** + * The access endpoint ip address. + */ + @identifiers(#["address"]) + accessEndpointIpAddresses?: IpAddress[]; +} + +/** + * The ip address. + */ +model IpAddress { + /** + * The address. + */ + address?: string; +} + +/** + * The access control configuration. + */ +model FlowAccessControlConfiguration { + /** + * The access control configuration for invoking workflow triggers. + */ + triggers?: FlowAccessControlConfigurationPolicy; + + /** + * The access control configuration for accessing workflow run contents. + */ + contents?: FlowAccessControlConfigurationPolicy; + + /** + * The access control configuration for workflow actions. + */ + actions?: FlowAccessControlConfigurationPolicy; + + /** + * The access control configuration for workflow management. + */ + workflowManagement?: FlowAccessControlConfigurationPolicy; +} + +/** + * The access control configuration policy. + */ +model FlowAccessControlConfigurationPolicy { + /** + * The allowed caller IP address ranges. + */ + @identifiers(#[]) + allowedCallerIpAddresses?: IpAddressRange[]; + + /** + * The authentication policies for workflow. + */ + openAuthenticationPolicies?: OpenAuthenticationAccessPolicies; +} + +/** + * The ip address range. + */ +model IpAddressRange { + /** + * The IP address range. + */ + addressRange?: string; +} + +/** + * AuthenticationPolicy of type Open. + */ +model OpenAuthenticationAccessPolicies { + /** + * Open authentication policies. + */ + #suppress "@azure-tools/typespec-azure-resource-manager/arm-no-record" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + policies?: Record; +} + +/** + * Open authentication access policy defined by user. + */ +model OpenAuthenticationAccessPolicy { + /** + * Type of provider for OAuth. + */ + type?: OpenAuthenticationProviderType; + + /** + * The access policy claims. + */ + @identifiers(#["name"]) + claims?: OpenAuthenticationPolicyClaim[]; +} + +/** + * Open authentication policy claim. + */ +model OpenAuthenticationPolicyClaim { + /** + * The name of the claim. + */ + name?: string; + + /** + * The value of the claim. + */ + value?: string; +} + +/** + * The sku type. + */ +model WorkflowSku { + /** + * The name. + */ + name: WorkflowSkuName; + + /** + * The reference to plan. + */ + plan?: ResourceReference; +} + +/** + * The workflow version properties. + */ +model WorkflowVersionProperties { + /** + * The provisioning state. + */ + @visibility(Lifecycle.Read) + provisioningState?: WorkflowProvisioningState; + + /** + * Gets the created time. + */ + @visibility(Lifecycle.Read) + // FIXME: (utcDateTime) Please double check that this is the correct type for your scenario. + createdTime?: utcDateTime; + + /** + * Gets the changed time. + */ + @visibility(Lifecycle.Read) + // FIXME: (utcDateTime) Please double check that this is the correct type for your scenario. + changedTime?: utcDateTime; + + /** + * The state. + */ + state?: WorkflowState; + + /** + * Gets the version. + */ + @visibility(Lifecycle.Read) + version?: string; + + /** + * Gets the access endpoint. + */ + @visibility(Lifecycle.Read) + accessEndpoint?: string; + + /** + * The endpoints configuration. + */ + endpointsConfiguration?: FlowEndpointsConfiguration; + + /** + * The access control configuration. + */ + accessControl?: FlowAccessControlConfiguration; + + /** + * The sku. + */ + @visibility(Lifecycle.Read) + sku?: WorkflowSku; + + /** + * The integration account. + */ + integrationAccount?: ResourceReference; + + /** + * The definition. + */ + #suppress "@azure-tools/typespec-azure-core/no-unknown" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + definition?: unknown; + + /** + * The parameters. + */ + #suppress "@azure-tools/typespec-azure-resource-manager/arm-no-record" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + parameters?: Record; +} + +/** + * Describes valid TLS cipher suites. + */ +model CipherSuites { + /** + * List of TLS Cipher Suites that are supported by App Service. + */ + suites?: string[]; +} + +/** + * Container App container definition. + */ +model Container { + /** + * Container image tag. + */ + image?: string; + + /** + * Custom container name. + */ + name?: string; + + /** + * Container start command. + */ + command?: string[]; + + /** + * Container start command arguments. + */ + args?: string[]; + + /** + * Container environment variables. + */ + @identifiers(#["name"]) + env?: EnvironmentVar[]; + + /** + * Container resource requirements. + */ + resources?: ContainerResources; +} + +/** + * Container App container environment variable. + */ +model EnvironmentVar { + /** + * Environment variable name. + */ + name?: string; + + /** + * Non-secret environment variable value. + */ + value?: string; + + /** + * Name of the Container App secret from which to pull the environment variable value. + */ + secretRef?: string; +} + +/** + * Container App container resource requirements. + */ +model ContainerResources { + /** + * Required CPU in cores, e.g. 0.5 + */ + cpu?: float64; + + /** + * Required memory, e.g. "250Mb" + */ + memory?: string; +} + +/** + * Container App container Custom scaling rule. + */ +model CustomScaleRule { + /** + * Type of the custom scale rule + * eg: azure-servicebus, redis etc. + */ + type?: string; + + /** + * Metadata properties to describe custom scale rule. + */ + #suppress "@azure-tools/typespec-azure-resource-manager/arm-no-record" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + metadata?: Record; + + /** + * Authentication secrets for the custom scale rule. + */ + @identifiers(#["triggerParameter"]) + auth?: ScaleRuleAuth[]; +} + +/** + * Auth Secrets for Container App Scale Rule + */ +model ScaleRuleAuth { + /** + * Name of the Container App secret from which to pull the auth params. + */ + secretRef?: string; + + /** + * Trigger Parameter that uses the secret + */ + triggerParameter?: string; +} + +/** + * Container App Dapr configuration. + */ +model Dapr { + /** + * Boolean indicating if the Dapr side car is enabled + */ + enabled?: boolean; + + /** + * Dapr application identifier + */ + appId?: string; + + /** + * Port on which the Dapr side car + */ + appPort?: int32; + + /** + * Collection of Dapr components + */ + @identifiers(#["name"]) + components?: DaprComponent[]; +} + +/** + * Dapr component configuration + */ +model DaprComponent { + /** + * Component name + */ + name?: string; + + /** + * Component type + */ + type?: string; + + /** + * Component version + */ + version?: string; + + /** + * Component metadata + */ + @identifiers(#["name"]) + metadata?: DaprMetadata[]; +} + +/** + * Container App Dapr component metadata. + */ +model DaprMetadata { + /** + * Metadata property name. + */ + name?: string; + + /** + * Metadata property value. + */ + value?: string; + + /** + * Name of the Container App secret from which to pull the metadata property value. + */ + secretRef?: string; +} + +/** + * Container App container Custom scaling rule. + */ +model HttpScaleRule { + /** + * Metadata properties to describe http scale rule. + */ + #suppress "@azure-tools/typespec-azure-resource-manager/arm-no-record" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + metadata?: Record; + + /** + * Authentication secrets for the custom scale rule. + */ + @identifiers(#["triggerParameter"]) + auth?: ScaleRuleAuth[]; +} + +/** + * A request to approve or reject a private endpoint connection + */ +model PrivateLinkConnectionApprovalRequest { + /** + * The state of a private link connection + */ + privateLinkServiceConnectionState?: PrivateLinkConnectionState; +} + +/** + * Private Endpoint Connection Approval ARM resource. + */ +#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +model PrivateLinkConnectionApprovalRequestResource extends ProxyOnlyResource { + /** + * Core resource properties + */ + #suppress "@azure-tools/typespec-azure-core/no-private-usage" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + properties?: PrivateLinkConnectionApprovalRequest; +} + +/** + * Container App container Azure Queue based scaling rule. + */ +model QueueScaleRule { + /** + * Queue name. + */ + queueName?: string; + + /** + * Queue length. + */ + queueLength?: int32; + + /** + * Authentication secrets for the queue scale rule. + */ + @identifiers(#["triggerParameter"]) + auth?: ScaleRuleAuth[]; +} + +/** + * Container App scaling configurations. + */ +model Scale { + /** + * Optional. Minimum number of container replicas. + */ + minReplicas?: int32; + + /** + * Optional. Maximum number of container replicas. Defaults to 10 if not set. + */ + maxReplicas?: int32; + + /** + * Scaling rules. + */ + @identifiers(#["name"]) + rules?: ScaleRule[]; +} + +/** + * Container App container scaling rule. + */ +model ScaleRule { + /** + * Scale Rule Name + */ + name?: string; + + /** + * Azure Queue based scaling. + */ + azureQueue?: QueueScaleRule; + + /** + * Custom scale rule. + */ + custom?: CustomScaleRule; + + /** + * HTTP requests based scaling. + */ + http?: HttpScaleRule; +} + +/** + * Container App versioned application definition. + * Defines the desired state of an immutable revision. + * Any changes to this section Will result in a new revision being created + */ +model Template { + /** + * User friendly suffix that is appended to the revision name + */ + revisionSuffix?: string; + + /** + * List of container definitions for the Container App. + */ + @identifiers(#["name"]) + containers?: Container[]; + + /** + * Scaling properties for the Container App. + */ + scale?: Scale; + + /** + * Dapr configuration for the Container App. + */ + dapr?: Dapr; +} + +/** + * Github access token for Appservice CLI github integration. + */ +model AppserviceGithubToken { + /** + * Github access token for Appservice CLI github integration + */ + accessToken?: string; + + /** + * Scope of the github access token + */ + scope?: string; + + /** + * token type + */ + tokenType?: string; + + /** + * True if valid github token received, False otherwise + */ + gotToken?: boolean; + + /** + * Error message if unable to get token + */ + errorMessage?: string; +} + +/** + * Appservice Github token request content. + */ +model AppserviceGithubTokenRequest { + /** + * Code string to exchange for Github Access token + */ + code: string; + + /** + * State string used for verification. + */ + state: string; +} + +/** + * A custom error page for a specific status returned by a web app. + */ +model ErrorPage { + /** + * The status code for which the error page will be used + */ + statusCode?: int32; + + /** + * The content of the error page. There is a 10kb limit imposed on custom error page content. + */ + content?: string; + + /** + * The content type of the error page. For example, 'text/html' + */ + contentType?: string; + + /** + * If true, the error page will be shown for all requests with a matching status code, regardless of whether they failed on the App Service FrontEnd load balancer or on the app itself. + */ + alwaysUse?: boolean; +} + +/** + * The workflow filter. + */ +model WorkflowFilter { + /** + * The state of workflows. + */ + state?: WorkflowState; +} + +/** + * The list of workflows. + */ +model WorkflowListResult { + /** + * The list of workflows. + */ + value?: Workflow[]; + + /** + * The URL to get the next set of results. + */ + nextLink?: string; +} + +/** + * The workflow run action filter. + */ +model WorkflowRunActionFilter { + /** + * The status of workflow run action. + */ + status?: WorkflowStatus; +} + +/** + * The workflow run filter. + */ +model WorkflowRunFilter { + /** + * The status of workflow run. + */ + status?: WorkflowStatus; +} + +/** + * The workflow trigger filter. + */ +model WorkflowTriggerFilter { + /** + * The state of workflow trigger. + */ + state?: WorkflowState; +} + +/** + * The workflow trigger history filter. + */ +model WorkflowTriggerHistoryFilter { + /** + * The status of workflow trigger history. + */ + status?: WorkflowStatus; +} + +/** + * Type of the registry adapter. + */ +union RegistryAdapterType { + string, + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + Binary: "Binary", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + String: "String", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + Expand_String: "Expand_String", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + Multi_String: "Multi_String", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + DWord: "DWord", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + QWord: "QWord", +} + +/** + * Type of the install script. + */ +union InstallScriptType { + string, + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + RemoteAzureBlob: "RemoteAzureBlob", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + PlatformStorage: "PlatformStorage", +} + +/** + * Type of the storage mount. + */ +union StorageMountType { + string, + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + AzureFiles: "AzureFiles", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + LocalStorage: "LocalStorage", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + FileShare: "FileShare", +} + +#suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +model DefaultIdentity { + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + identityType?: ManagedServiceIdentityType; + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + userAssignedIdentityResourceId?: string; +} + +/** + * Represents instance details for an app service plan. + */ +#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +model ServerFarmInstanceDetails { + /** + * The server farm name. + */ + serverFarmName?: string; + + /** + * The list of server farm instances. + */ + @identifiers(#[]) + instances?: ServerFarmInstance[]; + + /** + * The total number of instances. + */ + instanceCount?: int32; +} + +/** + * Represents details of a single instance in a server farm. + */ +model ServerFarmInstance { + /** + * The instance name. + */ + @maxLength(64) + @minLength(1) + @pattern("^[a-zA-Z0-9]+$") + instanceName?: string; + + /** + * The instance IP address. + */ + ipAddress?: string; + + /** + * The instance status. + */ + status?: string; +} + +/** + * Server Farm RDP connection details. + */ +model ServerFarmRdpDetails { + /** + * The RDP password for the server farm. + */ + @secret + rdpPassword?: string; + + /** + * The RDP password expiry date. + */ + // FIXME: (utcDateTime) Please double check that this is the correct type for your scenario. + #suppress "@azure-tools/typespec-azure-resource-manager/secret-prop" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + rdpPasswordExpiry?: utcDateTime; +} + +/** + * Server farm registry adapter configuration. + */ +model RegistryAdapter { + /** + * Registry key for the adapter. + */ + #suppress "@azure-tools/typespec-azure-resource-manager/secret-prop" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + registryKey?: string; + + /** + * Type of the registry adapter. + */ + type?: RegistryAdapterType; + + /** + * Key vault reference to the value that will be placed in the registry location + */ + keyVaultSecretReference?: KeyVaultReferenceWithStatus; +} +/** + * Object to hold key vault reference and the resolution status + */ +model KeyVaultReferenceWithStatus { + /** + * Key vault secret URI. + */ + secretUri?: string; + + /** + * Reference status of the key vault secret. + */ + referenceStatus?: string; +} +/** + * Server farm install script configuration. + */ +model InstallScript { + /** + * Name of the install script. + */ + name?: string; + + /** + * Source of the install script. + */ + source?: InstallScriptSource; +} +/** + * Object to hold install script reference. + */ +model InstallScriptSource { + /** + * Install script source URI where the install script file will be fetched from. + */ + sourceUri?: string; + + /** + * Type of the install script. + */ + type?: InstallScriptType; +} +/** + * Network settings for an app service plan. + */ +model ServerFarmNetworkSettings { + /** + * Azure Resource Manager ID of the Virtual network and subnet to be joined by Regional VNET Integration. This must be of the form /subscriptions/{subscriptionName}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{vnetName}/subnets/{subnetName} + */ + virtualNetworkSubnetId?: string; +} +/** + * Server farm storage mount configuration. + */ +model StorageMount { + /** + * Name of the storage mount. + */ + name?: string; + + /** + * Type of the storage mount. + */ + type?: StorageMountType; + + /** + * Source of the fileshare/storage. + */ + source?: string; + + /** + * Path on worker where storage will be mounted. + */ + destinationPath?: string; + + /** + * KV reference to the credentials to connect to the share. + */ + credentialsKeyVaultReference?: KeyVaultReferenceWithStatus; +} diff --git a/packages/typespec-test/test/AppService/spec/routes.tsp b/packages/typespec-test/test/AppService/spec/routes.tsp new file mode 100644 index 0000000000..8522566557 --- /dev/null +++ b/packages/typespec-test/test/AppService/spec/routes.tsp @@ -0,0 +1,516 @@ +// FIXME: Operations in this file are not detected as a resource operation, please confirm the conversion result manually + +import "@azure-tools/typespec-azure-core"; +import "@typespec/rest"; +import "./models.tsp"; +import "@azure-tools/typespec-azure-resource-manager"; +import "@typespec/openapi"; + +using TypeSpec.Rest; +using TypeSpec.Http; +using Azure.ResourceManager; +using TypeSpec.OpenAPI; + +namespace Microsoft.Web; + +/** + * Description for Validate whether a resource can be moved. + */ +#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-operation" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +@summary("Validate whether a resource can be moved.") +@summary("Validate whether a resource can be moved.") +@route("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/validateMoveResources") +@post +op validateMove( + ...ApiVersionParameter, + ...ResourceGroupParameter, + ...SubscriptionIdParameter, + + /** + * Object that represents the resource to move. + */ + @bodyRoot + moveResourceEnvelope: CsmMoveResourceEnvelope, +): DefaultErrorResponse | NoContentResponse; +/** + * Description for Validate if a resource can be created. + */ +#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-operation" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +@summary("Validate if a resource can be created.") +@summary("Validate if a resource can be created.") +@route("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/validate") +@post +op validate( + ...ApiVersionParameter, + ...ResourceGroupParameter, + ...SubscriptionIdParameter, + + /** + * Request with the resources to validate. + */ + @bodyRoot + validateRequest: ValidateRequest, +): ArmResponse | DefaultErrorResponse; + +/** + * Description for Gets list of available geo regions plus ministamps + */ +#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-operation" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +@summary("Gets list of available geo regions plus ministamps") +@autoRoute +@get +@action("deploymentLocations") +op getSubscriptionDeploymentLocations is ArmProviderActionSync< + Response = DeploymentLocations, + Scope = SubscriptionActionScope, + Parameters = {}, + Error = DefaultErrorResponse +>; + +/** + * Description for get a list of available ASE regions and its supported Skus. + */ +#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-operation" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +@summary("Get a list of available ASE regions and its supported Skus.") +@autoRoute +@get +@action("aseRegions") +@list +op listAseRegions is ArmProviderActionSync< + Response = AseRegionCollection, + Scope = SubscriptionActionScope, + Parameters = {}, + Error = DefaultErrorResponse +>; + +/** + * Description for Gets a list of meters for a given location. + */ +#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-operation" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-interface-requires-decorator" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +@summary("Gets a list of meters for a given location.") +@autoRoute +@get +@action("billingMeters") +@list +op listBillingMeters is ArmProviderActionSync< + Response = BillingMeterCollection, + Scope = SubscriptionActionScope, + Parameters = { + /** + * Azure Location of billable resource + */ + @query("billingLocation") + billingLocation?: string; + + /** + * App Service OS type meters used for + */ + @query("osType") + osType?: string; + }, + Error = DefaultErrorResponse +>; + +/** + * Description for Check if a resource name is available. + */ +#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-operation" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +@summary("Check if a resource name is available.") +@autoRoute +@action("checknameavailability") +op checkNameAvailability is ArmProviderActionSync< + Request = ResourceNameAvailabilityRequest, + Response = ResourceNameAvailability, + Scope = SubscriptionActionScope, + Parameters = {}, + Error = DefaultErrorResponse +>; + +/** + * Get custom hostnames under this subscription + */ +#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-operation" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +@summary("Get custom hostnames under this subscription") +@autoRoute +@get +@action("customhostnameSites") +@list +op listCustomHostNameSites is ArmProviderActionSync< + Response = CustomHostnameSitesCollection, + Scope = SubscriptionActionScope, + Parameters = { + /** + * Specific hostname + */ + @query("hostname") + hostname?: string; + }, + Error = DefaultErrorResponse +>; + +/** + * Description for Get a list of available geographical regions. + */ +#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-operation" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +@summary("Get a list of available geographical regions.") +@autoRoute +@get +@action("geoRegions") +@list +op listGeoRegions is ArmProviderActionSync< + Response = GeoRegionCollection, + Scope = SubscriptionActionScope, + Parameters = { + /** + * Name of SKU used to filter the regions. + */ + @query("sku") + sku?: SkuName; + + /** + * Specify true if you want to filter to only regions that support Linux workers. + */ + @query("linuxWorkersEnabled") + linuxWorkersEnabled?: boolean; + + /** + * Specify true if you want to filter to only regions that support Xenon workers. + */ + @query("xenonWorkersEnabled") + xenonWorkersEnabled?: boolean; + + /** + * Specify true if you want to filter to only regions that support Linux Consumption Workers. + */ + @query("linuxDynamicWorkersEnabled") + linuxDynamicWorkersEnabled?: boolean; + + /** + * Specify true if you want to filter to only regions that support App Service Plans with IsCustomMode set to true. + */ + @query("customModeWorkersEnabled") + customModeWorkersEnabled?: boolean; + }, + Error = DefaultErrorResponse +>; + +/** + * Check if a resource name is available for DNL sites. + */ +#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-operation" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +@summary("Check if a resource name is available for DNL sites.") +@autoRoute +@action("checknameavailability") +op regionalCheckNameAvailability is ArmProviderActionSync< + Request = DnlResourceNameAvailabilityRequest, + Response = DnlResourceNameAvailability, + Scope = SubscriptionActionScope, + Parameters = LocationParameter, + Error = DefaultErrorResponse +>; + +/** + * Description for List all premier add-on offers. + */ +#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-operation" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +@summary("List all premier add-on offers.") +@autoRoute +@get +@action("premieraddonoffers") +@list +op listPremierAddOnOffers is ArmProviderActionSync< + Response = PremierAddOnOfferCollection, + Scope = SubscriptionActionScope, + Parameters = {}, + Error = DefaultErrorResponse +>; + +/** + * Description for List all SKUs. + */ +#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-operation" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +@summary("List all SKUs.") +@autoRoute +@get +@action("skus") +op listSkus is ArmProviderActionSync< + Response = SkuInfos, + Scope = SubscriptionActionScope, + Parameters = {}, + Error = DefaultErrorResponse +>; + +/** + * Description for Verifies if this VNET is compatible with an App Service Environment by analyzing the Network Security Group rules. + */ +#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-operation" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +@summary("Verifies if this VNET is compatible with an App Service Environment by analyzing the Network Security Group rules.") +@autoRoute +op verifyHostingEnvironmentVnet is ArmProviderActionSync< + Request = VnetParameters, + Response = VnetValidationFailureDetails, + Scope = SubscriptionActionScope, + Parameters = {}, + Error = DefaultErrorResponse +>; + +/** + * Description for Move resources between resource groups. + */ +#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-operation" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +@summary("Move resources between resource groups.") +@route("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/moveResources") +@post +op move( + ...ApiVersionParameter, + ...ResourceGroupParameter, + ...SubscriptionIdParameter, + + /** + * Object that represents the resource to move. + */ + @bodyRoot + moveResourceEnvelope: CsmMoveResourceEnvelope, +): NoContentResponse | DefaultErrorResponse; + +#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-interface-requires-decorator" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +interface GlobalOperationGroup { + /** + * Description for Gets an operation in a subscription and given region + */ + #suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-operation" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + @summary("Gets an operation in a subscription and given region") + @route("/subscriptions/{subscriptionId}/providers/Microsoft.Web/locations/{location}/operations/{operationId}") + @get + getSubscriptionOperationWithAsyncResponse( + ...ApiVersionParameter, + ...LocationResourceParameter, + + /** + * Operation Id + */ + @path + operationId: string, + + ...SubscriptionIdParameter, + ): NoContentResponse | DefaultErrorResponse; +} + +#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-interface-requires-decorator" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +interface ProviderOperationGroup { + /** + * Description for Get available application frameworks and their versions + */ + @summary("Get available application frameworks and their versions") + @autoRoute + @get + @action("availableStacks") + @list + getAvailableStacks is ArmProviderActionSync< + Response = ApplicationStackCollection, + Parameters = { + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + @query("osTypeSelected") + osTypeSelected?: ProviderOsTypeSelected; + }, + Error = DefaultErrorResponse + >; + /** + * Description for Get available Function app frameworks and their versions + */ + @summary("Get available Function app frameworks and their versions") + @autoRoute + @get + @action("functionAppStacks") + @list + getFunctionAppStacks is ArmProviderActionSync< + Response = FunctionAppStackCollection, + Parameters = { + /** + * Stack OS Type + */ + @query("stackOsType") + stackOsType?: ProviderStackOsType; + }, + Error = DefaultErrorResponse + >; + /** + * Description for Get available Function app frameworks and their versions for location + */ + @summary("Get available Function app frameworks and their versions for location") + @autoRoute + @get + @action("functionAppStacks") + @list + getFunctionAppStacksForLocation is ArmProviderActionSync< + Response = FunctionAppStackCollection, + Parameters = { + ...LocationParameter; + + /** + * Stack OS Type + */ + @query("stackOsType") + stackOsType?: ProviderStackOsType; + }, + Error = DefaultErrorResponse + >; + /** + * Description for Get available Web app frameworks and their versions for location + */ + @summary("Get available Web app frameworks and their versions for location") + @autoRoute + @get + @action("webAppStacks") + @list + getWebAppStacksForLocation is ArmProviderActionSync< + Response = WebAppStackCollection, + Parameters = { + ...LocationParameter; + + /** + * Stack OS Type + */ + @query("stackOsType") + stackOsType?: ProviderStackOsType; + }, + Error = DefaultErrorResponse + >; + /** + * Description for Get available Web app frameworks and their versions + */ + @summary("Get available Web app frameworks and their versions") + @autoRoute + @get + @action("webAppStacks") + @list + getWebAppStacks is ArmProviderActionSync< + Response = WebAppStackCollection, + Parameters = { + /** + * Stack OS Type + */ + @query("stackOsType") + stackOsType?: ProviderStackOsType; + }, + Error = DefaultErrorResponse + >; + /** + * Description for Get available application frameworks and their versions + */ + @summary("Get available application frameworks and their versions") + @autoRoute + @get + @action("availableStacks") + @list + getAvailableStacksOnPrem is ArmProviderActionSync< + Response = ApplicationStackCollection, + Scope = SubscriptionActionScope, + Parameters = { + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + @query("osTypeSelected") + osTypeSelected?: ProviderOsTypeSelected; + }, + Error = DefaultErrorResponse + >; +} + +#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-interface-requires-decorator" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +interface RecommendationsOperationGroup { + /** + * Description for List all recommendations for a subscription. + */ + @summary("List all recommendations for a subscription.") + @autoRoute + @get + @action("recommendations") + @list + list is ArmProviderActionSync< + Response = RecommendationCollection, + Scope = SubscriptionActionScope, + Parameters = { + /** + * Specify true to return only the most critical recommendations. The default is false, which returns all recommendations. + */ + @query("featured") + featured?: boolean; + + /** + * Filter is specified by using OData syntax. Example: $filter=channel eq 'Api' or channel eq 'Notification' and startTime eq 2014-01-01T00:00:00Z and endTime eq 2014-12-31T23:59:59Z and timeGrain eq duration'[PT1H|PT1M|P1D] + */ + @query("$filter") + $filter?: string; + }, + Error = DefaultErrorResponse + >; + /** + * Description for Reset all recommendation opt-out settings for a subscription. + */ + @summary("Reset all recommendation opt-out settings for a subscription.") + @autoRoute + @action("recommendations/reset") + resetAllFilters is ArmProviderActionSync< + Scope = SubscriptionActionScope, + Parameters = {}, + Error = DefaultErrorResponse + >; + /** + * Description for Disables the specified rule so it will not apply to a subscription in the future. + */ + @summary("Disables the specified rule so it will not apply to a subscription in the future.") + @autoRoute + @action("disable") + disableRecommendationForSubscription is ArmProviderActionSync< + Response = { + @body body: void; + }, + Scope = Extension.Subscription, + Parameters = { + /** + * Rule name + */ + @path + @segment("recommendations") + name: string; + }, + Error = DefaultErrorResponse + >; +} + +#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-interface-requires-decorator" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +interface GetUsagesInLocationOperationGroup { + /** + * List usages in cores for all skus used by a subscription in a given location, for a specific quota type. + */ + #suppress "@azure-tools/typespec-azure-core/no-openapi" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + @summary("Lists subscription core usages for all skus used in a location, for a given type of quota.") + @operationId("GetUsagesInLocation_list") + @autoRoute + @get + @action("usages") + @list + list is ArmProviderActionSync< + Response = CsmUsageQuotaCollection, + Scope = SubscriptionActionScope, + Parameters = LocationParameter, + Error = DefaultErrorResponse + >; +} + +#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-interface-requires-decorator" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +interface StaticSitesOperationGroup { + /** + * Description for Generates a preview workflow file for the static site + */ + @summary("Generates a preview workflow file for the static site") + @autoRoute + @action("previewStaticSiteWorkflowFile") + previewWorkflow is ArmProviderActionSync< + Request = StaticSitesWorkflowPreviewRequest, + Response = StaticSitesWorkflowPreview, + Scope = SubscriptionActionScope, + Parameters = LocationParameter, + Error = DefaultErrorResponse + >; +} diff --git a/packages/typespec-test/test/AppService/tspconfig.yaml b/packages/typespec-test/test/AppService/tspconfig.yaml new file mode 100644 index 0000000000..1e703b951f --- /dev/null +++ b/packages/typespec-test/test/AppService/tspconfig.yaml @@ -0,0 +1,10 @@ +emit: ["@azure-tools/typespec-ts"] +options: + "@azure-tools/typespec-ts": + generate-samples: true + azure-sdk-for-js: false + experimental-extensible-enums: true + emitter-output-dir: "{project-root}/generated/typespec-ts" + compatibility-lro: true + package-details: + name: "@azure/arm-appservice" diff --git a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ArtifactManifestCreate.json b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ArtifactManifestCreate.json new file mode 100644 index 0000000000..3ac9816ddc --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ArtifactManifestCreate.json @@ -0,0 +1,79 @@ +{ + "parameters": { + "api-version": "2025-03-30", + "artifactManifestName": "TestManifest", + "artifactStoreName": "TestArtifactStore", + "parameters": { + "location": "eastus", + "properties": { + "artifacts": [ + { + "artifactName": "fed-rbac", + "artifactType": "OCIArtifact", + "artifactVersion": "1.0.0" + }, + { + "artifactName": "nginx", + "artifactType": "OCIArtifact", + "artifactVersion": "v1" + } + ] + } + }, + "publisherName": "TestPublisher", + "resourceGroupName": "rg", + "subscriptionId": "subid" + }, + "responses": { + "200": { + "body": { + "name": "TestManifest", + "type": "microsoft.hybridnetwork/publishers/artifactStores/artifactManifests", + "id": "/subscriptions/subid/resourcegroups/rg/providers/microsoft.hybridnetwork/publishers/UnityCloud/artifactStores/TestArtifactStore/artifactManifests/TestManifest", + "location": "eastus", + "properties": { + "artifactManifestState": "Uploaded", + "artifacts": [ + { + "artifactName": "fed-rbac", + "artifactType": "OCIArtifact", + "artifactVersion": "1.0.0" + }, + { + "artifactName": "nginx", + "artifactType": "OCIArtifact", + "artifactVersion": "v1" + } + ], + "provisioningState": "Succeeded" + } + } + }, + "201": { + "body": { + "name": "TestManifest", + "type": "microsoft.hybridnetwork/publishers/artifactStores/artifactManifests", + "id": "/subscriptions/subid/resourcegroups/rg/providers/microsoft.hybridnetwork/publishers/UnityCloud/artifactStores/TestArtifactStore/artifactManifests/TestManifest", + "location": "eastus", + "properties": { + "artifactManifestState": "Uploading", + "artifacts": [ + { + "artifactName": "fed-rbac", + "artifactType": "OCIArtifact", + "artifactVersion": "1.0.0" + }, + { + "artifactName": "nginx", + "artifactType": "OCIArtifact", + "artifactVersion": "v1" + } + ], + "provisioningState": "Succeeded" + } + } + } + }, + "operationId": "ArtifactManifests_CreateOrUpdate", + "title": "Create or update the artifact manifest resource" +} diff --git a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ArtifactManifestDelete.json b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ArtifactManifestDelete.json new file mode 100644 index 0000000000..3ae8868577 --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ArtifactManifestDelete.json @@ -0,0 +1,20 @@ +{ + "parameters": { + "api-version": "2025-03-30", + "artifactManifestName": "TestManifest", + "artifactStoreName": "TestArtifactStore", + "publisherName": "TestPublisher", + "resourceGroupName": "rg", + "subscriptionId": "subid" + }, + "responses": { + "202": { + "headers": { + "location": "https://management.azure.com/providers/microsoft.hybridnetwork/locations/EASTUS2EUAP/operationStatuses/0b37c625-7e7c-49c5-b86e-c817c85acb5d*B77A34159CA34A0BD446D3BC7EC120649181590DDF991982765DAC1A87491B2D?api-version=2021-05-01" + } + }, + "204": {} + }, + "operationId": "ArtifactManifests_Delete", + "title": "Delete a artifact manifest resource" +} diff --git a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ArtifactManifestGet.json b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ArtifactManifestGet.json new file mode 100644 index 0000000000..49d2920699 --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ArtifactManifestGet.json @@ -0,0 +1,38 @@ +{ + "parameters": { + "api-version": "2025-03-30", + "artifactManifestName": "TestManifest", + "artifactStoreName": "TestArtifactStore", + "publisherName": "TestPublisher", + "resourceGroupName": "rg", + "subscriptionId": "subid" + }, + "responses": { + "200": { + "body": { + "name": "TestManifest", + "type": "microsoft.hybridnetwork/publishers/artifactStores/artifactManifests", + "id": "/subscriptions/subid/providers/microsoft.hybridnetwork/publishers/UnityCloud/artifactStores/TestArtifactStore/artifactManifests/TestManifest", + "location": "eastus", + "properties": { + "artifactManifestState": "Uploaded", + "artifacts": [ + { + "artifactName": "fed-rbac", + "artifactType": "OCIArtifact", + "artifactVersion": "1.0.0" + }, + { + "artifactName": "nginx", + "artifactType": "OCIArtifact", + "artifactVersion": "v1" + } + ], + "provisioningState": "Succeeded" + } + } + } + }, + "operationId": "ArtifactManifests_Get", + "title": "Get a artifact manifest resource" +} diff --git a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ArtifactManifestListByArtifactStore.json b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ArtifactManifestListByArtifactStore.json new file mode 100644 index 0000000000..0d0d9867e1 --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ArtifactManifestListByArtifactStore.json @@ -0,0 +1,41 @@ +{ + "parameters": { + "api-version": "2025-03-30", + "artifactStoreName": "TestArtifactStore", + "publisherName": "TestPublisher", + "resourceGroupName": "rg", + "subscriptionId": "subid" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "name": "TestManifest", + "type": "microsoft.hybridnetwork/publishers/artifactStores/artifactManifests", + "id": "/subscriptions/subid/providers/microsoft.hybridnetwork/publishers/TestPublisher/artifactStores/TestArtifactStore/artifactManifests/TestManifest", + "location": "eastus", + "properties": { + "artifactManifestState": "Uploaded", + "artifacts": [ + { + "artifactName": "fed-rbac", + "artifactType": "OCIArtifact", + "artifactVersion": "1.0.0" + }, + { + "artifactName": "nginx", + "artifactType": "OCIArtifact", + "artifactVersion": "v1" + } + ], + "provisioningState": "Succeeded" + } + } + ] + } + } + }, + "operationId": "ArtifactManifests_ListByArtifactStore", + "title": "Get artifact manifest list resource" +} diff --git a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ArtifactManifestListCredential.json b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ArtifactManifestListCredential.json new file mode 100644 index 0000000000..4e9a5f6120 --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ArtifactManifestListCredential.json @@ -0,0 +1,26 @@ +{ + "parameters": { + "api-version": "2025-03-30", + "artifactManifestName": "TestArtifactManifestName", + "artifactStoreName": "TestArtifactStore", + "publisherName": "TestPublisher", + "resourceGroupName": "rg", + "subscriptionId": "subid" + }, + "responses": { + "200": { + "body": { + "acrServerUrl": "test.azurecr.io", + "acrToken": "dummytoken", + "credentialType": "AzureContainerRegistryScopedToken", + "expiry": "2022-06-07T18:01:41.334+00:00", + "repositories": [ + "" + ], + "username": "dummyuser" + } + } + }, + "operationId": "ArtifactManifests_ListCredential", + "title": "List a credential for artifact manifest" +} diff --git a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ArtifactManifestUpdateState.json b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ArtifactManifestUpdateState.json new file mode 100644 index 0000000000..407a0c24d6 --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ArtifactManifestUpdateState.json @@ -0,0 +1,27 @@ +{ + "parameters": { + "api-version": "2025-03-30", + "artifactManifestName": "TestArtifactManifestName", + "artifactStoreName": "TestArtifactStore", + "parameters": { + "artifactManifestState": "Uploaded" + }, + "publisherName": "TestPublisher", + "resourceGroupName": "rg", + "subscriptionId": "subid" + }, + "responses": { + "200": { + "body": { + "artifactManifestState": "Uploaded" + } + }, + "202": { + "headers": { + "location": "https://management.azure.com/providers/microsoft.hybridnetwork/locations/EASTUS2EUAP/operationStatuses/0b37c625-7e7c-49c5-b86e-c817c85acb5d*B77A34159CA34A0BD446D3BC7EC120649181590DDF991982765DAC1A87491B2D?api-version=2021-05-01" + } + } + }, + "operationId": "ArtifactManifests_UpdateState", + "title": "Update artifact manifest state" +} diff --git a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ArtifactManifestUpdateTags.json b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ArtifactManifestUpdateTags.json new file mode 100644 index 0000000000..f027aa7eba --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ArtifactManifestUpdateTags.json @@ -0,0 +1,48 @@ +{ + "parameters": { + "api-version": "2025-03-30", + "artifactManifestName": "TestManifest", + "artifactStoreName": "TestArtifactStore", + "parameters": { + "tags": { + "tag1": "value1", + "tag2": "value2" + } + }, + "publisherName": "TestPublisher", + "resourceGroupName": "rg", + "subscriptionId": "subid" + }, + "responses": { + "200": { + "body": { + "name": "TestManifest", + "type": "microsoft.hybridnetwork/publishers/artifactStores/artifactManifests", + "id": "/subscriptions/subid/resourcegroups/rg/providers/microsoft.hybridnetwork/publishers/UnityCloud/artifactStores/TestArtifactStore/artifactManifests/TestManifest", + "location": "eastus", + "properties": { + "artifactManifestState": "Uploaded", + "artifacts": [ + { + "artifactName": "fed-rbac", + "artifactType": "OCIArtifact", + "artifactVersion": "1.0.0" + }, + { + "artifactName": "nginx", + "artifactType": "OCIArtifact", + "artifactVersion": "v1" + } + ], + "provisioningState": "Succeeded" + }, + "tags": { + "tag1": "value1", + "tag2": "value2" + } + } + } + }, + "operationId": "ArtifactManifests_Update", + "title": "Update a artifact manifest resource tags" +} diff --git a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ArtifactStoreAddNFCEndPoints.json b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ArtifactStoreAddNFCEndPoints.json new file mode 100644 index 0000000000..7c2b326a25 --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ArtifactStoreAddNFCEndPoints.json @@ -0,0 +1,25 @@ +{ + "parameters": { + "api-version": "2025-03-30", + "artifactStoreName": "TestArtifactStore", + "parameters": { + "networkFabricControllerIds": [ + { + "id": "/subscriptions/testsubid/resourceGroups/testNFCMRG/providers/Microsoft.ManagedNetworkFabric/networkFabricControllers/testNFCControllerId" + } + ] + }, + "publisherName": "TestPublisher", + "resourceGroupName": "rg", + "subscriptionId": "subid" + }, + "responses": { + "202": { + "headers": { + "location": "https://management.azure.com/providers/microsoft.hybridnetwork/locations/EASTUS2EUAP/operationStatuses/0b37c625-7e7c-49c5-b86e-c817c85acb5d*B77A34159CA34A0BD446D3BC7EC120649181590DDF991982765DAC1A87491B2D?api-version=2021-05-01" + } + } + }, + "operationId": "ArtifactStores_AddNetworkFabricControllerEndPoints", + "title": "Add Network Fabric Endpoint" +} diff --git a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ArtifactStoreApprovePrivateEndPoints.json b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ArtifactStoreApprovePrivateEndPoints.json new file mode 100644 index 0000000000..49ada58ec0 --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ArtifactStoreApprovePrivateEndPoints.json @@ -0,0 +1,25 @@ +{ + "parameters": { + "api-version": "2025-03-30", + "artifactStoreName": "TestArtifactStore", + "parameters": { + "manualPrivateEndPointConnections": [ + { + "id": "/subscriptions/testSub/resourceGroups/testRG/providers/Microsoft.Network/privateEndpoints/newpetest" + } + ] + }, + "publisherName": "TestPublisher", + "resourceGroupName": "rg", + "subscriptionId": "subid" + }, + "responses": { + "202": { + "headers": { + "location": "https://management.azure.com/providers/microsoft.hybridnetwork/locations/EASTUS2EUAP/operationStatuses/0b37c625-7e7c-49c5-b86e-c817c85acb5d*B77A34159CA34A0BD446D3BC7EC120649181590DDF991982765DAC1A87491B2D?api-version=2021-05-01" + } + } + }, + "operationId": "ArtifactStores_ApprovePrivateEndPoints", + "title": "Approve manual private endpoints" +} diff --git a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ArtifactStoreCreate.json b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ArtifactStoreCreate.json new file mode 100644 index 0000000000..5974cf18b2 --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ArtifactStoreCreate.json @@ -0,0 +1,58 @@ +{ + "parameters": { + "api-version": "2025-03-30", + "artifactStoreName": "TestArtifactStore", + "parameters": { + "location": "eastus", + "properties": { + "managedResourceGroupConfiguration": { + "name": "testRg", + "location": "eastus" + }, + "replicationStrategy": "SingleReplication", + "storeType": "AzureContainerRegistry" + } + }, + "publisherName": "TestPublisher", + "resourceGroupName": "rg", + "subscriptionId": "subid" + }, + "responses": { + "200": { + "body": { + "name": "TestArtifactStore", + "type": "microsoft.hybridnetwork/publishers/artifactStores", + "id": "/subscriptions/subid/providers/microsoft.hybridnetwork/publishers/TestPublisher/artifactStores/TestArtifactStore", + "location": "eastus", + "properties": { + "managedResourceGroupConfiguration": { + "name": "testRg", + "location": "eastus" + }, + "replicationStrategy": "SingleReplication", + "storageResourceId": "TestResourceId", + "storeType": "AzureContainerRegistry" + } + } + }, + "201": { + "body": { + "name": "TestArtifactStore", + "type": "microsoft.hybridnetwork/publishers/artifactStores", + "id": "/subscriptions/subid/providers/microsoft.hybridnetwork/publishers/TestPublisher/artifactStores/TestArtifactStore", + "location": "eastus", + "properties": { + "managedResourceGroupConfiguration": { + "name": "testRg", + "location": "eastus" + }, + "replicationStrategy": "SingleReplication", + "storageResourceId": "TestResourceId", + "storeType": "AzureContainerRegistry" + } + } + } + }, + "operationId": "ArtifactStores_CreateOrUpdate", + "title": "Create or update an artifact store of publisher resource" +} diff --git a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ArtifactStoreCreateContainer.json b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ArtifactStoreCreateContainer.json new file mode 100644 index 0000000000..a937ec614a --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ArtifactStoreCreateContainer.json @@ -0,0 +1,61 @@ +{ + "parameters": { + "api-version": "2025-03-30", + "artifactStoreName": "TestArtifactStore", + "parameters": { + "location": "eastus", + "properties": { + "backingResourcePublicNetworkAccess": "Disabled", + "managedResourceGroupConfiguration": { + "name": "testRg", + "location": "eastus" + }, + "replicationStrategy": "SingleReplication", + "storeType": "AzureContainerRegistry" + } + }, + "publisherName": "TestPublisher", + "resourceGroupName": "rg", + "subscriptionId": "subid" + }, + "responses": { + "200": { + "body": { + "name": "TestArtifactStore", + "type": "microsoft.hybridnetwork/publishers/artifactStores", + "id": "/subscriptions/subid/providers/microsoft.hybridnetwork/publishers/TestPublisher/artifactStores/TestArtifactStore", + "location": "eastus", + "properties": { + "backingResourcePublicNetworkAccess": "Disabled", + "managedResourceGroupConfiguration": { + "name": "testRg", + "location": "eastus" + }, + "replicationStrategy": "SingleReplication", + "storageResourceId": "TestResourceId", + "storeType": "AzureContainerRegistry" + } + } + }, + "201": { + "body": { + "name": "TestArtifactStore", + "type": "microsoft.hybridnetwork/publishers/artifactStores", + "id": "/subscriptions/subid/providers/microsoft.hybridnetwork/publishers/TestPublisher/artifactStores/TestArtifactStore", + "location": "eastus", + "properties": { + "backingResourcePublicNetworkAccess": "Disabled", + "managedResourceGroupConfiguration": { + "name": "testRg", + "location": "eastus" + }, + "replicationStrategy": "SingleReplication", + "storageResourceId": "TestResourceId", + "storeType": "AzureContainerRegistry" + } + } + } + }, + "operationId": "ArtifactStores_CreateOrUpdate", + "title": "Create or update an artifact store of publisher resource with container registry" +} diff --git a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ArtifactStoreCreateStorage.json b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ArtifactStoreCreateStorage.json new file mode 100644 index 0000000000..40b33ebd6c --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ArtifactStoreCreateStorage.json @@ -0,0 +1,61 @@ +{ + "parameters": { + "api-version": "2025-03-30", + "artifactStoreName": "TestArtifactStore", + "parameters": { + "location": "eastus", + "properties": { + "backingResourcePublicNetworkAccess": "Enabled", + "managedResourceGroupConfiguration": { + "name": "testRg", + "location": "eastus" + }, + "replicationStrategy": "SingleReplication", + "storeType": "AzureStorageAccount" + } + }, + "publisherName": "TestPublisher", + "resourceGroupName": "rg", + "subscriptionId": "subid" + }, + "responses": { + "200": { + "body": { + "name": "TestArtifactStore", + "type": "microsoft.hybridnetwork/publishers/artifactStores", + "id": "/subscriptions/subid/providers/microsoft.hybridnetwork/publishers/TestPublisher/artifactStores/TestArtifactStore", + "location": "eastus", + "properties": { + "backingResourcePublicNetworkAccess": "Enabled", + "managedResourceGroupConfiguration": { + "name": "testRg", + "location": "eastus" + }, + "replicationStrategy": "SingleReplication", + "storageResourceId": "TestResourceId", + "storeType": "AzureStorageAccount" + } + } + }, + "201": { + "body": { + "name": "TestArtifactStore", + "type": "microsoft.hybridnetwork/publishers/artifactStores", + "id": "/subscriptions/subid/providers/microsoft.hybridnetwork/publishers/TestPublisher/artifactStores/TestArtifactStore", + "location": "eastus", + "properties": { + "backingResourcePublicNetworkAccess": "Enabled", + "managedResourceGroupConfiguration": { + "name": "testRg", + "location": "eastus" + }, + "replicationStrategy": "SingleReplication", + "storageResourceId": "TestResourceId", + "storeType": "AzureStorageAccount" + } + } + } + }, + "operationId": "ArtifactStores_CreateOrUpdate", + "title": "Create or update an artifact store of publisher resource with storage" +} diff --git a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ArtifactStoreDelete.json b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ArtifactStoreDelete.json new file mode 100644 index 0000000000..2ebd7fb519 --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ArtifactStoreDelete.json @@ -0,0 +1,19 @@ +{ + "parameters": { + "api-version": "2025-03-30", + "artifactStoreName": "TestArtifactStore", + "publisherName": "TestPublisher", + "resourceGroupName": "rg", + "subscriptionId": "subid" + }, + "responses": { + "202": { + "headers": { + "location": "https://management.azure.com/providers/microsoft.hybridnetwork/locations/EASTUS2EUAP/operationStatuses/0b37c625-7e7c-49c5-b86e-c817c85acb5d*B77A34159CA34A0BD446D3BC7EC120649181590DDF991982765DAC1A87491B2D?api-version=2021-05-01" + } + }, + "204": {} + }, + "operationId": "ArtifactStores_Delete", + "title": "Delete a artifact store of publisher resource" +} diff --git a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ArtifactStoreDeleteNFCEndPoints.json b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ArtifactStoreDeleteNFCEndPoints.json new file mode 100644 index 0000000000..c209e69845 --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ArtifactStoreDeleteNFCEndPoints.json @@ -0,0 +1,25 @@ +{ + "parameters": { + "api-version": "2025-03-30", + "artifactStoreName": "TestArtifactStore", + "parameters": { + "networkFabricControllerIds": [ + { + "id": "/subscriptions/testsubid/resourceGroups/testNFCMRG/providers/Microsoft.ManagedNetworkFabric/networkFabricControllers/testNFCControllerId" + } + ] + }, + "publisherName": "TestPublisher", + "resourceGroupName": "rg", + "subscriptionId": "subid" + }, + "responses": { + "202": { + "headers": { + "location": "https://management.azure.com/providers/microsoft.hybridnetwork/locations/EASTUS2EUAP/operationStatuses/0b37c625-7e7c-49c5-b86e-c817c85acb5d*B77A34159CA34A0BD446D3BC7EC120649181590DDF991982765DAC1A87491B2D?api-version=2021-05-01" + } + } + }, + "operationId": "ArtifactStores_DeleteNetworkFabricControllerEndPoints", + "title": "Delete Network Fabric Endpoints" +} diff --git a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ArtifactStoreGet.json b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ArtifactStoreGet.json new file mode 100644 index 0000000000..7e97629d44 --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ArtifactStoreGet.json @@ -0,0 +1,30 @@ +{ + "parameters": { + "api-version": "2025-03-30", + "artifactStoreName": "TestArtifactStoreName", + "publisherName": "TestPublisher", + "resourceGroupName": "rg", + "subscriptionId": "subid" + }, + "responses": { + "200": { + "body": { + "name": "TestArtifactStore", + "type": "microsoft.hybridnetwork/publishers/artifactStores", + "id": "/subscriptions/subid/providers/microsoft.hybridnetwork/publishers/TestPublisher/artifactStores/TestArtifactStore", + "location": "eastus", + "properties": { + "managedResourceGroupConfiguration": { + "name": "testRg", + "location": "eastus" + }, + "replicationStrategy": "SingleReplication", + "storageResourceId": "TestResourceId", + "storeType": "AzureContainerRegistry" + } + } + } + }, + "operationId": "ArtifactStores_Get", + "title": "Get a artifact store resource" +} diff --git a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ArtifactStoreListNFCEndPoints.json b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ArtifactStoreListNFCEndPoints.json new file mode 100644 index 0000000000..366ca66d35 --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ArtifactStoreListNFCEndPoints.json @@ -0,0 +1,31 @@ +{ + "parameters": { + "api-version": "2025-03-30", + "artifactStoreName": "TestArtifactStore", + "publisherName": "TestPublisher", + "resourceGroupName": "rg", + "subscriptionId": "subid" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "networkFabricControllerIds": [ + { + "id": "/subscriptions/testsubid/resourceGroups/testNFCMRG/providers/Microsoft.ManagedNetworkFabric/networkFabricControllers/testNFCControllerId" + } + ] + } + ] + } + }, + "202": { + "headers": { + "location": "https://management.azure.com/providers/microsoft.hybridnetwork/locations/EASTUS2EUAP/operationStatuses/0b37c625-7e7c-49c5-b86e-c817c85acb5d*B77A34159CA34A0BD446D3BC7EC120649181590DDF991982765DAC1A87491B2D?api-version=2021-05-01" + } + } + }, + "operationId": "ArtifactStores_ListNetworkFabricControllerPrivateEndPoints", + "title": "List Network Fabric Endpoints" +} diff --git a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ArtifactStoreListPrivateEndPoints.json b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ArtifactStoreListPrivateEndPoints.json new file mode 100644 index 0000000000..9dde9dad1a --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ArtifactStoreListPrivateEndPoints.json @@ -0,0 +1,31 @@ +{ + "parameters": { + "api-version": "2025-03-30", + "artifactStoreName": "TestArtifactStore", + "publisherName": "TestPublisher", + "resourceGroupName": "rg", + "subscriptionId": "subid" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "manualPrivateEndPointConnections": [ + { + "id": "/subscriptions/testSub/resourceGroups/testRG/providers/Microsoft.Network/privateEndpoints/newpetest" + } + ] + } + ] + } + }, + "202": { + "headers": { + "location": "https://management.azure.com/providers/microsoft.hybridnetwork/locations/EASTUS2EUAP/operationStatuses/0b37c625-7e7c-49c5-b86e-c817c85acb5d*B77A34159CA34A0BD446D3BC7EC120649181590DDF991982765DAC1A87491B2D?api-version=2021-05-01" + } + } + }, + "operationId": "ArtifactStores_ListPrivateEndPoints", + "title": "List Manual Private Endpoints" +} diff --git a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ArtifactStoreRemovePrivateEndPoints.json b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ArtifactStoreRemovePrivateEndPoints.json new file mode 100644 index 0000000000..f3b9559f2f --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ArtifactStoreRemovePrivateEndPoints.json @@ -0,0 +1,25 @@ +{ + "parameters": { + "api-version": "2025-03-30", + "artifactStoreName": "TestArtifactStore", + "parameters": { + "manualPrivateEndPointConnections": [ + { + "id": "/subscriptions/testSub/resourceGroups/testRG/providers/Microsoft.Network/privateEndpoints/newpetest" + } + ] + }, + "publisherName": "TestPublisher", + "resourceGroupName": "rg", + "subscriptionId": "subid" + }, + "responses": { + "202": { + "headers": { + "location": "https://management.azure.com/providers/microsoft.hybridnetwork/locations/EASTUS2EUAP/operationStatuses/0b37c625-7e7c-49c5-b86e-c817c85acb5d*B77A34159CA34A0BD446D3BC7EC120649181590DDF991982765DAC1A87491B2D?api-version=2021-05-01" + } + } + }, + "operationId": "ArtifactStores_RemovePrivateEndPoints", + "title": "Remove Manual Endpoint" +} diff --git a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ArtifactStoreUpdateTags.json b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ArtifactStoreUpdateTags.json new file mode 100644 index 0000000000..d5926c1ad0 --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ArtifactStoreUpdateTags.json @@ -0,0 +1,40 @@ +{ + "parameters": { + "api-version": "2025-03-30", + "artifactStoreName": "TestArtifactStore", + "parameters": { + "tags": { + "tag1": "value1", + "tag2": "value2" + } + }, + "publisherName": "TestPublisher", + "resourceGroupName": "rg", + "subscriptionId": "subid" + }, + "responses": { + "200": { + "body": { + "name": "TestArtifactStore", + "type": "microsoft.hybridnetwork/publishers/artifactStores", + "id": "/subscriptions/subid/providers/microsoft.hybridnetwork/publishers/TestPublisher/artifactStores/TestArtifactStore", + "location": "eastus", + "properties": { + "managedResourceGroupConfiguration": { + "name": "testRg", + "location": "eastus" + }, + "replicationStrategy": "SingleReplication", + "storageResourceId": "TestResourceId", + "storeType": "AzureContainerRegistry" + }, + "tags": { + "tag1": "value1", + "tag2": "value2" + } + } + } + }, + "operationId": "ArtifactStores_Update", + "title": "Update artifact store resource tags" +} diff --git a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ArtifactStoresListByPublisherName.json b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ArtifactStoresListByPublisherName.json new file mode 100644 index 0000000000..b1535b9981 --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ArtifactStoresListByPublisherName.json @@ -0,0 +1,33 @@ +{ + "parameters": { + "api-version": "2025-03-30", + "publisherName": "TestPublisher", + "resourceGroupName": "rg", + "subscriptionId": "subid" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "name": "TestArtifactStore", + "type": "microsoft.hybridnetwork/publishers/artifactStores", + "id": "/subscriptions/subid/providers/microsoft.hybridnetwork/publishers/TestPublisher/artifactStores/TestArtifactStore", + "location": "eastus", + "properties": { + "managedResourceGroupConfiguration": { + "name": "testRg", + "location": "eastus" + }, + "replicationStrategy": "SingleReplication", + "storageResourceId": "TestResourceId", + "storeType": "AzureContainerRegistry" + } + } + ] + } + } + }, + "operationId": "ArtifactStores_ListByPublisher", + "title": "Get application groups under a publisher resource" +} diff --git a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/AzureCore/VirtualNetworkFunctionCreate.json b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/AzureCore/VirtualNetworkFunctionCreate.json new file mode 100644 index 0000000000..f7f1a97969 --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/AzureCore/VirtualNetworkFunctionCreate.json @@ -0,0 +1,76 @@ +{ + "parameters": { + "api-version": "2025-03-30", + "networkFunctionName": "testNf", + "parameters": { + "location": "eastus", + "properties": { + "allowSoftwareUpdate": false, + "configurationType": "Open", + "deploymentValues": "{\"virtualMachineName\":\"test-VM\",\"cpuCores\":4,\"memorySizeGB\":8,\"cloudServicesNetworkAttachment\":{\"attachedNetworkId\":\"test-csnet\",\"ipAllocationMethod\":\"Dynamic\",\"networkAttachmentName\":\"test-cs-vlan\"},\"networkAttachments\":[{\"attachedNetworkId\":\"test-l3vlan\",\"defaultGateway\":\"True\",\"ipAllocationMethod\":\"Dynamic\",\"networkAttachmentName\":\"test-vlan\"}],\"sshPublicKeys\":[{\"keyData\":\"ssh-rsa CMIIIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEA0TqlveKKlc2MFvEmuXJiLGBsY1t4ML4uiRADGSZlnc+7Ugv3h+MCjkkwOKiOdsNo8k4KSBIG5GcQfKYOOd17AJvqCL6cGQbaLuqv0a64jeDm8oO8/xN/IM0oKw7rMr/2oAJOgIsfeXPkRxWWic9AVIS++H5Qi2r7bUFX+cqFsyUCAwEBBQ==\"}],\"storageProfile\":{\"osDisk\":{\"createOption\":\"Ephemeral\",\"deleteOption\":\"Delete\",\"diskSizeGB\":10}},\"userData\":\"testUserData\",\"adminUsername\":\"testUser\",\"virtioInterface\":\"Transitional\",\"isolateEmulatorThread\":\"False\",\"bootMethod\":\"BIOS\",\"placementHints\":[]}", + "networkFunctionDefinitionVersionResourceReference": { + "id": "/subscriptions/subid/resourcegroups/rg/providers/Microsoft.HybridNetwork/publishers/testVendor/networkFunctionDefinitionGroups/testnetworkFunctionDefinitionGroupName/networkFunctionDefinitionVersions/1.0.1", + "idType": "Open" + }, + "nfviId": "/subscriptions/subid/resourceGroups/testResourceGroup", + "nfviType": "AzureCore" + } + }, + "resourceGroupName": "rg", + "subscriptionId": "subid" + }, + "responses": { + "200": { + "body": { + "name": "testNf", + "type": "Microsoft.HybridNetwork/networkFunctions", + "id": "/subscriptions/subid/resourcegroups/rg/providers/Microsoft.HybridNetwork/networkFunctions/testNf", + "location": "eastus", + "properties": { + "allowSoftwareUpdate": false, + "configurationType": "Open", + "deploymentValues": "{\"virtualMachineName\":\"test-VM\",\"cpuCores\":4,\"memorySizeGB\":8,\"cloudServicesNetworkAttachment\":{\"attachedNetworkId\":\"test-csnet\",\"ipAllocationMethod\":\"Dynamic\",\"networkAttachmentName\":\"test-cs-vlan\"},\"networkAttachments\":[{\"attachedNetworkId\":\"test-l3vlan\",\"defaultGateway\":\"True\",\"ipAllocationMethod\":\"Dynamic\",\"networkAttachmentName\":\"test-vlan\"}],\"sshPublicKeys\":[{\"keyData\":\"ssh-rsa CMIIIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEA0TqlveKKlc2MFvEmuXJiLGBsY1t4ML4uiRADGSZlnc+7Ugv3h+MCjkkwOKiOdsNo8k4KSBIG5GcQfKYOOd17AJvqCL6cGQbaLuqv0a64jeDm8oO8/xN/IM0oKw7rMr/2oAJOgIsfeXPkRxWWic9AVIS++H5Qi2r7bUFX+cqFsyUCAwEBBQ==\"}],\"storageProfile\":{\"osDisk\":{\"createOption\":\"Ephemeral\",\"deleteOption\":\"Delete\",\"diskSizeGB\":10}},\"userData\":\"testUserData\",\"adminUsername\":\"testUser\",\"virtioInterface\":\"Transitional\",\"isolateEmulatorThread\":\"False\",\"bootMethod\":\"BIOS\",\"placementHints\":[]}", + "networkFunctionDefinitionGroupName": "TestNetworkFunctionDefinitionGroupName", + "networkFunctionDefinitionOfferingLocation": "eastus", + "networkFunctionDefinitionVersion": "1.0.0", + "networkFunctionDefinitionVersionResourceReference": { + "id": "/subscriptions/subid/resourcegroups/rg/providers/Microsoft.HybridNetwork/publishers/testVendor/networkFunctionDefinitionGroups/testnetworkFunctionDefinitionGroupName/networkFunctionDefinitionVersions/1.0.1", + "idType": "Open" + }, + "nfviId": "/subscriptions/subid/resourceGroups/testResourceGroup", + "nfviType": "AzureCore", + "provisioningState": "Succeeded", + "publisherName": "TestPublisher", + "publisherScope": "Private" + } + } + }, + "201": { + "body": { + "name": "testNf", + "type": "Microsoft.HybridNetwork/networkFunctions", + "id": "/subscriptions/subid/resourcegroups/rg/providers/Microsoft.HybridNetwork/networkFunctions/testNf", + "location": "eastus", + "properties": { + "allowSoftwareUpdate": false, + "configurationType": "Open", + "deploymentValues": "{\"virtualMachineName\":\"test-VM\",\"cpuCores\":4,\"memorySizeGB\":8,\"cloudServicesNetworkAttachment\":{\"attachedNetworkId\":\"test-csnet\",\"ipAllocationMethod\":\"Dynamic\",\"networkAttachmentName\":\"test-cs-vlan\"},\"networkAttachments\":[{\"attachedNetworkId\":\"test-l3vlan\",\"defaultGateway\":\"True\",\"ipAllocationMethod\":\"Dynamic\",\"networkAttachmentName\":\"test-vlan\"}],\"sshPublicKeys\":[{\"keyData\":\"ssh-rsa CMIIIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEA0TqlveKKlc2MFvEmuXJiLGBsY1t4ML4uiRADGSZlnc+7Ugv3h+MCjkkwOKiOdsNo8k4KSBIG5GcQfKYOOd17AJvqCL6cGQbaLuqv0a64jeDm8oO8/xN/IM0oKw7rMr/2oAJOgIsfeXPkRxWWic9AVIS++H5Qi2r7bUFX+cqFsyUCAwEBBQ==\"}],\"storageProfile\":{\"osDisk\":{\"createOption\":\"Ephemeral\",\"deleteOption\":\"Delete\",\"diskSizeGB\":10}},\"userData\":\"testUserData\",\"adminUsername\":\"testUser\",\"virtioInterface\":\"Transitional\",\"isolateEmulatorThread\":\"False\",\"bootMethod\":\"BIOS\",\"placementHints\":[]}", + "networkFunctionDefinitionGroupName": "TestNetworkFunctionDefinitionGroupName", + "networkFunctionDefinitionOfferingLocation": "eastus", + "networkFunctionDefinitionVersion": "1.0.0", + "networkFunctionDefinitionVersionResourceReference": { + "id": "/subscriptions/subid/resourcegroups/rg/providers/Microsoft.HybridNetwork/publishers/testVendor/networkFunctionDefinitionGroups/testnetworkFunctionDefinitionGroupName/networkFunctionDefinitionVersions/1.0.1", + "idType": "Open" + }, + "nfviId": "/subscriptions/subid/resourceGroups/testResourceGroup", + "nfviType": "AzureCore", + "provisioningState": "Accepted", + "publisherName": "TestPublisher", + "publisherScope": "Private" + } + } + } + }, + "operationId": "NetworkFunctions_CreateOrUpdate", + "title": "Create virtual network function resource on AzureCore" +} diff --git a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/AzureCore/VirtualNetworkFunctionDefinitionVersionCreate.json b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/AzureCore/VirtualNetworkFunctionDefinitionVersionCreate.json new file mode 100644 index 0000000000..9aa3a8262b --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/AzureCore/VirtualNetworkFunctionDefinitionVersionCreate.json @@ -0,0 +1,228 @@ +{ + "parameters": { + "api-version": "2025-03-30", + "networkFunctionDefinitionGroupName": "TestNetworkFunctionDefinitionGroupName", + "networkFunctionDefinitionVersionName": "1.0.0", + "parameters": { + "location": "eastus", + "properties": { + "description": "test NFDV for AzureCore", + "deployParameters": "{\"virtualMachineName\":{\"type\":\"string\"},\"cpuCores\":{\"type\":\"int\"},\"memorySizeGB\":{\"type\":\"int\"},\"cloudServicesNetworkAttachment\":{\"type\":\"object\",\"properties\":{\"networkAttachmentName\":{\"type\":\"string\"},\"attachedNetworkId\":{\"type\":\"string\"},\"ipAllocationMethod\":{\"type\":\"string\"},\"ipv4Address\":{\"type\":\"string\"},\"ipv6Address\":{\"type\":\"string\"},\"defaultGateway\":{\"type\":\"string\"}},\"required\":[\"attachedNetworkId\",\"ipAllocationMethod\"]},\"networkAttachments\":{\"type\":\"array\",\"items\":{\"type\":\"object\",\"properties\":{\"networkAttachmentName\":{\"type\":\"string\"},\"attachedNetworkId\":{\"type\":\"string\"},\"ipAllocationMethod\":{\"type\":\"string\"},\"ipv4Address\":{\"type\":\"string\"},\"ipv6Address\":{\"type\":\"string\"},\"defaultGateway\":{\"type\":\"string\"}},\"required\":[\"attachedNetworkId\",\"ipAllocationMethod\"]}},\"storageProfile\":{\"type\":\"object\",\"properties\":{\"osDisk\":{\"type\":\"object\",\"properties\":{\"createOption\":{\"type\":\"string\"},\"deleteOption\":{\"type\":\"string\"},\"diskSizeGB\":{\"type\":\"integer\"}},\"required\":[\"diskSizeGB\"]}},\"required\":[\"osDisk\"]},\"sshPublicKeys\":{\"type\":\"array\",\"items\":{\"type\":\"object\",\"properties\":{\"keyData\":{\"type\":\"string\"}},\"required\":[\"keyData\"]}},\"userData\":{\"type\":\"string\"},\"adminUsername\":{\"type\":\"string\"},\"bootMethod\":{\"type\":\"string\",\"default\":\"UEFI\",\"enum\":[\"UEFI\",\"BIOS\"]},\"isolateEmulatorThread\":{\"type\":\"string\"},\"virtioInterface\":{\"type\":\"string\"},\"placementHints\":{\"type\":\"array\",\"items\":{\"type\":\"object\",\"properties\":{\"hintType\":{\"type\":\"string\",\"enum\":[\"Affinity\",\"AntiAffinity\"]},\"resourceId\":{\"type\":\"string\"},\"schedulingExecution\":{\"type\":\"string\",\"enum\":[\"Soft\",\"Hard\"]},\"scope\":{\"type\":\"string\"}},\"required\":[\"hintType\",\"schedulingExecution\",\"resourceId\",\"scope\"]}}}", + "networkFunctionTemplate": { + "networkFunctionApplications": [ + { + "name": "testImageRole", + "artifactProfile": { + "artifactStore": { + "id": "/subscriptions/subid/resourceGroups/rg/providers/microsoft.hybridnetwork/publishers/TestPublisher/artifactStores/TestArtifactStore" + }, + "vhdArtifactProfile": { + "vhdName": "test-image", + "vhdVersion": "1-0-0" + } + }, + "artifactType": "VhdImageFile", + "dependsOnProfile": { + "installDependsOn": [], + "uninstallDependsOn": [], + "updateDependsOn": [] + }, + "deployParametersMappingRuleProfile": { + "applicationEnablement": "Unknown", + "vhdImageMappingRuleProfile": { + "userConfiguration": "" + } + } + }, + { + "name": "testTemplateRole", + "artifactProfile": { + "artifactStore": { + "id": "/subscriptions/subid/resourceGroups/rg/providers/microsoft.hybridnetwork/publishers/TestPublisher/artifactStores/TestArtifactStore" + }, + "templateArtifactProfile": { + "templateName": "test-template", + "templateVersion": "1.0.0" + } + }, + "artifactType": "ArmTemplate", + "dependsOnProfile": { + "installDependsOn": [ + "testImageRole" + ], + "uninstallDependsOn": [ + "testImageRole" + ], + "updateDependsOn": [ + "testImageRole" + ] + }, + "deployParametersMappingRuleProfile": { + "applicationEnablement": "Unknown", + "templateMappingRuleProfile": { + "templateParameters": "{\"virtualMachineName\":\"{deployParameters.virtualMachineName}\",\"cpuCores\":\"{deployParameters.cpuCores}\",\"memorySizeGB\":\"{deployParameters.memorySizeGB}\",\"cloudServicesNetworkAttachment\":\"{deployParameters.cloudServicesNetworkAttachment}\",\"networkAttachments\":\"{deployParameters.networkAttachments}\",\"sshPublicKeys\":\"{deployParameters.sshPublicKeys}\",\"storageProfile\":\"{deployParameters.storageProfile}\",\"isolateEmulatorThread\":\"{deployParameters.isolateEmulatorThread}\",\"virtioInterface\":\"{deployParameters.virtioInterface}\",\"userData\":\"{deployParameters.userData}\",\"adminUsername\":\"{deployParameters.adminUsername}\",\"bootMethod\":\"{deployParameters.bootMethod}\",\"placementHints\":\"{deployParameters.placementHints}\"}" + } + } + } + ], + "nfviType": "AzureCore" + }, + "networkFunctionType": "VirtualNetworkFunction", + "versionState": "Preview" + } + }, + "publisherName": "TestPublisher", + "resourceGroupName": "rg", + "subscriptionId": "subid" + }, + "responses": { + "200": { + "body": { + "name": "TestVersion", + "type": "Microsoft.HybridNetwork/publishers/networkFunctionDefinitionGroups/networkFunctionDefinitionVersions", + "id": "/subscriptions/subid/resourcegroups/rg/providers/Microsoft.HybridNetwork/publishers/TestPublisher/networkFunctionDefinitionGroups/TestNetworkFunctionDefinitionGroupName/networkFunctionDefinitionVersions/1.0.0", + "location": "eastus", + "properties": { + "description": "test NFDV for AzureCore", + "deployParameters": "{\"virtualMachineName\":{\"type\":\"string\"},\"cpuCores\":{\"type\":\"int\"},\"memorySizeGB\":{\"type\":\"int\"},\"cloudServicesNetworkAttachment\":{\"type\":\"object\",\"properties\":{\"networkAttachmentName\":{\"type\":\"string\"},\"attachedNetworkId\":{\"type\":\"string\"},\"ipAllocationMethod\":{\"type\":\"string\"},\"ipv4Address\":{\"type\":\"string\"},\"ipv6Address\":{\"type\":\"string\"},\"defaultGateway\":{\"type\":\"string\"}},\"required\":[\"attachedNetworkId\",\"ipAllocationMethod\"]},\"networkAttachments\":{\"type\":\"array\",\"items\":{\"type\":\"object\",\"properties\":{\"networkAttachmentName\":{\"type\":\"string\"},\"attachedNetworkId\":{\"type\":\"string\"},\"ipAllocationMethod\":{\"type\":\"string\"},\"ipv4Address\":{\"type\":\"string\"},\"ipv6Address\":{\"type\":\"string\"},\"defaultGateway\":{\"type\":\"string\"}},\"required\":[\"attachedNetworkId\",\"ipAllocationMethod\"]}},\"storageProfile\":{\"type\":\"object\",\"properties\":{\"osDisk\":{\"type\":\"object\",\"properties\":{\"createOption\":{\"type\":\"string\"},\"deleteOption\":{\"type\":\"string\"},\"diskSizeGB\":{\"type\":\"integer\"}},\"required\":[\"diskSizeGB\"]}},\"required\":[\"osDisk\"]},\"sshPublicKeys\":{\"type\":\"array\",\"items\":{\"type\":\"object\",\"properties\":{\"keyData\":{\"type\":\"string\"}},\"required\":[\"keyData\"]}},\"userData\":{\"type\":\"string\"},\"adminUsername\":{\"type\":\"string\"},\"bootMethod\":{\"type\":\"string\",\"default\":\"UEFI\",\"enum\":[\"UEFI\",\"BIOS\"]},\"isolateEmulatorThread\":{\"type\":\"string\"},\"virtioInterface\":{\"type\":\"string\"},\"placementHints\":{\"type\":\"array\",\"items\":{\"type\":\"object\",\"properties\":{\"hintType\":{\"type\":\"string\",\"enum\":[\"Affinity\",\"AntiAffinity\"]},\"resourceId\":{\"type\":\"string\"},\"schedulingExecution\":{\"type\":\"string\",\"enum\":[\"Soft\",\"Hard\"]},\"scope\":{\"type\":\"string\"}},\"required\":[\"hintType\",\"schedulingExecution\",\"resourceId\",\"scope\"]}}}", + "networkFunctionTemplate": { + "networkFunctionApplications": [ + { + "name": "testImageRole", + "artifactProfile": { + "artifactStore": { + "id": "/subscriptions/subid/resourceGroups/rg/providers/microsoft.hybridnetwork/publishers/TestPublisher/artifactStores/TestArtifactStore" + }, + "vhdArtifactProfile": { + "vhdName": "test-image", + "vhdVersion": "1-0-0" + } + }, + "artifactType": "VhdImageFile", + "dependsOnProfile": { + "installDependsOn": [], + "uninstallDependsOn": [], + "updateDependsOn": [] + }, + "deployParametersMappingRuleProfile": { + "applicationEnablement": "Unknown", + "vhdImageMappingRuleProfile": { + "userConfiguration": "" + } + } + }, + { + "name": "testTemplateRole", + "artifactProfile": { + "artifactStore": { + "id": "/subscriptions/subid/resourceGroups/rg/providers/microsoft.hybridnetwork/publishers/TestPublisher/artifactStores/TestArtifactStore" + }, + "templateArtifactProfile": { + "templateName": "test-template", + "templateVersion": "1.0.0" + } + }, + "artifactType": "ArmTemplate", + "dependsOnProfile": { + "installDependsOn": [ + "testImageRole" + ], + "uninstallDependsOn": [ + "testImageRole" + ], + "updateDependsOn": [ + "testImageRole" + ] + }, + "deployParametersMappingRuleProfile": { + "applicationEnablement": "Unknown", + "templateMappingRuleProfile": { + "templateParameters": "{\"virtualMachineName\":\"{deployParameters.virtualMachineName}\",\"cpuCores\":\"{deployParameters.cpuCores}\",\"memorySizeGB\":\"{deployParameters.memorySizeGB}\",\"cloudServicesNetworkAttachment\":\"{deployParameters.cloudServicesNetworkAttachment}\",\"networkAttachments\":\"{deployParameters.networkAttachments}\",\"sshPublicKeys\":\"{deployParameters.sshPublicKeys}\",\"storageProfile\":\"{deployParameters.storageProfile}\",\"isolateEmulatorThread\":\"{deployParameters.isolateEmulatorThread}\",\"virtioInterface\":\"{deployParameters.virtioInterface}\",\"userData\":\"{deployParameters.userData}\",\"adminUsername\":\"{deployParameters.adminUsername}\",\"bootMethod\":\"{deployParameters.bootMethod}\",\"placementHints\":\"{deployParameters.placementHints}\"}" + } + } + } + ], + "nfviType": "AzureCore" + }, + "networkFunctionType": "VirtualNetworkFunction", + "versionState": "Preview" + } + } + }, + "201": { + "body": { + "name": "TestVersion", + "type": "Microsoft.HybridNetwork/publishers/networkFunctionDefinitionGroups/networkFunctionDefinitionVersions", + "id": "/subscriptions/subid/resourcegroups/rg/providers/Microsoft.HybridNetwork/publishers/TestPublisher/networkFunctionDefinitionGroups/TestNetworkFunctionDefinitionGroupName/networkFunctionDefinitionVersions/1.0.0", + "location": "eastus", + "properties": { + "description": "test NFDV for AzureCore", + "deployParameters": "{\"virtualMachineName\":{\"type\":\"string\"},\"cpuCores\":{\"type\":\"int\"},\"memorySizeGB\":{\"type\":\"int\"},\"cloudServicesNetworkAttachment\":{\"type\":\"object\",\"properties\":{\"networkAttachmentName\":{\"type\":\"string\"},\"attachedNetworkId\":{\"type\":\"string\"},\"ipAllocationMethod\":{\"type\":\"string\"},\"ipv4Address\":{\"type\":\"string\"},\"ipv6Address\":{\"type\":\"string\"},\"defaultGateway\":{\"type\":\"string\"}},\"required\":[\"attachedNetworkId\",\"ipAllocationMethod\"]},\"networkAttachments\":{\"type\":\"array\",\"items\":{\"type\":\"object\",\"properties\":{\"networkAttachmentName\":{\"type\":\"string\"},\"attachedNetworkId\":{\"type\":\"string\"},\"ipAllocationMethod\":{\"type\":\"string\"},\"ipv4Address\":{\"type\":\"string\"},\"ipv6Address\":{\"type\":\"string\"},\"defaultGateway\":{\"type\":\"string\"}},\"required\":[\"attachedNetworkId\",\"ipAllocationMethod\"]}},\"storageProfile\":{\"type\":\"object\",\"properties\":{\"osDisk\":{\"type\":\"object\",\"properties\":{\"createOption\":{\"type\":\"string\"},\"deleteOption\":{\"type\":\"string\"},\"diskSizeGB\":{\"type\":\"integer\"}},\"required\":[\"diskSizeGB\"]}},\"required\":[\"osDisk\"]},\"sshPublicKeys\":{\"type\":\"array\",\"items\":{\"type\":\"object\",\"properties\":{\"keyData\":{\"type\":\"string\"}},\"required\":[\"keyData\"]}},\"userData\":{\"type\":\"string\"},\"adminUsername\":{\"type\":\"string\"},\"bootMethod\":{\"type\":\"string\",\"default\":\"UEFI\",\"enum\":[\"UEFI\",\"BIOS\"]},\"isolateEmulatorThread\":{\"type\":\"string\"},\"virtioInterface\":{\"type\":\"string\"},\"placementHints\":{\"type\":\"array\",\"items\":{\"type\":\"object\",\"properties\":{\"hintType\":{\"type\":\"string\",\"enum\":[\"Affinity\",\"AntiAffinity\"]},\"resourceId\":{\"type\":\"string\"},\"schedulingExecution\":{\"type\":\"string\",\"enum\":[\"Soft\",\"Hard\"]},\"scope\":{\"type\":\"string\"}},\"required\":[\"hintType\",\"schedulingExecution\",\"resourceId\",\"scope\"]}}}", + "networkFunctionTemplate": { + "networkFunctionApplications": [ + { + "name": "testImageRole", + "artifactProfile": { + "artifactStore": { + "id": "/subscriptions/subid/resourceGroups/rg/providers/microsoft.hybridnetwork/publishers/TestPublisher/artifactStores/TestArtifactStore" + }, + "vhdArtifactProfile": { + "vhdName": "test-image", + "vhdVersion": "1-0-0" + } + }, + "artifactType": "VhdImageFile", + "dependsOnProfile": { + "installDependsOn": [], + "uninstallDependsOn": [], + "updateDependsOn": [] + }, + "deployParametersMappingRuleProfile": { + "applicationEnablement": "Unknown", + "vhdImageMappingRuleProfile": { + "userConfiguration": "" + } + } + }, + { + "name": "testTemplateRole", + "artifactProfile": { + "artifactStore": { + "id": "/subscriptions/subid/resourceGroups/rg/providers/microsoft.hybridnetwork/publishers/TestPublisher/artifactStores/TestArtifactStore" + }, + "templateArtifactProfile": { + "templateName": "test-template", + "templateVersion": "1.0.0" + } + }, + "artifactType": "ArmTemplate", + "dependsOnProfile": { + "installDependsOn": [ + "testImageRole" + ], + "uninstallDependsOn": [ + "testImageRole" + ], + "updateDependsOn": [ + "testImageRole" + ] + }, + "deployParametersMappingRuleProfile": { + "applicationEnablement": "Unknown", + "templateMappingRuleProfile": { + "templateParameters": "{\"virtualMachineName\":\"{deployParameters.virtualMachineName}\",\"cpuCores\":\"{deployParameters.cpuCores}\",\"memorySizeGB\":\"{deployParameters.memorySizeGB}\",\"cloudServicesNetworkAttachment\":\"{deployParameters.cloudServicesNetworkAttachment}\",\"networkAttachments\":\"{deployParameters.networkAttachments}\",\"sshPublicKeys\":\"{deployParameters.sshPublicKeys}\",\"storageProfile\":\"{deployParameters.storageProfile}\",\"isolateEmulatorThread\":\"{deployParameters.isolateEmulatorThread}\",\"virtioInterface\":\"{deployParameters.virtioInterface}\",\"userData\":\"{deployParameters.userData}\",\"adminUsername\":\"{deployParameters.adminUsername}\",\"bootMethod\":\"{deployParameters.bootMethod}\",\"placementHints\":\"{deployParameters.placementHints}\"}" + } + } + } + ], + "nfviType": "AzureCore" + }, + "networkFunctionType": "VirtualNetworkFunction", + "versionState": "Preview" + } + } + } + }, + "operationId": "NetworkFunctionDefinitionVersions_CreateOrUpdate", + "title": "Create or update a network function definition version resource for AzureCore VNF" +} diff --git a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/AzureCore/VirtualNetworkFunctionDefinitionVersionDelete.json b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/AzureCore/VirtualNetworkFunctionDefinitionVersionDelete.json new file mode 100644 index 0000000000..0d3b1e6b5d --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/AzureCore/VirtualNetworkFunctionDefinitionVersionDelete.json @@ -0,0 +1,20 @@ +{ + "parameters": { + "api-version": "2025-03-30", + "networkFunctionDefinitionGroupName": "TestNetworkFunctionDefinitionGroupName", + "networkFunctionDefinitionVersionName": "1.0.0", + "publisherName": "TestPublisher", + "resourceGroupName": "rg", + "subscriptionId": "subid" + }, + "responses": { + "202": { + "headers": { + "location": "https://management.azure.com/providers/microsoft.hybridnetwork/locations/EASTUS2EUAP/operationStatuses/0b37c625-7e7c-49c5-b86e-c817c85acb5d*B77A34159CA34A0BD446D3BC7EC120649181590DDF991982765DAC1A87491B2D?api-version=2021-05-01" + } + }, + "204": {} + }, + "operationId": "NetworkFunctionDefinitionVersions_Delete", + "title": "Delete a network function definition version for AzureCore VNF" +} diff --git a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/AzureCore/VirtualNetworkFunctionDefinitionVersionGet.json b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/AzureCore/VirtualNetworkFunctionDefinitionVersionGet.json new file mode 100644 index 0000000000..46192e6866 --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/AzureCore/VirtualNetworkFunctionDefinitionVersionGet.json @@ -0,0 +1,87 @@ +{ + "parameters": { + "api-version": "2025-03-30", + "networkFunctionDefinitionGroupName": "TestNetworkFunctionDefinitionGroupName", + "networkFunctionDefinitionVersionName": "1.0.0", + "publisherName": "TestPublisher", + "resourceGroupName": "rg", + "subscriptionId": "subid" + }, + "responses": { + "200": { + "body": { + "name": "TestVersion", + "type": "Microsoft.HybridNetwork/publishers/networkFunctionDefinitionGroups/networkFunctionDefinitionVersions", + "id": "/subscriptions/subid/resourcegroups/rg/providers/Microsoft.HybridNetwork/publishers/TestPublisher/networkFunctionDefinitionGroups/TestNetworkFunctionDefinitionGroupName/networkFunctionDefinitionVersions/1.0.0", + "location": "eastus", + "properties": { + "description": "test NFDV for AzureCore", + "deployParameters": "{\"virtualMachineName\":{\"type\":\"string\"},\"cpuCores\":{\"type\":\"int\"},\"memorySizeGB\":{\"type\":\"int\"},\"cloudServicesNetworkAttachment\":{\"type\":\"object\",\"properties\":{\"networkAttachmentName\":{\"type\":\"string\"},\"attachedNetworkId\":{\"type\":\"string\"},\"ipAllocationMethod\":{\"type\":\"string\"},\"ipv4Address\":{\"type\":\"string\"},\"ipv6Address\":{\"type\":\"string\"},\"defaultGateway\":{\"type\":\"string\"}},\"required\":[\"attachedNetworkId\",\"ipAllocationMethod\"]},\"networkAttachments\":{\"type\":\"array\",\"items\":{\"type\":\"object\",\"properties\":{\"networkAttachmentName\":{\"type\":\"string\"},\"attachedNetworkId\":{\"type\":\"string\"},\"ipAllocationMethod\":{\"type\":\"string\"},\"ipv4Address\":{\"type\":\"string\"},\"ipv6Address\":{\"type\":\"string\"},\"defaultGateway\":{\"type\":\"string\"}},\"required\":[\"attachedNetworkId\",\"ipAllocationMethod\"]}},\"storageProfile\":{\"type\":\"object\",\"properties\":{\"osDisk\":{\"type\":\"object\",\"properties\":{\"createOption\":{\"type\":\"string\"},\"deleteOption\":{\"type\":\"string\"},\"diskSizeGB\":{\"type\":\"integer\"}},\"required\":[\"diskSizeGB\"]}},\"required\":[\"osDisk\"]},\"sshPublicKeys\":{\"type\":\"array\",\"items\":{\"type\":\"object\",\"properties\":{\"keyData\":{\"type\":\"string\"}},\"required\":[\"keyData\"]}},\"userData\":{\"type\":\"string\"},\"adminUsername\":{\"type\":\"string\"},\"bootMethod\":{\"type\":\"string\",\"default\":\"UEFI\",\"enum\":[\"UEFI\",\"BIOS\"]},\"isolateEmulatorThread\":{\"type\":\"string\"},\"virtioInterface\":{\"type\":\"string\"},\"placementHints\":{\"type\":\"array\",\"items\":{\"type\":\"object\",\"properties\":{\"hintType\":{\"type\":\"string\",\"enum\":[\"Affinity\",\"AntiAffinity\"]},\"resourceId\":{\"type\":\"string\"},\"schedulingExecution\":{\"type\":\"string\",\"enum\":[\"Soft\",\"Hard\"]},\"scope\":{\"type\":\"string\"}},\"required\":[\"hintType\",\"schedulingExecution\",\"resourceId\",\"scope\"]}}}", + "networkFunctionTemplate": { + "networkFunctionApplications": [ + { + "name": "testImageRole", + "artifactProfile": { + "artifactStore": { + "id": "/subscriptions/subid/resourceGroups/rg/providers/microsoft.hybridnetwork/publishers/TestPublisher/artifactStores/TestArtifactStore" + }, + "vhdArtifactProfile": { + "vhdName": "test-image", + "vhdVersion": "1-0-0" + } + }, + "artifactType": "VhdImageFile", + "dependsOnProfile": { + "installDependsOn": [], + "uninstallDependsOn": [], + "updateDependsOn": [] + }, + "deployParametersMappingRuleProfile": { + "applicationEnablement": "Unknown", + "vhdImageMappingRuleProfile": { + "userConfiguration": "" + } + } + }, + { + "name": "testTemplateRole", + "artifactProfile": { + "artifactStore": { + "id": "/subscriptions/subid/resourceGroups/rg/providers/microsoft.hybridnetwork/publishers/TestPublisher/artifactStores/TestArtifactStore" + }, + "templateArtifactProfile": { + "templateName": "test-template", + "templateVersion": "1.0.0" + } + }, + "artifactType": "ArmTemplate", + "dependsOnProfile": { + "installDependsOn": [ + "testImageRole" + ], + "uninstallDependsOn": [ + "testImageRole" + ], + "updateDependsOn": [ + "testImageRole" + ] + }, + "deployParametersMappingRuleProfile": { + "applicationEnablement": "Unknown", + "templateMappingRuleProfile": { + "templateParameters": "{\"virtualMachineName\":\"{deployParameters.virtualMachineName}\",\"cpuCores\":\"{deployParameters.cpuCores}\",\"memorySizeGB\":\"{deployParameters.memorySizeGB}\",\"cloudServicesNetworkAttachment\":\"{deployParameters.cloudServicesNetworkAttachment}\",\"networkAttachments\":\"{deployParameters.networkAttachments}\",\"sshPublicKeys\":\"{deployParameters.sshPublicKeys}\",\"storageProfile\":\"{deployParameters.storageProfile}\",\"isolateEmulatorThread\":\"{deployParameters.isolateEmulatorThread}\",\"virtioInterface\":\"{deployParameters.virtioInterface}\",\"userData\":\"{deployParameters.userData}\",\"adminUsername\":\"{deployParameters.adminUsername}\",\"bootMethod\":\"{deployParameters.bootMethod}\",\"placementHints\":\"{deployParameters.placementHints}\"}" + } + } + } + ], + "nfviType": "AzureCore" + }, + "networkFunctionType": "VirtualNetworkFunction", + "versionState": "Preview" + } + } + } + }, + "operationId": "NetworkFunctionDefinitionVersions_Get", + "title": "Get network function definition version resource for AzureCore VNF" +} diff --git a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/AzureCore/VirtualNetworkFunctionDelete.json b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/AzureCore/VirtualNetworkFunctionDelete.json new file mode 100644 index 0000000000..e1286f64da --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/AzureCore/VirtualNetworkFunctionDelete.json @@ -0,0 +1,19 @@ +{ + "parameters": { + "api-version": "2025-03-30", + "networkFunctionName": "testNf", + "resourceGroupName": "rg", + "subscriptionId": "subid" + }, + "responses": { + "200": {}, + "202": { + "headers": { + "location": "https://management.azure.com/providers/microsoft.hybridnetwork/locations/EASTUS2EUAP/operationStatuses/0b37c625-7e7c-49c5-b86e-c817c85acb5d*B77A34159CA34A0BD446D3BC7EC120649181590DDF991982765DAC1A87491B2D?api-version=2021-05-01" + } + }, + "204": {} + }, + "operationId": "NetworkFunctions_Delete", + "title": "Delete virtual network function resource on AzureCore" +} diff --git a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/AzureCore/VirtualNetworkFunctionGet.json b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/AzureCore/VirtualNetworkFunctionGet.json new file mode 100644 index 0000000000..4fe2410c8d --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/AzureCore/VirtualNetworkFunctionGet.json @@ -0,0 +1,33 @@ +{ + "parameters": { + "api-version": "2025-03-30", + "networkFunctionName": "testNf", + "resourceGroupName": "rg", + "subscriptionId": "subid" + }, + "responses": { + "200": { + "body": { + "name": "testNf", + "type": "Microsoft.HybridNetwork/networkFunctions", + "id": "/subscriptions/subid/resourcegroups/rg/providers/Microsoft.HybridNetwork/networkFunctions/testNf", + "location": "eastus", + "properties": { + "allowSoftwareUpdate": false, + "configurationType": "Open", + "deploymentValues": "{\"virtualMachineName\":\"test-VM\",\"cpuCores\":4,\"memorySizeGB\":8,\"cloudServicesNetworkAttachment\":{\"attachedNetworkId\":\"test-csnet\",\"ipAllocationMethod\":\"Dynamic\",\"networkAttachmentName\":\"test-cs-vlan\"},\"networkAttachments\":[{\"attachedNetworkId\":\"test-l3vlan\",\"defaultGateway\":\"True\",\"ipAllocationMethod\":\"Dynamic\",\"networkAttachmentName\":\"test-vlan\"}],\"sshPublicKeys\":[{\"keyData\":\"ssh-rsa CMIIIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEA0TqlveKKlc2MFvEmuXJiLGBsY1t4ML4uiRADGSZlnc+7Ugv3h+MCjkkwOKiOdsNo8k4KSBIG5GcQfKYOOd17AJvqCL6cGQbaLuqv0a64jeDm8oO8/xN/IM0oKw7rMr/2oAJOgIsfeXPkRxWWic9AVIS++H5Qi2r7bUFX+cqFsyUCAwEBBQ==\"}],\"storageProfile\":{\"osDisk\":{\"createOption\":\"Ephemeral\",\"deleteOption\":\"Delete\",\"diskSizeGB\":10}},\"userData\":\"testUserData\",\"adminUsername\":\"testUser\",\"virtioInterface\":\"Transitional\",\"isolateEmulatorThread\":\"False\",\"bootMethod\":\"BIOS\",\"placementHints\":[]}", + "networkFunctionDefinitionGroupName": "TestNetworkFunctionDefinitionGroupName", + "networkFunctionDefinitionOfferingLocation": "eastus", + "networkFunctionDefinitionVersion": "1.0.0", + "nfviId": "/subscriptions/subid/resourceGroups/testResourceGroup", + "nfviType": "AzureCore", + "provisioningState": "Succeeded", + "publisherName": "TestPublisher", + "publisherScope": "Private" + } + } + } + }, + "operationId": "NetworkFunctions_Get", + "title": "Get virtual network function resource on AzureCore" +} diff --git a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/AzureOperatorNexus/VirtualNetworkFunctionCreate.json b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/AzureOperatorNexus/VirtualNetworkFunctionCreate.json new file mode 100644 index 0000000000..e3c7b4a643 --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/AzureOperatorNexus/VirtualNetworkFunctionCreate.json @@ -0,0 +1,72 @@ +{ + "parameters": { + "api-version": "2025-03-30", + "networkFunctionName": "testNf", + "parameters": { + "location": "eastus", + "properties": { + "allowSoftwareUpdate": false, + "configurationType": "Open", + "deploymentValues": "{\"virtualMachineName\":\"test-VM\",\"extendedLocationName\":\"test-cluster\",\"cpuCores\":4,\"memorySizeGB\":8,\"cloudServicesNetworkAttachment\":{\"attachedNetworkId\":\"test-csnet\",\"ipAllocationMethod\":\"Dynamic\",\"networkAttachmentName\":\"test-cs-vlan\"},\"networkAttachments\":[{\"attachedNetworkId\":\"test-l3vlan\",\"defaultGateway\":\"True\",\"ipAllocationMethod\":\"Dynamic\",\"networkAttachmentName\":\"test-vlan\"}],\"sshPublicKeys\":[{\"keyData\":\"ssh-rsa CMIIIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEA0TqlveKKlc2MFvEmuXJiLGBsY1t4ML4uiRADGSZlnc+7Ugv3h+MCjkkwOKiOdsNo8k4KSBIG5GcQfKYOOd17AJvqCL6cGQbaLuqv0a64jeDm8oO8/xN/IM0oKw7rMr/2oAJOgIsfeXPkRxWWic9AVIS++H5Qi2r7bUFX+cqFsyUCAwEBBQ==\"}],\"storageProfile\":{\"osDisk\":{\"createOption\":\"Ephemeral\",\"deleteOption\":\"Delete\",\"diskSizeGB\":10}},\"userData\":\"testUserData\",\"adminUsername\":\"testUser\",\"virtioInterface\":\"Transitional\",\"isolateEmulatorThread\":\"False\",\"bootMethod\":\"BIOS\",\"placementHints\":[]}", + "networkFunctionDefinitionVersionResourceReference": { + "id": "/subscriptions/subid/resourcegroups/rg/providers/Microsoft.HybridNetwork/publishers/testVendor/networkFunctionDefinitionGroups/testnetworkFunctionDefinitionGroupName/networkFunctionDefinitionVersions/1.0.1", + "idType": "Open" + }, + "nfviId": "/subscriptions/subid/resourceGroups/testResourceGroup/providers/Microsoft.ExtendedLocation/customLocations/testCustomLocation", + "nfviType": "AzureOperatorNexus" + } + }, + "resourceGroupName": "rg", + "subscriptionId": "subid" + }, + "responses": { + "200": { + "body": { + "name": "testNf", + "type": "Microsoft.HybridNetwork/networkFunctions", + "id": "/subscriptions/subid/resourcegroups/rg/providers/Microsoft.HybridNetwork/networkFunctions/testNf", + "location": "eastus", + "properties": { + "allowSoftwareUpdate": false, + "configurationType": "Open", + "deploymentValues": "{\"virtualMachineName\":\"test-VM\",\"extendedLocationName\":\"test-cluster\",\"cpuCores\":4,\"memorySizeGB\":8,\"cloudServicesNetworkAttachment\":{\"attachedNetworkId\":\"test-csnet\",\"ipAllocationMethod\":\"Dynamic\",\"networkAttachmentName\":\"test-cs-vlan\"},\"networkAttachments\":[{\"attachedNetworkId\":\"test-l3vlan\",\"defaultGateway\":\"True\",\"ipAllocationMethod\":\"Dynamic\",\"networkAttachmentName\":\"test-vlan\"}],\"sshPublicKeys\":[{\"keyData\":\"ssh-rsa CMIIIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEA0TqlveKKlc2MFvEmuXJiLGBsY1t4ML4uiRADGSZlnc+7Ugv3h+MCjkkwOKiOdsNo8k4KSBIG5GcQfKYOOd17AJvqCL6cGQbaLuqv0a64jeDm8oO8/xN/IM0oKw7rMr/2oAJOgIsfeXPkRxWWic9AVIS++H5Qi2r7bUFX+cqFsyUCAwEBBQ==\"}],\"storageProfile\":{\"osDisk\":{\"createOption\":\"Ephemeral\",\"deleteOption\":\"Delete\",\"diskSizeGB\":10}},\"userData\":\"testUserData\",\"adminUsername\":\"testUser\",\"virtioInterface\":\"Transitional\",\"isolateEmulatorThread\":\"False\",\"bootMethod\":\"BIOS\",\"placementHints\":[]}", + "networkFunctionDefinitionGroupName": "TestNetworkFunctionDefinitionGroupName", + "networkFunctionDefinitionOfferingLocation": "eastus", + "networkFunctionDefinitionVersion": "1.0.0", + "networkFunctionDefinitionVersionResourceReference": { + "id": "/subscriptions/subid/resourcegroups/rg/providers/Microsoft.HybridNetwork/publishers/testVendor/networkFunctionDefinitionGroups/testnetworkFunctionDefinitionGroupName/networkFunctionDefinitionVersions/1.0.1", + "idType": "Open" + }, + "nfviId": "/subscriptions/subid/resourceGroups/testResourceGroup/providers/Microsoft.ExtendedLocation/customLocations/testCustomLocation", + "nfviType": "AzureOperatorNexus", + "provisioningState": "Succeeded", + "publisherName": "TestPublisher", + "publisherScope": "Private" + } + } + }, + "201": { + "body": { + "name": "testNf", + "type": "Microsoft.HybridNetwork/networkFunctions", + "id": "/subscriptions/subid/resourcegroups/rg/providers/Microsoft.HybridNetwork/networkFunctions/testNf", + "location": "eastus", + "properties": { + "allowSoftwareUpdate": false, + "configurationType": "Open", + "deploymentValues": "{\"virtualMachineName\":\"test-VM\",\"extendedLocationName\":\"test-cluster\",\"cpuCores\":4,\"memorySizeGB\":8,\"cloudServicesNetworkAttachment\":{\"attachedNetworkId\":\"test-csnet\",\"ipAllocationMethod\":\"Dynamic\",\"networkAttachmentName\":\"test-cs-vlan\"},\"networkAttachments\":[{\"attachedNetworkId\":\"test-l3vlan\",\"defaultGateway\":\"True\",\"ipAllocationMethod\":\"Dynamic\",\"networkAttachmentName\":\"test-vlan\"}],\"sshPublicKeys\":[{\"keyData\":\"ssh-rsa CMIIIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEA0TqlveKKlc2MFvEmuXJiLGBsY1t4ML4uiRADGSZlnc+7Ugv3h+MCjkkwOKiOdsNo8k4KSBIG5GcQfKYOOd17AJvqCL6cGQbaLuqv0a64jeDm8oO8/xN/IM0oKw7rMr/2oAJOgIsfeXPkRxWWic9AVIS++H5Qi2r7bUFX+cqFsyUCAwEBBQ==\"}],\"storageProfile\":{\"osDisk\":{\"createOption\":\"Ephemeral\",\"deleteOption\":\"Delete\",\"diskSizeGB\":10}},\"userData\":\"testUserData\",\"adminUsername\":\"testUser\",\"virtioInterface\":\"Transitional\",\"isolateEmulatorThread\":\"False\",\"bootMethod\":\"BIOS\",\"placementHints\":[]}", + "networkFunctionDefinitionGroupName": "TestNetworkFunctionDefinitionGroupName", + "networkFunctionDefinitionOfferingLocation": "eastus", + "networkFunctionDefinitionVersion": "1.0.0", + "nfviId": "/subscriptions/subid/resourceGroups/testResourceGroup/providers/Microsoft.ExtendedLocation/customLocations/testCustomLocation", + "nfviType": "AzureOperatorNexus", + "provisioningState": "Accepted", + "publisherName": "TestPublisher", + "publisherScope": "Private" + } + } + } + }, + "operationId": "NetworkFunctions_CreateOrUpdate", + "title": "Create virtual network function resource on AzureOperatorNexus" +} diff --git a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/AzureOperatorNexus/VirtualNetworkFunctionDefinitionVersionCreate.json b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/AzureOperatorNexus/VirtualNetworkFunctionDefinitionVersionCreate.json new file mode 100644 index 0000000000..6c0f1ec1ec --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/AzureOperatorNexus/VirtualNetworkFunctionDefinitionVersionCreate.json @@ -0,0 +1,228 @@ +{ + "parameters": { + "api-version": "2025-03-30", + "networkFunctionDefinitionGroupName": "TestNetworkFunctionDefinitionGroupName", + "networkFunctionDefinitionVersionName": "1.0.0", + "parameters": { + "location": "eastus", + "properties": { + "description": "test NFDV for AzureOperatorNexus", + "deployParameters": "{\"virtualMachineName\":{\"type\":\"string\"},\"extendedLocationName\":{\"type\":\"string\"},\"cpuCores\":{\"type\":\"int\"},\"memorySizeGB\":{\"type\":\"int\"},\"cloudServicesNetworkAttachment\":{\"type\":\"object\",\"properties\":{\"networkAttachmentName\":{\"type\":\"string\"},\"attachedNetworkId\":{\"type\":\"string\"},\"ipAllocationMethod\":{\"type\":\"string\"},\"ipv4Address\":{\"type\":\"string\"},\"ipv6Address\":{\"type\":\"string\"},\"defaultGateway\":{\"type\":\"string\"}},\"required\":[\"attachedNetworkId\",\"ipAllocationMethod\"]},\"networkAttachments\":{\"type\":\"array\",\"items\":{\"type\":\"object\",\"properties\":{\"networkAttachmentName\":{\"type\":\"string\"},\"attachedNetworkId\":{\"type\":\"string\"},\"ipAllocationMethod\":{\"type\":\"string\"},\"ipv4Address\":{\"type\":\"string\"},\"ipv6Address\":{\"type\":\"string\"},\"defaultGateway\":{\"type\":\"string\"}},\"required\":[\"attachedNetworkId\",\"ipAllocationMethod\"]}},\"storageProfile\":{\"type\":\"object\",\"properties\":{\"osDisk\":{\"type\":\"object\",\"properties\":{\"createOption\":{\"type\":\"string\"},\"deleteOption\":{\"type\":\"string\"},\"diskSizeGB\":{\"type\":\"integer\"}},\"required\":[\"diskSizeGB\"]}},\"required\":[\"osDisk\"]},\"sshPublicKeys\":{\"type\":\"array\",\"items\":{\"type\":\"object\",\"properties\":{\"keyData\":{\"type\":\"string\"}},\"required\":[\"keyData\"]}},\"userData\":{\"type\":\"string\"},\"adminUsername\":{\"type\":\"string\"},\"bootMethod\":{\"type\":\"string\",\"default\":\"UEFI\",\"enum\":[\"UEFI\",\"BIOS\"]},\"isolateEmulatorThread\":{\"type\":\"string\"},\"virtioInterface\":{\"type\":\"string\"},\"placementHints\":{\"type\":\"array\",\"items\":{\"type\":\"object\",\"properties\":{\"hintType\":{\"type\":\"string\",\"enum\":[\"Affinity\",\"AntiAffinity\"]},\"resourceId\":{\"type\":\"string\"},\"schedulingExecution\":{\"type\":\"string\",\"enum\":[\"Soft\",\"Hard\"]},\"scope\":{\"type\":\"string\"}},\"required\":[\"hintType\",\"schedulingExecution\",\"resourceId\",\"scope\"]}}}", + "networkFunctionTemplate": { + "networkFunctionApplications": [ + { + "name": "testImageRole", + "artifactProfile": { + "artifactStore": { + "id": "/subscriptions/subid/resourceGroups/rg/providers/microsoft.hybridnetwork/publishers/TestPublisher/artifactStores/TestArtifactStore" + }, + "imageArtifactProfile": { + "imageName": "test-image", + "imageVersion": "1.0.0" + } + }, + "artifactType": "ImageFile", + "dependsOnProfile": { + "installDependsOn": [], + "uninstallDependsOn": [], + "updateDependsOn": [] + }, + "deployParametersMappingRuleProfile": { + "applicationEnablement": "Unknown", + "imageMappingRuleProfile": { + "userConfiguration": "" + } + } + }, + { + "name": "testTemplateRole", + "artifactProfile": { + "artifactStore": { + "id": "/subscriptions/subid/resourceGroups/rg/providers/microsoft.hybridnetwork/publishers/TestPublisher/artifactStores/TestArtifactStore" + }, + "templateArtifactProfile": { + "templateName": "test-template", + "templateVersion": "1.0.0" + } + }, + "artifactType": "ArmTemplate", + "dependsOnProfile": { + "installDependsOn": [ + "testImageRole" + ], + "uninstallDependsOn": [ + "testImageRole" + ], + "updateDependsOn": [ + "testImageRole" + ] + }, + "deployParametersMappingRuleProfile": { + "applicationEnablement": "Unknown", + "templateMappingRuleProfile": { + "templateParameters": "{\"virtualMachineName\":\"{deployParameters.virtualMachineName}\",\"extendedLocationName\":\"{deployParameters.extendedLocationName}\",\"cpuCores\":\"{deployParameters.cpuCores}\",\"memorySizeGB\":\"{deployParameters.memorySizeGB}\",\"cloudServicesNetworkAttachment\":\"{deployParameters.cloudServicesNetworkAttachment}\",\"networkAttachments\":\"{deployParameters.networkAttachments}\",\"sshPublicKeys\":\"{deployParameters.sshPublicKeys}\",\"storageProfile\":\"{deployParameters.storageProfile}\",\"isolateEmulatorThread\":\"{deployParameters.isolateEmulatorThread}\",\"virtioInterface\":\"{deployParameters.virtioInterface}\",\"userData\":\"{deployParameters.userData}\",\"adminUsername\":\"{deployParameters.adminUsername}\",\"bootMethod\":\"{deployParameters.bootMethod}\",\"placementHints\":\"{deployParameters.placementHints}\"}" + } + } + } + ], + "nfviType": "AzureOperatorNexus" + }, + "networkFunctionType": "VirtualNetworkFunction", + "versionState": "Preview" + } + }, + "publisherName": "TestPublisher", + "resourceGroupName": "rg", + "subscriptionId": "subid" + }, + "responses": { + "200": { + "body": { + "name": "TestVersion", + "type": "Microsoft.HybridNetwork/publishers/networkFunctionDefinitionGroups/networkFunctionDefinitionVersions", + "id": "/subscriptions/subid/resourcegroups/rg/providers/Microsoft.HybridNetwork/publishers/TestPublisher/networkFunctionDefinitionGroups/TestNetworkFunctionDefinitionGroupName/networkFunctionDefinitionVersions/1.0.0", + "location": "eastus", + "properties": { + "description": "test NFDV for AzureOperatorNexus", + "deployParameters": "{\"virtualMachineName\":{\"type\":\"string\"},\"extendedLocationName\":{\"type\":\"string\"},\"cpuCores\":{\"type\":\"int\"},\"memorySizeGB\":{\"type\":\"int\"},\"cloudServicesNetworkAttachment\":{\"type\":\"object\",\"properties\":{\"networkAttachmentName\":{\"type\":\"string\"},\"attachedNetworkId\":{\"type\":\"string\"},\"ipAllocationMethod\":{\"type\":\"string\"},\"ipv4Address\":{\"type\":\"string\"},\"ipv6Address\":{\"type\":\"string\"},\"defaultGateway\":{\"type\":\"string\"}},\"required\":[\"attachedNetworkId\",\"ipAllocationMethod\"]},\"networkAttachments\":{\"type\":\"array\",\"items\":{\"type\":\"object\",\"properties\":{\"networkAttachmentName\":{\"type\":\"string\"},\"attachedNetworkId\":{\"type\":\"string\"},\"ipAllocationMethod\":{\"type\":\"string\"},\"ipv4Address\":{\"type\":\"string\"},\"ipv6Address\":{\"type\":\"string\"},\"defaultGateway\":{\"type\":\"string\"}},\"required\":[\"attachedNetworkId\",\"ipAllocationMethod\"]}},\"storageProfile\":{\"type\":\"object\",\"properties\":{\"osDisk\":{\"type\":\"object\",\"properties\":{\"createOption\":{\"type\":\"string\"},\"deleteOption\":{\"type\":\"string\"},\"diskSizeGB\":{\"type\":\"integer\"}},\"required\":[\"diskSizeGB\"]}},\"required\":[\"osDisk\"]},\"sshPublicKeys\":{\"type\":\"array\",\"items\":{\"type\":\"object\",\"properties\":{\"keyData\":{\"type\":\"string\"}},\"required\":[\"keyData\"]}},\"userData\":{\"type\":\"string\"},\"adminUsername\":{\"type\":\"string\"},\"bootMethod\":{\"type\":\"string\",\"default\":\"UEFI\",\"enum\":[\"UEFI\",\"BIOS\"]},\"isolateEmulatorThread\":{\"type\":\"string\"},\"virtioInterface\":{\"type\":\"string\"},\"placementHints\":{\"type\":\"array\",\"items\":{\"type\":\"object\",\"properties\":{\"hintType\":{\"type\":\"string\",\"enum\":[\"Affinity\",\"AntiAffinity\"]},\"resourceId\":{\"type\":\"string\"},\"schedulingExecution\":{\"type\":\"string\",\"enum\":[\"Soft\",\"Hard\"]},\"scope\":{\"type\":\"string\"}},\"required\":[\"hintType\",\"schedulingExecution\",\"resourceId\",\"scope\"]}}}", + "networkFunctionTemplate": { + "networkFunctionApplications": [ + { + "name": "testImageRole", + "artifactProfile": { + "artifactStore": { + "id": "/subscriptions/subid/resourceGroups/rg/providers/microsoft.hybridnetwork/publishers/TestPublisher/artifactStores/TestArtifactStore" + }, + "imageArtifactProfile": { + "imageName": "test-image", + "imageVersion": "1.0.0" + } + }, + "artifactType": "ImageFile", + "dependsOnProfile": { + "installDependsOn": [], + "uninstallDependsOn": [], + "updateDependsOn": [] + }, + "deployParametersMappingRuleProfile": { + "applicationEnablement": "Unknown", + "imageMappingRuleProfile": { + "userConfiguration": "" + } + } + }, + { + "name": "testTemplateRole", + "artifactProfile": { + "artifactStore": { + "id": "/subscriptions/subid/resourceGroups/rg/providers/microsoft.hybridnetwork/publishers/TestPublisher/artifactStores/TestArtifactStore" + }, + "templateArtifactProfile": { + "templateName": "test-template", + "templateVersion": "1.0.0" + } + }, + "artifactType": "ArmTemplate", + "dependsOnProfile": { + "installDependsOn": [ + "testImageRole" + ], + "uninstallDependsOn": [ + "testImageRole" + ], + "updateDependsOn": [ + "testImageRole" + ] + }, + "deployParametersMappingRuleProfile": { + "applicationEnablement": "Unknown", + "templateMappingRuleProfile": { + "templateParameters": "{\"virtualMachineName\":\"{deployParameters.virtualMachineName}\",\"extendedLocationName\":\"{deployParameters.extendedLocationName}\",\"cpuCores\":\"{deployParameters.cpuCores}\",\"memorySizeGB\":\"{deployParameters.memorySizeGB}\",\"cloudServicesNetworkAttachment\":\"{deployParameters.cloudServicesNetworkAttachment}\",\"networkAttachments\":\"{deployParameters.networkAttachments}\",\"sshPublicKeys\":\"{deployParameters.sshPublicKeys}\",\"storageProfile\":\"{deployParameters.storageProfile}\",\"isolateEmulatorThread\":\"{deployParameters.isolateEmulatorThread}\",\"virtioInterface\":\"{deployParameters.virtioInterface}\",\"userData\":\"{deployParameters.userData}\",\"adminUsername\":\"{deployParameters.adminUsername}\",\"bootMethod\":\"{deployParameters.bootMethod}\",\"placementHints\":\"{deployParameters.placementHints}\"}" + } + } + } + ], + "nfviType": "AzureOperatorNexus" + }, + "networkFunctionType": "VirtualNetworkFunction", + "versionState": "Preview" + } + } + }, + "201": { + "body": { + "name": "TestVersion", + "type": "Microsoft.HybridNetwork/publishers/networkFunctionDefinitionGroups/networkFunctionDefinitionVersions", + "id": "/subscriptions/subid/resourcegroups/rg/providers/Microsoft.HybridNetwork/publishers/TestPublisher/networkFunctionDefinitionGroups/TestNetworkFunctionDefinitionGroupName/networkFunctionDefinitionVersions/1.0.0", + "location": "eastus", + "properties": { + "description": "test NFDV for AzureOperatorNexus", + "deployParameters": "{\"virtualMachineName\":{\"type\":\"string\"},\"extendedLocationName\":{\"type\":\"string\"},\"cpuCores\":{\"type\":\"int\"},\"memorySizeGB\":{\"type\":\"int\"},\"cloudServicesNetworkAttachment\":{\"type\":\"object\",\"properties\":{\"networkAttachmentName\":{\"type\":\"string\"},\"attachedNetworkId\":{\"type\":\"string\"},\"ipAllocationMethod\":{\"type\":\"string\"},\"ipv4Address\":{\"type\":\"string\"},\"ipv6Address\":{\"type\":\"string\"},\"defaultGateway\":{\"type\":\"string\"}},\"required\":[\"attachedNetworkId\",\"ipAllocationMethod\"]},\"networkAttachments\":{\"type\":\"array\",\"items\":{\"type\":\"object\",\"properties\":{\"networkAttachmentName\":{\"type\":\"string\"},\"attachedNetworkId\":{\"type\":\"string\"},\"ipAllocationMethod\":{\"type\":\"string\"},\"ipv4Address\":{\"type\":\"string\"},\"ipv6Address\":{\"type\":\"string\"},\"defaultGateway\":{\"type\":\"string\"}},\"required\":[\"attachedNetworkId\",\"ipAllocationMethod\"]}},\"storageProfile\":{\"type\":\"object\",\"properties\":{\"osDisk\":{\"type\":\"object\",\"properties\":{\"createOption\":{\"type\":\"string\"},\"deleteOption\":{\"type\":\"string\"},\"diskSizeGB\":{\"type\":\"integer\"}},\"required\":[\"diskSizeGB\"]}},\"required\":[\"osDisk\"]},\"sshPublicKeys\":{\"type\":\"array\",\"items\":{\"type\":\"object\",\"properties\":{\"keyData\":{\"type\":\"string\"}},\"required\":[\"keyData\"]}},\"userData\":{\"type\":\"string\"},\"adminUsername\":{\"type\":\"string\"},\"bootMethod\":{\"type\":\"string\",\"default\":\"UEFI\",\"enum\":[\"UEFI\",\"BIOS\"]},\"isolateEmulatorThread\":{\"type\":\"string\"},\"virtioInterface\":{\"type\":\"string\"},\"placementHints\":{\"type\":\"array\",\"items\":{\"type\":\"object\",\"properties\":{\"hintType\":{\"type\":\"string\",\"enum\":[\"Affinity\",\"AntiAffinity\"]},\"resourceId\":{\"type\":\"string\"},\"schedulingExecution\":{\"type\":\"string\",\"enum\":[\"Soft\",\"Hard\"]},\"scope\":{\"type\":\"string\"}},\"required\":[\"hintType\",\"schedulingExecution\",\"resourceId\",\"scope\"]}}}", + "networkFunctionTemplate": { + "networkFunctionApplications": [ + { + "name": "testImageRole", + "artifactProfile": { + "artifactStore": { + "id": "/subscriptions/subid/resourceGroups/rg/providers/microsoft.hybridnetwork/publishers/TestPublisher/artifactStores/TestArtifactStore" + }, + "imageArtifactProfile": { + "imageName": "test-image", + "imageVersion": "1.0.0" + } + }, + "artifactType": "ImageFile", + "dependsOnProfile": { + "installDependsOn": [], + "uninstallDependsOn": [], + "updateDependsOn": [] + }, + "deployParametersMappingRuleProfile": { + "applicationEnablement": "Unknown", + "imageMappingRuleProfile": { + "userConfiguration": "" + } + } + }, + { + "name": "testTemplateRole", + "artifactProfile": { + "artifactStore": { + "id": "/subscriptions/subid/resourceGroups/rg/providers/microsoft.hybridnetwork/publishers/TestPublisher/artifactStores/TestArtifactStore" + }, + "templateArtifactProfile": { + "templateName": "test-template", + "templateVersion": "1.0.0" + } + }, + "artifactType": "ArmTemplate", + "dependsOnProfile": { + "installDependsOn": [ + "testImageRole" + ], + "uninstallDependsOn": [ + "testImageRole" + ], + "updateDependsOn": [ + "testImageRole" + ] + }, + "deployParametersMappingRuleProfile": { + "applicationEnablement": "Unknown", + "templateMappingRuleProfile": { + "templateParameters": "{\"virtualMachineName\":\"{deployParameters.virtualMachineName}\",\"extendedLocationName\":\"{deployParameters.extendedLocationName}\",\"cpuCores\":\"{deployParameters.cpuCores}\",\"memorySizeGB\":\"{deployParameters.memorySizeGB}\",\"cloudServicesNetworkAttachment\":\"{deployParameters.cloudServicesNetworkAttachment}\",\"networkAttachments\":\"{deployParameters.networkAttachments}\",\"sshPublicKeys\":\"{deployParameters.sshPublicKeys}\",\"storageProfile\":\"{deployParameters.storageProfile}\",\"isolateEmulatorThread\":\"{deployParameters.isolateEmulatorThread}\",\"virtioInterface\":\"{deployParameters.virtioInterface}\",\"userData\":\"{deployParameters.userData}\",\"adminUsername\":\"{deployParameters.adminUsername}\",\"bootMethod\":\"{deployParameters.bootMethod}\",\"placementHints\":\"{deployParameters.placementHints}\"}" + } + } + } + ], + "nfviType": "AzureOperatorNexus" + }, + "networkFunctionType": "VirtualNetworkFunction", + "versionState": "Preview" + } + } + } + }, + "operationId": "NetworkFunctionDefinitionVersions_CreateOrUpdate", + "title": "Create or update a network function definition version resource for AzureOperatorNexus VNF" +} diff --git a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/AzureOperatorNexus/VirtualNetworkFunctionDefinitionVersionDelete.json b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/AzureOperatorNexus/VirtualNetworkFunctionDefinitionVersionDelete.json new file mode 100644 index 0000000000..3dbea06338 --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/AzureOperatorNexus/VirtualNetworkFunctionDefinitionVersionDelete.json @@ -0,0 +1,20 @@ +{ + "parameters": { + "api-version": "2025-03-30", + "networkFunctionDefinitionGroupName": "TestNetworkFunctionDefinitionGroupName", + "networkFunctionDefinitionVersionName": "1.0.0", + "publisherName": "TestPublisher", + "resourceGroupName": "rg", + "subscriptionId": "subid" + }, + "responses": { + "202": { + "headers": { + "location": "https://management.azure.com/providers/microsoft.hybridnetwork/locations/EASTUS2EUAP/operationStatuses/0b37c625-7e7c-49c5-b86e-c817c85acb5d*B77A34159CA34A0BD446D3BC7EC120649181590DDF991982765DAC1A87491B2D?api-version=2021-05-01" + } + }, + "204": {} + }, + "operationId": "NetworkFunctionDefinitionVersions_Delete", + "title": "Delete a network function definition version for AzureOperatorNexus VNF" +} diff --git a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/AzureOperatorNexus/VirtualNetworkFunctionDefinitionVersionGet.json b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/AzureOperatorNexus/VirtualNetworkFunctionDefinitionVersionGet.json new file mode 100644 index 0000000000..6f3c19bfd5 --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/AzureOperatorNexus/VirtualNetworkFunctionDefinitionVersionGet.json @@ -0,0 +1,87 @@ +{ + "parameters": { + "api-version": "2025-03-30", + "networkFunctionDefinitionGroupName": "TestNetworkFunctionDefinitionGroupName", + "networkFunctionDefinitionVersionName": "1.0.0", + "publisherName": "TestPublisher", + "resourceGroupName": "rg", + "subscriptionId": "subid" + }, + "responses": { + "200": { + "body": { + "name": "TestVersion", + "type": "Microsoft.HybridNetwork/publishers/networkFunctionDefinitionGroups/networkFunctionDefinitionVersions", + "id": "/subscriptions/subid/resourcegroups/rg/providers/Microsoft.HybridNetwork/publishers/TestPublisher/networkFunctionDefinitionGroups/TestNetworkFunctionDefinitionGroupName/networkFunctionDefinitionVersions/1.0.0", + "location": "eastus", + "properties": { + "description": "test NFDV for AzureOperatorNexus", + "deployParameters": "{\"virtualMachineName\":{\"type\":\"string\"},\"extendedLocationName\":{\"type\":\"string\"},\"cpuCores\":{\"type\":\"int\"},\"memorySizeGB\":{\"type\":\"int\"},\"cloudServicesNetworkAttachment\":{\"type\":\"object\",\"properties\":{\"networkAttachmentName\":{\"type\":\"string\"},\"attachedNetworkId\":{\"type\":\"string\"},\"ipAllocationMethod\":{\"type\":\"string\"},\"ipv4Address\":{\"type\":\"string\"},\"ipv6Address\":{\"type\":\"string\"},\"defaultGateway\":{\"type\":\"string\"}},\"required\":[\"attachedNetworkId\",\"ipAllocationMethod\"]},\"networkAttachments\":{\"type\":\"array\",\"items\":{\"type\":\"object\",\"properties\":{\"networkAttachmentName\":{\"type\":\"string\"},\"attachedNetworkId\":{\"type\":\"string\"},\"ipAllocationMethod\":{\"type\":\"string\"},\"ipv4Address\":{\"type\":\"string\"},\"ipv6Address\":{\"type\":\"string\"},\"defaultGateway\":{\"type\":\"string\"}},\"required\":[\"attachedNetworkId\",\"ipAllocationMethod\"]}},\"storageProfile\":{\"type\":\"object\",\"properties\":{\"osDisk\":{\"type\":\"object\",\"properties\":{\"createOption\":{\"type\":\"string\"},\"deleteOption\":{\"type\":\"string\"},\"diskSizeGB\":{\"type\":\"integer\"}},\"required\":[\"diskSizeGB\"]}},\"required\":[\"osDisk\"]},\"sshPublicKeys\":{\"type\":\"array\",\"items\":{\"type\":\"object\",\"properties\":{\"keyData\":{\"type\":\"string\"}},\"required\":[\"keyData\"]}},\"userData\":{\"type\":\"string\"},\"adminUsername\":{\"type\":\"string\"},\"bootMethod\":{\"type\":\"string\",\"default\":\"UEFI\",\"enum\":[\"UEFI\",\"BIOS\"]},\"isolateEmulatorThread\":{\"type\":\"string\"},\"virtioInterface\":{\"type\":\"string\"},\"placementHints\":{\"type\":\"array\",\"items\":{\"type\":\"object\",\"properties\":{\"hintType\":{\"type\":\"string\",\"enum\":[\"Affinity\",\"AntiAffinity\"]},\"resourceId\":{\"type\":\"string\"},\"schedulingExecution\":{\"type\":\"string\",\"enum\":[\"Soft\",\"Hard\"]},\"scope\":{\"type\":\"string\"}},\"required\":[\"hintType\",\"schedulingExecution\",\"resourceId\",\"scope\"]}}}", + "networkFunctionTemplate": { + "networkFunctionApplications": [ + { + "name": "testImageRole", + "artifactProfile": { + "artifactStore": { + "id": "/subscriptions/subid/resourceGroups/rg/providers/microsoft.hybridnetwork/publishers/TestPublisher/artifactStores/TestArtifactStore" + }, + "imageArtifactProfile": { + "imageName": "test-image", + "imageVersion": "1.0.0" + } + }, + "artifactType": "ImageFile", + "dependsOnProfile": { + "installDependsOn": [], + "uninstallDependsOn": [], + "updateDependsOn": [] + }, + "deployParametersMappingRuleProfile": { + "applicationEnablement": "Unknown", + "imageMappingRuleProfile": { + "userConfiguration": "" + } + } + }, + { + "name": "testTemplateRole", + "artifactProfile": { + "artifactStore": { + "id": "/subscriptions/subid/resourceGroups/rg/providers/microsoft.hybridnetwork/publishers/TestPublisher/artifactStores/TestArtifactStore" + }, + "templateArtifactProfile": { + "templateName": "test-template", + "templateVersion": "1.0.0" + } + }, + "artifactType": "ArmTemplate", + "dependsOnProfile": { + "installDependsOn": [ + "testImageRole" + ], + "uninstallDependsOn": [ + "testImageRole" + ], + "updateDependsOn": [ + "testImageRole" + ] + }, + "deployParametersMappingRuleProfile": { + "applicationEnablement": "Unknown", + "templateMappingRuleProfile": { + "templateParameters": "{\"virtualMachineName\":\"{deployParameters.virtualMachineName}\",\"extendedLocationName\":\"{deployParameters.extendedLocationName}\",\"cpuCores\":\"{deployParameters.cpuCores}\",\"memorySizeGB\":\"{deployParameters.memorySizeGB}\",\"cloudServicesNetworkAttachment\":\"{deployParameters.cloudServicesNetworkAttachment}\",\"networkAttachments\":\"{deployParameters.networkAttachments}\",\"sshPublicKeys\":\"{deployParameters.sshPublicKeys}\",\"storageProfile\":\"{deployParameters.storageProfile}\",\"isolateEmulatorThread\":\"{deployParameters.isolateEmulatorThread}\",\"virtioInterface\":\"{deployParameters.virtioInterface}\",\"userData\":\"{deployParameters.userData}\",\"adminUsername\":\"{deployParameters.adminUsername}\",\"bootMethod\":\"{deployParameters.bootMethod}\",\"placementHints\":\"{deployParameters.placementHints}\"}" + } + } + } + ], + "nfviType": "AzureOperatorNexus" + }, + "networkFunctionType": "VirtualNetworkFunction", + "versionState": "Preview" + } + } + } + }, + "operationId": "NetworkFunctionDefinitionVersions_Get", + "title": "Get network function definition version resource for AzureOperatorNexus VNF" +} diff --git a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/AzureOperatorNexus/VirtualNetworkFunctionDelete.json b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/AzureOperatorNexus/VirtualNetworkFunctionDelete.json new file mode 100644 index 0000000000..be04721617 --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/AzureOperatorNexus/VirtualNetworkFunctionDelete.json @@ -0,0 +1,19 @@ +{ + "parameters": { + "api-version": "2025-03-30", + "networkFunctionName": "testNf", + "resourceGroupName": "rg", + "subscriptionId": "subid" + }, + "responses": { + "200": {}, + "202": { + "headers": { + "location": "https://management.azure.com/providers/microsoft.hybridnetwork/locations/EASTUS2EUAP/operationStatuses/0b37c625-7e7c-49c5-b86e-c817c85acb5d*B77A34159CA34A0BD446D3BC7EC120649181590DDF991982765DAC1A87491B2D?api-version=2021-05-01" + } + }, + "204": {} + }, + "operationId": "NetworkFunctions_Delete", + "title": "Delete virtual network function resource on AzureOperatorNexus" +} diff --git a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/AzureOperatorNexus/VirtualNetworkFunctionGet.json b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/AzureOperatorNexus/VirtualNetworkFunctionGet.json new file mode 100644 index 0000000000..d08a026a64 --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/AzureOperatorNexus/VirtualNetworkFunctionGet.json @@ -0,0 +1,33 @@ +{ + "parameters": { + "api-version": "2025-03-30", + "networkFunctionName": "testNf", + "resourceGroupName": "rg", + "subscriptionId": "subid" + }, + "responses": { + "200": { + "body": { + "name": "testNf", + "type": "Microsoft.HybridNetwork/networkFunctions", + "id": "/subscriptions/subid/resourcegroups/rg/providers/Microsoft.HybridNetwork/networkFunctions/testNf", + "location": "eastus", + "properties": { + "allowSoftwareUpdate": false, + "configurationType": "Open", + "deploymentValues": "{\"virtualMachineName\":\"test-VM\",\"extendedLocationName\":\"test-cluster\",\"cpuCores\":4,\"memorySizeGB\":8,\"cloudServicesNetworkAttachment\":{\"attachedNetworkId\":\"test-csnet\",\"ipAllocationMethod\":\"Dynamic\",\"networkAttachmentName\":\"test-cs-vlan\"},\"networkAttachments\":[{\"attachedNetworkId\":\"test-l3vlan\",\"defaultGateway\":\"True\",\"ipAllocationMethod\":\"Dynamic\",\"networkAttachmentName\":\"test-vlan\"}],\"sshPublicKeys\":[{\"keyData\":\"ssh-rsa CMIIIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEA0TqlveKKlc2MFvEmuXJiLGBsY1t4ML4uiRADGSZlnc+7Ugv3h+MCjkkwOKiOdsNo8k4KSBIG5GcQfKYOOd17AJvqCL6cGQbaLuqv0a64jeDm8oO8/xN/IM0oKw7rMr/2oAJOgIsfeXPkRxWWic9AVIS++H5Qi2r7bUFX+cqFsyUCAwEBBQ==\"}],\"storageProfile\":{\"osDisk\":{\"createOption\":\"Ephemeral\",\"deleteOption\":\"Delete\",\"diskSizeGB\":10}},\"userData\":\"testUserData\",\"adminUsername\":\"testUser\",\"virtioInterface\":\"Transitional\",\"isolateEmulatorThread\":\"False\",\"bootMethod\":\"BIOS\",\"placementHints\":[]}", + "networkFunctionDefinitionGroupName": "TestNetworkFunctionDefinitionGroupName", + "networkFunctionDefinitionOfferingLocation": "eastus", + "networkFunctionDefinitionVersion": "1.0.0", + "nfviId": "/subscriptions/subid/resourceGroups/testResourceGroup/providers/Microsoft.ExtendedLocation/customLocations/testCustomLocation", + "nfviType": "AzureOperatorNexus", + "provisioningState": "Succeeded", + "publisherName": "TestPublisher", + "publisherScope": "Private" + } + } + } + }, + "operationId": "NetworkFunctions_Get", + "title": "Get virtual network function resource on AzureOperatorNexus" +} diff --git a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ComponentGet.json b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ComponentGet.json new file mode 100644 index 0000000000..e8ed7ad1f1 --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ComponentGet.json @@ -0,0 +1,59 @@ +{ + "parameters": { + "api-version": "2025-03-30", + "componentName": "testComponent", + "networkFunctionName": "testNf", + "resourceGroupName": "rg", + "subscriptionId": "subid" + }, + "responses": { + "200": { + "body": { + "name": "testComponent", + "type": "Microsoft.HybridNetwork/networkFunctions/components", + "id": "/subscriptions/subid/resourcegroups/rg/providers/Microsoft.HybridNetwork/networkFunctions/testNf/components/testComponent", + "properties": { + "deploymentProfile": "{\"chart\":{\"name\":\"testChartName\",\"version\":\"v1.0.0\"},\"releaseName\":\"testReleaseName\",\"targetNamespace\":\"testTargetNameSpace\",\"values\":{\".repoBase\":\"testrepo.azurecr.io/\"}}", + "deploymentStatus": { + "nextExpectedUpdateAt": "2023-07-10T02:06:01.116+00:00", + "resources": { + "deployments": [ + { + "name": "nginix", + "available": 3, + "creationTime": "2023-07-10T02:05:01.116+00:00", + "desired": 3, + "namespace": "core", + "ready": 3, + "upToDate": 3 + } + ], + "pods": [ + { + "name": "nginix", + "creationTime": "2023-07-10T02:05:01.116+00:00", + "desired": 3, + "events": [ + { + "type": "Normal", + "lastSeenTime": "2023-07-10T02:06:01.116+00:00", + "message": "Pulling image nginx", + "reason": "Pulling" + } + ], + "namespace": "core", + "ready": 3, + "status": "Succeeded" + } + ] + }, + "status": "Installing" + }, + "provisioningState": "Succeeded" + } + } + } + }, + "operationId": "Components_Get", + "title": "Get component resource" +} diff --git a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ComponentListByNetworkFunction.json b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ComponentListByNetworkFunction.json new file mode 100644 index 0000000000..23e66f62c3 --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ComponentListByNetworkFunction.json @@ -0,0 +1,63 @@ +{ + "parameters": { + "api-version": "2025-03-30", + "networkFunctionName": "testNf", + "resourceGroupName": "rg", + "subscriptionId": "subid" + }, + "responses": { + "200": { + "body": { + "nextLink": "https://microsoft.com/a", + "value": [ + { + "name": "testComponent", + "type": "Microsoft.HybridNetwork/networkFunctions/components", + "id": "/subscriptions/subid/resourcegroups/rg/providers/Microsoft.HybridNetwork/networkFunctions/testNf/components/testComponent", + "properties": { + "deploymentProfile": "{\"chart\":{\"name\":\"testChartName\",\"version\":\"v1.0.0\"},\"releaseName\":\"testReleaseName\",\"targetNamespace\":\"testTargetNameSpace\",\"values\":{\".repoBase\":\"testrepo.azurecr.io/\"}}", + "deploymentStatus": { + "nextExpectedUpdateAt": "2023-07-10T02:06:01.116+00:00", + "resources": { + "deployments": [ + { + "name": "nginix", + "available": 3, + "creationTime": "2023-07-10T02:05:01.116+00:00", + "desired": 3, + "namespace": "core", + "ready": 3, + "upToDate": 3 + } + ], + "pods": [ + { + "name": "nginix", + "creationTime": "2023-07-10T02:05:01.116+00:00", + "desired": 3, + "events": [ + { + "type": "Normal", + "lastSeenTime": "2023-07-10T02:06:01.116+00:00", + "message": "Pulling image nginx", + "reason": "Pulling" + } + ], + "namespace": "core", + "ready": 3, + "status": "Succeeded" + } + ] + }, + "status": "Installing" + }, + "provisioningState": "Succeeded" + } + } + ] + } + } + }, + "operationId": "Components_ListByNetworkFunction", + "title": "List components in network function" +} diff --git a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ConfigurationGroupSchemaCreate.json b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ConfigurationGroupSchemaCreate.json new file mode 100644 index 0000000000..379e9e1332 --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ConfigurationGroupSchemaCreate.json @@ -0,0 +1,62 @@ +{ + "parameters": { + "api-version": "2025-03-30", + "configurationGroupSchemaName": "testConfigurationGroupSchema", + "parameters": { + "location": "westUs2", + "properties": { + "description": "Schema with no secrets", + "schemaDefinition": "{\"type\":\"object\",\"properties\":{\"interconnect-groups\":{\"type\":\"object\",\"properties\":{\"type\":\"object\",\"properties\":{\"name\":{\"type\":\"string\"},\"international-interconnects\":{\"type\":\"array\",\"item\":{\"type\":\"string\"}},\"domestic-interconnects\":{\"type\":\"array\",\"item\":{\"type\":\"string\"}}}}},\"interconnect-group-assignments\":{\"type\":\"object\",\"properties\":{\"type\":\"object\",\"properties\":{\"ssc\":{\"type\":\"string\"},\"interconnects-interconnects\":{\"type\":\"string\"}}}}},\"required\":[\"interconnect-groups\",\"interconnect-group-assignments\"]}" + } + }, + "publisherName": "testPublisher", + "resourceGroupName": "rg1", + "subscriptionId": "subid" + }, + "responses": { + "200": { + "body": { + "name": "testConfigurationGroupSchema", + "type": "Microsoft.HybridNetwork/publishers/configurationGroupSchemas", + "id": "/subscriptions/subid/resourcegroups/testRG/providers/microsoft.hybridnetwork/publishers/testPublisher/configurationGroupSchemas/interconnectgroupsSchema", + "location": "westUs2", + "properties": { + "description": "Schema with no secrets", + "provisioningState": "Accepted", + "schemaDefinition": "{\"type\":\"object\",\"properties\":{\"interconnect-groups\":{\"type\":\"object\",\"properties\":{\"type\":\"object\",\"properties\":{\"name\":{\"type\":\"string\"},\"international-interconnects\":{\"type\":\"array\",\"item\":{\"type\":\"string\"}},\"domestic-interconnects\":{\"type\":\"array\",\"item\":{\"type\":\"string\"}}}}},\"interconnect-group-assignments\":{\"type\":\"object\",\"properties\":{\"type\":\"object\",\"properties\":{\"ssc\":{\"type\":\"string\"},\"interconnects-interconnects\":{\"type\":\"string\"}}}}},\"required\":[\"interconnect-groups\",\"interconnect-group-assignments\"]}" + }, + "systemData": { + "createdAt": "2020-01-01T17:18:19.1234567Z", + "createdBy": "user1", + "createdByType": "User", + "lastModifiedAt": "2020-01-02T17:18:19.1234567Z", + "lastModifiedBy": "user2", + "lastModifiedByType": "User" + } + } + }, + "201": { + "body": { + "name": "testConfigurationGroupSchema", + "type": "Microsoft.HybridNetwork/publishers/configurationGroupSchemas", + "id": "/subscriptions/subid/resourcegroups/testRG/providers/microsoft.hybridnetwork/publishers/testPublisher/configurationGroupSchemas/interconnectgroupsSchema", + "location": "westUs2", + "properties": { + "description": "Schema with no secrets", + "provisioningState": "Accepted", + "schemaDefinition": "{\"type\":\"object\",\"properties\":{\"interconnect-groups\":{\"type\":\"object\",\"properties\":{\"type\":\"object\",\"properties\":{\"name\":{\"type\":\"string\"},\"international-interconnects\":{\"type\":\"array\",\"item\":{\"type\":\"string\"}},\"domestic-interconnects\":{\"type\":\"array\",\"item\":{\"type\":\"string\"}}}}},\"interconnect-group-assignments\":{\"type\":\"object\",\"properties\":{\"type\":\"object\",\"properties\":{\"ssc\":{\"type\":\"string\"},\"interconnects-interconnects\":{\"type\":\"string\"}}}}},\"required\":[\"interconnect-groups\",\"interconnect-group-assignments\"]}" + }, + "systemData": { + "createdAt": "2020-01-01T17:18:19.1234567Z", + "createdBy": "user1", + "createdByType": "User", + "lastModifiedAt": "2020-01-02T17:18:19.1234567Z", + "lastModifiedBy": "user2", + "lastModifiedByType": "User" + } + } + } + }, + "operationId": "ConfigurationGroupSchemas_CreateOrUpdate", + "title": "Create or update the network function definition group" +} diff --git a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ConfigurationGroupSchemaDelete.json b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ConfigurationGroupSchemaDelete.json new file mode 100644 index 0000000000..932397cab4 --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ConfigurationGroupSchemaDelete.json @@ -0,0 +1,19 @@ +{ + "parameters": { + "api-version": "2025-03-30", + "configurationGroupSchemaName": "testConfigurationGroupSchema", + "publisherName": "testPublisher", + "resourceGroupName": "rg1", + "subscriptionId": "subid" + }, + "responses": { + "202": { + "headers": { + "location": "https://management.azure.com/providers/microsoft.hybridnetwork/locations/EASTUS2EUAP/operationStatuses/0b37c625-7e7c-49c5-b86e-c817c85acb5d*B77A34159CA34A0BD446D3BC7EC120649181590DDF991982765DAC1A87491B2D?api-version=2021-05-01" + } + }, + "204": {} + }, + "operationId": "ConfigurationGroupSchemas_Delete", + "title": "Delete a network function group resource" +} diff --git a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ConfigurationGroupSchemaGet.json b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ConfigurationGroupSchemaGet.json new file mode 100644 index 0000000000..7c661f319d --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ConfigurationGroupSchemaGet.json @@ -0,0 +1,34 @@ +{ + "parameters": { + "api-version": "2025-03-30", + "configurationGroupSchemaName": "testConfigurationGroupSchema", + "publisherName": "testPublisher", + "resourceGroupName": "rg1", + "subscriptionId": "subid" + }, + "responses": { + "200": { + "body": { + "name": "testConfigurationGroupSchema", + "type": "Microsoft.HybridNetwork/publishers/configurationGroupSchemas", + "id": "/subscriptions/subid/resourcegroups/testRG/providers/microsoft.hybridnetwork/publishers/testPublisher/configurationGroupSchemas/interconnectgroupsSchema", + "location": "westUs2", + "properties": { + "description": "Schema with no secrets", + "provisioningState": "Accepted", + "schemaDefinition": "{\"type\":\"object\",\"properties\":{\"interconnect-groups\":{\"type\":\"object\",\"properties\":{\"type\":\"object\",\"properties\":{\"name\":{\"type\":\"string\"},\"international-interconnects\":{\"type\":\"array\",\"item\":{\"type\":\"string\"}},\"domestic-interconnects\":{\"type\":\"array\",\"item\":{\"type\":\"string\"}}}}},\"interconnect-group-assignments\":{\"type\":\"object\",\"properties\":{\"type\":\"object\",\"properties\":{\"ssc\":{\"type\":\"string\"},\"interconnects-interconnects\":{\"type\":\"string\"}}}}},\"required\":[\"interconnect-groups\",\"interconnect-group-assignments\"]}" + }, + "systemData": { + "createdAt": "2020-01-01T17:18:19.1234567Z", + "createdBy": "user1", + "createdByType": "User", + "lastModifiedAt": "2020-01-02T17:18:19.1234567Z", + "lastModifiedBy": "user2", + "lastModifiedByType": "User" + } + } + } + }, + "operationId": "ConfigurationGroupSchemas_Get", + "title": "Get a networkFunctionDefinition group resource" +} diff --git a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ConfigurationGroupSchemaListByPublisherName.json b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ConfigurationGroupSchemaListByPublisherName.json new file mode 100644 index 0000000000..4fca965e07 --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ConfigurationGroupSchemaListByPublisherName.json @@ -0,0 +1,37 @@ +{ + "parameters": { + "api-version": "2025-03-30", + "publisherName": "testPublisher", + "resourceGroupName": "rg1", + "subscriptionId": "subid" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "name": "testConfigurationGroupSchema", + "type": "Microsoft.HybridNetwork/publishers/configurationGroupSchemas", + "id": "/subscriptions/subid/resourcegroups/testRG/providers/microsoft.hybridnetwork/publishers/testPublisher/configurationGroupSchemas/interconnectgroupsSchema", + "location": "westUs2", + "properties": { + "description": "Schema with no secrets", + "provisioningState": "Accepted", + "schemaDefinition": "{\"type\":\"object\",\"properties\":{\"interconnect-groups\":{\"type\":\"object\",\"properties\":{\"type\":\"object\",\"properties\":{\"name\":{\"type\":\"string\"},\"international-interconnects\":{\"type\":\"array\",\"item\":{\"type\":\"string\"}},\"domestic-interconnects\":{\"type\":\"array\",\"item\":{\"type\":\"string\"}}}}},\"interconnect-group-assignments\":{\"type\":\"object\",\"properties\":{\"type\":\"object\",\"properties\":{\"ssc\":{\"type\":\"string\"},\"interconnects-interconnects\":{\"type\":\"string\"}}}}},\"required\":[\"interconnect-groups\",\"interconnect-group-assignments\"]}" + }, + "systemData": { + "createdAt": "2020-01-01T17:18:19.1234567Z", + "createdBy": "user1", + "createdByType": "User", + "lastModifiedAt": "2020-01-02T17:18:19.1234567Z", + "lastModifiedBy": "user2", + "lastModifiedByType": "User" + } + } + ] + } + } + }, + "operationId": "ConfigurationGroupSchemas_ListByPublisher", + "title": "Get networkFunctionDefinition groups under publisher resource" +} diff --git a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ConfigurationGroupSchemaUpdateTags.json b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ConfigurationGroupSchemaUpdateTags.json new file mode 100644 index 0000000000..37e1d2f9ea --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ConfigurationGroupSchemaUpdateTags.json @@ -0,0 +1,44 @@ +{ + "parameters": { + "api-version": "2025-03-30", + "configurationGroupSchemaName": "testConfigurationGroupSchema", + "parameters": { + "tags": { + "tag1": "value1", + "tag2": "value2" + } + }, + "publisherName": "testPublisher", + "resourceGroupName": "rg1", + "subscriptionId": "subid" + }, + "responses": { + "200": { + "body": { + "name": "testConfigurationGroupSchema", + "type": "Microsoft.HybridNetwork/publishers/configurationGroupSchemas", + "id": "/subscriptions/subid/resourcegroups/testRG/providers/microsoft.hybridnetwork/publishers/testPublisher/configurationGroupSchemas/interconnectgroupsSchema", + "location": "westUs2", + "properties": { + "description": "Schema with no secrets", + "provisioningState": "Accepted", + "schemaDefinition": "{\"type\":\"object\",\"properties\":{\"interconnect-groups\":{\"type\":\"object\",\"properties\":{\"type\":\"object\",\"properties\":{\"name\":{\"type\":\"string\"},\"international-interconnects\":{\"type\":\"array\",\"item\":{\"type\":\"string\"}},\"domestic-interconnects\":{\"type\":\"array\",\"item\":{\"type\":\"string\"}}}}},\"interconnect-group-assignments\":{\"type\":\"object\",\"properties\":{\"type\":\"object\",\"properties\":{\"ssc\":{\"type\":\"string\"},\"interconnects-interconnects\":{\"type\":\"string\"}}}}},\"required\":[\"interconnect-groups\",\"interconnect-group-assignments\"]}" + }, + "systemData": { + "createdAt": "2020-01-01T17:18:19.1234567Z", + "createdBy": "user1", + "createdByType": "User", + "lastModifiedAt": "2020-01-02T17:18:19.1234567Z", + "lastModifiedBy": "user2", + "lastModifiedByType": "User" + }, + "tags": { + "tag1": "value1", + "tag2": "value2" + } + } + } + }, + "operationId": "ConfigurationGroupSchemas_Update", + "title": "Create or update the configuration group schema resource" +} diff --git a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ConfigurationGroupSchemaVersionUpdateState.json b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ConfigurationGroupSchemaVersionUpdateState.json new file mode 100644 index 0000000000..be066545e7 --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ConfigurationGroupSchemaVersionUpdateState.json @@ -0,0 +1,26 @@ +{ + "parameters": { + "api-version": "2025-03-30", + "configurationGroupSchemaName": "testConfigurationGroupSchema", + "parameters": { + "versionState": "Active" + }, + "publisherName": "testPublisher", + "resourceGroupName": "rg1", + "subscriptionId": "subid" + }, + "responses": { + "200": { + "body": { + "versionState": "Active" + } + }, + "202": { + "headers": { + "location": "https://management.azure.com/providers/microsoft.hybridnetwork/locations/EASTUS2EUAP/operationStatuses/0b37c625-7e7c-49c5-b86e-c817c85acb5d*B77A34159CA34A0BD446D3BC7EC120649181590DDF991982765DAC1A87491B2D?api-version=2021-05-01" + } + } + }, + "operationId": "ConfigurationGroupSchemas_updateState", + "title": "Update network service design version state" +} diff --git a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ConfigurationGroupValueCreate.json b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ConfigurationGroupValueCreate.json new file mode 100644 index 0000000000..b5b53118c1 --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ConfigurationGroupValueCreate.json @@ -0,0 +1,83 @@ +{ + "parameters": { + "api-version": "2025-03-30", + "configurationGroupValueName": "testConfigurationGroupValue", + "parameters": { + "location": "eastus", + "properties": { + "configurationGroupSchemaResourceReference": { + "id": "/subscriptions/subid/resourcegroups/testRG/providers/microsoft.hybridnetwork/publishers/testPublisher/configurationGroupSchemas/testConfigurationGroupSchemaName", + "idType": "Open" + }, + "configurationType": "Open", + "configurationValue": "{\"interconnect-groups\":{\"stripe-one\":{\"name\":\"Stripe one\",\"international-interconnects\":[\"france\",\"germany\"],\"domestic-interconnects\":[\"birmingham\",\"edinburgh\"]},\"stripe-two\":{\"name\":\"Stripe two\",\"international-interconnects\":[\"germany\",\"italy\"],\"domestic-interconnects\":[\"edinburgh\",\"london\"]}},\"interconnect-group-assignments\":{\"ssc-one\":{\"ssc\":\"SSC 1\",\"interconnects\":\"stripe-one\"},\"ssc-two\":{\"ssc\":\"SSC 2\",\"interconnects\":\"stripe-two\"}}}" + } + }, + "resourceGroupName": "rg1", + "subscriptionId": "subid" + }, + "responses": { + "200": { + "body": { + "name": "testConfigurationGroupValue", + "type": "Microsoft.HybridNetwork/configurationGroupValues", + "id": "/subscriptions/subid/providers/Microsoft.HybridNetwork/configurationGroupValues/testConfigurationGroupValue", + "location": "eastus", + "properties": { + "configurationGroupSchemaName": "testConfigurationGroupSchemaName", + "configurationGroupSchemaOfferingLocation": "eastus", + "configurationGroupSchemaResourceReference": { + "id": "/subscriptions/subid/resourcegroups/testRG/providers/microsoft.hybridnetwork/publishers/testPublisher/configurationGroupSchemas/testConfigurationGroupSchemaName", + "idType": "Open" + }, + "configurationType": "Open", + "configurationValue": "{\"interconnect-groups\":{\"stripe-one\":{\"name\":\"Stripe one\",\"international-interconnects\":[\"france\",\"germany\"],\"domestic-interconnects\":[\"birmingham\",\"edinburgh\"]},\"stripe-two\":{\"name\":\"Stripe two\",\"international-interconnects\":[\"germany\",\"italy\"],\"domestic-interconnects\":[\"edinburgh\",\"london\"]}},\"interconnect-group-assignments\":{\"ssc-one\":{\"ssc\":\"SSC 1\",\"interconnects\":\"stripe-one\"},\"ssc-two\":{\"ssc\":\"SSC 2\",\"interconnects\":\"stripe-two\"}}}", + "provisioningState": "Succeeded", + "publisherName": "testPublisher", + "publisherScope": "Public" + }, + "systemData": { + "createdAt": "2020-01-01T17:18:19.1234567Z", + "createdBy": "user1", + "createdByType": "User", + "lastModifiedAt": "2020-01-02T17:18:19.1234567Z", + "lastModifiedBy": "user2", + "lastModifiedByType": "User" + }, + "tags": {} + } + }, + "201": { + "body": { + "name": "testConfigurationGroup", + "type": "Microsoft.HybridNetwork/configurationGroups", + "id": "/subscriptions/subid/providers/Microsoft.HybridNetwork/configurationGroups/testConfigurationGroup", + "location": "eastus", + "properties": { + "configurationGroupSchemaName": "testConfigurationGroupSchemaName", + "configurationGroupSchemaOfferingLocation": "eastus", + "configurationGroupSchemaResourceReference": { + "id": "/subscriptions/subid/resourcegroups/testRG/providers/microsoft.hybridnetwork/publishers/testPublisher/configurationGroupSchemas/testConfigurationGroupSchemaName", + "idType": "Open" + }, + "configurationType": "Open", + "configurationValue": "{\"interconnect-groups\":{\"stripe-one\":{\"name\":\"Stripe one\",\"international-interconnects\":[\"france\",\"germany\"],\"domestic-interconnects\":[\"birmingham\",\"edinburgh\"]},\"stripe-two\":{\"name\":\"Stripe two\",\"international-interconnects\":[\"germany\",\"italy\"],\"domestic-interconnects\":[\"edinburgh\",\"london\"]}},\"interconnect-group-assignments\":{\"ssc-one\":{\"ssc\":\"SSC 1\",\"interconnects\":\"stripe-one\"},\"ssc-two\":{\"ssc\":\"SSC 2\",\"interconnects\":\"stripe-two\"}}}", + "provisioningState": "Succeeded", + "publisherName": "testPublisher", + "publisherScope": "Public" + }, + "systemData": { + "createdAt": "2020-01-01T17:18:19.1234567Z", + "createdBy": "user1", + "createdByType": "User", + "lastModifiedAt": "2020-01-02T17:18:19.1234567Z", + "lastModifiedBy": "user2", + "lastModifiedByType": "User" + }, + "tags": {} + } + } + }, + "operationId": "ConfigurationGroupValues_CreateOrUpdate", + "title": "Create or update configuration group value" +} diff --git a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ConfigurationGroupValueCreateSecret.json b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ConfigurationGroupValueCreateSecret.json new file mode 100644 index 0000000000..64ec575632 --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ConfigurationGroupValueCreateSecret.json @@ -0,0 +1,81 @@ +{ + "parameters": { + "api-version": "2025-03-30", + "configurationGroupValueName": "testConfigurationGroupValue", + "parameters": { + "location": "eastus", + "properties": { + "configurationGroupSchemaResourceReference": { + "id": "/subscriptions/subid/resourcegroups/testRG/providers/microsoft.hybridnetwork/publishers/testPublisher/configurationGroupSchemas/testConfigurationGroupSchemaName", + "idType": "Open" + }, + "configurationType": "Secret", + "secretConfigurationValue": "{\"interconnect-groups\":{\"stripe-one\":{\"name\":\"Stripe one\",\"international-interconnects\":[\"france\",\"germany\"],\"domestic-interconnects\":[\"birmingham\",\"edinburgh\"]},\"stripe-two\":{\"name\":\"Stripe two\",\"international-interconnects\":[\"germany\",\"italy\"],\"domestic-interconnects\":[\"edinburgh\",\"london\"]}},\"interconnect-group-assignments\":{\"ssc-one\":{\"ssc\":\"SSC 1\",\"interconnects\":\"stripe-one\"},\"ssc-two\":{\"ssc\":\"SSC 2\",\"interconnects\":\"stripe-two\"}}}" + } + }, + "resourceGroupName": "rg1", + "subscriptionId": "subid" + }, + "responses": { + "200": { + "body": { + "name": "testConfigurationGroupValue", + "type": "Microsoft.HybridNetwork/configurationGroupValues", + "id": "/subscriptions/subid/providers/Microsoft.HybridNetwork/configurationGroupValues/testConfigurationGroupValue", + "location": "eastus", + "properties": { + "configurationGroupSchemaName": "testConfigurationGroupSchemaName", + "configurationGroupSchemaOfferingLocation": "eastus", + "configurationGroupSchemaResourceReference": { + "id": "/subscriptions/subid/resourcegroups/testRG/providers/microsoft.hybridnetwork/publishers/testPublisher/configurationGroupSchemas/testConfigurationGroupSchemaName", + "idType": "Open" + }, + "configurationType": "Secret", + "provisioningState": "Succeeded", + "publisherName": "testPublisher", + "publisherScope": "Public" + }, + "systemData": { + "createdAt": "2020-01-01T17:18:19.1234567Z", + "createdBy": "user1", + "createdByType": "User", + "lastModifiedAt": "2020-01-02T17:18:19.1234567Z", + "lastModifiedBy": "user2", + "lastModifiedByType": "User" + }, + "tags": {} + } + }, + "201": { + "body": { + "name": "testConfigurationGroup", + "type": "Microsoft.HybridNetwork/configurationGroups", + "id": "/subscriptions/subid/providers/Microsoft.HybridNetwork/configurationGroups/testConfigurationGroup", + "location": "eastus", + "properties": { + "configurationGroupSchemaName": "testConfigurationGroupSchemaName", + "configurationGroupSchemaOfferingLocation": "eastus", + "configurationGroupSchemaResourceReference": { + "id": "/subscriptions/subid/resourcegroups/testRG/providers/microsoft.hybridnetwork/publishers/testPublisher/configurationGroupSchemas/testConfigurationGroupSchemaName", + "idType": "Open" + }, + "configurationType": "Secret", + "provisioningState": "Succeeded", + "publisherName": "testPublisher", + "publisherScope": "Public" + }, + "systemData": { + "createdAt": "2020-01-01T17:18:19.1234567Z", + "createdBy": "user1", + "createdByType": "User", + "lastModifiedAt": "2020-01-02T17:18:19.1234567Z", + "lastModifiedBy": "user2", + "lastModifiedByType": "User" + }, + "tags": {} + } + } + }, + "operationId": "ConfigurationGroupValues_CreateOrUpdate", + "title": "Create or update configuration group value with secrets" +} diff --git a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ConfigurationGroupValueDelete.json b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ConfigurationGroupValueDelete.json new file mode 100644 index 0000000000..41a6b69f4c --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ConfigurationGroupValueDelete.json @@ -0,0 +1,18 @@ +{ + "parameters": { + "api-version": "2025-03-30", + "configurationGroupValueName": "testConfigurationGroupValue", + "resourceGroupName": "rg1", + "subscriptionId": "subid" + }, + "responses": { + "202": { + "headers": { + "location": "https://management.azure.com/providers/microsoft.hybridnetwork/locations/EASTUS2EUAP/operationStatuses/0b37c625-7e7c-49c5-b86e-c817c85acb5d*B77A34159CA34A0BD446D3BC7EC120649181590DDF991982765DAC1A87491B2D?api-version=2021-05-01" + } + }, + "204": {} + }, + "operationId": "ConfigurationGroupValues_Delete", + "title": "Delete hybrid configuration group resource" +} diff --git a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ConfigurationGroupValueFirstPartyCreate.json b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ConfigurationGroupValueFirstPartyCreate.json new file mode 100644 index 0000000000..9c799b91df --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ConfigurationGroupValueFirstPartyCreate.json @@ -0,0 +1,81 @@ +{ + "parameters": { + "api-version": "2025-03-30", + "configurationGroupValueName": "testConfigurationGroupValue", + "parameters": { + "location": "eastus", + "properties": { + "configurationGroupSchemaResourceReference": { + "id": "/subscriptions/subid/resourcegroups/testRG/providers/microsoft.hybridnetwork/publishers/testPublisher/configurationGroupSchemas/testConfigurationGroupSchemaName", + "idType": "Secret" + }, + "configurationType": "Open", + "configurationValue": "{\"interconnect-groups\":{\"stripe-one\":{\"name\":\"Stripe one\",\"international-interconnects\":[\"france\",\"germany\"],\"domestic-interconnects\":[\"birmingham\",\"edinburgh\"]},\"stripe-two\":{\"name\":\"Stripe two\",\"international-interconnects\":[\"germany\",\"italy\"],\"domestic-interconnects\":[\"edinburgh\",\"london\"]}},\"interconnect-group-assignments\":{\"ssc-one\":{\"ssc\":\"SSC 1\",\"interconnects\":\"stripe-one\"},\"ssc-two\":{\"ssc\":\"SSC 2\",\"interconnects\":\"stripe-two\"}}}" + } + }, + "resourceGroupName": "rg1", + "subscriptionId": "subid" + }, + "responses": { + "200": { + "body": { + "name": "testConfigurationGroupValue", + "type": "Microsoft.HybridNetwork/configurationGroupValues", + "id": "/subscriptions/subid/providers/Microsoft.HybridNetwork/configurationGroupValues/testConfigurationGroupValue", + "location": "eastus", + "properties": { + "configurationGroupSchemaName": "testConfigurationGroupSchemaName", + "configurationGroupSchemaOfferingLocation": "eastus", + "configurationGroupSchemaResourceReference": { + "idType": "Secret" + }, + "configurationType": "Open", + "configurationValue": "{\"interconnect-groups\":{\"stripe-one\":{\"name\":\"Stripe one\",\"international-interconnects\":[\"france\",\"germany\"],\"domestic-interconnects\":[\"birmingham\",\"edinburgh\"]},\"stripe-two\":{\"name\":\"Stripe two\",\"international-interconnects\":[\"germany\",\"italy\"],\"domestic-interconnects\":[\"edinburgh\",\"london\"]}},\"interconnect-group-assignments\":{\"ssc-one\":{\"ssc\":\"SSC 1\",\"interconnects\":\"stripe-one\"},\"ssc-two\":{\"ssc\":\"SSC 2\",\"interconnects\":\"stripe-two\"}}}", + "provisioningState": "Succeeded", + "publisherName": "testPublisher", + "publisherScope": "Private" + }, + "systemData": { + "createdAt": "2020-01-01T17:18:19.1234567Z", + "createdBy": "user1", + "createdByType": "User", + "lastModifiedAt": "2020-01-02T17:18:19.1234567Z", + "lastModifiedBy": "user2", + "lastModifiedByType": "User" + }, + "tags": {} + } + }, + "201": { + "body": { + "name": "testConfigurationGroup", + "type": "Microsoft.HybridNetwork/configurationGroups", + "id": "/subscriptions/subid/providers/Microsoft.HybridNetwork/configurationGroups/testConfigurationGroup", + "location": "eastus", + "properties": { + "configurationGroupSchemaName": "testConfigurationGroupSchemaName", + "configurationGroupSchemaOfferingLocation": "eastus", + "configurationGroupSchemaResourceReference": { + "idType": "Secret" + }, + "configurationType": "Open", + "configurationValue": "{\"interconnect-groups\":{\"stripe-one\":{\"name\":\"Stripe one\",\"international-interconnects\":[\"france\",\"germany\"],\"domestic-interconnects\":[\"birmingham\",\"edinburgh\"]},\"stripe-two\":{\"name\":\"Stripe two\",\"international-interconnects\":[\"germany\",\"italy\"],\"domestic-interconnects\":[\"edinburgh\",\"london\"]}},\"interconnect-group-assignments\":{\"ssc-one\":{\"ssc\":\"SSC 1\",\"interconnects\":\"stripe-one\"},\"ssc-two\":{\"ssc\":\"SSC 2\",\"interconnects\":\"stripe-two\"}}}", + "provisioningState": "Succeeded", + "publisherName": "testPublisher", + "publisherScope": "Private" + }, + "systemData": { + "createdAt": "2020-01-01T17:18:19.1234567Z", + "createdBy": "user1", + "createdByType": "User", + "lastModifiedAt": "2020-01-02T17:18:19.1234567Z", + "lastModifiedBy": "user2", + "lastModifiedByType": "User" + }, + "tags": {} + } + } + }, + "operationId": "ConfigurationGroupValues_CreateOrUpdate", + "title": "Create or update first party configuration group value" +} diff --git a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ConfigurationGroupValueGet.json b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ConfigurationGroupValueGet.json new file mode 100644 index 0000000000..fcf1fb2455 --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ConfigurationGroupValueGet.json @@ -0,0 +1,42 @@ +{ + "parameters": { + "api-version": "2025-03-30", + "configurationGroupValueName": "testConfigurationGroupValue", + "resourceGroupName": "rg1", + "subscriptionId": "subid" + }, + "responses": { + "200": { + "body": { + "name": "testConfigurationGroupValue", + "type": "Microsoft.HybridNetwork/configurationGroupValues", + "id": "/subscriptions/subid/providers/Microsoft.HybridNetwork/configurationGroupValues/testConfigurationGroupValue", + "location": "eastus", + "properties": { + "configurationGroupSchemaName": "testConfigurationGroupSchemaName", + "configurationGroupSchemaOfferingLocation": "eastus", + "configurationGroupSchemaResourceReference": { + "id": "/subscriptions/subid/resourcegroups/testRG/providers/microsoft.hybridnetwork/publishers/testPublisher/configurationGroupSchemas/testConfigurationGroupSchemaName", + "idType": "Open" + }, + "configurationType": "Open", + "configurationValue": "{\"interconnect-groups\":{\"stripe-one\":{\"name\":\"Stripe one\",\"international-interconnects\":[\"france\",\"germany\"],\"domestic-interconnects\":[\"birmingham\",\"edinburgh\"]},\"stripe-two\":{\"name\":\"Stripe two\",\"international-interconnects\":[\"germany\",\"italy\"],\"domestic-interconnects\":[\"edinburgh\",\"london\"]}},\"interconnect-group-assignments\":{\"ssc-one\":{\"ssc\":\"SSC 1\",\"interconnects\":\"stripe-one\"},\"ssc-two\":{\"ssc\":\"SSC 2\",\"interconnects\":\"stripe-two\"}}}", + "provisioningState": "Succeeded", + "publisherName": "testPublisher", + "publisherScope": "Private" + }, + "systemData": { + "createdAt": "2020-01-01T17:18:19.1234567Z", + "createdBy": "user1", + "createdByType": "User", + "lastModifiedAt": "2020-01-02T17:18:19.1234567Z", + "lastModifiedBy": "user2", + "lastModifiedByType": "User" + }, + "tags": {} + } + } + }, + "operationId": "ConfigurationGroupValues_Get", + "title": "Get hybrid configuration group" +} diff --git a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ConfigurationGroupValueListByResourceGroup.json b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ConfigurationGroupValueListByResourceGroup.json new file mode 100644 index 0000000000..62094174d8 --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ConfigurationGroupValueListByResourceGroup.json @@ -0,0 +1,43 @@ +{ + "parameters": { + "api-version": "2025-03-30", + "resourceGroupName": "rg1", + "subscriptionId": "subid" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "name": "testConfigurationGroupValue", + "type": "Microsoft.HybridNetwork/configurationGroupValues", + "id": "/subscriptions/subid/providers/Microsoft.HybridNetwork/configurationGroupValues/testConfigurationGroupValue", + "location": "westUs2", + "properties": { + "configurationGroupSchemaName": "testConfigurationGroupSchemaName", + "configurationGroupSchemaOfferingLocation": "eastus", + "configurationGroupSchemaResourceReference": { + "id": "/subscriptions/subid/resourcegroups/testRG/providers/microsoft.hybridnetwork/publishers/testPublisher/configurationGroupSchemas/testConfigurationGroupSchemaName", + "idType": "Open" + }, + "configurationType": "Open", + "configurationValue": "{\"interconnect-groups\":{\"stripe-one\":{\"name\":\"Stripe one\",\"international-interconnects\":[\"france\",\"germany\"],\"domestic-interconnects\":[\"birmingham\",\"edinburgh\"]},\"stripe-two\":{\"name\":\"Stripe two\",\"international-interconnects\":[\"germany\",\"italy\"],\"domestic-interconnects\":[\"edinburgh\",\"london\"]}},\"interconnect-group-assignments\":{\"ssc-one\":{\"ssc\":\"SSC 1\",\"interconnects\":\"stripe-one\"},\"ssc-two\":{\"ssc\":\"SSC 2\",\"interconnects\":\"stripe-two\"}}}", + "publisherName": "testPublisher", + "publisherScope": "Public" + }, + "systemData": { + "createdAt": "2020-01-01T17:18:19.1234567Z", + "createdBy": "user1", + "createdByType": "User", + "lastModifiedAt": "2020-01-02T17:18:19.1234567Z", + "lastModifiedBy": "user2", + "lastModifiedByType": "User" + } + } + ] + } + } + }, + "operationId": "ConfigurationGroupValues_ListByResourceGroup", + "title": "List all hybrid network configurationGroupValues in a subscription." +} diff --git a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ConfigurationGroupValueListBySubscription.json b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ConfigurationGroupValueListBySubscription.json new file mode 100644 index 0000000000..d74e3a4165 --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ConfigurationGroupValueListBySubscription.json @@ -0,0 +1,46 @@ +{ + "parameters": { + "api-version": "2025-03-30", + "subscriptionId": "subid" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "name": "testConfigurationGroupValue", + "type": "Microsoft.HybridNetwork/configurationGroupValues", + "id": "/subscriptions/subid/providers/Microsoft.HybridNetwork/configurationGroupValues/testConfigurationGroupValue", + "location": "eastus", + "properties": { + "configurationGroupSchemaName": "testConfigurationGroupSchemaName", + "configurationGroupSchemaOfferingLocation": "eastus", + "configurationGroupSchemaResourceReference": { + "id": "/subscriptions/subid/resourcegroups/testRG/providers/microsoft.hybridnetwork/publishers/testPublisher/configurationGroupSchemas/testConfigurationGroupSchemaName", + "idType": "Open" + }, + "configurationType": "Open", + "configurationValue": "{\"interconnect-groups\":{\"stripe-one\":{\"name\":\"Stripe one\",\"international-interconnects\":[\"france\",\"germany\"],\"domestic-interconnects\":[\"birmingham\",\"edinburgh\"]},\"stripe-two\":{\"name\":\"Stripe two\",\"international-interconnects\":[\"germany\",\"italy\"],\"domestic-interconnects\":[\"edinburgh\",\"london\"]}},\"interconnect-group-assignments\":{\"ssc-one\":{\"ssc\":\"SSC 1\",\"interconnects\":\"stripe-one\"},\"ssc-two\":{\"ssc\":\"SSC 2\",\"interconnects\":\"stripe-two\"}}}", + "publisherName": "testPublisher", + "publisherScope": "Public" + }, + "systemData": { + "createdAt": "2020-01-01T17:18:19.1234567Z", + "createdBy": "user1", + "createdByType": "User", + "lastModifiedAt": "2020-01-02T17:18:19.1234567Z", + "lastModifiedBy": "user2", + "lastModifiedByType": "User" + }, + "tags": { + "tag1": "value1", + "tag2": "value2" + } + } + ] + } + } + }, + "operationId": "ConfigurationGroupValues_ListBySubscription", + "title": "List all hybrid network sites in a subscription." +} diff --git a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ConfigurationGroupValueUpdateTags.json b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ConfigurationGroupValueUpdateTags.json new file mode 100644 index 0000000000..13e6a6a0e0 --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ConfigurationGroupValueUpdateTags.json @@ -0,0 +1,51 @@ +{ + "parameters": { + "api-version": "2025-03-30", + "configurationGroupValueName": "testConfigurationGroupValue", + "parameters": { + "tags": { + "tag1": "value1", + "tag2": "value2" + } + }, + "resourceGroupName": "rg1", + "subscriptionId": "subid" + }, + "responses": { + "200": { + "body": { + "name": "testConfigurationGroupValue", + "type": "Microsoft.HybridNetwork/configurationGroupValues", + "id": "/subscriptions/subid/providers/Microsoft.HybridNetwork/configurationGroupValues/testConfigurationGroupValue", + "location": "eastus", + "properties": { + "configurationGroupSchemaName": "testConfigurationGroupSchemaName", + "configurationGroupSchemaOfferingLocation": "eastus", + "configurationGroupSchemaResourceReference": { + "id": "/subscriptions/subid/resourcegroups/testRG/providers/microsoft.hybridnetwork/publishers/testPublisher/configurationGroupSchemas/testConfigurationGroupSchemaName", + "idType": "Open" + }, + "configurationType": "Open", + "configurationValue": "{\"interconnect-groups\":{\"stripe-one\":{\"name\":\"Stripe one\",\"international-interconnects\":[\"france\",\"germany\"],\"domestic-interconnects\":[\"birmingham\",\"edinburgh\"]},\"stripe-two\":{\"name\":\"Stripe two\",\"international-interconnects\":[\"germany\",\"italy\"],\"domestic-interconnects\":[\"edinburgh\",\"london\"]}},\"interconnect-group-assignments\":{\"ssc-one\":{\"ssc\":\"SSC 1\",\"interconnects\":\"stripe-one\"},\"ssc-two\":{\"ssc\":\"SSC 2\",\"interconnects\":\"stripe-two\"}}}", + "provisioningState": "Succeeded", + "publisherName": "testPublisher", + "publisherScope": "Public" + }, + "systemData": { + "createdAt": "2020-01-01T17:18:19.1234567Z", + "createdBy": "user1", + "createdByType": "User", + "lastModifiedAt": "2020-01-02T17:18:19.1234567Z", + "lastModifiedBy": "user2", + "lastModifiedByType": "User" + }, + "tags": { + "tag1": "value1", + "tag2": "value2" + } + } + } + }, + "operationId": "ConfigurationGroupValues_UpdateTags", + "title": "Update hybrid configuration group tags" +} diff --git a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/GetOperations.json b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/GetOperations.json new file mode 100644 index 0000000000..62b4460fd4 --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/GetOperations.json @@ -0,0 +1,26 @@ +{ + "parameters": { + "api-version": "2025-03-30", + "location": "westus", + "subscriptionId": "subid" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "name": "Microsoft.HybridNetwork/NetworkFunctions/read", + "display": { + "description": "Gets Nf", + "operation": "Get Nf", + "provider": "Microsoft Hybrid Network", + "resource": "Nf" + } + } + ] + } + } + }, + "operationId": "Operations_List", + "title": "Get Registration Operations" +} diff --git a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkFunctionCreate.json b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkFunctionCreate.json new file mode 100644 index 0000000000..8397454adc --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkFunctionCreate.json @@ -0,0 +1,88 @@ +{ + "parameters": { + "api-version": "2025-03-30", + "networkFunctionName": "testNf", + "parameters": { + "location": "eastus", + "properties": { + "allowSoftwareUpdate": false, + "configurationType": "Open", + "deploymentValues": "{\"releaseName\":\"testReleaseName\",\"namespace\":\"testNamespace\"}", + "networkFunctionDefinitionVersionResourceReference": { + "id": "/subscriptions/subid/resourcegroups/rg/providers/Microsoft.HybridNetwork/publishers/testVendor/networkFunctionDefinitionGroups/testnetworkFunctionDefinitionGroupName/networkFunctionDefinitionVersions/1.0.1", + "idType": "Open" + }, + "nfviId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testResourceGroup/providers/Microsoft.ExtendedLocation/customLocations/testCustomLocation", + "nfviType": "AzureArcKubernetes", + "roleOverrideValues": [ + "{\"name\":\"testRoleOne\",\"deployParametersMappingRuleProfile\":{\"helmMappingRuleProfile\":{\"helmPackageVersion\":\"2.1.3\",\"values\":\"{\\\"roleOneParam\\\":\\\"roleOneOverrideValue\\\"}\"}}}", + "{\"name\":\"testRoleTwo\",\"deployParametersMappingRuleProfile\":{\"helmMappingRuleProfile\":{\"releaseName\":\"overrideReleaseName\",\"releaseNamespace\":\"overrideNamespace\",\"values\":\"{\\\"roleTwoParam\\\":\\\"roleTwoOverrideValue\\\"}\"}}}" + ] + } + }, + "resourceGroupName": "rg", + "subscriptionId": "subid" + }, + "responses": { + "200": { + "body": { + "name": "testNf", + "type": "Microsoft.HybridNetwork/networkFunctions", + "id": "/subscriptions/subid/resourcegroups/rg/providers/Microsoft.HybridNetwork/networkFunctions/testNf", + "location": "eastus", + "properties": { + "allowSoftwareUpdate": false, + "configurationType": "Open", + "deploymentValues": "{\"releaseName\":\"testReleaseName\",\"namespace\":\"testNamespace\"}", + "networkFunctionDefinitionGroupName": "testnetworkFunctionDefinitionGroupName", + "networkFunctionDefinitionOfferingLocation": "eastus", + "networkFunctionDefinitionVersion": "1.0.1", + "networkFunctionDefinitionVersionResourceReference": { + "id": "/subscriptions/subid/resourcegroups/rg/providers/Microsoft.HybridNetwork/publishers/testVendor/networkFunctionDefinitionGroups/testnetworkFunctionDefinitionGroupName/networkFunctionDefinitionVersions/1.0.1", + "idType": "Open" + }, + "nfviId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testResourceGroup/providers/Microsoft.ExtendedLocation/customLocations/testCustomLocation", + "nfviType": "AzureArcKubernetes", + "provisioningState": "Succeeded", + "publisherName": "testVendor", + "publisherScope": "Public", + "roleOverrideValues": [ + "{\"name\":\"testRoleOne\",\"deployParametersMappingRuleProfile\":{\"helmMappingRuleProfile\":{\"helmPackageVersion\":\"2.1.3\",\"values\":\"{\\\"roleOneParam\\\":\\\"roleOneOverrideValue\\\"}\"}}}", + "{\"name\":\"testRoleTwo\",\"deployParametersMappingRuleProfile\":{\"helmMappingRuleProfile\":{\"releaseName\":\"overrideReleaseName\",\"releaseNamespace\":\"overrideNamespace\",\"values\":\"{\\\"roleTwoParam\\\":\\\"roleTwoOverrideValue\\\"}\"}}}" + ] + } + } + }, + "201": { + "body": { + "name": "testNf", + "type": "Microsoft.HybridNetwork/networkFunctions", + "id": "/subscriptions/subid/resourcegroups/rg/providers/Microsoft.HybridNetwork/networkFunctions/testNf", + "location": "eastus", + "properties": { + "allowSoftwareUpdate": false, + "configurationType": "Open", + "deploymentValues": "{\"releaseName\":\"testReleaseName\",\"namespace\":\"testNamespace\"}", + "networkFunctionDefinitionGroupName": "testnetworkFunctionDefinitionGroupName", + "networkFunctionDefinitionOfferingLocation": "eastus", + "networkFunctionDefinitionVersion": "1.0.1", + "networkFunctionDefinitionVersionResourceReference": { + "id": "/subscriptions/subid/resourcegroups/rg/providers/Microsoft.HybridNetwork/publishers/testVendor/networkFunctionDefinitionGroups/testnetworkFunctionDefinitionGroupName/networkFunctionDefinitionVersions/1.0.1", + "idType": "Open" + }, + "nfviId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testResourceGroup/providers/Microsoft.ExtendedLocation/customLocations/testCustomLocation", + "nfviType": "AzureArcKubernetes", + "provisioningState": "Accepted", + "publisherName": "testVendor", + "publisherScope": "Public", + "roleOverrideValues": [ + "{\"name\":\"testRoleOne\",\"deployParametersMappingRuleProfile\":{\"helmMappingRuleProfile\":{\"helmPackageVersion\":\"2.1.3\",\"values\":\"{\\\"roleOneParam\\\":\\\"roleOneOverrideValue\\\"}\"}}}", + "{\"name\":\"testRoleTwo\",\"deployParametersMappingRuleProfile\":{\"helmMappingRuleProfile\":{\"releaseName\":\"overrideReleaseName\",\"releaseNamespace\":\"overrideNamespace\",\"values\":\"{\\\"roleTwoParam\\\":\\\"roleTwoOverrideValue\\\"}\"}}}" + ] + } + } + } + }, + "operationId": "NetworkFunctions_CreateOrUpdate", + "title": "Create network function resource" +} diff --git a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkFunctionCreateSecret.json b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkFunctionCreateSecret.json new file mode 100644 index 0000000000..6729a41da5 --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkFunctionCreateSecret.json @@ -0,0 +1,86 @@ +{ + "parameters": { + "api-version": "2025-03-30", + "networkFunctionName": "testNf", + "parameters": { + "location": "eastus", + "properties": { + "allowSoftwareUpdate": false, + "configurationType": "Secret", + "networkFunctionDefinitionVersionResourceReference": { + "id": "/subscriptions/subid/resourcegroups/rg/providers/Microsoft.HybridNetwork/publishers/testVendor/networkFunctionDefinitionGroups/testnetworkFunctionDefinitionGroupName/networkFunctionDefinitionVersions/1.0.1", + "idType": "Open" + }, + "nfviId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testResourceGroup/providers/Microsoft.ExtendedLocation/customLocations/testCustomLocation", + "nfviType": "AzureArcKubernetes", + "roleOverrideValues": [ + "{\"name\":\"testRoleOne\",\"deployParametersMappingRuleProfile\":{\"helmMappingRuleProfile\":{\"helmPackageVersion\":\"2.1.3\",\"values\":\"{\\\"roleOneParam\\\":\\\"roleOneOverrideValue\\\"}\"}}}", + "{\"name\":\"testRoleTwo\",\"deployParametersMappingRuleProfile\":{\"helmMappingRuleProfile\":{\"releaseName\":\"overrideReleaseName\",\"releaseNamespace\":\"overrideNamespace\",\"values\":\"{\\\"roleTwoParam\\\":\\\"roleTwoOverrideValue\\\"}\"}}}" + ], + "secretDeploymentValues": "{\"adminPassword\":\"password1\",\"userPassword\":\"password2\"}" + } + }, + "resourceGroupName": "rg", + "subscriptionId": "subid" + }, + "responses": { + "200": { + "body": { + "name": "testNf", + "type": "Microsoft.HybridNetwork/networkFunctions", + "id": "/subscriptions/subid/resourcegroups/rg/providers/Microsoft.HybridNetwork/networkFunctions/testNf", + "location": "eastus", + "properties": { + "allowSoftwareUpdate": false, + "configurationType": "Secret", + "networkFunctionDefinitionGroupName": "testnetworkFunctionDefinitionGroupName", + "networkFunctionDefinitionOfferingLocation": "eastus", + "networkFunctionDefinitionVersion": "1.0.1", + "networkFunctionDefinitionVersionResourceReference": { + "id": "/subscriptions/subid/resourcegroups/rg/providers/Microsoft.HybridNetwork/publishers/testVendor/networkFunctionDefinitionGroups/testnetworkFunctionDefinitionGroupName/networkFunctionDefinitionVersions/1.0.1", + "idType": "Open" + }, + "nfviId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testResourceGroup/providers/Microsoft.ExtendedLocation/customLocations/testCustomLocation", + "nfviType": "AzureArcKubernetes", + "provisioningState": "Succeeded", + "publisherName": "testVendor", + "publisherScope": "Public", + "roleOverrideValues": [ + "{\"name\":\"testRoleOne\",\"deployParametersMappingRuleProfile\":{\"helmMappingRuleProfile\":{\"helmPackageVersion\":\"2.1.3\",\"values\":\"{\\\"roleOneParam\\\":\\\"roleOneOverrideValue\\\"}\"}}}", + "{\"name\":\"testRoleTwo\",\"deployParametersMappingRuleProfile\":{\"helmMappingRuleProfile\":{\"releaseName\":\"overrideReleaseName\",\"releaseNamespace\":\"overrideNamespace\",\"values\":\"{\\\"roleTwoParam\\\":\\\"roleTwoOverrideValue\\\"}\"}}}" + ] + } + } + }, + "201": { + "body": { + "name": "testNf", + "type": "Microsoft.HybridNetwork/networkFunctions", + "id": "/subscriptions/subid/resourcegroups/rg/providers/Microsoft.HybridNetwork/networkFunctions/testNf", + "location": "eastus", + "properties": { + "allowSoftwareUpdate": false, + "configurationType": "Secret", + "networkFunctionDefinitionGroupName": "testnetworkFunctionDefinitionGroupName", + "networkFunctionDefinitionOfferingLocation": "eastus", + "networkFunctionDefinitionVersion": "1.0.1", + "networkFunctionDefinitionVersionResourceReference": { + "id": "/subscriptions/subid/resourcegroups/rg/providers/Microsoft.HybridNetwork/publishers/testVendor/networkFunctionDefinitionGroups/testnetworkFunctionDefinitionGroupName/networkFunctionDefinitionVersions/1.0.1", + "idType": "Open" + }, + "nfviId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testResourceGroup/providers/Microsoft.ExtendedLocation/customLocations/testCustomLocation", + "nfviType": "AzureArcKubernetes", + "provisioningState": "Accepted", + "publisherName": "testVendor", + "publisherScope": "Public", + "roleOverrideValues": [ + "{\"name\":\"testRoleOne\",\"deployParametersMappingRuleProfile\":{\"helmMappingRuleProfile\":{\"helmPackageVersion\":\"2.1.3\",\"values\":\"{\\\"roleOneParam\\\":\\\"roleOneOverrideValue\\\"}\"}}}", + "{\"name\":\"testRoleTwo\",\"deployParametersMappingRuleProfile\":{\"helmMappingRuleProfile\":{\"releaseName\":\"overrideReleaseName\",\"releaseNamespace\":\"overrideNamespace\",\"values\":\"{\\\"roleTwoParam\\\":\\\"roleTwoOverrideValue\\\"}\"}}}" + ] + } + } + } + }, + "operationId": "NetworkFunctions_CreateOrUpdate", + "title": "Create network function resource with secrets" +} diff --git a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkFunctionDefinitionGroupCreate.json b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkFunctionDefinitionGroupCreate.json new file mode 100644 index 0000000000..d9152461ad --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkFunctionDefinitionGroupCreate.json @@ -0,0 +1,34 @@ +{ + "parameters": { + "api-version": "2025-03-30", + "networkFunctionDefinitionGroupName": "TestNetworkFunctionDefinitionGroupName", + "parameters": { + "location": "eastus" + }, + "publisherName": "TestPublisher", + "resourceGroupName": "rg", + "subscriptionId": "subid" + }, + "responses": { + "200": { + "body": { + "name": "TestPublisherSkuVersion", + "type": "Microsoft.HybridNetwork/publishers/networkFunctionDefinitionGroups", + "id": "/subscriptions/subid/resourcegroups/rg/rgproviders/Microsoft.HybridNetwork/publishers/TestPublisher/networkFunctionDefinitionGroups/TestNetworkFunctionDefinitionGroupName", + "location": "eastus", + "properties": {} + } + }, + "201": { + "body": { + "name": "TestPublisherSkuVersion", + "type": "Microsoft.HybridNetwork/publishers/networkFunctionDefinitionGroups", + "id": "/subscriptions/subid/resourcegroups/rg/providers/Microsoft.HybridNetwork/publishers/TestPublisher/networkFunctionDefinitionGroups/TestNetworkFunctionDefinitionGroupName", + "location": "eastus", + "properties": {} + } + } + }, + "operationId": "NetworkFunctionDefinitionGroups_CreateOrUpdate", + "title": "Create or update the network function definition group" +} diff --git a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkFunctionDefinitionGroupDelete.json b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkFunctionDefinitionGroupDelete.json new file mode 100644 index 0000000000..478bfb04ca --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkFunctionDefinitionGroupDelete.json @@ -0,0 +1,19 @@ +{ + "parameters": { + "api-version": "2025-03-30", + "networkFunctionDefinitionGroupName": "TestNetworkFunctionDefinitionGroupName", + "publisherName": "TestPublisher", + "resourceGroupName": "rg", + "subscriptionId": "subid" + }, + "responses": { + "202": { + "headers": { + "location": "https://management.azure.com/providers/microsoft.hybridnetwork/locations/EASTUS2EUAP/operationStatuses/0b37c625-7e7c-49c5-b86e-c817c85acb5d*B77A34159CA34A0BD446D3BC7EC120649181590DDF991982765DAC1A87491B2D?api-version=2021-05-01" + } + }, + "204": {} + }, + "operationId": "NetworkFunctionDefinitionGroups_Delete", + "title": "Delete a network function group resource" +} diff --git a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkFunctionDefinitionGroupGet.json b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkFunctionDefinitionGroupGet.json new file mode 100644 index 0000000000..7adc820345 --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkFunctionDefinitionGroupGet.json @@ -0,0 +1,24 @@ +{ + "parameters": { + "api-version": "2025-03-30", + "networkFunctionDefinitionGroupName": "TestNetworkFunctionDefinitionGroupName", + "publisherName": "TestPublisher", + "resourceGroupName": "rg", + "subscriptionId": "subid" + }, + "responses": { + "200": { + "body": { + "name": "TestNetworkFunctionDefinitionVersion", + "type": "Microsoft.HybridNetwork/publishers/networkFunctionDefinitionGroups", + "id": "/subscriptions/subid/resourcegroups/rg/rgproviders/Microsoft.HybridNetwork/publishers/TestPublisher/networkFunctionDefinitionGroups/TestNetworkFunctionDefinitionGroupName", + "location": "eastus", + "properties": { + "description": "Test NFD group" + } + } + } + }, + "operationId": "NetworkFunctionDefinitionGroups_Get", + "title": "Get a networkFunctionDefinition group resource" +} diff --git a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkFunctionDefinitionGroupUpdateTags.json b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkFunctionDefinitionGroupUpdateTags.json new file mode 100644 index 0000000000..8f9a5af210 --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkFunctionDefinitionGroupUpdateTags.json @@ -0,0 +1,32 @@ +{ + "parameters": { + "api-version": "2025-03-30", + "networkFunctionDefinitionGroupName": "TestNetworkFunctionDefinitionGroupName", + "parameters": { + "tags": { + "tag1": "value1", + "tag2": "value2" + } + }, + "publisherName": "TestPublisher", + "resourceGroupName": "rg", + "subscriptionId": "subid" + }, + "responses": { + "200": { + "body": { + "name": "TestPublisherSkuVersion", + "type": "Microsoft.HybridNetwork/publishers/networkFunctionDefinitionGroups", + "id": "/subscriptions/subid/resourcegroups/rg/rgproviders/Microsoft.HybridNetwork/publishers/TestPublisher/networkFunctionDefinitionGroups/TestNetworkFunctionDefinitionGroupName", + "location": "eastus", + "properties": {}, + "tags": { + "tag1": "value1", + "tag2": "value2" + } + } + } + }, + "operationId": "NetworkFunctionDefinitionGroups_Update", + "title": "Create or update the network function definition group resource" +} diff --git a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkFunctionDefinitionGroupsListByPublisherName.json b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkFunctionDefinitionGroupsListByPublisherName.json new file mode 100644 index 0000000000..5c90b52103 --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkFunctionDefinitionGroupsListByPublisherName.json @@ -0,0 +1,25 @@ +{ + "parameters": { + "api-version": "2025-03-30", + "publisherName": "TestPublisher", + "resourceGroupName": "rg", + "subscriptionId": "subid" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "name": "TestNetworkFunctionDefinitionVersion", + "type": "Microsoft.HybridNetwork/publishers/networkFunctionDefinitionGroups", + "id": "/subscriptions/subid/resourcegroups/rg/rgproviders/Microsoft.HybridNetwork/publishers/TestPublisher/networkFunctionDefinitionGroups/TestNetworkFunctionDefinitionGroupName", + "location": "eastus", + "properties": {} + } + ] + } + } + }, + "operationId": "NetworkFunctionDefinitionGroups_ListByPublisher", + "title": "Get networkFunctionDefinition groups under publisher resource" +} diff --git a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkFunctionDefinitionVersionCreate.json b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkFunctionDefinitionVersionCreate.json new file mode 100644 index 0000000000..312ec585f9 --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkFunctionDefinitionVersionCreate.json @@ -0,0 +1,198 @@ +{ + "parameters": { + "api-version": "2025-03-30", + "networkFunctionDefinitionGroupName": "TestNetworkFunctionDefinitionGroupName", + "networkFunctionDefinitionVersionName": "1.0.0", + "parameters": { + "location": "eastus", + "properties": { + "deployParameters": "{\"type\":\"object\",\"properties\":{\"releaseName\":{\"type\":\"string\"},\"namespace\":{\"type\":\"string\"}}}", + "networkFunctionTemplate": { + "networkFunctionApplications": [ + { + "name": "fedrbac", + "artifactProfile": { + "artifactStore": { + "id": "/subscriptions/subid/resourcegroups/rg/providers/microsoft.hybridnetwork/publishers/TestPublisher/artifactStores/testArtifactStore" + }, + "helmArtifactProfile": { + "helmPackageName": "fed-rbac", + "helmPackageVersionRange": "~2.1.3", + "imagePullSecretsValuesPaths": [ + "global.imagePullSecrets" + ], + "registryValuesPaths": [ + "global.registry.docker.repoPath" + ] + } + }, + "artifactType": "HelmPackage", + "dependsOnProfile": { + "installDependsOn": [], + "uninstallDependsOn": [], + "updateDependsOn": [] + }, + "deployParametersMappingRuleProfile": { + "applicationEnablement": "Enabled", + "helmMappingRuleProfile": { + "helmPackageVersion": "2.1.3", + "options": { + "installOptions": { + "atomic": "true", + "timeout": "30", + "wait": "waitValue" + }, + "upgradeOptions": { + "atomic": "true", + "timeout": "30", + "wait": "waitValue" + } + }, + "releaseName": "{deployParameters.releaseName}", + "releaseNamespace": "{deployParameters.namesapce}", + "values": "" + } + } + } + ], + "nfviType": "AzureArcKubernetes" + }, + "networkFunctionType": "ContainerizedNetworkFunction", + "versionState": "Active" + } + }, + "publisherName": "TestPublisher", + "resourceGroupName": "rg", + "subscriptionId": "subid" + }, + "responses": { + "200": { + "body": { + "name": "TestVersion", + "type": "Microsoft.HybridNetwork/publishers/networkFunctionDefinitionGroups/networkFunctionDefinitionVersions", + "id": "/subscriptions/subid/resourcegroups/rg/providers/Microsoft.HybridNetwork/publishers/TestPublisher/networkFunctionDefinitionGroups/TestNetworkFunctionDefinitionGroupName/networkFunctionDefinitionVersions/1.0.0", + "location": "eastus", + "properties": { + "deployParameters": "{\"type\":\"object\",\"properties\":{\"releaseName\":{\"type\":\"string\"},\"namespace\":{\"type\":\"string\"}}}", + "networkFunctionTemplate": { + "networkFunctionApplications": [ + { + "name": "fedrbac", + "artifactProfile": { + "artifactStore": { + "id": "/subscriptions/subid/resourcegroups/rg/providers/Microsoft.HybridNetwork/publishers/TestPublisher/artifactStores/testStore" + }, + "helmArtifactProfile": { + "helmPackageName": "fed-rbac", + "helmPackageVersionRange": "~2.1.3", + "imagePullSecretsValuesPaths": [ + "global.imagePullSecrets" + ], + "registryValuesPaths": [ + "global.registry.docker.repoPath" + ] + } + }, + "artifactType": "HelmPackage", + "dependsOnProfile": { + "installDependsOn": [], + "uninstallDependsOn": [], + "updateDependsOn": [] + }, + "deployParametersMappingRuleProfile": { + "applicationEnablement": "Enabled", + "helmMappingRuleProfile": { + "helmPackageVersion": "2.1.3", + "options": { + "installOptions": { + "atomic": "true", + "timeout": "30", + "wait": "waitValue" + }, + "upgradeOptions": { + "atomic": "true", + "timeout": "30", + "wait": "waitValue" + } + }, + "releaseName": "{deployParameters.releaseName}", + "releaseNamespace": "{deployParameters.namesapce}", + "values": "" + } + } + } + ], + "nfviType": "AzureArcKubernetes" + }, + "networkFunctionType": "ContainerizedNetworkFunction", + "versionState": "Active" + } + } + }, + "201": { + "body": { + "name": "TestVersion", + "type": "Microsoft.HybridNetwork/publishers/networkFunctionDefinitionGroups/networkFunctionDefinitionVersions", + "id": "/subscriptions/subid/resourcegroups/rg/providers/Microsoft.HybridNetwork/publishers/TestPublisher/networkFunctionDefinitionGroups/TestNetworkFunctionDefinitionGroupName/networkFunctionDefinitionVersions/1.0.0", + "location": "eastus", + "properties": { + "deployParameters": "{\"type\":\"object\",\"properties\":{\"releaseName\":{\"type\":\"string\"},\"namespace\":{\"type\":\"string\"}}}", + "networkFunctionTemplate": { + "networkFunctionApplications": [ + { + "name": "fedrbac", + "artifactProfile": { + "artifactStore": { + "id": "/subscriptions/subid/resourcegroups/rg/providers/microsoft.hybridnetwork/publishers/TestPublisher/artifactStores/testArtifactStore" + }, + "helmArtifactProfile": { + "helmPackageName": "fed-rbac", + "helmPackageVersionRange": "~2.1.3", + "imagePullSecretsValuesPaths": [ + "global.imagePullSecrets" + ], + "registryValuesPaths": [ + "global.registry.docker.repoPath" + ] + } + }, + "artifactType": "HelmPackage", + "dependsOnProfile": { + "installDependsOn": [], + "uninstallDependsOn": [], + "updateDependsOn": [] + }, + "deployParametersMappingRuleProfile": { + "applicationEnablement": "Enabled", + "helmMappingRuleProfile": { + "helmPackageVersion": "2.1.3", + "options": { + "installOptions": { + "atomic": "true", + "timeout": "30", + "wait": "waitValue" + }, + "upgradeOptions": { + "atomic": "true", + "timeout": "30", + "wait": "waitValue" + } + }, + "releaseName": "{deployParameters.releaseName}", + "releaseNamespace": "{deployParameters.namesapce}", + "values": "" + } + } + } + ], + "nfviType": "AzureArcKubernetes" + }, + "networkFunctionType": "ContainerizedNetworkFunction", + "versionState": "Active" + } + } + } + }, + "operationId": "NetworkFunctionDefinitionVersions_CreateOrUpdate", + "title": "Create or update a network function definition version resource" +} diff --git a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkFunctionDefinitionVersionDelete.json b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkFunctionDefinitionVersionDelete.json new file mode 100644 index 0000000000..a108ddc260 --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkFunctionDefinitionVersionDelete.json @@ -0,0 +1,20 @@ +{ + "parameters": { + "api-version": "2025-03-30", + "networkFunctionDefinitionGroupName": "TestNetworkFunctionDefinitionGroupName", + "networkFunctionDefinitionVersionName": "1.0.0", + "publisherName": "TestPublisher", + "resourceGroupName": "rg", + "subscriptionId": "subid" + }, + "responses": { + "202": { + "headers": { + "location": "https://management.azure.com/providers/microsoft.hybridnetwork/locations/EASTUS2EUAP/operationStatuses/0b37c625-7e7c-49c5-b86e-c817c85acb5d*B77A34159CA34A0BD446D3BC7EC120649181590DDF991982765DAC1A87491B2D?api-version=2021-05-01" + } + }, + "204": {} + }, + "operationId": "NetworkFunctionDefinitionVersions_Delete", + "title": "Delete a network function definition version" +} diff --git a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkFunctionDefinitionVersionGet.json b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkFunctionDefinitionVersionGet.json new file mode 100644 index 0000000000..2d0b22ef58 --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkFunctionDefinitionVersionGet.json @@ -0,0 +1,65 @@ +{ + "parameters": { + "api-version": "2025-03-30", + "networkFunctionDefinitionGroupName": "TestNetworkFunctionDefinitionGroupName", + "networkFunctionDefinitionVersionName": "1.0.0", + "publisherName": "TestPublisher", + "resourceGroupName": "rg", + "subscriptionId": "subid" + }, + "responses": { + "200": { + "body": { + "name": "TestVersion", + "type": "Microsoft.HybridNetwork/publishers/networkFunctionDefinitionGroups/networkFunctionDefinitionVersions", + "id": "/subscriptions/subid/resourcegroups/rg/providers/Microsoft.HybridNetwork/publishers/TestPublisher/networkFunctionDefinitionGroups/TestNetworkFunctionDefinitionGroupName/networkFunctionDefinitionVersions/1.0.0", + "location": "eastus", + "properties": { + "deployParameters": "{\"releaseName\":{\"type\":\"string\"},\"namespace\":{\"type\":\"string\"}}", + "networkFunctionTemplate": { + "networkFunctionApplications": [ + { + "name": "fedrbac", + "artifactProfile": { + "artifactStore": { + "id": "/subscriptions/subid/resourcegroups/rg/providers/microsoft.hybridnetwork/publishers/TestPublisher/artifactStores/testArtifactStore" + }, + "helmArtifactProfile": { + "helmPackageName": "fed-rbac", + "helmPackageVersionRange": "~2.1.3", + "imagePullSecretsValuesPaths": [ + "global.imagePullSecrets" + ], + "registryValuesPaths": [ + "global.registry.docker.repoPath" + ] + } + }, + "artifactType": "HelmPackage", + "dependsOnProfile": { + "installDependsOn": [], + "uninstallDependsOn": [], + "updateDependsOn": [] + }, + "deployParametersMappingRuleProfile": { + "applicationEnablement": "Enabled", + "helmMappingRuleProfile": { + "helmPackageVersion": "2.1.3", + "releaseName": "{deployParameters.releaseName}", + "releaseNamespace": "{deployParameters.namesapce}", + "values": "" + } + } + } + ], + "nfviType": "AzureArcKubernetes" + }, + "networkFunctionType": "ContainerizedNetworkFunction", + "versionState": "Active" + } + } + } + }, + "operationId": "NetworkFunctionDefinitionVersions_Get", + "title": "Get a network function definition version resource" +} diff --git a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkFunctionDefinitionVersionListByNetworkFunctionDefinitionGroup.json b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkFunctionDefinitionVersionListByNetworkFunctionDefinitionGroup.json new file mode 100644 index 0000000000..5a09303f1c --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkFunctionDefinitionVersionListByNetworkFunctionDefinitionGroup.json @@ -0,0 +1,80 @@ +{ + "parameters": { + "api-version": "2025-03-30", + "networkFunctionDefinitionGroupName": "TestNetworkFunctionDefinitionGroupNameName", + "publisherName": "TestPublisher", + "resourceGroupName": "rg", + "subscriptionId": "subid" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "name": "networkFunctionDefinitionVersionName", + "type": "Microsoft.HybridNetwork/publishers/publisherskugroups/publisherskuversions", + "id": "/subscriptions/subid/resourcegroups/rg/providers/Microsoft.HybridNetwork/publishers/TestPublisher/publisherskuGroups/networkFunctionDefinitionGroupName/networkFunctionDefinitionVersions/TestVersion", + "location": "eastus", + "properties": { + "deployParameters": "{\"releaseName\":{\"type\":\"string\"},\"namespace\":{\"type\":\"string\"}}", + "networkFunctionTemplate": { + "networkFunctionApplications": [ + { + "name": "fedrbac", + "artifactProfile": { + "artifactStore": { + "id": "/subscriptions/subid/resourcegroups/rg/providers/microsoft.hybridnetwork/publishers/TestPublisher/artifactStores/testArtifactStore" + }, + "helmArtifactProfile": { + "helmPackageName": "fed-rbac", + "helmPackageVersionRange": "~2.1.3", + "imagePullSecretsValuesPaths": [ + "global.imagePullSecrets" + ], + "registryValuesPaths": [ + "global.registry.docker.repoPath" + ] + } + }, + "artifactType": "HelmPackage", + "dependsOnProfile": { + "installDependsOn": [], + "uninstallDependsOn": [], + "updateDependsOn": [] + }, + "deployParametersMappingRuleProfile": { + "applicationEnablement": "Enabled", + "helmMappingRuleProfile": { + "helmPackageVersion": "2.1.3", + "options": { + "installOptions": { + "atomic": "true", + "timeout": "30", + "wait": "waitValue" + }, + "upgradeOptions": { + "atomic": "true", + "timeout": "30", + "wait": "waitValue" + } + }, + "releaseName": "{deployParameters.releaseName}", + "releaseNamespace": "{deployParameters.namesapce}", + "values": "" + } + } + } + ], + "nfviType": "AzureArcKubernetes" + }, + "networkFunctionType": "ContainerizedNetworkFunction", + "versionState": "Active" + } + } + ] + } + } + }, + "operationId": "NetworkFunctionDefinitionVersions_ListByNetworkFunctionDefinitionGroup", + "title": "Get Publisher resource" +} diff --git a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkFunctionDefinitionVersionUpdateState.json b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkFunctionDefinitionVersionUpdateState.json new file mode 100644 index 0000000000..c70e316e9b --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkFunctionDefinitionVersionUpdateState.json @@ -0,0 +1,27 @@ +{ + "parameters": { + "api-version": "2025-03-30", + "networkFunctionDefinitionGroupName": "TestSkuGroup", + "networkFunctionDefinitionVersionName": "1.0.0", + "parameters": { + "versionState": "Active" + }, + "publisherName": "TestPublisher", + "resourceGroupName": "rg", + "subscriptionId": "subid" + }, + "responses": { + "200": { + "body": { + "versionState": "Active" + } + }, + "202": { + "headers": { + "location": "https://management.azure.com/providers/microsoft.hybridnetwork/locations/EASTUS2EUAP/operationStatuses/0b37c625-7e7c-49c5-b86e-c817c85acb5d*B77A34159CA34A0BD446D3BC7EC120649181590DDF991982765DAC1A87491B2D?api-version=2021-05-01" + } + } + }, + "operationId": "NetworkFunctionDefinitionVersions_updateState", + "title": "Update network function definition version state" +} diff --git a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkFunctionDefinitionVersionUpdateTags.json b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkFunctionDefinitionVersionUpdateTags.json new file mode 100644 index 0000000000..33eed7722e --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkFunctionDefinitionVersionUpdateTags.json @@ -0,0 +1,75 @@ +{ + "parameters": { + "api-version": "2025-03-30", + "networkFunctionDefinitionGroupName": "TestNetworkFunctionDefinitionGroupName", + "networkFunctionDefinitionVersionName": "1.0.0", + "parameters": { + "tags": { + "tag1": "value1", + "tag2": "value2" + } + }, + "publisherName": "TestPublisher", + "resourceGroupName": "rg", + "subscriptionId": "subid" + }, + "responses": { + "200": { + "body": { + "name": "TestVersion", + "type": "Microsoft.HybridNetwork/publishers/networkFunctionDefinitionGroups/networkFunctionDefinitionVersions", + "id": "/subscriptions/subid/resourcegroups/rg/providers/Microsoft.HybridNetwork/publishers/TestPublisher/networkFunctionDefinitionGroups/TestNetworkFunctionDefinitionGroupName/networkFunctionDefinitionVersions/1.0.0", + "location": "eastus", + "properties": { + "deployParameters": "{\"releaseName\":{\"type\":\"string\"},\"namespace\":{\"type\":\"string\"}}", + "networkFunctionTemplate": { + "networkFunctionApplications": [ + { + "name": "fedrbac", + "artifactProfile": { + "artifactStore": { + "id": "/subscriptions/subid/resourcegroups/rg/providers/microsoft.hybridnetwork/publishers/TestPublisher/artifactStores/testArtifactStore" + }, + "helmArtifactProfile": { + "helmPackageName": "fed-rbac", + "helmPackageVersionRange": "~2.1.3", + "imagePullSecretsValuesPaths": [ + "global.imagePullSecrets" + ], + "registryValuesPaths": [ + "global.registry.docker.repoPath" + ] + } + }, + "artifactType": "HelmPackage", + "dependsOnProfile": { + "installDependsOn": [], + "uninstallDependsOn": [], + "updateDependsOn": [] + }, + "deployParametersMappingRuleProfile": { + "applicationEnablement": "Enabled", + "helmMappingRuleProfile": { + "helmPackageVersion": "2.1.3", + "releaseName": "{deployParameters.releaseName}", + "releaseNamespace": "{deployParameters.namesapce}", + "values": "" + } + } + } + ], + "nfviType": "AzureArcKubernetes" + }, + "networkFunctionType": "ContainerizedNetworkFunction", + "versionState": "Active" + }, + "tags": { + "tag1": "value1", + "tag2": "value2" + } + } + } + }, + "operationId": "NetworkFunctionDefinitionVersions_Update", + "title": "Update the network function definition version tags" +} diff --git a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkFunctionDelete.json b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkFunctionDelete.json new file mode 100644 index 0000000000..0a2a59f872 --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkFunctionDelete.json @@ -0,0 +1,19 @@ +{ + "parameters": { + "api-version": "2025-03-30", + "networkFunctionName": "testNf", + "resourceGroupName": "rg", + "subscriptionId": "subid" + }, + "responses": { + "200": {}, + "202": { + "headers": { + "location": "https://management.azure.com/providers/microsoft.hybridnetwork/locations/EASTUS2EUAP/operationStatuses/0b37c625-7e7c-49c5-b86e-c817c85acb5d*B77A34159CA34A0BD446D3BC7EC120649181590DDF991982765DAC1A87491B2D?api-version=2021-05-01" + } + }, + "204": {} + }, + "operationId": "NetworkFunctions_Delete", + "title": "Delete network function resource" +} diff --git a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkFunctionFirstPartyCreate.json b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkFunctionFirstPartyCreate.json new file mode 100644 index 0000000000..456f3f7edd --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkFunctionFirstPartyCreate.json @@ -0,0 +1,86 @@ +{ + "parameters": { + "api-version": "2025-03-30", + "networkFunctionName": "testNf", + "parameters": { + "location": "eastus", + "properties": { + "allowSoftwareUpdate": false, + "configurationType": "Open", + "deploymentValues": "{\"releaseName\":\"testReleaseName\",\"namespace\":\"testNamespace\"}", + "networkFunctionDefinitionVersionResourceReference": { + "id": "/subscriptions/subid/resourcegroups/rg/providers/Microsoft.HybridNetwork/publishers/testVendor/networkFunctionDefinitionGroups/testnetworkFunctionDefinitionGroupName/networkFunctionDefinitionVersions/1.0.1", + "idType": "Secret" + }, + "nfviId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testResourceGroup/providers/Microsoft.ExtendedLocation/customLocations/testCustomLocation", + "nfviType": "AzureArcKubernetes", + "roleOverrideValues": [ + "{\"name\":\"testRoleOne\",\"deployParametersMappingRuleProfile\":{\"helmMappingRuleProfile\":{\"helmPackageVersion\":\"2.1.3\",\"values\":\"{\\\"roleOneParam\\\":\\\"roleOneOverrideValue\\\"}\"}}}", + "{\"name\":\"testRoleTwo\",\"deployParametersMappingRuleProfile\":{\"helmMappingRuleProfile\":{\"releaseName\":\"overrideReleaseName\",\"releaseNamespace\":\"overrideNamespace\",\"values\":\"{\\\"roleTwoParam\\\":\\\"roleTwoOverrideValue\\\"}\"}}}" + ] + } + }, + "resourceGroupName": "rg", + "subscriptionId": "subid" + }, + "responses": { + "200": { + "body": { + "name": "testNf", + "type": "Microsoft.HybridNetwork/networkFunctions", + "id": "/subscriptions/subid/resourcegroups/rg/providers/Microsoft.HybridNetwork/networkFunctions/testNf", + "location": "eastus", + "properties": { + "allowSoftwareUpdate": false, + "configurationType": "Open", + "deploymentValues": "{\"releaseName\":\"testReleaseName\",\"namespace\":\"testNamespace\"}", + "networkFunctionDefinitionGroupName": "testnetworkFunctionDefinitionGroupName", + "networkFunctionDefinitionOfferingLocation": "eastus", + "networkFunctionDefinitionVersion": "1.0.1", + "networkFunctionDefinitionVersionResourceReference": { + "idType": "Secret" + }, + "nfviId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testResourceGroup/providers/Microsoft.ExtendedLocation/customLocations/testCustomLocation", + "nfviType": "AzureArcKubernetes", + "provisioningState": "Succeeded", + "publisherName": "testVendor", + "publisherScope": "Public", + "roleOverrideValues": [ + "{\"name\":\"testRoleOne\",\"deployParametersMappingRuleProfile\":{\"helmMappingRuleProfile\":{\"helmPackageVersion\":\"2.1.3\",\"values\":\"{\\\"roleOneParam\\\":\\\"roleOneOverrideValue\\\"}\"}}}", + "{\"name\":\"testRoleTwo\",\"deployParametersMappingRuleProfile\":{\"helmMappingRuleProfile\":{\"releaseName\":\"overrideReleaseName\",\"releaseNamespace\":\"overrideNamespace\",\"values\":\"{\\\"roleTwoParam\\\":\\\"roleTwoOverrideValue\\\"}\"}}}" + ] + } + } + }, + "201": { + "body": { + "name": "testNf", + "type": "Microsoft.HybridNetwork/networkFunctions", + "id": "/subscriptions/subid/resourcegroups/rg/providers/Microsoft.HybridNetwork/networkFunctions/testNf", + "location": "eastus", + "properties": { + "allowSoftwareUpdate": false, + "configurationType": "Open", + "deploymentValues": "{\"releaseName\":\"testReleaseName\",\"namespace\":\"testNamespace\"}", + "networkFunctionDefinitionGroupName": "testnetworkFunctionDefinitionGroupName", + "networkFunctionDefinitionOfferingLocation": "eastus", + "networkFunctionDefinitionVersion": "1.0.1", + "networkFunctionDefinitionVersionResourceReference": { + "idType": "Secret" + }, + "nfviId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testResourceGroup/providers/Microsoft.ExtendedLocation/customLocations/testCustomLocation", + "nfviType": "AzureArcKubernetes", + "provisioningState": "Accepted", + "publisherName": "testVendor", + "publisherScope": "Public", + "roleOverrideValues": [ + "{\"name\":\"testRoleOne\",\"deployParametersMappingRuleProfile\":{\"helmMappingRuleProfile\":{\"helmPackageVersion\":\"2.1.3\",\"values\":\"{\\\"roleOneParam\\\":\\\"roleOneOverrideValue\\\"}\"}}}", + "{\"name\":\"testRoleTwo\",\"deployParametersMappingRuleProfile\":{\"helmMappingRuleProfile\":{\"releaseName\":\"overrideReleaseName\",\"releaseNamespace\":\"overrideNamespace\",\"values\":\"{\\\"roleTwoParam\\\":\\\"roleTwoOverrideValue\\\"}\"}}}" + ] + } + } + } + }, + "operationId": "NetworkFunctions_CreateOrUpdate", + "title": "Create first party network function resource" +} diff --git a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkFunctionGet.json b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkFunctionGet.json new file mode 100644 index 0000000000..18aad47240 --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkFunctionGet.json @@ -0,0 +1,41 @@ +{ + "parameters": { + "api-version": "2025-03-30", + "networkFunctionName": "testNf", + "resourceGroupName": "rg", + "subscriptionId": "subid" + }, + "responses": { + "200": { + "body": { + "name": "testNf", + "type": "Microsoft.HybridNetwork/networkFunctions", + "id": "/subscriptions/subid/resourcegroups/rg/providers/Microsoft.HybridNetwork/networkFunctions/testNf", + "location": "eastus", + "properties": { + "allowSoftwareUpdate": false, + "configurationType": "Open", + "deploymentValues": "{\"releaseName\":\"testReleaseName\",\"namespace\":\"testNamespace\"}", + "networkFunctionDefinitionGroupName": "testnetworkFunctionDefinitionGroupName", + "networkFunctionDefinitionOfferingLocation": "eastus", + "networkFunctionDefinitionVersion": "1.0.1", + "networkFunctionDefinitionVersionResourceReference": { + "id": "/subscriptions/subid/resourcegroups/rg/providers/Microsoft.HybridNetwork/publishers/testVendor/networkFunctionDefinitionGroups/testnetworkFunctionDefinitionGroupName/networkFunctionDefinitionVersions/1.0.1", + "idType": "Open" + }, + "nfviId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testResourceGroup/providers/Microsoft.ExtendedLocation/customLocations/testCustomLocation", + "nfviType": "AzureArcKubernetes", + "provisioningState": "Succeeded", + "publisherName": "testVendor", + "publisherScope": "Public", + "roleOverrideValues": [ + "{\"name\":\"testRoleOne\",\"deployParametersMappingRuleProfile\":{\"helmMappingRuleProfile\":{\"helmPackageVersion\":\"2.1.3\",\"values\":\"{\\\"roleOneParam\\\":\\\"roleOneOverrideValue\\\"}\"}}}", + "{\"name\":\"testRoleTwo\",\"deployParametersMappingRuleProfile\":{\"helmMappingRuleProfile\":{\"releaseName\":\"overrideReleaseName\",\"releaseNamespace\":\"overrideNamespace\",\"values\":\"{\\\"roleTwoParam\\\":\\\"roleTwoOverrideValue\\\"}\"}}}" + ] + } + } + } + }, + "operationId": "NetworkFunctions_Get", + "title": "Get network function resource" +} diff --git a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkFunctionListByResourceGroup.json b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkFunctionListByResourceGroup.json new file mode 100644 index 0000000000..69d76838fb --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkFunctionListByResourceGroup.json @@ -0,0 +1,45 @@ +{ + "parameters": { + "api-version": "2025-03-30", + "resourceGroupName": "rg", + "subscriptionId": "subid" + }, + "responses": { + "200": { + "body": { + "nextLink": "https://microsoft.com/a", + "value": [ + { + "name": "testNf", + "type": "Microsoft.HybridNetwork/networkFunctions", + "id": "/subscriptions/subid/resourcegroups/rg/providers/Microsoft.HybridNetwork/networkFunctions/testNf", + "location": "eastus", + "properties": { + "allowSoftwareUpdate": false, + "configurationType": "Open", + "deploymentValues": "{\"releaseName\":\"testReleaseName\",\"namespace\":\"testNamespace\"}", + "networkFunctionDefinitionGroupName": "testnetworkFunctionDefinitionGroupName", + "networkFunctionDefinitionOfferingLocation": "eastus", + "networkFunctionDefinitionVersion": "1.0.1", + "networkFunctionDefinitionVersionResourceReference": { + "id": "/subscriptions/subid/resourcegroups/rg/providers/Microsoft.HybridNetwork/publishers/testVendor/networkFunctionDefinitionGroups/testnetworkFunctionDefinitionGroupName/networkFunctionDefinitionVersions/1.0.1", + "idType": "Open" + }, + "nfviId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testResourceGroup/providers/Microsoft.ExtendedLocation/customLocations/testCustomLocation", + "nfviType": "AzureArcKubernetes", + "provisioningState": "Succeeded", + "publisherName": "testVendor", + "publisherScope": "Public", + "roleOverrideValues": [ + "{\"name\":\"testRoleOne\",\"deployParametersMappingRuleProfile\":{\"helmMappingRuleProfile\":{\"helmPackageVersion\":\"2.1.3\",\"values\":\"{\\\"roleOneParam\\\":\\\"roleOneOverrideValue\\\"}\"}}}", + "{\"name\":\"testRoleTwo\",\"deployParametersMappingRuleProfile\":{\"helmMappingRuleProfile\":{\"releaseName\":\"overrideReleaseName\",\"releaseNamespace\":\"overrideNamespace\",\"values\":\"{\\\"roleTwoParam\\\":\\\"roleTwoOverrideValue\\\"}\"}}}" + ] + } + } + ] + } + } + }, + "operationId": "NetworkFunctions_ListByResourceGroup", + "title": "List network function in resource group" +} diff --git a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkFunctionListBySubscription.json b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkFunctionListBySubscription.json new file mode 100644 index 0000000000..2c09b5f04c --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkFunctionListBySubscription.json @@ -0,0 +1,44 @@ +{ + "parameters": { + "api-version": "2025-03-30", + "subscriptionId": "subid" + }, + "responses": { + "200": { + "body": { + "nextLink": "https://microsoft.com/a", + "value": [ + { + "name": "testNf", + "type": "Microsoft.HybridNetwork/networkFunctions", + "id": "/subscriptions/subid/resourcegroups/rg/providers/Microsoft.HybridNetwork/networkFunctions/testNf", + "location": "eastus", + "properties": { + "allowSoftwareUpdate": false, + "configurationType": "Open", + "deploymentValues": "{\"releaseName\":\"testReleaseName\",\"namespace\":\"testNamespace\"}", + "networkFunctionDefinitionGroupName": "testnetworkFunctionDefinitionGroupName", + "networkFunctionDefinitionOfferingLocation": "eastus", + "networkFunctionDefinitionVersion": "1.0.1", + "networkFunctionDefinitionVersionResourceReference": { + "id": "/subscriptions/subid/resourcegroups/rg/providers/Microsoft.HybridNetwork/publishers/testVendor/networkFunctionDefinitionGroups/testnetworkFunctionDefinitionGroupName/networkFunctionDefinitionVersions/1.0.1", + "idType": "Open" + }, + "nfviId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testResourceGroup/providers/Microsoft.ExtendedLocation/customLocations/testCustomLocation", + "nfviType": "AzureArcKubernetes", + "provisioningState": "Succeeded", + "publisherName": "testVendor", + "publisherScope": "Public", + "roleOverrideValues": [ + "{\"name\":\"testRoleOne\",\"deployParametersMappingRuleProfile\":{\"helmMappingRuleProfile\":{\"helmPackageVersion\":\"2.1.3\",\"values\":\"{\\\"roleOneParam\\\":\\\"roleOneOverrideValue\\\"}\"}}}", + "{\"name\":\"testRoleTwo\",\"deployParametersMappingRuleProfile\":{\"helmMappingRuleProfile\":{\"releaseName\":\"overrideReleaseName\",\"releaseNamespace\":\"overrideNamespace\",\"values\":\"{\\\"roleTwoParam\\\":\\\"roleTwoOverrideValue\\\"}\"}}}" + ] + } + } + ] + } + } + }, + "operationId": "NetworkFunctions_ListBySubscription", + "title": "List all network function resources in subscription." +} diff --git a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkFunctionUpdateTags.json b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkFunctionUpdateTags.json new file mode 100644 index 0000000000..60d7ba9ed6 --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkFunctionUpdateTags.json @@ -0,0 +1,51 @@ +{ + "parameters": { + "api-version": "2025-03-30", + "networkFunctionName": "testNf", + "parameters": { + "tags": { + "tag1": "value1", + "tag2": "value2" + } + }, + "resourceGroupName": "rg", + "subscriptionId": "subid" + }, + "responses": { + "200": { + "body": { + "name": "testNf", + "type": "Microsoft.HybridNetwork/networkFunctions", + "id": "/subscriptions/subid/resourcegroups/rg/providers/Microsoft.HybridNetwork/networkFunctions/testNf", + "location": "eastus", + "properties": { + "allowSoftwareUpdate": false, + "configurationType": "Open", + "deploymentValues": "{\"releaseName\":\"testReleaseName\",\"namespace\":\"testNamespace\"}", + "networkFunctionDefinitionGroupName": "testnetworkFunctionDefinitionGroupName", + "networkFunctionDefinitionOfferingLocation": "eastus", + "networkFunctionDefinitionVersion": "1.0.1", + "networkFunctionDefinitionVersionResourceReference": { + "id": "/subscriptions/subid/resourcegroups/rg/providers/Microsoft.HybridNetwork/publishers/testVendor/networkFunctionDefinitionGroups/testnetworkFunctionDefinitionGroupName/networkFunctionDefinitionVersions/1.0.1", + "idType": "Open" + }, + "nfviId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testResourceGroup/providers/Microsoft.ExtendedLocation/customLocations/testCustomLocation", + "nfviType": "AzureArcKubernetes", + "provisioningState": "Succeeded", + "publisherName": "testVendor", + "publisherScope": "Public", + "roleOverrideValues": [ + "{\"name\":\"testRoleOne\",\"deployParametersMappingRuleProfile\":{\"helmMappingRuleProfile\":{\"helmPackageVersion\":\"2.1.3\",\"values\":\"{\\\"roleOneParam\\\":\\\"roleOneOverrideValue\\\"}\"}}}", + "{\"name\":\"testRoleTwo\",\"deployParametersMappingRuleProfile\":{\"helmMappingRuleProfile\":{\"releaseName\":\"overrideReleaseName\",\"releaseNamespace\":\"overrideNamespace\",\"values\":\"{\\\"roleTwoParam\\\":\\\"roleTwoOverrideValue\\\"}\"}}}" + ] + }, + "tags": { + "tag1": "value1", + "tag2": "value2" + } + } + } + }, + "operationId": "NetworkFunctions_UpdateTags", + "title": "Update tags for network function resource" +} diff --git a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkFunctionsExecuteRequest.json b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkFunctionsExecuteRequest.json new file mode 100644 index 0000000000..38e7618086 --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkFunctionsExecuteRequest.json @@ -0,0 +1,27 @@ +{ + "parameters": { + "api-version": "2025-03-30", + "networkFunctionName": "testNetworkfunction", + "parameters": { + "requestMetadata": { + "apiVersion": "apiVersionQueryString", + "httpMethod": "Post", + "relativePath": "/simProfiles/testSimProfile", + "serializedBody": "{\"subscriptionProfile\":\"ChantestSubscription15\",\"permanentKey\":\"00112233445566778899AABBCCDDEEFF\",\"opcOperatorCode\":\"63bfa50ee6523365ff14c1f45f88737d\",\"staticIpAddresses\":{\"internet\":{\"ipv4Addr\":\"198.51.100.1\",\"ipv6Prefix\":\"2001:db8:abcd:12::0/64\"},\"another_network\":{\"ipv6Prefix\":\"2001:111:cdef:22::0/64\"}}}" + }, + "serviceEndpoint": "serviceEndpoint" + }, + "resourceGroupName": "rg", + "subscriptionId": "subid" + }, + "responses": { + "200": {}, + "202": { + "headers": { + "location": "https://management.azure.com/providers/microsoft.hybridnetwork/locations/EASTUS2EUAP/operationStatuses/0b37c625-7e7c-49c5-b86e-c817c85acb5d*B77A34159CA34A0BD446D3BC7EC120649181590DDF991982765DAC1A87491B2D?api-version=2021-05-01" + } + } + }, + "operationId": "NetworkFunctions_ExecuteRequest", + "title": "Send request to network function services" +} diff --git a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkServiceDesignGroupCreate.json b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkServiceDesignGroupCreate.json new file mode 100644 index 0000000000..178a55e946 --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkServiceDesignGroupCreate.json @@ -0,0 +1,38 @@ +{ + "parameters": { + "api-version": "2025-03-30", + "networkServiceDesignGroupName": "TestNetworkServiceDesignGroupName", + "parameters": { + "location": "eastus" + }, + "publisherName": "TestPublisher", + "resourceGroupName": "rg", + "subscriptionId": "subid" + }, + "responses": { + "200": { + "body": { + "name": "TestNetworkServiceDesignGroupName", + "type": "Microsoft.HybridNetwork/publishers/networkServiceDesignGroups", + "id": "/subscriptions/subid/resourcegroups/rg/rgproviders/Microsoft.HybridNetwork/publishers/TestPublisher/networkServiceDesignGroups/TestNetworkServiceDesignGroupName", + "location": "eastus", + "properties": { + "description": "Test NSD group" + } + } + }, + "201": { + "body": { + "name": "TestNetworkServiceDesignGroupName", + "type": "Microsoft.HybridNetwork/publishers/networkServiceDesignGroups", + "id": "/subscriptions/subid/resourcegroups/rg/providers/Microsoft.HybridNetwork/publishers/TestPublisher/networkServiceDesignGroups/TestNetworkServiceDesignGroupName", + "location": "eastus", + "properties": { + "description": "Test NSD group" + } + } + } + }, + "operationId": "NetworkServiceDesignGroups_CreateOrUpdate", + "title": "Create or update the network service design group" +} diff --git a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkServiceDesignGroupDelete.json b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkServiceDesignGroupDelete.json new file mode 100644 index 0000000000..0e1428ac83 --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkServiceDesignGroupDelete.json @@ -0,0 +1,19 @@ +{ + "parameters": { + "api-version": "2025-03-30", + "networkServiceDesignGroupName": "TestNetworkServiceDesignGroupName", + "publisherName": "TestPublisher", + "resourceGroupName": "rg", + "subscriptionId": "subid" + }, + "responses": { + "202": { + "headers": { + "location": "https://management.azure.com/providers/microsoft.hybridnetwork/locations/EASTUS2EUAP/operationStatuses/0b37c625-7e7c-49c5-b86e-c817c85acb5d*B77A34159CA34A0BD446D3BC7EC120649181590DDF991982765DAC1A87491B2D?api-version=2021-05-01" + } + }, + "204": {} + }, + "operationId": "NetworkServiceDesignGroups_Delete", + "title": "Delete a network function group resource" +} diff --git a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkServiceDesignGroupGet.json b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkServiceDesignGroupGet.json new file mode 100644 index 0000000000..394d046e37 --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkServiceDesignGroupGet.json @@ -0,0 +1,24 @@ +{ + "parameters": { + "api-version": "2025-03-30", + "networkServiceDesignGroupName": "TestNetworkServiceDesignGroupName", + "publisherName": "TestPublisher", + "resourceGroupName": "rg", + "subscriptionId": "subid" + }, + "responses": { + "200": { + "body": { + "name": "TestNetworkServiceDesignGroupName", + "type": "Microsoft.HybridNetwork/publishers/networkServiceDesignGroups", + "id": "/subscriptions/subid/resourcegroups/rg/providers/Microsoft.HybridNetwork/publishers/TestPublisher/networkServiceDesignGroups/TestNetworkServiceDesignGroupName", + "location": "eastus", + "properties": { + "description": "Test NSD group" + } + } + } + }, + "operationId": "NetworkServiceDesignGroups_Get", + "title": "Get a networkServiceDesign group resource" +} diff --git a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkServiceDesignGroupUpdateTags.json b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkServiceDesignGroupUpdateTags.json new file mode 100644 index 0000000000..85dbe03d7b --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkServiceDesignGroupUpdateTags.json @@ -0,0 +1,34 @@ +{ + "parameters": { + "api-version": "2025-03-30", + "networkServiceDesignGroupName": "TestNetworkServiceDesignGroupName", + "parameters": { + "tags": { + "tag1": "value1", + "tag2": "value2" + } + }, + "publisherName": "TestPublisher", + "resourceGroupName": "rg", + "subscriptionId": "subid" + }, + "responses": { + "200": { + "body": { + "name": "TestNetworkServiceDesignGroupName", + "type": "Microsoft.HybridNetwork/publishers/networkServiceDesignGroups", + "id": "/subscriptions/subid/resourcegroups/rg/providers/Microsoft.HybridNetwork/publishers/TestPublisher/networkServiceDesignGroups/TestNetworkServiceDesignGroupName", + "location": "eastus", + "properties": { + "description": "Test NSD group" + }, + "tags": { + "tag1": "value1", + "tag2": "value2" + } + } + } + }, + "operationId": "NetworkServiceDesignGroups_Update", + "title": "Create or update the network service design group resource" +} diff --git a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkServiceDesignGroupsListByPublisherName.json b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkServiceDesignGroupsListByPublisherName.json new file mode 100644 index 0000000000..ccfce9f0e6 --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkServiceDesignGroupsListByPublisherName.json @@ -0,0 +1,27 @@ +{ + "parameters": { + "api-version": "2025-03-30", + "publisherName": "TestPublisher", + "resourceGroupName": "rg", + "subscriptionId": "subid" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "name": "TestNetworkServiceDesignGroupName", + "type": "Microsoft.HybridNetwork/publishers/networkServiceDesignGroups", + "id": "/subscriptions/subid/resourcegroups/rg/providers/Microsoft.HybridNetwork/publishers/TestPublisher/networkServiceDesignGroups/TestNetworkServiceDesignGroupName", + "location": "eastus", + "properties": { + "description": "Test NSD group" + } + } + ] + } + } + }, + "operationId": "NetworkServiceDesignGroups_ListByPublisher", + "title": "Get networkServiceDesign groups under publisher resource" +} diff --git a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkServiceDesignVersionCreate.json b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkServiceDesignVersionCreate.json new file mode 100644 index 0000000000..1dd44bbd36 --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkServiceDesignVersionCreate.json @@ -0,0 +1,117 @@ +{ + "parameters": { + "api-version": "2025-03-30", + "networkServiceDesignGroupName": "TestNetworkServiceDesignGroupName", + "networkServiceDesignVersionName": "1.0.0", + "parameters": { + "location": "eastus", + "properties": { + "configurationGroupSchemaReferences": { + "MyVM_Configuration": { + "id": "/subscriptions/subid/resourcegroups/contosorg1/providers/microsoft.hybridnetwork/publishers/contosoGroup/networkServiceDesignGroups/NSD_contoso/configurationGroupSchemas/MyVM_Configuration_Schema" + } + }, + "resourceElementTemplates": [ + { + "name": "MyVM", + "type": "ArmResourceDefinition", + "configuration": { + "artifactProfile": { + "artifactName": "MyVMArmTemplate", + "artifactStoreReference": { + "id": "/subscriptions/subid/providers/Microsoft.HybridNetwork/publishers/contosoGroup/artifactStoreReference/store1" + }, + "artifactVersion": "1.0.0" + }, + "parameterValues": "{\"publisherName\":\"{configurationparameters('MyVM_Configuration').publisherName}\",\"skuGroupName\":\"{configurationparameters('MyVM_Configuration').skuGroupName}\",\"skuVersion\":\"{configurationparameters('MyVM_Configuration').skuVersion}\",\"skuOfferingLocation\":\"{configurationparameters('MyVM_Configuration').skuOfferingLocation}\",\"nfviType\":\"{nfvis().nfvisFromSitePerNfviType.AzureCore.nfviAlias1.nfviType}\",\"nfviId\":\"{nfvis().nfvisFromSitePerNfviType.AzureCore.nfviAlias1.nfviId}\",\"allowSoftwareUpdates\":\"{configurationparameters('MyVM_Configuration').allowSoftwareUpdates}\",\"virtualNetworkName\":\"{configurationparameters('MyVM_Configuration').vnetName}\",\"subnetName\":\"{configurationparameters('MyVM_Configuration').subnetName}\",\"subnetAddressPrefix\":\"{configurationparameters('MyVM_Configuration').subnetAddressPrefix}\",\"managedResourceGroup\":\"{configurationparameters('SNSSelf').managedResourceGroupName}\",\"adminPassword\":\"{secretparameters('MyVM_Configuration').adminPassword}\"}", + "templateType": "ArmTemplate" + }, + "dependsOnProfile": { + "installDependsOn": [] + } + } + ], + "versionState": "Active" + } + }, + "publisherName": "TestPublisher", + "resourceGroupName": "rg", + "subscriptionId": "subid" + }, + "responses": { + "200": { + "body": { + "name": "TestVersion", + "type": "Microsoft.HybridNetwork/publishers/networkServiceDesignGroups/networkServiceDesignVersions", + "id": "/subscriptions/subid/resourcegroups/rg/providers/Microsoft.HybridNetwork/publishers/TestPublisher/networkServiceDesignGroups/TestNetworkServiceDesignGroupName/networkServiceDesignVersions/1.0.0", + "location": "eastus", + "properties": { + "configurationGroupSchemaReferences": { + "MyVM_Configuration": { + "id": "/subscriptions/subid/resourcegroups/contosorg1/providers/microsoft.hybridnetwork/publishers/contosoGroup/networkServiceDesignGroups/NSD_contoso/configurationGroupSchemas/MyVM_Configuration_Schema" + } + }, + "resourceElementTemplates": [ + { + "name": "MyVM", + "type": "ArmResourceDefinition", + "configuration": { + "artifactProfile": { + "artifactName": "MyVMArmTemplate", + "artifactStoreReference": { + "id": "/subscriptions/subid/providers/Microsoft.HybridNetwork/publishers/contosoGroup/artifactStoreReference/store1" + }, + "artifactVersion": "1.0.0" + }, + "parameterValues": "{\"publisherName\":\"{configurationparameters('MyVM_Configuration').publisherName}\",\"skuGroupName\":\"{configurationparameters('MyVM_Configuration').skuGroupName}\",\"skuVersion\":\"{configurationparameters('MyVM_Configuration').skuVersion}\",\"skuOfferingLocation\":\"{configurationparameters('MyVM_Configuration').skuOfferingLocation}\",\"nfviType\":\"{nfvis().nfvisFromSitePerNfviType.AzureCore.nfviAlias1.nfviType}\",\"nfviId\":\"{nfvis().nfvisFromSitePerNfviType.AzureCore.nfviAlias1.nfviId}\",\"allowSoftwareUpdates\":\"{configurationparameters('MyVM_Configuration').allowSoftwareUpdates}\",\"virtualNetworkName\":\"{configurationparameters('MyVM_Configuration').vnetName}\",\"subnetName\":\"{configurationparameters('MyVM_Configuration').subnetName}\",\"subnetAddressPrefix\":\"{configurationparameters('MyVM_Configuration').subnetAddressPrefix}\",\"managedResourceGroup\":\"{configurationparameters('SNSSelf').managedResourceGroupName}\",\"adminPassword\":\"{secretparameters('MyVM_Configuration').adminPassword}\"}", + "templateType": "ArmTemplate" + }, + "dependsOnProfile": { + "installDependsOn": [] + } + } + ], + "versionState": "Active" + } + } + }, + "201": { + "body": { + "name": "TestVersion", + "type": "Microsoft.HybridNetwork/publishers/networkFunctionDefinitionGroups/networkFunctionDefinitionVersions", + "id": "/subscriptions/subid/resourcegroups/rg/providers/Microsoft.HybridNetwork/publishers/TestPublisher/networkFunctionDefinitionGroups/TestNetworkFunctionDefinitionGroupName/networkFunctionDefinitionVersions/1.0.0", + "location": "eastus", + "properties": { + "configurationGroupSchemaReferences": { + "MyVM_Configuration": { + "id": "/subscriptions/subid/resourcegroups/contosorg1/providers/microsoft.hybridnetwork/publishers/contosoGroup/networkServiceDesignGroups/NSD_contoso/configurationGroupSchemas/MyVM_Configuration_Schema" + } + }, + "resourceElementTemplates": [ + { + "name": "MyVM", + "type": "ArmResourceDefinition", + "configuration": { + "artifactProfile": { + "artifactName": "MyVMArmTemplate", + "artifactStoreReference": { + "id": "/subscriptions/subid/providers/Microsoft.HybridNetwork/publishers/contosoGroup/artifactStoreReference/store1" + }, + "artifactVersion": "1.0.0" + }, + "parameterValues": "{\"publisherName\":\"{configurationparameters('MyVM_Configuration').publisherName}\",\"skuGroupName\":\"{configurationparameters('MyVM_Configuration').skuGroupName}\",\"skuVersion\":\"{configurationparameters('MyVM_Configuration').skuVersion}\",\"skuOfferingLocation\":\"{configurationparameters('MyVM_Configuration').skuOfferingLocation}\",\"nfviType\":\"{nfvis().nfvisFromSitePerNfviType.AzureCore.nfviAlias1.nfviType}\",\"nfviId\":\"{nfvis().nfvisFromSitePerNfviType.AzureCore.nfviAlias1.nfviId}\",\"allowSoftwareUpdates\":\"{configurationparameters('MyVM_Configuration').allowSoftwareUpdates}\",\"virtualNetworkName\":\"{configurationparameters('MyVM_Configuration').vnetName}\",\"subnetName\":\"{configurationparameters('MyVM_Configuration').subnetName}\",\"subnetAddressPrefix\":\"{configurationparameters('MyVM_Configuration').subnetAddressPrefix}\",\"managedResourceGroup\":\"{configurationparameters('SNSSelf').managedResourceGroupName}\",\"adminPassword\":\"{secretparameters('MyVM_Configuration').adminPassword}\"}", + "templateType": "ArmTemplate" + }, + "dependsOnProfile": { + "installDependsOn": [] + } + } + ], + "versionState": "Active" + } + } + } + }, + "operationId": "NetworkServiceDesignVersions_CreateOrUpdate", + "title": "Create or update a network service design version resource" +} diff --git a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkServiceDesignVersionDelete.json b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkServiceDesignVersionDelete.json new file mode 100644 index 0000000000..7375f14a00 --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkServiceDesignVersionDelete.json @@ -0,0 +1,20 @@ +{ + "parameters": { + "api-version": "2025-03-30", + "networkServiceDesignGroupName": "TestNetworkServiceDesignGroupName", + "networkServiceDesignVersionName": "1.0.0", + "publisherName": "TestPublisher", + "resourceGroupName": "rg", + "subscriptionId": "subid" + }, + "responses": { + "202": { + "headers": { + "location": "https://management.azure.com/providers/microsoft.hybridnetwork/locations/EASTUS2EUAP/operationStatuses/0b37c625-7e7c-49c5-b86e-c817c85acb5d*B77A34159CA34A0BD446D3BC7EC120649181590DDF991982765DAC1A87491B2D?api-version=2021-05-01" + } + }, + "204": {} + }, + "operationId": "NetworkServiceDesignVersions_Delete", + "title": "Delete a network service design version" +} diff --git a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkServiceDesignVersionGet.json b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkServiceDesignVersionGet.json new file mode 100644 index 0000000000..dfa0254166 --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkServiceDesignVersionGet.json @@ -0,0 +1,56 @@ +{ + "parameters": { + "api-version": "2025-03-30", + "networkServiceDesignGroupName": "TestNetworkServiceDesignGroupName", + "networkServiceDesignVersionName": "1.0.0", + "publisherName": "TestPublisher", + "resourceGroupName": "rg", + "subscriptionId": "subid" + }, + "responses": { + "200": { + "body": { + "name": "TestVersion", + "type": "Microsoft.HybridNetwork/publishers/networkServiceDesignGroups/networkServiceDesignVersions", + "id": "/subscriptions/subid/resourcegroups/rg/providers/Microsoft.HybridNetwork/publishers/TestPublisher/networkServiceDesignGroups/TestNetworkServiceDesignGroupName/networkServiceDesignVersions/1.0.0", + "location": "eastus", + "properties": { + "configurationGroupSchemaReferences": { + "MyVM_Configuration": { + "id": "/subscriptions/subid/resourcegroups/contosorg1/providers/microsoft.hybridnetwork/publishers/contosoGroup/networkServiceDesignGroups/NSD_contoso/configurationGroupSchemas/MyVM_Configuration_Schema" + } + }, + "nfvisFromSite": { + "nfvi1": { + "name": "{configurationparameter('MyVM_Configuration').nfviNameFromSite}", + "type": "AzureCore" + } + }, + "resourceElementTemplates": [ + { + "name": "MyVM", + "type": "ArmResourceDefinition", + "configuration": { + "artifactProfile": { + "artifactName": "MyVMArmTemplate", + "artifactStoreReference": { + "id": "/subscriptions/subid/providers/Microsoft.HybridNetwork/publishers/contosoGroup/ArtifactStore/store1" + }, + "artifactVersion": "1.0.0" + }, + "parameterValues": "{\"publisherName\":\"{configurationparameters('MyVM_Configuration').publisherName}\",\"skuGroupName\":\"{configurationparameters('MyVM_Configuration').skuGroupName}\",\"skuVersion\":\"{configurationparameters('MyVM_Configuration').skuVersion}\",\"skuOfferingLocation\":\"{configurationparameters('MyVM_Configuration').skuOfferingLocation}\",\"nfviType\":\"{nfvis().nfvisFromSitePerNfviType.AzureCore.nfviAlias1.nfviType}\",\"nfviId\":\"{nfvis().nfvisFromSitePerNfviType.AzureCore.nfviAlias1.nfviId}\",\"allowSoftwareUpdates\":\"{configurationparameters('MyVM_Configuration').allowSoftwareUpdates}\",\"virtualNetworkName\":\"{configurationparameters('MyVM_Configuration').vnetName}\",\"subnetName\":\"{configurationparameters('MyVM_Configuration').subnetName}\",\"subnetAddressPrefix\":\"{configurationparameters('MyVM_Configuration').subnetAddressPrefix}\",\"managedResourceGroup\":\"{configurationparameters('SNSSelf').managedResourceGroupName}\",\"adminPassword\":\"{secretparameters('MyVM_Configuration').adminPassword}\"}", + "templateType": "ArmTemplate" + }, + "dependsOnProfile": { + "installDependsOn": [] + } + } + ], + "versionState": "Active" + } + } + } + }, + "operationId": "NetworkServiceDesignVersions_Get", + "title": "Get a network service design version resource" +} diff --git a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkServiceDesignVersionListByNetworkServiceDesignGroup.json b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkServiceDesignVersionListByNetworkServiceDesignGroup.json new file mode 100644 index 0000000000..704b896655 --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkServiceDesignVersionListByNetworkServiceDesignGroup.json @@ -0,0 +1,53 @@ +{ + "parameters": { + "api-version": "2025-03-30", + "networkServiceDesignGroupName": "TestNetworkServiceDesignGroupName", + "publisherName": "TestPublisher", + "resourceGroupName": "rg", + "subscriptionId": "subid" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "name": "TestVersion", + "type": "Microsoft.HybridNetwork/publishers/networkServiceDesignGroups/networkServiceDesignVersions", + "id": "/subscriptions/subid/resourcegroups/rg/providers/Microsoft.HybridNetwork/publishers/TestPublisher/networkServiceDesignGroups/TestNetworkServiceDesignGroupName/networkServiceDesignVersions/1.0.0", + "location": "eastus", + "properties": { + "configurationGroupSchemaReferences": { + "MyVM_Configuration": { + "id": "/subscriptions/subid/resourcegroups/contosorg1/providers/microsoft.hybridnetwork/publishers/contosoGroup/networkServiceDesignGroups/NSD_contoso/configurationGroupSchemas/MyVM_Configuration_Schema" + } + }, + "resourceElementTemplates": [ + { + "name": "MyVM", + "type": "ArmResourceDefinition", + "configuration": { + "artifactProfile": { + "artifactName": "MyVMArmTemplate", + "artifactStoreReference": { + "id": "/subscriptions/subid/providers/Microsoft.HybridNetwork/publishers/contosoGroup/ArtifactStore/store1" + }, + "artifactVersion": "1.0.0" + }, + "parameterValues": "\"publisherName\": \"{configurationparameters('MyVM_Configuration').publisherName}\",\r\n \"skuGroupName\": \"{configurationparameters('MyVM_Configuration').skuGroupName}\",\r\n \"skuVersion\": \"{configurationparameters('MyVM_Configuration').skuVersion}\",\r\n \"skuOfferingLocation\": \"{configurationparameters('MyVM_Configuration').skuOfferingLocation}\",\r\n \"nfviType\": \"{nfvis().nfvisFromSitePerNfviType.AzureCore.nfviAlias1.nfviType}\",\r\n \"nfviId\": \"{nfvis().nfvisFromSitePerNfviType.AzureCore.nfviAlias1.nfviId}\",\r\n \"allowSoftwareUpdates\": \"{configurationparameters('MyVM_Configuration').allowSoftwareUpdates}\",\r\n \"virtualNetworkName\": \"{configurationparameters('MyVM_Configuration').vnetName}\",\r\n \"subnetName\": \"{configurationparameters('MyVM_Configuration').subnetName}\",\r\n \"subnetAddressPrefix\": \"{configurationparameters('MyVM_Configuration').subnetAddressPrefix}\",\r\n \"managedResourceGroup\": \"{configurationparameters('SNSSelf').managedResourceGroupName}\"\r\n ", + "templateType": "ArmTemplate" + }, + "dependsOnProfile": { + "installDependsOn": [] + } + } + ], + "versionState": "Active" + } + } + ] + } + } + }, + "operationId": "NetworkServiceDesignVersions_ListByNetworkServiceDesignGroup", + "title": "Get Publisher resource" +} diff --git a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkServiceDesignVersionUpdateState.json b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkServiceDesignVersionUpdateState.json new file mode 100644 index 0000000000..0e6ac30b61 --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkServiceDesignVersionUpdateState.json @@ -0,0 +1,27 @@ +{ + "parameters": { + "api-version": "2025-03-30", + "networkServiceDesignGroupName": "TestNetworkServiceDesignGroupName", + "networkServiceDesignVersionName": "1.0.0", + "parameters": { + "versionState": "Active" + }, + "publisherName": "TestPublisher", + "resourceGroupName": "rg", + "subscriptionId": "subid" + }, + "responses": { + "200": { + "body": { + "versionState": "Active" + } + }, + "202": { + "headers": { + "location": "https://management.azure.com/providers/microsoft.hybridnetwork/locations/EASTUS2EUAP/operationStatuses/0b37c625-7e7c-49c5-b86e-c817c85acb5d*B77A34159CA34A0BD446D3BC7EC120649181590DDF991982765DAC1A87491B2D?api-version=2021-05-01" + } + } + }, + "operationId": "NetworkServiceDesignVersions_updateState", + "title": "Update network service design version state" +} diff --git a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkServiceDesignVersionUpdateTags.json b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkServiceDesignVersionUpdateTags.json new file mode 100644 index 0000000000..aabfb24f71 --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkServiceDesignVersionUpdateTags.json @@ -0,0 +1,60 @@ +{ + "parameters": { + "api-version": "2025-03-30", + "networkServiceDesignGroupName": "TestNetworkServiceDesignGroupName", + "networkServiceDesignVersionName": "1.0.0", + "parameters": { + "tags": { + "tag1": "value1", + "tag2": "value2" + } + }, + "publisherName": "TestPublisher", + "resourceGroupName": "rg", + "subscriptionId": "subid" + }, + "responses": { + "200": { + "body": { + "name": "TestVersion", + "type": "Microsoft.HybridNetwork/publishers/networkServiceDesignGroups/networkServiceDesignVersions", + "id": "/subscriptions/subid/resourcegroups/rg/providers/Microsoft.HybridNetwork/publishers/TestPublisher/networkServiceDesignGroups/TestNetworkServiceDesignGroupName/networkServiceDesignVersions/1.0.0", + "location": "eastus", + "properties": { + "configurationGroupSchemaReferences": { + "MyVM_Configuration": { + "id": "/subscriptions/subid/resourcegroups/contosorg1/providers/microsoft.hybridnetwork/publishers/contosoGroup/networkServiceDesignGroups/NSD_contoso/configurationGroupSchemas/MyVM_Configuration_Schema" + } + }, + "resourceElementTemplates": [ + { + "name": "MyVM", + "type": "ArmResourceDefinition", + "configuration": { + "artifactProfile": { + "artifactName": "MyVMArmTemplate", + "artifactStoreReference": { + "id": "/subscriptions/subid/providers/Microsoft.HybridNetwork/publishers/contosoGroup/ArtifactStore/store1" + }, + "artifactVersion": "1.0.0" + }, + "parameterValues": "\"publisherName\": \"{configurationparameters('MyVM_Configuration').publisherName}\",\r\n \"skuGroupName\": \"{configurationparameters('MyVM_Configuration').skuGroupName}\",\r\n \"skuVersion\": \"{configurationparameters('MyVM_Configuration').skuVersion}\",\r\n \"skuOfferingLocation\": \"{configurationparameters('MyVM_Configuration').skuOfferingLocation}\",\r\n \"nfviType\": \"{nfvis().nfvisFromSitePerNfviType.AzureCore.nfviAlias1.nfviType}\",\r\n \"nfviId\": \"{nfvis().nfvisFromSitePerNfviType.AzureCore.nfviAlias1.nfviId}\",\r\n \"allowSoftwareUpdates\": \"{configurationparameters('MyVM_Configuration').allowSoftwareUpdates}\",\r\n \"virtualNetworkName\": \"{configurationparameters('MyVM_Configuration').vnetName}\",\r\n \"subnetName\": \"{configurationparameters('MyVM_Configuration').subnetName}\",\r\n \"subnetAddressPrefix\": \"{configurationparameters('MyVM_Configuration').subnetAddressPrefix}\",\r\n \"managedResourceGroup\": \"{configurationparameters('SNSSelf').managedResourceGroupName}\"\r\n ", + "templateType": "ArmTemplate" + }, + "dependsOnProfile": { + "installDependsOn": [] + } + } + ], + "versionState": "Active" + }, + "tags": { + "tag1": "value1", + "tag2": "value2" + } + } + } + }, + "operationId": "NetworkServiceDesignVersions_Update", + "title": "Update the network service design version tags" +} diff --git a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/PublisherCreate.json b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/PublisherCreate.json new file mode 100644 index 0000000000..df9b2c4197 --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/PublisherCreate.json @@ -0,0 +1,42 @@ +{ + "parameters": { + "api-version": "2025-03-30", + "parameters": { + "location": "eastus", + "properties": { + "scope": "Public" + } + }, + "publisherName": "TestPublisher", + "resourceGroupName": "rg", + "subscriptionId": "subid" + }, + "responses": { + "200": { + "body": { + "name": "TestPublisher", + "type": "Microsoft.HybridNetwork/publishers", + "id": "/subscriptions/subid/resourcegroups/rg/providers/Microsoft.HybridNetwork/publishers/TestPublisher", + "location": "eastus", + "properties": { + "provisioningState": "Succeeded", + "scope": "Public" + } + } + }, + "201": { + "body": { + "name": "TestPublisher", + "type": "Microsoft.HybridNetwork/publishers", + "id": "/subscriptions/subid/resourcegroups/rg/providers/Microsoft.HybridNetwork/publishers/TestPublisher", + "location": "eastus", + "properties": { + "provisioningState": "Accepted", + "scope": "Public" + } + } + } + }, + "operationId": "Publishers_CreateOrUpdate", + "title": "Create or update a publisher resource" +} diff --git a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/PublisherDelete.json b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/PublisherDelete.json new file mode 100644 index 0000000000..420ddddf70 --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/PublisherDelete.json @@ -0,0 +1,18 @@ +{ + "parameters": { + "api-version": "2025-03-30", + "publisherName": "TestPublisher", + "resourceGroupName": "rg", + "subscriptionId": "subid" + }, + "responses": { + "202": { + "headers": { + "location": "https://management.azure.com/providers/microsoft.hybridnetwork/locations/EASTUS2EUAP/operationStatuses/0b37c625-7e7c-49c5-b86e-c817c85acb5d*B77A34159CA34A0BD446D3BC7EC120649181590DDF991982765DAC1A87491B2D?api-version=2021-05-01" + } + }, + "204": {} + }, + "operationId": "Publishers_Delete", + "title": "Delete a publisher resource" +} diff --git a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/PublisherGet.json b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/PublisherGet.json new file mode 100644 index 0000000000..cbc23e3c4d --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/PublisherGet.json @@ -0,0 +1,24 @@ +{ + "parameters": { + "api-version": "2025-03-30", + "publisherName": "TestPublisher", + "resourceGroupName": "rg", + "subscriptionId": "subid" + }, + "responses": { + "200": { + "body": { + "name": "TestPublisher", + "type": "Microsoft.HybridNetwork/publishers", + "id": "/subscriptions/subid/resourcegroups/rg/providers/Microsoft.HybridNetwork/publishers/TestPublisher", + "location": "eastus", + "properties": { + "provisioningState": "Succeeded", + "scope": "Public" + } + } + } + }, + "operationId": "Publishers_Get", + "title": "Get a publisher resource" +} diff --git a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/PublisherListByResourceGroup.json b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/PublisherListByResourceGroup.json new file mode 100644 index 0000000000..12b68bbc8b --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/PublisherListByResourceGroup.json @@ -0,0 +1,37 @@ +{ + "parameters": { + "api-version": "2025-03-30", + "resourceGroupName": "rg", + "subscriptionId": "subid" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "name": "TestPublisher", + "type": "Microsoft.HybridNetwork/publishers", + "id": "/subscriptions/subid/resourcegroups/rg/providers/Microsoft.HybridNetwork/publishers/TestPublisher", + "location": "eastus", + "properties": { + "provisioningState": "Succeeded", + "scope": "Public" + } + }, + { + "name": "TestPublisher2", + "type": "Microsoft.HybridNetwork/publishers", + "id": "/subscriptions/subid/resourcegroups/rg/providers/Microsoft.HybridNetwork/publishers/TestPublisher2", + "location": "eastus", + "properties": { + "provisioningState": "Succeeded", + "scope": "Public" + } + } + ] + } + } + }, + "operationId": "Publishers_ListByResourceGroup", + "title": "List all publisher resources in a resource group" +} diff --git a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/PublisherListBySubscription.json b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/PublisherListBySubscription.json new file mode 100644 index 0000000000..d9b9c71aad --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/PublisherListBySubscription.json @@ -0,0 +1,36 @@ +{ + "parameters": { + "api-version": "2025-03-30", + "subscriptionId": "subid" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "name": "TestPublisher", + "type": "Microsoft.HybridNetwork/publishers", + "id": "/subscriptions/subid/resourcegroups/rg/providers/Microsoft.HybridNetwork/publishers/TestPublisher", + "location": "eastus", + "properties": { + "provisioningState": "Succeeded", + "scope": "Public" + } + }, + { + "name": "TestPublisher2", + "type": "Microsoft.HybridNetwork/publishers", + "id": "/subscriptions/subid/resourcegroups/rg/providers/Microsoft.HybridNetwork/publishers/TestPublisher2", + "location": "eastus", + "properties": { + "provisioningState": "Succeeded", + "scope": "Public" + } + } + ] + } + } + }, + "operationId": "Publishers_ListBySubscription", + "title": "List all publisher resources in a subscription" +} diff --git a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/PublisherUpdateTags.json b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/PublisherUpdateTags.json new file mode 100644 index 0000000000..d7123e35fb --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/PublisherUpdateTags.json @@ -0,0 +1,34 @@ +{ + "parameters": { + "api-version": "2025-03-30", + "parameters": { + "tags": { + "tag1": "value1", + "tag2": "value2" + } + }, + "publisherName": "TestPublisher", + "resourceGroupName": "rg", + "subscriptionId": "subid" + }, + "responses": { + "200": { + "body": { + "name": "TestPublisher", + "type": "Microsoft.HybridNetwork/publishers", + "id": "/subscriptions/subid/resourcegroups/rg/providers/Microsoft.HybridNetwork/publishers/TestPublisher", + "location": "eastus", + "properties": { + "provisioningState": "Succeeded", + "scope": "Public" + }, + "tags": { + "tag1": "value1", + "tag2": "value2" + } + } + } + }, + "operationId": "Publishers_Update", + "title": "Update a publisher tags" +} diff --git a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/PureProxyArtifact/ArtifactChangeState.json b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/PureProxyArtifact/ArtifactChangeState.json new file mode 100644 index 0000000000..998eea558f --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/PureProxyArtifact/ArtifactChangeState.json @@ -0,0 +1,37 @@ +{ + "parameters": { + "api-version": "2025-03-30", + "artifactName": "fedrbac", + "artifactStoreName": "TestArtifactStoreName", + "artifactVersionName": "1.0.0", + "parameters": { + "properties": { + "artifactState": "Deprecated" + } + }, + "publisherName": "TestPublisher", + "resourceGroupName": "TestResourceGroup", + "subscriptionId": "subid" + }, + "responses": { + "200": { + "body": { + "name": "fedrbac", + "type": "Microsoft.HybridNetwork/publishers/artifactStores/artifactVersions", + "id": "/subscriptions/subid/resourceGroups/TestResourceGroup/providers/Microsoft.HybridNetwork/publishers/TestPublisher/artifactStores/TestArtifactStore/artifactVersions/1.0.0", + "properties": { + "artifactState": "Deprecated", + "artifactType": "OCIArtifact", + "artifactVersion": "1.0.0" + } + } + }, + "202": { + "headers": { + "location": "https://management.azure.com/providers/microsoft.hybridnetwork/locations/EASTUS2EUAP/operationStatuses/0b37c625-7e7c-49c5-b86e-c817c85acb5d*B77A34159CA34A0BD446D3BC7EC120649181590DDF991982765DAC1A87491B2D?api-version=2021-05-01" + } + } + }, + "operationId": "ProxyArtifact_UpdateState", + "title": "Update an artifact state" +} diff --git a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/PureProxyArtifact/ArtifactGet.json b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/PureProxyArtifact/ArtifactGet.json new file mode 100644 index 0000000000..64648a5eaf --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/PureProxyArtifact/ArtifactGet.json @@ -0,0 +1,41 @@ +{ + "parameters": { + "api-version": "2025-03-30", + "artifactName": "fedrbac", + "artifactStoreName": "TestArtifactStoreName", + "publisherName": "TestPublisher", + "resourceGroupName": "TestResourceGroup", + "subscriptionId": "subid" + }, + "responses": { + "200": { + "body": { + "nextLink": "https://microsoft.com/a", + "value": [ + { + "name": "fedrbac", + "type": "Microsoft.HybridNetwork/publishers/artifactStores/artifactVersions", + "id": "/subscriptions/subid/resourceGroups/TestResourceGroup/providers/Microsoft.HybridNetwork/publishers/TestPublisher/artifactStores/TestArtifactStore/artifactVersions", + "properties": { + "artifactState": "Deprecated", + "artifactType": "OCIArtifact", + "artifactVersion": "1.0.0" + } + }, + { + "name": "fedrbac", + "type": "Microsoft.HybridNetwork/publishers/artifactStores/artifactVersions", + "id": "/subscriptions/subid/resourceGroups/TestResourceGroup/providers/Microsoft.HybridNetwork/publishers/TestPublisher/artifactStores/TestArtifactStore/artifactVersions", + "properties": { + "artifactState": "Active", + "artifactType": "OCIArtifact", + "artifactVersion": "2.0.0" + } + } + ] + } + } + }, + "operationId": "ProxyArtifact_Get", + "title": "Get an artifact overview" +} diff --git a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/PureProxyArtifact/ArtifactList.json b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/PureProxyArtifact/ArtifactList.json new file mode 100644 index 0000000000..b7348cbdaa --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/PureProxyArtifact/ArtifactList.json @@ -0,0 +1,30 @@ +{ + "parameters": { + "api-version": "2025-03-30", + "artifactStoreName": "TestArtifactStoreName", + "publisherName": "TestPublisher", + "resourceGroupName": "TestResourceGroup", + "subscriptionId": "subid" + }, + "responses": { + "200": { + "body": { + "nextLink": "https://microsoft.com/a", + "value": [ + { + "name": "fedrbac1", + "type": "Microsoft.HybridNetwork/publishers/artifactStores/artifactVersions", + "id": "/subscriptions/subid/resourceGroups/TestResourceGroup/providers/Microsoft.HybridNetwork/publishers/TestPublisher/artifactStores/TestArtifactStore/artifactVersions" + }, + { + "name": "fedrbac2", + "type": "Microsoft.HybridNetwork/publishers/artifactStores/artifactVersions", + "id": "/subscriptions/subid/resourceGroups/TestResourceGroup/providers/Microsoft.HybridNetwork/publishers/TestPublisher/artifactStores/TestArtifactStore/artifactVersions" + } + ] + } + } + }, + "operationId": "ProxyArtifact_List", + "title": "List artifacts under an artifact store" +} diff --git a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/SiteCreate.json b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/SiteCreate.json new file mode 100644 index 0000000000..32ac91834c --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/SiteCreate.json @@ -0,0 +1,118 @@ +{ + "parameters": { + "api-version": "2025-03-30", + "parameters": { + "location": "westUs2", + "properties": { + "nfvis": [ + { + "name": "nfvi1", + "location": "westUs2", + "nfviType": "AzureCore" + }, + { + "name": "nfvi2", + "customLocationReference": { + "id": "/subscriptions/subid/resourceGroups/testResourceGroup/providers/Microsoft.ExtendedLocation/customLocations/testCustomLocation1" + }, + "nfviType": "AzureArcKubernetes" + }, + { + "name": "nfvi3", + "customLocationReference": { + "id": "/subscriptions/subid/resourceGroups/testResourceGroup/providers/Microsoft.ExtendedLocation/customLocations/testCustomLocation2" + }, + "nfviType": "AzureOperatorNexus" + } + ] + } + }, + "resourceGroupName": "rg1", + "siteName": "testSite", + "subscriptionId": "subid" + }, + "responses": { + "200": { + "body": { + "name": "testSite", + "type": "Microsoft.HybridNetwork/sites", + "id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.HybridNetwork/sites/testSite", + "location": "westUs2", + "properties": { + "nfvis": [ + { + "name": "nfvi1", + "location": "westUs2", + "nfviType": "AzureCore" + }, + { + "name": "nfvi2", + "customLocationReference": { + "id": "/subscriptions/subid/resourceGroups/testResourceGroup/providers/Microsoft.ExtendedLocation/customLocations/testCustomLocation1" + }, + "nfviType": "AzureArcKubernetes" + }, + { + "name": "nfvi3", + "customLocationReference": { + "id": "/subscriptions/subid/resourceGroups/testResourceGroup/providers/Microsoft.ExtendedLocation/customLocations/testCustomLocation2" + }, + "nfviType": "AzureOperatorNexus" + } + ], + "provisioningState": "Accepted" + }, + "systemData": { + "createdAt": "2020-01-01T17:18:19.1234567Z", + "createdBy": "user1", + "createdByType": "User", + "lastModifiedAt": "2020-01-02T17:18:19.1234567Z", + "lastModifiedBy": "user2", + "lastModifiedByType": "User" + } + } + }, + "201": { + "body": { + "name": "testSite", + "type": "Microsoft.HybridNetwork/sites", + "id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.HybridNetwork/sites/testSite", + "location": "westUs2", + "properties": { + "nfvis": [ + { + "name": "nfvi1", + "location": "westUs2", + "nfviType": "AzureCore" + }, + { + "name": "nfvi2", + "customLocationReference": { + "id": "/subscriptions/subid/resourceGroups/testResourceGroup/providers/Microsoft.ExtendedLocation/customLocations/testCustomLocation1" + }, + "nfviType": "AzureArcKubernetes" + }, + { + "name": "nfvi3", + "customLocationReference": { + "id": "/subscriptions/subid/resourceGroups/testResourceGroup/providers/Microsoft.ExtendedLocation/customLocations/testCustomLocation2" + }, + "nfviType": "AzureOperatorNexus" + } + ], + "provisioningState": "Accepted" + }, + "systemData": { + "createdAt": "2020-01-01T17:18:19.1234567Z", + "createdBy": "user1", + "createdByType": "User", + "lastModifiedAt": "2020-01-02T17:18:19.1234567Z", + "lastModifiedBy": "user2", + "lastModifiedByType": "User" + } + } + } + }, + "operationId": "Sites_CreateOrUpdate", + "title": "Create network site" +} diff --git a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/SiteDelete.json b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/SiteDelete.json new file mode 100644 index 0000000000..8dc1f80301 --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/SiteDelete.json @@ -0,0 +1,18 @@ +{ + "parameters": { + "api-version": "2025-03-30", + "resourceGroupName": "rg1", + "siteName": "testSite", + "subscriptionId": "subid" + }, + "responses": { + "202": { + "headers": { + "location": "https://management.azure.com/providers/microsoft.hybridnetwork/locations/EASTUS2EUAP/operationStatuses/0b37c625-7e7c-49c5-b86e-c817c85acb5d*B77A34159CA34A0BD446D3BC7EC120649181590DDF991982765DAC1A87491B2D?api-version=2021-05-01" + } + }, + "204": {} + }, + "operationId": "Sites_Delete", + "title": "Delete network site" +} diff --git a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/SiteGet.json b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/SiteGet.json new file mode 100644 index 0000000000..7ce3970584 --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/SiteGet.json @@ -0,0 +1,52 @@ +{ + "parameters": { + "api-version": "2025-03-30", + "resourceGroupName": "rg1", + "siteName": "testSite", + "subscriptionId": "subid" + }, + "responses": { + "200": { + "body": { + "name": "testSite", + "type": "Microsoft.HybridNetwork/sites", + "id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.HybridNetwork/sites/testSite", + "location": "westUs2", + "properties": { + "nfvis": [ + { + "name": "nfvi1", + "location": "westUs2", + "nfviType": "AzureCore" + }, + { + "name": "nfvi2", + "customLocationReference": { + "id": "/subscriptions/subid/resourceGroups/testResourceGroup/providers/Microsoft.ExtendedLocation/customLocations/testCustomLocation1" + }, + "nfviType": "AzureArcKubernetes" + }, + { + "name": "nfvi3", + "customLocationReference": { + "id": "/subscriptions/subid/resourceGroups/testResourceGroup/providers/Microsoft.ExtendedLocation/customLocations/testCustomLocation2" + }, + "nfviType": "AzureOperatorNexus" + } + ], + "provisioningState": "Accepted" + }, + "systemData": { + "createdAt": "2020-01-01T17:18:19.1234567Z", + "createdBy": "user1", + "createdByType": "User", + "lastModifiedAt": "2020-01-02T17:18:19.1234567Z", + "lastModifiedBy": "user2", + "lastModifiedByType": "User" + } + } + } + }, + "operationId": "Sites_Get", + "title": "Get network site" +} diff --git a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/SiteListByResourceGroup.json b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/SiteListByResourceGroup.json new file mode 100644 index 0000000000..a52ff55fad --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/SiteListByResourceGroup.json @@ -0,0 +1,40 @@ +{ + "parameters": { + "api-version": "2025-03-30", + "resourceGroupName": "rg1", + "subscriptionId": "subid" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "name": "testSite", + "type": "Microsoft.HybridNetwork/orchestrators/sites", + "id": "subscriptions/subid/resourceGroups/rg1/providers/Microsoft.HybridNetwork/sites/testSite", + "location": "westUs2", + "properties": { + "nfvis": [ + { + "name": "azureWestUs2", + "location": "westUs2", + "nfviType": "AzureCore" + } + ] + }, + "systemData": { + "createdAt": "2020-01-01T17:18:19.1234567Z", + "createdBy": "user1", + "createdByType": "User", + "lastModifiedAt": "2020-01-02T17:18:19.1234567Z", + "lastModifiedBy": "user2", + "lastModifiedByType": "User" + } + } + ] + } + } + }, + "operationId": "Sites_ListByResourceGroup", + "title": "List all network sites" +} diff --git a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/SiteListBySubscription.json b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/SiteListBySubscription.json new file mode 100644 index 0000000000..8e56d1317b --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/SiteListBySubscription.json @@ -0,0 +1,40 @@ +{ + "parameters": { + "api-version": "2025-03-30", + "subscriptionId": "subid" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "name": "testSite", + "type": "Microsoft.HybridNetwork/sites", + "id": "subscriptions/subid/resourceGroups/rg1/providers/Microsoft.HybridNetwork/sites/testSite", + "location": "westUs2", + "properties": { + "nfvis": [ + { + "name": "azureWestUs2", + "location": "westUs2", + "nfviType": "AzureCore" + } + ], + "provisioningState": "Accepted" + }, + "systemData": { + "createdAt": "2020-01-01T17:18:19.1234567Z", + "createdBy": "user1", + "createdByType": "User", + "lastModifiedAt": "2020-01-02T17:18:19.1234567Z", + "lastModifiedBy": "user2", + "lastModifiedByType": "User" + } + } + ] + } + } + }, + "operationId": "Sites_ListBySubscription", + "title": "List all hybrid network sites in a subscription." +} diff --git a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/SiteNetworkServiceCreate.json b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/SiteNetworkServiceCreate.json new file mode 100644 index 0000000000..70384bb1ab --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/SiteNetworkServiceCreate.json @@ -0,0 +1,112 @@ +{ + "parameters": { + "api-version": "2025-03-30", + "parameters": { + "location": "westUs2", + "properties": { + "desiredStateConfigurationGroupValueReferences": { + "MyVM_Configuration": { + "id": "/subscriptions/subid/resourcegroups/contosorg1/providers/microsoft.hybridnetwork/configurationgroupvalues/MyVM_Configuration1" + } + }, + "networkServiceDesignVersionResourceReference": { + "id": "/subscriptions/subid/resourcegroups/rg/providers/Microsoft.HybridNetwork/publishers/TestPublisher/networkServiceDesignGroups/TestNetworkServiceDesignGroupName/networkServiceDesignVersions/1.0.0", + "idType": "Open" + }, + "siteReference": { + "id": "/subscriptions/subid/resourcegroups/contosorg1/providers/microsoft.hybridnetwork/sites/testSite" + } + }, + "sku": { + "name": "Standard" + } + }, + "resourceGroupName": "rg1", + "siteNetworkServiceName": "testSiteNetworkServiceName", + "subscriptionId": "subid" + }, + "responses": { + "200": { + "body": { + "name": "testSiteNetworkServiceName", + "type": "Microsoft.HybridNetwork/siteNetworkServices", + "id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.HybridNetwork/siteNetworkServices/testSiteNetworkServiceName", + "location": "westUs2", + "properties": { + "desiredStateConfigurationGroupValueReferences": { + "MyVM_Configuration": { + "id": "/subscriptions/subid/resourcegroups/contosorg1/providers/microsoft.hybridnetwork/configurationgroupvalues/MyVM_Configuration1" + } + }, + "networkServiceDesignGroupName": "testNetworkServiceDesignGroupName", + "networkServiceDesignVersionName": "1.0.1", + "networkServiceDesignVersionOfferingLocation": "eastus", + "networkServiceDesignVersionResourceReference": { + "id": "/subscriptions/subid/resourcegroups/rg/providers/Microsoft.HybridNetwork/publishers/testPublisher/networkServiceDesignGroups/testNetworkServiceDesignGroupName/networkServiceDesignVersions/1.0.1", + "idType": "Open" + }, + "provisioningState": "Accepted", + "publisherName": "testPublisher", + "publisherScope": "Public", + "siteReference": { + "id": "/subscriptions/subid/resourcegroups/contosorg1/providers/microsoft.hybridnetwork/sites/testSite" + } + }, + "sku": { + "name": "Standard", + "tier": "Standard" + }, + "systemData": { + "createdAt": "2020-01-01T17:18:19.1234567Z", + "createdBy": "user1", + "createdByType": "User", + "lastModifiedAt": "2020-01-02T17:18:19.1234567Z", + "lastModifiedBy": "user2", + "lastModifiedByType": "User" + } + } + }, + "201": { + "body": { + "name": "testSiteNetworkServiceName", + "type": "Microsoft.HybridNetwork/siteNetworkServices", + "id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.HybridNetwork/siteNetworkServices/testSiteNetworkServiceName", + "location": "westUs2", + "properties": { + "desiredStateConfigurationGroupValueReferences": { + "MyVM_Configuration": { + "id": "/subscriptions/subid/resourcegroups/contosorg1/providers/microsoft.hybridnetwork/configurationgroupvalues/MyVM_Configuration1" + } + }, + "networkServiceDesignGroupName": "testNetworkServiceDesignGroupName", + "networkServiceDesignVersionName": "1.0.1", + "networkServiceDesignVersionOfferingLocation": "eastus", + "networkServiceDesignVersionResourceReference": { + "id": "/subscriptions/subid/resourcegroups/rg/providers/Microsoft.HybridNetwork/publishers/testPublisher/networkServiceDesignGroups/testNetworkServiceDesignGroupName/networkServiceDesignVersions/1.0.1", + "idType": "Open" + }, + "provisioningState": "Accepted", + "publisherName": "testPublisher", + "publisherScope": "Public", + "siteReference": { + "id": "/subscriptions/subid/resourcegroups/contosorg1/providers/microsoft.hybridnetwork/sites/testSite" + } + }, + "sku": { + "name": "Standard", + "tier": "Standard" + }, + "systemData": { + "createdAt": "2020-01-01T17:18:19.1234567Z", + "createdBy": "user1", + "createdByType": "User", + "lastModifiedAt": "2020-01-02T17:18:19.1234567Z", + "lastModifiedBy": "user2", + "lastModifiedByType": "User" + } + } + } + }, + "operationId": "SiteNetworkServices_CreateOrUpdate", + "title": "Create site network service" +} diff --git a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/SiteNetworkServiceDelete.json b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/SiteNetworkServiceDelete.json new file mode 100644 index 0000000000..e2713608da --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/SiteNetworkServiceDelete.json @@ -0,0 +1,18 @@ +{ + "parameters": { + "api-version": "2025-03-30", + "resourceGroupName": "rg1", + "siteNetworkServiceName": "testSiteNetworkServiceName", + "subscriptionId": "subid" + }, + "responses": { + "202": { + "headers": { + "location": "https://management.azure.com/providers/microsoft.hybridnetwork/locations/EASTUS2EUAP/operationStatuses/0b37c625-7e7c-49c5-b86e-c817c85acb5d*B77A34159CA34A0BD446D3BC7EC120649181590DDF991982765DAC1A87491B2D?api-version=2021-05-01" + } + }, + "204": {} + }, + "operationId": "SiteNetworkServices_Delete", + "title": "Delete network site" +} diff --git a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/SiteNetworkServiceFirstPartyCreate.json b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/SiteNetworkServiceFirstPartyCreate.json new file mode 100644 index 0000000000..af4208538b --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/SiteNetworkServiceFirstPartyCreate.json @@ -0,0 +1,110 @@ +{ + "parameters": { + "api-version": "2025-03-30", + "parameters": { + "location": "westUs2", + "properties": { + "desiredStateConfigurationGroupValueReferences": { + "MyVM_Configuration": { + "id": "/subscriptions/subid/resourcegroups/contosorg1/providers/microsoft.hybridnetwork/configurationgroupvalues/MyVM_Configuration1" + } + }, + "networkServiceDesignVersionResourceReference": { + "id": "/subscriptions/subid/resourcegroups/rg/providers/Microsoft.HybridNetwork/publishers/TestPublisher/networkServiceDesignGroups/TestNetworkServiceDesignGroupName/networkServiceDesignVersions/1.0.0", + "idType": "Secret" + }, + "siteReference": { + "id": "/subscriptions/subid/resourcegroups/contosorg1/providers/microsoft.hybridnetwork/sites/testSite" + } + }, + "sku": { + "name": "Standard" + } + }, + "resourceGroupName": "rg1", + "siteNetworkServiceName": "testSiteNetworkServiceName", + "subscriptionId": "subid" + }, + "responses": { + "200": { + "body": { + "name": "testSiteNetworkServiceName", + "type": "Microsoft.HybridNetwork/siteNetworkServices", + "id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.HybridNetwork/siteNetworkServices/testSiteNetworkServiceName", + "location": "westUs2", + "properties": { + "desiredStateConfigurationGroupValueReferences": { + "MyVM_Configuration": { + "id": "/subscriptions/subid/resourcegroups/contosorg1/providers/microsoft.hybridnetwork/configurationgroupvalues/MyVM_Configuration1" + } + }, + "networkServiceDesignGroupName": "testNetworkServiceDesignGroupName", + "networkServiceDesignVersionName": "1.0.1", + "networkServiceDesignVersionOfferingLocation": "eastus", + "networkServiceDesignVersionResourceReference": { + "idType": "Secret" + }, + "provisioningState": "Accepted", + "publisherName": "testPublisher", + "publisherScope": "Public", + "siteReference": { + "id": "/subscriptions/subid/resourcegroups/contosorg1/providers/microsoft.hybridnetwork/sites/testSite" + } + }, + "sku": { + "name": "Standard", + "tier": "Standard" + }, + "systemData": { + "createdAt": "2020-01-01T17:18:19.1234567Z", + "createdBy": "user1", + "createdByType": "User", + "lastModifiedAt": "2020-01-02T17:18:19.1234567Z", + "lastModifiedBy": "user2", + "lastModifiedByType": "User" + } + } + }, + "201": { + "body": { + "name": "testSiteNetworkServiceName", + "type": "Microsoft.HybridNetwork/siteNetworkServices", + "id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.HybridNetwork/siteNetworkServices/testSiteNetworkServiceName", + "location": "westUs2", + "properties": { + "desiredStateConfigurationGroupValueReferences": { + "MyVM_Configuration": { + "id": "/subscriptions/subid/resourcegroups/contosorg1/providers/microsoft.hybridnetwork/configurationgroupvalues/MyVM_Configuration1" + } + }, + "networkServiceDesignGroupName": "testNetworkServiceDesignGroupName", + "networkServiceDesignVersionName": "1.0.1", + "networkServiceDesignVersionOfferingLocation": "eastus", + "networkServiceDesignVersionResourceReference": { + "idType": "Secret" + }, + "provisioningState": "Accepted", + "publisherName": "testPublisher", + "publisherScope": "Public", + "siteReference": { + "id": "/subscriptions/subid/resourcegroups/contosorg1/providers/microsoft.hybridnetwork/sites/testSite" + } + }, + "sku": { + "name": "Standard", + "tier": "Standard" + }, + "systemData": { + "createdAt": "2020-01-01T17:18:19.1234567Z", + "createdBy": "user1", + "createdByType": "User", + "lastModifiedAt": "2020-01-02T17:18:19.1234567Z", + "lastModifiedBy": "user2", + "lastModifiedByType": "User" + } + } + } + }, + "operationId": "SiteNetworkServices_CreateOrUpdate", + "title": "Create first party site network service" +} diff --git a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/SiteNetworkServiceGet.json b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/SiteNetworkServiceGet.json new file mode 100644 index 0000000000..e697dba324 --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/SiteNetworkServiceGet.json @@ -0,0 +1,52 @@ +{ + "parameters": { + "api-version": "2025-03-30", + "resourceGroupName": "rg1", + "siteNetworkServiceName": "testSiteNetworkServiceName", + "subscriptionId": "subid" + }, + "responses": { + "200": { + "body": { + "name": "testSiteNetworkServiceName", + "type": "Microsoft.HybridNetwork/siteNetworkServices", + "id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.HybridNetwork/siteNetworkServices/testSiteNetworkServiceName", + "location": "westUs2", + "properties": { + "desiredStateConfigurationGroupValueReferences": { + "MyVM_Configuration": { + "id": "/subscriptions/subid/resourcegroups/contosorg1/providers/microsoft.hybridnetwork/configurationgroupvalues/MyVM_Configuration1" + } + }, + "networkServiceDesignGroupName": "testNetworkServiceDesignGroupName", + "networkServiceDesignVersionName": "1.0.1", + "networkServiceDesignVersionOfferingLocation": "eastus", + "networkServiceDesignVersionResourceReference": { + "id": "/subscriptions/subid/resourcegroups/rg/providers/Microsoft.HybridNetwork/publishers/testPublisher/networkServiceDesignGroups/testNetworkServiceDesignGroupName/networkServiceDesignVersions/1.0.1", + "idType": "Open" + }, + "provisioningState": "Accepted", + "publisherName": "testPublisher", + "publisherScope": "Public", + "siteReference": { + "id": "/subscriptions/subid/resourcegroups/contosorg1/providers/microsoft.hybridnetwork/sites/testSite" + } + }, + "sku": { + "name": "Standard", + "tier": "Standard" + }, + "systemData": { + "createdAt": "2020-01-01T17:18:19.1234567Z", + "createdBy": "user1", + "createdByType": "User", + "lastModifiedAt": "2020-01-02T17:18:19.1234567Z", + "lastModifiedBy": "user2", + "lastModifiedByType": "User" + } + } + } + }, + "operationId": "SiteNetworkServices_Get", + "title": "Get network site" +} diff --git a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/SiteNetworkServiceListByResourceGroup.json b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/SiteNetworkServiceListByResourceGroup.json new file mode 100644 index 0000000000..ad94f7dba2 --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/SiteNetworkServiceListByResourceGroup.json @@ -0,0 +1,55 @@ +{ + "parameters": { + "api-version": "2025-03-30", + "resourceGroupName": "rg1", + "subscriptionId": "subid" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "name": "testSiteNetworkServiceName", + "type": "Microsoft.HybridNetwork/siteNetworkServices", + "id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.HybridNetwork/siteNetworkServices/testSiteNetworkServiceName", + "location": "westUs2", + "properties": { + "desiredStateConfigurationGroupValueReferences": { + "MyVM_Configuration": { + "id": "/subscriptions/subid/resourcegroups/contosorg1/providers/microsoft.hybridnetwork/configurationgroupvalues/MyVM_Configuration1" + } + }, + "networkServiceDesignGroupName": "testNetworkServiceDesignGroupName", + "networkServiceDesignVersionName": "1.0.1", + "networkServiceDesignVersionOfferingLocation": "eastus", + "networkServiceDesignVersionResourceReference": { + "id": "/subscriptions/subid/resourcegroups/rg/providers/Microsoft.HybridNetwork/publishers/testPublisher/networkServiceDesignGroups/testNetworkServiceDesignGroupName/networkServiceDesignVersions/1.0.1", + "idType": "Open" + }, + "provisioningState": "Accepted", + "publisherName": "testPublisher", + "publisherScope": "Public", + "siteReference": { + "id": "/subscriptions/subid/resourcegroups/contosorg1/providers/microsoft.hybridnetwork/sites/testSite" + } + }, + "sku": { + "name": "Standard", + "tier": "Standard" + }, + "systemData": { + "createdAt": "2020-01-01T17:18:19.1234567Z", + "createdBy": "user1", + "createdByType": "User", + "lastModifiedAt": "2020-01-02T17:18:19.1234567Z", + "lastModifiedBy": "user2", + "lastModifiedByType": "User" + } + } + ] + } + } + }, + "operationId": "SiteNetworkServices_ListByResourceGroup", + "title": "List all network sites" +} diff --git a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/SiteNetworkServiceListBySubscription.json b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/SiteNetworkServiceListBySubscription.json new file mode 100644 index 0000000000..09518741fc --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/SiteNetworkServiceListBySubscription.json @@ -0,0 +1,54 @@ +{ + "parameters": { + "api-version": "2025-03-30", + "subscriptionId": "subid" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "name": "testSiteNetworkServiceName", + "type": "Microsoft.HybridNetwork/siteNetworkServices", + "id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.HybridNetwork/siteNetworkServices/testSiteNetworkServiceName", + "location": "westUs2", + "properties": { + "desiredStateConfigurationGroupValueReferences": { + "MyVM_Configuration": { + "id": "/subscriptions/subid/resourcegroups/contosorg1/providers/microsoft.hybridnetwork/configurationgroupvalues/MyVM_Configuration1" + } + }, + "networkServiceDesignGroupName": "testNetworkServiceDesignGroupName", + "networkServiceDesignVersionName": "1.0.1", + "networkServiceDesignVersionOfferingLocation": "eastus", + "networkServiceDesignVersionResourceReference": { + "id": "/subscriptions/subid/resourcegroups/rg/providers/Microsoft.HybridNetwork/publishers/testPublisher/networkServiceDesignGroups/testNetworkServiceDesignGroupName/networkServiceDesignVersions/1.0.1", + "idType": "Open" + }, + "provisioningState": "Accepted", + "publisherName": "testPublisher", + "publisherScope": "Public", + "siteReference": { + "id": "/subscriptions/subid/resourcegroups/contosorg1/providers/microsoft.hybridnetwork/sites/testSite" + } + }, + "sku": { + "name": "Standard", + "tier": "Standard" + }, + "systemData": { + "createdAt": "2020-01-01T17:18:19.1234567Z", + "createdBy": "user1", + "createdByType": "User", + "lastModifiedAt": "2020-01-02T17:18:19.1234567Z", + "lastModifiedBy": "user2", + "lastModifiedByType": "User" + } + } + ] + } + } + }, + "operationId": "SiteNetworkServices_ListBySubscription", + "title": "List all hybrid network sites in a subscription." +} diff --git a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/SiteNetworkServiceUpdateTags.json b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/SiteNetworkServiceUpdateTags.json new file mode 100644 index 0000000000..21b5eedc74 --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/SiteNetworkServiceUpdateTags.json @@ -0,0 +1,63 @@ +{ + "parameters": { + "api-version": "2025-03-30", + "parameters": { + "tags": { + "tag1": "value1", + "tag2": "value2" + } + }, + "resourceGroupName": "rg1", + "siteName": "testSite", + "siteNetworkServiceName": "testSiteNetworkServiceName", + "subscriptionId": "subid" + }, + "responses": { + "200": { + "body": { + "name": "testSiteNetworkServiceName", + "type": "Microsoft.HybridNetwork/siteNetworkServices", + "id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.HybridNetwork/siteNetworkServices/testSiteNetworkServiceName", + "location": "westUs2", + "properties": { + "desiredStateConfigurationGroupValueReferences": { + "MyVM_Configuration": { + "id": "/subscriptions/subid/resourcegroups/contosorg1/providers/microsoft.hybridnetwork/configurationgroupvalues/MyVM_Configuration1" + } + }, + "networkServiceDesignGroupName": "testNetworkServiceDesignGroupName", + "networkServiceDesignVersionName": "1.0.1", + "networkServiceDesignVersionOfferingLocation": "eastus", + "networkServiceDesignVersionResourceReference": { + "id": "/subscriptions/subid/resourcegroups/rg/providers/Microsoft.HybridNetwork/publishers/testPublisher/networkServiceDesignGroups/testNetworkServiceDesignGroupName/networkServiceDesignVersions/1.0.1", + "idType": "Open" + }, + "provisioningState": "Accepted", + "publisherName": "testPublisher", + "publisherScope": "Public", + "siteReference": { + "id": "/subscriptions/subid/resourcegroups/contosorg1/providers/microsoft.hybridnetwork/sites/testSite" + } + }, + "sku": { + "name": "Standard", + "tier": "Standard" + }, + "systemData": { + "createdAt": "2020-01-01T17:18:19.1234567Z", + "createdBy": "user1", + "createdByType": "User", + "lastModifiedAt": "2020-01-02T17:18:19.1234567Z", + "lastModifiedBy": "user2", + "lastModifiedByType": "User" + }, + "tags": { + "tag1": "value1", + "tag2": "value2" + } + } + } + }, + "operationId": "SiteNetworkServices_UpdateTags", + "title": "Update network site tags" +} diff --git a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/SiteNetworkServicesCancelOngoingPUTOperation.json b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/SiteNetworkServicesCancelOngoingPUTOperation.json new file mode 100644 index 0000000000..6921a5c74a --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/SiteNetworkServicesCancelOngoingPUTOperation.json @@ -0,0 +1,21 @@ +{ + "parameters": { + "api-version": "2025-03-30", + "parameters": { + "longRunningOperation": "Put", + "siteNetworkServiceReference": { + "id": "/subscriptions/sub1/resourceGroups/rg/providers/Microsoft.HybridNetwork/siteNetworkServices/TestSNS1" + } + }, + "subscriptionId": "sub1" + }, + "responses": { + "202": { + "headers": { + "Location": "https://management.azure.com/providers/microsoft.hybridnetwork/locations/EASTUS2EUAP/operationStatuses/0b37c625-7e7c-49c5-b86e-c817c85acb5d*B77A34159CA34A0BD446D3BC7EC120649181590DDF991982765DAC1A87491B2D?api-version=2021-05-01" + } + } + }, + "operationId": "SiteNetworkServices_CancelOperation", + "title": "Cancel an in progress SNS PUT " +} diff --git a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/SiteUpdateTags.json b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/SiteUpdateTags.json new file mode 100644 index 0000000000..d9a5d6e5e3 --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/SiteUpdateTags.json @@ -0,0 +1,48 @@ +{ + "parameters": { + "api-version": "2025-03-30", + "parameters": { + "tags": { + "tag1": "value1", + "tag2": "value2" + } + }, + "resourceGroupName": "rg1", + "siteName": "testSite", + "subscriptionId": "subid" + }, + "responses": { + "200": { + "body": { + "name": "testSite", + "type": "Microsoft.HybridNetwork/sites", + "id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.HybridNetwork/sites/testSite", + "location": "westUs2", + "properties": { + "nfvis": [ + { + "name": "azureWestUs2", + "location": "westUs2", + "nfviType": "AzureCore" + } + ], + "provisioningState": "Accepted" + }, + "systemData": { + "createdAt": "2020-01-01T17:18:19.1234567Z", + "createdBy": "user1", + "createdByType": "User", + "lastModifiedAt": "2020-01-02T17:18:19.1234567Z", + "lastModifiedBy": "user2", + "lastModifiedByType": "User" + }, + "tags": { + "tag1": "value1", + "tag2": "value2" + } + } + } + }, + "operationId": "Sites_UpdateTags", + "title": "Update network site tags" +} diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/LICENSE b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/LICENSE new file mode 100644 index 0000000000..63447fd8bb --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/LICENSE @@ -0,0 +1,21 @@ +Copyright (c) Microsoft Corporation. + +MIT License + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/README.md b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/README.md new file mode 100644 index 0000000000..65fb342964 --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/README.md @@ -0,0 +1,111 @@ +# Azure HybridNetworkManagement client library for JavaScript + +This package contains an isomorphic SDK (runs both in Node.js and in browsers) for Azure HybridNetworkManagement client. + + + +Key links: + +- [Package (NPM)](https://www.npmjs.com/package/@azure/arm-hybridnetwork) +- [API reference documentation](https://learn.microsoft.com/javascript/api/@azure/arm-hybridnetwork) + +## Getting started + +### Currently supported environments + +- [LTS versions of Node.js](https://github.com/nodejs/release#release-schedule) +- Latest versions of Safari, Chrome, Edge and Firefox. + +See our [support policy](https://github.com/Azure/azure-sdk-for-js/blob/main/SUPPORT.md) for more details. + +### Prerequisites + +- An [Azure subscription][azure_sub]. + +### Install the `@azure/arm-hybridnetwork` package + +Install the Azure HybridNetworkManagement client library for JavaScript with `npm`: + +```bash +npm install @azure/arm-hybridnetwork +``` + +### Create and authenticate a `HybridNetworkManagementClient` + +To create a client object to access the Azure HybridNetworkManagement API, you will need the `endpoint` of your Azure HybridNetworkManagement resource and a `credential`. The Azure HybridNetworkManagement client can use Azure Active Directory credentials to authenticate. +You can find the endpoint for your Azure HybridNetworkManagement resource in the [Azure Portal][azure_portal]. + +You can authenticate with Azure Active Directory using a credential from the [@azure/identity][azure_identity] library or [an existing AAD Token](https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/identity/identity/samples/AzureIdentityExamples.md#authenticating-with-a-pre-fetched-access-token). + +To use the [DefaultAzureCredential][defaultazurecredential] provider shown below, or other credential providers provided with the Azure SDK, please install the `@azure/identity` package: + +```bash +npm install @azure/identity +``` + +You will also need to **register a new AAD application and grant access to Azure HybridNetworkManagement** by assigning the suitable role to your service principal (note: roles such as `"Owner"` will not grant the necessary permissions). + +For more information about how to create an Azure AD Application check out [this guide](https://learn.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal). + +Using Node.js and Node-like environments, you can use the `DefaultAzureCredential` class to authenticate the client. + +```ts +import { HybridNetworkManagementClient } from "@azure/arm-hybridnetwork"; +import { DefaultAzureCredential } from "@azure/identity"; + +const subscriptionId = "00000000-0000-0000-0000-000000000000"; +const client = new HybridNetworkManagementClient(new DefaultAzureCredential(), subscriptionId); +``` + +For browser environments, use the `InteractiveBrowserCredential` from the `@azure/identity` package to authenticate. + +```ts +import { InteractiveBrowserCredential } from "@azure/identity"; +import { HybridNetworkManagementClient } from "@azure/arm-hybridnetwork"; + +const credential = new InteractiveBrowserCredential({ + tenantId: "", + clientId: "", + }); + +const subscriptionId = "00000000-0000-0000-0000-000000000000"; +const client = new HybridNetworkManagementClient(credential, subscriptionId); +``` + + +### JavaScript Bundle +To use this client library in the browser, first you need to use a bundler. For details on how to do this, please refer to our [bundling documentation](https://aka.ms/AzureSDKBundling). + +## Key concepts + +### HybridNetworkManagementClient + +`HybridNetworkManagementClient` is the primary interface for developers using the Azure HybridNetworkManagement client library. Explore the methods on this client object to understand the different features of the Azure HybridNetworkManagement service that you can access. + +## Troubleshooting + +### Logging + +Enabling logging may help uncover useful information about failures. In order to see a log of HTTP requests and responses, set the `AZURE_LOG_LEVEL` environment variable to `info`. Alternatively, logging can be enabled at runtime by calling `setLogLevel` in the `@azure/logger`: + +```ts +import { setLogLevel } from "@azure/logger"; + +setLogLevel("info"); +``` + +For more detailed instructions on how to enable logs, you can look at the [@azure/logger package docs](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/core/logger). + + +## Contributing + +If you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/main/CONTRIBUTING.md) to learn more about how to build and test the code. + +## Related projects + +- [Microsoft Azure SDK for JavaScript](https://github.com/Azure/azure-sdk-for-js) + +[azure_sub]: https://azure.microsoft.com/free/ +[azure_portal]: https://portal.azure.com +[azure_identity]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/identity/identity +[defaultazurecredential]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/identity/identity#defaultazurecredential diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/api-extractor.json b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/api-extractor.json new file mode 100644 index 0000000000..3afe3892e7 --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/api-extractor.json @@ -0,0 +1,18 @@ +{ + "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", + "mainEntryPointFilePath": "dist/esm/index.d.ts", + "docModel": { "enabled": true }, + "apiReport": { "enabled": true, "reportFolder": "./review" }, + "dtsRollup": { + "enabled": true, + "untrimmedFilePath": "", + "publicTrimmedFilePath": "dist/arm-hybridnetwork.d.ts" + }, + "messages": { + "tsdocMessageReporting": { "default": { "logLevel": "none" } }, + "extractorMessageReporting": { + "ae-missing-release-tag": { "logLevel": "none" }, + "ae-unresolved-link": { "logLevel": "none" } + } + } +} diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/eslint.config.mjs b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/eslint.config.mjs new file mode 100644 index 0000000000..9396819633 --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/eslint.config.mjs @@ -0,0 +1,14 @@ +import azsdkEslint from "@azure/eslint-plugin-azure-sdk"; + +export default azsdkEslint.config([ + { + rules: { + "@azure/azure-sdk/ts-modules-only-named": "warn", + "@azure/azure-sdk/ts-package-json-types": "warn", + "@azure/azure-sdk/ts-package-json-engine-is-present": "warn", + "@azure/azure-sdk/ts-package-json-files-required": "off", + "@azure/azure-sdk/ts-package-json-main-is-cjs": "off", + "tsdoc/syntax": "warn" + } + } +]); diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/package.json b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/package.json new file mode 100644 index 0000000000..e0df3dfc96 --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/package.json @@ -0,0 +1,401 @@ +{ + "name": "@azure/arm-hybridnetwork", + "version": "1.0.0-beta.1", + "description": "A generated SDK for HybridNetworkManagementClient.", + "engines": { + "node": ">=20.0.0" + }, + "sideEffects": false, + "autoPublish": false, + "tshy": { + "exports": { + "./package.json": "./package.json", + ".": "./src/index.ts", + "./api": "./src/api/index.ts", + "./api/siteNetworkServices": "src/api/siteNetworkServices/index.ts", + "./api/sites": "src/api/sites/index.ts", + "./api/artifactManifests": "src/api/artifactManifests/index.ts", + "./api/proxyArtifact": "src/api/proxyArtifact/index.ts", + "./api/artifactStores": "src/api/artifactStores/index.ts", + "./api/networkServiceDesignVersions": "src/api/networkServiceDesignVersions/index.ts", + "./api/networkServiceDesignGroups": "src/api/networkServiceDesignGroups/index.ts", + "./api/networkFunctionDefinitionVersions": "src/api/networkFunctionDefinitionVersions/index.ts", + "./api/networkFunctionDefinitionGroups": "src/api/networkFunctionDefinitionGroups/index.ts", + "./api/components": "src/api/components/index.ts", + "./api/networkFunctions": "src/api/networkFunctions/index.ts", + "./api/configurationGroupValues": "src/api/configurationGroupValues/index.ts", + "./api/publishers": "src/api/publishers/index.ts", + "./api/configurationGroupSchemas": "src/api/configurationGroupSchemas/index.ts", + "./api/operations": "src/api/operations/index.ts", + "./models": "./src/models/index.ts" + }, + "dialects": ["esm", "commonjs"], + "esmDialects": ["browser", "react-native"], + "selfLink": false + }, + "type": "module", + "browser": "./dist/browser/index.js", + "react-native": "./dist/react-native/index.js", + "keywords": ["node", "azure", "cloud", "typescript", "browser", "isomorphic"], + "author": "Microsoft Corporation", + "license": "MIT", + "files": ["dist/", "!dist/**/*.d.*ts.map", "README.md", "LICENSE"], + "dependencies": { + "@azure/core-util": "^1.9.2", + "@azure-rest/core-client": "^2.3.1", + "@azure/core-auth": "^1.6.0", + "@azure/core-rest-pipeline": "^1.5.0", + "@azure/logger": "^1.0.0", + "tslib": "^2.6.2", + "@azure/core-lro": "^3.1.0", + "@azure/abort-controller": "^2.1.2" + }, + "devDependencies": { + "dotenv": "^16.0.0", + "@types/node": "^20.0.0", + "eslint": "^9.9.0", + "typescript": "~5.8.2", + "tshy": "^2.0.0", + "@microsoft/api-extractor": "^7.40.3", + "rimraf": "^5.0.5", + "mkdirp": "^3.0.1" + }, + "scripts": { + "clean": "rimraf --glob dist dist-browser dist-esm test-dist temp types *.tgz *.log", + "extract-api": "rimraf review && mkdirp ./review && api-extractor run --local", + "pack": "npm pack 2>&1", + "lint": "eslint package.json api-extractor.json src", + "lint:fix": "eslint package.json api-extractor.json src --fix --fix-type [problem,suggestion]", + "build": "npm run clean && tshy && npm run extract-api" + }, + "exports": { + "./package.json": "./package.json", + ".": { + "browser": { + "types": "./dist/browser/index.d.ts", + "default": "./dist/browser/index.js" + }, + "react-native": { + "types": "./dist/react-native/index.d.ts", + "default": "./dist/react-native/index.js" + }, + "import": { + "types": "./dist/esm/index.d.ts", + "default": "./dist/esm/index.js" + }, + "require": { + "types": "./dist/commonjs/index.d.ts", + "default": "./dist/commonjs/index.js" + } + }, + "./api": { + "browser": { + "types": "./dist/browser/api/index.d.ts", + "default": "./dist/browser/api/index.js" + }, + "react-native": { + "types": "./dist/react-native/api/index.d.ts", + "default": "./dist/react-native/api/index.js" + }, + "import": { + "types": "./dist/esm/api/index.d.ts", + "default": "./dist/esm/api/index.js" + }, + "require": { + "types": "./dist/commonjs/api/index.d.ts", + "default": "./dist/commonjs/api/index.js" + } + }, + "./api/siteNetworkServices": { + "browser": { + "types": "./dist/browser/api/siteNetworkServices/index.d.ts", + "default": "./dist/browser/api/siteNetworkServices/index.js" + }, + "react-native": { + "types": "./dist/react-native/api/siteNetworkServices/index.d.ts", + "default": "./dist/react-native/api/siteNetworkServices/index.js" + }, + "import": { + "types": "./dist/esm/api/siteNetworkServices/index.d.ts", + "default": "./dist/esm/api/siteNetworkServices/index.js" + }, + "require": { + "types": "./dist/commonjs/api/siteNetworkServices/index.d.ts", + "default": "./dist/commonjs/api/siteNetworkServices/index.js" + } + }, + "./api/sites": { + "browser": { + "types": "./dist/browser/api/sites/index.d.ts", + "default": "./dist/browser/api/sites/index.js" + }, + "react-native": { + "types": "./dist/react-native/api/sites/index.d.ts", + "default": "./dist/react-native/api/sites/index.js" + }, + "import": { + "types": "./dist/esm/api/sites/index.d.ts", + "default": "./dist/esm/api/sites/index.js" + }, + "require": { + "types": "./dist/commonjs/api/sites/index.d.ts", + "default": "./dist/commonjs/api/sites/index.js" + } + }, + "./api/artifactManifests": { + "browser": { + "types": "./dist/browser/api/artifactManifests/index.d.ts", + "default": "./dist/browser/api/artifactManifests/index.js" + }, + "react-native": { + "types": "./dist/react-native/api/artifactManifests/index.d.ts", + "default": "./dist/react-native/api/artifactManifests/index.js" + }, + "import": { + "types": "./dist/esm/api/artifactManifests/index.d.ts", + "default": "./dist/esm/api/artifactManifests/index.js" + }, + "require": { + "types": "./dist/commonjs/api/artifactManifests/index.d.ts", + "default": "./dist/commonjs/api/artifactManifests/index.js" + } + }, + "./api/proxyArtifact": { + "browser": { + "types": "./dist/browser/api/proxyArtifact/index.d.ts", + "default": "./dist/browser/api/proxyArtifact/index.js" + }, + "react-native": { + "types": "./dist/react-native/api/proxyArtifact/index.d.ts", + "default": "./dist/react-native/api/proxyArtifact/index.js" + }, + "import": { + "types": "./dist/esm/api/proxyArtifact/index.d.ts", + "default": "./dist/esm/api/proxyArtifact/index.js" + }, + "require": { + "types": "./dist/commonjs/api/proxyArtifact/index.d.ts", + "default": "./dist/commonjs/api/proxyArtifact/index.js" + } + }, + "./api/artifactStores": { + "browser": { + "types": "./dist/browser/api/artifactStores/index.d.ts", + "default": "./dist/browser/api/artifactStores/index.js" + }, + "react-native": { + "types": "./dist/react-native/api/artifactStores/index.d.ts", + "default": "./dist/react-native/api/artifactStores/index.js" + }, + "import": { + "types": "./dist/esm/api/artifactStores/index.d.ts", + "default": "./dist/esm/api/artifactStores/index.js" + }, + "require": { + "types": "./dist/commonjs/api/artifactStores/index.d.ts", + "default": "./dist/commonjs/api/artifactStores/index.js" + } + }, + "./api/networkServiceDesignVersions": { + "browser": { + "types": "./dist/browser/api/networkServiceDesignVersions/index.d.ts", + "default": "./dist/browser/api/networkServiceDesignVersions/index.js" + }, + "react-native": { + "types": "./dist/react-native/api/networkServiceDesignVersions/index.d.ts", + "default": "./dist/react-native/api/networkServiceDesignVersions/index.js" + }, + "import": { + "types": "./dist/esm/api/networkServiceDesignVersions/index.d.ts", + "default": "./dist/esm/api/networkServiceDesignVersions/index.js" + }, + "require": { + "types": "./dist/commonjs/api/networkServiceDesignVersions/index.d.ts", + "default": "./dist/commonjs/api/networkServiceDesignVersions/index.js" + } + }, + "./api/networkServiceDesignGroups": { + "browser": { + "types": "./dist/browser/api/networkServiceDesignGroups/index.d.ts", + "default": "./dist/browser/api/networkServiceDesignGroups/index.js" + }, + "react-native": { + "types": "./dist/react-native/api/networkServiceDesignGroups/index.d.ts", + "default": "./dist/react-native/api/networkServiceDesignGroups/index.js" + }, + "import": { + "types": "./dist/esm/api/networkServiceDesignGroups/index.d.ts", + "default": "./dist/esm/api/networkServiceDesignGroups/index.js" + }, + "require": { + "types": "./dist/commonjs/api/networkServiceDesignGroups/index.d.ts", + "default": "./dist/commonjs/api/networkServiceDesignGroups/index.js" + } + }, + "./api/networkFunctionDefinitionVersions": { + "browser": { + "types": "./dist/browser/api/networkFunctionDefinitionVersions/index.d.ts", + "default": "./dist/browser/api/networkFunctionDefinitionVersions/index.js" + }, + "react-native": { + "types": "./dist/react-native/api/networkFunctionDefinitionVersions/index.d.ts", + "default": "./dist/react-native/api/networkFunctionDefinitionVersions/index.js" + }, + "import": { + "types": "./dist/esm/api/networkFunctionDefinitionVersions/index.d.ts", + "default": "./dist/esm/api/networkFunctionDefinitionVersions/index.js" + }, + "require": { + "types": "./dist/commonjs/api/networkFunctionDefinitionVersions/index.d.ts", + "default": "./dist/commonjs/api/networkFunctionDefinitionVersions/index.js" + } + }, + "./api/networkFunctionDefinitionGroups": { + "browser": { + "types": "./dist/browser/api/networkFunctionDefinitionGroups/index.d.ts", + "default": "./dist/browser/api/networkFunctionDefinitionGroups/index.js" + }, + "react-native": { + "types": "./dist/react-native/api/networkFunctionDefinitionGroups/index.d.ts", + "default": "./dist/react-native/api/networkFunctionDefinitionGroups/index.js" + }, + "import": { + "types": "./dist/esm/api/networkFunctionDefinitionGroups/index.d.ts", + "default": "./dist/esm/api/networkFunctionDefinitionGroups/index.js" + }, + "require": { + "types": "./dist/commonjs/api/networkFunctionDefinitionGroups/index.d.ts", + "default": "./dist/commonjs/api/networkFunctionDefinitionGroups/index.js" + } + }, + "./api/components": { + "browser": { + "types": "./dist/browser/api/components/index.d.ts", + "default": "./dist/browser/api/components/index.js" + }, + "react-native": { + "types": "./dist/react-native/api/components/index.d.ts", + "default": "./dist/react-native/api/components/index.js" + }, + "import": { + "types": "./dist/esm/api/components/index.d.ts", + "default": "./dist/esm/api/components/index.js" + }, + "require": { + "types": "./dist/commonjs/api/components/index.d.ts", + "default": "./dist/commonjs/api/components/index.js" + } + }, + "./api/networkFunctions": { + "browser": { + "types": "./dist/browser/api/networkFunctions/index.d.ts", + "default": "./dist/browser/api/networkFunctions/index.js" + }, + "react-native": { + "types": "./dist/react-native/api/networkFunctions/index.d.ts", + "default": "./dist/react-native/api/networkFunctions/index.js" + }, + "import": { + "types": "./dist/esm/api/networkFunctions/index.d.ts", + "default": "./dist/esm/api/networkFunctions/index.js" + }, + "require": { + "types": "./dist/commonjs/api/networkFunctions/index.d.ts", + "default": "./dist/commonjs/api/networkFunctions/index.js" + } + }, + "./api/configurationGroupValues": { + "browser": { + "types": "./dist/browser/api/configurationGroupValues/index.d.ts", + "default": "./dist/browser/api/configurationGroupValues/index.js" + }, + "react-native": { + "types": "./dist/react-native/api/configurationGroupValues/index.d.ts", + "default": "./dist/react-native/api/configurationGroupValues/index.js" + }, + "import": { + "types": "./dist/esm/api/configurationGroupValues/index.d.ts", + "default": "./dist/esm/api/configurationGroupValues/index.js" + }, + "require": { + "types": "./dist/commonjs/api/configurationGroupValues/index.d.ts", + "default": "./dist/commonjs/api/configurationGroupValues/index.js" + } + }, + "./api/publishers": { + "browser": { + "types": "./dist/browser/api/publishers/index.d.ts", + "default": "./dist/browser/api/publishers/index.js" + }, + "react-native": { + "types": "./dist/react-native/api/publishers/index.d.ts", + "default": "./dist/react-native/api/publishers/index.js" + }, + "import": { + "types": "./dist/esm/api/publishers/index.d.ts", + "default": "./dist/esm/api/publishers/index.js" + }, + "require": { + "types": "./dist/commonjs/api/publishers/index.d.ts", + "default": "./dist/commonjs/api/publishers/index.js" + } + }, + "./api/configurationGroupSchemas": { + "browser": { + "types": "./dist/browser/api/configurationGroupSchemas/index.d.ts", + "default": "./dist/browser/api/configurationGroupSchemas/index.js" + }, + "react-native": { + "types": "./dist/react-native/api/configurationGroupSchemas/index.d.ts", + "default": "./dist/react-native/api/configurationGroupSchemas/index.js" + }, + "import": { + "types": "./dist/esm/api/configurationGroupSchemas/index.d.ts", + "default": "./dist/esm/api/configurationGroupSchemas/index.js" + }, + "require": { + "types": "./dist/commonjs/api/configurationGroupSchemas/index.d.ts", + "default": "./dist/commonjs/api/configurationGroupSchemas/index.js" + } + }, + "./api/operations": { + "browser": { + "types": "./dist/browser/api/operations/index.d.ts", + "default": "./dist/browser/api/operations/index.js" + }, + "react-native": { + "types": "./dist/react-native/api/operations/index.d.ts", + "default": "./dist/react-native/api/operations/index.js" + }, + "import": { + "types": "./dist/esm/api/operations/index.d.ts", + "default": "./dist/esm/api/operations/index.js" + }, + "require": { + "types": "./dist/commonjs/api/operations/index.d.ts", + "default": "./dist/commonjs/api/operations/index.js" + } + }, + "./models": { + "browser": { + "types": "./dist/browser/models/index.d.ts", + "default": "./dist/browser/models/index.js" + }, + "react-native": { + "types": "./dist/react-native/models/index.d.ts", + "default": "./dist/react-native/models/index.js" + }, + "import": { + "types": "./dist/esm/models/index.d.ts", + "default": "./dist/esm/models/index.js" + }, + "require": { + "types": "./dist/commonjs/models/index.d.ts", + "default": "./dist/commonjs/models/index.js" + } + } + }, + "main": "./dist/commonjs/index.js", + "types": "./dist/commonjs/index.d.ts", + "module": "./dist/esm/index.js" +} diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/review/arm-hybridnetwork.api.md b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/review/arm-hybridnetwork.api.md new file mode 100644 index 0000000000..f7b9c7b4d5 --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/review/arm-hybridnetwork.api.md @@ -0,0 +1,1992 @@ +## API Report File for "@azure/arm-hybridnetwork" + +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). + +```ts + +import { AbortSignalLike } from '@azure/abort-controller'; +import { CancelOnProgress } from '@azure/core-lro'; +import { ClientOptions } from '@azure-rest/core-client'; +import { OperationOptions } from '@azure-rest/core-client'; +import { OperationState } from '@azure/core-lro'; +import { PathUncheckedResponse } from '@azure-rest/core-client'; +import { Pipeline } from '@azure/core-rest-pipeline'; +import { PollerLike } from '@azure/core-lro'; +import { TokenCredential } from '@azure/core-auth'; + +// @public +export type ActionType = string; + +// @public +export type ApplicationEnablement = string; + +// @public +export interface ArmResourceDefinitionResourceElementTemplate { + artifactProfile?: NSDArtifactProfile; + parameterValues?: string; + templateType?: TemplateType; +} + +// @public +export interface ArmResourceDefinitionResourceElementTemplateDetails extends ResourceElementTemplate { + configuration?: ArmResourceDefinitionResourceElementTemplate; + resourceElementType: "ArmResourceDefinition"; +} + +// @public +export interface ArmTemplateArtifactProfile { + templateName?: string; + templateVersion?: string; +} + +// @public +export interface ArmTemplateMappingRuleProfile { + templateParameters?: string; +} + +// @public +export interface ArtifactAccessCredential { + credentialType: CredentialType; +} + +// @public +export type ArtifactAccessCredentialUnion = AzureContainerRegistryScopedTokenCredential | AzureStorageAccountCredential | ArtifactAccessCredential; + +// @public +export interface ArtifactChangeState { + properties?: ArtifactChangeStateProperties; +} + +// @public +export interface ArtifactChangeStateProperties { + artifactState?: ArtifactState; +} + +// @public +export interface ArtifactManifest extends TrackedResource { + properties?: ArtifactManifestPropertiesFormat; +} + +// @public +export interface ArtifactManifestPropertiesFormat { + readonly artifactManifestState?: ArtifactManifestState; + artifacts?: ManifestArtifactFormat[]; + readonly provisioningState?: ProvisioningState; +} + +// @public +export interface ArtifactManifestsCreateOrUpdateOptionalParams extends OperationOptions { + updateIntervalInMs?: number; +} + +// @public +export interface ArtifactManifestsDeleteOptionalParams extends OperationOptions { + updateIntervalInMs?: number; +} + +// @public +export interface ArtifactManifestsGetOptionalParams extends OperationOptions { +} + +// @public +export interface ArtifactManifestsListByArtifactStoreOptionalParams extends OperationOptions { +} + +// @public +export interface ArtifactManifestsListCredentialOptionalParams extends OperationOptions { +} + +// @public +export interface ArtifactManifestsOperations { + // @deprecated (undocumented) + beginCreateOrUpdate: (resourceGroupName: string, publisherName: string, artifactStoreName: string, artifactManifestName: string, parameters: ArtifactManifest, options?: ArtifactManifestsCreateOrUpdateOptionalParams) => Promise, ArtifactManifest>>; + // @deprecated (undocumented) + beginCreateOrUpdateAndWait: (resourceGroupName: string, publisherName: string, artifactStoreName: string, artifactManifestName: string, parameters: ArtifactManifest, options?: ArtifactManifestsCreateOrUpdateOptionalParams) => Promise; + // @deprecated (undocumented) + beginDelete: (resourceGroupName: string, publisherName: string, artifactStoreName: string, artifactManifestName: string, options?: ArtifactManifestsDeleteOptionalParams) => Promise, void>>; + // @deprecated (undocumented) + beginDeleteAndWait: (resourceGroupName: string, publisherName: string, artifactStoreName: string, artifactManifestName: string, options?: ArtifactManifestsDeleteOptionalParams) => Promise; + // @deprecated (undocumented) + beginUpdateState: (resourceGroupName: string, publisherName: string, artifactStoreName: string, artifactManifestName: string, parameters: ArtifactManifestUpdateState, options?: ArtifactManifestsUpdateStateOptionalParams) => Promise, ArtifactManifestUpdateState>>; + // @deprecated (undocumented) + beginUpdateStateAndWait: (resourceGroupName: string, publisherName: string, artifactStoreName: string, artifactManifestName: string, parameters: ArtifactManifestUpdateState, options?: ArtifactManifestsUpdateStateOptionalParams) => Promise; + createOrUpdate: (resourceGroupName: string, publisherName: string, artifactStoreName: string, artifactManifestName: string, parameters: ArtifactManifest, options?: ArtifactManifestsCreateOrUpdateOptionalParams) => PollerLike, ArtifactManifest>; + delete: (resourceGroupName: string, publisherName: string, artifactStoreName: string, artifactManifestName: string, options?: ArtifactManifestsDeleteOptionalParams) => PollerLike, void>; + get: (resourceGroupName: string, publisherName: string, artifactStoreName: string, artifactManifestName: string, options?: ArtifactManifestsGetOptionalParams) => Promise; + listByArtifactStore: (resourceGroupName: string, publisherName: string, artifactStoreName: string, options?: ArtifactManifestsListByArtifactStoreOptionalParams) => PagedAsyncIterableIterator; + listCredential: (resourceGroupName: string, publisherName: string, artifactStoreName: string, artifactManifestName: string, options?: ArtifactManifestsListCredentialOptionalParams) => Promise; + update: (resourceGroupName: string, publisherName: string, artifactStoreName: string, artifactManifestName: string, parameters: TagsObject, options?: ArtifactManifestsUpdateOptionalParams) => Promise; + updateState: (resourceGroupName: string, publisherName: string, artifactStoreName: string, artifactManifestName: string, parameters: ArtifactManifestUpdateState, options?: ArtifactManifestsUpdateStateOptionalParams) => PollerLike, ArtifactManifestUpdateState>; +} + +// @public +export type ArtifactManifestState = string; + +// @public +export interface ArtifactManifestsUpdateOptionalParams extends OperationOptions { +} + +// @public +export interface ArtifactManifestsUpdateStateOptionalParams extends OperationOptions { + updateIntervalInMs?: number; +} + +// @public +export interface ArtifactManifestUpdateState { + artifactManifestState?: ArtifactManifestState; +} + +// @public +export interface ArtifactProfile { + artifactStore?: ReferencedResource; +} + +// @public +export type ArtifactReplicationStrategy = string; + +// @public +export type ArtifactState = string; + +// @public +export interface ArtifactStore extends TrackedResource { + properties?: ArtifactStorePropertiesFormat; +} + +// @public +export interface ArtifactStoreNetworkFabricControllerEndPoints { + networkFabricControllerIds?: ReferencedResource[]; +} + +// @public +export interface ArtifactStorePrivateEndPointsFormat { + manualPrivateEndPointConnections?: ReferencedResource[]; +} + +// @public +export interface ArtifactStorePropertiesFormat { + backingResourcePublicNetworkAccess?: BackingResourcePublicNetworkAccess; + // (undocumented) + managedResourceGroupConfiguration?: ArtifactStorePropertiesFormatManagedResourceGroupConfiguration; + readonly provisioningState?: ProvisioningState; + replicationStrategy?: ArtifactReplicationStrategy; + readonly storageResourceId?: string; + storeType?: ArtifactStoreType; +} + +// @public +export interface ArtifactStorePropertiesFormatManagedResourceGroupConfiguration { + location?: string; + name?: string; +} + +// @public +export interface ArtifactStoresAddNetworkFabricControllerEndPointsOptionalParams extends OperationOptions { + updateIntervalInMs?: number; +} + +// @public +export interface ArtifactStoresApprovePrivateEndPointsOptionalParams extends OperationOptions { + updateIntervalInMs?: number; +} + +// @public +export interface ArtifactStoresCreateOrUpdateOptionalParams extends OperationOptions { + updateIntervalInMs?: number; +} + +// @public +export interface ArtifactStoresDeleteNetworkFabricControllerEndPointsOptionalParams extends OperationOptions { + updateIntervalInMs?: number; +} + +// @public +export interface ArtifactStoresDeleteOptionalParams extends OperationOptions { + updateIntervalInMs?: number; +} + +// @public +export interface ArtifactStoresGetOptionalParams extends OperationOptions { +} + +// @public +export interface ArtifactStoresListByPublisherOptionalParams extends OperationOptions { +} + +// @public +export interface ArtifactStoresListNetworkFabricControllerPrivateEndPointsOptionalParams extends OperationOptions { + updateIntervalInMs?: number; +} + +// @public +export interface ArtifactStoresListPrivateEndPointsOptionalParams extends OperationOptions { + updateIntervalInMs?: number; +} + +// @public +export interface ArtifactStoresOperations { + addNetworkFabricControllerEndPoints: (resourceGroupName: string, publisherName: string, artifactStoreName: string, parameters: ArtifactStoreNetworkFabricControllerEndPoints, options?: ArtifactStoresAddNetworkFabricControllerEndPointsOptionalParams) => PollerLike, void>; + approvePrivateEndPoints: (resourceGroupName: string, publisherName: string, artifactStoreName: string, parameters: ArtifactStorePrivateEndPointsFormat, options?: ArtifactStoresApprovePrivateEndPointsOptionalParams) => PollerLike, void>; + // @deprecated (undocumented) + beginAddNetworkFabricControllerEndPoints: (resourceGroupName: string, publisherName: string, artifactStoreName: string, parameters: ArtifactStoreNetworkFabricControllerEndPoints, options?: ArtifactStoresAddNetworkFabricControllerEndPointsOptionalParams) => Promise, void>>; + // @deprecated (undocumented) + beginAddNetworkFabricControllerEndPointsAndWait: (resourceGroupName: string, publisherName: string, artifactStoreName: string, parameters: ArtifactStoreNetworkFabricControllerEndPoints, options?: ArtifactStoresAddNetworkFabricControllerEndPointsOptionalParams) => Promise; + // @deprecated (undocumented) + beginApprovePrivateEndPoints: (resourceGroupName: string, publisherName: string, artifactStoreName: string, parameters: ArtifactStorePrivateEndPointsFormat, options?: ArtifactStoresApprovePrivateEndPointsOptionalParams) => Promise, void>>; + // @deprecated (undocumented) + beginApprovePrivateEndPointsAndWait: (resourceGroupName: string, publisherName: string, artifactStoreName: string, parameters: ArtifactStorePrivateEndPointsFormat, options?: ArtifactStoresApprovePrivateEndPointsOptionalParams) => Promise; + // @deprecated (undocumented) + beginCreateOrUpdate: (resourceGroupName: string, publisherName: string, artifactStoreName: string, parameters: ArtifactStore, options?: ArtifactStoresCreateOrUpdateOptionalParams) => Promise, ArtifactStore>>; + // @deprecated (undocumented) + beginCreateOrUpdateAndWait: (resourceGroupName: string, publisherName: string, artifactStoreName: string, parameters: ArtifactStore, options?: ArtifactStoresCreateOrUpdateOptionalParams) => Promise; + // @deprecated (undocumented) + beginDelete: (resourceGroupName: string, publisherName: string, artifactStoreName: string, options?: ArtifactStoresDeleteOptionalParams) => Promise, void>>; + // @deprecated (undocumented) + beginDeleteAndWait: (resourceGroupName: string, publisherName: string, artifactStoreName: string, options?: ArtifactStoresDeleteOptionalParams) => Promise; + // @deprecated (undocumented) + beginDeleteNetworkFabricControllerEndPoints: (resourceGroupName: string, publisherName: string, artifactStoreName: string, parameters: ArtifactStoreNetworkFabricControllerEndPoints, options?: ArtifactStoresDeleteNetworkFabricControllerEndPointsOptionalParams) => Promise, void>>; + // @deprecated (undocumented) + beginDeleteNetworkFabricControllerEndPointsAndWait: (resourceGroupName: string, publisherName: string, artifactStoreName: string, parameters: ArtifactStoreNetworkFabricControllerEndPoints, options?: ArtifactStoresDeleteNetworkFabricControllerEndPointsOptionalParams) => Promise; + // @deprecated (undocumented) + beginRemovePrivateEndPoints: (resourceGroupName: string, publisherName: string, artifactStoreName: string, parameters: ArtifactStorePrivateEndPointsFormat, options?: ArtifactStoresRemovePrivateEndPointsOptionalParams) => Promise, void>>; + // @deprecated (undocumented) + beginRemovePrivateEndPointsAndWait: (resourceGroupName: string, publisherName: string, artifactStoreName: string, parameters: ArtifactStorePrivateEndPointsFormat, options?: ArtifactStoresRemovePrivateEndPointsOptionalParams) => Promise; + createOrUpdate: (resourceGroupName: string, publisherName: string, artifactStoreName: string, parameters: ArtifactStore, options?: ArtifactStoresCreateOrUpdateOptionalParams) => PollerLike, ArtifactStore>; + delete: (resourceGroupName: string, publisherName: string, artifactStoreName: string, options?: ArtifactStoresDeleteOptionalParams) => PollerLike, void>; + deleteNetworkFabricControllerEndPoints: (resourceGroupName: string, publisherName: string, artifactStoreName: string, parameters: ArtifactStoreNetworkFabricControllerEndPoints, options?: ArtifactStoresDeleteNetworkFabricControllerEndPointsOptionalParams) => PollerLike, void>; + get: (resourceGroupName: string, publisherName: string, artifactStoreName: string, options?: ArtifactStoresGetOptionalParams) => Promise; + listByPublisher: (resourceGroupName: string, publisherName: string, options?: ArtifactStoresListByPublisherOptionalParams) => PagedAsyncIterableIterator; + listNetworkFabricControllerPrivateEndPoints: (resourceGroupName: string, publisherName: string, artifactStoreName: string, options?: ArtifactStoresListNetworkFabricControllerPrivateEndPointsOptionalParams) => PagedAsyncIterableIterator; + listPrivateEndPoints: (resourceGroupName: string, publisherName: string, artifactStoreName: string, options?: ArtifactStoresListPrivateEndPointsOptionalParams) => PagedAsyncIterableIterator; + removePrivateEndPoints: (resourceGroupName: string, publisherName: string, artifactStoreName: string, parameters: ArtifactStorePrivateEndPointsFormat, options?: ArtifactStoresRemovePrivateEndPointsOptionalParams) => PollerLike, void>; + update: (resourceGroupName: string, publisherName: string, artifactStoreName: string, parameters: TagsObject, options?: ArtifactStoresUpdateOptionalParams) => Promise; +} + +// @public +export interface ArtifactStoresRemovePrivateEndPointsOptionalParams extends OperationOptions { + updateIntervalInMs?: number; +} + +// @public +export interface ArtifactStoresUpdateOptionalParams extends OperationOptions { +} + +// @public +export type ArtifactStoreType = string; + +// @public +export type ArtifactType = string; + +// @public +export interface AzureArcK8SClusterNfviDetails extends NFVIs { + customLocationReference?: ReferencedResource; + nfviType: "AzureArcKubernetes"; +} + +// @public +export interface AzureArcKubernetesArtifactProfile extends ArtifactProfile { + helmArtifactProfile?: HelmArtifactProfile; +} + +// @public +export type AzureArcKubernetesArtifactType = string; + +// @public +export interface AzureArcKubernetesDeployMappingRuleProfile extends MappingRuleProfile { + helmMappingRuleProfile?: HelmMappingRuleProfile; +} + +// @public +export interface AzureArcKubernetesHelmApplication extends AzureArcKubernetesNetworkFunctionApplication { + artifactProfile?: AzureArcKubernetesArtifactProfile; + artifactType: "HelmPackage"; + deployParametersMappingRuleProfile?: AzureArcKubernetesDeployMappingRuleProfile; +} + +// @public +export interface AzureArcKubernetesNetworkFunctionApplication extends NetworkFunctionApplication { + artifactType: AzureArcKubernetesArtifactType; +} + +// @public +export type AzureArcKubernetesNetworkFunctionApplicationUnion = AzureArcKubernetesHelmApplication | AzureArcKubernetesNetworkFunctionApplication; + +// @public +export interface AzureArcKubernetesNetworkFunctionTemplate extends ContainerizedNetworkFunctionTemplate { + networkFunctionApplications?: AzureArcKubernetesNetworkFunctionApplicationUnion[]; + nfviType: "AzureArcKubernetes"; +} + +// @public +export enum AzureClouds { + AZURE_CHINA_CLOUD = "AZURE_CHINA_CLOUD", + AZURE_PUBLIC_CLOUD = "AZURE_PUBLIC_CLOUD", + AZURE_US_GOVERNMENT = "AZURE_US_GOVERNMENT" +} + +// @public +export interface AzureContainerRegistryScopedTokenCredential extends ArtifactAccessCredential { + acrServerUrl?: string; + acrToken?: string; + credentialType: "AzureContainerRegistryScopedToken"; + expiry?: Date; + repositories?: string[]; + username?: string; +} + +// @public +export interface AzureCoreArmTemplateArtifactProfile extends ArtifactProfile { + templateArtifactProfile?: ArmTemplateArtifactProfile; +} + +// @public +export interface AzureCoreArmTemplateDeployMappingRuleProfile extends MappingRuleProfile { + templateMappingRuleProfile?: ArmTemplateMappingRuleProfile; +} + +// @public +export type AzureCoreArtifactType = string; + +// @public +export interface AzureCoreNetworkFunctionApplication extends NetworkFunctionApplication { + artifactType: AzureCoreArtifactType; +} + +// @public +export type AzureCoreNetworkFunctionApplicationUnion = AzureCoreNetworkFunctionVhdApplication | AzureCoreNetworkFunctionArmTemplateApplication | AzureCoreNetworkFunctionApplication; + +// @public +export interface AzureCoreNetworkFunctionArmTemplateApplication extends AzureCoreNetworkFunctionApplication { + artifactProfile?: AzureCoreArmTemplateArtifactProfile; + artifactType: "ArmTemplate"; + deployParametersMappingRuleProfile?: AzureCoreArmTemplateDeployMappingRuleProfile; +} + +// @public +export interface AzureCoreNetworkFunctionTemplate extends VirtualNetworkFunctionTemplate { + networkFunctionApplications?: AzureCoreNetworkFunctionApplicationUnion[]; + nfviType: "AzureCore"; +} + +// @public +export interface AzureCoreNetworkFunctionVhdApplication extends AzureCoreNetworkFunctionApplication { + artifactProfile?: AzureCoreVhdImageArtifactProfile; + artifactType: "VhdImageFile"; + deployParametersMappingRuleProfile?: AzureCoreVhdImageDeployMappingRuleProfile; +} + +// @public +export interface AzureCoreNfviDetails extends NFVIs { + location?: string; + nfviType: "AzureCore"; +} + +// @public +export interface AzureCoreVhdImageArtifactProfile extends ArtifactProfile { + vhdArtifactProfile?: VhdImageArtifactProfile; +} + +// @public +export interface AzureCoreVhdImageDeployMappingRuleProfile extends MappingRuleProfile { + vhdImageMappingRuleProfile?: VhdImageMappingRuleProfile; +} + +// @public +export interface AzureOperatorNexusArmTemplateArtifactProfile extends ArtifactProfile { + templateArtifactProfile?: ArmTemplateArtifactProfile; +} + +// @public +export interface AzureOperatorNexusArmTemplateDeployMappingRuleProfile extends MappingRuleProfile { + templateMappingRuleProfile?: ArmTemplateMappingRuleProfile; +} + +// @public +export type AzureOperatorNexusArtifactType = string; + +// @public +export interface AzureOperatorNexusClusterNfviDetails extends NFVIs { + customLocationReference?: ReferencedResource; + nfviType: "AzureOperatorNexus"; +} + +// @public +export interface AzureOperatorNexusImageArtifactProfile extends ArtifactProfile { + imageArtifactProfile?: ImageArtifactProfile; +} + +// @public +export interface AzureOperatorNexusImageDeployMappingRuleProfile extends MappingRuleProfile { + imageMappingRuleProfile?: ImageMappingRuleProfile; +} + +// @public +export interface AzureOperatorNexusNetworkFunctionApplication extends NetworkFunctionApplication { + artifactType: AzureOperatorNexusArtifactType; +} + +// @public +export type AzureOperatorNexusNetworkFunctionApplicationUnion = AzureOperatorNexusNetworkFunctionImageApplication | AzureOperatorNexusNetworkFunctionArmTemplateApplication | AzureOperatorNexusNetworkFunctionApplication; + +// @public +export interface AzureOperatorNexusNetworkFunctionArmTemplateApplication extends AzureOperatorNexusNetworkFunctionApplication { + artifactProfile?: AzureOperatorNexusArmTemplateArtifactProfile; + artifactType: "ArmTemplate"; + deployParametersMappingRuleProfile?: AzureOperatorNexusArmTemplateDeployMappingRuleProfile; +} + +// @public +export interface AzureOperatorNexusNetworkFunctionImageApplication extends AzureOperatorNexusNetworkFunctionApplication { + artifactProfile?: AzureOperatorNexusImageArtifactProfile; + artifactType: "ImageFile"; + deployParametersMappingRuleProfile?: AzureOperatorNexusImageDeployMappingRuleProfile; +} + +// @public +export interface AzureOperatorNexusNetworkFunctionTemplate extends VirtualNetworkFunctionTemplate { + networkFunctionApplications?: AzureOperatorNexusNetworkFunctionApplicationUnion[]; + nfviType: "AzureOperatorNexus"; +} + +// @public +export interface AzureStorageAccountContainerCredential { + containerName?: string; + containerSasUri?: string; +} + +// @public +export interface AzureStorageAccountCredential extends ArtifactAccessCredential { + containerCredentials?: AzureStorageAccountContainerCredential[]; + credentialType: "AzureStorageAccountToken"; + expiry?: Date; + storageAccountId?: string; +} + +// @public +export type AzureSupportedClouds = `${AzureClouds}`; + +// @public +export type BackingResourcePublicNetworkAccess = string; + +// @public +export interface CancelInformation { + longRunningOperation?: LongRunningOperation; + siteNetworkServiceReference: ReferencedResource; +} + +// @public +export interface Component extends ProxyResource { + properties?: ComponentProperties; +} + +// @public +export interface ComponentProperties { + readonly deploymentProfile?: string; + readonly deploymentStatus?: DeploymentStatusProperties; + readonly provisioningState?: ProvisioningState; +} + +// @public +export interface ComponentsGetOptionalParams extends OperationOptions { +} + +// @public +export interface ComponentsListByNetworkFunctionOptionalParams extends OperationOptions { +} + +// @public +export interface ComponentsOperations { + get: (resourceGroupName: string, networkFunctionName: string, componentName: string, options?: ComponentsGetOptionalParams) => Promise; + listByNetworkFunction: (resourceGroupName: string, networkFunctionName: string, options?: ComponentsListByNetworkFunctionOptionalParams) => PagedAsyncIterableIterator; +} + +// @public +export interface ConfigurationGroupSchema extends TrackedResource { + properties?: ConfigurationGroupSchemaPropertiesFormat; +} + +// @public +export interface ConfigurationGroupSchemaPropertiesFormat { + description?: string; + readonly provisioningState?: ProvisioningState; + schemaDefinition?: string; + readonly versionState?: VersionState; +} + +// @public +export interface ConfigurationGroupSchemasCreateOrUpdateOptionalParams extends OperationOptions { + updateIntervalInMs?: number; +} + +// @public +export interface ConfigurationGroupSchemasDeleteOptionalParams extends OperationOptions { + updateIntervalInMs?: number; +} + +// @public +export interface ConfigurationGroupSchemasGetOptionalParams extends OperationOptions { +} + +// @public +export interface ConfigurationGroupSchemasListByPublisherOptionalParams extends OperationOptions { +} + +// @public +export interface ConfigurationGroupSchemasOperations { + // @deprecated (undocumented) + beginCreateOrUpdate: (resourceGroupName: string, publisherName: string, configurationGroupSchemaName: string, parameters: ConfigurationGroupSchema, options?: ConfigurationGroupSchemasCreateOrUpdateOptionalParams) => Promise, ConfigurationGroupSchema>>; + // @deprecated (undocumented) + beginCreateOrUpdateAndWait: (resourceGroupName: string, publisherName: string, configurationGroupSchemaName: string, parameters: ConfigurationGroupSchema, options?: ConfigurationGroupSchemasCreateOrUpdateOptionalParams) => Promise; + // @deprecated (undocumented) + beginDelete: (resourceGroupName: string, publisherName: string, configurationGroupSchemaName: string, options?: ConfigurationGroupSchemasDeleteOptionalParams) => Promise, void>>; + // @deprecated (undocumented) + beginDeleteAndWait: (resourceGroupName: string, publisherName: string, configurationGroupSchemaName: string, options?: ConfigurationGroupSchemasDeleteOptionalParams) => Promise; + // @deprecated (undocumented) + beginUpdateState: (resourceGroupName: string, publisherName: string, configurationGroupSchemaName: string, parameters: ConfigurationGroupSchemaVersionUpdateState, options?: ConfigurationGroupSchemasUpdateStateOptionalParams) => Promise, ConfigurationGroupSchemaVersionUpdateState>>; + // @deprecated (undocumented) + beginUpdateStateAndWait: (resourceGroupName: string, publisherName: string, configurationGroupSchemaName: string, parameters: ConfigurationGroupSchemaVersionUpdateState, options?: ConfigurationGroupSchemasUpdateStateOptionalParams) => Promise; + createOrUpdate: (resourceGroupName: string, publisherName: string, configurationGroupSchemaName: string, parameters: ConfigurationGroupSchema, options?: ConfigurationGroupSchemasCreateOrUpdateOptionalParams) => PollerLike, ConfigurationGroupSchema>; + delete: (resourceGroupName: string, publisherName: string, configurationGroupSchemaName: string, options?: ConfigurationGroupSchemasDeleteOptionalParams) => PollerLike, void>; + get: (resourceGroupName: string, publisherName: string, configurationGroupSchemaName: string, options?: ConfigurationGroupSchemasGetOptionalParams) => Promise; + listByPublisher: (resourceGroupName: string, publisherName: string, options?: ConfigurationGroupSchemasListByPublisherOptionalParams) => PagedAsyncIterableIterator; + update: (resourceGroupName: string, publisherName: string, configurationGroupSchemaName: string, parameters: TagsObject, options?: ConfigurationGroupSchemasUpdateOptionalParams) => Promise; + updateState: (resourceGroupName: string, publisherName: string, configurationGroupSchemaName: string, parameters: ConfigurationGroupSchemaVersionUpdateState, options?: ConfigurationGroupSchemasUpdateStateOptionalParams) => PollerLike, ConfigurationGroupSchemaVersionUpdateState>; +} + +// @public +export interface ConfigurationGroupSchemasUpdateOptionalParams extends OperationOptions { +} + +// @public +export interface ConfigurationGroupSchemasUpdateStateOptionalParams extends OperationOptions { + updateIntervalInMs?: number; +} + +// @public +export interface ConfigurationGroupSchemaVersionUpdateState { + versionState?: VersionState; +} + +// @public +export interface ConfigurationGroupValue extends TrackedResource { + properties?: ConfigurationGroupValuePropertiesFormatUnion; +} + +// @public +export type ConfigurationGroupValueConfigurationType = string; + +// @public +export interface ConfigurationGroupValuePropertiesFormat { + readonly configurationGroupSchemaName?: string; + readonly configurationGroupSchemaOfferingLocation?: string; + configurationGroupSchemaResourceReference?: DeploymentResourceIdReferenceUnion; + configurationType: ConfigurationGroupValueConfigurationType; + readonly provisioningState?: ProvisioningState; + readonly publisherName?: string; + readonly publisherScope?: PublisherScope; +} + +// @public +export type ConfigurationGroupValuePropertiesFormatUnion = ConfigurationValueWithSecrets | ConfigurationValueWithoutSecrets | ConfigurationGroupValuePropertiesFormat; + +// @public +export interface ConfigurationGroupValuesCreateOrUpdateOptionalParams extends OperationOptions { + updateIntervalInMs?: number; +} + +// @public +export interface ConfigurationGroupValuesDeleteOptionalParams extends OperationOptions { + updateIntervalInMs?: number; +} + +// @public +export interface ConfigurationGroupValuesGetOptionalParams extends OperationOptions { +} + +// @public +export interface ConfigurationGroupValuesListByResourceGroupOptionalParams extends OperationOptions { +} + +// @public +export interface ConfigurationGroupValuesListBySubscriptionOptionalParams extends OperationOptions { +} + +// @public +export interface ConfigurationGroupValuesOperations { + // @deprecated (undocumented) + beginCreateOrUpdate: (resourceGroupName: string, configurationGroupValueName: string, parameters: ConfigurationGroupValue, options?: ConfigurationGroupValuesCreateOrUpdateOptionalParams) => Promise, ConfigurationGroupValue>>; + // @deprecated (undocumented) + beginCreateOrUpdateAndWait: (resourceGroupName: string, configurationGroupValueName: string, parameters: ConfigurationGroupValue, options?: ConfigurationGroupValuesCreateOrUpdateOptionalParams) => Promise; + // @deprecated (undocumented) + beginDelete: (resourceGroupName: string, configurationGroupValueName: string, options?: ConfigurationGroupValuesDeleteOptionalParams) => Promise, void>>; + // @deprecated (undocumented) + beginDeleteAndWait: (resourceGroupName: string, configurationGroupValueName: string, options?: ConfigurationGroupValuesDeleteOptionalParams) => Promise; + createOrUpdate: (resourceGroupName: string, configurationGroupValueName: string, parameters: ConfigurationGroupValue, options?: ConfigurationGroupValuesCreateOrUpdateOptionalParams) => PollerLike, ConfigurationGroupValue>; + delete: (resourceGroupName: string, configurationGroupValueName: string, options?: ConfigurationGroupValuesDeleteOptionalParams) => PollerLike, void>; + get: (resourceGroupName: string, configurationGroupValueName: string, options?: ConfigurationGroupValuesGetOptionalParams) => Promise; + listByResourceGroup: (resourceGroupName: string, options?: ConfigurationGroupValuesListByResourceGroupOptionalParams) => PagedAsyncIterableIterator; + listBySubscription: (options?: ConfigurationGroupValuesListBySubscriptionOptionalParams) => PagedAsyncIterableIterator; + updateTags: (resourceGroupName: string, configurationGroupValueName: string, parameters: TagsObject, options?: ConfigurationGroupValuesUpdateTagsOptionalParams) => Promise; +} + +// @public +export interface ConfigurationGroupValuesUpdateTagsOptionalParams extends OperationOptions { +} + +// @public +export interface ConfigurationValueWithoutSecrets extends ConfigurationGroupValuePropertiesFormat { + configurationType: "Open"; + configurationValue?: string; +} + +// @public +export interface ConfigurationValueWithSecrets extends ConfigurationGroupValuePropertiesFormat { + configurationType: "Secret"; + secretConfigurationValue?: string; +} + +// @public +export interface ContainerizedNetworkFunctionDefinitionVersion extends NetworkFunctionDefinitionVersionPropertiesFormat { + networkFunctionTemplate?: ContainerizedNetworkFunctionTemplateUnion; + networkFunctionType: "ContainerizedNetworkFunction"; +} + +// @public +export type ContainerizedNetworkFunctionNfviType = string; + +// @public +export interface ContainerizedNetworkFunctionTemplate { + nfviType: ContainerizedNetworkFunctionNfviType; +} + +// @public +export type ContainerizedNetworkFunctionTemplateUnion = AzureArcKubernetesNetworkFunctionTemplate | ContainerizedNetworkFunctionTemplate; + +// @public +export type ContinuablePage = TPage & { + continuationToken?: string; +}; + +// @public +export type CreatedByType = string; + +// @public +export type CredentialType = string; + +// @public +export interface DaemonSet { + available?: number; + creationTime?: Date; + current?: number; + desired?: number; + name?: string; + namespace?: string; + ready?: number; + upToDate?: number; +} + +// @public +export interface DependsOnProfile { + installDependsOn?: string[]; + uninstallDependsOn?: string[]; + updateDependsOn?: string[]; +} + +// @public +export interface Deployment { + available?: number; + creationTime?: Date; + desired?: number; + name?: string; + namespace?: string; + ready?: number; + upToDate?: number; +} + +// @public +export interface DeploymentResourceIdReference { + idType: IdType; +} + +// @public +export type DeploymentResourceIdReferenceUnion = SecretDeploymentResourceReference | OpenDeploymentResourceReference | DeploymentResourceIdReference; + +// @public +export interface DeploymentStatusProperties { + nextExpectedUpdateAt?: Date; + resources?: Resources; + status?: Status; +} + +// @public +export interface ErrorAdditionalInfo { + readonly info?: any; + readonly type?: string; +} + +// @public +export interface ErrorDetail { + readonly additionalInfo?: ErrorAdditionalInfo[]; + readonly code?: string; + readonly details?: ErrorDetail[]; + readonly message?: string; + readonly target?: string; +} + +// @public +export interface ErrorResponse { + error?: ErrorDetail; +} + +// @public +export interface ExecuteRequestParameters { + requestMetadata: RequestMetadata; + serviceEndpoint: string; +} + +// @public +export interface HelmArtifactProfile { + helmPackageName?: string; + helmPackageVersionRange?: string; + imagePullSecretsValuesPaths?: string[]; + registryValuesPaths?: string[]; +} + +// @public +export interface HelmInstallOptions { + atomic?: string; + timeout?: string; + wait?: string; +} + +// @public +export interface HelmMappingRuleProfile { + helmPackageVersion?: string; + options?: HelmMappingRuleProfileOptions; + releaseName?: string; + releaseNamespace?: string; + values?: string; +} + +// @public +export interface HelmMappingRuleProfileOptions { + installOptions?: HelmInstallOptions; + upgradeOptions?: HelmUpgradeOptions; +} + +// @public +export interface HelmUpgradeOptions { + atomic?: string; + timeout?: string; + wait?: string; +} + +// @public +export type HttpMethod = string; + +// @public (undocumented) +export class HybridNetworkManagementClient { + constructor(credential: TokenCredential, subscriptionId: string, options?: HybridNetworkManagementClientOptionalParams); + readonly artifactManifests: ArtifactManifestsOperations; + readonly artifactStores: ArtifactStoresOperations; + readonly components: ComponentsOperations; + readonly configurationGroupSchemas: ConfigurationGroupSchemasOperations; + readonly configurationGroupValues: ConfigurationGroupValuesOperations; + readonly networkFunctionDefinitionGroups: NetworkFunctionDefinitionGroupsOperations; + readonly networkFunctionDefinitionVersions: NetworkFunctionDefinitionVersionsOperations; + readonly networkFunctions: NetworkFunctionsOperations; + readonly networkServiceDesignGroups: NetworkServiceDesignGroupsOperations; + readonly networkServiceDesignVersions: NetworkServiceDesignVersionsOperations; + readonly operations: OperationsOperations; + readonly pipeline: Pipeline; + readonly proxyArtifact: ProxyArtifactOperations; + readonly publishers: PublishersOperations; + readonly siteNetworkServices: SiteNetworkServicesOperations; + readonly sites: SitesOperations; +} + +// @public +export interface HybridNetworkManagementClientOptionalParams extends ClientOptions { + apiVersion?: string; + cloudSetting?: AzureSupportedClouds; +} + +// @public +export type IdType = string; + +// @public +export interface ImageArtifactProfile { + imageName?: string; + imageVersion?: string; +} + +// @public +export interface ImageMappingRuleProfile { + userConfiguration?: string; +} + +// @public +export enum KnownActionType { + Internal = "Internal" +} + +// @public +export enum KnownApplicationEnablement { + Disabled = "Disabled", + Enabled = "Enabled", + Unknown = "Unknown" +} + +// @public +export enum KnownArtifactManifestState { + Succeeded = "Succeeded", + Unknown = "Unknown", + Uploaded = "Uploaded", + Uploading = "Uploading", + Validating = "Validating", + ValidationFailed = "ValidationFailed" +} + +// @public +export enum KnownArtifactReplicationStrategy { + SingleReplication = "SingleReplication", + Unknown = "Unknown" +} + +// @public +export enum KnownArtifactState { + Active = "Active", + Deprecated = "Deprecated", + Preview = "Preview", + Unknown = "Unknown" +} + +// @public +export enum KnownArtifactStoreType { + AzureContainerRegistry = "AzureContainerRegistry", + AzureStorageAccount = "AzureStorageAccount", + Unknown = "Unknown" +} + +// @public +export enum KnownArtifactType { + ArmTemplate = "ArmTemplate", + ImageFile = "ImageFile", + OCIArtifact = "OCIArtifact", + Unknown = "Unknown", + VhdImageFile = "VhdImageFile" +} + +// @public +export enum KnownAzureArcKubernetesArtifactType { + HelmPackage = "HelmPackage", + Unknown = "Unknown" +} + +// @public +export enum KnownAzureCoreArtifactType { + ArmTemplate = "ArmTemplate", + Unknown = "Unknown", + VhdImageFile = "VhdImageFile" +} + +// @public +export enum KnownAzureOperatorNexusArtifactType { + ArmTemplate = "ArmTemplate", + ImageFile = "ImageFile", + Unknown = "Unknown" +} + +// @public +export enum KnownBackingResourcePublicNetworkAccess { + Disabled = "Disabled", + Enabled = "Enabled" +} + +// @public +export enum KnownConfigurationGroupValueConfigurationType { + Open = "Open", + Secret = "Secret", + Unknown = "Unknown" +} + +// @public +export enum KnownContainerizedNetworkFunctionNfviType { + AzureArcKubernetes = "AzureArcKubernetes", + Unknown = "Unknown" +} + +// @public +export enum KnownCreatedByType { + Application = "Application", + Key = "Key", + ManagedIdentity = "ManagedIdentity", + User = "User" +} + +// @public +export enum KnownCredentialType { + AzureContainerRegistryScopedToken = "AzureContainerRegistryScopedToken", + AzureStorageAccountToken = "AzureStorageAccountToken", + Unknown = "Unknown" +} + +// @public +export enum KnownHttpMethod { + Delete = "Delete", + Get = "Get", + Patch = "Patch", + Post = "Post", + Put = "Put", + Unknown = "Unknown" +} + +// @public +export enum KnownIdType { + Open = "Open", + Secret = "Secret", + Unknown = "Unknown" +} + +// @public +export enum KnownLongRunningOperation { + Put = "Put", + Unknown = "Unknown" +} + +// @public +export enum KnownManagedServiceIdentityType { + None = "None", + SystemAssigned = "SystemAssigned", + SystemAssignedUserAssigned = "SystemAssigned,UserAssigned", + UserAssigned = "UserAssigned" +} + +// @public +export enum KnownNetworkFunctionConfigurationType { + Open = "Open", + Secret = "Secret", + Unknown = "Unknown" +} + +// @public +export enum KnownNetworkFunctionType { + ContainerizedNetworkFunction = "ContainerizedNetworkFunction", + Unknown = "Unknown", + VirtualNetworkFunction = "VirtualNetworkFunction" +} + +// @public +export enum KnownNfviType { + AzureArcKubernetes = "AzureArcKubernetes", + AzureCore = "AzureCore", + AzureOperatorNexus = "AzureOperatorNexus", + Unknown = "Unknown" +} + +// @public +export enum KnownOrigin { + System = "system", + User = "user", + UserSystem = "user,system" +} + +// @public +export enum KnownPodEventType { + Normal = "Normal", + Warning = "Warning" +} + +// @public +export enum KnownPodStatus { + Failed = "Failed", + NotReady = "NotReady", + Pending = "Pending", + Running = "Running", + Succeeded = "Succeeded", + Terminating = "Terminating", + Unknown = "Unknown" +} + +// @public +export enum KnownProvisioningState { + Accepted = "Accepted", + Canceled = "Canceled", + Cancelling = "Cancelling", + Converging = "Converging", + Deleted = "Deleted", + Deleting = "Deleting", + Failed = "Failed", + Succeeded = "Succeeded", + Unknown = "Unknown" +} + +// @public +export enum KnownPublisherScope { + Private = "Private", + Unknown = "Unknown" +} + +// @public +export enum KnownSkuName { + Basic = "Basic", + Standard = "Standard" +} + +// @public +export enum KnownSkuTier { + Basic = "Basic", + Standard = "Standard" +} + +// @public +export enum KnownStatus { + Deployed = "Deployed", + Downloading = "Downloading", + Failed = "Failed", + Installing = "Installing", + PendingInstall = "Pending-Install", + PendingRollback = "Pending-Rollback", + PendingUpgrade = "Pending-Upgrade", + Reinstalling = "Reinstalling", + Rollingback = "Rollingback", + Superseded = "Superseded", + Uninstalled = "Uninstalled", + Uninstalling = "Uninstalling", + Unknown = "Unknown", + Upgrading = "Upgrading" +} + +// @public +export enum KnownTemplateType { + ArmTemplate = "ArmTemplate", + Unknown = "Unknown" +} + +// @public +export enum KnownType { + ArmResourceDefinition = "ArmResourceDefinition", + NetworkFunctionDefinition = "NetworkFunctionDefinition", + Unknown = "Unknown" +} + +// @public +export enum KnownVersions { + V20250330 = "2025-03-30" +} + +// @public +export enum KnownVersionState { + Active = "Active", + Deprecated = "Deprecated", + Preview = "Preview", + Unknown = "Unknown", + Validating = "Validating", + ValidationFailed = "ValidationFailed" +} + +// @public +export enum KnownVirtualNetworkFunctionNfviType { + AzureCore = "AzureCore", + AzureOperatorNexus = "AzureOperatorNexus", + Unknown = "Unknown" +} + +// @public +export type LongRunningOperation = string; + +// @public +export interface ManagedResourceGroupConfiguration { + location?: string; + name?: string; +} + +// @public +export interface ManagedServiceIdentity { + readonly principalId?: string; + readonly tenantId?: string; + type: ManagedServiceIdentityType; + userAssignedIdentities?: Record; +} + +// @public +export type ManagedServiceIdentityType = string; + +// @public +export interface ManifestArtifactFormat { + artifactName?: string; + artifactType?: ArtifactType; + artifactVersion?: string; +} + +// @public +export interface MappingRuleProfile { + applicationEnablement?: ApplicationEnablement; +} + +// @public +export interface NetworkFunction extends TrackedResource { + etag?: string; + identity?: ManagedServiceIdentity; + properties?: NetworkFunctionPropertiesFormatUnion; +} + +// @public +export interface NetworkFunctionApplication { + dependsOnProfile?: DependsOnProfile; + name?: string; +} + +// @public +export type NetworkFunctionConfigurationType = string; + +// @public +export interface NetworkFunctionDefinitionGroup extends TrackedResource { + properties?: NetworkFunctionDefinitionGroupPropertiesFormat; +} + +// @public +export interface NetworkFunctionDefinitionGroupPropertiesFormat { + description?: string; + readonly provisioningState?: ProvisioningState; +} + +// @public +export interface NetworkFunctionDefinitionGroupsCreateOrUpdateOptionalParams extends OperationOptions { + updateIntervalInMs?: number; +} + +// @public +export interface NetworkFunctionDefinitionGroupsDeleteOptionalParams extends OperationOptions { + updateIntervalInMs?: number; +} + +// @public +export interface NetworkFunctionDefinitionGroupsGetOptionalParams extends OperationOptions { +} + +// @public +export interface NetworkFunctionDefinitionGroupsListByPublisherOptionalParams extends OperationOptions { +} + +// @public +export interface NetworkFunctionDefinitionGroupsOperations { + // @deprecated (undocumented) + beginCreateOrUpdate: (resourceGroupName: string, publisherName: string, networkFunctionDefinitionGroupName: string, parameters: NetworkFunctionDefinitionGroup, options?: NetworkFunctionDefinitionGroupsCreateOrUpdateOptionalParams) => Promise, NetworkFunctionDefinitionGroup>>; + // @deprecated (undocumented) + beginCreateOrUpdateAndWait: (resourceGroupName: string, publisherName: string, networkFunctionDefinitionGroupName: string, parameters: NetworkFunctionDefinitionGroup, options?: NetworkFunctionDefinitionGroupsCreateOrUpdateOptionalParams) => Promise; + // @deprecated (undocumented) + beginDelete: (resourceGroupName: string, publisherName: string, networkFunctionDefinitionGroupName: string, options?: NetworkFunctionDefinitionGroupsDeleteOptionalParams) => Promise, void>>; + // @deprecated (undocumented) + beginDeleteAndWait: (resourceGroupName: string, publisherName: string, networkFunctionDefinitionGroupName: string, options?: NetworkFunctionDefinitionGroupsDeleteOptionalParams) => Promise; + createOrUpdate: (resourceGroupName: string, publisherName: string, networkFunctionDefinitionGroupName: string, parameters: NetworkFunctionDefinitionGroup, options?: NetworkFunctionDefinitionGroupsCreateOrUpdateOptionalParams) => PollerLike, NetworkFunctionDefinitionGroup>; + delete: (resourceGroupName: string, publisherName: string, networkFunctionDefinitionGroupName: string, options?: NetworkFunctionDefinitionGroupsDeleteOptionalParams) => PollerLike, void>; + get: (resourceGroupName: string, publisherName: string, networkFunctionDefinitionGroupName: string, options?: NetworkFunctionDefinitionGroupsGetOptionalParams) => Promise; + listByPublisher: (resourceGroupName: string, publisherName: string, options?: NetworkFunctionDefinitionGroupsListByPublisherOptionalParams) => PagedAsyncIterableIterator; + update: (resourceGroupName: string, publisherName: string, networkFunctionDefinitionGroupName: string, parameters: TagsObject, options?: NetworkFunctionDefinitionGroupsUpdateOptionalParams) => Promise; +} + +// @public +export interface NetworkFunctionDefinitionGroupsUpdateOptionalParams extends OperationOptions { +} + +// @public +export interface NetworkFunctionDefinitionResourceElementTemplateDetails extends ResourceElementTemplate { + configuration?: ArmResourceDefinitionResourceElementTemplate; + resourceElementType: "NetworkFunctionDefinition"; +} + +// @public +export interface NetworkFunctionDefinitionVersion extends TrackedResource { + properties?: NetworkFunctionDefinitionVersionPropertiesFormatUnion; +} + +// @public +export interface NetworkFunctionDefinitionVersionPropertiesFormat { + deployParameters?: string; + description?: string; + networkFunctionType: NetworkFunctionType; + readonly provisioningState?: ProvisioningState; + readonly versionState?: VersionState; +} + +// @public +export type NetworkFunctionDefinitionVersionPropertiesFormatUnion = ContainerizedNetworkFunctionDefinitionVersion | VirtualNetworkFunctionNetworkFunctionDefinitionVersion | NetworkFunctionDefinitionVersionPropertiesFormat; + +// @public +export interface NetworkFunctionDefinitionVersionsCreateOrUpdateOptionalParams extends OperationOptions { + updateIntervalInMs?: number; +} + +// @public +export interface NetworkFunctionDefinitionVersionsDeleteOptionalParams extends OperationOptions { + updateIntervalInMs?: number; +} + +// @public +export interface NetworkFunctionDefinitionVersionsGetOptionalParams extends OperationOptions { +} + +// @public +export interface NetworkFunctionDefinitionVersionsListByNetworkFunctionDefinitionGroupOptionalParams extends OperationOptions { +} + +// @public +export interface NetworkFunctionDefinitionVersionsOperations { + // @deprecated (undocumented) + beginCreateOrUpdate: (resourceGroupName: string, publisherName: string, networkFunctionDefinitionGroupName: string, networkFunctionDefinitionVersionName: string, parameters: NetworkFunctionDefinitionVersion, options?: NetworkFunctionDefinitionVersionsCreateOrUpdateOptionalParams) => Promise, NetworkFunctionDefinitionVersion>>; + // @deprecated (undocumented) + beginCreateOrUpdateAndWait: (resourceGroupName: string, publisherName: string, networkFunctionDefinitionGroupName: string, networkFunctionDefinitionVersionName: string, parameters: NetworkFunctionDefinitionVersion, options?: NetworkFunctionDefinitionVersionsCreateOrUpdateOptionalParams) => Promise; + // @deprecated (undocumented) + beginDelete: (resourceGroupName: string, publisherName: string, networkFunctionDefinitionGroupName: string, networkFunctionDefinitionVersionName: string, options?: NetworkFunctionDefinitionVersionsDeleteOptionalParams) => Promise, void>>; + // @deprecated (undocumented) + beginDeleteAndWait: (resourceGroupName: string, publisherName: string, networkFunctionDefinitionGroupName: string, networkFunctionDefinitionVersionName: string, options?: NetworkFunctionDefinitionVersionsDeleteOptionalParams) => Promise; + // @deprecated (undocumented) + beginUpdateState: (resourceGroupName: string, publisherName: string, networkFunctionDefinitionGroupName: string, networkFunctionDefinitionVersionName: string, parameters: NetworkFunctionDefinitionVersionUpdateState, options?: NetworkFunctionDefinitionVersionsUpdateStateOptionalParams) => Promise, NetworkFunctionDefinitionVersionUpdateState>>; + // @deprecated (undocumented) + beginUpdateStateAndWait: (resourceGroupName: string, publisherName: string, networkFunctionDefinitionGroupName: string, networkFunctionDefinitionVersionName: string, parameters: NetworkFunctionDefinitionVersionUpdateState, options?: NetworkFunctionDefinitionVersionsUpdateStateOptionalParams) => Promise; + createOrUpdate: (resourceGroupName: string, publisherName: string, networkFunctionDefinitionGroupName: string, networkFunctionDefinitionVersionName: string, parameters: NetworkFunctionDefinitionVersion, options?: NetworkFunctionDefinitionVersionsCreateOrUpdateOptionalParams) => PollerLike, NetworkFunctionDefinitionVersion>; + delete: (resourceGroupName: string, publisherName: string, networkFunctionDefinitionGroupName: string, networkFunctionDefinitionVersionName: string, options?: NetworkFunctionDefinitionVersionsDeleteOptionalParams) => PollerLike, void>; + get: (resourceGroupName: string, publisherName: string, networkFunctionDefinitionGroupName: string, networkFunctionDefinitionVersionName: string, options?: NetworkFunctionDefinitionVersionsGetOptionalParams) => Promise; + listByNetworkFunctionDefinitionGroup: (resourceGroupName: string, publisherName: string, networkFunctionDefinitionGroupName: string, options?: NetworkFunctionDefinitionVersionsListByNetworkFunctionDefinitionGroupOptionalParams) => PagedAsyncIterableIterator; + update: (resourceGroupName: string, publisherName: string, networkFunctionDefinitionGroupName: string, networkFunctionDefinitionVersionName: string, parameters: TagsObject, options?: NetworkFunctionDefinitionVersionsUpdateOptionalParams) => Promise; + updateState: (resourceGroupName: string, publisherName: string, networkFunctionDefinitionGroupName: string, networkFunctionDefinitionVersionName: string, parameters: NetworkFunctionDefinitionVersionUpdateState, options?: NetworkFunctionDefinitionVersionsUpdateStateOptionalParams) => PollerLike, NetworkFunctionDefinitionVersionUpdateState>; +} + +// @public +export interface NetworkFunctionDefinitionVersionsUpdateOptionalParams extends OperationOptions { +} + +// @public +export interface NetworkFunctionDefinitionVersionsUpdateStateOptionalParams extends OperationOptions { + updateIntervalInMs?: number; +} + +// @public +export interface NetworkFunctionDefinitionVersionUpdateState { + versionState?: VersionState; +} + +// @public +export interface NetworkFunctionPropertiesFormat { + allowSoftwareUpdate?: boolean; + configurationType: NetworkFunctionConfigurationType; + networkFunctionDefinitionGroupName?: string; + networkFunctionDefinitionOfferingLocation?: string; + networkFunctionDefinitionVersion?: string; + networkFunctionDefinitionVersionResourceReference?: DeploymentResourceIdReferenceUnion; + nfviId?: string; + nfviType?: NfviType; + readonly provisioningState?: ProvisioningState; + publisherName?: string; + publisherScope?: PublisherScope; + roleOverrideValues?: string[]; +} + +// @public +export type NetworkFunctionPropertiesFormatUnion = NetworkFunctionValueWithSecrets | NetworkFunctionValueWithoutSecrets | NetworkFunctionPropertiesFormat; + +// @public +export interface NetworkFunctionsCreateOrUpdateOptionalParams extends OperationOptions { + updateIntervalInMs?: number; +} + +// @public +export interface NetworkFunctionsDeleteOptionalParams extends OperationOptions { + updateIntervalInMs?: number; +} + +// @public +export interface NetworkFunctionsExecuteRequestOptionalParams extends OperationOptions { + updateIntervalInMs?: number; +} + +// @public +export interface NetworkFunctionsGetOptionalParams extends OperationOptions { +} + +// @public +export interface NetworkFunctionsListByResourceGroupOptionalParams extends OperationOptions { +} + +// @public +export interface NetworkFunctionsListBySubscriptionOptionalParams extends OperationOptions { +} + +// @public +export interface NetworkFunctionsOperations { + // @deprecated (undocumented) + beginCreateOrUpdate: (resourceGroupName: string, networkFunctionName: string, parameters: NetworkFunction, options?: NetworkFunctionsCreateOrUpdateOptionalParams) => Promise, NetworkFunction>>; + // @deprecated (undocumented) + beginCreateOrUpdateAndWait: (resourceGroupName: string, networkFunctionName: string, parameters: NetworkFunction, options?: NetworkFunctionsCreateOrUpdateOptionalParams) => Promise; + // @deprecated (undocumented) + beginDelete: (resourceGroupName: string, networkFunctionName: string, options?: NetworkFunctionsDeleteOptionalParams) => Promise, void>>; + // @deprecated (undocumented) + beginDeleteAndWait: (resourceGroupName: string, networkFunctionName: string, options?: NetworkFunctionsDeleteOptionalParams) => Promise; + // @deprecated (undocumented) + beginExecuteRequest: (resourceGroupName: string, networkFunctionName: string, parameters: ExecuteRequestParameters, options?: NetworkFunctionsExecuteRequestOptionalParams) => Promise, void>>; + // @deprecated (undocumented) + beginExecuteRequestAndWait: (resourceGroupName: string, networkFunctionName: string, parameters: ExecuteRequestParameters, options?: NetworkFunctionsExecuteRequestOptionalParams) => Promise; + createOrUpdate: (resourceGroupName: string, networkFunctionName: string, parameters: NetworkFunction, options?: NetworkFunctionsCreateOrUpdateOptionalParams) => PollerLike, NetworkFunction>; + delete: (resourceGroupName: string, networkFunctionName: string, options?: NetworkFunctionsDeleteOptionalParams) => PollerLike, void>; + executeRequest: (resourceGroupName: string, networkFunctionName: string, parameters: ExecuteRequestParameters, options?: NetworkFunctionsExecuteRequestOptionalParams) => PollerLike, void>; + get: (resourceGroupName: string, networkFunctionName: string, options?: NetworkFunctionsGetOptionalParams) => Promise; + listByResourceGroup: (resourceGroupName: string, options?: NetworkFunctionsListByResourceGroupOptionalParams) => PagedAsyncIterableIterator; + listBySubscription: (options?: NetworkFunctionsListBySubscriptionOptionalParams) => PagedAsyncIterableIterator; + updateTags: (resourceGroupName: string, networkFunctionName: string, parameters: TagsObject, options?: NetworkFunctionsUpdateTagsOptionalParams) => Promise; +} + +// @public +export interface NetworkFunctionsUpdateTagsOptionalParams extends OperationOptions { +} + +// @public +export type NetworkFunctionType = string; + +// @public +export interface NetworkFunctionValueWithoutSecrets extends NetworkFunctionPropertiesFormat { + configurationType: "Open"; + deploymentValues?: string; +} + +// @public +export interface NetworkFunctionValueWithSecrets extends NetworkFunctionPropertiesFormat { + configurationType: "Secret"; + secretDeploymentValues?: string; +} + +// @public +export interface NetworkServiceDesignGroup extends TrackedResource { + properties?: NetworkServiceDesignGroupPropertiesFormat; +} + +// @public +export interface NetworkServiceDesignGroupPropertiesFormat { + description?: string; + readonly provisioningState?: ProvisioningState; +} + +// @public +export interface NetworkServiceDesignGroupsCreateOrUpdateOptionalParams extends OperationOptions { + updateIntervalInMs?: number; +} + +// @public +export interface NetworkServiceDesignGroupsDeleteOptionalParams extends OperationOptions { + updateIntervalInMs?: number; +} + +// @public +export interface NetworkServiceDesignGroupsGetOptionalParams extends OperationOptions { +} + +// @public +export interface NetworkServiceDesignGroupsListByPublisherOptionalParams extends OperationOptions { +} + +// @public +export interface NetworkServiceDesignGroupsOperations { + // @deprecated (undocumented) + beginCreateOrUpdate: (resourceGroupName: string, publisherName: string, networkServiceDesignGroupName: string, parameters: NetworkServiceDesignGroup, options?: NetworkServiceDesignGroupsCreateOrUpdateOptionalParams) => Promise, NetworkServiceDesignGroup>>; + // @deprecated (undocumented) + beginCreateOrUpdateAndWait: (resourceGroupName: string, publisherName: string, networkServiceDesignGroupName: string, parameters: NetworkServiceDesignGroup, options?: NetworkServiceDesignGroupsCreateOrUpdateOptionalParams) => Promise; + // @deprecated (undocumented) + beginDelete: (resourceGroupName: string, publisherName: string, networkServiceDesignGroupName: string, options?: NetworkServiceDesignGroupsDeleteOptionalParams) => Promise, void>>; + // @deprecated (undocumented) + beginDeleteAndWait: (resourceGroupName: string, publisherName: string, networkServiceDesignGroupName: string, options?: NetworkServiceDesignGroupsDeleteOptionalParams) => Promise; + createOrUpdate: (resourceGroupName: string, publisherName: string, networkServiceDesignGroupName: string, parameters: NetworkServiceDesignGroup, options?: NetworkServiceDesignGroupsCreateOrUpdateOptionalParams) => PollerLike, NetworkServiceDesignGroup>; + delete: (resourceGroupName: string, publisherName: string, networkServiceDesignGroupName: string, options?: NetworkServiceDesignGroupsDeleteOptionalParams) => PollerLike, void>; + get: (resourceGroupName: string, publisherName: string, networkServiceDesignGroupName: string, options?: NetworkServiceDesignGroupsGetOptionalParams) => Promise; + listByPublisher: (resourceGroupName: string, publisherName: string, options?: NetworkServiceDesignGroupsListByPublisherOptionalParams) => PagedAsyncIterableIterator; + update: (resourceGroupName: string, publisherName: string, networkServiceDesignGroupName: string, parameters: TagsObject, options?: NetworkServiceDesignGroupsUpdateOptionalParams) => Promise; +} + +// @public +export interface NetworkServiceDesignGroupsUpdateOptionalParams extends OperationOptions { +} + +// @public +export interface NetworkServiceDesignVersion extends TrackedResource { + properties?: NetworkServiceDesignVersionPropertiesFormat; +} + +// @public +export interface NetworkServiceDesignVersionPropertiesFormat { + configurationGroupSchemaReferences?: Record; + description?: string; + nfvisFromSite?: Record; + readonly provisioningState?: ProvisioningState; + resourceElementTemplates?: ResourceElementTemplateUnion[]; + readonly versionState?: VersionState; +} + +// @public +export interface NetworkServiceDesignVersionsCreateOrUpdateOptionalParams extends OperationOptions { + updateIntervalInMs?: number; +} + +// @public +export interface NetworkServiceDesignVersionsDeleteOptionalParams extends OperationOptions { + updateIntervalInMs?: number; +} + +// @public +export interface NetworkServiceDesignVersionsGetOptionalParams extends OperationOptions { +} + +// @public +export interface NetworkServiceDesignVersionsListByNetworkServiceDesignGroupOptionalParams extends OperationOptions { +} + +// @public +export interface NetworkServiceDesignVersionsOperations { + // @deprecated (undocumented) + beginCreateOrUpdate: (resourceGroupName: string, publisherName: string, networkServiceDesignGroupName: string, networkServiceDesignVersionName: string, parameters: NetworkServiceDesignVersion, options?: NetworkServiceDesignVersionsCreateOrUpdateOptionalParams) => Promise, NetworkServiceDesignVersion>>; + // @deprecated (undocumented) + beginCreateOrUpdateAndWait: (resourceGroupName: string, publisherName: string, networkServiceDesignGroupName: string, networkServiceDesignVersionName: string, parameters: NetworkServiceDesignVersion, options?: NetworkServiceDesignVersionsCreateOrUpdateOptionalParams) => Promise; + // @deprecated (undocumented) + beginDelete: (resourceGroupName: string, publisherName: string, networkServiceDesignGroupName: string, networkServiceDesignVersionName: string, options?: NetworkServiceDesignVersionsDeleteOptionalParams) => Promise, void>>; + // @deprecated (undocumented) + beginDeleteAndWait: (resourceGroupName: string, publisherName: string, networkServiceDesignGroupName: string, networkServiceDesignVersionName: string, options?: NetworkServiceDesignVersionsDeleteOptionalParams) => Promise; + // @deprecated (undocumented) + beginUpdateState: (resourceGroupName: string, publisherName: string, networkServiceDesignGroupName: string, networkServiceDesignVersionName: string, parameters: NetworkServiceDesignVersionUpdateState, options?: NetworkServiceDesignVersionsUpdateStateOptionalParams) => Promise, NetworkServiceDesignVersionUpdateState>>; + // @deprecated (undocumented) + beginUpdateStateAndWait: (resourceGroupName: string, publisherName: string, networkServiceDesignGroupName: string, networkServiceDesignVersionName: string, parameters: NetworkServiceDesignVersionUpdateState, options?: NetworkServiceDesignVersionsUpdateStateOptionalParams) => Promise; + createOrUpdate: (resourceGroupName: string, publisherName: string, networkServiceDesignGroupName: string, networkServiceDesignVersionName: string, parameters: NetworkServiceDesignVersion, options?: NetworkServiceDesignVersionsCreateOrUpdateOptionalParams) => PollerLike, NetworkServiceDesignVersion>; + delete: (resourceGroupName: string, publisherName: string, networkServiceDesignGroupName: string, networkServiceDesignVersionName: string, options?: NetworkServiceDesignVersionsDeleteOptionalParams) => PollerLike, void>; + get: (resourceGroupName: string, publisherName: string, networkServiceDesignGroupName: string, networkServiceDesignVersionName: string, options?: NetworkServiceDesignVersionsGetOptionalParams) => Promise; + listByNetworkServiceDesignGroup: (resourceGroupName: string, publisherName: string, networkServiceDesignGroupName: string, options?: NetworkServiceDesignVersionsListByNetworkServiceDesignGroupOptionalParams) => PagedAsyncIterableIterator; + update: (resourceGroupName: string, publisherName: string, networkServiceDesignGroupName: string, networkServiceDesignVersionName: string, parameters: TagsObject, options?: NetworkServiceDesignVersionsUpdateOptionalParams) => Promise; + updateState: (resourceGroupName: string, publisherName: string, networkServiceDesignGroupName: string, networkServiceDesignVersionName: string, parameters: NetworkServiceDesignVersionUpdateState, options?: NetworkServiceDesignVersionsUpdateStateOptionalParams) => PollerLike, NetworkServiceDesignVersionUpdateState>; +} + +// @public +export interface NetworkServiceDesignVersionsUpdateOptionalParams extends OperationOptions { +} + +// @public +export interface NetworkServiceDesignVersionsUpdateStateOptionalParams extends OperationOptions { + updateIntervalInMs?: number; +} + +// @public +export interface NetworkServiceDesignVersionUpdateState { + versionState?: VersionState; +} + +// @public +export interface NfviDetails { + name?: string; + type?: string; +} + +// @public +export interface NFVIs { + name?: string; + nfviType: NfviType; +} + +// @public +export type NFVIsUnion = AzureCoreNfviDetails | AzureArcK8SClusterNfviDetails | AzureOperatorNexusClusterNfviDetails | NFVIs; + +// @public +export type NfviType = string; + +// @public +export interface NSDArtifactProfile { + artifactName?: string; + artifactStoreReference?: ReferencedResource; + artifactVersion?: string; +} + +// @public +export interface OpenDeploymentResourceReference extends DeploymentResourceIdReference { + id?: string; + idType: "Open"; +} + +// @public +export interface Operation { + readonly actionType?: ActionType; + display?: OperationDisplay; + readonly isDataAction?: boolean; + readonly name?: string; + readonly origin?: Origin; +} + +// @public +export interface OperationDisplay { + readonly description?: string; + readonly operation?: string; + readonly provider?: string; + readonly resource?: string; +} + +// @public +export interface OperationsListOptionalParams extends OperationOptions { +} + +// @public +export interface OperationsOperations { + list: (options?: OperationsListOptionalParams) => PagedAsyncIterableIterator; +} + +// @public +export type Origin = string; + +// @public +export interface PagedAsyncIterableIterator { + [Symbol.asyncIterator](): PagedAsyncIterableIterator; + byPage: (settings?: TPageSettings) => AsyncIterableIterator>; + next(): Promise>; +} + +// @public +export interface PageSettings { + continuationToken?: string; +} + +// @public +export interface Pod { + creationTime?: Date; + desired?: number; + events?: PodEvent[]; + name?: string; + namespace?: string; + ready?: number; + status?: PodStatus; +} + +// @public +export interface PodEvent { + lastSeenTime?: Date; + message?: string; + reason?: string; + type?: PodEventType; +} + +// @public +export type PodEventType = string; + +// @public +export type PodStatus = string; + +// @public +export type ProvisioningState = string; + +// @public +export interface ProxyArtifactGetOptionalParams extends OperationOptions { +} + +// @public +export interface ProxyArtifactListOptionalParams extends OperationOptions { +} + +// @public +export interface ProxyArtifactListOverview extends ProxyResource { +} + +// @public +export interface ProxyArtifactOperations { + // @deprecated (undocumented) + beginUpdateState: (resourceGroupName: string, publisherName: string, artifactStoreName: string, artifactName: string, artifactVersionName: string, parameters: ArtifactChangeState, options?: ProxyArtifactUpdateStateOptionalParams) => Promise, ProxyArtifactVersionsListOverview>>; + // @deprecated (undocumented) + beginUpdateStateAndWait: (resourceGroupName: string, publisherName: string, artifactStoreName: string, artifactName: string, artifactVersionName: string, parameters: ArtifactChangeState, options?: ProxyArtifactUpdateStateOptionalParams) => Promise; + get: (resourceGroupName: string, publisherName: string, artifactStoreName: string, artifactName: string, options?: ProxyArtifactGetOptionalParams) => PagedAsyncIterableIterator; + list: (resourceGroupName: string, publisherName: string, artifactStoreName: string, options?: ProxyArtifactListOptionalParams) => PagedAsyncIterableIterator; + updateState: (resourceGroupName: string, publisherName: string, artifactStoreName: string, artifactName: string, artifactVersionName: string, parameters: ArtifactChangeState, options?: ProxyArtifactUpdateStateOptionalParams) => PollerLike, ProxyArtifactVersionsListOverview>; +} + +// @public +export interface ProxyArtifactOverviewPropertiesValue { + artifactState?: ArtifactState; + artifactType?: ArtifactType; + artifactVersion?: string; +} + +// @public +export interface ProxyArtifactUpdateStateOptionalParams extends OperationOptions { + updateIntervalInMs?: number; +} + +// @public +export interface ProxyArtifactVersionsListOverview extends ProxyResource { + readonly properties?: ProxyArtifactOverviewPropertiesValue; +} + +// @public +export interface ProxyResource extends Resource { +} + +// @public +export interface Publisher extends TrackedResource { + identity?: ManagedServiceIdentity; + properties?: PublisherPropertiesFormat; +} + +// @public +export interface PublisherPropertiesFormat { + readonly provisioningState?: ProvisioningState; + scope?: PublisherScope; +} + +// @public +export type PublisherScope = string; + +// @public +export interface PublishersCreateOrUpdateOptionalParams extends OperationOptions { + parameters?: Publisher; + updateIntervalInMs?: number; +} + +// @public +export interface PublishersDeleteOptionalParams extends OperationOptions { + updateIntervalInMs?: number; +} + +// @public +export interface PublishersGetOptionalParams extends OperationOptions { +} + +// @public +export interface PublishersListByResourceGroupOptionalParams extends OperationOptions { +} + +// @public +export interface PublishersListBySubscriptionOptionalParams extends OperationOptions { +} + +// @public +export interface PublishersOperations { + // @deprecated (undocumented) + beginCreateOrUpdate: (resourceGroupName: string, publisherName: string, options?: PublishersCreateOrUpdateOptionalParams) => Promise, Publisher>>; + // @deprecated (undocumented) + beginCreateOrUpdateAndWait: (resourceGroupName: string, publisherName: string, options?: PublishersCreateOrUpdateOptionalParams) => Promise; + // @deprecated (undocumented) + beginDelete: (resourceGroupName: string, publisherName: string, options?: PublishersDeleteOptionalParams) => Promise, void>>; + // @deprecated (undocumented) + beginDeleteAndWait: (resourceGroupName: string, publisherName: string, options?: PublishersDeleteOptionalParams) => Promise; + createOrUpdate: (resourceGroupName: string, publisherName: string, options?: PublishersCreateOrUpdateOptionalParams) => PollerLike, Publisher>; + delete: (resourceGroupName: string, publisherName: string, options?: PublishersDeleteOptionalParams) => PollerLike, void>; + get: (resourceGroupName: string, publisherName: string, options?: PublishersGetOptionalParams) => Promise; + listByResourceGroup: (resourceGroupName: string, options?: PublishersListByResourceGroupOptionalParams) => PagedAsyncIterableIterator; + listBySubscription: (options?: PublishersListBySubscriptionOptionalParams) => PagedAsyncIterableIterator; + update: (resourceGroupName: string, publisherName: string, options?: PublishersUpdateOptionalParams) => Promise; +} + +// @public +export interface PublishersUpdateOptionalParams extends OperationOptions { + parameters?: TagsObject; +} + +// @public +export interface ReferencedResource { + id?: string; +} + +// @public +export interface ReplicaSet { + creationTime?: Date; + current?: number; + desired?: number; + name?: string; + namespace?: string; + ready?: number; +} + +// @public +export interface RequestMetadata { + apiVersion?: string; + httpMethod: HttpMethod; + relativePath: string; + serializedBody: string; +} + +// @public +export interface Resource { + readonly id?: string; + readonly name?: string; + readonly systemData?: SystemData; + readonly type?: string; +} + +// @public +export interface ResourceElementTemplate { + dependsOnProfile?: DependsOnProfile; + name?: string; + resourceElementType: Type; +} + +// @public +export type ResourceElementTemplateUnion = ArmResourceDefinitionResourceElementTemplateDetails | NetworkFunctionDefinitionResourceElementTemplateDetails | ResourceElementTemplate; + +// @public +export interface Resources { + daemonSets?: DaemonSet[]; + deployments?: Deployment[]; + pods?: Pod[]; + replicaSets?: ReplicaSet[]; + statefulSets?: StatefulSet[]; +} + +// @public +export function restorePoller(client: HybridNetworkManagementClient, serializedState: string, sourceOperation: (...args: any[]) => PollerLike, TResult>, options?: RestorePollerOptions): PollerLike, TResult>; + +// @public (undocumented) +export interface RestorePollerOptions extends OperationOptions { + abortSignal?: AbortSignalLike; + processResponseBody?: (result: TResponse) => Promise; + updateIntervalInMs?: number; +} + +// @public +export interface SecretDeploymentResourceReference extends DeploymentResourceIdReference { + id?: string; + idType: "Secret"; +} + +// @public +export interface SimplePollerLike, TResult> { + getOperationState(): TState; + getResult(): TResult | undefined; + isDone(): boolean; + // @deprecated + isStopped(): boolean; + onProgress(callback: (state: TState) => void): CancelOnProgress; + poll(options?: { + abortSignal?: AbortSignalLike; + }): Promise; + pollUntilDone(pollOptions?: { + abortSignal?: AbortSignalLike; + }): Promise; + serialize(): Promise; + // @deprecated + stopPolling(): void; + submitted(): Promise; + // @deprecated + toString(): string; +} + +// @public +export interface Site extends TrackedResource { + properties?: SitePropertiesFormat; +} + +// @public +export interface SiteNetworkService extends TrackedResource { + identity?: ManagedServiceIdentity; + properties?: SiteNetworkServicePropertiesFormat; + sku?: Sku; +} + +// @public +export interface SiteNetworkServicePropertiesFormat { + desiredStateConfigurationGroupValueReferences?: Record; + readonly lastStateConfigurationGroupValueReferences?: Record; + readonly lastStateNetworkServiceDesignVersionName?: string; + managedResourceGroupConfiguration?: ManagedResourceGroupConfiguration; + readonly networkServiceDesignGroupName?: string; + readonly networkServiceDesignVersionName?: string; + readonly networkServiceDesignVersionOfferingLocation?: string; + networkServiceDesignVersionResourceReference?: DeploymentResourceIdReferenceUnion; + readonly provisioningState?: ProvisioningState; + readonly publisherName?: string; + readonly publisherScope?: PublisherScope; + siteReference?: ReferencedResource; +} + +// @public +export interface SiteNetworkServicesCancelOperationOptionalParams extends OperationOptions { + updateIntervalInMs?: number; +} + +// @public +export interface SiteNetworkServicesCreateOrUpdateOptionalParams extends OperationOptions { + updateIntervalInMs?: number; +} + +// @public +export interface SiteNetworkServicesDeleteOptionalParams extends OperationOptions { + updateIntervalInMs?: number; +} + +// @public +export interface SiteNetworkServicesGetOptionalParams extends OperationOptions { +} + +// @public +export interface SiteNetworkServicesListByResourceGroupOptionalParams extends OperationOptions { +} + +// @public +export interface SiteNetworkServicesListBySubscriptionOptionalParams extends OperationOptions { +} + +// @public +export interface SiteNetworkServicesOperations { + // @deprecated (undocumented) + beginCancelOperation: (parameters: CancelInformation, options?: SiteNetworkServicesCancelOperationOptionalParams) => Promise, void>>; + // @deprecated (undocumented) + beginCancelOperationAndWait: (parameters: CancelInformation, options?: SiteNetworkServicesCancelOperationOptionalParams) => Promise; + // @deprecated (undocumented) + beginCreateOrUpdate: (resourceGroupName: string, siteNetworkServiceName: string, parameters: SiteNetworkService, options?: SiteNetworkServicesCreateOrUpdateOptionalParams) => Promise, SiteNetworkService>>; + // @deprecated (undocumented) + beginCreateOrUpdateAndWait: (resourceGroupName: string, siteNetworkServiceName: string, parameters: SiteNetworkService, options?: SiteNetworkServicesCreateOrUpdateOptionalParams) => Promise; + // @deprecated (undocumented) + beginDelete: (resourceGroupName: string, siteNetworkServiceName: string, options?: SiteNetworkServicesDeleteOptionalParams) => Promise, void>>; + // @deprecated (undocumented) + beginDeleteAndWait: (resourceGroupName: string, siteNetworkServiceName: string, options?: SiteNetworkServicesDeleteOptionalParams) => Promise; + cancelOperation: (parameters: CancelInformation, options?: SiteNetworkServicesCancelOperationOptionalParams) => PollerLike, void>; + createOrUpdate: (resourceGroupName: string, siteNetworkServiceName: string, parameters: SiteNetworkService, options?: SiteNetworkServicesCreateOrUpdateOptionalParams) => PollerLike, SiteNetworkService>; + delete: (resourceGroupName: string, siteNetworkServiceName: string, options?: SiteNetworkServicesDeleteOptionalParams) => PollerLike, void>; + get: (resourceGroupName: string, siteNetworkServiceName: string, options?: SiteNetworkServicesGetOptionalParams) => Promise; + listByResourceGroup: (resourceGroupName: string, options?: SiteNetworkServicesListByResourceGroupOptionalParams) => PagedAsyncIterableIterator; + listBySubscription: (options?: SiteNetworkServicesListBySubscriptionOptionalParams) => PagedAsyncIterableIterator; + updateTags: (resourceGroupName: string, siteNetworkServiceName: string, parameters: TagsObject, options?: SiteNetworkServicesUpdateTagsOptionalParams) => Promise; +} + +// @public +export interface SiteNetworkServicesUpdateTagsOptionalParams extends OperationOptions { +} + +// @public +export interface SitePropertiesFormat { + nfvis?: NFVIsUnion[]; + readonly provisioningState?: ProvisioningState; + readonly siteNetworkServiceReferences?: ReferencedResource[]; +} + +// @public +export interface SitesCreateOrUpdateOptionalParams extends OperationOptions { + updateIntervalInMs?: number; +} + +// @public +export interface SitesDeleteOptionalParams extends OperationOptions { + updateIntervalInMs?: number; +} + +// @public +export interface SitesGetOptionalParams extends OperationOptions { +} + +// @public +export interface SitesListByResourceGroupOptionalParams extends OperationOptions { +} + +// @public +export interface SitesListBySubscriptionOptionalParams extends OperationOptions { +} + +// @public +export interface SitesOperations { + // @deprecated (undocumented) + beginCreateOrUpdate: (resourceGroupName: string, siteName: string, parameters: Site, options?: SitesCreateOrUpdateOptionalParams) => Promise, Site>>; + // @deprecated (undocumented) + beginCreateOrUpdateAndWait: (resourceGroupName: string, siteName: string, parameters: Site, options?: SitesCreateOrUpdateOptionalParams) => Promise; + // @deprecated (undocumented) + beginDelete: (resourceGroupName: string, siteName: string, options?: SitesDeleteOptionalParams) => Promise, void>>; + // @deprecated (undocumented) + beginDeleteAndWait: (resourceGroupName: string, siteName: string, options?: SitesDeleteOptionalParams) => Promise; + createOrUpdate: (resourceGroupName: string, siteName: string, parameters: Site, options?: SitesCreateOrUpdateOptionalParams) => PollerLike, Site>; + delete: (resourceGroupName: string, siteName: string, options?: SitesDeleteOptionalParams) => PollerLike, void>; + get: (resourceGroupName: string, siteName: string, options?: SitesGetOptionalParams) => Promise; + listByResourceGroup: (resourceGroupName: string, options?: SitesListByResourceGroupOptionalParams) => PagedAsyncIterableIterator; + listBySubscription: (options?: SitesListBySubscriptionOptionalParams) => PagedAsyncIterableIterator; + updateTags: (resourceGroupName: string, siteName: string, parameters: TagsObject, options?: SitesUpdateTagsOptionalParams) => Promise; +} + +// @public +export interface SitesUpdateTagsOptionalParams extends OperationOptions { +} + +// @public +export interface Sku { + name: SkuName; + readonly tier?: SkuTier; +} + +// @public +export type SkuName = string; + +// @public +export type SkuTier = string; + +// @public +export interface StatefulSet { + creationTime?: Date; + desired?: number; + name?: string; + namespace?: string; + ready?: number; +} + +// @public +export type Status = string; + +// @public +export interface SystemData { + createdAt?: Date; + createdBy?: string; + createdByType?: CreatedByType; + lastModifiedAt?: Date; + lastModifiedBy?: string; + lastModifiedByType?: CreatedByType; +} + +// @public +export interface TagsObject { + tags?: Record; +} + +// @public +export type TemplateType = string; + +// @public +export interface TrackedResource extends Resource { + location: string; + tags?: Record; +} + +// @public +export type Type = string; + +// @public +export interface UserAssignedIdentity { + readonly clientId?: string; + readonly principalId?: string; +} + +// @public +export type VersionState = string; + +// @public +export interface VhdImageArtifactProfile { + vhdName?: string; + vhdVersion?: string; +} + +// @public +export interface VhdImageMappingRuleProfile { + userConfiguration?: string; +} + +// @public +export interface VirtualNetworkFunctionNetworkFunctionDefinitionVersion extends NetworkFunctionDefinitionVersionPropertiesFormat { + networkFunctionTemplate?: VirtualNetworkFunctionTemplateUnion; + networkFunctionType: "VirtualNetworkFunction"; +} + +// @public +export type VirtualNetworkFunctionNfviType = string; + +// @public +export interface VirtualNetworkFunctionTemplate { + nfviType: VirtualNetworkFunctionNfviType; +} + +// @public +export type VirtualNetworkFunctionTemplateUnion = AzureCoreNetworkFunctionTemplate | AzureOperatorNexusNetworkFunctionTemplate | VirtualNetworkFunctionTemplate; + +// (No @packageDocumentation comment for this package) + +``` diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/rollup.config.js b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/rollup.config.js new file mode 100644 index 0000000000..92fab887b9 --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/rollup.config.js @@ -0,0 +1,117 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import nodeResolve from "@rollup/plugin-node-resolve"; +import cjs from "@rollup/plugin-commonjs"; +import sourcemaps from "rollup-plugin-sourcemaps"; +import multiEntry from "@rollup/plugin-multi-entry"; +import json from "@rollup/plugin-json"; + +import nodeBuiltins from "builtin-modules"; + +// #region Warning Handler + +/** + * A function that can determine whether a rollup warning should be ignored. If + * the function returns `true`, then the warning will not be displayed. + */ + +function ignoreNiseSinonEval(warning) { + return ( + warning.code === "EVAL" && + warning.id && + (warning.id.includes("node_modules/nise") || warning.id.includes("node_modules/sinon")) === true + ); +} + +function ignoreChaiCircularDependency(warning) { + return ( + warning.code === "CIRCULAR_DEPENDENCY" && + warning.importer && + warning.importer.includes("node_modules/chai") === true + ); +} + +const warningInhibitors = [ignoreChaiCircularDependency, ignoreNiseSinonEval]; + +/** + * Construct a warning handler for the shared rollup configuration + * that ignores certain warnings that are not relevant to testing. + */ +function makeOnWarnForTesting() { + return (warning, warn) => { + // If every inhibitor returns false (i.e. no inhibitors), then show the warning + if (warningInhibitors.every((inhib) => !inhib(warning))) { + warn(warning); + } + }; +} + +// #endregion + +function makeBrowserTestConfig() { + const config = { + input: { + include: ["dist-esm/test/**/*.spec.js"], + exclude: ["dist-esm/test/**/node/**"], + }, + output: { + file: `dist-test/index.browser.js`, + format: "umd", + sourcemap: true, + }, + preserveSymlinks: false, + plugins: [ + multiEntry({ exports: false }), + nodeResolve({ + mainFields: ["module", "browser"], + }), + cjs(), + json(), + sourcemaps(), + //viz({ filename: "dist-test/browser-stats.html", sourcemap: true }) + ], + onwarn: makeOnWarnForTesting(), + // Disable tree-shaking of test code. In rollup-plugin-node-resolve@5.0.0, + // rollup started respecting the "sideEffects" field in package.json. Since + // our package.json sets "sideEffects=false", this also applies to test + // code, which causes all tests to be removed by tree-shaking. + treeshake: false, + }; + + return config; +} + +const defaultConfigurationOptions = { + disableBrowserBundle: false, +}; + +export function makeConfig(pkg, options) { + options = { + ...defaultConfigurationOptions, + ...(options || {}), + }; + + const baseConfig = { + // Use the package's module field if it has one + input: pkg["module"] || "dist-esm/src/index.js", + external: [ + ...nodeBuiltins, + ...Object.keys(pkg.dependencies), + ...Object.keys(pkg.devDependencies), + ], + output: { file: "dist/index.js", format: "cjs", sourcemap: true }, + preserveSymlinks: false, + plugins: [sourcemaps(), nodeResolve()], + }; + + const config = [baseConfig]; + + if (!options.disableBrowserBundle) { + config.push(makeBrowserTestConfig()); + } + + return config; +} + +export default makeConfig(require("./package.json")); diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/sample.env b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/sample.env new file mode 100644 index 0000000000..508439fc7d --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/sample.env @@ -0,0 +1 @@ +# Feel free to add your own environment variables. \ No newline at end of file diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/artifactManifestsCreateOrUpdateSample.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/artifactManifestsCreateOrUpdateSample.ts new file mode 100644 index 0000000000..a2409cd0b7 --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/artifactManifestsCreateOrUpdateSample.ts @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { HybridNetworkManagementClient } from "@azure/arm-hybridnetwork"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to creates or updates a artifact manifest. + * + * @summary creates or updates a artifact manifest. + * x-ms-original-file: 2025-03-30/ArtifactManifestCreate.json + */ +async function createOrUpdateTheArtifactManifestResource(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subid"; + const client = new HybridNetworkManagementClient(credential, subscriptionId); + const result = await client.artifactManifests.createOrUpdate( + "rg", + "TestPublisher", + "TestArtifactStore", + "TestManifest", + { + location: "eastus", + properties: { + artifacts: [ + { artifactName: "fed-rbac", artifactType: "OCIArtifact", artifactVersion: "1.0.0" }, + { artifactName: "nginx", artifactType: "OCIArtifact", artifactVersion: "v1" }, + ], + }, + }, + ); + console.log(result); +} + +async function main(): Promise { + await createOrUpdateTheArtifactManifestResource(); +} + +main().catch(console.error); diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/artifactManifestsDeleteSample.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/artifactManifestsDeleteSample.ts new file mode 100644 index 0000000000..f43e5191c9 --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/artifactManifestsDeleteSample.ts @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { HybridNetworkManagementClient } from "@azure/arm-hybridnetwork"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to deletes the specified artifact manifest. + * + * @summary deletes the specified artifact manifest. + * x-ms-original-file: 2025-03-30/ArtifactManifestDelete.json + */ +async function deleteAArtifactManifestResource(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subid"; + const client = new HybridNetworkManagementClient(credential, subscriptionId); + await client.artifactManifests.delete("rg", "TestPublisher", "TestArtifactStore", "TestManifest"); +} + +async function main(): Promise { + await deleteAArtifactManifestResource(); +} + +main().catch(console.error); diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/artifactManifestsGetSample.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/artifactManifestsGetSample.ts new file mode 100644 index 0000000000..f7e65f1324 --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/artifactManifestsGetSample.ts @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { HybridNetworkManagementClient } from "@azure/arm-hybridnetwork"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to gets information about a artifact manifest resource. + * + * @summary gets information about a artifact manifest resource. + * x-ms-original-file: 2025-03-30/ArtifactManifestGet.json + */ +async function getAArtifactManifestResource(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subid"; + const client = new HybridNetworkManagementClient(credential, subscriptionId); + const result = await client.artifactManifests.get( + "rg", + "TestPublisher", + "TestArtifactStore", + "TestManifest", + ); + console.log(result); +} + +async function main(): Promise { + await getAArtifactManifestResource(); +} + +main().catch(console.error); diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/artifactManifestsListByArtifactStoreSample.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/artifactManifestsListByArtifactStoreSample.ts new file mode 100644 index 0000000000..bb23c1a113 --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/artifactManifestsListByArtifactStoreSample.ts @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { HybridNetworkManagementClient } from "@azure/arm-hybridnetwork"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to gets information about the artifact manifest. + * + * @summary gets information about the artifact manifest. + * x-ms-original-file: 2025-03-30/ArtifactManifestListByArtifactStore.json + */ +async function getArtifactManifestListResource(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subid"; + const client = new HybridNetworkManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.artifactManifests.listByArtifactStore( + "rg", + "TestPublisher", + "TestArtifactStore", + )) { + resArray.push(item); + } + + console.log(resArray); +} + +async function main(): Promise { + await getArtifactManifestListResource(); +} + +main().catch(console.error); diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/artifactManifestsListCredentialSample.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/artifactManifestsListCredentialSample.ts new file mode 100644 index 0000000000..40543ec274 --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/artifactManifestsListCredentialSample.ts @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { HybridNetworkManagementClient } from "@azure/arm-hybridnetwork"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to list credential for publishing artifacts defined in artifact manifest. + * + * @summary list credential for publishing artifacts defined in artifact manifest. + * x-ms-original-file: 2025-03-30/ArtifactManifestListCredential.json + */ +async function listACredentialForArtifactManifest(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subid"; + const client = new HybridNetworkManagementClient(credential, subscriptionId); + const result = await client.artifactManifests.listCredential( + "rg", + "TestPublisher", + "TestArtifactStore", + "TestArtifactManifestName", + ); + console.log(result); +} + +async function main(): Promise { + await listACredentialForArtifactManifest(); +} + +main().catch(console.error); diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/artifactManifestsUpdateSample.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/artifactManifestsUpdateSample.ts new file mode 100644 index 0000000000..cf81c0ae83 --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/artifactManifestsUpdateSample.ts @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { HybridNetworkManagementClient } from "@azure/arm-hybridnetwork"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to updates a artifact manifest resource. + * + * @summary updates a artifact manifest resource. + * x-ms-original-file: 2025-03-30/ArtifactManifestUpdateTags.json + */ +async function updateAArtifactManifestResourceTags(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subid"; + const client = new HybridNetworkManagementClient(credential, subscriptionId); + const result = await client.artifactManifests.update( + "rg", + "TestPublisher", + "TestArtifactStore", + "TestManifest", + { tags: { tag1: "value1", tag2: "value2" } }, + ); + console.log(result); +} + +async function main(): Promise { + await updateAArtifactManifestResourceTags(); +} + +main().catch(console.error); diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/artifactManifestsUpdateStateSample.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/artifactManifestsUpdateStateSample.ts new file mode 100644 index 0000000000..6061115f54 --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/artifactManifestsUpdateStateSample.ts @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { HybridNetworkManagementClient } from "@azure/arm-hybridnetwork"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to update state for artifact manifest. + * + * @summary update state for artifact manifest. + * x-ms-original-file: 2025-03-30/ArtifactManifestUpdateState.json + */ +async function updateArtifactManifestState(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subid"; + const client = new HybridNetworkManagementClient(credential, subscriptionId); + const result = await client.artifactManifests.updateState( + "rg", + "TestPublisher", + "TestArtifactStore", + "TestArtifactManifestName", + { artifactManifestState: "Uploaded" }, + ); + console.log(result); +} + +async function main(): Promise { + await updateArtifactManifestState(); +} + +main().catch(console.error); diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/artifactStoresAddNetworkFabricControllerEndPointsSample.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/artifactStoresAddNetworkFabricControllerEndPointsSample.ts new file mode 100644 index 0000000000..1e4614eb22 --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/artifactStoresAddNetworkFabricControllerEndPointsSample.ts @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { HybridNetworkManagementClient } from "@azure/arm-hybridnetwork"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to add network fabric controllers to artifact stores + * + * @summary add network fabric controllers to artifact stores + * x-ms-original-file: 2025-03-30/ArtifactStoreAddNFCEndPoints.json + */ +async function addNetworkFabricEndpoint(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subid"; + const client = new HybridNetworkManagementClient(credential, subscriptionId); + await client.artifactStores.addNetworkFabricControllerEndPoints( + "rg", + "TestPublisher", + "TestArtifactStore", + { + networkFabricControllerIds: [ + { + id: "/subscriptions/testsubid/resourceGroups/testNFCMRG/providers/Microsoft.ManagedNetworkFabric/networkFabricControllers/testNFCControllerId", + }, + ], + }, + ); +} + +async function main(): Promise { + await addNetworkFabricEndpoint(); +} + +main().catch(console.error); diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/artifactStoresApprovePrivateEndPointsSample.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/artifactStoresApprovePrivateEndPointsSample.ts new file mode 100644 index 0000000000..33fccff51c --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/artifactStoresApprovePrivateEndPointsSample.ts @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { HybridNetworkManagementClient } from "@azure/arm-hybridnetwork"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to approve manual private endpoints on artifact stores + * + * @summary approve manual private endpoints on artifact stores + * x-ms-original-file: 2025-03-30/ArtifactStoreApprovePrivateEndPoints.json + */ +async function approveManualPrivateEndpoints(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subid"; + const client = new HybridNetworkManagementClient(credential, subscriptionId); + await client.artifactStores.approvePrivateEndPoints("rg", "TestPublisher", "TestArtifactStore", { + manualPrivateEndPointConnections: [ + { + id: "/subscriptions/testSub/resourceGroups/testRG/providers/Microsoft.Network/privateEndpoints/newpetest", + }, + ], + }); +} + +async function main(): Promise { + await approveManualPrivateEndpoints(); +} + +main().catch(console.error); diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/artifactStoresCreateOrUpdateSample.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/artifactStoresCreateOrUpdateSample.ts new file mode 100644 index 0000000000..08d1d9259b --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/artifactStoresCreateOrUpdateSample.ts @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { HybridNetworkManagementClient } from "@azure/arm-hybridnetwork"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to creates or updates a artifact store. + * + * @summary creates or updates a artifact store. + * x-ms-original-file: 2025-03-30/ArtifactStoreCreate.json + */ +async function createOrUpdateAnArtifactStoreOfPublisherResource(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subid"; + const client = new HybridNetworkManagementClient(credential, subscriptionId); + const result = await client.artifactStores.createOrUpdate( + "rg", + "TestPublisher", + "TestArtifactStore", + { + location: "eastus", + properties: { + managedResourceGroupConfiguration: { name: "testRg", location: "eastus" }, + replicationStrategy: "SingleReplication", + storeType: "AzureContainerRegistry", + }, + }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to creates or updates a artifact store. + * + * @summary creates or updates a artifact store. + * x-ms-original-file: 2025-03-30/ArtifactStoreCreateContainer.json + */ +async function createOrUpdateAnArtifactStoreOfPublisherResourceWithContainerRegistry(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subid"; + const client = new HybridNetworkManagementClient(credential, subscriptionId); + const result = await client.artifactStores.createOrUpdate( + "rg", + "TestPublisher", + "TestArtifactStore", + { + location: "eastus", + properties: { + backingResourcePublicNetworkAccess: "Disabled", + managedResourceGroupConfiguration: { name: "testRg", location: "eastus" }, + replicationStrategy: "SingleReplication", + storeType: "AzureContainerRegistry", + }, + }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to creates or updates a artifact store. + * + * @summary creates or updates a artifact store. + * x-ms-original-file: 2025-03-30/ArtifactStoreCreateStorage.json + */ +async function createOrUpdateAnArtifactStoreOfPublisherResourceWithStorage(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subid"; + const client = new HybridNetworkManagementClient(credential, subscriptionId); + const result = await client.artifactStores.createOrUpdate( + "rg", + "TestPublisher", + "TestArtifactStore", + { + location: "eastus", + properties: { + backingResourcePublicNetworkAccess: "Enabled", + managedResourceGroupConfiguration: { name: "testRg", location: "eastus" }, + replicationStrategy: "SingleReplication", + storeType: "AzureStorageAccount", + }, + }, + ); + console.log(result); +} + +async function main(): Promise { + await createOrUpdateAnArtifactStoreOfPublisherResource(); + await createOrUpdateAnArtifactStoreOfPublisherResourceWithContainerRegistry(); + await createOrUpdateAnArtifactStoreOfPublisherResourceWithStorage(); +} + +main().catch(console.error); diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/artifactStoresDeleteNetworkFabricControllerEndPointsSample.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/artifactStoresDeleteNetworkFabricControllerEndPointsSample.ts new file mode 100644 index 0000000000..1efb4d7320 --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/artifactStoresDeleteNetworkFabricControllerEndPointsSample.ts @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { HybridNetworkManagementClient } from "@azure/arm-hybridnetwork"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to delete network fabric controllers on artifact stores + * + * @summary delete network fabric controllers on artifact stores + * x-ms-original-file: 2025-03-30/ArtifactStoreDeleteNFCEndPoints.json + */ +async function deleteNetworkFabricEndpoints(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subid"; + const client = new HybridNetworkManagementClient(credential, subscriptionId); + await client.artifactStores.deleteNetworkFabricControllerEndPoints( + "rg", + "TestPublisher", + "TestArtifactStore", + { + networkFabricControllerIds: [ + { + id: "/subscriptions/testsubid/resourceGroups/testNFCMRG/providers/Microsoft.ManagedNetworkFabric/networkFabricControllers/testNFCControllerId", + }, + ], + }, + ); +} + +async function main(): Promise { + await deleteNetworkFabricEndpoints(); +} + +main().catch(console.error); diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/artifactStoresDeleteSample.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/artifactStoresDeleteSample.ts new file mode 100644 index 0000000000..1d0bcf5007 --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/artifactStoresDeleteSample.ts @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { HybridNetworkManagementClient } from "@azure/arm-hybridnetwork"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to deletes the specified artifact store. + * + * @summary deletes the specified artifact store. + * x-ms-original-file: 2025-03-30/ArtifactStoreDelete.json + */ +async function deleteAArtifactStoreOfPublisherResource(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subid"; + const client = new HybridNetworkManagementClient(credential, subscriptionId); + await client.artifactStores.delete("rg", "TestPublisher", "TestArtifactStore"); +} + +async function main(): Promise { + await deleteAArtifactStoreOfPublisherResource(); +} + +main().catch(console.error); diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/artifactStoresGetSample.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/artifactStoresGetSample.ts new file mode 100644 index 0000000000..4d4f02b366 --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/artifactStoresGetSample.ts @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { HybridNetworkManagementClient } from "@azure/arm-hybridnetwork"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to gets information about the specified artifact store. + * + * @summary gets information about the specified artifact store. + * x-ms-original-file: 2025-03-30/ArtifactStoreGet.json + */ +async function getAArtifactStoreResource(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subid"; + const client = new HybridNetworkManagementClient(credential, subscriptionId); + const result = await client.artifactStores.get("rg", "TestPublisher", "TestArtifactStoreName"); + console.log(result); +} + +async function main(): Promise { + await getAArtifactStoreResource(); +} + +main().catch(console.error); diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/artifactStoresListByPublisherSample.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/artifactStoresListByPublisherSample.ts new file mode 100644 index 0000000000..886df7ff9e --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/artifactStoresListByPublisherSample.ts @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { HybridNetworkManagementClient } from "@azure/arm-hybridnetwork"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to gets information of the ArtifactStores under publisher. + * + * @summary gets information of the ArtifactStores under publisher. + * x-ms-original-file: 2025-03-30/ArtifactStoresListByPublisherName.json + */ +async function getApplicationGroupsUnderAPublisherResource(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subid"; + const client = new HybridNetworkManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.artifactStores.listByPublisher("rg", "TestPublisher")) { + resArray.push(item); + } + + console.log(resArray); +} + +async function main(): Promise { + await getApplicationGroupsUnderAPublisherResource(); +} + +main().catch(console.error); diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/artifactStoresListNetworkFabricControllerPrivateEndPointsSample.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/artifactStoresListNetworkFabricControllerPrivateEndPointsSample.ts new file mode 100644 index 0000000000..bb69b379c4 --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/artifactStoresListNetworkFabricControllerPrivateEndPointsSample.ts @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { HybridNetworkManagementClient } from "@azure/arm-hybridnetwork"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to list network fabric controllers to artifact stores + * + * @summary list network fabric controllers to artifact stores + * x-ms-original-file: 2025-03-30/ArtifactStoreListNFCEndPoints.json + */ +async function listNetworkFabricEndpoints(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subid"; + const client = new HybridNetworkManagementClient(credential, subscriptionId); + const result = await client.artifactStores.listNetworkFabricControllerPrivateEndPoints( + "rg", + "TestPublisher", + "TestArtifactStore", + ); + console.log(result); +} + +async function main(): Promise { + await listNetworkFabricEndpoints(); +} + +main().catch(console.error); diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/artifactStoresListPrivateEndPointsSample.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/artifactStoresListPrivateEndPointsSample.ts new file mode 100644 index 0000000000..4404e3489e --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/artifactStoresListPrivateEndPointsSample.ts @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { HybridNetworkManagementClient } from "@azure/arm-hybridnetwork"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to list manual private endpoints on artifact stores + * + * @summary list manual private endpoints on artifact stores + * x-ms-original-file: 2025-03-30/ArtifactStoreListPrivateEndPoints.json + */ +async function listManualPrivateEndpoints(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subid"; + const client = new HybridNetworkManagementClient(credential, subscriptionId); + const result = await client.artifactStores.listPrivateEndPoints( + "rg", + "TestPublisher", + "TestArtifactStore", + ); + console.log(result); +} + +async function main(): Promise { + await listManualPrivateEndpoints(); +} + +main().catch(console.error); diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/artifactStoresRemovePrivateEndPointsSample.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/artifactStoresRemovePrivateEndPointsSample.ts new file mode 100644 index 0000000000..e3c1e20d02 --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/artifactStoresRemovePrivateEndPointsSample.ts @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { HybridNetworkManagementClient } from "@azure/arm-hybridnetwork"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to remove manual private endpoints on artifact stores + * + * @summary remove manual private endpoints on artifact stores + * x-ms-original-file: 2025-03-30/ArtifactStoreRemovePrivateEndPoints.json + */ +async function removeManualEndpoint(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subid"; + const client = new HybridNetworkManagementClient(credential, subscriptionId); + await client.artifactStores.removePrivateEndPoints("rg", "TestPublisher", "TestArtifactStore", { + manualPrivateEndPointConnections: [ + { + id: "/subscriptions/testSub/resourceGroups/testRG/providers/Microsoft.Network/privateEndpoints/newpetest", + }, + ], + }); +} + +async function main(): Promise { + await removeManualEndpoint(); +} + +main().catch(console.error); diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/artifactStoresUpdateSample.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/artifactStoresUpdateSample.ts new file mode 100644 index 0000000000..2bb20c620a --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/artifactStoresUpdateSample.ts @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { HybridNetworkManagementClient } from "@azure/arm-hybridnetwork"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to update artifact store resource. + * + * @summary update artifact store resource. + * x-ms-original-file: 2025-03-30/ArtifactStoreUpdateTags.json + */ +async function updateArtifactStoreResourceTags(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subid"; + const client = new HybridNetworkManagementClient(credential, subscriptionId); + const result = await client.artifactStores.update("rg", "TestPublisher", "TestArtifactStore", { + tags: { tag1: "value1", tag2: "value2" }, + }); + console.log(result); +} + +async function main(): Promise { + await updateArtifactStoreResourceTags(); +} + +main().catch(console.error); diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/componentsGetSample.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/componentsGetSample.ts new file mode 100644 index 0000000000..1258b6a870 --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/componentsGetSample.ts @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { HybridNetworkManagementClient } from "@azure/arm-hybridnetwork"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to gets information about the specified application instance resource. + * + * @summary gets information about the specified application instance resource. + * x-ms-original-file: 2025-03-30/ComponentGet.json + */ +async function getComponentResource(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subid"; + const client = new HybridNetworkManagementClient(credential, subscriptionId); + const result = await client.components.get("rg", "testNf", "testComponent"); + console.log(result); +} + +async function main(): Promise { + await getComponentResource(); +} + +main().catch(console.error); diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/componentsListByNetworkFunctionSample.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/componentsListByNetworkFunctionSample.ts new file mode 100644 index 0000000000..d59853f195 --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/componentsListByNetworkFunctionSample.ts @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { HybridNetworkManagementClient } from "@azure/arm-hybridnetwork"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to lists all the component resources in a network function. + * + * @summary lists all the component resources in a network function. + * x-ms-original-file: 2025-03-30/ComponentListByNetworkFunction.json + */ +async function listComponentsInNetworkFunction(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subid"; + const client = new HybridNetworkManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.components.listByNetworkFunction("rg", "testNf")) { + resArray.push(item); + } + + console.log(resArray); +} + +async function main(): Promise { + await listComponentsInNetworkFunction(); +} + +main().catch(console.error); diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/configurationGroupSchemasCreateOrUpdateSample.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/configurationGroupSchemasCreateOrUpdateSample.ts new file mode 100644 index 0000000000..4bee4af5db --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/configurationGroupSchemasCreateOrUpdateSample.ts @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { HybridNetworkManagementClient } from "@azure/arm-hybridnetwork"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to creates or updates a configuration group schema. + * + * @summary creates or updates a configuration group schema. + * x-ms-original-file: 2025-03-30/ConfigurationGroupSchemaCreate.json + */ +async function createOrUpdateTheNetworkFunctionDefinitionGroup(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subid"; + const client = new HybridNetworkManagementClient(credential, subscriptionId); + const result = await client.configurationGroupSchemas.createOrUpdate( + "rg1", + "testPublisher", + "testConfigurationGroupSchema", + { + location: "westUs2", + properties: { + description: "Schema with no secrets", + schemaDefinition: + '{"type":"object","properties":{"interconnect-groups":{"type":"object","properties":{"type":"object","properties":{"name":{"type":"string"},"international-interconnects":{"type":"array","item":{"type":"string"}},"domestic-interconnects":{"type":"array","item":{"type":"string"}}}}},"interconnect-group-assignments":{"type":"object","properties":{"type":"object","properties":{"ssc":{"type":"string"},"interconnects-interconnects":{"type":"string"}}}}},"required":["interconnect-groups","interconnect-group-assignments"]}', + }, + }, + ); + console.log(result); +} + +async function main(): Promise { + await createOrUpdateTheNetworkFunctionDefinitionGroup(); +} + +main().catch(console.error); diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/configurationGroupSchemasDeleteSample.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/configurationGroupSchemasDeleteSample.ts new file mode 100644 index 0000000000..91e88a65a9 --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/configurationGroupSchemasDeleteSample.ts @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { HybridNetworkManagementClient } from "@azure/arm-hybridnetwork"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to deletes a specified configuration group schema. + * + * @summary deletes a specified configuration group schema. + * x-ms-original-file: 2025-03-30/ConfigurationGroupSchemaDelete.json + */ +async function deleteANetworkFunctionGroupResource(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subid"; + const client = new HybridNetworkManagementClient(credential, subscriptionId); + await client.configurationGroupSchemas.delete( + "rg1", + "testPublisher", + "testConfigurationGroupSchema", + ); +} + +async function main(): Promise { + await deleteANetworkFunctionGroupResource(); +} + +main().catch(console.error); diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/configurationGroupSchemasGetSample.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/configurationGroupSchemasGetSample.ts new file mode 100644 index 0000000000..b2d4c203f8 --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/configurationGroupSchemasGetSample.ts @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { HybridNetworkManagementClient } from "@azure/arm-hybridnetwork"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to gets information about the specified configuration group schema. + * + * @summary gets information about the specified configuration group schema. + * x-ms-original-file: 2025-03-30/ConfigurationGroupSchemaGet.json + */ +async function getANetworkFunctionDefinitionGroupResource(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subid"; + const client = new HybridNetworkManagementClient(credential, subscriptionId); + const result = await client.configurationGroupSchemas.get( + "rg1", + "testPublisher", + "testConfigurationGroupSchema", + ); + console.log(result); +} + +async function main(): Promise { + await getANetworkFunctionDefinitionGroupResource(); +} + +main().catch(console.error); diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/configurationGroupSchemasListByPublisherSample.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/configurationGroupSchemasListByPublisherSample.ts new file mode 100644 index 0000000000..c89b1bb94e --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/configurationGroupSchemasListByPublisherSample.ts @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { HybridNetworkManagementClient } from "@azure/arm-hybridnetwork"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to gets information of the configuration group schemas under a publisher. + * + * @summary gets information of the configuration group schemas under a publisher. + * x-ms-original-file: 2025-03-30/ConfigurationGroupSchemaListByPublisherName.json + */ +async function getNetworkFunctionDefinitionGroupsUnderPublisherResource(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subid"; + const client = new HybridNetworkManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.configurationGroupSchemas.listByPublisher( + "rg1", + "testPublisher", + )) { + resArray.push(item); + } + + console.log(resArray); +} + +async function main(): Promise { + await getNetworkFunctionDefinitionGroupsUnderPublisherResource(); +} + +main().catch(console.error); diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/configurationGroupSchemasUpdateSample.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/configurationGroupSchemasUpdateSample.ts new file mode 100644 index 0000000000..f4dd76616d --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/configurationGroupSchemasUpdateSample.ts @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { HybridNetworkManagementClient } from "@azure/arm-hybridnetwork"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to updates a configuration group schema resource. + * + * @summary updates a configuration group schema resource. + * x-ms-original-file: 2025-03-30/ConfigurationGroupSchemaUpdateTags.json + */ +async function createOrUpdateTheConfigurationGroupSchemaResource(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subid"; + const client = new HybridNetworkManagementClient(credential, subscriptionId); + const result = await client.configurationGroupSchemas.update( + "rg1", + "testPublisher", + "testConfigurationGroupSchema", + { tags: { tag1: "value1", tag2: "value2" } }, + ); + console.log(result); +} + +async function main(): Promise { + await createOrUpdateTheConfigurationGroupSchemaResource(); +} + +main().catch(console.error); diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/configurationGroupSchemasUpdateStateSample.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/configurationGroupSchemasUpdateStateSample.ts new file mode 100644 index 0000000000..ccb7c8c87c --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/configurationGroupSchemasUpdateStateSample.ts @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { HybridNetworkManagementClient } from "@azure/arm-hybridnetwork"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to update configuration group schema state. + * + * @summary update configuration group schema state. + * x-ms-original-file: 2025-03-30/ConfigurationGroupSchemaVersionUpdateState.json + */ +async function updateNetworkServiceDesignVersionState(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subid"; + const client = new HybridNetworkManagementClient(credential, subscriptionId); + const result = await client.configurationGroupSchemas.updateState( + "rg1", + "testPublisher", + "testConfigurationGroupSchema", + { versionState: "Active" }, + ); + console.log(result); +} + +async function main(): Promise { + await updateNetworkServiceDesignVersionState(); +} + +main().catch(console.error); diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/configurationGroupValuesCreateOrUpdateSample.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/configurationGroupValuesCreateOrUpdateSample.ts new file mode 100644 index 0000000000..dcf2010811 --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/configurationGroupValuesCreateOrUpdateSample.ts @@ -0,0 +1,100 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { HybridNetworkManagementClient } from "@azure/arm-hybridnetwork"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to creates or updates a hybrid configuration group value. + * + * @summary creates or updates a hybrid configuration group value. + * x-ms-original-file: 2025-03-30/ConfigurationGroupValueCreate.json + */ +async function createOrUpdateConfigurationGroupValue(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subid"; + const client = new HybridNetworkManagementClient(credential, subscriptionId); + const result = await client.configurationGroupValues.createOrUpdate( + "rg1", + "testConfigurationGroupValue", + { + location: "eastus", + properties: { + configurationGroupSchemaResourceReference: { + id: "/subscriptions/subid/resourcegroups/testRG/providers/microsoft.hybridnetwork/publishers/testPublisher/configurationGroupSchemas/testConfigurationGroupSchemaName", + idType: "Open", + }, + configurationType: "Open", + configurationValue: + '{"interconnect-groups":{"stripe-one":{"name":"Stripe one","international-interconnects":["france","germany"],"domestic-interconnects":["birmingham","edinburgh"]},"stripe-two":{"name":"Stripe two","international-interconnects":["germany","italy"],"domestic-interconnects":["edinburgh","london"]}},"interconnect-group-assignments":{"ssc-one":{"ssc":"SSC 1","interconnects":"stripe-one"},"ssc-two":{"ssc":"SSC 2","interconnects":"stripe-two"}}}', + }, + }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to creates or updates a hybrid configuration group value. + * + * @summary creates or updates a hybrid configuration group value. + * x-ms-original-file: 2025-03-30/ConfigurationGroupValueCreateSecret.json + */ +async function createOrUpdateConfigurationGroupValueWithSecrets(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subid"; + const client = new HybridNetworkManagementClient(credential, subscriptionId); + const result = await client.configurationGroupValues.createOrUpdate( + "rg1", + "testConfigurationGroupValue", + { + location: "eastus", + properties: { + configurationGroupSchemaResourceReference: { + id: "/subscriptions/subid/resourcegroups/testRG/providers/microsoft.hybridnetwork/publishers/testPublisher/configurationGroupSchemas/testConfigurationGroupSchemaName", + idType: "Open", + }, + configurationType: "Secret", + secretConfigurationValue: + '{"interconnect-groups":{"stripe-one":{"name":"Stripe one","international-interconnects":["france","germany"],"domestic-interconnects":["birmingham","edinburgh"]},"stripe-two":{"name":"Stripe two","international-interconnects":["germany","italy"],"domestic-interconnects":["edinburgh","london"]}},"interconnect-group-assignments":{"ssc-one":{"ssc":"SSC 1","interconnects":"stripe-one"},"ssc-two":{"ssc":"SSC 2","interconnects":"stripe-two"}}}', + }, + }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to creates or updates a hybrid configuration group value. + * + * @summary creates or updates a hybrid configuration group value. + * x-ms-original-file: 2025-03-30/ConfigurationGroupValueFirstPartyCreate.json + */ +async function createOrUpdateFirstPartyConfigurationGroupValue(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subid"; + const client = new HybridNetworkManagementClient(credential, subscriptionId); + const result = await client.configurationGroupValues.createOrUpdate( + "rg1", + "testConfigurationGroupValue", + { + location: "eastus", + properties: { + configurationGroupSchemaResourceReference: { + id: "/subscriptions/subid/resourcegroups/testRG/providers/microsoft.hybridnetwork/publishers/testPublisher/configurationGroupSchemas/testConfigurationGroupSchemaName", + idType: "Secret", + }, + configurationType: "Open", + configurationValue: + '{"interconnect-groups":{"stripe-one":{"name":"Stripe one","international-interconnects":["france","germany"],"domestic-interconnects":["birmingham","edinburgh"]},"stripe-two":{"name":"Stripe two","international-interconnects":["germany","italy"],"domestic-interconnects":["edinburgh","london"]}},"interconnect-group-assignments":{"ssc-one":{"ssc":"SSC 1","interconnects":"stripe-one"},"ssc-two":{"ssc":"SSC 2","interconnects":"stripe-two"}}}', + }, + }, + ); + console.log(result); +} + +async function main(): Promise { + await createOrUpdateConfigurationGroupValue(); + await createOrUpdateConfigurationGroupValueWithSecrets(); + await createOrUpdateFirstPartyConfigurationGroupValue(); +} + +main().catch(console.error); diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/configurationGroupValuesDeleteSample.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/configurationGroupValuesDeleteSample.ts new file mode 100644 index 0000000000..d4afc251dd --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/configurationGroupValuesDeleteSample.ts @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { HybridNetworkManagementClient } from "@azure/arm-hybridnetwork"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to deletes the specified hybrid configuration group value. + * + * @summary deletes the specified hybrid configuration group value. + * x-ms-original-file: 2025-03-30/ConfigurationGroupValueDelete.json + */ +async function deleteHybridConfigurationGroupResource(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subid"; + const client = new HybridNetworkManagementClient(credential, subscriptionId); + await client.configurationGroupValues.delete("rg1", "testConfigurationGroupValue"); +} + +async function main(): Promise { + await deleteHybridConfigurationGroupResource(); +} + +main().catch(console.error); diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/configurationGroupValuesGetSample.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/configurationGroupValuesGetSample.ts new file mode 100644 index 0000000000..e157bcff8a --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/configurationGroupValuesGetSample.ts @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { HybridNetworkManagementClient } from "@azure/arm-hybridnetwork"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to gets information about the specified hybrid configuration group values. + * + * @summary gets information about the specified hybrid configuration group values. + * x-ms-original-file: 2025-03-30/ConfigurationGroupValueGet.json + */ +async function getHybridConfigurationGroup(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subid"; + const client = new HybridNetworkManagementClient(credential, subscriptionId); + const result = await client.configurationGroupValues.get("rg1", "testConfigurationGroupValue"); + console.log(result); +} + +async function main(): Promise { + await getHybridConfigurationGroup(); +} + +main().catch(console.error); diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/configurationGroupValuesListByResourceGroupSample.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/configurationGroupValuesListByResourceGroupSample.ts new file mode 100644 index 0000000000..89c613614d --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/configurationGroupValuesListByResourceGroupSample.ts @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { HybridNetworkManagementClient } from "@azure/arm-hybridnetwork"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to lists all the hybrid network configurationGroupValues in a resource group. + * + * @summary lists all the hybrid network configurationGroupValues in a resource group. + * x-ms-original-file: 2025-03-30/ConfigurationGroupValueListByResourceGroup.json + */ +async function listAllHybridNetworkConfigurationGroupValuesInASubscription(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subid"; + const client = new HybridNetworkManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.configurationGroupValues.listByResourceGroup("rg1")) { + resArray.push(item); + } + + console.log(resArray); +} + +async function main(): Promise { + await listAllHybridNetworkConfigurationGroupValuesInASubscription(); +} + +main().catch(console.error); diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/configurationGroupValuesListBySubscriptionSample.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/configurationGroupValuesListBySubscriptionSample.ts new file mode 100644 index 0000000000..5144e04a89 --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/configurationGroupValuesListBySubscriptionSample.ts @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { HybridNetworkManagementClient } from "@azure/arm-hybridnetwork"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to lists all sites in the configuration group value in a subscription. + * + * @summary lists all sites in the configuration group value in a subscription. + * x-ms-original-file: 2025-03-30/ConfigurationGroupValueListBySubscription.json + */ +async function listAllHybridNetworkSitesInASubscription(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subid"; + const client = new HybridNetworkManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.configurationGroupValues.listBySubscription()) { + resArray.push(item); + } + + console.log(resArray); +} + +async function main(): Promise { + await listAllHybridNetworkSitesInASubscription(); +} + +main().catch(console.error); diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/configurationGroupValuesUpdateTagsSample.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/configurationGroupValuesUpdateTagsSample.ts new file mode 100644 index 0000000000..c839f3e875 --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/configurationGroupValuesUpdateTagsSample.ts @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { HybridNetworkManagementClient } from "@azure/arm-hybridnetwork"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to updates a hybrid configuration group tags. + * + * @summary updates a hybrid configuration group tags. + * x-ms-original-file: 2025-03-30/ConfigurationGroupValueUpdateTags.json + */ +async function updateHybridConfigurationGroupTags(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subid"; + const client = new HybridNetworkManagementClient(credential, subscriptionId); + const result = await client.configurationGroupValues.updateTags( + "rg1", + "testConfigurationGroupValue", + { tags: { tag1: "value1", tag2: "value2" } }, + ); + console.log(result); +} + +async function main(): Promise { + await updateHybridConfigurationGroupTags(); +} + +main().catch(console.error); diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/networkFunctionDefinitionGroupsCreateOrUpdateSample.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/networkFunctionDefinitionGroupsCreateOrUpdateSample.ts new file mode 100644 index 0000000000..e292b9655d --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/networkFunctionDefinitionGroupsCreateOrUpdateSample.ts @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { HybridNetworkManagementClient } from "@azure/arm-hybridnetwork"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to creates or updates a network function definition group. + * + * @summary creates or updates a network function definition group. + * x-ms-original-file: 2025-03-30/NetworkFunctionDefinitionGroupCreate.json + */ +async function createOrUpdateTheNetworkFunctionDefinitionGroup(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subid"; + const client = new HybridNetworkManagementClient(credential, subscriptionId); + const result = await client.networkFunctionDefinitionGroups.createOrUpdate( + "rg", + "TestPublisher", + "TestNetworkFunctionDefinitionGroupName", + { location: "eastus" }, + ); + console.log(result); +} + +async function main(): Promise { + await createOrUpdateTheNetworkFunctionDefinitionGroup(); +} + +main().catch(console.error); diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/networkFunctionDefinitionGroupsDeleteSample.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/networkFunctionDefinitionGroupsDeleteSample.ts new file mode 100644 index 0000000000..f0346356e2 --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/networkFunctionDefinitionGroupsDeleteSample.ts @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { HybridNetworkManagementClient } from "@azure/arm-hybridnetwork"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to deletes a specified network function definition group. + * + * @summary deletes a specified network function definition group. + * x-ms-original-file: 2025-03-30/NetworkFunctionDefinitionGroupDelete.json + */ +async function deleteANetworkFunctionGroupResource(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subid"; + const client = new HybridNetworkManagementClient(credential, subscriptionId); + await client.networkFunctionDefinitionGroups.delete( + "rg", + "TestPublisher", + "TestNetworkFunctionDefinitionGroupName", + ); +} + +async function main(): Promise { + await deleteANetworkFunctionGroupResource(); +} + +main().catch(console.error); diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/networkFunctionDefinitionGroupsGetSample.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/networkFunctionDefinitionGroupsGetSample.ts new file mode 100644 index 0000000000..1efe08451e --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/networkFunctionDefinitionGroupsGetSample.ts @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { HybridNetworkManagementClient } from "@azure/arm-hybridnetwork"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to gets information about the specified networkFunctionDefinition group. + * + * @summary gets information about the specified networkFunctionDefinition group. + * x-ms-original-file: 2025-03-30/NetworkFunctionDefinitionGroupGet.json + */ +async function getANetworkFunctionDefinitionGroupResource(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subid"; + const client = new HybridNetworkManagementClient(credential, subscriptionId); + const result = await client.networkFunctionDefinitionGroups.get( + "rg", + "TestPublisher", + "TestNetworkFunctionDefinitionGroupName", + ); + console.log(result); +} + +async function main(): Promise { + await getANetworkFunctionDefinitionGroupResource(); +} + +main().catch(console.error); diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/networkFunctionDefinitionGroupsListByPublisherSample.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/networkFunctionDefinitionGroupsListByPublisherSample.ts new file mode 100644 index 0000000000..d476288400 --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/networkFunctionDefinitionGroupsListByPublisherSample.ts @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { HybridNetworkManagementClient } from "@azure/arm-hybridnetwork"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to gets information of the network function definition groups under a publisher. + * + * @summary gets information of the network function definition groups under a publisher. + * x-ms-original-file: 2025-03-30/NetworkFunctionDefinitionGroupsListByPublisherName.json + */ +async function getNetworkFunctionDefinitionGroupsUnderPublisherResource(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subid"; + const client = new HybridNetworkManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.networkFunctionDefinitionGroups.listByPublisher( + "rg", + "TestPublisher", + )) { + resArray.push(item); + } + + console.log(resArray); +} + +async function main(): Promise { + await getNetworkFunctionDefinitionGroupsUnderPublisherResource(); +} + +main().catch(console.error); diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/networkFunctionDefinitionGroupsUpdateSample.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/networkFunctionDefinitionGroupsUpdateSample.ts new file mode 100644 index 0000000000..c22fae9c16 --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/networkFunctionDefinitionGroupsUpdateSample.ts @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { HybridNetworkManagementClient } from "@azure/arm-hybridnetwork"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to updates a network function definition group resource. + * + * @summary updates a network function definition group resource. + * x-ms-original-file: 2025-03-30/NetworkFunctionDefinitionGroupUpdateTags.json + */ +async function createOrUpdateTheNetworkFunctionDefinitionGroupResource(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subid"; + const client = new HybridNetworkManagementClient(credential, subscriptionId); + const result = await client.networkFunctionDefinitionGroups.update( + "rg", + "TestPublisher", + "TestNetworkFunctionDefinitionGroupName", + { tags: { tag1: "value1", tag2: "value2" } }, + ); + console.log(result); +} + +async function main(): Promise { + await createOrUpdateTheNetworkFunctionDefinitionGroupResource(); +} + +main().catch(console.error); diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/networkFunctionDefinitionVersionsCreateOrUpdateSample.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/networkFunctionDefinitionVersionsCreateOrUpdateSample.ts new file mode 100644 index 0000000000..c5c1ac87e8 --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/networkFunctionDefinitionVersionsCreateOrUpdateSample.ts @@ -0,0 +1,235 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { HybridNetworkManagementClient } from "@azure/arm-hybridnetwork"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to creates or updates a network function definition version. + * + * @summary creates or updates a network function definition version. + * x-ms-original-file: 2025-03-30/AzureCore/VirtualNetworkFunctionDefinitionVersionCreate.json + */ +async function createOrUpdateANetworkFunctionDefinitionVersionResourceForAzureCoreVNF(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subid"; + const client = new HybridNetworkManagementClient(credential, subscriptionId); + const result = await client.networkFunctionDefinitionVersions.createOrUpdate( + "rg", + "TestPublisher", + "TestNetworkFunctionDefinitionGroupName", + "1.0.0", + { + location: "eastus", + properties: { + description: "test NFDV for AzureCore", + deployParameters: + '{"virtualMachineName":{"type":"string"},"cpuCores":{"type":"int"},"memorySizeGB":{"type":"int"},"cloudServicesNetworkAttachment":{"type":"object","properties":{"networkAttachmentName":{"type":"string"},"attachedNetworkId":{"type":"string"},"ipAllocationMethod":{"type":"string"},"ipv4Address":{"type":"string"},"ipv6Address":{"type":"string"},"defaultGateway":{"type":"string"}},"required":["attachedNetworkId","ipAllocationMethod"]},"networkAttachments":{"type":"array","items":{"type":"object","properties":{"networkAttachmentName":{"type":"string"},"attachedNetworkId":{"type":"string"},"ipAllocationMethod":{"type":"string"},"ipv4Address":{"type":"string"},"ipv6Address":{"type":"string"},"defaultGateway":{"type":"string"}},"required":["attachedNetworkId","ipAllocationMethod"]}},"storageProfile":{"type":"object","properties":{"osDisk":{"type":"object","properties":{"createOption":{"type":"string"},"deleteOption":{"type":"string"},"diskSizeGB":{"type":"integer"}},"required":["diskSizeGB"]}},"required":["osDisk"]},"sshPublicKeys":{"type":"array","items":{"type":"object","properties":{"keyData":{"type":"string"}},"required":["keyData"]}},"userData":{"type":"string"},"adminUsername":{"type":"string"},"bootMethod":{"type":"string","default":"UEFI","enum":["UEFI","BIOS"]},"isolateEmulatorThread":{"type":"string"},"virtioInterface":{"type":"string"},"placementHints":{"type":"array","items":{"type":"object","properties":{"hintType":{"type":"string","enum":["Affinity","AntiAffinity"]},"resourceId":{"type":"string"},"schedulingExecution":{"type":"string","enum":["Soft","Hard"]},"scope":{"type":"string"}},"required":["hintType","schedulingExecution","resourceId","scope"]}}}', + networkFunctionTemplate: { + networkFunctionApplications: [ + { + name: "testImageRole", + artifactProfile: { + artifactStore: { + id: "/subscriptions/subid/resourceGroups/rg/providers/microsoft.hybridnetwork/publishers/TestPublisher/artifactStores/TestArtifactStore", + }, + vhdArtifactProfile: { vhdName: "test-image", vhdVersion: "1-0-0" }, + }, + artifactType: "VhdImageFile", + dependsOnProfile: { + installDependsOn: [], + uninstallDependsOn: [], + updateDependsOn: [], + }, + deployParametersMappingRuleProfile: { + applicationEnablement: "Unknown", + vhdImageMappingRuleProfile: { userConfiguration: "" }, + }, + }, + { + name: "testTemplateRole", + artifactProfile: { + artifactStore: { + id: "/subscriptions/subid/resourceGroups/rg/providers/microsoft.hybridnetwork/publishers/TestPublisher/artifactStores/TestArtifactStore", + }, + templateArtifactProfile: { + templateName: "test-template", + templateVersion: "1.0.0", + }, + }, + artifactType: "ArmTemplate", + dependsOnProfile: { + installDependsOn: ["testImageRole"], + uninstallDependsOn: ["testImageRole"], + updateDependsOn: ["testImageRole"], + }, + deployParametersMappingRuleProfile: { + applicationEnablement: "Unknown", + templateMappingRuleProfile: { + templateParameters: + '{"virtualMachineName":"{deployParameters.virtualMachineName}","cpuCores":"{deployParameters.cpuCores}","memorySizeGB":"{deployParameters.memorySizeGB}","cloudServicesNetworkAttachment":"{deployParameters.cloudServicesNetworkAttachment}","networkAttachments":"{deployParameters.networkAttachments}","sshPublicKeys":"{deployParameters.sshPublicKeys}","storageProfile":"{deployParameters.storageProfile}","isolateEmulatorThread":"{deployParameters.isolateEmulatorThread}","virtioInterface":"{deployParameters.virtioInterface}","userData":"{deployParameters.userData}","adminUsername":"{deployParameters.adminUsername}","bootMethod":"{deployParameters.bootMethod}","placementHints":"{deployParameters.placementHints}"}', + }, + }, + }, + ], + nfviType: "AzureCore", + }, + networkFunctionType: "VirtualNetworkFunction", + versionState: "Preview", + }, + }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to creates or updates a network function definition version. + * + * @summary creates or updates a network function definition version. + * x-ms-original-file: 2025-03-30/AzureOperatorNexus/VirtualNetworkFunctionDefinitionVersionCreate.json + */ +async function createOrUpdateANetworkFunctionDefinitionVersionResourceForAzureOperatorNexusVNF(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subid"; + const client = new HybridNetworkManagementClient(credential, subscriptionId); + const result = await client.networkFunctionDefinitionVersions.createOrUpdate( + "rg", + "TestPublisher", + "TestNetworkFunctionDefinitionGroupName", + "1.0.0", + { + location: "eastus", + properties: { + description: "test NFDV for AzureOperatorNexus", + deployParameters: + '{"virtualMachineName":{"type":"string"},"extendedLocationName":{"type":"string"},"cpuCores":{"type":"int"},"memorySizeGB":{"type":"int"},"cloudServicesNetworkAttachment":{"type":"object","properties":{"networkAttachmentName":{"type":"string"},"attachedNetworkId":{"type":"string"},"ipAllocationMethod":{"type":"string"},"ipv4Address":{"type":"string"},"ipv6Address":{"type":"string"},"defaultGateway":{"type":"string"}},"required":["attachedNetworkId","ipAllocationMethod"]},"networkAttachments":{"type":"array","items":{"type":"object","properties":{"networkAttachmentName":{"type":"string"},"attachedNetworkId":{"type":"string"},"ipAllocationMethod":{"type":"string"},"ipv4Address":{"type":"string"},"ipv6Address":{"type":"string"},"defaultGateway":{"type":"string"}},"required":["attachedNetworkId","ipAllocationMethod"]}},"storageProfile":{"type":"object","properties":{"osDisk":{"type":"object","properties":{"createOption":{"type":"string"},"deleteOption":{"type":"string"},"diskSizeGB":{"type":"integer"}},"required":["diskSizeGB"]}},"required":["osDisk"]},"sshPublicKeys":{"type":"array","items":{"type":"object","properties":{"keyData":{"type":"string"}},"required":["keyData"]}},"userData":{"type":"string"},"adminUsername":{"type":"string"},"bootMethod":{"type":"string","default":"UEFI","enum":["UEFI","BIOS"]},"isolateEmulatorThread":{"type":"string"},"virtioInterface":{"type":"string"},"placementHints":{"type":"array","items":{"type":"object","properties":{"hintType":{"type":"string","enum":["Affinity","AntiAffinity"]},"resourceId":{"type":"string"},"schedulingExecution":{"type":"string","enum":["Soft","Hard"]},"scope":{"type":"string"}},"required":["hintType","schedulingExecution","resourceId","scope"]}}}', + networkFunctionTemplate: { + networkFunctionApplications: [ + { + name: "testImageRole", + artifactProfile: { + artifactStore: { + id: "/subscriptions/subid/resourceGroups/rg/providers/microsoft.hybridnetwork/publishers/TestPublisher/artifactStores/TestArtifactStore", + }, + imageArtifactProfile: { imageName: "test-image", imageVersion: "1.0.0" }, + }, + artifactType: "ImageFile", + dependsOnProfile: { + installDependsOn: [], + uninstallDependsOn: [], + updateDependsOn: [], + }, + deployParametersMappingRuleProfile: { + applicationEnablement: "Unknown", + imageMappingRuleProfile: { userConfiguration: "" }, + }, + }, + { + name: "testTemplateRole", + artifactProfile: { + artifactStore: { + id: "/subscriptions/subid/resourceGroups/rg/providers/microsoft.hybridnetwork/publishers/TestPublisher/artifactStores/TestArtifactStore", + }, + templateArtifactProfile: { + templateName: "test-template", + templateVersion: "1.0.0", + }, + }, + artifactType: "ArmTemplate", + dependsOnProfile: { + installDependsOn: ["testImageRole"], + uninstallDependsOn: ["testImageRole"], + updateDependsOn: ["testImageRole"], + }, + deployParametersMappingRuleProfile: { + applicationEnablement: "Unknown", + templateMappingRuleProfile: { + templateParameters: + '{"virtualMachineName":"{deployParameters.virtualMachineName}","extendedLocationName":"{deployParameters.extendedLocationName}","cpuCores":"{deployParameters.cpuCores}","memorySizeGB":"{deployParameters.memorySizeGB}","cloudServicesNetworkAttachment":"{deployParameters.cloudServicesNetworkAttachment}","networkAttachments":"{deployParameters.networkAttachments}","sshPublicKeys":"{deployParameters.sshPublicKeys}","storageProfile":"{deployParameters.storageProfile}","isolateEmulatorThread":"{deployParameters.isolateEmulatorThread}","virtioInterface":"{deployParameters.virtioInterface}","userData":"{deployParameters.userData}","adminUsername":"{deployParameters.adminUsername}","bootMethod":"{deployParameters.bootMethod}","placementHints":"{deployParameters.placementHints}"}', + }, + }, + }, + ], + nfviType: "AzureOperatorNexus", + }, + networkFunctionType: "VirtualNetworkFunction", + versionState: "Preview", + }, + }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to creates or updates a network function definition version. + * + * @summary creates or updates a network function definition version. + * x-ms-original-file: 2025-03-30/NetworkFunctionDefinitionVersionCreate.json + */ +async function createOrUpdateANetworkFunctionDefinitionVersionResource(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subid"; + const client = new HybridNetworkManagementClient(credential, subscriptionId); + const result = await client.networkFunctionDefinitionVersions.createOrUpdate( + "rg", + "TestPublisher", + "TestNetworkFunctionDefinitionGroupName", + "1.0.0", + { + location: "eastus", + properties: { + deployParameters: + '{"type":"object","properties":{"releaseName":{"type":"string"},"namespace":{"type":"string"}}}', + networkFunctionTemplate: { + networkFunctionApplications: [ + { + name: "fedrbac", + artifactProfile: { + artifactStore: { + id: "/subscriptions/subid/resourcegroups/rg/providers/microsoft.hybridnetwork/publishers/TestPublisher/artifactStores/testArtifactStore", + }, + helmArtifactProfile: { + helmPackageName: "fed-rbac", + helmPackageVersionRange: "~2.1.3", + imagePullSecretsValuesPaths: ["global.imagePullSecrets"], + registryValuesPaths: ["global.registry.docker.repoPath"], + }, + }, + artifactType: "HelmPackage", + dependsOnProfile: { + installDependsOn: [], + uninstallDependsOn: [], + updateDependsOn: [], + }, + deployParametersMappingRuleProfile: { + applicationEnablement: "Enabled", + helmMappingRuleProfile: { + helmPackageVersion: "2.1.3", + options: { + installOptions: { atomic: "true", timeout: "30", wait: "waitValue" }, + upgradeOptions: { atomic: "true", timeout: "30", wait: "waitValue" }, + }, + releaseName: "{deployParameters.releaseName}", + releaseNamespace: "{deployParameters.namesapce}", + values: "", + }, + }, + }, + ], + nfviType: "AzureArcKubernetes", + }, + networkFunctionType: "ContainerizedNetworkFunction", + versionState: "Active", + }, + }, + ); + console.log(result); +} + +async function main(): Promise { + await createOrUpdateANetworkFunctionDefinitionVersionResourceForAzureCoreVNF(); + await createOrUpdateANetworkFunctionDefinitionVersionResourceForAzureOperatorNexusVNF(); + await createOrUpdateANetworkFunctionDefinitionVersionResource(); +} + +main().catch(console.error); diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/networkFunctionDefinitionVersionsDeleteSample.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/networkFunctionDefinitionVersionsDeleteSample.ts new file mode 100644 index 0000000000..02c1f48b40 --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/networkFunctionDefinitionVersionsDeleteSample.ts @@ -0,0 +1,67 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { HybridNetworkManagementClient } from "@azure/arm-hybridnetwork"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to deletes the specified network function definition version. + * + * @summary deletes the specified network function definition version. + * x-ms-original-file: 2025-03-30/AzureCore/VirtualNetworkFunctionDefinitionVersionDelete.json + */ +async function deleteANetworkFunctionDefinitionVersionForAzureCoreVNF(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subid"; + const client = new HybridNetworkManagementClient(credential, subscriptionId); + await client.networkFunctionDefinitionVersions.delete( + "rg", + "TestPublisher", + "TestNetworkFunctionDefinitionGroupName", + "1.0.0", + ); +} + +/** + * This sample demonstrates how to deletes the specified network function definition version. + * + * @summary deletes the specified network function definition version. + * x-ms-original-file: 2025-03-30/AzureOperatorNexus/VirtualNetworkFunctionDefinitionVersionDelete.json + */ +async function deleteANetworkFunctionDefinitionVersionForAzureOperatorNexusVNF(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subid"; + const client = new HybridNetworkManagementClient(credential, subscriptionId); + await client.networkFunctionDefinitionVersions.delete( + "rg", + "TestPublisher", + "TestNetworkFunctionDefinitionGroupName", + "1.0.0", + ); +} + +/** + * This sample demonstrates how to deletes the specified network function definition version. + * + * @summary deletes the specified network function definition version. + * x-ms-original-file: 2025-03-30/NetworkFunctionDefinitionVersionDelete.json + */ +async function deleteANetworkFunctionDefinitionVersion(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subid"; + const client = new HybridNetworkManagementClient(credential, subscriptionId); + await client.networkFunctionDefinitionVersions.delete( + "rg", + "TestPublisher", + "TestNetworkFunctionDefinitionGroupName", + "1.0.0", + ); +} + +async function main(): Promise { + await deleteANetworkFunctionDefinitionVersionForAzureCoreVNF(); + await deleteANetworkFunctionDefinitionVersionForAzureOperatorNexusVNF(); + await deleteANetworkFunctionDefinitionVersion(); +} + +main().catch(console.error); diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/networkFunctionDefinitionVersionsGetSample.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/networkFunctionDefinitionVersionsGetSample.ts new file mode 100644 index 0000000000..c7e4d5f12c --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/networkFunctionDefinitionVersionsGetSample.ts @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { HybridNetworkManagementClient } from "@azure/arm-hybridnetwork"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to gets information about a network function definition version. + * + * @summary gets information about a network function definition version. + * x-ms-original-file: 2025-03-30/AzureCore/VirtualNetworkFunctionDefinitionVersionGet.json + */ +async function getNetworkFunctionDefinitionVersionResourceForAzureCoreVNF(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subid"; + const client = new HybridNetworkManagementClient(credential, subscriptionId); + const result = await client.networkFunctionDefinitionVersions.get( + "rg", + "TestPublisher", + "TestNetworkFunctionDefinitionGroupName", + "1.0.0", + ); + console.log(result); +} + +/** + * This sample demonstrates how to gets information about a network function definition version. + * + * @summary gets information about a network function definition version. + * x-ms-original-file: 2025-03-30/AzureOperatorNexus/VirtualNetworkFunctionDefinitionVersionGet.json + */ +async function getNetworkFunctionDefinitionVersionResourceForAzureOperatorNexusVNF(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subid"; + const client = new HybridNetworkManagementClient(credential, subscriptionId); + const result = await client.networkFunctionDefinitionVersions.get( + "rg", + "TestPublisher", + "TestNetworkFunctionDefinitionGroupName", + "1.0.0", + ); + console.log(result); +} + +/** + * This sample demonstrates how to gets information about a network function definition version. + * + * @summary gets information about a network function definition version. + * x-ms-original-file: 2025-03-30/NetworkFunctionDefinitionVersionGet.json + */ +async function getANetworkFunctionDefinitionVersionResource(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subid"; + const client = new HybridNetworkManagementClient(credential, subscriptionId); + const result = await client.networkFunctionDefinitionVersions.get( + "rg", + "TestPublisher", + "TestNetworkFunctionDefinitionGroupName", + "1.0.0", + ); + console.log(result); +} + +async function main(): Promise { + await getNetworkFunctionDefinitionVersionResourceForAzureCoreVNF(); + await getNetworkFunctionDefinitionVersionResourceForAzureOperatorNexusVNF(); + await getANetworkFunctionDefinitionVersionResource(); +} + +main().catch(console.error); diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/networkFunctionDefinitionVersionsListByNetworkFunctionDefinitionGroupSample.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/networkFunctionDefinitionVersionsListByNetworkFunctionDefinitionGroupSample.ts new file mode 100644 index 0000000000..fa49659835 --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/networkFunctionDefinitionVersionsListByNetworkFunctionDefinitionGroupSample.ts @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { HybridNetworkManagementClient } from "@azure/arm-hybridnetwork"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to gets information about a list of network function definition versions under a network function definition group. + * + * @summary gets information about a list of network function definition versions under a network function definition group. + * x-ms-original-file: 2025-03-30/NetworkFunctionDefinitionVersionListByNetworkFunctionDefinitionGroup.json + */ +async function getPublisherResource(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subid"; + const client = new HybridNetworkManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.networkFunctionDefinitionVersions.listByNetworkFunctionDefinitionGroup( + "rg", + "TestPublisher", + "TestNetworkFunctionDefinitionGroupNameName", + )) { + resArray.push(item); + } + + console.log(resArray); +} + +async function main(): Promise { + await getPublisherResource(); +} + +main().catch(console.error); diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/networkFunctionDefinitionVersionsUpdateSample.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/networkFunctionDefinitionVersionsUpdateSample.ts new file mode 100644 index 0000000000..1b344149b8 --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/networkFunctionDefinitionVersionsUpdateSample.ts @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { HybridNetworkManagementClient } from "@azure/arm-hybridnetwork"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to updates a network function definition version resource. + * + * @summary updates a network function definition version resource. + * x-ms-original-file: 2025-03-30/NetworkFunctionDefinitionVersionUpdateTags.json + */ +async function updateTheNetworkFunctionDefinitionVersionTags(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subid"; + const client = new HybridNetworkManagementClient(credential, subscriptionId); + const result = await client.networkFunctionDefinitionVersions.update( + "rg", + "TestPublisher", + "TestNetworkFunctionDefinitionGroupName", + "1.0.0", + { tags: { tag1: "value1", tag2: "value2" } }, + ); + console.log(result); +} + +async function main(): Promise { + await updateTheNetworkFunctionDefinitionVersionTags(); +} + +main().catch(console.error); diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/networkFunctionDefinitionVersionsUpdateStateSample.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/networkFunctionDefinitionVersionsUpdateStateSample.ts new file mode 100644 index 0000000000..59040d35d5 --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/networkFunctionDefinitionVersionsUpdateStateSample.ts @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { HybridNetworkManagementClient } from "@azure/arm-hybridnetwork"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to update network function definition version state. + * + * @summary update network function definition version state. + * x-ms-original-file: 2025-03-30/NetworkFunctionDefinitionVersionUpdateState.json + */ +async function updateNetworkFunctionDefinitionVersionState(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subid"; + const client = new HybridNetworkManagementClient(credential, subscriptionId); + const result = await client.networkFunctionDefinitionVersions.updateState( + "rg", + "TestPublisher", + "TestSkuGroup", + "1.0.0", + { versionState: "Active" }, + ); + console.log(result); +} + +async function main(): Promise { + await updateNetworkFunctionDefinitionVersionState(); +} + +main().catch(console.error); diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/networkFunctionsCreateOrUpdateSample.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/networkFunctionsCreateOrUpdateSample.ts new file mode 100644 index 0000000000..4d2935f57e --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/networkFunctionsCreateOrUpdateSample.ts @@ -0,0 +1,168 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { HybridNetworkManagementClient } from "@azure/arm-hybridnetwork"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to creates or updates a network function resource. + * + * @summary creates or updates a network function resource. + * x-ms-original-file: 2025-03-30/AzureCore/VirtualNetworkFunctionCreate.json + */ +async function createVirtualNetworkFunctionResourceOnAzureCore(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subid"; + const client = new HybridNetworkManagementClient(credential, subscriptionId); + const result = await client.networkFunctions.createOrUpdate("rg", "testNf", { + location: "eastus", + properties: { + allowSoftwareUpdate: false, + configurationType: "Open", + deploymentValues: + '{"virtualMachineName":"test-VM","cpuCores":4,"memorySizeGB":8,"cloudServicesNetworkAttachment":{"attachedNetworkId":"test-csnet","ipAllocationMethod":"Dynamic","networkAttachmentName":"test-cs-vlan"},"networkAttachments":[{"attachedNetworkId":"test-l3vlan","defaultGateway":"True","ipAllocationMethod":"Dynamic","networkAttachmentName":"test-vlan"}],"sshPublicKeys":[{"keyData":"ssh-rsa CMIIIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEA0TqlveKKlc2MFvEmuXJiLGBsY1t4ML4uiRADGSZlnc+7Ugv3h+MCjkkwOKiOdsNo8k4KSBIG5GcQfKYOOd17AJvqCL6cGQbaLuqv0a64jeDm8oO8/xN/IM0oKw7rMr/2oAJOgIsfeXPkRxWWic9AVIS++H5Qi2r7bUFX+cqFsyUCAwEBBQ=="}],"storageProfile":{"osDisk":{"createOption":"Ephemeral","deleteOption":"Delete","diskSizeGB":10}},"userData":"testUserData","adminUsername":"testUser","virtioInterface":"Transitional","isolateEmulatorThread":"False","bootMethod":"BIOS","placementHints":[]}', + networkFunctionDefinitionVersionResourceReference: { + id: "/subscriptions/subid/resourcegroups/rg/providers/Microsoft.HybridNetwork/publishers/testVendor/networkFunctionDefinitionGroups/testnetworkFunctionDefinitionGroupName/networkFunctionDefinitionVersions/1.0.1", + idType: "Open", + }, + nfviId: "/subscriptions/subid/resourceGroups/testResourceGroup", + nfviType: "AzureCore", + }, + }); + console.log(result); +} + +/** + * This sample demonstrates how to creates or updates a network function resource. + * + * @summary creates or updates a network function resource. + * x-ms-original-file: 2025-03-30/AzureOperatorNexus/VirtualNetworkFunctionCreate.json + */ +async function createVirtualNetworkFunctionResourceOnAzureOperatorNexus(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subid"; + const client = new HybridNetworkManagementClient(credential, subscriptionId); + const result = await client.networkFunctions.createOrUpdate("rg", "testNf", { + location: "eastus", + properties: { + allowSoftwareUpdate: false, + configurationType: "Open", + deploymentValues: + '{"virtualMachineName":"test-VM","extendedLocationName":"test-cluster","cpuCores":4,"memorySizeGB":8,"cloudServicesNetworkAttachment":{"attachedNetworkId":"test-csnet","ipAllocationMethod":"Dynamic","networkAttachmentName":"test-cs-vlan"},"networkAttachments":[{"attachedNetworkId":"test-l3vlan","defaultGateway":"True","ipAllocationMethod":"Dynamic","networkAttachmentName":"test-vlan"}],"sshPublicKeys":[{"keyData":"ssh-rsa CMIIIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEA0TqlveKKlc2MFvEmuXJiLGBsY1t4ML4uiRADGSZlnc+7Ugv3h+MCjkkwOKiOdsNo8k4KSBIG5GcQfKYOOd17AJvqCL6cGQbaLuqv0a64jeDm8oO8/xN/IM0oKw7rMr/2oAJOgIsfeXPkRxWWic9AVIS++H5Qi2r7bUFX+cqFsyUCAwEBBQ=="}],"storageProfile":{"osDisk":{"createOption":"Ephemeral","deleteOption":"Delete","diskSizeGB":10}},"userData":"testUserData","adminUsername":"testUser","virtioInterface":"Transitional","isolateEmulatorThread":"False","bootMethod":"BIOS","placementHints":[]}', + networkFunctionDefinitionVersionResourceReference: { + id: "/subscriptions/subid/resourcegroups/rg/providers/Microsoft.HybridNetwork/publishers/testVendor/networkFunctionDefinitionGroups/testnetworkFunctionDefinitionGroupName/networkFunctionDefinitionVersions/1.0.1", + idType: "Open", + }, + nfviId: + "/subscriptions/subid/resourceGroups/testResourceGroup/providers/Microsoft.ExtendedLocation/customLocations/testCustomLocation", + nfviType: "AzureOperatorNexus", + }, + }); + console.log(result); +} + +/** + * This sample demonstrates how to creates or updates a network function resource. + * + * @summary creates or updates a network function resource. + * x-ms-original-file: 2025-03-30/NetworkFunctionCreate.json + */ +async function createNetworkFunctionResource(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subid"; + const client = new HybridNetworkManagementClient(credential, subscriptionId); + const result = await client.networkFunctions.createOrUpdate("rg", "testNf", { + location: "eastus", + properties: { + allowSoftwareUpdate: false, + configurationType: "Open", + deploymentValues: '{"releaseName":"testReleaseName","namespace":"testNamespace"}', + networkFunctionDefinitionVersionResourceReference: { + id: "/subscriptions/subid/resourcegroups/rg/providers/Microsoft.HybridNetwork/publishers/testVendor/networkFunctionDefinitionGroups/testnetworkFunctionDefinitionGroupName/networkFunctionDefinitionVersions/1.0.1", + idType: "Open", + }, + nfviId: + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testResourceGroup/providers/Microsoft.ExtendedLocation/customLocations/testCustomLocation", + nfviType: "AzureArcKubernetes", + roleOverrideValues: [ + '{"name":"testRoleOne","deployParametersMappingRuleProfile":{"helmMappingRuleProfile":{"helmPackageVersion":"2.1.3","values":"{\\"roleOneParam\\":\\"roleOneOverrideValue\\"}"}}}', + '{"name":"testRoleTwo","deployParametersMappingRuleProfile":{"helmMappingRuleProfile":{"releaseName":"overrideReleaseName","releaseNamespace":"overrideNamespace","values":"{\\"roleTwoParam\\":\\"roleTwoOverrideValue\\"}"}}}', + ], + }, + }); + console.log(result); +} + +/** + * This sample demonstrates how to creates or updates a network function resource. + * + * @summary creates or updates a network function resource. + * x-ms-original-file: 2025-03-30/NetworkFunctionCreateSecret.json + */ +async function createNetworkFunctionResourceWithSecrets(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subid"; + const client = new HybridNetworkManagementClient(credential, subscriptionId); + const result = await client.networkFunctions.createOrUpdate("rg", "testNf", { + location: "eastus", + properties: { + allowSoftwareUpdate: false, + configurationType: "Secret", + networkFunctionDefinitionVersionResourceReference: { + id: "/subscriptions/subid/resourcegroups/rg/providers/Microsoft.HybridNetwork/publishers/testVendor/networkFunctionDefinitionGroups/testnetworkFunctionDefinitionGroupName/networkFunctionDefinitionVersions/1.0.1", + idType: "Open", + }, + nfviId: + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testResourceGroup/providers/Microsoft.ExtendedLocation/customLocations/testCustomLocation", + nfviType: "AzureArcKubernetes", + roleOverrideValues: [ + '{"name":"testRoleOne","deployParametersMappingRuleProfile":{"helmMappingRuleProfile":{"helmPackageVersion":"2.1.3","values":"{\\"roleOneParam\\":\\"roleOneOverrideValue\\"}"}}}', + '{"name":"testRoleTwo","deployParametersMappingRuleProfile":{"helmMappingRuleProfile":{"releaseName":"overrideReleaseName","releaseNamespace":"overrideNamespace","values":"{\\"roleTwoParam\\":\\"roleTwoOverrideValue\\"}"}}}', + ], + secretDeploymentValues: '{"adminPassword":"password1","userPassword":"password2"}', + }, + }); + console.log(result); +} + +/** + * This sample demonstrates how to creates or updates a network function resource. + * + * @summary creates or updates a network function resource. + * x-ms-original-file: 2025-03-30/NetworkFunctionFirstPartyCreate.json + */ +async function createFirstPartyNetworkFunctionResource(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subid"; + const client = new HybridNetworkManagementClient(credential, subscriptionId); + const result = await client.networkFunctions.createOrUpdate("rg", "testNf", { + location: "eastus", + properties: { + allowSoftwareUpdate: false, + configurationType: "Open", + deploymentValues: '{"releaseName":"testReleaseName","namespace":"testNamespace"}', + networkFunctionDefinitionVersionResourceReference: { + id: "/subscriptions/subid/resourcegroups/rg/providers/Microsoft.HybridNetwork/publishers/testVendor/networkFunctionDefinitionGroups/testnetworkFunctionDefinitionGroupName/networkFunctionDefinitionVersions/1.0.1", + idType: "Secret", + }, + nfviId: + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testResourceGroup/providers/Microsoft.ExtendedLocation/customLocations/testCustomLocation", + nfviType: "AzureArcKubernetes", + roleOverrideValues: [ + '{"name":"testRoleOne","deployParametersMappingRuleProfile":{"helmMappingRuleProfile":{"helmPackageVersion":"2.1.3","values":"{\\"roleOneParam\\":\\"roleOneOverrideValue\\"}"}}}', + '{"name":"testRoleTwo","deployParametersMappingRuleProfile":{"helmMappingRuleProfile":{"releaseName":"overrideReleaseName","releaseNamespace":"overrideNamespace","values":"{\\"roleTwoParam\\":\\"roleTwoOverrideValue\\"}"}}}', + ], + }, + }); + console.log(result); +} + +async function main(): Promise { + await createVirtualNetworkFunctionResourceOnAzureCore(); + await createVirtualNetworkFunctionResourceOnAzureOperatorNexus(); + await createNetworkFunctionResource(); + await createNetworkFunctionResourceWithSecrets(); + await createFirstPartyNetworkFunctionResource(); +} + +main().catch(console.error); diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/networkFunctionsDeleteSample.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/networkFunctionsDeleteSample.ts new file mode 100644 index 0000000000..ed2fe74411 --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/networkFunctionsDeleteSample.ts @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { HybridNetworkManagementClient } from "@azure/arm-hybridnetwork"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to deletes the specified network function resource. + * + * @summary deletes the specified network function resource. + * x-ms-original-file: 2025-03-30/AzureCore/VirtualNetworkFunctionDelete.json + */ +async function deleteVirtualNetworkFunctionResourceOnAzureCore(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subid"; + const client = new HybridNetworkManagementClient(credential, subscriptionId); + await client.networkFunctions.delete("rg", "testNf"); +} + +/** + * This sample demonstrates how to deletes the specified network function resource. + * + * @summary deletes the specified network function resource. + * x-ms-original-file: 2025-03-30/AzureOperatorNexus/VirtualNetworkFunctionDelete.json + */ +async function deleteVirtualNetworkFunctionResourceOnAzureOperatorNexus(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subid"; + const client = new HybridNetworkManagementClient(credential, subscriptionId); + await client.networkFunctions.delete("rg", "testNf"); +} + +/** + * This sample demonstrates how to deletes the specified network function resource. + * + * @summary deletes the specified network function resource. + * x-ms-original-file: 2025-03-30/NetworkFunctionDelete.json + */ +async function deleteNetworkFunctionResource(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subid"; + const client = new HybridNetworkManagementClient(credential, subscriptionId); + await client.networkFunctions.delete("rg", "testNf"); +} + +async function main(): Promise { + await deleteVirtualNetworkFunctionResourceOnAzureCore(); + await deleteVirtualNetworkFunctionResourceOnAzureOperatorNexus(); + await deleteNetworkFunctionResource(); +} + +main().catch(console.error); diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/networkFunctionsExecuteRequestSample.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/networkFunctionsExecuteRequestSample.ts new file mode 100644 index 0000000000..53a982888d --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/networkFunctionsExecuteRequestSample.ts @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { HybridNetworkManagementClient } from "@azure/arm-hybridnetwork"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to execute a request to services on a containerized network function. + * + * @summary execute a request to services on a containerized network function. + * x-ms-original-file: 2025-03-30/NetworkFunctionsExecuteRequest.json + */ +async function sendRequestToNetworkFunctionServices(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subid"; + const client = new HybridNetworkManagementClient(credential, subscriptionId); + await client.networkFunctions.executeRequest("rg", "testNetworkfunction", { + requestMetadata: { + apiVersion: "apiVersionQueryString", + httpMethod: "Post", + relativePath: "/simProfiles/testSimProfile", + serializedBody: + '{"subscriptionProfile":"ChantestSubscription15","permanentKey":"00112233445566778899AABBCCDDEEFF","opcOperatorCode":"63bfa50ee6523365ff14c1f45f88737d","staticIpAddresses":{"internet":{"ipv4Addr":"198.51.100.1","ipv6Prefix":"2001:db8:abcd:12::0/64"},"another_network":{"ipv6Prefix":"2001:111:cdef:22::0/64"}}}', + }, + serviceEndpoint: "serviceEndpoint", + }); +} + +async function main(): Promise { + await sendRequestToNetworkFunctionServices(); +} + +main().catch(console.error); diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/networkFunctionsGetSample.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/networkFunctionsGetSample.ts new file mode 100644 index 0000000000..af79c31f07 --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/networkFunctionsGetSample.ts @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { HybridNetworkManagementClient } from "@azure/arm-hybridnetwork"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to gets information about the specified network function resource. + * + * @summary gets information about the specified network function resource. + * x-ms-original-file: 2025-03-30/AzureCore/VirtualNetworkFunctionGet.json + */ +async function getVirtualNetworkFunctionResourceOnAzureCore(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subid"; + const client = new HybridNetworkManagementClient(credential, subscriptionId); + const result = await client.networkFunctions.get("rg", "testNf"); + console.log(result); +} + +/** + * This sample demonstrates how to gets information about the specified network function resource. + * + * @summary gets information about the specified network function resource. + * x-ms-original-file: 2025-03-30/AzureOperatorNexus/VirtualNetworkFunctionGet.json + */ +async function getVirtualNetworkFunctionResourceOnAzureOperatorNexus(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subid"; + const client = new HybridNetworkManagementClient(credential, subscriptionId); + const result = await client.networkFunctions.get("rg", "testNf"); + console.log(result); +} + +/** + * This sample demonstrates how to gets information about the specified network function resource. + * + * @summary gets information about the specified network function resource. + * x-ms-original-file: 2025-03-30/NetworkFunctionGet.json + */ +async function getNetworkFunctionResource(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subid"; + const client = new HybridNetworkManagementClient(credential, subscriptionId); + const result = await client.networkFunctions.get("rg", "testNf"); + console.log(result); +} + +async function main(): Promise { + await getVirtualNetworkFunctionResourceOnAzureCore(); + await getVirtualNetworkFunctionResourceOnAzureOperatorNexus(); + await getNetworkFunctionResource(); +} + +main().catch(console.error); diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/networkFunctionsListByResourceGroupSample.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/networkFunctionsListByResourceGroupSample.ts new file mode 100644 index 0000000000..aff35c6dba --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/networkFunctionsListByResourceGroupSample.ts @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { HybridNetworkManagementClient } from "@azure/arm-hybridnetwork"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to lists all the network function resources in a resource group. + * + * @summary lists all the network function resources in a resource group. + * x-ms-original-file: 2025-03-30/NetworkFunctionListByResourceGroup.json + */ +async function listNetworkFunctionInResourceGroup(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subid"; + const client = new HybridNetworkManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.networkFunctions.listByResourceGroup("rg")) { + resArray.push(item); + } + + console.log(resArray); +} + +async function main(): Promise { + await listNetworkFunctionInResourceGroup(); +} + +main().catch(console.error); diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/networkFunctionsListBySubscriptionSample.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/networkFunctionsListBySubscriptionSample.ts new file mode 100644 index 0000000000..f84b252a60 --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/networkFunctionsListBySubscriptionSample.ts @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { HybridNetworkManagementClient } from "@azure/arm-hybridnetwork"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to lists all the network functions in a subscription. + * + * @summary lists all the network functions in a subscription. + * x-ms-original-file: 2025-03-30/NetworkFunctionListBySubscription.json + */ +async function listAllNetworkFunctionResourcesInSubscription(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subid"; + const client = new HybridNetworkManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.networkFunctions.listBySubscription()) { + resArray.push(item); + } + + console.log(resArray); +} + +async function main(): Promise { + await listAllNetworkFunctionResourcesInSubscription(); +} + +main().catch(console.error); diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/networkFunctionsUpdateTagsSample.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/networkFunctionsUpdateTagsSample.ts new file mode 100644 index 0000000000..4f42a95990 --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/networkFunctionsUpdateTagsSample.ts @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { HybridNetworkManagementClient } from "@azure/arm-hybridnetwork"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to updates the tags for the network function resource. + * + * @summary updates the tags for the network function resource. + * x-ms-original-file: 2025-03-30/NetworkFunctionUpdateTags.json + */ +async function updateTagsForNetworkFunctionResource(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subid"; + const client = new HybridNetworkManagementClient(credential, subscriptionId); + const result = await client.networkFunctions.updateTags("rg", "testNf", { + tags: { tag1: "value1", tag2: "value2" }, + }); + console.log(result); +} + +async function main(): Promise { + await updateTagsForNetworkFunctionResource(); +} + +main().catch(console.error); diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/networkServiceDesignGroupsCreateOrUpdateSample.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/networkServiceDesignGroupsCreateOrUpdateSample.ts new file mode 100644 index 0000000000..1721863548 --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/networkServiceDesignGroupsCreateOrUpdateSample.ts @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { HybridNetworkManagementClient } from "@azure/arm-hybridnetwork"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to creates or updates a network service design group. + * + * @summary creates or updates a network service design group. + * x-ms-original-file: 2025-03-30/NetworkServiceDesignGroupCreate.json + */ +async function createOrUpdateTheNetworkServiceDesignGroup(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subid"; + const client = new HybridNetworkManagementClient(credential, subscriptionId); + const result = await client.networkServiceDesignGroups.createOrUpdate( + "rg", + "TestPublisher", + "TestNetworkServiceDesignGroupName", + { location: "eastus" }, + ); + console.log(result); +} + +async function main(): Promise { + await createOrUpdateTheNetworkServiceDesignGroup(); +} + +main().catch(console.error); diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/networkServiceDesignGroupsDeleteSample.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/networkServiceDesignGroupsDeleteSample.ts new file mode 100644 index 0000000000..aba47e0470 --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/networkServiceDesignGroupsDeleteSample.ts @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { HybridNetworkManagementClient } from "@azure/arm-hybridnetwork"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to deletes a specified network service design group. + * + * @summary deletes a specified network service design group. + * x-ms-original-file: 2025-03-30/NetworkServiceDesignGroupDelete.json + */ +async function deleteANetworkFunctionGroupResource(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subid"; + const client = new HybridNetworkManagementClient(credential, subscriptionId); + await client.networkServiceDesignGroups.delete( + "rg", + "TestPublisher", + "TestNetworkServiceDesignGroupName", + ); +} + +async function main(): Promise { + await deleteANetworkFunctionGroupResource(); +} + +main().catch(console.error); diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/networkServiceDesignGroupsGetSample.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/networkServiceDesignGroupsGetSample.ts new file mode 100644 index 0000000000..4d778aed36 --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/networkServiceDesignGroupsGetSample.ts @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { HybridNetworkManagementClient } from "@azure/arm-hybridnetwork"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to gets information about the specified networkServiceDesign group. + * + * @summary gets information about the specified networkServiceDesign group. + * x-ms-original-file: 2025-03-30/NetworkServiceDesignGroupGet.json + */ +async function getANetworkServiceDesignGroupResource(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subid"; + const client = new HybridNetworkManagementClient(credential, subscriptionId); + const result = await client.networkServiceDesignGroups.get( + "rg", + "TestPublisher", + "TestNetworkServiceDesignGroupName", + ); + console.log(result); +} + +async function main(): Promise { + await getANetworkServiceDesignGroupResource(); +} + +main().catch(console.error); diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/networkServiceDesignGroupsListByPublisherSample.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/networkServiceDesignGroupsListByPublisherSample.ts new file mode 100644 index 0000000000..3ec9855ac4 --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/networkServiceDesignGroupsListByPublisherSample.ts @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { HybridNetworkManagementClient } from "@azure/arm-hybridnetwork"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to gets information of the network service design groups under a publisher. + * + * @summary gets information of the network service design groups under a publisher. + * x-ms-original-file: 2025-03-30/NetworkServiceDesignGroupsListByPublisherName.json + */ +async function getNetworkServiceDesignGroupsUnderPublisherResource(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subid"; + const client = new HybridNetworkManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.networkServiceDesignGroups.listByPublisher( + "rg", + "TestPublisher", + )) { + resArray.push(item); + } + + console.log(resArray); +} + +async function main(): Promise { + await getNetworkServiceDesignGroupsUnderPublisherResource(); +} + +main().catch(console.error); diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/networkServiceDesignGroupsUpdateSample.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/networkServiceDesignGroupsUpdateSample.ts new file mode 100644 index 0000000000..bad3d14477 --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/networkServiceDesignGroupsUpdateSample.ts @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { HybridNetworkManagementClient } from "@azure/arm-hybridnetwork"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to updates a network service design groups resource. + * + * @summary updates a network service design groups resource. + * x-ms-original-file: 2025-03-30/NetworkServiceDesignGroupUpdateTags.json + */ +async function createOrUpdateTheNetworkServiceDesignGroupResource(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subid"; + const client = new HybridNetworkManagementClient(credential, subscriptionId); + const result = await client.networkServiceDesignGroups.update( + "rg", + "TestPublisher", + "TestNetworkServiceDesignGroupName", + { tags: { tag1: "value1", tag2: "value2" } }, + ); + console.log(result); +} + +async function main(): Promise { + await createOrUpdateTheNetworkServiceDesignGroupResource(); +} + +main().catch(console.error); diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/networkServiceDesignVersionsCreateOrUpdateSample.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/networkServiceDesignVersionsCreateOrUpdateSample.ts new file mode 100644 index 0000000000..dc7a005961 --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/networkServiceDesignVersionsCreateOrUpdateSample.ts @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { HybridNetworkManagementClient } from "@azure/arm-hybridnetwork"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to creates or updates a network service design version. + * + * @summary creates or updates a network service design version. + * x-ms-original-file: 2025-03-30/NetworkServiceDesignVersionCreate.json + */ +async function createOrUpdateANetworkServiceDesignVersionResource(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subid"; + const client = new HybridNetworkManagementClient(credential, subscriptionId); + const result = await client.networkServiceDesignVersions.createOrUpdate( + "rg", + "TestPublisher", + "TestNetworkServiceDesignGroupName", + "1.0.0", + { + location: "eastus", + properties: { + configurationGroupSchemaReferences: { + MyVM_Configuration: { + id: "/subscriptions/subid/resourcegroups/contosorg1/providers/microsoft.hybridnetwork/publishers/contosoGroup/networkServiceDesignGroups/NSD_contoso/configurationGroupSchemas/MyVM_Configuration_Schema", + }, + }, + resourceElementTemplates: [], + versionState: "Active", + }, + }, + ); + console.log(result); +} + +async function main(): Promise { + await createOrUpdateANetworkServiceDesignVersionResource(); +} + +main().catch(console.error); diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/networkServiceDesignVersionsDeleteSample.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/networkServiceDesignVersionsDeleteSample.ts new file mode 100644 index 0000000000..a706e676c2 --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/networkServiceDesignVersionsDeleteSample.ts @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { HybridNetworkManagementClient } from "@azure/arm-hybridnetwork"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to deletes the specified network service design version. + * + * @summary deletes the specified network service design version. + * x-ms-original-file: 2025-03-30/NetworkServiceDesignVersionDelete.json + */ +async function deleteANetworkServiceDesignVersion(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subid"; + const client = new HybridNetworkManagementClient(credential, subscriptionId); + await client.networkServiceDesignVersions.delete( + "rg", + "TestPublisher", + "TestNetworkServiceDesignGroupName", + "1.0.0", + ); +} + +async function main(): Promise { + await deleteANetworkServiceDesignVersion(); +} + +main().catch(console.error); diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/networkServiceDesignVersionsGetSample.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/networkServiceDesignVersionsGetSample.ts new file mode 100644 index 0000000000..7f32404ffb --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/networkServiceDesignVersionsGetSample.ts @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { HybridNetworkManagementClient } from "@azure/arm-hybridnetwork"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to gets information about a network service design version. + * + * @summary gets information about a network service design version. + * x-ms-original-file: 2025-03-30/NetworkServiceDesignVersionGet.json + */ +async function getANetworkServiceDesignVersionResource(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subid"; + const client = new HybridNetworkManagementClient(credential, subscriptionId); + const result = await client.networkServiceDesignVersions.get( + "rg", + "TestPublisher", + "TestNetworkServiceDesignGroupName", + "1.0.0", + ); + console.log(result); +} + +async function main(): Promise { + await getANetworkServiceDesignVersionResource(); +} + +main().catch(console.error); diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/networkServiceDesignVersionsListByNetworkServiceDesignGroupSample.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/networkServiceDesignVersionsListByNetworkServiceDesignGroupSample.ts new file mode 100644 index 0000000000..615ae5f81d --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/networkServiceDesignVersionsListByNetworkServiceDesignGroupSample.ts @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { HybridNetworkManagementClient } from "@azure/arm-hybridnetwork"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to gets information about a list of network service design versions under a network service design group. + * + * @summary gets information about a list of network service design versions under a network service design group. + * x-ms-original-file: 2025-03-30/NetworkServiceDesignVersionListByNetworkServiceDesignGroup.json + */ +async function getPublisherResource(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subid"; + const client = new HybridNetworkManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.networkServiceDesignVersions.listByNetworkServiceDesignGroup( + "rg", + "TestPublisher", + "TestNetworkServiceDesignGroupName", + )) { + resArray.push(item); + } + + console.log(resArray); +} + +async function main(): Promise { + await getPublisherResource(); +} + +main().catch(console.error); diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/networkServiceDesignVersionsUpdateSample.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/networkServiceDesignVersionsUpdateSample.ts new file mode 100644 index 0000000000..ab32bd2bb2 --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/networkServiceDesignVersionsUpdateSample.ts @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { HybridNetworkManagementClient } from "@azure/arm-hybridnetwork"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to updates a network service design version resource. + * + * @summary updates a network service design version resource. + * x-ms-original-file: 2025-03-30/NetworkServiceDesignVersionUpdateTags.json + */ +async function updateTheNetworkServiceDesignVersionTags(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subid"; + const client = new HybridNetworkManagementClient(credential, subscriptionId); + const result = await client.networkServiceDesignVersions.update( + "rg", + "TestPublisher", + "TestNetworkServiceDesignGroupName", + "1.0.0", + { tags: { tag1: "value1", tag2: "value2" } }, + ); + console.log(result); +} + +async function main(): Promise { + await updateTheNetworkServiceDesignVersionTags(); +} + +main().catch(console.error); diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/networkServiceDesignVersionsUpdateStateSample.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/networkServiceDesignVersionsUpdateStateSample.ts new file mode 100644 index 0000000000..f1f5505163 --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/networkServiceDesignVersionsUpdateStateSample.ts @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { HybridNetworkManagementClient } from "@azure/arm-hybridnetwork"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to update network service design version state. + * + * @summary update network service design version state. + * x-ms-original-file: 2025-03-30/NetworkServiceDesignVersionUpdateState.json + */ +async function updateNetworkServiceDesignVersionState(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subid"; + const client = new HybridNetworkManagementClient(credential, subscriptionId); + const result = await client.networkServiceDesignVersions.updateState( + "rg", + "TestPublisher", + "TestNetworkServiceDesignGroupName", + "1.0.0", + { versionState: "Active" }, + ); + console.log(result); +} + +async function main(): Promise { + await updateNetworkServiceDesignVersionState(); +} + +main().catch(console.error); diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/operationsListSample.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/operationsListSample.ts new file mode 100644 index 0000000000..446d0e812e --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/operationsListSample.ts @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { HybridNetworkManagementClient } from "@azure/arm-hybridnetwork"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to gets a list of the operations. + * + * @summary gets a list of the operations. + * x-ms-original-file: 2025-03-30/GetOperations.json + */ +async function getRegistrationOperations(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new HybridNetworkManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.operations.list()) { + resArray.push(item); + } + + console.log(resArray); +} + +async function main(): Promise { + await getRegistrationOperations(); +} + +main().catch(console.error); diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/proxyArtifactGetSample.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/proxyArtifactGetSample.ts new file mode 100644 index 0000000000..92ac897bf2 --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/proxyArtifactGetSample.ts @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { HybridNetworkManagementClient } from "@azure/arm-hybridnetwork"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to get a Artifact overview information. + * + * @summary get a Artifact overview information. + * x-ms-original-file: 2025-03-30/PureProxyArtifact/ArtifactGet.json + */ +async function getAnArtifactOverview(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subid"; + const client = new HybridNetworkManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.proxyArtifact.get( + "TestResourceGroup", + "TestPublisher", + "TestArtifactStoreName", + "fedrbac", + )) { + resArray.push(item); + } + + console.log(resArray); +} + +async function main(): Promise { + await getAnArtifactOverview(); +} + +main().catch(console.error); diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/proxyArtifactListSample.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/proxyArtifactListSample.ts new file mode 100644 index 0000000000..b9199eb441 --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/proxyArtifactListSample.ts @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { HybridNetworkManagementClient } from "@azure/arm-hybridnetwork"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to lists all the available artifacts in the parent Artifact Store. + * + * @summary lists all the available artifacts in the parent Artifact Store. + * x-ms-original-file: 2025-03-30/PureProxyArtifact/ArtifactList.json + */ +async function listArtifactsUnderAnArtifactStore(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subid"; + const client = new HybridNetworkManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.proxyArtifact.list( + "TestResourceGroup", + "TestPublisher", + "TestArtifactStoreName", + )) { + resArray.push(item); + } + + console.log(resArray); +} + +async function main(): Promise { + await listArtifactsUnderAnArtifactStore(); +} + +main().catch(console.error); diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/proxyArtifactUpdateStateSample.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/proxyArtifactUpdateStateSample.ts new file mode 100644 index 0000000000..d65fb711cc --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/proxyArtifactUpdateStateSample.ts @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { HybridNetworkManagementClient } from "@azure/arm-hybridnetwork"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to change artifact state defined in artifact store. + * + * @summary change artifact state defined in artifact store. + * x-ms-original-file: 2025-03-30/PureProxyArtifact/ArtifactChangeState.json + */ +async function updateAnArtifactState(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subid"; + const client = new HybridNetworkManagementClient(credential, subscriptionId); + const result = await client.proxyArtifact.updateState( + "TestResourceGroup", + "TestPublisher", + "TestArtifactStoreName", + "fedrbac", + "1.0.0", + { properties: { artifactState: "Deprecated" } }, + ); + console.log(result); +} + +async function main(): Promise { + await updateAnArtifactState(); +} + +main().catch(console.error); diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/publishersCreateOrUpdateSample.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/publishersCreateOrUpdateSample.ts new file mode 100644 index 0000000000..477feb859b --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/publishersCreateOrUpdateSample.ts @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { HybridNetworkManagementClient } from "@azure/arm-hybridnetwork"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to creates or updates a publisher. + * + * @summary creates or updates a publisher. + * x-ms-original-file: 2025-03-30/PublisherCreate.json + */ +async function createOrUpdateAPublisherResource(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subid"; + const client = new HybridNetworkManagementClient(credential, subscriptionId); + const result = await client.publishers.createOrUpdate("rg", "TestPublisher", { + parameters: { location: "eastus", properties: { scope: "Public" } }, + }); + console.log(result); +} + +async function main(): Promise { + await createOrUpdateAPublisherResource(); +} + +main().catch(console.error); diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/publishersDeleteSample.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/publishersDeleteSample.ts new file mode 100644 index 0000000000..362c06b038 --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/publishersDeleteSample.ts @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { HybridNetworkManagementClient } from "@azure/arm-hybridnetwork"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to deletes the specified publisher. + * + * @summary deletes the specified publisher. + * x-ms-original-file: 2025-03-30/PublisherDelete.json + */ +async function deleteAPublisherResource(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subid"; + const client = new HybridNetworkManagementClient(credential, subscriptionId); + await client.publishers.delete("rg", "TestPublisher"); +} + +async function main(): Promise { + await deleteAPublisherResource(); +} + +main().catch(console.error); diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/publishersGetSample.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/publishersGetSample.ts new file mode 100644 index 0000000000..e2bde73d99 --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/publishersGetSample.ts @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { HybridNetworkManagementClient } from "@azure/arm-hybridnetwork"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to gets information about the specified publisher. + * + * @summary gets information about the specified publisher. + * x-ms-original-file: 2025-03-30/PublisherGet.json + */ +async function getAPublisherResource(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subid"; + const client = new HybridNetworkManagementClient(credential, subscriptionId); + const result = await client.publishers.get("rg", "TestPublisher"); + console.log(result); +} + +async function main(): Promise { + await getAPublisherResource(); +} + +main().catch(console.error); diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/publishersListByResourceGroupSample.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/publishersListByResourceGroupSample.ts new file mode 100644 index 0000000000..405f0b221c --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/publishersListByResourceGroupSample.ts @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { HybridNetworkManagementClient } from "@azure/arm-hybridnetwork"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to lists all the publishers in a resource group. + * + * @summary lists all the publishers in a resource group. + * x-ms-original-file: 2025-03-30/PublisherListByResourceGroup.json + */ +async function listAllPublisherResourcesInAResourceGroup(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subid"; + const client = new HybridNetworkManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.publishers.listByResourceGroup("rg")) { + resArray.push(item); + } + + console.log(resArray); +} + +async function main(): Promise { + await listAllPublisherResourcesInAResourceGroup(); +} + +main().catch(console.error); diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/publishersListBySubscriptionSample.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/publishersListBySubscriptionSample.ts new file mode 100644 index 0000000000..318f7d8466 --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/publishersListBySubscriptionSample.ts @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { HybridNetworkManagementClient } from "@azure/arm-hybridnetwork"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to lists all the publishers in a subscription. + * + * @summary lists all the publishers in a subscription. + * x-ms-original-file: 2025-03-30/PublisherListBySubscription.json + */ +async function listAllPublisherResourcesInASubscription(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subid"; + const client = new HybridNetworkManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.publishers.listBySubscription()) { + resArray.push(item); + } + + console.log(resArray); +} + +async function main(): Promise { + await listAllPublisherResourcesInASubscription(); +} + +main().catch(console.error); diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/publishersUpdateSample.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/publishersUpdateSample.ts new file mode 100644 index 0000000000..cb3e31c4a9 --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/publishersUpdateSample.ts @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { HybridNetworkManagementClient } from "@azure/arm-hybridnetwork"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to update a publisher resource. + * + * @summary update a publisher resource. + * x-ms-original-file: 2025-03-30/PublisherUpdateTags.json + */ +async function updateAPublisherTags(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subid"; + const client = new HybridNetworkManagementClient(credential, subscriptionId); + const result = await client.publishers.update("rg", "TestPublisher", { + parameters: { tags: { tag1: "value1", tag2: "value2" } }, + }); + console.log(result); +} + +async function main(): Promise { + await updateAPublisherTags(); +} + +main().catch(console.error); diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/siteNetworkServicesCancelOperationSample.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/siteNetworkServicesCancelOperationSample.ts new file mode 100644 index 0000000000..f5da46740c --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/siteNetworkServicesCancelOperationSample.ts @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { HybridNetworkManagementClient } from "@azure/arm-hybridnetwork"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to cancels an ongoing long-running PUT operation for the specified Site Network Service resource. Other operations are not supported for cancellation at this time. + * + * @summary cancels an ongoing long-running PUT operation for the specified Site Network Service resource. Other operations are not supported for cancellation at this time. + * x-ms-original-file: 2025-03-30/SiteNetworkServicesCancelOngoingPUTOperation.json + */ +async function cancelAnInProgressSNSPUT(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "sub1"; + const client = new HybridNetworkManagementClient(credential, subscriptionId); + await client.siteNetworkServices.cancelOperation({ + longRunningOperation: "Put", + siteNetworkServiceReference: { + id: "/subscriptions/sub1/resourceGroups/rg/providers/Microsoft.HybridNetwork/siteNetworkServices/TestSNS1", + }, + }); +} + +async function main(): Promise { + await cancelAnInProgressSNSPUT(); +} + +main().catch(console.error); diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/siteNetworkServicesCreateOrUpdateSample.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/siteNetworkServicesCreateOrUpdateSample.ts new file mode 100644 index 0000000000..3d1f61f68f --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/siteNetworkServicesCreateOrUpdateSample.ts @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { HybridNetworkManagementClient } from "@azure/arm-hybridnetwork"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to creates or updates a network site. + * + * @summary creates or updates a network site. + * x-ms-original-file: 2025-03-30/SiteNetworkServiceCreate.json + */ +async function createSiteNetworkService(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subid"; + const client = new HybridNetworkManagementClient(credential, subscriptionId); + const result = await client.siteNetworkServices.createOrUpdate( + "rg1", + "testSiteNetworkServiceName", + { + location: "westUs2", + properties: { + desiredStateConfigurationGroupValueReferences: { + MyVM_Configuration: { + id: "/subscriptions/subid/resourcegroups/contosorg1/providers/microsoft.hybridnetwork/configurationgroupvalues/MyVM_Configuration1", + }, + }, + networkServiceDesignVersionResourceReference: { + id: "/subscriptions/subid/resourcegroups/rg/providers/Microsoft.HybridNetwork/publishers/TestPublisher/networkServiceDesignGroups/TestNetworkServiceDesignGroupName/networkServiceDesignVersions/1.0.0", + idType: "Open", + }, + siteReference: { + id: "/subscriptions/subid/resourcegroups/contosorg1/providers/microsoft.hybridnetwork/sites/testSite", + }, + }, + sku: { name: "Standard" }, + }, + ); + console.log(result); +} + +/** + * This sample demonstrates how to creates or updates a network site. + * + * @summary creates or updates a network site. + * x-ms-original-file: 2025-03-30/SiteNetworkServiceFirstPartyCreate.json + */ +async function createFirstPartySiteNetworkService(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subid"; + const client = new HybridNetworkManagementClient(credential, subscriptionId); + const result = await client.siteNetworkServices.createOrUpdate( + "rg1", + "testSiteNetworkServiceName", + { + location: "westUs2", + properties: { + desiredStateConfigurationGroupValueReferences: { + MyVM_Configuration: { + id: "/subscriptions/subid/resourcegroups/contosorg1/providers/microsoft.hybridnetwork/configurationgroupvalues/MyVM_Configuration1", + }, + }, + networkServiceDesignVersionResourceReference: { + id: "/subscriptions/subid/resourcegroups/rg/providers/Microsoft.HybridNetwork/publishers/TestPublisher/networkServiceDesignGroups/TestNetworkServiceDesignGroupName/networkServiceDesignVersions/1.0.0", + idType: "Secret", + }, + siteReference: { + id: "/subscriptions/subid/resourcegroups/contosorg1/providers/microsoft.hybridnetwork/sites/testSite", + }, + }, + sku: { name: "Standard" }, + }, + ); + console.log(result); +} + +async function main(): Promise { + await createSiteNetworkService(); + await createFirstPartySiteNetworkService(); +} + +main().catch(console.error); diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/siteNetworkServicesDeleteSample.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/siteNetworkServicesDeleteSample.ts new file mode 100644 index 0000000000..7fac16680b --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/siteNetworkServicesDeleteSample.ts @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { HybridNetworkManagementClient } from "@azure/arm-hybridnetwork"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to deletes the specified site network service. + * + * @summary deletes the specified site network service. + * x-ms-original-file: 2025-03-30/SiteNetworkServiceDelete.json + */ +async function deleteNetworkSite(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subid"; + const client = new HybridNetworkManagementClient(credential, subscriptionId); + await client.siteNetworkServices.delete("rg1", "testSiteNetworkServiceName"); +} + +async function main(): Promise { + await deleteNetworkSite(); +} + +main().catch(console.error); diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/siteNetworkServicesGetSample.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/siteNetworkServicesGetSample.ts new file mode 100644 index 0000000000..0df3228020 --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/siteNetworkServicesGetSample.ts @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { HybridNetworkManagementClient } from "@azure/arm-hybridnetwork"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to gets information about the specified site network service. + * + * @summary gets information about the specified site network service. + * x-ms-original-file: 2025-03-30/SiteNetworkServiceGet.json + */ +async function getNetworkSite(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subid"; + const client = new HybridNetworkManagementClient(credential, subscriptionId); + const result = await client.siteNetworkServices.get("rg1", "testSiteNetworkServiceName"); + console.log(result); +} + +async function main(): Promise { + await getNetworkSite(); +} + +main().catch(console.error); diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/siteNetworkServicesListByResourceGroupSample.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/siteNetworkServicesListByResourceGroupSample.ts new file mode 100644 index 0000000000..72b9afcb43 --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/siteNetworkServicesListByResourceGroupSample.ts @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { HybridNetworkManagementClient } from "@azure/arm-hybridnetwork"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to lists all site network services. + * + * @summary lists all site network services. + * x-ms-original-file: 2025-03-30/SiteNetworkServiceListByResourceGroup.json + */ +async function listAllNetworkSites(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subid"; + const client = new HybridNetworkManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.siteNetworkServices.listByResourceGroup("rg1")) { + resArray.push(item); + } + + console.log(resArray); +} + +async function main(): Promise { + await listAllNetworkSites(); +} + +main().catch(console.error); diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/siteNetworkServicesListBySubscriptionSample.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/siteNetworkServicesListBySubscriptionSample.ts new file mode 100644 index 0000000000..e035fac5c0 --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/siteNetworkServicesListBySubscriptionSample.ts @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { HybridNetworkManagementClient } from "@azure/arm-hybridnetwork"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to lists all sites in the network service in a subscription. + * + * @summary lists all sites in the network service in a subscription. + * x-ms-original-file: 2025-03-30/SiteNetworkServiceListBySubscription.json + */ +async function listAllHybridNetworkSitesInASubscription(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subid"; + const client = new HybridNetworkManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.siteNetworkServices.listBySubscription()) { + resArray.push(item); + } + + console.log(resArray); +} + +async function main(): Promise { + await listAllHybridNetworkSitesInASubscription(); +} + +main().catch(console.error); diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/siteNetworkServicesUpdateTagsSample.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/siteNetworkServicesUpdateTagsSample.ts new file mode 100644 index 0000000000..ce4d6aa1bc --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/siteNetworkServicesUpdateTagsSample.ts @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { HybridNetworkManagementClient } from "@azure/arm-hybridnetwork"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to updates a site update tags. + * + * @summary updates a site update tags. + * x-ms-original-file: 2025-03-30/SiteNetworkServiceUpdateTags.json + */ +async function updateNetworkSiteTags(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subid"; + const client = new HybridNetworkManagementClient(credential, subscriptionId); + const result = await client.siteNetworkServices.updateTags("rg1", "testSiteNetworkServiceName", { + tags: { tag1: "value1", tag2: "value2" }, + }); + console.log(result); +} + +async function main(): Promise { + await updateNetworkSiteTags(); +} + +main().catch(console.error); diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/sitesCreateOrUpdateSample.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/sitesCreateOrUpdateSample.ts new file mode 100644 index 0000000000..00d31e546c --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/sitesCreateOrUpdateSample.ts @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { HybridNetworkManagementClient } from "@azure/arm-hybridnetwork"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to creates or updates a network site. + * + * @summary creates or updates a network site. + * x-ms-original-file: 2025-03-30/SiteCreate.json + */ +async function createNetworkSite(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subid"; + const client = new HybridNetworkManagementClient(credential, subscriptionId); + const result = await client.sites.createOrUpdate("rg1", "testSite", { + location: "westUs2", + properties: { + nfvis: [ + { name: "nfvi1", location: "westUs2", nfviType: "AzureCore" }, + { + name: "nfvi2", + customLocationReference: { + id: "/subscriptions/subid/resourceGroups/testResourceGroup/providers/Microsoft.ExtendedLocation/customLocations/testCustomLocation1", + }, + nfviType: "AzureArcKubernetes", + }, + { + name: "nfvi3", + customLocationReference: { + id: "/subscriptions/subid/resourceGroups/testResourceGroup/providers/Microsoft.ExtendedLocation/customLocations/testCustomLocation2", + }, + nfviType: "AzureOperatorNexus", + }, + ], + }, + }); + console.log(result); +} + +async function main(): Promise { + await createNetworkSite(); +} + +main().catch(console.error); diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/sitesDeleteSample.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/sitesDeleteSample.ts new file mode 100644 index 0000000000..a0749b35c0 --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/sitesDeleteSample.ts @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { HybridNetworkManagementClient } from "@azure/arm-hybridnetwork"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to deletes the specified network site. + * + * @summary deletes the specified network site. + * x-ms-original-file: 2025-03-30/SiteDelete.json + */ +async function deleteNetworkSite(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subid"; + const client = new HybridNetworkManagementClient(credential, subscriptionId); + await client.sites.delete("rg1", "testSite"); +} + +async function main(): Promise { + await deleteNetworkSite(); +} + +main().catch(console.error); diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/sitesGetSample.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/sitesGetSample.ts new file mode 100644 index 0000000000..2fd1e66b3a --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/sitesGetSample.ts @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { HybridNetworkManagementClient } from "@azure/arm-hybridnetwork"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to gets information about the specified network site. + * + * @summary gets information about the specified network site. + * x-ms-original-file: 2025-03-30/SiteGet.json + */ +async function getNetworkSite(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subid"; + const client = new HybridNetworkManagementClient(credential, subscriptionId); + const result = await client.sites.get("rg1", "testSite"); + console.log(result); +} + +async function main(): Promise { + await getNetworkSite(); +} + +main().catch(console.error); diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/sitesListByResourceGroupSample.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/sitesListByResourceGroupSample.ts new file mode 100644 index 0000000000..897fe68d8b --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/sitesListByResourceGroupSample.ts @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { HybridNetworkManagementClient } from "@azure/arm-hybridnetwork"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to lists all sites in the network service. + * + * @summary lists all sites in the network service. + * x-ms-original-file: 2025-03-30/SiteListByResourceGroup.json + */ +async function listAllNetworkSites(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subid"; + const client = new HybridNetworkManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.sites.listByResourceGroup("rg1")) { + resArray.push(item); + } + + console.log(resArray); +} + +async function main(): Promise { + await listAllNetworkSites(); +} + +main().catch(console.error); diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/sitesListBySubscriptionSample.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/sitesListBySubscriptionSample.ts new file mode 100644 index 0000000000..eb4c2d5269 --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/sitesListBySubscriptionSample.ts @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { HybridNetworkManagementClient } from "@azure/arm-hybridnetwork"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to lists all sites in the network service in a subscription. + * + * @summary lists all sites in the network service in a subscription. + * x-ms-original-file: 2025-03-30/SiteListBySubscription.json + */ +async function listAllHybridNetworkSitesInASubscription(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subid"; + const client = new HybridNetworkManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.sites.listBySubscription()) { + resArray.push(item); + } + + console.log(resArray); +} + +async function main(): Promise { + await listAllHybridNetworkSitesInASubscription(); +} + +main().catch(console.error); diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/sitesUpdateTagsSample.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/sitesUpdateTagsSample.ts new file mode 100644 index 0000000000..4c854ef42f --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/sitesUpdateTagsSample.ts @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { HybridNetworkManagementClient } from "@azure/arm-hybridnetwork"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to updates a site update tags. + * + * @summary updates a site update tags. + * x-ms-original-file: 2025-03-30/SiteUpdateTags.json + */ +async function updateNetworkSiteTags(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "subid"; + const client = new HybridNetworkManagementClient(credential, subscriptionId); + const result = await client.sites.updateTags("rg1", "testSite", { + tags: { tag1: "value1", tag2: "value2" }, + }); + console.log(result); +} + +async function main(): Promise { + await updateNetworkSiteTags(); +} + +main().catch(console.error); diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/artifactManifests/index.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/artifactManifests/index.ts new file mode 100644 index 0000000000..c3389ffb9d --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/artifactManifests/index.ts @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +export { + updateState, + listCredential, + listByArtifactStore, + $delete, + update, + createOrUpdate, + get, +} from "./operations.js"; +export { + ArtifactManifestsUpdateStateOptionalParams, + ArtifactManifestsListCredentialOptionalParams, + ArtifactManifestsListByArtifactStoreOptionalParams, + ArtifactManifestsDeleteOptionalParams, + ArtifactManifestsUpdateOptionalParams, + ArtifactManifestsCreateOrUpdateOptionalParams, + ArtifactManifestsGetOptionalParams, +} from "./options.js"; diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/artifactManifests/operations.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/artifactManifests/operations.ts new file mode 100644 index 0000000000..f12ff5f2a8 --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/artifactManifests/operations.ts @@ -0,0 +1,508 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { HybridNetworkManagementContext as Client } from "../index.js"; +import { + errorResponseDeserializer, + TagsObject, + tagsObjectSerializer, + ArtifactManifest, + artifactManifestSerializer, + artifactManifestDeserializer, + _ArtifactManifestListResult, + _artifactManifestListResultDeserializer, + artifactAccessCredentialUnionDeserializer, + ArtifactAccessCredentialUnion, + ArtifactManifestUpdateState, + artifactManifestUpdateStateSerializer, + artifactManifestUpdateStateDeserializer, +} from "../../models/models.js"; +import { + PagedAsyncIterableIterator, + buildPagedAsyncIterator, +} from "../../static-helpers/pagingHelpers.js"; +import { getLongRunningPoller } from "../../static-helpers/pollingHelpers.js"; +import { expandUrlTemplate } from "../../static-helpers/urlTemplate.js"; +import { + ArtifactManifestsUpdateStateOptionalParams, + ArtifactManifestsListCredentialOptionalParams, + ArtifactManifestsListByArtifactStoreOptionalParams, + ArtifactManifestsDeleteOptionalParams, + ArtifactManifestsUpdateOptionalParams, + ArtifactManifestsCreateOrUpdateOptionalParams, + ArtifactManifestsGetOptionalParams, +} from "./options.js"; +import { + StreamableMethod, + PathUncheckedResponse, + createRestError, + operationOptionsToRequestParameters, +} from "@azure-rest/core-client"; +import { PollerLike, OperationState } from "@azure/core-lro"; + +export function _updateStateSend( + context: Client, + resourceGroupName: string, + publisherName: string, + artifactStoreName: string, + artifactManifestName: string, + parameters: ArtifactManifestUpdateState, + options: ArtifactManifestsUpdateStateOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/artifactStores/{artifactStoreName}/artifactManifests/{artifactManifestName}/updateState{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + publisherName: publisherName, + artifactStoreName: artifactStoreName, + artifactManifestName: artifactManifestName, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context + .path(path) + .post({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + headers: { accept: "application/json", ...options.requestOptions?.headers }, + body: artifactManifestUpdateStateSerializer(parameters), + }); +} + +export async function _updateStateDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["200", "202", "201"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return artifactManifestUpdateStateDeserializer(result.body); +} + +/** Update state for artifact manifest. */ +export function updateState( + context: Client, + resourceGroupName: string, + publisherName: string, + artifactStoreName: string, + artifactManifestName: string, + parameters: ArtifactManifestUpdateState, + options: ArtifactManifestsUpdateStateOptionalParams = { requestOptions: {} }, +): PollerLike, ArtifactManifestUpdateState> { + return getLongRunningPoller(context, _updateStateDeserialize, ["200", "202", "201"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _updateStateSend( + context, + resourceGroupName, + publisherName, + artifactStoreName, + artifactManifestName, + parameters, + options, + ), + resourceLocationConfig: "location", + }) as PollerLike, ArtifactManifestUpdateState>; +} + +export function _listCredentialSend( + context: Client, + resourceGroupName: string, + publisherName: string, + artifactStoreName: string, + artifactManifestName: string, + options: ArtifactManifestsListCredentialOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/artifactStores/{artifactStoreName}/artifactManifests/{artifactManifestName}/listCredential{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + publisherName: publisherName, + artifactStoreName: artifactStoreName, + artifactManifestName: artifactManifestName, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context + .path(path) + .post({ + ...operationOptionsToRequestParameters(options), + headers: { accept: "application/json", ...options.requestOptions?.headers }, + }); +} + +export async function _listCredentialDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return artifactAccessCredentialUnionDeserializer(result.body); +} + +/** List credential for publishing artifacts defined in artifact manifest. */ +export async function listCredential( + context: Client, + resourceGroupName: string, + publisherName: string, + artifactStoreName: string, + artifactManifestName: string, + options: ArtifactManifestsListCredentialOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _listCredentialSend( + context, + resourceGroupName, + publisherName, + artifactStoreName, + artifactManifestName, + options, + ); + return _listCredentialDeserialize(result); +} + +export function _listByArtifactStoreSend( + context: Client, + resourceGroupName: string, + publisherName: string, + artifactStoreName: string, + options: ArtifactManifestsListByArtifactStoreOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/artifactStores/{artifactStoreName}/artifactManifests{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + publisherName: publisherName, + artifactStoreName: artifactStoreName, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context + .path(path) + .get({ + ...operationOptionsToRequestParameters(options), + headers: { accept: "application/json", ...options.requestOptions?.headers }, + }); +} + +export async function _listByArtifactStoreDeserialize( + result: PathUncheckedResponse, +): Promise<_ArtifactManifestListResult> { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return _artifactManifestListResultDeserializer(result.body); +} + +/** Gets information about the artifact manifest. */ +export function listByArtifactStore( + context: Client, + resourceGroupName: string, + publisherName: string, + artifactStoreName: string, + options: ArtifactManifestsListByArtifactStoreOptionalParams = { requestOptions: {} }, +): PagedAsyncIterableIterator { + return buildPagedAsyncIterator( + context, + () => + _listByArtifactStoreSend( + context, + resourceGroupName, + publisherName, + artifactStoreName, + options, + ), + _listByArtifactStoreDeserialize, + ["200"], + { itemName: "value", nextLinkName: "nextLink" }, + ); +} + +export function _$deleteSend( + context: Client, + resourceGroupName: string, + publisherName: string, + artifactStoreName: string, + artifactManifestName: string, + options: ArtifactManifestsDeleteOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/artifactStores/{artifactStoreName}/artifactManifests/{artifactManifestName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + publisherName: publisherName, + artifactStoreName: artifactStoreName, + artifactManifestName: artifactManifestName, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).delete({ ...operationOptionsToRequestParameters(options) }); +} + +export async function _$deleteDeserialize(result: PathUncheckedResponse): Promise { + const expectedStatuses = ["202", "204", "200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return; +} + +/** Deletes the specified artifact manifest. */ +/** + * @fixme delete is a reserved word that cannot be used as an operation name. + * Please add @clientName("clientName") or @clientName("", "javascript") + * to the operation to override the generated name. + */ +export function $delete( + context: Client, + resourceGroupName: string, + publisherName: string, + artifactStoreName: string, + artifactManifestName: string, + options: ArtifactManifestsDeleteOptionalParams = { requestOptions: {} }, +): PollerLike, void> { + return getLongRunningPoller(context, _$deleteDeserialize, ["202", "204", "200"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _$deleteSend( + context, + resourceGroupName, + publisherName, + artifactStoreName, + artifactManifestName, + options, + ), + resourceLocationConfig: "location", + }) as PollerLike, void>; +} + +export function _updateSend( + context: Client, + resourceGroupName: string, + publisherName: string, + artifactStoreName: string, + artifactManifestName: string, + parameters: TagsObject, + options: ArtifactManifestsUpdateOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/artifactStores/{artifactStoreName}/artifactManifests/{artifactManifestName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + publisherName: publisherName, + artifactStoreName: artifactStoreName, + artifactManifestName: artifactManifestName, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context + .path(path) + .patch({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + headers: { accept: "application/json", ...options.requestOptions?.headers }, + body: tagsObjectSerializer(parameters), + }); +} + +export async function _updateDeserialize(result: PathUncheckedResponse): Promise { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return artifactManifestDeserializer(result.body); +} + +/** Updates a artifact manifest resource. */ +export async function update( + context: Client, + resourceGroupName: string, + publisherName: string, + artifactStoreName: string, + artifactManifestName: string, + parameters: TagsObject, + options: ArtifactManifestsUpdateOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _updateSend( + context, + resourceGroupName, + publisherName, + artifactStoreName, + artifactManifestName, + parameters, + options, + ); + return _updateDeserialize(result); +} + +export function _createOrUpdateSend( + context: Client, + resourceGroupName: string, + publisherName: string, + artifactStoreName: string, + artifactManifestName: string, + parameters: ArtifactManifest, + options: ArtifactManifestsCreateOrUpdateOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/artifactStores/{artifactStoreName}/artifactManifests/{artifactManifestName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + publisherName: publisherName, + artifactStoreName: artifactStoreName, + artifactManifestName: artifactManifestName, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context + .path(path) + .put({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + headers: { accept: "application/json", ...options.requestOptions?.headers }, + body: artifactManifestSerializer(parameters), + }); +} + +export async function _createOrUpdateDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["200", "201", "202"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return artifactManifestDeserializer(result.body); +} + +/** Creates or updates a artifact manifest. */ +export function createOrUpdate( + context: Client, + resourceGroupName: string, + publisherName: string, + artifactStoreName: string, + artifactManifestName: string, + parameters: ArtifactManifest, + options: ArtifactManifestsCreateOrUpdateOptionalParams = { requestOptions: {} }, +): PollerLike, ArtifactManifest> { + return getLongRunningPoller(context, _createOrUpdateDeserialize, ["200", "201", "202"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _createOrUpdateSend( + context, + resourceGroupName, + publisherName, + artifactStoreName, + artifactManifestName, + parameters, + options, + ), + resourceLocationConfig: "azure-async-operation", + }) as PollerLike, ArtifactManifest>; +} + +export function _getSend( + context: Client, + resourceGroupName: string, + publisherName: string, + artifactStoreName: string, + artifactManifestName: string, + options: ArtifactManifestsGetOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/artifactStores/{artifactStoreName}/artifactManifests/{artifactManifestName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + publisherName: publisherName, + artifactStoreName: artifactStoreName, + artifactManifestName: artifactManifestName, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context + .path(path) + .get({ + ...operationOptionsToRequestParameters(options), + headers: { accept: "application/json", ...options.requestOptions?.headers }, + }); +} + +export async function _getDeserialize(result: PathUncheckedResponse): Promise { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return artifactManifestDeserializer(result.body); +} + +/** Gets information about a artifact manifest resource. */ +export async function get( + context: Client, + resourceGroupName: string, + publisherName: string, + artifactStoreName: string, + artifactManifestName: string, + options: ArtifactManifestsGetOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _getSend( + context, + resourceGroupName, + publisherName, + artifactStoreName, + artifactManifestName, + options, + ); + return _getDeserialize(result); +} diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/artifactManifests/options.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/artifactManifests/options.ts new file mode 100644 index 0000000000..f95956e291 --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/artifactManifests/options.ts @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { OperationOptions } from "@azure-rest/core-client"; + +/** Optional parameters. */ +export interface ArtifactManifestsUpdateStateOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface ArtifactManifestsListCredentialOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface ArtifactManifestsListByArtifactStoreOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface ArtifactManifestsDeleteOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface ArtifactManifestsUpdateOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface ArtifactManifestsCreateOrUpdateOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface ArtifactManifestsGetOptionalParams extends OperationOptions {} diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/artifactStores/index.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/artifactStores/index.ts new file mode 100644 index 0000000000..b006a792e9 --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/artifactStores/index.ts @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +export { + listPrivateEndPoints, + removePrivateEndPoints, + approvePrivateEndPoints, + listNetworkFabricControllerPrivateEndPoints, + deleteNetworkFabricControllerEndPoints, + addNetworkFabricControllerEndPoints, + listByPublisher, + $delete, + update, + createOrUpdate, + get, +} from "./operations.js"; +export { + ArtifactStoresListPrivateEndPointsOptionalParams, + ArtifactStoresRemovePrivateEndPointsOptionalParams, + ArtifactStoresApprovePrivateEndPointsOptionalParams, + ArtifactStoresListNetworkFabricControllerPrivateEndPointsOptionalParams, + ArtifactStoresDeleteNetworkFabricControllerEndPointsOptionalParams, + ArtifactStoresAddNetworkFabricControllerEndPointsOptionalParams, + ArtifactStoresListByPublisherOptionalParams, + ArtifactStoresDeleteOptionalParams, + ArtifactStoresUpdateOptionalParams, + ArtifactStoresCreateOrUpdateOptionalParams, + ArtifactStoresGetOptionalParams, +} from "./options.js"; diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/artifactStores/operations.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/artifactStores/operations.ts new file mode 100644 index 0000000000..ffa44e32aa --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/artifactStores/operations.ts @@ -0,0 +1,791 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { HybridNetworkManagementContext as Client } from "../index.js"; +import { + errorResponseDeserializer, + TagsObject, + tagsObjectSerializer, + ArtifactStore, + artifactStoreSerializer, + artifactStoreDeserializer, + _ArtifactStoreListResult, + _artifactStoreListResultDeserializer, + ArtifactStoreNetworkFabricControllerEndPoints, + artifactStoreNetworkFabricControllerEndPointsSerializer, + _ArtifactStoreNetworkFabricControllerEndPointsList, + _artifactStoreNetworkFabricControllerEndPointsListDeserializer, + ArtifactStorePrivateEndPointsFormat, + artifactStorePrivateEndPointsFormatSerializer, + _ArtifactStorePrivateEndPointsListResult, + _artifactStorePrivateEndPointsListResultDeserializer, +} from "../../models/models.js"; +import { + PagedAsyncIterableIterator, + buildPagedAsyncIterator, +} from "../../static-helpers/pagingHelpers.js"; +import { getLongRunningPoller } from "../../static-helpers/pollingHelpers.js"; +import { expandUrlTemplate } from "../../static-helpers/urlTemplate.js"; +import { + ArtifactStoresListPrivateEndPointsOptionalParams, + ArtifactStoresRemovePrivateEndPointsOptionalParams, + ArtifactStoresApprovePrivateEndPointsOptionalParams, + ArtifactStoresListNetworkFabricControllerPrivateEndPointsOptionalParams, + ArtifactStoresDeleteNetworkFabricControllerEndPointsOptionalParams, + ArtifactStoresAddNetworkFabricControllerEndPointsOptionalParams, + ArtifactStoresListByPublisherOptionalParams, + ArtifactStoresDeleteOptionalParams, + ArtifactStoresUpdateOptionalParams, + ArtifactStoresCreateOrUpdateOptionalParams, + ArtifactStoresGetOptionalParams, +} from "./options.js"; +import { + StreamableMethod, + PathUncheckedResponse, + createRestError, + operationOptionsToRequestParameters, +} from "@azure-rest/core-client"; +import { PollerLike, OperationState } from "@azure/core-lro"; + +export function _listPrivateEndPointsSend( + context: Client, + resourceGroupName: string, + publisherName: string, + artifactStoreName: string, + options: ArtifactStoresListPrivateEndPointsOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/artifactStores/{artifactStoreName}/listPrivateEndPoints{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + publisherName: publisherName, + artifactStoreName: artifactStoreName, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context + .path(path) + .post({ + ...operationOptionsToRequestParameters(options), + headers: { accept: "application/json", ...options.requestOptions?.headers }, + }); +} + +export async function _listPrivateEndPointsDeserialize( + result: PathUncheckedResponse, +): Promise<_ArtifactStorePrivateEndPointsListResult> { + const expectedStatuses = ["200", "202", "201"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return _artifactStorePrivateEndPointsListResultDeserializer(result.body); +} + +/** List manual private endpoints on artifact stores */ +export function listPrivateEndPoints( + context: Client, + resourceGroupName: string, + publisherName: string, + artifactStoreName: string, + options: ArtifactStoresListPrivateEndPointsOptionalParams = { requestOptions: {} }, +): PagedAsyncIterableIterator { + const initialPagingPoller = getLongRunningPoller( + context, + async (result: PathUncheckedResponse) => result, + ["200", "202", "201"], + { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _listPrivateEndPointsSend( + context, + resourceGroupName, + publisherName, + artifactStoreName, + options, + ), + resourceLocationConfig: "location", + }, + ) as PollerLike, PathUncheckedResponse>; + + return buildPagedAsyncIterator( + context, + async () => await initialPagingPoller, + _listPrivateEndPointsDeserialize, + ["200", "202", "201"], + { itemName: "value", nextLinkName: "nextLink" }, + ); +} + +export function _removePrivateEndPointsSend( + context: Client, + resourceGroupName: string, + publisherName: string, + artifactStoreName: string, + parameters: ArtifactStorePrivateEndPointsFormat, + options: ArtifactStoresRemovePrivateEndPointsOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/artifactStores/{artifactStoreName}/removePrivateEndPoints{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + publisherName: publisherName, + artifactStoreName: artifactStoreName, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context + .path(path) + .post({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + body: artifactStorePrivateEndPointsFormatSerializer(parameters), + }); +} + +export async function _removePrivateEndPointsDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["202", "200", "201"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return; +} + +/** Remove manual private endpoints on artifact stores */ +export function removePrivateEndPoints( + context: Client, + resourceGroupName: string, + publisherName: string, + artifactStoreName: string, + parameters: ArtifactStorePrivateEndPointsFormat, + options: ArtifactStoresRemovePrivateEndPointsOptionalParams = { requestOptions: {} }, +): PollerLike, void> { + return getLongRunningPoller(context, _removePrivateEndPointsDeserialize, ["202", "200", "201"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _removePrivateEndPointsSend( + context, + resourceGroupName, + publisherName, + artifactStoreName, + parameters, + options, + ), + resourceLocationConfig: "location", + }) as PollerLike, void>; +} + +export function _approvePrivateEndPointsSend( + context: Client, + resourceGroupName: string, + publisherName: string, + artifactStoreName: string, + parameters: ArtifactStorePrivateEndPointsFormat, + options: ArtifactStoresApprovePrivateEndPointsOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/artifactStores/{artifactStoreName}/approvePrivateEndPoints{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + publisherName: publisherName, + artifactStoreName: artifactStoreName, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context + .path(path) + .post({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + body: artifactStorePrivateEndPointsFormatSerializer(parameters), + }); +} + +export async function _approvePrivateEndPointsDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["202", "200", "201"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return; +} + +/** Approve manual private endpoints on artifact stores */ +export function approvePrivateEndPoints( + context: Client, + resourceGroupName: string, + publisherName: string, + artifactStoreName: string, + parameters: ArtifactStorePrivateEndPointsFormat, + options: ArtifactStoresApprovePrivateEndPointsOptionalParams = { requestOptions: {} }, +): PollerLike, void> { + return getLongRunningPoller(context, _approvePrivateEndPointsDeserialize, ["202", "200", "201"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _approvePrivateEndPointsSend( + context, + resourceGroupName, + publisherName, + artifactStoreName, + parameters, + options, + ), + resourceLocationConfig: "location", + }) as PollerLike, void>; +} + +export function _listNetworkFabricControllerPrivateEndPointsSend( + context: Client, + resourceGroupName: string, + publisherName: string, + artifactStoreName: string, + options: ArtifactStoresListNetworkFabricControllerPrivateEndPointsOptionalParams = { + requestOptions: {}, + }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/artifactStores/{artifactStoreName}/listNetworkFabricControllerPrivateEndPoints{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + publisherName: publisherName, + artifactStoreName: artifactStoreName, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context + .path(path) + .post({ + ...operationOptionsToRequestParameters(options), + headers: { accept: "application/json", ...options.requestOptions?.headers }, + }); +} + +export async function _listNetworkFabricControllerPrivateEndPointsDeserialize( + result: PathUncheckedResponse, +): Promise<_ArtifactStoreNetworkFabricControllerEndPointsList> { + const expectedStatuses = ["200", "202", "201"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return _artifactStoreNetworkFabricControllerEndPointsListDeserializer(result.body); +} + +/** List network fabric controllers to artifact stores */ +export function listNetworkFabricControllerPrivateEndPoints( + context: Client, + resourceGroupName: string, + publisherName: string, + artifactStoreName: string, + options: ArtifactStoresListNetworkFabricControllerPrivateEndPointsOptionalParams = { + requestOptions: {}, + }, +): PagedAsyncIterableIterator { + const initialPagingPoller = getLongRunningPoller( + context, + async (result: PathUncheckedResponse) => result, + ["200", "202", "201"], + { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _listNetworkFabricControllerPrivateEndPointsSend( + context, + resourceGroupName, + publisherName, + artifactStoreName, + options, + ), + resourceLocationConfig: "location", + }, + ) as PollerLike, PathUncheckedResponse>; + + return buildPagedAsyncIterator( + context, + async () => await initialPagingPoller, + _listNetworkFabricControllerPrivateEndPointsDeserialize, + ["200", "202", "201"], + { itemName: "value", nextLinkName: "nextLink" }, + ); +} + +export function _deleteNetworkFabricControllerEndPointsSend( + context: Client, + resourceGroupName: string, + publisherName: string, + artifactStoreName: string, + parameters: ArtifactStoreNetworkFabricControllerEndPoints, + options: ArtifactStoresDeleteNetworkFabricControllerEndPointsOptionalParams = { + requestOptions: {}, + }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/artifactStores/{artifactStoreName}/deleteNetworkFabricControllerEndPoints{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + publisherName: publisherName, + artifactStoreName: artifactStoreName, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context + .path(path) + .post({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + body: artifactStoreNetworkFabricControllerEndPointsSerializer(parameters), + }); +} + +export async function _deleteNetworkFabricControllerEndPointsDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["202", "200", "201"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return; +} + +/** Delete network fabric controllers on artifact stores */ +export function deleteNetworkFabricControllerEndPoints( + context: Client, + resourceGroupName: string, + publisherName: string, + artifactStoreName: string, + parameters: ArtifactStoreNetworkFabricControllerEndPoints, + options: ArtifactStoresDeleteNetworkFabricControllerEndPointsOptionalParams = { + requestOptions: {}, + }, +): PollerLike, void> { + return getLongRunningPoller( + context, + _deleteNetworkFabricControllerEndPointsDeserialize, + ["202", "200", "201"], + { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _deleteNetworkFabricControllerEndPointsSend( + context, + resourceGroupName, + publisherName, + artifactStoreName, + parameters, + options, + ), + resourceLocationConfig: "location", + }, + ) as PollerLike, void>; +} + +export function _addNetworkFabricControllerEndPointsSend( + context: Client, + resourceGroupName: string, + publisherName: string, + artifactStoreName: string, + parameters: ArtifactStoreNetworkFabricControllerEndPoints, + options: ArtifactStoresAddNetworkFabricControllerEndPointsOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/artifactStores/{artifactStoreName}/addNetworkFabricControllerEndPoints{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + publisherName: publisherName, + artifactStoreName: artifactStoreName, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context + .path(path) + .post({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + body: artifactStoreNetworkFabricControllerEndPointsSerializer(parameters), + }); +} + +export async function _addNetworkFabricControllerEndPointsDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["202", "200", "201"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return; +} + +/** Add network fabric controllers to artifact stores */ +export function addNetworkFabricControllerEndPoints( + context: Client, + resourceGroupName: string, + publisherName: string, + artifactStoreName: string, + parameters: ArtifactStoreNetworkFabricControllerEndPoints, + options: ArtifactStoresAddNetworkFabricControllerEndPointsOptionalParams = { requestOptions: {} }, +): PollerLike, void> { + return getLongRunningPoller( + context, + _addNetworkFabricControllerEndPointsDeserialize, + ["202", "200", "201"], + { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _addNetworkFabricControllerEndPointsSend( + context, + resourceGroupName, + publisherName, + artifactStoreName, + parameters, + options, + ), + resourceLocationConfig: "location", + }, + ) as PollerLike, void>; +} + +export function _listByPublisherSend( + context: Client, + resourceGroupName: string, + publisherName: string, + options: ArtifactStoresListByPublisherOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/artifactStores{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + publisherName: publisherName, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context + .path(path) + .get({ + ...operationOptionsToRequestParameters(options), + headers: { accept: "application/json", ...options.requestOptions?.headers }, + }); +} + +export async function _listByPublisherDeserialize( + result: PathUncheckedResponse, +): Promise<_ArtifactStoreListResult> { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return _artifactStoreListResultDeserializer(result.body); +} + +/** Gets information of the ArtifactStores under publisher. */ +export function listByPublisher( + context: Client, + resourceGroupName: string, + publisherName: string, + options: ArtifactStoresListByPublisherOptionalParams = { requestOptions: {} }, +): PagedAsyncIterableIterator { + return buildPagedAsyncIterator( + context, + () => _listByPublisherSend(context, resourceGroupName, publisherName, options), + _listByPublisherDeserialize, + ["200"], + { itemName: "value", nextLinkName: "nextLink" }, + ); +} + +export function _$deleteSend( + context: Client, + resourceGroupName: string, + publisherName: string, + artifactStoreName: string, + options: ArtifactStoresDeleteOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/artifactStores/{artifactStoreName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + publisherName: publisherName, + artifactStoreName: artifactStoreName, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).delete({ ...operationOptionsToRequestParameters(options) }); +} + +export async function _$deleteDeserialize(result: PathUncheckedResponse): Promise { + const expectedStatuses = ["202", "204", "200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return; +} + +/** Deletes the specified artifact store. */ +/** + * @fixme delete is a reserved word that cannot be used as an operation name. + * Please add @clientName("clientName") or @clientName("", "javascript") + * to the operation to override the generated name. + */ +export function $delete( + context: Client, + resourceGroupName: string, + publisherName: string, + artifactStoreName: string, + options: ArtifactStoresDeleteOptionalParams = { requestOptions: {} }, +): PollerLike, void> { + return getLongRunningPoller(context, _$deleteDeserialize, ["202", "204", "200"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _$deleteSend(context, resourceGroupName, publisherName, artifactStoreName, options), + resourceLocationConfig: "location", + }) as PollerLike, void>; +} + +export function _updateSend( + context: Client, + resourceGroupName: string, + publisherName: string, + artifactStoreName: string, + parameters: TagsObject, + options: ArtifactStoresUpdateOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/artifactStores/{artifactStoreName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + publisherName: publisherName, + artifactStoreName: artifactStoreName, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context + .path(path) + .patch({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + headers: { accept: "application/json", ...options.requestOptions?.headers }, + body: tagsObjectSerializer(parameters), + }); +} + +export async function _updateDeserialize(result: PathUncheckedResponse): Promise { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return artifactStoreDeserializer(result.body); +} + +/** Update artifact store resource. */ +export async function update( + context: Client, + resourceGroupName: string, + publisherName: string, + artifactStoreName: string, + parameters: TagsObject, + options: ArtifactStoresUpdateOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _updateSend( + context, + resourceGroupName, + publisherName, + artifactStoreName, + parameters, + options, + ); + return _updateDeserialize(result); +} + +export function _createOrUpdateSend( + context: Client, + resourceGroupName: string, + publisherName: string, + artifactStoreName: string, + parameters: ArtifactStore, + options: ArtifactStoresCreateOrUpdateOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/artifactStores/{artifactStoreName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + publisherName: publisherName, + artifactStoreName: artifactStoreName, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context + .path(path) + .put({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + headers: { accept: "application/json", ...options.requestOptions?.headers }, + body: artifactStoreSerializer(parameters), + }); +} + +export async function _createOrUpdateDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["200", "201", "202"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return artifactStoreDeserializer(result.body); +} + +/** Creates or updates a artifact store. */ +export function createOrUpdate( + context: Client, + resourceGroupName: string, + publisherName: string, + artifactStoreName: string, + parameters: ArtifactStore, + options: ArtifactStoresCreateOrUpdateOptionalParams = { requestOptions: {} }, +): PollerLike, ArtifactStore> { + return getLongRunningPoller(context, _createOrUpdateDeserialize, ["200", "201", "202"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _createOrUpdateSend( + context, + resourceGroupName, + publisherName, + artifactStoreName, + parameters, + options, + ), + resourceLocationConfig: "azure-async-operation", + }) as PollerLike, ArtifactStore>; +} + +export function _getSend( + context: Client, + resourceGroupName: string, + publisherName: string, + artifactStoreName: string, + options: ArtifactStoresGetOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/artifactStores/{artifactStoreName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + publisherName: publisherName, + artifactStoreName: artifactStoreName, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context + .path(path) + .get({ + ...operationOptionsToRequestParameters(options), + headers: { accept: "application/json", ...options.requestOptions?.headers }, + }); +} + +export async function _getDeserialize(result: PathUncheckedResponse): Promise { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return artifactStoreDeserializer(result.body); +} + +/** Gets information about the specified artifact store. */ +export async function get( + context: Client, + resourceGroupName: string, + publisherName: string, + artifactStoreName: string, + options: ArtifactStoresGetOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _getSend( + context, + resourceGroupName, + publisherName, + artifactStoreName, + options, + ); + return _getDeserialize(result); +} diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/artifactStores/options.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/artifactStores/options.ts new file mode 100644 index 0000000000..98b01e094e --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/artifactStores/options.ts @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { OperationOptions } from "@azure-rest/core-client"; + +/** Optional parameters. */ +export interface ArtifactStoresListPrivateEndPointsOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface ArtifactStoresRemovePrivateEndPointsOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface ArtifactStoresApprovePrivateEndPointsOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface ArtifactStoresListNetworkFabricControllerPrivateEndPointsOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface ArtifactStoresDeleteNetworkFabricControllerEndPointsOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface ArtifactStoresAddNetworkFabricControllerEndPointsOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface ArtifactStoresListByPublisherOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface ArtifactStoresDeleteOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface ArtifactStoresUpdateOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface ArtifactStoresCreateOrUpdateOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface ArtifactStoresGetOptionalParams extends OperationOptions {} diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/components/index.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/components/index.ts new file mode 100644 index 0000000000..57f5c9cf54 --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/components/index.ts @@ -0,0 +1,8 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +export { listByNetworkFunction, get } from "./operations.js"; +export { + ComponentsListByNetworkFunctionOptionalParams, + ComponentsGetOptionalParams, +} from "./options.js"; diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/components/operations.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/components/operations.ts new file mode 100644 index 0000000000..ac4b1f2f6d --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/components/operations.ts @@ -0,0 +1,138 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { HybridNetworkManagementContext as Client } from "../index.js"; +import { + errorResponseDeserializer, + Component, + componentDeserializer, + _ComponentListResult, + _componentListResultDeserializer, +} from "../../models/models.js"; +import { + PagedAsyncIterableIterator, + buildPagedAsyncIterator, +} from "../../static-helpers/pagingHelpers.js"; +import { expandUrlTemplate } from "../../static-helpers/urlTemplate.js"; +import { + ComponentsListByNetworkFunctionOptionalParams, + ComponentsGetOptionalParams, +} from "./options.js"; +import { + StreamableMethod, + PathUncheckedResponse, + createRestError, + operationOptionsToRequestParameters, +} from "@azure-rest/core-client"; + +export function _listByNetworkFunctionSend( + context: Client, + resourceGroupName: string, + networkFunctionName: string, + options: ComponentsListByNetworkFunctionOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/networkFunctions/{networkFunctionName}/components{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + networkFunctionName: networkFunctionName, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context + .path(path) + .get({ + ...operationOptionsToRequestParameters(options), + headers: { accept: "application/json", ...options.requestOptions?.headers }, + }); +} + +export async function _listByNetworkFunctionDeserialize( + result: PathUncheckedResponse, +): Promise<_ComponentListResult> { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return _componentListResultDeserializer(result.body); +} + +/** Lists all the component resources in a network function. */ +export function listByNetworkFunction( + context: Client, + resourceGroupName: string, + networkFunctionName: string, + options: ComponentsListByNetworkFunctionOptionalParams = { requestOptions: {} }, +): PagedAsyncIterableIterator { + return buildPagedAsyncIterator( + context, + () => _listByNetworkFunctionSend(context, resourceGroupName, networkFunctionName, options), + _listByNetworkFunctionDeserialize, + ["200"], + { itemName: "value", nextLinkName: "nextLink" }, + ); +} + +export function _getSend( + context: Client, + resourceGroupName: string, + networkFunctionName: string, + componentName: string, + options: ComponentsGetOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/networkFunctions/{networkFunctionName}/components/{componentName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + networkFunctionName: networkFunctionName, + componentName: componentName, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context + .path(path) + .get({ + ...operationOptionsToRequestParameters(options), + headers: { accept: "application/json", ...options.requestOptions?.headers }, + }); +} + +export async function _getDeserialize(result: PathUncheckedResponse): Promise { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return componentDeserializer(result.body); +} + +/** Gets information about the specified application instance resource. */ +export async function get( + context: Client, + resourceGroupName: string, + networkFunctionName: string, + componentName: string, + options: ComponentsGetOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _getSend( + context, + resourceGroupName, + networkFunctionName, + componentName, + options, + ); + return _getDeserialize(result); +} diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/components/options.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/components/options.ts new file mode 100644 index 0000000000..dbf9153de1 --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/components/options.ts @@ -0,0 +1,10 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { OperationOptions } from "@azure-rest/core-client"; + +/** Optional parameters. */ +export interface ComponentsListByNetworkFunctionOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface ComponentsGetOptionalParams extends OperationOptions {} diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/configurationGroupSchemas/index.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/configurationGroupSchemas/index.ts new file mode 100644 index 0000000000..1e3ce9b56c --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/configurationGroupSchemas/index.ts @@ -0,0 +1,19 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +export { + updateState, + listByPublisher, + $delete, + update, + createOrUpdate, + get, +} from "./operations.js"; +export { + ConfigurationGroupSchemasUpdateStateOptionalParams, + ConfigurationGroupSchemasListByPublisherOptionalParams, + ConfigurationGroupSchemasDeleteOptionalParams, + ConfigurationGroupSchemasUpdateOptionalParams, + ConfigurationGroupSchemasCreateOrUpdateOptionalParams, + ConfigurationGroupSchemasGetOptionalParams, +} from "./options.js"; diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/configurationGroupSchemas/operations.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/configurationGroupSchemas/operations.ts new file mode 100644 index 0000000000..97114de76f --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/configurationGroupSchemas/operations.ts @@ -0,0 +1,422 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { HybridNetworkManagementContext as Client } from "../index.js"; +import { + errorResponseDeserializer, + ConfigurationGroupSchema, + configurationGroupSchemaSerializer, + configurationGroupSchemaDeserializer, + TagsObject, + tagsObjectSerializer, + _ConfigurationGroupSchemaListResult, + _configurationGroupSchemaListResultDeserializer, + ConfigurationGroupSchemaVersionUpdateState, + configurationGroupSchemaVersionUpdateStateSerializer, + configurationGroupSchemaVersionUpdateStateDeserializer, +} from "../../models/models.js"; +import { + PagedAsyncIterableIterator, + buildPagedAsyncIterator, +} from "../../static-helpers/pagingHelpers.js"; +import { getLongRunningPoller } from "../../static-helpers/pollingHelpers.js"; +import { expandUrlTemplate } from "../../static-helpers/urlTemplate.js"; +import { + ConfigurationGroupSchemasUpdateStateOptionalParams, + ConfigurationGroupSchemasListByPublisherOptionalParams, + ConfigurationGroupSchemasDeleteOptionalParams, + ConfigurationGroupSchemasUpdateOptionalParams, + ConfigurationGroupSchemasCreateOrUpdateOptionalParams, + ConfigurationGroupSchemasGetOptionalParams, +} from "./options.js"; +import { + StreamableMethod, + PathUncheckedResponse, + createRestError, + operationOptionsToRequestParameters, +} from "@azure-rest/core-client"; +import { PollerLike, OperationState } from "@azure/core-lro"; + +export function _updateStateSend( + context: Client, + resourceGroupName: string, + publisherName: string, + configurationGroupSchemaName: string, + parameters: ConfigurationGroupSchemaVersionUpdateState, + options: ConfigurationGroupSchemasUpdateStateOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/configurationGroupSchemas/{configurationGroupSchemaName}/updateState{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + publisherName: publisherName, + configurationGroupSchemaName: configurationGroupSchemaName, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context + .path(path) + .post({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + headers: { accept: "application/json", ...options.requestOptions?.headers }, + body: configurationGroupSchemaVersionUpdateStateSerializer(parameters), + }); +} + +export async function _updateStateDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["200", "202", "201"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return configurationGroupSchemaVersionUpdateStateDeserializer(result.body); +} + +/** Update configuration group schema state. */ +export function updateState( + context: Client, + resourceGroupName: string, + publisherName: string, + configurationGroupSchemaName: string, + parameters: ConfigurationGroupSchemaVersionUpdateState, + options: ConfigurationGroupSchemasUpdateStateOptionalParams = { requestOptions: {} }, +): PollerLike< + OperationState, + ConfigurationGroupSchemaVersionUpdateState +> { + return getLongRunningPoller(context, _updateStateDeserialize, ["200", "202", "201"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _updateStateSend( + context, + resourceGroupName, + publisherName, + configurationGroupSchemaName, + parameters, + options, + ), + resourceLocationConfig: "location", + }) as PollerLike< + OperationState, + ConfigurationGroupSchemaVersionUpdateState + >; +} + +export function _listByPublisherSend( + context: Client, + resourceGroupName: string, + publisherName: string, + options: ConfigurationGroupSchemasListByPublisherOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/configurationGroupSchemas{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + publisherName: publisherName, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context + .path(path) + .get({ + ...operationOptionsToRequestParameters(options), + headers: { accept: "application/json", ...options.requestOptions?.headers }, + }); +} + +export async function _listByPublisherDeserialize( + result: PathUncheckedResponse, +): Promise<_ConfigurationGroupSchemaListResult> { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return _configurationGroupSchemaListResultDeserializer(result.body); +} + +/** Gets information of the configuration group schemas under a publisher. */ +export function listByPublisher( + context: Client, + resourceGroupName: string, + publisherName: string, + options: ConfigurationGroupSchemasListByPublisherOptionalParams = { requestOptions: {} }, +): PagedAsyncIterableIterator { + return buildPagedAsyncIterator( + context, + () => _listByPublisherSend(context, resourceGroupName, publisherName, options), + _listByPublisherDeserialize, + ["200"], + { itemName: "value", nextLinkName: "nextLink" }, + ); +} + +export function _$deleteSend( + context: Client, + resourceGroupName: string, + publisherName: string, + configurationGroupSchemaName: string, + options: ConfigurationGroupSchemasDeleteOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/configurationGroupSchemas/{configurationGroupSchemaName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + publisherName: publisherName, + configurationGroupSchemaName: configurationGroupSchemaName, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).delete({ ...operationOptionsToRequestParameters(options) }); +} + +export async function _$deleteDeserialize(result: PathUncheckedResponse): Promise { + const expectedStatuses = ["202", "204", "200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return; +} + +/** Deletes a specified configuration group schema. */ +/** + * @fixme delete is a reserved word that cannot be used as an operation name. + * Please add @clientName("clientName") or @clientName("", "javascript") + * to the operation to override the generated name. + */ +export function $delete( + context: Client, + resourceGroupName: string, + publisherName: string, + configurationGroupSchemaName: string, + options: ConfigurationGroupSchemasDeleteOptionalParams = { requestOptions: {} }, +): PollerLike, void> { + return getLongRunningPoller(context, _$deleteDeserialize, ["202", "204", "200"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _$deleteSend( + context, + resourceGroupName, + publisherName, + configurationGroupSchemaName, + options, + ), + resourceLocationConfig: "location", + }) as PollerLike, void>; +} + +export function _updateSend( + context: Client, + resourceGroupName: string, + publisherName: string, + configurationGroupSchemaName: string, + parameters: TagsObject, + options: ConfigurationGroupSchemasUpdateOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/configurationGroupSchemas/{configurationGroupSchemaName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + publisherName: publisherName, + configurationGroupSchemaName: configurationGroupSchemaName, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context + .path(path) + .patch({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + headers: { accept: "application/json", ...options.requestOptions?.headers }, + body: tagsObjectSerializer(parameters), + }); +} + +export async function _updateDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return configurationGroupSchemaDeserializer(result.body); +} + +/** Updates a configuration group schema resource. */ +export async function update( + context: Client, + resourceGroupName: string, + publisherName: string, + configurationGroupSchemaName: string, + parameters: TagsObject, + options: ConfigurationGroupSchemasUpdateOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _updateSend( + context, + resourceGroupName, + publisherName, + configurationGroupSchemaName, + parameters, + options, + ); + return _updateDeserialize(result); +} + +export function _createOrUpdateSend( + context: Client, + resourceGroupName: string, + publisherName: string, + configurationGroupSchemaName: string, + parameters: ConfigurationGroupSchema, + options: ConfigurationGroupSchemasCreateOrUpdateOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/configurationGroupSchemas/{configurationGroupSchemaName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + publisherName: publisherName, + configurationGroupSchemaName: configurationGroupSchemaName, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context + .path(path) + .put({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + headers: { accept: "application/json", ...options.requestOptions?.headers }, + body: configurationGroupSchemaSerializer(parameters), + }); +} + +export async function _createOrUpdateDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["200", "201", "202"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return configurationGroupSchemaDeserializer(result.body); +} + +/** Creates or updates a configuration group schema. */ +export function createOrUpdate( + context: Client, + resourceGroupName: string, + publisherName: string, + configurationGroupSchemaName: string, + parameters: ConfigurationGroupSchema, + options: ConfigurationGroupSchemasCreateOrUpdateOptionalParams = { requestOptions: {} }, +): PollerLike, ConfigurationGroupSchema> { + return getLongRunningPoller(context, _createOrUpdateDeserialize, ["200", "201", "202"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _createOrUpdateSend( + context, + resourceGroupName, + publisherName, + configurationGroupSchemaName, + parameters, + options, + ), + resourceLocationConfig: "azure-async-operation", + }) as PollerLike, ConfigurationGroupSchema>; +} + +export function _getSend( + context: Client, + resourceGroupName: string, + publisherName: string, + configurationGroupSchemaName: string, + options: ConfigurationGroupSchemasGetOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/configurationGroupSchemas/{configurationGroupSchemaName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + publisherName: publisherName, + configurationGroupSchemaName: configurationGroupSchemaName, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context + .path(path) + .get({ + ...operationOptionsToRequestParameters(options), + headers: { accept: "application/json", ...options.requestOptions?.headers }, + }); +} + +export async function _getDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return configurationGroupSchemaDeserializer(result.body); +} + +/** Gets information about the specified configuration group schema. */ +export async function get( + context: Client, + resourceGroupName: string, + publisherName: string, + configurationGroupSchemaName: string, + options: ConfigurationGroupSchemasGetOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _getSend( + context, + resourceGroupName, + publisherName, + configurationGroupSchemaName, + options, + ); + return _getDeserialize(result); +} diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/configurationGroupSchemas/options.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/configurationGroupSchemas/options.ts new file mode 100644 index 0000000000..b4785ef571 --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/configurationGroupSchemas/options.ts @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { OperationOptions } from "@azure-rest/core-client"; + +/** Optional parameters. */ +export interface ConfigurationGroupSchemasUpdateStateOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface ConfigurationGroupSchemasListByPublisherOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface ConfigurationGroupSchemasDeleteOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface ConfigurationGroupSchemasUpdateOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface ConfigurationGroupSchemasCreateOrUpdateOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface ConfigurationGroupSchemasGetOptionalParams extends OperationOptions {} diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/configurationGroupValues/index.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/configurationGroupValues/index.ts new file mode 100644 index 0000000000..084abc0c33 --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/configurationGroupValues/index.ts @@ -0,0 +1,19 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +export { + listBySubscription, + listByResourceGroup, + $delete, + updateTags, + createOrUpdate, + get, +} from "./operations.js"; +export { + ConfigurationGroupValuesListBySubscriptionOptionalParams, + ConfigurationGroupValuesListByResourceGroupOptionalParams, + ConfigurationGroupValuesDeleteOptionalParams, + ConfigurationGroupValuesUpdateTagsOptionalParams, + ConfigurationGroupValuesCreateOrUpdateOptionalParams, + ConfigurationGroupValuesGetOptionalParams, +} from "./options.js"; diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/configurationGroupValues/operations.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/configurationGroupValues/operations.ts new file mode 100644 index 0000000000..2571157b10 --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/configurationGroupValues/operations.ts @@ -0,0 +1,364 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { HybridNetworkManagementContext as Client } from "../index.js"; +import { + errorResponseDeserializer, + TagsObject, + tagsObjectSerializer, + ConfigurationGroupValue, + configurationGroupValueSerializer, + configurationGroupValueDeserializer, + _ConfigurationGroupValueListResult, + _configurationGroupValueListResultDeserializer, +} from "../../models/models.js"; +import { + PagedAsyncIterableIterator, + buildPagedAsyncIterator, +} from "../../static-helpers/pagingHelpers.js"; +import { getLongRunningPoller } from "../../static-helpers/pollingHelpers.js"; +import { expandUrlTemplate } from "../../static-helpers/urlTemplate.js"; +import { + ConfigurationGroupValuesListBySubscriptionOptionalParams, + ConfigurationGroupValuesListByResourceGroupOptionalParams, + ConfigurationGroupValuesDeleteOptionalParams, + ConfigurationGroupValuesUpdateTagsOptionalParams, + ConfigurationGroupValuesCreateOrUpdateOptionalParams, + ConfigurationGroupValuesGetOptionalParams, +} from "./options.js"; +import { + StreamableMethod, + PathUncheckedResponse, + createRestError, + operationOptionsToRequestParameters, +} from "@azure-rest/core-client"; +import { PollerLike, OperationState } from "@azure/core-lro"; + +export function _listBySubscriptionSend( + context: Client, + options: ConfigurationGroupValuesListBySubscriptionOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/providers/Microsoft.HybridNetwork/configurationGroupValues{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context + .path(path) + .get({ + ...operationOptionsToRequestParameters(options), + headers: { accept: "application/json", ...options.requestOptions?.headers }, + }); +} + +export async function _listBySubscriptionDeserialize( + result: PathUncheckedResponse, +): Promise<_ConfigurationGroupValueListResult> { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return _configurationGroupValueListResultDeserializer(result.body); +} + +/** Lists all sites in the configuration group value in a subscription. */ +export function listBySubscription( + context: Client, + options: ConfigurationGroupValuesListBySubscriptionOptionalParams = { requestOptions: {} }, +): PagedAsyncIterableIterator { + return buildPagedAsyncIterator( + context, + () => _listBySubscriptionSend(context, options), + _listBySubscriptionDeserialize, + ["200"], + { itemName: "value", nextLinkName: "nextLink" }, + ); +} + +export function _listByResourceGroupSend( + context: Client, + resourceGroupName: string, + options: ConfigurationGroupValuesListByResourceGroupOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/configurationGroupValues{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context + .path(path) + .get({ + ...operationOptionsToRequestParameters(options), + headers: { accept: "application/json", ...options.requestOptions?.headers }, + }); +} + +export async function _listByResourceGroupDeserialize( + result: PathUncheckedResponse, +): Promise<_ConfigurationGroupValueListResult> { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return _configurationGroupValueListResultDeserializer(result.body); +} + +/** Lists all the hybrid network configurationGroupValues in a resource group. */ +export function listByResourceGroup( + context: Client, + resourceGroupName: string, + options: ConfigurationGroupValuesListByResourceGroupOptionalParams = { requestOptions: {} }, +): PagedAsyncIterableIterator { + return buildPagedAsyncIterator( + context, + () => _listByResourceGroupSend(context, resourceGroupName, options), + _listByResourceGroupDeserialize, + ["200"], + { itemName: "value", nextLinkName: "nextLink" }, + ); +} + +export function _$deleteSend( + context: Client, + resourceGroupName: string, + configurationGroupValueName: string, + options: ConfigurationGroupValuesDeleteOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/configurationGroupValues/{configurationGroupValueName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + configurationGroupValueName: configurationGroupValueName, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).delete({ ...operationOptionsToRequestParameters(options) }); +} + +export async function _$deleteDeserialize(result: PathUncheckedResponse): Promise { + const expectedStatuses = ["202", "204", "200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return; +} + +/** Deletes the specified hybrid configuration group value. */ +/** + * @fixme delete is a reserved word that cannot be used as an operation name. + * Please add @clientName("clientName") or @clientName("", "javascript") + * to the operation to override the generated name. + */ +export function $delete( + context: Client, + resourceGroupName: string, + configurationGroupValueName: string, + options: ConfigurationGroupValuesDeleteOptionalParams = { requestOptions: {} }, +): PollerLike, void> { + return getLongRunningPoller(context, _$deleteDeserialize, ["202", "204", "200"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _$deleteSend(context, resourceGroupName, configurationGroupValueName, options), + resourceLocationConfig: "location", + }) as PollerLike, void>; +} + +export function _updateTagsSend( + context: Client, + resourceGroupName: string, + configurationGroupValueName: string, + parameters: TagsObject, + options: ConfigurationGroupValuesUpdateTagsOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/configurationGroupValues/{configurationGroupValueName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + configurationGroupValueName: configurationGroupValueName, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context + .path(path) + .patch({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + headers: { accept: "application/json", ...options.requestOptions?.headers }, + body: tagsObjectSerializer(parameters), + }); +} + +export async function _updateTagsDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return configurationGroupValueDeserializer(result.body); +} + +/** Updates a hybrid configuration group tags. */ +export async function updateTags( + context: Client, + resourceGroupName: string, + configurationGroupValueName: string, + parameters: TagsObject, + options: ConfigurationGroupValuesUpdateTagsOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _updateTagsSend( + context, + resourceGroupName, + configurationGroupValueName, + parameters, + options, + ); + return _updateTagsDeserialize(result); +} + +export function _createOrUpdateSend( + context: Client, + resourceGroupName: string, + configurationGroupValueName: string, + parameters: ConfigurationGroupValue, + options: ConfigurationGroupValuesCreateOrUpdateOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/configurationGroupValues/{configurationGroupValueName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + configurationGroupValueName: configurationGroupValueName, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context + .path(path) + .put({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + headers: { accept: "application/json", ...options.requestOptions?.headers }, + body: configurationGroupValueSerializer(parameters), + }); +} + +export async function _createOrUpdateDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["200", "201", "202"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return configurationGroupValueDeserializer(result.body); +} + +/** Creates or updates a hybrid configuration group value. */ +export function createOrUpdate( + context: Client, + resourceGroupName: string, + configurationGroupValueName: string, + parameters: ConfigurationGroupValue, + options: ConfigurationGroupValuesCreateOrUpdateOptionalParams = { requestOptions: {} }, +): PollerLike, ConfigurationGroupValue> { + return getLongRunningPoller(context, _createOrUpdateDeserialize, ["200", "201", "202"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _createOrUpdateSend( + context, + resourceGroupName, + configurationGroupValueName, + parameters, + options, + ), + resourceLocationConfig: "azure-async-operation", + }) as PollerLike, ConfigurationGroupValue>; +} + +export function _getSend( + context: Client, + resourceGroupName: string, + configurationGroupValueName: string, + options: ConfigurationGroupValuesGetOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/configurationGroupValues/{configurationGroupValueName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + configurationGroupValueName: configurationGroupValueName, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context + .path(path) + .get({ + ...operationOptionsToRequestParameters(options), + headers: { accept: "application/json", ...options.requestOptions?.headers }, + }); +} + +export async function _getDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return configurationGroupValueDeserializer(result.body); +} + +/** Gets information about the specified hybrid configuration group values. */ +export async function get( + context: Client, + resourceGroupName: string, + configurationGroupValueName: string, + options: ConfigurationGroupValuesGetOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _getSend(context, resourceGroupName, configurationGroupValueName, options); + return _getDeserialize(result); +} diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/configurationGroupValues/options.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/configurationGroupValues/options.ts new file mode 100644 index 0000000000..1b75385fa7 --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/configurationGroupValues/options.ts @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { OperationOptions } from "@azure-rest/core-client"; + +/** Optional parameters. */ +export interface ConfigurationGroupValuesListBySubscriptionOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface ConfigurationGroupValuesListByResourceGroupOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface ConfigurationGroupValuesDeleteOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface ConfigurationGroupValuesUpdateTagsOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface ConfigurationGroupValuesCreateOrUpdateOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface ConfigurationGroupValuesGetOptionalParams extends OperationOptions {} diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/hybridNetworkManagementContext.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/hybridNetworkManagementContext.ts new file mode 100644 index 0000000000..9d26e4a302 --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/hybridNetworkManagementContext.ts @@ -0,0 +1,64 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { logger } from "../logger.js"; +import { KnownVersions } from "../models/models.js"; +import { AzureSupportedClouds, getArmEndpoint } from "../static-helpers/cloudSettingHelpers.js"; +import { Client, ClientOptions, getClient } from "@azure-rest/core-client"; +import { TokenCredential } from "@azure/core-auth"; + +export interface HybridNetworkManagementContext extends Client { + /** The API version to use for this operation. */ + /** Known values of {@link KnownVersions} that the service accepts. */ + apiVersion: string; + /** The ID of the target subscription. The value must be an UUID. */ + subscriptionId: string; +} + +/** Optional parameters for the client. */ +export interface HybridNetworkManagementClientOptionalParams extends ClientOptions { + /** The API version to use for this operation. */ + /** Known values of {@link KnownVersions} that the service accepts. */ + apiVersion?: string; + /** Specifies the Azure cloud environment for the client. */ + cloudSetting?: AzureSupportedClouds; +} + +export function createHybridNetworkManagement( + credential: TokenCredential, + subscriptionId: string, + options: HybridNetworkManagementClientOptionalParams = {}, +): HybridNetworkManagementContext { + const endpointUrl = + options.endpoint ?? getArmEndpoint(options.cloudSetting) ?? "https://management.azure.com"; + const prefixFromOptions = options?.userAgentOptions?.userAgentPrefix; + const userAgentInfo = `azsdk-js-arm-hybridnetwork/1.0.0-beta.1`; + const userAgentPrefix = prefixFromOptions + ? `${prefixFromOptions} azsdk-js-api ${userAgentInfo}` + : `azsdk-js-api ${userAgentInfo}`; + const { apiVersion: _, ...updatedOptions } = { + ...options, + userAgentOptions: { userAgentPrefix }, + loggingOptions: { logger: options.loggingOptions?.logger ?? logger.info }, + credentials: { scopes: options.credentials?.scopes ?? [`${endpointUrl}/.default`] }, + }; + const clientContext = getClient(endpointUrl, credential, updatedOptions); + clientContext.pipeline.removePolicy({ name: "ApiVersionPolicy" }); + const apiVersion = options.apiVersion ?? "2025-03-30"; + clientContext.pipeline.addPolicy({ + name: "ClientApiVersionPolicy", + sendRequest: (req, next) => { + // Use the apiVersion defined in request url directly + // Append one if there is no apiVersion and we have one at client options + const url = new URL(req.url); + if (!url.searchParams.get("api-version")) { + req.url = `${req.url}${ + Array.from(url.searchParams.keys()).length > 0 ? "&" : "?" + }api-version=${apiVersion}`; + } + + return next(req); + }, + }); + return { ...clientContext, apiVersion, subscriptionId } as HybridNetworkManagementContext; +} diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/index.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/index.ts new file mode 100644 index 0000000000..71d00a6471 --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/index.ts @@ -0,0 +1,8 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +export { + createHybridNetworkManagement, + HybridNetworkManagementContext, + HybridNetworkManagementClientOptionalParams, +} from "./hybridNetworkManagementContext.js"; diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/networkFunctionDefinitionGroups/index.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/networkFunctionDefinitionGroups/index.ts new file mode 100644 index 0000000000..8f867818d3 --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/networkFunctionDefinitionGroups/index.ts @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +export { listByPublisher, $delete, update, createOrUpdate, get } from "./operations.js"; +export { + NetworkFunctionDefinitionGroupsListByPublisherOptionalParams, + NetworkFunctionDefinitionGroupsDeleteOptionalParams, + NetworkFunctionDefinitionGroupsUpdateOptionalParams, + NetworkFunctionDefinitionGroupsCreateOrUpdateOptionalParams, + NetworkFunctionDefinitionGroupsGetOptionalParams, +} from "./options.js"; diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/networkFunctionDefinitionGroups/operations.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/networkFunctionDefinitionGroups/operations.ts new file mode 100644 index 0000000000..e2e782d1d9 --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/networkFunctionDefinitionGroups/operations.ts @@ -0,0 +1,343 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { HybridNetworkManagementContext as Client } from "../index.js"; +import { + errorResponseDeserializer, + TagsObject, + tagsObjectSerializer, + NetworkFunctionDefinitionGroup, + networkFunctionDefinitionGroupSerializer, + networkFunctionDefinitionGroupDeserializer, + _NetworkFunctionDefinitionGroupListResult, + _networkFunctionDefinitionGroupListResultDeserializer, +} from "../../models/models.js"; +import { + PagedAsyncIterableIterator, + buildPagedAsyncIterator, +} from "../../static-helpers/pagingHelpers.js"; +import { getLongRunningPoller } from "../../static-helpers/pollingHelpers.js"; +import { expandUrlTemplate } from "../../static-helpers/urlTemplate.js"; +import { + NetworkFunctionDefinitionGroupsListByPublisherOptionalParams, + NetworkFunctionDefinitionGroupsDeleteOptionalParams, + NetworkFunctionDefinitionGroupsUpdateOptionalParams, + NetworkFunctionDefinitionGroupsCreateOrUpdateOptionalParams, + NetworkFunctionDefinitionGroupsGetOptionalParams, +} from "./options.js"; +import { + StreamableMethod, + PathUncheckedResponse, + createRestError, + operationOptionsToRequestParameters, +} from "@azure-rest/core-client"; +import { PollerLike, OperationState } from "@azure/core-lro"; + +export function _listByPublisherSend( + context: Client, + resourceGroupName: string, + publisherName: string, + options: NetworkFunctionDefinitionGroupsListByPublisherOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkFunctionDefinitionGroups{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + publisherName: publisherName, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context + .path(path) + .get({ + ...operationOptionsToRequestParameters(options), + headers: { accept: "application/json", ...options.requestOptions?.headers }, + }); +} + +export async function _listByPublisherDeserialize( + result: PathUncheckedResponse, +): Promise<_NetworkFunctionDefinitionGroupListResult> { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return _networkFunctionDefinitionGroupListResultDeserializer(result.body); +} + +/** Gets information of the network function definition groups under a publisher. */ +export function listByPublisher( + context: Client, + resourceGroupName: string, + publisherName: string, + options: NetworkFunctionDefinitionGroupsListByPublisherOptionalParams = { requestOptions: {} }, +): PagedAsyncIterableIterator { + return buildPagedAsyncIterator( + context, + () => _listByPublisherSend(context, resourceGroupName, publisherName, options), + _listByPublisherDeserialize, + ["200"], + { itemName: "value", nextLinkName: "nextLink" }, + ); +} + +export function _$deleteSend( + context: Client, + resourceGroupName: string, + publisherName: string, + networkFunctionDefinitionGroupName: string, + options: NetworkFunctionDefinitionGroupsDeleteOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkFunctionDefinitionGroups/{networkFunctionDefinitionGroupName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + publisherName: publisherName, + networkFunctionDefinitionGroupName: networkFunctionDefinitionGroupName, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).delete({ ...operationOptionsToRequestParameters(options) }); +} + +export async function _$deleteDeserialize(result: PathUncheckedResponse): Promise { + const expectedStatuses = ["202", "204", "200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return; +} + +/** Deletes a specified network function definition group. */ +/** + * @fixme delete is a reserved word that cannot be used as an operation name. + * Please add @clientName("clientName") or @clientName("", "javascript") + * to the operation to override the generated name. + */ +export function $delete( + context: Client, + resourceGroupName: string, + publisherName: string, + networkFunctionDefinitionGroupName: string, + options: NetworkFunctionDefinitionGroupsDeleteOptionalParams = { requestOptions: {} }, +): PollerLike, void> { + return getLongRunningPoller(context, _$deleteDeserialize, ["202", "204", "200"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _$deleteSend( + context, + resourceGroupName, + publisherName, + networkFunctionDefinitionGroupName, + options, + ), + resourceLocationConfig: "location", + }) as PollerLike, void>; +} + +export function _updateSend( + context: Client, + resourceGroupName: string, + publisherName: string, + networkFunctionDefinitionGroupName: string, + parameters: TagsObject, + options: NetworkFunctionDefinitionGroupsUpdateOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkFunctionDefinitionGroups/{networkFunctionDefinitionGroupName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + publisherName: publisherName, + networkFunctionDefinitionGroupName: networkFunctionDefinitionGroupName, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context + .path(path) + .patch({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + headers: { accept: "application/json", ...options.requestOptions?.headers }, + body: tagsObjectSerializer(parameters), + }); +} + +export async function _updateDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return networkFunctionDefinitionGroupDeserializer(result.body); +} + +/** Updates a network function definition group resource. */ +export async function update( + context: Client, + resourceGroupName: string, + publisherName: string, + networkFunctionDefinitionGroupName: string, + parameters: TagsObject, + options: NetworkFunctionDefinitionGroupsUpdateOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _updateSend( + context, + resourceGroupName, + publisherName, + networkFunctionDefinitionGroupName, + parameters, + options, + ); + return _updateDeserialize(result); +} + +export function _createOrUpdateSend( + context: Client, + resourceGroupName: string, + publisherName: string, + networkFunctionDefinitionGroupName: string, + parameters: NetworkFunctionDefinitionGroup, + options: NetworkFunctionDefinitionGroupsCreateOrUpdateOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkFunctionDefinitionGroups/{networkFunctionDefinitionGroupName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + publisherName: publisherName, + networkFunctionDefinitionGroupName: networkFunctionDefinitionGroupName, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context + .path(path) + .put({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + headers: { accept: "application/json", ...options.requestOptions?.headers }, + body: networkFunctionDefinitionGroupSerializer(parameters), + }); +} + +export async function _createOrUpdateDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["200", "201", "202"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return networkFunctionDefinitionGroupDeserializer(result.body); +} + +/** Creates or updates a network function definition group. */ +export function createOrUpdate( + context: Client, + resourceGroupName: string, + publisherName: string, + networkFunctionDefinitionGroupName: string, + parameters: NetworkFunctionDefinitionGroup, + options: NetworkFunctionDefinitionGroupsCreateOrUpdateOptionalParams = { requestOptions: {} }, +): PollerLike, NetworkFunctionDefinitionGroup> { + return getLongRunningPoller(context, _createOrUpdateDeserialize, ["200", "201", "202"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _createOrUpdateSend( + context, + resourceGroupName, + publisherName, + networkFunctionDefinitionGroupName, + parameters, + options, + ), + resourceLocationConfig: "azure-async-operation", + }) as PollerLike, NetworkFunctionDefinitionGroup>; +} + +export function _getSend( + context: Client, + resourceGroupName: string, + publisherName: string, + networkFunctionDefinitionGroupName: string, + options: NetworkFunctionDefinitionGroupsGetOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkFunctionDefinitionGroups/{networkFunctionDefinitionGroupName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + publisherName: publisherName, + networkFunctionDefinitionGroupName: networkFunctionDefinitionGroupName, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context + .path(path) + .get({ + ...operationOptionsToRequestParameters(options), + headers: { accept: "application/json", ...options.requestOptions?.headers }, + }); +} + +export async function _getDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return networkFunctionDefinitionGroupDeserializer(result.body); +} + +/** Gets information about the specified networkFunctionDefinition group. */ +export async function get( + context: Client, + resourceGroupName: string, + publisherName: string, + networkFunctionDefinitionGroupName: string, + options: NetworkFunctionDefinitionGroupsGetOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _getSend( + context, + resourceGroupName, + publisherName, + networkFunctionDefinitionGroupName, + options, + ); + return _getDeserialize(result); +} diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/networkFunctionDefinitionGroups/options.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/networkFunctionDefinitionGroups/options.ts new file mode 100644 index 0000000000..e292047485 --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/networkFunctionDefinitionGroups/options.ts @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { OperationOptions } from "@azure-rest/core-client"; + +/** Optional parameters. */ +export interface NetworkFunctionDefinitionGroupsListByPublisherOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface NetworkFunctionDefinitionGroupsDeleteOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface NetworkFunctionDefinitionGroupsUpdateOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface NetworkFunctionDefinitionGroupsCreateOrUpdateOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface NetworkFunctionDefinitionGroupsGetOptionalParams extends OperationOptions {} diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/networkFunctionDefinitionVersions/index.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/networkFunctionDefinitionVersions/index.ts new file mode 100644 index 0000000000..090fb7b660 --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/networkFunctionDefinitionVersions/index.ts @@ -0,0 +1,19 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +export { + updateState, + listByNetworkFunctionDefinitionGroup, + $delete, + update, + createOrUpdate, + get, +} from "./operations.js"; +export { + NetworkFunctionDefinitionVersionsUpdateStateOptionalParams, + NetworkFunctionDefinitionVersionsListByNetworkFunctionDefinitionGroupOptionalParams, + NetworkFunctionDefinitionVersionsDeleteOptionalParams, + NetworkFunctionDefinitionVersionsUpdateOptionalParams, + NetworkFunctionDefinitionVersionsCreateOrUpdateOptionalParams, + NetworkFunctionDefinitionVersionsGetOptionalParams, +} from "./options.js"; diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/networkFunctionDefinitionVersions/operations.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/networkFunctionDefinitionVersions/operations.ts new file mode 100644 index 0000000000..76ff361693 --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/networkFunctionDefinitionVersions/operations.ts @@ -0,0 +1,459 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { HybridNetworkManagementContext as Client } from "../index.js"; +import { + errorResponseDeserializer, + TagsObject, + tagsObjectSerializer, + NetworkFunctionDefinitionVersion, + networkFunctionDefinitionVersionSerializer, + networkFunctionDefinitionVersionDeserializer, + _NetworkFunctionDefinitionVersionListResult, + _networkFunctionDefinitionVersionListResultDeserializer, + NetworkFunctionDefinitionVersionUpdateState, + networkFunctionDefinitionVersionUpdateStateSerializer, + networkFunctionDefinitionVersionUpdateStateDeserializer, +} from "../../models/models.js"; +import { + PagedAsyncIterableIterator, + buildPagedAsyncIterator, +} from "../../static-helpers/pagingHelpers.js"; +import { getLongRunningPoller } from "../../static-helpers/pollingHelpers.js"; +import { expandUrlTemplate } from "../../static-helpers/urlTemplate.js"; +import { + NetworkFunctionDefinitionVersionsUpdateStateOptionalParams, + NetworkFunctionDefinitionVersionsListByNetworkFunctionDefinitionGroupOptionalParams, + NetworkFunctionDefinitionVersionsDeleteOptionalParams, + NetworkFunctionDefinitionVersionsUpdateOptionalParams, + NetworkFunctionDefinitionVersionsCreateOrUpdateOptionalParams, + NetworkFunctionDefinitionVersionsGetOptionalParams, +} from "./options.js"; +import { + StreamableMethod, + PathUncheckedResponse, + createRestError, + operationOptionsToRequestParameters, +} from "@azure-rest/core-client"; +import { PollerLike, OperationState } from "@azure/core-lro"; + +export function _updateStateSend( + context: Client, + resourceGroupName: string, + publisherName: string, + networkFunctionDefinitionGroupName: string, + networkFunctionDefinitionVersionName: string, + parameters: NetworkFunctionDefinitionVersionUpdateState, + options: NetworkFunctionDefinitionVersionsUpdateStateOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkFunctionDefinitionGroups/{networkFunctionDefinitionGroupName}/networkFunctionDefinitionVersions/{networkFunctionDefinitionVersionName}/updateState{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + publisherName: publisherName, + networkFunctionDefinitionGroupName: networkFunctionDefinitionGroupName, + networkFunctionDefinitionVersionName: networkFunctionDefinitionVersionName, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context + .path(path) + .post({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + headers: { accept: "application/json", ...options.requestOptions?.headers }, + body: networkFunctionDefinitionVersionUpdateStateSerializer(parameters), + }); +} + +export async function _updateStateDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["200", "202", "201"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return networkFunctionDefinitionVersionUpdateStateDeserializer(result.body); +} + +/** Update network function definition version state. */ +export function updateState( + context: Client, + resourceGroupName: string, + publisherName: string, + networkFunctionDefinitionGroupName: string, + networkFunctionDefinitionVersionName: string, + parameters: NetworkFunctionDefinitionVersionUpdateState, + options: NetworkFunctionDefinitionVersionsUpdateStateOptionalParams = { requestOptions: {} }, +): PollerLike< + OperationState, + NetworkFunctionDefinitionVersionUpdateState +> { + return getLongRunningPoller(context, _updateStateDeserialize, ["200", "202", "201"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _updateStateSend( + context, + resourceGroupName, + publisherName, + networkFunctionDefinitionGroupName, + networkFunctionDefinitionVersionName, + parameters, + options, + ), + resourceLocationConfig: "location", + }) as PollerLike< + OperationState, + NetworkFunctionDefinitionVersionUpdateState + >; +} + +export function _listByNetworkFunctionDefinitionGroupSend( + context: Client, + resourceGroupName: string, + publisherName: string, + networkFunctionDefinitionGroupName: string, + options: NetworkFunctionDefinitionVersionsListByNetworkFunctionDefinitionGroupOptionalParams = { + requestOptions: {}, + }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkFunctionDefinitionGroups/{networkFunctionDefinitionGroupName}/networkFunctionDefinitionVersions{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + publisherName: publisherName, + networkFunctionDefinitionGroupName: networkFunctionDefinitionGroupName, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context + .path(path) + .get({ + ...operationOptionsToRequestParameters(options), + headers: { accept: "application/json", ...options.requestOptions?.headers }, + }); +} + +export async function _listByNetworkFunctionDefinitionGroupDeserialize( + result: PathUncheckedResponse, +): Promise<_NetworkFunctionDefinitionVersionListResult> { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return _networkFunctionDefinitionVersionListResultDeserializer(result.body); +} + +/** Gets information about a list of network function definition versions under a network function definition group. */ +export function listByNetworkFunctionDefinitionGroup( + context: Client, + resourceGroupName: string, + publisherName: string, + networkFunctionDefinitionGroupName: string, + options: NetworkFunctionDefinitionVersionsListByNetworkFunctionDefinitionGroupOptionalParams = { + requestOptions: {}, + }, +): PagedAsyncIterableIterator { + return buildPagedAsyncIterator( + context, + () => + _listByNetworkFunctionDefinitionGroupSend( + context, + resourceGroupName, + publisherName, + networkFunctionDefinitionGroupName, + options, + ), + _listByNetworkFunctionDefinitionGroupDeserialize, + ["200"], + { itemName: "value", nextLinkName: "nextLink" }, + ); +} + +export function _$deleteSend( + context: Client, + resourceGroupName: string, + publisherName: string, + networkFunctionDefinitionGroupName: string, + networkFunctionDefinitionVersionName: string, + options: NetworkFunctionDefinitionVersionsDeleteOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkFunctionDefinitionGroups/{networkFunctionDefinitionGroupName}/networkFunctionDefinitionVersions/{networkFunctionDefinitionVersionName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + publisherName: publisherName, + networkFunctionDefinitionGroupName: networkFunctionDefinitionGroupName, + networkFunctionDefinitionVersionName: networkFunctionDefinitionVersionName, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).delete({ ...operationOptionsToRequestParameters(options) }); +} + +export async function _$deleteDeserialize(result: PathUncheckedResponse): Promise { + const expectedStatuses = ["202", "204", "200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return; +} + +/** Deletes the specified network function definition version. */ +/** + * @fixme delete is a reserved word that cannot be used as an operation name. + * Please add @clientName("clientName") or @clientName("", "javascript") + * to the operation to override the generated name. + */ +export function $delete( + context: Client, + resourceGroupName: string, + publisherName: string, + networkFunctionDefinitionGroupName: string, + networkFunctionDefinitionVersionName: string, + options: NetworkFunctionDefinitionVersionsDeleteOptionalParams = { requestOptions: {} }, +): PollerLike, void> { + return getLongRunningPoller(context, _$deleteDeserialize, ["202", "204", "200"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _$deleteSend( + context, + resourceGroupName, + publisherName, + networkFunctionDefinitionGroupName, + networkFunctionDefinitionVersionName, + options, + ), + resourceLocationConfig: "location", + }) as PollerLike, void>; +} + +export function _updateSend( + context: Client, + resourceGroupName: string, + publisherName: string, + networkFunctionDefinitionGroupName: string, + networkFunctionDefinitionVersionName: string, + parameters: TagsObject, + options: NetworkFunctionDefinitionVersionsUpdateOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkFunctionDefinitionGroups/{networkFunctionDefinitionGroupName}/networkFunctionDefinitionVersions/{networkFunctionDefinitionVersionName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + publisherName: publisherName, + networkFunctionDefinitionGroupName: networkFunctionDefinitionGroupName, + networkFunctionDefinitionVersionName: networkFunctionDefinitionVersionName, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context + .path(path) + .patch({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + headers: { accept: "application/json", ...options.requestOptions?.headers }, + body: tagsObjectSerializer(parameters), + }); +} + +export async function _updateDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return networkFunctionDefinitionVersionDeserializer(result.body); +} + +/** Updates a network function definition version resource. */ +export async function update( + context: Client, + resourceGroupName: string, + publisherName: string, + networkFunctionDefinitionGroupName: string, + networkFunctionDefinitionVersionName: string, + parameters: TagsObject, + options: NetworkFunctionDefinitionVersionsUpdateOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _updateSend( + context, + resourceGroupName, + publisherName, + networkFunctionDefinitionGroupName, + networkFunctionDefinitionVersionName, + parameters, + options, + ); + return _updateDeserialize(result); +} + +export function _createOrUpdateSend( + context: Client, + resourceGroupName: string, + publisherName: string, + networkFunctionDefinitionGroupName: string, + networkFunctionDefinitionVersionName: string, + parameters: NetworkFunctionDefinitionVersion, + options: NetworkFunctionDefinitionVersionsCreateOrUpdateOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkFunctionDefinitionGroups/{networkFunctionDefinitionGroupName}/networkFunctionDefinitionVersions/{networkFunctionDefinitionVersionName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + publisherName: publisherName, + networkFunctionDefinitionGroupName: networkFunctionDefinitionGroupName, + networkFunctionDefinitionVersionName: networkFunctionDefinitionVersionName, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context + .path(path) + .put({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + headers: { accept: "application/json", ...options.requestOptions?.headers }, + body: networkFunctionDefinitionVersionSerializer(parameters), + }); +} + +export async function _createOrUpdateDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["200", "201", "202"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return networkFunctionDefinitionVersionDeserializer(result.body); +} + +/** Creates or updates a network function definition version. */ +export function createOrUpdate( + context: Client, + resourceGroupName: string, + publisherName: string, + networkFunctionDefinitionGroupName: string, + networkFunctionDefinitionVersionName: string, + parameters: NetworkFunctionDefinitionVersion, + options: NetworkFunctionDefinitionVersionsCreateOrUpdateOptionalParams = { requestOptions: {} }, +): PollerLike, NetworkFunctionDefinitionVersion> { + return getLongRunningPoller(context, _createOrUpdateDeserialize, ["200", "201", "202"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _createOrUpdateSend( + context, + resourceGroupName, + publisherName, + networkFunctionDefinitionGroupName, + networkFunctionDefinitionVersionName, + parameters, + options, + ), + resourceLocationConfig: "azure-async-operation", + }) as PollerLike< + OperationState, + NetworkFunctionDefinitionVersion + >; +} + +export function _getSend( + context: Client, + resourceGroupName: string, + publisherName: string, + networkFunctionDefinitionGroupName: string, + networkFunctionDefinitionVersionName: string, + options: NetworkFunctionDefinitionVersionsGetOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkFunctionDefinitionGroups/{networkFunctionDefinitionGroupName}/networkFunctionDefinitionVersions/{networkFunctionDefinitionVersionName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + publisherName: publisherName, + networkFunctionDefinitionGroupName: networkFunctionDefinitionGroupName, + networkFunctionDefinitionVersionName: networkFunctionDefinitionVersionName, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context + .path(path) + .get({ + ...operationOptionsToRequestParameters(options), + headers: { accept: "application/json", ...options.requestOptions?.headers }, + }); +} + +export async function _getDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return networkFunctionDefinitionVersionDeserializer(result.body); +} + +/** Gets information about a network function definition version. */ +export async function get( + context: Client, + resourceGroupName: string, + publisherName: string, + networkFunctionDefinitionGroupName: string, + networkFunctionDefinitionVersionName: string, + options: NetworkFunctionDefinitionVersionsGetOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _getSend( + context, + resourceGroupName, + publisherName, + networkFunctionDefinitionGroupName, + networkFunctionDefinitionVersionName, + options, + ); + return _getDeserialize(result); +} diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/networkFunctionDefinitionVersions/options.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/networkFunctionDefinitionVersions/options.ts new file mode 100644 index 0000000000..7983674a1b --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/networkFunctionDefinitionVersions/options.ts @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { OperationOptions } from "@azure-rest/core-client"; + +/** Optional parameters. */ +export interface NetworkFunctionDefinitionVersionsUpdateStateOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface NetworkFunctionDefinitionVersionsListByNetworkFunctionDefinitionGroupOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface NetworkFunctionDefinitionVersionsDeleteOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface NetworkFunctionDefinitionVersionsUpdateOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface NetworkFunctionDefinitionVersionsCreateOrUpdateOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface NetworkFunctionDefinitionVersionsGetOptionalParams extends OperationOptions {} diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/networkFunctions/index.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/networkFunctions/index.ts new file mode 100644 index 0000000000..3f40c8862b --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/networkFunctions/index.ts @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +export { + executeRequest, + listBySubscription, + listByResourceGroup, + $delete, + updateTags, + createOrUpdate, + get, +} from "./operations.js"; +export { + NetworkFunctionsExecuteRequestOptionalParams, + NetworkFunctionsListBySubscriptionOptionalParams, + NetworkFunctionsListByResourceGroupOptionalParams, + NetworkFunctionsDeleteOptionalParams, + NetworkFunctionsUpdateTagsOptionalParams, + NetworkFunctionsCreateOrUpdateOptionalParams, + NetworkFunctionsGetOptionalParams, +} from "./options.js"; diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/networkFunctions/operations.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/networkFunctions/operations.ts new file mode 100644 index 0000000000..d88f7a56c9 --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/networkFunctions/operations.ts @@ -0,0 +1,415 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { HybridNetworkManagementContext as Client } from "../index.js"; +import { + errorResponseDeserializer, + TagsObject, + tagsObjectSerializer, + NetworkFunction, + networkFunctionSerializer, + networkFunctionDeserializer, + _NetworkFunctionListResult, + _networkFunctionListResultDeserializer, + ExecuteRequestParameters, + executeRequestParametersSerializer, +} from "../../models/models.js"; +import { + PagedAsyncIterableIterator, + buildPagedAsyncIterator, +} from "../../static-helpers/pagingHelpers.js"; +import { getLongRunningPoller } from "../../static-helpers/pollingHelpers.js"; +import { expandUrlTemplate } from "../../static-helpers/urlTemplate.js"; +import { + NetworkFunctionsExecuteRequestOptionalParams, + NetworkFunctionsListBySubscriptionOptionalParams, + NetworkFunctionsListByResourceGroupOptionalParams, + NetworkFunctionsDeleteOptionalParams, + NetworkFunctionsUpdateTagsOptionalParams, + NetworkFunctionsCreateOrUpdateOptionalParams, + NetworkFunctionsGetOptionalParams, +} from "./options.js"; +import { + StreamableMethod, + PathUncheckedResponse, + createRestError, + operationOptionsToRequestParameters, +} from "@azure-rest/core-client"; +import { PollerLike, OperationState } from "@azure/core-lro"; + +export function _executeRequestSend( + context: Client, + resourceGroupName: string, + networkFunctionName: string, + parameters: ExecuteRequestParameters, + options: NetworkFunctionsExecuteRequestOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/networkFunctions/{networkFunctionName}/executeRequest{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + networkFunctionName: networkFunctionName, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context + .path(path) + .post({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + body: executeRequestParametersSerializer(parameters), + }); +} + +export async function _executeRequestDeserialize(result: PathUncheckedResponse): Promise { + const expectedStatuses = ["200", "202", "201"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return; +} + +/** Execute a request to services on a containerized network function. */ +export function executeRequest( + context: Client, + resourceGroupName: string, + networkFunctionName: string, + parameters: ExecuteRequestParameters, + options: NetworkFunctionsExecuteRequestOptionalParams = { requestOptions: {} }, +): PollerLike, void> { + return getLongRunningPoller(context, _executeRequestDeserialize, ["200", "202", "201"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _executeRequestSend(context, resourceGroupName, networkFunctionName, parameters, options), + resourceLocationConfig: "location", + }) as PollerLike, void>; +} + +export function _listBySubscriptionSend( + context: Client, + options: NetworkFunctionsListBySubscriptionOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/providers/Microsoft.HybridNetwork/networkFunctions{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context + .path(path) + .get({ + ...operationOptionsToRequestParameters(options), + headers: { accept: "application/json", ...options.requestOptions?.headers }, + }); +} + +export async function _listBySubscriptionDeserialize( + result: PathUncheckedResponse, +): Promise<_NetworkFunctionListResult> { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return _networkFunctionListResultDeserializer(result.body); +} + +/** Lists all the network functions in a subscription. */ +export function listBySubscription( + context: Client, + options: NetworkFunctionsListBySubscriptionOptionalParams = { requestOptions: {} }, +): PagedAsyncIterableIterator { + return buildPagedAsyncIterator( + context, + () => _listBySubscriptionSend(context, options), + _listBySubscriptionDeserialize, + ["200"], + { itemName: "value", nextLinkName: "nextLink" }, + ); +} + +export function _listByResourceGroupSend( + context: Client, + resourceGroupName: string, + options: NetworkFunctionsListByResourceGroupOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/networkFunctions{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context + .path(path) + .get({ + ...operationOptionsToRequestParameters(options), + headers: { accept: "application/json", ...options.requestOptions?.headers }, + }); +} + +export async function _listByResourceGroupDeserialize( + result: PathUncheckedResponse, +): Promise<_NetworkFunctionListResult> { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return _networkFunctionListResultDeserializer(result.body); +} + +/** Lists all the network function resources in a resource group. */ +export function listByResourceGroup( + context: Client, + resourceGroupName: string, + options: NetworkFunctionsListByResourceGroupOptionalParams = { requestOptions: {} }, +): PagedAsyncIterableIterator { + return buildPagedAsyncIterator( + context, + () => _listByResourceGroupSend(context, resourceGroupName, options), + _listByResourceGroupDeserialize, + ["200"], + { itemName: "value", nextLinkName: "nextLink" }, + ); +} + +export function _$deleteSend( + context: Client, + resourceGroupName: string, + networkFunctionName: string, + options: NetworkFunctionsDeleteOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/networkFunctions/{networkFunctionName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + networkFunctionName: networkFunctionName, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).delete({ ...operationOptionsToRequestParameters(options) }); +} + +export async function _$deleteDeserialize(result: PathUncheckedResponse): Promise { + const expectedStatuses = ["200", "202", "204"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return; +} + +/** Deletes the specified network function resource. */ +/** + * @fixme delete is a reserved word that cannot be used as an operation name. + * Please add @clientName("clientName") or @clientName("", "javascript") + * to the operation to override the generated name. + */ +export function $delete( + context: Client, + resourceGroupName: string, + networkFunctionName: string, + options: NetworkFunctionsDeleteOptionalParams = { requestOptions: {} }, +): PollerLike, void> { + return getLongRunningPoller(context, _$deleteDeserialize, ["200", "202", "204"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _$deleteSend(context, resourceGroupName, networkFunctionName, options), + resourceLocationConfig: "location", + }) as PollerLike, void>; +} + +export function _updateTagsSend( + context: Client, + resourceGroupName: string, + networkFunctionName: string, + parameters: TagsObject, + options: NetworkFunctionsUpdateTagsOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/networkFunctions/{networkFunctionName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + networkFunctionName: networkFunctionName, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context + .path(path) + .patch({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + headers: { accept: "application/json", ...options.requestOptions?.headers }, + body: tagsObjectSerializer(parameters), + }); +} + +export async function _updateTagsDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return networkFunctionDeserializer(result.body); +} + +/** Updates the tags for the network function resource. */ +export async function updateTags( + context: Client, + resourceGroupName: string, + networkFunctionName: string, + parameters: TagsObject, + options: NetworkFunctionsUpdateTagsOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _updateTagsSend( + context, + resourceGroupName, + networkFunctionName, + parameters, + options, + ); + return _updateTagsDeserialize(result); +} + +export function _createOrUpdateSend( + context: Client, + resourceGroupName: string, + networkFunctionName: string, + parameters: NetworkFunction, + options: NetworkFunctionsCreateOrUpdateOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/networkFunctions/{networkFunctionName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + networkFunctionName: networkFunctionName, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context + .path(path) + .put({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + headers: { accept: "application/json", ...options.requestOptions?.headers }, + body: networkFunctionSerializer(parameters), + }); +} + +export async function _createOrUpdateDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["200", "201", "202"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return networkFunctionDeserializer(result.body); +} + +/** Creates or updates a network function resource. */ +export function createOrUpdate( + context: Client, + resourceGroupName: string, + networkFunctionName: string, + parameters: NetworkFunction, + options: NetworkFunctionsCreateOrUpdateOptionalParams = { requestOptions: {} }, +): PollerLike, NetworkFunction> { + return getLongRunningPoller(context, _createOrUpdateDeserialize, ["200", "201", "202"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _createOrUpdateSend(context, resourceGroupName, networkFunctionName, parameters, options), + resourceLocationConfig: "azure-async-operation", + }) as PollerLike, NetworkFunction>; +} + +export function _getSend( + context: Client, + resourceGroupName: string, + networkFunctionName: string, + options: NetworkFunctionsGetOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/networkFunctions/{networkFunctionName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + networkFunctionName: networkFunctionName, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context + .path(path) + .get({ + ...operationOptionsToRequestParameters(options), + headers: { accept: "application/json", ...options.requestOptions?.headers }, + }); +} + +export async function _getDeserialize(result: PathUncheckedResponse): Promise { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return networkFunctionDeserializer(result.body); +} + +/** Gets information about the specified network function resource. */ +export async function get( + context: Client, + resourceGroupName: string, + networkFunctionName: string, + options: NetworkFunctionsGetOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _getSend(context, resourceGroupName, networkFunctionName, options); + return _getDeserialize(result); +} diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/networkFunctions/options.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/networkFunctions/options.ts new file mode 100644 index 0000000000..f415604af2 --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/networkFunctions/options.ts @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { OperationOptions } from "@azure-rest/core-client"; + +/** Optional parameters. */ +export interface NetworkFunctionsExecuteRequestOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface NetworkFunctionsListBySubscriptionOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface NetworkFunctionsListByResourceGroupOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface NetworkFunctionsDeleteOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface NetworkFunctionsUpdateTagsOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface NetworkFunctionsCreateOrUpdateOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface NetworkFunctionsGetOptionalParams extends OperationOptions {} diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/networkServiceDesignGroups/index.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/networkServiceDesignGroups/index.ts new file mode 100644 index 0000000000..3d030af83b --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/networkServiceDesignGroups/index.ts @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +export { listByPublisher, $delete, update, createOrUpdate, get } from "./operations.js"; +export { + NetworkServiceDesignGroupsListByPublisherOptionalParams, + NetworkServiceDesignGroupsDeleteOptionalParams, + NetworkServiceDesignGroupsUpdateOptionalParams, + NetworkServiceDesignGroupsCreateOrUpdateOptionalParams, + NetworkServiceDesignGroupsGetOptionalParams, +} from "./options.js"; diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/networkServiceDesignGroups/operations.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/networkServiceDesignGroups/operations.ts new file mode 100644 index 0000000000..b88d5292af --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/networkServiceDesignGroups/operations.ts @@ -0,0 +1,343 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { HybridNetworkManagementContext as Client } from "../index.js"; +import { + errorResponseDeserializer, + TagsObject, + tagsObjectSerializer, + NetworkServiceDesignGroup, + networkServiceDesignGroupSerializer, + networkServiceDesignGroupDeserializer, + _NetworkServiceDesignGroupListResult, + _networkServiceDesignGroupListResultDeserializer, +} from "../../models/models.js"; +import { + PagedAsyncIterableIterator, + buildPagedAsyncIterator, +} from "../../static-helpers/pagingHelpers.js"; +import { getLongRunningPoller } from "../../static-helpers/pollingHelpers.js"; +import { expandUrlTemplate } from "../../static-helpers/urlTemplate.js"; +import { + NetworkServiceDesignGroupsListByPublisherOptionalParams, + NetworkServiceDesignGroupsDeleteOptionalParams, + NetworkServiceDesignGroupsUpdateOptionalParams, + NetworkServiceDesignGroupsCreateOrUpdateOptionalParams, + NetworkServiceDesignGroupsGetOptionalParams, +} from "./options.js"; +import { + StreamableMethod, + PathUncheckedResponse, + createRestError, + operationOptionsToRequestParameters, +} from "@azure-rest/core-client"; +import { PollerLike, OperationState } from "@azure/core-lro"; + +export function _listByPublisherSend( + context: Client, + resourceGroupName: string, + publisherName: string, + options: NetworkServiceDesignGroupsListByPublisherOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkServiceDesignGroups{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + publisherName: publisherName, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context + .path(path) + .get({ + ...operationOptionsToRequestParameters(options), + headers: { accept: "application/json", ...options.requestOptions?.headers }, + }); +} + +export async function _listByPublisherDeserialize( + result: PathUncheckedResponse, +): Promise<_NetworkServiceDesignGroupListResult> { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return _networkServiceDesignGroupListResultDeserializer(result.body); +} + +/** Gets information of the network service design groups under a publisher. */ +export function listByPublisher( + context: Client, + resourceGroupName: string, + publisherName: string, + options: NetworkServiceDesignGroupsListByPublisherOptionalParams = { requestOptions: {} }, +): PagedAsyncIterableIterator { + return buildPagedAsyncIterator( + context, + () => _listByPublisherSend(context, resourceGroupName, publisherName, options), + _listByPublisherDeserialize, + ["200"], + { itemName: "value", nextLinkName: "nextLink" }, + ); +} + +export function _$deleteSend( + context: Client, + resourceGroupName: string, + publisherName: string, + networkServiceDesignGroupName: string, + options: NetworkServiceDesignGroupsDeleteOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkServiceDesignGroups/{networkServiceDesignGroupName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + publisherName: publisherName, + networkServiceDesignGroupName: networkServiceDesignGroupName, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).delete({ ...operationOptionsToRequestParameters(options) }); +} + +export async function _$deleteDeserialize(result: PathUncheckedResponse): Promise { + const expectedStatuses = ["202", "204", "200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return; +} + +/** Deletes a specified network service design group. */ +/** + * @fixme delete is a reserved word that cannot be used as an operation name. + * Please add @clientName("clientName") or @clientName("", "javascript") + * to the operation to override the generated name. + */ +export function $delete( + context: Client, + resourceGroupName: string, + publisherName: string, + networkServiceDesignGroupName: string, + options: NetworkServiceDesignGroupsDeleteOptionalParams = { requestOptions: {} }, +): PollerLike, void> { + return getLongRunningPoller(context, _$deleteDeserialize, ["202", "204", "200"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _$deleteSend( + context, + resourceGroupName, + publisherName, + networkServiceDesignGroupName, + options, + ), + resourceLocationConfig: "location", + }) as PollerLike, void>; +} + +export function _updateSend( + context: Client, + resourceGroupName: string, + publisherName: string, + networkServiceDesignGroupName: string, + parameters: TagsObject, + options: NetworkServiceDesignGroupsUpdateOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkServiceDesignGroups/{networkServiceDesignGroupName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + publisherName: publisherName, + networkServiceDesignGroupName: networkServiceDesignGroupName, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context + .path(path) + .patch({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + headers: { accept: "application/json", ...options.requestOptions?.headers }, + body: tagsObjectSerializer(parameters), + }); +} + +export async function _updateDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return networkServiceDesignGroupDeserializer(result.body); +} + +/** Updates a network service design groups resource. */ +export async function update( + context: Client, + resourceGroupName: string, + publisherName: string, + networkServiceDesignGroupName: string, + parameters: TagsObject, + options: NetworkServiceDesignGroupsUpdateOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _updateSend( + context, + resourceGroupName, + publisherName, + networkServiceDesignGroupName, + parameters, + options, + ); + return _updateDeserialize(result); +} + +export function _createOrUpdateSend( + context: Client, + resourceGroupName: string, + publisherName: string, + networkServiceDesignGroupName: string, + parameters: NetworkServiceDesignGroup, + options: NetworkServiceDesignGroupsCreateOrUpdateOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkServiceDesignGroups/{networkServiceDesignGroupName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + publisherName: publisherName, + networkServiceDesignGroupName: networkServiceDesignGroupName, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context + .path(path) + .put({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + headers: { accept: "application/json", ...options.requestOptions?.headers }, + body: networkServiceDesignGroupSerializer(parameters), + }); +} + +export async function _createOrUpdateDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["200", "201", "202"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return networkServiceDesignGroupDeserializer(result.body); +} + +/** Creates or updates a network service design group. */ +export function createOrUpdate( + context: Client, + resourceGroupName: string, + publisherName: string, + networkServiceDesignGroupName: string, + parameters: NetworkServiceDesignGroup, + options: NetworkServiceDesignGroupsCreateOrUpdateOptionalParams = { requestOptions: {} }, +): PollerLike, NetworkServiceDesignGroup> { + return getLongRunningPoller(context, _createOrUpdateDeserialize, ["200", "201", "202"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _createOrUpdateSend( + context, + resourceGroupName, + publisherName, + networkServiceDesignGroupName, + parameters, + options, + ), + resourceLocationConfig: "azure-async-operation", + }) as PollerLike, NetworkServiceDesignGroup>; +} + +export function _getSend( + context: Client, + resourceGroupName: string, + publisherName: string, + networkServiceDesignGroupName: string, + options: NetworkServiceDesignGroupsGetOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkServiceDesignGroups/{networkServiceDesignGroupName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + publisherName: publisherName, + networkServiceDesignGroupName: networkServiceDesignGroupName, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context + .path(path) + .get({ + ...operationOptionsToRequestParameters(options), + headers: { accept: "application/json", ...options.requestOptions?.headers }, + }); +} + +export async function _getDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return networkServiceDesignGroupDeserializer(result.body); +} + +/** Gets information about the specified networkServiceDesign group. */ +export async function get( + context: Client, + resourceGroupName: string, + publisherName: string, + networkServiceDesignGroupName: string, + options: NetworkServiceDesignGroupsGetOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _getSend( + context, + resourceGroupName, + publisherName, + networkServiceDesignGroupName, + options, + ); + return _getDeserialize(result); +} diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/networkServiceDesignGroups/options.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/networkServiceDesignGroups/options.ts new file mode 100644 index 0000000000..847d7971d4 --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/networkServiceDesignGroups/options.ts @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { OperationOptions } from "@azure-rest/core-client"; + +/** Optional parameters. */ +export interface NetworkServiceDesignGroupsListByPublisherOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface NetworkServiceDesignGroupsDeleteOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface NetworkServiceDesignGroupsUpdateOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface NetworkServiceDesignGroupsCreateOrUpdateOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface NetworkServiceDesignGroupsGetOptionalParams extends OperationOptions {} diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/networkServiceDesignVersions/index.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/networkServiceDesignVersions/index.ts new file mode 100644 index 0000000000..1e99265a0c --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/networkServiceDesignVersions/index.ts @@ -0,0 +1,19 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +export { + updateState, + listByNetworkServiceDesignGroup, + $delete, + update, + createOrUpdate, + get, +} from "./operations.js"; +export { + NetworkServiceDesignVersionsUpdateStateOptionalParams, + NetworkServiceDesignVersionsListByNetworkServiceDesignGroupOptionalParams, + NetworkServiceDesignVersionsDeleteOptionalParams, + NetworkServiceDesignVersionsUpdateOptionalParams, + NetworkServiceDesignVersionsCreateOrUpdateOptionalParams, + NetworkServiceDesignVersionsGetOptionalParams, +} from "./options.js"; diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/networkServiceDesignVersions/operations.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/networkServiceDesignVersions/operations.ts new file mode 100644 index 0000000000..a212110a6b --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/networkServiceDesignVersions/operations.ts @@ -0,0 +1,456 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { HybridNetworkManagementContext as Client } from "../index.js"; +import { + errorResponseDeserializer, + TagsObject, + tagsObjectSerializer, + NetworkServiceDesignVersion, + networkServiceDesignVersionSerializer, + networkServiceDesignVersionDeserializer, + _NetworkServiceDesignVersionListResult, + _networkServiceDesignVersionListResultDeserializer, + NetworkServiceDesignVersionUpdateState, + networkServiceDesignVersionUpdateStateSerializer, + networkServiceDesignVersionUpdateStateDeserializer, +} from "../../models/models.js"; +import { + PagedAsyncIterableIterator, + buildPagedAsyncIterator, +} from "../../static-helpers/pagingHelpers.js"; +import { getLongRunningPoller } from "../../static-helpers/pollingHelpers.js"; +import { expandUrlTemplate } from "../../static-helpers/urlTemplate.js"; +import { + NetworkServiceDesignVersionsUpdateStateOptionalParams, + NetworkServiceDesignVersionsListByNetworkServiceDesignGroupOptionalParams, + NetworkServiceDesignVersionsDeleteOptionalParams, + NetworkServiceDesignVersionsUpdateOptionalParams, + NetworkServiceDesignVersionsCreateOrUpdateOptionalParams, + NetworkServiceDesignVersionsGetOptionalParams, +} from "./options.js"; +import { + StreamableMethod, + PathUncheckedResponse, + createRestError, + operationOptionsToRequestParameters, +} from "@azure-rest/core-client"; +import { PollerLike, OperationState } from "@azure/core-lro"; + +export function _updateStateSend( + context: Client, + resourceGroupName: string, + publisherName: string, + networkServiceDesignGroupName: string, + networkServiceDesignVersionName: string, + parameters: NetworkServiceDesignVersionUpdateState, + options: NetworkServiceDesignVersionsUpdateStateOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkServiceDesignGroups/{networkServiceDesignGroupName}/networkServiceDesignVersions/{networkServiceDesignVersionName}/updateState{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + publisherName: publisherName, + networkServiceDesignGroupName: networkServiceDesignGroupName, + networkServiceDesignVersionName: networkServiceDesignVersionName, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context + .path(path) + .post({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + headers: { accept: "application/json", ...options.requestOptions?.headers }, + body: networkServiceDesignVersionUpdateStateSerializer(parameters), + }); +} + +export async function _updateStateDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["200", "202", "201"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return networkServiceDesignVersionUpdateStateDeserializer(result.body); +} + +/** Update network service design version state. */ +export function updateState( + context: Client, + resourceGroupName: string, + publisherName: string, + networkServiceDesignGroupName: string, + networkServiceDesignVersionName: string, + parameters: NetworkServiceDesignVersionUpdateState, + options: NetworkServiceDesignVersionsUpdateStateOptionalParams = { requestOptions: {} }, +): PollerLike< + OperationState, + NetworkServiceDesignVersionUpdateState +> { + return getLongRunningPoller(context, _updateStateDeserialize, ["200", "202", "201"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _updateStateSend( + context, + resourceGroupName, + publisherName, + networkServiceDesignGroupName, + networkServiceDesignVersionName, + parameters, + options, + ), + resourceLocationConfig: "location", + }) as PollerLike< + OperationState, + NetworkServiceDesignVersionUpdateState + >; +} + +export function _listByNetworkServiceDesignGroupSend( + context: Client, + resourceGroupName: string, + publisherName: string, + networkServiceDesignGroupName: string, + options: NetworkServiceDesignVersionsListByNetworkServiceDesignGroupOptionalParams = { + requestOptions: {}, + }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkServiceDesignGroups/{networkServiceDesignGroupName}/networkServiceDesignVersions{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + publisherName: publisherName, + networkServiceDesignGroupName: networkServiceDesignGroupName, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context + .path(path) + .get({ + ...operationOptionsToRequestParameters(options), + headers: { accept: "application/json", ...options.requestOptions?.headers }, + }); +} + +export async function _listByNetworkServiceDesignGroupDeserialize( + result: PathUncheckedResponse, +): Promise<_NetworkServiceDesignVersionListResult> { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return _networkServiceDesignVersionListResultDeserializer(result.body); +} + +/** Gets information about a list of network service design versions under a network service design group. */ +export function listByNetworkServiceDesignGroup( + context: Client, + resourceGroupName: string, + publisherName: string, + networkServiceDesignGroupName: string, + options: NetworkServiceDesignVersionsListByNetworkServiceDesignGroupOptionalParams = { + requestOptions: {}, + }, +): PagedAsyncIterableIterator { + return buildPagedAsyncIterator( + context, + () => + _listByNetworkServiceDesignGroupSend( + context, + resourceGroupName, + publisherName, + networkServiceDesignGroupName, + options, + ), + _listByNetworkServiceDesignGroupDeserialize, + ["200"], + { itemName: "value", nextLinkName: "nextLink" }, + ); +} + +export function _$deleteSend( + context: Client, + resourceGroupName: string, + publisherName: string, + networkServiceDesignGroupName: string, + networkServiceDesignVersionName: string, + options: NetworkServiceDesignVersionsDeleteOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkServiceDesignGroups/{networkServiceDesignGroupName}/networkServiceDesignVersions/{networkServiceDesignVersionName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + publisherName: publisherName, + networkServiceDesignGroupName: networkServiceDesignGroupName, + networkServiceDesignVersionName: networkServiceDesignVersionName, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).delete({ ...operationOptionsToRequestParameters(options) }); +} + +export async function _$deleteDeserialize(result: PathUncheckedResponse): Promise { + const expectedStatuses = ["202", "204", "200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return; +} + +/** Deletes the specified network service design version. */ +/** + * @fixme delete is a reserved word that cannot be used as an operation name. + * Please add @clientName("clientName") or @clientName("", "javascript") + * to the operation to override the generated name. + */ +export function $delete( + context: Client, + resourceGroupName: string, + publisherName: string, + networkServiceDesignGroupName: string, + networkServiceDesignVersionName: string, + options: NetworkServiceDesignVersionsDeleteOptionalParams = { requestOptions: {} }, +): PollerLike, void> { + return getLongRunningPoller(context, _$deleteDeserialize, ["202", "204", "200"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _$deleteSend( + context, + resourceGroupName, + publisherName, + networkServiceDesignGroupName, + networkServiceDesignVersionName, + options, + ), + resourceLocationConfig: "location", + }) as PollerLike, void>; +} + +export function _updateSend( + context: Client, + resourceGroupName: string, + publisherName: string, + networkServiceDesignGroupName: string, + networkServiceDesignVersionName: string, + parameters: TagsObject, + options: NetworkServiceDesignVersionsUpdateOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkServiceDesignGroups/{networkServiceDesignGroupName}/networkServiceDesignVersions/{networkServiceDesignVersionName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + publisherName: publisherName, + networkServiceDesignGroupName: networkServiceDesignGroupName, + networkServiceDesignVersionName: networkServiceDesignVersionName, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context + .path(path) + .patch({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + headers: { accept: "application/json", ...options.requestOptions?.headers }, + body: tagsObjectSerializer(parameters), + }); +} + +export async function _updateDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return networkServiceDesignVersionDeserializer(result.body); +} + +/** Updates a network service design version resource. */ +export async function update( + context: Client, + resourceGroupName: string, + publisherName: string, + networkServiceDesignGroupName: string, + networkServiceDesignVersionName: string, + parameters: TagsObject, + options: NetworkServiceDesignVersionsUpdateOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _updateSend( + context, + resourceGroupName, + publisherName, + networkServiceDesignGroupName, + networkServiceDesignVersionName, + parameters, + options, + ); + return _updateDeserialize(result); +} + +export function _createOrUpdateSend( + context: Client, + resourceGroupName: string, + publisherName: string, + networkServiceDesignGroupName: string, + networkServiceDesignVersionName: string, + parameters: NetworkServiceDesignVersion, + options: NetworkServiceDesignVersionsCreateOrUpdateOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkServiceDesignGroups/{networkServiceDesignGroupName}/networkServiceDesignVersions/{networkServiceDesignVersionName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + publisherName: publisherName, + networkServiceDesignGroupName: networkServiceDesignGroupName, + networkServiceDesignVersionName: networkServiceDesignVersionName, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context + .path(path) + .put({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + headers: { accept: "application/json", ...options.requestOptions?.headers }, + body: networkServiceDesignVersionSerializer(parameters), + }); +} + +export async function _createOrUpdateDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["200", "201", "202"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return networkServiceDesignVersionDeserializer(result.body); +} + +/** Creates or updates a network service design version. */ +export function createOrUpdate( + context: Client, + resourceGroupName: string, + publisherName: string, + networkServiceDesignGroupName: string, + networkServiceDesignVersionName: string, + parameters: NetworkServiceDesignVersion, + options: NetworkServiceDesignVersionsCreateOrUpdateOptionalParams = { requestOptions: {} }, +): PollerLike, NetworkServiceDesignVersion> { + return getLongRunningPoller(context, _createOrUpdateDeserialize, ["200", "201", "202"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _createOrUpdateSend( + context, + resourceGroupName, + publisherName, + networkServiceDesignGroupName, + networkServiceDesignVersionName, + parameters, + options, + ), + resourceLocationConfig: "azure-async-operation", + }) as PollerLike, NetworkServiceDesignVersion>; +} + +export function _getSend( + context: Client, + resourceGroupName: string, + publisherName: string, + networkServiceDesignGroupName: string, + networkServiceDesignVersionName: string, + options: NetworkServiceDesignVersionsGetOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkServiceDesignGroups/{networkServiceDesignGroupName}/networkServiceDesignVersions/{networkServiceDesignVersionName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + publisherName: publisherName, + networkServiceDesignGroupName: networkServiceDesignGroupName, + networkServiceDesignVersionName: networkServiceDesignVersionName, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context + .path(path) + .get({ + ...operationOptionsToRequestParameters(options), + headers: { accept: "application/json", ...options.requestOptions?.headers }, + }); +} + +export async function _getDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return networkServiceDesignVersionDeserializer(result.body); +} + +/** Gets information about a network service design version. */ +export async function get( + context: Client, + resourceGroupName: string, + publisherName: string, + networkServiceDesignGroupName: string, + networkServiceDesignVersionName: string, + options: NetworkServiceDesignVersionsGetOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _getSend( + context, + resourceGroupName, + publisherName, + networkServiceDesignGroupName, + networkServiceDesignVersionName, + options, + ); + return _getDeserialize(result); +} diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/networkServiceDesignVersions/options.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/networkServiceDesignVersions/options.ts new file mode 100644 index 0000000000..804cb82ff6 --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/networkServiceDesignVersions/options.ts @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { OperationOptions } from "@azure-rest/core-client"; + +/** Optional parameters. */ +export interface NetworkServiceDesignVersionsUpdateStateOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface NetworkServiceDesignVersionsListByNetworkServiceDesignGroupOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface NetworkServiceDesignVersionsDeleteOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface NetworkServiceDesignVersionsUpdateOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface NetworkServiceDesignVersionsCreateOrUpdateOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface NetworkServiceDesignVersionsGetOptionalParams extends OperationOptions {} diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/operations/index.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/operations/index.ts new file mode 100644 index 0000000000..24a804d14f --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/operations/index.ts @@ -0,0 +1,5 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +export { list } from "./operations.js"; +export { OperationsListOptionalParams } from "./options.js"; diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/operations/operations.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/operations/operations.ts new file mode 100644 index 0000000000..0bf682b9bc --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/operations/operations.ts @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { HybridNetworkManagementContext as Client } from "../index.js"; +import { + _OperationListResult, + _operationListResultDeserializer, + Operation, + errorResponseDeserializer, +} from "../../models/models.js"; +import { + PagedAsyncIterableIterator, + buildPagedAsyncIterator, +} from "../../static-helpers/pagingHelpers.js"; +import { expandUrlTemplate } from "../../static-helpers/urlTemplate.js"; +import { OperationsListOptionalParams } from "./options.js"; +import { + StreamableMethod, + PathUncheckedResponse, + createRestError, + operationOptionsToRequestParameters, +} from "@azure-rest/core-client"; + +export function _listSend( + context: Client, + options: OperationsListOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/providers/Microsoft.HybridNetwork/operations{?api%2Dversion}", + { + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context + .path(path) + .get({ + ...operationOptionsToRequestParameters(options), + headers: { accept: "application/json", ...options.requestOptions?.headers }, + }); +} + +export async function _listDeserialize( + result: PathUncheckedResponse, +): Promise<_OperationListResult> { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return _operationListResultDeserializer(result.body); +} + +/** Gets a list of the operations. */ +export function list( + context: Client, + options: OperationsListOptionalParams = { requestOptions: {} }, +): PagedAsyncIterableIterator { + return buildPagedAsyncIterator( + context, + () => _listSend(context, options), + _listDeserialize, + ["200"], + { itemName: "value", nextLinkName: "nextLink" }, + ); +} diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/operations/options.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/operations/options.ts new file mode 100644 index 0000000000..c461016ad1 --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/operations/options.ts @@ -0,0 +1,7 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { OperationOptions } from "@azure-rest/core-client"; + +/** Optional parameters. */ +export interface OperationsListOptionalParams extends OperationOptions {} diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/proxyArtifact/index.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/proxyArtifact/index.ts new file mode 100644 index 0000000000..beea606701 --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/proxyArtifact/index.ts @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +export { updateState, get, list } from "./operations.js"; +export { + ProxyArtifactUpdateStateOptionalParams, + ProxyArtifactGetOptionalParams, + ProxyArtifactListOptionalParams, +} from "./options.js"; diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/proxyArtifact/operations.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/proxyArtifact/operations.ts new file mode 100644 index 0000000000..caaea79185 --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/proxyArtifact/operations.ts @@ -0,0 +1,237 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { HybridNetworkManagementContext as Client } from "../index.js"; +import { + errorResponseDeserializer, + _ProxyArtifactOverviewListResult, + _proxyArtifactOverviewListResultDeserializer, + ProxyArtifactListOverview, + _ProxyArtifactVersionsOverviewListResult, + _proxyArtifactVersionsOverviewListResultDeserializer, + ProxyArtifactVersionsListOverview, + proxyArtifactVersionsListOverviewDeserializer, + ArtifactChangeState, + artifactChangeStateSerializer, +} from "../../models/models.js"; +import { + PagedAsyncIterableIterator, + buildPagedAsyncIterator, +} from "../../static-helpers/pagingHelpers.js"; +import { getLongRunningPoller } from "../../static-helpers/pollingHelpers.js"; +import { expandUrlTemplate } from "../../static-helpers/urlTemplate.js"; +import { + ProxyArtifactUpdateStateOptionalParams, + ProxyArtifactGetOptionalParams, + ProxyArtifactListOptionalParams, +} from "./options.js"; +import { + StreamableMethod, + PathUncheckedResponse, + createRestError, + operationOptionsToRequestParameters, +} from "@azure-rest/core-client"; +import { PollerLike, OperationState } from "@azure/core-lro"; + +export function _updateStateSend( + context: Client, + resourceGroupName: string, + publisherName: string, + artifactStoreName: string, + artifactName: string, + artifactVersionName: string, + parameters: ArtifactChangeState, + options: ProxyArtifactUpdateStateOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/artifactStores/{artifactStoreName}/artifactVersions/{artifactVersionName}{?api%2Dversion,artifactName}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + publisherName: publisherName, + artifactStoreName: artifactStoreName, + artifactVersionName: artifactVersionName, + "api%2Dversion": context.apiVersion, + artifactName: artifactName, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context + .path(path) + .patch({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + headers: { accept: "application/json", ...options.requestOptions?.headers }, + body: artifactChangeStateSerializer(parameters), + }); +} + +export async function _updateStateDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["200", "202", "201"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return proxyArtifactVersionsListOverviewDeserializer(result.body); +} + +/** Change artifact state defined in artifact store. */ +export function updateState( + context: Client, + resourceGroupName: string, + publisherName: string, + artifactStoreName: string, + artifactName: string, + artifactVersionName: string, + parameters: ArtifactChangeState, + options: ProxyArtifactUpdateStateOptionalParams = { requestOptions: {} }, +): PollerLike< + OperationState, + ProxyArtifactVersionsListOverview +> { + return getLongRunningPoller(context, _updateStateDeserialize, ["200", "202", "201"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _updateStateSend( + context, + resourceGroupName, + publisherName, + artifactStoreName, + artifactName, + artifactVersionName, + parameters, + options, + ), + resourceLocationConfig: "location", + }) as PollerLike< + OperationState, + ProxyArtifactVersionsListOverview + >; +} + +export function _getSend( + context: Client, + resourceGroupName: string, + publisherName: string, + artifactStoreName: string, + artifactName: string, + options: ProxyArtifactGetOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/artifactStores/{artifactStoreName}/artifactVersions{?api%2Dversion,artifactName}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + publisherName: publisherName, + artifactStoreName: artifactStoreName, + "api%2Dversion": context.apiVersion, + artifactName: artifactName, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context + .path(path) + .get({ + ...operationOptionsToRequestParameters(options), + headers: { accept: "application/json", ...options.requestOptions?.headers }, + }); +} + +export async function _getDeserialize( + result: PathUncheckedResponse, +): Promise<_ProxyArtifactVersionsOverviewListResult> { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return _proxyArtifactVersionsOverviewListResultDeserializer(result.body); +} + +/** Get a Artifact overview information. */ +export function get( + context: Client, + resourceGroupName: string, + publisherName: string, + artifactStoreName: string, + artifactName: string, + options: ProxyArtifactGetOptionalParams = { requestOptions: {} }, +): PagedAsyncIterableIterator { + return buildPagedAsyncIterator( + context, + () => + _getSend(context, resourceGroupName, publisherName, artifactStoreName, artifactName, options), + _getDeserialize, + ["200"], + { itemName: "value", nextLinkName: "nextLink" }, + ); +} + +export function _listSend( + context: Client, + resourceGroupName: string, + publisherName: string, + artifactStoreName: string, + options: ProxyArtifactListOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/artifactStores/{artifactStoreName}/artifacts{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + publisherName: publisherName, + artifactStoreName: artifactStoreName, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context + .path(path) + .get({ + ...operationOptionsToRequestParameters(options), + headers: { accept: "application/json", ...options.requestOptions?.headers }, + }); +} + +export async function _listDeserialize( + result: PathUncheckedResponse, +): Promise<_ProxyArtifactOverviewListResult> { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return _proxyArtifactOverviewListResultDeserializer(result.body); +} + +/** Lists all the available artifacts in the parent Artifact Store. */ +export function list( + context: Client, + resourceGroupName: string, + publisherName: string, + artifactStoreName: string, + options: ProxyArtifactListOptionalParams = { requestOptions: {} }, +): PagedAsyncIterableIterator { + return buildPagedAsyncIterator( + context, + () => _listSend(context, resourceGroupName, publisherName, artifactStoreName, options), + _listDeserialize, + ["200"], + { itemName: "value", nextLinkName: "nextLink" }, + ); +} diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/proxyArtifact/options.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/proxyArtifact/options.ts new file mode 100644 index 0000000000..42c89d378f --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/proxyArtifact/options.ts @@ -0,0 +1,16 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { OperationOptions } from "@azure-rest/core-client"; + +/** Optional parameters. */ +export interface ProxyArtifactUpdateStateOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface ProxyArtifactGetOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface ProxyArtifactListOptionalParams extends OperationOptions {} diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/publishers/index.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/publishers/index.ts new file mode 100644 index 0000000000..80ba490814 --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/publishers/index.ts @@ -0,0 +1,19 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +export { + listBySubscription, + listByResourceGroup, + $delete, + update, + createOrUpdate, + get, +} from "./operations.js"; +export { + PublishersListBySubscriptionOptionalParams, + PublishersListByResourceGroupOptionalParams, + PublishersDeleteOptionalParams, + PublishersUpdateOptionalParams, + PublishersCreateOrUpdateOptionalParams, + PublishersGetOptionalParams, +} from "./options.js"; diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/publishers/operations.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/publishers/operations.ts new file mode 100644 index 0000000000..0c90bbb34a --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/publishers/operations.ts @@ -0,0 +1,346 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { HybridNetworkManagementContext as Client } from "../index.js"; +import { + errorResponseDeserializer, + tagsObjectSerializer, + Publisher, + publisherSerializer, + publisherDeserializer, + _PublisherListResult, + _publisherListResultDeserializer, +} from "../../models/models.js"; +import { + PagedAsyncIterableIterator, + buildPagedAsyncIterator, +} from "../../static-helpers/pagingHelpers.js"; +import { getLongRunningPoller } from "../../static-helpers/pollingHelpers.js"; +import { expandUrlTemplate } from "../../static-helpers/urlTemplate.js"; +import { + PublishersListBySubscriptionOptionalParams, + PublishersListByResourceGroupOptionalParams, + PublishersDeleteOptionalParams, + PublishersUpdateOptionalParams, + PublishersCreateOrUpdateOptionalParams, + PublishersGetOptionalParams, +} from "./options.js"; +import { + StreamableMethod, + PathUncheckedResponse, + createRestError, + operationOptionsToRequestParameters, +} from "@azure-rest/core-client"; +import { PollerLike, OperationState } from "@azure/core-lro"; + +export function _listBySubscriptionSend( + context: Client, + options: PublishersListBySubscriptionOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/providers/Microsoft.HybridNetwork/publishers{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context + .path(path) + .get({ + ...operationOptionsToRequestParameters(options), + headers: { accept: "application/json", ...options.requestOptions?.headers }, + }); +} + +export async function _listBySubscriptionDeserialize( + result: PathUncheckedResponse, +): Promise<_PublisherListResult> { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return _publisherListResultDeserializer(result.body); +} + +/** Lists all the publishers in a subscription. */ +export function listBySubscription( + context: Client, + options: PublishersListBySubscriptionOptionalParams = { requestOptions: {} }, +): PagedAsyncIterableIterator { + return buildPagedAsyncIterator( + context, + () => _listBySubscriptionSend(context, options), + _listBySubscriptionDeserialize, + ["200"], + { itemName: "value", nextLinkName: "nextLink" }, + ); +} + +export function _listByResourceGroupSend( + context: Client, + resourceGroupName: string, + options: PublishersListByResourceGroupOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context + .path(path) + .get({ + ...operationOptionsToRequestParameters(options), + headers: { accept: "application/json", ...options.requestOptions?.headers }, + }); +} + +export async function _listByResourceGroupDeserialize( + result: PathUncheckedResponse, +): Promise<_PublisherListResult> { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return _publisherListResultDeserializer(result.body); +} + +/** Lists all the publishers in a resource group. */ +export function listByResourceGroup( + context: Client, + resourceGroupName: string, + options: PublishersListByResourceGroupOptionalParams = { requestOptions: {} }, +): PagedAsyncIterableIterator { + return buildPagedAsyncIterator( + context, + () => _listByResourceGroupSend(context, resourceGroupName, options), + _listByResourceGroupDeserialize, + ["200"], + { itemName: "value", nextLinkName: "nextLink" }, + ); +} + +export function _$deleteSend( + context: Client, + resourceGroupName: string, + publisherName: string, + options: PublishersDeleteOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + publisherName: publisherName, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).delete({ ...operationOptionsToRequestParameters(options) }); +} + +export async function _$deleteDeserialize(result: PathUncheckedResponse): Promise { + const expectedStatuses = ["202", "204", "200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return; +} + +/** Deletes the specified publisher. */ +/** + * @fixme delete is a reserved word that cannot be used as an operation name. + * Please add @clientName("clientName") or @clientName("", "javascript") + * to the operation to override the generated name. + */ +export function $delete( + context: Client, + resourceGroupName: string, + publisherName: string, + options: PublishersDeleteOptionalParams = { requestOptions: {} }, +): PollerLike, void> { + return getLongRunningPoller(context, _$deleteDeserialize, ["202", "204", "200"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => _$deleteSend(context, resourceGroupName, publisherName, options), + resourceLocationConfig: "location", + }) as PollerLike, void>; +} + +export function _updateSend( + context: Client, + resourceGroupName: string, + publisherName: string, + options: PublishersUpdateOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + publisherName: publisherName, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context + .path(path) + .patch({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + headers: { accept: "application/json", ...options.requestOptions?.headers }, + body: !options["parameters"] + ? options["parameters"] + : tagsObjectSerializer(options["parameters"]), + }); +} + +export async function _updateDeserialize(result: PathUncheckedResponse): Promise { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return publisherDeserializer(result.body); +} + +/** Update a publisher resource. */ +export async function update( + context: Client, + resourceGroupName: string, + publisherName: string, + options: PublishersUpdateOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _updateSend(context, resourceGroupName, publisherName, options); + return _updateDeserialize(result); +} + +export function _createOrUpdateSend( + context: Client, + resourceGroupName: string, + publisherName: string, + options: PublishersCreateOrUpdateOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + publisherName: publisherName, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context + .path(path) + .put({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + headers: { accept: "application/json", ...options.requestOptions?.headers }, + body: !options["parameters"] + ? options["parameters"] + : publisherSerializer(options["parameters"]), + }); +} + +export async function _createOrUpdateDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["200", "201", "202"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return publisherDeserializer(result.body); +} + +/** Creates or updates a publisher. */ +export function createOrUpdate( + context: Client, + resourceGroupName: string, + publisherName: string, + options: PublishersCreateOrUpdateOptionalParams = { requestOptions: {} }, +): PollerLike, Publisher> { + return getLongRunningPoller(context, _createOrUpdateDeserialize, ["200", "201", "202"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _createOrUpdateSend(context, resourceGroupName, publisherName, options), + resourceLocationConfig: "azure-async-operation", + }) as PollerLike, Publisher>; +} + +export function _getSend( + context: Client, + resourceGroupName: string, + publisherName: string, + options: PublishersGetOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + publisherName: publisherName, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context + .path(path) + .get({ + ...operationOptionsToRequestParameters(options), + headers: { accept: "application/json", ...options.requestOptions?.headers }, + }); +} + +export async function _getDeserialize(result: PathUncheckedResponse): Promise { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return publisherDeserializer(result.body); +} + +/** Gets information about the specified publisher. */ +export async function get( + context: Client, + resourceGroupName: string, + publisherName: string, + options: PublishersGetOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _getSend(context, resourceGroupName, publisherName, options); + return _getDeserialize(result); +} diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/publishers/options.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/publishers/options.ts new file mode 100644 index 0000000000..e81a3a5a7d --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/publishers/options.ts @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { TagsObject, Publisher } from "../../models/models.js"; +import { OperationOptions } from "@azure-rest/core-client"; + +/** Optional parameters. */ +export interface PublishersListBySubscriptionOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface PublishersListByResourceGroupOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface PublishersDeleteOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface PublishersUpdateOptionalParams extends OperationOptions { + /** Parameters supplied to the create publisher operation. */ + parameters?: TagsObject; +} + +/** Optional parameters. */ +export interface PublishersCreateOrUpdateOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** Parameters supplied to the create publisher operation. */ + parameters?: Publisher; +} + +/** Optional parameters. */ +export interface PublishersGetOptionalParams extends OperationOptions {} diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/siteNetworkServices/index.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/siteNetworkServices/index.ts new file mode 100644 index 0000000000..220cfa5e95 --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/siteNetworkServices/index.ts @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +export { + cancelOperation, + listBySubscription, + listByResourceGroup, + $delete, + updateTags, + createOrUpdate, + get, +} from "./operations.js"; +export { + SiteNetworkServicesCancelOperationOptionalParams, + SiteNetworkServicesListBySubscriptionOptionalParams, + SiteNetworkServicesListByResourceGroupOptionalParams, + SiteNetworkServicesDeleteOptionalParams, + SiteNetworkServicesUpdateTagsOptionalParams, + SiteNetworkServicesCreateOrUpdateOptionalParams, + SiteNetworkServicesGetOptionalParams, +} from "./options.js"; diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/siteNetworkServices/operations.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/siteNetworkServices/operations.ts new file mode 100644 index 0000000000..5cdbe789ff --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/siteNetworkServices/operations.ts @@ -0,0 +1,408 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { HybridNetworkManagementContext as Client } from "../index.js"; +import { + errorResponseDeserializer, + TagsObject, + tagsObjectSerializer, + SiteNetworkService, + siteNetworkServiceSerializer, + siteNetworkServiceDeserializer, + _SiteNetworkServiceListResult, + _siteNetworkServiceListResultDeserializer, + CancelInformation, + cancelInformationSerializer, +} from "../../models/models.js"; +import { + PagedAsyncIterableIterator, + buildPagedAsyncIterator, +} from "../../static-helpers/pagingHelpers.js"; +import { getLongRunningPoller } from "../../static-helpers/pollingHelpers.js"; +import { expandUrlTemplate } from "../../static-helpers/urlTemplate.js"; +import { + SiteNetworkServicesCancelOperationOptionalParams, + SiteNetworkServicesListBySubscriptionOptionalParams, + SiteNetworkServicesListByResourceGroupOptionalParams, + SiteNetworkServicesDeleteOptionalParams, + SiteNetworkServicesUpdateTagsOptionalParams, + SiteNetworkServicesCreateOrUpdateOptionalParams, + SiteNetworkServicesGetOptionalParams, +} from "./options.js"; +import { + StreamableMethod, + PathUncheckedResponse, + createRestError, + operationOptionsToRequestParameters, +} from "@azure-rest/core-client"; +import { PollerLike, OperationState } from "@azure/core-lro"; + +export function _cancelOperationSend( + context: Client, + parameters: CancelInformation, + options: SiteNetworkServicesCancelOperationOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/providers/Microsoft.HybridNetwork/cancelSiteNetworkServiceOperation{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context + .path(path) + .post({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + body: cancelInformationSerializer(parameters), + }); +} + +export async function _cancelOperationDeserialize(result: PathUncheckedResponse): Promise { + const expectedStatuses = ["202", "200", "201"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return; +} + +/** Cancels an ongoing long-running PUT operation for the specified Site Network Service resource. Other operations are not supported for cancellation at this time. */ +export function cancelOperation( + context: Client, + parameters: CancelInformation, + options: SiteNetworkServicesCancelOperationOptionalParams = { requestOptions: {} }, +): PollerLike, void> { + return getLongRunningPoller(context, _cancelOperationDeserialize, ["202", "200", "201"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => _cancelOperationSend(context, parameters, options), + resourceLocationConfig: "location", + }) as PollerLike, void>; +} + +export function _listBySubscriptionSend( + context: Client, + options: SiteNetworkServicesListBySubscriptionOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/providers/Microsoft.HybridNetwork/siteNetworkServices{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context + .path(path) + .get({ + ...operationOptionsToRequestParameters(options), + headers: { accept: "application/json", ...options.requestOptions?.headers }, + }); +} + +export async function _listBySubscriptionDeserialize( + result: PathUncheckedResponse, +): Promise<_SiteNetworkServiceListResult> { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return _siteNetworkServiceListResultDeserializer(result.body); +} + +/** Lists all sites in the network service in a subscription. */ +export function listBySubscription( + context: Client, + options: SiteNetworkServicesListBySubscriptionOptionalParams = { requestOptions: {} }, +): PagedAsyncIterableIterator { + return buildPagedAsyncIterator( + context, + () => _listBySubscriptionSend(context, options), + _listBySubscriptionDeserialize, + ["200"], + { itemName: "value", nextLinkName: "nextLink" }, + ); +} + +export function _listByResourceGroupSend( + context: Client, + resourceGroupName: string, + options: SiteNetworkServicesListByResourceGroupOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/siteNetworkServices{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context + .path(path) + .get({ + ...operationOptionsToRequestParameters(options), + headers: { accept: "application/json", ...options.requestOptions?.headers }, + }); +} + +export async function _listByResourceGroupDeserialize( + result: PathUncheckedResponse, +): Promise<_SiteNetworkServiceListResult> { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return _siteNetworkServiceListResultDeserializer(result.body); +} + +/** Lists all site network services. */ +export function listByResourceGroup( + context: Client, + resourceGroupName: string, + options: SiteNetworkServicesListByResourceGroupOptionalParams = { requestOptions: {} }, +): PagedAsyncIterableIterator { + return buildPagedAsyncIterator( + context, + () => _listByResourceGroupSend(context, resourceGroupName, options), + _listByResourceGroupDeserialize, + ["200"], + { itemName: "value", nextLinkName: "nextLink" }, + ); +} + +export function _$deleteSend( + context: Client, + resourceGroupName: string, + siteNetworkServiceName: string, + options: SiteNetworkServicesDeleteOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/siteNetworkServices/{siteNetworkServiceName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + siteNetworkServiceName: siteNetworkServiceName, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).delete({ ...operationOptionsToRequestParameters(options) }); +} + +export async function _$deleteDeserialize(result: PathUncheckedResponse): Promise { + const expectedStatuses = ["202", "204", "200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return; +} + +/** Deletes the specified site network service. */ +/** + * @fixme delete is a reserved word that cannot be used as an operation name. + * Please add @clientName("clientName") or @clientName("", "javascript") + * to the operation to override the generated name. + */ +export function $delete( + context: Client, + resourceGroupName: string, + siteNetworkServiceName: string, + options: SiteNetworkServicesDeleteOptionalParams = { requestOptions: {} }, +): PollerLike, void> { + return getLongRunningPoller(context, _$deleteDeserialize, ["202", "204", "200"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _$deleteSend(context, resourceGroupName, siteNetworkServiceName, options), + resourceLocationConfig: "location", + }) as PollerLike, void>; +} + +export function _updateTagsSend( + context: Client, + resourceGroupName: string, + siteNetworkServiceName: string, + parameters: TagsObject, + options: SiteNetworkServicesUpdateTagsOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/siteNetworkServices/{siteNetworkServiceName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + siteNetworkServiceName: siteNetworkServiceName, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context + .path(path) + .patch({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + headers: { accept: "application/json", ...options.requestOptions?.headers }, + body: tagsObjectSerializer(parameters), + }); +} + +export async function _updateTagsDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return siteNetworkServiceDeserializer(result.body); +} + +/** Updates a site update tags. */ +export async function updateTags( + context: Client, + resourceGroupName: string, + siteNetworkServiceName: string, + parameters: TagsObject, + options: SiteNetworkServicesUpdateTagsOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _updateTagsSend( + context, + resourceGroupName, + siteNetworkServiceName, + parameters, + options, + ); + return _updateTagsDeserialize(result); +} + +export function _createOrUpdateSend( + context: Client, + resourceGroupName: string, + siteNetworkServiceName: string, + parameters: SiteNetworkService, + options: SiteNetworkServicesCreateOrUpdateOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/siteNetworkServices/{siteNetworkServiceName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + siteNetworkServiceName: siteNetworkServiceName, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context + .path(path) + .put({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + headers: { accept: "application/json", ...options.requestOptions?.headers }, + body: siteNetworkServiceSerializer(parameters), + }); +} + +export async function _createOrUpdateDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["200", "201", "202"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return siteNetworkServiceDeserializer(result.body); +} + +/** Creates or updates a network site. */ +export function createOrUpdate( + context: Client, + resourceGroupName: string, + siteNetworkServiceName: string, + parameters: SiteNetworkService, + options: SiteNetworkServicesCreateOrUpdateOptionalParams = { requestOptions: {} }, +): PollerLike, SiteNetworkService> { + return getLongRunningPoller(context, _createOrUpdateDeserialize, ["200", "201", "202"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _createOrUpdateSend(context, resourceGroupName, siteNetworkServiceName, parameters, options), + resourceLocationConfig: "azure-async-operation", + }) as PollerLike, SiteNetworkService>; +} + +export function _getSend( + context: Client, + resourceGroupName: string, + siteNetworkServiceName: string, + options: SiteNetworkServicesGetOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/siteNetworkServices/{siteNetworkServiceName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + siteNetworkServiceName: siteNetworkServiceName, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context + .path(path) + .get({ + ...operationOptionsToRequestParameters(options), + headers: { accept: "application/json", ...options.requestOptions?.headers }, + }); +} + +export async function _getDeserialize(result: PathUncheckedResponse): Promise { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return siteNetworkServiceDeserializer(result.body); +} + +/** Gets information about the specified site network service. */ +export async function get( + context: Client, + resourceGroupName: string, + siteNetworkServiceName: string, + options: SiteNetworkServicesGetOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _getSend(context, resourceGroupName, siteNetworkServiceName, options); + return _getDeserialize(result); +} diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/siteNetworkServices/options.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/siteNetworkServices/options.ts new file mode 100644 index 0000000000..d440d836c9 --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/siteNetworkServices/options.ts @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { OperationOptions } from "@azure-rest/core-client"; + +/** Optional parameters. */ +export interface SiteNetworkServicesCancelOperationOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface SiteNetworkServicesListBySubscriptionOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface SiteNetworkServicesListByResourceGroupOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface SiteNetworkServicesDeleteOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface SiteNetworkServicesUpdateTagsOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface SiteNetworkServicesCreateOrUpdateOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface SiteNetworkServicesGetOptionalParams extends OperationOptions {} diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/sites/index.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/sites/index.ts new file mode 100644 index 0000000000..53edf6f696 --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/sites/index.ts @@ -0,0 +1,19 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +export { + listBySubscription, + listByResourceGroup, + $delete, + updateTags, + createOrUpdate, + get, +} from "./operations.js"; +export { + SitesListBySubscriptionOptionalParams, + SitesListByResourceGroupOptionalParams, + SitesDeleteOptionalParams, + SitesUpdateTagsOptionalParams, + SitesCreateOrUpdateOptionalParams, + SitesGetOptionalParams, +} from "./options.js"; diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/sites/operations.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/sites/operations.ts new file mode 100644 index 0000000000..13c6899f1a --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/sites/operations.ts @@ -0,0 +1,345 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { HybridNetworkManagementContext as Client } from "../index.js"; +import { + errorResponseDeserializer, + TagsObject, + tagsObjectSerializer, + Site, + siteSerializer, + siteDeserializer, + _SiteListResult, + _siteListResultDeserializer, +} from "../../models/models.js"; +import { + PagedAsyncIterableIterator, + buildPagedAsyncIterator, +} from "../../static-helpers/pagingHelpers.js"; +import { getLongRunningPoller } from "../../static-helpers/pollingHelpers.js"; +import { expandUrlTemplate } from "../../static-helpers/urlTemplate.js"; +import { + SitesListBySubscriptionOptionalParams, + SitesListByResourceGroupOptionalParams, + SitesDeleteOptionalParams, + SitesUpdateTagsOptionalParams, + SitesCreateOrUpdateOptionalParams, + SitesGetOptionalParams, +} from "./options.js"; +import { + StreamableMethod, + PathUncheckedResponse, + createRestError, + operationOptionsToRequestParameters, +} from "@azure-rest/core-client"; +import { PollerLike, OperationState } from "@azure/core-lro"; + +export function _listBySubscriptionSend( + context: Client, + options: SitesListBySubscriptionOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/providers/Microsoft.HybridNetwork/sites{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context + .path(path) + .get({ + ...operationOptionsToRequestParameters(options), + headers: { accept: "application/json", ...options.requestOptions?.headers }, + }); +} + +export async function _listBySubscriptionDeserialize( + result: PathUncheckedResponse, +): Promise<_SiteListResult> { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return _siteListResultDeserializer(result.body); +} + +/** Lists all sites in the network service in a subscription. */ +export function listBySubscription( + context: Client, + options: SitesListBySubscriptionOptionalParams = { requestOptions: {} }, +): PagedAsyncIterableIterator { + return buildPagedAsyncIterator( + context, + () => _listBySubscriptionSend(context, options), + _listBySubscriptionDeserialize, + ["200"], + { itemName: "value", nextLinkName: "nextLink" }, + ); +} + +export function _listByResourceGroupSend( + context: Client, + resourceGroupName: string, + options: SitesListByResourceGroupOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/sites{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context + .path(path) + .get({ + ...operationOptionsToRequestParameters(options), + headers: { accept: "application/json", ...options.requestOptions?.headers }, + }); +} + +export async function _listByResourceGroupDeserialize( + result: PathUncheckedResponse, +): Promise<_SiteListResult> { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return _siteListResultDeserializer(result.body); +} + +/** Lists all sites in the network service. */ +export function listByResourceGroup( + context: Client, + resourceGroupName: string, + options: SitesListByResourceGroupOptionalParams = { requestOptions: {} }, +): PagedAsyncIterableIterator { + return buildPagedAsyncIterator( + context, + () => _listByResourceGroupSend(context, resourceGroupName, options), + _listByResourceGroupDeserialize, + ["200"], + { itemName: "value", nextLinkName: "nextLink" }, + ); +} + +export function _$deleteSend( + context: Client, + resourceGroupName: string, + siteName: string, + options: SitesDeleteOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/sites/{siteName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + siteName: siteName, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).delete({ ...operationOptionsToRequestParameters(options) }); +} + +export async function _$deleteDeserialize(result: PathUncheckedResponse): Promise { + const expectedStatuses = ["202", "204", "200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return; +} + +/** Deletes the specified network site. */ +/** + * @fixme delete is a reserved word that cannot be used as an operation name. + * Please add @clientName("clientName") or @clientName("", "javascript") + * to the operation to override the generated name. + */ +export function $delete( + context: Client, + resourceGroupName: string, + siteName: string, + options: SitesDeleteOptionalParams = { requestOptions: {} }, +): PollerLike, void> { + return getLongRunningPoller(context, _$deleteDeserialize, ["202", "204", "200"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => _$deleteSend(context, resourceGroupName, siteName, options), + resourceLocationConfig: "location", + }) as PollerLike, void>; +} + +export function _updateTagsSend( + context: Client, + resourceGroupName: string, + siteName: string, + parameters: TagsObject, + options: SitesUpdateTagsOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/sites/{siteName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + siteName: siteName, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context + .path(path) + .patch({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + headers: { accept: "application/json", ...options.requestOptions?.headers }, + body: tagsObjectSerializer(parameters), + }); +} + +export async function _updateTagsDeserialize(result: PathUncheckedResponse): Promise { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return siteDeserializer(result.body); +} + +/** Updates a site update tags. */ +export async function updateTags( + context: Client, + resourceGroupName: string, + siteName: string, + parameters: TagsObject, + options: SitesUpdateTagsOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _updateTagsSend(context, resourceGroupName, siteName, parameters, options); + return _updateTagsDeserialize(result); +} + +export function _createOrUpdateSend( + context: Client, + resourceGroupName: string, + siteName: string, + parameters: Site, + options: SitesCreateOrUpdateOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/sites/{siteName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + siteName: siteName, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context + .path(path) + .put({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + headers: { accept: "application/json", ...options.requestOptions?.headers }, + body: siteSerializer(parameters), + }); +} + +export async function _createOrUpdateDeserialize(result: PathUncheckedResponse): Promise { + const expectedStatuses = ["200", "201", "202"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return siteDeserializer(result.body); +} + +/** Creates or updates a network site. */ +export function createOrUpdate( + context: Client, + resourceGroupName: string, + siteName: string, + parameters: Site, + options: SitesCreateOrUpdateOptionalParams = { requestOptions: {} }, +): PollerLike, Site> { + return getLongRunningPoller(context, _createOrUpdateDeserialize, ["200", "201", "202"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _createOrUpdateSend(context, resourceGroupName, siteName, parameters, options), + resourceLocationConfig: "azure-async-operation", + }) as PollerLike, Site>; +} + +export function _getSend( + context: Client, + resourceGroupName: string, + siteName: string, + options: SitesGetOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/sites/{siteName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + siteName: siteName, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context + .path(path) + .get({ + ...operationOptionsToRequestParameters(options), + headers: { accept: "application/json", ...options.requestOptions?.headers }, + }); +} + +export async function _getDeserialize(result: PathUncheckedResponse): Promise { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return siteDeserializer(result.body); +} + +/** Gets information about the specified network site. */ +export async function get( + context: Client, + resourceGroupName: string, + siteName: string, + options: SitesGetOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _getSend(context, resourceGroupName, siteName, options); + return _getDeserialize(result); +} diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/sites/options.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/sites/options.ts new file mode 100644 index 0000000000..3947cc1c5b --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/sites/options.ts @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { OperationOptions } from "@azure-rest/core-client"; + +/** Optional parameters. */ +export interface SitesListBySubscriptionOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface SitesListByResourceGroupOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface SitesDeleteOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface SitesUpdateTagsOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface SitesCreateOrUpdateOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface SitesGetOptionalParams extends OperationOptions {} diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/classic/artifactManifests/index.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/classic/artifactManifests/index.ts new file mode 100644 index 0000000000..a0ba30933c --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/classic/artifactManifests/index.ts @@ -0,0 +1,377 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { HybridNetworkManagementContext } from "../../api/hybridNetworkManagementContext.js"; +import { + updateState, + listCredential, + listByArtifactStore, + $delete, + update, + createOrUpdate, + get, +} from "../../api/artifactManifests/operations.js"; +import { + ArtifactManifestsUpdateStateOptionalParams, + ArtifactManifestsListCredentialOptionalParams, + ArtifactManifestsListByArtifactStoreOptionalParams, + ArtifactManifestsDeleteOptionalParams, + ArtifactManifestsUpdateOptionalParams, + ArtifactManifestsCreateOrUpdateOptionalParams, + ArtifactManifestsGetOptionalParams, +} from "../../api/artifactManifests/options.js"; +import { + TagsObject, + ArtifactManifest, + ArtifactAccessCredentialUnion, + ArtifactManifestUpdateState, +} from "../../models/models.js"; +import { PagedAsyncIterableIterator } from "../../static-helpers/pagingHelpers.js"; +import { SimplePollerLike, getSimplePoller } from "../../static-helpers/simplePollerHelpers.js"; +import { PollerLike, OperationState } from "@azure/core-lro"; + +/** Interface representing a ArtifactManifests operations. */ +export interface ArtifactManifestsOperations { + /** Update state for artifact manifest. */ + updateState: ( + resourceGroupName: string, + publisherName: string, + artifactStoreName: string, + artifactManifestName: string, + parameters: ArtifactManifestUpdateState, + options?: ArtifactManifestsUpdateStateOptionalParams, + ) => PollerLike, ArtifactManifestUpdateState>; + /** @deprecated use updateState instead */ + beginUpdateState: ( + resourceGroupName: string, + publisherName: string, + artifactStoreName: string, + artifactManifestName: string, + parameters: ArtifactManifestUpdateState, + options?: ArtifactManifestsUpdateStateOptionalParams, + ) => Promise< + SimplePollerLike, ArtifactManifestUpdateState> + >; + /** @deprecated use updateState instead */ + beginUpdateStateAndWait: ( + resourceGroupName: string, + publisherName: string, + artifactStoreName: string, + artifactManifestName: string, + parameters: ArtifactManifestUpdateState, + options?: ArtifactManifestsUpdateStateOptionalParams, + ) => Promise; + /** List credential for publishing artifacts defined in artifact manifest. */ + listCredential: ( + resourceGroupName: string, + publisherName: string, + artifactStoreName: string, + artifactManifestName: string, + options?: ArtifactManifestsListCredentialOptionalParams, + ) => Promise; + /** Gets information about the artifact manifest. */ + listByArtifactStore: ( + resourceGroupName: string, + publisherName: string, + artifactStoreName: string, + options?: ArtifactManifestsListByArtifactStoreOptionalParams, + ) => PagedAsyncIterableIterator; + /** Deletes the specified artifact manifest. */ + /** + * @fixme delete is a reserved word that cannot be used as an operation name. + * Please add @clientName("clientName") or @clientName("", "javascript") + * to the operation to override the generated name. + */ + delete: ( + resourceGroupName: string, + publisherName: string, + artifactStoreName: string, + artifactManifestName: string, + options?: ArtifactManifestsDeleteOptionalParams, + ) => PollerLike, void>; + /** @deprecated use delete instead */ + beginDelete: ( + resourceGroupName: string, + publisherName: string, + artifactStoreName: string, + artifactManifestName: string, + options?: ArtifactManifestsDeleteOptionalParams, + ) => Promise, void>>; + /** @deprecated use delete instead */ + beginDeleteAndWait: ( + resourceGroupName: string, + publisherName: string, + artifactStoreName: string, + artifactManifestName: string, + options?: ArtifactManifestsDeleteOptionalParams, + ) => Promise; + /** Updates a artifact manifest resource. */ + update: ( + resourceGroupName: string, + publisherName: string, + artifactStoreName: string, + artifactManifestName: string, + parameters: TagsObject, + options?: ArtifactManifestsUpdateOptionalParams, + ) => Promise; + /** Creates or updates a artifact manifest. */ + createOrUpdate: ( + resourceGroupName: string, + publisherName: string, + artifactStoreName: string, + artifactManifestName: string, + parameters: ArtifactManifest, + options?: ArtifactManifestsCreateOrUpdateOptionalParams, + ) => PollerLike, ArtifactManifest>; + /** @deprecated use createOrUpdate instead */ + beginCreateOrUpdate: ( + resourceGroupName: string, + publisherName: string, + artifactStoreName: string, + artifactManifestName: string, + parameters: ArtifactManifest, + options?: ArtifactManifestsCreateOrUpdateOptionalParams, + ) => Promise, ArtifactManifest>>; + /** @deprecated use createOrUpdate instead */ + beginCreateOrUpdateAndWait: ( + resourceGroupName: string, + publisherName: string, + artifactStoreName: string, + artifactManifestName: string, + parameters: ArtifactManifest, + options?: ArtifactManifestsCreateOrUpdateOptionalParams, + ) => Promise; + /** Gets information about a artifact manifest resource. */ + get: ( + resourceGroupName: string, + publisherName: string, + artifactStoreName: string, + artifactManifestName: string, + options?: ArtifactManifestsGetOptionalParams, + ) => Promise; +} + +function _getArtifactManifests(context: HybridNetworkManagementContext) { + return { + updateState: ( + resourceGroupName: string, + publisherName: string, + artifactStoreName: string, + artifactManifestName: string, + parameters: ArtifactManifestUpdateState, + options?: ArtifactManifestsUpdateStateOptionalParams, + ) => + updateState( + context, + resourceGroupName, + publisherName, + artifactStoreName, + artifactManifestName, + parameters, + options, + ), + beginUpdateState: async ( + resourceGroupName: string, + publisherName: string, + artifactStoreName: string, + artifactManifestName: string, + parameters: ArtifactManifestUpdateState, + options?: ArtifactManifestsUpdateStateOptionalParams, + ) => { + const poller = updateState( + context, + resourceGroupName, + publisherName, + artifactStoreName, + artifactManifestName, + parameters, + options, + ); + await poller.submitted(); + return getSimplePoller(poller); + }, + beginUpdateStateAndWait: async ( + resourceGroupName: string, + publisherName: string, + artifactStoreName: string, + artifactManifestName: string, + parameters: ArtifactManifestUpdateState, + options?: ArtifactManifestsUpdateStateOptionalParams, + ) => { + return await updateState( + context, + resourceGroupName, + publisherName, + artifactStoreName, + artifactManifestName, + parameters, + options, + ); + }, + listCredential: ( + resourceGroupName: string, + publisherName: string, + artifactStoreName: string, + artifactManifestName: string, + options?: ArtifactManifestsListCredentialOptionalParams, + ) => + listCredential( + context, + resourceGroupName, + publisherName, + artifactStoreName, + artifactManifestName, + options, + ), + listByArtifactStore: ( + resourceGroupName: string, + publisherName: string, + artifactStoreName: string, + options?: ArtifactManifestsListByArtifactStoreOptionalParams, + ) => listByArtifactStore(context, resourceGroupName, publisherName, artifactStoreName, options), + delete: ( + resourceGroupName: string, + publisherName: string, + artifactStoreName: string, + artifactManifestName: string, + options?: ArtifactManifestsDeleteOptionalParams, + ) => + $delete( + context, + resourceGroupName, + publisherName, + artifactStoreName, + artifactManifestName, + options, + ), + beginDelete: async ( + resourceGroupName: string, + publisherName: string, + artifactStoreName: string, + artifactManifestName: string, + options?: ArtifactManifestsDeleteOptionalParams, + ) => { + const poller = $delete( + context, + resourceGroupName, + publisherName, + artifactStoreName, + artifactManifestName, + options, + ); + await poller.submitted(); + return getSimplePoller(poller); + }, + beginDeleteAndWait: async ( + resourceGroupName: string, + publisherName: string, + artifactStoreName: string, + artifactManifestName: string, + options?: ArtifactManifestsDeleteOptionalParams, + ) => { + return await $delete( + context, + resourceGroupName, + publisherName, + artifactStoreName, + artifactManifestName, + options, + ); + }, + update: ( + resourceGroupName: string, + publisherName: string, + artifactStoreName: string, + artifactManifestName: string, + parameters: TagsObject, + options?: ArtifactManifestsUpdateOptionalParams, + ) => + update( + context, + resourceGroupName, + publisherName, + artifactStoreName, + artifactManifestName, + parameters, + options, + ), + createOrUpdate: ( + resourceGroupName: string, + publisherName: string, + artifactStoreName: string, + artifactManifestName: string, + parameters: ArtifactManifest, + options?: ArtifactManifestsCreateOrUpdateOptionalParams, + ) => + createOrUpdate( + context, + resourceGroupName, + publisherName, + artifactStoreName, + artifactManifestName, + parameters, + options, + ), + beginCreateOrUpdate: async ( + resourceGroupName: string, + publisherName: string, + artifactStoreName: string, + artifactManifestName: string, + parameters: ArtifactManifest, + options?: ArtifactManifestsCreateOrUpdateOptionalParams, + ) => { + const poller = createOrUpdate( + context, + resourceGroupName, + publisherName, + artifactStoreName, + artifactManifestName, + parameters, + options, + ); + await poller.submitted(); + return getSimplePoller(poller); + }, + beginCreateOrUpdateAndWait: async ( + resourceGroupName: string, + publisherName: string, + artifactStoreName: string, + artifactManifestName: string, + parameters: ArtifactManifest, + options?: ArtifactManifestsCreateOrUpdateOptionalParams, + ) => { + return await createOrUpdate( + context, + resourceGroupName, + publisherName, + artifactStoreName, + artifactManifestName, + parameters, + options, + ); + }, + get: ( + resourceGroupName: string, + publisherName: string, + artifactStoreName: string, + artifactManifestName: string, + options?: ArtifactManifestsGetOptionalParams, + ) => + get( + context, + resourceGroupName, + publisherName, + artifactStoreName, + artifactManifestName, + options, + ), + }; +} + +export function _getArtifactManifestsOperations( + context: HybridNetworkManagementContext, +): ArtifactManifestsOperations { + return { + ..._getArtifactManifests(context), + }; +} diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/classic/artifactStores/index.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/classic/artifactStores/index.ts new file mode 100644 index 0000000000..ade64113ed --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/classic/artifactStores/index.ts @@ -0,0 +1,586 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { HybridNetworkManagementContext } from "../../api/hybridNetworkManagementContext.js"; +import { + listPrivateEndPoints, + removePrivateEndPoints, + approvePrivateEndPoints, + listNetworkFabricControllerPrivateEndPoints, + deleteNetworkFabricControllerEndPoints, + addNetworkFabricControllerEndPoints, + listByPublisher, + $delete, + update, + createOrUpdate, + get, +} from "../../api/artifactStores/operations.js"; +import { + ArtifactStoresListPrivateEndPointsOptionalParams, + ArtifactStoresRemovePrivateEndPointsOptionalParams, + ArtifactStoresApprovePrivateEndPointsOptionalParams, + ArtifactStoresListNetworkFabricControllerPrivateEndPointsOptionalParams, + ArtifactStoresDeleteNetworkFabricControllerEndPointsOptionalParams, + ArtifactStoresAddNetworkFabricControllerEndPointsOptionalParams, + ArtifactStoresListByPublisherOptionalParams, + ArtifactStoresDeleteOptionalParams, + ArtifactStoresUpdateOptionalParams, + ArtifactStoresCreateOrUpdateOptionalParams, + ArtifactStoresGetOptionalParams, +} from "../../api/artifactStores/options.js"; +import { + TagsObject, + ArtifactStore, + ArtifactStoreNetworkFabricControllerEndPoints, + ArtifactStorePrivateEndPointsFormat, +} from "../../models/models.js"; +import { PagedAsyncIterableIterator } from "../../static-helpers/pagingHelpers.js"; +import { SimplePollerLike, getSimplePoller } from "../../static-helpers/simplePollerHelpers.js"; +import { PollerLike, OperationState } from "@azure/core-lro"; + +/** Interface representing a ArtifactStores operations. */ +export interface ArtifactStoresOperations { + /** List manual private endpoints on artifact stores */ + listPrivateEndPoints: ( + resourceGroupName: string, + publisherName: string, + artifactStoreName: string, + options?: ArtifactStoresListPrivateEndPointsOptionalParams, + ) => PagedAsyncIterableIterator; + /** @deprecated use listPrivateEndPoints instead */ + beginListListPrivateEndPointsAndWait: ( + resourceGroupName: string, + publisherName: string, + artifactStoreName: string, + options?: ArtifactStoresListPrivateEndPointsOptionalParams, + ) => PagedAsyncIterableIterator; + /** Remove manual private endpoints on artifact stores */ + removePrivateEndPoints: ( + resourceGroupName: string, + publisherName: string, + artifactStoreName: string, + parameters: ArtifactStorePrivateEndPointsFormat, + options?: ArtifactStoresRemovePrivateEndPointsOptionalParams, + ) => PollerLike, void>; + /** @deprecated use removePrivateEndPoints instead */ + beginRemovePrivateEndPoints: ( + resourceGroupName: string, + publisherName: string, + artifactStoreName: string, + parameters: ArtifactStorePrivateEndPointsFormat, + options?: ArtifactStoresRemovePrivateEndPointsOptionalParams, + ) => Promise, void>>; + /** @deprecated use removePrivateEndPoints instead */ + beginRemovePrivateEndPointsAndWait: ( + resourceGroupName: string, + publisherName: string, + artifactStoreName: string, + parameters: ArtifactStorePrivateEndPointsFormat, + options?: ArtifactStoresRemovePrivateEndPointsOptionalParams, + ) => Promise; + /** Approve manual private endpoints on artifact stores */ + approvePrivateEndPoints: ( + resourceGroupName: string, + publisherName: string, + artifactStoreName: string, + parameters: ArtifactStorePrivateEndPointsFormat, + options?: ArtifactStoresApprovePrivateEndPointsOptionalParams, + ) => PollerLike, void>; + /** @deprecated use approvePrivateEndPoints instead */ + beginApprovePrivateEndPoints: ( + resourceGroupName: string, + publisherName: string, + artifactStoreName: string, + parameters: ArtifactStorePrivateEndPointsFormat, + options?: ArtifactStoresApprovePrivateEndPointsOptionalParams, + ) => Promise, void>>; + /** @deprecated use approvePrivateEndPoints instead */ + beginApprovePrivateEndPointsAndWait: ( + resourceGroupName: string, + publisherName: string, + artifactStoreName: string, + parameters: ArtifactStorePrivateEndPointsFormat, + options?: ArtifactStoresApprovePrivateEndPointsOptionalParams, + ) => Promise; + /** List network fabric controllers to artifact stores */ + listNetworkFabricControllerPrivateEndPoints: ( + resourceGroupName: string, + publisherName: string, + artifactStoreName: string, + options?: ArtifactStoresListNetworkFabricControllerPrivateEndPointsOptionalParams, + ) => PagedAsyncIterableIterator; + /** @deprecated use listNetworkFabricControllerPrivateEndPoints instead */ + beginListListNetworkFabricControllerPrivateEndPointsAndWait: ( + resourceGroupName: string, + publisherName: string, + artifactStoreName: string, + options?: ArtifactStoresListNetworkFabricControllerPrivateEndPointsOptionalParams, + ) => PagedAsyncIterableIterator; + /** Delete network fabric controllers on artifact stores */ + deleteNetworkFabricControllerEndPoints: ( + resourceGroupName: string, + publisherName: string, + artifactStoreName: string, + parameters: ArtifactStoreNetworkFabricControllerEndPoints, + options?: ArtifactStoresDeleteNetworkFabricControllerEndPointsOptionalParams, + ) => PollerLike, void>; + /** @deprecated use deleteNetworkFabricControllerEndPoints instead */ + beginDeleteNetworkFabricControllerEndPoints: ( + resourceGroupName: string, + publisherName: string, + artifactStoreName: string, + parameters: ArtifactStoreNetworkFabricControllerEndPoints, + options?: ArtifactStoresDeleteNetworkFabricControllerEndPointsOptionalParams, + ) => Promise, void>>; + /** @deprecated use deleteNetworkFabricControllerEndPoints instead */ + beginDeleteNetworkFabricControllerEndPointsAndWait: ( + resourceGroupName: string, + publisherName: string, + artifactStoreName: string, + parameters: ArtifactStoreNetworkFabricControllerEndPoints, + options?: ArtifactStoresDeleteNetworkFabricControllerEndPointsOptionalParams, + ) => Promise; + /** Add network fabric controllers to artifact stores */ + addNetworkFabricControllerEndPoints: ( + resourceGroupName: string, + publisherName: string, + artifactStoreName: string, + parameters: ArtifactStoreNetworkFabricControllerEndPoints, + options?: ArtifactStoresAddNetworkFabricControllerEndPointsOptionalParams, + ) => PollerLike, void>; + /** @deprecated use addNetworkFabricControllerEndPoints instead */ + beginAddNetworkFabricControllerEndPoints: ( + resourceGroupName: string, + publisherName: string, + artifactStoreName: string, + parameters: ArtifactStoreNetworkFabricControllerEndPoints, + options?: ArtifactStoresAddNetworkFabricControllerEndPointsOptionalParams, + ) => Promise, void>>; + /** @deprecated use addNetworkFabricControllerEndPoints instead */ + beginAddNetworkFabricControllerEndPointsAndWait: ( + resourceGroupName: string, + publisherName: string, + artifactStoreName: string, + parameters: ArtifactStoreNetworkFabricControllerEndPoints, + options?: ArtifactStoresAddNetworkFabricControllerEndPointsOptionalParams, + ) => Promise; + /** Gets information of the ArtifactStores under publisher. */ + listByPublisher: ( + resourceGroupName: string, + publisherName: string, + options?: ArtifactStoresListByPublisherOptionalParams, + ) => PagedAsyncIterableIterator; + /** Deletes the specified artifact store. */ + /** + * @fixme delete is a reserved word that cannot be used as an operation name. + * Please add @clientName("clientName") or @clientName("", "javascript") + * to the operation to override the generated name. + */ + delete: ( + resourceGroupName: string, + publisherName: string, + artifactStoreName: string, + options?: ArtifactStoresDeleteOptionalParams, + ) => PollerLike, void>; + /** @deprecated use delete instead */ + beginDelete: ( + resourceGroupName: string, + publisherName: string, + artifactStoreName: string, + options?: ArtifactStoresDeleteOptionalParams, + ) => Promise, void>>; + /** @deprecated use delete instead */ + beginDeleteAndWait: ( + resourceGroupName: string, + publisherName: string, + artifactStoreName: string, + options?: ArtifactStoresDeleteOptionalParams, + ) => Promise; + /** Update artifact store resource. */ + update: ( + resourceGroupName: string, + publisherName: string, + artifactStoreName: string, + parameters: TagsObject, + options?: ArtifactStoresUpdateOptionalParams, + ) => Promise; + /** Creates or updates a artifact store. */ + createOrUpdate: ( + resourceGroupName: string, + publisherName: string, + artifactStoreName: string, + parameters: ArtifactStore, + options?: ArtifactStoresCreateOrUpdateOptionalParams, + ) => PollerLike, ArtifactStore>; + /** @deprecated use createOrUpdate instead */ + beginCreateOrUpdate: ( + resourceGroupName: string, + publisherName: string, + artifactStoreName: string, + parameters: ArtifactStore, + options?: ArtifactStoresCreateOrUpdateOptionalParams, + ) => Promise, ArtifactStore>>; + /** @deprecated use createOrUpdate instead */ + beginCreateOrUpdateAndWait: ( + resourceGroupName: string, + publisherName: string, + artifactStoreName: string, + parameters: ArtifactStore, + options?: ArtifactStoresCreateOrUpdateOptionalParams, + ) => Promise; + /** Gets information about the specified artifact store. */ + get: ( + resourceGroupName: string, + publisherName: string, + artifactStoreName: string, + options?: ArtifactStoresGetOptionalParams, + ) => Promise; +} + +function _getArtifactStores(context: HybridNetworkManagementContext) { + return { + listPrivateEndPoints: ( + resourceGroupName: string, + publisherName: string, + artifactStoreName: string, + options?: ArtifactStoresListPrivateEndPointsOptionalParams, + ) => + listPrivateEndPoints(context, resourceGroupName, publisherName, artifactStoreName, options), + beginListListPrivateEndPointsAndWait: ( + resourceGroupName: string, + publisherName: string, + artifactStoreName: string, + options?: ArtifactStoresListPrivateEndPointsOptionalParams, + ) => { + return listPrivateEndPoints( + context, + resourceGroupName, + publisherName, + artifactStoreName, + options, + ); + }, + removePrivateEndPoints: ( + resourceGroupName: string, + publisherName: string, + artifactStoreName: string, + parameters: ArtifactStorePrivateEndPointsFormat, + options?: ArtifactStoresRemovePrivateEndPointsOptionalParams, + ) => + removePrivateEndPoints( + context, + resourceGroupName, + publisherName, + artifactStoreName, + parameters, + options, + ), + beginRemovePrivateEndPoints: async ( + resourceGroupName: string, + publisherName: string, + artifactStoreName: string, + parameters: ArtifactStorePrivateEndPointsFormat, + options?: ArtifactStoresRemovePrivateEndPointsOptionalParams, + ) => { + const poller = removePrivateEndPoints( + context, + resourceGroupName, + publisherName, + artifactStoreName, + parameters, + options, + ); + await poller.submitted(); + return getSimplePoller(poller); + }, + beginRemovePrivateEndPointsAndWait: async ( + resourceGroupName: string, + publisherName: string, + artifactStoreName: string, + parameters: ArtifactStorePrivateEndPointsFormat, + options?: ArtifactStoresRemovePrivateEndPointsOptionalParams, + ) => { + return await removePrivateEndPoints( + context, + resourceGroupName, + publisherName, + artifactStoreName, + parameters, + options, + ); + }, + approvePrivateEndPoints: ( + resourceGroupName: string, + publisherName: string, + artifactStoreName: string, + parameters: ArtifactStorePrivateEndPointsFormat, + options?: ArtifactStoresApprovePrivateEndPointsOptionalParams, + ) => + approvePrivateEndPoints( + context, + resourceGroupName, + publisherName, + artifactStoreName, + parameters, + options, + ), + beginApprovePrivateEndPoints: async ( + resourceGroupName: string, + publisherName: string, + artifactStoreName: string, + parameters: ArtifactStorePrivateEndPointsFormat, + options?: ArtifactStoresApprovePrivateEndPointsOptionalParams, + ) => { + const poller = approvePrivateEndPoints( + context, + resourceGroupName, + publisherName, + artifactStoreName, + parameters, + options, + ); + await poller.submitted(); + return getSimplePoller(poller); + }, + beginApprovePrivateEndPointsAndWait: async ( + resourceGroupName: string, + publisherName: string, + artifactStoreName: string, + parameters: ArtifactStorePrivateEndPointsFormat, + options?: ArtifactStoresApprovePrivateEndPointsOptionalParams, + ) => { + return await approvePrivateEndPoints( + context, + resourceGroupName, + publisherName, + artifactStoreName, + parameters, + options, + ); + }, + listNetworkFabricControllerPrivateEndPoints: ( + resourceGroupName: string, + publisherName: string, + artifactStoreName: string, + options?: ArtifactStoresListNetworkFabricControllerPrivateEndPointsOptionalParams, + ) => + listNetworkFabricControllerPrivateEndPoints( + context, + resourceGroupName, + publisherName, + artifactStoreName, + options, + ), + beginListListNetworkFabricControllerPrivateEndPointsAndWait: ( + resourceGroupName: string, + publisherName: string, + artifactStoreName: string, + options?: ArtifactStoresListNetworkFabricControllerPrivateEndPointsOptionalParams, + ) => { + return listNetworkFabricControllerPrivateEndPoints( + context, + resourceGroupName, + publisherName, + artifactStoreName, + options, + ); + }, + deleteNetworkFabricControllerEndPoints: ( + resourceGroupName: string, + publisherName: string, + artifactStoreName: string, + parameters: ArtifactStoreNetworkFabricControllerEndPoints, + options?: ArtifactStoresDeleteNetworkFabricControllerEndPointsOptionalParams, + ) => + deleteNetworkFabricControllerEndPoints( + context, + resourceGroupName, + publisherName, + artifactStoreName, + parameters, + options, + ), + beginDeleteNetworkFabricControllerEndPoints: async ( + resourceGroupName: string, + publisherName: string, + artifactStoreName: string, + parameters: ArtifactStoreNetworkFabricControllerEndPoints, + options?: ArtifactStoresDeleteNetworkFabricControllerEndPointsOptionalParams, + ) => { + const poller = deleteNetworkFabricControllerEndPoints( + context, + resourceGroupName, + publisherName, + artifactStoreName, + parameters, + options, + ); + await poller.submitted(); + return getSimplePoller(poller); + }, + beginDeleteNetworkFabricControllerEndPointsAndWait: async ( + resourceGroupName: string, + publisherName: string, + artifactStoreName: string, + parameters: ArtifactStoreNetworkFabricControllerEndPoints, + options?: ArtifactStoresDeleteNetworkFabricControllerEndPointsOptionalParams, + ) => { + return await deleteNetworkFabricControllerEndPoints( + context, + resourceGroupName, + publisherName, + artifactStoreName, + parameters, + options, + ); + }, + addNetworkFabricControllerEndPoints: ( + resourceGroupName: string, + publisherName: string, + artifactStoreName: string, + parameters: ArtifactStoreNetworkFabricControllerEndPoints, + options?: ArtifactStoresAddNetworkFabricControllerEndPointsOptionalParams, + ) => + addNetworkFabricControllerEndPoints( + context, + resourceGroupName, + publisherName, + artifactStoreName, + parameters, + options, + ), + beginAddNetworkFabricControllerEndPoints: async ( + resourceGroupName: string, + publisherName: string, + artifactStoreName: string, + parameters: ArtifactStoreNetworkFabricControllerEndPoints, + options?: ArtifactStoresAddNetworkFabricControllerEndPointsOptionalParams, + ) => { + const poller = addNetworkFabricControllerEndPoints( + context, + resourceGroupName, + publisherName, + artifactStoreName, + parameters, + options, + ); + await poller.submitted(); + return getSimplePoller(poller); + }, + beginAddNetworkFabricControllerEndPointsAndWait: async ( + resourceGroupName: string, + publisherName: string, + artifactStoreName: string, + parameters: ArtifactStoreNetworkFabricControllerEndPoints, + options?: ArtifactStoresAddNetworkFabricControllerEndPointsOptionalParams, + ) => { + return await addNetworkFabricControllerEndPoints( + context, + resourceGroupName, + publisherName, + artifactStoreName, + parameters, + options, + ); + }, + listByPublisher: ( + resourceGroupName: string, + publisherName: string, + options?: ArtifactStoresListByPublisherOptionalParams, + ) => listByPublisher(context, resourceGroupName, publisherName, options), + delete: ( + resourceGroupName: string, + publisherName: string, + artifactStoreName: string, + options?: ArtifactStoresDeleteOptionalParams, + ) => $delete(context, resourceGroupName, publisherName, artifactStoreName, options), + beginDelete: async ( + resourceGroupName: string, + publisherName: string, + artifactStoreName: string, + options?: ArtifactStoresDeleteOptionalParams, + ) => { + const poller = $delete(context, resourceGroupName, publisherName, artifactStoreName, options); + await poller.submitted(); + return getSimplePoller(poller); + }, + beginDeleteAndWait: async ( + resourceGroupName: string, + publisherName: string, + artifactStoreName: string, + options?: ArtifactStoresDeleteOptionalParams, + ) => { + return await $delete(context, resourceGroupName, publisherName, artifactStoreName, options); + }, + update: ( + resourceGroupName: string, + publisherName: string, + artifactStoreName: string, + parameters: TagsObject, + options?: ArtifactStoresUpdateOptionalParams, + ) => update(context, resourceGroupName, publisherName, artifactStoreName, parameters, options), + createOrUpdate: ( + resourceGroupName: string, + publisherName: string, + artifactStoreName: string, + parameters: ArtifactStore, + options?: ArtifactStoresCreateOrUpdateOptionalParams, + ) => + createOrUpdate( + context, + resourceGroupName, + publisherName, + artifactStoreName, + parameters, + options, + ), + beginCreateOrUpdate: async ( + resourceGroupName: string, + publisherName: string, + artifactStoreName: string, + parameters: ArtifactStore, + options?: ArtifactStoresCreateOrUpdateOptionalParams, + ) => { + const poller = createOrUpdate( + context, + resourceGroupName, + publisherName, + artifactStoreName, + parameters, + options, + ); + await poller.submitted(); + return getSimplePoller(poller); + }, + beginCreateOrUpdateAndWait: async ( + resourceGroupName: string, + publisherName: string, + artifactStoreName: string, + parameters: ArtifactStore, + options?: ArtifactStoresCreateOrUpdateOptionalParams, + ) => { + return await createOrUpdate( + context, + resourceGroupName, + publisherName, + artifactStoreName, + parameters, + options, + ); + }, + get: ( + resourceGroupName: string, + publisherName: string, + artifactStoreName: string, + options?: ArtifactStoresGetOptionalParams, + ) => get(context, resourceGroupName, publisherName, artifactStoreName, options), + }; +} + +export function _getArtifactStoresOperations( + context: HybridNetworkManagementContext, +): ArtifactStoresOperations { + return { + ..._getArtifactStores(context), + }; +} diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/classic/components/index.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/classic/components/index.ts new file mode 100644 index 0000000000..ce98face4f --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/classic/components/index.ts @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { HybridNetworkManagementContext } from "../../api/hybridNetworkManagementContext.js"; +import { listByNetworkFunction, get } from "../../api/components/operations.js"; +import { + ComponentsListByNetworkFunctionOptionalParams, + ComponentsGetOptionalParams, +} from "../../api/components/options.js"; +import { Component } from "../../models/models.js"; +import { PagedAsyncIterableIterator } from "../../static-helpers/pagingHelpers.js"; + +/** Interface representing a Components operations. */ +export interface ComponentsOperations { + /** Lists all the component resources in a network function. */ + listByNetworkFunction: ( + resourceGroupName: string, + networkFunctionName: string, + options?: ComponentsListByNetworkFunctionOptionalParams, + ) => PagedAsyncIterableIterator; + /** Gets information about the specified application instance resource. */ + get: ( + resourceGroupName: string, + networkFunctionName: string, + componentName: string, + options?: ComponentsGetOptionalParams, + ) => Promise; +} + +function _getComponents(context: HybridNetworkManagementContext) { + return { + listByNetworkFunction: ( + resourceGroupName: string, + networkFunctionName: string, + options?: ComponentsListByNetworkFunctionOptionalParams, + ) => listByNetworkFunction(context, resourceGroupName, networkFunctionName, options), + get: ( + resourceGroupName: string, + networkFunctionName: string, + componentName: string, + options?: ComponentsGetOptionalParams, + ) => get(context, resourceGroupName, networkFunctionName, componentName, options), + }; +} + +export function _getComponentsOperations( + context: HybridNetworkManagementContext, +): ComponentsOperations { + return { + ..._getComponents(context), + }; +} diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/classic/configurationGroupSchemas/index.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/classic/configurationGroupSchemas/index.ts new file mode 100644 index 0000000000..3648904fce --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/classic/configurationGroupSchemas/index.ts @@ -0,0 +1,310 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { HybridNetworkManagementContext } from "../../api/hybridNetworkManagementContext.js"; +import { + updateState, + listByPublisher, + $delete, + update, + createOrUpdate, + get, +} from "../../api/configurationGroupSchemas/operations.js"; +import { + ConfigurationGroupSchemasUpdateStateOptionalParams, + ConfigurationGroupSchemasListByPublisherOptionalParams, + ConfigurationGroupSchemasDeleteOptionalParams, + ConfigurationGroupSchemasUpdateOptionalParams, + ConfigurationGroupSchemasCreateOrUpdateOptionalParams, + ConfigurationGroupSchemasGetOptionalParams, +} from "../../api/configurationGroupSchemas/options.js"; +import { + ConfigurationGroupSchema, + TagsObject, + ConfigurationGroupSchemaVersionUpdateState, +} from "../../models/models.js"; +import { PagedAsyncIterableIterator } from "../../static-helpers/pagingHelpers.js"; +import { SimplePollerLike, getSimplePoller } from "../../static-helpers/simplePollerHelpers.js"; +import { PollerLike, OperationState } from "@azure/core-lro"; + +/** Interface representing a ConfigurationGroupSchemas operations. */ +export interface ConfigurationGroupSchemasOperations { + /** Update configuration group schema state. */ + updateState: ( + resourceGroupName: string, + publisherName: string, + configurationGroupSchemaName: string, + parameters: ConfigurationGroupSchemaVersionUpdateState, + options?: ConfigurationGroupSchemasUpdateStateOptionalParams, + ) => PollerLike< + OperationState, + ConfigurationGroupSchemaVersionUpdateState + >; + /** @deprecated use updateState instead */ + beginUpdateState: ( + resourceGroupName: string, + publisherName: string, + configurationGroupSchemaName: string, + parameters: ConfigurationGroupSchemaVersionUpdateState, + options?: ConfigurationGroupSchemasUpdateStateOptionalParams, + ) => Promise< + SimplePollerLike< + OperationState, + ConfigurationGroupSchemaVersionUpdateState + > + >; + /** @deprecated use updateState instead */ + beginUpdateStateAndWait: ( + resourceGroupName: string, + publisherName: string, + configurationGroupSchemaName: string, + parameters: ConfigurationGroupSchemaVersionUpdateState, + options?: ConfigurationGroupSchemasUpdateStateOptionalParams, + ) => Promise; + /** Gets information of the configuration group schemas under a publisher. */ + listByPublisher: ( + resourceGroupName: string, + publisherName: string, + options?: ConfigurationGroupSchemasListByPublisherOptionalParams, + ) => PagedAsyncIterableIterator; + /** Deletes a specified configuration group schema. */ + /** + * @fixme delete is a reserved word that cannot be used as an operation name. + * Please add @clientName("clientName") or @clientName("", "javascript") + * to the operation to override the generated name. + */ + delete: ( + resourceGroupName: string, + publisherName: string, + configurationGroupSchemaName: string, + options?: ConfigurationGroupSchemasDeleteOptionalParams, + ) => PollerLike, void>; + /** @deprecated use delete instead */ + beginDelete: ( + resourceGroupName: string, + publisherName: string, + configurationGroupSchemaName: string, + options?: ConfigurationGroupSchemasDeleteOptionalParams, + ) => Promise, void>>; + /** @deprecated use delete instead */ + beginDeleteAndWait: ( + resourceGroupName: string, + publisherName: string, + configurationGroupSchemaName: string, + options?: ConfigurationGroupSchemasDeleteOptionalParams, + ) => Promise; + /** Updates a configuration group schema resource. */ + update: ( + resourceGroupName: string, + publisherName: string, + configurationGroupSchemaName: string, + parameters: TagsObject, + options?: ConfigurationGroupSchemasUpdateOptionalParams, + ) => Promise; + /** Creates or updates a configuration group schema. */ + createOrUpdate: ( + resourceGroupName: string, + publisherName: string, + configurationGroupSchemaName: string, + parameters: ConfigurationGroupSchema, + options?: ConfigurationGroupSchemasCreateOrUpdateOptionalParams, + ) => PollerLike, ConfigurationGroupSchema>; + /** @deprecated use createOrUpdate instead */ + beginCreateOrUpdate: ( + resourceGroupName: string, + publisherName: string, + configurationGroupSchemaName: string, + parameters: ConfigurationGroupSchema, + options?: ConfigurationGroupSchemasCreateOrUpdateOptionalParams, + ) => Promise< + SimplePollerLike, ConfigurationGroupSchema> + >; + /** @deprecated use createOrUpdate instead */ + beginCreateOrUpdateAndWait: ( + resourceGroupName: string, + publisherName: string, + configurationGroupSchemaName: string, + parameters: ConfigurationGroupSchema, + options?: ConfigurationGroupSchemasCreateOrUpdateOptionalParams, + ) => Promise; + /** Gets information about the specified configuration group schema. */ + get: ( + resourceGroupName: string, + publisherName: string, + configurationGroupSchemaName: string, + options?: ConfigurationGroupSchemasGetOptionalParams, + ) => Promise; +} + +function _getConfigurationGroupSchemas(context: HybridNetworkManagementContext) { + return { + updateState: ( + resourceGroupName: string, + publisherName: string, + configurationGroupSchemaName: string, + parameters: ConfigurationGroupSchemaVersionUpdateState, + options?: ConfigurationGroupSchemasUpdateStateOptionalParams, + ) => + updateState( + context, + resourceGroupName, + publisherName, + configurationGroupSchemaName, + parameters, + options, + ), + beginUpdateState: async ( + resourceGroupName: string, + publisherName: string, + configurationGroupSchemaName: string, + parameters: ConfigurationGroupSchemaVersionUpdateState, + options?: ConfigurationGroupSchemasUpdateStateOptionalParams, + ) => { + const poller = updateState( + context, + resourceGroupName, + publisherName, + configurationGroupSchemaName, + parameters, + options, + ); + await poller.submitted(); + return getSimplePoller(poller); + }, + beginUpdateStateAndWait: async ( + resourceGroupName: string, + publisherName: string, + configurationGroupSchemaName: string, + parameters: ConfigurationGroupSchemaVersionUpdateState, + options?: ConfigurationGroupSchemasUpdateStateOptionalParams, + ) => { + return await updateState( + context, + resourceGroupName, + publisherName, + configurationGroupSchemaName, + parameters, + options, + ); + }, + listByPublisher: ( + resourceGroupName: string, + publisherName: string, + options?: ConfigurationGroupSchemasListByPublisherOptionalParams, + ) => listByPublisher(context, resourceGroupName, publisherName, options), + delete: ( + resourceGroupName: string, + publisherName: string, + configurationGroupSchemaName: string, + options?: ConfigurationGroupSchemasDeleteOptionalParams, + ) => $delete(context, resourceGroupName, publisherName, configurationGroupSchemaName, options), + beginDelete: async ( + resourceGroupName: string, + publisherName: string, + configurationGroupSchemaName: string, + options?: ConfigurationGroupSchemasDeleteOptionalParams, + ) => { + const poller = $delete( + context, + resourceGroupName, + publisherName, + configurationGroupSchemaName, + options, + ); + await poller.submitted(); + return getSimplePoller(poller); + }, + beginDeleteAndWait: async ( + resourceGroupName: string, + publisherName: string, + configurationGroupSchemaName: string, + options?: ConfigurationGroupSchemasDeleteOptionalParams, + ) => { + return await $delete( + context, + resourceGroupName, + publisherName, + configurationGroupSchemaName, + options, + ); + }, + update: ( + resourceGroupName: string, + publisherName: string, + configurationGroupSchemaName: string, + parameters: TagsObject, + options?: ConfigurationGroupSchemasUpdateOptionalParams, + ) => + update( + context, + resourceGroupName, + publisherName, + configurationGroupSchemaName, + parameters, + options, + ), + createOrUpdate: ( + resourceGroupName: string, + publisherName: string, + configurationGroupSchemaName: string, + parameters: ConfigurationGroupSchema, + options?: ConfigurationGroupSchemasCreateOrUpdateOptionalParams, + ) => + createOrUpdate( + context, + resourceGroupName, + publisherName, + configurationGroupSchemaName, + parameters, + options, + ), + beginCreateOrUpdate: async ( + resourceGroupName: string, + publisherName: string, + configurationGroupSchemaName: string, + parameters: ConfigurationGroupSchema, + options?: ConfigurationGroupSchemasCreateOrUpdateOptionalParams, + ) => { + const poller = createOrUpdate( + context, + resourceGroupName, + publisherName, + configurationGroupSchemaName, + parameters, + options, + ); + await poller.submitted(); + return getSimplePoller(poller); + }, + beginCreateOrUpdateAndWait: async ( + resourceGroupName: string, + publisherName: string, + configurationGroupSchemaName: string, + parameters: ConfigurationGroupSchema, + options?: ConfigurationGroupSchemasCreateOrUpdateOptionalParams, + ) => { + return await createOrUpdate( + context, + resourceGroupName, + publisherName, + configurationGroupSchemaName, + parameters, + options, + ); + }, + get: ( + resourceGroupName: string, + publisherName: string, + configurationGroupSchemaName: string, + options?: ConfigurationGroupSchemasGetOptionalParams, + ) => get(context, resourceGroupName, publisherName, configurationGroupSchemaName, options), + }; +} + +export function _getConfigurationGroupSchemasOperations( + context: HybridNetworkManagementContext, +): ConfigurationGroupSchemasOperations { + return { + ..._getConfigurationGroupSchemas(context), + }; +} diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/classic/configurationGroupValues/index.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/classic/configurationGroupValues/index.ts new file mode 100644 index 0000000000..6e1815f974 --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/classic/configurationGroupValues/index.ts @@ -0,0 +1,182 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { HybridNetworkManagementContext } from "../../api/hybridNetworkManagementContext.js"; +import { + listBySubscription, + listByResourceGroup, + $delete, + updateTags, + createOrUpdate, + get, +} from "../../api/configurationGroupValues/operations.js"; +import { + ConfigurationGroupValuesListBySubscriptionOptionalParams, + ConfigurationGroupValuesListByResourceGroupOptionalParams, + ConfigurationGroupValuesDeleteOptionalParams, + ConfigurationGroupValuesUpdateTagsOptionalParams, + ConfigurationGroupValuesCreateOrUpdateOptionalParams, + ConfigurationGroupValuesGetOptionalParams, +} from "../../api/configurationGroupValues/options.js"; +import { TagsObject, ConfigurationGroupValue } from "../../models/models.js"; +import { PagedAsyncIterableIterator } from "../../static-helpers/pagingHelpers.js"; +import { SimplePollerLike, getSimplePoller } from "../../static-helpers/simplePollerHelpers.js"; +import { PollerLike, OperationState } from "@azure/core-lro"; + +/** Interface representing a ConfigurationGroupValues operations. */ +export interface ConfigurationGroupValuesOperations { + /** Lists all sites in the configuration group value in a subscription. */ + listBySubscription: ( + options?: ConfigurationGroupValuesListBySubscriptionOptionalParams, + ) => PagedAsyncIterableIterator; + /** Lists all the hybrid network configurationGroupValues in a resource group. */ + listByResourceGroup: ( + resourceGroupName: string, + options?: ConfigurationGroupValuesListByResourceGroupOptionalParams, + ) => PagedAsyncIterableIterator; + /** Deletes the specified hybrid configuration group value. */ + /** + * @fixme delete is a reserved word that cannot be used as an operation name. + * Please add @clientName("clientName") or @clientName("", "javascript") + * to the operation to override the generated name. + */ + delete: ( + resourceGroupName: string, + configurationGroupValueName: string, + options?: ConfigurationGroupValuesDeleteOptionalParams, + ) => PollerLike, void>; + /** @deprecated use delete instead */ + beginDelete: ( + resourceGroupName: string, + configurationGroupValueName: string, + options?: ConfigurationGroupValuesDeleteOptionalParams, + ) => Promise, void>>; + /** @deprecated use delete instead */ + beginDeleteAndWait: ( + resourceGroupName: string, + configurationGroupValueName: string, + options?: ConfigurationGroupValuesDeleteOptionalParams, + ) => Promise; + /** Updates a hybrid configuration group tags. */ + updateTags: ( + resourceGroupName: string, + configurationGroupValueName: string, + parameters: TagsObject, + options?: ConfigurationGroupValuesUpdateTagsOptionalParams, + ) => Promise; + /** Creates or updates a hybrid configuration group value. */ + createOrUpdate: ( + resourceGroupName: string, + configurationGroupValueName: string, + parameters: ConfigurationGroupValue, + options?: ConfigurationGroupValuesCreateOrUpdateOptionalParams, + ) => PollerLike, ConfigurationGroupValue>; + /** @deprecated use createOrUpdate instead */ + beginCreateOrUpdate: ( + resourceGroupName: string, + configurationGroupValueName: string, + parameters: ConfigurationGroupValue, + options?: ConfigurationGroupValuesCreateOrUpdateOptionalParams, + ) => Promise, ConfigurationGroupValue>>; + /** @deprecated use createOrUpdate instead */ + beginCreateOrUpdateAndWait: ( + resourceGroupName: string, + configurationGroupValueName: string, + parameters: ConfigurationGroupValue, + options?: ConfigurationGroupValuesCreateOrUpdateOptionalParams, + ) => Promise; + /** Gets information about the specified hybrid configuration group values. */ + get: ( + resourceGroupName: string, + configurationGroupValueName: string, + options?: ConfigurationGroupValuesGetOptionalParams, + ) => Promise; +} + +function _getConfigurationGroupValues(context: HybridNetworkManagementContext) { + return { + listBySubscription: (options?: ConfigurationGroupValuesListBySubscriptionOptionalParams) => + listBySubscription(context, options), + listByResourceGroup: ( + resourceGroupName: string, + options?: ConfigurationGroupValuesListByResourceGroupOptionalParams, + ) => listByResourceGroup(context, resourceGroupName, options), + delete: ( + resourceGroupName: string, + configurationGroupValueName: string, + options?: ConfigurationGroupValuesDeleteOptionalParams, + ) => $delete(context, resourceGroupName, configurationGroupValueName, options), + beginDelete: async ( + resourceGroupName: string, + configurationGroupValueName: string, + options?: ConfigurationGroupValuesDeleteOptionalParams, + ) => { + const poller = $delete(context, resourceGroupName, configurationGroupValueName, options); + await poller.submitted(); + return getSimplePoller(poller); + }, + beginDeleteAndWait: async ( + resourceGroupName: string, + configurationGroupValueName: string, + options?: ConfigurationGroupValuesDeleteOptionalParams, + ) => { + return await $delete(context, resourceGroupName, configurationGroupValueName, options); + }, + updateTags: ( + resourceGroupName: string, + configurationGroupValueName: string, + parameters: TagsObject, + options?: ConfigurationGroupValuesUpdateTagsOptionalParams, + ) => updateTags(context, resourceGroupName, configurationGroupValueName, parameters, options), + createOrUpdate: ( + resourceGroupName: string, + configurationGroupValueName: string, + parameters: ConfigurationGroupValue, + options?: ConfigurationGroupValuesCreateOrUpdateOptionalParams, + ) => + createOrUpdate(context, resourceGroupName, configurationGroupValueName, parameters, options), + beginCreateOrUpdate: async ( + resourceGroupName: string, + configurationGroupValueName: string, + parameters: ConfigurationGroupValue, + options?: ConfigurationGroupValuesCreateOrUpdateOptionalParams, + ) => { + const poller = createOrUpdate( + context, + resourceGroupName, + configurationGroupValueName, + parameters, + options, + ); + await poller.submitted(); + return getSimplePoller(poller); + }, + beginCreateOrUpdateAndWait: async ( + resourceGroupName: string, + configurationGroupValueName: string, + parameters: ConfigurationGroupValue, + options?: ConfigurationGroupValuesCreateOrUpdateOptionalParams, + ) => { + return await createOrUpdate( + context, + resourceGroupName, + configurationGroupValueName, + parameters, + options, + ); + }, + get: ( + resourceGroupName: string, + configurationGroupValueName: string, + options?: ConfigurationGroupValuesGetOptionalParams, + ) => get(context, resourceGroupName, configurationGroupValueName, options), + }; +} + +export function _getConfigurationGroupValuesOperations( + context: HybridNetworkManagementContext, +): ConfigurationGroupValuesOperations { + return { + ..._getConfigurationGroupValues(context), + }; +} diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/classic/index.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/classic/index.ts new file mode 100644 index 0000000000..486a5dc488 --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/classic/index.ts @@ -0,0 +1,18 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +export { ArtifactManifestsOperations } from "./artifactManifests/index.js"; +export { ArtifactStoresOperations } from "./artifactStores/index.js"; +export { ComponentsOperations } from "./components/index.js"; +export { ConfigurationGroupSchemasOperations } from "./configurationGroupSchemas/index.js"; +export { ConfigurationGroupValuesOperations } from "./configurationGroupValues/index.js"; +export { NetworkFunctionDefinitionGroupsOperations } from "./networkFunctionDefinitionGroups/index.js"; +export { NetworkFunctionDefinitionVersionsOperations } from "./networkFunctionDefinitionVersions/index.js"; +export { NetworkFunctionsOperations } from "./networkFunctions/index.js"; +export { NetworkServiceDesignGroupsOperations } from "./networkServiceDesignGroups/index.js"; +export { NetworkServiceDesignVersionsOperations } from "./networkServiceDesignVersions/index.js"; +export { OperationsOperations } from "./operations/index.js"; +export { ProxyArtifactOperations } from "./proxyArtifact/index.js"; +export { PublishersOperations } from "./publishers/index.js"; +export { SiteNetworkServicesOperations } from "./siteNetworkServices/index.js"; +export { SitesOperations } from "./sites/index.js"; diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/classic/networkFunctionDefinitionGroups/index.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/classic/networkFunctionDefinitionGroups/index.ts new file mode 100644 index 0000000000..9000b31aff --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/classic/networkFunctionDefinitionGroups/index.ts @@ -0,0 +1,231 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { HybridNetworkManagementContext } from "../../api/hybridNetworkManagementContext.js"; +import { + listByPublisher, + $delete, + update, + createOrUpdate, + get, +} from "../../api/networkFunctionDefinitionGroups/operations.js"; +import { + NetworkFunctionDefinitionGroupsListByPublisherOptionalParams, + NetworkFunctionDefinitionGroupsDeleteOptionalParams, + NetworkFunctionDefinitionGroupsUpdateOptionalParams, + NetworkFunctionDefinitionGroupsCreateOrUpdateOptionalParams, + NetworkFunctionDefinitionGroupsGetOptionalParams, +} from "../../api/networkFunctionDefinitionGroups/options.js"; +import { TagsObject, NetworkFunctionDefinitionGroup } from "../../models/models.js"; +import { PagedAsyncIterableIterator } from "../../static-helpers/pagingHelpers.js"; +import { SimplePollerLike, getSimplePoller } from "../../static-helpers/simplePollerHelpers.js"; +import { PollerLike, OperationState } from "@azure/core-lro"; + +/** Interface representing a NetworkFunctionDefinitionGroups operations. */ +export interface NetworkFunctionDefinitionGroupsOperations { + /** Gets information of the network function definition groups under a publisher. */ + listByPublisher: ( + resourceGroupName: string, + publisherName: string, + options?: NetworkFunctionDefinitionGroupsListByPublisherOptionalParams, + ) => PagedAsyncIterableIterator; + /** Deletes a specified network function definition group. */ + /** + * @fixme delete is a reserved word that cannot be used as an operation name. + * Please add @clientName("clientName") or @clientName("", "javascript") + * to the operation to override the generated name. + */ + delete: ( + resourceGroupName: string, + publisherName: string, + networkFunctionDefinitionGroupName: string, + options?: NetworkFunctionDefinitionGroupsDeleteOptionalParams, + ) => PollerLike, void>; + /** @deprecated use delete instead */ + beginDelete: ( + resourceGroupName: string, + publisherName: string, + networkFunctionDefinitionGroupName: string, + options?: NetworkFunctionDefinitionGroupsDeleteOptionalParams, + ) => Promise, void>>; + /** @deprecated use delete instead */ + beginDeleteAndWait: ( + resourceGroupName: string, + publisherName: string, + networkFunctionDefinitionGroupName: string, + options?: NetworkFunctionDefinitionGroupsDeleteOptionalParams, + ) => Promise; + /** Updates a network function definition group resource. */ + update: ( + resourceGroupName: string, + publisherName: string, + networkFunctionDefinitionGroupName: string, + parameters: TagsObject, + options?: NetworkFunctionDefinitionGroupsUpdateOptionalParams, + ) => Promise; + /** Creates or updates a network function definition group. */ + createOrUpdate: ( + resourceGroupName: string, + publisherName: string, + networkFunctionDefinitionGroupName: string, + parameters: NetworkFunctionDefinitionGroup, + options?: NetworkFunctionDefinitionGroupsCreateOrUpdateOptionalParams, + ) => PollerLike, NetworkFunctionDefinitionGroup>; + /** @deprecated use createOrUpdate instead */ + beginCreateOrUpdate: ( + resourceGroupName: string, + publisherName: string, + networkFunctionDefinitionGroupName: string, + parameters: NetworkFunctionDefinitionGroup, + options?: NetworkFunctionDefinitionGroupsCreateOrUpdateOptionalParams, + ) => Promise< + SimplePollerLike, NetworkFunctionDefinitionGroup> + >; + /** @deprecated use createOrUpdate instead */ + beginCreateOrUpdateAndWait: ( + resourceGroupName: string, + publisherName: string, + networkFunctionDefinitionGroupName: string, + parameters: NetworkFunctionDefinitionGroup, + options?: NetworkFunctionDefinitionGroupsCreateOrUpdateOptionalParams, + ) => Promise; + /** Gets information about the specified networkFunctionDefinition group. */ + get: ( + resourceGroupName: string, + publisherName: string, + networkFunctionDefinitionGroupName: string, + options?: NetworkFunctionDefinitionGroupsGetOptionalParams, + ) => Promise; +} + +function _getNetworkFunctionDefinitionGroups(context: HybridNetworkManagementContext) { + return { + listByPublisher: ( + resourceGroupName: string, + publisherName: string, + options?: NetworkFunctionDefinitionGroupsListByPublisherOptionalParams, + ) => listByPublisher(context, resourceGroupName, publisherName, options), + delete: ( + resourceGroupName: string, + publisherName: string, + networkFunctionDefinitionGroupName: string, + options?: NetworkFunctionDefinitionGroupsDeleteOptionalParams, + ) => + $delete( + context, + resourceGroupName, + publisherName, + networkFunctionDefinitionGroupName, + options, + ), + beginDelete: async ( + resourceGroupName: string, + publisherName: string, + networkFunctionDefinitionGroupName: string, + options?: NetworkFunctionDefinitionGroupsDeleteOptionalParams, + ) => { + const poller = $delete( + context, + resourceGroupName, + publisherName, + networkFunctionDefinitionGroupName, + options, + ); + await poller.submitted(); + return getSimplePoller(poller); + }, + beginDeleteAndWait: async ( + resourceGroupName: string, + publisherName: string, + networkFunctionDefinitionGroupName: string, + options?: NetworkFunctionDefinitionGroupsDeleteOptionalParams, + ) => { + return await $delete( + context, + resourceGroupName, + publisherName, + networkFunctionDefinitionGroupName, + options, + ); + }, + update: ( + resourceGroupName: string, + publisherName: string, + networkFunctionDefinitionGroupName: string, + parameters: TagsObject, + options?: NetworkFunctionDefinitionGroupsUpdateOptionalParams, + ) => + update( + context, + resourceGroupName, + publisherName, + networkFunctionDefinitionGroupName, + parameters, + options, + ), + createOrUpdate: ( + resourceGroupName: string, + publisherName: string, + networkFunctionDefinitionGroupName: string, + parameters: NetworkFunctionDefinitionGroup, + options?: NetworkFunctionDefinitionGroupsCreateOrUpdateOptionalParams, + ) => + createOrUpdate( + context, + resourceGroupName, + publisherName, + networkFunctionDefinitionGroupName, + parameters, + options, + ), + beginCreateOrUpdate: async ( + resourceGroupName: string, + publisherName: string, + networkFunctionDefinitionGroupName: string, + parameters: NetworkFunctionDefinitionGroup, + options?: NetworkFunctionDefinitionGroupsCreateOrUpdateOptionalParams, + ) => { + const poller = createOrUpdate( + context, + resourceGroupName, + publisherName, + networkFunctionDefinitionGroupName, + parameters, + options, + ); + await poller.submitted(); + return getSimplePoller(poller); + }, + beginCreateOrUpdateAndWait: async ( + resourceGroupName: string, + publisherName: string, + networkFunctionDefinitionGroupName: string, + parameters: NetworkFunctionDefinitionGroup, + options?: NetworkFunctionDefinitionGroupsCreateOrUpdateOptionalParams, + ) => { + return await createOrUpdate( + context, + resourceGroupName, + publisherName, + networkFunctionDefinitionGroupName, + parameters, + options, + ); + }, + get: ( + resourceGroupName: string, + publisherName: string, + networkFunctionDefinitionGroupName: string, + options?: NetworkFunctionDefinitionGroupsGetOptionalParams, + ) => + get(context, resourceGroupName, publisherName, networkFunctionDefinitionGroupName, options), + }; +} + +export function _getNetworkFunctionDefinitionGroupsOperations( + context: HybridNetworkManagementContext, +): NetworkFunctionDefinitionGroupsOperations { + return { + ..._getNetworkFunctionDefinitionGroups(context), + }; +} diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/classic/networkFunctionDefinitionVersions/index.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/classic/networkFunctionDefinitionVersions/index.ts new file mode 100644 index 0000000000..25ff3e78f5 --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/classic/networkFunctionDefinitionVersions/index.ts @@ -0,0 +1,372 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { HybridNetworkManagementContext } from "../../api/hybridNetworkManagementContext.js"; +import { + updateState, + listByNetworkFunctionDefinitionGroup, + $delete, + update, + createOrUpdate, + get, +} from "../../api/networkFunctionDefinitionVersions/operations.js"; +import { + NetworkFunctionDefinitionVersionsUpdateStateOptionalParams, + NetworkFunctionDefinitionVersionsListByNetworkFunctionDefinitionGroupOptionalParams, + NetworkFunctionDefinitionVersionsDeleteOptionalParams, + NetworkFunctionDefinitionVersionsUpdateOptionalParams, + NetworkFunctionDefinitionVersionsCreateOrUpdateOptionalParams, + NetworkFunctionDefinitionVersionsGetOptionalParams, +} from "../../api/networkFunctionDefinitionVersions/options.js"; +import { + TagsObject, + NetworkFunctionDefinitionVersion, + NetworkFunctionDefinitionVersionUpdateState, +} from "../../models/models.js"; +import { PagedAsyncIterableIterator } from "../../static-helpers/pagingHelpers.js"; +import { SimplePollerLike, getSimplePoller } from "../../static-helpers/simplePollerHelpers.js"; +import { PollerLike, OperationState } from "@azure/core-lro"; + +/** Interface representing a NetworkFunctionDefinitionVersions operations. */ +export interface NetworkFunctionDefinitionVersionsOperations { + /** Update network function definition version state. */ + updateState: ( + resourceGroupName: string, + publisherName: string, + networkFunctionDefinitionGroupName: string, + networkFunctionDefinitionVersionName: string, + parameters: NetworkFunctionDefinitionVersionUpdateState, + options?: NetworkFunctionDefinitionVersionsUpdateStateOptionalParams, + ) => PollerLike< + OperationState, + NetworkFunctionDefinitionVersionUpdateState + >; + /** @deprecated use updateState instead */ + beginUpdateState: ( + resourceGroupName: string, + publisherName: string, + networkFunctionDefinitionGroupName: string, + networkFunctionDefinitionVersionName: string, + parameters: NetworkFunctionDefinitionVersionUpdateState, + options?: NetworkFunctionDefinitionVersionsUpdateStateOptionalParams, + ) => Promise< + SimplePollerLike< + OperationState, + NetworkFunctionDefinitionVersionUpdateState + > + >; + /** @deprecated use updateState instead */ + beginUpdateStateAndWait: ( + resourceGroupName: string, + publisherName: string, + networkFunctionDefinitionGroupName: string, + networkFunctionDefinitionVersionName: string, + parameters: NetworkFunctionDefinitionVersionUpdateState, + options?: NetworkFunctionDefinitionVersionsUpdateStateOptionalParams, + ) => Promise; + /** Gets information about a list of network function definition versions under a network function definition group. */ + listByNetworkFunctionDefinitionGroup: ( + resourceGroupName: string, + publisherName: string, + networkFunctionDefinitionGroupName: string, + options?: NetworkFunctionDefinitionVersionsListByNetworkFunctionDefinitionGroupOptionalParams, + ) => PagedAsyncIterableIterator; + /** Deletes the specified network function definition version. */ + /** + * @fixme delete is a reserved word that cannot be used as an operation name. + * Please add @clientName("clientName") or @clientName("", "javascript") + * to the operation to override the generated name. + */ + delete: ( + resourceGroupName: string, + publisherName: string, + networkFunctionDefinitionGroupName: string, + networkFunctionDefinitionVersionName: string, + options?: NetworkFunctionDefinitionVersionsDeleteOptionalParams, + ) => PollerLike, void>; + /** @deprecated use delete instead */ + beginDelete: ( + resourceGroupName: string, + publisherName: string, + networkFunctionDefinitionGroupName: string, + networkFunctionDefinitionVersionName: string, + options?: NetworkFunctionDefinitionVersionsDeleteOptionalParams, + ) => Promise, void>>; + /** @deprecated use delete instead */ + beginDeleteAndWait: ( + resourceGroupName: string, + publisherName: string, + networkFunctionDefinitionGroupName: string, + networkFunctionDefinitionVersionName: string, + options?: NetworkFunctionDefinitionVersionsDeleteOptionalParams, + ) => Promise; + /** Updates a network function definition version resource. */ + update: ( + resourceGroupName: string, + publisherName: string, + networkFunctionDefinitionGroupName: string, + networkFunctionDefinitionVersionName: string, + parameters: TagsObject, + options?: NetworkFunctionDefinitionVersionsUpdateOptionalParams, + ) => Promise; + /** Creates or updates a network function definition version. */ + createOrUpdate: ( + resourceGroupName: string, + publisherName: string, + networkFunctionDefinitionGroupName: string, + networkFunctionDefinitionVersionName: string, + parameters: NetworkFunctionDefinitionVersion, + options?: NetworkFunctionDefinitionVersionsCreateOrUpdateOptionalParams, + ) => PollerLike< + OperationState, + NetworkFunctionDefinitionVersion + >; + /** @deprecated use createOrUpdate instead */ + beginCreateOrUpdate: ( + resourceGroupName: string, + publisherName: string, + networkFunctionDefinitionGroupName: string, + networkFunctionDefinitionVersionName: string, + parameters: NetworkFunctionDefinitionVersion, + options?: NetworkFunctionDefinitionVersionsCreateOrUpdateOptionalParams, + ) => Promise< + SimplePollerLike< + OperationState, + NetworkFunctionDefinitionVersion + > + >; + /** @deprecated use createOrUpdate instead */ + beginCreateOrUpdateAndWait: ( + resourceGroupName: string, + publisherName: string, + networkFunctionDefinitionGroupName: string, + networkFunctionDefinitionVersionName: string, + parameters: NetworkFunctionDefinitionVersion, + options?: NetworkFunctionDefinitionVersionsCreateOrUpdateOptionalParams, + ) => Promise; + /** Gets information about a network function definition version. */ + get: ( + resourceGroupName: string, + publisherName: string, + networkFunctionDefinitionGroupName: string, + networkFunctionDefinitionVersionName: string, + options?: NetworkFunctionDefinitionVersionsGetOptionalParams, + ) => Promise; +} + +function _getNetworkFunctionDefinitionVersions(context: HybridNetworkManagementContext) { + return { + updateState: ( + resourceGroupName: string, + publisherName: string, + networkFunctionDefinitionGroupName: string, + networkFunctionDefinitionVersionName: string, + parameters: NetworkFunctionDefinitionVersionUpdateState, + options?: NetworkFunctionDefinitionVersionsUpdateStateOptionalParams, + ) => + updateState( + context, + resourceGroupName, + publisherName, + networkFunctionDefinitionGroupName, + networkFunctionDefinitionVersionName, + parameters, + options, + ), + beginUpdateState: async ( + resourceGroupName: string, + publisherName: string, + networkFunctionDefinitionGroupName: string, + networkFunctionDefinitionVersionName: string, + parameters: NetworkFunctionDefinitionVersionUpdateState, + options?: NetworkFunctionDefinitionVersionsUpdateStateOptionalParams, + ) => { + const poller = updateState( + context, + resourceGroupName, + publisherName, + networkFunctionDefinitionGroupName, + networkFunctionDefinitionVersionName, + parameters, + options, + ); + await poller.submitted(); + return getSimplePoller(poller); + }, + beginUpdateStateAndWait: async ( + resourceGroupName: string, + publisherName: string, + networkFunctionDefinitionGroupName: string, + networkFunctionDefinitionVersionName: string, + parameters: NetworkFunctionDefinitionVersionUpdateState, + options?: NetworkFunctionDefinitionVersionsUpdateStateOptionalParams, + ) => { + return await updateState( + context, + resourceGroupName, + publisherName, + networkFunctionDefinitionGroupName, + networkFunctionDefinitionVersionName, + parameters, + options, + ); + }, + listByNetworkFunctionDefinitionGroup: ( + resourceGroupName: string, + publisherName: string, + networkFunctionDefinitionGroupName: string, + options?: NetworkFunctionDefinitionVersionsListByNetworkFunctionDefinitionGroupOptionalParams, + ) => + listByNetworkFunctionDefinitionGroup( + context, + resourceGroupName, + publisherName, + networkFunctionDefinitionGroupName, + options, + ), + delete: ( + resourceGroupName: string, + publisherName: string, + networkFunctionDefinitionGroupName: string, + networkFunctionDefinitionVersionName: string, + options?: NetworkFunctionDefinitionVersionsDeleteOptionalParams, + ) => + $delete( + context, + resourceGroupName, + publisherName, + networkFunctionDefinitionGroupName, + networkFunctionDefinitionVersionName, + options, + ), + beginDelete: async ( + resourceGroupName: string, + publisherName: string, + networkFunctionDefinitionGroupName: string, + networkFunctionDefinitionVersionName: string, + options?: NetworkFunctionDefinitionVersionsDeleteOptionalParams, + ) => { + const poller = $delete( + context, + resourceGroupName, + publisherName, + networkFunctionDefinitionGroupName, + networkFunctionDefinitionVersionName, + options, + ); + await poller.submitted(); + return getSimplePoller(poller); + }, + beginDeleteAndWait: async ( + resourceGroupName: string, + publisherName: string, + networkFunctionDefinitionGroupName: string, + networkFunctionDefinitionVersionName: string, + options?: NetworkFunctionDefinitionVersionsDeleteOptionalParams, + ) => { + return await $delete( + context, + resourceGroupName, + publisherName, + networkFunctionDefinitionGroupName, + networkFunctionDefinitionVersionName, + options, + ); + }, + update: ( + resourceGroupName: string, + publisherName: string, + networkFunctionDefinitionGroupName: string, + networkFunctionDefinitionVersionName: string, + parameters: TagsObject, + options?: NetworkFunctionDefinitionVersionsUpdateOptionalParams, + ) => + update( + context, + resourceGroupName, + publisherName, + networkFunctionDefinitionGroupName, + networkFunctionDefinitionVersionName, + parameters, + options, + ), + createOrUpdate: ( + resourceGroupName: string, + publisherName: string, + networkFunctionDefinitionGroupName: string, + networkFunctionDefinitionVersionName: string, + parameters: NetworkFunctionDefinitionVersion, + options?: NetworkFunctionDefinitionVersionsCreateOrUpdateOptionalParams, + ) => + createOrUpdate( + context, + resourceGroupName, + publisherName, + networkFunctionDefinitionGroupName, + networkFunctionDefinitionVersionName, + parameters, + options, + ), + beginCreateOrUpdate: async ( + resourceGroupName: string, + publisherName: string, + networkFunctionDefinitionGroupName: string, + networkFunctionDefinitionVersionName: string, + parameters: NetworkFunctionDefinitionVersion, + options?: NetworkFunctionDefinitionVersionsCreateOrUpdateOptionalParams, + ) => { + const poller = createOrUpdate( + context, + resourceGroupName, + publisherName, + networkFunctionDefinitionGroupName, + networkFunctionDefinitionVersionName, + parameters, + options, + ); + await poller.submitted(); + return getSimplePoller(poller); + }, + beginCreateOrUpdateAndWait: async ( + resourceGroupName: string, + publisherName: string, + networkFunctionDefinitionGroupName: string, + networkFunctionDefinitionVersionName: string, + parameters: NetworkFunctionDefinitionVersion, + options?: NetworkFunctionDefinitionVersionsCreateOrUpdateOptionalParams, + ) => { + return await createOrUpdate( + context, + resourceGroupName, + publisherName, + networkFunctionDefinitionGroupName, + networkFunctionDefinitionVersionName, + parameters, + options, + ); + }, + get: ( + resourceGroupName: string, + publisherName: string, + networkFunctionDefinitionGroupName: string, + networkFunctionDefinitionVersionName: string, + options?: NetworkFunctionDefinitionVersionsGetOptionalParams, + ) => + get( + context, + resourceGroupName, + publisherName, + networkFunctionDefinitionGroupName, + networkFunctionDefinitionVersionName, + options, + ), + }; +} + +export function _getNetworkFunctionDefinitionVersionsOperations( + context: HybridNetworkManagementContext, +): NetworkFunctionDefinitionVersionsOperations { + return { + ..._getNetworkFunctionDefinitionVersions(context), + }; +} diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/classic/networkFunctions/index.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/classic/networkFunctions/index.ts new file mode 100644 index 0000000000..95f5232a6c --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/classic/networkFunctions/index.ts @@ -0,0 +1,240 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { HybridNetworkManagementContext } from "../../api/hybridNetworkManagementContext.js"; +import { + executeRequest, + listBySubscription, + listByResourceGroup, + $delete, + updateTags, + createOrUpdate, + get, +} from "../../api/networkFunctions/operations.js"; +import { + NetworkFunctionsExecuteRequestOptionalParams, + NetworkFunctionsListBySubscriptionOptionalParams, + NetworkFunctionsListByResourceGroupOptionalParams, + NetworkFunctionsDeleteOptionalParams, + NetworkFunctionsUpdateTagsOptionalParams, + NetworkFunctionsCreateOrUpdateOptionalParams, + NetworkFunctionsGetOptionalParams, +} from "../../api/networkFunctions/options.js"; +import { TagsObject, NetworkFunction, ExecuteRequestParameters } from "../../models/models.js"; +import { PagedAsyncIterableIterator } from "../../static-helpers/pagingHelpers.js"; +import { SimplePollerLike, getSimplePoller } from "../../static-helpers/simplePollerHelpers.js"; +import { PollerLike, OperationState } from "@azure/core-lro"; + +/** Interface representing a NetworkFunctions operations. */ +export interface NetworkFunctionsOperations { + /** Execute a request to services on a containerized network function. */ + executeRequest: ( + resourceGroupName: string, + networkFunctionName: string, + parameters: ExecuteRequestParameters, + options?: NetworkFunctionsExecuteRequestOptionalParams, + ) => PollerLike, void>; + /** @deprecated use executeRequest instead */ + beginExecuteRequest: ( + resourceGroupName: string, + networkFunctionName: string, + parameters: ExecuteRequestParameters, + options?: NetworkFunctionsExecuteRequestOptionalParams, + ) => Promise, void>>; + /** @deprecated use executeRequest instead */ + beginExecuteRequestAndWait: ( + resourceGroupName: string, + networkFunctionName: string, + parameters: ExecuteRequestParameters, + options?: NetworkFunctionsExecuteRequestOptionalParams, + ) => Promise; + /** Lists all the network functions in a subscription. */ + listBySubscription: ( + options?: NetworkFunctionsListBySubscriptionOptionalParams, + ) => PagedAsyncIterableIterator; + /** Lists all the network function resources in a resource group. */ + listByResourceGroup: ( + resourceGroupName: string, + options?: NetworkFunctionsListByResourceGroupOptionalParams, + ) => PagedAsyncIterableIterator; + /** Deletes the specified network function resource. */ + /** + * @fixme delete is a reserved word that cannot be used as an operation name. + * Please add @clientName("clientName") or @clientName("", "javascript") + * to the operation to override the generated name. + */ + delete: ( + resourceGroupName: string, + networkFunctionName: string, + options?: NetworkFunctionsDeleteOptionalParams, + ) => PollerLike, void>; + /** @deprecated use delete instead */ + beginDelete: ( + resourceGroupName: string, + networkFunctionName: string, + options?: NetworkFunctionsDeleteOptionalParams, + ) => Promise, void>>; + /** @deprecated use delete instead */ + beginDeleteAndWait: ( + resourceGroupName: string, + networkFunctionName: string, + options?: NetworkFunctionsDeleteOptionalParams, + ) => Promise; + /** Updates the tags for the network function resource. */ + updateTags: ( + resourceGroupName: string, + networkFunctionName: string, + parameters: TagsObject, + options?: NetworkFunctionsUpdateTagsOptionalParams, + ) => Promise; + /** Creates or updates a network function resource. */ + createOrUpdate: ( + resourceGroupName: string, + networkFunctionName: string, + parameters: NetworkFunction, + options?: NetworkFunctionsCreateOrUpdateOptionalParams, + ) => PollerLike, NetworkFunction>; + /** @deprecated use createOrUpdate instead */ + beginCreateOrUpdate: ( + resourceGroupName: string, + networkFunctionName: string, + parameters: NetworkFunction, + options?: NetworkFunctionsCreateOrUpdateOptionalParams, + ) => Promise, NetworkFunction>>; + /** @deprecated use createOrUpdate instead */ + beginCreateOrUpdateAndWait: ( + resourceGroupName: string, + networkFunctionName: string, + parameters: NetworkFunction, + options?: NetworkFunctionsCreateOrUpdateOptionalParams, + ) => Promise; + /** Gets information about the specified network function resource. */ + get: ( + resourceGroupName: string, + networkFunctionName: string, + options?: NetworkFunctionsGetOptionalParams, + ) => Promise; +} + +function _getNetworkFunctions(context: HybridNetworkManagementContext) { + return { + executeRequest: ( + resourceGroupName: string, + networkFunctionName: string, + parameters: ExecuteRequestParameters, + options?: NetworkFunctionsExecuteRequestOptionalParams, + ) => executeRequest(context, resourceGroupName, networkFunctionName, parameters, options), + beginExecuteRequest: async ( + resourceGroupName: string, + networkFunctionName: string, + parameters: ExecuteRequestParameters, + options?: NetworkFunctionsExecuteRequestOptionalParams, + ) => { + const poller = executeRequest( + context, + resourceGroupName, + networkFunctionName, + parameters, + options, + ); + await poller.submitted(); + return getSimplePoller(poller); + }, + beginExecuteRequestAndWait: async ( + resourceGroupName: string, + networkFunctionName: string, + parameters: ExecuteRequestParameters, + options?: NetworkFunctionsExecuteRequestOptionalParams, + ) => { + return await executeRequest( + context, + resourceGroupName, + networkFunctionName, + parameters, + options, + ); + }, + listBySubscription: (options?: NetworkFunctionsListBySubscriptionOptionalParams) => + listBySubscription(context, options), + listByResourceGroup: ( + resourceGroupName: string, + options?: NetworkFunctionsListByResourceGroupOptionalParams, + ) => listByResourceGroup(context, resourceGroupName, options), + delete: ( + resourceGroupName: string, + networkFunctionName: string, + options?: NetworkFunctionsDeleteOptionalParams, + ) => $delete(context, resourceGroupName, networkFunctionName, options), + beginDelete: async ( + resourceGroupName: string, + networkFunctionName: string, + options?: NetworkFunctionsDeleteOptionalParams, + ) => { + const poller = $delete(context, resourceGroupName, networkFunctionName, options); + await poller.submitted(); + return getSimplePoller(poller); + }, + beginDeleteAndWait: async ( + resourceGroupName: string, + networkFunctionName: string, + options?: NetworkFunctionsDeleteOptionalParams, + ) => { + return await $delete(context, resourceGroupName, networkFunctionName, options); + }, + updateTags: ( + resourceGroupName: string, + networkFunctionName: string, + parameters: TagsObject, + options?: NetworkFunctionsUpdateTagsOptionalParams, + ) => updateTags(context, resourceGroupName, networkFunctionName, parameters, options), + createOrUpdate: ( + resourceGroupName: string, + networkFunctionName: string, + parameters: NetworkFunction, + options?: NetworkFunctionsCreateOrUpdateOptionalParams, + ) => createOrUpdate(context, resourceGroupName, networkFunctionName, parameters, options), + beginCreateOrUpdate: async ( + resourceGroupName: string, + networkFunctionName: string, + parameters: NetworkFunction, + options?: NetworkFunctionsCreateOrUpdateOptionalParams, + ) => { + const poller = createOrUpdate( + context, + resourceGroupName, + networkFunctionName, + parameters, + options, + ); + await poller.submitted(); + return getSimplePoller(poller); + }, + beginCreateOrUpdateAndWait: async ( + resourceGroupName: string, + networkFunctionName: string, + parameters: NetworkFunction, + options?: NetworkFunctionsCreateOrUpdateOptionalParams, + ) => { + return await createOrUpdate( + context, + resourceGroupName, + networkFunctionName, + parameters, + options, + ); + }, + get: ( + resourceGroupName: string, + networkFunctionName: string, + options?: NetworkFunctionsGetOptionalParams, + ) => get(context, resourceGroupName, networkFunctionName, options), + }; +} + +export function _getNetworkFunctionsOperations( + context: HybridNetworkManagementContext, +): NetworkFunctionsOperations { + return { + ..._getNetworkFunctions(context), + }; +} diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/classic/networkServiceDesignGroups/index.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/classic/networkServiceDesignGroups/index.ts new file mode 100644 index 0000000000..e0ff15f82d --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/classic/networkServiceDesignGroups/index.ts @@ -0,0 +1,223 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { HybridNetworkManagementContext } from "../../api/hybridNetworkManagementContext.js"; +import { + listByPublisher, + $delete, + update, + createOrUpdate, + get, +} from "../../api/networkServiceDesignGroups/operations.js"; +import { + NetworkServiceDesignGroupsListByPublisherOptionalParams, + NetworkServiceDesignGroupsDeleteOptionalParams, + NetworkServiceDesignGroupsUpdateOptionalParams, + NetworkServiceDesignGroupsCreateOrUpdateOptionalParams, + NetworkServiceDesignGroupsGetOptionalParams, +} from "../../api/networkServiceDesignGroups/options.js"; +import { TagsObject, NetworkServiceDesignGroup } from "../../models/models.js"; +import { PagedAsyncIterableIterator } from "../../static-helpers/pagingHelpers.js"; +import { SimplePollerLike, getSimplePoller } from "../../static-helpers/simplePollerHelpers.js"; +import { PollerLike, OperationState } from "@azure/core-lro"; + +/** Interface representing a NetworkServiceDesignGroups operations. */ +export interface NetworkServiceDesignGroupsOperations { + /** Gets information of the network service design groups under a publisher. */ + listByPublisher: ( + resourceGroupName: string, + publisherName: string, + options?: NetworkServiceDesignGroupsListByPublisherOptionalParams, + ) => PagedAsyncIterableIterator; + /** Deletes a specified network service design group. */ + /** + * @fixme delete is a reserved word that cannot be used as an operation name. + * Please add @clientName("clientName") or @clientName("", "javascript") + * to the operation to override the generated name. + */ + delete: ( + resourceGroupName: string, + publisherName: string, + networkServiceDesignGroupName: string, + options?: NetworkServiceDesignGroupsDeleteOptionalParams, + ) => PollerLike, void>; + /** @deprecated use delete instead */ + beginDelete: ( + resourceGroupName: string, + publisherName: string, + networkServiceDesignGroupName: string, + options?: NetworkServiceDesignGroupsDeleteOptionalParams, + ) => Promise, void>>; + /** @deprecated use delete instead */ + beginDeleteAndWait: ( + resourceGroupName: string, + publisherName: string, + networkServiceDesignGroupName: string, + options?: NetworkServiceDesignGroupsDeleteOptionalParams, + ) => Promise; + /** Updates a network service design groups resource. */ + update: ( + resourceGroupName: string, + publisherName: string, + networkServiceDesignGroupName: string, + parameters: TagsObject, + options?: NetworkServiceDesignGroupsUpdateOptionalParams, + ) => Promise; + /** Creates or updates a network service design group. */ + createOrUpdate: ( + resourceGroupName: string, + publisherName: string, + networkServiceDesignGroupName: string, + parameters: NetworkServiceDesignGroup, + options?: NetworkServiceDesignGroupsCreateOrUpdateOptionalParams, + ) => PollerLike, NetworkServiceDesignGroup>; + /** @deprecated use createOrUpdate instead */ + beginCreateOrUpdate: ( + resourceGroupName: string, + publisherName: string, + networkServiceDesignGroupName: string, + parameters: NetworkServiceDesignGroup, + options?: NetworkServiceDesignGroupsCreateOrUpdateOptionalParams, + ) => Promise< + SimplePollerLike, NetworkServiceDesignGroup> + >; + /** @deprecated use createOrUpdate instead */ + beginCreateOrUpdateAndWait: ( + resourceGroupName: string, + publisherName: string, + networkServiceDesignGroupName: string, + parameters: NetworkServiceDesignGroup, + options?: NetworkServiceDesignGroupsCreateOrUpdateOptionalParams, + ) => Promise; + /** Gets information about the specified networkServiceDesign group. */ + get: ( + resourceGroupName: string, + publisherName: string, + networkServiceDesignGroupName: string, + options?: NetworkServiceDesignGroupsGetOptionalParams, + ) => Promise; +} + +function _getNetworkServiceDesignGroups(context: HybridNetworkManagementContext) { + return { + listByPublisher: ( + resourceGroupName: string, + publisherName: string, + options?: NetworkServiceDesignGroupsListByPublisherOptionalParams, + ) => listByPublisher(context, resourceGroupName, publisherName, options), + delete: ( + resourceGroupName: string, + publisherName: string, + networkServiceDesignGroupName: string, + options?: NetworkServiceDesignGroupsDeleteOptionalParams, + ) => $delete(context, resourceGroupName, publisherName, networkServiceDesignGroupName, options), + beginDelete: async ( + resourceGroupName: string, + publisherName: string, + networkServiceDesignGroupName: string, + options?: NetworkServiceDesignGroupsDeleteOptionalParams, + ) => { + const poller = $delete( + context, + resourceGroupName, + publisherName, + networkServiceDesignGroupName, + options, + ); + await poller.submitted(); + return getSimplePoller(poller); + }, + beginDeleteAndWait: async ( + resourceGroupName: string, + publisherName: string, + networkServiceDesignGroupName: string, + options?: NetworkServiceDesignGroupsDeleteOptionalParams, + ) => { + return await $delete( + context, + resourceGroupName, + publisherName, + networkServiceDesignGroupName, + options, + ); + }, + update: ( + resourceGroupName: string, + publisherName: string, + networkServiceDesignGroupName: string, + parameters: TagsObject, + options?: NetworkServiceDesignGroupsUpdateOptionalParams, + ) => + update( + context, + resourceGroupName, + publisherName, + networkServiceDesignGroupName, + parameters, + options, + ), + createOrUpdate: ( + resourceGroupName: string, + publisherName: string, + networkServiceDesignGroupName: string, + parameters: NetworkServiceDesignGroup, + options?: NetworkServiceDesignGroupsCreateOrUpdateOptionalParams, + ) => + createOrUpdate( + context, + resourceGroupName, + publisherName, + networkServiceDesignGroupName, + parameters, + options, + ), + beginCreateOrUpdate: async ( + resourceGroupName: string, + publisherName: string, + networkServiceDesignGroupName: string, + parameters: NetworkServiceDesignGroup, + options?: NetworkServiceDesignGroupsCreateOrUpdateOptionalParams, + ) => { + const poller = createOrUpdate( + context, + resourceGroupName, + publisherName, + networkServiceDesignGroupName, + parameters, + options, + ); + await poller.submitted(); + return getSimplePoller(poller); + }, + beginCreateOrUpdateAndWait: async ( + resourceGroupName: string, + publisherName: string, + networkServiceDesignGroupName: string, + parameters: NetworkServiceDesignGroup, + options?: NetworkServiceDesignGroupsCreateOrUpdateOptionalParams, + ) => { + return await createOrUpdate( + context, + resourceGroupName, + publisherName, + networkServiceDesignGroupName, + parameters, + options, + ); + }, + get: ( + resourceGroupName: string, + publisherName: string, + networkServiceDesignGroupName: string, + options?: NetworkServiceDesignGroupsGetOptionalParams, + ) => get(context, resourceGroupName, publisherName, networkServiceDesignGroupName, options), + }; +} + +export function _getNetworkServiceDesignGroupsOperations( + context: HybridNetworkManagementContext, +): NetworkServiceDesignGroupsOperations { + return { + ..._getNetworkServiceDesignGroups(context), + }; +} diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/classic/networkServiceDesignVersions/index.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/classic/networkServiceDesignVersions/index.ts new file mode 100644 index 0000000000..27941cc230 --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/classic/networkServiceDesignVersions/index.ts @@ -0,0 +1,366 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { HybridNetworkManagementContext } from "../../api/hybridNetworkManagementContext.js"; +import { + updateState, + listByNetworkServiceDesignGroup, + $delete, + update, + createOrUpdate, + get, +} from "../../api/networkServiceDesignVersions/operations.js"; +import { + NetworkServiceDesignVersionsUpdateStateOptionalParams, + NetworkServiceDesignVersionsListByNetworkServiceDesignGroupOptionalParams, + NetworkServiceDesignVersionsDeleteOptionalParams, + NetworkServiceDesignVersionsUpdateOptionalParams, + NetworkServiceDesignVersionsCreateOrUpdateOptionalParams, + NetworkServiceDesignVersionsGetOptionalParams, +} from "../../api/networkServiceDesignVersions/options.js"; +import { + TagsObject, + NetworkServiceDesignVersion, + NetworkServiceDesignVersionUpdateState, +} from "../../models/models.js"; +import { PagedAsyncIterableIterator } from "../../static-helpers/pagingHelpers.js"; +import { SimplePollerLike, getSimplePoller } from "../../static-helpers/simplePollerHelpers.js"; +import { PollerLike, OperationState } from "@azure/core-lro"; + +/** Interface representing a NetworkServiceDesignVersions operations. */ +export interface NetworkServiceDesignVersionsOperations { + /** Update network service design version state. */ + updateState: ( + resourceGroupName: string, + publisherName: string, + networkServiceDesignGroupName: string, + networkServiceDesignVersionName: string, + parameters: NetworkServiceDesignVersionUpdateState, + options?: NetworkServiceDesignVersionsUpdateStateOptionalParams, + ) => PollerLike< + OperationState, + NetworkServiceDesignVersionUpdateState + >; + /** @deprecated use updateState instead */ + beginUpdateState: ( + resourceGroupName: string, + publisherName: string, + networkServiceDesignGroupName: string, + networkServiceDesignVersionName: string, + parameters: NetworkServiceDesignVersionUpdateState, + options?: NetworkServiceDesignVersionsUpdateStateOptionalParams, + ) => Promise< + SimplePollerLike< + OperationState, + NetworkServiceDesignVersionUpdateState + > + >; + /** @deprecated use updateState instead */ + beginUpdateStateAndWait: ( + resourceGroupName: string, + publisherName: string, + networkServiceDesignGroupName: string, + networkServiceDesignVersionName: string, + parameters: NetworkServiceDesignVersionUpdateState, + options?: NetworkServiceDesignVersionsUpdateStateOptionalParams, + ) => Promise; + /** Gets information about a list of network service design versions under a network service design group. */ + listByNetworkServiceDesignGroup: ( + resourceGroupName: string, + publisherName: string, + networkServiceDesignGroupName: string, + options?: NetworkServiceDesignVersionsListByNetworkServiceDesignGroupOptionalParams, + ) => PagedAsyncIterableIterator; + /** Deletes the specified network service design version. */ + /** + * @fixme delete is a reserved word that cannot be used as an operation name. + * Please add @clientName("clientName") or @clientName("", "javascript") + * to the operation to override the generated name. + */ + delete: ( + resourceGroupName: string, + publisherName: string, + networkServiceDesignGroupName: string, + networkServiceDesignVersionName: string, + options?: NetworkServiceDesignVersionsDeleteOptionalParams, + ) => PollerLike, void>; + /** @deprecated use delete instead */ + beginDelete: ( + resourceGroupName: string, + publisherName: string, + networkServiceDesignGroupName: string, + networkServiceDesignVersionName: string, + options?: NetworkServiceDesignVersionsDeleteOptionalParams, + ) => Promise, void>>; + /** @deprecated use delete instead */ + beginDeleteAndWait: ( + resourceGroupName: string, + publisherName: string, + networkServiceDesignGroupName: string, + networkServiceDesignVersionName: string, + options?: NetworkServiceDesignVersionsDeleteOptionalParams, + ) => Promise; + /** Updates a network service design version resource. */ + update: ( + resourceGroupName: string, + publisherName: string, + networkServiceDesignGroupName: string, + networkServiceDesignVersionName: string, + parameters: TagsObject, + options?: NetworkServiceDesignVersionsUpdateOptionalParams, + ) => Promise; + /** Creates or updates a network service design version. */ + createOrUpdate: ( + resourceGroupName: string, + publisherName: string, + networkServiceDesignGroupName: string, + networkServiceDesignVersionName: string, + parameters: NetworkServiceDesignVersion, + options?: NetworkServiceDesignVersionsCreateOrUpdateOptionalParams, + ) => PollerLike, NetworkServiceDesignVersion>; + /** @deprecated use createOrUpdate instead */ + beginCreateOrUpdate: ( + resourceGroupName: string, + publisherName: string, + networkServiceDesignGroupName: string, + networkServiceDesignVersionName: string, + parameters: NetworkServiceDesignVersion, + options?: NetworkServiceDesignVersionsCreateOrUpdateOptionalParams, + ) => Promise< + SimplePollerLike, NetworkServiceDesignVersion> + >; + /** @deprecated use createOrUpdate instead */ + beginCreateOrUpdateAndWait: ( + resourceGroupName: string, + publisherName: string, + networkServiceDesignGroupName: string, + networkServiceDesignVersionName: string, + parameters: NetworkServiceDesignVersion, + options?: NetworkServiceDesignVersionsCreateOrUpdateOptionalParams, + ) => Promise; + /** Gets information about a network service design version. */ + get: ( + resourceGroupName: string, + publisherName: string, + networkServiceDesignGroupName: string, + networkServiceDesignVersionName: string, + options?: NetworkServiceDesignVersionsGetOptionalParams, + ) => Promise; +} + +function _getNetworkServiceDesignVersions(context: HybridNetworkManagementContext) { + return { + updateState: ( + resourceGroupName: string, + publisherName: string, + networkServiceDesignGroupName: string, + networkServiceDesignVersionName: string, + parameters: NetworkServiceDesignVersionUpdateState, + options?: NetworkServiceDesignVersionsUpdateStateOptionalParams, + ) => + updateState( + context, + resourceGroupName, + publisherName, + networkServiceDesignGroupName, + networkServiceDesignVersionName, + parameters, + options, + ), + beginUpdateState: async ( + resourceGroupName: string, + publisherName: string, + networkServiceDesignGroupName: string, + networkServiceDesignVersionName: string, + parameters: NetworkServiceDesignVersionUpdateState, + options?: NetworkServiceDesignVersionsUpdateStateOptionalParams, + ) => { + const poller = updateState( + context, + resourceGroupName, + publisherName, + networkServiceDesignGroupName, + networkServiceDesignVersionName, + parameters, + options, + ); + await poller.submitted(); + return getSimplePoller(poller); + }, + beginUpdateStateAndWait: async ( + resourceGroupName: string, + publisherName: string, + networkServiceDesignGroupName: string, + networkServiceDesignVersionName: string, + parameters: NetworkServiceDesignVersionUpdateState, + options?: NetworkServiceDesignVersionsUpdateStateOptionalParams, + ) => { + return await updateState( + context, + resourceGroupName, + publisherName, + networkServiceDesignGroupName, + networkServiceDesignVersionName, + parameters, + options, + ); + }, + listByNetworkServiceDesignGroup: ( + resourceGroupName: string, + publisherName: string, + networkServiceDesignGroupName: string, + options?: NetworkServiceDesignVersionsListByNetworkServiceDesignGroupOptionalParams, + ) => + listByNetworkServiceDesignGroup( + context, + resourceGroupName, + publisherName, + networkServiceDesignGroupName, + options, + ), + delete: ( + resourceGroupName: string, + publisherName: string, + networkServiceDesignGroupName: string, + networkServiceDesignVersionName: string, + options?: NetworkServiceDesignVersionsDeleteOptionalParams, + ) => + $delete( + context, + resourceGroupName, + publisherName, + networkServiceDesignGroupName, + networkServiceDesignVersionName, + options, + ), + beginDelete: async ( + resourceGroupName: string, + publisherName: string, + networkServiceDesignGroupName: string, + networkServiceDesignVersionName: string, + options?: NetworkServiceDesignVersionsDeleteOptionalParams, + ) => { + const poller = $delete( + context, + resourceGroupName, + publisherName, + networkServiceDesignGroupName, + networkServiceDesignVersionName, + options, + ); + await poller.submitted(); + return getSimplePoller(poller); + }, + beginDeleteAndWait: async ( + resourceGroupName: string, + publisherName: string, + networkServiceDesignGroupName: string, + networkServiceDesignVersionName: string, + options?: NetworkServiceDesignVersionsDeleteOptionalParams, + ) => { + return await $delete( + context, + resourceGroupName, + publisherName, + networkServiceDesignGroupName, + networkServiceDesignVersionName, + options, + ); + }, + update: ( + resourceGroupName: string, + publisherName: string, + networkServiceDesignGroupName: string, + networkServiceDesignVersionName: string, + parameters: TagsObject, + options?: NetworkServiceDesignVersionsUpdateOptionalParams, + ) => + update( + context, + resourceGroupName, + publisherName, + networkServiceDesignGroupName, + networkServiceDesignVersionName, + parameters, + options, + ), + createOrUpdate: ( + resourceGroupName: string, + publisherName: string, + networkServiceDesignGroupName: string, + networkServiceDesignVersionName: string, + parameters: NetworkServiceDesignVersion, + options?: NetworkServiceDesignVersionsCreateOrUpdateOptionalParams, + ) => + createOrUpdate( + context, + resourceGroupName, + publisherName, + networkServiceDesignGroupName, + networkServiceDesignVersionName, + parameters, + options, + ), + beginCreateOrUpdate: async ( + resourceGroupName: string, + publisherName: string, + networkServiceDesignGroupName: string, + networkServiceDesignVersionName: string, + parameters: NetworkServiceDesignVersion, + options?: NetworkServiceDesignVersionsCreateOrUpdateOptionalParams, + ) => { + const poller = createOrUpdate( + context, + resourceGroupName, + publisherName, + networkServiceDesignGroupName, + networkServiceDesignVersionName, + parameters, + options, + ); + await poller.submitted(); + return getSimplePoller(poller); + }, + beginCreateOrUpdateAndWait: async ( + resourceGroupName: string, + publisherName: string, + networkServiceDesignGroupName: string, + networkServiceDesignVersionName: string, + parameters: NetworkServiceDesignVersion, + options?: NetworkServiceDesignVersionsCreateOrUpdateOptionalParams, + ) => { + return await createOrUpdate( + context, + resourceGroupName, + publisherName, + networkServiceDesignGroupName, + networkServiceDesignVersionName, + parameters, + options, + ); + }, + get: ( + resourceGroupName: string, + publisherName: string, + networkServiceDesignGroupName: string, + networkServiceDesignVersionName: string, + options?: NetworkServiceDesignVersionsGetOptionalParams, + ) => + get( + context, + resourceGroupName, + publisherName, + networkServiceDesignGroupName, + networkServiceDesignVersionName, + options, + ), + }; +} + +export function _getNetworkServiceDesignVersionsOperations( + context: HybridNetworkManagementContext, +): NetworkServiceDesignVersionsOperations { + return { + ..._getNetworkServiceDesignVersions(context), + }; +} diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/classic/operations/index.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/classic/operations/index.ts new file mode 100644 index 0000000000..a8442c2e2f --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/classic/operations/index.ts @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { HybridNetworkManagementContext } from "../../api/hybridNetworkManagementContext.js"; +import { list } from "../../api/operations/operations.js"; +import { OperationsListOptionalParams } from "../../api/operations/options.js"; +import { Operation } from "../../models/models.js"; +import { PagedAsyncIterableIterator } from "../../static-helpers/pagingHelpers.js"; + +/** Interface representing a Operations operations. */ +export interface OperationsOperations { + /** Gets a list of the operations. */ + list: (options?: OperationsListOptionalParams) => PagedAsyncIterableIterator; +} + +function _getOperations(context: HybridNetworkManagementContext) { + return { + list: (options?: OperationsListOptionalParams) => list(context, options), + }; +} + +export function _getOperationsOperations( + context: HybridNetworkManagementContext, +): OperationsOperations { + return { + ..._getOperations(context), + }; +} diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/classic/proxyArtifact/index.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/classic/proxyArtifact/index.ts new file mode 100644 index 0000000000..b1888a5906 --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/classic/proxyArtifact/index.ts @@ -0,0 +1,162 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { HybridNetworkManagementContext } from "../../api/hybridNetworkManagementContext.js"; +import { updateState, get, list } from "../../api/proxyArtifact/operations.js"; +import { + ProxyArtifactUpdateStateOptionalParams, + ProxyArtifactGetOptionalParams, + ProxyArtifactListOptionalParams, +} from "../../api/proxyArtifact/options.js"; +import { + ProxyArtifactListOverview, + ProxyArtifactVersionsListOverview, + ArtifactChangeState, +} from "../../models/models.js"; +import { PagedAsyncIterableIterator } from "../../static-helpers/pagingHelpers.js"; +import { SimplePollerLike, getSimplePoller } from "../../static-helpers/simplePollerHelpers.js"; +import { PollerLike, OperationState } from "@azure/core-lro"; + +/** Interface representing a ProxyArtifact operations. */ +export interface ProxyArtifactOperations { + /** Change artifact state defined in artifact store. */ + updateState: ( + resourceGroupName: string, + publisherName: string, + artifactStoreName: string, + artifactName: string, + artifactVersionName: string, + parameters: ArtifactChangeState, + options?: ProxyArtifactUpdateStateOptionalParams, + ) => PollerLike< + OperationState, + ProxyArtifactVersionsListOverview + >; + /** @deprecated use updateState instead */ + beginUpdateState: ( + resourceGroupName: string, + publisherName: string, + artifactStoreName: string, + artifactName: string, + artifactVersionName: string, + parameters: ArtifactChangeState, + options?: ProxyArtifactUpdateStateOptionalParams, + ) => Promise< + SimplePollerLike< + OperationState, + ProxyArtifactVersionsListOverview + > + >; + /** @deprecated use updateState instead */ + beginUpdateStateAndWait: ( + resourceGroupName: string, + publisherName: string, + artifactStoreName: string, + artifactName: string, + artifactVersionName: string, + parameters: ArtifactChangeState, + options?: ProxyArtifactUpdateStateOptionalParams, + ) => Promise; + /** Get a Artifact overview information. */ + get: ( + resourceGroupName: string, + publisherName: string, + artifactStoreName: string, + artifactName: string, + options?: ProxyArtifactGetOptionalParams, + ) => PagedAsyncIterableIterator; + /** Lists all the available artifacts in the parent Artifact Store. */ + list: ( + resourceGroupName: string, + publisherName: string, + artifactStoreName: string, + options?: ProxyArtifactListOptionalParams, + ) => PagedAsyncIterableIterator; +} + +function _getProxyArtifact(context: HybridNetworkManagementContext) { + return { + updateState: ( + resourceGroupName: string, + publisherName: string, + artifactStoreName: string, + artifactName: string, + artifactVersionName: string, + parameters: ArtifactChangeState, + options?: ProxyArtifactUpdateStateOptionalParams, + ) => + updateState( + context, + resourceGroupName, + publisherName, + artifactStoreName, + artifactName, + artifactVersionName, + parameters, + options, + ), + beginUpdateState: async ( + resourceGroupName: string, + publisherName: string, + artifactStoreName: string, + artifactName: string, + artifactVersionName: string, + parameters: ArtifactChangeState, + options?: ProxyArtifactUpdateStateOptionalParams, + ) => { + const poller = updateState( + context, + resourceGroupName, + publisherName, + artifactStoreName, + artifactName, + artifactVersionName, + parameters, + options, + ); + await poller.submitted(); + return getSimplePoller(poller); + }, + beginUpdateStateAndWait: async ( + resourceGroupName: string, + publisherName: string, + artifactStoreName: string, + artifactName: string, + artifactVersionName: string, + parameters: ArtifactChangeState, + options?: ProxyArtifactUpdateStateOptionalParams, + ) => { + return await updateState( + context, + resourceGroupName, + publisherName, + artifactStoreName, + artifactName, + artifactVersionName, + parameters, + options, + ); + }, + get: ( + resourceGroupName: string, + publisherName: string, + artifactStoreName: string, + artifactName: string, + options?: ProxyArtifactGetOptionalParams, + ) => get(context, resourceGroupName, publisherName, artifactStoreName, artifactName, options), + list: ( + resourceGroupName: string, + publisherName: string, + artifactStoreName: string, + options?: ProxyArtifactListOptionalParams, + ) => list(context, resourceGroupName, publisherName, artifactStoreName, options), + }; +} + +export function _getProxyArtifactOperations( + context: HybridNetworkManagementContext, +): ProxyArtifactOperations { + return { + ..._getProxyArtifact(context), + }; +} diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/classic/publishers/index.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/classic/publishers/index.ts new file mode 100644 index 0000000000..e4b630ad2f --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/classic/publishers/index.ts @@ -0,0 +1,161 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { HybridNetworkManagementContext } from "../../api/hybridNetworkManagementContext.js"; +import { + listBySubscription, + listByResourceGroup, + $delete, + update, + createOrUpdate, + get, +} from "../../api/publishers/operations.js"; +import { + PublishersListBySubscriptionOptionalParams, + PublishersListByResourceGroupOptionalParams, + PublishersDeleteOptionalParams, + PublishersUpdateOptionalParams, + PublishersCreateOrUpdateOptionalParams, + PublishersGetOptionalParams, +} from "../../api/publishers/options.js"; +import { Publisher } from "../../models/models.js"; +import { PagedAsyncIterableIterator } from "../../static-helpers/pagingHelpers.js"; +import { SimplePollerLike, getSimplePoller } from "../../static-helpers/simplePollerHelpers.js"; +import { PollerLike, OperationState } from "@azure/core-lro"; + +/** Interface representing a Publishers operations. */ +export interface PublishersOperations { + /** Lists all the publishers in a subscription. */ + listBySubscription: ( + options?: PublishersListBySubscriptionOptionalParams, + ) => PagedAsyncIterableIterator; + /** Lists all the publishers in a resource group. */ + listByResourceGroup: ( + resourceGroupName: string, + options?: PublishersListByResourceGroupOptionalParams, + ) => PagedAsyncIterableIterator; + /** Deletes the specified publisher. */ + /** + * @fixme delete is a reserved word that cannot be used as an operation name. + * Please add @clientName("clientName") or @clientName("", "javascript") + * to the operation to override the generated name. + */ + delete: ( + resourceGroupName: string, + publisherName: string, + options?: PublishersDeleteOptionalParams, + ) => PollerLike, void>; + /** @deprecated use delete instead */ + beginDelete: ( + resourceGroupName: string, + publisherName: string, + options?: PublishersDeleteOptionalParams, + ) => Promise, void>>; + /** @deprecated use delete instead */ + beginDeleteAndWait: ( + resourceGroupName: string, + publisherName: string, + options?: PublishersDeleteOptionalParams, + ) => Promise; + /** Update a publisher resource. */ + update: ( + resourceGroupName: string, + publisherName: string, + options?: PublishersUpdateOptionalParams, + ) => Promise; + /** Creates or updates a publisher. */ + createOrUpdate: ( + resourceGroupName: string, + publisherName: string, + options?: PublishersCreateOrUpdateOptionalParams, + ) => PollerLike, Publisher>; + /** @deprecated use createOrUpdate instead */ + beginCreateOrUpdate: ( + resourceGroupName: string, + publisherName: string, + options?: PublishersCreateOrUpdateOptionalParams, + ) => Promise, Publisher>>; + /** @deprecated use createOrUpdate instead */ + beginCreateOrUpdateAndWait: ( + resourceGroupName: string, + publisherName: string, + options?: PublishersCreateOrUpdateOptionalParams, + ) => Promise; + /** Gets information about the specified publisher. */ + get: ( + resourceGroupName: string, + publisherName: string, + options?: PublishersGetOptionalParams, + ) => Promise; +} + +function _getPublishers(context: HybridNetworkManagementContext) { + return { + listBySubscription: (options?: PublishersListBySubscriptionOptionalParams) => + listBySubscription(context, options), + listByResourceGroup: ( + resourceGroupName: string, + options?: PublishersListByResourceGroupOptionalParams, + ) => listByResourceGroup(context, resourceGroupName, options), + delete: ( + resourceGroupName: string, + publisherName: string, + options?: PublishersDeleteOptionalParams, + ) => $delete(context, resourceGroupName, publisherName, options), + beginDelete: async ( + resourceGroupName: string, + publisherName: string, + options?: PublishersDeleteOptionalParams, + ) => { + const poller = $delete(context, resourceGroupName, publisherName, options); + await poller.submitted(); + return getSimplePoller(poller); + }, + beginDeleteAndWait: async ( + resourceGroupName: string, + publisherName: string, + options?: PublishersDeleteOptionalParams, + ) => { + return await $delete(context, resourceGroupName, publisherName, options); + }, + update: ( + resourceGroupName: string, + publisherName: string, + options?: PublishersUpdateOptionalParams, + ) => update(context, resourceGroupName, publisherName, options), + createOrUpdate: ( + resourceGroupName: string, + publisherName: string, + options?: PublishersCreateOrUpdateOptionalParams, + ) => createOrUpdate(context, resourceGroupName, publisherName, options), + beginCreateOrUpdate: async ( + resourceGroupName: string, + publisherName: string, + options?: PublishersCreateOrUpdateOptionalParams, + ) => { + const poller = createOrUpdate(context, resourceGroupName, publisherName, options); + await poller.submitted(); + return getSimplePoller(poller); + }, + beginCreateOrUpdateAndWait: async ( + resourceGroupName: string, + publisherName: string, + options?: PublishersCreateOrUpdateOptionalParams, + ) => { + return await createOrUpdate(context, resourceGroupName, publisherName, options); + }, + get: ( + resourceGroupName: string, + publisherName: string, + options?: PublishersGetOptionalParams, + ) => get(context, resourceGroupName, publisherName, options), + }; +} + +export function _getPublishersOperations( + context: HybridNetworkManagementContext, +): PublishersOperations { + return { + ..._getPublishers(context), + }; +} diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/classic/siteNetworkServices/index.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/classic/siteNetworkServices/index.ts new file mode 100644 index 0000000000..f71752b5e9 --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/classic/siteNetworkServices/index.ts @@ -0,0 +1,216 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { HybridNetworkManagementContext } from "../../api/hybridNetworkManagementContext.js"; +import { + cancelOperation, + listBySubscription, + listByResourceGroup, + $delete, + updateTags, + createOrUpdate, + get, +} from "../../api/siteNetworkServices/operations.js"; +import { + SiteNetworkServicesCancelOperationOptionalParams, + SiteNetworkServicesListBySubscriptionOptionalParams, + SiteNetworkServicesListByResourceGroupOptionalParams, + SiteNetworkServicesDeleteOptionalParams, + SiteNetworkServicesUpdateTagsOptionalParams, + SiteNetworkServicesCreateOrUpdateOptionalParams, + SiteNetworkServicesGetOptionalParams, +} from "../../api/siteNetworkServices/options.js"; +import { TagsObject, SiteNetworkService, CancelInformation } from "../../models/models.js"; +import { PagedAsyncIterableIterator } from "../../static-helpers/pagingHelpers.js"; +import { SimplePollerLike, getSimplePoller } from "../../static-helpers/simplePollerHelpers.js"; +import { PollerLike, OperationState } from "@azure/core-lro"; + +/** Interface representing a SiteNetworkServices operations. */ +export interface SiteNetworkServicesOperations { + /** Cancels an ongoing long-running PUT operation for the specified Site Network Service resource. Other operations are not supported for cancellation at this time. */ + cancelOperation: ( + parameters: CancelInformation, + options?: SiteNetworkServicesCancelOperationOptionalParams, + ) => PollerLike, void>; + /** @deprecated use cancelOperation instead */ + beginCancelOperation: ( + parameters: CancelInformation, + options?: SiteNetworkServicesCancelOperationOptionalParams, + ) => Promise, void>>; + /** @deprecated use cancelOperation instead */ + beginCancelOperationAndWait: ( + parameters: CancelInformation, + options?: SiteNetworkServicesCancelOperationOptionalParams, + ) => Promise; + /** Lists all sites in the network service in a subscription. */ + listBySubscription: ( + options?: SiteNetworkServicesListBySubscriptionOptionalParams, + ) => PagedAsyncIterableIterator; + /** Lists all site network services. */ + listByResourceGroup: ( + resourceGroupName: string, + options?: SiteNetworkServicesListByResourceGroupOptionalParams, + ) => PagedAsyncIterableIterator; + /** Deletes the specified site network service. */ + /** + * @fixme delete is a reserved word that cannot be used as an operation name. + * Please add @clientName("clientName") or @clientName("", "javascript") + * to the operation to override the generated name. + */ + delete: ( + resourceGroupName: string, + siteNetworkServiceName: string, + options?: SiteNetworkServicesDeleteOptionalParams, + ) => PollerLike, void>; + /** @deprecated use delete instead */ + beginDelete: ( + resourceGroupName: string, + siteNetworkServiceName: string, + options?: SiteNetworkServicesDeleteOptionalParams, + ) => Promise, void>>; + /** @deprecated use delete instead */ + beginDeleteAndWait: ( + resourceGroupName: string, + siteNetworkServiceName: string, + options?: SiteNetworkServicesDeleteOptionalParams, + ) => Promise; + /** Updates a site update tags. */ + updateTags: ( + resourceGroupName: string, + siteNetworkServiceName: string, + parameters: TagsObject, + options?: SiteNetworkServicesUpdateTagsOptionalParams, + ) => Promise; + /** Creates or updates a network site. */ + createOrUpdate: ( + resourceGroupName: string, + siteNetworkServiceName: string, + parameters: SiteNetworkService, + options?: SiteNetworkServicesCreateOrUpdateOptionalParams, + ) => PollerLike, SiteNetworkService>; + /** @deprecated use createOrUpdate instead */ + beginCreateOrUpdate: ( + resourceGroupName: string, + siteNetworkServiceName: string, + parameters: SiteNetworkService, + options?: SiteNetworkServicesCreateOrUpdateOptionalParams, + ) => Promise, SiteNetworkService>>; + /** @deprecated use createOrUpdate instead */ + beginCreateOrUpdateAndWait: ( + resourceGroupName: string, + siteNetworkServiceName: string, + parameters: SiteNetworkService, + options?: SiteNetworkServicesCreateOrUpdateOptionalParams, + ) => Promise; + /** Gets information about the specified site network service. */ + get: ( + resourceGroupName: string, + siteNetworkServiceName: string, + options?: SiteNetworkServicesGetOptionalParams, + ) => Promise; +} + +function _getSiteNetworkServices(context: HybridNetworkManagementContext) { + return { + cancelOperation: ( + parameters: CancelInformation, + options?: SiteNetworkServicesCancelOperationOptionalParams, + ) => cancelOperation(context, parameters, options), + beginCancelOperation: async ( + parameters: CancelInformation, + options?: SiteNetworkServicesCancelOperationOptionalParams, + ) => { + const poller = cancelOperation(context, parameters, options); + await poller.submitted(); + return getSimplePoller(poller); + }, + beginCancelOperationAndWait: async ( + parameters: CancelInformation, + options?: SiteNetworkServicesCancelOperationOptionalParams, + ) => { + return await cancelOperation(context, parameters, options); + }, + listBySubscription: (options?: SiteNetworkServicesListBySubscriptionOptionalParams) => + listBySubscription(context, options), + listByResourceGroup: ( + resourceGroupName: string, + options?: SiteNetworkServicesListByResourceGroupOptionalParams, + ) => listByResourceGroup(context, resourceGroupName, options), + delete: ( + resourceGroupName: string, + siteNetworkServiceName: string, + options?: SiteNetworkServicesDeleteOptionalParams, + ) => $delete(context, resourceGroupName, siteNetworkServiceName, options), + beginDelete: async ( + resourceGroupName: string, + siteNetworkServiceName: string, + options?: SiteNetworkServicesDeleteOptionalParams, + ) => { + const poller = $delete(context, resourceGroupName, siteNetworkServiceName, options); + await poller.submitted(); + return getSimplePoller(poller); + }, + beginDeleteAndWait: async ( + resourceGroupName: string, + siteNetworkServiceName: string, + options?: SiteNetworkServicesDeleteOptionalParams, + ) => { + return await $delete(context, resourceGroupName, siteNetworkServiceName, options); + }, + updateTags: ( + resourceGroupName: string, + siteNetworkServiceName: string, + parameters: TagsObject, + options?: SiteNetworkServicesUpdateTagsOptionalParams, + ) => updateTags(context, resourceGroupName, siteNetworkServiceName, parameters, options), + createOrUpdate: ( + resourceGroupName: string, + siteNetworkServiceName: string, + parameters: SiteNetworkService, + options?: SiteNetworkServicesCreateOrUpdateOptionalParams, + ) => createOrUpdate(context, resourceGroupName, siteNetworkServiceName, parameters, options), + beginCreateOrUpdate: async ( + resourceGroupName: string, + siteNetworkServiceName: string, + parameters: SiteNetworkService, + options?: SiteNetworkServicesCreateOrUpdateOptionalParams, + ) => { + const poller = createOrUpdate( + context, + resourceGroupName, + siteNetworkServiceName, + parameters, + options, + ); + await poller.submitted(); + return getSimplePoller(poller); + }, + beginCreateOrUpdateAndWait: async ( + resourceGroupName: string, + siteNetworkServiceName: string, + parameters: SiteNetworkService, + options?: SiteNetworkServicesCreateOrUpdateOptionalParams, + ) => { + return await createOrUpdate( + context, + resourceGroupName, + siteNetworkServiceName, + parameters, + options, + ); + }, + get: ( + resourceGroupName: string, + siteNetworkServiceName: string, + options?: SiteNetworkServicesGetOptionalParams, + ) => get(context, resourceGroupName, siteNetworkServiceName, options), + }; +} + +export function _getSiteNetworkServicesOperations( + context: HybridNetworkManagementContext, +): SiteNetworkServicesOperations { + return { + ..._getSiteNetworkServices(context), + }; +} diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/classic/sites/index.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/classic/sites/index.ts new file mode 100644 index 0000000000..9a07cafda9 --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/classic/sites/index.ts @@ -0,0 +1,161 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { HybridNetworkManagementContext } from "../../api/hybridNetworkManagementContext.js"; +import { + listBySubscription, + listByResourceGroup, + $delete, + updateTags, + createOrUpdate, + get, +} from "../../api/sites/operations.js"; +import { + SitesListBySubscriptionOptionalParams, + SitesListByResourceGroupOptionalParams, + SitesDeleteOptionalParams, + SitesUpdateTagsOptionalParams, + SitesCreateOrUpdateOptionalParams, + SitesGetOptionalParams, +} from "../../api/sites/options.js"; +import { TagsObject, Site } from "../../models/models.js"; +import { PagedAsyncIterableIterator } from "../../static-helpers/pagingHelpers.js"; +import { SimplePollerLike, getSimplePoller } from "../../static-helpers/simplePollerHelpers.js"; +import { PollerLike, OperationState } from "@azure/core-lro"; + +/** Interface representing a Sites operations. */ +export interface SitesOperations { + /** Lists all sites in the network service in a subscription. */ + listBySubscription: ( + options?: SitesListBySubscriptionOptionalParams, + ) => PagedAsyncIterableIterator; + /** Lists all sites in the network service. */ + listByResourceGroup: ( + resourceGroupName: string, + options?: SitesListByResourceGroupOptionalParams, + ) => PagedAsyncIterableIterator; + /** Deletes the specified network site. */ + /** + * @fixme delete is a reserved word that cannot be used as an operation name. + * Please add @clientName("clientName") or @clientName("", "javascript") + * to the operation to override the generated name. + */ + delete: ( + resourceGroupName: string, + siteName: string, + options?: SitesDeleteOptionalParams, + ) => PollerLike, void>; + /** @deprecated use delete instead */ + beginDelete: ( + resourceGroupName: string, + siteName: string, + options?: SitesDeleteOptionalParams, + ) => Promise, void>>; + /** @deprecated use delete instead */ + beginDeleteAndWait: ( + resourceGroupName: string, + siteName: string, + options?: SitesDeleteOptionalParams, + ) => Promise; + /** Updates a site update tags. */ + updateTags: ( + resourceGroupName: string, + siteName: string, + parameters: TagsObject, + options?: SitesUpdateTagsOptionalParams, + ) => Promise; + /** Creates or updates a network site. */ + createOrUpdate: ( + resourceGroupName: string, + siteName: string, + parameters: Site, + options?: SitesCreateOrUpdateOptionalParams, + ) => PollerLike, Site>; + /** @deprecated use createOrUpdate instead */ + beginCreateOrUpdate: ( + resourceGroupName: string, + siteName: string, + parameters: Site, + options?: SitesCreateOrUpdateOptionalParams, + ) => Promise, Site>>; + /** @deprecated use createOrUpdate instead */ + beginCreateOrUpdateAndWait: ( + resourceGroupName: string, + siteName: string, + parameters: Site, + options?: SitesCreateOrUpdateOptionalParams, + ) => Promise; + /** Gets information about the specified network site. */ + get: ( + resourceGroupName: string, + siteName: string, + options?: SitesGetOptionalParams, + ) => Promise; +} + +function _getSites(context: HybridNetworkManagementContext) { + return { + listBySubscription: (options?: SitesListBySubscriptionOptionalParams) => + listBySubscription(context, options), + listByResourceGroup: ( + resourceGroupName: string, + options?: SitesListByResourceGroupOptionalParams, + ) => listByResourceGroup(context, resourceGroupName, options), + delete: (resourceGroupName: string, siteName: string, options?: SitesDeleteOptionalParams) => + $delete(context, resourceGroupName, siteName, options), + beginDelete: async ( + resourceGroupName: string, + siteName: string, + options?: SitesDeleteOptionalParams, + ) => { + const poller = $delete(context, resourceGroupName, siteName, options); + await poller.submitted(); + return getSimplePoller(poller); + }, + beginDeleteAndWait: async ( + resourceGroupName: string, + siteName: string, + options?: SitesDeleteOptionalParams, + ) => { + return await $delete(context, resourceGroupName, siteName, options); + }, + updateTags: ( + resourceGroupName: string, + siteName: string, + parameters: TagsObject, + options?: SitesUpdateTagsOptionalParams, + ) => updateTags(context, resourceGroupName, siteName, parameters, options), + createOrUpdate: ( + resourceGroupName: string, + siteName: string, + parameters: Site, + options?: SitesCreateOrUpdateOptionalParams, + ) => createOrUpdate(context, resourceGroupName, siteName, parameters, options), + beginCreateOrUpdate: async ( + resourceGroupName: string, + siteName: string, + parameters: Site, + options?: SitesCreateOrUpdateOptionalParams, + ) => { + const poller = createOrUpdate(context, resourceGroupName, siteName, parameters, options); + await poller.submitted(); + return getSimplePoller(poller); + }, + beginCreateOrUpdateAndWait: async ( + resourceGroupName: string, + siteName: string, + parameters: Site, + options?: SitesCreateOrUpdateOptionalParams, + ) => { + return await createOrUpdate(context, resourceGroupName, siteName, parameters, options); + }, + get: (resourceGroupName: string, siteName: string, options?: SitesGetOptionalParams) => + get(context, resourceGroupName, siteName, options), + }; +} + +export function _getSitesOperations(context: HybridNetworkManagementContext): SitesOperations { + return { + ..._getSites(context), + }; +} diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/hybridNetworkManagementClient.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/hybridNetworkManagementClient.ts new file mode 100644 index 0000000000..546efa69b8 --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/hybridNetworkManagementClient.ts @@ -0,0 +1,132 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { + createHybridNetworkManagement, + HybridNetworkManagementContext, + HybridNetworkManagementClientOptionalParams, +} from "./api/index.js"; +import { + ArtifactManifestsOperations, + _getArtifactManifestsOperations, +} from "./classic/artifactManifests/index.js"; +import { + ArtifactStoresOperations, + _getArtifactStoresOperations, +} from "./classic/artifactStores/index.js"; +import { ComponentsOperations, _getComponentsOperations } from "./classic/components/index.js"; +import { + ConfigurationGroupSchemasOperations, + _getConfigurationGroupSchemasOperations, +} from "./classic/configurationGroupSchemas/index.js"; +import { + ConfigurationGroupValuesOperations, + _getConfigurationGroupValuesOperations, +} from "./classic/configurationGroupValues/index.js"; +import { + NetworkFunctionDefinitionGroupsOperations, + _getNetworkFunctionDefinitionGroupsOperations, +} from "./classic/networkFunctionDefinitionGroups/index.js"; +import { + NetworkFunctionDefinitionVersionsOperations, + _getNetworkFunctionDefinitionVersionsOperations, +} from "./classic/networkFunctionDefinitionVersions/index.js"; +import { + NetworkFunctionsOperations, + _getNetworkFunctionsOperations, +} from "./classic/networkFunctions/index.js"; +import { + NetworkServiceDesignGroupsOperations, + _getNetworkServiceDesignGroupsOperations, +} from "./classic/networkServiceDesignGroups/index.js"; +import { + NetworkServiceDesignVersionsOperations, + _getNetworkServiceDesignVersionsOperations, +} from "./classic/networkServiceDesignVersions/index.js"; +import { OperationsOperations, _getOperationsOperations } from "./classic/operations/index.js"; +import { + ProxyArtifactOperations, + _getProxyArtifactOperations, +} from "./classic/proxyArtifact/index.js"; +import { PublishersOperations, _getPublishersOperations } from "./classic/publishers/index.js"; +import { + SiteNetworkServicesOperations, + _getSiteNetworkServicesOperations, +} from "./classic/siteNetworkServices/index.js"; +import { SitesOperations, _getSitesOperations } from "./classic/sites/index.js"; +import { TokenCredential } from "@azure/core-auth"; +import { Pipeline } from "@azure/core-rest-pipeline"; + +export { HybridNetworkManagementClientOptionalParams } from "./api/hybridNetworkManagementContext.js"; + +export class HybridNetworkManagementClient { + private _client: HybridNetworkManagementContext; + /** The pipeline used by this client to make requests */ + public readonly pipeline: Pipeline; + + constructor( + credential: TokenCredential, + subscriptionId: string, + options: HybridNetworkManagementClientOptionalParams = {}, + ) { + const prefixFromOptions = options?.userAgentOptions?.userAgentPrefix; + const userAgentPrefix = prefixFromOptions + ? `${prefixFromOptions} azsdk-js-client` + : `azsdk-js-client`; + this._client = createHybridNetworkManagement(credential, subscriptionId, { + ...options, + userAgentOptions: { userAgentPrefix }, + }); + this.pipeline = this._client.pipeline; + this.siteNetworkServices = _getSiteNetworkServicesOperations(this._client); + this.sites = _getSitesOperations(this._client); + this.artifactManifests = _getArtifactManifestsOperations(this._client); + this.proxyArtifact = _getProxyArtifactOperations(this._client); + this.artifactStores = _getArtifactStoresOperations(this._client); + this.networkServiceDesignVersions = _getNetworkServiceDesignVersionsOperations(this._client); + this.networkServiceDesignGroups = _getNetworkServiceDesignGroupsOperations(this._client); + this.networkFunctionDefinitionVersions = _getNetworkFunctionDefinitionVersionsOperations( + this._client, + ); + this.networkFunctionDefinitionGroups = _getNetworkFunctionDefinitionGroupsOperations( + this._client, + ); + this.components = _getComponentsOperations(this._client); + this.networkFunctions = _getNetworkFunctionsOperations(this._client); + this.configurationGroupValues = _getConfigurationGroupValuesOperations(this._client); + this.publishers = _getPublishersOperations(this._client); + this.configurationGroupSchemas = _getConfigurationGroupSchemasOperations(this._client); + this.operations = _getOperationsOperations(this._client); + } + + /** The operation groups for siteNetworkServices */ + public readonly siteNetworkServices: SiteNetworkServicesOperations; + /** The operation groups for sites */ + public readonly sites: SitesOperations; + /** The operation groups for artifactManifests */ + public readonly artifactManifests: ArtifactManifestsOperations; + /** The operation groups for proxyArtifact */ + public readonly proxyArtifact: ProxyArtifactOperations; + /** The operation groups for artifactStores */ + public readonly artifactStores: ArtifactStoresOperations; + /** The operation groups for networkServiceDesignVersions */ + public readonly networkServiceDesignVersions: NetworkServiceDesignVersionsOperations; + /** The operation groups for networkServiceDesignGroups */ + public readonly networkServiceDesignGroups: NetworkServiceDesignGroupsOperations; + /** The operation groups for networkFunctionDefinitionVersions */ + public readonly networkFunctionDefinitionVersions: NetworkFunctionDefinitionVersionsOperations; + /** The operation groups for networkFunctionDefinitionGroups */ + public readonly networkFunctionDefinitionGroups: NetworkFunctionDefinitionGroupsOperations; + /** The operation groups for components */ + public readonly components: ComponentsOperations; + /** The operation groups for networkFunctions */ + public readonly networkFunctions: NetworkFunctionsOperations; + /** The operation groups for configurationGroupValues */ + public readonly configurationGroupValues: ConfigurationGroupValuesOperations; + /** The operation groups for publishers */ + public readonly publishers: PublishersOperations; + /** The operation groups for configurationGroupSchemas */ + public readonly configurationGroupSchemas: ConfigurationGroupSchemasOperations; + /** The operation groups for operations */ + public readonly operations: OperationsOperations; +} diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/index.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/index.ts new file mode 100644 index 0000000000..48ffe278d6 --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/index.ts @@ -0,0 +1,354 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { AzureClouds, AzureSupportedClouds } from "./static-helpers/cloudSettingHelpers.js"; +import { + PageSettings, + ContinuablePage, + PagedAsyncIterableIterator, +} from "./static-helpers/pagingHelpers.js"; + +export { HybridNetworkManagementClient } from "./hybridNetworkManagementClient.js"; +export { SimplePollerLike } from "./static-helpers/simplePollerHelpers.js"; +export { restorePoller, RestorePollerOptions } from "./restorePollerHelpers.js"; +export { + Operation, + OperationDisplay, + KnownOrigin, + Origin, + KnownActionType, + ActionType, + ErrorResponse, + ErrorDetail, + ErrorAdditionalInfo, + ConfigurationGroupSchema, + ConfigurationGroupSchemaPropertiesFormat, + KnownProvisioningState, + ProvisioningState, + KnownVersionState, + VersionState, + TrackedResource, + Resource, + SystemData, + KnownCreatedByType, + CreatedByType, + TagsObject, + ConfigurationGroupSchemaVersionUpdateState, + Publisher, + PublisherPropertiesFormat, + KnownPublisherScope, + PublisherScope, + ManagedServiceIdentity, + KnownManagedServiceIdentityType, + ManagedServiceIdentityType, + UserAssignedIdentity, + ConfigurationGroupValue, + ConfigurationGroupValuePropertiesFormat, + ConfigurationGroupValuePropertiesFormatUnion, + DeploymentResourceIdReference, + DeploymentResourceIdReferenceUnion, + KnownIdType, + IdType, + SecretDeploymentResourceReference, + OpenDeploymentResourceReference, + KnownConfigurationGroupValueConfigurationType, + ConfigurationGroupValueConfigurationType, + ConfigurationValueWithSecrets, + ConfigurationValueWithoutSecrets, + NetworkFunction, + NetworkFunctionPropertiesFormat, + NetworkFunctionPropertiesFormatUnion, + KnownNfviType, + NfviType, + KnownNetworkFunctionConfigurationType, + NetworkFunctionConfigurationType, + NetworkFunctionValueWithSecrets, + NetworkFunctionValueWithoutSecrets, + ExecuteRequestParameters, + RequestMetadata, + KnownHttpMethod, + HttpMethod, + Component, + ComponentProperties, + DeploymentStatusProperties, + KnownStatus, + Status, + Resources, + Deployment, + Pod, + KnownPodStatus, + PodStatus, + PodEvent, + KnownPodEventType, + PodEventType, + ReplicaSet, + StatefulSet, + DaemonSet, + ProxyResource, + NetworkFunctionDefinitionGroup, + NetworkFunctionDefinitionGroupPropertiesFormat, + NetworkFunctionDefinitionVersion, + NetworkFunctionDefinitionVersionPropertiesFormat, + NetworkFunctionDefinitionVersionPropertiesFormatUnion, + KnownNetworkFunctionType, + NetworkFunctionType, + ContainerizedNetworkFunctionDefinitionVersion, + ContainerizedNetworkFunctionTemplate, + ContainerizedNetworkFunctionTemplateUnion, + KnownContainerizedNetworkFunctionNfviType, + ContainerizedNetworkFunctionNfviType, + AzureArcKubernetesNetworkFunctionTemplate, + AzureArcKubernetesNetworkFunctionApplication, + AzureArcKubernetesNetworkFunctionApplicationUnion, + KnownAzureArcKubernetesArtifactType, + AzureArcKubernetesArtifactType, + AzureArcKubernetesHelmApplication, + AzureArcKubernetesArtifactProfile, + HelmArtifactProfile, + AzureArcKubernetesDeployMappingRuleProfile, + HelmMappingRuleProfile, + HelmMappingRuleProfileOptions, + HelmInstallOptions, + HelmUpgradeOptions, + VirtualNetworkFunctionNetworkFunctionDefinitionVersion, + VirtualNetworkFunctionTemplate, + VirtualNetworkFunctionTemplateUnion, + KnownVirtualNetworkFunctionNfviType, + VirtualNetworkFunctionNfviType, + AzureCoreNetworkFunctionTemplate, + AzureCoreNetworkFunctionApplication, + AzureCoreNetworkFunctionApplicationUnion, + KnownAzureCoreArtifactType, + AzureCoreArtifactType, + AzureCoreNetworkFunctionVhdApplication, + AzureCoreVhdImageArtifactProfile, + VhdImageArtifactProfile, + AzureCoreVhdImageDeployMappingRuleProfile, + VhdImageMappingRuleProfile, + AzureCoreNetworkFunctionArmTemplateApplication, + AzureCoreArmTemplateArtifactProfile, + ArmTemplateArtifactProfile, + AzureCoreArmTemplateDeployMappingRuleProfile, + ArmTemplateMappingRuleProfile, + AzureOperatorNexusNetworkFunctionTemplate, + AzureOperatorNexusNetworkFunctionApplication, + AzureOperatorNexusNetworkFunctionApplicationUnion, + KnownAzureOperatorNexusArtifactType, + AzureOperatorNexusArtifactType, + AzureOperatorNexusNetworkFunctionImageApplication, + AzureOperatorNexusImageArtifactProfile, + ImageArtifactProfile, + AzureOperatorNexusImageDeployMappingRuleProfile, + ImageMappingRuleProfile, + AzureOperatorNexusNetworkFunctionArmTemplateApplication, + AzureOperatorNexusArmTemplateArtifactProfile, + AzureOperatorNexusArmTemplateDeployMappingRuleProfile, + NetworkFunctionApplication, + DependsOnProfile, + ArtifactProfile, + ReferencedResource, + MappingRuleProfile, + KnownApplicationEnablement, + ApplicationEnablement, + NetworkFunctionDefinitionVersionUpdateState, + NetworkServiceDesignGroup, + NetworkServiceDesignGroupPropertiesFormat, + NetworkServiceDesignVersion, + NetworkServiceDesignVersionPropertiesFormat, + NfviDetails, + ResourceElementTemplate, + ResourceElementTemplateUnion, + KnownType, + Type, + ArmResourceDefinitionResourceElementTemplateDetails, + ArmResourceDefinitionResourceElementTemplate, + KnownTemplateType, + TemplateType, + NSDArtifactProfile, + NetworkFunctionDefinitionResourceElementTemplateDetails, + NetworkServiceDesignVersionUpdateState, + ArtifactStore, + ArtifactStorePropertiesFormat, + KnownArtifactStoreType, + ArtifactStoreType, + KnownBackingResourcePublicNetworkAccess, + BackingResourcePublicNetworkAccess, + KnownArtifactReplicationStrategy, + ArtifactReplicationStrategy, + ArtifactStorePropertiesFormatManagedResourceGroupConfiguration, + ArtifactStoreNetworkFabricControllerEndPoints, + ArtifactStorePrivateEndPointsFormat, + ProxyArtifactListOverview, + ProxyArtifactVersionsListOverview, + ProxyArtifactOverviewPropertiesValue, + KnownArtifactType, + ArtifactType, + KnownArtifactState, + ArtifactState, + ArtifactChangeState, + ArtifactChangeStateProperties, + ArtifactManifest, + ArtifactManifestPropertiesFormat, + KnownArtifactManifestState, + ArtifactManifestState, + ManifestArtifactFormat, + ArtifactAccessCredential, + ArtifactAccessCredentialUnion, + KnownCredentialType, + CredentialType, + AzureContainerRegistryScopedTokenCredential, + AzureStorageAccountCredential, + AzureStorageAccountContainerCredential, + ArtifactManifestUpdateState, + Site, + SitePropertiesFormat, + NFVIs, + NFVIsUnion, + AzureCoreNfviDetails, + AzureArcK8SClusterNfviDetails, + AzureOperatorNexusClusterNfviDetails, + SiteNetworkService, + SiteNetworkServicePropertiesFormat, + ManagedResourceGroupConfiguration, + Sku, + KnownSkuName, + SkuName, + KnownSkuTier, + SkuTier, + CancelInformation, + KnownLongRunningOperation, + LongRunningOperation, + KnownVersions, +} from "./models/index.js"; +export { HybridNetworkManagementClientOptionalParams } from "./api/index.js"; +export { + ArtifactManifestsUpdateStateOptionalParams, + ArtifactManifestsListCredentialOptionalParams, + ArtifactManifestsListByArtifactStoreOptionalParams, + ArtifactManifestsDeleteOptionalParams, + ArtifactManifestsUpdateOptionalParams, + ArtifactManifestsCreateOrUpdateOptionalParams, + ArtifactManifestsGetOptionalParams, +} from "./api/artifactManifests/index.js"; +export { + ArtifactStoresListPrivateEndPointsOptionalParams, + ArtifactStoresRemovePrivateEndPointsOptionalParams, + ArtifactStoresApprovePrivateEndPointsOptionalParams, + ArtifactStoresListNetworkFabricControllerPrivateEndPointsOptionalParams, + ArtifactStoresDeleteNetworkFabricControllerEndPointsOptionalParams, + ArtifactStoresAddNetworkFabricControllerEndPointsOptionalParams, + ArtifactStoresListByPublisherOptionalParams, + ArtifactStoresDeleteOptionalParams, + ArtifactStoresUpdateOptionalParams, + ArtifactStoresCreateOrUpdateOptionalParams, + ArtifactStoresGetOptionalParams, +} from "./api/artifactStores/index.js"; +export { + ComponentsListByNetworkFunctionOptionalParams, + ComponentsGetOptionalParams, +} from "./api/components/index.js"; +export { + ConfigurationGroupSchemasUpdateStateOptionalParams, + ConfigurationGroupSchemasListByPublisherOptionalParams, + ConfigurationGroupSchemasDeleteOptionalParams, + ConfigurationGroupSchemasUpdateOptionalParams, + ConfigurationGroupSchemasCreateOrUpdateOptionalParams, + ConfigurationGroupSchemasGetOptionalParams, +} from "./api/configurationGroupSchemas/index.js"; +export { + ConfigurationGroupValuesListBySubscriptionOptionalParams, + ConfigurationGroupValuesListByResourceGroupOptionalParams, + ConfigurationGroupValuesDeleteOptionalParams, + ConfigurationGroupValuesUpdateTagsOptionalParams, + ConfigurationGroupValuesCreateOrUpdateOptionalParams, + ConfigurationGroupValuesGetOptionalParams, +} from "./api/configurationGroupValues/index.js"; +export { + NetworkFunctionDefinitionGroupsListByPublisherOptionalParams, + NetworkFunctionDefinitionGroupsDeleteOptionalParams, + NetworkFunctionDefinitionGroupsUpdateOptionalParams, + NetworkFunctionDefinitionGroupsCreateOrUpdateOptionalParams, + NetworkFunctionDefinitionGroupsGetOptionalParams, +} from "./api/networkFunctionDefinitionGroups/index.js"; +export { + NetworkFunctionDefinitionVersionsUpdateStateOptionalParams, + NetworkFunctionDefinitionVersionsListByNetworkFunctionDefinitionGroupOptionalParams, + NetworkFunctionDefinitionVersionsDeleteOptionalParams, + NetworkFunctionDefinitionVersionsUpdateOptionalParams, + NetworkFunctionDefinitionVersionsCreateOrUpdateOptionalParams, + NetworkFunctionDefinitionVersionsGetOptionalParams, +} from "./api/networkFunctionDefinitionVersions/index.js"; +export { + NetworkFunctionsExecuteRequestOptionalParams, + NetworkFunctionsListBySubscriptionOptionalParams, + NetworkFunctionsListByResourceGroupOptionalParams, + NetworkFunctionsDeleteOptionalParams, + NetworkFunctionsUpdateTagsOptionalParams, + NetworkFunctionsCreateOrUpdateOptionalParams, + NetworkFunctionsGetOptionalParams, +} from "./api/networkFunctions/index.js"; +export { + NetworkServiceDesignGroupsListByPublisherOptionalParams, + NetworkServiceDesignGroupsDeleteOptionalParams, + NetworkServiceDesignGroupsUpdateOptionalParams, + NetworkServiceDesignGroupsCreateOrUpdateOptionalParams, + NetworkServiceDesignGroupsGetOptionalParams, +} from "./api/networkServiceDesignGroups/index.js"; +export { + NetworkServiceDesignVersionsUpdateStateOptionalParams, + NetworkServiceDesignVersionsListByNetworkServiceDesignGroupOptionalParams, + NetworkServiceDesignVersionsDeleteOptionalParams, + NetworkServiceDesignVersionsUpdateOptionalParams, + NetworkServiceDesignVersionsCreateOrUpdateOptionalParams, + NetworkServiceDesignVersionsGetOptionalParams, +} from "./api/networkServiceDesignVersions/index.js"; +export { OperationsListOptionalParams } from "./api/operations/index.js"; +export { + ProxyArtifactUpdateStateOptionalParams, + ProxyArtifactGetOptionalParams, + ProxyArtifactListOptionalParams, +} from "./api/proxyArtifact/index.js"; +export { + PublishersListBySubscriptionOptionalParams, + PublishersListByResourceGroupOptionalParams, + PublishersDeleteOptionalParams, + PublishersUpdateOptionalParams, + PublishersCreateOrUpdateOptionalParams, + PublishersGetOptionalParams, +} from "./api/publishers/index.js"; +export { + SiteNetworkServicesCancelOperationOptionalParams, + SiteNetworkServicesListBySubscriptionOptionalParams, + SiteNetworkServicesListByResourceGroupOptionalParams, + SiteNetworkServicesDeleteOptionalParams, + SiteNetworkServicesUpdateTagsOptionalParams, + SiteNetworkServicesCreateOrUpdateOptionalParams, + SiteNetworkServicesGetOptionalParams, +} from "./api/siteNetworkServices/index.js"; +export { + SitesListBySubscriptionOptionalParams, + SitesListByResourceGroupOptionalParams, + SitesDeleteOptionalParams, + SitesUpdateTagsOptionalParams, + SitesCreateOrUpdateOptionalParams, + SitesGetOptionalParams, +} from "./api/sites/index.js"; +export { + ArtifactManifestsOperations, + ArtifactStoresOperations, + ComponentsOperations, + ConfigurationGroupSchemasOperations, + ConfigurationGroupValuesOperations, + NetworkFunctionDefinitionGroupsOperations, + NetworkFunctionDefinitionVersionsOperations, + NetworkFunctionsOperations, + NetworkServiceDesignGroupsOperations, + NetworkServiceDesignVersionsOperations, + OperationsOperations, + ProxyArtifactOperations, + PublishersOperations, + SiteNetworkServicesOperations, + SitesOperations, +} from "./classic/index.js"; +export { PageSettings, ContinuablePage, PagedAsyncIterableIterator }; +export { AzureClouds, AzureSupportedClouds }; diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/logger.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/logger.ts new file mode 100644 index 0000000000..aa2c3a3d3e --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/logger.ts @@ -0,0 +1,5 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { createClientLogger } from "@azure/logger"; +export const logger = createClientLogger("arm-hybridnetwork"); diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/models/index.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/models/index.ts new file mode 100644 index 0000000000..ec6b441efb --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/models/index.ts @@ -0,0 +1,212 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +export { + Operation, + OperationDisplay, + KnownOrigin, + Origin, + KnownActionType, + ActionType, + ErrorResponse, + ErrorDetail, + ErrorAdditionalInfo, + ConfigurationGroupSchema, + ConfigurationGroupSchemaPropertiesFormat, + KnownProvisioningState, + ProvisioningState, + KnownVersionState, + VersionState, + TrackedResource, + Resource, + SystemData, + KnownCreatedByType, + CreatedByType, + TagsObject, + ConfigurationGroupSchemaVersionUpdateState, + Publisher, + PublisherPropertiesFormat, + KnownPublisherScope, + PublisherScope, + ManagedServiceIdentity, + KnownManagedServiceIdentityType, + ManagedServiceIdentityType, + UserAssignedIdentity, + ConfigurationGroupValue, + ConfigurationGroupValuePropertiesFormat, + ConfigurationGroupValuePropertiesFormatUnion, + DeploymentResourceIdReference, + DeploymentResourceIdReferenceUnion, + KnownIdType, + IdType, + SecretDeploymentResourceReference, + OpenDeploymentResourceReference, + KnownConfigurationGroupValueConfigurationType, + ConfigurationGroupValueConfigurationType, + ConfigurationValueWithSecrets, + ConfigurationValueWithoutSecrets, + NetworkFunction, + NetworkFunctionPropertiesFormat, + NetworkFunctionPropertiesFormatUnion, + KnownNfviType, + NfviType, + KnownNetworkFunctionConfigurationType, + NetworkFunctionConfigurationType, + NetworkFunctionValueWithSecrets, + NetworkFunctionValueWithoutSecrets, + ExecuteRequestParameters, + RequestMetadata, + KnownHttpMethod, + HttpMethod, + Component, + ComponentProperties, + DeploymentStatusProperties, + KnownStatus, + Status, + Resources, + Deployment, + Pod, + KnownPodStatus, + PodStatus, + PodEvent, + KnownPodEventType, + PodEventType, + ReplicaSet, + StatefulSet, + DaemonSet, + ProxyResource, + NetworkFunctionDefinitionGroup, + NetworkFunctionDefinitionGroupPropertiesFormat, + NetworkFunctionDefinitionVersion, + NetworkFunctionDefinitionVersionPropertiesFormat, + NetworkFunctionDefinitionVersionPropertiesFormatUnion, + KnownNetworkFunctionType, + NetworkFunctionType, + ContainerizedNetworkFunctionDefinitionVersion, + ContainerizedNetworkFunctionTemplate, + ContainerizedNetworkFunctionTemplateUnion, + KnownContainerizedNetworkFunctionNfviType, + ContainerizedNetworkFunctionNfviType, + AzureArcKubernetesNetworkFunctionTemplate, + AzureArcKubernetesNetworkFunctionApplication, + AzureArcKubernetesNetworkFunctionApplicationUnion, + KnownAzureArcKubernetesArtifactType, + AzureArcKubernetesArtifactType, + AzureArcKubernetesHelmApplication, + AzureArcKubernetesArtifactProfile, + HelmArtifactProfile, + AzureArcKubernetesDeployMappingRuleProfile, + HelmMappingRuleProfile, + HelmMappingRuleProfileOptions, + HelmInstallOptions, + HelmUpgradeOptions, + VirtualNetworkFunctionNetworkFunctionDefinitionVersion, + VirtualNetworkFunctionTemplate, + VirtualNetworkFunctionTemplateUnion, + KnownVirtualNetworkFunctionNfviType, + VirtualNetworkFunctionNfviType, + AzureCoreNetworkFunctionTemplate, + AzureCoreNetworkFunctionApplication, + AzureCoreNetworkFunctionApplicationUnion, + KnownAzureCoreArtifactType, + AzureCoreArtifactType, + AzureCoreNetworkFunctionVhdApplication, + AzureCoreVhdImageArtifactProfile, + VhdImageArtifactProfile, + AzureCoreVhdImageDeployMappingRuleProfile, + VhdImageMappingRuleProfile, + AzureCoreNetworkFunctionArmTemplateApplication, + AzureCoreArmTemplateArtifactProfile, + ArmTemplateArtifactProfile, + AzureCoreArmTemplateDeployMappingRuleProfile, + ArmTemplateMappingRuleProfile, + AzureOperatorNexusNetworkFunctionTemplate, + AzureOperatorNexusNetworkFunctionApplication, + AzureOperatorNexusNetworkFunctionApplicationUnion, + KnownAzureOperatorNexusArtifactType, + AzureOperatorNexusArtifactType, + AzureOperatorNexusNetworkFunctionImageApplication, + AzureOperatorNexusImageArtifactProfile, + ImageArtifactProfile, + AzureOperatorNexusImageDeployMappingRuleProfile, + ImageMappingRuleProfile, + AzureOperatorNexusNetworkFunctionArmTemplateApplication, + AzureOperatorNexusArmTemplateArtifactProfile, + AzureOperatorNexusArmTemplateDeployMappingRuleProfile, + NetworkFunctionApplication, + DependsOnProfile, + ArtifactProfile, + ReferencedResource, + MappingRuleProfile, + KnownApplicationEnablement, + ApplicationEnablement, + NetworkFunctionDefinitionVersionUpdateState, + NetworkServiceDesignGroup, + NetworkServiceDesignGroupPropertiesFormat, + NetworkServiceDesignVersion, + NetworkServiceDesignVersionPropertiesFormat, + NfviDetails, + ResourceElementTemplate, + ResourceElementTemplateUnion, + KnownType, + Type, + ArmResourceDefinitionResourceElementTemplateDetails, + ArmResourceDefinitionResourceElementTemplate, + KnownTemplateType, + TemplateType, + NSDArtifactProfile, + NetworkFunctionDefinitionResourceElementTemplateDetails, + NetworkServiceDesignVersionUpdateState, + ArtifactStore, + ArtifactStorePropertiesFormat, + KnownArtifactStoreType, + ArtifactStoreType, + KnownBackingResourcePublicNetworkAccess, + BackingResourcePublicNetworkAccess, + KnownArtifactReplicationStrategy, + ArtifactReplicationStrategy, + ArtifactStorePropertiesFormatManagedResourceGroupConfiguration, + ArtifactStoreNetworkFabricControllerEndPoints, + ArtifactStorePrivateEndPointsFormat, + ProxyArtifactListOverview, + ProxyArtifactVersionsListOverview, + ProxyArtifactOverviewPropertiesValue, + KnownArtifactType, + ArtifactType, + KnownArtifactState, + ArtifactState, + ArtifactChangeState, + ArtifactChangeStateProperties, + ArtifactManifest, + ArtifactManifestPropertiesFormat, + KnownArtifactManifestState, + ArtifactManifestState, + ManifestArtifactFormat, + ArtifactAccessCredential, + ArtifactAccessCredentialUnion, + KnownCredentialType, + CredentialType, + AzureContainerRegistryScopedTokenCredential, + AzureStorageAccountCredential, + AzureStorageAccountContainerCredential, + ArtifactManifestUpdateState, + Site, + SitePropertiesFormat, + NFVIs, + NFVIsUnion, + AzureCoreNfviDetails, + AzureArcK8SClusterNfviDetails, + AzureOperatorNexusClusterNfviDetails, + SiteNetworkService, + SiteNetworkServicePropertiesFormat, + ManagedResourceGroupConfiguration, + Sku, + KnownSkuName, + SkuName, + KnownSkuTier, + SkuTier, + CancelInformation, + KnownLongRunningOperation, + LongRunningOperation, + KnownVersions, +} from "./models.js"; diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/models/models.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/models/models.ts new file mode 100644 index 0000000000..cb70fc506c --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/models/models.ts @@ -0,0 +1,5731 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +/** + * This file contains only generated model types and their (de)serializers. + * Disable the following rules for internal models with '_' prefix and deserializers which require 'any' for raw JSON input. + */ +/* eslint-disable @typescript-eslint/naming-convention */ +/* eslint-disable @typescript-eslint/explicit-module-boundary-types */ +/** A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to get the next set of results. */ +export interface _OperationListResult { + /** The Operation items on this page */ + value: Operation[]; + /** The link to the next page of items */ + nextLink?: string; +} + +export function _operationListResultDeserializer(item: any): _OperationListResult { + return { + value: operationArrayDeserializer(item["value"]), + nextLink: item["nextLink"], + }; +} + +export function operationArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return operationDeserializer(item); + }); +} + +/** Details of a REST API operation, returned from the Resource Provider Operations API */ +export interface Operation { + /** The name of the operation, as per Resource-Based Access Control (RBAC). Examples: "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action" */ + readonly name?: string; + /** Whether the operation applies to data-plane. This is "true" for data-plane operations and "false" for Azure Resource Manager/control-plane operations. */ + readonly isDataAction?: boolean; + /** Localized display information for this particular operation. */ + display?: OperationDisplay; + /** The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value is "user,system" */ + readonly origin?: Origin; + /** Extensible enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. */ + readonly actionType?: ActionType; +} + +export function operationDeserializer(item: any): Operation { + return { + name: item["name"], + isDataAction: item["isDataAction"], + display: !item["display"] ? item["display"] : operationDisplayDeserializer(item["display"]), + origin: item["origin"], + actionType: item["actionType"], + }; +} + +/** Localized display information for an operation. */ +export interface OperationDisplay { + /** The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring Insights" or "Microsoft Compute". */ + readonly provider?: string; + /** The localized friendly name of the resource type related to this operation. E.g. "Virtual Machines" or "Job Schedule Collections". */ + readonly resource?: string; + /** The concise, localized friendly name for the operation; suitable for dropdowns. E.g. "Create or Update Virtual Machine", "Restart Virtual Machine". */ + readonly operation?: string; + /** The short, localized friendly description of the operation; suitable for tool tips and detailed views. */ + readonly description?: string; +} + +export function operationDisplayDeserializer(item: any): OperationDisplay { + return { + provider: item["provider"], + resource: item["resource"], + operation: item["operation"], + description: item["description"], + }; +} + +/** The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value is "user,system" */ +export enum KnownOrigin { + /** Indicates the operation is initiated by a user. */ + User = "user", + /** Indicates the operation is initiated by a system. */ + System = "system", + /** Indicates the operation is initiated by a user or system. */ + UserSystem = "user,system", +} + +/** + * The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value is "user,system" \ + * {@link KnownOrigin} can be used interchangeably with Origin, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **user**: Indicates the operation is initiated by a user. \ + * **system**: Indicates the operation is initiated by a system. \ + * **user,system**: Indicates the operation is initiated by a user or system. + */ +export type Origin = string; + +/** Extensible enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. */ +export enum KnownActionType { + /** Actions are for internal-only APIs. */ + Internal = "Internal", +} + +/** + * Extensible enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. \ + * {@link KnownActionType} can be used interchangeably with ActionType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Internal**: Actions are for internal-only APIs. + */ +export type ActionType = string; + +/** Common error response for all Azure Resource Manager APIs to return error details for failed operations. */ +export interface ErrorResponse { + /** The error object. */ + error?: ErrorDetail; +} + +export function errorResponseDeserializer(item: any): ErrorResponse { + return { + error: !item["error"] ? item["error"] : errorDetailDeserializer(item["error"]), + }; +} + +/** The error detail. */ +export interface ErrorDetail { + /** The error code. */ + readonly code?: string; + /** The error message. */ + readonly message?: string; + /** The error target. */ + readonly target?: string; + /** The error details. */ + readonly details?: ErrorDetail[]; + /** The error additional info. */ + readonly additionalInfo?: ErrorAdditionalInfo[]; +} + +export function errorDetailDeserializer(item: any): ErrorDetail { + return { + code: item["code"], + message: item["message"], + target: item["target"], + details: !item["details"] ? item["details"] : errorDetailArrayDeserializer(item["details"]), + additionalInfo: !item["additionalInfo"] + ? item["additionalInfo"] + : errorAdditionalInfoArrayDeserializer(item["additionalInfo"]), + }; +} + +export function errorDetailArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return errorDetailDeserializer(item); + }); +} + +export function errorAdditionalInfoArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return errorAdditionalInfoDeserializer(item); + }); +} + +/** The resource management error additional info. */ +export interface ErrorAdditionalInfo { + /** The additional info type. */ + readonly type?: string; + /** The additional info. */ + readonly info?: any; +} + +export function errorAdditionalInfoDeserializer(item: any): ErrorAdditionalInfo { + return { + type: item["type"], + info: item["info"], + }; +} + +/** Configuration group schema resource. */ +export interface ConfigurationGroupSchema extends TrackedResource { + /** Configuration group schema properties. */ + properties?: ConfigurationGroupSchemaPropertiesFormat; +} + +export function configurationGroupSchemaSerializer(item: ConfigurationGroupSchema): any { + return { + tags: item["tags"], + location: item["location"], + properties: !item["properties"] + ? item["properties"] + : configurationGroupSchemaPropertiesFormatSerializer(item["properties"]), + }; +} + +export function configurationGroupSchemaDeserializer(item: any): ConfigurationGroupSchema { + return { + tags: !item["tags"] + ? item["tags"] + : Object.fromEntries(Object.entries(item["tags"]).map(([k, p]: [string, any]) => [k, p])), + location: item["location"], + id: item["id"], + name: item["name"], + type: item["type"], + systemData: !item["systemData"] + ? item["systemData"] + : systemDataDeserializer(item["systemData"]), + properties: !item["properties"] + ? item["properties"] + : configurationGroupSchemaPropertiesFormatDeserializer(item["properties"]), + }; +} + +/** Configuration group schema properties. */ +export interface ConfigurationGroupSchemaPropertiesFormat { + /** The provisioning state of the Configuration group schema resource. */ + readonly provisioningState?: ProvisioningState; + /** The configuration group schema version state. */ + readonly versionState?: VersionState; + /** Description of what schema can contain. */ + description?: string; + /** Name and value pairs that define the configuration value. It can be a well formed escaped JSON string. */ + schemaDefinition?: string; +} + +export function configurationGroupSchemaPropertiesFormatSerializer( + item: ConfigurationGroupSchemaPropertiesFormat, +): any { + return { description: item["description"], schemaDefinition: item["schemaDefinition"] }; +} + +export function configurationGroupSchemaPropertiesFormatDeserializer( + item: any, +): ConfigurationGroupSchemaPropertiesFormat { + return { + provisioningState: item["provisioningState"], + versionState: item["versionState"], + description: item["description"], + schemaDefinition: item["schemaDefinition"], + }; +} + +/** The current provisioning state. */ +export enum KnownProvisioningState { + /** Unknown */ + Unknown = "Unknown", + /** Succeeded */ + Succeeded = "Succeeded", + /** Accepted */ + Accepted = "Accepted", + /** Deleting */ + Deleting = "Deleting", + /** Failed */ + Failed = "Failed", + /** Canceled */ + Canceled = "Canceled", + /** Deleted */ + Deleted = "Deleted", + /** Converging */ + Converging = "Converging", + /** Cancelling */ + Cancelling = "Cancelling", +} + +/** + * The current provisioning state. \ + * {@link KnownProvisioningState} can be used interchangeably with ProvisioningState, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Unknown** \ + * **Succeeded** \ + * **Accepted** \ + * **Deleting** \ + * **Failed** \ + * **Canceled** \ + * **Deleted** \ + * **Converging** \ + * **Cancelling** + */ +export type ProvisioningState = string; + +/** The configuration group schema state. */ +export enum KnownVersionState { + /** Unknown */ + Unknown = "Unknown", + /** Preview */ + Preview = "Preview", + /** Active */ + Active = "Active", + /** Deprecated */ + Deprecated = "Deprecated", + /** Validating */ + Validating = "Validating", + /** ValidationFailed */ + ValidationFailed = "ValidationFailed", +} + +/** + * The configuration group schema state. \ + * {@link KnownVersionState} can be used interchangeably with VersionState, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Unknown** \ + * **Preview** \ + * **Active** \ + * **Deprecated** \ + * **Validating** \ + * **ValidationFailed** + */ +export type VersionState = string; + +/** The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location' */ +export interface TrackedResource extends Resource { + /** Resource tags. */ + tags?: Record; + /** The geo-location where the resource lives */ + location: string; +} + +export function trackedResourceSerializer(item: TrackedResource): any { + return { tags: item["tags"], location: item["location"] }; +} + +export function trackedResourceDeserializer(item: any): TrackedResource { + return { + id: item["id"], + name: item["name"], + type: item["type"], + systemData: !item["systemData"] + ? item["systemData"] + : systemDataDeserializer(item["systemData"]), + tags: !item["tags"] + ? item["tags"] + : Object.fromEntries(Object.entries(item["tags"]).map(([k, p]: [string, any]) => [k, p])), + location: item["location"], + }; +} + +/** Common fields that are returned in the response for all Azure Resource Manager resources */ +export interface Resource { + /** Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} */ + readonly id?: string; + /** The name of the resource */ + readonly name?: string; + /** The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" */ + readonly type?: string; + /** Azure Resource Manager metadata containing createdBy and modifiedBy information. */ + readonly systemData?: SystemData; +} + +export function resourceSerializer(item: Resource): any { + return item; +} + +export function resourceDeserializer(item: any): Resource { + return { + id: item["id"], + name: item["name"], + type: item["type"], + systemData: !item["systemData"] + ? item["systemData"] + : systemDataDeserializer(item["systemData"]), + }; +} + +/** Metadata pertaining to creation and last modification of the resource. */ +export interface SystemData { + /** The identity that created the resource. */ + createdBy?: string; + /** The type of identity that created the resource. */ + createdByType?: CreatedByType; + /** The timestamp of resource creation (UTC). */ + createdAt?: Date; + /** The identity that last modified the resource. */ + lastModifiedBy?: string; + /** The type of identity that last modified the resource. */ + lastModifiedByType?: CreatedByType; + /** The timestamp of resource last modification (UTC) */ + lastModifiedAt?: Date; +} + +export function systemDataDeserializer(item: any): SystemData { + return { + createdBy: item["createdBy"], + createdByType: item["createdByType"], + createdAt: !item["createdAt"] ? item["createdAt"] : new Date(item["createdAt"]), + lastModifiedBy: item["lastModifiedBy"], + lastModifiedByType: item["lastModifiedByType"], + lastModifiedAt: !item["lastModifiedAt"] + ? item["lastModifiedAt"] + : new Date(item["lastModifiedAt"]), + }; +} + +/** The kind of entity that created the resource. */ +export enum KnownCreatedByType { + /** The entity was created by a user. */ + User = "User", + /** The entity was created by an application. */ + Application = "Application", + /** The entity was created by a managed identity. */ + ManagedIdentity = "ManagedIdentity", + /** The entity was created by a key. */ + Key = "Key", +} + +/** + * The kind of entity that created the resource. \ + * {@link KnownCreatedByType} can be used interchangeably with CreatedByType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **User**: The entity was created by a user. \ + * **Application**: The entity was created by an application. \ + * **ManagedIdentity**: The entity was created by a managed identity. \ + * **Key**: The entity was created by a key. + */ +export type CreatedByType = string; + +/** Tags object for patch operations. */ +export interface TagsObject { + /** Resource tags. */ + tags?: Record; +} + +export function tagsObjectSerializer(item: TagsObject): any { + return { tags: item["tags"] }; +} + +/** The response of a ConfigurationGroupSchema list operation. */ +export interface _ConfigurationGroupSchemaListResult { + /** The ConfigurationGroupSchema items on this page */ + value: ConfigurationGroupSchema[]; + /** The link to the next page of items */ + nextLink?: string; +} + +export function _configurationGroupSchemaListResultDeserializer( + item: any, +): _ConfigurationGroupSchemaListResult { + return { + value: configurationGroupSchemaArrayDeserializer(item["value"]), + nextLink: item["nextLink"], + }; +} + +export function configurationGroupSchemaArraySerializer( + result: Array, +): any[] { + return result.map((item) => { + return configurationGroupSchemaSerializer(item); + }); +} + +export function configurationGroupSchemaArrayDeserializer( + result: Array, +): any[] { + return result.map((item) => { + return configurationGroupSchemaDeserializer(item); + }); +} + +/** Publisher configuration group schema update request definition. */ +export interface ConfigurationGroupSchemaVersionUpdateState { + /** The configuration group schema state. */ + versionState?: VersionState; +} + +export function configurationGroupSchemaVersionUpdateStateSerializer( + item: ConfigurationGroupSchemaVersionUpdateState, +): any { + return { versionState: item["versionState"] }; +} + +export function configurationGroupSchemaVersionUpdateStateDeserializer( + item: any, +): ConfigurationGroupSchemaVersionUpdateState { + return { + versionState: item["versionState"], + }; +} + +/** publisher resource. */ +export interface Publisher extends TrackedResource { + /** Publisher properties. */ + properties?: PublisherPropertiesFormat; + /** The managed identity of the publisher, if configured. */ + identity?: ManagedServiceIdentity; +} + +export function publisherSerializer(item: Publisher): any { + return { + tags: item["tags"], + location: item["location"], + properties: !item["properties"] + ? item["properties"] + : publisherPropertiesFormatSerializer(item["properties"]), + identity: !item["identity"] + ? item["identity"] + : managedServiceIdentitySerializer(item["identity"]), + }; +} + +export function publisherDeserializer(item: any): Publisher { + return { + tags: !item["tags"] + ? item["tags"] + : Object.fromEntries(Object.entries(item["tags"]).map(([k, p]: [string, any]) => [k, p])), + location: item["location"], + id: item["id"], + name: item["name"], + type: item["type"], + systemData: !item["systemData"] + ? item["systemData"] + : systemDataDeserializer(item["systemData"]), + properties: !item["properties"] + ? item["properties"] + : publisherPropertiesFormatDeserializer(item["properties"]), + identity: !item["identity"] + ? item["identity"] + : managedServiceIdentityDeserializer(item["identity"]), + }; +} + +/** publisher properties. */ +export interface PublisherPropertiesFormat { + /** The provisioning state of the publisher resource. */ + readonly provisioningState?: ProvisioningState; + /** The publisher scope. */ + scope?: PublisherScope; +} + +export function publisherPropertiesFormatSerializer(item: PublisherPropertiesFormat): any { + return { scope: item["scope"] }; +} + +export function publisherPropertiesFormatDeserializer(item: any): PublisherPropertiesFormat { + return { + provisioningState: item["provisioningState"], + scope: item["scope"], + }; +} + +/** Publisher Scope. */ +export enum KnownPublisherScope { + /** Unknown */ + Unknown = "Unknown", + /** Private */ + Private = "Private", +} + +/** + * Publisher Scope. \ + * {@link KnownPublisherScope} can be used interchangeably with PublisherScope, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Unknown** \ + * **Private** + */ +export type PublisherScope = string; + +/** Managed service identity (system assigned and/or user assigned identities) */ +export interface ManagedServiceIdentity { + /** The service principal ID of the system assigned identity. This property will only be provided for a system assigned identity. */ + readonly principalId?: string; + /** The tenant ID of the system assigned identity. This property will only be provided for a system assigned identity. */ + readonly tenantId?: string; + /** The type of managed identity assigned to this resource. */ + type: ManagedServiceIdentityType; + /** The identities assigned to this resource by the user. */ + userAssignedIdentities?: Record; +} + +export function managedServiceIdentitySerializer(item: ManagedServiceIdentity): any { + return { + type: item["type"], + userAssignedIdentities: !item["userAssignedIdentities"] + ? item["userAssignedIdentities"] + : userAssignedIdentityRecordSerializer(item["userAssignedIdentities"]), + }; +} + +export function managedServiceIdentityDeserializer(item: any): ManagedServiceIdentity { + return { + principalId: item["principalId"], + tenantId: item["tenantId"], + type: item["type"], + userAssignedIdentities: !item["userAssignedIdentities"] + ? item["userAssignedIdentities"] + : userAssignedIdentityRecordDeserializer(item["userAssignedIdentities"]), + }; +} + +/** Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed). */ +export enum KnownManagedServiceIdentityType { + /** No managed identity. */ + None = "None", + /** System assigned managed identity. */ + SystemAssigned = "SystemAssigned", + /** User assigned managed identity. */ + UserAssigned = "UserAssigned", + /** System and user assigned managed identity. */ + SystemAssignedUserAssigned = "SystemAssigned,UserAssigned", +} + +/** + * Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed). \ + * {@link KnownManagedServiceIdentityType} can be used interchangeably with ManagedServiceIdentityType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **None**: No managed identity. \ + * **SystemAssigned**: System assigned managed identity. \ + * **UserAssigned**: User assigned managed identity. \ + * **SystemAssigned,UserAssigned**: System and user assigned managed identity. + */ +export type ManagedServiceIdentityType = string; + +export function userAssignedIdentityRecordSerializer( + item: Record, +): Record { + const result: Record = {}; + Object.keys(item).map((key) => { + result[key] = !item[key] ? item[key] : userAssignedIdentitySerializer(item[key]); + }); + return result; +} + +export function userAssignedIdentityRecordDeserializer( + item: Record, +): Record { + const result: Record = {}; + Object.keys(item).map((key) => { + result[key] = !item[key] ? item[key] : userAssignedIdentityDeserializer(item[key]); + }); + return result; +} + +/** User assigned identity properties */ +export interface UserAssignedIdentity { + /** The principal ID of the assigned identity. */ + readonly principalId?: string; + /** The client ID of the assigned identity. */ + readonly clientId?: string; +} + +export function userAssignedIdentitySerializer(item: UserAssignedIdentity): any { + return item; +} + +export function userAssignedIdentityDeserializer(item: any): UserAssignedIdentity { + return { + principalId: item["principalId"], + clientId: item["clientId"], + }; +} + +/** The response of a Publisher list operation. */ +export interface _PublisherListResult { + /** The Publisher items on this page */ + value: Publisher[]; + /** The link to the next page of items */ + nextLink?: string; +} + +export function _publisherListResultDeserializer(item: any): _PublisherListResult { + return { + value: publisherArrayDeserializer(item["value"]), + nextLink: item["nextLink"], + }; +} + +export function publisherArraySerializer(result: Array): any[] { + return result.map((item) => { + return publisherSerializer(item); + }); +} + +export function publisherArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return publisherDeserializer(item); + }); +} + +/** Hybrid configuration group value resource. */ +export interface ConfigurationGroupValue extends TrackedResource { + /** Hybrid configuration group value properties. */ + properties?: ConfigurationGroupValuePropertiesFormatUnion; +} + +export function configurationGroupValueSerializer(item: ConfigurationGroupValue): any { + return { + tags: item["tags"], + location: item["location"], + properties: !item["properties"] + ? item["properties"] + : configurationGroupValuePropertiesFormatUnionSerializer(item["properties"]), + }; +} + +export function configurationGroupValueDeserializer(item: any): ConfigurationGroupValue { + return { + tags: !item["tags"] + ? item["tags"] + : Object.fromEntries(Object.entries(item["tags"]).map(([k, p]: [string, any]) => [k, p])), + location: item["location"], + id: item["id"], + name: item["name"], + type: item["type"], + systemData: !item["systemData"] + ? item["systemData"] + : systemDataDeserializer(item["systemData"]), + properties: !item["properties"] + ? item["properties"] + : configurationGroupValuePropertiesFormatUnionDeserializer(item["properties"]), + }; +} + +/** Hybrid configuration group value properties. */ +export interface ConfigurationGroupValuePropertiesFormat { + /** The provisioning state of the site resource. */ + readonly provisioningState?: ProvisioningState; + /** The publisher name for the configuration group schema. */ + readonly publisherName?: string; + /** The scope of the publisher. */ + readonly publisherScope?: PublisherScope; + /** The configuration group schema name. */ + readonly configurationGroupSchemaName?: string; + /** The location of the configuration group schema offering. */ + readonly configurationGroupSchemaOfferingLocation?: string; + /** The configuration group schema resource reference. */ + configurationGroupSchemaResourceReference?: DeploymentResourceIdReferenceUnion; + /** The value which indicates if configuration values are secrets */ + /** The discriminator possible values: Secret, Open */ + configurationType: ConfigurationGroupValueConfigurationType; +} + +export function configurationGroupValuePropertiesFormatSerializer( + item: ConfigurationGroupValuePropertiesFormat, +): any { + return { + configurationGroupSchemaResourceReference: !item["configurationGroupSchemaResourceReference"] + ? item["configurationGroupSchemaResourceReference"] + : deploymentResourceIdReferenceUnionSerializer( + item["configurationGroupSchemaResourceReference"], + ), + configurationType: item["configurationType"], + }; +} + +export function configurationGroupValuePropertiesFormatDeserializer( + item: any, +): ConfigurationGroupValuePropertiesFormat { + return { + provisioningState: item["provisioningState"], + publisherName: item["publisherName"], + publisherScope: item["publisherScope"], + configurationGroupSchemaName: item["configurationGroupSchemaName"], + configurationGroupSchemaOfferingLocation: item["configurationGroupSchemaOfferingLocation"], + configurationGroupSchemaResourceReference: !item["configurationGroupSchemaResourceReference"] + ? item["configurationGroupSchemaResourceReference"] + : deploymentResourceIdReferenceUnionDeserializer( + item["configurationGroupSchemaResourceReference"], + ), + configurationType: item["configurationType"], + }; +} + +/** Alias for ConfigurationGroupValuePropertiesFormatUnion */ +export type ConfigurationGroupValuePropertiesFormatUnion = + | ConfigurationValueWithSecrets + | ConfigurationValueWithoutSecrets + | ConfigurationGroupValuePropertiesFormat; + +export function configurationGroupValuePropertiesFormatUnionSerializer( + item: ConfigurationGroupValuePropertiesFormatUnion, +): any { + switch (item.configurationType) { + case "Secret": + return configurationValueWithSecretsSerializer(item as ConfigurationValueWithSecrets); + + case "Open": + return configurationValueWithoutSecretsSerializer(item as ConfigurationValueWithoutSecrets); + + default: + return configurationGroupValuePropertiesFormatSerializer(item); + } +} + +export function configurationGroupValuePropertiesFormatUnionDeserializer( + item: any, +): ConfigurationGroupValuePropertiesFormatUnion { + switch (item.configurationType) { + case "Secret": + return configurationValueWithSecretsDeserializer(item as ConfigurationValueWithSecrets); + + case "Open": + return configurationValueWithoutSecretsDeserializer(item as ConfigurationValueWithoutSecrets); + + default: + return configurationGroupValuePropertiesFormatDeserializer(item); + } +} + +/** The azure resource reference which is used for deployment. */ +export interface DeploymentResourceIdReference { + /** The resource reference arm id type. */ + /** The discriminator possible values: Secret, Open */ + idType: IdType; +} + +export function deploymentResourceIdReferenceSerializer(item: DeploymentResourceIdReference): any { + return { idType: item["idType"] }; +} + +export function deploymentResourceIdReferenceDeserializer( + item: any, +): DeploymentResourceIdReference { + return { + idType: item["idType"], + }; +} + +/** Alias for DeploymentResourceIdReferenceUnion */ +export type DeploymentResourceIdReferenceUnion = + | SecretDeploymentResourceReference + | OpenDeploymentResourceReference + | DeploymentResourceIdReference; + +export function deploymentResourceIdReferenceUnionSerializer( + item: DeploymentResourceIdReferenceUnion, +): any { + switch (item.idType) { + case "Secret": + return secretDeploymentResourceReferenceSerializer(item as SecretDeploymentResourceReference); + + case "Open": + return openDeploymentResourceReferenceSerializer(item as OpenDeploymentResourceReference); + + default: + return deploymentResourceIdReferenceSerializer(item); + } +} + +export function deploymentResourceIdReferenceUnionDeserializer( + item: any, +): DeploymentResourceIdReferenceUnion { + switch (item.idType) { + case "Secret": + return secretDeploymentResourceReferenceDeserializer( + item as SecretDeploymentResourceReference, + ); + + case "Open": + return openDeploymentResourceReferenceDeserializer(item as OpenDeploymentResourceReference); + + default: + return deploymentResourceIdReferenceDeserializer(item); + } +} + +/** The resource reference arm id type. */ +export enum KnownIdType { + /** Unknown */ + Unknown = "Unknown", + /** Open */ + Open = "Open", + /** Secret */ + Secret = "Secret", +} + +/** + * The resource reference arm id type. \ + * {@link KnownIdType} can be used interchangeably with IdType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Unknown** \ + * **Open** \ + * **Secret** + */ +export type IdType = string; + +/** Secret deployment resource id reference. */ +export interface SecretDeploymentResourceReference extends DeploymentResourceIdReference { + /** Resource ID. */ + id?: string; + /** The resource reference arm id type. */ + idType: "Secret"; +} + +export function secretDeploymentResourceReferenceSerializer( + item: SecretDeploymentResourceReference, +): any { + return { idType: item["idType"], id: item["id"] }; +} + +export function secretDeploymentResourceReferenceDeserializer( + item: any, +): SecretDeploymentResourceReference { + return { + idType: item["idType"], + id: item["id"], + }; +} + +/** Non secret deployment resource id reference. */ +export interface OpenDeploymentResourceReference extends DeploymentResourceIdReference { + /** Resource ID. */ + id?: string; + /** The resource reference arm id type. */ + idType: "Open"; +} + +export function openDeploymentResourceReferenceSerializer( + item: OpenDeploymentResourceReference, +): any { + return { idType: item["idType"], id: item["id"] }; +} + +export function openDeploymentResourceReferenceDeserializer( + item: any, +): OpenDeploymentResourceReference { + return { + idType: item["idType"], + id: item["id"], + }; +} + +/** The secret type which indicates if secret or not. */ +export enum KnownConfigurationGroupValueConfigurationType { + /** Unknown */ + Unknown = "Unknown", + /** Secret */ + Secret = "Secret", + /** Open */ + Open = "Open", +} + +/** + * The secret type which indicates if secret or not. \ + * {@link KnownConfigurationGroupValueConfigurationType} can be used interchangeably with ConfigurationGroupValueConfigurationType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Unknown** \ + * **Secret** \ + * **Open** + */ +export type ConfigurationGroupValueConfigurationType = string; + +/** The ConfigurationValue with secrets. */ +export interface ConfigurationValueWithSecrets extends ConfigurationGroupValuePropertiesFormat { + /** Name and value pairs that define the configuration value secrets. It can be a well formed escaped JSON string. */ + secretConfigurationValue?: string; + /** The value which indicates if configuration values are secrets */ + configurationType: "Secret"; +} + +export function configurationValueWithSecretsSerializer(item: ConfigurationValueWithSecrets): any { + return { + configurationGroupSchemaResourceReference: !item["configurationGroupSchemaResourceReference"] + ? item["configurationGroupSchemaResourceReference"] + : deploymentResourceIdReferenceUnionSerializer( + item["configurationGroupSchemaResourceReference"], + ), + configurationType: item["configurationType"], + secretConfigurationValue: item["secretConfigurationValue"], + }; +} + +export function configurationValueWithSecretsDeserializer( + item: any, +): ConfigurationValueWithSecrets { + return { + provisioningState: item["provisioningState"], + publisherName: item["publisherName"], + publisherScope: item["publisherScope"], + configurationGroupSchemaName: item["configurationGroupSchemaName"], + configurationGroupSchemaOfferingLocation: item["configurationGroupSchemaOfferingLocation"], + configurationGroupSchemaResourceReference: !item["configurationGroupSchemaResourceReference"] + ? item["configurationGroupSchemaResourceReference"] + : deploymentResourceIdReferenceUnionDeserializer( + item["configurationGroupSchemaResourceReference"], + ), + configurationType: item["configurationType"], + secretConfigurationValue: item["secretConfigurationValue"], + }; +} + +/** The ConfigurationValue with no secrets. */ +export interface ConfigurationValueWithoutSecrets extends ConfigurationGroupValuePropertiesFormat { + /** Name and value pairs that define the configuration value. It can be a well formed escaped JSON string. */ + configurationValue?: string; + /** The value which indicates if configuration values are secrets */ + configurationType: "Open"; +} + +export function configurationValueWithoutSecretsSerializer( + item: ConfigurationValueWithoutSecrets, +): any { + return { + configurationGroupSchemaResourceReference: !item["configurationGroupSchemaResourceReference"] + ? item["configurationGroupSchemaResourceReference"] + : deploymentResourceIdReferenceUnionSerializer( + item["configurationGroupSchemaResourceReference"], + ), + configurationType: item["configurationType"], + configurationValue: item["configurationValue"], + }; +} + +export function configurationValueWithoutSecretsDeserializer( + item: any, +): ConfigurationValueWithoutSecrets { + return { + provisioningState: item["provisioningState"], + publisherName: item["publisherName"], + publisherScope: item["publisherScope"], + configurationGroupSchemaName: item["configurationGroupSchemaName"], + configurationGroupSchemaOfferingLocation: item["configurationGroupSchemaOfferingLocation"], + configurationGroupSchemaResourceReference: !item["configurationGroupSchemaResourceReference"] + ? item["configurationGroupSchemaResourceReference"] + : deploymentResourceIdReferenceUnionDeserializer( + item["configurationGroupSchemaResourceReference"], + ), + configurationType: item["configurationType"], + configurationValue: item["configurationValue"], + }; +} + +/** The response of a configurationGroupValue list operation. */ +export interface _ConfigurationGroupValueListResult { + /** The configurationGroupValue items on this page */ + value: ConfigurationGroupValue[]; + /** The link to the next page of items */ + nextLink?: string; +} + +export function _configurationGroupValueListResultDeserializer( + item: any, +): _ConfigurationGroupValueListResult { + return { + value: configurationGroupValueArrayDeserializer(item["value"]), + nextLink: item["nextLink"], + }; +} + +export function configurationGroupValueArraySerializer( + result: Array, +): any[] { + return result.map((item) => { + return configurationGroupValueSerializer(item); + }); +} + +export function configurationGroupValueArrayDeserializer( + result: Array, +): any[] { + return result.map((item) => { + return configurationGroupValueDeserializer(item); + }); +} + +/** Network function resource response. */ +export interface NetworkFunction extends TrackedResource { + /** Network function properties. */ + properties?: NetworkFunctionPropertiesFormatUnion; + /** A unique read-only string that changes whenever the resource is updated. */ + etag?: string; + /** The managed identity of the network function. */ + identity?: ManagedServiceIdentity; +} + +export function networkFunctionSerializer(item: NetworkFunction): any { + return { + tags: item["tags"], + location: item["location"], + properties: !item["properties"] + ? item["properties"] + : networkFunctionPropertiesFormatUnionSerializer(item["properties"]), + etag: item["etag"], + identity: !item["identity"] + ? item["identity"] + : managedServiceIdentitySerializer(item["identity"]), + }; +} + +export function networkFunctionDeserializer(item: any): NetworkFunction { + return { + tags: !item["tags"] + ? item["tags"] + : Object.fromEntries(Object.entries(item["tags"]).map(([k, p]: [string, any]) => [k, p])), + location: item["location"], + id: item["id"], + name: item["name"], + type: item["type"], + systemData: !item["systemData"] + ? item["systemData"] + : systemDataDeserializer(item["systemData"]), + properties: !item["properties"] + ? item["properties"] + : networkFunctionPropertiesFormatUnionDeserializer(item["properties"]), + etag: item["etag"], + identity: !item["identity"] + ? item["identity"] + : managedServiceIdentityDeserializer(item["identity"]), + }; +} + +/** Network function properties. */ +export interface NetworkFunctionPropertiesFormat { + /** The provisioning state of the network function resource. */ + readonly provisioningState?: ProvisioningState; + /** The publisher name for the network function. */ + publisherName?: string; + /** The scope of the publisher. */ + publisherScope?: PublisherScope; + /** The network function definition group name for the network function. */ + networkFunctionDefinitionGroupName?: string; + /** The network function definition version for the network function. */ + networkFunctionDefinitionVersion?: string; + /** The location of the network function definition offering. */ + networkFunctionDefinitionOfferingLocation?: string; + /** The network function definition version resource reference. */ + networkFunctionDefinitionVersionResourceReference?: DeploymentResourceIdReferenceUnion; + /** The nfvi type for the network function. */ + nfviType?: NfviType; + /** The nfviId for the network function. */ + nfviId?: string; + /** Indicates if software updates are allowed during deployment. */ + allowSoftwareUpdate?: boolean; + /** The value which indicates if NF values are secrets */ + /** The discriminator possible values: Secret, Open */ + configurationType: NetworkFunctionConfigurationType; + /** The role configuration override values from the user. */ + roleOverrideValues?: string[]; +} + +export function networkFunctionPropertiesFormatSerializer( + item: NetworkFunctionPropertiesFormat, +): any { + return { + publisherName: item["publisherName"], + publisherScope: item["publisherScope"], + networkFunctionDefinitionGroupName: item["networkFunctionDefinitionGroupName"], + networkFunctionDefinitionVersion: item["networkFunctionDefinitionVersion"], + networkFunctionDefinitionOfferingLocation: item["networkFunctionDefinitionOfferingLocation"], + networkFunctionDefinitionVersionResourceReference: !item[ + "networkFunctionDefinitionVersionResourceReference" + ] + ? item["networkFunctionDefinitionVersionResourceReference"] + : deploymentResourceIdReferenceUnionSerializer( + item["networkFunctionDefinitionVersionResourceReference"], + ), + nfviType: item["nfviType"], + nfviId: item["nfviId"], + allowSoftwareUpdate: item["allowSoftwareUpdate"], + configurationType: item["configurationType"], + roleOverrideValues: !item["roleOverrideValues"] + ? item["roleOverrideValues"] + : item["roleOverrideValues"].map((p: any) => { + return p; + }), + }; +} + +export function networkFunctionPropertiesFormatDeserializer( + item: any, +): NetworkFunctionPropertiesFormat { + return { + provisioningState: item["provisioningState"], + publisherName: item["publisherName"], + publisherScope: item["publisherScope"], + networkFunctionDefinitionGroupName: item["networkFunctionDefinitionGroupName"], + networkFunctionDefinitionVersion: item["networkFunctionDefinitionVersion"], + networkFunctionDefinitionOfferingLocation: item["networkFunctionDefinitionOfferingLocation"], + networkFunctionDefinitionVersionResourceReference: !item[ + "networkFunctionDefinitionVersionResourceReference" + ] + ? item["networkFunctionDefinitionVersionResourceReference"] + : deploymentResourceIdReferenceUnionDeserializer( + item["networkFunctionDefinitionVersionResourceReference"], + ), + nfviType: item["nfviType"], + nfviId: item["nfviId"], + allowSoftwareUpdate: item["allowSoftwareUpdate"], + configurationType: item["configurationType"], + roleOverrideValues: !item["roleOverrideValues"] + ? item["roleOverrideValues"] + : item["roleOverrideValues"].map((p: any) => { + return p; + }), + }; +} + +/** Alias for NetworkFunctionPropertiesFormatUnion */ +export type NetworkFunctionPropertiesFormatUnion = + | NetworkFunctionValueWithSecrets + | NetworkFunctionValueWithoutSecrets + | NetworkFunctionPropertiesFormat; + +export function networkFunctionPropertiesFormatUnionSerializer( + item: NetworkFunctionPropertiesFormatUnion, +): any { + switch (item.configurationType) { + case "Secret": + return networkFunctionValueWithSecretsSerializer(item as NetworkFunctionValueWithSecrets); + + case "Open": + return networkFunctionValueWithoutSecretsSerializer( + item as NetworkFunctionValueWithoutSecrets, + ); + + default: + return networkFunctionPropertiesFormatSerializer(item); + } +} + +export function networkFunctionPropertiesFormatUnionDeserializer( + item: any, +): NetworkFunctionPropertiesFormatUnion { + switch (item.configurationType) { + case "Secret": + return networkFunctionValueWithSecretsDeserializer(item as NetworkFunctionValueWithSecrets); + + case "Open": + return networkFunctionValueWithoutSecretsDeserializer( + item as NetworkFunctionValueWithoutSecrets, + ); + + default: + return networkFunctionPropertiesFormatDeserializer(item); + } +} + +/** The NFVI type. */ +export enum KnownNfviType { + /** Unknown */ + Unknown = "Unknown", + /** AzureArcKubernetes */ + AzureArcKubernetes = "AzureArcKubernetes", + /** AzureCore */ + AzureCore = "AzureCore", + /** AzureOperatorNexus */ + AzureOperatorNexus = "AzureOperatorNexus", +} + +/** + * The NFVI type. \ + * {@link KnownNfviType} can be used interchangeably with NfviType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Unknown** \ + * **AzureArcKubernetes** \ + * **AzureCore** \ + * **AzureOperatorNexus** + */ +export type NfviType = string; + +/** The secret type which indicates if secret or not. */ +export enum KnownNetworkFunctionConfigurationType { + /** Unknown */ + Unknown = "Unknown", + /** Secret */ + Secret = "Secret", + /** Open */ + Open = "Open", +} + +/** + * The secret type which indicates if secret or not. \ + * {@link KnownNetworkFunctionConfigurationType} can be used interchangeably with NetworkFunctionConfigurationType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Unknown** \ + * **Secret** \ + * **Open** + */ +export type NetworkFunctionConfigurationType = string; + +/** NetworkFunction with secrets. */ +export interface NetworkFunctionValueWithSecrets extends NetworkFunctionPropertiesFormat { + /** The JSON-serialized secret deployment values from the user. This contains secrets like passwords,keys etc */ + secretDeploymentValues?: string; + /** The value which indicates if NF values are secrets */ + configurationType: "Secret"; +} + +export function networkFunctionValueWithSecretsSerializer( + item: NetworkFunctionValueWithSecrets, +): any { + return { + publisherName: item["publisherName"], + publisherScope: item["publisherScope"], + networkFunctionDefinitionGroupName: item["networkFunctionDefinitionGroupName"], + networkFunctionDefinitionVersion: item["networkFunctionDefinitionVersion"], + networkFunctionDefinitionOfferingLocation: item["networkFunctionDefinitionOfferingLocation"], + networkFunctionDefinitionVersionResourceReference: !item[ + "networkFunctionDefinitionVersionResourceReference" + ] + ? item["networkFunctionDefinitionVersionResourceReference"] + : deploymentResourceIdReferenceUnionSerializer( + item["networkFunctionDefinitionVersionResourceReference"], + ), + nfviType: item["nfviType"], + nfviId: item["nfviId"], + allowSoftwareUpdate: item["allowSoftwareUpdate"], + configurationType: item["configurationType"], + roleOverrideValues: !item["roleOverrideValues"] + ? item["roleOverrideValues"] + : item["roleOverrideValues"].map((p: any) => { + return p; + }), + secretDeploymentValues: item["secretDeploymentValues"], + }; +} + +export function networkFunctionValueWithSecretsDeserializer( + item: any, +): NetworkFunctionValueWithSecrets { + return { + provisioningState: item["provisioningState"], + publisherName: item["publisherName"], + publisherScope: item["publisherScope"], + networkFunctionDefinitionGroupName: item["networkFunctionDefinitionGroupName"], + networkFunctionDefinitionVersion: item["networkFunctionDefinitionVersion"], + networkFunctionDefinitionOfferingLocation: item["networkFunctionDefinitionOfferingLocation"], + networkFunctionDefinitionVersionResourceReference: !item[ + "networkFunctionDefinitionVersionResourceReference" + ] + ? item["networkFunctionDefinitionVersionResourceReference"] + : deploymentResourceIdReferenceUnionDeserializer( + item["networkFunctionDefinitionVersionResourceReference"], + ), + nfviType: item["nfviType"], + nfviId: item["nfviId"], + allowSoftwareUpdate: item["allowSoftwareUpdate"], + configurationType: item["configurationType"], + roleOverrideValues: !item["roleOverrideValues"] + ? item["roleOverrideValues"] + : item["roleOverrideValues"].map((p: any) => { + return p; + }), + secretDeploymentValues: item["secretDeploymentValues"], + }; +} + +/** NetworkFunction with no secrets. */ +export interface NetworkFunctionValueWithoutSecrets extends NetworkFunctionPropertiesFormat { + /** The JSON-serialized deployment values from the user. */ + deploymentValues?: string; + /** The value which indicates if NF values are secrets */ + configurationType: "Open"; +} + +export function networkFunctionValueWithoutSecretsSerializer( + item: NetworkFunctionValueWithoutSecrets, +): any { + return { + publisherName: item["publisherName"], + publisherScope: item["publisherScope"], + networkFunctionDefinitionGroupName: item["networkFunctionDefinitionGroupName"], + networkFunctionDefinitionVersion: item["networkFunctionDefinitionVersion"], + networkFunctionDefinitionOfferingLocation: item["networkFunctionDefinitionOfferingLocation"], + networkFunctionDefinitionVersionResourceReference: !item[ + "networkFunctionDefinitionVersionResourceReference" + ] + ? item["networkFunctionDefinitionVersionResourceReference"] + : deploymentResourceIdReferenceUnionSerializer( + item["networkFunctionDefinitionVersionResourceReference"], + ), + nfviType: item["nfviType"], + nfviId: item["nfviId"], + allowSoftwareUpdate: item["allowSoftwareUpdate"], + configurationType: item["configurationType"], + roleOverrideValues: !item["roleOverrideValues"] + ? item["roleOverrideValues"] + : item["roleOverrideValues"].map((p: any) => { + return p; + }), + deploymentValues: item["deploymentValues"], + }; +} + +export function networkFunctionValueWithoutSecretsDeserializer( + item: any, +): NetworkFunctionValueWithoutSecrets { + return { + provisioningState: item["provisioningState"], + publisherName: item["publisherName"], + publisherScope: item["publisherScope"], + networkFunctionDefinitionGroupName: item["networkFunctionDefinitionGroupName"], + networkFunctionDefinitionVersion: item["networkFunctionDefinitionVersion"], + networkFunctionDefinitionOfferingLocation: item["networkFunctionDefinitionOfferingLocation"], + networkFunctionDefinitionVersionResourceReference: !item[ + "networkFunctionDefinitionVersionResourceReference" + ] + ? item["networkFunctionDefinitionVersionResourceReference"] + : deploymentResourceIdReferenceUnionDeserializer( + item["networkFunctionDefinitionVersionResourceReference"], + ), + nfviType: item["nfviType"], + nfviId: item["nfviId"], + allowSoftwareUpdate: item["allowSoftwareUpdate"], + configurationType: item["configurationType"], + roleOverrideValues: !item["roleOverrideValues"] + ? item["roleOverrideValues"] + : item["roleOverrideValues"].map((p: any) => { + return p; + }), + deploymentValues: item["deploymentValues"], + }; +} + +/** The response of a NetworkFunction list operation. */ +export interface _NetworkFunctionListResult { + /** The NetworkFunction items on this page */ + value: NetworkFunction[]; + /** The link to the next page of items */ + nextLink?: string; +} + +export function _networkFunctionListResultDeserializer(item: any): _NetworkFunctionListResult { + return { + value: networkFunctionArrayDeserializer(item["value"]), + nextLink: item["nextLink"], + }; +} + +export function networkFunctionArraySerializer(result: Array): any[] { + return result.map((item) => { + return networkFunctionSerializer(item); + }); +} + +export function networkFunctionArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return networkFunctionDeserializer(item); + }); +} + +/** Payload for execute request post call. */ +export interface ExecuteRequestParameters { + /** The endpoint of service to call. */ + serviceEndpoint: string; + /** The request metadata. */ + requestMetadata: RequestMetadata; +} + +export function executeRequestParametersSerializer(item: ExecuteRequestParameters): any { + return { + serviceEndpoint: item["serviceEndpoint"], + requestMetadata: requestMetadataSerializer(item["requestMetadata"]), + }; +} + +/** Request metadata of execute request post call payload. */ +export interface RequestMetadata { + /** The relative path of the request. */ + relativePath: string; + /** The http method of the request. */ + httpMethod: HttpMethod; + /** The serialized body of the request. */ + serializedBody: string; + /** The api version of the request. */ + apiVersion?: string; +} + +export function requestMetadataSerializer(item: RequestMetadata): any { + return { + relativePath: item["relativePath"], + httpMethod: item["httpMethod"], + serializedBody: item["serializedBody"], + apiVersion: item["apiVersion"], + }; +} + +/** The http method of the request. */ +export enum KnownHttpMethod { + /** Unknown */ + Unknown = "Unknown", + /** Post */ + Post = "Post", + /** Put */ + Put = "Put", + /** Get */ + Get = "Get", + /** Patch */ + Patch = "Patch", + /** Delete */ + Delete = "Delete", +} + +/** + * The http method of the request. \ + * {@link KnownHttpMethod} can be used interchangeably with HttpMethod, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Unknown** \ + * **Post** \ + * **Put** \ + * **Get** \ + * **Patch** \ + * **Delete** + */ +export type HttpMethod = string; + +/** The component sub resource. */ +export interface Component extends ProxyResource { + /** The component properties. */ + properties?: ComponentProperties; +} + +export function componentDeserializer(item: any): Component { + return { + id: item["id"], + name: item["name"], + type: item["type"], + systemData: !item["systemData"] + ? item["systemData"] + : systemDataDeserializer(item["systemData"]), + properties: !item["properties"] + ? item["properties"] + : componentPropertiesDeserializer(item["properties"]), + }; +} + +/** The component properties of the network function. */ +export interface ComponentProperties { + /** The provisioning state of the component resource. */ + readonly provisioningState?: ProvisioningState; + /** The JSON-serialized deployment profile of the component resource. */ + readonly deploymentProfile?: string; + /** The deployment status of the component resource. */ + readonly deploymentStatus?: DeploymentStatusProperties; +} + +export function componentPropertiesDeserializer(item: any): ComponentProperties { + return { + provisioningState: item["provisioningState"], + deploymentProfile: item["deploymentProfile"], + deploymentStatus: !item["deploymentStatus"] + ? item["deploymentStatus"] + : deploymentStatusPropertiesDeserializer(item["deploymentStatus"]), + }; +} + +/** The deployment status properties of the network function component. */ +export interface DeploymentStatusProperties { + /** The status of the component resource. */ + status?: Status; + /** The resource related to the component resource. */ + resources?: Resources; + /** The next expected update of deployment status. */ + nextExpectedUpdateAt?: Date; +} + +export function deploymentStatusPropertiesDeserializer(item: any): DeploymentStatusProperties { + return { + status: item["status"], + resources: !item["resources"] ? item["resources"] : resourcesDeserializer(item["resources"]), + nextExpectedUpdateAt: !item["nextExpectedUpdateAt"] + ? item["nextExpectedUpdateAt"] + : new Date(item["nextExpectedUpdateAt"]), + }; +} + +/** The component resource deployment status. */ +export enum KnownStatus { + /** Unknown */ + Unknown = "Unknown", + /** Deployed */ + Deployed = "Deployed", + /** Uninstalled */ + Uninstalled = "Uninstalled", + /** Superseded */ + Superseded = "Superseded", + /** Failed */ + Failed = "Failed", + /** Uninstalling */ + Uninstalling = "Uninstalling", + /** Pending-Install */ + PendingInstall = "Pending-Install", + /** Pending-Upgrade */ + PendingUpgrade = "Pending-Upgrade", + /** Pending-Rollback */ + PendingRollback = "Pending-Rollback", + /** Downloading */ + Downloading = "Downloading", + /** Installing */ + Installing = "Installing", + /** Reinstalling */ + Reinstalling = "Reinstalling", + /** Rollingback */ + Rollingback = "Rollingback", + /** Upgrading */ + Upgrading = "Upgrading", +} + +/** + * The component resource deployment status. \ + * {@link KnownStatus} can be used interchangeably with Status, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Unknown** \ + * **Deployed** \ + * **Uninstalled** \ + * **Superseded** \ + * **Failed** \ + * **Uninstalling** \ + * **Pending-Install** \ + * **Pending-Upgrade** \ + * **Pending-Rollback** \ + * **Downloading** \ + * **Installing** \ + * **Reinstalling** \ + * **Rollingback** \ + * **Upgrading** + */ +export type Status = string; + +/** The resources of the network function component. */ +export interface Resources { + /** Deployments that are related to component resource. */ + deployments?: Deployment[]; + /** Pods related to component resource. */ + pods?: Pod[]; + /** Replica sets related to component resource. */ + replicaSets?: ReplicaSet[]; + /** Stateful sets related to component resource. */ + statefulSets?: StatefulSet[]; + /** Daemonsets related to component resource. */ + daemonSets?: DaemonSet[]; +} + +export function resourcesDeserializer(item: any): Resources { + return { + deployments: !item["deployments"] + ? item["deployments"] + : deploymentArrayDeserializer(item["deployments"]), + pods: !item["pods"] ? item["pods"] : podArrayDeserializer(item["pods"]), + replicaSets: !item["replicaSets"] + ? item["replicaSets"] + : replicaSetArrayDeserializer(item["replicaSets"]), + statefulSets: !item["statefulSets"] + ? item["statefulSets"] + : statefulSetArrayDeserializer(item["statefulSets"]), + daemonSets: !item["daemonSets"] + ? item["daemonSets"] + : daemonSetArrayDeserializer(item["daemonSets"]), + }; +} + +export function deploymentArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return deploymentDeserializer(item); + }); +} + +/** Helm Deployment status properties. */ +export interface Deployment { + /** The name of the deployment. */ + name?: string; + /** The namespace of the deployment. */ + namespace?: string; + /** Desired number of pods */ + desired?: number; + /** Number of ready pods. */ + ready?: number; + /** Number of upto date pods. */ + upToDate?: number; + /** Number of available pods. */ + available?: number; + /** Creation Time of deployment. */ + creationTime?: Date; +} + +export function deploymentDeserializer(item: any): Deployment { + return { + name: item["name"], + namespace: item["namespace"], + desired: item["desired"], + ready: item["ready"], + upToDate: item["upToDate"], + available: item["available"], + creationTime: !item["creationTime"] ? item["creationTime"] : new Date(item["creationTime"]), + }; +} + +export function podArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return podDeserializer(item); + }); +} + +/** Helm Pod status properties. */ +export interface Pod { + /** The name of the Pod. */ + name?: string; + /** The namespace of the Pod. */ + namespace?: string; + /** Desired number of containers */ + desired?: number; + /** Number of ready containers. */ + ready?: number; + /** The status of a pod. */ + status?: PodStatus; + /** Creation Time of Pod. */ + creationTime?: Date; + /** Last 5 Pod events. */ + events?: PodEvent[]; +} + +export function podDeserializer(item: any): Pod { + return { + name: item["name"], + namespace: item["namespace"], + desired: item["desired"], + ready: item["ready"], + status: item["status"], + creationTime: !item["creationTime"] ? item["creationTime"] : new Date(item["creationTime"]), + events: !item["events"] ? item["events"] : podEventArrayDeserializer(item["events"]), + }; +} + +/** The status of a Pod. */ +export enum KnownPodStatus { + /** Unknown */ + Unknown = "Unknown", + /** Succeeded */ + Succeeded = "Succeeded", + /** Failed */ + Failed = "Failed", + /** Running */ + Running = "Running", + /** Pending */ + Pending = "Pending", + /** Terminating */ + Terminating = "Terminating", + /** NotReady */ + NotReady = "NotReady", +} + +/** + * The status of a Pod. \ + * {@link KnownPodStatus} can be used interchangeably with PodStatus, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Unknown** \ + * **Succeeded** \ + * **Failed** \ + * **Running** \ + * **Pending** \ + * **Terminating** \ + * **NotReady** + */ +export type PodStatus = string; + +export function podEventArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return podEventDeserializer(item); + }); +} + +/** Pod Event properties. */ +export interface PodEvent { + /** The type of pod event. */ + type?: PodEventType; + /** Event reason. */ + reason?: string; + /** Event message. */ + message?: string; + /** Event Last seen. */ + lastSeenTime?: Date; +} + +export function podEventDeserializer(item: any): PodEvent { + return { + type: item["type"], + reason: item["reason"], + message: item["message"], + lastSeenTime: !item["lastSeenTime"] ? item["lastSeenTime"] : new Date(item["lastSeenTime"]), + }; +} + +/** The type of pod event. */ +export enum KnownPodEventType { + /** Normal */ + Normal = "Normal", + /** Warning */ + Warning = "Warning", +} + +/** + * The type of pod event. \ + * {@link KnownPodEventType} can be used interchangeably with PodEventType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Normal** \ + * **Warning** + */ +export type PodEventType = string; + +export function replicaSetArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return replicaSetDeserializer(item); + }); +} + +/** Helm ReplicaSet status properties. */ +export interface ReplicaSet { + /** The name of the replicaSet. */ + name?: string; + /** The namespace of the replicaSet. */ + namespace?: string; + /** Desired number of pods */ + desired?: number; + /** Number of ready pods. */ + ready?: number; + /** Number of current pods. */ + current?: number; + /** Creation Time of replicaSet. */ + creationTime?: Date; +} + +export function replicaSetDeserializer(item: any): ReplicaSet { + return { + name: item["name"], + namespace: item["namespace"], + desired: item["desired"], + ready: item["ready"], + current: item["current"], + creationTime: !item["creationTime"] ? item["creationTime"] : new Date(item["creationTime"]), + }; +} + +export function statefulSetArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return statefulSetDeserializer(item); + }); +} + +/** Helm StatefulSet status properties. */ +export interface StatefulSet { + /** The name of the statefulset. */ + name?: string; + /** The namespace of the statefulset. */ + namespace?: string; + /** Desired number of pods */ + desired?: number; + /** Number of ready pods. */ + ready?: number; + /** Creation Time of statefulset. */ + creationTime?: Date; +} + +export function statefulSetDeserializer(item: any): StatefulSet { + return { + name: item["name"], + namespace: item["namespace"], + desired: item["desired"], + ready: item["ready"], + creationTime: !item["creationTime"] ? item["creationTime"] : new Date(item["creationTime"]), + }; +} + +export function daemonSetArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return daemonSetDeserializer(item); + }); +} + +/** Helm DaemonSet status properties. */ +export interface DaemonSet { + /** The name of the daemonSet. */ + name?: string; + /** The namespace of the daemonSet. */ + namespace?: string; + /** Desired number of pods */ + desired?: number; + /** Current number of pods */ + current?: number; + /** Number of Ready pods */ + ready?: number; + /** Number of upto date pods */ + upToDate?: number; + /** Number of available pods. */ + available?: number; + /** Creation Time of daemonSet. */ + creationTime?: Date; +} + +export function daemonSetDeserializer(item: any): DaemonSet { + return { + name: item["name"], + namespace: item["namespace"], + desired: item["desired"], + current: item["current"], + ready: item["ready"], + upToDate: item["upToDate"], + available: item["available"], + creationTime: !item["creationTime"] ? item["creationTime"] : new Date(item["creationTime"]), + }; +} + +/** The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a location */ +export interface ProxyResource extends Resource {} + +export function proxyResourceDeserializer(item: any): ProxyResource { + return { + id: item["id"], + name: item["name"], + type: item["type"], + systemData: !item["systemData"] + ? item["systemData"] + : systemDataDeserializer(item["systemData"]), + }; +} + +/** The response of a Component list operation. */ +export interface _ComponentListResult { + /** The Component items on this page */ + value: Component[]; + /** The link to the next page of items */ + nextLink?: string; +} + +export function _componentListResultDeserializer(item: any): _ComponentListResult { + return { + value: componentArrayDeserializer(item["value"]), + nextLink: item["nextLink"], + }; +} + +export function componentArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return componentDeserializer(item); + }); +} + +/** Network function definition group resource. */ +export interface NetworkFunctionDefinitionGroup extends TrackedResource { + /** Network function definition group properties. */ + properties?: NetworkFunctionDefinitionGroupPropertiesFormat; +} + +export function networkFunctionDefinitionGroupSerializer( + item: NetworkFunctionDefinitionGroup, +): any { + return { + tags: item["tags"], + location: item["location"], + properties: !item["properties"] + ? item["properties"] + : networkFunctionDefinitionGroupPropertiesFormatSerializer(item["properties"]), + }; +} + +export function networkFunctionDefinitionGroupDeserializer( + item: any, +): NetworkFunctionDefinitionGroup { + return { + tags: !item["tags"] + ? item["tags"] + : Object.fromEntries(Object.entries(item["tags"]).map(([k, p]: [string, any]) => [k, p])), + location: item["location"], + id: item["id"], + name: item["name"], + type: item["type"], + systemData: !item["systemData"] + ? item["systemData"] + : systemDataDeserializer(item["systemData"]), + properties: !item["properties"] + ? item["properties"] + : networkFunctionDefinitionGroupPropertiesFormatDeserializer(item["properties"]), + }; +} + +/** Network function definition group properties. */ +export interface NetworkFunctionDefinitionGroupPropertiesFormat { + /** The provisioning state of the network function definition groups resource. */ + readonly provisioningState?: ProvisioningState; + /** The network function definition group description. */ + description?: string; +} + +export function networkFunctionDefinitionGroupPropertiesFormatSerializer( + item: NetworkFunctionDefinitionGroupPropertiesFormat, +): any { + return { description: item["description"] }; +} + +export function networkFunctionDefinitionGroupPropertiesFormatDeserializer( + item: any, +): NetworkFunctionDefinitionGroupPropertiesFormat { + return { + provisioningState: item["provisioningState"], + description: item["description"], + }; +} + +/** The response of a NetworkFunctionDefinitionGroup list operation. */ +export interface _NetworkFunctionDefinitionGroupListResult { + /** The NetworkFunctionDefinitionGroup items on this page */ + value: NetworkFunctionDefinitionGroup[]; + /** The link to the next page of items */ + nextLink?: string; +} + +export function _networkFunctionDefinitionGroupListResultDeserializer( + item: any, +): _NetworkFunctionDefinitionGroupListResult { + return { + value: networkFunctionDefinitionGroupArrayDeserializer(item["value"]), + nextLink: item["nextLink"], + }; +} + +export function networkFunctionDefinitionGroupArraySerializer( + result: Array, +): any[] { + return result.map((item) => { + return networkFunctionDefinitionGroupSerializer(item); + }); +} + +export function networkFunctionDefinitionGroupArrayDeserializer( + result: Array, +): any[] { + return result.map((item) => { + return networkFunctionDefinitionGroupDeserializer(item); + }); +} + +/** Network function definition version. */ +export interface NetworkFunctionDefinitionVersion extends TrackedResource { + /** Network function definition version properties. */ + properties?: NetworkFunctionDefinitionVersionPropertiesFormatUnion; +} + +export function networkFunctionDefinitionVersionSerializer( + item: NetworkFunctionDefinitionVersion, +): any { + return { + tags: item["tags"], + location: item["location"], + properties: !item["properties"] + ? item["properties"] + : networkFunctionDefinitionVersionPropertiesFormatUnionSerializer(item["properties"]), + }; +} + +export function networkFunctionDefinitionVersionDeserializer( + item: any, +): NetworkFunctionDefinitionVersion { + return { + tags: !item["tags"] + ? item["tags"] + : Object.fromEntries(Object.entries(item["tags"]).map(([k, p]: [string, any]) => [k, p])), + location: item["location"], + id: item["id"], + name: item["name"], + type: item["type"], + systemData: !item["systemData"] + ? item["systemData"] + : systemDataDeserializer(item["systemData"]), + properties: !item["properties"] + ? item["properties"] + : networkFunctionDefinitionVersionPropertiesFormatUnionDeserializer(item["properties"]), + }; +} + +/** Network function definition version properties. */ +export interface NetworkFunctionDefinitionVersionPropertiesFormat { + /** The provisioning state of the network function definition version resource. */ + readonly provisioningState?: ProvisioningState; + /** The network function definition version state. */ + readonly versionState?: VersionState; + /** The network function definition version description. */ + description?: string; + /** The deployment parameters of the network function definition version. */ + deployParameters?: string; + /** The network function type. */ + /** The discriminator possible values: ContainerizedNetworkFunction, VirtualNetworkFunction */ + networkFunctionType: NetworkFunctionType; +} + +export function networkFunctionDefinitionVersionPropertiesFormatSerializer( + item: NetworkFunctionDefinitionVersionPropertiesFormat, +): any { + return { + description: item["description"], + deployParameters: item["deployParameters"], + networkFunctionType: item["networkFunctionType"], + }; +} + +export function networkFunctionDefinitionVersionPropertiesFormatDeserializer( + item: any, +): NetworkFunctionDefinitionVersionPropertiesFormat { + return { + provisioningState: item["provisioningState"], + versionState: item["versionState"], + description: item["description"], + deployParameters: item["deployParameters"], + networkFunctionType: item["networkFunctionType"], + }; +} + +/** Alias for NetworkFunctionDefinitionVersionPropertiesFormatUnion */ +export type NetworkFunctionDefinitionVersionPropertiesFormatUnion = + | ContainerizedNetworkFunctionDefinitionVersion + | VirtualNetworkFunctionNetworkFunctionDefinitionVersion + | NetworkFunctionDefinitionVersionPropertiesFormat; + +export function networkFunctionDefinitionVersionPropertiesFormatUnionSerializer( + item: NetworkFunctionDefinitionVersionPropertiesFormatUnion, +): any { + switch (item.networkFunctionType) { + case "ContainerizedNetworkFunction": + return containerizedNetworkFunctionDefinitionVersionSerializer( + item as ContainerizedNetworkFunctionDefinitionVersion, + ); + + case "VirtualNetworkFunction": + return virtualNetworkFunctionNetworkFunctionDefinitionVersionSerializer( + item as VirtualNetworkFunctionNetworkFunctionDefinitionVersion, + ); + + default: + return networkFunctionDefinitionVersionPropertiesFormatSerializer(item); + } +} + +export function networkFunctionDefinitionVersionPropertiesFormatUnionDeserializer( + item: any, +): NetworkFunctionDefinitionVersionPropertiesFormatUnion { + switch (item.networkFunctionType) { + case "ContainerizedNetworkFunction": + return containerizedNetworkFunctionDefinitionVersionDeserializer( + item as ContainerizedNetworkFunctionDefinitionVersion, + ); + + case "VirtualNetworkFunction": + return virtualNetworkFunctionNetworkFunctionDefinitionVersionDeserializer( + item as VirtualNetworkFunctionNetworkFunctionDefinitionVersion, + ); + + default: + return networkFunctionDefinitionVersionPropertiesFormatDeserializer(item); + } +} + +/** The network function type. */ +export enum KnownNetworkFunctionType { + /** Unknown */ + Unknown = "Unknown", + /** VirtualNetworkFunction */ + VirtualNetworkFunction = "VirtualNetworkFunction", + /** ContainerizedNetworkFunction */ + ContainerizedNetworkFunction = "ContainerizedNetworkFunction", +} + +/** + * The network function type. \ + * {@link KnownNetworkFunctionType} can be used interchangeably with NetworkFunctionType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Unknown** \ + * **VirtualNetworkFunction** \ + * **ContainerizedNetworkFunction** + */ +export type NetworkFunctionType = string; + +/** Containerized network function network function definition version properties. */ +export interface ContainerizedNetworkFunctionDefinitionVersion extends NetworkFunctionDefinitionVersionPropertiesFormat { + /** Containerized network function template. */ + networkFunctionTemplate?: ContainerizedNetworkFunctionTemplateUnion; + /** The network function type. */ + networkFunctionType: "ContainerizedNetworkFunction"; +} + +export function containerizedNetworkFunctionDefinitionVersionSerializer( + item: ContainerizedNetworkFunctionDefinitionVersion, +): any { + return { + description: item["description"], + deployParameters: item["deployParameters"], + networkFunctionType: item["networkFunctionType"], + networkFunctionTemplate: !item["networkFunctionTemplate"] + ? item["networkFunctionTemplate"] + : containerizedNetworkFunctionTemplateUnionSerializer(item["networkFunctionTemplate"]), + }; +} + +export function containerizedNetworkFunctionDefinitionVersionDeserializer( + item: any, +): ContainerizedNetworkFunctionDefinitionVersion { + return { + provisioningState: item["provisioningState"], + versionState: item["versionState"], + description: item["description"], + deployParameters: item["deployParameters"], + networkFunctionType: item["networkFunctionType"], + networkFunctionTemplate: !item["networkFunctionTemplate"] + ? item["networkFunctionTemplate"] + : containerizedNetworkFunctionTemplateUnionDeserializer(item["networkFunctionTemplate"]), + }; +} + +/** Containerized network function template. */ +export interface ContainerizedNetworkFunctionTemplate { + /** The network function type. */ + /** The discriminator possible values: AzureArcKubernetes */ + nfviType: ContainerizedNetworkFunctionNfviType; +} + +export function containerizedNetworkFunctionTemplateSerializer( + item: ContainerizedNetworkFunctionTemplate, +): any { + return { nfviType: item["nfviType"] }; +} + +export function containerizedNetworkFunctionTemplateDeserializer( + item: any, +): ContainerizedNetworkFunctionTemplate { + return { + nfviType: item["nfviType"], + }; +} + +/** Alias for ContainerizedNetworkFunctionTemplateUnion */ +export type ContainerizedNetworkFunctionTemplateUnion = + | AzureArcKubernetesNetworkFunctionTemplate + | ContainerizedNetworkFunctionTemplate; + +export function containerizedNetworkFunctionTemplateUnionSerializer( + item: ContainerizedNetworkFunctionTemplateUnion, +): any { + switch (item.nfviType) { + case "AzureArcKubernetes": + return azureArcKubernetesNetworkFunctionTemplateSerializer( + item as AzureArcKubernetesNetworkFunctionTemplate, + ); + + default: + return containerizedNetworkFunctionTemplateSerializer(item); + } +} + +export function containerizedNetworkFunctionTemplateUnionDeserializer( + item: any, +): ContainerizedNetworkFunctionTemplateUnion { + switch (item.nfviType) { + case "AzureArcKubernetes": + return azureArcKubernetesNetworkFunctionTemplateDeserializer( + item as AzureArcKubernetesNetworkFunctionTemplate, + ); + + default: + return containerizedNetworkFunctionTemplateDeserializer(item); + } +} + +/** The network function type. */ +export enum KnownContainerizedNetworkFunctionNfviType { + /** Unknown */ + Unknown = "Unknown", + /** AzureArcKubernetes */ + AzureArcKubernetes = "AzureArcKubernetes", +} + +/** + * The network function type. \ + * {@link KnownContainerizedNetworkFunctionNfviType} can be used interchangeably with ContainerizedNetworkFunctionNfviType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Unknown** \ + * **AzureArcKubernetes** + */ +export type ContainerizedNetworkFunctionNfviType = string; + +/** Azure Arc kubernetes network function template. */ +export interface AzureArcKubernetesNetworkFunctionTemplate extends ContainerizedNetworkFunctionTemplate { + /** Network function applications. */ + networkFunctionApplications?: AzureArcKubernetesNetworkFunctionApplicationUnion[]; + /** The network function type. */ + nfviType: "AzureArcKubernetes"; +} + +export function azureArcKubernetesNetworkFunctionTemplateSerializer( + item: AzureArcKubernetesNetworkFunctionTemplate, +): any { + return { + nfviType: item["nfviType"], + networkFunctionApplications: !item["networkFunctionApplications"] + ? item["networkFunctionApplications"] + : azureArcKubernetesNetworkFunctionApplicationUnionArraySerializer( + item["networkFunctionApplications"], + ), + }; +} + +export function azureArcKubernetesNetworkFunctionTemplateDeserializer( + item: any, +): AzureArcKubernetesNetworkFunctionTemplate { + return { + nfviType: item["nfviType"], + networkFunctionApplications: !item["networkFunctionApplications"] + ? item["networkFunctionApplications"] + : azureArcKubernetesNetworkFunctionApplicationUnionArrayDeserializer( + item["networkFunctionApplications"], + ), + }; +} + +export function azureArcKubernetesNetworkFunctionApplicationUnionArraySerializer( + result: Array, +): any[] { + return result.map((item) => { + return azureArcKubernetesNetworkFunctionApplicationUnionSerializer(item); + }); +} + +export function azureArcKubernetesNetworkFunctionApplicationUnionArrayDeserializer( + result: Array, +): any[] { + return result.map((item) => { + return azureArcKubernetesNetworkFunctionApplicationUnionDeserializer(item); + }); +} + +/** Azure arc kubernetes network function application definition. */ +export interface AzureArcKubernetesNetworkFunctionApplication extends NetworkFunctionApplication { + /** The artifact type. */ + /** The discriminator possible values: HelmPackage */ + artifactType: AzureArcKubernetesArtifactType; +} + +export function azureArcKubernetesNetworkFunctionApplicationSerializer( + item: AzureArcKubernetesNetworkFunctionApplication, +): any { + return { + name: item["name"], + dependsOnProfile: !item["dependsOnProfile"] + ? item["dependsOnProfile"] + : dependsOnProfileSerializer(item["dependsOnProfile"]), + artifactType: item["artifactType"], + }; +} + +export function azureArcKubernetesNetworkFunctionApplicationDeserializer( + item: any, +): AzureArcKubernetesNetworkFunctionApplication { + return { + name: item["name"], + dependsOnProfile: !item["dependsOnProfile"] + ? item["dependsOnProfile"] + : dependsOnProfileDeserializer(item["dependsOnProfile"]), + artifactType: item["artifactType"], + }; +} + +/** Alias for AzureArcKubernetesNetworkFunctionApplicationUnion */ +export type AzureArcKubernetesNetworkFunctionApplicationUnion = + | AzureArcKubernetesHelmApplication + | AzureArcKubernetesNetworkFunctionApplication; + +export function azureArcKubernetesNetworkFunctionApplicationUnionSerializer( + item: AzureArcKubernetesNetworkFunctionApplicationUnion, +): any { + switch (item.artifactType) { + case "HelmPackage": + return azureArcKubernetesHelmApplicationSerializer(item as AzureArcKubernetesHelmApplication); + + default: + return azureArcKubernetesNetworkFunctionApplicationSerializer(item); + } +} + +export function azureArcKubernetesNetworkFunctionApplicationUnionDeserializer( + item: any, +): AzureArcKubernetesNetworkFunctionApplicationUnion { + switch (item.artifactType) { + case "HelmPackage": + return azureArcKubernetesHelmApplicationDeserializer( + item as AzureArcKubernetesHelmApplication, + ); + + default: + return azureArcKubernetesNetworkFunctionApplicationDeserializer(item); + } +} + +/** The artifact type. */ +export enum KnownAzureArcKubernetesArtifactType { + /** Unknown */ + Unknown = "Unknown", + /** HelmPackage */ + HelmPackage = "HelmPackage", +} + +/** + * The artifact type. \ + * {@link KnownAzureArcKubernetesArtifactType} can be used interchangeably with AzureArcKubernetesArtifactType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Unknown** \ + * **HelmPackage** + */ +export type AzureArcKubernetesArtifactType = string; + +/** Azure arc kubernetes helm application configurations. */ +export interface AzureArcKubernetesHelmApplication extends AzureArcKubernetesNetworkFunctionApplication { + /** Azure arc kubernetes artifact profile. */ + artifactProfile?: AzureArcKubernetesArtifactProfile; + /** Deploy mapping rule profile. */ + deployParametersMappingRuleProfile?: AzureArcKubernetesDeployMappingRuleProfile; + /** The artifact type. */ + artifactType: "HelmPackage"; +} + +export function azureArcKubernetesHelmApplicationSerializer( + item: AzureArcKubernetesHelmApplication, +): any { + return { + artifactType: item["artifactType"], + name: item["name"], + dependsOnProfile: !item["dependsOnProfile"] + ? item["dependsOnProfile"] + : dependsOnProfileSerializer(item["dependsOnProfile"]), + artifactProfile: !item["artifactProfile"] + ? item["artifactProfile"] + : azureArcKubernetesArtifactProfileSerializer(item["artifactProfile"]), + deployParametersMappingRuleProfile: !item["deployParametersMappingRuleProfile"] + ? item["deployParametersMappingRuleProfile"] + : azureArcKubernetesDeployMappingRuleProfileSerializer( + item["deployParametersMappingRuleProfile"], + ), + }; +} + +export function azureArcKubernetesHelmApplicationDeserializer( + item: any, +): AzureArcKubernetesHelmApplication { + return { + artifactType: item["artifactType"], + name: item["name"], + dependsOnProfile: !item["dependsOnProfile"] + ? item["dependsOnProfile"] + : dependsOnProfileDeserializer(item["dependsOnProfile"]), + artifactProfile: !item["artifactProfile"] + ? item["artifactProfile"] + : azureArcKubernetesArtifactProfileDeserializer(item["artifactProfile"]), + deployParametersMappingRuleProfile: !item["deployParametersMappingRuleProfile"] + ? item["deployParametersMappingRuleProfile"] + : azureArcKubernetesDeployMappingRuleProfileDeserializer( + item["deployParametersMappingRuleProfile"], + ), + }; +} + +/** Azure arc kubernetes artifact profile properties. */ +export interface AzureArcKubernetesArtifactProfile extends ArtifactProfile { + /** Helm artifact profile. */ + helmArtifactProfile?: HelmArtifactProfile; +} + +export function azureArcKubernetesArtifactProfileSerializer( + item: AzureArcKubernetesArtifactProfile, +): any { + return { + artifactStore: !item["artifactStore"] + ? item["artifactStore"] + : referencedResourceSerializer(item["artifactStore"]), + helmArtifactProfile: !item["helmArtifactProfile"] + ? item["helmArtifactProfile"] + : helmArtifactProfileSerializer(item["helmArtifactProfile"]), + }; +} + +export function azureArcKubernetesArtifactProfileDeserializer( + item: any, +): AzureArcKubernetesArtifactProfile { + return { + artifactStore: !item["artifactStore"] + ? item["artifactStore"] + : referencedResourceDeserializer(item["artifactStore"]), + helmArtifactProfile: !item["helmArtifactProfile"] + ? item["helmArtifactProfile"] + : helmArtifactProfileDeserializer(item["helmArtifactProfile"]), + }; +} + +/** Helm artifact profile. */ +export interface HelmArtifactProfile { + /** Helm package name. */ + helmPackageName?: string; + /** Helm package version range. */ + helmPackageVersionRange?: string; + /** The registry values path list. */ + registryValuesPaths?: string[]; + /** The image pull secrets values path list. */ + imagePullSecretsValuesPaths?: string[]; +} + +export function helmArtifactProfileSerializer(item: HelmArtifactProfile): any { + return { + helmPackageName: item["helmPackageName"], + helmPackageVersionRange: item["helmPackageVersionRange"], + registryValuesPaths: !item["registryValuesPaths"] + ? item["registryValuesPaths"] + : item["registryValuesPaths"].map((p: any) => { + return p; + }), + imagePullSecretsValuesPaths: !item["imagePullSecretsValuesPaths"] + ? item["imagePullSecretsValuesPaths"] + : item["imagePullSecretsValuesPaths"].map((p: any) => { + return p; + }), + }; +} + +export function helmArtifactProfileDeserializer(item: any): HelmArtifactProfile { + return { + helmPackageName: item["helmPackageName"], + helmPackageVersionRange: item["helmPackageVersionRange"], + registryValuesPaths: !item["registryValuesPaths"] + ? item["registryValuesPaths"] + : item["registryValuesPaths"].map((p: any) => { + return p; + }), + imagePullSecretsValuesPaths: !item["imagePullSecretsValuesPaths"] + ? item["imagePullSecretsValuesPaths"] + : item["imagePullSecretsValuesPaths"].map((p: any) => { + return p; + }), + }; +} + +/** Azure arc kubernetes deploy mapping rule profile. */ +export interface AzureArcKubernetesDeployMappingRuleProfile extends MappingRuleProfile { + /** The helm mapping rule profile. */ + helmMappingRuleProfile?: HelmMappingRuleProfile; +} + +export function azureArcKubernetesDeployMappingRuleProfileSerializer( + item: AzureArcKubernetesDeployMappingRuleProfile, +): any { + return { + applicationEnablement: item["applicationEnablement"], + helmMappingRuleProfile: !item["helmMappingRuleProfile"] + ? item["helmMappingRuleProfile"] + : helmMappingRuleProfileSerializer(item["helmMappingRuleProfile"]), + }; +} + +export function azureArcKubernetesDeployMappingRuleProfileDeserializer( + item: any, +): AzureArcKubernetesDeployMappingRuleProfile { + return { + applicationEnablement: item["applicationEnablement"], + helmMappingRuleProfile: !item["helmMappingRuleProfile"] + ? item["helmMappingRuleProfile"] + : helmMappingRuleProfileDeserializer(item["helmMappingRuleProfile"]), + }; +} + +/** Helm mapping rule profile */ +export interface HelmMappingRuleProfile { + /** Helm release namespace. */ + releaseNamespace?: string; + /** Helm release name. */ + releaseName?: string; + /** Helm package version. */ + helmPackageVersion?: string; + /** Helm release values. */ + values?: string; + /** The helm deployment options */ + options?: HelmMappingRuleProfileOptions; +} + +export function helmMappingRuleProfileSerializer(item: HelmMappingRuleProfile): any { + return { + releaseNamespace: item["releaseNamespace"], + releaseName: item["releaseName"], + helmPackageVersion: item["helmPackageVersion"], + values: item["values"], + options: !item["options"] + ? item["options"] + : helmMappingRuleProfileOptionsSerializer(item["options"]), + }; +} + +export function helmMappingRuleProfileDeserializer(item: any): HelmMappingRuleProfile { + return { + releaseNamespace: item["releaseNamespace"], + releaseName: item["releaseName"], + helmPackageVersion: item["helmPackageVersion"], + values: item["values"], + options: !item["options"] + ? item["options"] + : helmMappingRuleProfileOptionsDeserializer(item["options"]), + }; +} + +/** The helm deployment options */ +export interface HelmMappingRuleProfileOptions { + /** The helm deployment install options */ + installOptions?: HelmInstallOptions; + /** The helm deployment upgrade options */ + upgradeOptions?: HelmUpgradeOptions; +} + +export function helmMappingRuleProfileOptionsSerializer(item: HelmMappingRuleProfileOptions): any { + return { + installOptions: !item["installOptions"] + ? item["installOptions"] + : helmInstallOptionsSerializer(item["installOptions"]), + upgradeOptions: !item["upgradeOptions"] + ? item["upgradeOptions"] + : helmUpgradeOptionsSerializer(item["upgradeOptions"]), + }; +} + +export function helmMappingRuleProfileOptionsDeserializer( + item: any, +): HelmMappingRuleProfileOptions { + return { + installOptions: !item["installOptions"] + ? item["installOptions"] + : helmInstallOptionsDeserializer(item["installOptions"]), + upgradeOptions: !item["upgradeOptions"] + ? item["upgradeOptions"] + : helmUpgradeOptionsDeserializer(item["upgradeOptions"]), + }; +} + +/** The helm deployment install options */ +export interface HelmInstallOptions { + /** The helm deployment atomic options */ + atomic?: string; + /** The helm deployment wait options */ + wait?: string; + /** The helm deployment timeout options */ + timeout?: string; +} + +export function helmInstallOptionsSerializer(item: HelmInstallOptions): any { + return { atomic: item["atomic"], wait: item["wait"], timeout: item["timeout"] }; +} + +export function helmInstallOptionsDeserializer(item: any): HelmInstallOptions { + return { + atomic: item["atomic"], + wait: item["wait"], + timeout: item["timeout"], + }; +} + +/** The helm deployment install options */ +export interface HelmUpgradeOptions { + /** The helm deployment atomic options */ + atomic?: string; + /** The helm deployment wait options */ + wait?: string; + /** The helm deployment timeout options */ + timeout?: string; +} + +export function helmUpgradeOptionsSerializer(item: HelmUpgradeOptions): any { + return { atomic: item["atomic"], wait: item["wait"], timeout: item["timeout"] }; +} + +export function helmUpgradeOptionsDeserializer(item: any): HelmUpgradeOptions { + return { + atomic: item["atomic"], + wait: item["wait"], + timeout: item["timeout"], + }; +} + +/** Virtual network function network function definition version properties. */ +export interface VirtualNetworkFunctionNetworkFunctionDefinitionVersion extends NetworkFunctionDefinitionVersionPropertiesFormat { + /** Virtual network function template. */ + networkFunctionTemplate?: VirtualNetworkFunctionTemplateUnion; + /** The network function type. */ + networkFunctionType: "VirtualNetworkFunction"; +} + +export function virtualNetworkFunctionNetworkFunctionDefinitionVersionSerializer( + item: VirtualNetworkFunctionNetworkFunctionDefinitionVersion, +): any { + return { + description: item["description"], + deployParameters: item["deployParameters"], + networkFunctionType: item["networkFunctionType"], + networkFunctionTemplate: !item["networkFunctionTemplate"] + ? item["networkFunctionTemplate"] + : virtualNetworkFunctionTemplateUnionSerializer(item["networkFunctionTemplate"]), + }; +} + +export function virtualNetworkFunctionNetworkFunctionDefinitionVersionDeserializer( + item: any, +): VirtualNetworkFunctionNetworkFunctionDefinitionVersion { + return { + provisioningState: item["provisioningState"], + versionState: item["versionState"], + description: item["description"], + deployParameters: item["deployParameters"], + networkFunctionType: item["networkFunctionType"], + networkFunctionTemplate: !item["networkFunctionTemplate"] + ? item["networkFunctionTemplate"] + : virtualNetworkFunctionTemplateUnionDeserializer(item["networkFunctionTemplate"]), + }; +} + +/** Virtual network function template. */ +export interface VirtualNetworkFunctionTemplate { + /** The network function type. */ + /** The discriminator possible values: AzureCore, AzureOperatorNexus */ + nfviType: VirtualNetworkFunctionNfviType; +} + +export function virtualNetworkFunctionTemplateSerializer( + item: VirtualNetworkFunctionTemplate, +): any { + return { nfviType: item["nfviType"] }; +} + +export function virtualNetworkFunctionTemplateDeserializer( + item: any, +): VirtualNetworkFunctionTemplate { + return { + nfviType: item["nfviType"], + }; +} + +/** Alias for VirtualNetworkFunctionTemplateUnion */ +export type VirtualNetworkFunctionTemplateUnion = + | AzureCoreNetworkFunctionTemplate + | AzureOperatorNexusNetworkFunctionTemplate + | VirtualNetworkFunctionTemplate; + +export function virtualNetworkFunctionTemplateUnionSerializer( + item: VirtualNetworkFunctionTemplateUnion, +): any { + switch (item.nfviType) { + case "AzureCore": + return azureCoreNetworkFunctionTemplateSerializer(item as AzureCoreNetworkFunctionTemplate); + + case "AzureOperatorNexus": + return azureOperatorNexusNetworkFunctionTemplateSerializer( + item as AzureOperatorNexusNetworkFunctionTemplate, + ); + + default: + return virtualNetworkFunctionTemplateSerializer(item); + } +} + +export function virtualNetworkFunctionTemplateUnionDeserializer( + item: any, +): VirtualNetworkFunctionTemplateUnion { + switch (item.nfviType) { + case "AzureCore": + return azureCoreNetworkFunctionTemplateDeserializer(item as AzureCoreNetworkFunctionTemplate); + + case "AzureOperatorNexus": + return azureOperatorNexusNetworkFunctionTemplateDeserializer( + item as AzureOperatorNexusNetworkFunctionTemplate, + ); + + default: + return virtualNetworkFunctionTemplateDeserializer(item); + } +} + +/** The network function type. */ +export enum KnownVirtualNetworkFunctionNfviType { + /** Unknown */ + Unknown = "Unknown", + /** AzureCore */ + AzureCore = "AzureCore", + /** AzureOperatorNexus */ + AzureOperatorNexus = "AzureOperatorNexus", +} + +/** + * The network function type. \ + * {@link KnownVirtualNetworkFunctionNfviType} can be used interchangeably with VirtualNetworkFunctionNfviType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Unknown** \ + * **AzureCore** \ + * **AzureOperatorNexus** + */ +export type VirtualNetworkFunctionNfviType = string; + +/** Azure virtual network function template. */ +export interface AzureCoreNetworkFunctionTemplate extends VirtualNetworkFunctionTemplate { + /** Network function applications. */ + networkFunctionApplications?: AzureCoreNetworkFunctionApplicationUnion[]; + /** The network function type. */ + nfviType: "AzureCore"; +} + +export function azureCoreNetworkFunctionTemplateSerializer( + item: AzureCoreNetworkFunctionTemplate, +): any { + return { + nfviType: item["nfviType"], + networkFunctionApplications: !item["networkFunctionApplications"] + ? item["networkFunctionApplications"] + : azureCoreNetworkFunctionApplicationUnionArraySerializer( + item["networkFunctionApplications"], + ), + }; +} + +export function azureCoreNetworkFunctionTemplateDeserializer( + item: any, +): AzureCoreNetworkFunctionTemplate { + return { + nfviType: item["nfviType"], + networkFunctionApplications: !item["networkFunctionApplications"] + ? item["networkFunctionApplications"] + : azureCoreNetworkFunctionApplicationUnionArrayDeserializer( + item["networkFunctionApplications"], + ), + }; +} + +export function azureCoreNetworkFunctionApplicationUnionArraySerializer( + result: Array, +): any[] { + return result.map((item) => { + return azureCoreNetworkFunctionApplicationUnionSerializer(item); + }); +} + +export function azureCoreNetworkFunctionApplicationUnionArrayDeserializer( + result: Array, +): any[] { + return result.map((item) => { + return azureCoreNetworkFunctionApplicationUnionDeserializer(item); + }); +} + +/** Azure virtual network function application definition. */ +export interface AzureCoreNetworkFunctionApplication extends NetworkFunctionApplication { + /** The artifact type. */ + /** The discriminator possible values: VhdImageFile, ArmTemplate */ + artifactType: AzureCoreArtifactType; +} + +export function azureCoreNetworkFunctionApplicationSerializer( + item: AzureCoreNetworkFunctionApplication, +): any { + return { + name: item["name"], + dependsOnProfile: !item["dependsOnProfile"] + ? item["dependsOnProfile"] + : dependsOnProfileSerializer(item["dependsOnProfile"]), + artifactType: item["artifactType"], + }; +} + +export function azureCoreNetworkFunctionApplicationDeserializer( + item: any, +): AzureCoreNetworkFunctionApplication { + return { + name: item["name"], + dependsOnProfile: !item["dependsOnProfile"] + ? item["dependsOnProfile"] + : dependsOnProfileDeserializer(item["dependsOnProfile"]), + artifactType: item["artifactType"], + }; +} + +/** Alias for AzureCoreNetworkFunctionApplicationUnion */ +export type AzureCoreNetworkFunctionApplicationUnion = + | AzureCoreNetworkFunctionVhdApplication + | AzureCoreNetworkFunctionArmTemplateApplication + | AzureCoreNetworkFunctionApplication; + +export function azureCoreNetworkFunctionApplicationUnionSerializer( + item: AzureCoreNetworkFunctionApplicationUnion, +): any { + switch (item.artifactType) { + case "VhdImageFile": + return azureCoreNetworkFunctionVhdApplicationSerializer( + item as AzureCoreNetworkFunctionVhdApplication, + ); + + case "ArmTemplate": + return azureCoreNetworkFunctionArmTemplateApplicationSerializer( + item as AzureCoreNetworkFunctionArmTemplateApplication, + ); + + default: + return azureCoreNetworkFunctionApplicationSerializer(item); + } +} + +export function azureCoreNetworkFunctionApplicationUnionDeserializer( + item: any, +): AzureCoreNetworkFunctionApplicationUnion { + switch (item.artifactType) { + case "VhdImageFile": + return azureCoreNetworkFunctionVhdApplicationDeserializer( + item as AzureCoreNetworkFunctionVhdApplication, + ); + + case "ArmTemplate": + return azureCoreNetworkFunctionArmTemplateApplicationDeserializer( + item as AzureCoreNetworkFunctionArmTemplateApplication, + ); + + default: + return azureCoreNetworkFunctionApplicationDeserializer(item); + } +} + +/** The artifact type. */ +export enum KnownAzureCoreArtifactType { + /** Unknown */ + Unknown = "Unknown", + /** VhdImageFile */ + VhdImageFile = "VhdImageFile", + /** ArmTemplate */ + ArmTemplate = "ArmTemplate", +} + +/** + * The artifact type. \ + * {@link KnownAzureCoreArtifactType} can be used interchangeably with AzureCoreArtifactType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Unknown** \ + * **VhdImageFile** \ + * **ArmTemplate** + */ +export type AzureCoreArtifactType = string; + +/** Azure core network function vhd application definition. */ +export interface AzureCoreNetworkFunctionVhdApplication extends AzureCoreNetworkFunctionApplication { + /** Azure vhd image artifact profile. */ + artifactProfile?: AzureCoreVhdImageArtifactProfile; + /** Deploy mapping rule profile. */ + deployParametersMappingRuleProfile?: AzureCoreVhdImageDeployMappingRuleProfile; + /** The artifact type. */ + artifactType: "VhdImageFile"; +} + +export function azureCoreNetworkFunctionVhdApplicationSerializer( + item: AzureCoreNetworkFunctionVhdApplication, +): any { + return { + artifactType: item["artifactType"], + name: item["name"], + dependsOnProfile: !item["dependsOnProfile"] + ? item["dependsOnProfile"] + : dependsOnProfileSerializer(item["dependsOnProfile"]), + artifactProfile: !item["artifactProfile"] + ? item["artifactProfile"] + : azureCoreVhdImageArtifactProfileSerializer(item["artifactProfile"]), + deployParametersMappingRuleProfile: !item["deployParametersMappingRuleProfile"] + ? item["deployParametersMappingRuleProfile"] + : azureCoreVhdImageDeployMappingRuleProfileSerializer( + item["deployParametersMappingRuleProfile"], + ), + }; +} + +export function azureCoreNetworkFunctionVhdApplicationDeserializer( + item: any, +): AzureCoreNetworkFunctionVhdApplication { + return { + artifactType: item["artifactType"], + name: item["name"], + dependsOnProfile: !item["dependsOnProfile"] + ? item["dependsOnProfile"] + : dependsOnProfileDeserializer(item["dependsOnProfile"]), + artifactProfile: !item["artifactProfile"] + ? item["artifactProfile"] + : azureCoreVhdImageArtifactProfileDeserializer(item["artifactProfile"]), + deployParametersMappingRuleProfile: !item["deployParametersMappingRuleProfile"] + ? item["deployParametersMappingRuleProfile"] + : azureCoreVhdImageDeployMappingRuleProfileDeserializer( + item["deployParametersMappingRuleProfile"], + ), + }; +} + +/** Azure vhd artifact profile properties. */ +export interface AzureCoreVhdImageArtifactProfile extends ArtifactProfile { + /** Vhd artifact profile. */ + vhdArtifactProfile?: VhdImageArtifactProfile; +} + +export function azureCoreVhdImageArtifactProfileSerializer( + item: AzureCoreVhdImageArtifactProfile, +): any { + return { + artifactStore: !item["artifactStore"] + ? item["artifactStore"] + : referencedResourceSerializer(item["artifactStore"]), + vhdArtifactProfile: !item["vhdArtifactProfile"] + ? item["vhdArtifactProfile"] + : vhdImageArtifactProfileSerializer(item["vhdArtifactProfile"]), + }; +} + +export function azureCoreVhdImageArtifactProfileDeserializer( + item: any, +): AzureCoreVhdImageArtifactProfile { + return { + artifactStore: !item["artifactStore"] + ? item["artifactStore"] + : referencedResourceDeserializer(item["artifactStore"]), + vhdArtifactProfile: !item["vhdArtifactProfile"] + ? item["vhdArtifactProfile"] + : vhdImageArtifactProfileDeserializer(item["vhdArtifactProfile"]), + }; +} + +/** Vhd artifact profile. */ +export interface VhdImageArtifactProfile { + /** Vhd name. */ + vhdName?: string; + /** Vhd version. */ + vhdVersion?: string; +} + +export function vhdImageArtifactProfileSerializer(item: VhdImageArtifactProfile): any { + return { vhdName: item["vhdName"], vhdVersion: item["vhdVersion"] }; +} + +export function vhdImageArtifactProfileDeserializer(item: any): VhdImageArtifactProfile { + return { + vhdName: item["vhdName"], + vhdVersion: item["vhdVersion"], + }; +} + +/** Azure vhd deploy mapping rule profile. */ +export interface AzureCoreVhdImageDeployMappingRuleProfile extends MappingRuleProfile { + /** The vhd mapping rule profile. */ + vhdImageMappingRuleProfile?: VhdImageMappingRuleProfile; +} + +export function azureCoreVhdImageDeployMappingRuleProfileSerializer( + item: AzureCoreVhdImageDeployMappingRuleProfile, +): any { + return { + applicationEnablement: item["applicationEnablement"], + vhdImageMappingRuleProfile: !item["vhdImageMappingRuleProfile"] + ? item["vhdImageMappingRuleProfile"] + : vhdImageMappingRuleProfileSerializer(item["vhdImageMappingRuleProfile"]), + }; +} + +export function azureCoreVhdImageDeployMappingRuleProfileDeserializer( + item: any, +): AzureCoreVhdImageDeployMappingRuleProfile { + return { + applicationEnablement: item["applicationEnablement"], + vhdImageMappingRuleProfile: !item["vhdImageMappingRuleProfile"] + ? item["vhdImageMappingRuleProfile"] + : vhdImageMappingRuleProfileDeserializer(item["vhdImageMappingRuleProfile"]), + }; +} + +/** Vhd mapping rule profile */ +export interface VhdImageMappingRuleProfile { + /** List of values. */ + userConfiguration?: string; +} + +export function vhdImageMappingRuleProfileSerializer(item: VhdImageMappingRuleProfile): any { + return { userConfiguration: item["userConfiguration"] }; +} + +export function vhdImageMappingRuleProfileDeserializer(item: any): VhdImageMappingRuleProfile { + return { + userConfiguration: item["userConfiguration"], + }; +} + +/** Azure core network function Template application definition. */ +export interface AzureCoreNetworkFunctionArmTemplateApplication extends AzureCoreNetworkFunctionApplication { + /** Azure template artifact profile. */ + artifactProfile?: AzureCoreArmTemplateArtifactProfile; + /** Deploy mapping rule profile. */ + deployParametersMappingRuleProfile?: AzureCoreArmTemplateDeployMappingRuleProfile; + /** The artifact type. */ + artifactType: "ArmTemplate"; +} + +export function azureCoreNetworkFunctionArmTemplateApplicationSerializer( + item: AzureCoreNetworkFunctionArmTemplateApplication, +): any { + return { + artifactType: item["artifactType"], + name: item["name"], + dependsOnProfile: !item["dependsOnProfile"] + ? item["dependsOnProfile"] + : dependsOnProfileSerializer(item["dependsOnProfile"]), + artifactProfile: !item["artifactProfile"] + ? item["artifactProfile"] + : azureCoreArmTemplateArtifactProfileSerializer(item["artifactProfile"]), + deployParametersMappingRuleProfile: !item["deployParametersMappingRuleProfile"] + ? item["deployParametersMappingRuleProfile"] + : azureCoreArmTemplateDeployMappingRuleProfileSerializer( + item["deployParametersMappingRuleProfile"], + ), + }; +} + +export function azureCoreNetworkFunctionArmTemplateApplicationDeserializer( + item: any, +): AzureCoreNetworkFunctionArmTemplateApplication { + return { + artifactType: item["artifactType"], + name: item["name"], + dependsOnProfile: !item["dependsOnProfile"] + ? item["dependsOnProfile"] + : dependsOnProfileDeserializer(item["dependsOnProfile"]), + artifactProfile: !item["artifactProfile"] + ? item["artifactProfile"] + : azureCoreArmTemplateArtifactProfileDeserializer(item["artifactProfile"]), + deployParametersMappingRuleProfile: !item["deployParametersMappingRuleProfile"] + ? item["deployParametersMappingRuleProfile"] + : azureCoreArmTemplateDeployMappingRuleProfileDeserializer( + item["deployParametersMappingRuleProfile"], + ), + }; +} + +/** Azure template artifact profile properties. */ +export interface AzureCoreArmTemplateArtifactProfile extends ArtifactProfile { + /** Template artifact profile. */ + templateArtifactProfile?: ArmTemplateArtifactProfile; +} + +export function azureCoreArmTemplateArtifactProfileSerializer( + item: AzureCoreArmTemplateArtifactProfile, +): any { + return { + artifactStore: !item["artifactStore"] + ? item["artifactStore"] + : referencedResourceSerializer(item["artifactStore"]), + templateArtifactProfile: !item["templateArtifactProfile"] + ? item["templateArtifactProfile"] + : armTemplateArtifactProfileSerializer(item["templateArtifactProfile"]), + }; +} + +export function azureCoreArmTemplateArtifactProfileDeserializer( + item: any, +): AzureCoreArmTemplateArtifactProfile { + return { + artifactStore: !item["artifactStore"] + ? item["artifactStore"] + : referencedResourceDeserializer(item["artifactStore"]), + templateArtifactProfile: !item["templateArtifactProfile"] + ? item["templateArtifactProfile"] + : armTemplateArtifactProfileDeserializer(item["templateArtifactProfile"]), + }; +} + +/** Template artifact profile. */ +export interface ArmTemplateArtifactProfile { + /** Template name. */ + templateName?: string; + /** Template version. */ + templateVersion?: string; +} + +export function armTemplateArtifactProfileSerializer(item: ArmTemplateArtifactProfile): any { + return { templateName: item["templateName"], templateVersion: item["templateVersion"] }; +} + +export function armTemplateArtifactProfileDeserializer(item: any): ArmTemplateArtifactProfile { + return { + templateName: item["templateName"], + templateVersion: item["templateVersion"], + }; +} + +/** Azure template deploy mapping rule profile. */ +export interface AzureCoreArmTemplateDeployMappingRuleProfile extends MappingRuleProfile { + /** The template mapping rule profile. */ + templateMappingRuleProfile?: ArmTemplateMappingRuleProfile; +} + +export function azureCoreArmTemplateDeployMappingRuleProfileSerializer( + item: AzureCoreArmTemplateDeployMappingRuleProfile, +): any { + return { + applicationEnablement: item["applicationEnablement"], + templateMappingRuleProfile: !item["templateMappingRuleProfile"] + ? item["templateMappingRuleProfile"] + : armTemplateMappingRuleProfileSerializer(item["templateMappingRuleProfile"]), + }; +} + +export function azureCoreArmTemplateDeployMappingRuleProfileDeserializer( + item: any, +): AzureCoreArmTemplateDeployMappingRuleProfile { + return { + applicationEnablement: item["applicationEnablement"], + templateMappingRuleProfile: !item["templateMappingRuleProfile"] + ? item["templateMappingRuleProfile"] + : armTemplateMappingRuleProfileDeserializer(item["templateMappingRuleProfile"]), + }; +} + +/** Template mapping rule profile */ +export interface ArmTemplateMappingRuleProfile { + /** List of template parameters. */ + templateParameters?: string; +} + +export function armTemplateMappingRuleProfileSerializer(item: ArmTemplateMappingRuleProfile): any { + return { templateParameters: item["templateParameters"] }; +} + +export function armTemplateMappingRuleProfileDeserializer( + item: any, +): ArmTemplateMappingRuleProfile { + return { + templateParameters: item["templateParameters"], + }; +} + +/** Azure Operator Distributed Services network function template. */ +export interface AzureOperatorNexusNetworkFunctionTemplate extends VirtualNetworkFunctionTemplate { + /** Network function applications. */ + networkFunctionApplications?: AzureOperatorNexusNetworkFunctionApplicationUnion[]; + /** The network function type. */ + nfviType: "AzureOperatorNexus"; +} + +export function azureOperatorNexusNetworkFunctionTemplateSerializer( + item: AzureOperatorNexusNetworkFunctionTemplate, +): any { + return { + nfviType: item["nfviType"], + networkFunctionApplications: !item["networkFunctionApplications"] + ? item["networkFunctionApplications"] + : azureOperatorNexusNetworkFunctionApplicationUnionArraySerializer( + item["networkFunctionApplications"], + ), + }; +} + +export function azureOperatorNexusNetworkFunctionTemplateDeserializer( + item: any, +): AzureOperatorNexusNetworkFunctionTemplate { + return { + nfviType: item["nfviType"], + networkFunctionApplications: !item["networkFunctionApplications"] + ? item["networkFunctionApplications"] + : azureOperatorNexusNetworkFunctionApplicationUnionArrayDeserializer( + item["networkFunctionApplications"], + ), + }; +} + +export function azureOperatorNexusNetworkFunctionApplicationUnionArraySerializer( + result: Array, +): any[] { + return result.map((item) => { + return azureOperatorNexusNetworkFunctionApplicationUnionSerializer(item); + }); +} + +export function azureOperatorNexusNetworkFunctionApplicationUnionArrayDeserializer( + result: Array, +): any[] { + return result.map((item) => { + return azureOperatorNexusNetworkFunctionApplicationUnionDeserializer(item); + }); +} + +/** Azure Operator Distributed Services network function application definition. */ +export interface AzureOperatorNexusNetworkFunctionApplication extends NetworkFunctionApplication { + /** The artifact type. */ + /** The discriminator possible values: ImageFile, ArmTemplate */ + artifactType: AzureOperatorNexusArtifactType; +} + +export function azureOperatorNexusNetworkFunctionApplicationSerializer( + item: AzureOperatorNexusNetworkFunctionApplication, +): any { + return { + name: item["name"], + dependsOnProfile: !item["dependsOnProfile"] + ? item["dependsOnProfile"] + : dependsOnProfileSerializer(item["dependsOnProfile"]), + artifactType: item["artifactType"], + }; +} + +export function azureOperatorNexusNetworkFunctionApplicationDeserializer( + item: any, +): AzureOperatorNexusNetworkFunctionApplication { + return { + name: item["name"], + dependsOnProfile: !item["dependsOnProfile"] + ? item["dependsOnProfile"] + : dependsOnProfileDeserializer(item["dependsOnProfile"]), + artifactType: item["artifactType"], + }; +} + +/** Alias for AzureOperatorNexusNetworkFunctionApplicationUnion */ +export type AzureOperatorNexusNetworkFunctionApplicationUnion = + | AzureOperatorNexusNetworkFunctionImageApplication + | AzureOperatorNexusNetworkFunctionArmTemplateApplication + | AzureOperatorNexusNetworkFunctionApplication; + +export function azureOperatorNexusNetworkFunctionApplicationUnionSerializer( + item: AzureOperatorNexusNetworkFunctionApplicationUnion, +): any { + switch (item.artifactType) { + case "ImageFile": + return azureOperatorNexusNetworkFunctionImageApplicationSerializer( + item as AzureOperatorNexusNetworkFunctionImageApplication, + ); + + case "ArmTemplate": + return azureOperatorNexusNetworkFunctionArmTemplateApplicationSerializer( + item as AzureOperatorNexusNetworkFunctionArmTemplateApplication, + ); + + default: + return azureOperatorNexusNetworkFunctionApplicationSerializer(item); + } +} + +export function azureOperatorNexusNetworkFunctionApplicationUnionDeserializer( + item: any, +): AzureOperatorNexusNetworkFunctionApplicationUnion { + switch (item.artifactType) { + case "ImageFile": + return azureOperatorNexusNetworkFunctionImageApplicationDeserializer( + item as AzureOperatorNexusNetworkFunctionImageApplication, + ); + + case "ArmTemplate": + return azureOperatorNexusNetworkFunctionArmTemplateApplicationDeserializer( + item as AzureOperatorNexusNetworkFunctionArmTemplateApplication, + ); + + default: + return azureOperatorNexusNetworkFunctionApplicationDeserializer(item); + } +} + +/** The artifact type. */ +export enum KnownAzureOperatorNexusArtifactType { + /** Unknown */ + Unknown = "Unknown", + /** ImageFile */ + ImageFile = "ImageFile", + /** ArmTemplate */ + ArmTemplate = "ArmTemplate", +} + +/** + * The artifact type. \ + * {@link KnownAzureOperatorNexusArtifactType} can be used interchangeably with AzureOperatorNexusArtifactType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Unknown** \ + * **ImageFile** \ + * **ArmTemplate** + */ +export type AzureOperatorNexusArtifactType = string; + +/** Azure Operator Distributed Services network function image application definition. */ +export interface AzureOperatorNexusNetworkFunctionImageApplication extends AzureOperatorNexusNetworkFunctionApplication { + /** Azure Operator Distributed Services image artifact profile. */ + artifactProfile?: AzureOperatorNexusImageArtifactProfile; + /** Deploy mapping rule profile. */ + deployParametersMappingRuleProfile?: AzureOperatorNexusImageDeployMappingRuleProfile; + /** The artifact type. */ + artifactType: "ImageFile"; +} + +export function azureOperatorNexusNetworkFunctionImageApplicationSerializer( + item: AzureOperatorNexusNetworkFunctionImageApplication, +): any { + return { + artifactType: item["artifactType"], + name: item["name"], + dependsOnProfile: !item["dependsOnProfile"] + ? item["dependsOnProfile"] + : dependsOnProfileSerializer(item["dependsOnProfile"]), + artifactProfile: !item["artifactProfile"] + ? item["artifactProfile"] + : azureOperatorNexusImageArtifactProfileSerializer(item["artifactProfile"]), + deployParametersMappingRuleProfile: !item["deployParametersMappingRuleProfile"] + ? item["deployParametersMappingRuleProfile"] + : azureOperatorNexusImageDeployMappingRuleProfileSerializer( + item["deployParametersMappingRuleProfile"], + ), + }; +} + +export function azureOperatorNexusNetworkFunctionImageApplicationDeserializer( + item: any, +): AzureOperatorNexusNetworkFunctionImageApplication { + return { + artifactType: item["artifactType"], + name: item["name"], + dependsOnProfile: !item["dependsOnProfile"] + ? item["dependsOnProfile"] + : dependsOnProfileDeserializer(item["dependsOnProfile"]), + artifactProfile: !item["artifactProfile"] + ? item["artifactProfile"] + : azureOperatorNexusImageArtifactProfileDeserializer(item["artifactProfile"]), + deployParametersMappingRuleProfile: !item["deployParametersMappingRuleProfile"] + ? item["deployParametersMappingRuleProfile"] + : azureOperatorNexusImageDeployMappingRuleProfileDeserializer( + item["deployParametersMappingRuleProfile"], + ), + }; +} + +/** Azure Operator Distributed Services image artifact profile properties. */ +export interface AzureOperatorNexusImageArtifactProfile extends ArtifactProfile { + /** Image artifact profile. */ + imageArtifactProfile?: ImageArtifactProfile; +} + +export function azureOperatorNexusImageArtifactProfileSerializer( + item: AzureOperatorNexusImageArtifactProfile, +): any { + return { + artifactStore: !item["artifactStore"] + ? item["artifactStore"] + : referencedResourceSerializer(item["artifactStore"]), + imageArtifactProfile: !item["imageArtifactProfile"] + ? item["imageArtifactProfile"] + : imageArtifactProfileSerializer(item["imageArtifactProfile"]), + }; +} + +export function azureOperatorNexusImageArtifactProfileDeserializer( + item: any, +): AzureOperatorNexusImageArtifactProfile { + return { + artifactStore: !item["artifactStore"] + ? item["artifactStore"] + : referencedResourceDeserializer(item["artifactStore"]), + imageArtifactProfile: !item["imageArtifactProfile"] + ? item["imageArtifactProfile"] + : imageArtifactProfileDeserializer(item["imageArtifactProfile"]), + }; +} + +/** Image artifact profile. */ +export interface ImageArtifactProfile { + /** Image name. */ + imageName?: string; + /** Image version. */ + imageVersion?: string; +} + +export function imageArtifactProfileSerializer(item: ImageArtifactProfile): any { + return { imageName: item["imageName"], imageVersion: item["imageVersion"] }; +} + +export function imageArtifactProfileDeserializer(item: any): ImageArtifactProfile { + return { + imageName: item["imageName"], + imageVersion: item["imageVersion"], + }; +} + +/** Azure Operator Distributed Services image deploy mapping rule profile. */ +export interface AzureOperatorNexusImageDeployMappingRuleProfile extends MappingRuleProfile { + /** The vhd mapping rule profile. */ + imageMappingRuleProfile?: ImageMappingRuleProfile; +} + +export function azureOperatorNexusImageDeployMappingRuleProfileSerializer( + item: AzureOperatorNexusImageDeployMappingRuleProfile, +): any { + return { + applicationEnablement: item["applicationEnablement"], + imageMappingRuleProfile: !item["imageMappingRuleProfile"] + ? item["imageMappingRuleProfile"] + : imageMappingRuleProfileSerializer(item["imageMappingRuleProfile"]), + }; +} + +export function azureOperatorNexusImageDeployMappingRuleProfileDeserializer( + item: any, +): AzureOperatorNexusImageDeployMappingRuleProfile { + return { + applicationEnablement: item["applicationEnablement"], + imageMappingRuleProfile: !item["imageMappingRuleProfile"] + ? item["imageMappingRuleProfile"] + : imageMappingRuleProfileDeserializer(item["imageMappingRuleProfile"]), + }; +} + +/** Image mapping rule profile */ +export interface ImageMappingRuleProfile { + /** List of values. */ + userConfiguration?: string; +} + +export function imageMappingRuleProfileSerializer(item: ImageMappingRuleProfile): any { + return { userConfiguration: item["userConfiguration"] }; +} + +export function imageMappingRuleProfileDeserializer(item: any): ImageMappingRuleProfile { + return { + userConfiguration: item["userConfiguration"], + }; +} + +/** Azure Operator Distributed Services network function Template application definition. */ +export interface AzureOperatorNexusNetworkFunctionArmTemplateApplication extends AzureOperatorNexusNetworkFunctionApplication { + /** Azure Operator Distributed Services Template artifact profile. */ + artifactProfile?: AzureOperatorNexusArmTemplateArtifactProfile; + /** Deploy mapping rule profile. */ + deployParametersMappingRuleProfile?: AzureOperatorNexusArmTemplateDeployMappingRuleProfile; + /** The artifact type. */ + artifactType: "ArmTemplate"; +} + +export function azureOperatorNexusNetworkFunctionArmTemplateApplicationSerializer( + item: AzureOperatorNexusNetworkFunctionArmTemplateApplication, +): any { + return { + artifactType: item["artifactType"], + name: item["name"], + dependsOnProfile: !item["dependsOnProfile"] + ? item["dependsOnProfile"] + : dependsOnProfileSerializer(item["dependsOnProfile"]), + artifactProfile: !item["artifactProfile"] + ? item["artifactProfile"] + : azureOperatorNexusArmTemplateArtifactProfileSerializer(item["artifactProfile"]), + deployParametersMappingRuleProfile: !item["deployParametersMappingRuleProfile"] + ? item["deployParametersMappingRuleProfile"] + : azureOperatorNexusArmTemplateDeployMappingRuleProfileSerializer( + item["deployParametersMappingRuleProfile"], + ), + }; +} + +export function azureOperatorNexusNetworkFunctionArmTemplateApplicationDeserializer( + item: any, +): AzureOperatorNexusNetworkFunctionArmTemplateApplication { + return { + artifactType: item["artifactType"], + name: item["name"], + dependsOnProfile: !item["dependsOnProfile"] + ? item["dependsOnProfile"] + : dependsOnProfileDeserializer(item["dependsOnProfile"]), + artifactProfile: !item["artifactProfile"] + ? item["artifactProfile"] + : azureOperatorNexusArmTemplateArtifactProfileDeserializer(item["artifactProfile"]), + deployParametersMappingRuleProfile: !item["deployParametersMappingRuleProfile"] + ? item["deployParametersMappingRuleProfile"] + : azureOperatorNexusArmTemplateDeployMappingRuleProfileDeserializer( + item["deployParametersMappingRuleProfile"], + ), + }; +} + +/** Azure Operator Distributed Services vhd artifact profile properties. */ +export interface AzureOperatorNexusArmTemplateArtifactProfile extends ArtifactProfile { + /** Template artifact profile. */ + templateArtifactProfile?: ArmTemplateArtifactProfile; +} + +export function azureOperatorNexusArmTemplateArtifactProfileSerializer( + item: AzureOperatorNexusArmTemplateArtifactProfile, +): any { + return { + artifactStore: !item["artifactStore"] + ? item["artifactStore"] + : referencedResourceSerializer(item["artifactStore"]), + templateArtifactProfile: !item["templateArtifactProfile"] + ? item["templateArtifactProfile"] + : armTemplateArtifactProfileSerializer(item["templateArtifactProfile"]), + }; +} + +export function azureOperatorNexusArmTemplateArtifactProfileDeserializer( + item: any, +): AzureOperatorNexusArmTemplateArtifactProfile { + return { + artifactStore: !item["artifactStore"] + ? item["artifactStore"] + : referencedResourceDeserializer(item["artifactStore"]), + templateArtifactProfile: !item["templateArtifactProfile"] + ? item["templateArtifactProfile"] + : armTemplateArtifactProfileDeserializer(item["templateArtifactProfile"]), + }; +} + +/** Azure Operator Distributed Services template deploy mapping rule profile. */ +export interface AzureOperatorNexusArmTemplateDeployMappingRuleProfile extends MappingRuleProfile { + /** The template mapping rule profile. */ + templateMappingRuleProfile?: ArmTemplateMappingRuleProfile; +} + +export function azureOperatorNexusArmTemplateDeployMappingRuleProfileSerializer( + item: AzureOperatorNexusArmTemplateDeployMappingRuleProfile, +): any { + return { + applicationEnablement: item["applicationEnablement"], + templateMappingRuleProfile: !item["templateMappingRuleProfile"] + ? item["templateMappingRuleProfile"] + : armTemplateMappingRuleProfileSerializer(item["templateMappingRuleProfile"]), + }; +} + +export function azureOperatorNexusArmTemplateDeployMappingRuleProfileDeserializer( + item: any, +): AzureOperatorNexusArmTemplateDeployMappingRuleProfile { + return { + applicationEnablement: item["applicationEnablement"], + templateMappingRuleProfile: !item["templateMappingRuleProfile"] + ? item["templateMappingRuleProfile"] + : armTemplateMappingRuleProfileDeserializer(item["templateMappingRuleProfile"]), + }; +} + +/** Network function application definition. */ +export interface NetworkFunctionApplication { + /** The name of the network function application. */ + name?: string; + /** Depends on profile definition. */ + dependsOnProfile?: DependsOnProfile; +} + +export function networkFunctionApplicationSerializer(item: NetworkFunctionApplication): any { + return { + name: item["name"], + dependsOnProfile: !item["dependsOnProfile"] + ? item["dependsOnProfile"] + : dependsOnProfileSerializer(item["dependsOnProfile"]), + }; +} + +export function networkFunctionApplicationDeserializer(item: any): NetworkFunctionApplication { + return { + name: item["name"], + dependsOnProfile: !item["dependsOnProfile"] + ? item["dependsOnProfile"] + : dependsOnProfileDeserializer(item["dependsOnProfile"]), + }; +} + +/** Depends on profile definition. */ +export interface DependsOnProfile { + /** Application installation operation dependency. */ + installDependsOn?: string[]; + /** Application deletion operation dependency. */ + uninstallDependsOn?: string[]; + /** Application update operation dependency. */ + updateDependsOn?: string[]; +} + +export function dependsOnProfileSerializer(item: DependsOnProfile): any { + return { + installDependsOn: !item["installDependsOn"] + ? item["installDependsOn"] + : item["installDependsOn"].map((p: any) => { + return p; + }), + uninstallDependsOn: !item["uninstallDependsOn"] + ? item["uninstallDependsOn"] + : item["uninstallDependsOn"].map((p: any) => { + return p; + }), + updateDependsOn: !item["updateDependsOn"] + ? item["updateDependsOn"] + : item["updateDependsOn"].map((p: any) => { + return p; + }), + }; +} + +export function dependsOnProfileDeserializer(item: any): DependsOnProfile { + return { + installDependsOn: !item["installDependsOn"] + ? item["installDependsOn"] + : item["installDependsOn"].map((p: any) => { + return p; + }), + uninstallDependsOn: !item["uninstallDependsOn"] + ? item["uninstallDependsOn"] + : item["uninstallDependsOn"].map((p: any) => { + return p; + }), + updateDependsOn: !item["updateDependsOn"] + ? item["updateDependsOn"] + : item["updateDependsOn"].map((p: any) => { + return p; + }), + }; +} + +/** Artifact profile properties. */ +export interface ArtifactProfile { + /** The reference to artifact store. */ + artifactStore?: ReferencedResource; +} + +export function artifactProfileSerializer(item: ArtifactProfile): any { + return { + artifactStore: !item["artifactStore"] + ? item["artifactStore"] + : referencedResourceSerializer(item["artifactStore"]), + }; +} + +export function artifactProfileDeserializer(item: any): ArtifactProfile { + return { + artifactStore: !item["artifactStore"] + ? item["artifactStore"] + : referencedResourceDeserializer(item["artifactStore"]), + }; +} + +/** Reference to another resource. */ +export interface ReferencedResource { + /** Resource ID. */ + id?: string; +} + +export function referencedResourceSerializer(item: ReferencedResource): any { + return { id: item["id"] }; +} + +export function referencedResourceDeserializer(item: any): ReferencedResource { + return { + id: item["id"], + }; +} + +/** Mapping rule profile properties. */ +export interface MappingRuleProfile { + /** The application enablement. */ + applicationEnablement?: ApplicationEnablement; +} + +export function mappingRuleProfileSerializer(item: MappingRuleProfile): any { + return { applicationEnablement: item["applicationEnablement"] }; +} + +export function mappingRuleProfileDeserializer(item: any): MappingRuleProfile { + return { + applicationEnablement: item["applicationEnablement"], + }; +} + +/** The application enablement. */ +export enum KnownApplicationEnablement { + /** Unknown */ + Unknown = "Unknown", + /** Enabled */ + Enabled = "Enabled", + /** Disabled */ + Disabled = "Disabled", +} + +/** + * The application enablement. \ + * {@link KnownApplicationEnablement} can be used interchangeably with ApplicationEnablement, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Unknown** \ + * **Enabled** \ + * **Disabled** + */ +export type ApplicationEnablement = string; + +/** The response of a NetworkFunctionDefinitionVersion list operation. */ +export interface _NetworkFunctionDefinitionVersionListResult { + /** The NetworkFunctionDefinitionVersion items on this page */ + value: NetworkFunctionDefinitionVersion[]; + /** The link to the next page of items */ + nextLink?: string; +} + +export function _networkFunctionDefinitionVersionListResultDeserializer( + item: any, +): _NetworkFunctionDefinitionVersionListResult { + return { + value: networkFunctionDefinitionVersionArrayDeserializer(item["value"]), + nextLink: item["nextLink"], + }; +} + +export function networkFunctionDefinitionVersionArraySerializer( + result: Array, +): any[] { + return result.map((item) => { + return networkFunctionDefinitionVersionSerializer(item); + }); +} + +export function networkFunctionDefinitionVersionArrayDeserializer( + result: Array, +): any[] { + return result.map((item) => { + return networkFunctionDefinitionVersionDeserializer(item); + }); +} + +/** Publisher network function definition version update request definition. */ +export interface NetworkFunctionDefinitionVersionUpdateState { + /** The network function definition version state. */ + versionState?: VersionState; +} + +export function networkFunctionDefinitionVersionUpdateStateSerializer( + item: NetworkFunctionDefinitionVersionUpdateState, +): any { + return { versionState: item["versionState"] }; +} + +export function networkFunctionDefinitionVersionUpdateStateDeserializer( + item: any, +): NetworkFunctionDefinitionVersionUpdateState { + return { + versionState: item["versionState"], + }; +} + +/** network service design group resource. */ +export interface NetworkServiceDesignGroup extends TrackedResource { + /** network service design group properties. */ + properties?: NetworkServiceDesignGroupPropertiesFormat; +} + +export function networkServiceDesignGroupSerializer(item: NetworkServiceDesignGroup): any { + return { + tags: item["tags"], + location: item["location"], + properties: !item["properties"] + ? item["properties"] + : networkServiceDesignGroupPropertiesFormatSerializer(item["properties"]), + }; +} + +export function networkServiceDesignGroupDeserializer(item: any): NetworkServiceDesignGroup { + return { + tags: !item["tags"] + ? item["tags"] + : Object.fromEntries(Object.entries(item["tags"]).map(([k, p]: [string, any]) => [k, p])), + location: item["location"], + id: item["id"], + name: item["name"], + type: item["type"], + systemData: !item["systemData"] + ? item["systemData"] + : systemDataDeserializer(item["systemData"]), + properties: !item["properties"] + ? item["properties"] + : networkServiceDesignGroupPropertiesFormatDeserializer(item["properties"]), + }; +} + +/** network service design group properties. */ +export interface NetworkServiceDesignGroupPropertiesFormat { + /** The provisioning state of the network service design groups resource. */ + readonly provisioningState?: ProvisioningState; + /** The network service design group description. */ + description?: string; +} + +export function networkServiceDesignGroupPropertiesFormatSerializer( + item: NetworkServiceDesignGroupPropertiesFormat, +): any { + return { description: item["description"] }; +} + +export function networkServiceDesignGroupPropertiesFormatDeserializer( + item: any, +): NetworkServiceDesignGroupPropertiesFormat { + return { + provisioningState: item["provisioningState"], + description: item["description"], + }; +} + +/** The response of a NetworkServiceDesignGroup list operation. */ +export interface _NetworkServiceDesignGroupListResult { + /** The NetworkServiceDesignGroup items on this page */ + value: NetworkServiceDesignGroup[]; + /** The link to the next page of items */ + nextLink?: string; +} + +export function _networkServiceDesignGroupListResultDeserializer( + item: any, +): _NetworkServiceDesignGroupListResult { + return { + value: networkServiceDesignGroupArrayDeserializer(item["value"]), + nextLink: item["nextLink"], + }; +} + +export function networkServiceDesignGroupArraySerializer( + result: Array, +): any[] { + return result.map((item) => { + return networkServiceDesignGroupSerializer(item); + }); +} + +export function networkServiceDesignGroupArrayDeserializer( + result: Array, +): any[] { + return result.map((item) => { + return networkServiceDesignGroupDeserializer(item); + }); +} + +/** network service design version. */ +export interface NetworkServiceDesignVersion extends TrackedResource { + /** network service design version properties. */ + properties?: NetworkServiceDesignVersionPropertiesFormat; +} + +export function networkServiceDesignVersionSerializer(item: NetworkServiceDesignVersion): any { + return { + tags: item["tags"], + location: item["location"], + properties: !item["properties"] + ? item["properties"] + : networkServiceDesignVersionPropertiesFormatSerializer(item["properties"]), + }; +} + +export function networkServiceDesignVersionDeserializer(item: any): NetworkServiceDesignVersion { + return { + tags: !item["tags"] + ? item["tags"] + : Object.fromEntries(Object.entries(item["tags"]).map(([k, p]: [string, any]) => [k, p])), + location: item["location"], + id: item["id"], + name: item["name"], + type: item["type"], + systemData: !item["systemData"] + ? item["systemData"] + : systemDataDeserializer(item["systemData"]), + properties: !item["properties"] + ? item["properties"] + : networkServiceDesignVersionPropertiesFormatDeserializer(item["properties"]), + }; +} + +/** network service design version properties. */ +export interface NetworkServiceDesignVersionPropertiesFormat { + /** The provisioning state of the network service design version resource. */ + readonly provisioningState?: ProvisioningState; + /** The network service design version state. */ + readonly versionState?: VersionState; + /** The network service design version description. */ + description?: string; + /** The configuration schemas to used to define the values. */ + configurationGroupSchemaReferences?: Record; + /** The nfvis from the site. */ + nfvisFromSite?: Record; + /** List of resource element template */ + resourceElementTemplates?: ResourceElementTemplateUnion[]; +} + +export function networkServiceDesignVersionPropertiesFormatSerializer( + item: NetworkServiceDesignVersionPropertiesFormat, +): any { + return { + description: item["description"], + configurationGroupSchemaReferences: !item["configurationGroupSchemaReferences"] + ? item["configurationGroupSchemaReferences"] + : referencedResourceRecordSerializer(item["configurationGroupSchemaReferences"]), + nfvisFromSite: !item["nfvisFromSite"] + ? item["nfvisFromSite"] + : nfviDetailsRecordSerializer(item["nfvisFromSite"]), + resourceElementTemplates: !item["resourceElementTemplates"] + ? item["resourceElementTemplates"] + : resourceElementTemplateUnionArraySerializer(item["resourceElementTemplates"]), + }; +} + +export function networkServiceDesignVersionPropertiesFormatDeserializer( + item: any, +): NetworkServiceDesignVersionPropertiesFormat { + return { + provisioningState: item["provisioningState"], + versionState: item["versionState"], + description: item["description"], + configurationGroupSchemaReferences: !item["configurationGroupSchemaReferences"] + ? item["configurationGroupSchemaReferences"] + : referencedResourceRecordDeserializer(item["configurationGroupSchemaReferences"]), + nfvisFromSite: !item["nfvisFromSite"] + ? item["nfvisFromSite"] + : nfviDetailsRecordDeserializer(item["nfvisFromSite"]), + resourceElementTemplates: !item["resourceElementTemplates"] + ? item["resourceElementTemplates"] + : resourceElementTemplateUnionArrayDeserializer(item["resourceElementTemplates"]), + }; +} + +export function referencedResourceRecordSerializer( + item: Record, +): Record { + const result: Record = {}; + Object.keys(item).map((key) => { + result[key] = !item[key] ? item[key] : referencedResourceSerializer(item[key]); + }); + return result; +} + +export function referencedResourceRecordDeserializer( + item: Record, +): Record { + const result: Record = {}; + Object.keys(item).map((key) => { + result[key] = !item[key] ? item[key] : referencedResourceDeserializer(item[key]); + }); + return result; +} + +export function nfviDetailsRecordSerializer( + item: Record, +): Record { + const result: Record = {}; + Object.keys(item).map((key) => { + result[key] = !item[key] ? item[key] : nfviDetailsSerializer(item[key]); + }); + return result; +} + +export function nfviDetailsRecordDeserializer( + item: Record, +): Record { + const result: Record = {}; + Object.keys(item).map((key) => { + result[key] = !item[key] ? item[key] : nfviDetailsDeserializer(item[key]); + }); + return result; +} + +/** The nfvi details. */ +export interface NfviDetails { + /** The nfvi name. */ + name?: string; + /** The nfvi type. */ + type?: string; +} + +export function nfviDetailsSerializer(item: NfviDetails): any { + return { name: item["name"], type: item["type"] }; +} + +export function nfviDetailsDeserializer(item: any): NfviDetails { + return { + name: item["name"], + type: item["type"], + }; +} + +export function resourceElementTemplateUnionArraySerializer( + result: Array, +): any[] { + return result.map((item) => { + return resourceElementTemplateUnionSerializer(item); + }); +} + +export function resourceElementTemplateUnionArrayDeserializer( + result: Array, +): any[] { + return result.map((item) => { + return resourceElementTemplateUnionDeserializer(item); + }); +} + +/** The resource element template object. */ +export interface ResourceElementTemplate { + /** Name of the resource element template. */ + name?: string; + /** The resource element template type. */ + /** The discriminator possible values: ArmResourceDefinition, NetworkFunctionDefinition */ + resourceElementType: Type; + /** The depends on profile. */ + dependsOnProfile?: DependsOnProfile; +} + +export function resourceElementTemplateSerializer(item: ResourceElementTemplate): any { + return { + name: item["name"], + type: item["resourceElementType"], + dependsOnProfile: !item["dependsOnProfile"] + ? item["dependsOnProfile"] + : dependsOnProfileSerializer(item["dependsOnProfile"]), + }; +} + +export function resourceElementTemplateDeserializer(item: any): ResourceElementTemplate { + return { + name: item["name"], + resourceElementType: item["type"], + dependsOnProfile: !item["dependsOnProfile"] + ? item["dependsOnProfile"] + : dependsOnProfileDeserializer(item["dependsOnProfile"]), + }; +} + +/** Alias for ResourceElementTemplateUnion */ +export type ResourceElementTemplateUnion = + | ArmResourceDefinitionResourceElementTemplateDetails + | NetworkFunctionDefinitionResourceElementTemplateDetails + | ResourceElementTemplate; + +export function resourceElementTemplateUnionSerializer(item: ResourceElementTemplateUnion): any { + switch (item.resourceElementType) { + case "ArmResourceDefinition": + return armResourceDefinitionResourceElementTemplateDetailsSerializer( + item as ArmResourceDefinitionResourceElementTemplateDetails, + ); + + case "NetworkFunctionDefinition": + return networkFunctionDefinitionResourceElementTemplateDetailsSerializer( + item as NetworkFunctionDefinitionResourceElementTemplateDetails, + ); + + default: + return resourceElementTemplateSerializer(item); + } +} + +export function resourceElementTemplateUnionDeserializer(item: any): ResourceElementTemplateUnion { + switch (item.resourceElementType) { + case "ArmResourceDefinition": + return armResourceDefinitionResourceElementTemplateDetailsDeserializer( + item as ArmResourceDefinitionResourceElementTemplateDetails, + ); + + case "NetworkFunctionDefinition": + return networkFunctionDefinitionResourceElementTemplateDetailsDeserializer( + item as NetworkFunctionDefinitionResourceElementTemplateDetails, + ); + + default: + return resourceElementTemplateDeserializer(item); + } +} + +/** The resource element template type. */ +export enum KnownType { + /** Unknown */ + Unknown = "Unknown", + /** ArmResourceDefinition */ + ArmResourceDefinition = "ArmResourceDefinition", + /** NetworkFunctionDefinition */ + NetworkFunctionDefinition = "NetworkFunctionDefinition", +} + +/** + * The resource element template type. \ + * {@link KnownType} can be used interchangeably with Type, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Unknown** \ + * **ArmResourceDefinition** \ + * **NetworkFunctionDefinition** + */ +export type Type = string; + +/** The arm resource definition resource element template details. */ +export interface ArmResourceDefinitionResourceElementTemplateDetails extends ResourceElementTemplate { + /** The resource element template type. */ + configuration?: ArmResourceDefinitionResourceElementTemplate; + /** The resource element template type. */ + resourceElementType: "ArmResourceDefinition"; +} + +export function armResourceDefinitionResourceElementTemplateDetailsSerializer( + item: ArmResourceDefinitionResourceElementTemplateDetails, +): any { + return { + name: item["name"], + type: item["resourceElementType"], + dependsOnProfile: !item["dependsOnProfile"] + ? item["dependsOnProfile"] + : dependsOnProfileSerializer(item["dependsOnProfile"]), + configuration: !item["configuration"] + ? item["configuration"] + : armResourceDefinitionResourceElementTemplateSerializer(item["configuration"]), + }; +} + +export function armResourceDefinitionResourceElementTemplateDetailsDeserializer( + item: any, +): ArmResourceDefinitionResourceElementTemplateDetails { + return { + name: item["name"], + resourceElementType: item["type"], + dependsOnProfile: !item["dependsOnProfile"] + ? item["dependsOnProfile"] + : dependsOnProfileDeserializer(item["dependsOnProfile"]), + configuration: !item["configuration"] + ? item["configuration"] + : armResourceDefinitionResourceElementTemplateDeserializer(item["configuration"]), + }; +} + +/** The arm template RE. */ +export interface ArmResourceDefinitionResourceElementTemplate { + /** The template type. */ + templateType?: TemplateType; + /** Name and value pairs that define the parameter values. It can be a well formed escaped JSON string. */ + parameterValues?: string; + /** Artifact profile properties. */ + artifactProfile?: NSDArtifactProfile; +} + +export function armResourceDefinitionResourceElementTemplateSerializer( + item: ArmResourceDefinitionResourceElementTemplate, +): any { + return { + templateType: item["templateType"], + parameterValues: item["parameterValues"], + artifactProfile: !item["artifactProfile"] + ? item["artifactProfile"] + : nsdArtifactProfileSerializer(item["artifactProfile"]), + }; +} + +export function armResourceDefinitionResourceElementTemplateDeserializer( + item: any, +): ArmResourceDefinitionResourceElementTemplate { + return { + templateType: item["templateType"], + parameterValues: item["parameterValues"], + artifactProfile: !item["artifactProfile"] + ? item["artifactProfile"] + : nsdArtifactProfileDeserializer(item["artifactProfile"]), + }; +} + +/** The template type. */ +export enum KnownTemplateType { + /** Unknown */ + Unknown = "Unknown", + /** ArmTemplate */ + ArmTemplate = "ArmTemplate", +} + +/** + * The template type. \ + * {@link KnownTemplateType} can be used interchangeably with TemplateType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Unknown** \ + * **ArmTemplate** + */ +export type TemplateType = string; + +/** Artifact profile properties. */ +export interface NSDArtifactProfile { + /** The artifact store resource id */ + artifactStoreReference?: ReferencedResource; + /** Artifact name. */ + artifactName?: string; + /** Artifact version. */ + artifactVersion?: string; +} + +export function nsdArtifactProfileSerializer(item: NSDArtifactProfile): any { + return { + artifactStoreReference: !item["artifactStoreReference"] + ? item["artifactStoreReference"] + : referencedResourceSerializer(item["artifactStoreReference"]), + artifactName: item["artifactName"], + artifactVersion: item["artifactVersion"], + }; +} + +export function nsdArtifactProfileDeserializer(item: any): NSDArtifactProfile { + return { + artifactStoreReference: !item["artifactStoreReference"] + ? item["artifactStoreReference"] + : referencedResourceDeserializer(item["artifactStoreReference"]), + artifactName: item["artifactName"], + artifactVersion: item["artifactVersion"], + }; +} + +/** The network function definition resource element template details. */ +export interface NetworkFunctionDefinitionResourceElementTemplateDetails extends ResourceElementTemplate { + /** The resource element template type. */ + configuration?: ArmResourceDefinitionResourceElementTemplate; + /** The resource element template type. */ + resourceElementType: "NetworkFunctionDefinition"; +} + +export function networkFunctionDefinitionResourceElementTemplateDetailsSerializer( + item: NetworkFunctionDefinitionResourceElementTemplateDetails, +): any { + return { + name: item["name"], + type: item["resourceElementType"], + dependsOnProfile: !item["dependsOnProfile"] + ? item["dependsOnProfile"] + : dependsOnProfileSerializer(item["dependsOnProfile"]), + configuration: !item["configuration"] + ? item["configuration"] + : armResourceDefinitionResourceElementTemplateSerializer(item["configuration"]), + }; +} + +export function networkFunctionDefinitionResourceElementTemplateDetailsDeserializer( + item: any, +): NetworkFunctionDefinitionResourceElementTemplateDetails { + return { + name: item["name"], + resourceElementType: item["type"], + dependsOnProfile: !item["dependsOnProfile"] + ? item["dependsOnProfile"] + : dependsOnProfileDeserializer(item["dependsOnProfile"]), + configuration: !item["configuration"] + ? item["configuration"] + : armResourceDefinitionResourceElementTemplateDeserializer(item["configuration"]), + }; +} + +/** The response of a networkServiceDesignVersion list operation. */ +export interface _NetworkServiceDesignVersionListResult { + /** The networkServiceDesignVersion items on this page */ + value: NetworkServiceDesignVersion[]; + /** The link to the next page of items */ + nextLink?: string; +} + +export function _networkServiceDesignVersionListResultDeserializer( + item: any, +): _NetworkServiceDesignVersionListResult { + return { + value: networkServiceDesignVersionArrayDeserializer(item["value"]), + nextLink: item["nextLink"], + }; +} + +export function networkServiceDesignVersionArraySerializer( + result: Array, +): any[] { + return result.map((item) => { + return networkServiceDesignVersionSerializer(item); + }); +} + +export function networkServiceDesignVersionArrayDeserializer( + result: Array, +): any[] { + return result.map((item) => { + return networkServiceDesignVersionDeserializer(item); + }); +} + +/** Publisher network service design version update request definition. */ +export interface NetworkServiceDesignVersionUpdateState { + /** The network service design version state. */ + versionState?: VersionState; +} + +export function networkServiceDesignVersionUpdateStateSerializer( + item: NetworkServiceDesignVersionUpdateState, +): any { + return { versionState: item["versionState"] }; +} + +export function networkServiceDesignVersionUpdateStateDeserializer( + item: any, +): NetworkServiceDesignVersionUpdateState { + return { + versionState: item["versionState"], + }; +} + +/** Artifact store properties. */ +export interface ArtifactStore extends TrackedResource { + /** ArtifactStores properties. */ + properties?: ArtifactStorePropertiesFormat; +} + +export function artifactStoreSerializer(item: ArtifactStore): any { + return { + tags: item["tags"], + location: item["location"], + properties: !item["properties"] + ? item["properties"] + : artifactStorePropertiesFormatSerializer(item["properties"]), + }; +} + +export function artifactStoreDeserializer(item: any): ArtifactStore { + return { + tags: !item["tags"] + ? item["tags"] + : Object.fromEntries(Object.entries(item["tags"]).map(([k, p]: [string, any]) => [k, p])), + location: item["location"], + id: item["id"], + name: item["name"], + type: item["type"], + systemData: !item["systemData"] + ? item["systemData"] + : systemDataDeserializer(item["systemData"]), + properties: !item["properties"] + ? item["properties"] + : artifactStorePropertiesFormatDeserializer(item["properties"]), + }; +} + +/** Artifact store properties. */ +export interface ArtifactStorePropertiesFormat { + /** The provisioning state of the application groups resource. */ + readonly provisioningState?: ProvisioningState; + /** The artifact store type. */ + storeType?: ArtifactStoreType; + /** The artifact store backing resource network access type */ + backingResourcePublicNetworkAccess?: BackingResourcePublicNetworkAccess; + /** The replication strategy. */ + replicationStrategy?: ArtifactReplicationStrategy; + managedResourceGroupConfiguration?: ArtifactStorePropertiesFormatManagedResourceGroupConfiguration; + /** The created storage resource id */ + readonly storageResourceId?: string; +} + +export function artifactStorePropertiesFormatSerializer(item: ArtifactStorePropertiesFormat): any { + return { + storeType: item["storeType"], + backingResourcePublicNetworkAccess: item["backingResourcePublicNetworkAccess"], + replicationStrategy: item["replicationStrategy"], + managedResourceGroupConfiguration: !item["managedResourceGroupConfiguration"] + ? item["managedResourceGroupConfiguration"] + : artifactStorePropertiesFormatManagedResourceGroupConfigurationSerializer( + item["managedResourceGroupConfiguration"], + ), + }; +} + +export function artifactStorePropertiesFormatDeserializer( + item: any, +): ArtifactStorePropertiesFormat { + return { + provisioningState: item["provisioningState"], + storeType: item["storeType"], + backingResourcePublicNetworkAccess: item["backingResourcePublicNetworkAccess"], + replicationStrategy: item["replicationStrategy"], + managedResourceGroupConfiguration: !item["managedResourceGroupConfiguration"] + ? item["managedResourceGroupConfiguration"] + : artifactStorePropertiesFormatManagedResourceGroupConfigurationDeserializer( + item["managedResourceGroupConfiguration"], + ), + storageResourceId: item["storageResourceId"], + }; +} + +/** The artifact store type. */ +export enum KnownArtifactStoreType { + /** Unknown */ + Unknown = "Unknown", + /** AzureContainerRegistry */ + AzureContainerRegistry = "AzureContainerRegistry", + /** AzureStorageAccount */ + AzureStorageAccount = "AzureStorageAccount", +} + +/** + * The artifact store type. \ + * {@link KnownArtifactStoreType} can be used interchangeably with ArtifactStoreType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Unknown** \ + * **AzureContainerRegistry** \ + * **AzureStorageAccount** + */ +export type ArtifactStoreType = string; + +/** The backing resource network access type. */ +export enum KnownBackingResourcePublicNetworkAccess { + /** Enabled */ + Enabled = "Enabled", + /** Disabled */ + Disabled = "Disabled", +} + +/** + * The backing resource network access type. \ + * {@link KnownBackingResourcePublicNetworkAccess} can be used interchangeably with BackingResourcePublicNetworkAccess, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Enabled** \ + * **Disabled** + */ +export type BackingResourcePublicNetworkAccess = string; + +/** The replication strategy. */ +export enum KnownArtifactReplicationStrategy { + /** Unknown */ + Unknown = "Unknown", + /** SingleReplication */ + SingleReplication = "SingleReplication", +} + +/** + * The replication strategy. \ + * {@link KnownArtifactReplicationStrategy} can be used interchangeably with ArtifactReplicationStrategy, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Unknown** \ + * **SingleReplication** + */ +export type ArtifactReplicationStrategy = string; + +/** model interface ArtifactStorePropertiesFormatManagedResourceGroupConfiguration */ +export interface ArtifactStorePropertiesFormatManagedResourceGroupConfiguration { + /** The managed resource group name. */ + name?: string; + /** The managed resource group location. */ + location?: string; +} + +export function artifactStorePropertiesFormatManagedResourceGroupConfigurationSerializer( + item: ArtifactStorePropertiesFormatManagedResourceGroupConfiguration, +): any { + return { name: item["name"], location: item["location"] }; +} + +export function artifactStorePropertiesFormatManagedResourceGroupConfigurationDeserializer( + item: any, +): ArtifactStorePropertiesFormatManagedResourceGroupConfiguration { + return { + name: item["name"], + location: item["location"], + }; +} + +/** The response of a ArtifactStore list operation. */ +export interface _ArtifactStoreListResult { + /** The ArtifactStore items on this page */ + value: ArtifactStore[]; + /** The link to the next page of items */ + nextLink?: string; +} + +export function _artifactStoreListResultDeserializer(item: any): _ArtifactStoreListResult { + return { + value: artifactStoreArrayDeserializer(item["value"]), + nextLink: item["nextLink"], + }; +} + +export function artifactStoreArraySerializer(result: Array): any[] { + return result.map((item) => { + return artifactStoreSerializer(item); + }); +} + +export function artifactStoreArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return artifactStoreDeserializer(item); + }); +} + +/** List of network fabric controller ids. */ +export interface ArtifactStoreNetworkFabricControllerEndPoints { + /** list of network fabric controllers. */ + networkFabricControllerIds?: ReferencedResource[]; +} + +export function artifactStoreNetworkFabricControllerEndPointsSerializer( + item: ArtifactStoreNetworkFabricControllerEndPoints, +): any { + return { + networkFabricControllerIds: !item["networkFabricControllerIds"] + ? item["networkFabricControllerIds"] + : referencedResourceArraySerializer(item["networkFabricControllerIds"]), + }; +} + +export function artifactStoreNetworkFabricControllerEndPointsDeserializer( + item: any, +): ArtifactStoreNetworkFabricControllerEndPoints { + return { + networkFabricControllerIds: !item["networkFabricControllerIds"] + ? item["networkFabricControllerIds"] + : referencedResourceArrayDeserializer(item["networkFabricControllerIds"]), + }; +} + +export function referencedResourceArraySerializer(result: Array): any[] { + return result.map((item) => { + return referencedResourceSerializer(item); + }); +} + +export function referencedResourceArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return referencedResourceDeserializer(item); + }); +} + +/** List of manual private endpoints. */ +export interface _ArtifactStoreNetworkFabricControllerEndPointsList { + /** The ArtifactStoreNetworkFabricControllerEndPoints items on this page */ + value: ArtifactStoreNetworkFabricControllerEndPoints[]; + /** The link to the next page of items */ + nextLink?: string; +} + +export function _artifactStoreNetworkFabricControllerEndPointsListDeserializer( + item: any, +): _ArtifactStoreNetworkFabricControllerEndPointsList { + return { + value: artifactStoreNetworkFabricControllerEndPointsArrayDeserializer(item["value"]), + nextLink: item["nextLink"], + }; +} + +export function artifactStoreNetworkFabricControllerEndPointsArraySerializer( + result: Array, +): any[] { + return result.map((item) => { + return artifactStoreNetworkFabricControllerEndPointsSerializer(item); + }); +} + +export function artifactStoreNetworkFabricControllerEndPointsArrayDeserializer( + result: Array, +): any[] { + return result.map((item) => { + return artifactStoreNetworkFabricControllerEndPointsDeserializer(item); + }); +} + +/** List of manual private endpoints. */ +export interface ArtifactStorePrivateEndPointsFormat { + /** list of private endpoints. */ + manualPrivateEndPointConnections?: ReferencedResource[]; +} + +export function artifactStorePrivateEndPointsFormatSerializer( + item: ArtifactStorePrivateEndPointsFormat, +): any { + return { + manualPrivateEndPointConnections: !item["manualPrivateEndPointConnections"] + ? item["manualPrivateEndPointConnections"] + : referencedResourceArraySerializer(item["manualPrivateEndPointConnections"]), + }; +} + +export function artifactStorePrivateEndPointsFormatDeserializer( + item: any, +): ArtifactStorePrivateEndPointsFormat { + return { + manualPrivateEndPointConnections: !item["manualPrivateEndPointConnections"] + ? item["manualPrivateEndPointConnections"] + : referencedResourceArrayDeserializer(item["manualPrivateEndPointConnections"]), + }; +} + +/** List of manual private endpoints. */ +export interface _ArtifactStorePrivateEndPointsListResult { + /** The ArtifactStorePrivateEndPointsFormat items on this page */ + value: ArtifactStorePrivateEndPointsFormat[]; + /** The link to the next page of items */ + nextLink?: string; +} + +export function _artifactStorePrivateEndPointsListResultDeserializer( + item: any, +): _ArtifactStorePrivateEndPointsListResult { + return { + value: artifactStorePrivateEndPointsFormatArrayDeserializer(item["value"]), + nextLink: item["nextLink"], + }; +} + +export function artifactStorePrivateEndPointsFormatArraySerializer( + result: Array, +): any[] { + return result.map((item) => { + return artifactStorePrivateEndPointsFormatSerializer(item); + }); +} + +export function artifactStorePrivateEndPointsFormatArrayDeserializer( + result: Array, +): any[] { + return result.map((item) => { + return artifactStorePrivateEndPointsFormatDeserializer(item); + }); +} + +/** The description for page model */ +export interface _ProxyArtifactOverviewListResult { + /** The description for value property */ + value: ProxyArtifactListOverview[]; + /** The description for nextLink property */ + nextLink?: string; +} + +export function _proxyArtifactOverviewListResultDeserializer( + item: any, +): _ProxyArtifactOverviewListResult { + return { + value: proxyArtifactListOverviewArrayDeserializer(item["value"]), + nextLink: item["nextLink"], + }; +} + +export function proxyArtifactListOverviewArrayDeserializer( + result: Array, +): any[] { + return result.map((item) => { + return proxyArtifactListOverviewDeserializer(item); + }); +} + +/** The proxy artifact overview. */ +export interface ProxyArtifactListOverview extends ProxyResource {} + +export function proxyArtifactListOverviewDeserializer(item: any): ProxyArtifactListOverview { + return { + id: item["id"], + name: item["name"], + type: item["type"], + systemData: !item["systemData"] + ? item["systemData"] + : systemDataDeserializer(item["systemData"]), + }; +} + +/** The description for page model */ +export interface _ProxyArtifactVersionsOverviewListResult { + /** The description for value property */ + value: ProxyArtifactVersionsListOverview[]; + /** The description for nextLink property */ + nextLink?: string; +} + +export function _proxyArtifactVersionsOverviewListResultDeserializer( + item: any, +): _ProxyArtifactVersionsOverviewListResult { + return { + value: proxyArtifactVersionsListOverviewArrayDeserializer(item["value"]), + nextLink: item["nextLink"], + }; +} + +export function proxyArtifactVersionsListOverviewArrayDeserializer( + result: Array, +): any[] { + return result.map((item) => { + return proxyArtifactVersionsListOverviewDeserializer(item); + }); +} + +/** The proxy artifact overview. */ +export interface ProxyArtifactVersionsListOverview extends ProxyResource { + /** Proxy Artifact overview properties. */ + readonly properties?: ProxyArtifactOverviewPropertiesValue; +} + +export function proxyArtifactVersionsListOverviewDeserializer( + item: any, +): ProxyArtifactVersionsListOverview { + return { + id: item["id"], + name: item["name"], + type: item["type"], + systemData: !item["systemData"] + ? item["systemData"] + : systemDataDeserializer(item["systemData"]), + properties: !item["properties"] + ? item["properties"] + : proxyArtifactOverviewPropertiesValueDeserializer(item["properties"]), + }; +} + +/** model interface ProxyArtifactOverviewPropertiesValue */ +export interface ProxyArtifactOverviewPropertiesValue { + /** The artifact type. */ + artifactType?: ArtifactType; + /** The artifact version. */ + artifactVersion?: string; + /** The artifact state */ + artifactState?: ArtifactState; +} + +export function proxyArtifactOverviewPropertiesValueDeserializer( + item: any, +): ProxyArtifactOverviewPropertiesValue { + return { + artifactType: item["artifactType"], + artifactVersion: item["artifactVersion"], + artifactState: item["artifactState"], + }; +} + +/** The artifact type. */ +export enum KnownArtifactType { + /** Unknown */ + Unknown = "Unknown", + /** OCIArtifact */ + OCIArtifact = "OCIArtifact", + /** VhdImageFile */ + VhdImageFile = "VhdImageFile", + /** ArmTemplate */ + ArmTemplate = "ArmTemplate", + /** ImageFile */ + ImageFile = "ImageFile", +} + +/** + * The artifact type. \ + * {@link KnownArtifactType} can be used interchangeably with ArtifactType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Unknown** \ + * **OCIArtifact** \ + * **VhdImageFile** \ + * **ArmTemplate** \ + * **ImageFile** + */ +export type ArtifactType = string; + +/** The artifact state. */ +export enum KnownArtifactState { + /** Unknown */ + Unknown = "Unknown", + /** Preview */ + Preview = "Preview", + /** Active */ + Active = "Active", + /** Deprecated */ + Deprecated = "Deprecated", +} + +/** + * The artifact state. \ + * {@link KnownArtifactState} can be used interchangeably with ArtifactState, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Unknown** \ + * **Preview** \ + * **Active** \ + * **Deprecated** + */ +export type ArtifactState = string; + +/** The artifact updating request payload. */ +export interface ArtifactChangeState { + /** Artifact update state properties. */ + properties?: ArtifactChangeStateProperties; +} + +export function artifactChangeStateSerializer(item: ArtifactChangeState): any { + return { + properties: !item["properties"] + ? item["properties"] + : artifactChangeStatePropertiesSerializer(item["properties"]), + }; +} + +/** The artifact update state properties. */ +export interface ArtifactChangeStateProperties { + /** The artifact state */ + artifactState?: ArtifactState; +} + +export function artifactChangeStatePropertiesSerializer(item: ArtifactChangeStateProperties): any { + return { artifactState: item["artifactState"] }; +} + +/** Artifact manifest properties. */ +export interface ArtifactManifest extends TrackedResource { + /** Artifact manifest properties. */ + properties?: ArtifactManifestPropertiesFormat; +} + +export function artifactManifestSerializer(item: ArtifactManifest): any { + return { + tags: item["tags"], + location: item["location"], + properties: !item["properties"] + ? item["properties"] + : artifactManifestPropertiesFormatSerializer(item["properties"]), + }; +} + +export function artifactManifestDeserializer(item: any): ArtifactManifest { + return { + tags: !item["tags"] + ? item["tags"] + : Object.fromEntries(Object.entries(item["tags"]).map(([k, p]: [string, any]) => [k, p])), + location: item["location"], + id: item["id"], + name: item["name"], + type: item["type"], + systemData: !item["systemData"] + ? item["systemData"] + : systemDataDeserializer(item["systemData"]), + properties: !item["properties"] + ? item["properties"] + : artifactManifestPropertiesFormatDeserializer(item["properties"]), + }; +} + +/** Artifact manifest properties. */ +export interface ArtifactManifestPropertiesFormat { + /** The provisioning state of the ArtifactManifest resource. */ + readonly provisioningState?: ProvisioningState; + /** The artifact manifest state. */ + readonly artifactManifestState?: ArtifactManifestState; + /** The artifacts list. */ + artifacts?: ManifestArtifactFormat[]; +} + +export function artifactManifestPropertiesFormatSerializer( + item: ArtifactManifestPropertiesFormat, +): any { + return { + artifacts: !item["artifacts"] + ? item["artifacts"] + : manifestArtifactFormatArraySerializer(item["artifacts"]), + }; +} + +export function artifactManifestPropertiesFormatDeserializer( + item: any, +): ArtifactManifestPropertiesFormat { + return { + provisioningState: item["provisioningState"], + artifactManifestState: item["artifactManifestState"], + artifacts: !item["artifacts"] + ? item["artifacts"] + : manifestArtifactFormatArrayDeserializer(item["artifacts"]), + }; +} + +/** The artifact manifest state. */ +export enum KnownArtifactManifestState { + /** Unknown */ + Unknown = "Unknown", + /** Uploading */ + Uploading = "Uploading", + /** Uploaded */ + Uploaded = "Uploaded", + /** Validating */ + Validating = "Validating", + /** ValidationFailed */ + ValidationFailed = "ValidationFailed", + /** Succeeded */ + Succeeded = "Succeeded", +} + +/** + * The artifact manifest state. \ + * {@link KnownArtifactManifestState} can be used interchangeably with ArtifactManifestState, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Unknown** \ + * **Uploading** \ + * **Uploaded** \ + * **Validating** \ + * **ValidationFailed** \ + * **Succeeded** + */ +export type ArtifactManifestState = string; + +export function manifestArtifactFormatArraySerializer( + result: Array, +): any[] { + return result.map((item) => { + return manifestArtifactFormatSerializer(item); + }); +} + +export function manifestArtifactFormatArrayDeserializer( + result: Array, +): any[] { + return result.map((item) => { + return manifestArtifactFormatDeserializer(item); + }); +} + +/** Manifest artifact properties. */ +export interface ManifestArtifactFormat { + /** The artifact name */ + artifactName?: string; + /** The artifact type. */ + artifactType?: ArtifactType; + /** The artifact version. */ + artifactVersion?: string; +} + +export function manifestArtifactFormatSerializer(item: ManifestArtifactFormat): any { + return { + artifactName: item["artifactName"], + artifactType: item["artifactType"], + artifactVersion: item["artifactVersion"], + }; +} + +export function manifestArtifactFormatDeserializer(item: any): ManifestArtifactFormat { + return { + artifactName: item["artifactName"], + artifactType: item["artifactType"], + artifactVersion: item["artifactVersion"], + }; +} + +/** The response of a ArtifactManifest list operation. */ +export interface _ArtifactManifestListResult { + /** The ArtifactManifest items on this page */ + value: ArtifactManifest[]; + /** The link to the next page of items */ + nextLink?: string; +} + +export function _artifactManifestListResultDeserializer(item: any): _ArtifactManifestListResult { + return { + value: artifactManifestArrayDeserializer(item["value"]), + nextLink: item["nextLink"], + }; +} + +export function artifactManifestArraySerializer(result: Array): any[] { + return result.map((item) => { + return artifactManifestSerializer(item); + }); +} + +export function artifactManifestArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return artifactManifestDeserializer(item); + }); +} + +/** The artifact manifest credential definition. */ +export interface ArtifactAccessCredential { + /** The credential type. */ + /** The discriminator possible values: AzureContainerRegistryScopedToken, AzureStorageAccountToken */ + credentialType: CredentialType; +} + +export function artifactAccessCredentialDeserializer(item: any): ArtifactAccessCredential { + return { + credentialType: item["credentialType"], + }; +} + +/** Alias for ArtifactAccessCredentialUnion */ +export type ArtifactAccessCredentialUnion = + | AzureContainerRegistryScopedTokenCredential + | AzureStorageAccountCredential + | ArtifactAccessCredential; + +export function artifactAccessCredentialUnionDeserializer( + item: any, +): ArtifactAccessCredentialUnion { + switch (item.credentialType) { + case "AzureContainerRegistryScopedToken": + return azureContainerRegistryScopedTokenCredentialDeserializer( + item as AzureContainerRegistryScopedTokenCredential, + ); + + case "AzureStorageAccountToken": + return azureStorageAccountCredentialDeserializer(item as AzureStorageAccountCredential); + + default: + return artifactAccessCredentialDeserializer(item); + } +} + +/** The credential type. */ +export enum KnownCredentialType { + /** Unknown */ + Unknown = "Unknown", + /** AzureContainerRegistryScopedToken */ + AzureContainerRegistryScopedToken = "AzureContainerRegistryScopedToken", + /** AzureStorageAccountToken */ + AzureStorageAccountToken = "AzureStorageAccountToken", +} + +/** + * The credential type. \ + * {@link KnownCredentialType} can be used interchangeably with CredentialType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Unknown** \ + * **AzureContainerRegistryScopedToken** \ + * **AzureStorageAccountToken** + */ +export type CredentialType = string; + +/** The azure container registry scoped token credential definition. */ +export interface AzureContainerRegistryScopedTokenCredential extends ArtifactAccessCredential { + /** The username of the credential. */ + username?: string; + /** The credential value. */ + acrToken?: string; + /** The Acr server url */ + acrServerUrl?: string; + /** The repositories that could be accessed using the current credential. */ + repositories?: string[]; + /** The UTC time when credential will expire. */ + expiry?: Date; + /** The credential type. */ + credentialType: "AzureContainerRegistryScopedToken"; +} + +export function azureContainerRegistryScopedTokenCredentialDeserializer( + item: any, +): AzureContainerRegistryScopedTokenCredential { + return { + credentialType: item["credentialType"], + username: item["username"], + acrToken: item["acrToken"], + acrServerUrl: item["acrServerUrl"], + repositories: !item["repositories"] + ? item["repositories"] + : item["repositories"].map((p: any) => { + return p; + }), + expiry: !item["expiry"] ? item["expiry"] : new Date(item["expiry"]), + }; +} + +/** The azure storage account credential definition. */ +export interface AzureStorageAccountCredential extends ArtifactAccessCredential { + /** The storage account Id */ + storageAccountId?: string; + /** The containers that could be accessed using the current credential. */ + containerCredentials?: AzureStorageAccountContainerCredential[]; + /** The UTC time when credential will expire. */ + expiry?: Date; + /** The credential type. */ + credentialType: "AzureStorageAccountToken"; +} + +export function azureStorageAccountCredentialDeserializer( + item: any, +): AzureStorageAccountCredential { + return { + credentialType: item["credentialType"], + storageAccountId: item["storageAccountId"], + containerCredentials: !item["containerCredentials"] + ? item["containerCredentials"] + : azureStorageAccountContainerCredentialArrayDeserializer(item["containerCredentials"]), + expiry: !item["expiry"] ? item["expiry"] : new Date(item["expiry"]), + }; +} + +export function azureStorageAccountContainerCredentialArrayDeserializer( + result: Array, +): any[] { + return result.map((item) => { + return azureStorageAccountContainerCredentialDeserializer(item); + }); +} + +/** The azure storage account container credential definition. */ +export interface AzureStorageAccountContainerCredential { + /** The storage account container name */ + containerName?: string; + /** The storage account container sas uri */ + containerSasUri?: string; +} + +export function azureStorageAccountContainerCredentialDeserializer( + item: any, +): AzureStorageAccountContainerCredential { + return { + containerName: item["containerName"], + containerSasUri: item["containerSasUri"], + }; +} + +/** The artifact manifest updating request payload. Only the 'Uploaded' state is allowed for updates. Other states are used for internal state transitioning. */ +export interface ArtifactManifestUpdateState { + /** The artifact manifest state. */ + artifactManifestState?: ArtifactManifestState; +} + +export function artifactManifestUpdateStateSerializer(item: ArtifactManifestUpdateState): any { + return { artifactManifestState: item["artifactManifestState"] }; +} + +export function artifactManifestUpdateStateDeserializer(item: any): ArtifactManifestUpdateState { + return { + artifactManifestState: item["artifactManifestState"], + }; +} + +/** Site resource. */ +export interface Site extends TrackedResource { + /** Site properties. */ + properties?: SitePropertiesFormat; +} + +export function siteSerializer(item: Site): any { + return { + tags: item["tags"], + location: item["location"], + properties: !item["properties"] + ? item["properties"] + : sitePropertiesFormatSerializer(item["properties"]), + }; +} + +export function siteDeserializer(item: any): Site { + return { + tags: !item["tags"] + ? item["tags"] + : Object.fromEntries(Object.entries(item["tags"]).map(([k, p]: [string, any]) => [k, p])), + location: item["location"], + id: item["id"], + name: item["name"], + type: item["type"], + systemData: !item["systemData"] + ? item["systemData"] + : systemDataDeserializer(item["systemData"]), + properties: !item["properties"] + ? item["properties"] + : sitePropertiesFormatDeserializer(item["properties"]), + }; +} + +/** Site properties. */ +export interface SitePropertiesFormat { + /** The provisioning state of the site resource. **TODO**: Confirm if this is needed. */ + readonly provisioningState?: ProvisioningState; + /** List of NFVIs */ + nfvis?: NFVIsUnion[]; + /** The list of site network services on the site. */ + readonly siteNetworkServiceReferences?: ReferencedResource[]; +} + +export function sitePropertiesFormatSerializer(item: SitePropertiesFormat): any { + return { nfvis: !item["nfvis"] ? item["nfvis"] : nfvIsUnionArraySerializer(item["nfvis"]) }; +} + +export function sitePropertiesFormatDeserializer(item: any): SitePropertiesFormat { + return { + provisioningState: item["provisioningState"], + nfvis: !item["nfvis"] ? item["nfvis"] : nfvIsUnionArrayDeserializer(item["nfvis"]), + siteNetworkServiceReferences: !item["siteNetworkServiceReferences"] + ? item["siteNetworkServiceReferences"] + : referencedResourceArrayDeserializer(item["siteNetworkServiceReferences"]), + }; +} + +export function nfvIsUnionArraySerializer(result: Array): any[] { + return result.map((item) => { + return nfvIsUnionSerializer(item); + }); +} + +export function nfvIsUnionArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return nfvIsUnionDeserializer(item); + }); +} + +/** The NFVI object. */ +export interface NFVIs { + /** Name of the nfvi. */ + name?: string; + /** The NFVI type. */ + /** The discriminator possible values: AzureCore, AzureArcKubernetes, AzureOperatorNexus */ + nfviType: NfviType; +} + +export function nfvIsSerializer(item: NFVIs): any { + return { name: item["name"], nfviType: item["nfviType"] }; +} + +export function nfvIsDeserializer(item: any): NFVIs { + return { + name: item["name"], + nfviType: item["nfviType"], + }; +} + +/** Alias for NFVIsUnion */ +export type NFVIsUnion = + | AzureCoreNfviDetails + | AzureArcK8SClusterNfviDetails + | AzureOperatorNexusClusterNfviDetails + | NFVIs; + +export function nfvIsUnionSerializer(item: NFVIsUnion): any { + switch (item.nfviType) { + case "AzureCore": + return azureCoreNfviDetailsSerializer(item as AzureCoreNfviDetails); + + case "AzureArcKubernetes": + return azureArcK8SClusterNfviDetailsSerializer(item as AzureArcK8SClusterNfviDetails); + + case "AzureOperatorNexus": + return azureOperatorNexusClusterNfviDetailsSerializer( + item as AzureOperatorNexusClusterNfviDetails, + ); + + default: + return nfvIsSerializer(item); + } +} + +export function nfvIsUnionDeserializer(item: any): NFVIsUnion { + switch (item.nfviType) { + case "AzureCore": + return azureCoreNfviDetailsDeserializer(item as AzureCoreNfviDetails); + + case "AzureArcKubernetes": + return azureArcK8SClusterNfviDetailsDeserializer(item as AzureArcK8SClusterNfviDetails); + + case "AzureOperatorNexus": + return azureOperatorNexusClusterNfviDetailsDeserializer( + item as AzureOperatorNexusClusterNfviDetails, + ); + + default: + return nfvIsDeserializer(item); + } +} + +/** The Azure Core NFVI detail. */ +export interface AzureCoreNfviDetails extends NFVIs { + /** Location of the Azure core. */ + location?: string; + /** The NFVI type. */ + nfviType: "AzureCore"; +} + +export function azureCoreNfviDetailsSerializer(item: AzureCoreNfviDetails): any { + return { name: item["name"], nfviType: item["nfviType"], location: item["location"] }; +} + +export function azureCoreNfviDetailsDeserializer(item: any): AzureCoreNfviDetails { + return { + name: item["name"], + nfviType: item["nfviType"], + location: item["location"], + }; +} + +/** The AzureArcK8sCluster NFVI detail. */ +export interface AzureArcK8SClusterNfviDetails extends NFVIs { + /** The reference to the custom location. */ + customLocationReference?: ReferencedResource; + /** The NFVI type. */ + nfviType: "AzureArcKubernetes"; +} + +export function azureArcK8SClusterNfviDetailsSerializer(item: AzureArcK8SClusterNfviDetails): any { + return { + name: item["name"], + nfviType: item["nfviType"], + customLocationReference: !item["customLocationReference"] + ? item["customLocationReference"] + : referencedResourceSerializer(item["customLocationReference"]), + }; +} + +export function azureArcK8SClusterNfviDetailsDeserializer( + item: any, +): AzureArcK8SClusterNfviDetails { + return { + name: item["name"], + nfviType: item["nfviType"], + customLocationReference: !item["customLocationReference"] + ? item["customLocationReference"] + : referencedResourceDeserializer(item["customLocationReference"]), + }; +} + +/** The AzureOperatorNexusCluster NFVI detail. */ +export interface AzureOperatorNexusClusterNfviDetails extends NFVIs { + /** The reference to the custom location. */ + customLocationReference?: ReferencedResource; + /** The NFVI type. */ + nfviType: "AzureOperatorNexus"; +} + +export function azureOperatorNexusClusterNfviDetailsSerializer( + item: AzureOperatorNexusClusterNfviDetails, +): any { + return { + name: item["name"], + nfviType: item["nfviType"], + customLocationReference: !item["customLocationReference"] + ? item["customLocationReference"] + : referencedResourceSerializer(item["customLocationReference"]), + }; +} + +export function azureOperatorNexusClusterNfviDetailsDeserializer( + item: any, +): AzureOperatorNexusClusterNfviDetails { + return { + name: item["name"], + nfviType: item["nfviType"], + customLocationReference: !item["customLocationReference"] + ? item["customLocationReference"] + : referencedResourceDeserializer(item["customLocationReference"]), + }; +} + +/** The response of a Site list operation. */ +export interface _SiteListResult { + /** The Site items on this page */ + value: Site[]; + /** The link to the next page of items */ + nextLink?: string; +} + +export function _siteListResultDeserializer(item: any): _SiteListResult { + return { + value: siteArrayDeserializer(item["value"]), + nextLink: item["nextLink"], + }; +} + +export function siteArraySerializer(result: Array): any[] { + return result.map((item) => { + return siteSerializer(item); + }); +} + +export function siteArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return siteDeserializer(item); + }); +} + +/** Site network service resource. */ +export interface SiteNetworkService extends TrackedResource { + /** Site network service properties. */ + properties?: SiteNetworkServicePropertiesFormat; + /** The managed identity of the Site network service, if configured. */ + identity?: ManagedServiceIdentity; + /** Sku of the site network service. */ + sku?: Sku; +} + +export function siteNetworkServiceSerializer(item: SiteNetworkService): any { + return { + tags: item["tags"], + location: item["location"], + properties: !item["properties"] + ? item["properties"] + : siteNetworkServicePropertiesFormatSerializer(item["properties"]), + identity: !item["identity"] + ? item["identity"] + : managedServiceIdentitySerializer(item["identity"]), + sku: !item["sku"] ? item["sku"] : skuSerializer(item["sku"]), + }; +} + +export function siteNetworkServiceDeserializer(item: any): SiteNetworkService { + return { + tags: !item["tags"] + ? item["tags"] + : Object.fromEntries(Object.entries(item["tags"]).map(([k, p]: [string, any]) => [k, p])), + location: item["location"], + id: item["id"], + name: item["name"], + type: item["type"], + systemData: !item["systemData"] + ? item["systemData"] + : systemDataDeserializer(item["systemData"]), + properties: !item["properties"] + ? item["properties"] + : siteNetworkServicePropertiesFormatDeserializer(item["properties"]), + identity: !item["identity"] + ? item["identity"] + : managedServiceIdentityDeserializer(item["identity"]), + sku: !item["sku"] ? item["sku"] : skuDeserializer(item["sku"]), + }; +} + +/** Site network service properties. */ +export interface SiteNetworkServicePropertiesFormat { + /** The provisioning state of the site network service resource. */ + readonly provisioningState?: ProvisioningState; + /** Managed resource group configuration. */ + managedResourceGroupConfiguration?: ManagedResourceGroupConfiguration; + /** The site details */ + siteReference?: ReferencedResource; + /** The publisher name for the site network service. */ + readonly publisherName?: string; + /** The scope of the publisher. */ + readonly publisherScope?: PublisherScope; + /** The network service design group name for the site network service. */ + readonly networkServiceDesignGroupName?: string; + /** The network service design version for the site network service. */ + readonly networkServiceDesignVersionName?: string; + /** The location of the network service design offering. */ + readonly networkServiceDesignVersionOfferingLocation?: string; + /** The network service design version resource reference. */ + networkServiceDesignVersionResourceReference?: DeploymentResourceIdReferenceUnion; + /** The goal state of the site network service resource. This has references to the configuration group value objects that describe the desired state of the site network service. */ + desiredStateConfigurationGroupValueReferences?: Record; + /** The network service design version for the site network service. */ + readonly lastStateNetworkServiceDesignVersionName?: string; + /** The last state of the site network service resource. */ + readonly lastStateConfigurationGroupValueReferences?: Record; +} + +export function siteNetworkServicePropertiesFormatSerializer( + item: SiteNetworkServicePropertiesFormat, +): any { + return { + managedResourceGroupConfiguration: !item["managedResourceGroupConfiguration"] + ? item["managedResourceGroupConfiguration"] + : managedResourceGroupConfigurationSerializer(item["managedResourceGroupConfiguration"]), + siteReference: !item["siteReference"] + ? item["siteReference"] + : referencedResourceSerializer(item["siteReference"]), + networkServiceDesignVersionResourceReference: !item[ + "networkServiceDesignVersionResourceReference" + ] + ? item["networkServiceDesignVersionResourceReference"] + : deploymentResourceIdReferenceUnionSerializer( + item["networkServiceDesignVersionResourceReference"], + ), + desiredStateConfigurationGroupValueReferences: !item[ + "desiredStateConfigurationGroupValueReferences" + ] + ? item["desiredStateConfigurationGroupValueReferences"] + : referencedResourceRecordSerializer(item["desiredStateConfigurationGroupValueReferences"]), + }; +} + +export function siteNetworkServicePropertiesFormatDeserializer( + item: any, +): SiteNetworkServicePropertiesFormat { + return { + provisioningState: item["provisioningState"], + managedResourceGroupConfiguration: !item["managedResourceGroupConfiguration"] + ? item["managedResourceGroupConfiguration"] + : managedResourceGroupConfigurationDeserializer(item["managedResourceGroupConfiguration"]), + siteReference: !item["siteReference"] + ? item["siteReference"] + : referencedResourceDeserializer(item["siteReference"]), + publisherName: item["publisherName"], + publisherScope: item["publisherScope"], + networkServiceDesignGroupName: item["networkServiceDesignGroupName"], + networkServiceDesignVersionName: item["networkServiceDesignVersionName"], + networkServiceDesignVersionOfferingLocation: + item["networkServiceDesignVersionOfferingLocation"], + networkServiceDesignVersionResourceReference: !item[ + "networkServiceDesignVersionResourceReference" + ] + ? item["networkServiceDesignVersionResourceReference"] + : deploymentResourceIdReferenceUnionDeserializer( + item["networkServiceDesignVersionResourceReference"], + ), + desiredStateConfigurationGroupValueReferences: !item[ + "desiredStateConfigurationGroupValueReferences" + ] + ? item["desiredStateConfigurationGroupValueReferences"] + : referencedResourceRecordDeserializer(item["desiredStateConfigurationGroupValueReferences"]), + lastStateNetworkServiceDesignVersionName: item["lastStateNetworkServiceDesignVersionName"], + lastStateConfigurationGroupValueReferences: !item["lastStateConfigurationGroupValueReferences"] + ? item["lastStateConfigurationGroupValueReferences"] + : referencedResourceRecordDeserializer(item["lastStateConfigurationGroupValueReferences"]), + }; +} + +/** Managed resource group configuration. */ +export interface ManagedResourceGroupConfiguration { + /** Managed resource group name. */ + name?: string; + /** Managed resource group location. */ + location?: string; +} + +export function managedResourceGroupConfigurationSerializer( + item: ManagedResourceGroupConfiguration, +): any { + return { name: item["name"], location: item["location"] }; +} + +export function managedResourceGroupConfigurationDeserializer( + item: any, +): ManagedResourceGroupConfiguration { + return { + name: item["name"], + location: item["location"], + }; +} + +/** Sku, to be associated with a SiteNetworkService. */ +export interface Sku { + /** Name of this Sku */ + name: SkuName; + /** The SKU tier based on the SKU name. */ + readonly tier?: SkuTier; +} + +export function skuSerializer(item: Sku): any { + return { name: item["name"] }; +} + +export function skuDeserializer(item: any): Sku { + return { + name: item["name"], + tier: item["tier"], + }; +} + +/** Name of this Sku */ +export enum KnownSkuName { + /** Basic */ + Basic = "Basic", + /** Standard */ + Standard = "Standard", +} + +/** + * Name of this Sku \ + * {@link KnownSkuName} can be used interchangeably with SkuName, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Basic** \ + * **Standard** + */ +export type SkuName = string; + +/** The SKU tier based on the SKU name. */ +export enum KnownSkuTier { + /** Basic */ + Basic = "Basic", + /** Standard */ + Standard = "Standard", +} + +/** + * The SKU tier based on the SKU name. \ + * {@link KnownSkuTier} can be used interchangeably with SkuTier, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Basic** \ + * **Standard** + */ +export type SkuTier = string; + +/** The response of a SiteNetworkService list operation. */ +export interface _SiteNetworkServiceListResult { + /** The SiteNetworkService items on this page */ + value: SiteNetworkService[]; + /** The link to the next page of items */ + nextLink?: string; +} + +export function _siteNetworkServiceListResultDeserializer( + item: any, +): _SiteNetworkServiceListResult { + return { + value: siteNetworkServiceArrayDeserializer(item["value"]), + nextLink: item["nextLink"], + }; +} + +export function siteNetworkServiceArraySerializer(result: Array): any[] { + return result.map((item) => { + return siteNetworkServiceSerializer(item); + }); +} + +export function siteNetworkServiceArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return siteNetworkServiceDeserializer(item); + }); +} + +/** Cancels an ongoing long-running operation, only Put is supported now */ +export interface CancelInformation { + /** The ARM id of the siteNetworkService resource. */ + siteNetworkServiceReference: ReferencedResource; + /** The type of long-running operation the user wants to cancel, such as 'Put'. */ + longRunningOperation?: LongRunningOperation; +} + +export function cancelInformationSerializer(item: CancelInformation): any { + return { + siteNetworkServiceReference: referencedResourceSerializer(item["siteNetworkServiceReference"]), + longRunningOperation: item["longRunningOperation"], + }; +} + +/** The type of long-running operation the user wants to cancel, such as 'Put'. */ +export enum KnownLongRunningOperation { + /** Unknown */ + Unknown = "Unknown", + /** Put */ + Put = "Put", +} + +/** + * The type of long-running operation the user wants to cancel, such as 'Put'. \ + * {@link KnownLongRunningOperation} can be used interchangeably with LongRunningOperation, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Unknown** \ + * **Put** + */ +export type LongRunningOperation = string; + +/** The available API versions. */ +export enum KnownVersions { + /** The 2025-03-30 API version. */ + V20250330 = "2025-03-30", +} diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/restorePollerHelpers.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/restorePollerHelpers.ts new file mode 100644 index 0000000000..3115f46d9b --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/restorePollerHelpers.ts @@ -0,0 +1,337 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { HybridNetworkManagementClient } from "./hybridNetworkManagementClient.js"; +import { + _cancelOperationDeserialize, + _$deleteDeserialize, + _createOrUpdateDeserialize, +} from "./api/siteNetworkServices/operations.js"; +import { + _$deleteDeserialize as _$deleteDeserializeSites, + _createOrUpdateDeserialize as _createOrUpdateDeserializeSites, +} from "./api/sites/operations.js"; +import { + _updateStateDeserialize, + _$deleteDeserialize as _$deleteDeserializeArtifactManifests, + _createOrUpdateDeserialize as _createOrUpdateDeserializeArtifactManifests, +} from "./api/artifactManifests/operations.js"; +import { _updateStateDeserialize as _updateStateDeserializeProxyArtifact } from "./api/proxyArtifact/operations.js"; +import { + _removePrivateEndPointsDeserialize, + _approvePrivateEndPointsDeserialize, + _deleteNetworkFabricControllerEndPointsDeserialize, + _addNetworkFabricControllerEndPointsDeserialize, + _$deleteDeserialize as _$deleteDeserializeArtifactStores, + _createOrUpdateDeserialize as _createOrUpdateDeserializeArtifactStores, +} from "./api/artifactStores/operations.js"; +import { + _updateStateDeserialize as _updateStateDeserializeNetworkServiceDesignVersions, + _$deleteDeserialize as _$deleteDeserializeNetworkServiceDesignVersions, + _createOrUpdateDeserialize as _createOrUpdateDeserializeNetworkServiceDesignVersions, +} from "./api/networkServiceDesignVersions/operations.js"; +import { + _$deleteDeserialize as _$deleteDeserializeNetworkServiceDesignGroups, + _createOrUpdateDeserialize as _createOrUpdateDeserializeNetworkServiceDesignGroups, +} from "./api/networkServiceDesignGroups/operations.js"; +import { + _updateStateDeserialize as _updateStateDeserializeNetworkFunctionDefinitionVersions, + _$deleteDeserialize as _$deleteDeserializeNetworkFunctionDefinitionVersions, + _createOrUpdateDeserialize as _createOrUpdateDeserializeNetworkFunctionDefinitionVersions, +} from "./api/networkFunctionDefinitionVersions/operations.js"; +import { + _$deleteDeserialize as _$deleteDeserializeNetworkFunctionDefinitionGroups, + _createOrUpdateDeserialize as _createOrUpdateDeserializeNetworkFunctionDefinitionGroups, +} from "./api/networkFunctionDefinitionGroups/operations.js"; +import { + _executeRequestDeserialize, + _$deleteDeserialize as _$deleteDeserializeNetworkFunctions, + _createOrUpdateDeserialize as _createOrUpdateDeserializeNetworkFunctions, +} from "./api/networkFunctions/operations.js"; +import { + _$deleteDeserialize as _$deleteDeserializeConfigurationGroupValues, + _createOrUpdateDeserialize as _createOrUpdateDeserializeConfigurationGroupValues, +} from "./api/configurationGroupValues/operations.js"; +import { + _$deleteDeserialize as _$deleteDeserializePublishers, + _createOrUpdateDeserialize as _createOrUpdateDeserializePublishers, +} from "./api/publishers/operations.js"; +import { + _updateStateDeserialize as _updateStateDeserializeConfigurationGroupSchemas, + _$deleteDeserialize as _$deleteDeserializeConfigurationGroupSchemas, + _createOrUpdateDeserialize as _createOrUpdateDeserializeConfigurationGroupSchemas, +} from "./api/configurationGroupSchemas/operations.js"; +import { getLongRunningPoller } from "./static-helpers/pollingHelpers.js"; +import { OperationOptions, PathUncheckedResponse } from "@azure-rest/core-client"; +import { AbortSignalLike } from "@azure/abort-controller"; +import { + PollerLike, + OperationState, + deserializeState, + ResourceLocationConfig, +} from "@azure/core-lro"; + +export interface RestorePollerOptions< + TResult, + TResponse extends PathUncheckedResponse = PathUncheckedResponse, +> extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** + * The signal which can be used to abort requests. + */ + abortSignal?: AbortSignalLike; + /** Deserialization function for raw response body */ + processResponseBody?: (result: TResponse) => Promise; +} + +/** + * Creates a poller from the serialized state of another poller. This can be + * useful when you want to create pollers on a different host or a poller + * needs to be constructed after the original one is not in scope. + */ +export function restorePoller( + client: HybridNetworkManagementClient, + serializedState: string, + sourceOperation: (...args: any[]) => PollerLike, TResult>, + options?: RestorePollerOptions, +): PollerLike, TResult> { + const pollerConfig = deserializeState(serializedState).config; + const { initialRequestUrl, requestMethod, metadata } = pollerConfig; + if (!initialRequestUrl || !requestMethod) { + throw new Error( + `Invalid serialized state: ${serializedState} for sourceOperation ${sourceOperation?.name}`, + ); + } + const resourceLocationConfig = metadata?.["resourceLocationConfig"] as + | ResourceLocationConfig + | undefined; + const { deserializer, expectedStatuses = [] } = + getDeserializationHelper(initialRequestUrl, requestMethod) ?? {}; + const deserializeHelper = options?.processResponseBody ?? deserializer; + if (!deserializeHelper) { + throw new Error( + `Please ensure the operation is in this client! We can't find its deserializeHelper for ${sourceOperation?.name}.`, + ); + } + return getLongRunningPoller( + (client as any)["_client"] ?? client, + deserializeHelper as (result: TResponse) => Promise, + expectedStatuses, + { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + resourceLocationConfig, + restoreFrom: serializedState, + initialRequestUrl, + }, + ); +} + +interface DeserializationHelper { + deserializer: (result: PathUncheckedResponse) => Promise; + expectedStatuses: string[]; +} + +const deserializeMap: Record = { + "POST /subscriptions/{subscriptionId}/providers/Microsoft.HybridNetwork/cancelSiteNetworkServiceOperation": + { deserializer: _cancelOperationDeserialize, expectedStatuses: ["202", "200", "201"] }, + "DELETE /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/siteNetworkServices/{siteNetworkServiceName}": + { deserializer: _$deleteDeserialize, expectedStatuses: ["202", "204", "200"] }, + "PUT /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/siteNetworkServices/{siteNetworkServiceName}": + { deserializer: _createOrUpdateDeserialize, expectedStatuses: ["200", "201", "202"] }, + "DELETE /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/sites/{siteName}": + { deserializer: _$deleteDeserializeSites, expectedStatuses: ["202", "204", "200"] }, + "PUT /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/sites/{siteName}": + { deserializer: _createOrUpdateDeserializeSites, expectedStatuses: ["200", "201", "202"] }, + "POST /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/artifactStores/{artifactStoreName}/artifactManifests/{artifactManifestName}/updateState": + { deserializer: _updateStateDeserialize, expectedStatuses: ["200", "202", "201"] }, + "DELETE /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/artifactStores/{artifactStoreName}/artifactManifests/{artifactManifestName}": + { deserializer: _$deleteDeserializeArtifactManifests, expectedStatuses: ["202", "204", "200"] }, + "PUT /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/artifactStores/{artifactStoreName}/artifactManifests/{artifactManifestName}": + { + deserializer: _createOrUpdateDeserializeArtifactManifests, + expectedStatuses: ["200", "201", "202"], + }, + "PATCH /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/artifactStores/{artifactStoreName}/artifactVersions/{artifactVersionName}": + { deserializer: _updateStateDeserializeProxyArtifact, expectedStatuses: ["200", "202", "201"] }, + "POST /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/artifactStores/{artifactStoreName}/removePrivateEndPoints": + { deserializer: _removePrivateEndPointsDeserialize, expectedStatuses: ["202", "200", "201"] }, + "POST /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/artifactStores/{artifactStoreName}/approvePrivateEndPoints": + { deserializer: _approvePrivateEndPointsDeserialize, expectedStatuses: ["202", "200", "201"] }, + "POST /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/artifactStores/{artifactStoreName}/deleteNetworkFabricControllerEndPoints": + { + deserializer: _deleteNetworkFabricControllerEndPointsDeserialize, + expectedStatuses: ["202", "200", "201"], + }, + "POST /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/artifactStores/{artifactStoreName}/addNetworkFabricControllerEndPoints": + { + deserializer: _addNetworkFabricControllerEndPointsDeserialize, + expectedStatuses: ["202", "200", "201"], + }, + "DELETE /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/artifactStores/{artifactStoreName}": + { deserializer: _$deleteDeserializeArtifactStores, expectedStatuses: ["202", "204", "200"] }, + "PUT /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/artifactStores/{artifactStoreName}": + { + deserializer: _createOrUpdateDeserializeArtifactStores, + expectedStatuses: ["200", "201", "202"], + }, + "POST /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkServiceDesignGroups/{networkServiceDesignGroupName}/networkServiceDesignVersions/{networkServiceDesignVersionName}/updateState": + { + deserializer: _updateStateDeserializeNetworkServiceDesignVersions, + expectedStatuses: ["200", "202", "201"], + }, + "DELETE /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkServiceDesignGroups/{networkServiceDesignGroupName}/networkServiceDesignVersions/{networkServiceDesignVersionName}": + { + deserializer: _$deleteDeserializeNetworkServiceDesignVersions, + expectedStatuses: ["202", "204", "200"], + }, + "PUT /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkServiceDesignGroups/{networkServiceDesignGroupName}/networkServiceDesignVersions/{networkServiceDesignVersionName}": + { + deserializer: _createOrUpdateDeserializeNetworkServiceDesignVersions, + expectedStatuses: ["200", "201", "202"], + }, + "DELETE /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkServiceDesignGroups/{networkServiceDesignGroupName}": + { + deserializer: _$deleteDeserializeNetworkServiceDesignGroups, + expectedStatuses: ["202", "204", "200"], + }, + "PUT /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkServiceDesignGroups/{networkServiceDesignGroupName}": + { + deserializer: _createOrUpdateDeserializeNetworkServiceDesignGroups, + expectedStatuses: ["200", "201", "202"], + }, + "POST /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkFunctionDefinitionGroups/{networkFunctionDefinitionGroupName}/networkFunctionDefinitionVersions/{networkFunctionDefinitionVersionName}/updateState": + { + deserializer: _updateStateDeserializeNetworkFunctionDefinitionVersions, + expectedStatuses: ["200", "202", "201"], + }, + "DELETE /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkFunctionDefinitionGroups/{networkFunctionDefinitionGroupName}/networkFunctionDefinitionVersions/{networkFunctionDefinitionVersionName}": + { + deserializer: _$deleteDeserializeNetworkFunctionDefinitionVersions, + expectedStatuses: ["202", "204", "200"], + }, + "PUT /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkFunctionDefinitionGroups/{networkFunctionDefinitionGroupName}/networkFunctionDefinitionVersions/{networkFunctionDefinitionVersionName}": + { + deserializer: _createOrUpdateDeserializeNetworkFunctionDefinitionVersions, + expectedStatuses: ["200", "201", "202"], + }, + "DELETE /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkFunctionDefinitionGroups/{networkFunctionDefinitionGroupName}": + { + deserializer: _$deleteDeserializeNetworkFunctionDefinitionGroups, + expectedStatuses: ["202", "204", "200"], + }, + "PUT /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkFunctionDefinitionGroups/{networkFunctionDefinitionGroupName}": + { + deserializer: _createOrUpdateDeserializeNetworkFunctionDefinitionGroups, + expectedStatuses: ["200", "201", "202"], + }, + "POST /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/networkFunctions/{networkFunctionName}/executeRequest": + { deserializer: _executeRequestDeserialize, expectedStatuses: ["200", "202", "201"] }, + "DELETE /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/networkFunctions/{networkFunctionName}": + { deserializer: _$deleteDeserializeNetworkFunctions, expectedStatuses: ["200", "202", "204"] }, + "PUT /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/networkFunctions/{networkFunctionName}": + { + deserializer: _createOrUpdateDeserializeNetworkFunctions, + expectedStatuses: ["200", "201", "202"], + }, + "DELETE /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/configurationGroupValues/{configurationGroupValueName}": + { + deserializer: _$deleteDeserializeConfigurationGroupValues, + expectedStatuses: ["202", "204", "200"], + }, + "PUT /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/configurationGroupValues/{configurationGroupValueName}": + { + deserializer: _createOrUpdateDeserializeConfigurationGroupValues, + expectedStatuses: ["200", "201", "202"], + }, + "DELETE /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}": + { deserializer: _$deleteDeserializePublishers, expectedStatuses: ["202", "204", "200"] }, + "PUT /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}": + { deserializer: _createOrUpdateDeserializePublishers, expectedStatuses: ["200", "201", "202"] }, + "POST /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/configurationGroupSchemas/{configurationGroupSchemaName}/updateState": + { + deserializer: _updateStateDeserializeConfigurationGroupSchemas, + expectedStatuses: ["200", "202", "201"], + }, + "DELETE /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/configurationGroupSchemas/{configurationGroupSchemaName}": + { + deserializer: _$deleteDeserializeConfigurationGroupSchemas, + expectedStatuses: ["202", "204", "200"], + }, + "PUT /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/configurationGroupSchemas/{configurationGroupSchemaName}": + { + deserializer: _createOrUpdateDeserializeConfigurationGroupSchemas, + expectedStatuses: ["200", "201", "202"], + }, +}; + +function getDeserializationHelper( + urlStr: string, + method: string, +): DeserializationHelper | undefined { + const path = new URL(urlStr).pathname; + const pathParts = path.split("/"); + + // Traverse list to match the longest candidate + // matchedLen: the length of candidate path + // matchedValue: the matched status code array + let matchedLen = -1, + matchedValue: DeserializationHelper | undefined; + + // Iterate the responseMap to find a match + for (const [key, value] of Object.entries(deserializeMap)) { + // Extracting the path from the map key which is in format + // GET /path/foo + if (!key.startsWith(method)) { + continue; + } + const candidatePath = getPathFromMapKey(key); + // Get each part of the url path + const candidateParts = candidatePath.split("/"); + + // track if we have found a match to return the values found. + let found = true; + for (let i = candidateParts.length - 1, j = pathParts.length - 1; i >= 1 && j >= 1; i--, j--) { + if (candidateParts[i]?.startsWith("{") && candidateParts[i]?.indexOf("}") !== -1) { + const start = candidateParts[i]!.indexOf("}") + 1, + end = candidateParts[i]?.length; + // If the current part of the candidate is a "template" part + // Try to use the suffix of pattern to match the path + // {guid} ==> $ + // {guid}:export ==> :export$ + const isMatched = new RegExp(`${candidateParts[i]?.slice(start, end)}`).test( + pathParts[j] || "", + ); + + if (!isMatched) { + found = false; + break; + } + continue; + } + + // If the candidate part is not a template and + // the parts don't match mark the candidate as not found + // to move on with the next candidate path. + if (candidateParts[i] !== pathParts[j]) { + found = false; + break; + } + } + + // We finished evaluating the current candidate parts + // Update the matched value if and only if we found the longer pattern + if (found && candidatePath.length > matchedLen) { + matchedLen = candidatePath.length; + matchedValue = value; + } + } + + return matchedValue; +} + +function getPathFromMapKey(mapKey: string): string { + const pathStart = mapKey.indexOf("/"); + return mapKey.slice(pathStart); +} diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/static-helpers/cloudSettingHelpers.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/static-helpers/cloudSettingHelpers.ts new file mode 100644 index 0000000000..613112c6e3 --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/static-helpers/cloudSettingHelpers.ts @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +/** + * An enum to describe Azure Cloud environments. + * @enum {string} + */ +export enum AzureClouds { + /** Azure public cloud, which is the default cloud for Azure SDKs. */ + AZURE_PUBLIC_CLOUD = "AZURE_PUBLIC_CLOUD", + /** Azure China cloud */ + AZURE_CHINA_CLOUD = "AZURE_CHINA_CLOUD", + /** Azure US government cloud */ + AZURE_US_GOVERNMENT = "AZURE_US_GOVERNMENT", +} + +/** The supported values for cloud setting as a string literal type */ +export type AzureSupportedClouds = `${AzureClouds}`; + +/** + * Gets the Azure Resource Manager endpoint URL for the specified cloud setting. + * @param cloudSetting - The Azure cloud environment setting. Use one of the AzureClouds enum values. + * @returns The ARM endpoint URL for the specified cloud, or undefined if cloudSetting is undefined. + * @throws {Error} Throws an error if an unknown cloud setting is provided. + */ +export function getArmEndpoint(cloudSetting?: AzureSupportedClouds): string | undefined { + if (cloudSetting === undefined) { + return undefined; + } + const cloudEndpoints: Record = { + AZURE_CHINA_CLOUD: "https://management.chinacloudapi.cn/", + AZURE_US_GOVERNMENT: "https://management.usgovcloudapi.net/", + AZURE_PUBLIC_CLOUD: "https://management.azure.com/", + }; + if (cloudSetting in cloudEndpoints) { + return cloudEndpoints[cloudSetting]; + } else { + throw new Error( + `Unknown cloud setting: ${cloudSetting}. Please refer to the enum AzureClouds for possible values.`, + ); + } +} diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/static-helpers/pagingHelpers.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/static-helpers/pagingHelpers.ts new file mode 100644 index 0000000000..5a3472a3f0 --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/static-helpers/pagingHelpers.ts @@ -0,0 +1,245 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { Client, createRestError, PathUncheckedResponse } from "@azure-rest/core-client"; +import { RestError } from "@azure/core-rest-pipeline"; + +/** + * Options for the byPage method + */ +export interface PageSettings { + /** + * A reference to a specific page to start iterating from. + */ + continuationToken?: string; +} + +/** + * An interface that describes a page of results. + */ +export type ContinuablePage = TPage & { + /** + * The token that keeps track of where to continue the iterator + */ + continuationToken?: string; +}; + +/** + * An interface that allows async iterable iteration both to completion and by page. + */ +export interface PagedAsyncIterableIterator< + TElement, + TPage = TElement[], + TPageSettings extends PageSettings = PageSettings, +> { + /** + * The next method, part of the iteration protocol + */ + next(): Promise>; + /** + * The connection to the async iterator, part of the iteration protocol + */ + [Symbol.asyncIterator](): PagedAsyncIterableIterator; + /** + * Return an AsyncIterableIterator that works a page at a time + */ + byPage: (settings?: TPageSettings) => AsyncIterableIterator>; +} + +/** + * An interface that describes how to communicate with the service. + */ +export interface PagedResult< + TElement, + TPage = TElement[], + TPageSettings extends PageSettings = PageSettings, +> { + /** + * Link to the first page of results. + */ + firstPageLink?: string; + /** + * A method that returns a page of results. + */ + getPage: (pageLink?: string) => Promise<{ page: TPage; nextPageLink?: string } | undefined>; + /** + * a function to implement the `byPage` method on the paged async iterator. + */ + byPage?: (settings?: TPageSettings) => AsyncIterableIterator>; + + /** + * A function to extract elements from a page. + */ + toElements?: (page: TPage) => TElement[]; +} + +/** + * Options for the paging helper + */ +export interface BuildPagedAsyncIteratorOptions { + itemName?: string; + nextLinkName?: string; + nextLinkMethod?: "GET" | "POST"; +} + +/** + * Helper to paginate results in a generic way and return a PagedAsyncIterableIterator + */ +export function buildPagedAsyncIterator< + TElement, + TPage = TElement[], + TPageSettings extends PageSettings = PageSettings, + TResponse extends PathUncheckedResponse = PathUncheckedResponse, +>( + client: Client, + getInitialResponse: () => PromiseLike, + processResponseBody: (result: TResponse) => PromiseLike, + expectedStatuses: string[], + options: BuildPagedAsyncIteratorOptions = {}, +): PagedAsyncIterableIterator { + const itemName = options.itemName ?? "value"; + const nextLinkName = options.nextLinkName ?? "nextLink"; + const nextLinkMethod = options.nextLinkMethod ?? "GET"; + const pagedResult: PagedResult = { + getPage: async (pageLink?: string) => { + const result = + pageLink === undefined + ? await getInitialResponse() + : nextLinkMethod === "POST" + ? await client.pathUnchecked(pageLink).post() + : await client.pathUnchecked(pageLink).get(); + checkPagingRequest(result, expectedStatuses); + const results = await processResponseBody(result as TResponse); + const nextLink = getNextLink(results, nextLinkName); + const values = getElements(results, itemName) as TPage; + return { + page: values, + nextPageLink: nextLink, + }; + }, + byPage: (settings?: TPageSettings) => { + const { continuationToken } = settings ?? {}; + return getPageAsyncIterator(pagedResult, { + pageLink: continuationToken, + }); + }, + }; + return getPagedAsyncIterator(pagedResult); +} + +/** + * returns an async iterator that iterates over results. It also has a `byPage` + * method that returns pages of items at once. + * + * @param pagedResult - an object that specifies how to get pages. + * @returns a paged async iterator that iterates over results. + */ + +function getPagedAsyncIterator< + TElement, + TPage = TElement[], + TPageSettings extends PageSettings = PageSettings, +>( + pagedResult: PagedResult, +): PagedAsyncIterableIterator { + const iter = getItemAsyncIterator(pagedResult); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: + pagedResult?.byPage ?? + ((settings?: TPageSettings) => { + const { continuationToken } = settings ?? {}; + return getPageAsyncIterator(pagedResult, { + pageLink: continuationToken, + }); + }), + }; +} + +async function* getItemAsyncIterator( + pagedResult: PagedResult, +): AsyncIterableIterator { + const pages = getPageAsyncIterator(pagedResult); + for await (const page of pages) { + yield* page as unknown as TElement[]; + } +} + +async function* getPageAsyncIterator( + pagedResult: PagedResult, + options: { + pageLink?: string; + } = {}, +): AsyncIterableIterator> { + const { pageLink } = options; + let response = await pagedResult.getPage(pageLink ?? pagedResult.firstPageLink); + if (!response) { + return; + } + let result = response.page as ContinuablePage; + result.continuationToken = response.nextPageLink; + yield result; + while (response.nextPageLink) { + response = await pagedResult.getPage(response.nextPageLink); + if (!response) { + return; + } + result = response.page as ContinuablePage; + result.continuationToken = response.nextPageLink; + yield result; + } +} + +/** + * Gets for the value of nextLink in the body + */ +function getNextLink(body: unknown, nextLinkName?: string): string | undefined { + if (!nextLinkName) { + return undefined; + } + + const nextLink = (body as Record)[nextLinkName]; + + if (typeof nextLink !== "string" && typeof nextLink !== "undefined" && nextLink !== null) { + throw new RestError( + `Body Property ${nextLinkName} should be a string or undefined or null but got ${typeof nextLink}`, + ); + } + + if (nextLink === null) { + return undefined; + } + + return nextLink; +} + +/** + * Gets the elements of the current request in the body. + */ +function getElements(body: unknown, itemName: string): T[] { + const value = (body as Record)[itemName] as T[]; + if (!Array.isArray(value)) { + throw new RestError( + `Couldn't paginate response\n Body doesn't contain an array property with name: ${itemName}`, + ); + } + + return value ?? []; +} + +/** + * Checks if a request failed + */ +function checkPagingRequest(response: PathUncheckedResponse, expectedStatuses: string[]): void { + if (!expectedStatuses.includes(response.status)) { + throw createRestError( + `Pagination failed with unexpected statusCode ${response.status}`, + response, + ); + } +} diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/static-helpers/pollingHelpers.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/static-helpers/pollingHelpers.ts new file mode 100644 index 0000000000..f01c41bab6 --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/static-helpers/pollingHelpers.ts @@ -0,0 +1,126 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { + PollerLike, + OperationState, + ResourceLocationConfig, + RunningOperation, + createHttpPoller, + OperationResponse, +} from "@azure/core-lro"; + +import { Client, PathUncheckedResponse, createRestError } from "@azure-rest/core-client"; +import { AbortSignalLike } from "@azure/abort-controller"; + +export interface GetLongRunningPollerOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** + * The signal which can be used to abort requests. + */ + abortSignal?: AbortSignalLike; + /** + * The potential location of the result of the LRO if specified by the LRO extension in the swagger. + */ + resourceLocationConfig?: ResourceLocationConfig; + /** + * The original url of the LRO + * Should not be null when restoreFrom is set + */ + initialRequestUrl?: string; + /** + * A serialized poller which can be used to resume an existing paused Long-Running-Operation. + */ + restoreFrom?: string; + /** + * The function to get the initial response + */ + getInitialResponse?: () => PromiseLike; +} +export function getLongRunningPoller( + client: Client, + processResponseBody: (result: TResponse) => Promise, + expectedStatuses: string[], + options: GetLongRunningPollerOptions, +): PollerLike, TResult> { + const { restoreFrom, getInitialResponse } = options; + if (!restoreFrom && !getInitialResponse) { + throw new Error("Either restoreFrom or getInitialResponse must be specified"); + } + let initialResponse: TResponse | undefined = undefined; + const pollAbortController = new AbortController(); + const poller: RunningOperation = { + sendInitialRequest: async () => { + if (!getInitialResponse) { + throw new Error("getInitialResponse is required when initializing a new poller"); + } + initialResponse = await getInitialResponse(); + return getLroResponse(initialResponse, expectedStatuses); + }, + sendPollRequest: async ( + path: string, + pollOptions?: { + abortSignal?: AbortSignalLike; + }, + ) => { + // The poll request would both listen to the user provided abort signal and the poller's own abort signal + function abortListener(): void { + pollAbortController.abort(); + } + const abortSignal = pollAbortController.signal; + if (options.abortSignal?.aborted) { + pollAbortController.abort(); + } else if (pollOptions?.abortSignal?.aborted) { + pollAbortController.abort(); + } else if (!abortSignal.aborted) { + options.abortSignal?.addEventListener("abort", abortListener, { + once: true, + }); + pollOptions?.abortSignal?.addEventListener("abort", abortListener, { + once: true, + }); + } + let response; + try { + response = await client.pathUnchecked(path).get({ abortSignal }); + } finally { + options.abortSignal?.removeEventListener("abort", abortListener); + pollOptions?.abortSignal?.removeEventListener("abort", abortListener); + } + + return getLroResponse(response as TResponse, expectedStatuses); + }, + }; + return createHttpPoller(poller, { + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: options?.resourceLocationConfig, + restoreFrom: options?.restoreFrom, + processResult: (result: unknown) => { + return processResponseBody(result as TResponse); + }, + }); +} +/** + * Converts a Rest Client response to a response that the LRO implementation understands + * @param response - a rest client http response + * @param deserializeFn - deserialize function to convert Rest response to modular output + * @returns - An LRO response that the LRO implementation understands + */ +function getLroResponse( + response: TResponse, + expectedStatuses: string[], +): OperationResponse { + if (!expectedStatuses.includes(response.status)) { + throw createRestError(response); + } + + return { + flatResponse: response, + rawResponse: { + ...response, + statusCode: Number.parseInt(response.status), + body: response.body, + }, + }; +} diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/static-helpers/simplePollerHelpers.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/static-helpers/simplePollerHelpers.ts new file mode 100644 index 0000000000..21c6d5eee8 --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/static-helpers/simplePollerHelpers.ts @@ -0,0 +1,119 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { PollerLike, OperationState, CancelOnProgress } from "@azure/core-lro"; +import { AbortSignalLike } from "@azure/abort-controller"; + +/** + * A simple poller that can be used to poll a long running operation. + */ +export interface SimplePollerLike, TResult> { + /** + * Returns true if the poller has finished polling. + */ + isDone(): boolean; + /** + * Returns the state of the operation. + */ + getOperationState(): TState; + /** + * Returns the result value of the operation, + * regardless of the state of the poller. + * It can return undefined or an incomplete form of the final TResult value + * depending on the implementation. + */ + getResult(): TResult | undefined; + /** + * Returns a promise that will resolve once a single polling request finishes. + * It does this by calling the update method of the Poller's operation. + */ + poll(options?: { abortSignal?: AbortSignalLike }): Promise; + /** + * Returns a promise that will resolve once the underlying operation is completed. + */ + pollUntilDone(pollOptions?: { abortSignal?: AbortSignalLike }): Promise; + /** + * Invokes the provided callback after each polling is completed, + * sending the current state of the poller's operation. + * + * It returns a method that can be used to stop receiving updates on the given callback function. + */ + onProgress(callback: (state: TState) => void): CancelOnProgress; + + /** + * Returns a promise that could be used for serialized version of the poller's operation + * by invoking the operation's serialize method. + */ + serialize(): Promise; + + /** + * Wait the poller to be submitted. + */ + submitted(): Promise; + + /** + * Returns a string representation of the poller's operation. Similar to serialize but returns a string. + * @deprecated Use serialize() instead. + */ + toString(): string; + + /** + * Stops the poller from continuing to poll. Please note this will only stop the client-side polling + * @deprecated Use abortSignal to stop polling instead. + */ + stopPolling(): void; + + /** + * Returns true if the poller is stopped. + * @deprecated Use abortSignal status to track this instead. + */ + isStopped(): boolean; +} + +/** + * Create the deprecated SimplePollerLike from PollerLike + * @param poller PollerLike to convert + * @returns SimplePollerLike + */ +export function getSimplePoller( + poller: PollerLike, TResult>, +): SimplePollerLike, TResult> { + const simplePoller: SimplePollerLike, TResult> = { + isDone() { + return poller.isDone; + }, + isStopped() { + throw new Error("isStopped is deprecated. Use abortSignal status to track this instead."); + }, + getOperationState() { + if (!poller.operationState) { + throw new Error( + "Operation state is not available. The poller may not have been started and you could await submitted() before calling getOperationState().", + ); + } + return poller.operationState; + }, + getResult() { + return poller.result; + }, + toString() { + if (!poller.operationState) { + throw new Error( + "Operation state is not available. The poller may not have been started and you could await submitted() before calling getOperationState().", + ); + } + return JSON.stringify({ + state: poller.operationState, + }); + }, + stopPolling() { + throw new Error("stopPolling is deprecated. Use abortSignal to stop polling instead."); + }, + onProgress: poller.onProgress, + poll: poller.poll, + pollUntilDone: poller.pollUntilDone, + serialize: poller.serialize, + submitted: poller.submitted, + }; + return simplePoller; +} diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/static-helpers/urlTemplate.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/static-helpers/urlTemplate.ts new file mode 100644 index 0000000000..c710989869 --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/static-helpers/urlTemplate.ts @@ -0,0 +1,227 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +// --------------------- +// interfaces +// --------------------- +interface ValueOptions { + isFirst: boolean; // is first value in the expression + op?: string; // operator + varValue?: any; // variable value + varName?: string; // variable name + modifier?: string; // modifier e.g * + reserved?: boolean; // if true we'll keep reserved words with not encoding +} + +export interface UrlTemplateOptions { + // if set to true, reserved characters will not be encoded + allowReserved?: boolean; +} + +// --------------------- +// helpers +// --------------------- +function encodeComponent(val: string, reserved?: boolean, op?: string): string { + return (reserved ?? op === "+") || op === "#" + ? encodeReservedComponent(val) + : encodeRFC3986URIComponent(val); +} + +function encodeReservedComponent(str: string): string { + return str + .split(/(%[0-9A-Fa-f]{2})/g) + .map((part) => (!/%[0-9A-Fa-f]/.test(part) ? encodeURI(part) : part)) + .join(""); +} + +function encodeRFC3986URIComponent(str: string): string { + return encodeURIComponent(str).replace( + /[!'()*]/g, + (c) => `%${c.charCodeAt(0).toString(16).toUpperCase()}`, + ); +} + +function isDefined(val: any): boolean { + return val !== undefined && val !== null; +} + +function getNamedAndIfEmpty(op?: string): [boolean, string] { + return [!!op && [";", "?", "&"].includes(op), !!op && ["?", "&"].includes(op) ? "=" : ""]; +} + +function getFirstOrSep(op?: string, isFirst = false): string { + if (isFirst) { + return !op || op === "+" ? "" : op; + } else if (!op || op === "+" || op === "#") { + return ","; + } else if (op === "?") { + return "&"; + } else { + return op; + } +} + +function getExpandedValue(option: ValueOptions): string { + let isFirst = option.isFirst; + const { op, varName, varValue: value, reserved } = option; + const vals: string[] = []; + const [named, ifEmpty] = getNamedAndIfEmpty(op); + + if (Array.isArray(value)) { + for (const val of value.filter(isDefined)) { + // prepare the following parts: separator, varName, value + vals.push(`${getFirstOrSep(op, isFirst)}`); + if (named && varName) { + vals.push(`${encodeURIComponent(varName)}`); + if (val === "") { + vals.push(ifEmpty); + } else { + vals.push("="); + } + } + vals.push(encodeComponent(val, reserved, op)); + isFirst = false; + } + } else if (typeof value === "object") { + for (const key of Object.keys(value)) { + const val = value[key]; + if (!isDefined(val)) { + continue; + } + // prepare the following parts: separator, key, value + vals.push(`${getFirstOrSep(op, isFirst)}`); + if (key) { + vals.push(`${encodeURIComponent(key)}`); + if (named && val === "") { + vals.push(ifEmpty); + } else { + vals.push("="); + } + } + vals.push(encodeComponent(val, reserved, op)); + isFirst = false; + } + } + return vals.join(""); +} + +function getNonExpandedValue(option: ValueOptions): string | undefined { + const { op, varName, varValue: value, isFirst, reserved } = option; + const vals: string[] = []; + const first = getFirstOrSep(op, isFirst); + const [named, ifEmpty] = getNamedAndIfEmpty(op); + if (named && varName) { + vals.push(encodeComponent(varName, reserved, op)); + if (value === "") { + if (!ifEmpty) { + vals.push(ifEmpty); + } + return !vals.join("") ? undefined : `${first}${vals.join("")}`; + } + vals.push("="); + } + + const items = []; + if (Array.isArray(value)) { + for (const val of value.filter(isDefined)) { + items.push(encodeComponent(val, reserved, op)); + } + } else if (typeof value === "object") { + for (const key of Object.keys(value)) { + if (!isDefined(value[key])) { + continue; + } + items.push(encodeRFC3986URIComponent(key)); + items.push(encodeComponent(value[key], reserved, op)); + } + } + vals.push(items.join(",")); + return !vals.join(",") ? undefined : `${first}${vals.join("")}`; +} + +function getVarValue(option: ValueOptions): string | undefined { + const { op, varName, modifier, isFirst, reserved, varValue: value } = option; + + if (!isDefined(value)) { + return undefined; + } else if (["string", "number", "boolean"].includes(typeof value)) { + let val = value.toString(); + const [named, ifEmpty] = getNamedAndIfEmpty(op); + const vals: string[] = [getFirstOrSep(op, isFirst)]; + if (named && varName) { + // No need to encode varName considering it is already encoded + vals.push(varName); + if (val === "") { + vals.push(ifEmpty); + } else { + vals.push("="); + } + } + if (modifier && modifier !== "*") { + val = val.substring(0, parseInt(modifier, 10)); + } + vals.push(encodeComponent(val, reserved, op)); + return vals.join(""); + } else if (modifier === "*") { + return getExpandedValue(option); + } else { + return getNonExpandedValue(option); + } +} + +// --------------------------------------------------------------------------------------------------- +// This is an implementation of RFC 6570 URI Template: https://datatracker.ietf.org/doc/html/rfc6570. +// --------------------------------------------------------------------------------------------------- +export function expandUrlTemplate( + template: string, + context: Record, + option?: UrlTemplateOptions, +): string { + const result = template.replace(/\{([^{}]+)\}|([^{}]+)/g, (_, expr, text) => { + if (!expr) { + return encodeReservedComponent(text); + } + let op; + if (["+", "#", ".", "/", ";", "?", "&"].includes(expr[0])) { + op = expr[0]; + expr = expr.slice(1); + } + const varList = expr.split(/,/g); + const result = []; + for (const varSpec of varList) { + const varMatch = /([^:*]*)(?::(\d+)|(\*))?/.exec(varSpec); + if (!varMatch || !varMatch[1]) { + continue; + } + const varValue = getVarValue({ + isFirst: result.length === 0, + op, + varValue: context[varMatch[1]], + varName: varMatch[1], + modifier: varMatch[2] || varMatch[3], + reserved: option?.allowReserved, + }); + if (varValue) { + result.push(varValue); + } + } + return result.join(""); + }); + + return normalizeUnreserved(result); +} + +/** + * Normalize an expanded URI by decoding percent-encoded unreserved characters. + * RFC 3986 unreserved: "-" / "." / "~" + */ +function normalizeUnreserved(uri: string): string { + return uri.replace(/%([0-9A-Fa-f]{2})/g, (match, hex) => { + const char = String.fromCharCode(parseInt(hex, 16)); + // Decode only if it's unreserved + if (/[\-.~]/.test(char)) { + return char; + } + return match; // leave other encodings intact + }); +} diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/tsconfig.json b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/tsconfig.json new file mode 100644 index 0000000000..2438674c36 --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/tsconfig.json @@ -0,0 +1,26 @@ +{ + "compilerOptions": { + "target": "ES2017", + "module": "NodeNext", + "lib": [], + "declaration": true, + "declarationMap": true, + "inlineSources": true, + "sourceMap": true, + "importHelpers": true, + "strict": true, + "alwaysStrict": true, + "noUnusedLocals": true, + "noUnusedParameters": true, + "noImplicitReturns": true, + "noFallthroughCasesInSwitch": true, + "forceConsistentCasingInFileNames": true, + "moduleResolution": "NodeNext", + "allowSyntheticDefaultImports": true, + "esModuleInterop": true, + "paths": { + "@azure/arm-hybridnetwork": ["./src/index"] + } + }, + "include": ["src/**/*.ts", "samples-dev/**/*.ts"] +} diff --git a/packages/typespec-test/test/HybridNetwork.Management/spec/ArtifactManifest.tsp b/packages/typespec-test/test/HybridNetwork.Management/spec/ArtifactManifest.tsp new file mode 100644 index 0000000000..b02db4e8eb --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/spec/ArtifactManifest.tsp @@ -0,0 +1,100 @@ +import "@azure-tools/typespec-azure-core"; +import "@azure-tools/typespec-azure-resource-manager"; +import "@typespec/openapi"; +import "@typespec/rest"; +import "./models.tsp"; +import "./ArtifactStore.tsp"; + +using TypeSpec.Rest; +using Azure.ResourceManager; +using TypeSpec.Http; +using TypeSpec.OpenAPI; + +namespace Microsoft.HybridNetwork; +/** + * Artifact manifest properties. + */ +@parentResource(ArtifactStore) +model ArtifactManifest + is Azure.ResourceManager.TrackedResource { + ...ResourceNameParameter< + Resource = ArtifactManifest, + KeyName = "artifactManifestName", + SegmentName = "artifactManifests", + NamePattern = "^[^\\s]*[^\\s]+[^\\s]*$" + >; +} + +@armResourceOperations +interface ArtifactManifests { + /** + * Gets information about a artifact manifest resource. + */ + get is ArmResourceRead; + + /** + * Creates or updates a artifact manifest. + */ + createOrUpdate is ArmResourceCreateOrReplaceAsync< + ArtifactManifest, + LroHeaders = ArmAsyncOperationHeader + >; + + /** + * Updates a artifact manifest resource. + */ + @patch(#{ implicitOptionality: false }) + update is ArmCustomPatchSync; + + /** + * Deletes the specified artifact manifest. + */ + delete is ArmResourceDeleteWithoutOkAsync< + ArtifactManifest, + LroHeaders = ArmLroLocationHeader, + Response = ArmAcceptedLroResponse< + "Accepted. Sets provisioningState to 'Deleting' until the operation is completed. Returns an operation URI that can be queried to find the current state of the operation.", + ArmLroLocationHeader + > | ArmNoContentResponse<"Request is successful. Resource does not exist."> + >; + + /** + * Gets information about the artifact manifest. + */ + listByArtifactStore is ArmResourceListByParent; + + /** + * List credential for publishing artifacts defined in artifact manifest. + */ + listCredential is ArmResourceActionSync< + ArtifactManifest, + void, + ArmResponse + >; + + /** + * Update state for artifact manifest. + */ + updateState is ArmResourceActionAsyncBase< + ArtifactManifest, + ArtifactManifestUpdateState, + ArmResponse | ArmAcceptedLroResponse< + "Request of updating artifact manifest state is accepted.", + ArmLroLocationHeader + >, + BaseParameters = Azure.ResourceManager.Foundations.DefaultBaseParameters + >; +} + +@@maxLength(ArtifactManifest.name, 64); +@@doc(ArtifactManifest.name, "The name of the artifact manifest."); +@@doc(ArtifactManifest.properties, "Artifact manifest properties."); +@@doc(ArtifactManifests.createOrUpdate::parameters.resource, + "Parameters supplied to the create or update artifact manifest operation." +); +@@doc(ArtifactManifests.update::parameters.properties, + "Parameters supplied to the create or update artifact manifest operation." +); +@@doc(ArtifactManifests.updateState::parameters.body, + "Parameters supplied to update the state of artifact manifest." +); diff --git a/packages/typespec-test/test/HybridNetwork.Management/spec/ArtifactStore.tsp b/packages/typespec-test/test/HybridNetwork.Management/spec/ArtifactStore.tsp new file mode 100644 index 0000000000..88feb687fc --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/spec/ArtifactStore.tsp @@ -0,0 +1,261 @@ +import "@azure-tools/typespec-azure-core"; +import "@azure-tools/typespec-azure-resource-manager"; +import "@typespec/openapi"; +import "@typespec/rest"; +import "./models.tsp"; +import "./Publisher.tsp"; + +using TypeSpec.Rest; +using Azure.ResourceManager; +using TypeSpec.Http; +using TypeSpec.OpenAPI; + +namespace Microsoft.HybridNetwork; +/** + * Artifact store properties. + */ +@parentResource(Publisher) +model ArtifactStore + is Azure.ResourceManager.TrackedResource { + ...ResourceNameParameter< + Resource = ArtifactStore, + KeyName = "artifactStoreName", + SegmentName = "artifactStores", + NamePattern = "^[a-zA-Z0-9][a-zA-Z0-9_-]*$" + >; +} + +@armResourceOperations +interface ArtifactStores { + /** + * Gets information about the specified artifact store. + */ + get is ArmResourceRead; + + /** + * Creates or updates a artifact store. + */ + createOrUpdate is ArmResourceCreateOrReplaceAsync< + ArtifactStore, + LroHeaders = ArmAsyncOperationHeader + >; + + /** + * Update artifact store resource. + */ + @patch(#{ implicitOptionality: false }) + update is ArmCustomPatchSync; + + /** + * Deletes the specified artifact store. + */ + delete is ArmResourceDeleteWithoutOkAsync< + ArtifactStore, + LroHeaders = ArmLroLocationHeader, + Response = ArmAcceptedLroResponse< + "Accepted. Sets provisioningState to 'Deleting' until the operation is completed. Returns an operation URI that can be queried to find the current state of the operation.", + ArmLroLocationHeader + > | ArmNoContentResponse<"Request is successful. Resource does not exist."> + >; + + /** + * Gets information of the ArtifactStores under publisher. + */ + listByPublisher is ArmResourceListByParent; + + /** + * Add network fabric controllers to artifact stores + */ + addNetworkFabricControllerEndPoints is ArmResourceActionAsyncBase< + ArtifactStore, + ArtifactStoreNetworkFabricControllerEndPoints, + ArmAcceptedLroResponse< + "Accepted. The header contains 'Azure-AsyncOperation' header which can be used to monitor the progress of the operation.", + ArmLroLocationHeader + >, + BaseParameters = Azure.ResourceManager.Foundations.DefaultBaseParameters + >; + + /** + * Delete network fabric controllers on artifact stores + */ + deleteNetworkFabricControllerEndPoints is ArmResourceActionAsyncBase< + ArtifactStore, + ArtifactStoreNetworkFabricControllerEndPoints, + ArmAcceptedLroResponse< + "Accepted. The header contains 'Azure-AsyncOperation' header which can be used to monitor the progress of the operation.", + ArmLroLocationHeader + >, + BaseParameters = Azure.ResourceManager.Foundations.DefaultBaseParameters + >; + + /** + * List network fabric controllers to artifact stores + */ + @list + listNetworkFabricControllerPrivateEndPoints is ArmResourceActionAsyncBase< + ArtifactStore, + void, + ArmResponse | ArmAcceptedLroResponse< + "Accepted. The header contains 'Azure-AsyncOperation' header which can be used to monitor the progress of the operation.", + ArmLroLocationHeader + >, + BaseParameters = Azure.ResourceManager.Foundations.DefaultBaseParameters + >; + + /** + * Approve manual private endpoints on artifact stores + */ + approvePrivateEndPoints is ArmResourceActionAsyncBase< + ArtifactStore, + ArtifactStorePrivateEndPointsFormat, + ArmAcceptedLroResponse< + "Accepted. The header contains 'Azure-AsyncOperation' header which can be used to monitor the progress of the operation.", + ArmLroLocationHeader + >, + BaseParameters = Azure.ResourceManager.Foundations.DefaultBaseParameters + >; + + /** + * Remove manual private endpoints on artifact stores + */ + removePrivateEndPoints is ArmResourceActionAsyncBase< + ArtifactStore, + ArtifactStorePrivateEndPointsFormat, + ArmAcceptedLroResponse< + "Accepted. The header contains 'Azure-AsyncOperation' header which can be used to monitor the progress of the operation.", + ArmLroLocationHeader + >, + BaseParameters = Azure.ResourceManager.Foundations.DefaultBaseParameters + >; + + /** + * List manual private endpoints on artifact stores + */ + @list + listPrivateEndPoints is ArmResourceActionAsyncBase< + ArtifactStore, + void, + ArmResponse | ArmAcceptedLroResponse< + "Accepted. The header contains 'Azure-AsyncOperation' header which can be used to monitor the progress of the operation.", + ArmLroLocationHeader + >, + BaseParameters = Azure.ResourceManager.Foundations.DefaultBaseParameters + >; +} + +@armResourceOperations +interface ProxyArtifact { + /** + * Lists all the available artifacts in the parent Artifact Store. + */ + #suppress "@azure-tools/typespec-azure-core/no-openapi" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + @list + @get + @action("artifacts") + list is ArmResourceActionSync< + ArtifactStore, + void, + ArmResponse + >; + + /** + * Get a Artifact overview information. + */ + #suppress "@azure-tools/typespec-azure-core/no-openapi" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + @list + @get + @action("artifactVersions") + proxyArtifactGet is ArmResourceActionSync< + ArtifactStore, + void, + ArmResponse, + Parameters = { + /** + * The name of the artifact. + */ + @maxLength(64) + @pattern("^[^\\s]*[^\\s]+[^\\s]*$") + @query("artifactName") + artifactName: string; + } + >; + + /** + * Change artifact state defined in artifact store. + */ + #suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-operation" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + @patch(#{ implicitOptionality: false }) + updateState( + ...ApiVersionParameter, + ...SubscriptionIdParameter, + ...ResourceGroupParameter, + ...Azure.ResourceManager.Legacy.Provider, + + /** + * The name of the publisher. + */ + @path + @maxLength(64) + @pattern("^[a-zA-Z0-9][a-zA-Z0-9_-]*$") + @segment("publishers") + publisherName: string, + + /** + * The name of the artifact store. + */ + @path + @maxLength(64) + @pattern("^[a-zA-Z0-9][a-zA-Z0-9_-]*$") + @segment("artifactStores") + artifactStoreName: string, + + /** + * The name of the artifact version. + */ + @path + @maxLength(64) + @pattern("^[^\\s]*[^\\s]+[^\\s]*$") + @segment("artifactVersions") + artifactVersionName: string, + + /** + * The name of the artifact. + */ + @maxLength(64) + @pattern("^[^\\s]*[^\\s]+[^\\s]*$") + @query("artifactName") + artifactName: string, + + @body + body: ArtifactChangeState, + ): ArmResponse | ArmAcceptedLroResponse< + "Request of updating artifact state is accepted.", + ArmLroLocationHeader + > | ErrorResponse; +} + +@@maxLength(ArtifactStore.name, 64); +@@doc(ArtifactStore.name, "The name of the artifact store."); +@@doc(ArtifactStore.properties, "ArtifactStores properties."); +@@doc(ArtifactStores.createOrUpdate::parameters.resource, + "Parameters supplied to the create or update application group operation." +); +@@doc(ArtifactStores.update::parameters.properties, + "Parameters supplied to the create or update application group operation." +); +@@doc(ArtifactStores.addNetworkFabricControllerEndPoints::parameters.body, + "Parameters supplied to the create or update application group operation." +); +@@doc(ArtifactStores.deleteNetworkFabricControllerEndPoints::parameters.body, + "Parameters supplied to the create or update application group operation." +); +@@doc(ArtifactStores.approvePrivateEndPoints::parameters.body, + "Parameters supplied to approve private endpoints." +); +@@doc(ArtifactStores.removePrivateEndPoints::parameters.body, + "Parameters supplied to the create or update application group operation." +); +@@doc(ProxyArtifact.updateState::parameters.body, + "Parameters supplied to update the state of artifact manifest." +); diff --git a/packages/typespec-test/test/HybridNetwork.Management/spec/Component.tsp b/packages/typespec-test/test/HybridNetwork.Management/spec/Component.tsp new file mode 100644 index 0000000000..9ef78ab1d4 --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/spec/Component.tsp @@ -0,0 +1,42 @@ +import "@azure-tools/typespec-azure-core"; +import "@azure-tools/typespec-azure-resource-manager"; +import "@typespec/openapi"; +import "@typespec/rest"; +import "./models.tsp"; +import "./NetworkFunction.tsp"; + +using TypeSpec.Rest; +using Azure.ResourceManager; +using TypeSpec.Http; +using TypeSpec.OpenAPI; + +namespace Microsoft.HybridNetwork; +/** + * The component sub resource. + */ +@parentResource(NetworkFunction) +model Component is Azure.ResourceManager.ProxyResource { + ...ResourceNameParameter< + Resource = Component, + KeyName = "componentName", + SegmentName = "components", + NamePattern = "^[^\\s]*[^\\s]+[^\\s]*$" + >; +} + +@armResourceOperations +interface Components { + /** + * Gets information about the specified application instance resource. + */ + get is ArmResourceRead; + + /** + * Lists all the component resources in a network function. + */ + listByNetworkFunction is ArmResourceListByParent; +} + +@@maxLength(Component.name, 64); +@@doc(Component.name, "The name of the component."); +@@doc(Component.properties, "The component properties."); diff --git a/packages/typespec-test/test/HybridNetwork.Management/spec/ConfigurationGroupSchema.tsp b/packages/typespec-test/test/HybridNetwork.Management/spec/ConfigurationGroupSchema.tsp new file mode 100644 index 0000000000..9560c1b5da --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/spec/ConfigurationGroupSchema.tsp @@ -0,0 +1,100 @@ +import "@azure-tools/typespec-azure-core"; +import "@azure-tools/typespec-azure-resource-manager"; +import "@typespec/openapi"; +import "@typespec/rest"; +import "./models.tsp"; +import "./Publisher.tsp"; + +using TypeSpec.Rest; +using Azure.ResourceManager; +using TypeSpec.Http; +using TypeSpec.OpenAPI; + +namespace Microsoft.HybridNetwork; +/** + * Configuration group schema resource. + */ +@parentResource(Publisher) +model ConfigurationGroupSchema + is Azure.ResourceManager.TrackedResource { + ...ResourceNameParameter< + Resource = ConfigurationGroupSchema, + KeyName = "configurationGroupSchemaName", + SegmentName = "configurationGroupSchemas", + NamePattern = "^[a-zA-Z0-9][a-zA-Z0-9_-]*$" + >; +} + +@armResourceOperations +interface ConfigurationGroupSchemas { + /** + * Gets information about the specified configuration group schema. + */ + get is ArmResourceRead; + + /** + * Creates or updates a configuration group schema. + */ + createOrUpdate is ArmResourceCreateOrReplaceAsync< + ConfigurationGroupSchema, + LroHeaders = ArmAsyncOperationHeader + >; + + /** + * Updates a configuration group schema resource. + */ + @patch(#{ implicitOptionality: false }) + update is ArmCustomPatchSync< + ConfigurationGroupSchema, + PatchModel = TagsObject + >; + + /** + * Deletes a specified configuration group schema. + */ + delete is ArmResourceDeleteWithoutOkAsync< + ConfigurationGroupSchema, + LroHeaders = ArmLroLocationHeader, + Response = ArmAcceptedLroResponse< + "Accepted. Sets provisioningState to 'Deleting' until the operation is completed. Returns an operation URI that can be queried to find the current state of the operation.", + ArmLroLocationHeader + > | ArmNoContentResponse<"Request is successful. Resource does not exist."> + >; + + /** + * Gets information of the configuration group schemas under a publisher. + */ + listByPublisher is ArmResourceListByParent; + + /** + * Update configuration group schema state. + */ + #suppress "@azure-tools/typespec-azure-core/no-openapi" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + @operationId("ConfigurationGroupSchemas_updateState") + updateState is ArmResourceActionAsyncBase< + ConfigurationGroupSchema, + ConfigurationGroupSchemaVersionUpdateState, + ArmResponse | ArmAcceptedLroResponse< + "The request of updating configuration group schema state is accepted.", + ArmLroLocationHeader + >, + BaseParameters = Azure.ResourceManager.Foundations.DefaultBaseParameters + >; +} + +@@maxLength(ConfigurationGroupSchema.name, 64); +@@doc(ConfigurationGroupSchema.name, + "The name of the configuration group schema." +); +@@doc(ConfigurationGroupSchema.properties, + "Configuration group schema properties." +); +@@doc(ConfigurationGroupSchemas.createOrUpdate::parameters.resource, + "Parameters supplied to the create or update configuration group schema resource." +); +@@doc(ConfigurationGroupSchemas.update::parameters.properties, + "Parameters supplied to the create or update network service design version operation." +); +@@doc(ConfigurationGroupSchemas.updateState::parameters.body, + "Parameters supplied to update the state of configuration group schema." +); diff --git a/packages/typespec-test/test/HybridNetwork.Management/spec/ConfigurationGroupValue.tsp b/packages/typespec-test/test/HybridNetwork.Management/spec/ConfigurationGroupValue.tsp new file mode 100644 index 0000000000..9359028ba6 --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/spec/ConfigurationGroupValue.tsp @@ -0,0 +1,87 @@ +import "@azure-tools/typespec-azure-core"; +import "@azure-tools/typespec-azure-resource-manager"; +import "@typespec/openapi"; +import "@typespec/rest"; +import "./models.tsp"; + +using TypeSpec.Rest; +using Azure.ResourceManager; +using TypeSpec.Http; +using TypeSpec.OpenAPI; + +namespace Microsoft.HybridNetwork; +/** + * Hybrid configuration group value resource. + */ +#suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +#suppress "@azure-tools/typespec-azure-resource-manager/resource-name" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +model configurationGroupValue + is Azure.ResourceManager.TrackedResource { + ...ResourceNameParameter< + Resource = configurationGroupValue, + KeyName = "configurationGroupValueName", + SegmentName = "configurationGroupValues", + NamePattern = "^[a-zA-Z0-9][a-zA-Z0-9_-]*$" + >; +} + +@armResourceOperations +interface ConfigurationGroupValues { + /** + * Gets information about the specified hybrid configuration group values. + */ + get is ArmResourceRead; + + /** + * Creates or updates a hybrid configuration group value. + */ + createOrUpdate is ArmResourceCreateOrReplaceAsync< + configurationGroupValue, + LroHeaders = ArmAsyncOperationHeader + >; + + /** + * Updates a hybrid configuration group tags. + */ + @patch(#{ implicitOptionality: false }) + updateTags is ArmCustomPatchSync< + configurationGroupValue, + PatchModel = TagsObject + >; + + /** + * Deletes the specified hybrid configuration group value. + */ + delete is ArmResourceDeleteWithoutOkAsync< + configurationGroupValue, + LroHeaders = ArmLroLocationHeader, + Response = ArmAcceptedLroResponse< + "Accepted. Sets 'Deleting' provisioningState until the operation completes. Returns an operation URI that can be queried to find the current state of the operation.", + ArmLroLocationHeader + > | ArmNoContentResponse<"Request successful. Resource does not exist."> + >; + + /** + * Lists all the hybrid network configurationGroupValues in a resource group. + */ + listByResourceGroup is ArmResourceListByParent; + + /** + * Lists all sites in the configuration group value in a subscription. + */ + listBySubscription is ArmListBySubscription; +} + +@@maxLength(configurationGroupValue.name, 64); +@@doc(configurationGroupValue.name, + "The name of the configuration group value." +); +@@doc(configurationGroupValue.properties, + "Hybrid configuration group value properties." +); +@@doc(ConfigurationGroupValues.createOrUpdate::parameters.resource, + "Parameters supplied to the create or update configuration group value resource." +); +@@doc(ConfigurationGroupValues.updateTags::parameters.properties, + "Parameters supplied to update configuration group values tags." +); diff --git a/packages/typespec-test/test/HybridNetwork.Management/spec/NetworkFunction.tsp b/packages/typespec-test/test/HybridNetwork.Management/spec/NetworkFunction.tsp new file mode 100644 index 0000000000..c1cfc4b6fa --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/spec/NetworkFunction.tsp @@ -0,0 +1,118 @@ +import "@azure-tools/typespec-azure-core"; +import "@azure-tools/typespec-azure-resource-manager"; +import "@typespec/openapi"; +import "@typespec/rest"; +import "./models.tsp"; + +using TypeSpec.Rest; +using Azure.ResourceManager; +using TypeSpec.Http; +using TypeSpec.OpenAPI; + +namespace Microsoft.HybridNetwork; +/** + * Network function resource response. + */ +model NetworkFunction + is Azure.ResourceManager.TrackedResource { + ...ResourceNameParameter< + Resource = NetworkFunction, + KeyName = "networkFunctionName", + SegmentName = "networkFunctions", + NamePattern = "" + >; + + /** + * A unique read-only string that changes whenever the resource is updated. + */ + #suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-envelope-property" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + etag?: string; + + ...Azure.ResourceManager.ManagedServiceIdentityProperty; +} + +@armResourceOperations +interface NetworkFunctions { + /** + * Gets information about the specified network function resource. + */ + get is ArmResourceRead; + + /** + * Creates or updates a network function resource. + */ + createOrUpdate is ArmResourceCreateOrReplaceAsync< + NetworkFunction, + LroHeaders = ArmAsyncOperationHeader + >; + + /** + * Updates the tags for the network function resource. + */ + @patch(#{ implicitOptionality: false }) + updateTags is ArmCustomPatchSync; + + /** + * Deletes the specified network function resource. + */ + #suppress "@azure-tools/typespec-azure-resource-manager/arm-delete-operation-response-codes" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + delete is ArmResourceDeleteWithoutOkAsync< + NetworkFunction, + Response = ArmDeletedResponse | ArmAcceptedLroResponse< + "Accepted. The header contains 'Azure-AsyncOperation' header pointing to an operations resource. The operation URI can be queried to find the current state of the operation.", + LroHeaders = ArmLroLocationHeader + > | ArmNoContentResponse<"Request is successful. Resource with the specified name does not exist.">, + LroHeaders = ArmLroLocationHeader + >; + + /** + * Lists all the network function resources in a resource group. + */ + listByResourceGroup is ArmResourceListByParent; + + /** + * Lists all the network functions in a subscription. + */ + listBySubscription is ArmListBySubscription; + + /** + * Execute a request to services on a containerized network function. + */ + executeRequest is NetworkFunctionsOps.ActionSync< + Resource = NetworkFunction, + Request = ExecuteRequestParameters, + Response = OkResponse | ArmAcceptedLroResponse< + "Accepted. The header contains 'Azure-AsyncOperation' header which can be used to monitor the progress of the operation.", + ArmLroLocationHeader + > + >; +} + +alias NetworkFunctionsOps = Azure.ResourceManager.Legacy.LegacyOperations< + { + ...ApiVersionParameter; + ...SubscriptionIdParameter; + ...ResourceGroupParameter; + ...Azure.ResourceManager.Legacy.Provider; + }, + KeysOf, + ErrorResponse +>; + +@@doc(NetworkFunction.name, "Resource name for the network function resource."); +@@doc(NetworkFunction.properties, "Network function properties."); +@@doc(NetworkFunctions.createOrUpdate::parameters.resource, + "Parameters supplied in the body to the create or update network function operation." +); +@@doc(NetworkFunctions.updateTags::parameters.properties, + "Parameters supplied to the update network function tags operation." +); +@@doc(NetworkFunctions.executeRequest::parameters.body, + "Payload for execute request post call." +); +@@doc(NetworkFunction.identity, + "The managed identity of the network function." +); +@@doc(NetworkFunction.etag, + "A unique read-only string that changes whenever the resource is updated." +); diff --git a/packages/typespec-test/test/HybridNetwork.Management/spec/NetworkFunctionDefinitionGroup.tsp b/packages/typespec-test/test/HybridNetwork.Management/spec/NetworkFunctionDefinitionGroup.tsp new file mode 100644 index 0000000000..f7897f6ce6 --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/spec/NetworkFunctionDefinitionGroup.tsp @@ -0,0 +1,82 @@ +import "@azure-tools/typespec-azure-core"; +import "@azure-tools/typespec-azure-resource-manager"; +import "@typespec/openapi"; +import "@typespec/rest"; +import "./models.tsp"; +import "./Publisher.tsp"; + +using TypeSpec.Rest; +using Azure.ResourceManager; +using TypeSpec.Http; +using TypeSpec.OpenAPI; + +namespace Microsoft.HybridNetwork; +/** + * Network function definition group resource. + */ +@parentResource(Publisher) +model NetworkFunctionDefinitionGroup + is Azure.ResourceManager.TrackedResource { + ...ResourceNameParameter< + Resource = NetworkFunctionDefinitionGroup, + KeyName = "networkFunctionDefinitionGroupName", + SegmentName = "networkFunctionDefinitionGroups", + NamePattern = "^[a-zA-Z0-9][a-zA-Z0-9_-]*$" + >; +} + +@armResourceOperations +interface NetworkFunctionDefinitionGroups { + /** + * Gets information about the specified networkFunctionDefinition group. + */ + get is ArmResourceRead; + + /** + * Creates or updates a network function definition group. + */ + createOrUpdate is ArmResourceCreateOrReplaceAsync< + NetworkFunctionDefinitionGroup, + LroHeaders = ArmAsyncOperationHeader + >; + + /** + * Updates a network function definition group resource. + */ + @patch(#{ implicitOptionality: false }) + update is ArmCustomPatchSync< + NetworkFunctionDefinitionGroup, + PatchModel = TagsObject + >; + + /** + * Deletes a specified network function definition group. + */ + delete is ArmResourceDeleteWithoutOkAsync< + NetworkFunctionDefinitionGroup, + Response = ArmAcceptedLroResponse< + "Accepted. Sets provisioningState to 'Deleting' until the operation is completed. Returns an operation URI that can be queried to find the current state of the operation.", + LroHeaders = ArmLroLocationHeader + > | ArmNoContentResponse<"Request is successful. Resource does not exist.">, + LroHeaders = ArmLroLocationHeader + >; + + /** + * Gets information of the network function definition groups under a publisher. + */ + listByPublisher is ArmResourceListByParent; +} + +@@maxLength(NetworkFunctionDefinitionGroup.name, 64); +@@doc(NetworkFunctionDefinitionGroup.name, + "The name of the network function definition group." +); +@@doc(NetworkFunctionDefinitionGroup.properties, + "Network function definition group properties." +); +@@doc(NetworkFunctionDefinitionGroups.createOrUpdate::parameters.resource, + "Parameters supplied to the create or update publisher network function definition group operation." +); +@@doc(NetworkFunctionDefinitionGroups.update::parameters.properties, + "Parameters supplied to the create or update publisher network function definition group operation." +); diff --git a/packages/typespec-test/test/HybridNetwork.Management/spec/NetworkFunctionDefinitionVersion.tsp b/packages/typespec-test/test/HybridNetwork.Management/spec/NetworkFunctionDefinitionVersion.tsp new file mode 100644 index 0000000000..b33b8ae7fa --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/spec/NetworkFunctionDefinitionVersion.tsp @@ -0,0 +1,100 @@ +import "@azure-tools/typespec-azure-core"; +import "@azure-tools/typespec-azure-resource-manager"; +import "@typespec/openapi"; +import "@typespec/rest"; +import "./models.tsp"; +import "./NetworkFunctionDefinitionGroup.tsp"; + +using TypeSpec.Rest; +using Azure.ResourceManager; +using TypeSpec.Http; +using TypeSpec.OpenAPI; + +namespace Microsoft.HybridNetwork; +/** + * Network function definition version. + */ +@parentResource(NetworkFunctionDefinitionGroup) +model NetworkFunctionDefinitionVersion + is Azure.ResourceManager.TrackedResource { + ...ResourceNameParameter< + Resource = NetworkFunctionDefinitionVersion, + KeyName = "networkFunctionDefinitionVersionName", + SegmentName = "networkFunctionDefinitionVersions", + NamePattern = "^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$" + >; +} + +@armResourceOperations +interface NetworkFunctionDefinitionVersions { + /** + * Gets information about a network function definition version. + */ + get is ArmResourceRead; + + /** + * Creates or updates a network function definition version. + */ + createOrUpdate is ArmResourceCreateOrReplaceAsync< + NetworkFunctionDefinitionVersion, + LroHeaders = ArmAsyncOperationHeader + >; + + /** + * Updates a network function definition version resource. + */ + @patch(#{ implicitOptionality: false }) + update is ArmCustomPatchSync< + NetworkFunctionDefinitionVersion, + PatchModel = TagsObject + >; + + /** + * Deletes the specified network function definition version. + */ + delete is ArmResourceDeleteWithoutOkAsync< + NetworkFunctionDefinitionVersion, + Response = ArmAcceptedLroResponse< + "Accepted. Sets provisioningState to 'Deleting' until the operation is completed. Returns an operation URI that can be queried to find the current state of the operation.", + LroHeaders = ArmLroLocationHeader + > | ArmNoContentResponse<"Request is successful. Resource does not exist.">, + LroHeaders = ArmLroLocationHeader + >; + + /** + * Gets information about a list of network function definition versions under a network function definition group. + */ + listByNetworkFunctionDefinitionGroup is ArmResourceListByParent; + + /** + * Update network function definition version state. + */ + #suppress "@azure-tools/typespec-azure-core/no-openapi" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + @operationId("NetworkFunctionDefinitionVersions_updateState") + updateState is ArmResourceActionAsyncBase< + NetworkFunctionDefinitionVersion, + NetworkFunctionDefinitionVersionUpdateState, + ArmResponse | ArmAcceptedLroResponse< + "The request of updating network function definition version state is accepted.", + ArmLroLocationHeader + >, + BaseParameters = Azure.ResourceManager.Foundations.DefaultBaseParameters + >; +} + +@@maxLength(NetworkFunctionDefinitionVersion.name, 64); +@@doc(NetworkFunctionDefinitionVersion.name, + "The name of the network function definition version. The name should conform to the SemVer 2.0.0 specification: https://semver.org/spec/v2.0.0.html." +); +@@doc(NetworkFunctionDefinitionVersion.properties, + "Network function definition version properties." +); +@@doc(NetworkFunctionDefinitionVersions.createOrUpdate::parameters.resource, + "Parameters supplied to the create or update network function definition version operation." +); +@@doc(NetworkFunctionDefinitionVersions.update::parameters.properties, + "Parameters supplied to the create or update network function definition version operation." +); +@@doc(NetworkFunctionDefinitionVersions.updateState::parameters.body, + "Parameters supplied to update the state of network function definition version." +); diff --git a/packages/typespec-test/test/HybridNetwork.Management/spec/NetworkServiceDesignGroup.tsp b/packages/typespec-test/test/HybridNetwork.Management/spec/NetworkServiceDesignGroup.tsp new file mode 100644 index 0000000000..8170918a33 --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/spec/NetworkServiceDesignGroup.tsp @@ -0,0 +1,82 @@ +import "@azure-tools/typespec-azure-core"; +import "@azure-tools/typespec-azure-resource-manager"; +import "@typespec/openapi"; +import "@typespec/rest"; +import "./models.tsp"; +import "./Publisher.tsp"; + +using TypeSpec.Rest; +using Azure.ResourceManager; +using TypeSpec.Http; +using TypeSpec.OpenAPI; + +namespace Microsoft.HybridNetwork; +/** + * network service design group resource. + */ +@parentResource(Publisher) +model NetworkServiceDesignGroup + is Azure.ResourceManager.TrackedResource { + ...ResourceNameParameter< + Resource = NetworkServiceDesignGroup, + KeyName = "networkServiceDesignGroupName", + SegmentName = "networkServiceDesignGroups", + NamePattern = "^[a-zA-Z0-9][a-zA-Z0-9_-]*$" + >; +} + +@armResourceOperations +interface NetworkServiceDesignGroups { + /** + * Gets information about the specified networkServiceDesign group. + */ + get is ArmResourceRead; + + /** + * Creates or updates a network service design group. + */ + createOrUpdate is ArmResourceCreateOrReplaceAsync< + NetworkServiceDesignGroup, + LroHeaders = ArmAsyncOperationHeader + >; + + /** + * Updates a network service design groups resource. + */ + @patch(#{ implicitOptionality: false }) + update is ArmCustomPatchSync< + NetworkServiceDesignGroup, + PatchModel = TagsObject + >; + + /** + * Deletes a specified network service design group. + */ + delete is ArmResourceDeleteWithoutOkAsync< + NetworkServiceDesignGroup, + Response = ArmAcceptedLroResponse< + "Accepted. Sets provisioningState to 'Deleting' until the operation is completed. Returns an operation URI that can be queried to find the current state of the operation.", + LroHeaders = ArmLroLocationHeader + > | ArmNoContentResponse<"Request is successful. Resource does not exist.">, + LroHeaders = ArmLroLocationHeader + >; + + /** + * Gets information of the network service design groups under a publisher. + */ + listByPublisher is ArmResourceListByParent; +} + +@@maxLength(NetworkServiceDesignGroup.name, 64); +@@doc(NetworkServiceDesignGroup.name, + "The name of the network service design group." +); +@@doc(NetworkServiceDesignGroup.properties, + "network service design group properties." +); +@@doc(NetworkServiceDesignGroups.createOrUpdate::parameters.resource, + "Parameters supplied to the create or update publisher network service design group operation." +); +@@doc(NetworkServiceDesignGroups.update::parameters.properties, + "Parameters supplied to the create or update publisher network service design group operation." +); diff --git a/packages/typespec-test/test/HybridNetwork.Management/spec/NetworkServiceDesignVersion.tsp b/packages/typespec-test/test/HybridNetwork.Management/spec/NetworkServiceDesignVersion.tsp new file mode 100644 index 0000000000..186e1638b7 --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/spec/NetworkServiceDesignVersion.tsp @@ -0,0 +1,102 @@ +import "@azure-tools/typespec-azure-core"; +import "@azure-tools/typespec-azure-resource-manager"; +import "@typespec/openapi"; +import "@typespec/rest"; +import "./models.tsp"; +import "./NetworkServiceDesignGroup.tsp"; + +using TypeSpec.Rest; +using Azure.ResourceManager; +using TypeSpec.Http; +using TypeSpec.OpenAPI; + +namespace Microsoft.HybridNetwork; +/** + * network service design version. + */ +#suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +#suppress "@azure-tools/typespec-azure-resource-manager/resource-name" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +@parentResource(NetworkServiceDesignGroup) +model networkServiceDesignVersion + is Azure.ResourceManager.TrackedResource { + ...ResourceNameParameter< + Resource = networkServiceDesignVersion, + KeyName = "networkServiceDesignVersionName", + SegmentName = "networkServiceDesignVersions", + NamePattern = "^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$" + >; +} + +@armResourceOperations +interface NetworkServiceDesignVersions { + /** + * Gets information about a network service design version. + */ + get is ArmResourceRead; + + /** + * Creates or updates a network service design version. + */ + createOrUpdate is ArmResourceCreateOrReplaceAsync< + networkServiceDesignVersion, + LroHeaders = ArmAsyncOperationHeader + >; + + /** + * Updates a network service design version resource. + */ + @patch(#{ implicitOptionality: false }) + update is ArmCustomPatchSync< + networkServiceDesignVersion, + PatchModel = TagsObject + >; + + /** + * Deletes the specified network service design version. + */ + delete is ArmResourceDeleteWithoutOkAsync< + networkServiceDesignVersion, + Response = ArmAcceptedLroResponse< + "Accepted. Sets provisioningState to 'Deleting' until the operation is completed. Returns an operation URI that can be queried to find the current state of the operation.", + LroHeaders = ArmLroLocationHeader + > | ArmNoContentResponse<"Request is successful. Resource does not exist.">, + LroHeaders = ArmLroLocationHeader + >; + + /** + * Gets information about a list of network service design versions under a network service design group. + */ + listByNetworkServiceDesignGroup is ArmResourceListByParent; + + /** + * Update network service design version state. + */ + #suppress "@azure-tools/typespec-azure-core/no-openapi" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + @operationId("NetworkServiceDesignVersions_updateState") + updateState is ArmResourceActionAsyncBase< + networkServiceDesignVersion, + NetworkServiceDesignVersionUpdateState, + ArmResponse | ArmAcceptedLroResponse< + "The request of updating network service design version state is accepted.", + ArmLroLocationHeader + >, + BaseParameters = Azure.ResourceManager.Foundations.DefaultBaseParameters + >; +} + +@@maxLength(networkServiceDesignVersion.name, 64); +@@doc(networkServiceDesignVersion.name, + "The name of the network service design version. The name should conform to the SemVer 2.0.0 specification: https://semver.org/spec/v2.0.0.html." +); +@@doc(networkServiceDesignVersion.properties, + "network service design version properties." +); +@@doc(NetworkServiceDesignVersions.createOrUpdate::parameters.resource, + "Parameters supplied to the create or update network service design version operation." +); +@@doc(NetworkServiceDesignVersions.update::parameters.properties, + "Parameters supplied to the create or update network service design version operation." +); +@@doc(NetworkServiceDesignVersions.updateState::parameters.body, + "Parameters supplied to update the state of network service design version." +); diff --git a/packages/typespec-test/test/HybridNetwork.Management/spec/Publisher.tsp b/packages/typespec-test/test/HybridNetwork.Management/spec/Publisher.tsp new file mode 100644 index 0000000000..70778e70fe --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/spec/Publisher.tsp @@ -0,0 +1,87 @@ +import "@azure-tools/typespec-azure-core"; +import "@azure-tools/typespec-azure-resource-manager"; +import "@typespec/openapi"; +import "@typespec/rest"; +import "./models.tsp"; + +using TypeSpec.Rest; +using Azure.ResourceManager; +using TypeSpec.Http; +using TypeSpec.OpenAPI; + +namespace Microsoft.HybridNetwork; +/** + * publisher resource. + */ +model Publisher + is Azure.ResourceManager.TrackedResource { + ...ResourceNameParameter< + Resource = Publisher, + KeyName = "publisherName", + SegmentName = "publishers", + NamePattern = "^[a-zA-Z0-9][a-zA-Z0-9_-]*$" + >; + ...Azure.ResourceManager.ManagedServiceIdentityProperty; +} + +@armResourceOperations +interface Publishers { + /** + * Gets information about the specified publisher. + */ + get is ArmResourceRead; + + /** + * Creates or updates a publisher. + */ + createOrUpdate is Azure.ResourceManager.Legacy.CreateOrUpdateAsync< + Publisher, + LroHeaders = ArmAsyncOperationHeader, + OptionalRequestBody = true + >; + + /** + * Update a publisher resource. + */ + @patch(#{ implicitOptionality: false }) + update is Azure.ResourceManager.Legacy.CustomPatchSync< + Publisher, + PatchModel = TagsObject, + OptionalRequestBody = true + >; + + /** + * Deletes the specified publisher. + */ + delete is ArmResourceDeleteWithoutOkAsync< + Publisher, + LroHeaders = ArmLroLocationHeader, + Response = ArmAcceptedLroResponse< + "Accepted. Sets provisioningState to 'Deleting' until the operation is completed. Returns an operation URI that can be queried to find the current state of the operation.", + LroHeaders = ArmLroLocationHeader + > | ArmNoContentResponse<"Request is successful. Resource does not exist."> + >; + + /** + * Lists all the publishers in a resource group. + */ + listByResourceGroup is ArmResourceListByParent; + + /** + * Lists all the publishers in a subscription. + */ + listBySubscription is ArmListBySubscription; +} + +@@maxLength(Publisher.name, 64); +@@doc(Publisher.name, "The name of the publisher."); +@@doc(Publisher.properties, "Publisher properties."); +@@doc(Publishers.createOrUpdate::parameters.resource, + "Parameters supplied to the create publisher operation." +); +@@doc(Publishers.update::parameters.properties, + "Parameters supplied to the create publisher operation." +); +@@doc(Publisher.identity, + "The managed identity of the publisher, if configured." +); diff --git a/packages/typespec-test/test/HybridNetwork.Management/spec/Site.tsp b/packages/typespec-test/test/HybridNetwork.Management/spec/Site.tsp new file mode 100644 index 0000000000..6bed9fefaf --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/spec/Site.tsp @@ -0,0 +1,77 @@ +import "@azure-tools/typespec-azure-core"; +import "@azure-tools/typespec-azure-resource-manager"; +import "@typespec/openapi"; +import "@typespec/rest"; +import "./models.tsp"; + +using TypeSpec.Rest; +using Azure.ResourceManager; +using TypeSpec.Http; +using TypeSpec.OpenAPI; + +namespace Microsoft.HybridNetwork; +/** + * Site resource. + */ +model Site is Azure.ResourceManager.TrackedResource { + ...ResourceNameParameter< + Resource = Site, + KeyName = "siteName", + SegmentName = "sites", + NamePattern = "^[a-zA-Z0-9][a-zA-Z0-9_-]*$" + >; +} + +@armResourceOperations +interface Sites { + /** + * Gets information about the specified network site. + */ + get is ArmResourceRead; + + /** + * Creates or updates a network site. + */ + createOrUpdate is ArmResourceCreateOrReplaceAsync< + Site, + LroHeaders = ArmAsyncOperationHeader + >; + + /** + * Updates a site update tags. + */ + @patch(#{ implicitOptionality: false }) + updateTags is ArmCustomPatchSync; + + /** + * Deletes the specified network site. + */ + delete is ArmResourceDeleteWithoutOkAsync< + Site, + Response = ArmAcceptedLroResponse< + "Accepted. Sets 'Deleting' provisioningState until the operation completes. Returns an operation URI that can be queried to find the current state of the operation.", + LroHeaders = ArmLroLocationHeader + > | ArmNoContentResponse<"Request successful. Resource does not exist.">, + LroHeaders = ArmLroLocationHeader + >; + + /** + * Lists all sites in the network service. + */ + listByResourceGroup is ArmResourceListByParent; + + /** + * Lists all sites in the network service in a subscription. + */ + listBySubscription is ArmListBySubscription; +} + +@@maxLength(Site.name, 64); +@@doc(Site.name, "The name of the network service site."); +@@doc(Site.properties, "Site properties."); +@@doc(Sites.createOrUpdate::parameters.resource, + "Parameters supplied to the create or update network site operation." +); +@@doc(Sites.updateTags::parameters.properties, + "Parameters supplied to update network site tags." +); diff --git a/packages/typespec-test/test/HybridNetwork.Management/spec/SiteNetworkService.tsp b/packages/typespec-test/test/HybridNetwork.Management/spec/SiteNetworkService.tsp new file mode 100644 index 0000000000..5f11130f34 --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/spec/SiteNetworkService.tsp @@ -0,0 +1,88 @@ +import "@azure-tools/typespec-azure-core"; +import "@azure-tools/typespec-azure-resource-manager"; +import "@typespec/openapi"; +import "@typespec/rest"; +import "./models.tsp"; + +using TypeSpec.Rest; +using Azure.ResourceManager; +using TypeSpec.Http; +using TypeSpec.OpenAPI; + +namespace Microsoft.HybridNetwork; +/** + * Site network service resource. + */ +model SiteNetworkService + is Azure.ResourceManager.TrackedResource { + ...ResourceNameParameter< + Resource = SiteNetworkService, + KeyName = "siteNetworkServiceName", + SegmentName = "siteNetworkServices", + NamePattern = "^[a-zA-Z0-9][a-zA-Z0-9_-]*$" + >; + ...Azure.ResourceManager.ManagedServiceIdentityProperty; + + /** + * Sku of the site network service. + */ + #suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-envelope-property" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + sku?: Sku; +} + +@armResourceOperations +interface SiteNetworkServices { + /** + * Gets information about the specified site network service. + */ + get is ArmResourceRead; + + /** + * Creates or updates a network site. + */ + createOrUpdate is ArmResourceCreateOrReplaceAsync< + SiteNetworkService, + LroHeaders = ArmAsyncOperationHeader + >; + + /** + * Updates a site update tags. + */ + @patch(#{ implicitOptionality: false }) + updateTags is ArmCustomPatchSync; + + /** + * Deletes the specified site network service. + */ + delete is ArmResourceDeleteWithoutOkAsync< + SiteNetworkService, + Response = ArmAcceptedLroResponse< + "Accepted. Sets 'Deleting' provisioningState until the operation completes. Returns an operation URI that can be queried to find the current state of the operation.", + LroHeaders = ArmLroLocationHeader + > | ArmNoContentResponse<"Request successful. Resource does not exist.">, + LroHeaders = ArmLroLocationHeader + >; + + /** + * Lists all site network services. + */ + listByResourceGroup is ArmResourceListByParent; + + /** + * Lists all sites in the network service in a subscription. + */ + listBySubscription is ArmListBySubscription; +} + +@@maxLength(SiteNetworkService.name, 64); +@@doc(SiteNetworkService.name, "The name of the site network service."); +@@doc(SiteNetworkService.properties, "Site network service properties."); +@@doc(SiteNetworkServices.createOrUpdate::parameters.resource, + "Parameters supplied to the create or update site network service operation." +); +@@doc(SiteNetworkServices.updateTags::parameters.properties, + "Parameters supplied to update network site tags." +); +@@doc(SiteNetworkService.identity, + "The managed identity of the Site network service, if configured." +); diff --git a/packages/typespec-test/test/HybridNetwork.Management/spec/back-compatible.tsp b/packages/typespec-test/test/HybridNetwork.Management/spec/back-compatible.tsp new file mode 100644 index 0000000000..56777d875d --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/spec/back-compatible.tsp @@ -0,0 +1,118 @@ +import "@azure-tools/typespec-client-generator-core"; + +using Azure.ClientGenerator.Core; +using Microsoft.HybridNetwork; + +@@clientName(ResourceElementTemplate.type, "ResourceElementType"); +@@clientName(NetworkFunctionDefinitionResourceElementTemplateDetails.type, + "ResourceElementType", + "go, javascript" +); +@@clientName(ArmResourceDefinitionResourceElementTemplateDetails.type, + "ResourceElementType", + "go, javascript" +); + +@@clientName(ConfigurationGroupSchemas.createOrUpdate::parameters.resource, + "parameters" +); +@@clientName(ConfigurationGroupSchemas.update::parameters.properties, + "parameters" +); +@@clientName(ConfigurationGroupSchemas.updateState, "updateState"); +@@clientName(ConfigurationGroupSchemas.updateState::parameters.body, + "parameters" +); + +@@clientName(ConfigurationGroupValues.createOrUpdate::parameters.resource, + "parameters" +); +@@clientName(ConfigurationGroupValues.updateTags::parameters.properties, + "parameters" +); + +@@clientName(NetworkFunctions.createOrUpdate::parameters.resource, + "parameters" +); +@@clientName(NetworkFunctions.updateTags::parameters.properties, "parameters"); +@@clientName(NetworkFunctions.executeRequest::parameters.body, "parameters"); + +@@clientName(NetworkFunctionDefinitionGroups.createOrUpdate::parameters.resource, + "parameters" +); +@@clientName(NetworkFunctionDefinitionGroups.update::parameters.properties, + "parameters" +); + +@@clientName(NetworkFunctionDefinitionVersions.createOrUpdate::parameters.resource, + "parameters" +); +@@clientName(NetworkFunctionDefinitionVersions.update::parameters.properties, + "parameters" +); +@@clientName(NetworkFunctionDefinitionVersions.updateState, "updateState"); +@@clientName(NetworkFunctionDefinitionVersions.updateState::parameters.body, + "parameters" +); + +@@clientName(NetworkServiceDesignGroups.createOrUpdate::parameters.resource, + "parameters" +); +@@clientName(NetworkServiceDesignGroups.update::parameters.properties, + "parameters" +); + +@@clientName(NetworkServiceDesignVersions.createOrUpdate::parameters.resource, + "parameters" +); +@@clientName(NetworkServiceDesignVersions.update::parameters.properties, + "parameters" +); +@@clientName(NetworkServiceDesignVersions.updateState, "updateState"); +@@clientName(NetworkServiceDesignVersions.updateState::parameters.body, + "parameters" +); + +@@clientName(Publishers.createOrUpdate::parameters.resource, "parameters"); +@@clientName(Publishers.update::parameters.properties, "parameters"); + +@@clientName(ArtifactStores.createOrUpdate::parameters.resource, "parameters"); +@@clientName(ArtifactStores.update::parameters.properties, "parameters"); +@@clientName(ArtifactStores.addNetworkFabricControllerEndPoints::parameters.body, + "parameters" +); +@@clientName(ArtifactStores.deleteNetworkFabricControllerEndPoints::parameters.body, + "parameters" +); +@@clientName(ArtifactStores.approvePrivateEndPoints::parameters.body, + "parameters" +); +@@clientName(ArtifactStores.removePrivateEndPoints::parameters.body, + "parameters" +); +@@clientName(ProxyArtifact.proxyArtifactGet, "Get"); +@@clientName(ProxyArtifact.updateState::parameters.body, "parameters"); + +@@clientName(ArtifactManifests.createOrUpdate::parameters.resource, + "parameters" +); +@@clientName(ArtifactManifests.update::parameters.properties, "parameters"); +@@clientName(ArtifactManifests.updateState::parameters.body, "parameters"); + +@@clientName(Sites.createOrUpdate::parameters.resource, "parameters"); +@@clientName(Sites.updateTags::parameters.properties, "parameters"); + +@@clientName(SiteNetworkServices.createOrUpdate::parameters.resource, + "parameters" +); +@@clientName(SiteNetworkServices.updateTags::parameters.properties, + "parameters" +); + +@@clientLocation(SiteNetworkServicesOperationGroup.cancelOperation, + SiteNetworkServices +); + +@@clientName(SiteNetworkServicesOperationGroup.cancelOperation::parameters.body, + "parameters" +); diff --git a/packages/typespec-test/test/HybridNetwork.Management/spec/client.tsp b/packages/typespec-test/test/HybridNetwork.Management/spec/client.tsp new file mode 100644 index 0000000000..e228ce6209 --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/spec/client.tsp @@ -0,0 +1,106 @@ +import "./main.tsp"; +import "@azure-tools/typespec-client-generator-core"; + +using Azure.ClientGenerator.Core; + +namespace Microsoft.HybridNetwork; +using Azure.ResourceManager; +using TypeSpec.Rest; +using TypeSpec.Http; + +@@clientName(HelmInstallOptions.wait, "waitOption", "java"); +@@clientName(HelmUpgradeOptions.wait, "waitOption", "java"); + +@@clientName(NSDArtifactProfile, "NsdArtifactProfile", "java"); +@@clientName(NFVIs, "NfvIs", "java"); +@@clientName(AzureCoreNFVIDetails, "AzureCoreNfviDetails", "java"); +@@clientName(AzureArcK8sClusterNFVIDetails, + "AzureArcK8SClusterNfviDetails", + "java,python" +); +@@clientName(AzureOperatorNexusClusterNFVIDetails, + "AzureOperatorNexusClusterNfviDetails", + "java" +); +@@clientName(VirtualNetworkFunctionNFVIType, + "VirtualNetworkFunctionNfviType", + "java" +); +@@clientName(ContainerizedNetworkFunctionNFVIType, + "ContainerizedNetworkFunctionNfviType", + "java" +); +@@clientName(VirtualNetworkFunctionNetworkFunctionDefinitionVersion, + "VirtualNetworkFunctionDefinitionVersion", + "java,python,go" +); + +@@clientName(Microsoft.HybridNetwork, + "HybridNetworkManagementClient", + "python,javascript" +); +@@clientName(AzureArcK8sClusterNFVIDetails, + "AzureArcK8SClusterNFVIDetails", + "python" +); +@@clientName(NfviType, "NFVIType", "go"); + +#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-operation" "customization" +#suppress "@azure-tools/typespec-azure-core/documentation-required" "override" +op proxyArtifactUpdateState( + ...ApiVersionParameter, + ...SubscriptionIdParameter, + ...ResourceGroupParameter, + ...Azure.ResourceManager.Legacy.Provider, + + /** + * The name of the publisher. + */ + #suppress "@azure-tools/typespec-azure-core/documentation-required" "override" + @path + @maxLength(64) + @pattern("^[a-zA-Z0-9][a-zA-Z0-9_-]*$") + @segment("publishers") + publisherName: string, + + /** + * The name of the artifact store. + */ + #suppress "@azure-tools/typespec-azure-core/documentation-required" "override" + @path + @maxLength(64) + @pattern("^[a-zA-Z0-9][a-zA-Z0-9_-]*$") + @segment("artifactStores") + artifactStoreName: string, + + /** + * The name of the artifact. + */ + #suppress "@azure-tools/typespec-azure-core/documentation-required" "override" + @maxLength(64) + @pattern("^[^\\s]*[^\\s]+[^\\s]*$") + @query("artifactName") + artifactName: string, + + /** + * The name of the artifact version. + */ + #suppress "@azure-tools/typespec-azure-core/documentation-required" "override" + @path + @maxLength(64) + @pattern("^[^\\s]*[^\\s]+[^\\s]*$") + @segment("artifactVersions") + artifactVersionName: string, + + #suppress "@azure-tools/typespec-azure-core/documentation-required" "override" + @body + parameters: ArtifactChangeState, +): ArmResponse | ArmAcceptedLroResponse< + "Request of updating artifact state is accepted.", + ArmLroLocationHeader +> | ErrorResponse; + +@@override(ProxyArtifact.updateState, + proxyArtifactUpdateState, + "go,javascript" +); diff --git a/packages/typespec-test/test/HybridNetwork.Management/spec/main.tsp b/packages/typespec-test/test/HybridNetwork.Management/spec/main.tsp new file mode 100644 index 0000000000..849e579d88 --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/spec/main.tsp @@ -0,0 +1,58 @@ +/** + * PLEASE DO NOT REMOVE - USED FOR CONVERTER METRICS + * Generated by package: @autorest/openapi-to-typespec + * Parameters used: + * isFullCompatible: true + * guessResourceKey: false + * Version: 0.11.7 + * Date: 2025-10-17T02:57:09.233Z + */ +import "@typespec/rest"; +import "@typespec/versioning"; +import "@azure-tools/typespec-azure-core"; +import "@azure-tools/typespec-azure-resource-manager"; +import "./models.tsp"; +import "./back-compatible.tsp"; +import "./ConfigurationGroupSchema.tsp"; +import "./ConfigurationGroupValue.tsp"; +import "./NetworkFunction.tsp"; +import "./Component.tsp"; +import "./NetworkFunctionDefinitionGroup.tsp"; +import "./NetworkFunctionDefinitionVersion.tsp"; +import "./NetworkServiceDesignGroup.tsp"; +import "./NetworkServiceDesignVersion.tsp"; +import "./Publisher.tsp"; +import "./ArtifactStore.tsp"; +import "./ArtifactManifest.tsp"; +import "./Site.tsp"; +import "./SiteNetworkService.tsp"; +import "./routes.tsp"; + +using TypeSpec.Rest; +using TypeSpec.Http; +using Azure.ResourceManager.Foundations; +using Azure.Core; +using Azure.ResourceManager; +using TypeSpec.Versioning; +/** + * The resources in this swagger specification will be used to manage the hybrid network site network service. + */ +@armProviderNamespace +@service(#{ title: "HybridNetworkManagementClient" }) +@versioned(Versions) +@armCommonTypesVersion(Azure.ResourceManager.CommonTypes.Versions.v3) +namespace Microsoft.HybridNetwork; + +/** + * The available API versions. + */ +enum Versions { + /** + * The 2025-03-30 API version. + */ + v2025_03_30: "2025-03-30", +} + +interface Operations extends Azure.ResourceManager.Operations {} + +@@doc(Operations.list, "Gets a list of the operations."); diff --git a/packages/typespec-test/test/HybridNetwork.Management/spec/models.tsp b/packages/typespec-test/test/HybridNetwork.Management/spec/models.tsp new file mode 100644 index 0000000000..f703503cb6 --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/spec/models.tsp @@ -0,0 +1,2566 @@ +import "@typespec/rest"; +import "@typespec/http"; +import "@azure-tools/typespec-azure-core"; +import "@azure-tools/typespec-azure-resource-manager"; + +using TypeSpec.Rest; +using TypeSpec.Http; +using Azure.ResourceManager; +using Azure.ResourceManager.Foundations; + +namespace Microsoft.HybridNetwork; + +/** + * The current provisioning state. + */ +union ProvisioningState { + string, + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + Unknown: "Unknown", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + Succeeded: "Succeeded", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + Accepted: "Accepted", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + Deleting: "Deleting", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + Failed: "Failed", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + Canceled: "Canceled", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + Deleted: "Deleted", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + Converging: "Converging", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + Cancelling: "Cancelling", +} + +/** + * The configuration group schema state. + */ +union VersionState { + string, + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + Unknown: "Unknown", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + Preview: "Preview", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + Active: "Active", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + Deprecated: "Deprecated", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + Validating: "Validating", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + ValidationFailed: "ValidationFailed", +} + +/** + * The type of identity that created the resource. + */ +union CreatedByType { + string, + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + User: "User", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + Application: "Application", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + ManagedIdentity: "ManagedIdentity", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + Key: "Key", +} + +/** + * Publisher Scope. + */ +union PublisherScope { + string, + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + Unknown: "Unknown", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + Private: "Private", +} + +/** + * The resource reference arm id type. + */ +union IdType { + string, + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + Unknown: "Unknown", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + Open: "Open", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + Secret: "Secret", +} + +/** + * The secret type which indicates if secret or not. + */ +union ConfigurationGroupValueConfigurationType { + string, + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + Unknown: "Unknown", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + Secret: "Secret", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + Open: "Open", +} + +/** + * The NFVI type. + */ +union NfviType { + string, + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + Unknown: "Unknown", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + AzureArcKubernetes: "AzureArcKubernetes", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + AzureCore: "AzureCore", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + AzureOperatorNexus: "AzureOperatorNexus", +} + +/** + * The secret type which indicates if secret or not. + */ +union NetworkFunctionConfigurationType { + string, + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + Unknown: "Unknown", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + Secret: "Secret", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + Open: "Open", +} + +/** + * The http method of the request. + */ +union HttpMethod { + string, + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + Unknown: "Unknown", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + Post: "Post", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + Put: "Put", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + Get: "Get", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + Patch: "Patch", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + Delete: "Delete", +} + +/** + * The component resource deployment status. + */ +union Status { + string, + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + Unknown: "Unknown", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + Deployed: "Deployed", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + Uninstalled: "Uninstalled", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + Superseded: "Superseded", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + Failed: "Failed", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + Uninstalling: "Uninstalling", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + `Pending-Install`: "Pending-Install", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + `Pending-Upgrade`: "Pending-Upgrade", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + `Pending-Rollback`: "Pending-Rollback", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + Downloading: "Downloading", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + Installing: "Installing", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + Reinstalling: "Reinstalling", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + Rollingback: "Rollingback", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + Upgrading: "Upgrading", +} + +/** + * The status of a Pod. + */ +union PodStatus { + string, + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + Unknown: "Unknown", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + Succeeded: "Succeeded", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + Failed: "Failed", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + Running: "Running", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + Pending: "Pending", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + Terminating: "Terminating", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + NotReady: "NotReady", +} + +/** + * The type of pod event. + */ +union PodEventType { + string, + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + Normal: "Normal", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + Warning: "Warning", +} + +/** + * The network function type. + */ +union NetworkFunctionType { + string, + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + Unknown: "Unknown", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + VirtualNetworkFunction: "VirtualNetworkFunction", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + ContainerizedNetworkFunction: "ContainerizedNetworkFunction", +} + +/** + * The resource element template type. + */ +union Type { + string, + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + Unknown: "Unknown", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + ArmResourceDefinition: "ArmResourceDefinition", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + NetworkFunctionDefinition: "NetworkFunctionDefinition", +} + +/** + * The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value is "user,system" + */ +union Origin { + string, + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + user: "user", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + system: "system", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + `user,system`: "user,system", +} + +/** + * Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. + */ +union ActionType { + string, + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + Internal: "Internal", +} + +/** + * The artifact store type. + */ +union ArtifactStoreType { + string, + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + Unknown: "Unknown", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + AzureContainerRegistry: "AzureContainerRegistry", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + AzureStorageAccount: "AzureStorageAccount", +} + +/** + * The backing resource network access type. + */ +union BackingResourcePublicNetworkAccess { + string, + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + Enabled: "Enabled", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + Disabled: "Disabled", +} + +/** + * The replication strategy. + */ +union ArtifactReplicationStrategy { + string, + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + Unknown: "Unknown", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + SingleReplication: "SingleReplication", +} + +/** + * The artifact manifest state. + */ +union ArtifactManifestState { + string, + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + Unknown: "Unknown", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + Uploading: "Uploading", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + Uploaded: "Uploaded", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + Validating: "Validating", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + ValidationFailed: "ValidationFailed", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + Succeeded: "Succeeded", +} + +/** + * The artifact type. + */ +union ArtifactType { + string, + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + Unknown: "Unknown", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + OCIArtifact: "OCIArtifact", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + VhdImageFile: "VhdImageFile", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + ArmTemplate: "ArmTemplate", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + ImageFile: "ImageFile", +} + +/** + * The credential type. + */ +union CredentialType { + string, + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + Unknown: "Unknown", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + AzureContainerRegistryScopedToken: "AzureContainerRegistryScopedToken", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + AzureStorageAccountToken: "AzureStorageAccountToken", +} + +/** + * The artifact state. + */ +union ArtifactState { + string, + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + Unknown: "Unknown", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + Preview: "Preview", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + Active: "Active", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + Deprecated: "Deprecated", +} + +/** + * Name of this Sku + */ +union SkuName { + string, + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + Basic: "Basic", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + Standard: "Standard", +} + +/** + * The SKU tier based on the SKU name. + */ +union SkuTier { + string, + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + Basic: "Basic", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + Standard: "Standard", +} + +/** + * The type of long-running operation the user wants to cancel, such as 'Put'. + */ +union LongRunningOperation { + string, + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + Unknown: "Unknown", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + Put: "Put", +} + +/** + * The application enablement. + */ +union ApplicationEnablement { + string, + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + Unknown: "Unknown", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + Enabled: "Enabled", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + Disabled: "Disabled", +} + +/** + * The network function type. + */ +union ContainerizedNetworkFunctionNFVIType { + string, + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + Unknown: "Unknown", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + AzureArcKubernetes: "AzureArcKubernetes", +} + +/** + * The network function type. + */ +union VirtualNetworkFunctionNFVIType { + string, + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + Unknown: "Unknown", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + AzureCore: "AzureCore", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + AzureOperatorNexus: "AzureOperatorNexus", +} + +/** + * The artifact type. + */ +union AzureArcKubernetesArtifactType { + string, + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + Unknown: "Unknown", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + HelmPackage: "HelmPackage", +} + +/** + * The artifact type. + */ +union AzureCoreArtifactType { + string, + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + Unknown: "Unknown", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + VhdImageFile: "VhdImageFile", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + ArmTemplate: "ArmTemplate", +} + +/** + * The artifact type. + */ +union AzureOperatorNexusArtifactType { + string, + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + Unknown: "Unknown", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + ImageFile: "ImageFile", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + ArmTemplate: "ArmTemplate", +} + +/** + * The template type. + */ +union TemplateType { + string, + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + Unknown: "Unknown", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + ArmTemplate: "ArmTemplate", +} + +/** + * The configuration generation type. + */ +union ConfigurationGenerationType { + string, + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + Unknown: "Unknown", + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + HandlebarTemplate: "HandlebarTemplate", +} + +/** + * Configuration group schema properties. + */ +model ConfigurationGroupSchemaPropertiesFormat { + /** + * The provisioning state of the Configuration group schema resource. + */ + @visibility(Lifecycle.Read) + provisioningState?: ProvisioningState; + + /** + * The configuration group schema version state. + */ + @visibility(Lifecycle.Read) + versionState?: VersionState; + + /** + * Description of what schema can contain. + */ + description?: string; + + /** + * Name and value pairs that define the configuration value. It can be a well formed escaped JSON string. + */ + schemaDefinition?: string; +} + +/** + * Tags object for patch operations. + */ +#suppress "@azure-tools/typespec-azure-resource-manager/patch-envelope" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +model TagsObject { + /** + * Resource tags. + */ + #suppress "@azure-tools/typespec-azure-resource-manager/arm-no-record" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + tags?: Record; +} + +/** + * Publisher configuration group schema update request definition. + */ +model ConfigurationGroupSchemaVersionUpdateState { + /** + * The configuration group schema state. + */ + @visibility(Lifecycle.Read, Lifecycle.Create) + versionState?: VersionState; +} + +/** + * Hybrid configuration group value properties. + */ +#suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +@discriminator("configurationType") +model configurationGroupValuePropertiesFormat { + /** + * The provisioning state of the site resource. + */ + @visibility(Lifecycle.Read) + provisioningState?: ProvisioningState; + + /** + * The publisher name for the configuration group schema. + */ + @visibility(Lifecycle.Read) + publisherName?: string; + + /** + * The scope of the publisher. + */ + @visibility(Lifecycle.Read) + publisherScope?: PublisherScope; + + /** + * The configuration group schema name. + */ + @visibility(Lifecycle.Read) + configurationGroupSchemaName?: string; + + /** + * The location of the configuration group schema offering. + */ + @visibility(Lifecycle.Read) + configurationGroupSchemaOfferingLocation?: string; + + /** + * The configuration group schema resource reference. + */ + configurationGroupSchemaResourceReference?: DeploymentResourceIdReference; + + /** + * The value which indicates if configuration values are secrets + */ + configurationType: ConfigurationGroupValueConfigurationType; +} + +/** + * The azure resource reference which is used for deployment. + */ +@discriminator("idType") +model DeploymentResourceIdReference { + /** + * The resource reference arm id type. + */ + idType: IdType = IdType.Open; +} + +/** + * Network function properties. + */ +@discriminator("configurationType") +model NetworkFunctionPropertiesFormat { + /** + * The provisioning state of the network function resource. + */ + @visibility(Lifecycle.Read) + provisioningState?: ProvisioningState; + + /** + * The publisher name for the network function. + */ + publisherName?: string; + + /** + * The scope of the publisher. + */ + publisherScope?: PublisherScope; + + /** + * The network function definition group name for the network function. + */ + networkFunctionDefinitionGroupName?: string; + + /** + * The network function definition version for the network function. + */ + networkFunctionDefinitionVersion?: string; + + /** + * The location of the network function definition offering. + */ + networkFunctionDefinitionOfferingLocation?: string; + + /** + * The network function definition version resource reference. + */ + networkFunctionDefinitionVersionResourceReference?: DeploymentResourceIdReference; + + /** + * The nfvi type for the network function. + */ + nfviType?: NfviType; + + /** + * The nfviId for the network function. + */ + nfviId?: string; + + /** + * Indicates if software updates are allowed during deployment. + */ + allowSoftwareUpdate?: boolean; + + /** + * The value which indicates if NF values are secrets + */ + configurationType: NetworkFunctionConfigurationType; + + /** + * The role configuration override values from the user. + */ + roleOverrideValues?: string[]; +} + +/** + * Payload for execute request post call. + */ +model ExecuteRequestParameters { + /** + * The endpoint of service to call. + */ + serviceEndpoint: string; + + /** + * The request metadata. + */ + requestMetadata: RequestMetadata; +} + +/** + * Request metadata of execute request post call payload. + */ +model RequestMetadata { + /** + * The relative path of the request. + */ + relativePath: string; + + /** + * The http method of the request. + */ + httpMethod: HttpMethod; + + /** + * The serialized body of the request. + */ + serializedBody: string; + + /** + * The api version of the request. + */ + apiVersion?: string; +} + +/** + * The component properties of the network function. + */ +model ComponentProperties { + /** + * The provisioning state of the component resource. + */ + @visibility(Lifecycle.Read) + provisioningState?: ProvisioningState; + + /** + * The JSON-serialized deployment profile of the component resource. + */ + @visibility(Lifecycle.Read) + deploymentProfile?: string; + + /** + * The deployment status of the component resource. + */ + @visibility(Lifecycle.Read) + deploymentStatus?: DeploymentStatusProperties; +} + +/** + * The deployment status properties of the network function component. + */ +model DeploymentStatusProperties { + /** + * The status of the component resource. + */ + status?: Status; + + /** + * The resource related to the component resource. + */ + resources?: Resources; + + /** + * The next expected update of deployment status. + */ + // FIXME: (utcDateTime) Please double check that this is the correct type for your scenario. + nextExpectedUpdateAt?: utcDateTime; +} + +/** + * The resources of the network function component. + */ +model Resources { + /** + * Deployments that are related to component resource. + */ + deployments?: Deployment[]; + + /** + * Pods related to component resource. + */ + pods?: Pod[]; + + /** + * Replica sets related to component resource. + */ + replicaSets?: ReplicaSet[]; + + /** + * Stateful sets related to component resource. + */ + statefulSets?: StatefulSet[]; + + /** + * Daemonsets related to component resource. + */ + daemonSets?: DaemonSet[]; +} + +/** + * Helm Deployment status properties. + */ +model Deployment { + /** + * The name of the deployment. + */ + name?: string; + + /** + * The namespace of the deployment. + */ + `namespace`?: string; + + /** + * Desired number of pods + */ + desired?: int32; + + /** + * Number of ready pods. + */ + ready?: int32; + + /** + * Number of upto date pods. + */ + upToDate?: int32; + + /** + * Number of available pods. + */ + available?: int32; + + /** + * Creation Time of deployment. + */ + // FIXME: (utcDateTime) Please double check that this is the correct type for your scenario. + creationTime?: utcDateTime; +} + +/** + * Helm Pod status properties. + */ +model Pod { + /** + * The name of the Pod. + */ + name?: string; + + /** + * The namespace of the Pod. + */ + `namespace`?: string; + + /** + * Desired number of containers + */ + desired?: int32; + + /** + * Number of ready containers. + */ + ready?: int32; + + /** + * The status of a pod. + */ + status?: PodStatus; + + /** + * Creation Time of Pod. + */ + // FIXME: (utcDateTime) Please double check that this is the correct type for your scenario. + creationTime?: utcDateTime; + + /** + * Last 5 Pod events. + */ + @identifiers(#[]) + events?: PodEvent[]; +} + +/** + * Pod Event properties. + */ +model PodEvent { + /** + * The type of pod event. + */ + type?: PodEventType; + + /** + * Event reason. + */ + reason?: string; + + /** + * Event message. + */ + message?: string; + + /** + * Event Last seen. + */ + // FIXME: (utcDateTime) Please double check that this is the correct type for your scenario. + lastSeenTime?: utcDateTime; +} + +/** + * Helm ReplicaSet status properties. + */ +model ReplicaSet { + /** + * The name of the replicaSet. + */ + name?: string; + + /** + * The namespace of the replicaSet. + */ + `namespace`?: string; + + /** + * Desired number of pods + */ + desired?: int32; + + /** + * Number of ready pods. + */ + ready?: int32; + + /** + * Number of current pods. + */ + current?: int32; + + /** + * Creation Time of replicaSet. + */ + // FIXME: (utcDateTime) Please double check that this is the correct type for your scenario. + creationTime?: utcDateTime; +} + +/** + * Helm StatefulSet status properties. + */ +model StatefulSet { + /** + * The name of the statefulset. + */ + name?: string; + + /** + * The namespace of the statefulset. + */ + `namespace`?: string; + + /** + * Desired number of pods + */ + desired?: int32; + + /** + * Number of ready pods. + */ + ready?: int32; + + /** + * Creation Time of statefulset. + */ + // FIXME: (utcDateTime) Please double check that this is the correct type for your scenario. + creationTime?: utcDateTime; +} + +/** + * Helm DaemonSet status properties. + */ +model DaemonSet { + /** + * The name of the daemonSet. + */ + name?: string; + + /** + * The namespace of the daemonSet. + */ + `namespace`?: string; + + /** + * Desired number of pods + */ + desired?: int32; + + /** + * Current number of pods + */ + current?: int32; + + /** + * Number of Ready pods + */ + ready?: int32; + + /** + * Number of upto date pods + */ + upToDate?: int32; + + /** + * Number of available pods. + */ + available?: int32; + + /** + * Creation Time of daemonSet. + */ + // FIXME: (utcDateTime) Please double check that this is the correct type for your scenario. + creationTime?: utcDateTime; +} + +/** + * Network function definition group properties. + */ +model NetworkFunctionDefinitionGroupPropertiesFormat { + /** + * The provisioning state of the network function definition groups resource. + */ + @visibility(Lifecycle.Read) + provisioningState?: ProvisioningState; + + /** + * The network function definition group description. + */ + description?: string; +} + +/** + * Network function definition version properties. + */ +@discriminator("networkFunctionType") +model NetworkFunctionDefinitionVersionPropertiesFormat { + /** + * The provisioning state of the network function definition version resource. + */ + @visibility(Lifecycle.Read) + provisioningState?: ProvisioningState; + + /** + * The network function definition version state. + */ + @visibility(Lifecycle.Read) + versionState?: VersionState; + + /** + * The network function definition version description. + */ + description?: string; + + /** + * The deployment parameters of the network function definition version. + */ + deployParameters?: string; + + /** + * The network function type. + */ + networkFunctionType: NetworkFunctionType; +} + +/** + * Publisher network function definition version update request definition. + */ +model NetworkFunctionDefinitionVersionUpdateState { + /** + * The network function definition version state. + */ + @visibility(Lifecycle.Read, Lifecycle.Create) + versionState?: VersionState; +} + +/** + * network service design group properties. + */ +model NetworkServiceDesignGroupPropertiesFormat { + /** + * The provisioning state of the network service design groups resource. + */ + @visibility(Lifecycle.Read) + provisioningState?: ProvisioningState; + + /** + * The network service design group description. + */ + description?: string; +} + +/** + * network service design version properties. + */ +#suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +model networkServiceDesignVersionPropertiesFormat { + /** + * The provisioning state of the network service design version resource. + */ + @visibility(Lifecycle.Read) + provisioningState?: ProvisioningState; + + /** + * The network service design version state. + */ + @visibility(Lifecycle.Read) + versionState?: VersionState; + + /** + * The network service design version description. + */ + description?: string; + + /** + * The configuration schemas to used to define the values. + */ + #suppress "@azure-tools/typespec-azure-resource-manager/arm-no-record" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + configurationGroupSchemaReferences?: Record; + + /** + * The nfvis from the site. + */ + #suppress "@azure-tools/typespec-azure-resource-manager/arm-no-record" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + nfvisFromSite?: Record; + + /** + * List of resource element template + */ + @identifiers(#["name"]) + resourceElementTemplates?: ResourceElementTemplate[]; +} + +/** + * Reference to another resource. + */ +model ReferencedResource { + /** + * Resource ID. + */ + id?: string; +} + +/** + * The nfvi details. + */ +model NfviDetails { + /** + * The nfvi name. + */ + name?: string; + + /** + * The nfvi type. + */ + type?: string; +} + +/** + * The resource element template object. + */ +@discriminator("type") +model ResourceElementTemplate { + /** + * Name of the resource element template. + */ + name?: string; + + /** + * The resource element template type. + */ + type: Type; + + /** + * The depends on profile. + */ + dependsOnProfile?: DependsOnProfile; +} + +/** + * Depends on profile definition. + */ +model DependsOnProfile { + /** + * Application installation operation dependency. + */ + installDependsOn?: string[]; + + /** + * Application deletion operation dependency. + */ + uninstallDependsOn?: string[]; + + /** + * Application update operation dependency. + */ + updateDependsOn?: string[]; +} + +/** + * Publisher network service design version update request definition. + */ +model NetworkServiceDesignVersionUpdateState { + /** + * The network service design version state. + */ + @visibility(Lifecycle.Read, Lifecycle.Create) + versionState?: VersionState; +} + +/** + * Localized display information for this particular operation. + */ +model OperationDisplay { + /** + * The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring Insights" or "Microsoft Compute". + */ + @visibility(Lifecycle.Read) + provider?: string; + + /** + * The localized friendly name of the resource type related to this operation. E.g. "Virtual Machines" or "Job Schedule Collections". + */ + @visibility(Lifecycle.Read) + resource?: string; + + /** + * The concise, localized friendly name for the operation; suitable for dropdowns. E.g. "Create or Update Virtual Machine", "Restart Virtual Machine". + */ + @visibility(Lifecycle.Read) + operation?: string; + + /** + * The short, localized friendly description of the operation; suitable for tool tips and detailed views. + */ + @visibility(Lifecycle.Read) + description?: string; +} + +/** + * publisher properties. + */ +model PublisherPropertiesFormat { + /** + * The provisioning state of the publisher resource. + */ + @visibility(Lifecycle.Read) + provisioningState?: ProvisioningState; + + /** + * The publisher scope. + */ + @visibility(Lifecycle.Read, Lifecycle.Create) + scope?: PublisherScope; +} + +/** + * Artifact store properties. + */ +model ArtifactStorePropertiesFormat { + /** + * The provisioning state of the application groups resource. + */ + @visibility(Lifecycle.Read) + provisioningState?: ProvisioningState; + + /** + * The artifact store type. + */ + @visibility(Lifecycle.Read, Lifecycle.Create) + storeType?: ArtifactStoreType; + + /** + * The artifact store backing resource network access type + */ + backingResourcePublicNetworkAccess?: BackingResourcePublicNetworkAccess; + + /** + * The replication strategy. + */ + replicationStrategy?: ArtifactReplicationStrategy; + + #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + managedResourceGroupConfiguration?: ArtifactStorePropertiesFormatManagedResourceGroupConfiguration; + + /** + * The created storage resource id + */ + @visibility(Lifecycle.Read) + storageResourceId?: string; +} + +#suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +model ArtifactStorePropertiesFormatManagedResourceGroupConfiguration { + /** + * The managed resource group name. + */ + @visibility(Lifecycle.Read, Lifecycle.Create) + name?: string; + + /** + * The managed resource group location. + */ + @visibility(Lifecycle.Read, Lifecycle.Create) + location?: string; +} + +/** + * List of network fabric controller ids. + */ +model ArtifactStoreNetworkFabricControllerEndPoints { + /** + * list of network fabric controllers. + */ + @identifiers(#["id"]) + networkFabricControllerIds?: ReferencedResource[]; +} + +/** + * List of manual private endpoints. + */ +model ArtifactStoreNetworkFabricControllerEndPointsList + is Azure.Core.Page; + +/** + * List of manual private endpoints. + */ +model ArtifactStorePrivateEndPointsFormat { + /** + * list of private endpoints. + */ + @identifiers(#["id"]) + manualPrivateEndPointConnections?: ReferencedResource[]; +} + +/** + * List of manual private endpoints. + */ +model ArtifactStorePrivateEndPointsListResult + is Azure.Core.Page; + +/** + * Artifact manifest properties. + */ +model ArtifactManifestPropertiesFormat { + /** + * The provisioning state of the ArtifactManifest resource. + */ + @visibility(Lifecycle.Read) + provisioningState?: ProvisioningState; + + /** + * The artifact manifest state. + */ + @visibility(Lifecycle.Read) + artifactManifestState?: ArtifactManifestState; + + /** + * The artifacts list. + */ + @identifiers(#["artifactName", "artifactType", "artifactVersion"]) + artifacts?: ManifestArtifactFormat[]; +} + +/** + * Manifest artifact properties. + */ +model ManifestArtifactFormat { + /** + * The artifact name + */ + @visibility(Lifecycle.Read, Lifecycle.Create) + artifactName?: string; + + /** + * The artifact type. + */ + @visibility(Lifecycle.Read, Lifecycle.Create) + artifactType?: ArtifactType; + + /** + * The artifact version. + */ + @visibility(Lifecycle.Read, Lifecycle.Create) + artifactVersion?: string; +} + +/** + * The artifact manifest credential definition. + */ +@discriminator("credentialType") +model ArtifactAccessCredential { + /** + * The credential type. + */ + credentialType: CredentialType; +} + +/** + * The artifact manifest updating request payload. Only the 'Uploaded' state is allowed for updates. Other states are used for internal state transitioning. + */ +model ArtifactManifestUpdateState { + /** + * The artifact manifest state. + */ + @visibility(Lifecycle.Read, Lifecycle.Create) + artifactManifestState?: ArtifactManifestState; +} + +/** + * The proxy artifact overview. + */ +#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +#suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +#suppress "@azure-tools/typespec-azure-resource-manager/no-empty-model" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +model ProxyArtifactListOverview + extends Azure.ResourceManager.CommonTypes.ProxyResource {} + +/** + * The proxy artifact overview. + */ +#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +model ProxyArtifactVersionsListOverview + extends Azure.ResourceManager.CommonTypes.ProxyResource { + /** + * Proxy Artifact overview properties. + */ + @visibility(Lifecycle.Read) + properties?: ProxyArtifactOverviewPropertiesValue; +} + +#suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +model ProxyArtifactOverviewPropertiesValue { + /** + * The artifact type. + */ + artifactType?: ArtifactType; + + /** + * The artifact version. + */ + artifactVersion?: string; + + /** + * The artifact state + */ + artifactState?: ArtifactState; +} + +/** + * The artifact updating request payload. + */ +model ArtifactChangeState { + /** + * Artifact update state properties. + */ + properties?: ArtifactChangeStateProperties; +} + +/** + * The artifact update state properties. + */ +model ArtifactChangeStateProperties { + /** + * The artifact state + */ + artifactState?: ArtifactState; +} + +/** + * Site properties. + */ +model SitePropertiesFormat { + /** + * The provisioning state of the site resource. **TODO**: Confirm if this is needed. + */ + @visibility(Lifecycle.Read) + provisioningState?: ProvisioningState; + + /** + * List of NFVIs + */ + @identifiers(#["name"]) + nfvis?: NFVIs[]; + + /** + * The list of site network services on the site. + */ + @visibility(Lifecycle.Read) + @identifiers(#["id"]) + siteNetworkServiceReferences?: ReferencedResource[]; +} + +/** + * The NFVI object. + */ +#suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +@discriminator("nfviType") +model NFVIs { + /** + * Name of the nfvi. + */ + name?: string; + + /** + * The NFVI type. + */ + nfviType: NfviType; +} + +/** + * Site network service properties. + */ +model SiteNetworkServicePropertiesFormat { + /** + * The provisioning state of the site network service resource. + */ + @visibility(Lifecycle.Read) + provisioningState?: ProvisioningState; + + /** + * Managed resource group configuration. + */ + managedResourceGroupConfiguration?: ManagedResourceGroupConfiguration; + + /** + * The site details + */ + siteReference?: ReferencedResource; + + /** + * The publisher name for the site network service. + */ + @visibility(Lifecycle.Read) + publisherName?: string; + + /** + * The scope of the publisher. + */ + @visibility(Lifecycle.Read) + publisherScope?: PublisherScope; + + /** + * The network service design group name for the site network service. + */ + @visibility(Lifecycle.Read) + networkServiceDesignGroupName?: string; + + /** + * The network service design version for the site network service. + */ + @visibility(Lifecycle.Read) + networkServiceDesignVersionName?: string; + + /** + * The location of the network service design offering. + */ + @visibility(Lifecycle.Read) + networkServiceDesignVersionOfferingLocation?: string; + + /** + * The network service design version resource reference. + */ + networkServiceDesignVersionResourceReference?: DeploymentResourceIdReference; + + /** + * The goal state of the site network service resource. This has references to the configuration group value objects that describe the desired state of the site network service. + */ + #suppress "@azure-tools/typespec-azure-resource-manager/arm-no-record" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + desiredStateConfigurationGroupValueReferences?: Record; + + /** + * The network service design version for the site network service. + */ + @visibility(Lifecycle.Read) + lastStateNetworkServiceDesignVersionName?: string; + + /** + * The last state of the site network service resource. + */ + #suppress "@azure-tools/typespec-azure-resource-manager/arm-no-record" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + @visibility(Lifecycle.Read) + lastStateConfigurationGroupValueReferences?: Record; +} + +/** + * Managed resource group configuration. + */ +model ManagedResourceGroupConfiguration { + /** + * Managed resource group name. + */ + name?: string; + + /** + * Managed resource group location. + */ + location?: string; +} + +/** + * Sku, to be associated with a SiteNetworkService. + */ +model Sku { + /** + * Name of this Sku + */ + name: SkuName; + + /** + * The SKU tier based on the SKU name. + */ + @visibility(Lifecycle.Read) + tier?: SkuTier; +} + +/** + * Cancels an ongoing long-running operation, only Put is supported now + */ +model CancelInformation { + /** + * The ARM id of the siteNetworkService resource. + */ + siteNetworkServiceReference: ReferencedResource; + + /** + * The type of long-running operation the user wants to cancel, such as 'Put'. + */ + longRunningOperation?: LongRunningOperation; +} + +/** + * Reference to an Azure ARC custom location resource. + */ +model CustomLocationResourceId { + /** + * Azure ARC custom location resource ID. + */ + @pattern("^/[sS][uU][bB][sS][cC][rR][iI][pP][tT][iI][oO][nN][sS]/[^/?#]+/[rR][eE][sS][oO][uU][rR][cC][eE][gG][rR][oO][uU][pP][sS]/[^/?#]+/[pP][rR][oO][vV][iI][dD][eE][rR][sS]/[mM][iI][cC][rR][oO][sS][oO][fF][tT]\\.[eE][xX][tT][eE][nN][dD][eE][dD][lL][oO][cC][aA][tT][iI][oO][nN]/[cC][uU][sS][tT][oO][mM][lL][oO][cC][aA][tT][iI][oO][nN][sS]/[^/?#]+$") + id?: string; +} + +/** + * Network function application definition. + */ +model NetworkFunctionApplication { + /** + * The name of the network function application. + */ + name?: string; + + /** + * Depends on profile definition. + */ + dependsOnProfile?: DependsOnProfile; +} + +/** + * Artifact profile properties. + */ +model ArtifactProfile { + /** + * The reference to artifact store. + */ + artifactStore?: ReferencedResource; +} + +/** + * Mapping rule profile properties. + */ +model MappingRuleProfile { + /** + * The application enablement. + */ + applicationEnablement?: ApplicationEnablement; +} + +/** + * The azure container registry scoped token credential definition. + */ +model AzureContainerRegistryScopedTokenCredential + extends ArtifactAccessCredential { + /** + * The username of the credential. + */ + username?: string; + + /** + * The credential value. + */ + #suppress "@azure-tools/typespec-azure-resource-manager/secret-prop" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + acrToken?: string; + + /** + * The Acr server url + */ + acrServerUrl?: string; + + /** + * The repositories that could be accessed using the current credential. + */ + repositories?: string[]; + + /** + * The UTC time when credential will expire. + */ + // FIXME: (utcDateTime) Please double check that this is the correct type for your scenario. + expiry?: utcDateTime; + + /** + * The credential type. + */ + credentialType: "AzureContainerRegistryScopedToken"; +} + +/** + * The azure storage account credential definition. + */ +model AzureStorageAccountCredential extends ArtifactAccessCredential { + /** + * The storage account Id + */ + storageAccountId?: string; + + /** + * The containers that could be accessed using the current credential. + */ + @identifiers(#[]) + containerCredentials?: AzureStorageAccountContainerCredential[]; + + /** + * The UTC time when credential will expire. + */ + // FIXME: (utcDateTime) Please double check that this is the correct type for your scenario. + expiry?: utcDateTime; + + /** + * The credential type. + */ + credentialType: "AzureStorageAccountToken"; +} + +/** + * The azure storage account container credential definition. + */ +model AzureStorageAccountContainerCredential { + /** + * The storage account container name + */ + containerName?: string; + + /** + * The storage account container sas uri + */ + containerSasUri?: string; +} + +/** + * Secret deployment resource id reference. + */ +model SecretDeploymentResourceReference extends DeploymentResourceIdReference { + /** + * Resource ID. + */ + @secret + @visibility(Lifecycle.Create, Lifecycle.Update) + id?: string; + + /** + * The resource reference arm id type. + */ + idType: "Secret"; +} + +/** + * Non secret deployment resource id reference. + */ +model OpenDeploymentResourceReference extends DeploymentResourceIdReference { + /** + * Resource ID. + */ + id?: string; + + /** + * The resource reference arm id type. + */ + idType: "Open"; +} + +/** + * The ConfigurationValue with secrets. + */ +#suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +model ConfigurationValueWithSecrets + extends configurationGroupValuePropertiesFormat { + /** + * Name and value pairs that define the configuration value secrets. It can be a well formed escaped JSON string. + */ + @visibility(Lifecycle.Create, Lifecycle.Update) + @secret + secretConfigurationValue?: string; + + /** + * The value which indicates if configuration values are secrets + */ + configurationType: "Secret"; +} + +/** + * The ConfigurationValue with no secrets. + */ +#suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +model ConfigurationValueWithoutSecrets + extends configurationGroupValuePropertiesFormat { + /** + * Name and value pairs that define the configuration value. It can be a well formed escaped JSON string. + */ + configurationValue?: string; + + /** + * The value which indicates if configuration values are secrets + */ + configurationType: "Open"; +} + +/** + * NetworkFunction with secrets. + */ +model NetworkFunctionValueWithSecrets extends NetworkFunctionPropertiesFormat { + /** + * The JSON-serialized secret deployment values from the user. This contains secrets like passwords,keys etc + */ + @visibility(Lifecycle.Create, Lifecycle.Update) + @secret + secretDeploymentValues?: string; + + /** + * The value which indicates if NF values are secrets + */ + configurationType: "Secret"; +} + +/** + * NetworkFunction with no secrets. + */ +model NetworkFunctionValueWithoutSecrets + extends NetworkFunctionPropertiesFormat { + /** + * The JSON-serialized deployment values from the user. + */ + deploymentValues?: string; + + /** + * The value which indicates if NF values are secrets + */ + configurationType: "Open"; +} + +/** + * Containerized network function network function definition version properties. + */ +model ContainerizedNetworkFunctionDefinitionVersion + extends NetworkFunctionDefinitionVersionPropertiesFormat { + /** + * Containerized network function template. + */ + networkFunctionTemplate?: ContainerizedNetworkFunctionTemplate; + + /** + * The network function type. + */ + networkFunctionType: "ContainerizedNetworkFunction"; +} + +/** + * Containerized network function template. + */ +@discriminator("nfviType") +model ContainerizedNetworkFunctionTemplate { + /** + * The network function type. + */ + @visibility(Lifecycle.Read, Lifecycle.Create) + nfviType: ContainerizedNetworkFunctionNFVIType; +} + +/** + * Virtual network function network function definition version properties. + */ +model VirtualNetworkFunctionNetworkFunctionDefinitionVersion + extends NetworkFunctionDefinitionVersionPropertiesFormat { + /** + * Virtual network function template. + */ + networkFunctionTemplate?: VirtualNetworkFunctionTemplate; + + /** + * The network function type. + */ + networkFunctionType: "VirtualNetworkFunction"; +} + +/** + * Virtual network function template. + */ +@discriminator("nfviType") +model VirtualNetworkFunctionTemplate { + /** + * The network function type. + */ + @visibility(Lifecycle.Read, Lifecycle.Create) + nfviType: VirtualNetworkFunctionNFVIType; +} + +/** + * Azure Arc kubernetes network function template. + */ +model AzureArcKubernetesNetworkFunctionTemplate + extends ContainerizedNetworkFunctionTemplate { + /** + * Network function applications. + */ + @identifiers(#["name"]) + networkFunctionApplications?: AzureArcKubernetesNetworkFunctionApplication[]; + + /** + * The network function type. + */ + nfviType: "AzureArcKubernetes"; +} + +/** + * Azure arc kubernetes network function application definition. + */ +#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +@discriminator("artifactType") +model AzureArcKubernetesNetworkFunctionApplication + extends NetworkFunctionApplication { + /** + * The artifact type. + */ + artifactType: AzureArcKubernetesArtifactType; +} + +/** + * Azure arc kubernetes helm application configurations. + */ +model AzureArcKubernetesHelmApplication + extends AzureArcKubernetesNetworkFunctionApplication { + /** + * Azure arc kubernetes artifact profile. + */ + artifactProfile?: AzureArcKubernetesArtifactProfile; + + /** + * Deploy mapping rule profile. + */ + deployParametersMappingRuleProfile?: AzureArcKubernetesDeployMappingRuleProfile; + + /** + * The artifact type. + */ + artifactType: "HelmPackage"; +} + +/** + * Azure arc kubernetes artifact profile properties. + */ +#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +model AzureArcKubernetesArtifactProfile extends ArtifactProfile { + /** + * Helm artifact profile. + */ + helmArtifactProfile?: HelmArtifactProfile; +} + +/** + * Helm artifact profile. + */ +model HelmArtifactProfile { + /** + * Helm package name. + */ + helmPackageName?: string; + + /** + * Helm package version range. + */ + helmPackageVersionRange?: string; + + /** + * The registry values path list. + */ + registryValuesPaths?: string[]; + + /** + * The image pull secrets values path list. + */ + imagePullSecretsValuesPaths?: string[]; +} + +/** + * Azure arc kubernetes deploy mapping rule profile. + */ +#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +model AzureArcKubernetesDeployMappingRuleProfile extends MappingRuleProfile { + /** + * The helm mapping rule profile. + */ + helmMappingRuleProfile?: HelmMappingRuleProfile; +} + +/** + * Helm mapping rule profile + */ +model HelmMappingRuleProfile { + /** + * Helm release namespace. + */ + releaseNamespace?: string; + + /** + * Helm release name. + */ + releaseName?: string; + + /** + * Helm package version. + */ + helmPackageVersion?: string; + + /** + * Helm release values. + */ + @visibility(Lifecycle.Read, Lifecycle.Create) + values?: string; + + /** + * The helm deployment options + */ + options?: HelmMappingRuleProfileOptions; +} + +/** + * The helm deployment options + */ +model HelmMappingRuleProfileOptions { + /** + * The helm deployment install options + */ + @doc("The helm deployment install options") + installOptions?: HelmInstallOptions; + + /** + * The helm deployment upgrade options + */ + @doc("The helm deployment upgrade options") + upgradeOptions?: HelmUpgradeOptions; +} + +/** + * The helm deployment install options + */ +model HelmInstallOptions { + /** + * The helm deployment atomic options + */ + atomic?: string; + + /** + * The helm deployment wait options + */ + wait?: string; + + /** + * The helm deployment timeout options + */ + timeout?: string; +} + +/** + * The helm deployment install options + */ +model HelmUpgradeOptions { + /** + * The helm deployment atomic options + */ + atomic?: string; + + /** + * The helm deployment wait options + */ + wait?: string; + + /** + * The helm deployment timeout options + */ + timeout?: string; +} + +/** + * Azure virtual network function template. + */ +model AzureCoreNetworkFunctionTemplate extends VirtualNetworkFunctionTemplate { + /** + * Network function applications. + */ + @identifiers(#["name"]) + networkFunctionApplications?: AzureCoreNetworkFunctionApplication[]; + + /** + * The network function type. + */ + nfviType: "AzureCore"; +} + +/** + * Azure virtual network function application definition. + */ +#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +@discriminator("artifactType") +model AzureCoreNetworkFunctionApplication extends NetworkFunctionApplication { + /** + * The artifact type. + */ + artifactType: AzureCoreArtifactType; +} + +/** + * Azure Operator Distributed Services network function template. + */ +model AzureOperatorNexusNetworkFunctionTemplate + extends VirtualNetworkFunctionTemplate { + /** + * Network function applications. + */ + @identifiers(#["name"]) + networkFunctionApplications?: AzureOperatorNexusNetworkFunctionApplication[]; + + /** + * The network function type. + */ + nfviType: "AzureOperatorNexus"; +} + +/** + * Azure Operator Distributed Services network function application definition. + */ +#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +@discriminator("artifactType") +model AzureOperatorNexusNetworkFunctionApplication + extends NetworkFunctionApplication { + /** + * The artifact type. + */ + artifactType: AzureOperatorNexusArtifactType; +} + +/** + * Azure core network function vhd application definition. + */ +model AzureCoreNetworkFunctionVhdApplication + extends AzureCoreNetworkFunctionApplication { + /** + * Azure vhd image artifact profile. + */ + artifactProfile?: AzureCoreVhdImageArtifactProfile; + + /** + * Deploy mapping rule profile. + */ + deployParametersMappingRuleProfile?: AzureCoreVhdImageDeployMappingRuleProfile; + + /** + * The artifact type. + */ + artifactType: "VhdImageFile"; +} + +/** + * Azure vhd artifact profile properties. + */ +#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +model AzureCoreVhdImageArtifactProfile extends ArtifactProfile { + /** + * Vhd artifact profile. + */ + vhdArtifactProfile?: VhdImageArtifactProfile; +} + +/** + * Vhd artifact profile. + */ +model VhdImageArtifactProfile { + /** + * Vhd name. + */ + vhdName?: string; + + /** + * Vhd version. + */ + vhdVersion?: string; +} + +/** + * Azure vhd deploy mapping rule profile. + */ +#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +model AzureCoreVhdImageDeployMappingRuleProfile extends MappingRuleProfile { + /** + * The vhd mapping rule profile. + */ + vhdImageMappingRuleProfile?: VhdImageMappingRuleProfile; +} + +/** + * Vhd mapping rule profile + */ +model VhdImageMappingRuleProfile { + /** + * List of values. + */ + userConfiguration?: string; +} + +/** + * Azure core network function Template application definition. + */ +model AzureCoreNetworkFunctionArmTemplateApplication + extends AzureCoreNetworkFunctionApplication { + /** + * Azure template artifact profile. + */ + artifactProfile?: AzureCoreArmTemplateArtifactProfile; + + /** + * Deploy mapping rule profile. + */ + deployParametersMappingRuleProfile?: AzureCoreArmTemplateDeployMappingRuleProfile; + + /** + * The artifact type. + */ + artifactType: "ArmTemplate"; +} + +/** + * Azure template artifact profile properties. + */ +#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +model AzureCoreArmTemplateArtifactProfile extends ArtifactProfile { + /** + * Template artifact profile. + */ + templateArtifactProfile?: ArmTemplateArtifactProfile; +} + +/** + * Template artifact profile. + */ +model ArmTemplateArtifactProfile { + /** + * Template name. + */ + templateName?: string; + + /** + * Template version. + */ + templateVersion?: string; +} + +/** + * Azure template deploy mapping rule profile. + */ +#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +model AzureCoreArmTemplateDeployMappingRuleProfile extends MappingRuleProfile { + /** + * The template mapping rule profile. + */ + templateMappingRuleProfile?: ArmTemplateMappingRuleProfile; +} + +/** + * Template mapping rule profile + */ +model ArmTemplateMappingRuleProfile { + /** + * List of template parameters. + */ + templateParameters?: string; +} + +/** + * Azure Operator Distributed Services network function image application definition. + */ +model AzureOperatorNexusNetworkFunctionImageApplication + extends AzureOperatorNexusNetworkFunctionApplication { + /** + * Azure Operator Distributed Services image artifact profile. + */ + artifactProfile?: AzureOperatorNexusImageArtifactProfile; + + /** + * Deploy mapping rule profile. + */ + deployParametersMappingRuleProfile?: AzureOperatorNexusImageDeployMappingRuleProfile; + + /** + * The artifact type. + */ + artifactType: "ImageFile"; +} + +/** + * Azure Operator Distributed Services image artifact profile properties. + */ +#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +model AzureOperatorNexusImageArtifactProfile extends ArtifactProfile { + /** + * Image artifact profile. + */ + imageArtifactProfile?: ImageArtifactProfile; +} + +/** + * Image artifact profile. + */ +model ImageArtifactProfile { + /** + * Image name. + */ + imageName?: string; + + /** + * Image version. + */ + imageVersion?: string; +} + +/** + * Azure Operator Distributed Services image deploy mapping rule profile. + */ +#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +model AzureOperatorNexusImageDeployMappingRuleProfile + extends MappingRuleProfile { + /** + * The vhd mapping rule profile. + */ + imageMappingRuleProfile?: ImageMappingRuleProfile; +} + +/** + * Image mapping rule profile + */ +model ImageMappingRuleProfile { + /** + * List of values. + */ + userConfiguration?: string; +} + +/** + * Azure Operator Distributed Services network function Template application definition. + */ +model AzureOperatorNexusNetworkFunctionArmTemplateApplication + extends AzureOperatorNexusNetworkFunctionApplication { + /** + * Azure Operator Distributed Services Template artifact profile. + */ + artifactProfile?: AzureOperatorNexusArmTemplateArtifactProfile; + + /** + * Deploy mapping rule profile. + */ + deployParametersMappingRuleProfile?: AzureOperatorNexusArmTemplateDeployMappingRuleProfile; + + /** + * The artifact type. + */ + artifactType: "ArmTemplate"; +} + +/** + * Azure Operator Distributed Services vhd artifact profile properties. + */ +#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +model AzureOperatorNexusArmTemplateArtifactProfile extends ArtifactProfile { + /** + * Template artifact profile. + */ + templateArtifactProfile?: ArmTemplateArtifactProfile; +} + +/** + * Azure Operator Distributed Services template deploy mapping rule profile. + */ +#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +model AzureOperatorNexusArmTemplateDeployMappingRuleProfile + extends MappingRuleProfile { + /** + * The template mapping rule profile. + */ + templateMappingRuleProfile?: ArmTemplateMappingRuleProfile; +} + +/** + * The arm resource definition resource element template details. + */ +model ArmResourceDefinitionResourceElementTemplateDetails + extends ResourceElementTemplate { + /** + * The resource element template type. + */ + configuration?: ArmResourceDefinitionResourceElementTemplate; + + /** + * The resource element template type. + */ + type: "ArmResourceDefinition"; +} + +/** + * The arm template RE. + */ +model ArmResourceDefinitionResourceElementTemplate { + /** + * The template type. + */ + templateType?: TemplateType; + + /** + * Name and value pairs that define the parameter values. It can be a well formed escaped JSON string. + */ + parameterValues?: string; + + /** + * Artifact profile properties. + */ + artifactProfile?: NSDArtifactProfile; +} + +/** + * Artifact profile properties. + */ +#suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +model NSDArtifactProfile { + /** + * The artifact store resource id + */ + artifactStoreReference?: ReferencedResource; + + /** + * Artifact name. + */ + artifactName?: string; + + /** + * Artifact version. + */ + artifactVersion?: string; +} + +/** + * The network function definition resource element template details. + */ +model NetworkFunctionDefinitionResourceElementTemplateDetails + extends ResourceElementTemplate { + /** + * The resource element template type. + */ + configuration?: ArmResourceDefinitionResourceElementTemplate; + + /** + * The resource element template type. + */ + type: "NetworkFunctionDefinition"; +} + +/** + * Proxy Artifact overview properties. + */ +#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-provisioning-state" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +model ProxyArtifactOverviewPropertiesFormat { + /** + * The proxy artifact overview properties. + */ + @identifiers(#[]) + artifactVersions?: ProxyArtifactOverviewPropertiesValue[]; +} + +/** + * The Azure Core NFVI detail. + */ +#suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +model AzureCoreNFVIDetails extends NFVIs { + /** + * Location of the Azure core. + */ + location?: string; + + /** + * The NFVI type. + */ + nfviType: "AzureCore"; +} + +/** + * The AzureArcK8sCluster NFVI detail. + */ +#suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +model AzureArcK8sClusterNFVIDetails extends NFVIs { + /** + * The reference to the custom location. + */ + customLocationReference?: ReferencedResource; + + /** + * The NFVI type. + */ + nfviType: "AzureArcKubernetes"; +} + +/** + * The AzureOperatorNexusCluster NFVI detail. + */ +#suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +model AzureOperatorNexusClusterNFVIDetails extends NFVIs { + /** + * The reference to the custom location. + */ + customLocationReference?: ReferencedResource; + + /** + * The NFVI type. + */ + nfviType: "AzureOperatorNexus"; +} + +/** + * The description for page model + */ +model ProxyArtifactVersionsOverviewListResult { + /** + * The description for value property + */ + @pageItems + value: ProxyArtifactVersionsListOverview[]; + + /** + * The description for nextLink property + */ + @nextLink + nextLink?: string; +} + +/** + * The description for page model + */ +model ProxyArtifactOverviewListResult { + /** + * The description for value property + */ + @pageItems + value: ProxyArtifactListOverview[]; + + /** + * The description for nextLink property + */ + @nextLink + nextLink?: string; +} diff --git a/packages/typespec-test/test/HybridNetwork.Management/spec/routes.tsp b/packages/typespec-test/test/HybridNetwork.Management/spec/routes.tsp new file mode 100644 index 0000000000..d06d27962f --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/spec/routes.tsp @@ -0,0 +1,36 @@ +// FIXME: Operations in this file are not detected as a resource operation, please confirm the conversion result manually + +import "@azure-tools/typespec-azure-core"; +import "@typespec/rest"; +import "./models.tsp"; +import "@azure-tools/typespec-azure-resource-manager"; +import "@typespec/openapi"; + +using TypeSpec.Rest; +using TypeSpec.Http; +using Azure.ResourceManager; +using TypeSpec.OpenAPI; + +namespace Microsoft.HybridNetwork; + +@armResourceOperations +interface SiteNetworkServicesOperationGroup { + /** + * Cancels an ongoing long-running PUT operation for the specified Site Network Service resource. Other operations are not supported for cancellation at this time. + */ + @action("cancelSiteNetworkServiceOperation") + cancelOperation is ArmProviderActionAsync< + Request = CancelInformation, + Response = ArmAcceptedLroResponse< + "Accepted. The header contains Location URL to check the status of the asynchronous operation", + ArmLroLocationHeader + >, + Scope = SubscriptionActionScope, + Parameters = {}, + LroHeaders = ArmLroLocationHeader + >; +} + +@@doc(SiteNetworkServicesOperationGroup.cancelOperation::parameters.body, + "The SiteNetworkService detail and an optional operation which defaults to 'Put'." +); diff --git a/packages/typespec-test/test/HybridNetwork.Management/tspconfig.yaml b/packages/typespec-test/test/HybridNetwork.Management/tspconfig.yaml new file mode 100644 index 0000000000..c53f9526b1 --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/tspconfig.yaml @@ -0,0 +1,10 @@ +emit: ["@azure-tools/typespec-ts"] +options: + "@azure-tools/typespec-ts": + generate-samples: true + azure-sdk-for-js: false + experimental-extensible-enums: true + emitter-output-dir: "{project-root}/generated/typespec-ts" + compatibility-lro: true + package-details: + name: "@azure/arm-hybridnetwork" From 24d4cc163e63359d1234db6182b6e9a73a06a680 Mon Sep 17 00:00:00 2001 From: "Jiao Di (MSFT)" Date: Mon, 2 Feb 2026 11:54:46 +0800 Subject: [PATCH 03/10] update --- .../generated/typespec-ts/package.json | 40 +++++++++---- .../operations.ts | 15 +++-- .../operations.ts | 4 +- .../api/globalOperationGroup/operations.ts | 2 +- .../typespec-ts/src/api/operations.ts | 36 ++++++------ .../src/api/operations/operations.ts | 4 +- .../api/providerOperationGroup/operations.ts | 24 ++++---- .../operations.ts | 8 +-- .../staticSitesOperationGroup/operations.ts | 2 +- .../src/api/webSiteManagementContext.ts | 24 ++------ .../src/static-helpers/pagingHelpers.ts | 36 ++++++++++-- .../src/static-helpers/pollingHelpers.ts | 27 ++++++++- .../generated/typespec-ts/package.json | 56 ++++++++++++------- .../review/arm-hybridnetwork.api.md | 4 ++ .../src/api/artifactManifests/operations.ts | 19 ++++--- .../src/api/artifactStores/operations.ts | 36 +++++++----- .../src/api/components/operations.ts | 6 +- .../configurationGroupSchemas/operations.ts | 17 +++--- .../configurationGroupValues/operations.ts | 18 +++--- .../src/api/hybridNetworkManagementContext.ts | 24 ++------ .../operations.ts | 14 +++-- .../operations.ts | 17 +++--- .../src/api/networkFunctions/operations.ts | 21 ++++--- .../networkServiceDesignGroups/operations.ts | 14 +++-- .../operations.ts | 17 +++--- .../src/api/operations/operations.ts | 4 +- .../src/api/proxyArtifact/operations.ts | 11 ++-- .../src/api/publishers/operations.ts | 18 +++--- .../src/api/siteNetworkServices/operations.ts | 21 ++++--- .../typespec-ts/src/api/sites/operations.ts | 18 +++--- .../typespec-ts/src/restorePollerHelpers.ts | 7 +++ .../src/static-helpers/pagingHelpers.ts | 36 ++++++++++-- .../src/static-helpers/pollingHelpers.ts | 27 ++++++++- .../review/arm-networkanalytics.api.md | 24 +------- .../sdk/test/arm-test/src/index.ts | 1 - .../typespec-ts/review/authoring.api.md | 2 +- .../review/confidential-ledger.api.md | 2 +- .../review/contosowidgetmanager-rest.api.md | 2 +- .../typespec-ts/review/customWrapper.api.md | 2 +- .../typespec-ts/review/ai-face-rest.api.md | 2 +- .../health-insights-clinicalmatching.api.md | 2 +- .../typespec-ts/review/load-testing.api.md | 2 +- .../typespec-ts/review/openai.api.md | 2 +- .../cognitiveservices-translator.api.md | 2 +- 44 files changed, 399 insertions(+), 271 deletions(-) diff --git a/packages/typespec-test/test/AppService/generated/typespec-ts/package.json b/packages/typespec-test/test/AppService/generated/typespec-ts/package.json index da4349aedb..fced32d193 100644 --- a/packages/typespec-test/test/AppService/generated/typespec-ts/package.json +++ b/packages/typespec-test/test/AppService/generated/typespec-ts/package.json @@ -12,26 +12,44 @@ "./package.json": "./package.json", ".": "./src/index.ts", "./api": "./src/api/index.ts", - "./api/staticSitesOperationGroup": "src/api/staticSitesOperationGroup/index.ts", - "./api/getUsagesInLocationOperationGroup": "src/api/getUsagesInLocationOperationGroup/index.ts", - "./api/recommendationsOperationGroup": "src/api/recommendationsOperationGroup/index.ts", - "./api/providerOperationGroup": "src/api/providerOperationGroup/index.ts", - "./api/globalOperationGroup": "src/api/globalOperationGroup/index.ts", - "./api/appServiceEnvironmentResources": "src/api/appServiceEnvironmentResources/index.ts", - "./api/operations": "src/api/operations/index.ts", + "./api/staticSitesOperationGroup": "./src/api/staticSitesOperationGroup/index.ts", + "./api/getUsagesInLocationOperationGroup": "./src/api/getUsagesInLocationOperationGroup/index.ts", + "./api/recommendationsOperationGroup": "./src/api/recommendationsOperationGroup/index.ts", + "./api/providerOperationGroup": "./src/api/providerOperationGroup/index.ts", + "./api/globalOperationGroup": "./src/api/globalOperationGroup/index.ts", + "./api/appServiceEnvironmentResources": "./src/api/appServiceEnvironmentResources/index.ts", + "./api/operations": "./src/api/operations/index.ts", "./models": "./src/models/index.ts" }, - "dialects": ["esm", "commonjs"], - "esmDialects": ["browser", "react-native"], + "dialects": [ + "esm", + "commonjs" + ], + "esmDialects": [ + "browser", + "react-native" + ], "selfLink": false }, "type": "module", "browser": "./dist/browser/index.js", "react-native": "./dist/react-native/index.js", - "keywords": ["node", "azure", "cloud", "typescript", "browser", "isomorphic"], + "keywords": [ + "node", + "azure", + "cloud", + "typescript", + "browser", + "isomorphic" + ], "author": "Microsoft Corporation", "license": "MIT", - "files": ["dist/", "!dist/**/*.d.*ts.map", "README.md", "LICENSE"], + "files": [ + "dist/", + "!dist/**/*.d.*ts.map", + "README.md", + "LICENSE" + ], "dependencies": { "@azure/core-util": "^1.9.2", "@azure-rest/core-client": "^2.3.1", diff --git a/packages/typespec-test/test/AppService/generated/typespec-ts/src/api/appServiceEnvironmentResources/operations.ts b/packages/typespec-test/test/AppService/generated/typespec-ts/src/api/appServiceEnvironmentResources/operations.ts index 4d13949dba..d52a9f68ff 100644 --- a/packages/typespec-test/test/AppService/generated/typespec-ts/src/api/appServiceEnvironmentResources/operations.ts +++ b/packages/typespec-test/test/AppService/generated/typespec-ts/src/api/appServiceEnvironmentResources/operations.ts @@ -41,7 +41,7 @@ export function _suspendSend( subscriptionId: context.subscriptionId, resourceGroupName: resourceGroupName, name: name, - "api%2Dversion": context.apiVersion, + "api%2Dversion": context.apiVersion ?? "2025-05-01", }, { allowReserved: options?.requestOptions?.skipUrlEncoding, @@ -84,6 +84,7 @@ export function suspend( abortSignal: options?.abortSignal, getInitialResponse: () => _suspendSend(context, resourceGroupName, name, options), resourceLocationConfig: "location", + apiVersion: context.apiVersion ?? "2025-05-01", }, ) as PollerLike, PathUncheckedResponse>; @@ -92,7 +93,7 @@ export function suspend( async () => await initialPagingPoller, _suspendDeserialize, ["200", "202", "201"], - { itemName: "value", nextLinkName: "nextLink" }, + { itemName: "value", nextLinkName: "nextLink", apiVersion: context.apiVersion ?? "2025-05-01" }, ); } @@ -108,7 +109,7 @@ export function _resumeSend( subscriptionId: context.subscriptionId, resourceGroupName: resourceGroupName, name: name, - "api%2Dversion": context.apiVersion, + "api%2Dversion": context.apiVersion ?? "2025-05-01", }, { allowReserved: options?.requestOptions?.skipUrlEncoding, @@ -151,6 +152,7 @@ export function resume( abortSignal: options?.abortSignal, getInitialResponse: () => _resumeSend(context, resourceGroupName, name, options), resourceLocationConfig: "location", + apiVersion: context.apiVersion ?? "2025-05-01", }, ) as PollerLike, PathUncheckedResponse>; @@ -159,7 +161,7 @@ export function resume( async () => await initialPagingPoller, _resumeDeserialize, ["200", "202", "201"], - { itemName: "value", nextLinkName: "nextLink" }, + { itemName: "value", nextLinkName: "nextLink", apiVersion: context.apiVersion ?? "2025-05-01" }, ); } @@ -176,7 +178,7 @@ export function _changeVnetSend( subscriptionId: context.subscriptionId, resourceGroupName: resourceGroupName, name: name, - "api%2Dversion": context.apiVersion, + "api%2Dversion": context.apiVersion ?? "2025-05-01", }, { allowReserved: options?.requestOptions?.skipUrlEncoding, @@ -222,6 +224,7 @@ export function changeVnet( abortSignal: options?.abortSignal, getInitialResponse: () => _changeVnetSend(context, resourceGroupName, name, body, options), resourceLocationConfig: "location", + apiVersion: context.apiVersion ?? "2025-05-01", }, ) as PollerLike, PathUncheckedResponse>; @@ -230,6 +233,6 @@ export function changeVnet( async () => await initialPagingPoller, _changeVnetDeserialize, ["200", "202", "201"], - { itemName: "value", nextLinkName: "nextLink" }, + { itemName: "value", nextLinkName: "nextLink", apiVersion: context.apiVersion ?? "2025-05-01" }, ); } diff --git a/packages/typespec-test/test/AppService/generated/typespec-ts/src/api/getUsagesInLocationOperationGroup/operations.ts b/packages/typespec-test/test/AppService/generated/typespec-ts/src/api/getUsagesInLocationOperationGroup/operations.ts index a7cb7c64f1..9b2dd702a6 100644 --- a/packages/typespec-test/test/AppService/generated/typespec-ts/src/api/getUsagesInLocationOperationGroup/operations.ts +++ b/packages/typespec-test/test/AppService/generated/typespec-ts/src/api/getUsagesInLocationOperationGroup/operations.ts @@ -31,7 +31,7 @@ export function _listSend( { subscriptionId: context.subscriptionId, location: location, - "api%2Dversion": context.apiVersion, + "api%2Dversion": context.apiVersion ?? "2025-05-01", }, { allowReserved: options?.requestOptions?.skipUrlEncoding, @@ -69,6 +69,6 @@ export function list( () => _listSend(context, location, options), _listDeserialize, ["200"], - { itemName: "value", nextLinkName: "nextLink" }, + { itemName: "value", nextLinkName: "nextLink", apiVersion: context.apiVersion ?? "2025-05-01" }, ); } diff --git a/packages/typespec-test/test/AppService/generated/typespec-ts/src/api/globalOperationGroup/operations.ts b/packages/typespec-test/test/AppService/generated/typespec-ts/src/api/globalOperationGroup/operations.ts index 5931a4541e..23f4bb99fa 100644 --- a/packages/typespec-test/test/AppService/generated/typespec-ts/src/api/globalOperationGroup/operations.ts +++ b/packages/typespec-test/test/AppService/generated/typespec-ts/src/api/globalOperationGroup/operations.ts @@ -26,7 +26,7 @@ export function _getSubscriptionOperationWithAsyncResponseSend( location: location, operationId: operationId, subscriptionId: context.subscriptionId, - "api%2Dversion": context.apiVersion, + "api%2Dversion": context.apiVersion ?? "2025-05-01", }, { allowReserved: options?.requestOptions?.skipUrlEncoding, diff --git a/packages/typespec-test/test/AppService/generated/typespec-ts/src/api/operations.ts b/packages/typespec-test/test/AppService/generated/typespec-ts/src/api/operations.ts index 55cd9e4bd7..18305914c8 100644 --- a/packages/typespec-test/test/AppService/generated/typespec-ts/src/api/operations.ts +++ b/packages/typespec-test/test/AppService/generated/typespec-ts/src/api/operations.ts @@ -80,7 +80,7 @@ export function _moveSend( { resourceGroupName: resourceGroupName, subscriptionId: context.subscriptionId, - "api%2Dversion": context.apiVersion, + "api%2Dversion": context.apiVersion ?? "2025-05-01", }, { allowReserved: options?.requestOptions?.skipUrlEncoding, @@ -126,7 +126,7 @@ export function _verifyHostingEnvironmentVnetSend( "/subscriptions/{subscriptionId}/providers/Microsoft.Web/verifyHostingEnvironmentVnet{?api%2Dversion}", { subscriptionId: context.subscriptionId, - "api%2Dversion": context.apiVersion, + "api%2Dversion": context.apiVersion ?? "2025-05-01", }, { allowReserved: options?.requestOptions?.skipUrlEncoding, @@ -173,7 +173,7 @@ export function _listSkusSend( "/subscriptions/{subscriptionId}/providers/Microsoft.Web/skus{?api%2Dversion}", { subscriptionId: context.subscriptionId, - "api%2Dversion": context.apiVersion, + "api%2Dversion": context.apiVersion ?? "2025-05-01", }, { allowReserved: options?.requestOptions?.skipUrlEncoding, @@ -215,7 +215,7 @@ export function _listPremierAddOnOffersSend( "/subscriptions/{subscriptionId}/providers/Microsoft.Web/premieraddonoffers{?api%2Dversion}", { subscriptionId: context.subscriptionId, - "api%2Dversion": context.apiVersion, + "api%2Dversion": context.apiVersion ?? "2025-05-01", }, { allowReserved: options?.requestOptions?.skipUrlEncoding, @@ -252,7 +252,7 @@ export function listPremierAddOnOffers( () => _listPremierAddOnOffersSend(context, options), _listPremierAddOnOffersDeserialize, ["200"], - { itemName: "value", nextLinkName: "nextLink" }, + { itemName: "value", nextLinkName: "nextLink", apiVersion: context.apiVersion ?? "2025-05-01" }, ); } @@ -267,7 +267,7 @@ export function _regionalCheckNameAvailabilitySend( { subscriptionId: context.subscriptionId, location: location, - "api%2Dversion": context.apiVersion, + "api%2Dversion": context.apiVersion ?? "2025-05-01", }, { allowReserved: options?.requestOptions?.skipUrlEncoding, @@ -315,7 +315,7 @@ export function _listGeoRegionsSend( "/subscriptions/{subscriptionId}/providers/Microsoft.Web/geoRegions{?api%2Dversion,sku,linuxWorkersEnabled,xenonWorkersEnabled,linuxDynamicWorkersEnabled,customModeWorkersEnabled}", { subscriptionId: context.subscriptionId, - "api%2Dversion": context.apiVersion, + "api%2Dversion": context.apiVersion ?? "2025-05-01", sku: options?.sku, linuxWorkersEnabled: options?.linuxWorkersEnabled, xenonWorkersEnabled: options?.xenonWorkersEnabled, @@ -357,7 +357,7 @@ export function listGeoRegions( () => _listGeoRegionsSend(context, options), _listGeoRegionsDeserialize, ["200"], - { itemName: "value", nextLinkName: "nextLink" }, + { itemName: "value", nextLinkName: "nextLink", apiVersion: context.apiVersion ?? "2025-05-01" }, ); } @@ -369,7 +369,7 @@ export function _listCustomHostNameSitesSend( "/subscriptions/{subscriptionId}/providers/Microsoft.Web/customhostnameSites{?api%2Dversion,hostname}", { subscriptionId: context.subscriptionId, - "api%2Dversion": context.apiVersion, + "api%2Dversion": context.apiVersion ?? "2025-05-01", hostname: options?.hostname, }, { @@ -407,7 +407,7 @@ export function listCustomHostNameSites( () => _listCustomHostNameSitesSend(context, options), _listCustomHostNameSitesDeserialize, ["200"], - { itemName: "value", nextLinkName: "nextLink" }, + { itemName: "value", nextLinkName: "nextLink", apiVersion: context.apiVersion ?? "2025-05-01" }, ); } @@ -420,7 +420,7 @@ export function _checkNameAvailabilitySend( "/subscriptions/{subscriptionId}/providers/Microsoft.Web/checknameavailability{?api%2Dversion}", { subscriptionId: context.subscriptionId, - "api%2Dversion": context.apiVersion, + "api%2Dversion": context.apiVersion ?? "2025-05-01", }, { allowReserved: options?.requestOptions?.skipUrlEncoding, @@ -467,7 +467,7 @@ export function _listBillingMetersSend( "/subscriptions/{subscriptionId}/providers/Microsoft.Web/billingMeters{?api%2Dversion,billingLocation,osType}", { subscriptionId: context.subscriptionId, - "api%2Dversion": context.apiVersion, + "api%2Dversion": context.apiVersion ?? "2025-05-01", billingLocation: options?.billingLocation, osType: options?.osType, }, @@ -506,7 +506,7 @@ export function listBillingMeters( () => _listBillingMetersSend(context, options), _listBillingMetersDeserialize, ["200"], - { itemName: "value", nextLinkName: "nextLink" }, + { itemName: "value", nextLinkName: "nextLink", apiVersion: context.apiVersion ?? "2025-05-01" }, ); } @@ -518,7 +518,7 @@ export function _listAseRegionsSend( "/subscriptions/{subscriptionId}/providers/Microsoft.Web/aseRegions{?api%2Dversion}", { subscriptionId: context.subscriptionId, - "api%2Dversion": context.apiVersion, + "api%2Dversion": context.apiVersion ?? "2025-05-01", }, { allowReserved: options?.requestOptions?.skipUrlEncoding, @@ -555,7 +555,7 @@ export function listAseRegions( () => _listAseRegionsSend(context, options), _listAseRegionsDeserialize, ["200"], - { itemName: "value", nextLinkName: "nextLink" }, + { itemName: "value", nextLinkName: "nextLink", apiVersion: context.apiVersion ?? "2025-05-01" }, ); } @@ -567,7 +567,7 @@ export function _getSubscriptionDeploymentLocationsSend( "/subscriptions/{subscriptionId}/providers/Microsoft.Web/deploymentLocations{?api%2Dversion}", { subscriptionId: context.subscriptionId, - "api%2Dversion": context.apiVersion, + "api%2Dversion": context.apiVersion ?? "2025-05-01", }, { allowReserved: options?.requestOptions?.skipUrlEncoding, @@ -614,7 +614,7 @@ export function _validateSend( { resourceGroupName: resourceGroupName, subscriptionId: context.subscriptionId, - "api%2Dversion": context.apiVersion, + "api%2Dversion": context.apiVersion ?? "2025-05-01", }, { allowReserved: options?.requestOptions?.skipUrlEncoding, @@ -665,7 +665,7 @@ export function _validateMoveSend( { resourceGroupName: resourceGroupName, subscriptionId: context.subscriptionId, - "api%2Dversion": context.apiVersion, + "api%2Dversion": context.apiVersion ?? "2025-05-01", }, { allowReserved: options?.requestOptions?.skipUrlEncoding, diff --git a/packages/typespec-test/test/AppService/generated/typespec-ts/src/api/operations/operations.ts b/packages/typespec-test/test/AppService/generated/typespec-ts/src/api/operations/operations.ts index 292d6d6f55..b4b3d8efa9 100644 --- a/packages/typespec-test/test/AppService/generated/typespec-ts/src/api/operations/operations.ts +++ b/packages/typespec-test/test/AppService/generated/typespec-ts/src/api/operations/operations.ts @@ -28,7 +28,7 @@ export function _listSend( const path = expandUrlTemplate( "/providers/Microsoft.Web/operations{?api%2Dversion}", { - "api%2Dversion": context.apiVersion, + "api%2Dversion": context.apiVersion ?? "2025-05-01", }, { allowReserved: options?.requestOptions?.skipUrlEncoding, @@ -65,6 +65,6 @@ export function list( () => _listSend(context, options), _listDeserialize, ["200"], - { itemName: "value", nextLinkName: "nextLink" }, + { itemName: "value", nextLinkName: "nextLink", apiVersion: context.apiVersion ?? "2025-05-01" }, ); } diff --git a/packages/typespec-test/test/AppService/generated/typespec-ts/src/api/providerOperationGroup/operations.ts b/packages/typespec-test/test/AppService/generated/typespec-ts/src/api/providerOperationGroup/operations.ts index 93d9c04aca..0e8f6f7533 100644 --- a/packages/typespec-test/test/AppService/generated/typespec-ts/src/api/providerOperationGroup/operations.ts +++ b/packages/typespec-test/test/AppService/generated/typespec-ts/src/api/providerOperationGroup/operations.ts @@ -42,7 +42,7 @@ export function _getAvailableStacksOnPremSend( "/subscriptions/{subscriptionId}/providers/Microsoft.Web/availableStacks{?api%2Dversion,osTypeSelected}", { subscriptionId: context.subscriptionId, - "api%2Dversion": context.apiVersion, + "api%2Dversion": context.apiVersion ?? "2025-05-01", osTypeSelected: options?.osTypeSelected, }, { @@ -80,7 +80,7 @@ export function getAvailableStacksOnPrem( () => _getAvailableStacksOnPremSend(context, options), _getAvailableStacksOnPremDeserialize, ["200"], - { itemName: "value", nextLinkName: "nextLink" }, + { itemName: "value", nextLinkName: "nextLink", apiVersion: context.apiVersion ?? "2025-05-01" }, ); } @@ -91,7 +91,7 @@ export function _getWebAppStacksSend( const path = expandUrlTemplate( "/providers/Microsoft.Web/webAppStacks{?api%2Dversion,stackOsType}", { - "api%2Dversion": context.apiVersion, + "api%2Dversion": context.apiVersion ?? "2025-05-01", stackOsType: options?.stackOsType, }, { @@ -129,7 +129,7 @@ export function getWebAppStacks( () => _getWebAppStacksSend(context, options), _getWebAppStacksDeserialize, ["200"], - { itemName: "value", nextLinkName: "nextLink" }, + { itemName: "value", nextLinkName: "nextLink", apiVersion: context.apiVersion ?? "2025-05-01" }, ); } @@ -142,7 +142,7 @@ export function _getWebAppStacksForLocationSend( "/providers/Microsoft.Web/locations/{location}/webAppStacks{?api%2Dversion,stackOsType}", { location: location, - "api%2Dversion": context.apiVersion, + "api%2Dversion": context.apiVersion ?? "2025-05-01", stackOsType: options?.stackOsType, }, { @@ -181,7 +181,7 @@ export function getWebAppStacksForLocation( () => _getWebAppStacksForLocationSend(context, location, options), _getWebAppStacksForLocationDeserialize, ["200"], - { itemName: "value", nextLinkName: "nextLink" }, + { itemName: "value", nextLinkName: "nextLink", apiVersion: context.apiVersion ?? "2025-05-01" }, ); } @@ -196,7 +196,7 @@ export function _getFunctionAppStacksForLocationSend( "/providers/Microsoft.Web/locations/{location}/functionAppStacks{?api%2Dversion,stackOsType}", { location: location, - "api%2Dversion": context.apiVersion, + "api%2Dversion": context.apiVersion ?? "2025-05-01", stackOsType: options?.stackOsType, }, { @@ -237,7 +237,7 @@ export function getFunctionAppStacksForLocation( () => _getFunctionAppStacksForLocationSend(context, location, options), _getFunctionAppStacksForLocationDeserialize, ["200"], - { itemName: "value", nextLinkName: "nextLink" }, + { itemName: "value", nextLinkName: "nextLink", apiVersion: context.apiVersion ?? "2025-05-01" }, ); } @@ -248,7 +248,7 @@ export function _getFunctionAppStacksSend( const path = expandUrlTemplate( "/providers/Microsoft.Web/functionAppStacks{?api%2Dversion,stackOsType}", { - "api%2Dversion": context.apiVersion, + "api%2Dversion": context.apiVersion ?? "2025-05-01", stackOsType: options?.stackOsType, }, { @@ -286,7 +286,7 @@ export function getFunctionAppStacks( () => _getFunctionAppStacksSend(context, options), _getFunctionAppStacksDeserialize, ["200"], - { itemName: "value", nextLinkName: "nextLink" }, + { itemName: "value", nextLinkName: "nextLink", apiVersion: context.apiVersion ?? "2025-05-01" }, ); } @@ -297,7 +297,7 @@ export function _getAvailableStacksSend( const path = expandUrlTemplate( "/providers/Microsoft.Web/availableStacks{?api%2Dversion,osTypeSelected}", { - "api%2Dversion": context.apiVersion, + "api%2Dversion": context.apiVersion ?? "2025-05-01", osTypeSelected: options?.osTypeSelected, }, { @@ -335,6 +335,6 @@ export function getAvailableStacks( () => _getAvailableStacksSend(context, options), _getAvailableStacksDeserialize, ["200"], - { itemName: "value", nextLinkName: "nextLink" }, + { itemName: "value", nextLinkName: "nextLink", apiVersion: context.apiVersion ?? "2025-05-01" }, ); } diff --git a/packages/typespec-test/test/AppService/generated/typespec-ts/src/api/recommendationsOperationGroup/operations.ts b/packages/typespec-test/test/AppService/generated/typespec-ts/src/api/recommendationsOperationGroup/operations.ts index 06eb45b7b1..b8557dfeb3 100644 --- a/packages/typespec-test/test/AppService/generated/typespec-ts/src/api/recommendationsOperationGroup/operations.ts +++ b/packages/typespec-test/test/AppService/generated/typespec-ts/src/api/recommendationsOperationGroup/operations.ts @@ -37,7 +37,7 @@ export function _disableRecommendationForSubscriptionSend( { subscriptionId: context.subscriptionId, name: name, - "api%2Dversion": context.apiVersion, + "api%2Dversion": context.apiVersion ?? "2025-05-01", }, { allowReserved: options?.requestOptions?.skipUrlEncoding, @@ -79,7 +79,7 @@ export function _resetAllFiltersSend( "/subscriptions/{subscriptionId}/providers/Microsoft.Web/recommendations/reset{?api%2Dversion}", { subscriptionId: context.subscriptionId, - "api%2Dversion": context.apiVersion, + "api%2Dversion": context.apiVersion ?? "2025-05-01", }, { allowReserved: options?.requestOptions?.skipUrlEncoding, @@ -116,7 +116,7 @@ export function _listSend( "/subscriptions/{subscriptionId}/providers/Microsoft.Web/recommendations{?api%2Dversion,featured,%24filter}", { subscriptionId: context.subscriptionId, - "api%2Dversion": context.apiVersion, + "api%2Dversion": context.apiVersion ?? "2025-05-01", featured: options?.featured, "%24filter": options?.filter, }, @@ -155,6 +155,6 @@ export function list( () => _listSend(context, options), _listDeserialize, ["200"], - { itemName: "value", nextLinkName: "nextLink" }, + { itemName: "value", nextLinkName: "nextLink", apiVersion: context.apiVersion ?? "2025-05-01" }, ); } diff --git a/packages/typespec-test/test/AppService/generated/typespec-ts/src/api/staticSitesOperationGroup/operations.ts b/packages/typespec-test/test/AppService/generated/typespec-ts/src/api/staticSitesOperationGroup/operations.ts index c269dc8223..a09e533265 100644 --- a/packages/typespec-test/test/AppService/generated/typespec-ts/src/api/staticSitesOperationGroup/operations.ts +++ b/packages/typespec-test/test/AppService/generated/typespec-ts/src/api/staticSitesOperationGroup/operations.ts @@ -29,7 +29,7 @@ export function _previewWorkflowSend( { subscriptionId: context.subscriptionId, location: location, - "api%2Dversion": context.apiVersion, + "api%2Dversion": context.apiVersion ?? "2025-05-01", }, { allowReserved: options?.requestOptions?.skipUrlEncoding, diff --git a/packages/typespec-test/test/AppService/generated/typespec-ts/src/api/webSiteManagementContext.ts b/packages/typespec-test/test/AppService/generated/typespec-ts/src/api/webSiteManagementContext.ts index 8a310ff3ab..a7bb32f46a 100644 --- a/packages/typespec-test/test/AppService/generated/typespec-ts/src/api/webSiteManagementContext.ts +++ b/packages/typespec-test/test/AppService/generated/typespec-ts/src/api/webSiteManagementContext.ts @@ -8,11 +8,11 @@ import { Client, ClientOptions, getClient } from "@azure-rest/core-client"; import { TokenCredential } from "@azure/core-auth"; export interface WebSiteManagementContext extends Client { - /** The API version to use for this operation. */ - /** Known values of {@link KnownVersions} that the service accepts. */ - apiVersion: string; /** The ID of the target subscription. The value must be an UUID. */ subscriptionId: string; + /** The API version to use for this operation. */ + /** Known values of {@link KnownVersions} that the service accepts. */ + apiVersion?: string; } /** Optional parameters for the client. */ @@ -43,22 +43,6 @@ export function createWebSiteManagement( credentials: { scopes: options.credentials?.scopes ?? [`${endpointUrl}/.default`] }, }; const clientContext = getClient(endpointUrl, credential, updatedOptions); - clientContext.pipeline.removePolicy({ name: "ApiVersionPolicy" }); - const apiVersion = options.apiVersion ?? "2025-05-01"; - clientContext.pipeline.addPolicy({ - name: "ClientApiVersionPolicy", - sendRequest: (req, next) => { - // Use the apiVersion defined in request url directly - // Append one if there is no apiVersion and we have one at client options - const url = new URL(req.url); - if (!url.searchParams.get("api-version")) { - req.url = `${req.url}${ - Array.from(url.searchParams.keys()).length > 0 ? "&" : "?" - }api-version=${apiVersion}`; - } - - return next(req); - }, - }); + const apiVersion = options.apiVersion; return { ...clientContext, apiVersion, subscriptionId } as WebSiteManagementContext; } diff --git a/packages/typespec-test/test/AppService/generated/typespec-ts/src/static-helpers/pagingHelpers.ts b/packages/typespec-test/test/AppService/generated/typespec-ts/src/static-helpers/pagingHelpers.ts index 5a3472a3f0..8412742a96 100644 --- a/packages/typespec-test/test/AppService/generated/typespec-ts/src/static-helpers/pagingHelpers.ts +++ b/packages/typespec-test/test/AppService/generated/typespec-ts/src/static-helpers/pagingHelpers.ts @@ -80,6 +80,7 @@ export interface BuildPagedAsyncIteratorOptions { itemName?: string; nextLinkName?: string; nextLinkMethod?: "GET" | "POST"; + apiVersion?: string; } /** @@ -100,14 +101,19 @@ export function buildPagedAsyncIterator< const itemName = options.itemName ?? "value"; const nextLinkName = options.nextLinkName ?? "nextLink"; const nextLinkMethod = options.nextLinkMethod ?? "GET"; + const apiVersion = options.apiVersion; const pagedResult: PagedResult = { getPage: async (pageLink?: string) => { - const result = - pageLink === undefined - ? await getInitialResponse() - : nextLinkMethod === "POST" - ? await client.pathUnchecked(pageLink).post() - : await client.pathUnchecked(pageLink).get(); + let result; + if (pageLink === undefined) { + result = await getInitialResponse(); + } else { + const resolvedPageLink = apiVersion ? addApiVersionToUrl(pageLink, apiVersion) : pageLink; + result = + nextLinkMethod === "POST" + ? await client.pathUnchecked(resolvedPageLink).post() + : await client.pathUnchecked(resolvedPageLink).get(); + } checkPagingRequest(result, expectedStatuses); const results = await processResponseBody(result as TResponse); const nextLink = getNextLink(results, nextLinkName); @@ -243,3 +249,21 @@ function checkPagingRequest(response: PathUncheckedResponse, expectedStatuses: s ); } } + +/** + * Adds the api-version query parameter on a URL if it's not present. + * @param url - the URL to modify + * @param apiVersion - the API version to set + * @returns - the URL with the api-version query parameter set + */ +function addApiVersionToUrl(url: string, apiVersion: string): string { + // The base URL is only used for parsing and won't appear in the returned URL + const urlObj = new URL(url, "https://microsoft.com"); + if (!urlObj.searchParams.get("api-version")) { + // Append one if there is no apiVersion + return `${url}${ + Array.from(urlObj.searchParams.keys()).length > 0 ? "&" : "?" + }api-version=${apiVersion}`; + } + return url; +} diff --git a/packages/typespec-test/test/AppService/generated/typespec-ts/src/static-helpers/pollingHelpers.ts b/packages/typespec-test/test/AppService/generated/typespec-ts/src/static-helpers/pollingHelpers.ts index f01c41bab6..b1bb018377 100644 --- a/packages/typespec-test/test/AppService/generated/typespec-ts/src/static-helpers/pollingHelpers.ts +++ b/packages/typespec-test/test/AppService/generated/typespec-ts/src/static-helpers/pollingHelpers.ts @@ -37,6 +37,10 @@ export interface GetLongRunningPollerOptions { * The function to get the initial response */ getInitialResponse?: () => PromiseLike; + /** + * The api-version of the LRO + */ + apiVersion?: string; } export function getLongRunningPoller( client: Client, @@ -44,7 +48,7 @@ export function getLongRunningPoller, ): PollerLike, TResult> { - const { restoreFrom, getInitialResponse } = options; + const { restoreFrom, getInitialResponse, apiVersion } = options; if (!restoreFrom && !getInitialResponse) { throw new Error("Either restoreFrom or getInitialResponse must be specified"); } @@ -83,7 +87,8 @@ export function getLongRunningPoller( }, }; } + +/** + * Adds the api-version query parameter on a URL if it's not present. + * @param url - the URL to modify + * @param apiVersion - the API version to set + * @returns - the URL with the api-version query parameter set + */ +function addApiVersionToUrl(url: string, apiVersion: string): string { + // The base URL is only used for parsing and won't appear in the returned URL + const urlObj = new URL(url, "https://microsoft.com"); + if (!urlObj.searchParams.get("api-version")) { + // Append one if there is no apiVersion + return `${url}${ + Array.from(urlObj.searchParams.keys()).length > 0 ? "&" : "?" + }api-version=${apiVersion}`; + } + return url; +} diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/package.json b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/package.json index e0df3dfc96..1a6b458746 100644 --- a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/package.json +++ b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/package.json @@ -12,34 +12,52 @@ "./package.json": "./package.json", ".": "./src/index.ts", "./api": "./src/api/index.ts", - "./api/siteNetworkServices": "src/api/siteNetworkServices/index.ts", - "./api/sites": "src/api/sites/index.ts", - "./api/artifactManifests": "src/api/artifactManifests/index.ts", - "./api/proxyArtifact": "src/api/proxyArtifact/index.ts", - "./api/artifactStores": "src/api/artifactStores/index.ts", - "./api/networkServiceDesignVersions": "src/api/networkServiceDesignVersions/index.ts", - "./api/networkServiceDesignGroups": "src/api/networkServiceDesignGroups/index.ts", - "./api/networkFunctionDefinitionVersions": "src/api/networkFunctionDefinitionVersions/index.ts", - "./api/networkFunctionDefinitionGroups": "src/api/networkFunctionDefinitionGroups/index.ts", - "./api/components": "src/api/components/index.ts", - "./api/networkFunctions": "src/api/networkFunctions/index.ts", - "./api/configurationGroupValues": "src/api/configurationGroupValues/index.ts", - "./api/publishers": "src/api/publishers/index.ts", - "./api/configurationGroupSchemas": "src/api/configurationGroupSchemas/index.ts", - "./api/operations": "src/api/operations/index.ts", + "./api/siteNetworkServices": "./src/api/siteNetworkServices/index.ts", + "./api/sites": "./src/api/sites/index.ts", + "./api/artifactManifests": "./src/api/artifactManifests/index.ts", + "./api/proxyArtifact": "./src/api/proxyArtifact/index.ts", + "./api/artifactStores": "./src/api/artifactStores/index.ts", + "./api/networkServiceDesignVersions": "./src/api/networkServiceDesignVersions/index.ts", + "./api/networkServiceDesignGroups": "./src/api/networkServiceDesignGroups/index.ts", + "./api/networkFunctionDefinitionVersions": "./src/api/networkFunctionDefinitionVersions/index.ts", + "./api/networkFunctionDefinitionGroups": "./src/api/networkFunctionDefinitionGroups/index.ts", + "./api/components": "./src/api/components/index.ts", + "./api/networkFunctions": "./src/api/networkFunctions/index.ts", + "./api/configurationGroupValues": "./src/api/configurationGroupValues/index.ts", + "./api/publishers": "./src/api/publishers/index.ts", + "./api/configurationGroupSchemas": "./src/api/configurationGroupSchemas/index.ts", + "./api/operations": "./src/api/operations/index.ts", "./models": "./src/models/index.ts" }, - "dialects": ["esm", "commonjs"], - "esmDialects": ["browser", "react-native"], + "dialects": [ + "esm", + "commonjs" + ], + "esmDialects": [ + "browser", + "react-native" + ], "selfLink": false }, "type": "module", "browser": "./dist/browser/index.js", "react-native": "./dist/react-native/index.js", - "keywords": ["node", "azure", "cloud", "typescript", "browser", "isomorphic"], + "keywords": [ + "node", + "azure", + "cloud", + "typescript", + "browser", + "isomorphic" + ], "author": "Microsoft Corporation", "license": "MIT", - "files": ["dist/", "!dist/**/*.d.*ts.map", "README.md", "LICENSE"], + "files": [ + "dist/", + "!dist/**/*.d.*ts.map", + "README.md", + "LICENSE" + ], "dependencies": { "@azure/core-util": "^1.9.2", "@azure-rest/core-client": "^2.3.1", diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/review/arm-hybridnetwork.api.md b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/review/arm-hybridnetwork.api.md index f7b9c7b4d5..8447de60e7 100644 --- a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/review/arm-hybridnetwork.api.md +++ b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/review/arm-hybridnetwork.api.md @@ -247,6 +247,10 @@ export interface ArtifactStoresOperations { // @deprecated (undocumented) beginDeleteNetworkFabricControllerEndPointsAndWait: (resourceGroupName: string, publisherName: string, artifactStoreName: string, parameters: ArtifactStoreNetworkFabricControllerEndPoints, options?: ArtifactStoresDeleteNetworkFabricControllerEndPointsOptionalParams) => Promise; // @deprecated (undocumented) + beginListListNetworkFabricControllerPrivateEndPointsAndWait: (resourceGroupName: string, publisherName: string, artifactStoreName: string, options?: ArtifactStoresListNetworkFabricControllerPrivateEndPointsOptionalParams) => PagedAsyncIterableIterator; + // @deprecated (undocumented) + beginListListPrivateEndPointsAndWait: (resourceGroupName: string, publisherName: string, artifactStoreName: string, options?: ArtifactStoresListPrivateEndPointsOptionalParams) => PagedAsyncIterableIterator; + // @deprecated (undocumented) beginRemovePrivateEndPoints: (resourceGroupName: string, publisherName: string, artifactStoreName: string, parameters: ArtifactStorePrivateEndPointsFormat, options?: ArtifactStoresRemovePrivateEndPointsOptionalParams) => Promise, void>>; // @deprecated (undocumented) beginRemovePrivateEndPointsAndWait: (resourceGroupName: string, publisherName: string, artifactStoreName: string, parameters: ArtifactStorePrivateEndPointsFormat, options?: ArtifactStoresRemovePrivateEndPointsOptionalParams) => Promise; diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/artifactManifests/operations.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/artifactManifests/operations.ts index f12ff5f2a8..f830621885 100644 --- a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/artifactManifests/operations.ts +++ b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/artifactManifests/operations.ts @@ -57,7 +57,7 @@ export function _updateStateSend( publisherName: publisherName, artifactStoreName: artifactStoreName, artifactManifestName: artifactManifestName, - "api%2Dversion": context.apiVersion, + "api%2Dversion": context.apiVersion ?? "2025-03-30", }, { allowReserved: options?.requestOptions?.skipUrlEncoding, @@ -110,6 +110,7 @@ export function updateState( options, ), resourceLocationConfig: "location", + apiVersion: context.apiVersion ?? "2025-03-30", }) as PollerLike, ArtifactManifestUpdateState>; } @@ -129,7 +130,7 @@ export function _listCredentialSend( publisherName: publisherName, artifactStoreName: artifactStoreName, artifactManifestName: artifactManifestName, - "api%2Dversion": context.apiVersion, + "api%2Dversion": context.apiVersion ?? "2025-03-30", }, { allowReserved: options?.requestOptions?.skipUrlEncoding, @@ -190,7 +191,7 @@ export function _listByArtifactStoreSend( resourceGroupName: resourceGroupName, publisherName: publisherName, artifactStoreName: artifactStoreName, - "api%2Dversion": context.apiVersion, + "api%2Dversion": context.apiVersion ?? "2025-03-30", }, { allowReserved: options?.requestOptions?.skipUrlEncoding, @@ -237,7 +238,7 @@ export function listByArtifactStore( ), _listByArtifactStoreDeserialize, ["200"], - { itemName: "value", nextLinkName: "nextLink" }, + { itemName: "value", nextLinkName: "nextLink", apiVersion: context.apiVersion ?? "2025-03-30" }, ); } @@ -257,7 +258,7 @@ export function _$deleteSend( publisherName: publisherName, artifactStoreName: artifactStoreName, artifactManifestName: artifactManifestName, - "api%2Dversion": context.apiVersion, + "api%2Dversion": context.apiVersion ?? "2025-03-30", }, { allowReserved: options?.requestOptions?.skipUrlEncoding, @@ -304,6 +305,7 @@ export function $delete( options, ), resourceLocationConfig: "location", + apiVersion: context.apiVersion ?? "2025-03-30", }) as PollerLike, void>; } @@ -324,7 +326,7 @@ export function _updateSend( publisherName: publisherName, artifactStoreName: artifactStoreName, artifactManifestName: artifactManifestName, - "api%2Dversion": context.apiVersion, + "api%2Dversion": context.apiVersion ?? "2025-03-30", }, { allowReserved: options?.requestOptions?.skipUrlEncoding, @@ -390,7 +392,7 @@ export function _createOrUpdateSend( publisherName: publisherName, artifactStoreName: artifactStoreName, artifactManifestName: artifactManifestName, - "api%2Dversion": context.apiVersion, + "api%2Dversion": context.apiVersion ?? "2025-03-30", }, { allowReserved: options?.requestOptions?.skipUrlEncoding, @@ -443,6 +445,7 @@ export function createOrUpdate( options, ), resourceLocationConfig: "azure-async-operation", + apiVersion: context.apiVersion ?? "2025-03-30", }) as PollerLike, ArtifactManifest>; } @@ -462,7 +465,7 @@ export function _getSend( publisherName: publisherName, artifactStoreName: artifactStoreName, artifactManifestName: artifactManifestName, - "api%2Dversion": context.apiVersion, + "api%2Dversion": context.apiVersion ?? "2025-03-30", }, { allowReserved: options?.requestOptions?.skipUrlEncoding, diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/artifactStores/operations.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/artifactStores/operations.ts index ffa44e32aa..6069d4cc25 100644 --- a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/artifactStores/operations.ts +++ b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/artifactStores/operations.ts @@ -61,7 +61,7 @@ export function _listPrivateEndPointsSend( resourceGroupName: resourceGroupName, publisherName: publisherName, artifactStoreName: artifactStoreName, - "api%2Dversion": context.apiVersion, + "api%2Dversion": context.apiVersion ?? "2025-03-30", }, { allowReserved: options?.requestOptions?.skipUrlEncoding, @@ -112,6 +112,7 @@ export function listPrivateEndPoints( options, ), resourceLocationConfig: "location", + apiVersion: context.apiVersion ?? "2025-03-30", }, ) as PollerLike, PathUncheckedResponse>; @@ -120,7 +121,7 @@ export function listPrivateEndPoints( async () => await initialPagingPoller, _listPrivateEndPointsDeserialize, ["200", "202", "201"], - { itemName: "value", nextLinkName: "nextLink" }, + { itemName: "value", nextLinkName: "nextLink", apiVersion: context.apiVersion ?? "2025-03-30" }, ); } @@ -139,7 +140,7 @@ export function _removePrivateEndPointsSend( resourceGroupName: resourceGroupName, publisherName: publisherName, artifactStoreName: artifactStoreName, - "api%2Dversion": context.apiVersion, + "api%2Dversion": context.apiVersion ?? "2025-03-30", }, { allowReserved: options?.requestOptions?.skipUrlEncoding, @@ -189,6 +190,7 @@ export function removePrivateEndPoints( options, ), resourceLocationConfig: "location", + apiVersion: context.apiVersion ?? "2025-03-30", }) as PollerLike, void>; } @@ -207,7 +209,7 @@ export function _approvePrivateEndPointsSend( resourceGroupName: resourceGroupName, publisherName: publisherName, artifactStoreName: artifactStoreName, - "api%2Dversion": context.apiVersion, + "api%2Dversion": context.apiVersion ?? "2025-03-30", }, { allowReserved: options?.requestOptions?.skipUrlEncoding, @@ -257,6 +259,7 @@ export function approvePrivateEndPoints( options, ), resourceLocationConfig: "location", + apiVersion: context.apiVersion ?? "2025-03-30", }) as PollerLike, void>; } @@ -276,7 +279,7 @@ export function _listNetworkFabricControllerPrivateEndPointsSend( resourceGroupName: resourceGroupName, publisherName: publisherName, artifactStoreName: artifactStoreName, - "api%2Dversion": context.apiVersion, + "api%2Dversion": context.apiVersion ?? "2025-03-30", }, { allowReserved: options?.requestOptions?.skipUrlEncoding, @@ -329,6 +332,7 @@ export function listNetworkFabricControllerPrivateEndPoints( options, ), resourceLocationConfig: "location", + apiVersion: context.apiVersion ?? "2025-03-30", }, ) as PollerLike, PathUncheckedResponse>; @@ -337,7 +341,7 @@ export function listNetworkFabricControllerPrivateEndPoints( async () => await initialPagingPoller, _listNetworkFabricControllerPrivateEndPointsDeserialize, ["200", "202", "201"], - { itemName: "value", nextLinkName: "nextLink" }, + { itemName: "value", nextLinkName: "nextLink", apiVersion: context.apiVersion ?? "2025-03-30" }, ); } @@ -358,7 +362,7 @@ export function _deleteNetworkFabricControllerEndPointsSend( resourceGroupName: resourceGroupName, publisherName: publisherName, artifactStoreName: artifactStoreName, - "api%2Dversion": context.apiVersion, + "api%2Dversion": context.apiVersion ?? "2025-03-30", }, { allowReserved: options?.requestOptions?.skipUrlEncoding, @@ -414,6 +418,7 @@ export function deleteNetworkFabricControllerEndPoints( options, ), resourceLocationConfig: "location", + apiVersion: context.apiVersion ?? "2025-03-30", }, ) as PollerLike, void>; } @@ -433,7 +438,7 @@ export function _addNetworkFabricControllerEndPointsSend( resourceGroupName: resourceGroupName, publisherName: publisherName, artifactStoreName: artifactStoreName, - "api%2Dversion": context.apiVersion, + "api%2Dversion": context.apiVersion ?? "2025-03-30", }, { allowReserved: options?.requestOptions?.skipUrlEncoding, @@ -487,6 +492,7 @@ export function addNetworkFabricControllerEndPoints( options, ), resourceLocationConfig: "location", + apiVersion: context.apiVersion ?? "2025-03-30", }, ) as PollerLike, void>; } @@ -503,7 +509,7 @@ export function _listByPublisherSend( subscriptionId: context.subscriptionId, resourceGroupName: resourceGroupName, publisherName: publisherName, - "api%2Dversion": context.apiVersion, + "api%2Dversion": context.apiVersion ?? "2025-03-30", }, { allowReserved: options?.requestOptions?.skipUrlEncoding, @@ -542,7 +548,7 @@ export function listByPublisher( () => _listByPublisherSend(context, resourceGroupName, publisherName, options), _listByPublisherDeserialize, ["200"], - { itemName: "value", nextLinkName: "nextLink" }, + { itemName: "value", nextLinkName: "nextLink", apiVersion: context.apiVersion ?? "2025-03-30" }, ); } @@ -560,7 +566,7 @@ export function _$deleteSend( resourceGroupName: resourceGroupName, publisherName: publisherName, artifactStoreName: artifactStoreName, - "api%2Dversion": context.apiVersion, + "api%2Dversion": context.apiVersion ?? "2025-03-30", }, { allowReserved: options?.requestOptions?.skipUrlEncoding, @@ -599,6 +605,7 @@ export function $delete( getInitialResponse: () => _$deleteSend(context, resourceGroupName, publisherName, artifactStoreName, options), resourceLocationConfig: "location", + apiVersion: context.apiVersion ?? "2025-03-30", }) as PollerLike, void>; } @@ -617,7 +624,7 @@ export function _updateSend( resourceGroupName: resourceGroupName, publisherName: publisherName, artifactStoreName: artifactStoreName, - "api%2Dversion": context.apiVersion, + "api%2Dversion": context.apiVersion ?? "2025-03-30", }, { allowReserved: options?.requestOptions?.skipUrlEncoding, @@ -679,7 +686,7 @@ export function _createOrUpdateSend( resourceGroupName: resourceGroupName, publisherName: publisherName, artifactStoreName: artifactStoreName, - "api%2Dversion": context.apiVersion, + "api%2Dversion": context.apiVersion ?? "2025-03-30", }, { allowReserved: options?.requestOptions?.skipUrlEncoding, @@ -730,6 +737,7 @@ export function createOrUpdate( options, ), resourceLocationConfig: "azure-async-operation", + apiVersion: context.apiVersion ?? "2025-03-30", }) as PollerLike, ArtifactStore>; } @@ -747,7 +755,7 @@ export function _getSend( resourceGroupName: resourceGroupName, publisherName: publisherName, artifactStoreName: artifactStoreName, - "api%2Dversion": context.apiVersion, + "api%2Dversion": context.apiVersion ?? "2025-03-30", }, { allowReserved: options?.requestOptions?.skipUrlEncoding, diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/components/operations.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/components/operations.ts index ac4b1f2f6d..417a0a58ca 100644 --- a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/components/operations.ts +++ b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/components/operations.ts @@ -37,7 +37,7 @@ export function _listByNetworkFunctionSend( subscriptionId: context.subscriptionId, resourceGroupName: resourceGroupName, networkFunctionName: networkFunctionName, - "api%2Dversion": context.apiVersion, + "api%2Dversion": context.apiVersion ?? "2025-03-30", }, { allowReserved: options?.requestOptions?.skipUrlEncoding, @@ -76,7 +76,7 @@ export function listByNetworkFunction( () => _listByNetworkFunctionSend(context, resourceGroupName, networkFunctionName, options), _listByNetworkFunctionDeserialize, ["200"], - { itemName: "value", nextLinkName: "nextLink" }, + { itemName: "value", nextLinkName: "nextLink", apiVersion: context.apiVersion ?? "2025-03-30" }, ); } @@ -94,7 +94,7 @@ export function _getSend( resourceGroupName: resourceGroupName, networkFunctionName: networkFunctionName, componentName: componentName, - "api%2Dversion": context.apiVersion, + "api%2Dversion": context.apiVersion ?? "2025-03-30", }, { allowReserved: options?.requestOptions?.skipUrlEncoding, diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/configurationGroupSchemas/operations.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/configurationGroupSchemas/operations.ts index 97114de76f..81f7d116bc 100644 --- a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/configurationGroupSchemas/operations.ts +++ b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/configurationGroupSchemas/operations.ts @@ -52,7 +52,7 @@ export function _updateStateSend( resourceGroupName: resourceGroupName, publisherName: publisherName, configurationGroupSchemaName: configurationGroupSchemaName, - "api%2Dversion": context.apiVersion, + "api%2Dversion": context.apiVersion ?? "2025-03-30", }, { allowReserved: options?.requestOptions?.skipUrlEncoding, @@ -106,6 +106,7 @@ export function updateState( options, ), resourceLocationConfig: "location", + apiVersion: context.apiVersion ?? "2025-03-30", }) as PollerLike< OperationState, ConfigurationGroupSchemaVersionUpdateState @@ -124,7 +125,7 @@ export function _listByPublisherSend( subscriptionId: context.subscriptionId, resourceGroupName: resourceGroupName, publisherName: publisherName, - "api%2Dversion": context.apiVersion, + "api%2Dversion": context.apiVersion ?? "2025-03-30", }, { allowReserved: options?.requestOptions?.skipUrlEncoding, @@ -163,7 +164,7 @@ export function listByPublisher( () => _listByPublisherSend(context, resourceGroupName, publisherName, options), _listByPublisherDeserialize, ["200"], - { itemName: "value", nextLinkName: "nextLink" }, + { itemName: "value", nextLinkName: "nextLink", apiVersion: context.apiVersion ?? "2025-03-30" }, ); } @@ -181,7 +182,7 @@ export function _$deleteSend( resourceGroupName: resourceGroupName, publisherName: publisherName, configurationGroupSchemaName: configurationGroupSchemaName, - "api%2Dversion": context.apiVersion, + "api%2Dversion": context.apiVersion ?? "2025-03-30", }, { allowReserved: options?.requestOptions?.skipUrlEncoding, @@ -226,6 +227,7 @@ export function $delete( options, ), resourceLocationConfig: "location", + apiVersion: context.apiVersion ?? "2025-03-30", }) as PollerLike, void>; } @@ -244,7 +246,7 @@ export function _updateSend( resourceGroupName: resourceGroupName, publisherName: publisherName, configurationGroupSchemaName: configurationGroupSchemaName, - "api%2Dversion": context.apiVersion, + "api%2Dversion": context.apiVersion ?? "2025-03-30", }, { allowReserved: options?.requestOptions?.skipUrlEncoding, @@ -308,7 +310,7 @@ export function _createOrUpdateSend( resourceGroupName: resourceGroupName, publisherName: publisherName, configurationGroupSchemaName: configurationGroupSchemaName, - "api%2Dversion": context.apiVersion, + "api%2Dversion": context.apiVersion ?? "2025-03-30", }, { allowReserved: options?.requestOptions?.skipUrlEncoding, @@ -359,6 +361,7 @@ export function createOrUpdate( options, ), resourceLocationConfig: "azure-async-operation", + apiVersion: context.apiVersion ?? "2025-03-30", }) as PollerLike, ConfigurationGroupSchema>; } @@ -376,7 +379,7 @@ export function _getSend( resourceGroupName: resourceGroupName, publisherName: publisherName, configurationGroupSchemaName: configurationGroupSchemaName, - "api%2Dversion": context.apiVersion, + "api%2Dversion": context.apiVersion ?? "2025-03-30", }, { allowReserved: options?.requestOptions?.skipUrlEncoding, diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/configurationGroupValues/operations.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/configurationGroupValues/operations.ts index 2571157b10..3d00a832d1 100644 --- a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/configurationGroupValues/operations.ts +++ b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/configurationGroupValues/operations.ts @@ -42,7 +42,7 @@ export function _listBySubscriptionSend( "/subscriptions/{subscriptionId}/providers/Microsoft.HybridNetwork/configurationGroupValues{?api%2Dversion}", { subscriptionId: context.subscriptionId, - "api%2Dversion": context.apiVersion, + "api%2Dversion": context.apiVersion ?? "2025-03-30", }, { allowReserved: options?.requestOptions?.skipUrlEncoding, @@ -79,7 +79,7 @@ export function listBySubscription( () => _listBySubscriptionSend(context, options), _listBySubscriptionDeserialize, ["200"], - { itemName: "value", nextLinkName: "nextLink" }, + { itemName: "value", nextLinkName: "nextLink", apiVersion: context.apiVersion ?? "2025-03-30" }, ); } @@ -93,7 +93,7 @@ export function _listByResourceGroupSend( { subscriptionId: context.subscriptionId, resourceGroupName: resourceGroupName, - "api%2Dversion": context.apiVersion, + "api%2Dversion": context.apiVersion ?? "2025-03-30", }, { allowReserved: options?.requestOptions?.skipUrlEncoding, @@ -131,7 +131,7 @@ export function listByResourceGroup( () => _listByResourceGroupSend(context, resourceGroupName, options), _listByResourceGroupDeserialize, ["200"], - { itemName: "value", nextLinkName: "nextLink" }, + { itemName: "value", nextLinkName: "nextLink", apiVersion: context.apiVersion ?? "2025-03-30" }, ); } @@ -147,7 +147,7 @@ export function _$deleteSend( subscriptionId: context.subscriptionId, resourceGroupName: resourceGroupName, configurationGroupValueName: configurationGroupValueName, - "api%2Dversion": context.apiVersion, + "api%2Dversion": context.apiVersion ?? "2025-03-30", }, { allowReserved: options?.requestOptions?.skipUrlEncoding, @@ -185,6 +185,7 @@ export function $delete( getInitialResponse: () => _$deleteSend(context, resourceGroupName, configurationGroupValueName, options), resourceLocationConfig: "location", + apiVersion: context.apiVersion ?? "2025-03-30", }) as PollerLike, void>; } @@ -201,7 +202,7 @@ export function _updateTagsSend( subscriptionId: context.subscriptionId, resourceGroupName: resourceGroupName, configurationGroupValueName: configurationGroupValueName, - "api%2Dversion": context.apiVersion, + "api%2Dversion": context.apiVersion ?? "2025-03-30", }, { allowReserved: options?.requestOptions?.skipUrlEncoding, @@ -261,7 +262,7 @@ export function _createOrUpdateSend( subscriptionId: context.subscriptionId, resourceGroupName: resourceGroupName, configurationGroupValueName: configurationGroupValueName, - "api%2Dversion": context.apiVersion, + "api%2Dversion": context.apiVersion ?? "2025-03-30", }, { allowReserved: options?.requestOptions?.skipUrlEncoding, @@ -310,6 +311,7 @@ export function createOrUpdate( options, ), resourceLocationConfig: "azure-async-operation", + apiVersion: context.apiVersion ?? "2025-03-30", }) as PollerLike, ConfigurationGroupValue>; } @@ -325,7 +327,7 @@ export function _getSend( subscriptionId: context.subscriptionId, resourceGroupName: resourceGroupName, configurationGroupValueName: configurationGroupValueName, - "api%2Dversion": context.apiVersion, + "api%2Dversion": context.apiVersion ?? "2025-03-30", }, { allowReserved: options?.requestOptions?.skipUrlEncoding, diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/hybridNetworkManagementContext.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/hybridNetworkManagementContext.ts index 9d26e4a302..e619baa97d 100644 --- a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/hybridNetworkManagementContext.ts +++ b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/hybridNetworkManagementContext.ts @@ -8,11 +8,11 @@ import { Client, ClientOptions, getClient } from "@azure-rest/core-client"; import { TokenCredential } from "@azure/core-auth"; export interface HybridNetworkManagementContext extends Client { - /** The API version to use for this operation. */ - /** Known values of {@link KnownVersions} that the service accepts. */ - apiVersion: string; /** The ID of the target subscription. The value must be an UUID. */ subscriptionId: string; + /** The API version to use for this operation. */ + /** Known values of {@link KnownVersions} that the service accepts. */ + apiVersion?: string; } /** Optional parameters for the client. */ @@ -43,22 +43,6 @@ export function createHybridNetworkManagement( credentials: { scopes: options.credentials?.scopes ?? [`${endpointUrl}/.default`] }, }; const clientContext = getClient(endpointUrl, credential, updatedOptions); - clientContext.pipeline.removePolicy({ name: "ApiVersionPolicy" }); - const apiVersion = options.apiVersion ?? "2025-03-30"; - clientContext.pipeline.addPolicy({ - name: "ClientApiVersionPolicy", - sendRequest: (req, next) => { - // Use the apiVersion defined in request url directly - // Append one if there is no apiVersion and we have one at client options - const url = new URL(req.url); - if (!url.searchParams.get("api-version")) { - req.url = `${req.url}${ - Array.from(url.searchParams.keys()).length > 0 ? "&" : "?" - }api-version=${apiVersion}`; - } - - return next(req); - }, - }); + const apiVersion = options.apiVersion; return { ...clientContext, apiVersion, subscriptionId } as HybridNetworkManagementContext; } diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/networkFunctionDefinitionGroups/operations.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/networkFunctionDefinitionGroups/operations.ts index e2e782d1d9..2f473abddb 100644 --- a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/networkFunctionDefinitionGroups/operations.ts +++ b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/networkFunctionDefinitionGroups/operations.ts @@ -45,7 +45,7 @@ export function _listByPublisherSend( subscriptionId: context.subscriptionId, resourceGroupName: resourceGroupName, publisherName: publisherName, - "api%2Dversion": context.apiVersion, + "api%2Dversion": context.apiVersion ?? "2025-03-30", }, { allowReserved: options?.requestOptions?.skipUrlEncoding, @@ -84,7 +84,7 @@ export function listByPublisher( () => _listByPublisherSend(context, resourceGroupName, publisherName, options), _listByPublisherDeserialize, ["200"], - { itemName: "value", nextLinkName: "nextLink" }, + { itemName: "value", nextLinkName: "nextLink", apiVersion: context.apiVersion ?? "2025-03-30" }, ); } @@ -102,7 +102,7 @@ export function _$deleteSend( resourceGroupName: resourceGroupName, publisherName: publisherName, networkFunctionDefinitionGroupName: networkFunctionDefinitionGroupName, - "api%2Dversion": context.apiVersion, + "api%2Dversion": context.apiVersion ?? "2025-03-30", }, { allowReserved: options?.requestOptions?.skipUrlEncoding, @@ -147,6 +147,7 @@ export function $delete( options, ), resourceLocationConfig: "location", + apiVersion: context.apiVersion ?? "2025-03-30", }) as PollerLike, void>; } @@ -165,7 +166,7 @@ export function _updateSend( resourceGroupName: resourceGroupName, publisherName: publisherName, networkFunctionDefinitionGroupName: networkFunctionDefinitionGroupName, - "api%2Dversion": context.apiVersion, + "api%2Dversion": context.apiVersion ?? "2025-03-30", }, { allowReserved: options?.requestOptions?.skipUrlEncoding, @@ -229,7 +230,7 @@ export function _createOrUpdateSend( resourceGroupName: resourceGroupName, publisherName: publisherName, networkFunctionDefinitionGroupName: networkFunctionDefinitionGroupName, - "api%2Dversion": context.apiVersion, + "api%2Dversion": context.apiVersion ?? "2025-03-30", }, { allowReserved: options?.requestOptions?.skipUrlEncoding, @@ -280,6 +281,7 @@ export function createOrUpdate( options, ), resourceLocationConfig: "azure-async-operation", + apiVersion: context.apiVersion ?? "2025-03-30", }) as PollerLike, NetworkFunctionDefinitionGroup>; } @@ -297,7 +299,7 @@ export function _getSend( resourceGroupName: resourceGroupName, publisherName: publisherName, networkFunctionDefinitionGroupName: networkFunctionDefinitionGroupName, - "api%2Dversion": context.apiVersion, + "api%2Dversion": context.apiVersion ?? "2025-03-30", }, { allowReserved: options?.requestOptions?.skipUrlEncoding, diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/networkFunctionDefinitionVersions/operations.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/networkFunctionDefinitionVersions/operations.ts index 76ff361693..caef29a713 100644 --- a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/networkFunctionDefinitionVersions/operations.ts +++ b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/networkFunctionDefinitionVersions/operations.ts @@ -54,7 +54,7 @@ export function _updateStateSend( publisherName: publisherName, networkFunctionDefinitionGroupName: networkFunctionDefinitionGroupName, networkFunctionDefinitionVersionName: networkFunctionDefinitionVersionName, - "api%2Dversion": context.apiVersion, + "api%2Dversion": context.apiVersion ?? "2025-03-30", }, { allowReserved: options?.requestOptions?.skipUrlEncoding, @@ -110,6 +110,7 @@ export function updateState( options, ), resourceLocationConfig: "location", + apiVersion: context.apiVersion ?? "2025-03-30", }) as PollerLike< OperationState, NetworkFunctionDefinitionVersionUpdateState @@ -132,7 +133,7 @@ export function _listByNetworkFunctionDefinitionGroupSend( resourceGroupName: resourceGroupName, publisherName: publisherName, networkFunctionDefinitionGroupName: networkFunctionDefinitionGroupName, - "api%2Dversion": context.apiVersion, + "api%2Dversion": context.apiVersion ?? "2025-03-30", }, { allowReserved: options?.requestOptions?.skipUrlEncoding, @@ -181,7 +182,7 @@ export function listByNetworkFunctionDefinitionGroup( ), _listByNetworkFunctionDefinitionGroupDeserialize, ["200"], - { itemName: "value", nextLinkName: "nextLink" }, + { itemName: "value", nextLinkName: "nextLink", apiVersion: context.apiVersion ?? "2025-03-30" }, ); } @@ -201,7 +202,7 @@ export function _$deleteSend( publisherName: publisherName, networkFunctionDefinitionGroupName: networkFunctionDefinitionGroupName, networkFunctionDefinitionVersionName: networkFunctionDefinitionVersionName, - "api%2Dversion": context.apiVersion, + "api%2Dversion": context.apiVersion ?? "2025-03-30", }, { allowReserved: options?.requestOptions?.skipUrlEncoding, @@ -248,6 +249,7 @@ export function $delete( options, ), resourceLocationConfig: "location", + apiVersion: context.apiVersion ?? "2025-03-30", }) as PollerLike, void>; } @@ -268,7 +270,7 @@ export function _updateSend( publisherName: publisherName, networkFunctionDefinitionGroupName: networkFunctionDefinitionGroupName, networkFunctionDefinitionVersionName: networkFunctionDefinitionVersionName, - "api%2Dversion": context.apiVersion, + "api%2Dversion": context.apiVersion ?? "2025-03-30", }, { allowReserved: options?.requestOptions?.skipUrlEncoding, @@ -336,7 +338,7 @@ export function _createOrUpdateSend( publisherName: publisherName, networkFunctionDefinitionGroupName: networkFunctionDefinitionGroupName, networkFunctionDefinitionVersionName: networkFunctionDefinitionVersionName, - "api%2Dversion": context.apiVersion, + "api%2Dversion": context.apiVersion ?? "2025-03-30", }, { allowReserved: options?.requestOptions?.skipUrlEncoding, @@ -389,6 +391,7 @@ export function createOrUpdate( options, ), resourceLocationConfig: "azure-async-operation", + apiVersion: context.apiVersion ?? "2025-03-30", }) as PollerLike< OperationState, NetworkFunctionDefinitionVersion @@ -411,7 +414,7 @@ export function _getSend( publisherName: publisherName, networkFunctionDefinitionGroupName: networkFunctionDefinitionGroupName, networkFunctionDefinitionVersionName: networkFunctionDefinitionVersionName, - "api%2Dversion": context.apiVersion, + "api%2Dversion": context.apiVersion ?? "2025-03-30", }, { allowReserved: options?.requestOptions?.skipUrlEncoding, diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/networkFunctions/operations.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/networkFunctions/operations.ts index d88f7a56c9..d67e04b389 100644 --- a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/networkFunctions/operations.ts +++ b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/networkFunctions/operations.ts @@ -50,7 +50,7 @@ export function _executeRequestSend( subscriptionId: context.subscriptionId, resourceGroupName: resourceGroupName, networkFunctionName: networkFunctionName, - "api%2Dversion": context.apiVersion, + "api%2Dversion": context.apiVersion ?? "2025-03-30", }, { allowReserved: options?.requestOptions?.skipUrlEncoding, @@ -90,6 +90,7 @@ export function executeRequest( getInitialResponse: () => _executeRequestSend(context, resourceGroupName, networkFunctionName, parameters, options), resourceLocationConfig: "location", + apiVersion: context.apiVersion ?? "2025-03-30", }) as PollerLike, void>; } @@ -101,7 +102,7 @@ export function _listBySubscriptionSend( "/subscriptions/{subscriptionId}/providers/Microsoft.HybridNetwork/networkFunctions{?api%2Dversion}", { subscriptionId: context.subscriptionId, - "api%2Dversion": context.apiVersion, + "api%2Dversion": context.apiVersion ?? "2025-03-30", }, { allowReserved: options?.requestOptions?.skipUrlEncoding, @@ -138,7 +139,7 @@ export function listBySubscription( () => _listBySubscriptionSend(context, options), _listBySubscriptionDeserialize, ["200"], - { itemName: "value", nextLinkName: "nextLink" }, + { itemName: "value", nextLinkName: "nextLink", apiVersion: context.apiVersion ?? "2025-03-30" }, ); } @@ -152,7 +153,7 @@ export function _listByResourceGroupSend( { subscriptionId: context.subscriptionId, resourceGroupName: resourceGroupName, - "api%2Dversion": context.apiVersion, + "api%2Dversion": context.apiVersion ?? "2025-03-30", }, { allowReserved: options?.requestOptions?.skipUrlEncoding, @@ -190,7 +191,7 @@ export function listByResourceGroup( () => _listByResourceGroupSend(context, resourceGroupName, options), _listByResourceGroupDeserialize, ["200"], - { itemName: "value", nextLinkName: "nextLink" }, + { itemName: "value", nextLinkName: "nextLink", apiVersion: context.apiVersion ?? "2025-03-30" }, ); } @@ -206,7 +207,7 @@ export function _$deleteSend( subscriptionId: context.subscriptionId, resourceGroupName: resourceGroupName, networkFunctionName: networkFunctionName, - "api%2Dversion": context.apiVersion, + "api%2Dversion": context.apiVersion ?? "2025-03-30", }, { allowReserved: options?.requestOptions?.skipUrlEncoding, @@ -244,6 +245,7 @@ export function $delete( getInitialResponse: () => _$deleteSend(context, resourceGroupName, networkFunctionName, options), resourceLocationConfig: "location", + apiVersion: context.apiVersion ?? "2025-03-30", }) as PollerLike, void>; } @@ -260,7 +262,7 @@ export function _updateTagsSend( subscriptionId: context.subscriptionId, resourceGroupName: resourceGroupName, networkFunctionName: networkFunctionName, - "api%2Dversion": context.apiVersion, + "api%2Dversion": context.apiVersion ?? "2025-03-30", }, { allowReserved: options?.requestOptions?.skipUrlEncoding, @@ -320,7 +322,7 @@ export function _createOrUpdateSend( subscriptionId: context.subscriptionId, resourceGroupName: resourceGroupName, networkFunctionName: networkFunctionName, - "api%2Dversion": context.apiVersion, + "api%2Dversion": context.apiVersion ?? "2025-03-30", }, { allowReserved: options?.requestOptions?.skipUrlEncoding, @@ -363,6 +365,7 @@ export function createOrUpdate( getInitialResponse: () => _createOrUpdateSend(context, resourceGroupName, networkFunctionName, parameters, options), resourceLocationConfig: "azure-async-operation", + apiVersion: context.apiVersion ?? "2025-03-30", }) as PollerLike, NetworkFunction>; } @@ -378,7 +381,7 @@ export function _getSend( subscriptionId: context.subscriptionId, resourceGroupName: resourceGroupName, networkFunctionName: networkFunctionName, - "api%2Dversion": context.apiVersion, + "api%2Dversion": context.apiVersion ?? "2025-03-30", }, { allowReserved: options?.requestOptions?.skipUrlEncoding, diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/networkServiceDesignGroups/operations.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/networkServiceDesignGroups/operations.ts index b88d5292af..cefa557029 100644 --- a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/networkServiceDesignGroups/operations.ts +++ b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/networkServiceDesignGroups/operations.ts @@ -45,7 +45,7 @@ export function _listByPublisherSend( subscriptionId: context.subscriptionId, resourceGroupName: resourceGroupName, publisherName: publisherName, - "api%2Dversion": context.apiVersion, + "api%2Dversion": context.apiVersion ?? "2025-03-30", }, { allowReserved: options?.requestOptions?.skipUrlEncoding, @@ -84,7 +84,7 @@ export function listByPublisher( () => _listByPublisherSend(context, resourceGroupName, publisherName, options), _listByPublisherDeserialize, ["200"], - { itemName: "value", nextLinkName: "nextLink" }, + { itemName: "value", nextLinkName: "nextLink", apiVersion: context.apiVersion ?? "2025-03-30" }, ); } @@ -102,7 +102,7 @@ export function _$deleteSend( resourceGroupName: resourceGroupName, publisherName: publisherName, networkServiceDesignGroupName: networkServiceDesignGroupName, - "api%2Dversion": context.apiVersion, + "api%2Dversion": context.apiVersion ?? "2025-03-30", }, { allowReserved: options?.requestOptions?.skipUrlEncoding, @@ -147,6 +147,7 @@ export function $delete( options, ), resourceLocationConfig: "location", + apiVersion: context.apiVersion ?? "2025-03-30", }) as PollerLike, void>; } @@ -165,7 +166,7 @@ export function _updateSend( resourceGroupName: resourceGroupName, publisherName: publisherName, networkServiceDesignGroupName: networkServiceDesignGroupName, - "api%2Dversion": context.apiVersion, + "api%2Dversion": context.apiVersion ?? "2025-03-30", }, { allowReserved: options?.requestOptions?.skipUrlEncoding, @@ -229,7 +230,7 @@ export function _createOrUpdateSend( resourceGroupName: resourceGroupName, publisherName: publisherName, networkServiceDesignGroupName: networkServiceDesignGroupName, - "api%2Dversion": context.apiVersion, + "api%2Dversion": context.apiVersion ?? "2025-03-30", }, { allowReserved: options?.requestOptions?.skipUrlEncoding, @@ -280,6 +281,7 @@ export function createOrUpdate( options, ), resourceLocationConfig: "azure-async-operation", + apiVersion: context.apiVersion ?? "2025-03-30", }) as PollerLike, NetworkServiceDesignGroup>; } @@ -297,7 +299,7 @@ export function _getSend( resourceGroupName: resourceGroupName, publisherName: publisherName, networkServiceDesignGroupName: networkServiceDesignGroupName, - "api%2Dversion": context.apiVersion, + "api%2Dversion": context.apiVersion ?? "2025-03-30", }, { allowReserved: options?.requestOptions?.skipUrlEncoding, diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/networkServiceDesignVersions/operations.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/networkServiceDesignVersions/operations.ts index a212110a6b..4267bce710 100644 --- a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/networkServiceDesignVersions/operations.ts +++ b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/networkServiceDesignVersions/operations.ts @@ -54,7 +54,7 @@ export function _updateStateSend( publisherName: publisherName, networkServiceDesignGroupName: networkServiceDesignGroupName, networkServiceDesignVersionName: networkServiceDesignVersionName, - "api%2Dversion": context.apiVersion, + "api%2Dversion": context.apiVersion ?? "2025-03-30", }, { allowReserved: options?.requestOptions?.skipUrlEncoding, @@ -110,6 +110,7 @@ export function updateState( options, ), resourceLocationConfig: "location", + apiVersion: context.apiVersion ?? "2025-03-30", }) as PollerLike< OperationState, NetworkServiceDesignVersionUpdateState @@ -132,7 +133,7 @@ export function _listByNetworkServiceDesignGroupSend( resourceGroupName: resourceGroupName, publisherName: publisherName, networkServiceDesignGroupName: networkServiceDesignGroupName, - "api%2Dversion": context.apiVersion, + "api%2Dversion": context.apiVersion ?? "2025-03-30", }, { allowReserved: options?.requestOptions?.skipUrlEncoding, @@ -181,7 +182,7 @@ export function listByNetworkServiceDesignGroup( ), _listByNetworkServiceDesignGroupDeserialize, ["200"], - { itemName: "value", nextLinkName: "nextLink" }, + { itemName: "value", nextLinkName: "nextLink", apiVersion: context.apiVersion ?? "2025-03-30" }, ); } @@ -201,7 +202,7 @@ export function _$deleteSend( publisherName: publisherName, networkServiceDesignGroupName: networkServiceDesignGroupName, networkServiceDesignVersionName: networkServiceDesignVersionName, - "api%2Dversion": context.apiVersion, + "api%2Dversion": context.apiVersion ?? "2025-03-30", }, { allowReserved: options?.requestOptions?.skipUrlEncoding, @@ -248,6 +249,7 @@ export function $delete( options, ), resourceLocationConfig: "location", + apiVersion: context.apiVersion ?? "2025-03-30", }) as PollerLike, void>; } @@ -268,7 +270,7 @@ export function _updateSend( publisherName: publisherName, networkServiceDesignGroupName: networkServiceDesignGroupName, networkServiceDesignVersionName: networkServiceDesignVersionName, - "api%2Dversion": context.apiVersion, + "api%2Dversion": context.apiVersion ?? "2025-03-30", }, { allowReserved: options?.requestOptions?.skipUrlEncoding, @@ -336,7 +338,7 @@ export function _createOrUpdateSend( publisherName: publisherName, networkServiceDesignGroupName: networkServiceDesignGroupName, networkServiceDesignVersionName: networkServiceDesignVersionName, - "api%2Dversion": context.apiVersion, + "api%2Dversion": context.apiVersion ?? "2025-03-30", }, { allowReserved: options?.requestOptions?.skipUrlEncoding, @@ -389,6 +391,7 @@ export function createOrUpdate( options, ), resourceLocationConfig: "azure-async-operation", + apiVersion: context.apiVersion ?? "2025-03-30", }) as PollerLike, NetworkServiceDesignVersion>; } @@ -408,7 +411,7 @@ export function _getSend( publisherName: publisherName, networkServiceDesignGroupName: networkServiceDesignGroupName, networkServiceDesignVersionName: networkServiceDesignVersionName, - "api%2Dversion": context.apiVersion, + "api%2Dversion": context.apiVersion ?? "2025-03-30", }, { allowReserved: options?.requestOptions?.skipUrlEncoding, diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/operations/operations.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/operations/operations.ts index 0bf682b9bc..c58ac7361d 100644 --- a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/operations/operations.ts +++ b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/operations/operations.ts @@ -28,7 +28,7 @@ export function _listSend( const path = expandUrlTemplate( "/providers/Microsoft.HybridNetwork/operations{?api%2Dversion}", { - "api%2Dversion": context.apiVersion, + "api%2Dversion": context.apiVersion ?? "2025-03-30", }, { allowReserved: options?.requestOptions?.skipUrlEncoding, @@ -65,6 +65,6 @@ export function list( () => _listSend(context, options), _listDeserialize, ["200"], - { itemName: "value", nextLinkName: "nextLink" }, + { itemName: "value", nextLinkName: "nextLink", apiVersion: context.apiVersion ?? "2025-03-30" }, ); } diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/proxyArtifact/operations.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/proxyArtifact/operations.ts index caaea79185..e7541438f8 100644 --- a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/proxyArtifact/operations.ts +++ b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/proxyArtifact/operations.ts @@ -51,7 +51,7 @@ export function _updateStateSend( publisherName: publisherName, artifactStoreName: artifactStoreName, artifactVersionName: artifactVersionName, - "api%2Dversion": context.apiVersion, + "api%2Dversion": context.apiVersion ?? "2025-03-30", artifactName: artifactName, }, { @@ -110,6 +110,7 @@ export function updateState( options, ), resourceLocationConfig: "location", + apiVersion: context.apiVersion ?? "2025-03-30", }) as PollerLike< OperationState, ProxyArtifactVersionsListOverview @@ -131,7 +132,7 @@ export function _getSend( resourceGroupName: resourceGroupName, publisherName: publisherName, artifactStoreName: artifactStoreName, - "api%2Dversion": context.apiVersion, + "api%2Dversion": context.apiVersion ?? "2025-03-30", artifactName: artifactName, }, { @@ -174,7 +175,7 @@ export function get( _getSend(context, resourceGroupName, publisherName, artifactStoreName, artifactName, options), _getDeserialize, ["200"], - { itemName: "value", nextLinkName: "nextLink" }, + { itemName: "value", nextLinkName: "nextLink", apiVersion: context.apiVersion ?? "2025-03-30" }, ); } @@ -192,7 +193,7 @@ export function _listSend( resourceGroupName: resourceGroupName, publisherName: publisherName, artifactStoreName: artifactStoreName, - "api%2Dversion": context.apiVersion, + "api%2Dversion": context.apiVersion ?? "2025-03-30", }, { allowReserved: options?.requestOptions?.skipUrlEncoding, @@ -232,6 +233,6 @@ export function list( () => _listSend(context, resourceGroupName, publisherName, artifactStoreName, options), _listDeserialize, ["200"], - { itemName: "value", nextLinkName: "nextLink" }, + { itemName: "value", nextLinkName: "nextLink", apiVersion: context.apiVersion ?? "2025-03-30" }, ); } diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/publishers/operations.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/publishers/operations.ts index 0c90bbb34a..86497ee6b5 100644 --- a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/publishers/operations.ts +++ b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/publishers/operations.ts @@ -41,7 +41,7 @@ export function _listBySubscriptionSend( "/subscriptions/{subscriptionId}/providers/Microsoft.HybridNetwork/publishers{?api%2Dversion}", { subscriptionId: context.subscriptionId, - "api%2Dversion": context.apiVersion, + "api%2Dversion": context.apiVersion ?? "2025-03-30", }, { allowReserved: options?.requestOptions?.skipUrlEncoding, @@ -78,7 +78,7 @@ export function listBySubscription( () => _listBySubscriptionSend(context, options), _listBySubscriptionDeserialize, ["200"], - { itemName: "value", nextLinkName: "nextLink" }, + { itemName: "value", nextLinkName: "nextLink", apiVersion: context.apiVersion ?? "2025-03-30" }, ); } @@ -92,7 +92,7 @@ export function _listByResourceGroupSend( { subscriptionId: context.subscriptionId, resourceGroupName: resourceGroupName, - "api%2Dversion": context.apiVersion, + "api%2Dversion": context.apiVersion ?? "2025-03-30", }, { allowReserved: options?.requestOptions?.skipUrlEncoding, @@ -130,7 +130,7 @@ export function listByResourceGroup( () => _listByResourceGroupSend(context, resourceGroupName, options), _listByResourceGroupDeserialize, ["200"], - { itemName: "value", nextLinkName: "nextLink" }, + { itemName: "value", nextLinkName: "nextLink", apiVersion: context.apiVersion ?? "2025-03-30" }, ); } @@ -146,7 +146,7 @@ export function _$deleteSend( subscriptionId: context.subscriptionId, resourceGroupName: resourceGroupName, publisherName: publisherName, - "api%2Dversion": context.apiVersion, + "api%2Dversion": context.apiVersion ?? "2025-03-30", }, { allowReserved: options?.requestOptions?.skipUrlEncoding, @@ -183,6 +183,7 @@ export function $delete( abortSignal: options?.abortSignal, getInitialResponse: () => _$deleteSend(context, resourceGroupName, publisherName, options), resourceLocationConfig: "location", + apiVersion: context.apiVersion ?? "2025-03-30", }) as PollerLike, void>; } @@ -198,7 +199,7 @@ export function _updateSend( subscriptionId: context.subscriptionId, resourceGroupName: resourceGroupName, publisherName: publisherName, - "api%2Dversion": context.apiVersion, + "api%2Dversion": context.apiVersion ?? "2025-03-30", }, { allowReserved: options?.requestOptions?.skipUrlEncoding, @@ -250,7 +251,7 @@ export function _createOrUpdateSend( subscriptionId: context.subscriptionId, resourceGroupName: resourceGroupName, publisherName: publisherName, - "api%2Dversion": context.apiVersion, + "api%2Dversion": context.apiVersion ?? "2025-03-30", }, { allowReserved: options?.requestOptions?.skipUrlEncoding, @@ -294,6 +295,7 @@ export function createOrUpdate( getInitialResponse: () => _createOrUpdateSend(context, resourceGroupName, publisherName, options), resourceLocationConfig: "azure-async-operation", + apiVersion: context.apiVersion ?? "2025-03-30", }) as PollerLike, Publisher>; } @@ -309,7 +311,7 @@ export function _getSend( subscriptionId: context.subscriptionId, resourceGroupName: resourceGroupName, publisherName: publisherName, - "api%2Dversion": context.apiVersion, + "api%2Dversion": context.apiVersion ?? "2025-03-30", }, { allowReserved: options?.requestOptions?.skipUrlEncoding, diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/siteNetworkServices/operations.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/siteNetworkServices/operations.ts index 5cdbe789ff..f187d599b1 100644 --- a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/siteNetworkServices/operations.ts +++ b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/siteNetworkServices/operations.ts @@ -46,7 +46,7 @@ export function _cancelOperationSend( "/subscriptions/{subscriptionId}/providers/Microsoft.HybridNetwork/cancelSiteNetworkServiceOperation{?api%2Dversion}", { subscriptionId: context.subscriptionId, - "api%2Dversion": context.apiVersion, + "api%2Dversion": context.apiVersion ?? "2025-03-30", }, { allowReserved: options?.requestOptions?.skipUrlEncoding, @@ -83,6 +83,7 @@ export function cancelOperation( abortSignal: options?.abortSignal, getInitialResponse: () => _cancelOperationSend(context, parameters, options), resourceLocationConfig: "location", + apiVersion: context.apiVersion ?? "2025-03-30", }) as PollerLike, void>; } @@ -94,7 +95,7 @@ export function _listBySubscriptionSend( "/subscriptions/{subscriptionId}/providers/Microsoft.HybridNetwork/siteNetworkServices{?api%2Dversion}", { subscriptionId: context.subscriptionId, - "api%2Dversion": context.apiVersion, + "api%2Dversion": context.apiVersion ?? "2025-03-30", }, { allowReserved: options?.requestOptions?.skipUrlEncoding, @@ -131,7 +132,7 @@ export function listBySubscription( () => _listBySubscriptionSend(context, options), _listBySubscriptionDeserialize, ["200"], - { itemName: "value", nextLinkName: "nextLink" }, + { itemName: "value", nextLinkName: "nextLink", apiVersion: context.apiVersion ?? "2025-03-30" }, ); } @@ -145,7 +146,7 @@ export function _listByResourceGroupSend( { subscriptionId: context.subscriptionId, resourceGroupName: resourceGroupName, - "api%2Dversion": context.apiVersion, + "api%2Dversion": context.apiVersion ?? "2025-03-30", }, { allowReserved: options?.requestOptions?.skipUrlEncoding, @@ -183,7 +184,7 @@ export function listByResourceGroup( () => _listByResourceGroupSend(context, resourceGroupName, options), _listByResourceGroupDeserialize, ["200"], - { itemName: "value", nextLinkName: "nextLink" }, + { itemName: "value", nextLinkName: "nextLink", apiVersion: context.apiVersion ?? "2025-03-30" }, ); } @@ -199,7 +200,7 @@ export function _$deleteSend( subscriptionId: context.subscriptionId, resourceGroupName: resourceGroupName, siteNetworkServiceName: siteNetworkServiceName, - "api%2Dversion": context.apiVersion, + "api%2Dversion": context.apiVersion ?? "2025-03-30", }, { allowReserved: options?.requestOptions?.skipUrlEncoding, @@ -237,6 +238,7 @@ export function $delete( getInitialResponse: () => _$deleteSend(context, resourceGroupName, siteNetworkServiceName, options), resourceLocationConfig: "location", + apiVersion: context.apiVersion ?? "2025-03-30", }) as PollerLike, void>; } @@ -253,7 +255,7 @@ export function _updateTagsSend( subscriptionId: context.subscriptionId, resourceGroupName: resourceGroupName, siteNetworkServiceName: siteNetworkServiceName, - "api%2Dversion": context.apiVersion, + "api%2Dversion": context.apiVersion ?? "2025-03-30", }, { allowReserved: options?.requestOptions?.skipUrlEncoding, @@ -313,7 +315,7 @@ export function _createOrUpdateSend( subscriptionId: context.subscriptionId, resourceGroupName: resourceGroupName, siteNetworkServiceName: siteNetworkServiceName, - "api%2Dversion": context.apiVersion, + "api%2Dversion": context.apiVersion ?? "2025-03-30", }, { allowReserved: options?.requestOptions?.skipUrlEncoding, @@ -356,6 +358,7 @@ export function createOrUpdate( getInitialResponse: () => _createOrUpdateSend(context, resourceGroupName, siteNetworkServiceName, parameters, options), resourceLocationConfig: "azure-async-operation", + apiVersion: context.apiVersion ?? "2025-03-30", }) as PollerLike, SiteNetworkService>; } @@ -371,7 +374,7 @@ export function _getSend( subscriptionId: context.subscriptionId, resourceGroupName: resourceGroupName, siteNetworkServiceName: siteNetworkServiceName, - "api%2Dversion": context.apiVersion, + "api%2Dversion": context.apiVersion ?? "2025-03-30", }, { allowReserved: options?.requestOptions?.skipUrlEncoding, diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/sites/operations.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/sites/operations.ts index 13c6899f1a..d7d922dc59 100644 --- a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/sites/operations.ts +++ b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/sites/operations.ts @@ -42,7 +42,7 @@ export function _listBySubscriptionSend( "/subscriptions/{subscriptionId}/providers/Microsoft.HybridNetwork/sites{?api%2Dversion}", { subscriptionId: context.subscriptionId, - "api%2Dversion": context.apiVersion, + "api%2Dversion": context.apiVersion ?? "2025-03-30", }, { allowReserved: options?.requestOptions?.skipUrlEncoding, @@ -79,7 +79,7 @@ export function listBySubscription( () => _listBySubscriptionSend(context, options), _listBySubscriptionDeserialize, ["200"], - { itemName: "value", nextLinkName: "nextLink" }, + { itemName: "value", nextLinkName: "nextLink", apiVersion: context.apiVersion ?? "2025-03-30" }, ); } @@ -93,7 +93,7 @@ export function _listByResourceGroupSend( { subscriptionId: context.subscriptionId, resourceGroupName: resourceGroupName, - "api%2Dversion": context.apiVersion, + "api%2Dversion": context.apiVersion ?? "2025-03-30", }, { allowReserved: options?.requestOptions?.skipUrlEncoding, @@ -131,7 +131,7 @@ export function listByResourceGroup( () => _listByResourceGroupSend(context, resourceGroupName, options), _listByResourceGroupDeserialize, ["200"], - { itemName: "value", nextLinkName: "nextLink" }, + { itemName: "value", nextLinkName: "nextLink", apiVersion: context.apiVersion ?? "2025-03-30" }, ); } @@ -147,7 +147,7 @@ export function _$deleteSend( subscriptionId: context.subscriptionId, resourceGroupName: resourceGroupName, siteName: siteName, - "api%2Dversion": context.apiVersion, + "api%2Dversion": context.apiVersion ?? "2025-03-30", }, { allowReserved: options?.requestOptions?.skipUrlEncoding, @@ -184,6 +184,7 @@ export function $delete( abortSignal: options?.abortSignal, getInitialResponse: () => _$deleteSend(context, resourceGroupName, siteName, options), resourceLocationConfig: "location", + apiVersion: context.apiVersion ?? "2025-03-30", }) as PollerLike, void>; } @@ -200,7 +201,7 @@ export function _updateTagsSend( subscriptionId: context.subscriptionId, resourceGroupName: resourceGroupName, siteName: siteName, - "api%2Dversion": context.apiVersion, + "api%2Dversion": context.apiVersion ?? "2025-03-30", }, { allowReserved: options?.requestOptions?.skipUrlEncoding, @@ -252,7 +253,7 @@ export function _createOrUpdateSend( subscriptionId: context.subscriptionId, resourceGroupName: resourceGroupName, siteName: siteName, - "api%2Dversion": context.apiVersion, + "api%2Dversion": context.apiVersion ?? "2025-03-30", }, { allowReserved: options?.requestOptions?.skipUrlEncoding, @@ -293,6 +294,7 @@ export function createOrUpdate( getInitialResponse: () => _createOrUpdateSend(context, resourceGroupName, siteName, parameters, options), resourceLocationConfig: "azure-async-operation", + apiVersion: context.apiVersion ?? "2025-03-30", }) as PollerLike, Site>; } @@ -308,7 +310,7 @@ export function _getSend( subscriptionId: context.subscriptionId, resourceGroupName: resourceGroupName, siteName: siteName, - "api%2Dversion": context.apiVersion, + "api%2Dversion": context.apiVersion ?? "2025-03-30", }, { allowReserved: options?.requestOptions?.skipUrlEncoding, diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/restorePollerHelpers.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/restorePollerHelpers.ts index 3115f46d9b..4f9a1e7dd7 100644 --- a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/restorePollerHelpers.ts +++ b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/restorePollerHelpers.ts @@ -114,6 +114,7 @@ export function restorePoller( `Please ensure the operation is in this client! We can't find its deserializeHelper for ${sourceOperation?.name}.`, ); } + const apiVersion = getApiVersionFromUrl(initialRequestUrl); return getLongRunningPoller( (client as any)["_client"] ?? client, deserializeHelper as (result: TResponse) => Promise, @@ -124,6 +125,7 @@ export function restorePoller( resourceLocationConfig, restoreFrom: serializedState, initialRequestUrl, + apiVersion, }, ); } @@ -335,3 +337,8 @@ function getPathFromMapKey(mapKey: string): string { const pathStart = mapKey.indexOf("/"); return mapKey.slice(pathStart); } + +function getApiVersionFromUrl(urlStr: string): string | undefined { + const url = new URL(urlStr); + return url.searchParams.get("api-version") ?? undefined; +} diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/static-helpers/pagingHelpers.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/static-helpers/pagingHelpers.ts index 5a3472a3f0..8412742a96 100644 --- a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/static-helpers/pagingHelpers.ts +++ b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/static-helpers/pagingHelpers.ts @@ -80,6 +80,7 @@ export interface BuildPagedAsyncIteratorOptions { itemName?: string; nextLinkName?: string; nextLinkMethod?: "GET" | "POST"; + apiVersion?: string; } /** @@ -100,14 +101,19 @@ export function buildPagedAsyncIterator< const itemName = options.itemName ?? "value"; const nextLinkName = options.nextLinkName ?? "nextLink"; const nextLinkMethod = options.nextLinkMethod ?? "GET"; + const apiVersion = options.apiVersion; const pagedResult: PagedResult = { getPage: async (pageLink?: string) => { - const result = - pageLink === undefined - ? await getInitialResponse() - : nextLinkMethod === "POST" - ? await client.pathUnchecked(pageLink).post() - : await client.pathUnchecked(pageLink).get(); + let result; + if (pageLink === undefined) { + result = await getInitialResponse(); + } else { + const resolvedPageLink = apiVersion ? addApiVersionToUrl(pageLink, apiVersion) : pageLink; + result = + nextLinkMethod === "POST" + ? await client.pathUnchecked(resolvedPageLink).post() + : await client.pathUnchecked(resolvedPageLink).get(); + } checkPagingRequest(result, expectedStatuses); const results = await processResponseBody(result as TResponse); const nextLink = getNextLink(results, nextLinkName); @@ -243,3 +249,21 @@ function checkPagingRequest(response: PathUncheckedResponse, expectedStatuses: s ); } } + +/** + * Adds the api-version query parameter on a URL if it's not present. + * @param url - the URL to modify + * @param apiVersion - the API version to set + * @returns - the URL with the api-version query parameter set + */ +function addApiVersionToUrl(url: string, apiVersion: string): string { + // The base URL is only used for parsing and won't appear in the returned URL + const urlObj = new URL(url, "https://microsoft.com"); + if (!urlObj.searchParams.get("api-version")) { + // Append one if there is no apiVersion + return `${url}${ + Array.from(urlObj.searchParams.keys()).length > 0 ? "&" : "?" + }api-version=${apiVersion}`; + } + return url; +} diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/static-helpers/pollingHelpers.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/static-helpers/pollingHelpers.ts index f01c41bab6..b1bb018377 100644 --- a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/static-helpers/pollingHelpers.ts +++ b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/static-helpers/pollingHelpers.ts @@ -37,6 +37,10 @@ export interface GetLongRunningPollerOptions { * The function to get the initial response */ getInitialResponse?: () => PromiseLike; + /** + * The api-version of the LRO + */ + apiVersion?: string; } export function getLongRunningPoller( client: Client, @@ -44,7 +48,7 @@ export function getLongRunningPoller, ): PollerLike, TResult> { - const { restoreFrom, getInitialResponse } = options; + const { restoreFrom, getInitialResponse, apiVersion } = options; if (!restoreFrom && !getInitialResponse) { throw new Error("Either restoreFrom or getInitialResponse must be specified"); } @@ -83,7 +87,8 @@ export function getLongRunningPoller( }, }; } + +/** + * Adds the api-version query parameter on a URL if it's not present. + * @param url - the URL to modify + * @param apiVersion - the API version to set + * @returns - the URL with the api-version query parameter set + */ +function addApiVersionToUrl(url: string, apiVersion: string): string { + // The base URL is only used for parsing and won't appear in the returned URL + const urlObj = new URL(url, "https://microsoft.com"); + if (!urlObj.searchParams.get("api-version")) { + // Append one if there is no apiVersion + return `${url}${ + Array.from(urlObj.searchParams.keys()).length > 0 ? "&" : "?" + }api-version=${apiVersion}`; + } + return url; +} diff --git a/packages/typespec-test/test/NetworkAnalytics.Management/generated/typespec-ts/sdk/test/arm-test/review/arm-networkanalytics.api.md b/packages/typespec-test/test/NetworkAnalytics.Management/generated/typespec-ts/sdk/test/arm-test/review/arm-networkanalytics.api.md index ae7897fc73..79c78bc81a 100644 --- a/packages/typespec-test/test/NetworkAnalytics.Management/generated/typespec-ts/sdk/test/arm-test/review/arm-networkanalytics.api.md +++ b/packages/typespec-test/test/NetworkAnalytics.Management/generated/typespec-ts/sdk/test/arm-test/review/arm-networkanalytics.api.md @@ -207,6 +207,8 @@ export interface DataProductsOperations { beginCreate: (resourceGroupName: string, dataProductName: string, resource: DataProduct, options?: DataProductsCreateOptionalParams) => Promise, DataProduct>>; // @deprecated (undocumented) beginCreateAndWait: (resourceGroupName: string, dataProductName: string, resource: DataProduct, options?: DataProductsCreateOptionalParams) => Promise; + // Warning: (ae-forgotten-export) The symbol "SimplePollerLike" needs to be exported by the entry point index.d.ts + // // @deprecated (undocumented) beginDelete: (resourceGroupName: string, dataProductName: string, options?: DataProductsDeleteOptionalParams) => Promise, void>>; // @deprecated (undocumented) @@ -602,28 +604,6 @@ export interface RoleAssignmentDetail { userName: string; } -// @public -export interface SimplePollerLike, TResult> { - getOperationState(): TState; - getResult(): TResult | undefined; - isDone(): boolean; - // @deprecated - isStopped(): boolean; - onProgress(callback: (state: TState) => void): CancelOnProgress; - poll(options?: { - abortSignal?: AbortSignalLike; - }): Promise; - pollUntilDone(pollOptions?: { - abortSignal?: AbortSignalLike; - }): Promise; - serialize(): Promise; - // @deprecated - stopPolling(): void; - submitted(): Promise; - // @deprecated - toString(): string; -} - // @public export interface SystemData { createdAt?: Date; diff --git a/packages/typespec-test/test/NetworkAnalytics.Management/generated/typespec-ts/sdk/test/arm-test/src/index.ts b/packages/typespec-test/test/NetworkAnalytics.Management/generated/typespec-ts/sdk/test/arm-test/src/index.ts index 4f90224b22..99e90ff555 100644 --- a/packages/typespec-test/test/NetworkAnalytics.Management/generated/typespec-ts/sdk/test/arm-test/src/index.ts +++ b/packages/typespec-test/test/NetworkAnalytics.Management/generated/typespec-ts/sdk/test/arm-test/src/index.ts @@ -9,7 +9,6 @@ import { } from "./static-helpers/pagingHelpers.js"; export { NetworkAnalyticsApi } from "./networkAnalyticsApi.js"; -export { SimplePollerLike } from "./static-helpers/simplePollerHelpers.js"; export { restorePoller, RestorePollerOptions } from "./restorePollerHelpers.js"; export { Operation, diff --git a/packages/typespec-test/test/authoring/generated/typespec-ts/review/authoring.api.md b/packages/typespec-test/test/authoring/generated/typespec-ts/review/authoring.api.md index 72f95c13f7..bb255e88db 100644 --- a/packages/typespec-test/test/authoring/generated/typespec-ts/review/authoring.api.md +++ b/packages/typespec-test/test/authoring/generated/typespec-ts/review/authoring.api.md @@ -30,7 +30,7 @@ export interface AuthoringClientOptions extends ClientOptions { } // @public -function createClient(endpointParam: string, credentials: KeyCredential, input?: AuthoringClientOptions): AuthoringClient; +function createClient(endpointParam: string, credentials: KeyCredential, { apiVersion, ...options }?: AuthoringClientOptions): AuthoringClient; export default createClient; // @public (undocumented) diff --git a/packages/typespec-test/test/confidentialLedger/generated/typespec-ts/review/confidential-ledger.api.md b/packages/typespec-test/test/confidentialLedger/generated/typespec-ts/review/confidential-ledger.api.md index b33ef3a6c7..aa724927cd 100644 --- a/packages/typespec-test/test/confidentialLedger/generated/typespec-ts/review/confidential-ledger.api.md +++ b/packages/typespec-test/test/confidentialLedger/generated/typespec-ts/review/confidential-ledger.api.md @@ -30,7 +30,7 @@ export interface ConfidentialLedgerClientOptions extends ClientOptions { } // @public -function createClient(ledgerUri: string, credentials: TokenCredential, input?: ConfidentialLedgerClientOptions): ConfidentialLedgerClient; +function createClient(ledgerUri: string, credentials: TokenCredential, { apiVersion, ...options }?: ConfidentialLedgerClientOptions): ConfidentialLedgerClient; export default createClient; // @public (undocumented) diff --git a/packages/typespec-test/test/contoso/generated/typespec-ts/review/contosowidgetmanager-rest.api.md b/packages/typespec-test/test/contoso/generated/typespec-ts/review/contosowidgetmanager-rest.api.md index 8f88896e45..2b8b485f44 100644 --- a/packages/typespec-test/test/contoso/generated/typespec-ts/review/contosowidgetmanager-rest.api.md +++ b/packages/typespec-test/test/contoso/generated/typespec-ts/review/contosowidgetmanager-rest.api.md @@ -19,7 +19,7 @@ import type { RequestParameters } from '@azure-rest/core-client'; import type { StreamableMethod } from '@azure-rest/core-client'; // @public -function createClient(endpointParam: string, input?: WidgetManagerClientOptions): WidgetManagerClient; +function createClient(endpointParam: string, { apiVersion, ...options }?: WidgetManagerClientOptions): WidgetManagerClient; export default createClient; // @public (undocumented) diff --git a/packages/typespec-test/test/customWrapper/generated/typespec-ts/review/customWrapper.api.md b/packages/typespec-test/test/customWrapper/generated/typespec-ts/review/customWrapper.api.md index 53fe360fc8..6a7df58d40 100644 --- a/packages/typespec-test/test/customWrapper/generated/typespec-ts/review/customWrapper.api.md +++ b/packages/typespec-test/test/customWrapper/generated/typespec-ts/review/customWrapper.api.md @@ -24,7 +24,7 @@ export interface AuthoringClientOptions extends ClientOptions { } // @public -function createClient(endpointParam: string, credentials: KeyCredential, input?: AuthoringClientOptions): AuthoringClient; +function createClient(endpointParam: string, credentials: KeyCredential, { apiVersion, ...options }?: AuthoringClientOptions): AuthoringClient; export default createClient; // @public diff --git a/packages/typespec-test/test/faceai/generated/typespec-ts/review/ai-face-rest.api.md b/packages/typespec-test/test/faceai/generated/typespec-ts/review/ai-face-rest.api.md index 4fbc666fc5..9e45011c52 100644 --- a/packages/typespec-test/test/faceai/generated/typespec-ts/review/ai-face-rest.api.md +++ b/packages/typespec-test/test/faceai/generated/typespec-ts/review/ai-face-rest.api.md @@ -504,7 +504,7 @@ export interface BlurPropertiesOutput { } // @public -function createClient(endpointParam: string, credentials: TokenCredential | KeyCredential, input?: FaceClientOptions): FaceClient; +function createClient(endpointParam: string, credentials: TokenCredential | KeyCredential, { apiVersion, ...options }?: FaceClientOptions): FaceClient; export default createClient; // @public diff --git a/packages/typespec-test/test/healthInsights_trialmatcher/generated/typespec-ts/review/health-insights-clinicalmatching.api.md b/packages/typespec-test/test/healthInsights_trialmatcher/generated/typespec-ts/review/health-insights-clinicalmatching.api.md index abb6ca859d..62dc160117 100644 --- a/packages/typespec-test/test/healthInsights_trialmatcher/generated/typespec-ts/review/health-insights-clinicalmatching.api.md +++ b/packages/typespec-test/test/healthInsights_trialmatcher/generated/typespec-ts/review/health-insights-clinicalmatching.api.md @@ -191,7 +191,7 @@ export interface ContactDetailsOutput { } // @public -function createClient(endpointParam: string, credentials: KeyCredential, input?: HealthInsightsClinicalMatchingClientOptions): HealthInsightsClinicalMatchingClient; +function createClient(endpointParam: string, credentials: KeyCredential, { apiVersion, ...options }?: HealthInsightsClinicalMatchingClientOptions): HealthInsightsClinicalMatchingClient; export default createClient; // @public (undocumented) diff --git a/packages/typespec-test/test/loadTest/generated/typespec-ts/review/load-testing.api.md b/packages/typespec-test/test/loadTest/generated/typespec-ts/review/load-testing.api.md index c11a48276f..dac0ef4a3f 100644 --- a/packages/typespec-test/test/loadTest/generated/typespec-ts/review/load-testing.api.md +++ b/packages/typespec-test/test/loadTest/generated/typespec-ts/review/load-testing.api.md @@ -71,7 +71,7 @@ export type CertificateType = "AKV_CERT_URI"; export type CertificateTypeOutput = "AKV_CERT_URI"; // @public -function createClient(endpointParam: string, credentials: TokenCredential, input?: AzureLoadTestingClientOptions): AzureLoadTestingClient; +function createClient(endpointParam: string, credentials: TokenCredential, { apiVersion, ...options }?: AzureLoadTestingClientOptions): AzureLoadTestingClient; export default createClient; // @public diff --git a/packages/typespec-test/test/openai/generated/typespec-ts/review/openai.api.md b/packages/typespec-test/test/openai/generated/typespec-ts/review/openai.api.md index 3ed43ecfab..32548426ce 100644 --- a/packages/typespec-test/test/openai/generated/typespec-ts/review/openai.api.md +++ b/packages/typespec-test/test/openai/generated/typespec-ts/review/openai.api.md @@ -237,7 +237,7 @@ export interface ContentFilterResultsOutput { export type ContentFilterSeverityOutput = "safe" | "low" | "medium" | "high"; // @public -function createClient(endpointParam: string, credentials: TokenCredential | KeyCredential, input?: OpenAIClientOptions): OpenAIClient; +function createClient(endpointParam: string, credentials: TokenCredential | KeyCredential, { apiVersion, ...options }?: OpenAIClientOptions): OpenAIClient; export default createClient; // @public diff --git a/packages/typespec-test/test/translator/generated/typespec-ts/review/cognitiveservices-translator.api.md b/packages/typespec-test/test/translator/generated/typespec-ts/review/cognitiveservices-translator.api.md index 90626e1505..35305cfa57 100644 --- a/packages/typespec-test/test/translator/generated/typespec-ts/review/cognitiveservices-translator.api.md +++ b/packages/typespec-test/test/translator/generated/typespec-ts/review/cognitiveservices-translator.api.md @@ -106,7 +106,7 @@ export interface CommonScriptModelOutput { } // @public -function createClient(endpointParam: string, input?: TranslatorClientOptions): TranslatorClient; +function createClient(endpointParam: string, { apiVersion, ...options }?: TranslatorClientOptions): TranslatorClient; export default createClient; // @public (undocumented) From 9da93cb17c0d55753f956f549dd04213c65d9741 Mon Sep 17 00:00:00 2001 From: "Jiao Di (MSFT)" Date: Mon, 2 Feb 2026 14:24:44 +0800 Subject: [PATCH 04/10] update --- .../2025-03-30/ArtifactManifestCreate.json | 79 - .../2025-03-30/ArtifactManifestDelete.json | 20 - .../2025-03-30/ArtifactManifestGet.json | 38 - .../ArtifactManifestListByArtifactStore.json | 41 - .../ArtifactManifestListCredential.json | 26 - .../ArtifactManifestUpdateState.json | 27 - .../ArtifactManifestUpdateTags.json | 48 - .../ArtifactStoreAddNFCEndPoints.json | 25 - .../ArtifactStoreApprovePrivateEndPoints.json | 25 - .../2025-03-30/ArtifactStoreCreate.json | 58 - .../ArtifactStoreCreateContainer.json | 61 - .../ArtifactStoreCreateStorage.json | 61 - .../2025-03-30/ArtifactStoreDelete.json | 19 - .../ArtifactStoreDeleteNFCEndPoints.json | 25 - .../examples/2025-03-30/ArtifactStoreGet.json | 30 - .../ArtifactStoreListNFCEndPoints.json | 31 - .../ArtifactStoreListPrivateEndPoints.json | 31 - .../ArtifactStoreRemovePrivateEndPoints.json | 25 - .../2025-03-30/ArtifactStoreUpdateTags.json | 40 - .../ArtifactStoresListByPublisherName.json | 33 - .../VirtualNetworkFunctionCreate.json | 76 - ...etworkFunctionDefinitionVersionCreate.json | 228 -- ...etworkFunctionDefinitionVersionDelete.json | 20 - ...alNetworkFunctionDefinitionVersionGet.json | 87 - .../VirtualNetworkFunctionDelete.json | 19 - .../AzureCore/VirtualNetworkFunctionGet.json | 33 - .../VirtualNetworkFunctionCreate.json | 72 - ...etworkFunctionDefinitionVersionCreate.json | 228 -- ...etworkFunctionDefinitionVersionDelete.json | 20 - ...alNetworkFunctionDefinitionVersionGet.json | 87 - .../VirtualNetworkFunctionDelete.json | 19 - .../VirtualNetworkFunctionGet.json | 33 - .../examples/2025-03-30/ComponentGet.json | 59 - .../ComponentListByNetworkFunction.json | 63 - .../ConfigurationGroupSchemaCreate.json | 62 - .../ConfigurationGroupSchemaDelete.json | 19 - .../ConfigurationGroupSchemaGet.json | 34 - ...urationGroupSchemaListByPublisherName.json | 37 - .../ConfigurationGroupSchemaUpdateTags.json | 44 - ...gurationGroupSchemaVersionUpdateState.json | 26 - .../ConfigurationGroupValueCreate.json | 83 - .../ConfigurationGroupValueCreateSecret.json | 81 - .../ConfigurationGroupValueDelete.json | 18 - ...nfigurationGroupValueFirstPartyCreate.json | 81 - .../ConfigurationGroupValueGet.json | 42 - ...gurationGroupValueListByResourceGroup.json | 43 - ...igurationGroupValueListBySubscription.json | 46 - .../ConfigurationGroupValueUpdateTags.json | 51 - .../examples/2025-03-30/GetOperations.json | 26 - .../2025-03-30/NetworkFunctionCreate.json | 88 - .../NetworkFunctionCreateSecret.json | 86 - .../NetworkFunctionDefinitionGroupCreate.json | 34 - .../NetworkFunctionDefinitionGroupDelete.json | 19 - .../NetworkFunctionDefinitionGroupGet.json | 24 - ...workFunctionDefinitionGroupUpdateTags.json | 32 - ...onDefinitionGroupsListByPublisherName.json | 25 - ...etworkFunctionDefinitionVersionCreate.json | 198 - ...etworkFunctionDefinitionVersionDelete.json | 20 - .../NetworkFunctionDefinitionVersionGet.json | 65 - ...nListByNetworkFunctionDefinitionGroup.json | 80 - ...kFunctionDefinitionVersionUpdateState.json | 27 - ...rkFunctionDefinitionVersionUpdateTags.json | 75 - .../2025-03-30/NetworkFunctionDelete.json | 19 - .../NetworkFunctionFirstPartyCreate.json | 86 - .../2025-03-30/NetworkFunctionGet.json | 41 - .../NetworkFunctionListByResourceGroup.json | 45 - .../NetworkFunctionListBySubscription.json | 44 - .../2025-03-30/NetworkFunctionUpdateTags.json | 51 - .../NetworkFunctionsExecuteRequest.json | 27 - .../NetworkServiceDesignGroupCreate.json | 38 - .../NetworkServiceDesignGroupDelete.json | 19 - .../NetworkServiceDesignGroupGet.json | 24 - .../NetworkServiceDesignGroupUpdateTags.json | 34 - ...erviceDesignGroupsListByPublisherName.json | 27 - .../NetworkServiceDesignVersionCreate.json | 117 - .../NetworkServiceDesignVersionDelete.json | 20 - .../NetworkServiceDesignVersionGet.json | 56 - ...ersionListByNetworkServiceDesignGroup.json | 53 - ...etworkServiceDesignVersionUpdateState.json | 27 - ...NetworkServiceDesignVersionUpdateTags.json | 60 - .../examples/2025-03-30/PublisherCreate.json | 42 - .../examples/2025-03-30/PublisherDelete.json | 18 - .../examples/2025-03-30/PublisherGet.json | 24 - .../PublisherListByResourceGroup.json | 37 - .../PublisherListBySubscription.json | 36 - .../2025-03-30/PublisherUpdateTags.json | 34 - .../ArtifactChangeState.json | 37 - .../PureProxyArtifact/ArtifactGet.json | 41 - .../PureProxyArtifact/ArtifactList.json | 30 - .../examples/2025-03-30/SiteCreate.json | 118 - .../examples/2025-03-30/SiteDelete.json | 18 - .../examples/2025-03-30/SiteGet.json | 52 - .../2025-03-30/SiteListByResourceGroup.json | 40 - .../2025-03-30/SiteListBySubscription.json | 40 - .../2025-03-30/SiteNetworkServiceCreate.json | 112 - .../2025-03-30/SiteNetworkServiceDelete.json | 18 - .../SiteNetworkServiceFirstPartyCreate.json | 110 - .../2025-03-30/SiteNetworkServiceGet.json | 52 - ...SiteNetworkServiceListByResourceGroup.json | 55 - .../SiteNetworkServiceListBySubscription.json | 54 - .../SiteNetworkServiceUpdateTags.json | 63 - ...workServicesCancelOngoingPUTOperation.json | 21 - .../examples/2025-03-30/SiteUpdateTags.json | 48 - .../generated/typespec-ts/sample.env | 1 - .../artifactManifestsCreateOrUpdateSample.ts | 39 - .../artifactManifestsDeleteSample.ts | 24 - .../samples-dev/artifactManifestsGetSample.ts | 30 - ...ifactManifestsListByArtifactStoreSample.ts | 33 - .../artifactManifestsListCredentialSample.ts | 30 - .../artifactManifestsUpdateSample.ts | 31 - .../artifactManifestsUpdateStateSample.ts | 31 - ...dNetworkFabricControllerEndPointsSample.ts | 35 - ...factStoresApprovePrivateEndPointsSample.ts | 30 - .../artifactStoresCreateOrUpdateSample.ts | 93 - ...eNetworkFabricControllerEndPointsSample.ts | 35 - .../samples-dev/artifactStoresDeleteSample.ts | 24 - .../samples-dev/artifactStoresGetSample.ts | 25 - .../artifactStoresListByPublisherSample.ts | 29 - ...kFabricControllerPrivateEndPointsSample.ts | 29 - ...rtifactStoresListPrivateEndPointsSample.ts | 29 - ...ifactStoresRemovePrivateEndPointsSample.ts | 30 - .../samples-dev/artifactStoresUpdateSample.ts | 27 - .../samples-dev/componentsGetSample.ts | 25 - .../componentsListByNetworkFunctionSample.ts | 29 - ...urationGroupSchemasCreateOrUpdateSample.ts | 37 - .../configurationGroupSchemasDeleteSample.ts | 28 - .../configurationGroupSchemasGetSample.ts | 29 - ...rationGroupSchemasListByPublisherSample.ts | 32 - .../configurationGroupSchemasUpdateSample.ts | 30 - ...figurationGroupSchemasUpdateStateSample.ts | 30 - ...gurationGroupValuesCreateOrUpdateSample.ts | 100 - .../configurationGroupValuesDeleteSample.ts | 24 - .../configurationGroupValuesGetSample.ts | 25 - ...ionGroupValuesListByResourceGroupSample.ts | 29 - ...tionGroupValuesListBySubscriptionSample.ts | 29 - ...onfigurationGroupValuesUpdateTagsSample.ts | 29 - ...ionDefinitionGroupsCreateOrUpdateSample.ts | 30 - ...orkFunctionDefinitionGroupsDeleteSample.ts | 28 - ...etworkFunctionDefinitionGroupsGetSample.ts | 29 - ...onDefinitionGroupsListByPublisherSample.ts | 32 - ...orkFunctionDefinitionGroupsUpdateSample.ts | 30 - ...nDefinitionVersionsCreateOrUpdateSample.ts | 235 -- ...kFunctionDefinitionVersionsDeleteSample.ts | 67 - ...workFunctionDefinitionVersionsGetSample.ts | 70 - ...tByNetworkFunctionDefinitionGroupSample.ts | 33 - ...kFunctionDefinitionVersionsUpdateSample.ts | 31 - ...tionDefinitionVersionsUpdateStateSample.ts | 31 - .../networkFunctionsCreateOrUpdateSample.ts | 168 - .../networkFunctionsDeleteSample.ts | 52 - .../networkFunctionsExecuteRequestSample.ts | 33 - .../samples-dev/networkFunctionsGetSample.ts | 55 - ...tworkFunctionsListByResourceGroupSample.ts | 29 - ...etworkFunctionsListBySubscriptionSample.ts | 29 - .../networkFunctionsUpdateTagsSample.ts | 27 - ...ServiceDesignGroupsCreateOrUpdateSample.ts | 30 - .../networkServiceDesignGroupsDeleteSample.ts | 28 - .../networkServiceDesignGroupsGetSample.ts | 29 - ...erviceDesignGroupsListByPublisherSample.ts | 32 - .../networkServiceDesignGroupsUpdateSample.ts | 30 - ...rviceDesignVersionsCreateOrUpdateSample.ts | 42 - ...etworkServiceDesignVersionsDeleteSample.ts | 29 - .../networkServiceDesignVersionsGetSample.ts | 30 - ...nsListByNetworkServiceDesignGroupSample.ts | 33 - ...etworkServiceDesignVersionsUpdateSample.ts | 31 - ...kServiceDesignVersionsUpdateStateSample.ts | 31 - .../samples-dev/operationsListSample.ts | 29 - .../samples-dev/proxyArtifactGetSample.ts | 34 - .../samples-dev/proxyArtifactListSample.ts | 33 - .../proxyArtifactUpdateStateSample.ts | 32 - .../publishersCreateOrUpdateSample.ts | 27 - .../samples-dev/publishersDeleteSample.ts | 24 - .../samples-dev/publishersGetSample.ts | 25 - .../publishersListByResourceGroupSample.ts | 29 - .../publishersListBySubscriptionSample.ts | 29 - .../samples-dev/publishersUpdateSample.ts | 27 - ...iteNetworkServicesCancelOperationSample.ts | 29 - ...siteNetworkServicesCreateOrUpdateSample.ts | 82 - .../siteNetworkServicesDeleteSample.ts | 24 - .../siteNetworkServicesGetSample.ts | 25 - ...etworkServicesListByResourceGroupSample.ts | 29 - ...NetworkServicesListBySubscriptionSample.ts | 29 - .../siteNetworkServicesUpdateTagsSample.ts | 27 - .../samples-dev/sitesCreateOrUpdateSample.ts | 46 - .../samples-dev/sitesDeleteSample.ts | 24 - .../typespec-ts/samples-dev/sitesGetSample.ts | 25 - .../sitesListByResourceGroupSample.ts | 29 - .../sitesListBySubscriptionSample.ts | 29 - .../samples-dev/sitesUpdateTagsSample.ts | 27 - .../generated/typespec-ts/tsconfig.json | 7 +- .../typespec-ts/review/authoring.api.md | 2 +- .../generated/openapi/openapi.json | 851 ---- .../review/confidential-ledger.api.md | 2 +- .../review/contosowidgetmanager-rest.api.md | 2 +- .../typespec-ts/review/customWrapper.api.md | 2 +- .../typespec-ts/review/ai-face-rest.api.md | 2 +- .../health-insights-clinicalmatching.api.md | 2 +- .../generated/openapi/2022-11-01/openapi.json | 3523 ----------------- .../typespec-ts/review/load-testing.api.md | 2 +- .../typespec-ts/review/openai.api.md | 2 +- .../cognitiveservices-translator.api.md | 2 +- 200 files changed, 11 insertions(+), 12678 deletions(-) delete mode 100644 packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ArtifactManifestCreate.json delete mode 100644 packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ArtifactManifestDelete.json delete mode 100644 packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ArtifactManifestGet.json delete mode 100644 packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ArtifactManifestListByArtifactStore.json delete mode 100644 packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ArtifactManifestListCredential.json delete mode 100644 packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ArtifactManifestUpdateState.json delete mode 100644 packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ArtifactManifestUpdateTags.json delete mode 100644 packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ArtifactStoreAddNFCEndPoints.json delete mode 100644 packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ArtifactStoreApprovePrivateEndPoints.json delete mode 100644 packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ArtifactStoreCreate.json delete mode 100644 packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ArtifactStoreCreateContainer.json delete mode 100644 packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ArtifactStoreCreateStorage.json delete mode 100644 packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ArtifactStoreDelete.json delete mode 100644 packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ArtifactStoreDeleteNFCEndPoints.json delete mode 100644 packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ArtifactStoreGet.json delete mode 100644 packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ArtifactStoreListNFCEndPoints.json delete mode 100644 packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ArtifactStoreListPrivateEndPoints.json delete mode 100644 packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ArtifactStoreRemovePrivateEndPoints.json delete mode 100644 packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ArtifactStoreUpdateTags.json delete mode 100644 packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ArtifactStoresListByPublisherName.json delete mode 100644 packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/AzureCore/VirtualNetworkFunctionCreate.json delete mode 100644 packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/AzureCore/VirtualNetworkFunctionDefinitionVersionCreate.json delete mode 100644 packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/AzureCore/VirtualNetworkFunctionDefinitionVersionDelete.json delete mode 100644 packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/AzureCore/VirtualNetworkFunctionDefinitionVersionGet.json delete mode 100644 packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/AzureCore/VirtualNetworkFunctionDelete.json delete mode 100644 packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/AzureCore/VirtualNetworkFunctionGet.json delete mode 100644 packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/AzureOperatorNexus/VirtualNetworkFunctionCreate.json delete mode 100644 packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/AzureOperatorNexus/VirtualNetworkFunctionDefinitionVersionCreate.json delete mode 100644 packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/AzureOperatorNexus/VirtualNetworkFunctionDefinitionVersionDelete.json delete mode 100644 packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/AzureOperatorNexus/VirtualNetworkFunctionDefinitionVersionGet.json delete mode 100644 packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/AzureOperatorNexus/VirtualNetworkFunctionDelete.json delete mode 100644 packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/AzureOperatorNexus/VirtualNetworkFunctionGet.json delete mode 100644 packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ComponentGet.json delete mode 100644 packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ComponentListByNetworkFunction.json delete mode 100644 packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ConfigurationGroupSchemaCreate.json delete mode 100644 packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ConfigurationGroupSchemaDelete.json delete mode 100644 packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ConfigurationGroupSchemaGet.json delete mode 100644 packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ConfigurationGroupSchemaListByPublisherName.json delete mode 100644 packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ConfigurationGroupSchemaUpdateTags.json delete mode 100644 packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ConfigurationGroupSchemaVersionUpdateState.json delete mode 100644 packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ConfigurationGroupValueCreate.json delete mode 100644 packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ConfigurationGroupValueCreateSecret.json delete mode 100644 packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ConfigurationGroupValueDelete.json delete mode 100644 packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ConfigurationGroupValueFirstPartyCreate.json delete mode 100644 packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ConfigurationGroupValueGet.json delete mode 100644 packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ConfigurationGroupValueListByResourceGroup.json delete mode 100644 packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ConfigurationGroupValueListBySubscription.json delete mode 100644 packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ConfigurationGroupValueUpdateTags.json delete mode 100644 packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/GetOperations.json delete mode 100644 packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkFunctionCreate.json delete mode 100644 packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkFunctionCreateSecret.json delete mode 100644 packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkFunctionDefinitionGroupCreate.json delete mode 100644 packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkFunctionDefinitionGroupDelete.json delete mode 100644 packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkFunctionDefinitionGroupGet.json delete mode 100644 packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkFunctionDefinitionGroupUpdateTags.json delete mode 100644 packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkFunctionDefinitionGroupsListByPublisherName.json delete mode 100644 packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkFunctionDefinitionVersionCreate.json delete mode 100644 packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkFunctionDefinitionVersionDelete.json delete mode 100644 packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkFunctionDefinitionVersionGet.json delete mode 100644 packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkFunctionDefinitionVersionListByNetworkFunctionDefinitionGroup.json delete mode 100644 packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkFunctionDefinitionVersionUpdateState.json delete mode 100644 packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkFunctionDefinitionVersionUpdateTags.json delete mode 100644 packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkFunctionDelete.json delete mode 100644 packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkFunctionFirstPartyCreate.json delete mode 100644 packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkFunctionGet.json delete mode 100644 packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkFunctionListByResourceGroup.json delete mode 100644 packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkFunctionListBySubscription.json delete mode 100644 packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkFunctionUpdateTags.json delete mode 100644 packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkFunctionsExecuteRequest.json delete mode 100644 packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkServiceDesignGroupCreate.json delete mode 100644 packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkServiceDesignGroupDelete.json delete mode 100644 packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkServiceDesignGroupGet.json delete mode 100644 packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkServiceDesignGroupUpdateTags.json delete mode 100644 packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkServiceDesignGroupsListByPublisherName.json delete mode 100644 packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkServiceDesignVersionCreate.json delete mode 100644 packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkServiceDesignVersionDelete.json delete mode 100644 packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkServiceDesignVersionGet.json delete mode 100644 packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkServiceDesignVersionListByNetworkServiceDesignGroup.json delete mode 100644 packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkServiceDesignVersionUpdateState.json delete mode 100644 packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkServiceDesignVersionUpdateTags.json delete mode 100644 packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/PublisherCreate.json delete mode 100644 packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/PublisherDelete.json delete mode 100644 packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/PublisherGet.json delete mode 100644 packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/PublisherListByResourceGroup.json delete mode 100644 packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/PublisherListBySubscription.json delete mode 100644 packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/PublisherUpdateTags.json delete mode 100644 packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/PureProxyArtifact/ArtifactChangeState.json delete mode 100644 packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/PureProxyArtifact/ArtifactGet.json delete mode 100644 packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/PureProxyArtifact/ArtifactList.json delete mode 100644 packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/SiteCreate.json delete mode 100644 packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/SiteDelete.json delete mode 100644 packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/SiteGet.json delete mode 100644 packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/SiteListByResourceGroup.json delete mode 100644 packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/SiteListBySubscription.json delete mode 100644 packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/SiteNetworkServiceCreate.json delete mode 100644 packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/SiteNetworkServiceDelete.json delete mode 100644 packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/SiteNetworkServiceFirstPartyCreate.json delete mode 100644 packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/SiteNetworkServiceGet.json delete mode 100644 packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/SiteNetworkServiceListByResourceGroup.json delete mode 100644 packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/SiteNetworkServiceListBySubscription.json delete mode 100644 packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/SiteNetworkServiceUpdateTags.json delete mode 100644 packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/SiteNetworkServicesCancelOngoingPUTOperation.json delete mode 100644 packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/SiteUpdateTags.json delete mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/sample.env delete mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/artifactManifestsCreateOrUpdateSample.ts delete mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/artifactManifestsDeleteSample.ts delete mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/artifactManifestsGetSample.ts delete mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/artifactManifestsListByArtifactStoreSample.ts delete mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/artifactManifestsListCredentialSample.ts delete mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/artifactManifestsUpdateSample.ts delete mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/artifactManifestsUpdateStateSample.ts delete mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/artifactStoresAddNetworkFabricControllerEndPointsSample.ts delete mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/artifactStoresApprovePrivateEndPointsSample.ts delete mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/artifactStoresCreateOrUpdateSample.ts delete mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/artifactStoresDeleteNetworkFabricControllerEndPointsSample.ts delete mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/artifactStoresDeleteSample.ts delete mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/artifactStoresGetSample.ts delete mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/artifactStoresListByPublisherSample.ts delete mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/artifactStoresListNetworkFabricControllerPrivateEndPointsSample.ts delete mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/artifactStoresListPrivateEndPointsSample.ts delete mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/artifactStoresRemovePrivateEndPointsSample.ts delete mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/artifactStoresUpdateSample.ts delete mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/componentsGetSample.ts delete mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/componentsListByNetworkFunctionSample.ts delete mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/configurationGroupSchemasCreateOrUpdateSample.ts delete mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/configurationGroupSchemasDeleteSample.ts delete mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/configurationGroupSchemasGetSample.ts delete mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/configurationGroupSchemasListByPublisherSample.ts delete mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/configurationGroupSchemasUpdateSample.ts delete mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/configurationGroupSchemasUpdateStateSample.ts delete mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/configurationGroupValuesCreateOrUpdateSample.ts delete mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/configurationGroupValuesDeleteSample.ts delete mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/configurationGroupValuesGetSample.ts delete mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/configurationGroupValuesListByResourceGroupSample.ts delete mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/configurationGroupValuesListBySubscriptionSample.ts delete mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/configurationGroupValuesUpdateTagsSample.ts delete mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/networkFunctionDefinitionGroupsCreateOrUpdateSample.ts delete mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/networkFunctionDefinitionGroupsDeleteSample.ts delete mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/networkFunctionDefinitionGroupsGetSample.ts delete mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/networkFunctionDefinitionGroupsListByPublisherSample.ts delete mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/networkFunctionDefinitionGroupsUpdateSample.ts delete mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/networkFunctionDefinitionVersionsCreateOrUpdateSample.ts delete mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/networkFunctionDefinitionVersionsDeleteSample.ts delete mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/networkFunctionDefinitionVersionsGetSample.ts delete mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/networkFunctionDefinitionVersionsListByNetworkFunctionDefinitionGroupSample.ts delete mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/networkFunctionDefinitionVersionsUpdateSample.ts delete mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/networkFunctionDefinitionVersionsUpdateStateSample.ts delete mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/networkFunctionsCreateOrUpdateSample.ts delete mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/networkFunctionsDeleteSample.ts delete mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/networkFunctionsExecuteRequestSample.ts delete mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/networkFunctionsGetSample.ts delete mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/networkFunctionsListByResourceGroupSample.ts delete mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/networkFunctionsListBySubscriptionSample.ts delete mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/networkFunctionsUpdateTagsSample.ts delete mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/networkServiceDesignGroupsCreateOrUpdateSample.ts delete mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/networkServiceDesignGroupsDeleteSample.ts delete mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/networkServiceDesignGroupsGetSample.ts delete mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/networkServiceDesignGroupsListByPublisherSample.ts delete mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/networkServiceDesignGroupsUpdateSample.ts delete mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/networkServiceDesignVersionsCreateOrUpdateSample.ts delete mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/networkServiceDesignVersionsDeleteSample.ts delete mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/networkServiceDesignVersionsGetSample.ts delete mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/networkServiceDesignVersionsListByNetworkServiceDesignGroupSample.ts delete mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/networkServiceDesignVersionsUpdateSample.ts delete mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/networkServiceDesignVersionsUpdateStateSample.ts delete mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/operationsListSample.ts delete mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/proxyArtifactGetSample.ts delete mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/proxyArtifactListSample.ts delete mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/proxyArtifactUpdateStateSample.ts delete mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/publishersCreateOrUpdateSample.ts delete mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/publishersDeleteSample.ts delete mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/publishersGetSample.ts delete mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/publishersListByResourceGroupSample.ts delete mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/publishersListBySubscriptionSample.ts delete mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/publishersUpdateSample.ts delete mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/siteNetworkServicesCancelOperationSample.ts delete mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/siteNetworkServicesCreateOrUpdateSample.ts delete mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/siteNetworkServicesDeleteSample.ts delete mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/siteNetworkServicesGetSample.ts delete mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/siteNetworkServicesListByResourceGroupSample.ts delete mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/siteNetworkServicesListBySubscriptionSample.ts delete mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/siteNetworkServicesUpdateTagsSample.ts delete mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/sitesCreateOrUpdateSample.ts delete mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/sitesDeleteSample.ts delete mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/sitesGetSample.ts delete mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/sitesListByResourceGroupSample.ts delete mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/sitesListBySubscriptionSample.ts delete mode 100644 packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/sitesUpdateTagsSample.ts delete mode 100644 packages/typespec-test/test/confidentialLedger/generated/openapi/openapi.json delete mode 100644 packages/typespec-test/test/loadTest/generated/openapi/2022-11-01/openapi.json diff --git a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ArtifactManifestCreate.json b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ArtifactManifestCreate.json deleted file mode 100644 index 3ac9816ddc..0000000000 --- a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ArtifactManifestCreate.json +++ /dev/null @@ -1,79 +0,0 @@ -{ - "parameters": { - "api-version": "2025-03-30", - "artifactManifestName": "TestManifest", - "artifactStoreName": "TestArtifactStore", - "parameters": { - "location": "eastus", - "properties": { - "artifacts": [ - { - "artifactName": "fed-rbac", - "artifactType": "OCIArtifact", - "artifactVersion": "1.0.0" - }, - { - "artifactName": "nginx", - "artifactType": "OCIArtifact", - "artifactVersion": "v1" - } - ] - } - }, - "publisherName": "TestPublisher", - "resourceGroupName": "rg", - "subscriptionId": "subid" - }, - "responses": { - "200": { - "body": { - "name": "TestManifest", - "type": "microsoft.hybridnetwork/publishers/artifactStores/artifactManifests", - "id": "/subscriptions/subid/resourcegroups/rg/providers/microsoft.hybridnetwork/publishers/UnityCloud/artifactStores/TestArtifactStore/artifactManifests/TestManifest", - "location": "eastus", - "properties": { - "artifactManifestState": "Uploaded", - "artifacts": [ - { - "artifactName": "fed-rbac", - "artifactType": "OCIArtifact", - "artifactVersion": "1.0.0" - }, - { - "artifactName": "nginx", - "artifactType": "OCIArtifact", - "artifactVersion": "v1" - } - ], - "provisioningState": "Succeeded" - } - } - }, - "201": { - "body": { - "name": "TestManifest", - "type": "microsoft.hybridnetwork/publishers/artifactStores/artifactManifests", - "id": "/subscriptions/subid/resourcegroups/rg/providers/microsoft.hybridnetwork/publishers/UnityCloud/artifactStores/TestArtifactStore/artifactManifests/TestManifest", - "location": "eastus", - "properties": { - "artifactManifestState": "Uploading", - "artifacts": [ - { - "artifactName": "fed-rbac", - "artifactType": "OCIArtifact", - "artifactVersion": "1.0.0" - }, - { - "artifactName": "nginx", - "artifactType": "OCIArtifact", - "artifactVersion": "v1" - } - ], - "provisioningState": "Succeeded" - } - } - } - }, - "operationId": "ArtifactManifests_CreateOrUpdate", - "title": "Create or update the artifact manifest resource" -} diff --git a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ArtifactManifestDelete.json b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ArtifactManifestDelete.json deleted file mode 100644 index 3ae8868577..0000000000 --- a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ArtifactManifestDelete.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "parameters": { - "api-version": "2025-03-30", - "artifactManifestName": "TestManifest", - "artifactStoreName": "TestArtifactStore", - "publisherName": "TestPublisher", - "resourceGroupName": "rg", - "subscriptionId": "subid" - }, - "responses": { - "202": { - "headers": { - "location": "https://management.azure.com/providers/microsoft.hybridnetwork/locations/EASTUS2EUAP/operationStatuses/0b37c625-7e7c-49c5-b86e-c817c85acb5d*B77A34159CA34A0BD446D3BC7EC120649181590DDF991982765DAC1A87491B2D?api-version=2021-05-01" - } - }, - "204": {} - }, - "operationId": "ArtifactManifests_Delete", - "title": "Delete a artifact manifest resource" -} diff --git a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ArtifactManifestGet.json b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ArtifactManifestGet.json deleted file mode 100644 index 49d2920699..0000000000 --- a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ArtifactManifestGet.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "parameters": { - "api-version": "2025-03-30", - "artifactManifestName": "TestManifest", - "artifactStoreName": "TestArtifactStore", - "publisherName": "TestPublisher", - "resourceGroupName": "rg", - "subscriptionId": "subid" - }, - "responses": { - "200": { - "body": { - "name": "TestManifest", - "type": "microsoft.hybridnetwork/publishers/artifactStores/artifactManifests", - "id": "/subscriptions/subid/providers/microsoft.hybridnetwork/publishers/UnityCloud/artifactStores/TestArtifactStore/artifactManifests/TestManifest", - "location": "eastus", - "properties": { - "artifactManifestState": "Uploaded", - "artifacts": [ - { - "artifactName": "fed-rbac", - "artifactType": "OCIArtifact", - "artifactVersion": "1.0.0" - }, - { - "artifactName": "nginx", - "artifactType": "OCIArtifact", - "artifactVersion": "v1" - } - ], - "provisioningState": "Succeeded" - } - } - } - }, - "operationId": "ArtifactManifests_Get", - "title": "Get a artifact manifest resource" -} diff --git a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ArtifactManifestListByArtifactStore.json b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ArtifactManifestListByArtifactStore.json deleted file mode 100644 index 0d0d9867e1..0000000000 --- a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ArtifactManifestListByArtifactStore.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "parameters": { - "api-version": "2025-03-30", - "artifactStoreName": "TestArtifactStore", - "publisherName": "TestPublisher", - "resourceGroupName": "rg", - "subscriptionId": "subid" - }, - "responses": { - "200": { - "body": { - "value": [ - { - "name": "TestManifest", - "type": "microsoft.hybridnetwork/publishers/artifactStores/artifactManifests", - "id": "/subscriptions/subid/providers/microsoft.hybridnetwork/publishers/TestPublisher/artifactStores/TestArtifactStore/artifactManifests/TestManifest", - "location": "eastus", - "properties": { - "artifactManifestState": "Uploaded", - "artifacts": [ - { - "artifactName": "fed-rbac", - "artifactType": "OCIArtifact", - "artifactVersion": "1.0.0" - }, - { - "artifactName": "nginx", - "artifactType": "OCIArtifact", - "artifactVersion": "v1" - } - ], - "provisioningState": "Succeeded" - } - } - ] - } - } - }, - "operationId": "ArtifactManifests_ListByArtifactStore", - "title": "Get artifact manifest list resource" -} diff --git a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ArtifactManifestListCredential.json b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ArtifactManifestListCredential.json deleted file mode 100644 index 4e9a5f6120..0000000000 --- a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ArtifactManifestListCredential.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "parameters": { - "api-version": "2025-03-30", - "artifactManifestName": "TestArtifactManifestName", - "artifactStoreName": "TestArtifactStore", - "publisherName": "TestPublisher", - "resourceGroupName": "rg", - "subscriptionId": "subid" - }, - "responses": { - "200": { - "body": { - "acrServerUrl": "test.azurecr.io", - "acrToken": "dummytoken", - "credentialType": "AzureContainerRegistryScopedToken", - "expiry": "2022-06-07T18:01:41.334+00:00", - "repositories": [ - "" - ], - "username": "dummyuser" - } - } - }, - "operationId": "ArtifactManifests_ListCredential", - "title": "List a credential for artifact manifest" -} diff --git a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ArtifactManifestUpdateState.json b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ArtifactManifestUpdateState.json deleted file mode 100644 index 407a0c24d6..0000000000 --- a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ArtifactManifestUpdateState.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "parameters": { - "api-version": "2025-03-30", - "artifactManifestName": "TestArtifactManifestName", - "artifactStoreName": "TestArtifactStore", - "parameters": { - "artifactManifestState": "Uploaded" - }, - "publisherName": "TestPublisher", - "resourceGroupName": "rg", - "subscriptionId": "subid" - }, - "responses": { - "200": { - "body": { - "artifactManifestState": "Uploaded" - } - }, - "202": { - "headers": { - "location": "https://management.azure.com/providers/microsoft.hybridnetwork/locations/EASTUS2EUAP/operationStatuses/0b37c625-7e7c-49c5-b86e-c817c85acb5d*B77A34159CA34A0BD446D3BC7EC120649181590DDF991982765DAC1A87491B2D?api-version=2021-05-01" - } - } - }, - "operationId": "ArtifactManifests_UpdateState", - "title": "Update artifact manifest state" -} diff --git a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ArtifactManifestUpdateTags.json b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ArtifactManifestUpdateTags.json deleted file mode 100644 index f027aa7eba..0000000000 --- a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ArtifactManifestUpdateTags.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "parameters": { - "api-version": "2025-03-30", - "artifactManifestName": "TestManifest", - "artifactStoreName": "TestArtifactStore", - "parameters": { - "tags": { - "tag1": "value1", - "tag2": "value2" - } - }, - "publisherName": "TestPublisher", - "resourceGroupName": "rg", - "subscriptionId": "subid" - }, - "responses": { - "200": { - "body": { - "name": "TestManifest", - "type": "microsoft.hybridnetwork/publishers/artifactStores/artifactManifests", - "id": "/subscriptions/subid/resourcegroups/rg/providers/microsoft.hybridnetwork/publishers/UnityCloud/artifactStores/TestArtifactStore/artifactManifests/TestManifest", - "location": "eastus", - "properties": { - "artifactManifestState": "Uploaded", - "artifacts": [ - { - "artifactName": "fed-rbac", - "artifactType": "OCIArtifact", - "artifactVersion": "1.0.0" - }, - { - "artifactName": "nginx", - "artifactType": "OCIArtifact", - "artifactVersion": "v1" - } - ], - "provisioningState": "Succeeded" - }, - "tags": { - "tag1": "value1", - "tag2": "value2" - } - } - } - }, - "operationId": "ArtifactManifests_Update", - "title": "Update a artifact manifest resource tags" -} diff --git a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ArtifactStoreAddNFCEndPoints.json b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ArtifactStoreAddNFCEndPoints.json deleted file mode 100644 index 7c2b326a25..0000000000 --- a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ArtifactStoreAddNFCEndPoints.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "parameters": { - "api-version": "2025-03-30", - "artifactStoreName": "TestArtifactStore", - "parameters": { - "networkFabricControllerIds": [ - { - "id": "/subscriptions/testsubid/resourceGroups/testNFCMRG/providers/Microsoft.ManagedNetworkFabric/networkFabricControllers/testNFCControllerId" - } - ] - }, - "publisherName": "TestPublisher", - "resourceGroupName": "rg", - "subscriptionId": "subid" - }, - "responses": { - "202": { - "headers": { - "location": "https://management.azure.com/providers/microsoft.hybridnetwork/locations/EASTUS2EUAP/operationStatuses/0b37c625-7e7c-49c5-b86e-c817c85acb5d*B77A34159CA34A0BD446D3BC7EC120649181590DDF991982765DAC1A87491B2D?api-version=2021-05-01" - } - } - }, - "operationId": "ArtifactStores_AddNetworkFabricControllerEndPoints", - "title": "Add Network Fabric Endpoint" -} diff --git a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ArtifactStoreApprovePrivateEndPoints.json b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ArtifactStoreApprovePrivateEndPoints.json deleted file mode 100644 index 49ada58ec0..0000000000 --- a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ArtifactStoreApprovePrivateEndPoints.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "parameters": { - "api-version": "2025-03-30", - "artifactStoreName": "TestArtifactStore", - "parameters": { - "manualPrivateEndPointConnections": [ - { - "id": "/subscriptions/testSub/resourceGroups/testRG/providers/Microsoft.Network/privateEndpoints/newpetest" - } - ] - }, - "publisherName": "TestPublisher", - "resourceGroupName": "rg", - "subscriptionId": "subid" - }, - "responses": { - "202": { - "headers": { - "location": "https://management.azure.com/providers/microsoft.hybridnetwork/locations/EASTUS2EUAP/operationStatuses/0b37c625-7e7c-49c5-b86e-c817c85acb5d*B77A34159CA34A0BD446D3BC7EC120649181590DDF991982765DAC1A87491B2D?api-version=2021-05-01" - } - } - }, - "operationId": "ArtifactStores_ApprovePrivateEndPoints", - "title": "Approve manual private endpoints" -} diff --git a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ArtifactStoreCreate.json b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ArtifactStoreCreate.json deleted file mode 100644 index 5974cf18b2..0000000000 --- a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ArtifactStoreCreate.json +++ /dev/null @@ -1,58 +0,0 @@ -{ - "parameters": { - "api-version": "2025-03-30", - "artifactStoreName": "TestArtifactStore", - "parameters": { - "location": "eastus", - "properties": { - "managedResourceGroupConfiguration": { - "name": "testRg", - "location": "eastus" - }, - "replicationStrategy": "SingleReplication", - "storeType": "AzureContainerRegistry" - } - }, - "publisherName": "TestPublisher", - "resourceGroupName": "rg", - "subscriptionId": "subid" - }, - "responses": { - "200": { - "body": { - "name": "TestArtifactStore", - "type": "microsoft.hybridnetwork/publishers/artifactStores", - "id": "/subscriptions/subid/providers/microsoft.hybridnetwork/publishers/TestPublisher/artifactStores/TestArtifactStore", - "location": "eastus", - "properties": { - "managedResourceGroupConfiguration": { - "name": "testRg", - "location": "eastus" - }, - "replicationStrategy": "SingleReplication", - "storageResourceId": "TestResourceId", - "storeType": "AzureContainerRegistry" - } - } - }, - "201": { - "body": { - "name": "TestArtifactStore", - "type": "microsoft.hybridnetwork/publishers/artifactStores", - "id": "/subscriptions/subid/providers/microsoft.hybridnetwork/publishers/TestPublisher/artifactStores/TestArtifactStore", - "location": "eastus", - "properties": { - "managedResourceGroupConfiguration": { - "name": "testRg", - "location": "eastus" - }, - "replicationStrategy": "SingleReplication", - "storageResourceId": "TestResourceId", - "storeType": "AzureContainerRegistry" - } - } - } - }, - "operationId": "ArtifactStores_CreateOrUpdate", - "title": "Create or update an artifact store of publisher resource" -} diff --git a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ArtifactStoreCreateContainer.json b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ArtifactStoreCreateContainer.json deleted file mode 100644 index a937ec614a..0000000000 --- a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ArtifactStoreCreateContainer.json +++ /dev/null @@ -1,61 +0,0 @@ -{ - "parameters": { - "api-version": "2025-03-30", - "artifactStoreName": "TestArtifactStore", - "parameters": { - "location": "eastus", - "properties": { - "backingResourcePublicNetworkAccess": "Disabled", - "managedResourceGroupConfiguration": { - "name": "testRg", - "location": "eastus" - }, - "replicationStrategy": "SingleReplication", - "storeType": "AzureContainerRegistry" - } - }, - "publisherName": "TestPublisher", - "resourceGroupName": "rg", - "subscriptionId": "subid" - }, - "responses": { - "200": { - "body": { - "name": "TestArtifactStore", - "type": "microsoft.hybridnetwork/publishers/artifactStores", - "id": "/subscriptions/subid/providers/microsoft.hybridnetwork/publishers/TestPublisher/artifactStores/TestArtifactStore", - "location": "eastus", - "properties": { - "backingResourcePublicNetworkAccess": "Disabled", - "managedResourceGroupConfiguration": { - "name": "testRg", - "location": "eastus" - }, - "replicationStrategy": "SingleReplication", - "storageResourceId": "TestResourceId", - "storeType": "AzureContainerRegistry" - } - } - }, - "201": { - "body": { - "name": "TestArtifactStore", - "type": "microsoft.hybridnetwork/publishers/artifactStores", - "id": "/subscriptions/subid/providers/microsoft.hybridnetwork/publishers/TestPublisher/artifactStores/TestArtifactStore", - "location": "eastus", - "properties": { - "backingResourcePublicNetworkAccess": "Disabled", - "managedResourceGroupConfiguration": { - "name": "testRg", - "location": "eastus" - }, - "replicationStrategy": "SingleReplication", - "storageResourceId": "TestResourceId", - "storeType": "AzureContainerRegistry" - } - } - } - }, - "operationId": "ArtifactStores_CreateOrUpdate", - "title": "Create or update an artifact store of publisher resource with container registry" -} diff --git a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ArtifactStoreCreateStorage.json b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ArtifactStoreCreateStorage.json deleted file mode 100644 index 40b33ebd6c..0000000000 --- a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ArtifactStoreCreateStorage.json +++ /dev/null @@ -1,61 +0,0 @@ -{ - "parameters": { - "api-version": "2025-03-30", - "artifactStoreName": "TestArtifactStore", - "parameters": { - "location": "eastus", - "properties": { - "backingResourcePublicNetworkAccess": "Enabled", - "managedResourceGroupConfiguration": { - "name": "testRg", - "location": "eastus" - }, - "replicationStrategy": "SingleReplication", - "storeType": "AzureStorageAccount" - } - }, - "publisherName": "TestPublisher", - "resourceGroupName": "rg", - "subscriptionId": "subid" - }, - "responses": { - "200": { - "body": { - "name": "TestArtifactStore", - "type": "microsoft.hybridnetwork/publishers/artifactStores", - "id": "/subscriptions/subid/providers/microsoft.hybridnetwork/publishers/TestPublisher/artifactStores/TestArtifactStore", - "location": "eastus", - "properties": { - "backingResourcePublicNetworkAccess": "Enabled", - "managedResourceGroupConfiguration": { - "name": "testRg", - "location": "eastus" - }, - "replicationStrategy": "SingleReplication", - "storageResourceId": "TestResourceId", - "storeType": "AzureStorageAccount" - } - } - }, - "201": { - "body": { - "name": "TestArtifactStore", - "type": "microsoft.hybridnetwork/publishers/artifactStores", - "id": "/subscriptions/subid/providers/microsoft.hybridnetwork/publishers/TestPublisher/artifactStores/TestArtifactStore", - "location": "eastus", - "properties": { - "backingResourcePublicNetworkAccess": "Enabled", - "managedResourceGroupConfiguration": { - "name": "testRg", - "location": "eastus" - }, - "replicationStrategy": "SingleReplication", - "storageResourceId": "TestResourceId", - "storeType": "AzureStorageAccount" - } - } - } - }, - "operationId": "ArtifactStores_CreateOrUpdate", - "title": "Create or update an artifact store of publisher resource with storage" -} diff --git a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ArtifactStoreDelete.json b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ArtifactStoreDelete.json deleted file mode 100644 index 2ebd7fb519..0000000000 --- a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ArtifactStoreDelete.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "parameters": { - "api-version": "2025-03-30", - "artifactStoreName": "TestArtifactStore", - "publisherName": "TestPublisher", - "resourceGroupName": "rg", - "subscriptionId": "subid" - }, - "responses": { - "202": { - "headers": { - "location": "https://management.azure.com/providers/microsoft.hybridnetwork/locations/EASTUS2EUAP/operationStatuses/0b37c625-7e7c-49c5-b86e-c817c85acb5d*B77A34159CA34A0BD446D3BC7EC120649181590DDF991982765DAC1A87491B2D?api-version=2021-05-01" - } - }, - "204": {} - }, - "operationId": "ArtifactStores_Delete", - "title": "Delete a artifact store of publisher resource" -} diff --git a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ArtifactStoreDeleteNFCEndPoints.json b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ArtifactStoreDeleteNFCEndPoints.json deleted file mode 100644 index c209e69845..0000000000 --- a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ArtifactStoreDeleteNFCEndPoints.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "parameters": { - "api-version": "2025-03-30", - "artifactStoreName": "TestArtifactStore", - "parameters": { - "networkFabricControllerIds": [ - { - "id": "/subscriptions/testsubid/resourceGroups/testNFCMRG/providers/Microsoft.ManagedNetworkFabric/networkFabricControllers/testNFCControllerId" - } - ] - }, - "publisherName": "TestPublisher", - "resourceGroupName": "rg", - "subscriptionId": "subid" - }, - "responses": { - "202": { - "headers": { - "location": "https://management.azure.com/providers/microsoft.hybridnetwork/locations/EASTUS2EUAP/operationStatuses/0b37c625-7e7c-49c5-b86e-c817c85acb5d*B77A34159CA34A0BD446D3BC7EC120649181590DDF991982765DAC1A87491B2D?api-version=2021-05-01" - } - } - }, - "operationId": "ArtifactStores_DeleteNetworkFabricControllerEndPoints", - "title": "Delete Network Fabric Endpoints" -} diff --git a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ArtifactStoreGet.json b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ArtifactStoreGet.json deleted file mode 100644 index 7e97629d44..0000000000 --- a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ArtifactStoreGet.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "parameters": { - "api-version": "2025-03-30", - "artifactStoreName": "TestArtifactStoreName", - "publisherName": "TestPublisher", - "resourceGroupName": "rg", - "subscriptionId": "subid" - }, - "responses": { - "200": { - "body": { - "name": "TestArtifactStore", - "type": "microsoft.hybridnetwork/publishers/artifactStores", - "id": "/subscriptions/subid/providers/microsoft.hybridnetwork/publishers/TestPublisher/artifactStores/TestArtifactStore", - "location": "eastus", - "properties": { - "managedResourceGroupConfiguration": { - "name": "testRg", - "location": "eastus" - }, - "replicationStrategy": "SingleReplication", - "storageResourceId": "TestResourceId", - "storeType": "AzureContainerRegistry" - } - } - } - }, - "operationId": "ArtifactStores_Get", - "title": "Get a artifact store resource" -} diff --git a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ArtifactStoreListNFCEndPoints.json b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ArtifactStoreListNFCEndPoints.json deleted file mode 100644 index 366ca66d35..0000000000 --- a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ArtifactStoreListNFCEndPoints.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "parameters": { - "api-version": "2025-03-30", - "artifactStoreName": "TestArtifactStore", - "publisherName": "TestPublisher", - "resourceGroupName": "rg", - "subscriptionId": "subid" - }, - "responses": { - "200": { - "body": { - "value": [ - { - "networkFabricControllerIds": [ - { - "id": "/subscriptions/testsubid/resourceGroups/testNFCMRG/providers/Microsoft.ManagedNetworkFabric/networkFabricControllers/testNFCControllerId" - } - ] - } - ] - } - }, - "202": { - "headers": { - "location": "https://management.azure.com/providers/microsoft.hybridnetwork/locations/EASTUS2EUAP/operationStatuses/0b37c625-7e7c-49c5-b86e-c817c85acb5d*B77A34159CA34A0BD446D3BC7EC120649181590DDF991982765DAC1A87491B2D?api-version=2021-05-01" - } - } - }, - "operationId": "ArtifactStores_ListNetworkFabricControllerPrivateEndPoints", - "title": "List Network Fabric Endpoints" -} diff --git a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ArtifactStoreListPrivateEndPoints.json b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ArtifactStoreListPrivateEndPoints.json deleted file mode 100644 index 9dde9dad1a..0000000000 --- a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ArtifactStoreListPrivateEndPoints.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "parameters": { - "api-version": "2025-03-30", - "artifactStoreName": "TestArtifactStore", - "publisherName": "TestPublisher", - "resourceGroupName": "rg", - "subscriptionId": "subid" - }, - "responses": { - "200": { - "body": { - "value": [ - { - "manualPrivateEndPointConnections": [ - { - "id": "/subscriptions/testSub/resourceGroups/testRG/providers/Microsoft.Network/privateEndpoints/newpetest" - } - ] - } - ] - } - }, - "202": { - "headers": { - "location": "https://management.azure.com/providers/microsoft.hybridnetwork/locations/EASTUS2EUAP/operationStatuses/0b37c625-7e7c-49c5-b86e-c817c85acb5d*B77A34159CA34A0BD446D3BC7EC120649181590DDF991982765DAC1A87491B2D?api-version=2021-05-01" - } - } - }, - "operationId": "ArtifactStores_ListPrivateEndPoints", - "title": "List Manual Private Endpoints" -} diff --git a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ArtifactStoreRemovePrivateEndPoints.json b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ArtifactStoreRemovePrivateEndPoints.json deleted file mode 100644 index f3b9559f2f..0000000000 --- a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ArtifactStoreRemovePrivateEndPoints.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "parameters": { - "api-version": "2025-03-30", - "artifactStoreName": "TestArtifactStore", - "parameters": { - "manualPrivateEndPointConnections": [ - { - "id": "/subscriptions/testSub/resourceGroups/testRG/providers/Microsoft.Network/privateEndpoints/newpetest" - } - ] - }, - "publisherName": "TestPublisher", - "resourceGroupName": "rg", - "subscriptionId": "subid" - }, - "responses": { - "202": { - "headers": { - "location": "https://management.azure.com/providers/microsoft.hybridnetwork/locations/EASTUS2EUAP/operationStatuses/0b37c625-7e7c-49c5-b86e-c817c85acb5d*B77A34159CA34A0BD446D3BC7EC120649181590DDF991982765DAC1A87491B2D?api-version=2021-05-01" - } - } - }, - "operationId": "ArtifactStores_RemovePrivateEndPoints", - "title": "Remove Manual Endpoint" -} diff --git a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ArtifactStoreUpdateTags.json b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ArtifactStoreUpdateTags.json deleted file mode 100644 index d5926c1ad0..0000000000 --- a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ArtifactStoreUpdateTags.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "parameters": { - "api-version": "2025-03-30", - "artifactStoreName": "TestArtifactStore", - "parameters": { - "tags": { - "tag1": "value1", - "tag2": "value2" - } - }, - "publisherName": "TestPublisher", - "resourceGroupName": "rg", - "subscriptionId": "subid" - }, - "responses": { - "200": { - "body": { - "name": "TestArtifactStore", - "type": "microsoft.hybridnetwork/publishers/artifactStores", - "id": "/subscriptions/subid/providers/microsoft.hybridnetwork/publishers/TestPublisher/artifactStores/TestArtifactStore", - "location": "eastus", - "properties": { - "managedResourceGroupConfiguration": { - "name": "testRg", - "location": "eastus" - }, - "replicationStrategy": "SingleReplication", - "storageResourceId": "TestResourceId", - "storeType": "AzureContainerRegistry" - }, - "tags": { - "tag1": "value1", - "tag2": "value2" - } - } - } - }, - "operationId": "ArtifactStores_Update", - "title": "Update artifact store resource tags" -} diff --git a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ArtifactStoresListByPublisherName.json b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ArtifactStoresListByPublisherName.json deleted file mode 100644 index b1535b9981..0000000000 --- a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ArtifactStoresListByPublisherName.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "parameters": { - "api-version": "2025-03-30", - "publisherName": "TestPublisher", - "resourceGroupName": "rg", - "subscriptionId": "subid" - }, - "responses": { - "200": { - "body": { - "value": [ - { - "name": "TestArtifactStore", - "type": "microsoft.hybridnetwork/publishers/artifactStores", - "id": "/subscriptions/subid/providers/microsoft.hybridnetwork/publishers/TestPublisher/artifactStores/TestArtifactStore", - "location": "eastus", - "properties": { - "managedResourceGroupConfiguration": { - "name": "testRg", - "location": "eastus" - }, - "replicationStrategy": "SingleReplication", - "storageResourceId": "TestResourceId", - "storeType": "AzureContainerRegistry" - } - } - ] - } - } - }, - "operationId": "ArtifactStores_ListByPublisher", - "title": "Get application groups under a publisher resource" -} diff --git a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/AzureCore/VirtualNetworkFunctionCreate.json b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/AzureCore/VirtualNetworkFunctionCreate.json deleted file mode 100644 index f7f1a97969..0000000000 --- a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/AzureCore/VirtualNetworkFunctionCreate.json +++ /dev/null @@ -1,76 +0,0 @@ -{ - "parameters": { - "api-version": "2025-03-30", - "networkFunctionName": "testNf", - "parameters": { - "location": "eastus", - "properties": { - "allowSoftwareUpdate": false, - "configurationType": "Open", - "deploymentValues": "{\"virtualMachineName\":\"test-VM\",\"cpuCores\":4,\"memorySizeGB\":8,\"cloudServicesNetworkAttachment\":{\"attachedNetworkId\":\"test-csnet\",\"ipAllocationMethod\":\"Dynamic\",\"networkAttachmentName\":\"test-cs-vlan\"},\"networkAttachments\":[{\"attachedNetworkId\":\"test-l3vlan\",\"defaultGateway\":\"True\",\"ipAllocationMethod\":\"Dynamic\",\"networkAttachmentName\":\"test-vlan\"}],\"sshPublicKeys\":[{\"keyData\":\"ssh-rsa CMIIIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEA0TqlveKKlc2MFvEmuXJiLGBsY1t4ML4uiRADGSZlnc+7Ugv3h+MCjkkwOKiOdsNo8k4KSBIG5GcQfKYOOd17AJvqCL6cGQbaLuqv0a64jeDm8oO8/xN/IM0oKw7rMr/2oAJOgIsfeXPkRxWWic9AVIS++H5Qi2r7bUFX+cqFsyUCAwEBBQ==\"}],\"storageProfile\":{\"osDisk\":{\"createOption\":\"Ephemeral\",\"deleteOption\":\"Delete\",\"diskSizeGB\":10}},\"userData\":\"testUserData\",\"adminUsername\":\"testUser\",\"virtioInterface\":\"Transitional\",\"isolateEmulatorThread\":\"False\",\"bootMethod\":\"BIOS\",\"placementHints\":[]}", - "networkFunctionDefinitionVersionResourceReference": { - "id": "/subscriptions/subid/resourcegroups/rg/providers/Microsoft.HybridNetwork/publishers/testVendor/networkFunctionDefinitionGroups/testnetworkFunctionDefinitionGroupName/networkFunctionDefinitionVersions/1.0.1", - "idType": "Open" - }, - "nfviId": "/subscriptions/subid/resourceGroups/testResourceGroup", - "nfviType": "AzureCore" - } - }, - "resourceGroupName": "rg", - "subscriptionId": "subid" - }, - "responses": { - "200": { - "body": { - "name": "testNf", - "type": "Microsoft.HybridNetwork/networkFunctions", - "id": "/subscriptions/subid/resourcegroups/rg/providers/Microsoft.HybridNetwork/networkFunctions/testNf", - "location": "eastus", - "properties": { - "allowSoftwareUpdate": false, - "configurationType": "Open", - "deploymentValues": "{\"virtualMachineName\":\"test-VM\",\"cpuCores\":4,\"memorySizeGB\":8,\"cloudServicesNetworkAttachment\":{\"attachedNetworkId\":\"test-csnet\",\"ipAllocationMethod\":\"Dynamic\",\"networkAttachmentName\":\"test-cs-vlan\"},\"networkAttachments\":[{\"attachedNetworkId\":\"test-l3vlan\",\"defaultGateway\":\"True\",\"ipAllocationMethod\":\"Dynamic\",\"networkAttachmentName\":\"test-vlan\"}],\"sshPublicKeys\":[{\"keyData\":\"ssh-rsa CMIIIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEA0TqlveKKlc2MFvEmuXJiLGBsY1t4ML4uiRADGSZlnc+7Ugv3h+MCjkkwOKiOdsNo8k4KSBIG5GcQfKYOOd17AJvqCL6cGQbaLuqv0a64jeDm8oO8/xN/IM0oKw7rMr/2oAJOgIsfeXPkRxWWic9AVIS++H5Qi2r7bUFX+cqFsyUCAwEBBQ==\"}],\"storageProfile\":{\"osDisk\":{\"createOption\":\"Ephemeral\",\"deleteOption\":\"Delete\",\"diskSizeGB\":10}},\"userData\":\"testUserData\",\"adminUsername\":\"testUser\",\"virtioInterface\":\"Transitional\",\"isolateEmulatorThread\":\"False\",\"bootMethod\":\"BIOS\",\"placementHints\":[]}", - "networkFunctionDefinitionGroupName": "TestNetworkFunctionDefinitionGroupName", - "networkFunctionDefinitionOfferingLocation": "eastus", - "networkFunctionDefinitionVersion": "1.0.0", - "networkFunctionDefinitionVersionResourceReference": { - "id": "/subscriptions/subid/resourcegroups/rg/providers/Microsoft.HybridNetwork/publishers/testVendor/networkFunctionDefinitionGroups/testnetworkFunctionDefinitionGroupName/networkFunctionDefinitionVersions/1.0.1", - "idType": "Open" - }, - "nfviId": "/subscriptions/subid/resourceGroups/testResourceGroup", - "nfviType": "AzureCore", - "provisioningState": "Succeeded", - "publisherName": "TestPublisher", - "publisherScope": "Private" - } - } - }, - "201": { - "body": { - "name": "testNf", - "type": "Microsoft.HybridNetwork/networkFunctions", - "id": "/subscriptions/subid/resourcegroups/rg/providers/Microsoft.HybridNetwork/networkFunctions/testNf", - "location": "eastus", - "properties": { - "allowSoftwareUpdate": false, - "configurationType": "Open", - "deploymentValues": "{\"virtualMachineName\":\"test-VM\",\"cpuCores\":4,\"memorySizeGB\":8,\"cloudServicesNetworkAttachment\":{\"attachedNetworkId\":\"test-csnet\",\"ipAllocationMethod\":\"Dynamic\",\"networkAttachmentName\":\"test-cs-vlan\"},\"networkAttachments\":[{\"attachedNetworkId\":\"test-l3vlan\",\"defaultGateway\":\"True\",\"ipAllocationMethod\":\"Dynamic\",\"networkAttachmentName\":\"test-vlan\"}],\"sshPublicKeys\":[{\"keyData\":\"ssh-rsa CMIIIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEA0TqlveKKlc2MFvEmuXJiLGBsY1t4ML4uiRADGSZlnc+7Ugv3h+MCjkkwOKiOdsNo8k4KSBIG5GcQfKYOOd17AJvqCL6cGQbaLuqv0a64jeDm8oO8/xN/IM0oKw7rMr/2oAJOgIsfeXPkRxWWic9AVIS++H5Qi2r7bUFX+cqFsyUCAwEBBQ==\"}],\"storageProfile\":{\"osDisk\":{\"createOption\":\"Ephemeral\",\"deleteOption\":\"Delete\",\"diskSizeGB\":10}},\"userData\":\"testUserData\",\"adminUsername\":\"testUser\",\"virtioInterface\":\"Transitional\",\"isolateEmulatorThread\":\"False\",\"bootMethod\":\"BIOS\",\"placementHints\":[]}", - "networkFunctionDefinitionGroupName": "TestNetworkFunctionDefinitionGroupName", - "networkFunctionDefinitionOfferingLocation": "eastus", - "networkFunctionDefinitionVersion": "1.0.0", - "networkFunctionDefinitionVersionResourceReference": { - "id": "/subscriptions/subid/resourcegroups/rg/providers/Microsoft.HybridNetwork/publishers/testVendor/networkFunctionDefinitionGroups/testnetworkFunctionDefinitionGroupName/networkFunctionDefinitionVersions/1.0.1", - "idType": "Open" - }, - "nfviId": "/subscriptions/subid/resourceGroups/testResourceGroup", - "nfviType": "AzureCore", - "provisioningState": "Accepted", - "publisherName": "TestPublisher", - "publisherScope": "Private" - } - } - } - }, - "operationId": "NetworkFunctions_CreateOrUpdate", - "title": "Create virtual network function resource on AzureCore" -} diff --git a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/AzureCore/VirtualNetworkFunctionDefinitionVersionCreate.json b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/AzureCore/VirtualNetworkFunctionDefinitionVersionCreate.json deleted file mode 100644 index 9aa3a8262b..0000000000 --- a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/AzureCore/VirtualNetworkFunctionDefinitionVersionCreate.json +++ /dev/null @@ -1,228 +0,0 @@ -{ - "parameters": { - "api-version": "2025-03-30", - "networkFunctionDefinitionGroupName": "TestNetworkFunctionDefinitionGroupName", - "networkFunctionDefinitionVersionName": "1.0.0", - "parameters": { - "location": "eastus", - "properties": { - "description": "test NFDV for AzureCore", - "deployParameters": "{\"virtualMachineName\":{\"type\":\"string\"},\"cpuCores\":{\"type\":\"int\"},\"memorySizeGB\":{\"type\":\"int\"},\"cloudServicesNetworkAttachment\":{\"type\":\"object\",\"properties\":{\"networkAttachmentName\":{\"type\":\"string\"},\"attachedNetworkId\":{\"type\":\"string\"},\"ipAllocationMethod\":{\"type\":\"string\"},\"ipv4Address\":{\"type\":\"string\"},\"ipv6Address\":{\"type\":\"string\"},\"defaultGateway\":{\"type\":\"string\"}},\"required\":[\"attachedNetworkId\",\"ipAllocationMethod\"]},\"networkAttachments\":{\"type\":\"array\",\"items\":{\"type\":\"object\",\"properties\":{\"networkAttachmentName\":{\"type\":\"string\"},\"attachedNetworkId\":{\"type\":\"string\"},\"ipAllocationMethod\":{\"type\":\"string\"},\"ipv4Address\":{\"type\":\"string\"},\"ipv6Address\":{\"type\":\"string\"},\"defaultGateway\":{\"type\":\"string\"}},\"required\":[\"attachedNetworkId\",\"ipAllocationMethod\"]}},\"storageProfile\":{\"type\":\"object\",\"properties\":{\"osDisk\":{\"type\":\"object\",\"properties\":{\"createOption\":{\"type\":\"string\"},\"deleteOption\":{\"type\":\"string\"},\"diskSizeGB\":{\"type\":\"integer\"}},\"required\":[\"diskSizeGB\"]}},\"required\":[\"osDisk\"]},\"sshPublicKeys\":{\"type\":\"array\",\"items\":{\"type\":\"object\",\"properties\":{\"keyData\":{\"type\":\"string\"}},\"required\":[\"keyData\"]}},\"userData\":{\"type\":\"string\"},\"adminUsername\":{\"type\":\"string\"},\"bootMethod\":{\"type\":\"string\",\"default\":\"UEFI\",\"enum\":[\"UEFI\",\"BIOS\"]},\"isolateEmulatorThread\":{\"type\":\"string\"},\"virtioInterface\":{\"type\":\"string\"},\"placementHints\":{\"type\":\"array\",\"items\":{\"type\":\"object\",\"properties\":{\"hintType\":{\"type\":\"string\",\"enum\":[\"Affinity\",\"AntiAffinity\"]},\"resourceId\":{\"type\":\"string\"},\"schedulingExecution\":{\"type\":\"string\",\"enum\":[\"Soft\",\"Hard\"]},\"scope\":{\"type\":\"string\"}},\"required\":[\"hintType\",\"schedulingExecution\",\"resourceId\",\"scope\"]}}}", - "networkFunctionTemplate": { - "networkFunctionApplications": [ - { - "name": "testImageRole", - "artifactProfile": { - "artifactStore": { - "id": "/subscriptions/subid/resourceGroups/rg/providers/microsoft.hybridnetwork/publishers/TestPublisher/artifactStores/TestArtifactStore" - }, - "vhdArtifactProfile": { - "vhdName": "test-image", - "vhdVersion": "1-0-0" - } - }, - "artifactType": "VhdImageFile", - "dependsOnProfile": { - "installDependsOn": [], - "uninstallDependsOn": [], - "updateDependsOn": [] - }, - "deployParametersMappingRuleProfile": { - "applicationEnablement": "Unknown", - "vhdImageMappingRuleProfile": { - "userConfiguration": "" - } - } - }, - { - "name": "testTemplateRole", - "artifactProfile": { - "artifactStore": { - "id": "/subscriptions/subid/resourceGroups/rg/providers/microsoft.hybridnetwork/publishers/TestPublisher/artifactStores/TestArtifactStore" - }, - "templateArtifactProfile": { - "templateName": "test-template", - "templateVersion": "1.0.0" - } - }, - "artifactType": "ArmTemplate", - "dependsOnProfile": { - "installDependsOn": [ - "testImageRole" - ], - "uninstallDependsOn": [ - "testImageRole" - ], - "updateDependsOn": [ - "testImageRole" - ] - }, - "deployParametersMappingRuleProfile": { - "applicationEnablement": "Unknown", - "templateMappingRuleProfile": { - "templateParameters": "{\"virtualMachineName\":\"{deployParameters.virtualMachineName}\",\"cpuCores\":\"{deployParameters.cpuCores}\",\"memorySizeGB\":\"{deployParameters.memorySizeGB}\",\"cloudServicesNetworkAttachment\":\"{deployParameters.cloudServicesNetworkAttachment}\",\"networkAttachments\":\"{deployParameters.networkAttachments}\",\"sshPublicKeys\":\"{deployParameters.sshPublicKeys}\",\"storageProfile\":\"{deployParameters.storageProfile}\",\"isolateEmulatorThread\":\"{deployParameters.isolateEmulatorThread}\",\"virtioInterface\":\"{deployParameters.virtioInterface}\",\"userData\":\"{deployParameters.userData}\",\"adminUsername\":\"{deployParameters.adminUsername}\",\"bootMethod\":\"{deployParameters.bootMethod}\",\"placementHints\":\"{deployParameters.placementHints}\"}" - } - } - } - ], - "nfviType": "AzureCore" - }, - "networkFunctionType": "VirtualNetworkFunction", - "versionState": "Preview" - } - }, - "publisherName": "TestPublisher", - "resourceGroupName": "rg", - "subscriptionId": "subid" - }, - "responses": { - "200": { - "body": { - "name": "TestVersion", - "type": "Microsoft.HybridNetwork/publishers/networkFunctionDefinitionGroups/networkFunctionDefinitionVersions", - "id": "/subscriptions/subid/resourcegroups/rg/providers/Microsoft.HybridNetwork/publishers/TestPublisher/networkFunctionDefinitionGroups/TestNetworkFunctionDefinitionGroupName/networkFunctionDefinitionVersions/1.0.0", - "location": "eastus", - "properties": { - "description": "test NFDV for AzureCore", - "deployParameters": "{\"virtualMachineName\":{\"type\":\"string\"},\"cpuCores\":{\"type\":\"int\"},\"memorySizeGB\":{\"type\":\"int\"},\"cloudServicesNetworkAttachment\":{\"type\":\"object\",\"properties\":{\"networkAttachmentName\":{\"type\":\"string\"},\"attachedNetworkId\":{\"type\":\"string\"},\"ipAllocationMethod\":{\"type\":\"string\"},\"ipv4Address\":{\"type\":\"string\"},\"ipv6Address\":{\"type\":\"string\"},\"defaultGateway\":{\"type\":\"string\"}},\"required\":[\"attachedNetworkId\",\"ipAllocationMethod\"]},\"networkAttachments\":{\"type\":\"array\",\"items\":{\"type\":\"object\",\"properties\":{\"networkAttachmentName\":{\"type\":\"string\"},\"attachedNetworkId\":{\"type\":\"string\"},\"ipAllocationMethod\":{\"type\":\"string\"},\"ipv4Address\":{\"type\":\"string\"},\"ipv6Address\":{\"type\":\"string\"},\"defaultGateway\":{\"type\":\"string\"}},\"required\":[\"attachedNetworkId\",\"ipAllocationMethod\"]}},\"storageProfile\":{\"type\":\"object\",\"properties\":{\"osDisk\":{\"type\":\"object\",\"properties\":{\"createOption\":{\"type\":\"string\"},\"deleteOption\":{\"type\":\"string\"},\"diskSizeGB\":{\"type\":\"integer\"}},\"required\":[\"diskSizeGB\"]}},\"required\":[\"osDisk\"]},\"sshPublicKeys\":{\"type\":\"array\",\"items\":{\"type\":\"object\",\"properties\":{\"keyData\":{\"type\":\"string\"}},\"required\":[\"keyData\"]}},\"userData\":{\"type\":\"string\"},\"adminUsername\":{\"type\":\"string\"},\"bootMethod\":{\"type\":\"string\",\"default\":\"UEFI\",\"enum\":[\"UEFI\",\"BIOS\"]},\"isolateEmulatorThread\":{\"type\":\"string\"},\"virtioInterface\":{\"type\":\"string\"},\"placementHints\":{\"type\":\"array\",\"items\":{\"type\":\"object\",\"properties\":{\"hintType\":{\"type\":\"string\",\"enum\":[\"Affinity\",\"AntiAffinity\"]},\"resourceId\":{\"type\":\"string\"},\"schedulingExecution\":{\"type\":\"string\",\"enum\":[\"Soft\",\"Hard\"]},\"scope\":{\"type\":\"string\"}},\"required\":[\"hintType\",\"schedulingExecution\",\"resourceId\",\"scope\"]}}}", - "networkFunctionTemplate": { - "networkFunctionApplications": [ - { - "name": "testImageRole", - "artifactProfile": { - "artifactStore": { - "id": "/subscriptions/subid/resourceGroups/rg/providers/microsoft.hybridnetwork/publishers/TestPublisher/artifactStores/TestArtifactStore" - }, - "vhdArtifactProfile": { - "vhdName": "test-image", - "vhdVersion": "1-0-0" - } - }, - "artifactType": "VhdImageFile", - "dependsOnProfile": { - "installDependsOn": [], - "uninstallDependsOn": [], - "updateDependsOn": [] - }, - "deployParametersMappingRuleProfile": { - "applicationEnablement": "Unknown", - "vhdImageMappingRuleProfile": { - "userConfiguration": "" - } - } - }, - { - "name": "testTemplateRole", - "artifactProfile": { - "artifactStore": { - "id": "/subscriptions/subid/resourceGroups/rg/providers/microsoft.hybridnetwork/publishers/TestPublisher/artifactStores/TestArtifactStore" - }, - "templateArtifactProfile": { - "templateName": "test-template", - "templateVersion": "1.0.0" - } - }, - "artifactType": "ArmTemplate", - "dependsOnProfile": { - "installDependsOn": [ - "testImageRole" - ], - "uninstallDependsOn": [ - "testImageRole" - ], - "updateDependsOn": [ - "testImageRole" - ] - }, - "deployParametersMappingRuleProfile": { - "applicationEnablement": "Unknown", - "templateMappingRuleProfile": { - "templateParameters": "{\"virtualMachineName\":\"{deployParameters.virtualMachineName}\",\"cpuCores\":\"{deployParameters.cpuCores}\",\"memorySizeGB\":\"{deployParameters.memorySizeGB}\",\"cloudServicesNetworkAttachment\":\"{deployParameters.cloudServicesNetworkAttachment}\",\"networkAttachments\":\"{deployParameters.networkAttachments}\",\"sshPublicKeys\":\"{deployParameters.sshPublicKeys}\",\"storageProfile\":\"{deployParameters.storageProfile}\",\"isolateEmulatorThread\":\"{deployParameters.isolateEmulatorThread}\",\"virtioInterface\":\"{deployParameters.virtioInterface}\",\"userData\":\"{deployParameters.userData}\",\"adminUsername\":\"{deployParameters.adminUsername}\",\"bootMethod\":\"{deployParameters.bootMethod}\",\"placementHints\":\"{deployParameters.placementHints}\"}" - } - } - } - ], - "nfviType": "AzureCore" - }, - "networkFunctionType": "VirtualNetworkFunction", - "versionState": "Preview" - } - } - }, - "201": { - "body": { - "name": "TestVersion", - "type": "Microsoft.HybridNetwork/publishers/networkFunctionDefinitionGroups/networkFunctionDefinitionVersions", - "id": "/subscriptions/subid/resourcegroups/rg/providers/Microsoft.HybridNetwork/publishers/TestPublisher/networkFunctionDefinitionGroups/TestNetworkFunctionDefinitionGroupName/networkFunctionDefinitionVersions/1.0.0", - "location": "eastus", - "properties": { - "description": "test NFDV for AzureCore", - "deployParameters": "{\"virtualMachineName\":{\"type\":\"string\"},\"cpuCores\":{\"type\":\"int\"},\"memorySizeGB\":{\"type\":\"int\"},\"cloudServicesNetworkAttachment\":{\"type\":\"object\",\"properties\":{\"networkAttachmentName\":{\"type\":\"string\"},\"attachedNetworkId\":{\"type\":\"string\"},\"ipAllocationMethod\":{\"type\":\"string\"},\"ipv4Address\":{\"type\":\"string\"},\"ipv6Address\":{\"type\":\"string\"},\"defaultGateway\":{\"type\":\"string\"}},\"required\":[\"attachedNetworkId\",\"ipAllocationMethod\"]},\"networkAttachments\":{\"type\":\"array\",\"items\":{\"type\":\"object\",\"properties\":{\"networkAttachmentName\":{\"type\":\"string\"},\"attachedNetworkId\":{\"type\":\"string\"},\"ipAllocationMethod\":{\"type\":\"string\"},\"ipv4Address\":{\"type\":\"string\"},\"ipv6Address\":{\"type\":\"string\"},\"defaultGateway\":{\"type\":\"string\"}},\"required\":[\"attachedNetworkId\",\"ipAllocationMethod\"]}},\"storageProfile\":{\"type\":\"object\",\"properties\":{\"osDisk\":{\"type\":\"object\",\"properties\":{\"createOption\":{\"type\":\"string\"},\"deleteOption\":{\"type\":\"string\"},\"diskSizeGB\":{\"type\":\"integer\"}},\"required\":[\"diskSizeGB\"]}},\"required\":[\"osDisk\"]},\"sshPublicKeys\":{\"type\":\"array\",\"items\":{\"type\":\"object\",\"properties\":{\"keyData\":{\"type\":\"string\"}},\"required\":[\"keyData\"]}},\"userData\":{\"type\":\"string\"},\"adminUsername\":{\"type\":\"string\"},\"bootMethod\":{\"type\":\"string\",\"default\":\"UEFI\",\"enum\":[\"UEFI\",\"BIOS\"]},\"isolateEmulatorThread\":{\"type\":\"string\"},\"virtioInterface\":{\"type\":\"string\"},\"placementHints\":{\"type\":\"array\",\"items\":{\"type\":\"object\",\"properties\":{\"hintType\":{\"type\":\"string\",\"enum\":[\"Affinity\",\"AntiAffinity\"]},\"resourceId\":{\"type\":\"string\"},\"schedulingExecution\":{\"type\":\"string\",\"enum\":[\"Soft\",\"Hard\"]},\"scope\":{\"type\":\"string\"}},\"required\":[\"hintType\",\"schedulingExecution\",\"resourceId\",\"scope\"]}}}", - "networkFunctionTemplate": { - "networkFunctionApplications": [ - { - "name": "testImageRole", - "artifactProfile": { - "artifactStore": { - "id": "/subscriptions/subid/resourceGroups/rg/providers/microsoft.hybridnetwork/publishers/TestPublisher/artifactStores/TestArtifactStore" - }, - "vhdArtifactProfile": { - "vhdName": "test-image", - "vhdVersion": "1-0-0" - } - }, - "artifactType": "VhdImageFile", - "dependsOnProfile": { - "installDependsOn": [], - "uninstallDependsOn": [], - "updateDependsOn": [] - }, - "deployParametersMappingRuleProfile": { - "applicationEnablement": "Unknown", - "vhdImageMappingRuleProfile": { - "userConfiguration": "" - } - } - }, - { - "name": "testTemplateRole", - "artifactProfile": { - "artifactStore": { - "id": "/subscriptions/subid/resourceGroups/rg/providers/microsoft.hybridnetwork/publishers/TestPublisher/artifactStores/TestArtifactStore" - }, - "templateArtifactProfile": { - "templateName": "test-template", - "templateVersion": "1.0.0" - } - }, - "artifactType": "ArmTemplate", - "dependsOnProfile": { - "installDependsOn": [ - "testImageRole" - ], - "uninstallDependsOn": [ - "testImageRole" - ], - "updateDependsOn": [ - "testImageRole" - ] - }, - "deployParametersMappingRuleProfile": { - "applicationEnablement": "Unknown", - "templateMappingRuleProfile": { - "templateParameters": "{\"virtualMachineName\":\"{deployParameters.virtualMachineName}\",\"cpuCores\":\"{deployParameters.cpuCores}\",\"memorySizeGB\":\"{deployParameters.memorySizeGB}\",\"cloudServicesNetworkAttachment\":\"{deployParameters.cloudServicesNetworkAttachment}\",\"networkAttachments\":\"{deployParameters.networkAttachments}\",\"sshPublicKeys\":\"{deployParameters.sshPublicKeys}\",\"storageProfile\":\"{deployParameters.storageProfile}\",\"isolateEmulatorThread\":\"{deployParameters.isolateEmulatorThread}\",\"virtioInterface\":\"{deployParameters.virtioInterface}\",\"userData\":\"{deployParameters.userData}\",\"adminUsername\":\"{deployParameters.adminUsername}\",\"bootMethod\":\"{deployParameters.bootMethod}\",\"placementHints\":\"{deployParameters.placementHints}\"}" - } - } - } - ], - "nfviType": "AzureCore" - }, - "networkFunctionType": "VirtualNetworkFunction", - "versionState": "Preview" - } - } - } - }, - "operationId": "NetworkFunctionDefinitionVersions_CreateOrUpdate", - "title": "Create or update a network function definition version resource for AzureCore VNF" -} diff --git a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/AzureCore/VirtualNetworkFunctionDefinitionVersionDelete.json b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/AzureCore/VirtualNetworkFunctionDefinitionVersionDelete.json deleted file mode 100644 index 0d3b1e6b5d..0000000000 --- a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/AzureCore/VirtualNetworkFunctionDefinitionVersionDelete.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "parameters": { - "api-version": "2025-03-30", - "networkFunctionDefinitionGroupName": "TestNetworkFunctionDefinitionGroupName", - "networkFunctionDefinitionVersionName": "1.0.0", - "publisherName": "TestPublisher", - "resourceGroupName": "rg", - "subscriptionId": "subid" - }, - "responses": { - "202": { - "headers": { - "location": "https://management.azure.com/providers/microsoft.hybridnetwork/locations/EASTUS2EUAP/operationStatuses/0b37c625-7e7c-49c5-b86e-c817c85acb5d*B77A34159CA34A0BD446D3BC7EC120649181590DDF991982765DAC1A87491B2D?api-version=2021-05-01" - } - }, - "204": {} - }, - "operationId": "NetworkFunctionDefinitionVersions_Delete", - "title": "Delete a network function definition version for AzureCore VNF" -} diff --git a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/AzureCore/VirtualNetworkFunctionDefinitionVersionGet.json b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/AzureCore/VirtualNetworkFunctionDefinitionVersionGet.json deleted file mode 100644 index 46192e6866..0000000000 --- a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/AzureCore/VirtualNetworkFunctionDefinitionVersionGet.json +++ /dev/null @@ -1,87 +0,0 @@ -{ - "parameters": { - "api-version": "2025-03-30", - "networkFunctionDefinitionGroupName": "TestNetworkFunctionDefinitionGroupName", - "networkFunctionDefinitionVersionName": "1.0.0", - "publisherName": "TestPublisher", - "resourceGroupName": "rg", - "subscriptionId": "subid" - }, - "responses": { - "200": { - "body": { - "name": "TestVersion", - "type": "Microsoft.HybridNetwork/publishers/networkFunctionDefinitionGroups/networkFunctionDefinitionVersions", - "id": "/subscriptions/subid/resourcegroups/rg/providers/Microsoft.HybridNetwork/publishers/TestPublisher/networkFunctionDefinitionGroups/TestNetworkFunctionDefinitionGroupName/networkFunctionDefinitionVersions/1.0.0", - "location": "eastus", - "properties": { - "description": "test NFDV for AzureCore", - "deployParameters": "{\"virtualMachineName\":{\"type\":\"string\"},\"cpuCores\":{\"type\":\"int\"},\"memorySizeGB\":{\"type\":\"int\"},\"cloudServicesNetworkAttachment\":{\"type\":\"object\",\"properties\":{\"networkAttachmentName\":{\"type\":\"string\"},\"attachedNetworkId\":{\"type\":\"string\"},\"ipAllocationMethod\":{\"type\":\"string\"},\"ipv4Address\":{\"type\":\"string\"},\"ipv6Address\":{\"type\":\"string\"},\"defaultGateway\":{\"type\":\"string\"}},\"required\":[\"attachedNetworkId\",\"ipAllocationMethod\"]},\"networkAttachments\":{\"type\":\"array\",\"items\":{\"type\":\"object\",\"properties\":{\"networkAttachmentName\":{\"type\":\"string\"},\"attachedNetworkId\":{\"type\":\"string\"},\"ipAllocationMethod\":{\"type\":\"string\"},\"ipv4Address\":{\"type\":\"string\"},\"ipv6Address\":{\"type\":\"string\"},\"defaultGateway\":{\"type\":\"string\"}},\"required\":[\"attachedNetworkId\",\"ipAllocationMethod\"]}},\"storageProfile\":{\"type\":\"object\",\"properties\":{\"osDisk\":{\"type\":\"object\",\"properties\":{\"createOption\":{\"type\":\"string\"},\"deleteOption\":{\"type\":\"string\"},\"diskSizeGB\":{\"type\":\"integer\"}},\"required\":[\"diskSizeGB\"]}},\"required\":[\"osDisk\"]},\"sshPublicKeys\":{\"type\":\"array\",\"items\":{\"type\":\"object\",\"properties\":{\"keyData\":{\"type\":\"string\"}},\"required\":[\"keyData\"]}},\"userData\":{\"type\":\"string\"},\"adminUsername\":{\"type\":\"string\"},\"bootMethod\":{\"type\":\"string\",\"default\":\"UEFI\",\"enum\":[\"UEFI\",\"BIOS\"]},\"isolateEmulatorThread\":{\"type\":\"string\"},\"virtioInterface\":{\"type\":\"string\"},\"placementHints\":{\"type\":\"array\",\"items\":{\"type\":\"object\",\"properties\":{\"hintType\":{\"type\":\"string\",\"enum\":[\"Affinity\",\"AntiAffinity\"]},\"resourceId\":{\"type\":\"string\"},\"schedulingExecution\":{\"type\":\"string\",\"enum\":[\"Soft\",\"Hard\"]},\"scope\":{\"type\":\"string\"}},\"required\":[\"hintType\",\"schedulingExecution\",\"resourceId\",\"scope\"]}}}", - "networkFunctionTemplate": { - "networkFunctionApplications": [ - { - "name": "testImageRole", - "artifactProfile": { - "artifactStore": { - "id": "/subscriptions/subid/resourceGroups/rg/providers/microsoft.hybridnetwork/publishers/TestPublisher/artifactStores/TestArtifactStore" - }, - "vhdArtifactProfile": { - "vhdName": "test-image", - "vhdVersion": "1-0-0" - } - }, - "artifactType": "VhdImageFile", - "dependsOnProfile": { - "installDependsOn": [], - "uninstallDependsOn": [], - "updateDependsOn": [] - }, - "deployParametersMappingRuleProfile": { - "applicationEnablement": "Unknown", - "vhdImageMappingRuleProfile": { - "userConfiguration": "" - } - } - }, - { - "name": "testTemplateRole", - "artifactProfile": { - "artifactStore": { - "id": "/subscriptions/subid/resourceGroups/rg/providers/microsoft.hybridnetwork/publishers/TestPublisher/artifactStores/TestArtifactStore" - }, - "templateArtifactProfile": { - "templateName": "test-template", - "templateVersion": "1.0.0" - } - }, - "artifactType": "ArmTemplate", - "dependsOnProfile": { - "installDependsOn": [ - "testImageRole" - ], - "uninstallDependsOn": [ - "testImageRole" - ], - "updateDependsOn": [ - "testImageRole" - ] - }, - "deployParametersMappingRuleProfile": { - "applicationEnablement": "Unknown", - "templateMappingRuleProfile": { - "templateParameters": "{\"virtualMachineName\":\"{deployParameters.virtualMachineName}\",\"cpuCores\":\"{deployParameters.cpuCores}\",\"memorySizeGB\":\"{deployParameters.memorySizeGB}\",\"cloudServicesNetworkAttachment\":\"{deployParameters.cloudServicesNetworkAttachment}\",\"networkAttachments\":\"{deployParameters.networkAttachments}\",\"sshPublicKeys\":\"{deployParameters.sshPublicKeys}\",\"storageProfile\":\"{deployParameters.storageProfile}\",\"isolateEmulatorThread\":\"{deployParameters.isolateEmulatorThread}\",\"virtioInterface\":\"{deployParameters.virtioInterface}\",\"userData\":\"{deployParameters.userData}\",\"adminUsername\":\"{deployParameters.adminUsername}\",\"bootMethod\":\"{deployParameters.bootMethod}\",\"placementHints\":\"{deployParameters.placementHints}\"}" - } - } - } - ], - "nfviType": "AzureCore" - }, - "networkFunctionType": "VirtualNetworkFunction", - "versionState": "Preview" - } - } - } - }, - "operationId": "NetworkFunctionDefinitionVersions_Get", - "title": "Get network function definition version resource for AzureCore VNF" -} diff --git a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/AzureCore/VirtualNetworkFunctionDelete.json b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/AzureCore/VirtualNetworkFunctionDelete.json deleted file mode 100644 index e1286f64da..0000000000 --- a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/AzureCore/VirtualNetworkFunctionDelete.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "parameters": { - "api-version": "2025-03-30", - "networkFunctionName": "testNf", - "resourceGroupName": "rg", - "subscriptionId": "subid" - }, - "responses": { - "200": {}, - "202": { - "headers": { - "location": "https://management.azure.com/providers/microsoft.hybridnetwork/locations/EASTUS2EUAP/operationStatuses/0b37c625-7e7c-49c5-b86e-c817c85acb5d*B77A34159CA34A0BD446D3BC7EC120649181590DDF991982765DAC1A87491B2D?api-version=2021-05-01" - } - }, - "204": {} - }, - "operationId": "NetworkFunctions_Delete", - "title": "Delete virtual network function resource on AzureCore" -} diff --git a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/AzureCore/VirtualNetworkFunctionGet.json b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/AzureCore/VirtualNetworkFunctionGet.json deleted file mode 100644 index 4fe2410c8d..0000000000 --- a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/AzureCore/VirtualNetworkFunctionGet.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "parameters": { - "api-version": "2025-03-30", - "networkFunctionName": "testNf", - "resourceGroupName": "rg", - "subscriptionId": "subid" - }, - "responses": { - "200": { - "body": { - "name": "testNf", - "type": "Microsoft.HybridNetwork/networkFunctions", - "id": "/subscriptions/subid/resourcegroups/rg/providers/Microsoft.HybridNetwork/networkFunctions/testNf", - "location": "eastus", - "properties": { - "allowSoftwareUpdate": false, - "configurationType": "Open", - "deploymentValues": "{\"virtualMachineName\":\"test-VM\",\"cpuCores\":4,\"memorySizeGB\":8,\"cloudServicesNetworkAttachment\":{\"attachedNetworkId\":\"test-csnet\",\"ipAllocationMethod\":\"Dynamic\",\"networkAttachmentName\":\"test-cs-vlan\"},\"networkAttachments\":[{\"attachedNetworkId\":\"test-l3vlan\",\"defaultGateway\":\"True\",\"ipAllocationMethod\":\"Dynamic\",\"networkAttachmentName\":\"test-vlan\"}],\"sshPublicKeys\":[{\"keyData\":\"ssh-rsa CMIIIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEA0TqlveKKlc2MFvEmuXJiLGBsY1t4ML4uiRADGSZlnc+7Ugv3h+MCjkkwOKiOdsNo8k4KSBIG5GcQfKYOOd17AJvqCL6cGQbaLuqv0a64jeDm8oO8/xN/IM0oKw7rMr/2oAJOgIsfeXPkRxWWic9AVIS++H5Qi2r7bUFX+cqFsyUCAwEBBQ==\"}],\"storageProfile\":{\"osDisk\":{\"createOption\":\"Ephemeral\",\"deleteOption\":\"Delete\",\"diskSizeGB\":10}},\"userData\":\"testUserData\",\"adminUsername\":\"testUser\",\"virtioInterface\":\"Transitional\",\"isolateEmulatorThread\":\"False\",\"bootMethod\":\"BIOS\",\"placementHints\":[]}", - "networkFunctionDefinitionGroupName": "TestNetworkFunctionDefinitionGroupName", - "networkFunctionDefinitionOfferingLocation": "eastus", - "networkFunctionDefinitionVersion": "1.0.0", - "nfviId": "/subscriptions/subid/resourceGroups/testResourceGroup", - "nfviType": "AzureCore", - "provisioningState": "Succeeded", - "publisherName": "TestPublisher", - "publisherScope": "Private" - } - } - } - }, - "operationId": "NetworkFunctions_Get", - "title": "Get virtual network function resource on AzureCore" -} diff --git a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/AzureOperatorNexus/VirtualNetworkFunctionCreate.json b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/AzureOperatorNexus/VirtualNetworkFunctionCreate.json deleted file mode 100644 index e3c7b4a643..0000000000 --- a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/AzureOperatorNexus/VirtualNetworkFunctionCreate.json +++ /dev/null @@ -1,72 +0,0 @@ -{ - "parameters": { - "api-version": "2025-03-30", - "networkFunctionName": "testNf", - "parameters": { - "location": "eastus", - "properties": { - "allowSoftwareUpdate": false, - "configurationType": "Open", - "deploymentValues": "{\"virtualMachineName\":\"test-VM\",\"extendedLocationName\":\"test-cluster\",\"cpuCores\":4,\"memorySizeGB\":8,\"cloudServicesNetworkAttachment\":{\"attachedNetworkId\":\"test-csnet\",\"ipAllocationMethod\":\"Dynamic\",\"networkAttachmentName\":\"test-cs-vlan\"},\"networkAttachments\":[{\"attachedNetworkId\":\"test-l3vlan\",\"defaultGateway\":\"True\",\"ipAllocationMethod\":\"Dynamic\",\"networkAttachmentName\":\"test-vlan\"}],\"sshPublicKeys\":[{\"keyData\":\"ssh-rsa CMIIIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEA0TqlveKKlc2MFvEmuXJiLGBsY1t4ML4uiRADGSZlnc+7Ugv3h+MCjkkwOKiOdsNo8k4KSBIG5GcQfKYOOd17AJvqCL6cGQbaLuqv0a64jeDm8oO8/xN/IM0oKw7rMr/2oAJOgIsfeXPkRxWWic9AVIS++H5Qi2r7bUFX+cqFsyUCAwEBBQ==\"}],\"storageProfile\":{\"osDisk\":{\"createOption\":\"Ephemeral\",\"deleteOption\":\"Delete\",\"diskSizeGB\":10}},\"userData\":\"testUserData\",\"adminUsername\":\"testUser\",\"virtioInterface\":\"Transitional\",\"isolateEmulatorThread\":\"False\",\"bootMethod\":\"BIOS\",\"placementHints\":[]}", - "networkFunctionDefinitionVersionResourceReference": { - "id": "/subscriptions/subid/resourcegroups/rg/providers/Microsoft.HybridNetwork/publishers/testVendor/networkFunctionDefinitionGroups/testnetworkFunctionDefinitionGroupName/networkFunctionDefinitionVersions/1.0.1", - "idType": "Open" - }, - "nfviId": "/subscriptions/subid/resourceGroups/testResourceGroup/providers/Microsoft.ExtendedLocation/customLocations/testCustomLocation", - "nfviType": "AzureOperatorNexus" - } - }, - "resourceGroupName": "rg", - "subscriptionId": "subid" - }, - "responses": { - "200": { - "body": { - "name": "testNf", - "type": "Microsoft.HybridNetwork/networkFunctions", - "id": "/subscriptions/subid/resourcegroups/rg/providers/Microsoft.HybridNetwork/networkFunctions/testNf", - "location": "eastus", - "properties": { - "allowSoftwareUpdate": false, - "configurationType": "Open", - "deploymentValues": "{\"virtualMachineName\":\"test-VM\",\"extendedLocationName\":\"test-cluster\",\"cpuCores\":4,\"memorySizeGB\":8,\"cloudServicesNetworkAttachment\":{\"attachedNetworkId\":\"test-csnet\",\"ipAllocationMethod\":\"Dynamic\",\"networkAttachmentName\":\"test-cs-vlan\"},\"networkAttachments\":[{\"attachedNetworkId\":\"test-l3vlan\",\"defaultGateway\":\"True\",\"ipAllocationMethod\":\"Dynamic\",\"networkAttachmentName\":\"test-vlan\"}],\"sshPublicKeys\":[{\"keyData\":\"ssh-rsa CMIIIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEA0TqlveKKlc2MFvEmuXJiLGBsY1t4ML4uiRADGSZlnc+7Ugv3h+MCjkkwOKiOdsNo8k4KSBIG5GcQfKYOOd17AJvqCL6cGQbaLuqv0a64jeDm8oO8/xN/IM0oKw7rMr/2oAJOgIsfeXPkRxWWic9AVIS++H5Qi2r7bUFX+cqFsyUCAwEBBQ==\"}],\"storageProfile\":{\"osDisk\":{\"createOption\":\"Ephemeral\",\"deleteOption\":\"Delete\",\"diskSizeGB\":10}},\"userData\":\"testUserData\",\"adminUsername\":\"testUser\",\"virtioInterface\":\"Transitional\",\"isolateEmulatorThread\":\"False\",\"bootMethod\":\"BIOS\",\"placementHints\":[]}", - "networkFunctionDefinitionGroupName": "TestNetworkFunctionDefinitionGroupName", - "networkFunctionDefinitionOfferingLocation": "eastus", - "networkFunctionDefinitionVersion": "1.0.0", - "networkFunctionDefinitionVersionResourceReference": { - "id": "/subscriptions/subid/resourcegroups/rg/providers/Microsoft.HybridNetwork/publishers/testVendor/networkFunctionDefinitionGroups/testnetworkFunctionDefinitionGroupName/networkFunctionDefinitionVersions/1.0.1", - "idType": "Open" - }, - "nfviId": "/subscriptions/subid/resourceGroups/testResourceGroup/providers/Microsoft.ExtendedLocation/customLocations/testCustomLocation", - "nfviType": "AzureOperatorNexus", - "provisioningState": "Succeeded", - "publisherName": "TestPublisher", - "publisherScope": "Private" - } - } - }, - "201": { - "body": { - "name": "testNf", - "type": "Microsoft.HybridNetwork/networkFunctions", - "id": "/subscriptions/subid/resourcegroups/rg/providers/Microsoft.HybridNetwork/networkFunctions/testNf", - "location": "eastus", - "properties": { - "allowSoftwareUpdate": false, - "configurationType": "Open", - "deploymentValues": "{\"virtualMachineName\":\"test-VM\",\"extendedLocationName\":\"test-cluster\",\"cpuCores\":4,\"memorySizeGB\":8,\"cloudServicesNetworkAttachment\":{\"attachedNetworkId\":\"test-csnet\",\"ipAllocationMethod\":\"Dynamic\",\"networkAttachmentName\":\"test-cs-vlan\"},\"networkAttachments\":[{\"attachedNetworkId\":\"test-l3vlan\",\"defaultGateway\":\"True\",\"ipAllocationMethod\":\"Dynamic\",\"networkAttachmentName\":\"test-vlan\"}],\"sshPublicKeys\":[{\"keyData\":\"ssh-rsa CMIIIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEA0TqlveKKlc2MFvEmuXJiLGBsY1t4ML4uiRADGSZlnc+7Ugv3h+MCjkkwOKiOdsNo8k4KSBIG5GcQfKYOOd17AJvqCL6cGQbaLuqv0a64jeDm8oO8/xN/IM0oKw7rMr/2oAJOgIsfeXPkRxWWic9AVIS++H5Qi2r7bUFX+cqFsyUCAwEBBQ==\"}],\"storageProfile\":{\"osDisk\":{\"createOption\":\"Ephemeral\",\"deleteOption\":\"Delete\",\"diskSizeGB\":10}},\"userData\":\"testUserData\",\"adminUsername\":\"testUser\",\"virtioInterface\":\"Transitional\",\"isolateEmulatorThread\":\"False\",\"bootMethod\":\"BIOS\",\"placementHints\":[]}", - "networkFunctionDefinitionGroupName": "TestNetworkFunctionDefinitionGroupName", - "networkFunctionDefinitionOfferingLocation": "eastus", - "networkFunctionDefinitionVersion": "1.0.0", - "nfviId": "/subscriptions/subid/resourceGroups/testResourceGroup/providers/Microsoft.ExtendedLocation/customLocations/testCustomLocation", - "nfviType": "AzureOperatorNexus", - "provisioningState": "Accepted", - "publisherName": "TestPublisher", - "publisherScope": "Private" - } - } - } - }, - "operationId": "NetworkFunctions_CreateOrUpdate", - "title": "Create virtual network function resource on AzureOperatorNexus" -} diff --git a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/AzureOperatorNexus/VirtualNetworkFunctionDefinitionVersionCreate.json b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/AzureOperatorNexus/VirtualNetworkFunctionDefinitionVersionCreate.json deleted file mode 100644 index 6c0f1ec1ec..0000000000 --- a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/AzureOperatorNexus/VirtualNetworkFunctionDefinitionVersionCreate.json +++ /dev/null @@ -1,228 +0,0 @@ -{ - "parameters": { - "api-version": "2025-03-30", - "networkFunctionDefinitionGroupName": "TestNetworkFunctionDefinitionGroupName", - "networkFunctionDefinitionVersionName": "1.0.0", - "parameters": { - "location": "eastus", - "properties": { - "description": "test NFDV for AzureOperatorNexus", - "deployParameters": "{\"virtualMachineName\":{\"type\":\"string\"},\"extendedLocationName\":{\"type\":\"string\"},\"cpuCores\":{\"type\":\"int\"},\"memorySizeGB\":{\"type\":\"int\"},\"cloudServicesNetworkAttachment\":{\"type\":\"object\",\"properties\":{\"networkAttachmentName\":{\"type\":\"string\"},\"attachedNetworkId\":{\"type\":\"string\"},\"ipAllocationMethod\":{\"type\":\"string\"},\"ipv4Address\":{\"type\":\"string\"},\"ipv6Address\":{\"type\":\"string\"},\"defaultGateway\":{\"type\":\"string\"}},\"required\":[\"attachedNetworkId\",\"ipAllocationMethod\"]},\"networkAttachments\":{\"type\":\"array\",\"items\":{\"type\":\"object\",\"properties\":{\"networkAttachmentName\":{\"type\":\"string\"},\"attachedNetworkId\":{\"type\":\"string\"},\"ipAllocationMethod\":{\"type\":\"string\"},\"ipv4Address\":{\"type\":\"string\"},\"ipv6Address\":{\"type\":\"string\"},\"defaultGateway\":{\"type\":\"string\"}},\"required\":[\"attachedNetworkId\",\"ipAllocationMethod\"]}},\"storageProfile\":{\"type\":\"object\",\"properties\":{\"osDisk\":{\"type\":\"object\",\"properties\":{\"createOption\":{\"type\":\"string\"},\"deleteOption\":{\"type\":\"string\"},\"diskSizeGB\":{\"type\":\"integer\"}},\"required\":[\"diskSizeGB\"]}},\"required\":[\"osDisk\"]},\"sshPublicKeys\":{\"type\":\"array\",\"items\":{\"type\":\"object\",\"properties\":{\"keyData\":{\"type\":\"string\"}},\"required\":[\"keyData\"]}},\"userData\":{\"type\":\"string\"},\"adminUsername\":{\"type\":\"string\"},\"bootMethod\":{\"type\":\"string\",\"default\":\"UEFI\",\"enum\":[\"UEFI\",\"BIOS\"]},\"isolateEmulatorThread\":{\"type\":\"string\"},\"virtioInterface\":{\"type\":\"string\"},\"placementHints\":{\"type\":\"array\",\"items\":{\"type\":\"object\",\"properties\":{\"hintType\":{\"type\":\"string\",\"enum\":[\"Affinity\",\"AntiAffinity\"]},\"resourceId\":{\"type\":\"string\"},\"schedulingExecution\":{\"type\":\"string\",\"enum\":[\"Soft\",\"Hard\"]},\"scope\":{\"type\":\"string\"}},\"required\":[\"hintType\",\"schedulingExecution\",\"resourceId\",\"scope\"]}}}", - "networkFunctionTemplate": { - "networkFunctionApplications": [ - { - "name": "testImageRole", - "artifactProfile": { - "artifactStore": { - "id": "/subscriptions/subid/resourceGroups/rg/providers/microsoft.hybridnetwork/publishers/TestPublisher/artifactStores/TestArtifactStore" - }, - "imageArtifactProfile": { - "imageName": "test-image", - "imageVersion": "1.0.0" - } - }, - "artifactType": "ImageFile", - "dependsOnProfile": { - "installDependsOn": [], - "uninstallDependsOn": [], - "updateDependsOn": [] - }, - "deployParametersMappingRuleProfile": { - "applicationEnablement": "Unknown", - "imageMappingRuleProfile": { - "userConfiguration": "" - } - } - }, - { - "name": "testTemplateRole", - "artifactProfile": { - "artifactStore": { - "id": "/subscriptions/subid/resourceGroups/rg/providers/microsoft.hybridnetwork/publishers/TestPublisher/artifactStores/TestArtifactStore" - }, - "templateArtifactProfile": { - "templateName": "test-template", - "templateVersion": "1.0.0" - } - }, - "artifactType": "ArmTemplate", - "dependsOnProfile": { - "installDependsOn": [ - "testImageRole" - ], - "uninstallDependsOn": [ - "testImageRole" - ], - "updateDependsOn": [ - "testImageRole" - ] - }, - "deployParametersMappingRuleProfile": { - "applicationEnablement": "Unknown", - "templateMappingRuleProfile": { - "templateParameters": "{\"virtualMachineName\":\"{deployParameters.virtualMachineName}\",\"extendedLocationName\":\"{deployParameters.extendedLocationName}\",\"cpuCores\":\"{deployParameters.cpuCores}\",\"memorySizeGB\":\"{deployParameters.memorySizeGB}\",\"cloudServicesNetworkAttachment\":\"{deployParameters.cloudServicesNetworkAttachment}\",\"networkAttachments\":\"{deployParameters.networkAttachments}\",\"sshPublicKeys\":\"{deployParameters.sshPublicKeys}\",\"storageProfile\":\"{deployParameters.storageProfile}\",\"isolateEmulatorThread\":\"{deployParameters.isolateEmulatorThread}\",\"virtioInterface\":\"{deployParameters.virtioInterface}\",\"userData\":\"{deployParameters.userData}\",\"adminUsername\":\"{deployParameters.adminUsername}\",\"bootMethod\":\"{deployParameters.bootMethod}\",\"placementHints\":\"{deployParameters.placementHints}\"}" - } - } - } - ], - "nfviType": "AzureOperatorNexus" - }, - "networkFunctionType": "VirtualNetworkFunction", - "versionState": "Preview" - } - }, - "publisherName": "TestPublisher", - "resourceGroupName": "rg", - "subscriptionId": "subid" - }, - "responses": { - "200": { - "body": { - "name": "TestVersion", - "type": "Microsoft.HybridNetwork/publishers/networkFunctionDefinitionGroups/networkFunctionDefinitionVersions", - "id": "/subscriptions/subid/resourcegroups/rg/providers/Microsoft.HybridNetwork/publishers/TestPublisher/networkFunctionDefinitionGroups/TestNetworkFunctionDefinitionGroupName/networkFunctionDefinitionVersions/1.0.0", - "location": "eastus", - "properties": { - "description": "test NFDV for AzureOperatorNexus", - "deployParameters": "{\"virtualMachineName\":{\"type\":\"string\"},\"extendedLocationName\":{\"type\":\"string\"},\"cpuCores\":{\"type\":\"int\"},\"memorySizeGB\":{\"type\":\"int\"},\"cloudServicesNetworkAttachment\":{\"type\":\"object\",\"properties\":{\"networkAttachmentName\":{\"type\":\"string\"},\"attachedNetworkId\":{\"type\":\"string\"},\"ipAllocationMethod\":{\"type\":\"string\"},\"ipv4Address\":{\"type\":\"string\"},\"ipv6Address\":{\"type\":\"string\"},\"defaultGateway\":{\"type\":\"string\"}},\"required\":[\"attachedNetworkId\",\"ipAllocationMethod\"]},\"networkAttachments\":{\"type\":\"array\",\"items\":{\"type\":\"object\",\"properties\":{\"networkAttachmentName\":{\"type\":\"string\"},\"attachedNetworkId\":{\"type\":\"string\"},\"ipAllocationMethod\":{\"type\":\"string\"},\"ipv4Address\":{\"type\":\"string\"},\"ipv6Address\":{\"type\":\"string\"},\"defaultGateway\":{\"type\":\"string\"}},\"required\":[\"attachedNetworkId\",\"ipAllocationMethod\"]}},\"storageProfile\":{\"type\":\"object\",\"properties\":{\"osDisk\":{\"type\":\"object\",\"properties\":{\"createOption\":{\"type\":\"string\"},\"deleteOption\":{\"type\":\"string\"},\"diskSizeGB\":{\"type\":\"integer\"}},\"required\":[\"diskSizeGB\"]}},\"required\":[\"osDisk\"]},\"sshPublicKeys\":{\"type\":\"array\",\"items\":{\"type\":\"object\",\"properties\":{\"keyData\":{\"type\":\"string\"}},\"required\":[\"keyData\"]}},\"userData\":{\"type\":\"string\"},\"adminUsername\":{\"type\":\"string\"},\"bootMethod\":{\"type\":\"string\",\"default\":\"UEFI\",\"enum\":[\"UEFI\",\"BIOS\"]},\"isolateEmulatorThread\":{\"type\":\"string\"},\"virtioInterface\":{\"type\":\"string\"},\"placementHints\":{\"type\":\"array\",\"items\":{\"type\":\"object\",\"properties\":{\"hintType\":{\"type\":\"string\",\"enum\":[\"Affinity\",\"AntiAffinity\"]},\"resourceId\":{\"type\":\"string\"},\"schedulingExecution\":{\"type\":\"string\",\"enum\":[\"Soft\",\"Hard\"]},\"scope\":{\"type\":\"string\"}},\"required\":[\"hintType\",\"schedulingExecution\",\"resourceId\",\"scope\"]}}}", - "networkFunctionTemplate": { - "networkFunctionApplications": [ - { - "name": "testImageRole", - "artifactProfile": { - "artifactStore": { - "id": "/subscriptions/subid/resourceGroups/rg/providers/microsoft.hybridnetwork/publishers/TestPublisher/artifactStores/TestArtifactStore" - }, - "imageArtifactProfile": { - "imageName": "test-image", - "imageVersion": "1.0.0" - } - }, - "artifactType": "ImageFile", - "dependsOnProfile": { - "installDependsOn": [], - "uninstallDependsOn": [], - "updateDependsOn": [] - }, - "deployParametersMappingRuleProfile": { - "applicationEnablement": "Unknown", - "imageMappingRuleProfile": { - "userConfiguration": "" - } - } - }, - { - "name": "testTemplateRole", - "artifactProfile": { - "artifactStore": { - "id": "/subscriptions/subid/resourceGroups/rg/providers/microsoft.hybridnetwork/publishers/TestPublisher/artifactStores/TestArtifactStore" - }, - "templateArtifactProfile": { - "templateName": "test-template", - "templateVersion": "1.0.0" - } - }, - "artifactType": "ArmTemplate", - "dependsOnProfile": { - "installDependsOn": [ - "testImageRole" - ], - "uninstallDependsOn": [ - "testImageRole" - ], - "updateDependsOn": [ - "testImageRole" - ] - }, - "deployParametersMappingRuleProfile": { - "applicationEnablement": "Unknown", - "templateMappingRuleProfile": { - "templateParameters": "{\"virtualMachineName\":\"{deployParameters.virtualMachineName}\",\"extendedLocationName\":\"{deployParameters.extendedLocationName}\",\"cpuCores\":\"{deployParameters.cpuCores}\",\"memorySizeGB\":\"{deployParameters.memorySizeGB}\",\"cloudServicesNetworkAttachment\":\"{deployParameters.cloudServicesNetworkAttachment}\",\"networkAttachments\":\"{deployParameters.networkAttachments}\",\"sshPublicKeys\":\"{deployParameters.sshPublicKeys}\",\"storageProfile\":\"{deployParameters.storageProfile}\",\"isolateEmulatorThread\":\"{deployParameters.isolateEmulatorThread}\",\"virtioInterface\":\"{deployParameters.virtioInterface}\",\"userData\":\"{deployParameters.userData}\",\"adminUsername\":\"{deployParameters.adminUsername}\",\"bootMethod\":\"{deployParameters.bootMethod}\",\"placementHints\":\"{deployParameters.placementHints}\"}" - } - } - } - ], - "nfviType": "AzureOperatorNexus" - }, - "networkFunctionType": "VirtualNetworkFunction", - "versionState": "Preview" - } - } - }, - "201": { - "body": { - "name": "TestVersion", - "type": "Microsoft.HybridNetwork/publishers/networkFunctionDefinitionGroups/networkFunctionDefinitionVersions", - "id": "/subscriptions/subid/resourcegroups/rg/providers/Microsoft.HybridNetwork/publishers/TestPublisher/networkFunctionDefinitionGroups/TestNetworkFunctionDefinitionGroupName/networkFunctionDefinitionVersions/1.0.0", - "location": "eastus", - "properties": { - "description": "test NFDV for AzureOperatorNexus", - "deployParameters": "{\"virtualMachineName\":{\"type\":\"string\"},\"extendedLocationName\":{\"type\":\"string\"},\"cpuCores\":{\"type\":\"int\"},\"memorySizeGB\":{\"type\":\"int\"},\"cloudServicesNetworkAttachment\":{\"type\":\"object\",\"properties\":{\"networkAttachmentName\":{\"type\":\"string\"},\"attachedNetworkId\":{\"type\":\"string\"},\"ipAllocationMethod\":{\"type\":\"string\"},\"ipv4Address\":{\"type\":\"string\"},\"ipv6Address\":{\"type\":\"string\"},\"defaultGateway\":{\"type\":\"string\"}},\"required\":[\"attachedNetworkId\",\"ipAllocationMethod\"]},\"networkAttachments\":{\"type\":\"array\",\"items\":{\"type\":\"object\",\"properties\":{\"networkAttachmentName\":{\"type\":\"string\"},\"attachedNetworkId\":{\"type\":\"string\"},\"ipAllocationMethod\":{\"type\":\"string\"},\"ipv4Address\":{\"type\":\"string\"},\"ipv6Address\":{\"type\":\"string\"},\"defaultGateway\":{\"type\":\"string\"}},\"required\":[\"attachedNetworkId\",\"ipAllocationMethod\"]}},\"storageProfile\":{\"type\":\"object\",\"properties\":{\"osDisk\":{\"type\":\"object\",\"properties\":{\"createOption\":{\"type\":\"string\"},\"deleteOption\":{\"type\":\"string\"},\"diskSizeGB\":{\"type\":\"integer\"}},\"required\":[\"diskSizeGB\"]}},\"required\":[\"osDisk\"]},\"sshPublicKeys\":{\"type\":\"array\",\"items\":{\"type\":\"object\",\"properties\":{\"keyData\":{\"type\":\"string\"}},\"required\":[\"keyData\"]}},\"userData\":{\"type\":\"string\"},\"adminUsername\":{\"type\":\"string\"},\"bootMethod\":{\"type\":\"string\",\"default\":\"UEFI\",\"enum\":[\"UEFI\",\"BIOS\"]},\"isolateEmulatorThread\":{\"type\":\"string\"},\"virtioInterface\":{\"type\":\"string\"},\"placementHints\":{\"type\":\"array\",\"items\":{\"type\":\"object\",\"properties\":{\"hintType\":{\"type\":\"string\",\"enum\":[\"Affinity\",\"AntiAffinity\"]},\"resourceId\":{\"type\":\"string\"},\"schedulingExecution\":{\"type\":\"string\",\"enum\":[\"Soft\",\"Hard\"]},\"scope\":{\"type\":\"string\"}},\"required\":[\"hintType\",\"schedulingExecution\",\"resourceId\",\"scope\"]}}}", - "networkFunctionTemplate": { - "networkFunctionApplications": [ - { - "name": "testImageRole", - "artifactProfile": { - "artifactStore": { - "id": "/subscriptions/subid/resourceGroups/rg/providers/microsoft.hybridnetwork/publishers/TestPublisher/artifactStores/TestArtifactStore" - }, - "imageArtifactProfile": { - "imageName": "test-image", - "imageVersion": "1.0.0" - } - }, - "artifactType": "ImageFile", - "dependsOnProfile": { - "installDependsOn": [], - "uninstallDependsOn": [], - "updateDependsOn": [] - }, - "deployParametersMappingRuleProfile": { - "applicationEnablement": "Unknown", - "imageMappingRuleProfile": { - "userConfiguration": "" - } - } - }, - { - "name": "testTemplateRole", - "artifactProfile": { - "artifactStore": { - "id": "/subscriptions/subid/resourceGroups/rg/providers/microsoft.hybridnetwork/publishers/TestPublisher/artifactStores/TestArtifactStore" - }, - "templateArtifactProfile": { - "templateName": "test-template", - "templateVersion": "1.0.0" - } - }, - "artifactType": "ArmTemplate", - "dependsOnProfile": { - "installDependsOn": [ - "testImageRole" - ], - "uninstallDependsOn": [ - "testImageRole" - ], - "updateDependsOn": [ - "testImageRole" - ] - }, - "deployParametersMappingRuleProfile": { - "applicationEnablement": "Unknown", - "templateMappingRuleProfile": { - "templateParameters": "{\"virtualMachineName\":\"{deployParameters.virtualMachineName}\",\"extendedLocationName\":\"{deployParameters.extendedLocationName}\",\"cpuCores\":\"{deployParameters.cpuCores}\",\"memorySizeGB\":\"{deployParameters.memorySizeGB}\",\"cloudServicesNetworkAttachment\":\"{deployParameters.cloudServicesNetworkAttachment}\",\"networkAttachments\":\"{deployParameters.networkAttachments}\",\"sshPublicKeys\":\"{deployParameters.sshPublicKeys}\",\"storageProfile\":\"{deployParameters.storageProfile}\",\"isolateEmulatorThread\":\"{deployParameters.isolateEmulatorThread}\",\"virtioInterface\":\"{deployParameters.virtioInterface}\",\"userData\":\"{deployParameters.userData}\",\"adminUsername\":\"{deployParameters.adminUsername}\",\"bootMethod\":\"{deployParameters.bootMethod}\",\"placementHints\":\"{deployParameters.placementHints}\"}" - } - } - } - ], - "nfviType": "AzureOperatorNexus" - }, - "networkFunctionType": "VirtualNetworkFunction", - "versionState": "Preview" - } - } - } - }, - "operationId": "NetworkFunctionDefinitionVersions_CreateOrUpdate", - "title": "Create or update a network function definition version resource for AzureOperatorNexus VNF" -} diff --git a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/AzureOperatorNexus/VirtualNetworkFunctionDefinitionVersionDelete.json b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/AzureOperatorNexus/VirtualNetworkFunctionDefinitionVersionDelete.json deleted file mode 100644 index 3dbea06338..0000000000 --- a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/AzureOperatorNexus/VirtualNetworkFunctionDefinitionVersionDelete.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "parameters": { - "api-version": "2025-03-30", - "networkFunctionDefinitionGroupName": "TestNetworkFunctionDefinitionGroupName", - "networkFunctionDefinitionVersionName": "1.0.0", - "publisherName": "TestPublisher", - "resourceGroupName": "rg", - "subscriptionId": "subid" - }, - "responses": { - "202": { - "headers": { - "location": "https://management.azure.com/providers/microsoft.hybridnetwork/locations/EASTUS2EUAP/operationStatuses/0b37c625-7e7c-49c5-b86e-c817c85acb5d*B77A34159CA34A0BD446D3BC7EC120649181590DDF991982765DAC1A87491B2D?api-version=2021-05-01" - } - }, - "204": {} - }, - "operationId": "NetworkFunctionDefinitionVersions_Delete", - "title": "Delete a network function definition version for AzureOperatorNexus VNF" -} diff --git a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/AzureOperatorNexus/VirtualNetworkFunctionDefinitionVersionGet.json b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/AzureOperatorNexus/VirtualNetworkFunctionDefinitionVersionGet.json deleted file mode 100644 index 6f3c19bfd5..0000000000 --- a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/AzureOperatorNexus/VirtualNetworkFunctionDefinitionVersionGet.json +++ /dev/null @@ -1,87 +0,0 @@ -{ - "parameters": { - "api-version": "2025-03-30", - "networkFunctionDefinitionGroupName": "TestNetworkFunctionDefinitionGroupName", - "networkFunctionDefinitionVersionName": "1.0.0", - "publisherName": "TestPublisher", - "resourceGroupName": "rg", - "subscriptionId": "subid" - }, - "responses": { - "200": { - "body": { - "name": "TestVersion", - "type": "Microsoft.HybridNetwork/publishers/networkFunctionDefinitionGroups/networkFunctionDefinitionVersions", - "id": "/subscriptions/subid/resourcegroups/rg/providers/Microsoft.HybridNetwork/publishers/TestPublisher/networkFunctionDefinitionGroups/TestNetworkFunctionDefinitionGroupName/networkFunctionDefinitionVersions/1.0.0", - "location": "eastus", - "properties": { - "description": "test NFDV for AzureOperatorNexus", - "deployParameters": "{\"virtualMachineName\":{\"type\":\"string\"},\"extendedLocationName\":{\"type\":\"string\"},\"cpuCores\":{\"type\":\"int\"},\"memorySizeGB\":{\"type\":\"int\"},\"cloudServicesNetworkAttachment\":{\"type\":\"object\",\"properties\":{\"networkAttachmentName\":{\"type\":\"string\"},\"attachedNetworkId\":{\"type\":\"string\"},\"ipAllocationMethod\":{\"type\":\"string\"},\"ipv4Address\":{\"type\":\"string\"},\"ipv6Address\":{\"type\":\"string\"},\"defaultGateway\":{\"type\":\"string\"}},\"required\":[\"attachedNetworkId\",\"ipAllocationMethod\"]},\"networkAttachments\":{\"type\":\"array\",\"items\":{\"type\":\"object\",\"properties\":{\"networkAttachmentName\":{\"type\":\"string\"},\"attachedNetworkId\":{\"type\":\"string\"},\"ipAllocationMethod\":{\"type\":\"string\"},\"ipv4Address\":{\"type\":\"string\"},\"ipv6Address\":{\"type\":\"string\"},\"defaultGateway\":{\"type\":\"string\"}},\"required\":[\"attachedNetworkId\",\"ipAllocationMethod\"]}},\"storageProfile\":{\"type\":\"object\",\"properties\":{\"osDisk\":{\"type\":\"object\",\"properties\":{\"createOption\":{\"type\":\"string\"},\"deleteOption\":{\"type\":\"string\"},\"diskSizeGB\":{\"type\":\"integer\"}},\"required\":[\"diskSizeGB\"]}},\"required\":[\"osDisk\"]},\"sshPublicKeys\":{\"type\":\"array\",\"items\":{\"type\":\"object\",\"properties\":{\"keyData\":{\"type\":\"string\"}},\"required\":[\"keyData\"]}},\"userData\":{\"type\":\"string\"},\"adminUsername\":{\"type\":\"string\"},\"bootMethod\":{\"type\":\"string\",\"default\":\"UEFI\",\"enum\":[\"UEFI\",\"BIOS\"]},\"isolateEmulatorThread\":{\"type\":\"string\"},\"virtioInterface\":{\"type\":\"string\"},\"placementHints\":{\"type\":\"array\",\"items\":{\"type\":\"object\",\"properties\":{\"hintType\":{\"type\":\"string\",\"enum\":[\"Affinity\",\"AntiAffinity\"]},\"resourceId\":{\"type\":\"string\"},\"schedulingExecution\":{\"type\":\"string\",\"enum\":[\"Soft\",\"Hard\"]},\"scope\":{\"type\":\"string\"}},\"required\":[\"hintType\",\"schedulingExecution\",\"resourceId\",\"scope\"]}}}", - "networkFunctionTemplate": { - "networkFunctionApplications": [ - { - "name": "testImageRole", - "artifactProfile": { - "artifactStore": { - "id": "/subscriptions/subid/resourceGroups/rg/providers/microsoft.hybridnetwork/publishers/TestPublisher/artifactStores/TestArtifactStore" - }, - "imageArtifactProfile": { - "imageName": "test-image", - "imageVersion": "1.0.0" - } - }, - "artifactType": "ImageFile", - "dependsOnProfile": { - "installDependsOn": [], - "uninstallDependsOn": [], - "updateDependsOn": [] - }, - "deployParametersMappingRuleProfile": { - "applicationEnablement": "Unknown", - "imageMappingRuleProfile": { - "userConfiguration": "" - } - } - }, - { - "name": "testTemplateRole", - "artifactProfile": { - "artifactStore": { - "id": "/subscriptions/subid/resourceGroups/rg/providers/microsoft.hybridnetwork/publishers/TestPublisher/artifactStores/TestArtifactStore" - }, - "templateArtifactProfile": { - "templateName": "test-template", - "templateVersion": "1.0.0" - } - }, - "artifactType": "ArmTemplate", - "dependsOnProfile": { - "installDependsOn": [ - "testImageRole" - ], - "uninstallDependsOn": [ - "testImageRole" - ], - "updateDependsOn": [ - "testImageRole" - ] - }, - "deployParametersMappingRuleProfile": { - "applicationEnablement": "Unknown", - "templateMappingRuleProfile": { - "templateParameters": "{\"virtualMachineName\":\"{deployParameters.virtualMachineName}\",\"extendedLocationName\":\"{deployParameters.extendedLocationName}\",\"cpuCores\":\"{deployParameters.cpuCores}\",\"memorySizeGB\":\"{deployParameters.memorySizeGB}\",\"cloudServicesNetworkAttachment\":\"{deployParameters.cloudServicesNetworkAttachment}\",\"networkAttachments\":\"{deployParameters.networkAttachments}\",\"sshPublicKeys\":\"{deployParameters.sshPublicKeys}\",\"storageProfile\":\"{deployParameters.storageProfile}\",\"isolateEmulatorThread\":\"{deployParameters.isolateEmulatorThread}\",\"virtioInterface\":\"{deployParameters.virtioInterface}\",\"userData\":\"{deployParameters.userData}\",\"adminUsername\":\"{deployParameters.adminUsername}\",\"bootMethod\":\"{deployParameters.bootMethod}\",\"placementHints\":\"{deployParameters.placementHints}\"}" - } - } - } - ], - "nfviType": "AzureOperatorNexus" - }, - "networkFunctionType": "VirtualNetworkFunction", - "versionState": "Preview" - } - } - } - }, - "operationId": "NetworkFunctionDefinitionVersions_Get", - "title": "Get network function definition version resource for AzureOperatorNexus VNF" -} diff --git a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/AzureOperatorNexus/VirtualNetworkFunctionDelete.json b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/AzureOperatorNexus/VirtualNetworkFunctionDelete.json deleted file mode 100644 index be04721617..0000000000 --- a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/AzureOperatorNexus/VirtualNetworkFunctionDelete.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "parameters": { - "api-version": "2025-03-30", - "networkFunctionName": "testNf", - "resourceGroupName": "rg", - "subscriptionId": "subid" - }, - "responses": { - "200": {}, - "202": { - "headers": { - "location": "https://management.azure.com/providers/microsoft.hybridnetwork/locations/EASTUS2EUAP/operationStatuses/0b37c625-7e7c-49c5-b86e-c817c85acb5d*B77A34159CA34A0BD446D3BC7EC120649181590DDF991982765DAC1A87491B2D?api-version=2021-05-01" - } - }, - "204": {} - }, - "operationId": "NetworkFunctions_Delete", - "title": "Delete virtual network function resource on AzureOperatorNexus" -} diff --git a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/AzureOperatorNexus/VirtualNetworkFunctionGet.json b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/AzureOperatorNexus/VirtualNetworkFunctionGet.json deleted file mode 100644 index d08a026a64..0000000000 --- a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/AzureOperatorNexus/VirtualNetworkFunctionGet.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "parameters": { - "api-version": "2025-03-30", - "networkFunctionName": "testNf", - "resourceGroupName": "rg", - "subscriptionId": "subid" - }, - "responses": { - "200": { - "body": { - "name": "testNf", - "type": "Microsoft.HybridNetwork/networkFunctions", - "id": "/subscriptions/subid/resourcegroups/rg/providers/Microsoft.HybridNetwork/networkFunctions/testNf", - "location": "eastus", - "properties": { - "allowSoftwareUpdate": false, - "configurationType": "Open", - "deploymentValues": "{\"virtualMachineName\":\"test-VM\",\"extendedLocationName\":\"test-cluster\",\"cpuCores\":4,\"memorySizeGB\":8,\"cloudServicesNetworkAttachment\":{\"attachedNetworkId\":\"test-csnet\",\"ipAllocationMethod\":\"Dynamic\",\"networkAttachmentName\":\"test-cs-vlan\"},\"networkAttachments\":[{\"attachedNetworkId\":\"test-l3vlan\",\"defaultGateway\":\"True\",\"ipAllocationMethod\":\"Dynamic\",\"networkAttachmentName\":\"test-vlan\"}],\"sshPublicKeys\":[{\"keyData\":\"ssh-rsa CMIIIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEA0TqlveKKlc2MFvEmuXJiLGBsY1t4ML4uiRADGSZlnc+7Ugv3h+MCjkkwOKiOdsNo8k4KSBIG5GcQfKYOOd17AJvqCL6cGQbaLuqv0a64jeDm8oO8/xN/IM0oKw7rMr/2oAJOgIsfeXPkRxWWic9AVIS++H5Qi2r7bUFX+cqFsyUCAwEBBQ==\"}],\"storageProfile\":{\"osDisk\":{\"createOption\":\"Ephemeral\",\"deleteOption\":\"Delete\",\"diskSizeGB\":10}},\"userData\":\"testUserData\",\"adminUsername\":\"testUser\",\"virtioInterface\":\"Transitional\",\"isolateEmulatorThread\":\"False\",\"bootMethod\":\"BIOS\",\"placementHints\":[]}", - "networkFunctionDefinitionGroupName": "TestNetworkFunctionDefinitionGroupName", - "networkFunctionDefinitionOfferingLocation": "eastus", - "networkFunctionDefinitionVersion": "1.0.0", - "nfviId": "/subscriptions/subid/resourceGroups/testResourceGroup/providers/Microsoft.ExtendedLocation/customLocations/testCustomLocation", - "nfviType": "AzureOperatorNexus", - "provisioningState": "Succeeded", - "publisherName": "TestPublisher", - "publisherScope": "Private" - } - } - } - }, - "operationId": "NetworkFunctions_Get", - "title": "Get virtual network function resource on AzureOperatorNexus" -} diff --git a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ComponentGet.json b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ComponentGet.json deleted file mode 100644 index e8ed7ad1f1..0000000000 --- a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ComponentGet.json +++ /dev/null @@ -1,59 +0,0 @@ -{ - "parameters": { - "api-version": "2025-03-30", - "componentName": "testComponent", - "networkFunctionName": "testNf", - "resourceGroupName": "rg", - "subscriptionId": "subid" - }, - "responses": { - "200": { - "body": { - "name": "testComponent", - "type": "Microsoft.HybridNetwork/networkFunctions/components", - "id": "/subscriptions/subid/resourcegroups/rg/providers/Microsoft.HybridNetwork/networkFunctions/testNf/components/testComponent", - "properties": { - "deploymentProfile": "{\"chart\":{\"name\":\"testChartName\",\"version\":\"v1.0.0\"},\"releaseName\":\"testReleaseName\",\"targetNamespace\":\"testTargetNameSpace\",\"values\":{\".repoBase\":\"testrepo.azurecr.io/\"}}", - "deploymentStatus": { - "nextExpectedUpdateAt": "2023-07-10T02:06:01.116+00:00", - "resources": { - "deployments": [ - { - "name": "nginix", - "available": 3, - "creationTime": "2023-07-10T02:05:01.116+00:00", - "desired": 3, - "namespace": "core", - "ready": 3, - "upToDate": 3 - } - ], - "pods": [ - { - "name": "nginix", - "creationTime": "2023-07-10T02:05:01.116+00:00", - "desired": 3, - "events": [ - { - "type": "Normal", - "lastSeenTime": "2023-07-10T02:06:01.116+00:00", - "message": "Pulling image nginx", - "reason": "Pulling" - } - ], - "namespace": "core", - "ready": 3, - "status": "Succeeded" - } - ] - }, - "status": "Installing" - }, - "provisioningState": "Succeeded" - } - } - } - }, - "operationId": "Components_Get", - "title": "Get component resource" -} diff --git a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ComponentListByNetworkFunction.json b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ComponentListByNetworkFunction.json deleted file mode 100644 index 23e66f62c3..0000000000 --- a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ComponentListByNetworkFunction.json +++ /dev/null @@ -1,63 +0,0 @@ -{ - "parameters": { - "api-version": "2025-03-30", - "networkFunctionName": "testNf", - "resourceGroupName": "rg", - "subscriptionId": "subid" - }, - "responses": { - "200": { - "body": { - "nextLink": "https://microsoft.com/a", - "value": [ - { - "name": "testComponent", - "type": "Microsoft.HybridNetwork/networkFunctions/components", - "id": "/subscriptions/subid/resourcegroups/rg/providers/Microsoft.HybridNetwork/networkFunctions/testNf/components/testComponent", - "properties": { - "deploymentProfile": "{\"chart\":{\"name\":\"testChartName\",\"version\":\"v1.0.0\"},\"releaseName\":\"testReleaseName\",\"targetNamespace\":\"testTargetNameSpace\",\"values\":{\".repoBase\":\"testrepo.azurecr.io/\"}}", - "deploymentStatus": { - "nextExpectedUpdateAt": "2023-07-10T02:06:01.116+00:00", - "resources": { - "deployments": [ - { - "name": "nginix", - "available": 3, - "creationTime": "2023-07-10T02:05:01.116+00:00", - "desired": 3, - "namespace": "core", - "ready": 3, - "upToDate": 3 - } - ], - "pods": [ - { - "name": "nginix", - "creationTime": "2023-07-10T02:05:01.116+00:00", - "desired": 3, - "events": [ - { - "type": "Normal", - "lastSeenTime": "2023-07-10T02:06:01.116+00:00", - "message": "Pulling image nginx", - "reason": "Pulling" - } - ], - "namespace": "core", - "ready": 3, - "status": "Succeeded" - } - ] - }, - "status": "Installing" - }, - "provisioningState": "Succeeded" - } - } - ] - } - } - }, - "operationId": "Components_ListByNetworkFunction", - "title": "List components in network function" -} diff --git a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ConfigurationGroupSchemaCreate.json b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ConfigurationGroupSchemaCreate.json deleted file mode 100644 index 379e9e1332..0000000000 --- a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ConfigurationGroupSchemaCreate.json +++ /dev/null @@ -1,62 +0,0 @@ -{ - "parameters": { - "api-version": "2025-03-30", - "configurationGroupSchemaName": "testConfigurationGroupSchema", - "parameters": { - "location": "westUs2", - "properties": { - "description": "Schema with no secrets", - "schemaDefinition": "{\"type\":\"object\",\"properties\":{\"interconnect-groups\":{\"type\":\"object\",\"properties\":{\"type\":\"object\",\"properties\":{\"name\":{\"type\":\"string\"},\"international-interconnects\":{\"type\":\"array\",\"item\":{\"type\":\"string\"}},\"domestic-interconnects\":{\"type\":\"array\",\"item\":{\"type\":\"string\"}}}}},\"interconnect-group-assignments\":{\"type\":\"object\",\"properties\":{\"type\":\"object\",\"properties\":{\"ssc\":{\"type\":\"string\"},\"interconnects-interconnects\":{\"type\":\"string\"}}}}},\"required\":[\"interconnect-groups\",\"interconnect-group-assignments\"]}" - } - }, - "publisherName": "testPublisher", - "resourceGroupName": "rg1", - "subscriptionId": "subid" - }, - "responses": { - "200": { - "body": { - "name": "testConfigurationGroupSchema", - "type": "Microsoft.HybridNetwork/publishers/configurationGroupSchemas", - "id": "/subscriptions/subid/resourcegroups/testRG/providers/microsoft.hybridnetwork/publishers/testPublisher/configurationGroupSchemas/interconnectgroupsSchema", - "location": "westUs2", - "properties": { - "description": "Schema with no secrets", - "provisioningState": "Accepted", - "schemaDefinition": "{\"type\":\"object\",\"properties\":{\"interconnect-groups\":{\"type\":\"object\",\"properties\":{\"type\":\"object\",\"properties\":{\"name\":{\"type\":\"string\"},\"international-interconnects\":{\"type\":\"array\",\"item\":{\"type\":\"string\"}},\"domestic-interconnects\":{\"type\":\"array\",\"item\":{\"type\":\"string\"}}}}},\"interconnect-group-assignments\":{\"type\":\"object\",\"properties\":{\"type\":\"object\",\"properties\":{\"ssc\":{\"type\":\"string\"},\"interconnects-interconnects\":{\"type\":\"string\"}}}}},\"required\":[\"interconnect-groups\",\"interconnect-group-assignments\"]}" - }, - "systemData": { - "createdAt": "2020-01-01T17:18:19.1234567Z", - "createdBy": "user1", - "createdByType": "User", - "lastModifiedAt": "2020-01-02T17:18:19.1234567Z", - "lastModifiedBy": "user2", - "lastModifiedByType": "User" - } - } - }, - "201": { - "body": { - "name": "testConfigurationGroupSchema", - "type": "Microsoft.HybridNetwork/publishers/configurationGroupSchemas", - "id": "/subscriptions/subid/resourcegroups/testRG/providers/microsoft.hybridnetwork/publishers/testPublisher/configurationGroupSchemas/interconnectgroupsSchema", - "location": "westUs2", - "properties": { - "description": "Schema with no secrets", - "provisioningState": "Accepted", - "schemaDefinition": "{\"type\":\"object\",\"properties\":{\"interconnect-groups\":{\"type\":\"object\",\"properties\":{\"type\":\"object\",\"properties\":{\"name\":{\"type\":\"string\"},\"international-interconnects\":{\"type\":\"array\",\"item\":{\"type\":\"string\"}},\"domestic-interconnects\":{\"type\":\"array\",\"item\":{\"type\":\"string\"}}}}},\"interconnect-group-assignments\":{\"type\":\"object\",\"properties\":{\"type\":\"object\",\"properties\":{\"ssc\":{\"type\":\"string\"},\"interconnects-interconnects\":{\"type\":\"string\"}}}}},\"required\":[\"interconnect-groups\",\"interconnect-group-assignments\"]}" - }, - "systemData": { - "createdAt": "2020-01-01T17:18:19.1234567Z", - "createdBy": "user1", - "createdByType": "User", - "lastModifiedAt": "2020-01-02T17:18:19.1234567Z", - "lastModifiedBy": "user2", - "lastModifiedByType": "User" - } - } - } - }, - "operationId": "ConfigurationGroupSchemas_CreateOrUpdate", - "title": "Create or update the network function definition group" -} diff --git a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ConfigurationGroupSchemaDelete.json b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ConfigurationGroupSchemaDelete.json deleted file mode 100644 index 932397cab4..0000000000 --- a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ConfigurationGroupSchemaDelete.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "parameters": { - "api-version": "2025-03-30", - "configurationGroupSchemaName": "testConfigurationGroupSchema", - "publisherName": "testPublisher", - "resourceGroupName": "rg1", - "subscriptionId": "subid" - }, - "responses": { - "202": { - "headers": { - "location": "https://management.azure.com/providers/microsoft.hybridnetwork/locations/EASTUS2EUAP/operationStatuses/0b37c625-7e7c-49c5-b86e-c817c85acb5d*B77A34159CA34A0BD446D3BC7EC120649181590DDF991982765DAC1A87491B2D?api-version=2021-05-01" - } - }, - "204": {} - }, - "operationId": "ConfigurationGroupSchemas_Delete", - "title": "Delete a network function group resource" -} diff --git a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ConfigurationGroupSchemaGet.json b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ConfigurationGroupSchemaGet.json deleted file mode 100644 index 7c661f319d..0000000000 --- a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ConfigurationGroupSchemaGet.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "parameters": { - "api-version": "2025-03-30", - "configurationGroupSchemaName": "testConfigurationGroupSchema", - "publisherName": "testPublisher", - "resourceGroupName": "rg1", - "subscriptionId": "subid" - }, - "responses": { - "200": { - "body": { - "name": "testConfigurationGroupSchema", - "type": "Microsoft.HybridNetwork/publishers/configurationGroupSchemas", - "id": "/subscriptions/subid/resourcegroups/testRG/providers/microsoft.hybridnetwork/publishers/testPublisher/configurationGroupSchemas/interconnectgroupsSchema", - "location": "westUs2", - "properties": { - "description": "Schema with no secrets", - "provisioningState": "Accepted", - "schemaDefinition": "{\"type\":\"object\",\"properties\":{\"interconnect-groups\":{\"type\":\"object\",\"properties\":{\"type\":\"object\",\"properties\":{\"name\":{\"type\":\"string\"},\"international-interconnects\":{\"type\":\"array\",\"item\":{\"type\":\"string\"}},\"domestic-interconnects\":{\"type\":\"array\",\"item\":{\"type\":\"string\"}}}}},\"interconnect-group-assignments\":{\"type\":\"object\",\"properties\":{\"type\":\"object\",\"properties\":{\"ssc\":{\"type\":\"string\"},\"interconnects-interconnects\":{\"type\":\"string\"}}}}},\"required\":[\"interconnect-groups\",\"interconnect-group-assignments\"]}" - }, - "systemData": { - "createdAt": "2020-01-01T17:18:19.1234567Z", - "createdBy": "user1", - "createdByType": "User", - "lastModifiedAt": "2020-01-02T17:18:19.1234567Z", - "lastModifiedBy": "user2", - "lastModifiedByType": "User" - } - } - } - }, - "operationId": "ConfigurationGroupSchemas_Get", - "title": "Get a networkFunctionDefinition group resource" -} diff --git a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ConfigurationGroupSchemaListByPublisherName.json b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ConfigurationGroupSchemaListByPublisherName.json deleted file mode 100644 index 4fca965e07..0000000000 --- a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ConfigurationGroupSchemaListByPublisherName.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "parameters": { - "api-version": "2025-03-30", - "publisherName": "testPublisher", - "resourceGroupName": "rg1", - "subscriptionId": "subid" - }, - "responses": { - "200": { - "body": { - "value": [ - { - "name": "testConfigurationGroupSchema", - "type": "Microsoft.HybridNetwork/publishers/configurationGroupSchemas", - "id": "/subscriptions/subid/resourcegroups/testRG/providers/microsoft.hybridnetwork/publishers/testPublisher/configurationGroupSchemas/interconnectgroupsSchema", - "location": "westUs2", - "properties": { - "description": "Schema with no secrets", - "provisioningState": "Accepted", - "schemaDefinition": "{\"type\":\"object\",\"properties\":{\"interconnect-groups\":{\"type\":\"object\",\"properties\":{\"type\":\"object\",\"properties\":{\"name\":{\"type\":\"string\"},\"international-interconnects\":{\"type\":\"array\",\"item\":{\"type\":\"string\"}},\"domestic-interconnects\":{\"type\":\"array\",\"item\":{\"type\":\"string\"}}}}},\"interconnect-group-assignments\":{\"type\":\"object\",\"properties\":{\"type\":\"object\",\"properties\":{\"ssc\":{\"type\":\"string\"},\"interconnects-interconnects\":{\"type\":\"string\"}}}}},\"required\":[\"interconnect-groups\",\"interconnect-group-assignments\"]}" - }, - "systemData": { - "createdAt": "2020-01-01T17:18:19.1234567Z", - "createdBy": "user1", - "createdByType": "User", - "lastModifiedAt": "2020-01-02T17:18:19.1234567Z", - "lastModifiedBy": "user2", - "lastModifiedByType": "User" - } - } - ] - } - } - }, - "operationId": "ConfigurationGroupSchemas_ListByPublisher", - "title": "Get networkFunctionDefinition groups under publisher resource" -} diff --git a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ConfigurationGroupSchemaUpdateTags.json b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ConfigurationGroupSchemaUpdateTags.json deleted file mode 100644 index 37e1d2f9ea..0000000000 --- a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ConfigurationGroupSchemaUpdateTags.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "parameters": { - "api-version": "2025-03-30", - "configurationGroupSchemaName": "testConfigurationGroupSchema", - "parameters": { - "tags": { - "tag1": "value1", - "tag2": "value2" - } - }, - "publisherName": "testPublisher", - "resourceGroupName": "rg1", - "subscriptionId": "subid" - }, - "responses": { - "200": { - "body": { - "name": "testConfigurationGroupSchema", - "type": "Microsoft.HybridNetwork/publishers/configurationGroupSchemas", - "id": "/subscriptions/subid/resourcegroups/testRG/providers/microsoft.hybridnetwork/publishers/testPublisher/configurationGroupSchemas/interconnectgroupsSchema", - "location": "westUs2", - "properties": { - "description": "Schema with no secrets", - "provisioningState": "Accepted", - "schemaDefinition": "{\"type\":\"object\",\"properties\":{\"interconnect-groups\":{\"type\":\"object\",\"properties\":{\"type\":\"object\",\"properties\":{\"name\":{\"type\":\"string\"},\"international-interconnects\":{\"type\":\"array\",\"item\":{\"type\":\"string\"}},\"domestic-interconnects\":{\"type\":\"array\",\"item\":{\"type\":\"string\"}}}}},\"interconnect-group-assignments\":{\"type\":\"object\",\"properties\":{\"type\":\"object\",\"properties\":{\"ssc\":{\"type\":\"string\"},\"interconnects-interconnects\":{\"type\":\"string\"}}}}},\"required\":[\"interconnect-groups\",\"interconnect-group-assignments\"]}" - }, - "systemData": { - "createdAt": "2020-01-01T17:18:19.1234567Z", - "createdBy": "user1", - "createdByType": "User", - "lastModifiedAt": "2020-01-02T17:18:19.1234567Z", - "lastModifiedBy": "user2", - "lastModifiedByType": "User" - }, - "tags": { - "tag1": "value1", - "tag2": "value2" - } - } - } - }, - "operationId": "ConfigurationGroupSchemas_Update", - "title": "Create or update the configuration group schema resource" -} diff --git a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ConfigurationGroupSchemaVersionUpdateState.json b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ConfigurationGroupSchemaVersionUpdateState.json deleted file mode 100644 index be066545e7..0000000000 --- a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ConfigurationGroupSchemaVersionUpdateState.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "parameters": { - "api-version": "2025-03-30", - "configurationGroupSchemaName": "testConfigurationGroupSchema", - "parameters": { - "versionState": "Active" - }, - "publisherName": "testPublisher", - "resourceGroupName": "rg1", - "subscriptionId": "subid" - }, - "responses": { - "200": { - "body": { - "versionState": "Active" - } - }, - "202": { - "headers": { - "location": "https://management.azure.com/providers/microsoft.hybridnetwork/locations/EASTUS2EUAP/operationStatuses/0b37c625-7e7c-49c5-b86e-c817c85acb5d*B77A34159CA34A0BD446D3BC7EC120649181590DDF991982765DAC1A87491B2D?api-version=2021-05-01" - } - } - }, - "operationId": "ConfigurationGroupSchemas_updateState", - "title": "Update network service design version state" -} diff --git a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ConfigurationGroupValueCreate.json b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ConfigurationGroupValueCreate.json deleted file mode 100644 index b5b53118c1..0000000000 --- a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ConfigurationGroupValueCreate.json +++ /dev/null @@ -1,83 +0,0 @@ -{ - "parameters": { - "api-version": "2025-03-30", - "configurationGroupValueName": "testConfigurationGroupValue", - "parameters": { - "location": "eastus", - "properties": { - "configurationGroupSchemaResourceReference": { - "id": "/subscriptions/subid/resourcegroups/testRG/providers/microsoft.hybridnetwork/publishers/testPublisher/configurationGroupSchemas/testConfigurationGroupSchemaName", - "idType": "Open" - }, - "configurationType": "Open", - "configurationValue": "{\"interconnect-groups\":{\"stripe-one\":{\"name\":\"Stripe one\",\"international-interconnects\":[\"france\",\"germany\"],\"domestic-interconnects\":[\"birmingham\",\"edinburgh\"]},\"stripe-two\":{\"name\":\"Stripe two\",\"international-interconnects\":[\"germany\",\"italy\"],\"domestic-interconnects\":[\"edinburgh\",\"london\"]}},\"interconnect-group-assignments\":{\"ssc-one\":{\"ssc\":\"SSC 1\",\"interconnects\":\"stripe-one\"},\"ssc-two\":{\"ssc\":\"SSC 2\",\"interconnects\":\"stripe-two\"}}}" - } - }, - "resourceGroupName": "rg1", - "subscriptionId": "subid" - }, - "responses": { - "200": { - "body": { - "name": "testConfigurationGroupValue", - "type": "Microsoft.HybridNetwork/configurationGroupValues", - "id": "/subscriptions/subid/providers/Microsoft.HybridNetwork/configurationGroupValues/testConfigurationGroupValue", - "location": "eastus", - "properties": { - "configurationGroupSchemaName": "testConfigurationGroupSchemaName", - "configurationGroupSchemaOfferingLocation": "eastus", - "configurationGroupSchemaResourceReference": { - "id": "/subscriptions/subid/resourcegroups/testRG/providers/microsoft.hybridnetwork/publishers/testPublisher/configurationGroupSchemas/testConfigurationGroupSchemaName", - "idType": "Open" - }, - "configurationType": "Open", - "configurationValue": "{\"interconnect-groups\":{\"stripe-one\":{\"name\":\"Stripe one\",\"international-interconnects\":[\"france\",\"germany\"],\"domestic-interconnects\":[\"birmingham\",\"edinburgh\"]},\"stripe-two\":{\"name\":\"Stripe two\",\"international-interconnects\":[\"germany\",\"italy\"],\"domestic-interconnects\":[\"edinburgh\",\"london\"]}},\"interconnect-group-assignments\":{\"ssc-one\":{\"ssc\":\"SSC 1\",\"interconnects\":\"stripe-one\"},\"ssc-two\":{\"ssc\":\"SSC 2\",\"interconnects\":\"stripe-two\"}}}", - "provisioningState": "Succeeded", - "publisherName": "testPublisher", - "publisherScope": "Public" - }, - "systemData": { - "createdAt": "2020-01-01T17:18:19.1234567Z", - "createdBy": "user1", - "createdByType": "User", - "lastModifiedAt": "2020-01-02T17:18:19.1234567Z", - "lastModifiedBy": "user2", - "lastModifiedByType": "User" - }, - "tags": {} - } - }, - "201": { - "body": { - "name": "testConfigurationGroup", - "type": "Microsoft.HybridNetwork/configurationGroups", - "id": "/subscriptions/subid/providers/Microsoft.HybridNetwork/configurationGroups/testConfigurationGroup", - "location": "eastus", - "properties": { - "configurationGroupSchemaName": "testConfigurationGroupSchemaName", - "configurationGroupSchemaOfferingLocation": "eastus", - "configurationGroupSchemaResourceReference": { - "id": "/subscriptions/subid/resourcegroups/testRG/providers/microsoft.hybridnetwork/publishers/testPublisher/configurationGroupSchemas/testConfigurationGroupSchemaName", - "idType": "Open" - }, - "configurationType": "Open", - "configurationValue": "{\"interconnect-groups\":{\"stripe-one\":{\"name\":\"Stripe one\",\"international-interconnects\":[\"france\",\"germany\"],\"domestic-interconnects\":[\"birmingham\",\"edinburgh\"]},\"stripe-two\":{\"name\":\"Stripe two\",\"international-interconnects\":[\"germany\",\"italy\"],\"domestic-interconnects\":[\"edinburgh\",\"london\"]}},\"interconnect-group-assignments\":{\"ssc-one\":{\"ssc\":\"SSC 1\",\"interconnects\":\"stripe-one\"},\"ssc-two\":{\"ssc\":\"SSC 2\",\"interconnects\":\"stripe-two\"}}}", - "provisioningState": "Succeeded", - "publisherName": "testPublisher", - "publisherScope": "Public" - }, - "systemData": { - "createdAt": "2020-01-01T17:18:19.1234567Z", - "createdBy": "user1", - "createdByType": "User", - "lastModifiedAt": "2020-01-02T17:18:19.1234567Z", - "lastModifiedBy": "user2", - "lastModifiedByType": "User" - }, - "tags": {} - } - } - }, - "operationId": "ConfigurationGroupValues_CreateOrUpdate", - "title": "Create or update configuration group value" -} diff --git a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ConfigurationGroupValueCreateSecret.json b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ConfigurationGroupValueCreateSecret.json deleted file mode 100644 index 64ec575632..0000000000 --- a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ConfigurationGroupValueCreateSecret.json +++ /dev/null @@ -1,81 +0,0 @@ -{ - "parameters": { - "api-version": "2025-03-30", - "configurationGroupValueName": "testConfigurationGroupValue", - "parameters": { - "location": "eastus", - "properties": { - "configurationGroupSchemaResourceReference": { - "id": "/subscriptions/subid/resourcegroups/testRG/providers/microsoft.hybridnetwork/publishers/testPublisher/configurationGroupSchemas/testConfigurationGroupSchemaName", - "idType": "Open" - }, - "configurationType": "Secret", - "secretConfigurationValue": "{\"interconnect-groups\":{\"stripe-one\":{\"name\":\"Stripe one\",\"international-interconnects\":[\"france\",\"germany\"],\"domestic-interconnects\":[\"birmingham\",\"edinburgh\"]},\"stripe-two\":{\"name\":\"Stripe two\",\"international-interconnects\":[\"germany\",\"italy\"],\"domestic-interconnects\":[\"edinburgh\",\"london\"]}},\"interconnect-group-assignments\":{\"ssc-one\":{\"ssc\":\"SSC 1\",\"interconnects\":\"stripe-one\"},\"ssc-two\":{\"ssc\":\"SSC 2\",\"interconnects\":\"stripe-two\"}}}" - } - }, - "resourceGroupName": "rg1", - "subscriptionId": "subid" - }, - "responses": { - "200": { - "body": { - "name": "testConfigurationGroupValue", - "type": "Microsoft.HybridNetwork/configurationGroupValues", - "id": "/subscriptions/subid/providers/Microsoft.HybridNetwork/configurationGroupValues/testConfigurationGroupValue", - "location": "eastus", - "properties": { - "configurationGroupSchemaName": "testConfigurationGroupSchemaName", - "configurationGroupSchemaOfferingLocation": "eastus", - "configurationGroupSchemaResourceReference": { - "id": "/subscriptions/subid/resourcegroups/testRG/providers/microsoft.hybridnetwork/publishers/testPublisher/configurationGroupSchemas/testConfigurationGroupSchemaName", - "idType": "Open" - }, - "configurationType": "Secret", - "provisioningState": "Succeeded", - "publisherName": "testPublisher", - "publisherScope": "Public" - }, - "systemData": { - "createdAt": "2020-01-01T17:18:19.1234567Z", - "createdBy": "user1", - "createdByType": "User", - "lastModifiedAt": "2020-01-02T17:18:19.1234567Z", - "lastModifiedBy": "user2", - "lastModifiedByType": "User" - }, - "tags": {} - } - }, - "201": { - "body": { - "name": "testConfigurationGroup", - "type": "Microsoft.HybridNetwork/configurationGroups", - "id": "/subscriptions/subid/providers/Microsoft.HybridNetwork/configurationGroups/testConfigurationGroup", - "location": "eastus", - "properties": { - "configurationGroupSchemaName": "testConfigurationGroupSchemaName", - "configurationGroupSchemaOfferingLocation": "eastus", - "configurationGroupSchemaResourceReference": { - "id": "/subscriptions/subid/resourcegroups/testRG/providers/microsoft.hybridnetwork/publishers/testPublisher/configurationGroupSchemas/testConfigurationGroupSchemaName", - "idType": "Open" - }, - "configurationType": "Secret", - "provisioningState": "Succeeded", - "publisherName": "testPublisher", - "publisherScope": "Public" - }, - "systemData": { - "createdAt": "2020-01-01T17:18:19.1234567Z", - "createdBy": "user1", - "createdByType": "User", - "lastModifiedAt": "2020-01-02T17:18:19.1234567Z", - "lastModifiedBy": "user2", - "lastModifiedByType": "User" - }, - "tags": {} - } - } - }, - "operationId": "ConfigurationGroupValues_CreateOrUpdate", - "title": "Create or update configuration group value with secrets" -} diff --git a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ConfigurationGroupValueDelete.json b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ConfigurationGroupValueDelete.json deleted file mode 100644 index 41a6b69f4c..0000000000 --- a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ConfigurationGroupValueDelete.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "parameters": { - "api-version": "2025-03-30", - "configurationGroupValueName": "testConfigurationGroupValue", - "resourceGroupName": "rg1", - "subscriptionId": "subid" - }, - "responses": { - "202": { - "headers": { - "location": "https://management.azure.com/providers/microsoft.hybridnetwork/locations/EASTUS2EUAP/operationStatuses/0b37c625-7e7c-49c5-b86e-c817c85acb5d*B77A34159CA34A0BD446D3BC7EC120649181590DDF991982765DAC1A87491B2D?api-version=2021-05-01" - } - }, - "204": {} - }, - "operationId": "ConfigurationGroupValues_Delete", - "title": "Delete hybrid configuration group resource" -} diff --git a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ConfigurationGroupValueFirstPartyCreate.json b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ConfigurationGroupValueFirstPartyCreate.json deleted file mode 100644 index 9c799b91df..0000000000 --- a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ConfigurationGroupValueFirstPartyCreate.json +++ /dev/null @@ -1,81 +0,0 @@ -{ - "parameters": { - "api-version": "2025-03-30", - "configurationGroupValueName": "testConfigurationGroupValue", - "parameters": { - "location": "eastus", - "properties": { - "configurationGroupSchemaResourceReference": { - "id": "/subscriptions/subid/resourcegroups/testRG/providers/microsoft.hybridnetwork/publishers/testPublisher/configurationGroupSchemas/testConfigurationGroupSchemaName", - "idType": "Secret" - }, - "configurationType": "Open", - "configurationValue": "{\"interconnect-groups\":{\"stripe-one\":{\"name\":\"Stripe one\",\"international-interconnects\":[\"france\",\"germany\"],\"domestic-interconnects\":[\"birmingham\",\"edinburgh\"]},\"stripe-two\":{\"name\":\"Stripe two\",\"international-interconnects\":[\"germany\",\"italy\"],\"domestic-interconnects\":[\"edinburgh\",\"london\"]}},\"interconnect-group-assignments\":{\"ssc-one\":{\"ssc\":\"SSC 1\",\"interconnects\":\"stripe-one\"},\"ssc-two\":{\"ssc\":\"SSC 2\",\"interconnects\":\"stripe-two\"}}}" - } - }, - "resourceGroupName": "rg1", - "subscriptionId": "subid" - }, - "responses": { - "200": { - "body": { - "name": "testConfigurationGroupValue", - "type": "Microsoft.HybridNetwork/configurationGroupValues", - "id": "/subscriptions/subid/providers/Microsoft.HybridNetwork/configurationGroupValues/testConfigurationGroupValue", - "location": "eastus", - "properties": { - "configurationGroupSchemaName": "testConfigurationGroupSchemaName", - "configurationGroupSchemaOfferingLocation": "eastus", - "configurationGroupSchemaResourceReference": { - "idType": "Secret" - }, - "configurationType": "Open", - "configurationValue": "{\"interconnect-groups\":{\"stripe-one\":{\"name\":\"Stripe one\",\"international-interconnects\":[\"france\",\"germany\"],\"domestic-interconnects\":[\"birmingham\",\"edinburgh\"]},\"stripe-two\":{\"name\":\"Stripe two\",\"international-interconnects\":[\"germany\",\"italy\"],\"domestic-interconnects\":[\"edinburgh\",\"london\"]}},\"interconnect-group-assignments\":{\"ssc-one\":{\"ssc\":\"SSC 1\",\"interconnects\":\"stripe-one\"},\"ssc-two\":{\"ssc\":\"SSC 2\",\"interconnects\":\"stripe-two\"}}}", - "provisioningState": "Succeeded", - "publisherName": "testPublisher", - "publisherScope": "Private" - }, - "systemData": { - "createdAt": "2020-01-01T17:18:19.1234567Z", - "createdBy": "user1", - "createdByType": "User", - "lastModifiedAt": "2020-01-02T17:18:19.1234567Z", - "lastModifiedBy": "user2", - "lastModifiedByType": "User" - }, - "tags": {} - } - }, - "201": { - "body": { - "name": "testConfigurationGroup", - "type": "Microsoft.HybridNetwork/configurationGroups", - "id": "/subscriptions/subid/providers/Microsoft.HybridNetwork/configurationGroups/testConfigurationGroup", - "location": "eastus", - "properties": { - "configurationGroupSchemaName": "testConfigurationGroupSchemaName", - "configurationGroupSchemaOfferingLocation": "eastus", - "configurationGroupSchemaResourceReference": { - "idType": "Secret" - }, - "configurationType": "Open", - "configurationValue": "{\"interconnect-groups\":{\"stripe-one\":{\"name\":\"Stripe one\",\"international-interconnects\":[\"france\",\"germany\"],\"domestic-interconnects\":[\"birmingham\",\"edinburgh\"]},\"stripe-two\":{\"name\":\"Stripe two\",\"international-interconnects\":[\"germany\",\"italy\"],\"domestic-interconnects\":[\"edinburgh\",\"london\"]}},\"interconnect-group-assignments\":{\"ssc-one\":{\"ssc\":\"SSC 1\",\"interconnects\":\"stripe-one\"},\"ssc-two\":{\"ssc\":\"SSC 2\",\"interconnects\":\"stripe-two\"}}}", - "provisioningState": "Succeeded", - "publisherName": "testPublisher", - "publisherScope": "Private" - }, - "systemData": { - "createdAt": "2020-01-01T17:18:19.1234567Z", - "createdBy": "user1", - "createdByType": "User", - "lastModifiedAt": "2020-01-02T17:18:19.1234567Z", - "lastModifiedBy": "user2", - "lastModifiedByType": "User" - }, - "tags": {} - } - } - }, - "operationId": "ConfigurationGroupValues_CreateOrUpdate", - "title": "Create or update first party configuration group value" -} diff --git a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ConfigurationGroupValueGet.json b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ConfigurationGroupValueGet.json deleted file mode 100644 index fcf1fb2455..0000000000 --- a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ConfigurationGroupValueGet.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "parameters": { - "api-version": "2025-03-30", - "configurationGroupValueName": "testConfigurationGroupValue", - "resourceGroupName": "rg1", - "subscriptionId": "subid" - }, - "responses": { - "200": { - "body": { - "name": "testConfigurationGroupValue", - "type": "Microsoft.HybridNetwork/configurationGroupValues", - "id": "/subscriptions/subid/providers/Microsoft.HybridNetwork/configurationGroupValues/testConfigurationGroupValue", - "location": "eastus", - "properties": { - "configurationGroupSchemaName": "testConfigurationGroupSchemaName", - "configurationGroupSchemaOfferingLocation": "eastus", - "configurationGroupSchemaResourceReference": { - "id": "/subscriptions/subid/resourcegroups/testRG/providers/microsoft.hybridnetwork/publishers/testPublisher/configurationGroupSchemas/testConfigurationGroupSchemaName", - "idType": "Open" - }, - "configurationType": "Open", - "configurationValue": "{\"interconnect-groups\":{\"stripe-one\":{\"name\":\"Stripe one\",\"international-interconnects\":[\"france\",\"germany\"],\"domestic-interconnects\":[\"birmingham\",\"edinburgh\"]},\"stripe-two\":{\"name\":\"Stripe two\",\"international-interconnects\":[\"germany\",\"italy\"],\"domestic-interconnects\":[\"edinburgh\",\"london\"]}},\"interconnect-group-assignments\":{\"ssc-one\":{\"ssc\":\"SSC 1\",\"interconnects\":\"stripe-one\"},\"ssc-two\":{\"ssc\":\"SSC 2\",\"interconnects\":\"stripe-two\"}}}", - "provisioningState": "Succeeded", - "publisherName": "testPublisher", - "publisherScope": "Private" - }, - "systemData": { - "createdAt": "2020-01-01T17:18:19.1234567Z", - "createdBy": "user1", - "createdByType": "User", - "lastModifiedAt": "2020-01-02T17:18:19.1234567Z", - "lastModifiedBy": "user2", - "lastModifiedByType": "User" - }, - "tags": {} - } - } - }, - "operationId": "ConfigurationGroupValues_Get", - "title": "Get hybrid configuration group" -} diff --git a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ConfigurationGroupValueListByResourceGroup.json b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ConfigurationGroupValueListByResourceGroup.json deleted file mode 100644 index 62094174d8..0000000000 --- a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ConfigurationGroupValueListByResourceGroup.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "parameters": { - "api-version": "2025-03-30", - "resourceGroupName": "rg1", - "subscriptionId": "subid" - }, - "responses": { - "200": { - "body": { - "value": [ - { - "name": "testConfigurationGroupValue", - "type": "Microsoft.HybridNetwork/configurationGroupValues", - "id": "/subscriptions/subid/providers/Microsoft.HybridNetwork/configurationGroupValues/testConfigurationGroupValue", - "location": "westUs2", - "properties": { - "configurationGroupSchemaName": "testConfigurationGroupSchemaName", - "configurationGroupSchemaOfferingLocation": "eastus", - "configurationGroupSchemaResourceReference": { - "id": "/subscriptions/subid/resourcegroups/testRG/providers/microsoft.hybridnetwork/publishers/testPublisher/configurationGroupSchemas/testConfigurationGroupSchemaName", - "idType": "Open" - }, - "configurationType": "Open", - "configurationValue": "{\"interconnect-groups\":{\"stripe-one\":{\"name\":\"Stripe one\",\"international-interconnects\":[\"france\",\"germany\"],\"domestic-interconnects\":[\"birmingham\",\"edinburgh\"]},\"stripe-two\":{\"name\":\"Stripe two\",\"international-interconnects\":[\"germany\",\"italy\"],\"domestic-interconnects\":[\"edinburgh\",\"london\"]}},\"interconnect-group-assignments\":{\"ssc-one\":{\"ssc\":\"SSC 1\",\"interconnects\":\"stripe-one\"},\"ssc-two\":{\"ssc\":\"SSC 2\",\"interconnects\":\"stripe-two\"}}}", - "publisherName": "testPublisher", - "publisherScope": "Public" - }, - "systemData": { - "createdAt": "2020-01-01T17:18:19.1234567Z", - "createdBy": "user1", - "createdByType": "User", - "lastModifiedAt": "2020-01-02T17:18:19.1234567Z", - "lastModifiedBy": "user2", - "lastModifiedByType": "User" - } - } - ] - } - } - }, - "operationId": "ConfigurationGroupValues_ListByResourceGroup", - "title": "List all hybrid network configurationGroupValues in a subscription." -} diff --git a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ConfigurationGroupValueListBySubscription.json b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ConfigurationGroupValueListBySubscription.json deleted file mode 100644 index d74e3a4165..0000000000 --- a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ConfigurationGroupValueListBySubscription.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "parameters": { - "api-version": "2025-03-30", - "subscriptionId": "subid" - }, - "responses": { - "200": { - "body": { - "value": [ - { - "name": "testConfigurationGroupValue", - "type": "Microsoft.HybridNetwork/configurationGroupValues", - "id": "/subscriptions/subid/providers/Microsoft.HybridNetwork/configurationGroupValues/testConfigurationGroupValue", - "location": "eastus", - "properties": { - "configurationGroupSchemaName": "testConfigurationGroupSchemaName", - "configurationGroupSchemaOfferingLocation": "eastus", - "configurationGroupSchemaResourceReference": { - "id": "/subscriptions/subid/resourcegroups/testRG/providers/microsoft.hybridnetwork/publishers/testPublisher/configurationGroupSchemas/testConfigurationGroupSchemaName", - "idType": "Open" - }, - "configurationType": "Open", - "configurationValue": "{\"interconnect-groups\":{\"stripe-one\":{\"name\":\"Stripe one\",\"international-interconnects\":[\"france\",\"germany\"],\"domestic-interconnects\":[\"birmingham\",\"edinburgh\"]},\"stripe-two\":{\"name\":\"Stripe two\",\"international-interconnects\":[\"germany\",\"italy\"],\"domestic-interconnects\":[\"edinburgh\",\"london\"]}},\"interconnect-group-assignments\":{\"ssc-one\":{\"ssc\":\"SSC 1\",\"interconnects\":\"stripe-one\"},\"ssc-two\":{\"ssc\":\"SSC 2\",\"interconnects\":\"stripe-two\"}}}", - "publisherName": "testPublisher", - "publisherScope": "Public" - }, - "systemData": { - "createdAt": "2020-01-01T17:18:19.1234567Z", - "createdBy": "user1", - "createdByType": "User", - "lastModifiedAt": "2020-01-02T17:18:19.1234567Z", - "lastModifiedBy": "user2", - "lastModifiedByType": "User" - }, - "tags": { - "tag1": "value1", - "tag2": "value2" - } - } - ] - } - } - }, - "operationId": "ConfigurationGroupValues_ListBySubscription", - "title": "List all hybrid network sites in a subscription." -} diff --git a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ConfigurationGroupValueUpdateTags.json b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ConfigurationGroupValueUpdateTags.json deleted file mode 100644 index 13e6a6a0e0..0000000000 --- a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/ConfigurationGroupValueUpdateTags.json +++ /dev/null @@ -1,51 +0,0 @@ -{ - "parameters": { - "api-version": "2025-03-30", - "configurationGroupValueName": "testConfigurationGroupValue", - "parameters": { - "tags": { - "tag1": "value1", - "tag2": "value2" - } - }, - "resourceGroupName": "rg1", - "subscriptionId": "subid" - }, - "responses": { - "200": { - "body": { - "name": "testConfigurationGroupValue", - "type": "Microsoft.HybridNetwork/configurationGroupValues", - "id": "/subscriptions/subid/providers/Microsoft.HybridNetwork/configurationGroupValues/testConfigurationGroupValue", - "location": "eastus", - "properties": { - "configurationGroupSchemaName": "testConfigurationGroupSchemaName", - "configurationGroupSchemaOfferingLocation": "eastus", - "configurationGroupSchemaResourceReference": { - "id": "/subscriptions/subid/resourcegroups/testRG/providers/microsoft.hybridnetwork/publishers/testPublisher/configurationGroupSchemas/testConfigurationGroupSchemaName", - "idType": "Open" - }, - "configurationType": "Open", - "configurationValue": "{\"interconnect-groups\":{\"stripe-one\":{\"name\":\"Stripe one\",\"international-interconnects\":[\"france\",\"germany\"],\"domestic-interconnects\":[\"birmingham\",\"edinburgh\"]},\"stripe-two\":{\"name\":\"Stripe two\",\"international-interconnects\":[\"germany\",\"italy\"],\"domestic-interconnects\":[\"edinburgh\",\"london\"]}},\"interconnect-group-assignments\":{\"ssc-one\":{\"ssc\":\"SSC 1\",\"interconnects\":\"stripe-one\"},\"ssc-two\":{\"ssc\":\"SSC 2\",\"interconnects\":\"stripe-two\"}}}", - "provisioningState": "Succeeded", - "publisherName": "testPublisher", - "publisherScope": "Public" - }, - "systemData": { - "createdAt": "2020-01-01T17:18:19.1234567Z", - "createdBy": "user1", - "createdByType": "User", - "lastModifiedAt": "2020-01-02T17:18:19.1234567Z", - "lastModifiedBy": "user2", - "lastModifiedByType": "User" - }, - "tags": { - "tag1": "value1", - "tag2": "value2" - } - } - } - }, - "operationId": "ConfigurationGroupValues_UpdateTags", - "title": "Update hybrid configuration group tags" -} diff --git a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/GetOperations.json b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/GetOperations.json deleted file mode 100644 index 62b4460fd4..0000000000 --- a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/GetOperations.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "parameters": { - "api-version": "2025-03-30", - "location": "westus", - "subscriptionId": "subid" - }, - "responses": { - "200": { - "body": { - "value": [ - { - "name": "Microsoft.HybridNetwork/NetworkFunctions/read", - "display": { - "description": "Gets Nf", - "operation": "Get Nf", - "provider": "Microsoft Hybrid Network", - "resource": "Nf" - } - } - ] - } - } - }, - "operationId": "Operations_List", - "title": "Get Registration Operations" -} diff --git a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkFunctionCreate.json b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkFunctionCreate.json deleted file mode 100644 index 8397454adc..0000000000 --- a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkFunctionCreate.json +++ /dev/null @@ -1,88 +0,0 @@ -{ - "parameters": { - "api-version": "2025-03-30", - "networkFunctionName": "testNf", - "parameters": { - "location": "eastus", - "properties": { - "allowSoftwareUpdate": false, - "configurationType": "Open", - "deploymentValues": "{\"releaseName\":\"testReleaseName\",\"namespace\":\"testNamespace\"}", - "networkFunctionDefinitionVersionResourceReference": { - "id": "/subscriptions/subid/resourcegroups/rg/providers/Microsoft.HybridNetwork/publishers/testVendor/networkFunctionDefinitionGroups/testnetworkFunctionDefinitionGroupName/networkFunctionDefinitionVersions/1.0.1", - "idType": "Open" - }, - "nfviId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testResourceGroup/providers/Microsoft.ExtendedLocation/customLocations/testCustomLocation", - "nfviType": "AzureArcKubernetes", - "roleOverrideValues": [ - "{\"name\":\"testRoleOne\",\"deployParametersMappingRuleProfile\":{\"helmMappingRuleProfile\":{\"helmPackageVersion\":\"2.1.3\",\"values\":\"{\\\"roleOneParam\\\":\\\"roleOneOverrideValue\\\"}\"}}}", - "{\"name\":\"testRoleTwo\",\"deployParametersMappingRuleProfile\":{\"helmMappingRuleProfile\":{\"releaseName\":\"overrideReleaseName\",\"releaseNamespace\":\"overrideNamespace\",\"values\":\"{\\\"roleTwoParam\\\":\\\"roleTwoOverrideValue\\\"}\"}}}" - ] - } - }, - "resourceGroupName": "rg", - "subscriptionId": "subid" - }, - "responses": { - "200": { - "body": { - "name": "testNf", - "type": "Microsoft.HybridNetwork/networkFunctions", - "id": "/subscriptions/subid/resourcegroups/rg/providers/Microsoft.HybridNetwork/networkFunctions/testNf", - "location": "eastus", - "properties": { - "allowSoftwareUpdate": false, - "configurationType": "Open", - "deploymentValues": "{\"releaseName\":\"testReleaseName\",\"namespace\":\"testNamespace\"}", - "networkFunctionDefinitionGroupName": "testnetworkFunctionDefinitionGroupName", - "networkFunctionDefinitionOfferingLocation": "eastus", - "networkFunctionDefinitionVersion": "1.0.1", - "networkFunctionDefinitionVersionResourceReference": { - "id": "/subscriptions/subid/resourcegroups/rg/providers/Microsoft.HybridNetwork/publishers/testVendor/networkFunctionDefinitionGroups/testnetworkFunctionDefinitionGroupName/networkFunctionDefinitionVersions/1.0.1", - "idType": "Open" - }, - "nfviId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testResourceGroup/providers/Microsoft.ExtendedLocation/customLocations/testCustomLocation", - "nfviType": "AzureArcKubernetes", - "provisioningState": "Succeeded", - "publisherName": "testVendor", - "publisherScope": "Public", - "roleOverrideValues": [ - "{\"name\":\"testRoleOne\",\"deployParametersMappingRuleProfile\":{\"helmMappingRuleProfile\":{\"helmPackageVersion\":\"2.1.3\",\"values\":\"{\\\"roleOneParam\\\":\\\"roleOneOverrideValue\\\"}\"}}}", - "{\"name\":\"testRoleTwo\",\"deployParametersMappingRuleProfile\":{\"helmMappingRuleProfile\":{\"releaseName\":\"overrideReleaseName\",\"releaseNamespace\":\"overrideNamespace\",\"values\":\"{\\\"roleTwoParam\\\":\\\"roleTwoOverrideValue\\\"}\"}}}" - ] - } - } - }, - "201": { - "body": { - "name": "testNf", - "type": "Microsoft.HybridNetwork/networkFunctions", - "id": "/subscriptions/subid/resourcegroups/rg/providers/Microsoft.HybridNetwork/networkFunctions/testNf", - "location": "eastus", - "properties": { - "allowSoftwareUpdate": false, - "configurationType": "Open", - "deploymentValues": "{\"releaseName\":\"testReleaseName\",\"namespace\":\"testNamespace\"}", - "networkFunctionDefinitionGroupName": "testnetworkFunctionDefinitionGroupName", - "networkFunctionDefinitionOfferingLocation": "eastus", - "networkFunctionDefinitionVersion": "1.0.1", - "networkFunctionDefinitionVersionResourceReference": { - "id": "/subscriptions/subid/resourcegroups/rg/providers/Microsoft.HybridNetwork/publishers/testVendor/networkFunctionDefinitionGroups/testnetworkFunctionDefinitionGroupName/networkFunctionDefinitionVersions/1.0.1", - "idType": "Open" - }, - "nfviId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testResourceGroup/providers/Microsoft.ExtendedLocation/customLocations/testCustomLocation", - "nfviType": "AzureArcKubernetes", - "provisioningState": "Accepted", - "publisherName": "testVendor", - "publisherScope": "Public", - "roleOverrideValues": [ - "{\"name\":\"testRoleOne\",\"deployParametersMappingRuleProfile\":{\"helmMappingRuleProfile\":{\"helmPackageVersion\":\"2.1.3\",\"values\":\"{\\\"roleOneParam\\\":\\\"roleOneOverrideValue\\\"}\"}}}", - "{\"name\":\"testRoleTwo\",\"deployParametersMappingRuleProfile\":{\"helmMappingRuleProfile\":{\"releaseName\":\"overrideReleaseName\",\"releaseNamespace\":\"overrideNamespace\",\"values\":\"{\\\"roleTwoParam\\\":\\\"roleTwoOverrideValue\\\"}\"}}}" - ] - } - } - } - }, - "operationId": "NetworkFunctions_CreateOrUpdate", - "title": "Create network function resource" -} diff --git a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkFunctionCreateSecret.json b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkFunctionCreateSecret.json deleted file mode 100644 index 6729a41da5..0000000000 --- a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkFunctionCreateSecret.json +++ /dev/null @@ -1,86 +0,0 @@ -{ - "parameters": { - "api-version": "2025-03-30", - "networkFunctionName": "testNf", - "parameters": { - "location": "eastus", - "properties": { - "allowSoftwareUpdate": false, - "configurationType": "Secret", - "networkFunctionDefinitionVersionResourceReference": { - "id": "/subscriptions/subid/resourcegroups/rg/providers/Microsoft.HybridNetwork/publishers/testVendor/networkFunctionDefinitionGroups/testnetworkFunctionDefinitionGroupName/networkFunctionDefinitionVersions/1.0.1", - "idType": "Open" - }, - "nfviId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testResourceGroup/providers/Microsoft.ExtendedLocation/customLocations/testCustomLocation", - "nfviType": "AzureArcKubernetes", - "roleOverrideValues": [ - "{\"name\":\"testRoleOne\",\"deployParametersMappingRuleProfile\":{\"helmMappingRuleProfile\":{\"helmPackageVersion\":\"2.1.3\",\"values\":\"{\\\"roleOneParam\\\":\\\"roleOneOverrideValue\\\"}\"}}}", - "{\"name\":\"testRoleTwo\",\"deployParametersMappingRuleProfile\":{\"helmMappingRuleProfile\":{\"releaseName\":\"overrideReleaseName\",\"releaseNamespace\":\"overrideNamespace\",\"values\":\"{\\\"roleTwoParam\\\":\\\"roleTwoOverrideValue\\\"}\"}}}" - ], - "secretDeploymentValues": "{\"adminPassword\":\"password1\",\"userPassword\":\"password2\"}" - } - }, - "resourceGroupName": "rg", - "subscriptionId": "subid" - }, - "responses": { - "200": { - "body": { - "name": "testNf", - "type": "Microsoft.HybridNetwork/networkFunctions", - "id": "/subscriptions/subid/resourcegroups/rg/providers/Microsoft.HybridNetwork/networkFunctions/testNf", - "location": "eastus", - "properties": { - "allowSoftwareUpdate": false, - "configurationType": "Secret", - "networkFunctionDefinitionGroupName": "testnetworkFunctionDefinitionGroupName", - "networkFunctionDefinitionOfferingLocation": "eastus", - "networkFunctionDefinitionVersion": "1.0.1", - "networkFunctionDefinitionVersionResourceReference": { - "id": "/subscriptions/subid/resourcegroups/rg/providers/Microsoft.HybridNetwork/publishers/testVendor/networkFunctionDefinitionGroups/testnetworkFunctionDefinitionGroupName/networkFunctionDefinitionVersions/1.0.1", - "idType": "Open" - }, - "nfviId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testResourceGroup/providers/Microsoft.ExtendedLocation/customLocations/testCustomLocation", - "nfviType": "AzureArcKubernetes", - "provisioningState": "Succeeded", - "publisherName": "testVendor", - "publisherScope": "Public", - "roleOverrideValues": [ - "{\"name\":\"testRoleOne\",\"deployParametersMappingRuleProfile\":{\"helmMappingRuleProfile\":{\"helmPackageVersion\":\"2.1.3\",\"values\":\"{\\\"roleOneParam\\\":\\\"roleOneOverrideValue\\\"}\"}}}", - "{\"name\":\"testRoleTwo\",\"deployParametersMappingRuleProfile\":{\"helmMappingRuleProfile\":{\"releaseName\":\"overrideReleaseName\",\"releaseNamespace\":\"overrideNamespace\",\"values\":\"{\\\"roleTwoParam\\\":\\\"roleTwoOverrideValue\\\"}\"}}}" - ] - } - } - }, - "201": { - "body": { - "name": "testNf", - "type": "Microsoft.HybridNetwork/networkFunctions", - "id": "/subscriptions/subid/resourcegroups/rg/providers/Microsoft.HybridNetwork/networkFunctions/testNf", - "location": "eastus", - "properties": { - "allowSoftwareUpdate": false, - "configurationType": "Secret", - "networkFunctionDefinitionGroupName": "testnetworkFunctionDefinitionGroupName", - "networkFunctionDefinitionOfferingLocation": "eastus", - "networkFunctionDefinitionVersion": "1.0.1", - "networkFunctionDefinitionVersionResourceReference": { - "id": "/subscriptions/subid/resourcegroups/rg/providers/Microsoft.HybridNetwork/publishers/testVendor/networkFunctionDefinitionGroups/testnetworkFunctionDefinitionGroupName/networkFunctionDefinitionVersions/1.0.1", - "idType": "Open" - }, - "nfviId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testResourceGroup/providers/Microsoft.ExtendedLocation/customLocations/testCustomLocation", - "nfviType": "AzureArcKubernetes", - "provisioningState": "Accepted", - "publisherName": "testVendor", - "publisherScope": "Public", - "roleOverrideValues": [ - "{\"name\":\"testRoleOne\",\"deployParametersMappingRuleProfile\":{\"helmMappingRuleProfile\":{\"helmPackageVersion\":\"2.1.3\",\"values\":\"{\\\"roleOneParam\\\":\\\"roleOneOverrideValue\\\"}\"}}}", - "{\"name\":\"testRoleTwo\",\"deployParametersMappingRuleProfile\":{\"helmMappingRuleProfile\":{\"releaseName\":\"overrideReleaseName\",\"releaseNamespace\":\"overrideNamespace\",\"values\":\"{\\\"roleTwoParam\\\":\\\"roleTwoOverrideValue\\\"}\"}}}" - ] - } - } - } - }, - "operationId": "NetworkFunctions_CreateOrUpdate", - "title": "Create network function resource with secrets" -} diff --git a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkFunctionDefinitionGroupCreate.json b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkFunctionDefinitionGroupCreate.json deleted file mode 100644 index d9152461ad..0000000000 --- a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkFunctionDefinitionGroupCreate.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "parameters": { - "api-version": "2025-03-30", - "networkFunctionDefinitionGroupName": "TestNetworkFunctionDefinitionGroupName", - "parameters": { - "location": "eastus" - }, - "publisherName": "TestPublisher", - "resourceGroupName": "rg", - "subscriptionId": "subid" - }, - "responses": { - "200": { - "body": { - "name": "TestPublisherSkuVersion", - "type": "Microsoft.HybridNetwork/publishers/networkFunctionDefinitionGroups", - "id": "/subscriptions/subid/resourcegroups/rg/rgproviders/Microsoft.HybridNetwork/publishers/TestPublisher/networkFunctionDefinitionGroups/TestNetworkFunctionDefinitionGroupName", - "location": "eastus", - "properties": {} - } - }, - "201": { - "body": { - "name": "TestPublisherSkuVersion", - "type": "Microsoft.HybridNetwork/publishers/networkFunctionDefinitionGroups", - "id": "/subscriptions/subid/resourcegroups/rg/providers/Microsoft.HybridNetwork/publishers/TestPublisher/networkFunctionDefinitionGroups/TestNetworkFunctionDefinitionGroupName", - "location": "eastus", - "properties": {} - } - } - }, - "operationId": "NetworkFunctionDefinitionGroups_CreateOrUpdate", - "title": "Create or update the network function definition group" -} diff --git a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkFunctionDefinitionGroupDelete.json b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkFunctionDefinitionGroupDelete.json deleted file mode 100644 index 478bfb04ca..0000000000 --- a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkFunctionDefinitionGroupDelete.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "parameters": { - "api-version": "2025-03-30", - "networkFunctionDefinitionGroupName": "TestNetworkFunctionDefinitionGroupName", - "publisherName": "TestPublisher", - "resourceGroupName": "rg", - "subscriptionId": "subid" - }, - "responses": { - "202": { - "headers": { - "location": "https://management.azure.com/providers/microsoft.hybridnetwork/locations/EASTUS2EUAP/operationStatuses/0b37c625-7e7c-49c5-b86e-c817c85acb5d*B77A34159CA34A0BD446D3BC7EC120649181590DDF991982765DAC1A87491B2D?api-version=2021-05-01" - } - }, - "204": {} - }, - "operationId": "NetworkFunctionDefinitionGroups_Delete", - "title": "Delete a network function group resource" -} diff --git a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkFunctionDefinitionGroupGet.json b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkFunctionDefinitionGroupGet.json deleted file mode 100644 index 7adc820345..0000000000 --- a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkFunctionDefinitionGroupGet.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "parameters": { - "api-version": "2025-03-30", - "networkFunctionDefinitionGroupName": "TestNetworkFunctionDefinitionGroupName", - "publisherName": "TestPublisher", - "resourceGroupName": "rg", - "subscriptionId": "subid" - }, - "responses": { - "200": { - "body": { - "name": "TestNetworkFunctionDefinitionVersion", - "type": "Microsoft.HybridNetwork/publishers/networkFunctionDefinitionGroups", - "id": "/subscriptions/subid/resourcegroups/rg/rgproviders/Microsoft.HybridNetwork/publishers/TestPublisher/networkFunctionDefinitionGroups/TestNetworkFunctionDefinitionGroupName", - "location": "eastus", - "properties": { - "description": "Test NFD group" - } - } - } - }, - "operationId": "NetworkFunctionDefinitionGroups_Get", - "title": "Get a networkFunctionDefinition group resource" -} diff --git a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkFunctionDefinitionGroupUpdateTags.json b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkFunctionDefinitionGroupUpdateTags.json deleted file mode 100644 index 8f9a5af210..0000000000 --- a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkFunctionDefinitionGroupUpdateTags.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "parameters": { - "api-version": "2025-03-30", - "networkFunctionDefinitionGroupName": "TestNetworkFunctionDefinitionGroupName", - "parameters": { - "tags": { - "tag1": "value1", - "tag2": "value2" - } - }, - "publisherName": "TestPublisher", - "resourceGroupName": "rg", - "subscriptionId": "subid" - }, - "responses": { - "200": { - "body": { - "name": "TestPublisherSkuVersion", - "type": "Microsoft.HybridNetwork/publishers/networkFunctionDefinitionGroups", - "id": "/subscriptions/subid/resourcegroups/rg/rgproviders/Microsoft.HybridNetwork/publishers/TestPublisher/networkFunctionDefinitionGroups/TestNetworkFunctionDefinitionGroupName", - "location": "eastus", - "properties": {}, - "tags": { - "tag1": "value1", - "tag2": "value2" - } - } - } - }, - "operationId": "NetworkFunctionDefinitionGroups_Update", - "title": "Create or update the network function definition group resource" -} diff --git a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkFunctionDefinitionGroupsListByPublisherName.json b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkFunctionDefinitionGroupsListByPublisherName.json deleted file mode 100644 index 5c90b52103..0000000000 --- a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkFunctionDefinitionGroupsListByPublisherName.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "parameters": { - "api-version": "2025-03-30", - "publisherName": "TestPublisher", - "resourceGroupName": "rg", - "subscriptionId": "subid" - }, - "responses": { - "200": { - "body": { - "value": [ - { - "name": "TestNetworkFunctionDefinitionVersion", - "type": "Microsoft.HybridNetwork/publishers/networkFunctionDefinitionGroups", - "id": "/subscriptions/subid/resourcegroups/rg/rgproviders/Microsoft.HybridNetwork/publishers/TestPublisher/networkFunctionDefinitionGroups/TestNetworkFunctionDefinitionGroupName", - "location": "eastus", - "properties": {} - } - ] - } - } - }, - "operationId": "NetworkFunctionDefinitionGroups_ListByPublisher", - "title": "Get networkFunctionDefinition groups under publisher resource" -} diff --git a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkFunctionDefinitionVersionCreate.json b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkFunctionDefinitionVersionCreate.json deleted file mode 100644 index 312ec585f9..0000000000 --- a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkFunctionDefinitionVersionCreate.json +++ /dev/null @@ -1,198 +0,0 @@ -{ - "parameters": { - "api-version": "2025-03-30", - "networkFunctionDefinitionGroupName": "TestNetworkFunctionDefinitionGroupName", - "networkFunctionDefinitionVersionName": "1.0.0", - "parameters": { - "location": "eastus", - "properties": { - "deployParameters": "{\"type\":\"object\",\"properties\":{\"releaseName\":{\"type\":\"string\"},\"namespace\":{\"type\":\"string\"}}}", - "networkFunctionTemplate": { - "networkFunctionApplications": [ - { - "name": "fedrbac", - "artifactProfile": { - "artifactStore": { - "id": "/subscriptions/subid/resourcegroups/rg/providers/microsoft.hybridnetwork/publishers/TestPublisher/artifactStores/testArtifactStore" - }, - "helmArtifactProfile": { - "helmPackageName": "fed-rbac", - "helmPackageVersionRange": "~2.1.3", - "imagePullSecretsValuesPaths": [ - "global.imagePullSecrets" - ], - "registryValuesPaths": [ - "global.registry.docker.repoPath" - ] - } - }, - "artifactType": "HelmPackage", - "dependsOnProfile": { - "installDependsOn": [], - "uninstallDependsOn": [], - "updateDependsOn": [] - }, - "deployParametersMappingRuleProfile": { - "applicationEnablement": "Enabled", - "helmMappingRuleProfile": { - "helmPackageVersion": "2.1.3", - "options": { - "installOptions": { - "atomic": "true", - "timeout": "30", - "wait": "waitValue" - }, - "upgradeOptions": { - "atomic": "true", - "timeout": "30", - "wait": "waitValue" - } - }, - "releaseName": "{deployParameters.releaseName}", - "releaseNamespace": "{deployParameters.namesapce}", - "values": "" - } - } - } - ], - "nfviType": "AzureArcKubernetes" - }, - "networkFunctionType": "ContainerizedNetworkFunction", - "versionState": "Active" - } - }, - "publisherName": "TestPublisher", - "resourceGroupName": "rg", - "subscriptionId": "subid" - }, - "responses": { - "200": { - "body": { - "name": "TestVersion", - "type": "Microsoft.HybridNetwork/publishers/networkFunctionDefinitionGroups/networkFunctionDefinitionVersions", - "id": "/subscriptions/subid/resourcegroups/rg/providers/Microsoft.HybridNetwork/publishers/TestPublisher/networkFunctionDefinitionGroups/TestNetworkFunctionDefinitionGroupName/networkFunctionDefinitionVersions/1.0.0", - "location": "eastus", - "properties": { - "deployParameters": "{\"type\":\"object\",\"properties\":{\"releaseName\":{\"type\":\"string\"},\"namespace\":{\"type\":\"string\"}}}", - "networkFunctionTemplate": { - "networkFunctionApplications": [ - { - "name": "fedrbac", - "artifactProfile": { - "artifactStore": { - "id": "/subscriptions/subid/resourcegroups/rg/providers/Microsoft.HybridNetwork/publishers/TestPublisher/artifactStores/testStore" - }, - "helmArtifactProfile": { - "helmPackageName": "fed-rbac", - "helmPackageVersionRange": "~2.1.3", - "imagePullSecretsValuesPaths": [ - "global.imagePullSecrets" - ], - "registryValuesPaths": [ - "global.registry.docker.repoPath" - ] - } - }, - "artifactType": "HelmPackage", - "dependsOnProfile": { - "installDependsOn": [], - "uninstallDependsOn": [], - "updateDependsOn": [] - }, - "deployParametersMappingRuleProfile": { - "applicationEnablement": "Enabled", - "helmMappingRuleProfile": { - "helmPackageVersion": "2.1.3", - "options": { - "installOptions": { - "atomic": "true", - "timeout": "30", - "wait": "waitValue" - }, - "upgradeOptions": { - "atomic": "true", - "timeout": "30", - "wait": "waitValue" - } - }, - "releaseName": "{deployParameters.releaseName}", - "releaseNamespace": "{deployParameters.namesapce}", - "values": "" - } - } - } - ], - "nfviType": "AzureArcKubernetes" - }, - "networkFunctionType": "ContainerizedNetworkFunction", - "versionState": "Active" - } - } - }, - "201": { - "body": { - "name": "TestVersion", - "type": "Microsoft.HybridNetwork/publishers/networkFunctionDefinitionGroups/networkFunctionDefinitionVersions", - "id": "/subscriptions/subid/resourcegroups/rg/providers/Microsoft.HybridNetwork/publishers/TestPublisher/networkFunctionDefinitionGroups/TestNetworkFunctionDefinitionGroupName/networkFunctionDefinitionVersions/1.0.0", - "location": "eastus", - "properties": { - "deployParameters": "{\"type\":\"object\",\"properties\":{\"releaseName\":{\"type\":\"string\"},\"namespace\":{\"type\":\"string\"}}}", - "networkFunctionTemplate": { - "networkFunctionApplications": [ - { - "name": "fedrbac", - "artifactProfile": { - "artifactStore": { - "id": "/subscriptions/subid/resourcegroups/rg/providers/microsoft.hybridnetwork/publishers/TestPublisher/artifactStores/testArtifactStore" - }, - "helmArtifactProfile": { - "helmPackageName": "fed-rbac", - "helmPackageVersionRange": "~2.1.3", - "imagePullSecretsValuesPaths": [ - "global.imagePullSecrets" - ], - "registryValuesPaths": [ - "global.registry.docker.repoPath" - ] - } - }, - "artifactType": "HelmPackage", - "dependsOnProfile": { - "installDependsOn": [], - "uninstallDependsOn": [], - "updateDependsOn": [] - }, - "deployParametersMappingRuleProfile": { - "applicationEnablement": "Enabled", - "helmMappingRuleProfile": { - "helmPackageVersion": "2.1.3", - "options": { - "installOptions": { - "atomic": "true", - "timeout": "30", - "wait": "waitValue" - }, - "upgradeOptions": { - "atomic": "true", - "timeout": "30", - "wait": "waitValue" - } - }, - "releaseName": "{deployParameters.releaseName}", - "releaseNamespace": "{deployParameters.namesapce}", - "values": "" - } - } - } - ], - "nfviType": "AzureArcKubernetes" - }, - "networkFunctionType": "ContainerizedNetworkFunction", - "versionState": "Active" - } - } - } - }, - "operationId": "NetworkFunctionDefinitionVersions_CreateOrUpdate", - "title": "Create or update a network function definition version resource" -} diff --git a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkFunctionDefinitionVersionDelete.json b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkFunctionDefinitionVersionDelete.json deleted file mode 100644 index a108ddc260..0000000000 --- a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkFunctionDefinitionVersionDelete.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "parameters": { - "api-version": "2025-03-30", - "networkFunctionDefinitionGroupName": "TestNetworkFunctionDefinitionGroupName", - "networkFunctionDefinitionVersionName": "1.0.0", - "publisherName": "TestPublisher", - "resourceGroupName": "rg", - "subscriptionId": "subid" - }, - "responses": { - "202": { - "headers": { - "location": "https://management.azure.com/providers/microsoft.hybridnetwork/locations/EASTUS2EUAP/operationStatuses/0b37c625-7e7c-49c5-b86e-c817c85acb5d*B77A34159CA34A0BD446D3BC7EC120649181590DDF991982765DAC1A87491B2D?api-version=2021-05-01" - } - }, - "204": {} - }, - "operationId": "NetworkFunctionDefinitionVersions_Delete", - "title": "Delete a network function definition version" -} diff --git a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkFunctionDefinitionVersionGet.json b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkFunctionDefinitionVersionGet.json deleted file mode 100644 index 2d0b22ef58..0000000000 --- a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkFunctionDefinitionVersionGet.json +++ /dev/null @@ -1,65 +0,0 @@ -{ - "parameters": { - "api-version": "2025-03-30", - "networkFunctionDefinitionGroupName": "TestNetworkFunctionDefinitionGroupName", - "networkFunctionDefinitionVersionName": "1.0.0", - "publisherName": "TestPublisher", - "resourceGroupName": "rg", - "subscriptionId": "subid" - }, - "responses": { - "200": { - "body": { - "name": "TestVersion", - "type": "Microsoft.HybridNetwork/publishers/networkFunctionDefinitionGroups/networkFunctionDefinitionVersions", - "id": "/subscriptions/subid/resourcegroups/rg/providers/Microsoft.HybridNetwork/publishers/TestPublisher/networkFunctionDefinitionGroups/TestNetworkFunctionDefinitionGroupName/networkFunctionDefinitionVersions/1.0.0", - "location": "eastus", - "properties": { - "deployParameters": "{\"releaseName\":{\"type\":\"string\"},\"namespace\":{\"type\":\"string\"}}", - "networkFunctionTemplate": { - "networkFunctionApplications": [ - { - "name": "fedrbac", - "artifactProfile": { - "artifactStore": { - "id": "/subscriptions/subid/resourcegroups/rg/providers/microsoft.hybridnetwork/publishers/TestPublisher/artifactStores/testArtifactStore" - }, - "helmArtifactProfile": { - "helmPackageName": "fed-rbac", - "helmPackageVersionRange": "~2.1.3", - "imagePullSecretsValuesPaths": [ - "global.imagePullSecrets" - ], - "registryValuesPaths": [ - "global.registry.docker.repoPath" - ] - } - }, - "artifactType": "HelmPackage", - "dependsOnProfile": { - "installDependsOn": [], - "uninstallDependsOn": [], - "updateDependsOn": [] - }, - "deployParametersMappingRuleProfile": { - "applicationEnablement": "Enabled", - "helmMappingRuleProfile": { - "helmPackageVersion": "2.1.3", - "releaseName": "{deployParameters.releaseName}", - "releaseNamespace": "{deployParameters.namesapce}", - "values": "" - } - } - } - ], - "nfviType": "AzureArcKubernetes" - }, - "networkFunctionType": "ContainerizedNetworkFunction", - "versionState": "Active" - } - } - } - }, - "operationId": "NetworkFunctionDefinitionVersions_Get", - "title": "Get a network function definition version resource" -} diff --git a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkFunctionDefinitionVersionListByNetworkFunctionDefinitionGroup.json b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkFunctionDefinitionVersionListByNetworkFunctionDefinitionGroup.json deleted file mode 100644 index 5a09303f1c..0000000000 --- a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkFunctionDefinitionVersionListByNetworkFunctionDefinitionGroup.json +++ /dev/null @@ -1,80 +0,0 @@ -{ - "parameters": { - "api-version": "2025-03-30", - "networkFunctionDefinitionGroupName": "TestNetworkFunctionDefinitionGroupNameName", - "publisherName": "TestPublisher", - "resourceGroupName": "rg", - "subscriptionId": "subid" - }, - "responses": { - "200": { - "body": { - "value": [ - { - "name": "networkFunctionDefinitionVersionName", - "type": "Microsoft.HybridNetwork/publishers/publisherskugroups/publisherskuversions", - "id": "/subscriptions/subid/resourcegroups/rg/providers/Microsoft.HybridNetwork/publishers/TestPublisher/publisherskuGroups/networkFunctionDefinitionGroupName/networkFunctionDefinitionVersions/TestVersion", - "location": "eastus", - "properties": { - "deployParameters": "{\"releaseName\":{\"type\":\"string\"},\"namespace\":{\"type\":\"string\"}}", - "networkFunctionTemplate": { - "networkFunctionApplications": [ - { - "name": "fedrbac", - "artifactProfile": { - "artifactStore": { - "id": "/subscriptions/subid/resourcegroups/rg/providers/microsoft.hybridnetwork/publishers/TestPublisher/artifactStores/testArtifactStore" - }, - "helmArtifactProfile": { - "helmPackageName": "fed-rbac", - "helmPackageVersionRange": "~2.1.3", - "imagePullSecretsValuesPaths": [ - "global.imagePullSecrets" - ], - "registryValuesPaths": [ - "global.registry.docker.repoPath" - ] - } - }, - "artifactType": "HelmPackage", - "dependsOnProfile": { - "installDependsOn": [], - "uninstallDependsOn": [], - "updateDependsOn": [] - }, - "deployParametersMappingRuleProfile": { - "applicationEnablement": "Enabled", - "helmMappingRuleProfile": { - "helmPackageVersion": "2.1.3", - "options": { - "installOptions": { - "atomic": "true", - "timeout": "30", - "wait": "waitValue" - }, - "upgradeOptions": { - "atomic": "true", - "timeout": "30", - "wait": "waitValue" - } - }, - "releaseName": "{deployParameters.releaseName}", - "releaseNamespace": "{deployParameters.namesapce}", - "values": "" - } - } - } - ], - "nfviType": "AzureArcKubernetes" - }, - "networkFunctionType": "ContainerizedNetworkFunction", - "versionState": "Active" - } - } - ] - } - } - }, - "operationId": "NetworkFunctionDefinitionVersions_ListByNetworkFunctionDefinitionGroup", - "title": "Get Publisher resource" -} diff --git a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkFunctionDefinitionVersionUpdateState.json b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkFunctionDefinitionVersionUpdateState.json deleted file mode 100644 index c70e316e9b..0000000000 --- a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkFunctionDefinitionVersionUpdateState.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "parameters": { - "api-version": "2025-03-30", - "networkFunctionDefinitionGroupName": "TestSkuGroup", - "networkFunctionDefinitionVersionName": "1.0.0", - "parameters": { - "versionState": "Active" - }, - "publisherName": "TestPublisher", - "resourceGroupName": "rg", - "subscriptionId": "subid" - }, - "responses": { - "200": { - "body": { - "versionState": "Active" - } - }, - "202": { - "headers": { - "location": "https://management.azure.com/providers/microsoft.hybridnetwork/locations/EASTUS2EUAP/operationStatuses/0b37c625-7e7c-49c5-b86e-c817c85acb5d*B77A34159CA34A0BD446D3BC7EC120649181590DDF991982765DAC1A87491B2D?api-version=2021-05-01" - } - } - }, - "operationId": "NetworkFunctionDefinitionVersions_updateState", - "title": "Update network function definition version state" -} diff --git a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkFunctionDefinitionVersionUpdateTags.json b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkFunctionDefinitionVersionUpdateTags.json deleted file mode 100644 index 33eed7722e..0000000000 --- a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkFunctionDefinitionVersionUpdateTags.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "parameters": { - "api-version": "2025-03-30", - "networkFunctionDefinitionGroupName": "TestNetworkFunctionDefinitionGroupName", - "networkFunctionDefinitionVersionName": "1.0.0", - "parameters": { - "tags": { - "tag1": "value1", - "tag2": "value2" - } - }, - "publisherName": "TestPublisher", - "resourceGroupName": "rg", - "subscriptionId": "subid" - }, - "responses": { - "200": { - "body": { - "name": "TestVersion", - "type": "Microsoft.HybridNetwork/publishers/networkFunctionDefinitionGroups/networkFunctionDefinitionVersions", - "id": "/subscriptions/subid/resourcegroups/rg/providers/Microsoft.HybridNetwork/publishers/TestPublisher/networkFunctionDefinitionGroups/TestNetworkFunctionDefinitionGroupName/networkFunctionDefinitionVersions/1.0.0", - "location": "eastus", - "properties": { - "deployParameters": "{\"releaseName\":{\"type\":\"string\"},\"namespace\":{\"type\":\"string\"}}", - "networkFunctionTemplate": { - "networkFunctionApplications": [ - { - "name": "fedrbac", - "artifactProfile": { - "artifactStore": { - "id": "/subscriptions/subid/resourcegroups/rg/providers/microsoft.hybridnetwork/publishers/TestPublisher/artifactStores/testArtifactStore" - }, - "helmArtifactProfile": { - "helmPackageName": "fed-rbac", - "helmPackageVersionRange": "~2.1.3", - "imagePullSecretsValuesPaths": [ - "global.imagePullSecrets" - ], - "registryValuesPaths": [ - "global.registry.docker.repoPath" - ] - } - }, - "artifactType": "HelmPackage", - "dependsOnProfile": { - "installDependsOn": [], - "uninstallDependsOn": [], - "updateDependsOn": [] - }, - "deployParametersMappingRuleProfile": { - "applicationEnablement": "Enabled", - "helmMappingRuleProfile": { - "helmPackageVersion": "2.1.3", - "releaseName": "{deployParameters.releaseName}", - "releaseNamespace": "{deployParameters.namesapce}", - "values": "" - } - } - } - ], - "nfviType": "AzureArcKubernetes" - }, - "networkFunctionType": "ContainerizedNetworkFunction", - "versionState": "Active" - }, - "tags": { - "tag1": "value1", - "tag2": "value2" - } - } - } - }, - "operationId": "NetworkFunctionDefinitionVersions_Update", - "title": "Update the network function definition version tags" -} diff --git a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkFunctionDelete.json b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkFunctionDelete.json deleted file mode 100644 index 0a2a59f872..0000000000 --- a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkFunctionDelete.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "parameters": { - "api-version": "2025-03-30", - "networkFunctionName": "testNf", - "resourceGroupName": "rg", - "subscriptionId": "subid" - }, - "responses": { - "200": {}, - "202": { - "headers": { - "location": "https://management.azure.com/providers/microsoft.hybridnetwork/locations/EASTUS2EUAP/operationStatuses/0b37c625-7e7c-49c5-b86e-c817c85acb5d*B77A34159CA34A0BD446D3BC7EC120649181590DDF991982765DAC1A87491B2D?api-version=2021-05-01" - } - }, - "204": {} - }, - "operationId": "NetworkFunctions_Delete", - "title": "Delete network function resource" -} diff --git a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkFunctionFirstPartyCreate.json b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkFunctionFirstPartyCreate.json deleted file mode 100644 index 456f3f7edd..0000000000 --- a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkFunctionFirstPartyCreate.json +++ /dev/null @@ -1,86 +0,0 @@ -{ - "parameters": { - "api-version": "2025-03-30", - "networkFunctionName": "testNf", - "parameters": { - "location": "eastus", - "properties": { - "allowSoftwareUpdate": false, - "configurationType": "Open", - "deploymentValues": "{\"releaseName\":\"testReleaseName\",\"namespace\":\"testNamespace\"}", - "networkFunctionDefinitionVersionResourceReference": { - "id": "/subscriptions/subid/resourcegroups/rg/providers/Microsoft.HybridNetwork/publishers/testVendor/networkFunctionDefinitionGroups/testnetworkFunctionDefinitionGroupName/networkFunctionDefinitionVersions/1.0.1", - "idType": "Secret" - }, - "nfviId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testResourceGroup/providers/Microsoft.ExtendedLocation/customLocations/testCustomLocation", - "nfviType": "AzureArcKubernetes", - "roleOverrideValues": [ - "{\"name\":\"testRoleOne\",\"deployParametersMappingRuleProfile\":{\"helmMappingRuleProfile\":{\"helmPackageVersion\":\"2.1.3\",\"values\":\"{\\\"roleOneParam\\\":\\\"roleOneOverrideValue\\\"}\"}}}", - "{\"name\":\"testRoleTwo\",\"deployParametersMappingRuleProfile\":{\"helmMappingRuleProfile\":{\"releaseName\":\"overrideReleaseName\",\"releaseNamespace\":\"overrideNamespace\",\"values\":\"{\\\"roleTwoParam\\\":\\\"roleTwoOverrideValue\\\"}\"}}}" - ] - } - }, - "resourceGroupName": "rg", - "subscriptionId": "subid" - }, - "responses": { - "200": { - "body": { - "name": "testNf", - "type": "Microsoft.HybridNetwork/networkFunctions", - "id": "/subscriptions/subid/resourcegroups/rg/providers/Microsoft.HybridNetwork/networkFunctions/testNf", - "location": "eastus", - "properties": { - "allowSoftwareUpdate": false, - "configurationType": "Open", - "deploymentValues": "{\"releaseName\":\"testReleaseName\",\"namespace\":\"testNamespace\"}", - "networkFunctionDefinitionGroupName": "testnetworkFunctionDefinitionGroupName", - "networkFunctionDefinitionOfferingLocation": "eastus", - "networkFunctionDefinitionVersion": "1.0.1", - "networkFunctionDefinitionVersionResourceReference": { - "idType": "Secret" - }, - "nfviId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testResourceGroup/providers/Microsoft.ExtendedLocation/customLocations/testCustomLocation", - "nfviType": "AzureArcKubernetes", - "provisioningState": "Succeeded", - "publisherName": "testVendor", - "publisherScope": "Public", - "roleOverrideValues": [ - "{\"name\":\"testRoleOne\",\"deployParametersMappingRuleProfile\":{\"helmMappingRuleProfile\":{\"helmPackageVersion\":\"2.1.3\",\"values\":\"{\\\"roleOneParam\\\":\\\"roleOneOverrideValue\\\"}\"}}}", - "{\"name\":\"testRoleTwo\",\"deployParametersMappingRuleProfile\":{\"helmMappingRuleProfile\":{\"releaseName\":\"overrideReleaseName\",\"releaseNamespace\":\"overrideNamespace\",\"values\":\"{\\\"roleTwoParam\\\":\\\"roleTwoOverrideValue\\\"}\"}}}" - ] - } - } - }, - "201": { - "body": { - "name": "testNf", - "type": "Microsoft.HybridNetwork/networkFunctions", - "id": "/subscriptions/subid/resourcegroups/rg/providers/Microsoft.HybridNetwork/networkFunctions/testNf", - "location": "eastus", - "properties": { - "allowSoftwareUpdate": false, - "configurationType": "Open", - "deploymentValues": "{\"releaseName\":\"testReleaseName\",\"namespace\":\"testNamespace\"}", - "networkFunctionDefinitionGroupName": "testnetworkFunctionDefinitionGroupName", - "networkFunctionDefinitionOfferingLocation": "eastus", - "networkFunctionDefinitionVersion": "1.0.1", - "networkFunctionDefinitionVersionResourceReference": { - "idType": "Secret" - }, - "nfviId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testResourceGroup/providers/Microsoft.ExtendedLocation/customLocations/testCustomLocation", - "nfviType": "AzureArcKubernetes", - "provisioningState": "Accepted", - "publisherName": "testVendor", - "publisherScope": "Public", - "roleOverrideValues": [ - "{\"name\":\"testRoleOne\",\"deployParametersMappingRuleProfile\":{\"helmMappingRuleProfile\":{\"helmPackageVersion\":\"2.1.3\",\"values\":\"{\\\"roleOneParam\\\":\\\"roleOneOverrideValue\\\"}\"}}}", - "{\"name\":\"testRoleTwo\",\"deployParametersMappingRuleProfile\":{\"helmMappingRuleProfile\":{\"releaseName\":\"overrideReleaseName\",\"releaseNamespace\":\"overrideNamespace\",\"values\":\"{\\\"roleTwoParam\\\":\\\"roleTwoOverrideValue\\\"}\"}}}" - ] - } - } - } - }, - "operationId": "NetworkFunctions_CreateOrUpdate", - "title": "Create first party network function resource" -} diff --git a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkFunctionGet.json b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkFunctionGet.json deleted file mode 100644 index 18aad47240..0000000000 --- a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkFunctionGet.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "parameters": { - "api-version": "2025-03-30", - "networkFunctionName": "testNf", - "resourceGroupName": "rg", - "subscriptionId": "subid" - }, - "responses": { - "200": { - "body": { - "name": "testNf", - "type": "Microsoft.HybridNetwork/networkFunctions", - "id": "/subscriptions/subid/resourcegroups/rg/providers/Microsoft.HybridNetwork/networkFunctions/testNf", - "location": "eastus", - "properties": { - "allowSoftwareUpdate": false, - "configurationType": "Open", - "deploymentValues": "{\"releaseName\":\"testReleaseName\",\"namespace\":\"testNamespace\"}", - "networkFunctionDefinitionGroupName": "testnetworkFunctionDefinitionGroupName", - "networkFunctionDefinitionOfferingLocation": "eastus", - "networkFunctionDefinitionVersion": "1.0.1", - "networkFunctionDefinitionVersionResourceReference": { - "id": "/subscriptions/subid/resourcegroups/rg/providers/Microsoft.HybridNetwork/publishers/testVendor/networkFunctionDefinitionGroups/testnetworkFunctionDefinitionGroupName/networkFunctionDefinitionVersions/1.0.1", - "idType": "Open" - }, - "nfviId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testResourceGroup/providers/Microsoft.ExtendedLocation/customLocations/testCustomLocation", - "nfviType": "AzureArcKubernetes", - "provisioningState": "Succeeded", - "publisherName": "testVendor", - "publisherScope": "Public", - "roleOverrideValues": [ - "{\"name\":\"testRoleOne\",\"deployParametersMappingRuleProfile\":{\"helmMappingRuleProfile\":{\"helmPackageVersion\":\"2.1.3\",\"values\":\"{\\\"roleOneParam\\\":\\\"roleOneOverrideValue\\\"}\"}}}", - "{\"name\":\"testRoleTwo\",\"deployParametersMappingRuleProfile\":{\"helmMappingRuleProfile\":{\"releaseName\":\"overrideReleaseName\",\"releaseNamespace\":\"overrideNamespace\",\"values\":\"{\\\"roleTwoParam\\\":\\\"roleTwoOverrideValue\\\"}\"}}}" - ] - } - } - } - }, - "operationId": "NetworkFunctions_Get", - "title": "Get network function resource" -} diff --git a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkFunctionListByResourceGroup.json b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkFunctionListByResourceGroup.json deleted file mode 100644 index 69d76838fb..0000000000 --- a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkFunctionListByResourceGroup.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "parameters": { - "api-version": "2025-03-30", - "resourceGroupName": "rg", - "subscriptionId": "subid" - }, - "responses": { - "200": { - "body": { - "nextLink": "https://microsoft.com/a", - "value": [ - { - "name": "testNf", - "type": "Microsoft.HybridNetwork/networkFunctions", - "id": "/subscriptions/subid/resourcegroups/rg/providers/Microsoft.HybridNetwork/networkFunctions/testNf", - "location": "eastus", - "properties": { - "allowSoftwareUpdate": false, - "configurationType": "Open", - "deploymentValues": "{\"releaseName\":\"testReleaseName\",\"namespace\":\"testNamespace\"}", - "networkFunctionDefinitionGroupName": "testnetworkFunctionDefinitionGroupName", - "networkFunctionDefinitionOfferingLocation": "eastus", - "networkFunctionDefinitionVersion": "1.0.1", - "networkFunctionDefinitionVersionResourceReference": { - "id": "/subscriptions/subid/resourcegroups/rg/providers/Microsoft.HybridNetwork/publishers/testVendor/networkFunctionDefinitionGroups/testnetworkFunctionDefinitionGroupName/networkFunctionDefinitionVersions/1.0.1", - "idType": "Open" - }, - "nfviId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testResourceGroup/providers/Microsoft.ExtendedLocation/customLocations/testCustomLocation", - "nfviType": "AzureArcKubernetes", - "provisioningState": "Succeeded", - "publisherName": "testVendor", - "publisherScope": "Public", - "roleOverrideValues": [ - "{\"name\":\"testRoleOne\",\"deployParametersMappingRuleProfile\":{\"helmMappingRuleProfile\":{\"helmPackageVersion\":\"2.1.3\",\"values\":\"{\\\"roleOneParam\\\":\\\"roleOneOverrideValue\\\"}\"}}}", - "{\"name\":\"testRoleTwo\",\"deployParametersMappingRuleProfile\":{\"helmMappingRuleProfile\":{\"releaseName\":\"overrideReleaseName\",\"releaseNamespace\":\"overrideNamespace\",\"values\":\"{\\\"roleTwoParam\\\":\\\"roleTwoOverrideValue\\\"}\"}}}" - ] - } - } - ] - } - } - }, - "operationId": "NetworkFunctions_ListByResourceGroup", - "title": "List network function in resource group" -} diff --git a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkFunctionListBySubscription.json b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkFunctionListBySubscription.json deleted file mode 100644 index 2c09b5f04c..0000000000 --- a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkFunctionListBySubscription.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "parameters": { - "api-version": "2025-03-30", - "subscriptionId": "subid" - }, - "responses": { - "200": { - "body": { - "nextLink": "https://microsoft.com/a", - "value": [ - { - "name": "testNf", - "type": "Microsoft.HybridNetwork/networkFunctions", - "id": "/subscriptions/subid/resourcegroups/rg/providers/Microsoft.HybridNetwork/networkFunctions/testNf", - "location": "eastus", - "properties": { - "allowSoftwareUpdate": false, - "configurationType": "Open", - "deploymentValues": "{\"releaseName\":\"testReleaseName\",\"namespace\":\"testNamespace\"}", - "networkFunctionDefinitionGroupName": "testnetworkFunctionDefinitionGroupName", - "networkFunctionDefinitionOfferingLocation": "eastus", - "networkFunctionDefinitionVersion": "1.0.1", - "networkFunctionDefinitionVersionResourceReference": { - "id": "/subscriptions/subid/resourcegroups/rg/providers/Microsoft.HybridNetwork/publishers/testVendor/networkFunctionDefinitionGroups/testnetworkFunctionDefinitionGroupName/networkFunctionDefinitionVersions/1.0.1", - "idType": "Open" - }, - "nfviId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testResourceGroup/providers/Microsoft.ExtendedLocation/customLocations/testCustomLocation", - "nfviType": "AzureArcKubernetes", - "provisioningState": "Succeeded", - "publisherName": "testVendor", - "publisherScope": "Public", - "roleOverrideValues": [ - "{\"name\":\"testRoleOne\",\"deployParametersMappingRuleProfile\":{\"helmMappingRuleProfile\":{\"helmPackageVersion\":\"2.1.3\",\"values\":\"{\\\"roleOneParam\\\":\\\"roleOneOverrideValue\\\"}\"}}}", - "{\"name\":\"testRoleTwo\",\"deployParametersMappingRuleProfile\":{\"helmMappingRuleProfile\":{\"releaseName\":\"overrideReleaseName\",\"releaseNamespace\":\"overrideNamespace\",\"values\":\"{\\\"roleTwoParam\\\":\\\"roleTwoOverrideValue\\\"}\"}}}" - ] - } - } - ] - } - } - }, - "operationId": "NetworkFunctions_ListBySubscription", - "title": "List all network function resources in subscription." -} diff --git a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkFunctionUpdateTags.json b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkFunctionUpdateTags.json deleted file mode 100644 index 60d7ba9ed6..0000000000 --- a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkFunctionUpdateTags.json +++ /dev/null @@ -1,51 +0,0 @@ -{ - "parameters": { - "api-version": "2025-03-30", - "networkFunctionName": "testNf", - "parameters": { - "tags": { - "tag1": "value1", - "tag2": "value2" - } - }, - "resourceGroupName": "rg", - "subscriptionId": "subid" - }, - "responses": { - "200": { - "body": { - "name": "testNf", - "type": "Microsoft.HybridNetwork/networkFunctions", - "id": "/subscriptions/subid/resourcegroups/rg/providers/Microsoft.HybridNetwork/networkFunctions/testNf", - "location": "eastus", - "properties": { - "allowSoftwareUpdate": false, - "configurationType": "Open", - "deploymentValues": "{\"releaseName\":\"testReleaseName\",\"namespace\":\"testNamespace\"}", - "networkFunctionDefinitionGroupName": "testnetworkFunctionDefinitionGroupName", - "networkFunctionDefinitionOfferingLocation": "eastus", - "networkFunctionDefinitionVersion": "1.0.1", - "networkFunctionDefinitionVersionResourceReference": { - "id": "/subscriptions/subid/resourcegroups/rg/providers/Microsoft.HybridNetwork/publishers/testVendor/networkFunctionDefinitionGroups/testnetworkFunctionDefinitionGroupName/networkFunctionDefinitionVersions/1.0.1", - "idType": "Open" - }, - "nfviId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testResourceGroup/providers/Microsoft.ExtendedLocation/customLocations/testCustomLocation", - "nfviType": "AzureArcKubernetes", - "provisioningState": "Succeeded", - "publisherName": "testVendor", - "publisherScope": "Public", - "roleOverrideValues": [ - "{\"name\":\"testRoleOne\",\"deployParametersMappingRuleProfile\":{\"helmMappingRuleProfile\":{\"helmPackageVersion\":\"2.1.3\",\"values\":\"{\\\"roleOneParam\\\":\\\"roleOneOverrideValue\\\"}\"}}}", - "{\"name\":\"testRoleTwo\",\"deployParametersMappingRuleProfile\":{\"helmMappingRuleProfile\":{\"releaseName\":\"overrideReleaseName\",\"releaseNamespace\":\"overrideNamespace\",\"values\":\"{\\\"roleTwoParam\\\":\\\"roleTwoOverrideValue\\\"}\"}}}" - ] - }, - "tags": { - "tag1": "value1", - "tag2": "value2" - } - } - } - }, - "operationId": "NetworkFunctions_UpdateTags", - "title": "Update tags for network function resource" -} diff --git a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkFunctionsExecuteRequest.json b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkFunctionsExecuteRequest.json deleted file mode 100644 index 38e7618086..0000000000 --- a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkFunctionsExecuteRequest.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "parameters": { - "api-version": "2025-03-30", - "networkFunctionName": "testNetworkfunction", - "parameters": { - "requestMetadata": { - "apiVersion": "apiVersionQueryString", - "httpMethod": "Post", - "relativePath": "/simProfiles/testSimProfile", - "serializedBody": "{\"subscriptionProfile\":\"ChantestSubscription15\",\"permanentKey\":\"00112233445566778899AABBCCDDEEFF\",\"opcOperatorCode\":\"63bfa50ee6523365ff14c1f45f88737d\",\"staticIpAddresses\":{\"internet\":{\"ipv4Addr\":\"198.51.100.1\",\"ipv6Prefix\":\"2001:db8:abcd:12::0/64\"},\"another_network\":{\"ipv6Prefix\":\"2001:111:cdef:22::0/64\"}}}" - }, - "serviceEndpoint": "serviceEndpoint" - }, - "resourceGroupName": "rg", - "subscriptionId": "subid" - }, - "responses": { - "200": {}, - "202": { - "headers": { - "location": "https://management.azure.com/providers/microsoft.hybridnetwork/locations/EASTUS2EUAP/operationStatuses/0b37c625-7e7c-49c5-b86e-c817c85acb5d*B77A34159CA34A0BD446D3BC7EC120649181590DDF991982765DAC1A87491B2D?api-version=2021-05-01" - } - } - }, - "operationId": "NetworkFunctions_ExecuteRequest", - "title": "Send request to network function services" -} diff --git a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkServiceDesignGroupCreate.json b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkServiceDesignGroupCreate.json deleted file mode 100644 index 178a55e946..0000000000 --- a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkServiceDesignGroupCreate.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "parameters": { - "api-version": "2025-03-30", - "networkServiceDesignGroupName": "TestNetworkServiceDesignGroupName", - "parameters": { - "location": "eastus" - }, - "publisherName": "TestPublisher", - "resourceGroupName": "rg", - "subscriptionId": "subid" - }, - "responses": { - "200": { - "body": { - "name": "TestNetworkServiceDesignGroupName", - "type": "Microsoft.HybridNetwork/publishers/networkServiceDesignGroups", - "id": "/subscriptions/subid/resourcegroups/rg/rgproviders/Microsoft.HybridNetwork/publishers/TestPublisher/networkServiceDesignGroups/TestNetworkServiceDesignGroupName", - "location": "eastus", - "properties": { - "description": "Test NSD group" - } - } - }, - "201": { - "body": { - "name": "TestNetworkServiceDesignGroupName", - "type": "Microsoft.HybridNetwork/publishers/networkServiceDesignGroups", - "id": "/subscriptions/subid/resourcegroups/rg/providers/Microsoft.HybridNetwork/publishers/TestPublisher/networkServiceDesignGroups/TestNetworkServiceDesignGroupName", - "location": "eastus", - "properties": { - "description": "Test NSD group" - } - } - } - }, - "operationId": "NetworkServiceDesignGroups_CreateOrUpdate", - "title": "Create or update the network service design group" -} diff --git a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkServiceDesignGroupDelete.json b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkServiceDesignGroupDelete.json deleted file mode 100644 index 0e1428ac83..0000000000 --- a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkServiceDesignGroupDelete.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "parameters": { - "api-version": "2025-03-30", - "networkServiceDesignGroupName": "TestNetworkServiceDesignGroupName", - "publisherName": "TestPublisher", - "resourceGroupName": "rg", - "subscriptionId": "subid" - }, - "responses": { - "202": { - "headers": { - "location": "https://management.azure.com/providers/microsoft.hybridnetwork/locations/EASTUS2EUAP/operationStatuses/0b37c625-7e7c-49c5-b86e-c817c85acb5d*B77A34159CA34A0BD446D3BC7EC120649181590DDF991982765DAC1A87491B2D?api-version=2021-05-01" - } - }, - "204": {} - }, - "operationId": "NetworkServiceDesignGroups_Delete", - "title": "Delete a network function group resource" -} diff --git a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkServiceDesignGroupGet.json b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkServiceDesignGroupGet.json deleted file mode 100644 index 394d046e37..0000000000 --- a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkServiceDesignGroupGet.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "parameters": { - "api-version": "2025-03-30", - "networkServiceDesignGroupName": "TestNetworkServiceDesignGroupName", - "publisherName": "TestPublisher", - "resourceGroupName": "rg", - "subscriptionId": "subid" - }, - "responses": { - "200": { - "body": { - "name": "TestNetworkServiceDesignGroupName", - "type": "Microsoft.HybridNetwork/publishers/networkServiceDesignGroups", - "id": "/subscriptions/subid/resourcegroups/rg/providers/Microsoft.HybridNetwork/publishers/TestPublisher/networkServiceDesignGroups/TestNetworkServiceDesignGroupName", - "location": "eastus", - "properties": { - "description": "Test NSD group" - } - } - } - }, - "operationId": "NetworkServiceDesignGroups_Get", - "title": "Get a networkServiceDesign group resource" -} diff --git a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkServiceDesignGroupUpdateTags.json b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkServiceDesignGroupUpdateTags.json deleted file mode 100644 index 85dbe03d7b..0000000000 --- a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkServiceDesignGroupUpdateTags.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "parameters": { - "api-version": "2025-03-30", - "networkServiceDesignGroupName": "TestNetworkServiceDesignGroupName", - "parameters": { - "tags": { - "tag1": "value1", - "tag2": "value2" - } - }, - "publisherName": "TestPublisher", - "resourceGroupName": "rg", - "subscriptionId": "subid" - }, - "responses": { - "200": { - "body": { - "name": "TestNetworkServiceDesignGroupName", - "type": "Microsoft.HybridNetwork/publishers/networkServiceDesignGroups", - "id": "/subscriptions/subid/resourcegroups/rg/providers/Microsoft.HybridNetwork/publishers/TestPublisher/networkServiceDesignGroups/TestNetworkServiceDesignGroupName", - "location": "eastus", - "properties": { - "description": "Test NSD group" - }, - "tags": { - "tag1": "value1", - "tag2": "value2" - } - } - } - }, - "operationId": "NetworkServiceDesignGroups_Update", - "title": "Create or update the network service design group resource" -} diff --git a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkServiceDesignGroupsListByPublisherName.json b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkServiceDesignGroupsListByPublisherName.json deleted file mode 100644 index ccfce9f0e6..0000000000 --- a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkServiceDesignGroupsListByPublisherName.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "parameters": { - "api-version": "2025-03-30", - "publisherName": "TestPublisher", - "resourceGroupName": "rg", - "subscriptionId": "subid" - }, - "responses": { - "200": { - "body": { - "value": [ - { - "name": "TestNetworkServiceDesignGroupName", - "type": "Microsoft.HybridNetwork/publishers/networkServiceDesignGroups", - "id": "/subscriptions/subid/resourcegroups/rg/providers/Microsoft.HybridNetwork/publishers/TestPublisher/networkServiceDesignGroups/TestNetworkServiceDesignGroupName", - "location": "eastus", - "properties": { - "description": "Test NSD group" - } - } - ] - } - } - }, - "operationId": "NetworkServiceDesignGroups_ListByPublisher", - "title": "Get networkServiceDesign groups under publisher resource" -} diff --git a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkServiceDesignVersionCreate.json b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkServiceDesignVersionCreate.json deleted file mode 100644 index 1dd44bbd36..0000000000 --- a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkServiceDesignVersionCreate.json +++ /dev/null @@ -1,117 +0,0 @@ -{ - "parameters": { - "api-version": "2025-03-30", - "networkServiceDesignGroupName": "TestNetworkServiceDesignGroupName", - "networkServiceDesignVersionName": "1.0.0", - "parameters": { - "location": "eastus", - "properties": { - "configurationGroupSchemaReferences": { - "MyVM_Configuration": { - "id": "/subscriptions/subid/resourcegroups/contosorg1/providers/microsoft.hybridnetwork/publishers/contosoGroup/networkServiceDesignGroups/NSD_contoso/configurationGroupSchemas/MyVM_Configuration_Schema" - } - }, - "resourceElementTemplates": [ - { - "name": "MyVM", - "type": "ArmResourceDefinition", - "configuration": { - "artifactProfile": { - "artifactName": "MyVMArmTemplate", - "artifactStoreReference": { - "id": "/subscriptions/subid/providers/Microsoft.HybridNetwork/publishers/contosoGroup/artifactStoreReference/store1" - }, - "artifactVersion": "1.0.0" - }, - "parameterValues": "{\"publisherName\":\"{configurationparameters('MyVM_Configuration').publisherName}\",\"skuGroupName\":\"{configurationparameters('MyVM_Configuration').skuGroupName}\",\"skuVersion\":\"{configurationparameters('MyVM_Configuration').skuVersion}\",\"skuOfferingLocation\":\"{configurationparameters('MyVM_Configuration').skuOfferingLocation}\",\"nfviType\":\"{nfvis().nfvisFromSitePerNfviType.AzureCore.nfviAlias1.nfviType}\",\"nfviId\":\"{nfvis().nfvisFromSitePerNfviType.AzureCore.nfviAlias1.nfviId}\",\"allowSoftwareUpdates\":\"{configurationparameters('MyVM_Configuration').allowSoftwareUpdates}\",\"virtualNetworkName\":\"{configurationparameters('MyVM_Configuration').vnetName}\",\"subnetName\":\"{configurationparameters('MyVM_Configuration').subnetName}\",\"subnetAddressPrefix\":\"{configurationparameters('MyVM_Configuration').subnetAddressPrefix}\",\"managedResourceGroup\":\"{configurationparameters('SNSSelf').managedResourceGroupName}\",\"adminPassword\":\"{secretparameters('MyVM_Configuration').adminPassword}\"}", - "templateType": "ArmTemplate" - }, - "dependsOnProfile": { - "installDependsOn": [] - } - } - ], - "versionState": "Active" - } - }, - "publisherName": "TestPublisher", - "resourceGroupName": "rg", - "subscriptionId": "subid" - }, - "responses": { - "200": { - "body": { - "name": "TestVersion", - "type": "Microsoft.HybridNetwork/publishers/networkServiceDesignGroups/networkServiceDesignVersions", - "id": "/subscriptions/subid/resourcegroups/rg/providers/Microsoft.HybridNetwork/publishers/TestPublisher/networkServiceDesignGroups/TestNetworkServiceDesignGroupName/networkServiceDesignVersions/1.0.0", - "location": "eastus", - "properties": { - "configurationGroupSchemaReferences": { - "MyVM_Configuration": { - "id": "/subscriptions/subid/resourcegroups/contosorg1/providers/microsoft.hybridnetwork/publishers/contosoGroup/networkServiceDesignGroups/NSD_contoso/configurationGroupSchemas/MyVM_Configuration_Schema" - } - }, - "resourceElementTemplates": [ - { - "name": "MyVM", - "type": "ArmResourceDefinition", - "configuration": { - "artifactProfile": { - "artifactName": "MyVMArmTemplate", - "artifactStoreReference": { - "id": "/subscriptions/subid/providers/Microsoft.HybridNetwork/publishers/contosoGroup/artifactStoreReference/store1" - }, - "artifactVersion": "1.0.0" - }, - "parameterValues": "{\"publisherName\":\"{configurationparameters('MyVM_Configuration').publisherName}\",\"skuGroupName\":\"{configurationparameters('MyVM_Configuration').skuGroupName}\",\"skuVersion\":\"{configurationparameters('MyVM_Configuration').skuVersion}\",\"skuOfferingLocation\":\"{configurationparameters('MyVM_Configuration').skuOfferingLocation}\",\"nfviType\":\"{nfvis().nfvisFromSitePerNfviType.AzureCore.nfviAlias1.nfviType}\",\"nfviId\":\"{nfvis().nfvisFromSitePerNfviType.AzureCore.nfviAlias1.nfviId}\",\"allowSoftwareUpdates\":\"{configurationparameters('MyVM_Configuration').allowSoftwareUpdates}\",\"virtualNetworkName\":\"{configurationparameters('MyVM_Configuration').vnetName}\",\"subnetName\":\"{configurationparameters('MyVM_Configuration').subnetName}\",\"subnetAddressPrefix\":\"{configurationparameters('MyVM_Configuration').subnetAddressPrefix}\",\"managedResourceGroup\":\"{configurationparameters('SNSSelf').managedResourceGroupName}\",\"adminPassword\":\"{secretparameters('MyVM_Configuration').adminPassword}\"}", - "templateType": "ArmTemplate" - }, - "dependsOnProfile": { - "installDependsOn": [] - } - } - ], - "versionState": "Active" - } - } - }, - "201": { - "body": { - "name": "TestVersion", - "type": "Microsoft.HybridNetwork/publishers/networkFunctionDefinitionGroups/networkFunctionDefinitionVersions", - "id": "/subscriptions/subid/resourcegroups/rg/providers/Microsoft.HybridNetwork/publishers/TestPublisher/networkFunctionDefinitionGroups/TestNetworkFunctionDefinitionGroupName/networkFunctionDefinitionVersions/1.0.0", - "location": "eastus", - "properties": { - "configurationGroupSchemaReferences": { - "MyVM_Configuration": { - "id": "/subscriptions/subid/resourcegroups/contosorg1/providers/microsoft.hybridnetwork/publishers/contosoGroup/networkServiceDesignGroups/NSD_contoso/configurationGroupSchemas/MyVM_Configuration_Schema" - } - }, - "resourceElementTemplates": [ - { - "name": "MyVM", - "type": "ArmResourceDefinition", - "configuration": { - "artifactProfile": { - "artifactName": "MyVMArmTemplate", - "artifactStoreReference": { - "id": "/subscriptions/subid/providers/Microsoft.HybridNetwork/publishers/contosoGroup/artifactStoreReference/store1" - }, - "artifactVersion": "1.0.0" - }, - "parameterValues": "{\"publisherName\":\"{configurationparameters('MyVM_Configuration').publisherName}\",\"skuGroupName\":\"{configurationparameters('MyVM_Configuration').skuGroupName}\",\"skuVersion\":\"{configurationparameters('MyVM_Configuration').skuVersion}\",\"skuOfferingLocation\":\"{configurationparameters('MyVM_Configuration').skuOfferingLocation}\",\"nfviType\":\"{nfvis().nfvisFromSitePerNfviType.AzureCore.nfviAlias1.nfviType}\",\"nfviId\":\"{nfvis().nfvisFromSitePerNfviType.AzureCore.nfviAlias1.nfviId}\",\"allowSoftwareUpdates\":\"{configurationparameters('MyVM_Configuration').allowSoftwareUpdates}\",\"virtualNetworkName\":\"{configurationparameters('MyVM_Configuration').vnetName}\",\"subnetName\":\"{configurationparameters('MyVM_Configuration').subnetName}\",\"subnetAddressPrefix\":\"{configurationparameters('MyVM_Configuration').subnetAddressPrefix}\",\"managedResourceGroup\":\"{configurationparameters('SNSSelf').managedResourceGroupName}\",\"adminPassword\":\"{secretparameters('MyVM_Configuration').adminPassword}\"}", - "templateType": "ArmTemplate" - }, - "dependsOnProfile": { - "installDependsOn": [] - } - } - ], - "versionState": "Active" - } - } - } - }, - "operationId": "NetworkServiceDesignVersions_CreateOrUpdate", - "title": "Create or update a network service design version resource" -} diff --git a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkServiceDesignVersionDelete.json b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkServiceDesignVersionDelete.json deleted file mode 100644 index 7375f14a00..0000000000 --- a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkServiceDesignVersionDelete.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "parameters": { - "api-version": "2025-03-30", - "networkServiceDesignGroupName": "TestNetworkServiceDesignGroupName", - "networkServiceDesignVersionName": "1.0.0", - "publisherName": "TestPublisher", - "resourceGroupName": "rg", - "subscriptionId": "subid" - }, - "responses": { - "202": { - "headers": { - "location": "https://management.azure.com/providers/microsoft.hybridnetwork/locations/EASTUS2EUAP/operationStatuses/0b37c625-7e7c-49c5-b86e-c817c85acb5d*B77A34159CA34A0BD446D3BC7EC120649181590DDF991982765DAC1A87491B2D?api-version=2021-05-01" - } - }, - "204": {} - }, - "operationId": "NetworkServiceDesignVersions_Delete", - "title": "Delete a network service design version" -} diff --git a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkServiceDesignVersionGet.json b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkServiceDesignVersionGet.json deleted file mode 100644 index dfa0254166..0000000000 --- a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkServiceDesignVersionGet.json +++ /dev/null @@ -1,56 +0,0 @@ -{ - "parameters": { - "api-version": "2025-03-30", - "networkServiceDesignGroupName": "TestNetworkServiceDesignGroupName", - "networkServiceDesignVersionName": "1.0.0", - "publisherName": "TestPublisher", - "resourceGroupName": "rg", - "subscriptionId": "subid" - }, - "responses": { - "200": { - "body": { - "name": "TestVersion", - "type": "Microsoft.HybridNetwork/publishers/networkServiceDesignGroups/networkServiceDesignVersions", - "id": "/subscriptions/subid/resourcegroups/rg/providers/Microsoft.HybridNetwork/publishers/TestPublisher/networkServiceDesignGroups/TestNetworkServiceDesignGroupName/networkServiceDesignVersions/1.0.0", - "location": "eastus", - "properties": { - "configurationGroupSchemaReferences": { - "MyVM_Configuration": { - "id": "/subscriptions/subid/resourcegroups/contosorg1/providers/microsoft.hybridnetwork/publishers/contosoGroup/networkServiceDesignGroups/NSD_contoso/configurationGroupSchemas/MyVM_Configuration_Schema" - } - }, - "nfvisFromSite": { - "nfvi1": { - "name": "{configurationparameter('MyVM_Configuration').nfviNameFromSite}", - "type": "AzureCore" - } - }, - "resourceElementTemplates": [ - { - "name": "MyVM", - "type": "ArmResourceDefinition", - "configuration": { - "artifactProfile": { - "artifactName": "MyVMArmTemplate", - "artifactStoreReference": { - "id": "/subscriptions/subid/providers/Microsoft.HybridNetwork/publishers/contosoGroup/ArtifactStore/store1" - }, - "artifactVersion": "1.0.0" - }, - "parameterValues": "{\"publisherName\":\"{configurationparameters('MyVM_Configuration').publisherName}\",\"skuGroupName\":\"{configurationparameters('MyVM_Configuration').skuGroupName}\",\"skuVersion\":\"{configurationparameters('MyVM_Configuration').skuVersion}\",\"skuOfferingLocation\":\"{configurationparameters('MyVM_Configuration').skuOfferingLocation}\",\"nfviType\":\"{nfvis().nfvisFromSitePerNfviType.AzureCore.nfviAlias1.nfviType}\",\"nfviId\":\"{nfvis().nfvisFromSitePerNfviType.AzureCore.nfviAlias1.nfviId}\",\"allowSoftwareUpdates\":\"{configurationparameters('MyVM_Configuration').allowSoftwareUpdates}\",\"virtualNetworkName\":\"{configurationparameters('MyVM_Configuration').vnetName}\",\"subnetName\":\"{configurationparameters('MyVM_Configuration').subnetName}\",\"subnetAddressPrefix\":\"{configurationparameters('MyVM_Configuration').subnetAddressPrefix}\",\"managedResourceGroup\":\"{configurationparameters('SNSSelf').managedResourceGroupName}\",\"adminPassword\":\"{secretparameters('MyVM_Configuration').adminPassword}\"}", - "templateType": "ArmTemplate" - }, - "dependsOnProfile": { - "installDependsOn": [] - } - } - ], - "versionState": "Active" - } - } - } - }, - "operationId": "NetworkServiceDesignVersions_Get", - "title": "Get a network service design version resource" -} diff --git a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkServiceDesignVersionListByNetworkServiceDesignGroup.json b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkServiceDesignVersionListByNetworkServiceDesignGroup.json deleted file mode 100644 index 704b896655..0000000000 --- a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkServiceDesignVersionListByNetworkServiceDesignGroup.json +++ /dev/null @@ -1,53 +0,0 @@ -{ - "parameters": { - "api-version": "2025-03-30", - "networkServiceDesignGroupName": "TestNetworkServiceDesignGroupName", - "publisherName": "TestPublisher", - "resourceGroupName": "rg", - "subscriptionId": "subid" - }, - "responses": { - "200": { - "body": { - "value": [ - { - "name": "TestVersion", - "type": "Microsoft.HybridNetwork/publishers/networkServiceDesignGroups/networkServiceDesignVersions", - "id": "/subscriptions/subid/resourcegroups/rg/providers/Microsoft.HybridNetwork/publishers/TestPublisher/networkServiceDesignGroups/TestNetworkServiceDesignGroupName/networkServiceDesignVersions/1.0.0", - "location": "eastus", - "properties": { - "configurationGroupSchemaReferences": { - "MyVM_Configuration": { - "id": "/subscriptions/subid/resourcegroups/contosorg1/providers/microsoft.hybridnetwork/publishers/contosoGroup/networkServiceDesignGroups/NSD_contoso/configurationGroupSchemas/MyVM_Configuration_Schema" - } - }, - "resourceElementTemplates": [ - { - "name": "MyVM", - "type": "ArmResourceDefinition", - "configuration": { - "artifactProfile": { - "artifactName": "MyVMArmTemplate", - "artifactStoreReference": { - "id": "/subscriptions/subid/providers/Microsoft.HybridNetwork/publishers/contosoGroup/ArtifactStore/store1" - }, - "artifactVersion": "1.0.0" - }, - "parameterValues": "\"publisherName\": \"{configurationparameters('MyVM_Configuration').publisherName}\",\r\n \"skuGroupName\": \"{configurationparameters('MyVM_Configuration').skuGroupName}\",\r\n \"skuVersion\": \"{configurationparameters('MyVM_Configuration').skuVersion}\",\r\n \"skuOfferingLocation\": \"{configurationparameters('MyVM_Configuration').skuOfferingLocation}\",\r\n \"nfviType\": \"{nfvis().nfvisFromSitePerNfviType.AzureCore.nfviAlias1.nfviType}\",\r\n \"nfviId\": \"{nfvis().nfvisFromSitePerNfviType.AzureCore.nfviAlias1.nfviId}\",\r\n \"allowSoftwareUpdates\": \"{configurationparameters('MyVM_Configuration').allowSoftwareUpdates}\",\r\n \"virtualNetworkName\": \"{configurationparameters('MyVM_Configuration').vnetName}\",\r\n \"subnetName\": \"{configurationparameters('MyVM_Configuration').subnetName}\",\r\n \"subnetAddressPrefix\": \"{configurationparameters('MyVM_Configuration').subnetAddressPrefix}\",\r\n \"managedResourceGroup\": \"{configurationparameters('SNSSelf').managedResourceGroupName}\"\r\n ", - "templateType": "ArmTemplate" - }, - "dependsOnProfile": { - "installDependsOn": [] - } - } - ], - "versionState": "Active" - } - } - ] - } - } - }, - "operationId": "NetworkServiceDesignVersions_ListByNetworkServiceDesignGroup", - "title": "Get Publisher resource" -} diff --git a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkServiceDesignVersionUpdateState.json b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkServiceDesignVersionUpdateState.json deleted file mode 100644 index 0e6ac30b61..0000000000 --- a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkServiceDesignVersionUpdateState.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "parameters": { - "api-version": "2025-03-30", - "networkServiceDesignGroupName": "TestNetworkServiceDesignGroupName", - "networkServiceDesignVersionName": "1.0.0", - "parameters": { - "versionState": "Active" - }, - "publisherName": "TestPublisher", - "resourceGroupName": "rg", - "subscriptionId": "subid" - }, - "responses": { - "200": { - "body": { - "versionState": "Active" - } - }, - "202": { - "headers": { - "location": "https://management.azure.com/providers/microsoft.hybridnetwork/locations/EASTUS2EUAP/operationStatuses/0b37c625-7e7c-49c5-b86e-c817c85acb5d*B77A34159CA34A0BD446D3BC7EC120649181590DDF991982765DAC1A87491B2D?api-version=2021-05-01" - } - } - }, - "operationId": "NetworkServiceDesignVersions_updateState", - "title": "Update network service design version state" -} diff --git a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkServiceDesignVersionUpdateTags.json b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkServiceDesignVersionUpdateTags.json deleted file mode 100644 index aabfb24f71..0000000000 --- a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/NetworkServiceDesignVersionUpdateTags.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "parameters": { - "api-version": "2025-03-30", - "networkServiceDesignGroupName": "TestNetworkServiceDesignGroupName", - "networkServiceDesignVersionName": "1.0.0", - "parameters": { - "tags": { - "tag1": "value1", - "tag2": "value2" - } - }, - "publisherName": "TestPublisher", - "resourceGroupName": "rg", - "subscriptionId": "subid" - }, - "responses": { - "200": { - "body": { - "name": "TestVersion", - "type": "Microsoft.HybridNetwork/publishers/networkServiceDesignGroups/networkServiceDesignVersions", - "id": "/subscriptions/subid/resourcegroups/rg/providers/Microsoft.HybridNetwork/publishers/TestPublisher/networkServiceDesignGroups/TestNetworkServiceDesignGroupName/networkServiceDesignVersions/1.0.0", - "location": "eastus", - "properties": { - "configurationGroupSchemaReferences": { - "MyVM_Configuration": { - "id": "/subscriptions/subid/resourcegroups/contosorg1/providers/microsoft.hybridnetwork/publishers/contosoGroup/networkServiceDesignGroups/NSD_contoso/configurationGroupSchemas/MyVM_Configuration_Schema" - } - }, - "resourceElementTemplates": [ - { - "name": "MyVM", - "type": "ArmResourceDefinition", - "configuration": { - "artifactProfile": { - "artifactName": "MyVMArmTemplate", - "artifactStoreReference": { - "id": "/subscriptions/subid/providers/Microsoft.HybridNetwork/publishers/contosoGroup/ArtifactStore/store1" - }, - "artifactVersion": "1.0.0" - }, - "parameterValues": "\"publisherName\": \"{configurationparameters('MyVM_Configuration').publisherName}\",\r\n \"skuGroupName\": \"{configurationparameters('MyVM_Configuration').skuGroupName}\",\r\n \"skuVersion\": \"{configurationparameters('MyVM_Configuration').skuVersion}\",\r\n \"skuOfferingLocation\": \"{configurationparameters('MyVM_Configuration').skuOfferingLocation}\",\r\n \"nfviType\": \"{nfvis().nfvisFromSitePerNfviType.AzureCore.nfviAlias1.nfviType}\",\r\n \"nfviId\": \"{nfvis().nfvisFromSitePerNfviType.AzureCore.nfviAlias1.nfviId}\",\r\n \"allowSoftwareUpdates\": \"{configurationparameters('MyVM_Configuration').allowSoftwareUpdates}\",\r\n \"virtualNetworkName\": \"{configurationparameters('MyVM_Configuration').vnetName}\",\r\n \"subnetName\": \"{configurationparameters('MyVM_Configuration').subnetName}\",\r\n \"subnetAddressPrefix\": \"{configurationparameters('MyVM_Configuration').subnetAddressPrefix}\",\r\n \"managedResourceGroup\": \"{configurationparameters('SNSSelf').managedResourceGroupName}\"\r\n ", - "templateType": "ArmTemplate" - }, - "dependsOnProfile": { - "installDependsOn": [] - } - } - ], - "versionState": "Active" - }, - "tags": { - "tag1": "value1", - "tag2": "value2" - } - } - } - }, - "operationId": "NetworkServiceDesignVersions_Update", - "title": "Update the network service design version tags" -} diff --git a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/PublisherCreate.json b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/PublisherCreate.json deleted file mode 100644 index df9b2c4197..0000000000 --- a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/PublisherCreate.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "parameters": { - "api-version": "2025-03-30", - "parameters": { - "location": "eastus", - "properties": { - "scope": "Public" - } - }, - "publisherName": "TestPublisher", - "resourceGroupName": "rg", - "subscriptionId": "subid" - }, - "responses": { - "200": { - "body": { - "name": "TestPublisher", - "type": "Microsoft.HybridNetwork/publishers", - "id": "/subscriptions/subid/resourcegroups/rg/providers/Microsoft.HybridNetwork/publishers/TestPublisher", - "location": "eastus", - "properties": { - "provisioningState": "Succeeded", - "scope": "Public" - } - } - }, - "201": { - "body": { - "name": "TestPublisher", - "type": "Microsoft.HybridNetwork/publishers", - "id": "/subscriptions/subid/resourcegroups/rg/providers/Microsoft.HybridNetwork/publishers/TestPublisher", - "location": "eastus", - "properties": { - "provisioningState": "Accepted", - "scope": "Public" - } - } - } - }, - "operationId": "Publishers_CreateOrUpdate", - "title": "Create or update a publisher resource" -} diff --git a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/PublisherDelete.json b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/PublisherDelete.json deleted file mode 100644 index 420ddddf70..0000000000 --- a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/PublisherDelete.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "parameters": { - "api-version": "2025-03-30", - "publisherName": "TestPublisher", - "resourceGroupName": "rg", - "subscriptionId": "subid" - }, - "responses": { - "202": { - "headers": { - "location": "https://management.azure.com/providers/microsoft.hybridnetwork/locations/EASTUS2EUAP/operationStatuses/0b37c625-7e7c-49c5-b86e-c817c85acb5d*B77A34159CA34A0BD446D3BC7EC120649181590DDF991982765DAC1A87491B2D?api-version=2021-05-01" - } - }, - "204": {} - }, - "operationId": "Publishers_Delete", - "title": "Delete a publisher resource" -} diff --git a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/PublisherGet.json b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/PublisherGet.json deleted file mode 100644 index cbc23e3c4d..0000000000 --- a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/PublisherGet.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "parameters": { - "api-version": "2025-03-30", - "publisherName": "TestPublisher", - "resourceGroupName": "rg", - "subscriptionId": "subid" - }, - "responses": { - "200": { - "body": { - "name": "TestPublisher", - "type": "Microsoft.HybridNetwork/publishers", - "id": "/subscriptions/subid/resourcegroups/rg/providers/Microsoft.HybridNetwork/publishers/TestPublisher", - "location": "eastus", - "properties": { - "provisioningState": "Succeeded", - "scope": "Public" - } - } - } - }, - "operationId": "Publishers_Get", - "title": "Get a publisher resource" -} diff --git a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/PublisherListByResourceGroup.json b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/PublisherListByResourceGroup.json deleted file mode 100644 index 12b68bbc8b..0000000000 --- a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/PublisherListByResourceGroup.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "parameters": { - "api-version": "2025-03-30", - "resourceGroupName": "rg", - "subscriptionId": "subid" - }, - "responses": { - "200": { - "body": { - "value": [ - { - "name": "TestPublisher", - "type": "Microsoft.HybridNetwork/publishers", - "id": "/subscriptions/subid/resourcegroups/rg/providers/Microsoft.HybridNetwork/publishers/TestPublisher", - "location": "eastus", - "properties": { - "provisioningState": "Succeeded", - "scope": "Public" - } - }, - { - "name": "TestPublisher2", - "type": "Microsoft.HybridNetwork/publishers", - "id": "/subscriptions/subid/resourcegroups/rg/providers/Microsoft.HybridNetwork/publishers/TestPublisher2", - "location": "eastus", - "properties": { - "provisioningState": "Succeeded", - "scope": "Public" - } - } - ] - } - } - }, - "operationId": "Publishers_ListByResourceGroup", - "title": "List all publisher resources in a resource group" -} diff --git a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/PublisherListBySubscription.json b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/PublisherListBySubscription.json deleted file mode 100644 index d9b9c71aad..0000000000 --- a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/PublisherListBySubscription.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "parameters": { - "api-version": "2025-03-30", - "subscriptionId": "subid" - }, - "responses": { - "200": { - "body": { - "value": [ - { - "name": "TestPublisher", - "type": "Microsoft.HybridNetwork/publishers", - "id": "/subscriptions/subid/resourcegroups/rg/providers/Microsoft.HybridNetwork/publishers/TestPublisher", - "location": "eastus", - "properties": { - "provisioningState": "Succeeded", - "scope": "Public" - } - }, - { - "name": "TestPublisher2", - "type": "Microsoft.HybridNetwork/publishers", - "id": "/subscriptions/subid/resourcegroups/rg/providers/Microsoft.HybridNetwork/publishers/TestPublisher2", - "location": "eastus", - "properties": { - "provisioningState": "Succeeded", - "scope": "Public" - } - } - ] - } - } - }, - "operationId": "Publishers_ListBySubscription", - "title": "List all publisher resources in a subscription" -} diff --git a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/PublisherUpdateTags.json b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/PublisherUpdateTags.json deleted file mode 100644 index d7123e35fb..0000000000 --- a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/PublisherUpdateTags.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "parameters": { - "api-version": "2025-03-30", - "parameters": { - "tags": { - "tag1": "value1", - "tag2": "value2" - } - }, - "publisherName": "TestPublisher", - "resourceGroupName": "rg", - "subscriptionId": "subid" - }, - "responses": { - "200": { - "body": { - "name": "TestPublisher", - "type": "Microsoft.HybridNetwork/publishers", - "id": "/subscriptions/subid/resourcegroups/rg/providers/Microsoft.HybridNetwork/publishers/TestPublisher", - "location": "eastus", - "properties": { - "provisioningState": "Succeeded", - "scope": "Public" - }, - "tags": { - "tag1": "value1", - "tag2": "value2" - } - } - } - }, - "operationId": "Publishers_Update", - "title": "Update a publisher tags" -} diff --git a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/PureProxyArtifact/ArtifactChangeState.json b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/PureProxyArtifact/ArtifactChangeState.json deleted file mode 100644 index 998eea558f..0000000000 --- a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/PureProxyArtifact/ArtifactChangeState.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "parameters": { - "api-version": "2025-03-30", - "artifactName": "fedrbac", - "artifactStoreName": "TestArtifactStoreName", - "artifactVersionName": "1.0.0", - "parameters": { - "properties": { - "artifactState": "Deprecated" - } - }, - "publisherName": "TestPublisher", - "resourceGroupName": "TestResourceGroup", - "subscriptionId": "subid" - }, - "responses": { - "200": { - "body": { - "name": "fedrbac", - "type": "Microsoft.HybridNetwork/publishers/artifactStores/artifactVersions", - "id": "/subscriptions/subid/resourceGroups/TestResourceGroup/providers/Microsoft.HybridNetwork/publishers/TestPublisher/artifactStores/TestArtifactStore/artifactVersions/1.0.0", - "properties": { - "artifactState": "Deprecated", - "artifactType": "OCIArtifact", - "artifactVersion": "1.0.0" - } - } - }, - "202": { - "headers": { - "location": "https://management.azure.com/providers/microsoft.hybridnetwork/locations/EASTUS2EUAP/operationStatuses/0b37c625-7e7c-49c5-b86e-c817c85acb5d*B77A34159CA34A0BD446D3BC7EC120649181590DDF991982765DAC1A87491B2D?api-version=2021-05-01" - } - } - }, - "operationId": "ProxyArtifact_UpdateState", - "title": "Update an artifact state" -} diff --git a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/PureProxyArtifact/ArtifactGet.json b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/PureProxyArtifact/ArtifactGet.json deleted file mode 100644 index 64648a5eaf..0000000000 --- a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/PureProxyArtifact/ArtifactGet.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "parameters": { - "api-version": "2025-03-30", - "artifactName": "fedrbac", - "artifactStoreName": "TestArtifactStoreName", - "publisherName": "TestPublisher", - "resourceGroupName": "TestResourceGroup", - "subscriptionId": "subid" - }, - "responses": { - "200": { - "body": { - "nextLink": "https://microsoft.com/a", - "value": [ - { - "name": "fedrbac", - "type": "Microsoft.HybridNetwork/publishers/artifactStores/artifactVersions", - "id": "/subscriptions/subid/resourceGroups/TestResourceGroup/providers/Microsoft.HybridNetwork/publishers/TestPublisher/artifactStores/TestArtifactStore/artifactVersions", - "properties": { - "artifactState": "Deprecated", - "artifactType": "OCIArtifact", - "artifactVersion": "1.0.0" - } - }, - { - "name": "fedrbac", - "type": "Microsoft.HybridNetwork/publishers/artifactStores/artifactVersions", - "id": "/subscriptions/subid/resourceGroups/TestResourceGroup/providers/Microsoft.HybridNetwork/publishers/TestPublisher/artifactStores/TestArtifactStore/artifactVersions", - "properties": { - "artifactState": "Active", - "artifactType": "OCIArtifact", - "artifactVersion": "2.0.0" - } - } - ] - } - } - }, - "operationId": "ProxyArtifact_Get", - "title": "Get an artifact overview" -} diff --git a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/PureProxyArtifact/ArtifactList.json b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/PureProxyArtifact/ArtifactList.json deleted file mode 100644 index b7348cbdaa..0000000000 --- a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/PureProxyArtifact/ArtifactList.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "parameters": { - "api-version": "2025-03-30", - "artifactStoreName": "TestArtifactStoreName", - "publisherName": "TestPublisher", - "resourceGroupName": "TestResourceGroup", - "subscriptionId": "subid" - }, - "responses": { - "200": { - "body": { - "nextLink": "https://microsoft.com/a", - "value": [ - { - "name": "fedrbac1", - "type": "Microsoft.HybridNetwork/publishers/artifactStores/artifactVersions", - "id": "/subscriptions/subid/resourceGroups/TestResourceGroup/providers/Microsoft.HybridNetwork/publishers/TestPublisher/artifactStores/TestArtifactStore/artifactVersions" - }, - { - "name": "fedrbac2", - "type": "Microsoft.HybridNetwork/publishers/artifactStores/artifactVersions", - "id": "/subscriptions/subid/resourceGroups/TestResourceGroup/providers/Microsoft.HybridNetwork/publishers/TestPublisher/artifactStores/TestArtifactStore/artifactVersions" - } - ] - } - } - }, - "operationId": "ProxyArtifact_List", - "title": "List artifacts under an artifact store" -} diff --git a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/SiteCreate.json b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/SiteCreate.json deleted file mode 100644 index 32ac91834c..0000000000 --- a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/SiteCreate.json +++ /dev/null @@ -1,118 +0,0 @@ -{ - "parameters": { - "api-version": "2025-03-30", - "parameters": { - "location": "westUs2", - "properties": { - "nfvis": [ - { - "name": "nfvi1", - "location": "westUs2", - "nfviType": "AzureCore" - }, - { - "name": "nfvi2", - "customLocationReference": { - "id": "/subscriptions/subid/resourceGroups/testResourceGroup/providers/Microsoft.ExtendedLocation/customLocations/testCustomLocation1" - }, - "nfviType": "AzureArcKubernetes" - }, - { - "name": "nfvi3", - "customLocationReference": { - "id": "/subscriptions/subid/resourceGroups/testResourceGroup/providers/Microsoft.ExtendedLocation/customLocations/testCustomLocation2" - }, - "nfviType": "AzureOperatorNexus" - } - ] - } - }, - "resourceGroupName": "rg1", - "siteName": "testSite", - "subscriptionId": "subid" - }, - "responses": { - "200": { - "body": { - "name": "testSite", - "type": "Microsoft.HybridNetwork/sites", - "id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.HybridNetwork/sites/testSite", - "location": "westUs2", - "properties": { - "nfvis": [ - { - "name": "nfvi1", - "location": "westUs2", - "nfviType": "AzureCore" - }, - { - "name": "nfvi2", - "customLocationReference": { - "id": "/subscriptions/subid/resourceGroups/testResourceGroup/providers/Microsoft.ExtendedLocation/customLocations/testCustomLocation1" - }, - "nfviType": "AzureArcKubernetes" - }, - { - "name": "nfvi3", - "customLocationReference": { - "id": "/subscriptions/subid/resourceGroups/testResourceGroup/providers/Microsoft.ExtendedLocation/customLocations/testCustomLocation2" - }, - "nfviType": "AzureOperatorNexus" - } - ], - "provisioningState": "Accepted" - }, - "systemData": { - "createdAt": "2020-01-01T17:18:19.1234567Z", - "createdBy": "user1", - "createdByType": "User", - "lastModifiedAt": "2020-01-02T17:18:19.1234567Z", - "lastModifiedBy": "user2", - "lastModifiedByType": "User" - } - } - }, - "201": { - "body": { - "name": "testSite", - "type": "Microsoft.HybridNetwork/sites", - "id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.HybridNetwork/sites/testSite", - "location": "westUs2", - "properties": { - "nfvis": [ - { - "name": "nfvi1", - "location": "westUs2", - "nfviType": "AzureCore" - }, - { - "name": "nfvi2", - "customLocationReference": { - "id": "/subscriptions/subid/resourceGroups/testResourceGroup/providers/Microsoft.ExtendedLocation/customLocations/testCustomLocation1" - }, - "nfviType": "AzureArcKubernetes" - }, - { - "name": "nfvi3", - "customLocationReference": { - "id": "/subscriptions/subid/resourceGroups/testResourceGroup/providers/Microsoft.ExtendedLocation/customLocations/testCustomLocation2" - }, - "nfviType": "AzureOperatorNexus" - } - ], - "provisioningState": "Accepted" - }, - "systemData": { - "createdAt": "2020-01-01T17:18:19.1234567Z", - "createdBy": "user1", - "createdByType": "User", - "lastModifiedAt": "2020-01-02T17:18:19.1234567Z", - "lastModifiedBy": "user2", - "lastModifiedByType": "User" - } - } - } - }, - "operationId": "Sites_CreateOrUpdate", - "title": "Create network site" -} diff --git a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/SiteDelete.json b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/SiteDelete.json deleted file mode 100644 index 8dc1f80301..0000000000 --- a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/SiteDelete.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "parameters": { - "api-version": "2025-03-30", - "resourceGroupName": "rg1", - "siteName": "testSite", - "subscriptionId": "subid" - }, - "responses": { - "202": { - "headers": { - "location": "https://management.azure.com/providers/microsoft.hybridnetwork/locations/EASTUS2EUAP/operationStatuses/0b37c625-7e7c-49c5-b86e-c817c85acb5d*B77A34159CA34A0BD446D3BC7EC120649181590DDF991982765DAC1A87491B2D?api-version=2021-05-01" - } - }, - "204": {} - }, - "operationId": "Sites_Delete", - "title": "Delete network site" -} diff --git a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/SiteGet.json b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/SiteGet.json deleted file mode 100644 index 7ce3970584..0000000000 --- a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/SiteGet.json +++ /dev/null @@ -1,52 +0,0 @@ -{ - "parameters": { - "api-version": "2025-03-30", - "resourceGroupName": "rg1", - "siteName": "testSite", - "subscriptionId": "subid" - }, - "responses": { - "200": { - "body": { - "name": "testSite", - "type": "Microsoft.HybridNetwork/sites", - "id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.HybridNetwork/sites/testSite", - "location": "westUs2", - "properties": { - "nfvis": [ - { - "name": "nfvi1", - "location": "westUs2", - "nfviType": "AzureCore" - }, - { - "name": "nfvi2", - "customLocationReference": { - "id": "/subscriptions/subid/resourceGroups/testResourceGroup/providers/Microsoft.ExtendedLocation/customLocations/testCustomLocation1" - }, - "nfviType": "AzureArcKubernetes" - }, - { - "name": "nfvi3", - "customLocationReference": { - "id": "/subscriptions/subid/resourceGroups/testResourceGroup/providers/Microsoft.ExtendedLocation/customLocations/testCustomLocation2" - }, - "nfviType": "AzureOperatorNexus" - } - ], - "provisioningState": "Accepted" - }, - "systemData": { - "createdAt": "2020-01-01T17:18:19.1234567Z", - "createdBy": "user1", - "createdByType": "User", - "lastModifiedAt": "2020-01-02T17:18:19.1234567Z", - "lastModifiedBy": "user2", - "lastModifiedByType": "User" - } - } - } - }, - "operationId": "Sites_Get", - "title": "Get network site" -} diff --git a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/SiteListByResourceGroup.json b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/SiteListByResourceGroup.json deleted file mode 100644 index a52ff55fad..0000000000 --- a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/SiteListByResourceGroup.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "parameters": { - "api-version": "2025-03-30", - "resourceGroupName": "rg1", - "subscriptionId": "subid" - }, - "responses": { - "200": { - "body": { - "value": [ - { - "name": "testSite", - "type": "Microsoft.HybridNetwork/orchestrators/sites", - "id": "subscriptions/subid/resourceGroups/rg1/providers/Microsoft.HybridNetwork/sites/testSite", - "location": "westUs2", - "properties": { - "nfvis": [ - { - "name": "azureWestUs2", - "location": "westUs2", - "nfviType": "AzureCore" - } - ] - }, - "systemData": { - "createdAt": "2020-01-01T17:18:19.1234567Z", - "createdBy": "user1", - "createdByType": "User", - "lastModifiedAt": "2020-01-02T17:18:19.1234567Z", - "lastModifiedBy": "user2", - "lastModifiedByType": "User" - } - } - ] - } - } - }, - "operationId": "Sites_ListByResourceGroup", - "title": "List all network sites" -} diff --git a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/SiteListBySubscription.json b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/SiteListBySubscription.json deleted file mode 100644 index 8e56d1317b..0000000000 --- a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/SiteListBySubscription.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "parameters": { - "api-version": "2025-03-30", - "subscriptionId": "subid" - }, - "responses": { - "200": { - "body": { - "value": [ - { - "name": "testSite", - "type": "Microsoft.HybridNetwork/sites", - "id": "subscriptions/subid/resourceGroups/rg1/providers/Microsoft.HybridNetwork/sites/testSite", - "location": "westUs2", - "properties": { - "nfvis": [ - { - "name": "azureWestUs2", - "location": "westUs2", - "nfviType": "AzureCore" - } - ], - "provisioningState": "Accepted" - }, - "systemData": { - "createdAt": "2020-01-01T17:18:19.1234567Z", - "createdBy": "user1", - "createdByType": "User", - "lastModifiedAt": "2020-01-02T17:18:19.1234567Z", - "lastModifiedBy": "user2", - "lastModifiedByType": "User" - } - } - ] - } - } - }, - "operationId": "Sites_ListBySubscription", - "title": "List all hybrid network sites in a subscription." -} diff --git a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/SiteNetworkServiceCreate.json b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/SiteNetworkServiceCreate.json deleted file mode 100644 index 70384bb1ab..0000000000 --- a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/SiteNetworkServiceCreate.json +++ /dev/null @@ -1,112 +0,0 @@ -{ - "parameters": { - "api-version": "2025-03-30", - "parameters": { - "location": "westUs2", - "properties": { - "desiredStateConfigurationGroupValueReferences": { - "MyVM_Configuration": { - "id": "/subscriptions/subid/resourcegroups/contosorg1/providers/microsoft.hybridnetwork/configurationgroupvalues/MyVM_Configuration1" - } - }, - "networkServiceDesignVersionResourceReference": { - "id": "/subscriptions/subid/resourcegroups/rg/providers/Microsoft.HybridNetwork/publishers/TestPublisher/networkServiceDesignGroups/TestNetworkServiceDesignGroupName/networkServiceDesignVersions/1.0.0", - "idType": "Open" - }, - "siteReference": { - "id": "/subscriptions/subid/resourcegroups/contosorg1/providers/microsoft.hybridnetwork/sites/testSite" - } - }, - "sku": { - "name": "Standard" - } - }, - "resourceGroupName": "rg1", - "siteNetworkServiceName": "testSiteNetworkServiceName", - "subscriptionId": "subid" - }, - "responses": { - "200": { - "body": { - "name": "testSiteNetworkServiceName", - "type": "Microsoft.HybridNetwork/siteNetworkServices", - "id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.HybridNetwork/siteNetworkServices/testSiteNetworkServiceName", - "location": "westUs2", - "properties": { - "desiredStateConfigurationGroupValueReferences": { - "MyVM_Configuration": { - "id": "/subscriptions/subid/resourcegroups/contosorg1/providers/microsoft.hybridnetwork/configurationgroupvalues/MyVM_Configuration1" - } - }, - "networkServiceDesignGroupName": "testNetworkServiceDesignGroupName", - "networkServiceDesignVersionName": "1.0.1", - "networkServiceDesignVersionOfferingLocation": "eastus", - "networkServiceDesignVersionResourceReference": { - "id": "/subscriptions/subid/resourcegroups/rg/providers/Microsoft.HybridNetwork/publishers/testPublisher/networkServiceDesignGroups/testNetworkServiceDesignGroupName/networkServiceDesignVersions/1.0.1", - "idType": "Open" - }, - "provisioningState": "Accepted", - "publisherName": "testPublisher", - "publisherScope": "Public", - "siteReference": { - "id": "/subscriptions/subid/resourcegroups/contosorg1/providers/microsoft.hybridnetwork/sites/testSite" - } - }, - "sku": { - "name": "Standard", - "tier": "Standard" - }, - "systemData": { - "createdAt": "2020-01-01T17:18:19.1234567Z", - "createdBy": "user1", - "createdByType": "User", - "lastModifiedAt": "2020-01-02T17:18:19.1234567Z", - "lastModifiedBy": "user2", - "lastModifiedByType": "User" - } - } - }, - "201": { - "body": { - "name": "testSiteNetworkServiceName", - "type": "Microsoft.HybridNetwork/siteNetworkServices", - "id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.HybridNetwork/siteNetworkServices/testSiteNetworkServiceName", - "location": "westUs2", - "properties": { - "desiredStateConfigurationGroupValueReferences": { - "MyVM_Configuration": { - "id": "/subscriptions/subid/resourcegroups/contosorg1/providers/microsoft.hybridnetwork/configurationgroupvalues/MyVM_Configuration1" - } - }, - "networkServiceDesignGroupName": "testNetworkServiceDesignGroupName", - "networkServiceDesignVersionName": "1.0.1", - "networkServiceDesignVersionOfferingLocation": "eastus", - "networkServiceDesignVersionResourceReference": { - "id": "/subscriptions/subid/resourcegroups/rg/providers/Microsoft.HybridNetwork/publishers/testPublisher/networkServiceDesignGroups/testNetworkServiceDesignGroupName/networkServiceDesignVersions/1.0.1", - "idType": "Open" - }, - "provisioningState": "Accepted", - "publisherName": "testPublisher", - "publisherScope": "Public", - "siteReference": { - "id": "/subscriptions/subid/resourcegroups/contosorg1/providers/microsoft.hybridnetwork/sites/testSite" - } - }, - "sku": { - "name": "Standard", - "tier": "Standard" - }, - "systemData": { - "createdAt": "2020-01-01T17:18:19.1234567Z", - "createdBy": "user1", - "createdByType": "User", - "lastModifiedAt": "2020-01-02T17:18:19.1234567Z", - "lastModifiedBy": "user2", - "lastModifiedByType": "User" - } - } - } - }, - "operationId": "SiteNetworkServices_CreateOrUpdate", - "title": "Create site network service" -} diff --git a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/SiteNetworkServiceDelete.json b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/SiteNetworkServiceDelete.json deleted file mode 100644 index e2713608da..0000000000 --- a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/SiteNetworkServiceDelete.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "parameters": { - "api-version": "2025-03-30", - "resourceGroupName": "rg1", - "siteNetworkServiceName": "testSiteNetworkServiceName", - "subscriptionId": "subid" - }, - "responses": { - "202": { - "headers": { - "location": "https://management.azure.com/providers/microsoft.hybridnetwork/locations/EASTUS2EUAP/operationStatuses/0b37c625-7e7c-49c5-b86e-c817c85acb5d*B77A34159CA34A0BD446D3BC7EC120649181590DDF991982765DAC1A87491B2D?api-version=2021-05-01" - } - }, - "204": {} - }, - "operationId": "SiteNetworkServices_Delete", - "title": "Delete network site" -} diff --git a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/SiteNetworkServiceFirstPartyCreate.json b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/SiteNetworkServiceFirstPartyCreate.json deleted file mode 100644 index af4208538b..0000000000 --- a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/SiteNetworkServiceFirstPartyCreate.json +++ /dev/null @@ -1,110 +0,0 @@ -{ - "parameters": { - "api-version": "2025-03-30", - "parameters": { - "location": "westUs2", - "properties": { - "desiredStateConfigurationGroupValueReferences": { - "MyVM_Configuration": { - "id": "/subscriptions/subid/resourcegroups/contosorg1/providers/microsoft.hybridnetwork/configurationgroupvalues/MyVM_Configuration1" - } - }, - "networkServiceDesignVersionResourceReference": { - "id": "/subscriptions/subid/resourcegroups/rg/providers/Microsoft.HybridNetwork/publishers/TestPublisher/networkServiceDesignGroups/TestNetworkServiceDesignGroupName/networkServiceDesignVersions/1.0.0", - "idType": "Secret" - }, - "siteReference": { - "id": "/subscriptions/subid/resourcegroups/contosorg1/providers/microsoft.hybridnetwork/sites/testSite" - } - }, - "sku": { - "name": "Standard" - } - }, - "resourceGroupName": "rg1", - "siteNetworkServiceName": "testSiteNetworkServiceName", - "subscriptionId": "subid" - }, - "responses": { - "200": { - "body": { - "name": "testSiteNetworkServiceName", - "type": "Microsoft.HybridNetwork/siteNetworkServices", - "id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.HybridNetwork/siteNetworkServices/testSiteNetworkServiceName", - "location": "westUs2", - "properties": { - "desiredStateConfigurationGroupValueReferences": { - "MyVM_Configuration": { - "id": "/subscriptions/subid/resourcegroups/contosorg1/providers/microsoft.hybridnetwork/configurationgroupvalues/MyVM_Configuration1" - } - }, - "networkServiceDesignGroupName": "testNetworkServiceDesignGroupName", - "networkServiceDesignVersionName": "1.0.1", - "networkServiceDesignVersionOfferingLocation": "eastus", - "networkServiceDesignVersionResourceReference": { - "idType": "Secret" - }, - "provisioningState": "Accepted", - "publisherName": "testPublisher", - "publisherScope": "Public", - "siteReference": { - "id": "/subscriptions/subid/resourcegroups/contosorg1/providers/microsoft.hybridnetwork/sites/testSite" - } - }, - "sku": { - "name": "Standard", - "tier": "Standard" - }, - "systemData": { - "createdAt": "2020-01-01T17:18:19.1234567Z", - "createdBy": "user1", - "createdByType": "User", - "lastModifiedAt": "2020-01-02T17:18:19.1234567Z", - "lastModifiedBy": "user2", - "lastModifiedByType": "User" - } - } - }, - "201": { - "body": { - "name": "testSiteNetworkServiceName", - "type": "Microsoft.HybridNetwork/siteNetworkServices", - "id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.HybridNetwork/siteNetworkServices/testSiteNetworkServiceName", - "location": "westUs2", - "properties": { - "desiredStateConfigurationGroupValueReferences": { - "MyVM_Configuration": { - "id": "/subscriptions/subid/resourcegroups/contosorg1/providers/microsoft.hybridnetwork/configurationgroupvalues/MyVM_Configuration1" - } - }, - "networkServiceDesignGroupName": "testNetworkServiceDesignGroupName", - "networkServiceDesignVersionName": "1.0.1", - "networkServiceDesignVersionOfferingLocation": "eastus", - "networkServiceDesignVersionResourceReference": { - "idType": "Secret" - }, - "provisioningState": "Accepted", - "publisherName": "testPublisher", - "publisherScope": "Public", - "siteReference": { - "id": "/subscriptions/subid/resourcegroups/contosorg1/providers/microsoft.hybridnetwork/sites/testSite" - } - }, - "sku": { - "name": "Standard", - "tier": "Standard" - }, - "systemData": { - "createdAt": "2020-01-01T17:18:19.1234567Z", - "createdBy": "user1", - "createdByType": "User", - "lastModifiedAt": "2020-01-02T17:18:19.1234567Z", - "lastModifiedBy": "user2", - "lastModifiedByType": "User" - } - } - } - }, - "operationId": "SiteNetworkServices_CreateOrUpdate", - "title": "Create first party site network service" -} diff --git a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/SiteNetworkServiceGet.json b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/SiteNetworkServiceGet.json deleted file mode 100644 index e697dba324..0000000000 --- a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/SiteNetworkServiceGet.json +++ /dev/null @@ -1,52 +0,0 @@ -{ - "parameters": { - "api-version": "2025-03-30", - "resourceGroupName": "rg1", - "siteNetworkServiceName": "testSiteNetworkServiceName", - "subscriptionId": "subid" - }, - "responses": { - "200": { - "body": { - "name": "testSiteNetworkServiceName", - "type": "Microsoft.HybridNetwork/siteNetworkServices", - "id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.HybridNetwork/siteNetworkServices/testSiteNetworkServiceName", - "location": "westUs2", - "properties": { - "desiredStateConfigurationGroupValueReferences": { - "MyVM_Configuration": { - "id": "/subscriptions/subid/resourcegroups/contosorg1/providers/microsoft.hybridnetwork/configurationgroupvalues/MyVM_Configuration1" - } - }, - "networkServiceDesignGroupName": "testNetworkServiceDesignGroupName", - "networkServiceDesignVersionName": "1.0.1", - "networkServiceDesignVersionOfferingLocation": "eastus", - "networkServiceDesignVersionResourceReference": { - "id": "/subscriptions/subid/resourcegroups/rg/providers/Microsoft.HybridNetwork/publishers/testPublisher/networkServiceDesignGroups/testNetworkServiceDesignGroupName/networkServiceDesignVersions/1.0.1", - "idType": "Open" - }, - "provisioningState": "Accepted", - "publisherName": "testPublisher", - "publisherScope": "Public", - "siteReference": { - "id": "/subscriptions/subid/resourcegroups/contosorg1/providers/microsoft.hybridnetwork/sites/testSite" - } - }, - "sku": { - "name": "Standard", - "tier": "Standard" - }, - "systemData": { - "createdAt": "2020-01-01T17:18:19.1234567Z", - "createdBy": "user1", - "createdByType": "User", - "lastModifiedAt": "2020-01-02T17:18:19.1234567Z", - "lastModifiedBy": "user2", - "lastModifiedByType": "User" - } - } - } - }, - "operationId": "SiteNetworkServices_Get", - "title": "Get network site" -} diff --git a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/SiteNetworkServiceListByResourceGroup.json b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/SiteNetworkServiceListByResourceGroup.json deleted file mode 100644 index ad94f7dba2..0000000000 --- a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/SiteNetworkServiceListByResourceGroup.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "parameters": { - "api-version": "2025-03-30", - "resourceGroupName": "rg1", - "subscriptionId": "subid" - }, - "responses": { - "200": { - "body": { - "value": [ - { - "name": "testSiteNetworkServiceName", - "type": "Microsoft.HybridNetwork/siteNetworkServices", - "id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.HybridNetwork/siteNetworkServices/testSiteNetworkServiceName", - "location": "westUs2", - "properties": { - "desiredStateConfigurationGroupValueReferences": { - "MyVM_Configuration": { - "id": "/subscriptions/subid/resourcegroups/contosorg1/providers/microsoft.hybridnetwork/configurationgroupvalues/MyVM_Configuration1" - } - }, - "networkServiceDesignGroupName": "testNetworkServiceDesignGroupName", - "networkServiceDesignVersionName": "1.0.1", - "networkServiceDesignVersionOfferingLocation": "eastus", - "networkServiceDesignVersionResourceReference": { - "id": "/subscriptions/subid/resourcegroups/rg/providers/Microsoft.HybridNetwork/publishers/testPublisher/networkServiceDesignGroups/testNetworkServiceDesignGroupName/networkServiceDesignVersions/1.0.1", - "idType": "Open" - }, - "provisioningState": "Accepted", - "publisherName": "testPublisher", - "publisherScope": "Public", - "siteReference": { - "id": "/subscriptions/subid/resourcegroups/contosorg1/providers/microsoft.hybridnetwork/sites/testSite" - } - }, - "sku": { - "name": "Standard", - "tier": "Standard" - }, - "systemData": { - "createdAt": "2020-01-01T17:18:19.1234567Z", - "createdBy": "user1", - "createdByType": "User", - "lastModifiedAt": "2020-01-02T17:18:19.1234567Z", - "lastModifiedBy": "user2", - "lastModifiedByType": "User" - } - } - ] - } - } - }, - "operationId": "SiteNetworkServices_ListByResourceGroup", - "title": "List all network sites" -} diff --git a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/SiteNetworkServiceListBySubscription.json b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/SiteNetworkServiceListBySubscription.json deleted file mode 100644 index 09518741fc..0000000000 --- a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/SiteNetworkServiceListBySubscription.json +++ /dev/null @@ -1,54 +0,0 @@ -{ - "parameters": { - "api-version": "2025-03-30", - "subscriptionId": "subid" - }, - "responses": { - "200": { - "body": { - "value": [ - { - "name": "testSiteNetworkServiceName", - "type": "Microsoft.HybridNetwork/siteNetworkServices", - "id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.HybridNetwork/siteNetworkServices/testSiteNetworkServiceName", - "location": "westUs2", - "properties": { - "desiredStateConfigurationGroupValueReferences": { - "MyVM_Configuration": { - "id": "/subscriptions/subid/resourcegroups/contosorg1/providers/microsoft.hybridnetwork/configurationgroupvalues/MyVM_Configuration1" - } - }, - "networkServiceDesignGroupName": "testNetworkServiceDesignGroupName", - "networkServiceDesignVersionName": "1.0.1", - "networkServiceDesignVersionOfferingLocation": "eastus", - "networkServiceDesignVersionResourceReference": { - "id": "/subscriptions/subid/resourcegroups/rg/providers/Microsoft.HybridNetwork/publishers/testPublisher/networkServiceDesignGroups/testNetworkServiceDesignGroupName/networkServiceDesignVersions/1.0.1", - "idType": "Open" - }, - "provisioningState": "Accepted", - "publisherName": "testPublisher", - "publisherScope": "Public", - "siteReference": { - "id": "/subscriptions/subid/resourcegroups/contosorg1/providers/microsoft.hybridnetwork/sites/testSite" - } - }, - "sku": { - "name": "Standard", - "tier": "Standard" - }, - "systemData": { - "createdAt": "2020-01-01T17:18:19.1234567Z", - "createdBy": "user1", - "createdByType": "User", - "lastModifiedAt": "2020-01-02T17:18:19.1234567Z", - "lastModifiedBy": "user2", - "lastModifiedByType": "User" - } - } - ] - } - } - }, - "operationId": "SiteNetworkServices_ListBySubscription", - "title": "List all hybrid network sites in a subscription." -} diff --git a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/SiteNetworkServiceUpdateTags.json b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/SiteNetworkServiceUpdateTags.json deleted file mode 100644 index 21b5eedc74..0000000000 --- a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/SiteNetworkServiceUpdateTags.json +++ /dev/null @@ -1,63 +0,0 @@ -{ - "parameters": { - "api-version": "2025-03-30", - "parameters": { - "tags": { - "tag1": "value1", - "tag2": "value2" - } - }, - "resourceGroupName": "rg1", - "siteName": "testSite", - "siteNetworkServiceName": "testSiteNetworkServiceName", - "subscriptionId": "subid" - }, - "responses": { - "200": { - "body": { - "name": "testSiteNetworkServiceName", - "type": "Microsoft.HybridNetwork/siteNetworkServices", - "id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.HybridNetwork/siteNetworkServices/testSiteNetworkServiceName", - "location": "westUs2", - "properties": { - "desiredStateConfigurationGroupValueReferences": { - "MyVM_Configuration": { - "id": "/subscriptions/subid/resourcegroups/contosorg1/providers/microsoft.hybridnetwork/configurationgroupvalues/MyVM_Configuration1" - } - }, - "networkServiceDesignGroupName": "testNetworkServiceDesignGroupName", - "networkServiceDesignVersionName": "1.0.1", - "networkServiceDesignVersionOfferingLocation": "eastus", - "networkServiceDesignVersionResourceReference": { - "id": "/subscriptions/subid/resourcegroups/rg/providers/Microsoft.HybridNetwork/publishers/testPublisher/networkServiceDesignGroups/testNetworkServiceDesignGroupName/networkServiceDesignVersions/1.0.1", - "idType": "Open" - }, - "provisioningState": "Accepted", - "publisherName": "testPublisher", - "publisherScope": "Public", - "siteReference": { - "id": "/subscriptions/subid/resourcegroups/contosorg1/providers/microsoft.hybridnetwork/sites/testSite" - } - }, - "sku": { - "name": "Standard", - "tier": "Standard" - }, - "systemData": { - "createdAt": "2020-01-01T17:18:19.1234567Z", - "createdBy": "user1", - "createdByType": "User", - "lastModifiedAt": "2020-01-02T17:18:19.1234567Z", - "lastModifiedBy": "user2", - "lastModifiedByType": "User" - }, - "tags": { - "tag1": "value1", - "tag2": "value2" - } - } - } - }, - "operationId": "SiteNetworkServices_UpdateTags", - "title": "Update network site tags" -} diff --git a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/SiteNetworkServicesCancelOngoingPUTOperation.json b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/SiteNetworkServicesCancelOngoingPUTOperation.json deleted file mode 100644 index 6921a5c74a..0000000000 --- a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/SiteNetworkServicesCancelOngoingPUTOperation.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "parameters": { - "api-version": "2025-03-30", - "parameters": { - "longRunningOperation": "Put", - "siteNetworkServiceReference": { - "id": "/subscriptions/sub1/resourceGroups/rg/providers/Microsoft.HybridNetwork/siteNetworkServices/TestSNS1" - } - }, - "subscriptionId": "sub1" - }, - "responses": { - "202": { - "headers": { - "Location": "https://management.azure.com/providers/microsoft.hybridnetwork/locations/EASTUS2EUAP/operationStatuses/0b37c625-7e7c-49c5-b86e-c817c85acb5d*B77A34159CA34A0BD446D3BC7EC120649181590DDF991982765DAC1A87491B2D?api-version=2021-05-01" - } - } - }, - "operationId": "SiteNetworkServices_CancelOperation", - "title": "Cancel an in progress SNS PUT " -} diff --git a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/SiteUpdateTags.json b/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/SiteUpdateTags.json deleted file mode 100644 index d9a5d6e5e3..0000000000 --- a/packages/typespec-test/test/HybridNetwork.Management/examples/2025-03-30/SiteUpdateTags.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "parameters": { - "api-version": "2025-03-30", - "parameters": { - "tags": { - "tag1": "value1", - "tag2": "value2" - } - }, - "resourceGroupName": "rg1", - "siteName": "testSite", - "subscriptionId": "subid" - }, - "responses": { - "200": { - "body": { - "name": "testSite", - "type": "Microsoft.HybridNetwork/sites", - "id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.HybridNetwork/sites/testSite", - "location": "westUs2", - "properties": { - "nfvis": [ - { - "name": "azureWestUs2", - "location": "westUs2", - "nfviType": "AzureCore" - } - ], - "provisioningState": "Accepted" - }, - "systemData": { - "createdAt": "2020-01-01T17:18:19.1234567Z", - "createdBy": "user1", - "createdByType": "User", - "lastModifiedAt": "2020-01-02T17:18:19.1234567Z", - "lastModifiedBy": "user2", - "lastModifiedByType": "User" - }, - "tags": { - "tag1": "value1", - "tag2": "value2" - } - } - } - }, - "operationId": "Sites_UpdateTags", - "title": "Update network site tags" -} diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/sample.env b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/sample.env deleted file mode 100644 index 508439fc7d..0000000000 --- a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/sample.env +++ /dev/null @@ -1 +0,0 @@ -# Feel free to add your own environment variables. \ No newline at end of file diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/artifactManifestsCreateOrUpdateSample.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/artifactManifestsCreateOrUpdateSample.ts deleted file mode 100644 index a2409cd0b7..0000000000 --- a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/artifactManifestsCreateOrUpdateSample.ts +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { HybridNetworkManagementClient } from "@azure/arm-hybridnetwork"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to creates or updates a artifact manifest. - * - * @summary creates or updates a artifact manifest. - * x-ms-original-file: 2025-03-30/ArtifactManifestCreate.json - */ -async function createOrUpdateTheArtifactManifestResource(): Promise { - const credential = new DefaultAzureCredential(); - const subscriptionId = "subid"; - const client = new HybridNetworkManagementClient(credential, subscriptionId); - const result = await client.artifactManifests.createOrUpdate( - "rg", - "TestPublisher", - "TestArtifactStore", - "TestManifest", - { - location: "eastus", - properties: { - artifacts: [ - { artifactName: "fed-rbac", artifactType: "OCIArtifact", artifactVersion: "1.0.0" }, - { artifactName: "nginx", artifactType: "OCIArtifact", artifactVersion: "v1" }, - ], - }, - }, - ); - console.log(result); -} - -async function main(): Promise { - await createOrUpdateTheArtifactManifestResource(); -} - -main().catch(console.error); diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/artifactManifestsDeleteSample.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/artifactManifestsDeleteSample.ts deleted file mode 100644 index f43e5191c9..0000000000 --- a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/artifactManifestsDeleteSample.ts +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { HybridNetworkManagementClient } from "@azure/arm-hybridnetwork"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to deletes the specified artifact manifest. - * - * @summary deletes the specified artifact manifest. - * x-ms-original-file: 2025-03-30/ArtifactManifestDelete.json - */ -async function deleteAArtifactManifestResource(): Promise { - const credential = new DefaultAzureCredential(); - const subscriptionId = "subid"; - const client = new HybridNetworkManagementClient(credential, subscriptionId); - await client.artifactManifests.delete("rg", "TestPublisher", "TestArtifactStore", "TestManifest"); -} - -async function main(): Promise { - await deleteAArtifactManifestResource(); -} - -main().catch(console.error); diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/artifactManifestsGetSample.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/artifactManifestsGetSample.ts deleted file mode 100644 index f7e65f1324..0000000000 --- a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/artifactManifestsGetSample.ts +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { HybridNetworkManagementClient } from "@azure/arm-hybridnetwork"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to gets information about a artifact manifest resource. - * - * @summary gets information about a artifact manifest resource. - * x-ms-original-file: 2025-03-30/ArtifactManifestGet.json - */ -async function getAArtifactManifestResource(): Promise { - const credential = new DefaultAzureCredential(); - const subscriptionId = "subid"; - const client = new HybridNetworkManagementClient(credential, subscriptionId); - const result = await client.artifactManifests.get( - "rg", - "TestPublisher", - "TestArtifactStore", - "TestManifest", - ); - console.log(result); -} - -async function main(): Promise { - await getAArtifactManifestResource(); -} - -main().catch(console.error); diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/artifactManifestsListByArtifactStoreSample.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/artifactManifestsListByArtifactStoreSample.ts deleted file mode 100644 index bb23c1a113..0000000000 --- a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/artifactManifestsListByArtifactStoreSample.ts +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { HybridNetworkManagementClient } from "@azure/arm-hybridnetwork"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to gets information about the artifact manifest. - * - * @summary gets information about the artifact manifest. - * x-ms-original-file: 2025-03-30/ArtifactManifestListByArtifactStore.json - */ -async function getArtifactManifestListResource(): Promise { - const credential = new DefaultAzureCredential(); - const subscriptionId = "subid"; - const client = new HybridNetworkManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (const item of client.artifactManifests.listByArtifactStore( - "rg", - "TestPublisher", - "TestArtifactStore", - )) { - resArray.push(item); - } - - console.log(resArray); -} - -async function main(): Promise { - await getArtifactManifestListResource(); -} - -main().catch(console.error); diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/artifactManifestsListCredentialSample.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/artifactManifestsListCredentialSample.ts deleted file mode 100644 index 40543ec274..0000000000 --- a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/artifactManifestsListCredentialSample.ts +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { HybridNetworkManagementClient } from "@azure/arm-hybridnetwork"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to list credential for publishing artifacts defined in artifact manifest. - * - * @summary list credential for publishing artifacts defined in artifact manifest. - * x-ms-original-file: 2025-03-30/ArtifactManifestListCredential.json - */ -async function listACredentialForArtifactManifest(): Promise { - const credential = new DefaultAzureCredential(); - const subscriptionId = "subid"; - const client = new HybridNetworkManagementClient(credential, subscriptionId); - const result = await client.artifactManifests.listCredential( - "rg", - "TestPublisher", - "TestArtifactStore", - "TestArtifactManifestName", - ); - console.log(result); -} - -async function main(): Promise { - await listACredentialForArtifactManifest(); -} - -main().catch(console.error); diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/artifactManifestsUpdateSample.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/artifactManifestsUpdateSample.ts deleted file mode 100644 index cf81c0ae83..0000000000 --- a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/artifactManifestsUpdateSample.ts +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { HybridNetworkManagementClient } from "@azure/arm-hybridnetwork"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to updates a artifact manifest resource. - * - * @summary updates a artifact manifest resource. - * x-ms-original-file: 2025-03-30/ArtifactManifestUpdateTags.json - */ -async function updateAArtifactManifestResourceTags(): Promise { - const credential = new DefaultAzureCredential(); - const subscriptionId = "subid"; - const client = new HybridNetworkManagementClient(credential, subscriptionId); - const result = await client.artifactManifests.update( - "rg", - "TestPublisher", - "TestArtifactStore", - "TestManifest", - { tags: { tag1: "value1", tag2: "value2" } }, - ); - console.log(result); -} - -async function main(): Promise { - await updateAArtifactManifestResourceTags(); -} - -main().catch(console.error); diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/artifactManifestsUpdateStateSample.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/artifactManifestsUpdateStateSample.ts deleted file mode 100644 index 6061115f54..0000000000 --- a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/artifactManifestsUpdateStateSample.ts +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { HybridNetworkManagementClient } from "@azure/arm-hybridnetwork"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to update state for artifact manifest. - * - * @summary update state for artifact manifest. - * x-ms-original-file: 2025-03-30/ArtifactManifestUpdateState.json - */ -async function updateArtifactManifestState(): Promise { - const credential = new DefaultAzureCredential(); - const subscriptionId = "subid"; - const client = new HybridNetworkManagementClient(credential, subscriptionId); - const result = await client.artifactManifests.updateState( - "rg", - "TestPublisher", - "TestArtifactStore", - "TestArtifactManifestName", - { artifactManifestState: "Uploaded" }, - ); - console.log(result); -} - -async function main(): Promise { - await updateArtifactManifestState(); -} - -main().catch(console.error); diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/artifactStoresAddNetworkFabricControllerEndPointsSample.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/artifactStoresAddNetworkFabricControllerEndPointsSample.ts deleted file mode 100644 index 1e4614eb22..0000000000 --- a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/artifactStoresAddNetworkFabricControllerEndPointsSample.ts +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { HybridNetworkManagementClient } from "@azure/arm-hybridnetwork"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to add network fabric controllers to artifact stores - * - * @summary add network fabric controllers to artifact stores - * x-ms-original-file: 2025-03-30/ArtifactStoreAddNFCEndPoints.json - */ -async function addNetworkFabricEndpoint(): Promise { - const credential = new DefaultAzureCredential(); - const subscriptionId = "subid"; - const client = new HybridNetworkManagementClient(credential, subscriptionId); - await client.artifactStores.addNetworkFabricControllerEndPoints( - "rg", - "TestPublisher", - "TestArtifactStore", - { - networkFabricControllerIds: [ - { - id: "/subscriptions/testsubid/resourceGroups/testNFCMRG/providers/Microsoft.ManagedNetworkFabric/networkFabricControllers/testNFCControllerId", - }, - ], - }, - ); -} - -async function main(): Promise { - await addNetworkFabricEndpoint(); -} - -main().catch(console.error); diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/artifactStoresApprovePrivateEndPointsSample.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/artifactStoresApprovePrivateEndPointsSample.ts deleted file mode 100644 index 33fccff51c..0000000000 --- a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/artifactStoresApprovePrivateEndPointsSample.ts +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { HybridNetworkManagementClient } from "@azure/arm-hybridnetwork"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to approve manual private endpoints on artifact stores - * - * @summary approve manual private endpoints on artifact stores - * x-ms-original-file: 2025-03-30/ArtifactStoreApprovePrivateEndPoints.json - */ -async function approveManualPrivateEndpoints(): Promise { - const credential = new DefaultAzureCredential(); - const subscriptionId = "subid"; - const client = new HybridNetworkManagementClient(credential, subscriptionId); - await client.artifactStores.approvePrivateEndPoints("rg", "TestPublisher", "TestArtifactStore", { - manualPrivateEndPointConnections: [ - { - id: "/subscriptions/testSub/resourceGroups/testRG/providers/Microsoft.Network/privateEndpoints/newpetest", - }, - ], - }); -} - -async function main(): Promise { - await approveManualPrivateEndpoints(); -} - -main().catch(console.error); diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/artifactStoresCreateOrUpdateSample.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/artifactStoresCreateOrUpdateSample.ts deleted file mode 100644 index 08d1d9259b..0000000000 --- a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/artifactStoresCreateOrUpdateSample.ts +++ /dev/null @@ -1,93 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { HybridNetworkManagementClient } from "@azure/arm-hybridnetwork"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to creates or updates a artifact store. - * - * @summary creates or updates a artifact store. - * x-ms-original-file: 2025-03-30/ArtifactStoreCreate.json - */ -async function createOrUpdateAnArtifactStoreOfPublisherResource(): Promise { - const credential = new DefaultAzureCredential(); - const subscriptionId = "subid"; - const client = new HybridNetworkManagementClient(credential, subscriptionId); - const result = await client.artifactStores.createOrUpdate( - "rg", - "TestPublisher", - "TestArtifactStore", - { - location: "eastus", - properties: { - managedResourceGroupConfiguration: { name: "testRg", location: "eastus" }, - replicationStrategy: "SingleReplication", - storeType: "AzureContainerRegistry", - }, - }, - ); - console.log(result); -} - -/** - * This sample demonstrates how to creates or updates a artifact store. - * - * @summary creates or updates a artifact store. - * x-ms-original-file: 2025-03-30/ArtifactStoreCreateContainer.json - */ -async function createOrUpdateAnArtifactStoreOfPublisherResourceWithContainerRegistry(): Promise { - const credential = new DefaultAzureCredential(); - const subscriptionId = "subid"; - const client = new HybridNetworkManagementClient(credential, subscriptionId); - const result = await client.artifactStores.createOrUpdate( - "rg", - "TestPublisher", - "TestArtifactStore", - { - location: "eastus", - properties: { - backingResourcePublicNetworkAccess: "Disabled", - managedResourceGroupConfiguration: { name: "testRg", location: "eastus" }, - replicationStrategy: "SingleReplication", - storeType: "AzureContainerRegistry", - }, - }, - ); - console.log(result); -} - -/** - * This sample demonstrates how to creates or updates a artifact store. - * - * @summary creates or updates a artifact store. - * x-ms-original-file: 2025-03-30/ArtifactStoreCreateStorage.json - */ -async function createOrUpdateAnArtifactStoreOfPublisherResourceWithStorage(): Promise { - const credential = new DefaultAzureCredential(); - const subscriptionId = "subid"; - const client = new HybridNetworkManagementClient(credential, subscriptionId); - const result = await client.artifactStores.createOrUpdate( - "rg", - "TestPublisher", - "TestArtifactStore", - { - location: "eastus", - properties: { - backingResourcePublicNetworkAccess: "Enabled", - managedResourceGroupConfiguration: { name: "testRg", location: "eastus" }, - replicationStrategy: "SingleReplication", - storeType: "AzureStorageAccount", - }, - }, - ); - console.log(result); -} - -async function main(): Promise { - await createOrUpdateAnArtifactStoreOfPublisherResource(); - await createOrUpdateAnArtifactStoreOfPublisherResourceWithContainerRegistry(); - await createOrUpdateAnArtifactStoreOfPublisherResourceWithStorage(); -} - -main().catch(console.error); diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/artifactStoresDeleteNetworkFabricControllerEndPointsSample.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/artifactStoresDeleteNetworkFabricControllerEndPointsSample.ts deleted file mode 100644 index 1efb4d7320..0000000000 --- a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/artifactStoresDeleteNetworkFabricControllerEndPointsSample.ts +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { HybridNetworkManagementClient } from "@azure/arm-hybridnetwork"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to delete network fabric controllers on artifact stores - * - * @summary delete network fabric controllers on artifact stores - * x-ms-original-file: 2025-03-30/ArtifactStoreDeleteNFCEndPoints.json - */ -async function deleteNetworkFabricEndpoints(): Promise { - const credential = new DefaultAzureCredential(); - const subscriptionId = "subid"; - const client = new HybridNetworkManagementClient(credential, subscriptionId); - await client.artifactStores.deleteNetworkFabricControllerEndPoints( - "rg", - "TestPublisher", - "TestArtifactStore", - { - networkFabricControllerIds: [ - { - id: "/subscriptions/testsubid/resourceGroups/testNFCMRG/providers/Microsoft.ManagedNetworkFabric/networkFabricControllers/testNFCControllerId", - }, - ], - }, - ); -} - -async function main(): Promise { - await deleteNetworkFabricEndpoints(); -} - -main().catch(console.error); diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/artifactStoresDeleteSample.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/artifactStoresDeleteSample.ts deleted file mode 100644 index 1d0bcf5007..0000000000 --- a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/artifactStoresDeleteSample.ts +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { HybridNetworkManagementClient } from "@azure/arm-hybridnetwork"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to deletes the specified artifact store. - * - * @summary deletes the specified artifact store. - * x-ms-original-file: 2025-03-30/ArtifactStoreDelete.json - */ -async function deleteAArtifactStoreOfPublisherResource(): Promise { - const credential = new DefaultAzureCredential(); - const subscriptionId = "subid"; - const client = new HybridNetworkManagementClient(credential, subscriptionId); - await client.artifactStores.delete("rg", "TestPublisher", "TestArtifactStore"); -} - -async function main(): Promise { - await deleteAArtifactStoreOfPublisherResource(); -} - -main().catch(console.error); diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/artifactStoresGetSample.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/artifactStoresGetSample.ts deleted file mode 100644 index 4d4f02b366..0000000000 --- a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/artifactStoresGetSample.ts +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { HybridNetworkManagementClient } from "@azure/arm-hybridnetwork"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to gets information about the specified artifact store. - * - * @summary gets information about the specified artifact store. - * x-ms-original-file: 2025-03-30/ArtifactStoreGet.json - */ -async function getAArtifactStoreResource(): Promise { - const credential = new DefaultAzureCredential(); - const subscriptionId = "subid"; - const client = new HybridNetworkManagementClient(credential, subscriptionId); - const result = await client.artifactStores.get("rg", "TestPublisher", "TestArtifactStoreName"); - console.log(result); -} - -async function main(): Promise { - await getAArtifactStoreResource(); -} - -main().catch(console.error); diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/artifactStoresListByPublisherSample.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/artifactStoresListByPublisherSample.ts deleted file mode 100644 index 886df7ff9e..0000000000 --- a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/artifactStoresListByPublisherSample.ts +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { HybridNetworkManagementClient } from "@azure/arm-hybridnetwork"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to gets information of the ArtifactStores under publisher. - * - * @summary gets information of the ArtifactStores under publisher. - * x-ms-original-file: 2025-03-30/ArtifactStoresListByPublisherName.json - */ -async function getApplicationGroupsUnderAPublisherResource(): Promise { - const credential = new DefaultAzureCredential(); - const subscriptionId = "subid"; - const client = new HybridNetworkManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (const item of client.artifactStores.listByPublisher("rg", "TestPublisher")) { - resArray.push(item); - } - - console.log(resArray); -} - -async function main(): Promise { - await getApplicationGroupsUnderAPublisherResource(); -} - -main().catch(console.error); diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/artifactStoresListNetworkFabricControllerPrivateEndPointsSample.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/artifactStoresListNetworkFabricControllerPrivateEndPointsSample.ts deleted file mode 100644 index bb69b379c4..0000000000 --- a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/artifactStoresListNetworkFabricControllerPrivateEndPointsSample.ts +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { HybridNetworkManagementClient } from "@azure/arm-hybridnetwork"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to list network fabric controllers to artifact stores - * - * @summary list network fabric controllers to artifact stores - * x-ms-original-file: 2025-03-30/ArtifactStoreListNFCEndPoints.json - */ -async function listNetworkFabricEndpoints(): Promise { - const credential = new DefaultAzureCredential(); - const subscriptionId = "subid"; - const client = new HybridNetworkManagementClient(credential, subscriptionId); - const result = await client.artifactStores.listNetworkFabricControllerPrivateEndPoints( - "rg", - "TestPublisher", - "TestArtifactStore", - ); - console.log(result); -} - -async function main(): Promise { - await listNetworkFabricEndpoints(); -} - -main().catch(console.error); diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/artifactStoresListPrivateEndPointsSample.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/artifactStoresListPrivateEndPointsSample.ts deleted file mode 100644 index 4404e3489e..0000000000 --- a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/artifactStoresListPrivateEndPointsSample.ts +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { HybridNetworkManagementClient } from "@azure/arm-hybridnetwork"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to list manual private endpoints on artifact stores - * - * @summary list manual private endpoints on artifact stores - * x-ms-original-file: 2025-03-30/ArtifactStoreListPrivateEndPoints.json - */ -async function listManualPrivateEndpoints(): Promise { - const credential = new DefaultAzureCredential(); - const subscriptionId = "subid"; - const client = new HybridNetworkManagementClient(credential, subscriptionId); - const result = await client.artifactStores.listPrivateEndPoints( - "rg", - "TestPublisher", - "TestArtifactStore", - ); - console.log(result); -} - -async function main(): Promise { - await listManualPrivateEndpoints(); -} - -main().catch(console.error); diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/artifactStoresRemovePrivateEndPointsSample.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/artifactStoresRemovePrivateEndPointsSample.ts deleted file mode 100644 index e3c1e20d02..0000000000 --- a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/artifactStoresRemovePrivateEndPointsSample.ts +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { HybridNetworkManagementClient } from "@azure/arm-hybridnetwork"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to remove manual private endpoints on artifact stores - * - * @summary remove manual private endpoints on artifact stores - * x-ms-original-file: 2025-03-30/ArtifactStoreRemovePrivateEndPoints.json - */ -async function removeManualEndpoint(): Promise { - const credential = new DefaultAzureCredential(); - const subscriptionId = "subid"; - const client = new HybridNetworkManagementClient(credential, subscriptionId); - await client.artifactStores.removePrivateEndPoints("rg", "TestPublisher", "TestArtifactStore", { - manualPrivateEndPointConnections: [ - { - id: "/subscriptions/testSub/resourceGroups/testRG/providers/Microsoft.Network/privateEndpoints/newpetest", - }, - ], - }); -} - -async function main(): Promise { - await removeManualEndpoint(); -} - -main().catch(console.error); diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/artifactStoresUpdateSample.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/artifactStoresUpdateSample.ts deleted file mode 100644 index 2bb20c620a..0000000000 --- a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/artifactStoresUpdateSample.ts +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { HybridNetworkManagementClient } from "@azure/arm-hybridnetwork"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to update artifact store resource. - * - * @summary update artifact store resource. - * x-ms-original-file: 2025-03-30/ArtifactStoreUpdateTags.json - */ -async function updateArtifactStoreResourceTags(): Promise { - const credential = new DefaultAzureCredential(); - const subscriptionId = "subid"; - const client = new HybridNetworkManagementClient(credential, subscriptionId); - const result = await client.artifactStores.update("rg", "TestPublisher", "TestArtifactStore", { - tags: { tag1: "value1", tag2: "value2" }, - }); - console.log(result); -} - -async function main(): Promise { - await updateArtifactStoreResourceTags(); -} - -main().catch(console.error); diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/componentsGetSample.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/componentsGetSample.ts deleted file mode 100644 index 1258b6a870..0000000000 --- a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/componentsGetSample.ts +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { HybridNetworkManagementClient } from "@azure/arm-hybridnetwork"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to gets information about the specified application instance resource. - * - * @summary gets information about the specified application instance resource. - * x-ms-original-file: 2025-03-30/ComponentGet.json - */ -async function getComponentResource(): Promise { - const credential = new DefaultAzureCredential(); - const subscriptionId = "subid"; - const client = new HybridNetworkManagementClient(credential, subscriptionId); - const result = await client.components.get("rg", "testNf", "testComponent"); - console.log(result); -} - -async function main(): Promise { - await getComponentResource(); -} - -main().catch(console.error); diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/componentsListByNetworkFunctionSample.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/componentsListByNetworkFunctionSample.ts deleted file mode 100644 index d59853f195..0000000000 --- a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/componentsListByNetworkFunctionSample.ts +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { HybridNetworkManagementClient } from "@azure/arm-hybridnetwork"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to lists all the component resources in a network function. - * - * @summary lists all the component resources in a network function. - * x-ms-original-file: 2025-03-30/ComponentListByNetworkFunction.json - */ -async function listComponentsInNetworkFunction(): Promise { - const credential = new DefaultAzureCredential(); - const subscriptionId = "subid"; - const client = new HybridNetworkManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (const item of client.components.listByNetworkFunction("rg", "testNf")) { - resArray.push(item); - } - - console.log(resArray); -} - -async function main(): Promise { - await listComponentsInNetworkFunction(); -} - -main().catch(console.error); diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/configurationGroupSchemasCreateOrUpdateSample.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/configurationGroupSchemasCreateOrUpdateSample.ts deleted file mode 100644 index 4bee4af5db..0000000000 --- a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/configurationGroupSchemasCreateOrUpdateSample.ts +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { HybridNetworkManagementClient } from "@azure/arm-hybridnetwork"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to creates or updates a configuration group schema. - * - * @summary creates or updates a configuration group schema. - * x-ms-original-file: 2025-03-30/ConfigurationGroupSchemaCreate.json - */ -async function createOrUpdateTheNetworkFunctionDefinitionGroup(): Promise { - const credential = new DefaultAzureCredential(); - const subscriptionId = "subid"; - const client = new HybridNetworkManagementClient(credential, subscriptionId); - const result = await client.configurationGroupSchemas.createOrUpdate( - "rg1", - "testPublisher", - "testConfigurationGroupSchema", - { - location: "westUs2", - properties: { - description: "Schema with no secrets", - schemaDefinition: - '{"type":"object","properties":{"interconnect-groups":{"type":"object","properties":{"type":"object","properties":{"name":{"type":"string"},"international-interconnects":{"type":"array","item":{"type":"string"}},"domestic-interconnects":{"type":"array","item":{"type":"string"}}}}},"interconnect-group-assignments":{"type":"object","properties":{"type":"object","properties":{"ssc":{"type":"string"},"interconnects-interconnects":{"type":"string"}}}}},"required":["interconnect-groups","interconnect-group-assignments"]}', - }, - }, - ); - console.log(result); -} - -async function main(): Promise { - await createOrUpdateTheNetworkFunctionDefinitionGroup(); -} - -main().catch(console.error); diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/configurationGroupSchemasDeleteSample.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/configurationGroupSchemasDeleteSample.ts deleted file mode 100644 index 91e88a65a9..0000000000 --- a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/configurationGroupSchemasDeleteSample.ts +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { HybridNetworkManagementClient } from "@azure/arm-hybridnetwork"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to deletes a specified configuration group schema. - * - * @summary deletes a specified configuration group schema. - * x-ms-original-file: 2025-03-30/ConfigurationGroupSchemaDelete.json - */ -async function deleteANetworkFunctionGroupResource(): Promise { - const credential = new DefaultAzureCredential(); - const subscriptionId = "subid"; - const client = new HybridNetworkManagementClient(credential, subscriptionId); - await client.configurationGroupSchemas.delete( - "rg1", - "testPublisher", - "testConfigurationGroupSchema", - ); -} - -async function main(): Promise { - await deleteANetworkFunctionGroupResource(); -} - -main().catch(console.error); diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/configurationGroupSchemasGetSample.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/configurationGroupSchemasGetSample.ts deleted file mode 100644 index b2d4c203f8..0000000000 --- a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/configurationGroupSchemasGetSample.ts +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { HybridNetworkManagementClient } from "@azure/arm-hybridnetwork"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to gets information about the specified configuration group schema. - * - * @summary gets information about the specified configuration group schema. - * x-ms-original-file: 2025-03-30/ConfigurationGroupSchemaGet.json - */ -async function getANetworkFunctionDefinitionGroupResource(): Promise { - const credential = new DefaultAzureCredential(); - const subscriptionId = "subid"; - const client = new HybridNetworkManagementClient(credential, subscriptionId); - const result = await client.configurationGroupSchemas.get( - "rg1", - "testPublisher", - "testConfigurationGroupSchema", - ); - console.log(result); -} - -async function main(): Promise { - await getANetworkFunctionDefinitionGroupResource(); -} - -main().catch(console.error); diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/configurationGroupSchemasListByPublisherSample.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/configurationGroupSchemasListByPublisherSample.ts deleted file mode 100644 index c89b1bb94e..0000000000 --- a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/configurationGroupSchemasListByPublisherSample.ts +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { HybridNetworkManagementClient } from "@azure/arm-hybridnetwork"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to gets information of the configuration group schemas under a publisher. - * - * @summary gets information of the configuration group schemas under a publisher. - * x-ms-original-file: 2025-03-30/ConfigurationGroupSchemaListByPublisherName.json - */ -async function getNetworkFunctionDefinitionGroupsUnderPublisherResource(): Promise { - const credential = new DefaultAzureCredential(); - const subscriptionId = "subid"; - const client = new HybridNetworkManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (const item of client.configurationGroupSchemas.listByPublisher( - "rg1", - "testPublisher", - )) { - resArray.push(item); - } - - console.log(resArray); -} - -async function main(): Promise { - await getNetworkFunctionDefinitionGroupsUnderPublisherResource(); -} - -main().catch(console.error); diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/configurationGroupSchemasUpdateSample.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/configurationGroupSchemasUpdateSample.ts deleted file mode 100644 index f4dd76616d..0000000000 --- a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/configurationGroupSchemasUpdateSample.ts +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { HybridNetworkManagementClient } from "@azure/arm-hybridnetwork"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to updates a configuration group schema resource. - * - * @summary updates a configuration group schema resource. - * x-ms-original-file: 2025-03-30/ConfigurationGroupSchemaUpdateTags.json - */ -async function createOrUpdateTheConfigurationGroupSchemaResource(): Promise { - const credential = new DefaultAzureCredential(); - const subscriptionId = "subid"; - const client = new HybridNetworkManagementClient(credential, subscriptionId); - const result = await client.configurationGroupSchemas.update( - "rg1", - "testPublisher", - "testConfigurationGroupSchema", - { tags: { tag1: "value1", tag2: "value2" } }, - ); - console.log(result); -} - -async function main(): Promise { - await createOrUpdateTheConfigurationGroupSchemaResource(); -} - -main().catch(console.error); diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/configurationGroupSchemasUpdateStateSample.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/configurationGroupSchemasUpdateStateSample.ts deleted file mode 100644 index ccb7c8c87c..0000000000 --- a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/configurationGroupSchemasUpdateStateSample.ts +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { HybridNetworkManagementClient } from "@azure/arm-hybridnetwork"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to update configuration group schema state. - * - * @summary update configuration group schema state. - * x-ms-original-file: 2025-03-30/ConfigurationGroupSchemaVersionUpdateState.json - */ -async function updateNetworkServiceDesignVersionState(): Promise { - const credential = new DefaultAzureCredential(); - const subscriptionId = "subid"; - const client = new HybridNetworkManagementClient(credential, subscriptionId); - const result = await client.configurationGroupSchemas.updateState( - "rg1", - "testPublisher", - "testConfigurationGroupSchema", - { versionState: "Active" }, - ); - console.log(result); -} - -async function main(): Promise { - await updateNetworkServiceDesignVersionState(); -} - -main().catch(console.error); diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/configurationGroupValuesCreateOrUpdateSample.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/configurationGroupValuesCreateOrUpdateSample.ts deleted file mode 100644 index dcf2010811..0000000000 --- a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/configurationGroupValuesCreateOrUpdateSample.ts +++ /dev/null @@ -1,100 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { HybridNetworkManagementClient } from "@azure/arm-hybridnetwork"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to creates or updates a hybrid configuration group value. - * - * @summary creates or updates a hybrid configuration group value. - * x-ms-original-file: 2025-03-30/ConfigurationGroupValueCreate.json - */ -async function createOrUpdateConfigurationGroupValue(): Promise { - const credential = new DefaultAzureCredential(); - const subscriptionId = "subid"; - const client = new HybridNetworkManagementClient(credential, subscriptionId); - const result = await client.configurationGroupValues.createOrUpdate( - "rg1", - "testConfigurationGroupValue", - { - location: "eastus", - properties: { - configurationGroupSchemaResourceReference: { - id: "/subscriptions/subid/resourcegroups/testRG/providers/microsoft.hybridnetwork/publishers/testPublisher/configurationGroupSchemas/testConfigurationGroupSchemaName", - idType: "Open", - }, - configurationType: "Open", - configurationValue: - '{"interconnect-groups":{"stripe-one":{"name":"Stripe one","international-interconnects":["france","germany"],"domestic-interconnects":["birmingham","edinburgh"]},"stripe-two":{"name":"Stripe two","international-interconnects":["germany","italy"],"domestic-interconnects":["edinburgh","london"]}},"interconnect-group-assignments":{"ssc-one":{"ssc":"SSC 1","interconnects":"stripe-one"},"ssc-two":{"ssc":"SSC 2","interconnects":"stripe-two"}}}', - }, - }, - ); - console.log(result); -} - -/** - * This sample demonstrates how to creates or updates a hybrid configuration group value. - * - * @summary creates or updates a hybrid configuration group value. - * x-ms-original-file: 2025-03-30/ConfigurationGroupValueCreateSecret.json - */ -async function createOrUpdateConfigurationGroupValueWithSecrets(): Promise { - const credential = new DefaultAzureCredential(); - const subscriptionId = "subid"; - const client = new HybridNetworkManagementClient(credential, subscriptionId); - const result = await client.configurationGroupValues.createOrUpdate( - "rg1", - "testConfigurationGroupValue", - { - location: "eastus", - properties: { - configurationGroupSchemaResourceReference: { - id: "/subscriptions/subid/resourcegroups/testRG/providers/microsoft.hybridnetwork/publishers/testPublisher/configurationGroupSchemas/testConfigurationGroupSchemaName", - idType: "Open", - }, - configurationType: "Secret", - secretConfigurationValue: - '{"interconnect-groups":{"stripe-one":{"name":"Stripe one","international-interconnects":["france","germany"],"domestic-interconnects":["birmingham","edinburgh"]},"stripe-two":{"name":"Stripe two","international-interconnects":["germany","italy"],"domestic-interconnects":["edinburgh","london"]}},"interconnect-group-assignments":{"ssc-one":{"ssc":"SSC 1","interconnects":"stripe-one"},"ssc-two":{"ssc":"SSC 2","interconnects":"stripe-two"}}}', - }, - }, - ); - console.log(result); -} - -/** - * This sample demonstrates how to creates or updates a hybrid configuration group value. - * - * @summary creates or updates a hybrid configuration group value. - * x-ms-original-file: 2025-03-30/ConfigurationGroupValueFirstPartyCreate.json - */ -async function createOrUpdateFirstPartyConfigurationGroupValue(): Promise { - const credential = new DefaultAzureCredential(); - const subscriptionId = "subid"; - const client = new HybridNetworkManagementClient(credential, subscriptionId); - const result = await client.configurationGroupValues.createOrUpdate( - "rg1", - "testConfigurationGroupValue", - { - location: "eastus", - properties: { - configurationGroupSchemaResourceReference: { - id: "/subscriptions/subid/resourcegroups/testRG/providers/microsoft.hybridnetwork/publishers/testPublisher/configurationGroupSchemas/testConfigurationGroupSchemaName", - idType: "Secret", - }, - configurationType: "Open", - configurationValue: - '{"interconnect-groups":{"stripe-one":{"name":"Stripe one","international-interconnects":["france","germany"],"domestic-interconnects":["birmingham","edinburgh"]},"stripe-two":{"name":"Stripe two","international-interconnects":["germany","italy"],"domestic-interconnects":["edinburgh","london"]}},"interconnect-group-assignments":{"ssc-one":{"ssc":"SSC 1","interconnects":"stripe-one"},"ssc-two":{"ssc":"SSC 2","interconnects":"stripe-two"}}}', - }, - }, - ); - console.log(result); -} - -async function main(): Promise { - await createOrUpdateConfigurationGroupValue(); - await createOrUpdateConfigurationGroupValueWithSecrets(); - await createOrUpdateFirstPartyConfigurationGroupValue(); -} - -main().catch(console.error); diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/configurationGroupValuesDeleteSample.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/configurationGroupValuesDeleteSample.ts deleted file mode 100644 index d4afc251dd..0000000000 --- a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/configurationGroupValuesDeleteSample.ts +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { HybridNetworkManagementClient } from "@azure/arm-hybridnetwork"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to deletes the specified hybrid configuration group value. - * - * @summary deletes the specified hybrid configuration group value. - * x-ms-original-file: 2025-03-30/ConfigurationGroupValueDelete.json - */ -async function deleteHybridConfigurationGroupResource(): Promise { - const credential = new DefaultAzureCredential(); - const subscriptionId = "subid"; - const client = new HybridNetworkManagementClient(credential, subscriptionId); - await client.configurationGroupValues.delete("rg1", "testConfigurationGroupValue"); -} - -async function main(): Promise { - await deleteHybridConfigurationGroupResource(); -} - -main().catch(console.error); diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/configurationGroupValuesGetSample.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/configurationGroupValuesGetSample.ts deleted file mode 100644 index e157bcff8a..0000000000 --- a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/configurationGroupValuesGetSample.ts +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { HybridNetworkManagementClient } from "@azure/arm-hybridnetwork"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to gets information about the specified hybrid configuration group values. - * - * @summary gets information about the specified hybrid configuration group values. - * x-ms-original-file: 2025-03-30/ConfigurationGroupValueGet.json - */ -async function getHybridConfigurationGroup(): Promise { - const credential = new DefaultAzureCredential(); - const subscriptionId = "subid"; - const client = new HybridNetworkManagementClient(credential, subscriptionId); - const result = await client.configurationGroupValues.get("rg1", "testConfigurationGroupValue"); - console.log(result); -} - -async function main(): Promise { - await getHybridConfigurationGroup(); -} - -main().catch(console.error); diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/configurationGroupValuesListByResourceGroupSample.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/configurationGroupValuesListByResourceGroupSample.ts deleted file mode 100644 index 89c613614d..0000000000 --- a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/configurationGroupValuesListByResourceGroupSample.ts +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { HybridNetworkManagementClient } from "@azure/arm-hybridnetwork"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to lists all the hybrid network configurationGroupValues in a resource group. - * - * @summary lists all the hybrid network configurationGroupValues in a resource group. - * x-ms-original-file: 2025-03-30/ConfigurationGroupValueListByResourceGroup.json - */ -async function listAllHybridNetworkConfigurationGroupValuesInASubscription(): Promise { - const credential = new DefaultAzureCredential(); - const subscriptionId = "subid"; - const client = new HybridNetworkManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (const item of client.configurationGroupValues.listByResourceGroup("rg1")) { - resArray.push(item); - } - - console.log(resArray); -} - -async function main(): Promise { - await listAllHybridNetworkConfigurationGroupValuesInASubscription(); -} - -main().catch(console.error); diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/configurationGroupValuesListBySubscriptionSample.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/configurationGroupValuesListBySubscriptionSample.ts deleted file mode 100644 index 5144e04a89..0000000000 --- a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/configurationGroupValuesListBySubscriptionSample.ts +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { HybridNetworkManagementClient } from "@azure/arm-hybridnetwork"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to lists all sites in the configuration group value in a subscription. - * - * @summary lists all sites in the configuration group value in a subscription. - * x-ms-original-file: 2025-03-30/ConfigurationGroupValueListBySubscription.json - */ -async function listAllHybridNetworkSitesInASubscription(): Promise { - const credential = new DefaultAzureCredential(); - const subscriptionId = "subid"; - const client = new HybridNetworkManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (const item of client.configurationGroupValues.listBySubscription()) { - resArray.push(item); - } - - console.log(resArray); -} - -async function main(): Promise { - await listAllHybridNetworkSitesInASubscription(); -} - -main().catch(console.error); diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/configurationGroupValuesUpdateTagsSample.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/configurationGroupValuesUpdateTagsSample.ts deleted file mode 100644 index c839f3e875..0000000000 --- a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/configurationGroupValuesUpdateTagsSample.ts +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { HybridNetworkManagementClient } from "@azure/arm-hybridnetwork"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to updates a hybrid configuration group tags. - * - * @summary updates a hybrid configuration group tags. - * x-ms-original-file: 2025-03-30/ConfigurationGroupValueUpdateTags.json - */ -async function updateHybridConfigurationGroupTags(): Promise { - const credential = new DefaultAzureCredential(); - const subscriptionId = "subid"; - const client = new HybridNetworkManagementClient(credential, subscriptionId); - const result = await client.configurationGroupValues.updateTags( - "rg1", - "testConfigurationGroupValue", - { tags: { tag1: "value1", tag2: "value2" } }, - ); - console.log(result); -} - -async function main(): Promise { - await updateHybridConfigurationGroupTags(); -} - -main().catch(console.error); diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/networkFunctionDefinitionGroupsCreateOrUpdateSample.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/networkFunctionDefinitionGroupsCreateOrUpdateSample.ts deleted file mode 100644 index e292b9655d..0000000000 --- a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/networkFunctionDefinitionGroupsCreateOrUpdateSample.ts +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { HybridNetworkManagementClient } from "@azure/arm-hybridnetwork"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to creates or updates a network function definition group. - * - * @summary creates or updates a network function definition group. - * x-ms-original-file: 2025-03-30/NetworkFunctionDefinitionGroupCreate.json - */ -async function createOrUpdateTheNetworkFunctionDefinitionGroup(): Promise { - const credential = new DefaultAzureCredential(); - const subscriptionId = "subid"; - const client = new HybridNetworkManagementClient(credential, subscriptionId); - const result = await client.networkFunctionDefinitionGroups.createOrUpdate( - "rg", - "TestPublisher", - "TestNetworkFunctionDefinitionGroupName", - { location: "eastus" }, - ); - console.log(result); -} - -async function main(): Promise { - await createOrUpdateTheNetworkFunctionDefinitionGroup(); -} - -main().catch(console.error); diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/networkFunctionDefinitionGroupsDeleteSample.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/networkFunctionDefinitionGroupsDeleteSample.ts deleted file mode 100644 index f0346356e2..0000000000 --- a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/networkFunctionDefinitionGroupsDeleteSample.ts +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { HybridNetworkManagementClient } from "@azure/arm-hybridnetwork"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to deletes a specified network function definition group. - * - * @summary deletes a specified network function definition group. - * x-ms-original-file: 2025-03-30/NetworkFunctionDefinitionGroupDelete.json - */ -async function deleteANetworkFunctionGroupResource(): Promise { - const credential = new DefaultAzureCredential(); - const subscriptionId = "subid"; - const client = new HybridNetworkManagementClient(credential, subscriptionId); - await client.networkFunctionDefinitionGroups.delete( - "rg", - "TestPublisher", - "TestNetworkFunctionDefinitionGroupName", - ); -} - -async function main(): Promise { - await deleteANetworkFunctionGroupResource(); -} - -main().catch(console.error); diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/networkFunctionDefinitionGroupsGetSample.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/networkFunctionDefinitionGroupsGetSample.ts deleted file mode 100644 index 1efe08451e..0000000000 --- a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/networkFunctionDefinitionGroupsGetSample.ts +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { HybridNetworkManagementClient } from "@azure/arm-hybridnetwork"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to gets information about the specified networkFunctionDefinition group. - * - * @summary gets information about the specified networkFunctionDefinition group. - * x-ms-original-file: 2025-03-30/NetworkFunctionDefinitionGroupGet.json - */ -async function getANetworkFunctionDefinitionGroupResource(): Promise { - const credential = new DefaultAzureCredential(); - const subscriptionId = "subid"; - const client = new HybridNetworkManagementClient(credential, subscriptionId); - const result = await client.networkFunctionDefinitionGroups.get( - "rg", - "TestPublisher", - "TestNetworkFunctionDefinitionGroupName", - ); - console.log(result); -} - -async function main(): Promise { - await getANetworkFunctionDefinitionGroupResource(); -} - -main().catch(console.error); diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/networkFunctionDefinitionGroupsListByPublisherSample.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/networkFunctionDefinitionGroupsListByPublisherSample.ts deleted file mode 100644 index d476288400..0000000000 --- a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/networkFunctionDefinitionGroupsListByPublisherSample.ts +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { HybridNetworkManagementClient } from "@azure/arm-hybridnetwork"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to gets information of the network function definition groups under a publisher. - * - * @summary gets information of the network function definition groups under a publisher. - * x-ms-original-file: 2025-03-30/NetworkFunctionDefinitionGroupsListByPublisherName.json - */ -async function getNetworkFunctionDefinitionGroupsUnderPublisherResource(): Promise { - const credential = new DefaultAzureCredential(); - const subscriptionId = "subid"; - const client = new HybridNetworkManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (const item of client.networkFunctionDefinitionGroups.listByPublisher( - "rg", - "TestPublisher", - )) { - resArray.push(item); - } - - console.log(resArray); -} - -async function main(): Promise { - await getNetworkFunctionDefinitionGroupsUnderPublisherResource(); -} - -main().catch(console.error); diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/networkFunctionDefinitionGroupsUpdateSample.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/networkFunctionDefinitionGroupsUpdateSample.ts deleted file mode 100644 index c22fae9c16..0000000000 --- a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/networkFunctionDefinitionGroupsUpdateSample.ts +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { HybridNetworkManagementClient } from "@azure/arm-hybridnetwork"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to updates a network function definition group resource. - * - * @summary updates a network function definition group resource. - * x-ms-original-file: 2025-03-30/NetworkFunctionDefinitionGroupUpdateTags.json - */ -async function createOrUpdateTheNetworkFunctionDefinitionGroupResource(): Promise { - const credential = new DefaultAzureCredential(); - const subscriptionId = "subid"; - const client = new HybridNetworkManagementClient(credential, subscriptionId); - const result = await client.networkFunctionDefinitionGroups.update( - "rg", - "TestPublisher", - "TestNetworkFunctionDefinitionGroupName", - { tags: { tag1: "value1", tag2: "value2" } }, - ); - console.log(result); -} - -async function main(): Promise { - await createOrUpdateTheNetworkFunctionDefinitionGroupResource(); -} - -main().catch(console.error); diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/networkFunctionDefinitionVersionsCreateOrUpdateSample.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/networkFunctionDefinitionVersionsCreateOrUpdateSample.ts deleted file mode 100644 index c5c1ac87e8..0000000000 --- a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/networkFunctionDefinitionVersionsCreateOrUpdateSample.ts +++ /dev/null @@ -1,235 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { HybridNetworkManagementClient } from "@azure/arm-hybridnetwork"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to creates or updates a network function definition version. - * - * @summary creates or updates a network function definition version. - * x-ms-original-file: 2025-03-30/AzureCore/VirtualNetworkFunctionDefinitionVersionCreate.json - */ -async function createOrUpdateANetworkFunctionDefinitionVersionResourceForAzureCoreVNF(): Promise { - const credential = new DefaultAzureCredential(); - const subscriptionId = "subid"; - const client = new HybridNetworkManagementClient(credential, subscriptionId); - const result = await client.networkFunctionDefinitionVersions.createOrUpdate( - "rg", - "TestPublisher", - "TestNetworkFunctionDefinitionGroupName", - "1.0.0", - { - location: "eastus", - properties: { - description: "test NFDV for AzureCore", - deployParameters: - '{"virtualMachineName":{"type":"string"},"cpuCores":{"type":"int"},"memorySizeGB":{"type":"int"},"cloudServicesNetworkAttachment":{"type":"object","properties":{"networkAttachmentName":{"type":"string"},"attachedNetworkId":{"type":"string"},"ipAllocationMethod":{"type":"string"},"ipv4Address":{"type":"string"},"ipv6Address":{"type":"string"},"defaultGateway":{"type":"string"}},"required":["attachedNetworkId","ipAllocationMethod"]},"networkAttachments":{"type":"array","items":{"type":"object","properties":{"networkAttachmentName":{"type":"string"},"attachedNetworkId":{"type":"string"},"ipAllocationMethod":{"type":"string"},"ipv4Address":{"type":"string"},"ipv6Address":{"type":"string"},"defaultGateway":{"type":"string"}},"required":["attachedNetworkId","ipAllocationMethod"]}},"storageProfile":{"type":"object","properties":{"osDisk":{"type":"object","properties":{"createOption":{"type":"string"},"deleteOption":{"type":"string"},"diskSizeGB":{"type":"integer"}},"required":["diskSizeGB"]}},"required":["osDisk"]},"sshPublicKeys":{"type":"array","items":{"type":"object","properties":{"keyData":{"type":"string"}},"required":["keyData"]}},"userData":{"type":"string"},"adminUsername":{"type":"string"},"bootMethod":{"type":"string","default":"UEFI","enum":["UEFI","BIOS"]},"isolateEmulatorThread":{"type":"string"},"virtioInterface":{"type":"string"},"placementHints":{"type":"array","items":{"type":"object","properties":{"hintType":{"type":"string","enum":["Affinity","AntiAffinity"]},"resourceId":{"type":"string"},"schedulingExecution":{"type":"string","enum":["Soft","Hard"]},"scope":{"type":"string"}},"required":["hintType","schedulingExecution","resourceId","scope"]}}}', - networkFunctionTemplate: { - networkFunctionApplications: [ - { - name: "testImageRole", - artifactProfile: { - artifactStore: { - id: "/subscriptions/subid/resourceGroups/rg/providers/microsoft.hybridnetwork/publishers/TestPublisher/artifactStores/TestArtifactStore", - }, - vhdArtifactProfile: { vhdName: "test-image", vhdVersion: "1-0-0" }, - }, - artifactType: "VhdImageFile", - dependsOnProfile: { - installDependsOn: [], - uninstallDependsOn: [], - updateDependsOn: [], - }, - deployParametersMappingRuleProfile: { - applicationEnablement: "Unknown", - vhdImageMappingRuleProfile: { userConfiguration: "" }, - }, - }, - { - name: "testTemplateRole", - artifactProfile: { - artifactStore: { - id: "/subscriptions/subid/resourceGroups/rg/providers/microsoft.hybridnetwork/publishers/TestPublisher/artifactStores/TestArtifactStore", - }, - templateArtifactProfile: { - templateName: "test-template", - templateVersion: "1.0.0", - }, - }, - artifactType: "ArmTemplate", - dependsOnProfile: { - installDependsOn: ["testImageRole"], - uninstallDependsOn: ["testImageRole"], - updateDependsOn: ["testImageRole"], - }, - deployParametersMappingRuleProfile: { - applicationEnablement: "Unknown", - templateMappingRuleProfile: { - templateParameters: - '{"virtualMachineName":"{deployParameters.virtualMachineName}","cpuCores":"{deployParameters.cpuCores}","memorySizeGB":"{deployParameters.memorySizeGB}","cloudServicesNetworkAttachment":"{deployParameters.cloudServicesNetworkAttachment}","networkAttachments":"{deployParameters.networkAttachments}","sshPublicKeys":"{deployParameters.sshPublicKeys}","storageProfile":"{deployParameters.storageProfile}","isolateEmulatorThread":"{deployParameters.isolateEmulatorThread}","virtioInterface":"{deployParameters.virtioInterface}","userData":"{deployParameters.userData}","adminUsername":"{deployParameters.adminUsername}","bootMethod":"{deployParameters.bootMethod}","placementHints":"{deployParameters.placementHints}"}', - }, - }, - }, - ], - nfviType: "AzureCore", - }, - networkFunctionType: "VirtualNetworkFunction", - versionState: "Preview", - }, - }, - ); - console.log(result); -} - -/** - * This sample demonstrates how to creates or updates a network function definition version. - * - * @summary creates or updates a network function definition version. - * x-ms-original-file: 2025-03-30/AzureOperatorNexus/VirtualNetworkFunctionDefinitionVersionCreate.json - */ -async function createOrUpdateANetworkFunctionDefinitionVersionResourceForAzureOperatorNexusVNF(): Promise { - const credential = new DefaultAzureCredential(); - const subscriptionId = "subid"; - const client = new HybridNetworkManagementClient(credential, subscriptionId); - const result = await client.networkFunctionDefinitionVersions.createOrUpdate( - "rg", - "TestPublisher", - "TestNetworkFunctionDefinitionGroupName", - "1.0.0", - { - location: "eastus", - properties: { - description: "test NFDV for AzureOperatorNexus", - deployParameters: - '{"virtualMachineName":{"type":"string"},"extendedLocationName":{"type":"string"},"cpuCores":{"type":"int"},"memorySizeGB":{"type":"int"},"cloudServicesNetworkAttachment":{"type":"object","properties":{"networkAttachmentName":{"type":"string"},"attachedNetworkId":{"type":"string"},"ipAllocationMethod":{"type":"string"},"ipv4Address":{"type":"string"},"ipv6Address":{"type":"string"},"defaultGateway":{"type":"string"}},"required":["attachedNetworkId","ipAllocationMethod"]},"networkAttachments":{"type":"array","items":{"type":"object","properties":{"networkAttachmentName":{"type":"string"},"attachedNetworkId":{"type":"string"},"ipAllocationMethod":{"type":"string"},"ipv4Address":{"type":"string"},"ipv6Address":{"type":"string"},"defaultGateway":{"type":"string"}},"required":["attachedNetworkId","ipAllocationMethod"]}},"storageProfile":{"type":"object","properties":{"osDisk":{"type":"object","properties":{"createOption":{"type":"string"},"deleteOption":{"type":"string"},"diskSizeGB":{"type":"integer"}},"required":["diskSizeGB"]}},"required":["osDisk"]},"sshPublicKeys":{"type":"array","items":{"type":"object","properties":{"keyData":{"type":"string"}},"required":["keyData"]}},"userData":{"type":"string"},"adminUsername":{"type":"string"},"bootMethod":{"type":"string","default":"UEFI","enum":["UEFI","BIOS"]},"isolateEmulatorThread":{"type":"string"},"virtioInterface":{"type":"string"},"placementHints":{"type":"array","items":{"type":"object","properties":{"hintType":{"type":"string","enum":["Affinity","AntiAffinity"]},"resourceId":{"type":"string"},"schedulingExecution":{"type":"string","enum":["Soft","Hard"]},"scope":{"type":"string"}},"required":["hintType","schedulingExecution","resourceId","scope"]}}}', - networkFunctionTemplate: { - networkFunctionApplications: [ - { - name: "testImageRole", - artifactProfile: { - artifactStore: { - id: "/subscriptions/subid/resourceGroups/rg/providers/microsoft.hybridnetwork/publishers/TestPublisher/artifactStores/TestArtifactStore", - }, - imageArtifactProfile: { imageName: "test-image", imageVersion: "1.0.0" }, - }, - artifactType: "ImageFile", - dependsOnProfile: { - installDependsOn: [], - uninstallDependsOn: [], - updateDependsOn: [], - }, - deployParametersMappingRuleProfile: { - applicationEnablement: "Unknown", - imageMappingRuleProfile: { userConfiguration: "" }, - }, - }, - { - name: "testTemplateRole", - artifactProfile: { - artifactStore: { - id: "/subscriptions/subid/resourceGroups/rg/providers/microsoft.hybridnetwork/publishers/TestPublisher/artifactStores/TestArtifactStore", - }, - templateArtifactProfile: { - templateName: "test-template", - templateVersion: "1.0.0", - }, - }, - artifactType: "ArmTemplate", - dependsOnProfile: { - installDependsOn: ["testImageRole"], - uninstallDependsOn: ["testImageRole"], - updateDependsOn: ["testImageRole"], - }, - deployParametersMappingRuleProfile: { - applicationEnablement: "Unknown", - templateMappingRuleProfile: { - templateParameters: - '{"virtualMachineName":"{deployParameters.virtualMachineName}","extendedLocationName":"{deployParameters.extendedLocationName}","cpuCores":"{deployParameters.cpuCores}","memorySizeGB":"{deployParameters.memorySizeGB}","cloudServicesNetworkAttachment":"{deployParameters.cloudServicesNetworkAttachment}","networkAttachments":"{deployParameters.networkAttachments}","sshPublicKeys":"{deployParameters.sshPublicKeys}","storageProfile":"{deployParameters.storageProfile}","isolateEmulatorThread":"{deployParameters.isolateEmulatorThread}","virtioInterface":"{deployParameters.virtioInterface}","userData":"{deployParameters.userData}","adminUsername":"{deployParameters.adminUsername}","bootMethod":"{deployParameters.bootMethod}","placementHints":"{deployParameters.placementHints}"}', - }, - }, - }, - ], - nfviType: "AzureOperatorNexus", - }, - networkFunctionType: "VirtualNetworkFunction", - versionState: "Preview", - }, - }, - ); - console.log(result); -} - -/** - * This sample demonstrates how to creates or updates a network function definition version. - * - * @summary creates or updates a network function definition version. - * x-ms-original-file: 2025-03-30/NetworkFunctionDefinitionVersionCreate.json - */ -async function createOrUpdateANetworkFunctionDefinitionVersionResource(): Promise { - const credential = new DefaultAzureCredential(); - const subscriptionId = "subid"; - const client = new HybridNetworkManagementClient(credential, subscriptionId); - const result = await client.networkFunctionDefinitionVersions.createOrUpdate( - "rg", - "TestPublisher", - "TestNetworkFunctionDefinitionGroupName", - "1.0.0", - { - location: "eastus", - properties: { - deployParameters: - '{"type":"object","properties":{"releaseName":{"type":"string"},"namespace":{"type":"string"}}}', - networkFunctionTemplate: { - networkFunctionApplications: [ - { - name: "fedrbac", - artifactProfile: { - artifactStore: { - id: "/subscriptions/subid/resourcegroups/rg/providers/microsoft.hybridnetwork/publishers/TestPublisher/artifactStores/testArtifactStore", - }, - helmArtifactProfile: { - helmPackageName: "fed-rbac", - helmPackageVersionRange: "~2.1.3", - imagePullSecretsValuesPaths: ["global.imagePullSecrets"], - registryValuesPaths: ["global.registry.docker.repoPath"], - }, - }, - artifactType: "HelmPackage", - dependsOnProfile: { - installDependsOn: [], - uninstallDependsOn: [], - updateDependsOn: [], - }, - deployParametersMappingRuleProfile: { - applicationEnablement: "Enabled", - helmMappingRuleProfile: { - helmPackageVersion: "2.1.3", - options: { - installOptions: { atomic: "true", timeout: "30", wait: "waitValue" }, - upgradeOptions: { atomic: "true", timeout: "30", wait: "waitValue" }, - }, - releaseName: "{deployParameters.releaseName}", - releaseNamespace: "{deployParameters.namesapce}", - values: "", - }, - }, - }, - ], - nfviType: "AzureArcKubernetes", - }, - networkFunctionType: "ContainerizedNetworkFunction", - versionState: "Active", - }, - }, - ); - console.log(result); -} - -async function main(): Promise { - await createOrUpdateANetworkFunctionDefinitionVersionResourceForAzureCoreVNF(); - await createOrUpdateANetworkFunctionDefinitionVersionResourceForAzureOperatorNexusVNF(); - await createOrUpdateANetworkFunctionDefinitionVersionResource(); -} - -main().catch(console.error); diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/networkFunctionDefinitionVersionsDeleteSample.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/networkFunctionDefinitionVersionsDeleteSample.ts deleted file mode 100644 index 02c1f48b40..0000000000 --- a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/networkFunctionDefinitionVersionsDeleteSample.ts +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { HybridNetworkManagementClient } from "@azure/arm-hybridnetwork"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to deletes the specified network function definition version. - * - * @summary deletes the specified network function definition version. - * x-ms-original-file: 2025-03-30/AzureCore/VirtualNetworkFunctionDefinitionVersionDelete.json - */ -async function deleteANetworkFunctionDefinitionVersionForAzureCoreVNF(): Promise { - const credential = new DefaultAzureCredential(); - const subscriptionId = "subid"; - const client = new HybridNetworkManagementClient(credential, subscriptionId); - await client.networkFunctionDefinitionVersions.delete( - "rg", - "TestPublisher", - "TestNetworkFunctionDefinitionGroupName", - "1.0.0", - ); -} - -/** - * This sample demonstrates how to deletes the specified network function definition version. - * - * @summary deletes the specified network function definition version. - * x-ms-original-file: 2025-03-30/AzureOperatorNexus/VirtualNetworkFunctionDefinitionVersionDelete.json - */ -async function deleteANetworkFunctionDefinitionVersionForAzureOperatorNexusVNF(): Promise { - const credential = new DefaultAzureCredential(); - const subscriptionId = "subid"; - const client = new HybridNetworkManagementClient(credential, subscriptionId); - await client.networkFunctionDefinitionVersions.delete( - "rg", - "TestPublisher", - "TestNetworkFunctionDefinitionGroupName", - "1.0.0", - ); -} - -/** - * This sample demonstrates how to deletes the specified network function definition version. - * - * @summary deletes the specified network function definition version. - * x-ms-original-file: 2025-03-30/NetworkFunctionDefinitionVersionDelete.json - */ -async function deleteANetworkFunctionDefinitionVersion(): Promise { - const credential = new DefaultAzureCredential(); - const subscriptionId = "subid"; - const client = new HybridNetworkManagementClient(credential, subscriptionId); - await client.networkFunctionDefinitionVersions.delete( - "rg", - "TestPublisher", - "TestNetworkFunctionDefinitionGroupName", - "1.0.0", - ); -} - -async function main(): Promise { - await deleteANetworkFunctionDefinitionVersionForAzureCoreVNF(); - await deleteANetworkFunctionDefinitionVersionForAzureOperatorNexusVNF(); - await deleteANetworkFunctionDefinitionVersion(); -} - -main().catch(console.error); diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/networkFunctionDefinitionVersionsGetSample.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/networkFunctionDefinitionVersionsGetSample.ts deleted file mode 100644 index c7e4d5f12c..0000000000 --- a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/networkFunctionDefinitionVersionsGetSample.ts +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { HybridNetworkManagementClient } from "@azure/arm-hybridnetwork"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to gets information about a network function definition version. - * - * @summary gets information about a network function definition version. - * x-ms-original-file: 2025-03-30/AzureCore/VirtualNetworkFunctionDefinitionVersionGet.json - */ -async function getNetworkFunctionDefinitionVersionResourceForAzureCoreVNF(): Promise { - const credential = new DefaultAzureCredential(); - const subscriptionId = "subid"; - const client = new HybridNetworkManagementClient(credential, subscriptionId); - const result = await client.networkFunctionDefinitionVersions.get( - "rg", - "TestPublisher", - "TestNetworkFunctionDefinitionGroupName", - "1.0.0", - ); - console.log(result); -} - -/** - * This sample demonstrates how to gets information about a network function definition version. - * - * @summary gets information about a network function definition version. - * x-ms-original-file: 2025-03-30/AzureOperatorNexus/VirtualNetworkFunctionDefinitionVersionGet.json - */ -async function getNetworkFunctionDefinitionVersionResourceForAzureOperatorNexusVNF(): Promise { - const credential = new DefaultAzureCredential(); - const subscriptionId = "subid"; - const client = new HybridNetworkManagementClient(credential, subscriptionId); - const result = await client.networkFunctionDefinitionVersions.get( - "rg", - "TestPublisher", - "TestNetworkFunctionDefinitionGroupName", - "1.0.0", - ); - console.log(result); -} - -/** - * This sample demonstrates how to gets information about a network function definition version. - * - * @summary gets information about a network function definition version. - * x-ms-original-file: 2025-03-30/NetworkFunctionDefinitionVersionGet.json - */ -async function getANetworkFunctionDefinitionVersionResource(): Promise { - const credential = new DefaultAzureCredential(); - const subscriptionId = "subid"; - const client = new HybridNetworkManagementClient(credential, subscriptionId); - const result = await client.networkFunctionDefinitionVersions.get( - "rg", - "TestPublisher", - "TestNetworkFunctionDefinitionGroupName", - "1.0.0", - ); - console.log(result); -} - -async function main(): Promise { - await getNetworkFunctionDefinitionVersionResourceForAzureCoreVNF(); - await getNetworkFunctionDefinitionVersionResourceForAzureOperatorNexusVNF(); - await getANetworkFunctionDefinitionVersionResource(); -} - -main().catch(console.error); diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/networkFunctionDefinitionVersionsListByNetworkFunctionDefinitionGroupSample.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/networkFunctionDefinitionVersionsListByNetworkFunctionDefinitionGroupSample.ts deleted file mode 100644 index fa49659835..0000000000 --- a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/networkFunctionDefinitionVersionsListByNetworkFunctionDefinitionGroupSample.ts +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { HybridNetworkManagementClient } from "@azure/arm-hybridnetwork"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to gets information about a list of network function definition versions under a network function definition group. - * - * @summary gets information about a list of network function definition versions under a network function definition group. - * x-ms-original-file: 2025-03-30/NetworkFunctionDefinitionVersionListByNetworkFunctionDefinitionGroup.json - */ -async function getPublisherResource(): Promise { - const credential = new DefaultAzureCredential(); - const subscriptionId = "subid"; - const client = new HybridNetworkManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (const item of client.networkFunctionDefinitionVersions.listByNetworkFunctionDefinitionGroup( - "rg", - "TestPublisher", - "TestNetworkFunctionDefinitionGroupNameName", - )) { - resArray.push(item); - } - - console.log(resArray); -} - -async function main(): Promise { - await getPublisherResource(); -} - -main().catch(console.error); diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/networkFunctionDefinitionVersionsUpdateSample.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/networkFunctionDefinitionVersionsUpdateSample.ts deleted file mode 100644 index 1b344149b8..0000000000 --- a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/networkFunctionDefinitionVersionsUpdateSample.ts +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { HybridNetworkManagementClient } from "@azure/arm-hybridnetwork"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to updates a network function definition version resource. - * - * @summary updates a network function definition version resource. - * x-ms-original-file: 2025-03-30/NetworkFunctionDefinitionVersionUpdateTags.json - */ -async function updateTheNetworkFunctionDefinitionVersionTags(): Promise { - const credential = new DefaultAzureCredential(); - const subscriptionId = "subid"; - const client = new HybridNetworkManagementClient(credential, subscriptionId); - const result = await client.networkFunctionDefinitionVersions.update( - "rg", - "TestPublisher", - "TestNetworkFunctionDefinitionGroupName", - "1.0.0", - { tags: { tag1: "value1", tag2: "value2" } }, - ); - console.log(result); -} - -async function main(): Promise { - await updateTheNetworkFunctionDefinitionVersionTags(); -} - -main().catch(console.error); diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/networkFunctionDefinitionVersionsUpdateStateSample.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/networkFunctionDefinitionVersionsUpdateStateSample.ts deleted file mode 100644 index 59040d35d5..0000000000 --- a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/networkFunctionDefinitionVersionsUpdateStateSample.ts +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { HybridNetworkManagementClient } from "@azure/arm-hybridnetwork"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to update network function definition version state. - * - * @summary update network function definition version state. - * x-ms-original-file: 2025-03-30/NetworkFunctionDefinitionVersionUpdateState.json - */ -async function updateNetworkFunctionDefinitionVersionState(): Promise { - const credential = new DefaultAzureCredential(); - const subscriptionId = "subid"; - const client = new HybridNetworkManagementClient(credential, subscriptionId); - const result = await client.networkFunctionDefinitionVersions.updateState( - "rg", - "TestPublisher", - "TestSkuGroup", - "1.0.0", - { versionState: "Active" }, - ); - console.log(result); -} - -async function main(): Promise { - await updateNetworkFunctionDefinitionVersionState(); -} - -main().catch(console.error); diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/networkFunctionsCreateOrUpdateSample.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/networkFunctionsCreateOrUpdateSample.ts deleted file mode 100644 index 4d2935f57e..0000000000 --- a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/networkFunctionsCreateOrUpdateSample.ts +++ /dev/null @@ -1,168 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { HybridNetworkManagementClient } from "@azure/arm-hybridnetwork"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to creates or updates a network function resource. - * - * @summary creates or updates a network function resource. - * x-ms-original-file: 2025-03-30/AzureCore/VirtualNetworkFunctionCreate.json - */ -async function createVirtualNetworkFunctionResourceOnAzureCore(): Promise { - const credential = new DefaultAzureCredential(); - const subscriptionId = "subid"; - const client = new HybridNetworkManagementClient(credential, subscriptionId); - const result = await client.networkFunctions.createOrUpdate("rg", "testNf", { - location: "eastus", - properties: { - allowSoftwareUpdate: false, - configurationType: "Open", - deploymentValues: - '{"virtualMachineName":"test-VM","cpuCores":4,"memorySizeGB":8,"cloudServicesNetworkAttachment":{"attachedNetworkId":"test-csnet","ipAllocationMethod":"Dynamic","networkAttachmentName":"test-cs-vlan"},"networkAttachments":[{"attachedNetworkId":"test-l3vlan","defaultGateway":"True","ipAllocationMethod":"Dynamic","networkAttachmentName":"test-vlan"}],"sshPublicKeys":[{"keyData":"ssh-rsa CMIIIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEA0TqlveKKlc2MFvEmuXJiLGBsY1t4ML4uiRADGSZlnc+7Ugv3h+MCjkkwOKiOdsNo8k4KSBIG5GcQfKYOOd17AJvqCL6cGQbaLuqv0a64jeDm8oO8/xN/IM0oKw7rMr/2oAJOgIsfeXPkRxWWic9AVIS++H5Qi2r7bUFX+cqFsyUCAwEBBQ=="}],"storageProfile":{"osDisk":{"createOption":"Ephemeral","deleteOption":"Delete","diskSizeGB":10}},"userData":"testUserData","adminUsername":"testUser","virtioInterface":"Transitional","isolateEmulatorThread":"False","bootMethod":"BIOS","placementHints":[]}', - networkFunctionDefinitionVersionResourceReference: { - id: "/subscriptions/subid/resourcegroups/rg/providers/Microsoft.HybridNetwork/publishers/testVendor/networkFunctionDefinitionGroups/testnetworkFunctionDefinitionGroupName/networkFunctionDefinitionVersions/1.0.1", - idType: "Open", - }, - nfviId: "/subscriptions/subid/resourceGroups/testResourceGroup", - nfviType: "AzureCore", - }, - }); - console.log(result); -} - -/** - * This sample demonstrates how to creates or updates a network function resource. - * - * @summary creates or updates a network function resource. - * x-ms-original-file: 2025-03-30/AzureOperatorNexus/VirtualNetworkFunctionCreate.json - */ -async function createVirtualNetworkFunctionResourceOnAzureOperatorNexus(): Promise { - const credential = new DefaultAzureCredential(); - const subscriptionId = "subid"; - const client = new HybridNetworkManagementClient(credential, subscriptionId); - const result = await client.networkFunctions.createOrUpdate("rg", "testNf", { - location: "eastus", - properties: { - allowSoftwareUpdate: false, - configurationType: "Open", - deploymentValues: - '{"virtualMachineName":"test-VM","extendedLocationName":"test-cluster","cpuCores":4,"memorySizeGB":8,"cloudServicesNetworkAttachment":{"attachedNetworkId":"test-csnet","ipAllocationMethod":"Dynamic","networkAttachmentName":"test-cs-vlan"},"networkAttachments":[{"attachedNetworkId":"test-l3vlan","defaultGateway":"True","ipAllocationMethod":"Dynamic","networkAttachmentName":"test-vlan"}],"sshPublicKeys":[{"keyData":"ssh-rsa CMIIIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEA0TqlveKKlc2MFvEmuXJiLGBsY1t4ML4uiRADGSZlnc+7Ugv3h+MCjkkwOKiOdsNo8k4KSBIG5GcQfKYOOd17AJvqCL6cGQbaLuqv0a64jeDm8oO8/xN/IM0oKw7rMr/2oAJOgIsfeXPkRxWWic9AVIS++H5Qi2r7bUFX+cqFsyUCAwEBBQ=="}],"storageProfile":{"osDisk":{"createOption":"Ephemeral","deleteOption":"Delete","diskSizeGB":10}},"userData":"testUserData","adminUsername":"testUser","virtioInterface":"Transitional","isolateEmulatorThread":"False","bootMethod":"BIOS","placementHints":[]}', - networkFunctionDefinitionVersionResourceReference: { - id: "/subscriptions/subid/resourcegroups/rg/providers/Microsoft.HybridNetwork/publishers/testVendor/networkFunctionDefinitionGroups/testnetworkFunctionDefinitionGroupName/networkFunctionDefinitionVersions/1.0.1", - idType: "Open", - }, - nfviId: - "/subscriptions/subid/resourceGroups/testResourceGroup/providers/Microsoft.ExtendedLocation/customLocations/testCustomLocation", - nfviType: "AzureOperatorNexus", - }, - }); - console.log(result); -} - -/** - * This sample demonstrates how to creates or updates a network function resource. - * - * @summary creates or updates a network function resource. - * x-ms-original-file: 2025-03-30/NetworkFunctionCreate.json - */ -async function createNetworkFunctionResource(): Promise { - const credential = new DefaultAzureCredential(); - const subscriptionId = "subid"; - const client = new HybridNetworkManagementClient(credential, subscriptionId); - const result = await client.networkFunctions.createOrUpdate("rg", "testNf", { - location: "eastus", - properties: { - allowSoftwareUpdate: false, - configurationType: "Open", - deploymentValues: '{"releaseName":"testReleaseName","namespace":"testNamespace"}', - networkFunctionDefinitionVersionResourceReference: { - id: "/subscriptions/subid/resourcegroups/rg/providers/Microsoft.HybridNetwork/publishers/testVendor/networkFunctionDefinitionGroups/testnetworkFunctionDefinitionGroupName/networkFunctionDefinitionVersions/1.0.1", - idType: "Open", - }, - nfviId: - "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testResourceGroup/providers/Microsoft.ExtendedLocation/customLocations/testCustomLocation", - nfviType: "AzureArcKubernetes", - roleOverrideValues: [ - '{"name":"testRoleOne","deployParametersMappingRuleProfile":{"helmMappingRuleProfile":{"helmPackageVersion":"2.1.3","values":"{\\"roleOneParam\\":\\"roleOneOverrideValue\\"}"}}}', - '{"name":"testRoleTwo","deployParametersMappingRuleProfile":{"helmMappingRuleProfile":{"releaseName":"overrideReleaseName","releaseNamespace":"overrideNamespace","values":"{\\"roleTwoParam\\":\\"roleTwoOverrideValue\\"}"}}}', - ], - }, - }); - console.log(result); -} - -/** - * This sample demonstrates how to creates or updates a network function resource. - * - * @summary creates or updates a network function resource. - * x-ms-original-file: 2025-03-30/NetworkFunctionCreateSecret.json - */ -async function createNetworkFunctionResourceWithSecrets(): Promise { - const credential = new DefaultAzureCredential(); - const subscriptionId = "subid"; - const client = new HybridNetworkManagementClient(credential, subscriptionId); - const result = await client.networkFunctions.createOrUpdate("rg", "testNf", { - location: "eastus", - properties: { - allowSoftwareUpdate: false, - configurationType: "Secret", - networkFunctionDefinitionVersionResourceReference: { - id: "/subscriptions/subid/resourcegroups/rg/providers/Microsoft.HybridNetwork/publishers/testVendor/networkFunctionDefinitionGroups/testnetworkFunctionDefinitionGroupName/networkFunctionDefinitionVersions/1.0.1", - idType: "Open", - }, - nfviId: - "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testResourceGroup/providers/Microsoft.ExtendedLocation/customLocations/testCustomLocation", - nfviType: "AzureArcKubernetes", - roleOverrideValues: [ - '{"name":"testRoleOne","deployParametersMappingRuleProfile":{"helmMappingRuleProfile":{"helmPackageVersion":"2.1.3","values":"{\\"roleOneParam\\":\\"roleOneOverrideValue\\"}"}}}', - '{"name":"testRoleTwo","deployParametersMappingRuleProfile":{"helmMappingRuleProfile":{"releaseName":"overrideReleaseName","releaseNamespace":"overrideNamespace","values":"{\\"roleTwoParam\\":\\"roleTwoOverrideValue\\"}"}}}', - ], - secretDeploymentValues: '{"adminPassword":"password1","userPassword":"password2"}', - }, - }); - console.log(result); -} - -/** - * This sample demonstrates how to creates or updates a network function resource. - * - * @summary creates or updates a network function resource. - * x-ms-original-file: 2025-03-30/NetworkFunctionFirstPartyCreate.json - */ -async function createFirstPartyNetworkFunctionResource(): Promise { - const credential = new DefaultAzureCredential(); - const subscriptionId = "subid"; - const client = new HybridNetworkManagementClient(credential, subscriptionId); - const result = await client.networkFunctions.createOrUpdate("rg", "testNf", { - location: "eastus", - properties: { - allowSoftwareUpdate: false, - configurationType: "Open", - deploymentValues: '{"releaseName":"testReleaseName","namespace":"testNamespace"}', - networkFunctionDefinitionVersionResourceReference: { - id: "/subscriptions/subid/resourcegroups/rg/providers/Microsoft.HybridNetwork/publishers/testVendor/networkFunctionDefinitionGroups/testnetworkFunctionDefinitionGroupName/networkFunctionDefinitionVersions/1.0.1", - idType: "Secret", - }, - nfviId: - "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testResourceGroup/providers/Microsoft.ExtendedLocation/customLocations/testCustomLocation", - nfviType: "AzureArcKubernetes", - roleOverrideValues: [ - '{"name":"testRoleOne","deployParametersMappingRuleProfile":{"helmMappingRuleProfile":{"helmPackageVersion":"2.1.3","values":"{\\"roleOneParam\\":\\"roleOneOverrideValue\\"}"}}}', - '{"name":"testRoleTwo","deployParametersMappingRuleProfile":{"helmMappingRuleProfile":{"releaseName":"overrideReleaseName","releaseNamespace":"overrideNamespace","values":"{\\"roleTwoParam\\":\\"roleTwoOverrideValue\\"}"}}}', - ], - }, - }); - console.log(result); -} - -async function main(): Promise { - await createVirtualNetworkFunctionResourceOnAzureCore(); - await createVirtualNetworkFunctionResourceOnAzureOperatorNexus(); - await createNetworkFunctionResource(); - await createNetworkFunctionResourceWithSecrets(); - await createFirstPartyNetworkFunctionResource(); -} - -main().catch(console.error); diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/networkFunctionsDeleteSample.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/networkFunctionsDeleteSample.ts deleted file mode 100644 index ed2fe74411..0000000000 --- a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/networkFunctionsDeleteSample.ts +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { HybridNetworkManagementClient } from "@azure/arm-hybridnetwork"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to deletes the specified network function resource. - * - * @summary deletes the specified network function resource. - * x-ms-original-file: 2025-03-30/AzureCore/VirtualNetworkFunctionDelete.json - */ -async function deleteVirtualNetworkFunctionResourceOnAzureCore(): Promise { - const credential = new DefaultAzureCredential(); - const subscriptionId = "subid"; - const client = new HybridNetworkManagementClient(credential, subscriptionId); - await client.networkFunctions.delete("rg", "testNf"); -} - -/** - * This sample demonstrates how to deletes the specified network function resource. - * - * @summary deletes the specified network function resource. - * x-ms-original-file: 2025-03-30/AzureOperatorNexus/VirtualNetworkFunctionDelete.json - */ -async function deleteVirtualNetworkFunctionResourceOnAzureOperatorNexus(): Promise { - const credential = new DefaultAzureCredential(); - const subscriptionId = "subid"; - const client = new HybridNetworkManagementClient(credential, subscriptionId); - await client.networkFunctions.delete("rg", "testNf"); -} - -/** - * This sample demonstrates how to deletes the specified network function resource. - * - * @summary deletes the specified network function resource. - * x-ms-original-file: 2025-03-30/NetworkFunctionDelete.json - */ -async function deleteNetworkFunctionResource(): Promise { - const credential = new DefaultAzureCredential(); - const subscriptionId = "subid"; - const client = new HybridNetworkManagementClient(credential, subscriptionId); - await client.networkFunctions.delete("rg", "testNf"); -} - -async function main(): Promise { - await deleteVirtualNetworkFunctionResourceOnAzureCore(); - await deleteVirtualNetworkFunctionResourceOnAzureOperatorNexus(); - await deleteNetworkFunctionResource(); -} - -main().catch(console.error); diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/networkFunctionsExecuteRequestSample.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/networkFunctionsExecuteRequestSample.ts deleted file mode 100644 index 53a982888d..0000000000 --- a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/networkFunctionsExecuteRequestSample.ts +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { HybridNetworkManagementClient } from "@azure/arm-hybridnetwork"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to execute a request to services on a containerized network function. - * - * @summary execute a request to services on a containerized network function. - * x-ms-original-file: 2025-03-30/NetworkFunctionsExecuteRequest.json - */ -async function sendRequestToNetworkFunctionServices(): Promise { - const credential = new DefaultAzureCredential(); - const subscriptionId = "subid"; - const client = new HybridNetworkManagementClient(credential, subscriptionId); - await client.networkFunctions.executeRequest("rg", "testNetworkfunction", { - requestMetadata: { - apiVersion: "apiVersionQueryString", - httpMethod: "Post", - relativePath: "/simProfiles/testSimProfile", - serializedBody: - '{"subscriptionProfile":"ChantestSubscription15","permanentKey":"00112233445566778899AABBCCDDEEFF","opcOperatorCode":"63bfa50ee6523365ff14c1f45f88737d","staticIpAddresses":{"internet":{"ipv4Addr":"198.51.100.1","ipv6Prefix":"2001:db8:abcd:12::0/64"},"another_network":{"ipv6Prefix":"2001:111:cdef:22::0/64"}}}', - }, - serviceEndpoint: "serviceEndpoint", - }); -} - -async function main(): Promise { - await sendRequestToNetworkFunctionServices(); -} - -main().catch(console.error); diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/networkFunctionsGetSample.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/networkFunctionsGetSample.ts deleted file mode 100644 index af79c31f07..0000000000 --- a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/networkFunctionsGetSample.ts +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { HybridNetworkManagementClient } from "@azure/arm-hybridnetwork"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to gets information about the specified network function resource. - * - * @summary gets information about the specified network function resource. - * x-ms-original-file: 2025-03-30/AzureCore/VirtualNetworkFunctionGet.json - */ -async function getVirtualNetworkFunctionResourceOnAzureCore(): Promise { - const credential = new DefaultAzureCredential(); - const subscriptionId = "subid"; - const client = new HybridNetworkManagementClient(credential, subscriptionId); - const result = await client.networkFunctions.get("rg", "testNf"); - console.log(result); -} - -/** - * This sample demonstrates how to gets information about the specified network function resource. - * - * @summary gets information about the specified network function resource. - * x-ms-original-file: 2025-03-30/AzureOperatorNexus/VirtualNetworkFunctionGet.json - */ -async function getVirtualNetworkFunctionResourceOnAzureOperatorNexus(): Promise { - const credential = new DefaultAzureCredential(); - const subscriptionId = "subid"; - const client = new HybridNetworkManagementClient(credential, subscriptionId); - const result = await client.networkFunctions.get("rg", "testNf"); - console.log(result); -} - -/** - * This sample demonstrates how to gets information about the specified network function resource. - * - * @summary gets information about the specified network function resource. - * x-ms-original-file: 2025-03-30/NetworkFunctionGet.json - */ -async function getNetworkFunctionResource(): Promise { - const credential = new DefaultAzureCredential(); - const subscriptionId = "subid"; - const client = new HybridNetworkManagementClient(credential, subscriptionId); - const result = await client.networkFunctions.get("rg", "testNf"); - console.log(result); -} - -async function main(): Promise { - await getVirtualNetworkFunctionResourceOnAzureCore(); - await getVirtualNetworkFunctionResourceOnAzureOperatorNexus(); - await getNetworkFunctionResource(); -} - -main().catch(console.error); diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/networkFunctionsListByResourceGroupSample.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/networkFunctionsListByResourceGroupSample.ts deleted file mode 100644 index aff35c6dba..0000000000 --- a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/networkFunctionsListByResourceGroupSample.ts +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { HybridNetworkManagementClient } from "@azure/arm-hybridnetwork"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to lists all the network function resources in a resource group. - * - * @summary lists all the network function resources in a resource group. - * x-ms-original-file: 2025-03-30/NetworkFunctionListByResourceGroup.json - */ -async function listNetworkFunctionInResourceGroup(): Promise { - const credential = new DefaultAzureCredential(); - const subscriptionId = "subid"; - const client = new HybridNetworkManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (const item of client.networkFunctions.listByResourceGroup("rg")) { - resArray.push(item); - } - - console.log(resArray); -} - -async function main(): Promise { - await listNetworkFunctionInResourceGroup(); -} - -main().catch(console.error); diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/networkFunctionsListBySubscriptionSample.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/networkFunctionsListBySubscriptionSample.ts deleted file mode 100644 index f84b252a60..0000000000 --- a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/networkFunctionsListBySubscriptionSample.ts +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { HybridNetworkManagementClient } from "@azure/arm-hybridnetwork"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to lists all the network functions in a subscription. - * - * @summary lists all the network functions in a subscription. - * x-ms-original-file: 2025-03-30/NetworkFunctionListBySubscription.json - */ -async function listAllNetworkFunctionResourcesInSubscription(): Promise { - const credential = new DefaultAzureCredential(); - const subscriptionId = "subid"; - const client = new HybridNetworkManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (const item of client.networkFunctions.listBySubscription()) { - resArray.push(item); - } - - console.log(resArray); -} - -async function main(): Promise { - await listAllNetworkFunctionResourcesInSubscription(); -} - -main().catch(console.error); diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/networkFunctionsUpdateTagsSample.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/networkFunctionsUpdateTagsSample.ts deleted file mode 100644 index 4f42a95990..0000000000 --- a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/networkFunctionsUpdateTagsSample.ts +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { HybridNetworkManagementClient } from "@azure/arm-hybridnetwork"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to updates the tags for the network function resource. - * - * @summary updates the tags for the network function resource. - * x-ms-original-file: 2025-03-30/NetworkFunctionUpdateTags.json - */ -async function updateTagsForNetworkFunctionResource(): Promise { - const credential = new DefaultAzureCredential(); - const subscriptionId = "subid"; - const client = new HybridNetworkManagementClient(credential, subscriptionId); - const result = await client.networkFunctions.updateTags("rg", "testNf", { - tags: { tag1: "value1", tag2: "value2" }, - }); - console.log(result); -} - -async function main(): Promise { - await updateTagsForNetworkFunctionResource(); -} - -main().catch(console.error); diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/networkServiceDesignGroupsCreateOrUpdateSample.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/networkServiceDesignGroupsCreateOrUpdateSample.ts deleted file mode 100644 index 1721863548..0000000000 --- a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/networkServiceDesignGroupsCreateOrUpdateSample.ts +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { HybridNetworkManagementClient } from "@azure/arm-hybridnetwork"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to creates or updates a network service design group. - * - * @summary creates or updates a network service design group. - * x-ms-original-file: 2025-03-30/NetworkServiceDesignGroupCreate.json - */ -async function createOrUpdateTheNetworkServiceDesignGroup(): Promise { - const credential = new DefaultAzureCredential(); - const subscriptionId = "subid"; - const client = new HybridNetworkManagementClient(credential, subscriptionId); - const result = await client.networkServiceDesignGroups.createOrUpdate( - "rg", - "TestPublisher", - "TestNetworkServiceDesignGroupName", - { location: "eastus" }, - ); - console.log(result); -} - -async function main(): Promise { - await createOrUpdateTheNetworkServiceDesignGroup(); -} - -main().catch(console.error); diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/networkServiceDesignGroupsDeleteSample.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/networkServiceDesignGroupsDeleteSample.ts deleted file mode 100644 index aba47e0470..0000000000 --- a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/networkServiceDesignGroupsDeleteSample.ts +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { HybridNetworkManagementClient } from "@azure/arm-hybridnetwork"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to deletes a specified network service design group. - * - * @summary deletes a specified network service design group. - * x-ms-original-file: 2025-03-30/NetworkServiceDesignGroupDelete.json - */ -async function deleteANetworkFunctionGroupResource(): Promise { - const credential = new DefaultAzureCredential(); - const subscriptionId = "subid"; - const client = new HybridNetworkManagementClient(credential, subscriptionId); - await client.networkServiceDesignGroups.delete( - "rg", - "TestPublisher", - "TestNetworkServiceDesignGroupName", - ); -} - -async function main(): Promise { - await deleteANetworkFunctionGroupResource(); -} - -main().catch(console.error); diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/networkServiceDesignGroupsGetSample.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/networkServiceDesignGroupsGetSample.ts deleted file mode 100644 index 4d778aed36..0000000000 --- a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/networkServiceDesignGroupsGetSample.ts +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { HybridNetworkManagementClient } from "@azure/arm-hybridnetwork"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to gets information about the specified networkServiceDesign group. - * - * @summary gets information about the specified networkServiceDesign group. - * x-ms-original-file: 2025-03-30/NetworkServiceDesignGroupGet.json - */ -async function getANetworkServiceDesignGroupResource(): Promise { - const credential = new DefaultAzureCredential(); - const subscriptionId = "subid"; - const client = new HybridNetworkManagementClient(credential, subscriptionId); - const result = await client.networkServiceDesignGroups.get( - "rg", - "TestPublisher", - "TestNetworkServiceDesignGroupName", - ); - console.log(result); -} - -async function main(): Promise { - await getANetworkServiceDesignGroupResource(); -} - -main().catch(console.error); diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/networkServiceDesignGroupsListByPublisherSample.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/networkServiceDesignGroupsListByPublisherSample.ts deleted file mode 100644 index 3ec9855ac4..0000000000 --- a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/networkServiceDesignGroupsListByPublisherSample.ts +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { HybridNetworkManagementClient } from "@azure/arm-hybridnetwork"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to gets information of the network service design groups under a publisher. - * - * @summary gets information of the network service design groups under a publisher. - * x-ms-original-file: 2025-03-30/NetworkServiceDesignGroupsListByPublisherName.json - */ -async function getNetworkServiceDesignGroupsUnderPublisherResource(): Promise { - const credential = new DefaultAzureCredential(); - const subscriptionId = "subid"; - const client = new HybridNetworkManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (const item of client.networkServiceDesignGroups.listByPublisher( - "rg", - "TestPublisher", - )) { - resArray.push(item); - } - - console.log(resArray); -} - -async function main(): Promise { - await getNetworkServiceDesignGroupsUnderPublisherResource(); -} - -main().catch(console.error); diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/networkServiceDesignGroupsUpdateSample.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/networkServiceDesignGroupsUpdateSample.ts deleted file mode 100644 index bad3d14477..0000000000 --- a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/networkServiceDesignGroupsUpdateSample.ts +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { HybridNetworkManagementClient } from "@azure/arm-hybridnetwork"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to updates a network service design groups resource. - * - * @summary updates a network service design groups resource. - * x-ms-original-file: 2025-03-30/NetworkServiceDesignGroupUpdateTags.json - */ -async function createOrUpdateTheNetworkServiceDesignGroupResource(): Promise { - const credential = new DefaultAzureCredential(); - const subscriptionId = "subid"; - const client = new HybridNetworkManagementClient(credential, subscriptionId); - const result = await client.networkServiceDesignGroups.update( - "rg", - "TestPublisher", - "TestNetworkServiceDesignGroupName", - { tags: { tag1: "value1", tag2: "value2" } }, - ); - console.log(result); -} - -async function main(): Promise { - await createOrUpdateTheNetworkServiceDesignGroupResource(); -} - -main().catch(console.error); diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/networkServiceDesignVersionsCreateOrUpdateSample.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/networkServiceDesignVersionsCreateOrUpdateSample.ts deleted file mode 100644 index dc7a005961..0000000000 --- a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/networkServiceDesignVersionsCreateOrUpdateSample.ts +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { HybridNetworkManagementClient } from "@azure/arm-hybridnetwork"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to creates or updates a network service design version. - * - * @summary creates or updates a network service design version. - * x-ms-original-file: 2025-03-30/NetworkServiceDesignVersionCreate.json - */ -async function createOrUpdateANetworkServiceDesignVersionResource(): Promise { - const credential = new DefaultAzureCredential(); - const subscriptionId = "subid"; - const client = new HybridNetworkManagementClient(credential, subscriptionId); - const result = await client.networkServiceDesignVersions.createOrUpdate( - "rg", - "TestPublisher", - "TestNetworkServiceDesignGroupName", - "1.0.0", - { - location: "eastus", - properties: { - configurationGroupSchemaReferences: { - MyVM_Configuration: { - id: "/subscriptions/subid/resourcegroups/contosorg1/providers/microsoft.hybridnetwork/publishers/contosoGroup/networkServiceDesignGroups/NSD_contoso/configurationGroupSchemas/MyVM_Configuration_Schema", - }, - }, - resourceElementTemplates: [], - versionState: "Active", - }, - }, - ); - console.log(result); -} - -async function main(): Promise { - await createOrUpdateANetworkServiceDesignVersionResource(); -} - -main().catch(console.error); diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/networkServiceDesignVersionsDeleteSample.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/networkServiceDesignVersionsDeleteSample.ts deleted file mode 100644 index a706e676c2..0000000000 --- a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/networkServiceDesignVersionsDeleteSample.ts +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { HybridNetworkManagementClient } from "@azure/arm-hybridnetwork"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to deletes the specified network service design version. - * - * @summary deletes the specified network service design version. - * x-ms-original-file: 2025-03-30/NetworkServiceDesignVersionDelete.json - */ -async function deleteANetworkServiceDesignVersion(): Promise { - const credential = new DefaultAzureCredential(); - const subscriptionId = "subid"; - const client = new HybridNetworkManagementClient(credential, subscriptionId); - await client.networkServiceDesignVersions.delete( - "rg", - "TestPublisher", - "TestNetworkServiceDesignGroupName", - "1.0.0", - ); -} - -async function main(): Promise { - await deleteANetworkServiceDesignVersion(); -} - -main().catch(console.error); diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/networkServiceDesignVersionsGetSample.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/networkServiceDesignVersionsGetSample.ts deleted file mode 100644 index 7f32404ffb..0000000000 --- a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/networkServiceDesignVersionsGetSample.ts +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { HybridNetworkManagementClient } from "@azure/arm-hybridnetwork"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to gets information about a network service design version. - * - * @summary gets information about a network service design version. - * x-ms-original-file: 2025-03-30/NetworkServiceDesignVersionGet.json - */ -async function getANetworkServiceDesignVersionResource(): Promise { - const credential = new DefaultAzureCredential(); - const subscriptionId = "subid"; - const client = new HybridNetworkManagementClient(credential, subscriptionId); - const result = await client.networkServiceDesignVersions.get( - "rg", - "TestPublisher", - "TestNetworkServiceDesignGroupName", - "1.0.0", - ); - console.log(result); -} - -async function main(): Promise { - await getANetworkServiceDesignVersionResource(); -} - -main().catch(console.error); diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/networkServiceDesignVersionsListByNetworkServiceDesignGroupSample.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/networkServiceDesignVersionsListByNetworkServiceDesignGroupSample.ts deleted file mode 100644 index 615ae5f81d..0000000000 --- a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/networkServiceDesignVersionsListByNetworkServiceDesignGroupSample.ts +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { HybridNetworkManagementClient } from "@azure/arm-hybridnetwork"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to gets information about a list of network service design versions under a network service design group. - * - * @summary gets information about a list of network service design versions under a network service design group. - * x-ms-original-file: 2025-03-30/NetworkServiceDesignVersionListByNetworkServiceDesignGroup.json - */ -async function getPublisherResource(): Promise { - const credential = new DefaultAzureCredential(); - const subscriptionId = "subid"; - const client = new HybridNetworkManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (const item of client.networkServiceDesignVersions.listByNetworkServiceDesignGroup( - "rg", - "TestPublisher", - "TestNetworkServiceDesignGroupName", - )) { - resArray.push(item); - } - - console.log(resArray); -} - -async function main(): Promise { - await getPublisherResource(); -} - -main().catch(console.error); diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/networkServiceDesignVersionsUpdateSample.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/networkServiceDesignVersionsUpdateSample.ts deleted file mode 100644 index ab32bd2bb2..0000000000 --- a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/networkServiceDesignVersionsUpdateSample.ts +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { HybridNetworkManagementClient } from "@azure/arm-hybridnetwork"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to updates a network service design version resource. - * - * @summary updates a network service design version resource. - * x-ms-original-file: 2025-03-30/NetworkServiceDesignVersionUpdateTags.json - */ -async function updateTheNetworkServiceDesignVersionTags(): Promise { - const credential = new DefaultAzureCredential(); - const subscriptionId = "subid"; - const client = new HybridNetworkManagementClient(credential, subscriptionId); - const result = await client.networkServiceDesignVersions.update( - "rg", - "TestPublisher", - "TestNetworkServiceDesignGroupName", - "1.0.0", - { tags: { tag1: "value1", tag2: "value2" } }, - ); - console.log(result); -} - -async function main(): Promise { - await updateTheNetworkServiceDesignVersionTags(); -} - -main().catch(console.error); diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/networkServiceDesignVersionsUpdateStateSample.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/networkServiceDesignVersionsUpdateStateSample.ts deleted file mode 100644 index f1f5505163..0000000000 --- a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/networkServiceDesignVersionsUpdateStateSample.ts +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { HybridNetworkManagementClient } from "@azure/arm-hybridnetwork"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to update network service design version state. - * - * @summary update network service design version state. - * x-ms-original-file: 2025-03-30/NetworkServiceDesignVersionUpdateState.json - */ -async function updateNetworkServiceDesignVersionState(): Promise { - const credential = new DefaultAzureCredential(); - const subscriptionId = "subid"; - const client = new HybridNetworkManagementClient(credential, subscriptionId); - const result = await client.networkServiceDesignVersions.updateState( - "rg", - "TestPublisher", - "TestNetworkServiceDesignGroupName", - "1.0.0", - { versionState: "Active" }, - ); - console.log(result); -} - -async function main(): Promise { - await updateNetworkServiceDesignVersionState(); -} - -main().catch(console.error); diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/operationsListSample.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/operationsListSample.ts deleted file mode 100644 index 446d0e812e..0000000000 --- a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/operationsListSample.ts +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { HybridNetworkManagementClient } from "@azure/arm-hybridnetwork"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to gets a list of the operations. - * - * @summary gets a list of the operations. - * x-ms-original-file: 2025-03-30/GetOperations.json - */ -async function getRegistrationOperations(): Promise { - const credential = new DefaultAzureCredential(); - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const client = new HybridNetworkManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (const item of client.operations.list()) { - resArray.push(item); - } - - console.log(resArray); -} - -async function main(): Promise { - await getRegistrationOperations(); -} - -main().catch(console.error); diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/proxyArtifactGetSample.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/proxyArtifactGetSample.ts deleted file mode 100644 index 92ac897bf2..0000000000 --- a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/proxyArtifactGetSample.ts +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { HybridNetworkManagementClient } from "@azure/arm-hybridnetwork"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to get a Artifact overview information. - * - * @summary get a Artifact overview information. - * x-ms-original-file: 2025-03-30/PureProxyArtifact/ArtifactGet.json - */ -async function getAnArtifactOverview(): Promise { - const credential = new DefaultAzureCredential(); - const subscriptionId = "subid"; - const client = new HybridNetworkManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (const item of client.proxyArtifact.get( - "TestResourceGroup", - "TestPublisher", - "TestArtifactStoreName", - "fedrbac", - )) { - resArray.push(item); - } - - console.log(resArray); -} - -async function main(): Promise { - await getAnArtifactOverview(); -} - -main().catch(console.error); diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/proxyArtifactListSample.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/proxyArtifactListSample.ts deleted file mode 100644 index b9199eb441..0000000000 --- a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/proxyArtifactListSample.ts +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { HybridNetworkManagementClient } from "@azure/arm-hybridnetwork"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to lists all the available artifacts in the parent Artifact Store. - * - * @summary lists all the available artifacts in the parent Artifact Store. - * x-ms-original-file: 2025-03-30/PureProxyArtifact/ArtifactList.json - */ -async function listArtifactsUnderAnArtifactStore(): Promise { - const credential = new DefaultAzureCredential(); - const subscriptionId = "subid"; - const client = new HybridNetworkManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (const item of client.proxyArtifact.list( - "TestResourceGroup", - "TestPublisher", - "TestArtifactStoreName", - )) { - resArray.push(item); - } - - console.log(resArray); -} - -async function main(): Promise { - await listArtifactsUnderAnArtifactStore(); -} - -main().catch(console.error); diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/proxyArtifactUpdateStateSample.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/proxyArtifactUpdateStateSample.ts deleted file mode 100644 index d65fb711cc..0000000000 --- a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/proxyArtifactUpdateStateSample.ts +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { HybridNetworkManagementClient } from "@azure/arm-hybridnetwork"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to change artifact state defined in artifact store. - * - * @summary change artifact state defined in artifact store. - * x-ms-original-file: 2025-03-30/PureProxyArtifact/ArtifactChangeState.json - */ -async function updateAnArtifactState(): Promise { - const credential = new DefaultAzureCredential(); - const subscriptionId = "subid"; - const client = new HybridNetworkManagementClient(credential, subscriptionId); - const result = await client.proxyArtifact.updateState( - "TestResourceGroup", - "TestPublisher", - "TestArtifactStoreName", - "fedrbac", - "1.0.0", - { properties: { artifactState: "Deprecated" } }, - ); - console.log(result); -} - -async function main(): Promise { - await updateAnArtifactState(); -} - -main().catch(console.error); diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/publishersCreateOrUpdateSample.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/publishersCreateOrUpdateSample.ts deleted file mode 100644 index 477feb859b..0000000000 --- a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/publishersCreateOrUpdateSample.ts +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { HybridNetworkManagementClient } from "@azure/arm-hybridnetwork"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to creates or updates a publisher. - * - * @summary creates or updates a publisher. - * x-ms-original-file: 2025-03-30/PublisherCreate.json - */ -async function createOrUpdateAPublisherResource(): Promise { - const credential = new DefaultAzureCredential(); - const subscriptionId = "subid"; - const client = new HybridNetworkManagementClient(credential, subscriptionId); - const result = await client.publishers.createOrUpdate("rg", "TestPublisher", { - parameters: { location: "eastus", properties: { scope: "Public" } }, - }); - console.log(result); -} - -async function main(): Promise { - await createOrUpdateAPublisherResource(); -} - -main().catch(console.error); diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/publishersDeleteSample.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/publishersDeleteSample.ts deleted file mode 100644 index 362c06b038..0000000000 --- a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/publishersDeleteSample.ts +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { HybridNetworkManagementClient } from "@azure/arm-hybridnetwork"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to deletes the specified publisher. - * - * @summary deletes the specified publisher. - * x-ms-original-file: 2025-03-30/PublisherDelete.json - */ -async function deleteAPublisherResource(): Promise { - const credential = new DefaultAzureCredential(); - const subscriptionId = "subid"; - const client = new HybridNetworkManagementClient(credential, subscriptionId); - await client.publishers.delete("rg", "TestPublisher"); -} - -async function main(): Promise { - await deleteAPublisherResource(); -} - -main().catch(console.error); diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/publishersGetSample.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/publishersGetSample.ts deleted file mode 100644 index e2bde73d99..0000000000 --- a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/publishersGetSample.ts +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { HybridNetworkManagementClient } from "@azure/arm-hybridnetwork"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to gets information about the specified publisher. - * - * @summary gets information about the specified publisher. - * x-ms-original-file: 2025-03-30/PublisherGet.json - */ -async function getAPublisherResource(): Promise { - const credential = new DefaultAzureCredential(); - const subscriptionId = "subid"; - const client = new HybridNetworkManagementClient(credential, subscriptionId); - const result = await client.publishers.get("rg", "TestPublisher"); - console.log(result); -} - -async function main(): Promise { - await getAPublisherResource(); -} - -main().catch(console.error); diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/publishersListByResourceGroupSample.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/publishersListByResourceGroupSample.ts deleted file mode 100644 index 405f0b221c..0000000000 --- a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/publishersListByResourceGroupSample.ts +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { HybridNetworkManagementClient } from "@azure/arm-hybridnetwork"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to lists all the publishers in a resource group. - * - * @summary lists all the publishers in a resource group. - * x-ms-original-file: 2025-03-30/PublisherListByResourceGroup.json - */ -async function listAllPublisherResourcesInAResourceGroup(): Promise { - const credential = new DefaultAzureCredential(); - const subscriptionId = "subid"; - const client = new HybridNetworkManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (const item of client.publishers.listByResourceGroup("rg")) { - resArray.push(item); - } - - console.log(resArray); -} - -async function main(): Promise { - await listAllPublisherResourcesInAResourceGroup(); -} - -main().catch(console.error); diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/publishersListBySubscriptionSample.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/publishersListBySubscriptionSample.ts deleted file mode 100644 index 318f7d8466..0000000000 --- a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/publishersListBySubscriptionSample.ts +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { HybridNetworkManagementClient } from "@azure/arm-hybridnetwork"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to lists all the publishers in a subscription. - * - * @summary lists all the publishers in a subscription. - * x-ms-original-file: 2025-03-30/PublisherListBySubscription.json - */ -async function listAllPublisherResourcesInASubscription(): Promise { - const credential = new DefaultAzureCredential(); - const subscriptionId = "subid"; - const client = new HybridNetworkManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (const item of client.publishers.listBySubscription()) { - resArray.push(item); - } - - console.log(resArray); -} - -async function main(): Promise { - await listAllPublisherResourcesInASubscription(); -} - -main().catch(console.error); diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/publishersUpdateSample.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/publishersUpdateSample.ts deleted file mode 100644 index cb3e31c4a9..0000000000 --- a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/publishersUpdateSample.ts +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { HybridNetworkManagementClient } from "@azure/arm-hybridnetwork"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to update a publisher resource. - * - * @summary update a publisher resource. - * x-ms-original-file: 2025-03-30/PublisherUpdateTags.json - */ -async function updateAPublisherTags(): Promise { - const credential = new DefaultAzureCredential(); - const subscriptionId = "subid"; - const client = new HybridNetworkManagementClient(credential, subscriptionId); - const result = await client.publishers.update("rg", "TestPublisher", { - parameters: { tags: { tag1: "value1", tag2: "value2" } }, - }); - console.log(result); -} - -async function main(): Promise { - await updateAPublisherTags(); -} - -main().catch(console.error); diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/siteNetworkServicesCancelOperationSample.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/siteNetworkServicesCancelOperationSample.ts deleted file mode 100644 index f5da46740c..0000000000 --- a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/siteNetworkServicesCancelOperationSample.ts +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { HybridNetworkManagementClient } from "@azure/arm-hybridnetwork"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to cancels an ongoing long-running PUT operation for the specified Site Network Service resource. Other operations are not supported for cancellation at this time. - * - * @summary cancels an ongoing long-running PUT operation for the specified Site Network Service resource. Other operations are not supported for cancellation at this time. - * x-ms-original-file: 2025-03-30/SiteNetworkServicesCancelOngoingPUTOperation.json - */ -async function cancelAnInProgressSNSPUT(): Promise { - const credential = new DefaultAzureCredential(); - const subscriptionId = "sub1"; - const client = new HybridNetworkManagementClient(credential, subscriptionId); - await client.siteNetworkServices.cancelOperation({ - longRunningOperation: "Put", - siteNetworkServiceReference: { - id: "/subscriptions/sub1/resourceGroups/rg/providers/Microsoft.HybridNetwork/siteNetworkServices/TestSNS1", - }, - }); -} - -async function main(): Promise { - await cancelAnInProgressSNSPUT(); -} - -main().catch(console.error); diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/siteNetworkServicesCreateOrUpdateSample.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/siteNetworkServicesCreateOrUpdateSample.ts deleted file mode 100644 index 3d1f61f68f..0000000000 --- a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/siteNetworkServicesCreateOrUpdateSample.ts +++ /dev/null @@ -1,82 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { HybridNetworkManagementClient } from "@azure/arm-hybridnetwork"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to creates or updates a network site. - * - * @summary creates or updates a network site. - * x-ms-original-file: 2025-03-30/SiteNetworkServiceCreate.json - */ -async function createSiteNetworkService(): Promise { - const credential = new DefaultAzureCredential(); - const subscriptionId = "subid"; - const client = new HybridNetworkManagementClient(credential, subscriptionId); - const result = await client.siteNetworkServices.createOrUpdate( - "rg1", - "testSiteNetworkServiceName", - { - location: "westUs2", - properties: { - desiredStateConfigurationGroupValueReferences: { - MyVM_Configuration: { - id: "/subscriptions/subid/resourcegroups/contosorg1/providers/microsoft.hybridnetwork/configurationgroupvalues/MyVM_Configuration1", - }, - }, - networkServiceDesignVersionResourceReference: { - id: "/subscriptions/subid/resourcegroups/rg/providers/Microsoft.HybridNetwork/publishers/TestPublisher/networkServiceDesignGroups/TestNetworkServiceDesignGroupName/networkServiceDesignVersions/1.0.0", - idType: "Open", - }, - siteReference: { - id: "/subscriptions/subid/resourcegroups/contosorg1/providers/microsoft.hybridnetwork/sites/testSite", - }, - }, - sku: { name: "Standard" }, - }, - ); - console.log(result); -} - -/** - * This sample demonstrates how to creates or updates a network site. - * - * @summary creates or updates a network site. - * x-ms-original-file: 2025-03-30/SiteNetworkServiceFirstPartyCreate.json - */ -async function createFirstPartySiteNetworkService(): Promise { - const credential = new DefaultAzureCredential(); - const subscriptionId = "subid"; - const client = new HybridNetworkManagementClient(credential, subscriptionId); - const result = await client.siteNetworkServices.createOrUpdate( - "rg1", - "testSiteNetworkServiceName", - { - location: "westUs2", - properties: { - desiredStateConfigurationGroupValueReferences: { - MyVM_Configuration: { - id: "/subscriptions/subid/resourcegroups/contosorg1/providers/microsoft.hybridnetwork/configurationgroupvalues/MyVM_Configuration1", - }, - }, - networkServiceDesignVersionResourceReference: { - id: "/subscriptions/subid/resourcegroups/rg/providers/Microsoft.HybridNetwork/publishers/TestPublisher/networkServiceDesignGroups/TestNetworkServiceDesignGroupName/networkServiceDesignVersions/1.0.0", - idType: "Secret", - }, - siteReference: { - id: "/subscriptions/subid/resourcegroups/contosorg1/providers/microsoft.hybridnetwork/sites/testSite", - }, - }, - sku: { name: "Standard" }, - }, - ); - console.log(result); -} - -async function main(): Promise { - await createSiteNetworkService(); - await createFirstPartySiteNetworkService(); -} - -main().catch(console.error); diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/siteNetworkServicesDeleteSample.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/siteNetworkServicesDeleteSample.ts deleted file mode 100644 index 7fac16680b..0000000000 --- a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/siteNetworkServicesDeleteSample.ts +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { HybridNetworkManagementClient } from "@azure/arm-hybridnetwork"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to deletes the specified site network service. - * - * @summary deletes the specified site network service. - * x-ms-original-file: 2025-03-30/SiteNetworkServiceDelete.json - */ -async function deleteNetworkSite(): Promise { - const credential = new DefaultAzureCredential(); - const subscriptionId = "subid"; - const client = new HybridNetworkManagementClient(credential, subscriptionId); - await client.siteNetworkServices.delete("rg1", "testSiteNetworkServiceName"); -} - -async function main(): Promise { - await deleteNetworkSite(); -} - -main().catch(console.error); diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/siteNetworkServicesGetSample.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/siteNetworkServicesGetSample.ts deleted file mode 100644 index 0df3228020..0000000000 --- a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/siteNetworkServicesGetSample.ts +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { HybridNetworkManagementClient } from "@azure/arm-hybridnetwork"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to gets information about the specified site network service. - * - * @summary gets information about the specified site network service. - * x-ms-original-file: 2025-03-30/SiteNetworkServiceGet.json - */ -async function getNetworkSite(): Promise { - const credential = new DefaultAzureCredential(); - const subscriptionId = "subid"; - const client = new HybridNetworkManagementClient(credential, subscriptionId); - const result = await client.siteNetworkServices.get("rg1", "testSiteNetworkServiceName"); - console.log(result); -} - -async function main(): Promise { - await getNetworkSite(); -} - -main().catch(console.error); diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/siteNetworkServicesListByResourceGroupSample.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/siteNetworkServicesListByResourceGroupSample.ts deleted file mode 100644 index 72b9afcb43..0000000000 --- a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/siteNetworkServicesListByResourceGroupSample.ts +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { HybridNetworkManagementClient } from "@azure/arm-hybridnetwork"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to lists all site network services. - * - * @summary lists all site network services. - * x-ms-original-file: 2025-03-30/SiteNetworkServiceListByResourceGroup.json - */ -async function listAllNetworkSites(): Promise { - const credential = new DefaultAzureCredential(); - const subscriptionId = "subid"; - const client = new HybridNetworkManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (const item of client.siteNetworkServices.listByResourceGroup("rg1")) { - resArray.push(item); - } - - console.log(resArray); -} - -async function main(): Promise { - await listAllNetworkSites(); -} - -main().catch(console.error); diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/siteNetworkServicesListBySubscriptionSample.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/siteNetworkServicesListBySubscriptionSample.ts deleted file mode 100644 index e035fac5c0..0000000000 --- a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/siteNetworkServicesListBySubscriptionSample.ts +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { HybridNetworkManagementClient } from "@azure/arm-hybridnetwork"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to lists all sites in the network service in a subscription. - * - * @summary lists all sites in the network service in a subscription. - * x-ms-original-file: 2025-03-30/SiteNetworkServiceListBySubscription.json - */ -async function listAllHybridNetworkSitesInASubscription(): Promise { - const credential = new DefaultAzureCredential(); - const subscriptionId = "subid"; - const client = new HybridNetworkManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (const item of client.siteNetworkServices.listBySubscription()) { - resArray.push(item); - } - - console.log(resArray); -} - -async function main(): Promise { - await listAllHybridNetworkSitesInASubscription(); -} - -main().catch(console.error); diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/siteNetworkServicesUpdateTagsSample.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/siteNetworkServicesUpdateTagsSample.ts deleted file mode 100644 index ce4d6aa1bc..0000000000 --- a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/siteNetworkServicesUpdateTagsSample.ts +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { HybridNetworkManagementClient } from "@azure/arm-hybridnetwork"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to updates a site update tags. - * - * @summary updates a site update tags. - * x-ms-original-file: 2025-03-30/SiteNetworkServiceUpdateTags.json - */ -async function updateNetworkSiteTags(): Promise { - const credential = new DefaultAzureCredential(); - const subscriptionId = "subid"; - const client = new HybridNetworkManagementClient(credential, subscriptionId); - const result = await client.siteNetworkServices.updateTags("rg1", "testSiteNetworkServiceName", { - tags: { tag1: "value1", tag2: "value2" }, - }); - console.log(result); -} - -async function main(): Promise { - await updateNetworkSiteTags(); -} - -main().catch(console.error); diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/sitesCreateOrUpdateSample.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/sitesCreateOrUpdateSample.ts deleted file mode 100644 index 00d31e546c..0000000000 --- a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/sitesCreateOrUpdateSample.ts +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { HybridNetworkManagementClient } from "@azure/arm-hybridnetwork"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to creates or updates a network site. - * - * @summary creates or updates a network site. - * x-ms-original-file: 2025-03-30/SiteCreate.json - */ -async function createNetworkSite(): Promise { - const credential = new DefaultAzureCredential(); - const subscriptionId = "subid"; - const client = new HybridNetworkManagementClient(credential, subscriptionId); - const result = await client.sites.createOrUpdate("rg1", "testSite", { - location: "westUs2", - properties: { - nfvis: [ - { name: "nfvi1", location: "westUs2", nfviType: "AzureCore" }, - { - name: "nfvi2", - customLocationReference: { - id: "/subscriptions/subid/resourceGroups/testResourceGroup/providers/Microsoft.ExtendedLocation/customLocations/testCustomLocation1", - }, - nfviType: "AzureArcKubernetes", - }, - { - name: "nfvi3", - customLocationReference: { - id: "/subscriptions/subid/resourceGroups/testResourceGroup/providers/Microsoft.ExtendedLocation/customLocations/testCustomLocation2", - }, - nfviType: "AzureOperatorNexus", - }, - ], - }, - }); - console.log(result); -} - -async function main(): Promise { - await createNetworkSite(); -} - -main().catch(console.error); diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/sitesDeleteSample.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/sitesDeleteSample.ts deleted file mode 100644 index a0749b35c0..0000000000 --- a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/sitesDeleteSample.ts +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { HybridNetworkManagementClient } from "@azure/arm-hybridnetwork"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to deletes the specified network site. - * - * @summary deletes the specified network site. - * x-ms-original-file: 2025-03-30/SiteDelete.json - */ -async function deleteNetworkSite(): Promise { - const credential = new DefaultAzureCredential(); - const subscriptionId = "subid"; - const client = new HybridNetworkManagementClient(credential, subscriptionId); - await client.sites.delete("rg1", "testSite"); -} - -async function main(): Promise { - await deleteNetworkSite(); -} - -main().catch(console.error); diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/sitesGetSample.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/sitesGetSample.ts deleted file mode 100644 index 2fd1e66b3a..0000000000 --- a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/sitesGetSample.ts +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { HybridNetworkManagementClient } from "@azure/arm-hybridnetwork"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to gets information about the specified network site. - * - * @summary gets information about the specified network site. - * x-ms-original-file: 2025-03-30/SiteGet.json - */ -async function getNetworkSite(): Promise { - const credential = new DefaultAzureCredential(); - const subscriptionId = "subid"; - const client = new HybridNetworkManagementClient(credential, subscriptionId); - const result = await client.sites.get("rg1", "testSite"); - console.log(result); -} - -async function main(): Promise { - await getNetworkSite(); -} - -main().catch(console.error); diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/sitesListByResourceGroupSample.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/sitesListByResourceGroupSample.ts deleted file mode 100644 index 897fe68d8b..0000000000 --- a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/sitesListByResourceGroupSample.ts +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { HybridNetworkManagementClient } from "@azure/arm-hybridnetwork"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to lists all sites in the network service. - * - * @summary lists all sites in the network service. - * x-ms-original-file: 2025-03-30/SiteListByResourceGroup.json - */ -async function listAllNetworkSites(): Promise { - const credential = new DefaultAzureCredential(); - const subscriptionId = "subid"; - const client = new HybridNetworkManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (const item of client.sites.listByResourceGroup("rg1")) { - resArray.push(item); - } - - console.log(resArray); -} - -async function main(): Promise { - await listAllNetworkSites(); -} - -main().catch(console.error); diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/sitesListBySubscriptionSample.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/sitesListBySubscriptionSample.ts deleted file mode 100644 index eb4c2d5269..0000000000 --- a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/sitesListBySubscriptionSample.ts +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { HybridNetworkManagementClient } from "@azure/arm-hybridnetwork"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to lists all sites in the network service in a subscription. - * - * @summary lists all sites in the network service in a subscription. - * x-ms-original-file: 2025-03-30/SiteListBySubscription.json - */ -async function listAllHybridNetworkSitesInASubscription(): Promise { - const credential = new DefaultAzureCredential(); - const subscriptionId = "subid"; - const client = new HybridNetworkManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (const item of client.sites.listBySubscription()) { - resArray.push(item); - } - - console.log(resArray); -} - -async function main(): Promise { - await listAllHybridNetworkSitesInASubscription(); -} - -main().catch(console.error); diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/sitesUpdateTagsSample.ts b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/sitesUpdateTagsSample.ts deleted file mode 100644 index 4c854ef42f..0000000000 --- a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/samples-dev/sitesUpdateTagsSample.ts +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { HybridNetworkManagementClient } from "@azure/arm-hybridnetwork"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to updates a site update tags. - * - * @summary updates a site update tags. - * x-ms-original-file: 2025-03-30/SiteUpdateTags.json - */ -async function updateNetworkSiteTags(): Promise { - const credential = new DefaultAzureCredential(); - const subscriptionId = "subid"; - const client = new HybridNetworkManagementClient(credential, subscriptionId); - const result = await client.sites.updateTags("rg1", "testSite", { - tags: { tag1: "value1", tag2: "value2" }, - }); - console.log(result); -} - -async function main(): Promise { - await updateNetworkSiteTags(); -} - -main().catch(console.error); diff --git a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/tsconfig.json b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/tsconfig.json index 2438674c36..031889db45 100644 --- a/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/tsconfig.json +++ b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/tsconfig.json @@ -17,10 +17,7 @@ "forceConsistentCasingInFileNames": true, "moduleResolution": "NodeNext", "allowSyntheticDefaultImports": true, - "esModuleInterop": true, - "paths": { - "@azure/arm-hybridnetwork": ["./src/index"] - } + "esModuleInterop": true }, - "include": ["src/**/*.ts", "samples-dev/**/*.ts"] + "include": ["src/**/*.ts"] } diff --git a/packages/typespec-test/test/authoring/generated/typespec-ts/review/authoring.api.md b/packages/typespec-test/test/authoring/generated/typespec-ts/review/authoring.api.md index bb255e88db..72f95c13f7 100644 --- a/packages/typespec-test/test/authoring/generated/typespec-ts/review/authoring.api.md +++ b/packages/typespec-test/test/authoring/generated/typespec-ts/review/authoring.api.md @@ -30,7 +30,7 @@ export interface AuthoringClientOptions extends ClientOptions { } // @public -function createClient(endpointParam: string, credentials: KeyCredential, { apiVersion, ...options }?: AuthoringClientOptions): AuthoringClient; +function createClient(endpointParam: string, credentials: KeyCredential, input?: AuthoringClientOptions): AuthoringClient; export default createClient; // @public (undocumented) diff --git a/packages/typespec-test/test/confidentialLedger/generated/openapi/openapi.json b/packages/typespec-test/test/confidentialLedger/generated/openapi/openapi.json deleted file mode 100644 index 27beacd9db..0000000000 --- a/packages/typespec-test/test/confidentialLedger/generated/openapi/openapi.json +++ /dev/null @@ -1,851 +0,0 @@ -{ - "swagger": "2.0", - "info": { - "title": "Confidential Ledger Service", - "version": "2022-05-13", - "x-typespec-generated": [ - { - "emitter": "@azure-tools/typespec-autorest" - } - ] - }, - "schemes": [ - "https" - ], - "x-ms-parameterized-host": { - "hostTemplate": "{ledgerUri}", - "useSchemePrefix": false, - "parameters": [ - { - "name": "ledgerUri", - "in": "path", - "required": true, - "type": "string", - "format": "uri", - "x-ms-skip-url-encoding": true - } - ] - }, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ], - "security": [ - { - "OAuth2Auth": [ - "https://confidential-ledger.azure.com/.default" - ] - } - ], - "securityDefinitions": { - "OAuth2Auth": { - "type": "oauth2", - "flow": "implicit", - "authorizationUrl": "https://login.microsoftonline.com/common/v2.0/oauth2/authorize", - "scopes": { - "https://confidential-ledger.azure.com/.default": "" - }, - "tokenUrl": "https://login.microsoftonline.com/common/v2.0/oauth2/token" - } - }, - "tags": [], - "paths": { - "/app/collections": { - "get": { - "operationId": "ConfidentialLedger_ListCollections", - "summary": "Retrieves a list of collection ids present in the Confidential Ledger", - "description": "Collection ids are user-created collections of ledger entries", - "parameters": [ - { - "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" - } - ], - "responses": { - "200": { - "description": "The request has succeeded.", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/Collection" - }, - "x-ms-identifiers": [] - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" - }, - "headers": { - "x-ms-error-code": { - "type": "string", - "description": "String error code indicating what went wrong." - } - } - } - } - } - }, - "/app/enclaveQuotes": { - "get": { - "operationId": "ConfidentialLedger_GetEnclaveQuotes", - "summary": "Gets quotes for all nodes of the Confidential Ledger.", - "description": "A quote is an SGX enclave measurement that can be used to verify the validity of a node and its enclave.", - "parameters": [ - { - "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" - } - ], - "responses": { - "200": { - "description": "The request has succeeded." - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" - }, - "headers": { - "x-ms-error-code": { - "type": "string", - "description": "String error code indicating what went wrong." - } - } - } - } - } - }, - "/app/governance/constitution": { - "get": { - "operationId": "ConfidentialLedger_GetConstitution", - "summary": "Gets the constitution used for governance.", - "description": "The constitution is a script that assesses and applies proposals from consortium members.", - "parameters": [ - { - "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" - } - ], - "responses": { - "200": { - "description": "The request has succeeded." - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" - }, - "headers": { - "x-ms-error-code": { - "type": "string", - "description": "String error code indicating what went wrong." - } - } - } - } - } - }, - "/app/governance/members": { - "get": { - "operationId": "ConfidentialLedger_GetConsortiumMembers", - "summary": "Gets the consortium members.", - "description": "Consortium members can manage the Confidential Ledger.", - "parameters": [ - { - "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" - } - ], - "responses": { - "200": { - "description": "The request has succeeded." - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" - }, - "headers": { - "x-ms-error-code": { - "type": "string", - "description": "String error code indicating what went wrong." - } - } - } - } - } - }, - "/app/transactions": { - "get": { - "operationId": "ConfidentialLedger_ListLedgerEntries", - "summary": "Gets ledger entries from a collection corresponding to a range.", - "description": "A collection id may optionally be specified. Only entries in the specified (or default) collection will be returned.", - "parameters": [ - { - "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" - } - ], - "responses": { - "200": { - "description": "The request has succeeded.", - "schema": { - "$ref": "#/definitions/PagedLedgerEntries" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" - }, - "headers": { - "x-ms-error-code": { - "type": "string", - "description": "String error code indicating what went wrong." - } - } - } - }, - "x-ms-pageable": { - "nextLinkName": "nextLink" - } - } - }, - "/app/transactions/{transactionId}": { - "get": { - "operationId": "ConfidentialLedger_GetLedgerEntry", - "summary": "Gets the ledger entry at the specified transaction id. A collection id may optionally be specified to indicate the collection from which to fetch the value.", - "description": "Get a LedgerEntry", - "parameters": [ - { - "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" - }, - { - "name": "transactionId", - "in": "path", - "description": "A unique identifier for the state of the ledger. If returned as part of a LedgerEntry, it indicates the state from which the entry was read.", - "required": true, - "type": "string" - } - ], - "responses": { - "200": { - "description": "The request has succeeded.", - "schema": { - "$ref": "#/definitions/LedgerEntry" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" - }, - "headers": { - "x-ms-error-code": { - "type": "string", - "description": "String error code indicating what went wrong." - } - } - } - } - } - }, - "/app/transactions/{transactionId}/receipt": { - "get": { - "operationId": "ConfidentialLedger_GetReceipt", - "summary": "Gets a receipt certifying ledger contents at a particular transaction id.", - "description": "Runs a custom action on LedgerEntry", - "parameters": [ - { - "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" - }, - { - "name": "transactionId", - "in": "path", - "description": "A unique identifier for the state of the ledger. If returned as part of a LedgerEntry, it indicates the state from which the entry was read.", - "required": true, - "type": "string" - } - ], - "responses": { - "200": { - "description": "The request has succeeded.", - "schema": { - "$ref": "#/definitions/TransactionReceipt" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" - }, - "headers": { - "x-ms-error-code": { - "type": "string", - "description": "String error code indicating what went wrong." - } - } - } - } - } - }, - "/app/transactions/{transactionId}/status": { - "get": { - "operationId": "ConfidentialLedger_GetTransactionStatus", - "summary": "Gets a receipt certifying ledger contents at a particular transaction id.", - "description": "Runs a custom action on LedgerEntry", - "parameters": [ - { - "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" - }, - { - "name": "transactionId", - "in": "path", - "description": "A unique identifier for the state of the ledger. If returned as part of a LedgerEntry, it indicates the state from which the entry was read.", - "required": true, - "type": "string" - } - ], - "responses": { - "200": { - "description": "The request has succeeded.", - "schema": { - "$ref": "#/definitions/TransactionStatus" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" - }, - "headers": { - "x-ms-error-code": { - "type": "string", - "description": "String error code indicating what went wrong." - } - } - } - } - } - }, - "/app/transactions/getCurrentLedgerEntry": { - "get": { - "operationId": "ConfidentialLedger_GetCurrentLedgerEntry", - "summary": "Gets the current value available in the ledger.", - "description": "Runs a custom action on LedgerEntry", - "parameters": [ - { - "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" - }, - { - "$ref": "#/parameters/CollectionIdParameter" - } - ], - "responses": { - "200": { - "description": "The request has succeeded.", - "schema": { - "$ref": "#/definitions/LedgerEntry" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" - }, - "headers": { - "x-ms-error-code": { - "type": "string", - "description": "String error code indicating what went wrong." - } - } - } - } - } - }, - "/app/transactions/transactions": { - "post": { - "operationId": "ConfidentialLedger_CreateLedgerEntry", - "summary": "Writes a ledger entry.", - "description": "A collection id may optionally be specified.", - "parameters": [ - { - "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" - }, - { - "name": "resource", - "in": "body", - "description": "The resource instance.", - "required": true, - "schema": { - "$ref": "#/definitions/LedgerEntry" - } - } - ], - "responses": { - "201": { - "description": "The request has succeeded and a new resource has been created as a result.", - "headers": { - "Location": { - "type": "string", - "format": "uri", - "description": "The location of an instance of LedgerEntry" - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" - }, - "headers": { - "x-ms-error-code": { - "type": "string", - "description": "String error code indicating what went wrong." - } - } - } - } - } - }, - "/app/users/{userId}": { - "get": { - "operationId": "ConfidentialLedger_GetUser", - "summary": "Gets a user.", - "description": "Get a LedgerUser", - "parameters": [ - { - "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" - }, - { - "name": "userId", - "in": "path", - "description": "The user id, either an AAD object ID or certificate fingerprint.", - "required": true, - "type": "string", - "x-ms-skip-url-encoding": true - } - ], - "responses": { - "200": { - "description": "The request has succeeded.", - "schema": { - "$ref": "#/definitions/LedgerUser" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" - }, - "headers": { - "x-ms-error-code": { - "type": "string", - "description": "String error code indicating what went wrong." - } - } - } - } - }, - "patch": { - "operationId": "ConfidentialLedger_CreateOrUpdateUser", - "summary": "Adds a user or updates a user's fields.", - "description": "Creates or updates a LedgerUser", - "consumes": [ - "application/merge-patch+json" - ], - "parameters": [ - { - "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" - }, - { - "name": "userId", - "in": "path", - "description": "The user id, either an AAD object ID or certificate fingerprint.", - "required": true, - "type": "string", - "x-ms-skip-url-encoding": true - }, - { - "name": "resource", - "in": "body", - "description": "The resource instance.", - "required": true, - "schema": { - "$ref": "#/definitions/LedgerUserCreateOrUpdate" - } - } - ], - "responses": { - "200": { - "description": "The request has succeeded.", - "schema": { - "$ref": "#/definitions/LedgerUser" - } - }, - "201": { - "description": "The request has succeeded and a new resource has been created as a result.", - "schema": { - "$ref": "#/definitions/LedgerUser" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" - }, - "headers": { - "x-ms-error-code": { - "type": "string", - "description": "String error code indicating what went wrong." - } - } - } - } - }, - "delete": { - "operationId": "ConfidentialLedger_DeleteUser", - "summary": "Deletes a user from the Confidential Ledger.", - "description": "Delete a LedgerUser", - "parameters": [ - { - "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" - }, - { - "name": "userId", - "in": "path", - "description": "The user id, either an AAD object ID or certificate fingerprint.", - "required": true, - "type": "string", - "x-ms-skip-url-encoding": true - } - ], - "responses": { - "204": { - "description": "There is no content to send for this request, but the headers may be useful. " - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" - }, - "headers": { - "x-ms-error-code": { - "type": "string", - "description": "String error code indicating what went wrong." - } - } - } - } - } - } - }, - "definitions": { - "Azure.Core.Foundations.Error": { - "type": "object", - "description": "The error object.", - "properties": { - "code": { - "type": "string", - "description": "One of a server-defined set of error codes." - }, - "message": { - "type": "string", - "description": "A human-readable representation of the error." - }, - "target": { - "type": "string", - "description": "The target of the error." - }, - "details": { - "type": "array", - "description": "An array of details about specific errors that led to this reported error.", - "items": { - "$ref": "#/definitions/Azure.Core.Foundations.Error" - }, - "x-ms-identifiers": [] - }, - "innererror": { - "$ref": "#/definitions/Azure.Core.Foundations.InnerError", - "description": "An object containing more specific information than the current object about the error." - } - }, - "required": [ - "code", - "message" - ] - }, - "Azure.Core.Foundations.ErrorResponse": { - "type": "object", - "description": "A response containing error details.", - "properties": { - "error": { - "$ref": "#/definitions/Azure.Core.Foundations.Error", - "description": "The error object." - } - }, - "required": [ - "error" - ] - }, - "Azure.Core.Foundations.InnerError": { - "type": "object", - "description": "An object containing more specific information about the error. As per Microsoft One API guidelines - https://github.com/Microsoft/api-guidelines/blob/vNext/Guidelines.md#7102-error-condition-responses.", - "properties": { - "code": { - "type": "string", - "description": "One of a server-defined set of error codes." - }, - "innererror": { - "$ref": "#/definitions/Azure.Core.Foundations.InnerError", - "description": "Inner error." - } - } - }, - "Collection": { - "type": "object", - "description": "Identifier for collections.", - "properties": { - "collectionId": { - "type": "string", - "description": "The collection id.", - "readOnly": true - } - }, - "required": [ - "collectionId" - ] - }, - "LedgerEntry": { - "type": "object", - "description": "Details about a ledger entry.", - "properties": { - "contents": { - "type": "string", - "description": "Contents of the ledger entry." - }, - "collectionId": { - "type": "string", - "description": "The collection id.", - "readOnly": true - }, - "transactionId": { - "$ref": "#/definitions/TransactionId", - "description": "A unique identifier for the state of the ledger. If returned as part of a LedgerEntry, it indicates the state from which the entry was read.", - "readOnly": true - } - }, - "required": [ - "contents", - "collectionId", - "transactionId" - ] - }, - "LedgerQueryState": { - "type": "string", - "description": "State of a ledger query.", - "enum": [ - "Loading", - "Ready" - ], - "x-ms-enum": { - "name": "LedgerQueryState", - "modelAsString": false - } - }, - "LedgerUser": { - "type": "object", - "description": "Details about a Confidential ledger user.", - "properties": { - "userId": { - "type": "string", - "description": "The user id, either an AAD object ID or certificate fingerprint.", - "readOnly": true, - "x-ms-skip-url-encoding": true - }, - "assignedRole": { - "$ref": "#/definitions/LedgerUserRole", - "description": "The user's assigned role." - } - }, - "required": [ - "userId", - "assignedRole" - ] - }, - "LedgerUserCreateOrUpdate": { - "type": "object", - "description": "Details about a Confidential ledger user.", - "properties": { - "assignedRole": { - "$ref": "#/definitions/LedgerUserRole", - "description": "The user's assigned role." - } - } - }, - "LedgerUserRole": { - "type": "string", - "description": "Represents an assignable role.", - "enum": [ - "Administrator", - "Contributor", - "Reader" - ], - "x-ms-enum": { - "name": "LedgerUserRole", - "modelAsString": false - } - }, - "MyFlow": { - "type": "object", - "description": "Define the auth flow", - "properties": { - "type": { - "type": "string", - "description": "type of auth flow", - "enum": [ - "implicit" - ] - }, - "authorizationUrl": { - "type": "string", - "description": "authorizationUrl of auth flow", - "enum": [ - "https://login.microsoftonline.com/common/v2.0/oauth2/authorize" - ], - "x-ms-enum": { - "modelAsString": false - } - }, - "tokenUrl": { - "type": "string", - "description": "tokenUrl of auth flow", - "enum": [ - "https://login.microsoftonline.com/common/v2.0/oauth2/token" - ], - "x-ms-enum": { - "modelAsString": false - } - }, - "scopes": { - "type": "array", - "description": "scopes of auth flow", - "items": {} - } - }, - "required": [ - "type", - "authorizationUrl", - "tokenUrl", - "scopes" - ] - }, - "PagedLedgerEntries": { - "type": "object", - "description": "Paginated ledger entries returned in response to a query.", - "properties": { - "entries": { - "type": "array", - "description": "Array of ledger entries.", - "items": { - "$ref": "#/definitions/LedgerEntry" - }, - "x-ms-identifiers": [] - }, - "state": { - "$ref": "#/definitions/LedgerQueryState", - "description": "State of the ledger query." - }, - "nextLink": { - "type": "string", - "format": "uri", - "description": "Path from which to retrieve the next page of results." - } - }, - "required": [ - "entries", - "state" - ] - }, - "ReceiptContents": { - "type": "object", - "description": "The contents of a receipt." - }, - "TransactionId": { - "type": "string", - "description": "A unique identifier for the state of the ledger. If returned as part of a LedgerEntry, it indicates the state from which the entry was read." - }, - "TransactionReceipt": { - "type": "object", - "description": "A receipt certifying the transaction at the specified id.", - "properties": { - "receipt": { - "$ref": "#/definitions/ReceiptContents", - "description": "The receipt contents." - }, - "state": { - "$ref": "#/definitions/LedgerQueryState", - "description": "The state of the ledger query." - }, - "transactionId": { - "$ref": "#/definitions/TransactionId", - "description": "The transaction ID." - } - }, - "required": [ - "receipt", - "state", - "transactionId" - ] - }, - "TransactionState": { - "type": "string", - "description": "Represents the state of the transaction.", - "enum": [ - "Committed", - "Pending" - ], - "x-ms-enum": { - "name": "TransactionState", - "modelAsString": false - } - }, - "TransactionStatus": { - "type": "object", - "description": "Response returned to a query for the transaction status.", - "properties": { - "state": { - "$ref": "#/definitions/TransactionState", - "description": "The transaction state." - }, - "transactionId": { - "$ref": "#/definitions/TransactionId", - "description": "The transaction ID." - } - }, - "required": [ - "state", - "transactionId" - ] - } - }, - "parameters": { - "Azure.Core.Foundations.ApiVersionParameter": { - "name": "api-version", - "in": "query", - "description": "The API version to use for this operation.", - "required": true, - "type": "string", - "minLength": 1, - "x-ms-parameter-location": "method", - "x-ms-client-name": "apiVersion" - }, - "CollectionIdParameter": { - "name": "collectionId", - "in": "query", - "description": "The collection id.", - "required": false, - "type": "string", - "x-ms-parameter-location": "method" - } - } -} diff --git a/packages/typespec-test/test/confidentialLedger/generated/typespec-ts/review/confidential-ledger.api.md b/packages/typespec-test/test/confidentialLedger/generated/typespec-ts/review/confidential-ledger.api.md index aa724927cd..b33ef3a6c7 100644 --- a/packages/typespec-test/test/confidentialLedger/generated/typespec-ts/review/confidential-ledger.api.md +++ b/packages/typespec-test/test/confidentialLedger/generated/typespec-ts/review/confidential-ledger.api.md @@ -30,7 +30,7 @@ export interface ConfidentialLedgerClientOptions extends ClientOptions { } // @public -function createClient(ledgerUri: string, credentials: TokenCredential, { apiVersion, ...options }?: ConfidentialLedgerClientOptions): ConfidentialLedgerClient; +function createClient(ledgerUri: string, credentials: TokenCredential, input?: ConfidentialLedgerClientOptions): ConfidentialLedgerClient; export default createClient; // @public (undocumented) diff --git a/packages/typespec-test/test/contoso/generated/typespec-ts/review/contosowidgetmanager-rest.api.md b/packages/typespec-test/test/contoso/generated/typespec-ts/review/contosowidgetmanager-rest.api.md index 2b8b485f44..8f88896e45 100644 --- a/packages/typespec-test/test/contoso/generated/typespec-ts/review/contosowidgetmanager-rest.api.md +++ b/packages/typespec-test/test/contoso/generated/typespec-ts/review/contosowidgetmanager-rest.api.md @@ -19,7 +19,7 @@ import type { RequestParameters } from '@azure-rest/core-client'; import type { StreamableMethod } from '@azure-rest/core-client'; // @public -function createClient(endpointParam: string, { apiVersion, ...options }?: WidgetManagerClientOptions): WidgetManagerClient; +function createClient(endpointParam: string, input?: WidgetManagerClientOptions): WidgetManagerClient; export default createClient; // @public (undocumented) diff --git a/packages/typespec-test/test/customWrapper/generated/typespec-ts/review/customWrapper.api.md b/packages/typespec-test/test/customWrapper/generated/typespec-ts/review/customWrapper.api.md index 6a7df58d40..53fe360fc8 100644 --- a/packages/typespec-test/test/customWrapper/generated/typespec-ts/review/customWrapper.api.md +++ b/packages/typespec-test/test/customWrapper/generated/typespec-ts/review/customWrapper.api.md @@ -24,7 +24,7 @@ export interface AuthoringClientOptions extends ClientOptions { } // @public -function createClient(endpointParam: string, credentials: KeyCredential, { apiVersion, ...options }?: AuthoringClientOptions): AuthoringClient; +function createClient(endpointParam: string, credentials: KeyCredential, input?: AuthoringClientOptions): AuthoringClient; export default createClient; // @public diff --git a/packages/typespec-test/test/faceai/generated/typespec-ts/review/ai-face-rest.api.md b/packages/typespec-test/test/faceai/generated/typespec-ts/review/ai-face-rest.api.md index 9e45011c52..4fbc666fc5 100644 --- a/packages/typespec-test/test/faceai/generated/typespec-ts/review/ai-face-rest.api.md +++ b/packages/typespec-test/test/faceai/generated/typespec-ts/review/ai-face-rest.api.md @@ -504,7 +504,7 @@ export interface BlurPropertiesOutput { } // @public -function createClient(endpointParam: string, credentials: TokenCredential | KeyCredential, { apiVersion, ...options }?: FaceClientOptions): FaceClient; +function createClient(endpointParam: string, credentials: TokenCredential | KeyCredential, input?: FaceClientOptions): FaceClient; export default createClient; // @public diff --git a/packages/typespec-test/test/healthInsights_trialmatcher/generated/typespec-ts/review/health-insights-clinicalmatching.api.md b/packages/typespec-test/test/healthInsights_trialmatcher/generated/typespec-ts/review/health-insights-clinicalmatching.api.md index 62dc160117..abb6ca859d 100644 --- a/packages/typespec-test/test/healthInsights_trialmatcher/generated/typespec-ts/review/health-insights-clinicalmatching.api.md +++ b/packages/typespec-test/test/healthInsights_trialmatcher/generated/typespec-ts/review/health-insights-clinicalmatching.api.md @@ -191,7 +191,7 @@ export interface ContactDetailsOutput { } // @public -function createClient(endpointParam: string, credentials: KeyCredential, { apiVersion, ...options }?: HealthInsightsClinicalMatchingClientOptions): HealthInsightsClinicalMatchingClient; +function createClient(endpointParam: string, credentials: KeyCredential, input?: HealthInsightsClinicalMatchingClientOptions): HealthInsightsClinicalMatchingClient; export default createClient; // @public (undocumented) diff --git a/packages/typespec-test/test/loadTest/generated/openapi/2022-11-01/openapi.json b/packages/typespec-test/test/loadTest/generated/openapi/2022-11-01/openapi.json deleted file mode 100644 index e5ea6ebcf5..0000000000 --- a/packages/typespec-test/test/loadTest/generated/openapi/2022-11-01/openapi.json +++ /dev/null @@ -1,3523 +0,0 @@ -{ - "swagger": "2.0", - "info": { - "title": "Azure Load Testing", - "version": "2022-11-01", - "description": "These APIs allow end users to create, view and run load tests using Azure Load\nTest Service.", - "x-typespec-generated": [ - { - "emitter": "@azure-tools/typespec-autorest" - } - ] - }, - "schemes": [ - "https" - ], - "x-ms-parameterized-host": { - "hostTemplate": "https://{endpoint}", - "useSchemePrefix": false, - "parameters": [ - { - "name": "endpoint", - "in": "path", - "required": true, - "type": "string" - } - ] - }, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ], - "security": [ - { - "Oauth2": [ - "https://cnt-prod.loadtesting.azure.com/.default" - ] - } - ], - "securityDefinitions": { - "Oauth2": { - "type": "oauth2", - "description": "The Azure Active Directory OAuth2 Flow", - "flow": "implicit", - "authorizationUrl": "https://login.microsoftonline.com/common/oauth2/v2.0/authorize", - "scopes": { - "https://cnt-prod.loadtesting.azure.com/.default": "" - } - } - }, - "tags": [], - "paths": { - "/test-runs": { - "get": { - "operationId": "LoadTestRun_ListTestRuns", - "summary": "Get all test runs with given filters", - "description": "Get all test runs with given filters", - "parameters": [ - { - "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" - }, - { - "name": "orderby", - "in": "query", - "description": "Sort on the supported fields in (field asc/desc) format. eg: executedDateTime\nasc. Supported fields - executedDateTime", - "required": false, - "type": "string" - }, - { - "name": "search", - "in": "query", - "description": "Prefix based, case sensitive search on searchable fields - description,\nexecutedUser. For example, to search for a test run, with description 500 VUs,\nthe search parameter can be 500.", - "required": false, - "type": "string" - }, - { - "name": "testId", - "in": "query", - "description": "Unique name of an existing load test.", - "required": false, - "type": "string" - }, - { - "name": "executionFrom", - "in": "query", - "description": "Start DateTime(ISO 8601 literal format) of test-run execution time filter range.", - "required": false, - "type": "string", - "format": "date-time" - }, - { - "name": "executionTo", - "in": "query", - "description": "End DateTime(ISO 8601 literal format) of test-run execution time filter range.", - "required": false, - "type": "string", - "format": "date-time" - }, - { - "name": "status", - "in": "query", - "description": "Comma separated list of test run status.", - "required": false, - "type": "string" - }, - { - "name": "maxpagesize", - "in": "query", - "description": "Number of results in response.", - "required": false, - "type": "integer", - "format": "int32" - } - ], - "responses": { - "200": { - "description": "The request has succeeded.", - "schema": { - "$ref": "#/definitions/PagedTestRun" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" - }, - "headers": { - "x-ms-error-code": { - "type": "string", - "description": "String error code indicating what went wrong." - } - } - } - }, - "x-ms-pageable": { - "nextLinkName": "nextLink" - } - } - }, - "/test-runs/{testRunId}": { - "get": { - "operationId": "LoadTestRun_GetTestRun", - "summary": "Get test run details by name.", - "description": "Get test run details by name.", - "parameters": [ - { - "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" - }, - { - "name": "testRunId", - "in": "path", - "description": "Unique name for the load test run, must contain only lower-case alphabetic,\nnumeric, underscore or hyphen characters.", - "required": true, - "type": "string" - } - ], - "responses": { - "200": { - "description": "The request has succeeded.", - "schema": { - "$ref": "#/definitions/TestRun" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" - }, - "headers": { - "x-ms-error-code": { - "type": "string", - "description": "String error code indicating what went wrong." - } - } - } - } - }, - "patch": { - "operationId": "LoadTestRun_CreateOrUpdateTestRun", - "summary": "Create and start a new test run with the given name.", - "description": "Create and start a new test run with the given name.", - "consumes": [ - "application/merge-patch+json" - ], - "parameters": [ - { - "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" - }, - { - "name": "testRunId", - "in": "path", - "description": "Unique test run name as identifier", - "required": true, - "type": "string" - }, - { - "name": "oldTestRunId", - "in": "query", - "description": "Existing test run identifier that should be rerun, if this is provided, the\ntest will run with the JMX file, configuration and app components from the\nexisting test run. You can override the configuration values for new test run\nin the request body.", - "required": false, - "type": "string" - }, - { - "name": "resource", - "in": "body", - "description": "The resource instance.", - "required": true, - "schema": { - "$ref": "#/definitions/TestRunCreateOrUpdate" - } - } - ], - "responses": { - "200": { - "description": "The request has succeeded.", - "schema": { - "$ref": "#/definitions/TestRun" - }, - "headers": { - "Operation-Location": { - "type": "string", - "format": "uri", - "description": "The location for monitoring the operation state." - } - } - }, - "201": { - "description": "The request has succeeded and a new resource has been created as a result.", - "schema": { - "$ref": "#/definitions/TestRun" - }, - "headers": { - "Operation-Location": { - "type": "string", - "format": "uri", - "description": "The location for monitoring the operation state." - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" - }, - "headers": { - "x-ms-error-code": { - "type": "string", - "description": "String error code indicating what went wrong." - } - } - } - }, - "x-ms-long-running-operation": true - }, - "delete": { - "operationId": "LoadTestRun_DeleteTestRun", - "summary": "Delete a test run by its name.", - "description": "Delete a test run by its name.", - "parameters": [ - { - "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" - }, - { - "name": "testRunId", - "in": "path", - "description": "Unique name for the load test run, must contain only lower-case alphabetic,\nnumeric, underscore or hyphen characters.", - "required": true, - "type": "string" - } - ], - "responses": { - "204": { - "description": "There is no content to send for this request, but the headers may be useful. " - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" - }, - "headers": { - "x-ms-error-code": { - "type": "string", - "description": "String error code indicating what went wrong." - } - } - } - } - } - }, - "/test-runs/{testRunId}:stop": { - "post": { - "operationId": "LoadTestRun_StopTestRun", - "summary": "Stop test run by name.", - "description": "Stop test run by name.", - "parameters": [ - { - "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" - }, - { - "name": "testRunId", - "in": "path", - "description": "Unique name for the load test run, must contain only lower-case alphabetic,\nnumeric, underscore or hyphen characters.", - "required": true, - "type": "string" - } - ], - "responses": { - "200": { - "description": "The request has succeeded.", - "schema": { - "$ref": "#/definitions/TestRun" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" - }, - "headers": { - "x-ms-error-code": { - "type": "string", - "description": "String error code indicating what went wrong." - } - } - } - } - } - }, - "/test-runs/{testRunId}/app-components": { - "get": { - "operationId": "LoadTestRun_GetAppComponents", - "summary": "Get associated app component (collection of azure resources) for the given test\nrun.", - "description": "Get associated app component (collection of azure resources) for the given test\nrun.", - "parameters": [ - { - "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" - }, - { - "name": "testRunId", - "in": "path", - "description": "Unique name for the load test run, must contain only lower-case alphabetic,\nnumeric, underscore or hyphen characters.", - "required": true, - "type": "string" - } - ], - "responses": { - "200": { - "description": "The request has succeeded.", - "schema": { - "$ref": "#/definitions/TestRunAppComponents" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" - }, - "headers": { - "x-ms-error-code": { - "type": "string", - "description": "String error code indicating what went wrong." - } - } - } - } - }, - "patch": { - "operationId": "LoadTestRun_CreateOrUpdateAppComponents", - "summary": "Associate an app component (collection of azure resources) to a test run", - "description": "Associate an app component (collection of azure resources) to a test run", - "consumes": [ - "application/merge-patch+json" - ], - "parameters": [ - { - "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" - }, - { - "name": "testRunId", - "in": "path", - "description": "Unique name for the load test run, must contain only lower-case alphabetic,\nnumeric, underscore or hyphen characters.", - "required": true, - "type": "string" - }, - { - "name": "body", - "in": "body", - "description": "App Component model.", - "required": true, - "schema": { - "$ref": "#/definitions/TestRunAppComponentsUpdate" - } - } - ], - "responses": { - "200": { - "description": "The request has succeeded.", - "schema": { - "$ref": "#/definitions/TestRunAppComponents" - } - }, - "201": { - "description": "The request has succeeded and a new resource has been created as a result.", - "schema": { - "$ref": "#/definitions/TestRunAppComponents" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" - }, - "headers": { - "x-ms-error-code": { - "type": "string", - "description": "String error code indicating what went wrong." - } - } - } - } - } - }, - "/test-runs/{testRunId}/files/{fileName}": { - "get": { - "operationId": "LoadTestRun_GetTestRunFile", - "summary": "Get test run file by file name.", - "description": "Get test run file by file name.", - "parameters": [ - { - "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" - }, - { - "name": "testRunId", - "in": "path", - "description": "Unique name for the load test run, must contain only lower-case alphabetic,\nnumeric, underscore or hyphen characters.", - "required": true, - "type": "string" - }, - { - "name": "fileName", - "in": "path", - "description": "Test run file name with file extension", - "required": true, - "type": "string" - } - ], - "responses": { - "200": { - "description": "The request has succeeded.", - "schema": { - "$ref": "#/definitions/FileInfo" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" - }, - "headers": { - "x-ms-error-code": { - "type": "string", - "description": "String error code indicating what went wrong." - } - } - } - } - } - }, - "/test-runs/{testRunId}/metric-definitions": { - "get": { - "operationId": "LoadTestRun_ListMetricDefinitions", - "summary": "List the metric definitions for a load test run.", - "description": "List the metric definitions for a load test run.", - "parameters": [ - { - "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" - }, - { - "name": "testRunId", - "in": "path", - "description": "Unique name for the load test run, must contain only lower-case alphabetic,\nnumeric, underscore or hyphen characters.", - "required": true, - "type": "string" - }, - { - "name": "metricNamespace", - "in": "query", - "description": "Metric namespace to query metric definitions for.", - "required": false, - "type": "string" - } - ], - "responses": { - "200": { - "description": "The request has succeeded.", - "schema": { - "$ref": "#/definitions/MetricDefinitionCollection" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" - }, - "headers": { - "x-ms-error-code": { - "type": "string", - "description": "String error code indicating what went wrong." - } - } - } - } - } - }, - "/test-runs/{testRunId}/metric-dimensions/{name}/values": { - "get": { - "operationId": "LoadTestRun_ListMetricDimensionValues", - "summary": "List the dimension values for the given metric dimension name.", - "description": "List the dimension values for the given metric dimension name.", - "parameters": [ - { - "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" - }, - { - "name": "testRunId", - "in": "path", - "description": "Unique test run name as identifier", - "required": true, - "type": "string" - }, - { - "name": "name", - "in": "path", - "description": "Dimension name", - "required": true, - "type": "string" - }, - { - "$ref": "#/parameters/MetricDimensions.interval" - }, - { - "$ref": "#/parameters/MetricDimensions.metricName" - }, - { - "$ref": "#/parameters/MetricDimensions.metricNamespace" - }, - { - "$ref": "#/parameters/MetricDimensions.timespan" - } - ], - "responses": { - "200": { - "description": "The request has succeeded.", - "schema": { - "$ref": "#/definitions/PagedDimensionValueList" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" - }, - "headers": { - "x-ms-error-code": { - "type": "string", - "description": "String error code indicating what went wrong." - } - } - } - }, - "x-ms-pageable": { - "nextLinkName": "nextLink" - } - } - }, - "/test-runs/{testRunId}/metric-namespaces": { - "get": { - "operationId": "LoadTestRun_ListMetricNamespaces", - "summary": "List the metric namespaces for a load test run.", - "description": "List the metric namespaces for a load test run.", - "parameters": [ - { - "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" - }, - { - "name": "testRunId", - "in": "path", - "description": "Unique name for the load test run, must contain only lower-case alphabetic,\nnumeric, underscore or hyphen characters.", - "required": true, - "type": "string" - } - ], - "responses": { - "200": { - "description": "The request has succeeded.", - "schema": { - "$ref": "#/definitions/MetricNamespaceCollection" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" - }, - "headers": { - "x-ms-error-code": { - "type": "string", - "description": "String error code indicating what went wrong." - } - } - } - } - } - }, - "/test-runs/{testRunId}/metrics": { - "post": { - "operationId": "LoadTestRun_ListMetrics", - "summary": "List the metric values for a load test run.", - "description": "List the metric values for a load test run.", - "parameters": [ - { - "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" - }, - { - "name": "testRunId", - "in": "path", - "description": "Unique name for the load test run, must contain only lower-case alphabetic,\nnumeric, underscore or hyphen characters.", - "required": true, - "type": "string" - }, - { - "name": "aggregation", - "in": "query", - "description": "The aggregation", - "required": false, - "type": "string" - }, - { - "name": "interval", - "in": "query", - "description": "The interval (i.e. timegrain) of the query.", - "required": false, - "type": "string", - "enum": [ - "PT5S", - "PT10S", - "PT1M", - "PT5M", - "PT1H" - ], - "x-ms-enum": { - "name": "Interval", - "modelAsString": true, - "values": [ - { - "name": "PT5S", - "value": "PT5S", - "description": "5 seconds, available only if test run duration is less than 10 minutes" - }, - { - "name": "PT10S", - "value": "PT10S", - "description": "10 seconds, available only if test run duration is less than 10 minutes" - }, - { - "name": "PT1M", - "value": "PT1M", - "description": "1 minute" - }, - { - "name": "PT5M", - "value": "PT5M", - "description": "5 minutes, available only if test run duration is greater than 1 minute" - }, - { - "name": "PT1H", - "value": "PT1H", - "description": "1 hour, available only if test run duration is greater than 1 minute" - } - ] - } - }, - { - "name": "metricName", - "in": "query", - "description": "Metric name", - "required": false, - "type": "string" - }, - { - "name": "metricNamespace", - "in": "query", - "description": "Metric namespace to query metric definitions for.", - "required": false, - "type": "string" - }, - { - "name": "timespan", - "in": "query", - "description": "The timespan of the query. It is a string with the following format\n'startDateTime_ISO/endDateTime_ISO'.", - "required": false, - "type": "string" - }, - { - "name": "body", - "in": "body", - "description": "Metric dimension filter ", - "required": true, - "schema": { - "$ref": "#/definitions/MetricRequestPayload" - } - } - ], - "responses": { - "200": { - "description": "The request has succeeded.", - "schema": { - "$ref": "#/definitions/PagedTimeSeriesElement" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" - }, - "headers": { - "x-ms-error-code": { - "type": "string", - "description": "String error code indicating what went wrong." - } - } - } - }, - "x-ms-pageable": { - "nextLinkName": "nextLink" - } - } - }, - "/test-runs/{testRunId}/server-metrics-config": { - "get": { - "operationId": "LoadTestRun_GetServerMetricsConfig", - "summary": "List server metrics configuration for the given test run.", - "description": "List server metrics configuration for the given test run.", - "parameters": [ - { - "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" - }, - { - "name": "testRunId", - "in": "path", - "description": "Unique name for the load test run, must contain only lower-case alphabetic,\nnumeric, underscore or hyphen characters.", - "required": true, - "type": "string" - } - ], - "responses": { - "200": { - "description": "The request has succeeded.", - "schema": { - "$ref": "#/definitions/TestRunServerMetricConfig" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" - }, - "headers": { - "x-ms-error-code": { - "type": "string", - "description": "String error code indicating what went wrong." - } - } - } - } - }, - "patch": { - "operationId": "LoadTestRun_CreateOrUpdateServerMetricsConfig", - "summary": "Configure server metrics for a test run", - "description": "Configure server metrics for a test run", - "consumes": [ - "application/merge-patch+json" - ], - "parameters": [ - { - "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" - }, - { - "name": "testRunId", - "in": "path", - "description": "Unique name for the load test run, must contain only lower-case alphabetic,\nnumeric, underscore or hyphen characters.", - "required": true, - "type": "string" - }, - { - "name": "body", - "in": "body", - "description": "Server metric configuration model.", - "required": true, - "schema": { - "$ref": "#/definitions/TestRunServerMetricConfig" - } - } - ], - "responses": { - "200": { - "description": "The request has succeeded.", - "schema": { - "$ref": "#/definitions/TestRunServerMetricConfig" - } - }, - "201": { - "description": "The request has succeeded and a new resource has been created as a result.", - "schema": { - "$ref": "#/definitions/TestRunServerMetricConfig" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" - }, - "headers": { - "x-ms-error-code": { - "type": "string", - "description": "String error code indicating what went wrong." - } - } - } - } - } - }, - "/tests": { - "get": { - "operationId": "LoadTestAdministration_ListTests", - "summary": "Get all load tests by the fully qualified resource Id e.g\nsubscriptions/{subId}/resourceGroups/{rg}/providers/Microsoft.LoadTestService/loadtests/{resName}.", - "description": "Get all load tests by the fully qualified resource Id e.g\nsubscriptions/{subId}/resourceGroups/{rg}/providers/Microsoft.LoadTestService/loadtests/{resName}.", - "parameters": [ - { - "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" - }, - { - "name": "orderby", - "in": "query", - "description": "Sort on the supported fields in (field asc/desc) format. eg:\nlastModifiedDateTime asc. Supported fields - lastModifiedDateTime", - "required": false, - "type": "string" - }, - { - "name": "search", - "in": "query", - "description": "Prefix based, case sensitive search on searchable fields - displayName,\ncreatedBy. For example, to search for a test, with display name is Login Test,\nthe search parameter can be Login.", - "required": false, - "type": "string" - }, - { - "name": "lastModifiedStartTime", - "in": "query", - "description": "Start DateTime(ISO 8601 literal format) of the last updated time range to\nfilter tests.", - "required": false, - "type": "string", - "format": "date-time" - }, - { - "name": "lastModifiedEndTime", - "in": "query", - "description": "End DateTime(ISO 8601 literal format) of the last updated time range to filter\ntests.", - "required": false, - "type": "string", - "format": "date-time" - }, - { - "name": "maxpagesize", - "in": "query", - "description": "Number of results in response.", - "required": false, - "type": "integer", - "format": "int32" - } - ], - "responses": { - "200": { - "description": "The request has succeeded.", - "schema": { - "$ref": "#/definitions/PagedTest" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" - }, - "headers": { - "x-ms-error-code": { - "type": "string", - "description": "String error code indicating what went wrong." - } - } - } - }, - "x-ms-pageable": { - "nextLinkName": "nextLink" - } - } - }, - "/tests/{testId}": { - "get": { - "operationId": "LoadTestAdministration_GetTest", - "summary": "Get load test details by test name", - "description": "Get load test details by test name", - "parameters": [ - { - "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" - }, - { - "name": "testId", - "in": "path", - "description": "Unique name for the load test, must contain only lower-case alphabetic,\nnumeric, underscore or hyphen characters.", - "required": true, - "type": "string" - } - ], - "responses": { - "200": { - "description": "The request has succeeded.", - "schema": { - "$ref": "#/definitions/Test" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" - }, - "headers": { - "x-ms-error-code": { - "type": "string", - "description": "String error code indicating what went wrong." - } - } - } - } - }, - "patch": { - "operationId": "LoadTestAdministration_CreateOrUpdateTest", - "summary": "Create a new test or update an existing test.", - "description": "Create a new test or update an existing test.", - "consumes": [ - "application/merge-patch+json" - ], - "parameters": [ - { - "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" - }, - { - "name": "testId", - "in": "path", - "description": "Unique name for the load test, must contain only lower-case alphabetic,\nnumeric, underscore or hyphen characters.", - "required": true, - "type": "string" - }, - { - "name": "body", - "in": "body", - "description": "Load test model", - "required": true, - "schema": { - "$ref": "#/definitions/Test" - } - } - ], - "responses": { - "200": { - "description": "The request has succeeded.", - "schema": { - "$ref": "#/definitions/Test" - } - }, - "201": { - "description": "The request has succeeded and a new resource has been created as a result.", - "schema": { - "$ref": "#/definitions/Test" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" - }, - "headers": { - "x-ms-error-code": { - "type": "string", - "description": "String error code indicating what went wrong." - } - } - } - } - }, - "delete": { - "operationId": "LoadTestAdministration_DeleteTest", - "summary": "Delete a test by its name.", - "description": "Delete a test by its name.", - "parameters": [ - { - "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" - }, - { - "name": "testId", - "in": "path", - "description": "Unique name for the load test, must contain only lower-case alphabetic,\nnumeric, underscore or hyphen characters.", - "required": true, - "type": "string" - } - ], - "responses": { - "204": { - "description": "There is no content to send for this request, but the headers may be useful. " - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" - }, - "headers": { - "x-ms-error-code": { - "type": "string", - "description": "String error code indicating what went wrong." - } - } - } - } - } - }, - "/tests/{testId}/app-components": { - "get": { - "operationId": "LoadTestAdministration_GetAppComponents", - "summary": "Get associated app component (collection of azure resources) for the given test.", - "description": "Get associated app component (collection of azure resources) for the given test.", - "parameters": [ - { - "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" - }, - { - "name": "testId", - "in": "path", - "description": "Unique name for the load test, must contain only lower-case alphabetic,\nnumeric, underscore or hyphen characters.", - "required": true, - "type": "string" - } - ], - "responses": { - "200": { - "description": "The request has succeeded.", - "schema": { - "$ref": "#/definitions/TestAppComponents" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" - }, - "headers": { - "x-ms-error-code": { - "type": "string", - "description": "String error code indicating what went wrong." - } - } - } - } - }, - "patch": { - "operationId": "LoadTestAdministration_CreateOrUpdateAppComponents", - "summary": "Associate an app component (collection of azure resources) to a test", - "description": "Associate an app component (collection of azure resources) to a test", - "consumes": [ - "application/merge-patch+json" - ], - "parameters": [ - { - "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" - }, - { - "name": "testId", - "in": "path", - "description": "Unique name for the load test, must contain only lower-case alphabetic,\nnumeric, underscore or hyphen characters.", - "required": true, - "type": "string" - }, - { - "name": "body", - "in": "body", - "description": "App Component model.", - "required": true, - "schema": { - "$ref": "#/definitions/TestAppComponentsUpdate" - } - } - ], - "responses": { - "200": { - "description": "The request has succeeded.", - "schema": { - "$ref": "#/definitions/TestAppComponents" - } - }, - "201": { - "description": "The request has succeeded and a new resource has been created as a result.", - "schema": { - "$ref": "#/definitions/TestAppComponents" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" - }, - "headers": { - "x-ms-error-code": { - "type": "string", - "description": "String error code indicating what went wrong." - } - } - } - } - } - }, - "/tests/{testId}/files": { - "get": { - "operationId": "LoadTestAdministration_ListTestFiles", - "summary": "Get all test files.", - "description": "Get all test files.", - "parameters": [ - { - "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" - }, - { - "name": "testId", - "in": "path", - "description": "Unique name for the load test, must contain only lower-case alphabetic,\nnumeric, underscore or hyphen characters.", - "required": true, - "type": "string" - } - ], - "responses": { - "200": { - "description": "The request has succeeded.", - "schema": { - "$ref": "#/definitions/PagedFileInfo" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" - }, - "headers": { - "x-ms-error-code": { - "type": "string", - "description": "String error code indicating what went wrong." - } - } - } - }, - "x-ms-pageable": { - "nextLinkName": "nextLink" - } - } - }, - "/tests/{testId}/files/{fileName}": { - "get": { - "operationId": "LoadTestAdministration_GetTestFile", - "summary": "Get test file by the file name.", - "description": "Get test file by the file name.", - "parameters": [ - { - "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" - }, - { - "name": "testId", - "in": "path", - "description": "Unique name for the load test, must contain only lower-case alphabetic,\nnumeric, underscore or hyphen characters.", - "required": true, - "type": "string" - }, - { - "name": "fileName", - "in": "path", - "description": "File name with file extension like app.jmx", - "required": true, - "type": "string" - } - ], - "responses": { - "200": { - "description": "The request has succeeded.", - "schema": { - "$ref": "#/definitions/FileInfo" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" - }, - "headers": { - "x-ms-error-code": { - "type": "string", - "description": "String error code indicating what went wrong." - } - } - } - } - }, - "put": { - "operationId": "LoadTestAdministration_UploadTestFile", - "summary": "Upload input file for a given test name. File size can't be more than 50 MB.\nExisting file with same name for the given test will be overwritten. File\nshould be provided in the request body as application/octet-stream.", - "description": "Upload input file for a given test name. File size can't be more than 50 MB.\nExisting file with same name for the given test will be overwritten. File\nshould be provided in the request body as application/octet-stream.", - "consumes": [ - "application/octet-stream" - ], - "parameters": [ - { - "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" - }, - { - "name": "testId", - "in": "path", - "description": "Unique name for the load test, must contain only lower-case alphabetic,\nnumeric, underscore or hyphen characters.", - "required": true, - "type": "string" - }, - { - "name": "fileName", - "in": "path", - "description": "Unique name for test file with file extension like : App.jmx", - "required": true, - "type": "string" - }, - { - "name": "fileType", - "in": "query", - "description": "File type", - "required": false, - "type": "string", - "enum": [ - "JMX_FILE", - "USER_PROPERTIES", - "ADDITIONAL_ARTIFACTS" - ], - "x-ms-enum": { - "name": "FileType", - "modelAsString": true, - "values": [ - { - "name": "JMX_FILE", - "value": "JMX_FILE", - "description": "If file is jmx script" - }, - { - "name": "USER_PROPERTIES", - "value": "USER_PROPERTIES", - "description": "If file is user properties" - }, - { - "name": "ADDITIONAL_ARTIFACTS", - "value": "ADDITIONAL_ARTIFACTS", - "description": "If file is not any of other supported type" - } - ] - } - }, - { - "name": "body", - "in": "body", - "description": "The file content as application/octet-stream.", - "required": true, - "schema": { - "type": "string", - "format": "binary" - } - } - ], - "responses": { - "201": { - "description": "The request has succeeded and a new resource has been created as a result.", - "schema": { - "$ref": "#/definitions/FileInfo" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" - }, - "headers": { - "x-ms-error-code": { - "type": "string", - "description": "String error code indicating what went wrong." - } - } - } - } - }, - "delete": { - "operationId": "LoadTestAdministration_DeleteTestFile", - "summary": "Delete file by the file name for a test", - "description": "Delete file by the file name for a test", - "parameters": [ - { - "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" - }, - { - "name": "testId", - "in": "path", - "description": "Unique name for the load test, must contain only lower-case alphabetic,\nnumeric, underscore or hyphen characters.", - "required": true, - "type": "string" - }, - { - "name": "fileName", - "in": "path", - "description": "File name with file extension like app.jmx", - "required": true, - "type": "string" - } - ], - "responses": { - "204": { - "description": "There is no content to send for this request, but the headers may be useful. " - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" - }, - "headers": { - "x-ms-error-code": { - "type": "string", - "description": "String error code indicating what went wrong." - } - } - } - } - } - }, - "/tests/{testId}/server-metrics-config": { - "get": { - "operationId": "LoadTestAdministration_GetServerMetricsConfig", - "summary": "List server metrics configuration for the given test.", - "description": "List server metrics configuration for the given test.", - "parameters": [ - { - "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" - }, - { - "name": "testId", - "in": "path", - "description": "Unique name for the load test, must contain only lower-case alphabetic,\nnumeric, underscore or hyphen characters.", - "required": true, - "type": "string" - } - ], - "responses": { - "200": { - "description": "The request has succeeded.", - "schema": { - "$ref": "#/definitions/TestServerMetricConfig" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" - }, - "headers": { - "x-ms-error-code": { - "type": "string", - "description": "String error code indicating what went wrong." - } - } - } - } - }, - "patch": { - "operationId": "LoadTestAdministration_CreateOrUpdateServerMetricsConfig", - "summary": "Configure server metrics for a test", - "description": "Configure server metrics for a test", - "consumes": [ - "application/merge-patch+json" - ], - "parameters": [ - { - "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" - }, - { - "name": "testId", - "in": "path", - "description": "Unique name for the load test, must contain only lower-case alphabetic,\nnumeric, underscore or hyphen characters.", - "required": true, - "type": "string" - }, - { - "name": "body", - "in": "body", - "description": "Server metric configuration model.", - "required": true, - "schema": { - "$ref": "#/definitions/TestServerMetricConfig" - } - } - ], - "responses": { - "200": { - "description": "The request has succeeded.", - "schema": { - "$ref": "#/definitions/TestServerMetricConfig" - } - }, - "201": { - "description": "The request has succeeded and a new resource has been created as a result.", - "schema": { - "$ref": "#/definitions/TestServerMetricConfig" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" - }, - "headers": { - "x-ms-error-code": { - "type": "string", - "description": "String error code indicating what went wrong." - } - } - } - } - } - } - }, - "definitions": { - "APIVersions": { - "type": "string", - "enum": [ - "2022-11-01" - ], - "x-ms-enum": { - "name": "APIVersions", - "modelAsString": true, - "values": [ - { - "name": "v2022_11_01", - "value": "2022-11-01" - } - ] - } - }, - "AggregationType": { - "type": "string", - "enum": [ - "Average", - "Count", - "None", - "Total", - "Percentile90", - "Percentile95", - "Percentile99" - ], - "x-ms-enum": { - "name": "AggregationType", - "modelAsString": true, - "values": [ - { - "name": "Average", - "value": "Average", - "description": "Average value" - }, - { - "name": "Count", - "value": "Count", - "description": "Total count" - }, - { - "name": "None", - "value": "None", - "description": "Aggregation will be average in this case" - }, - { - "name": "Total", - "value": "Total", - "description": "Total sum" - }, - { - "name": "Percentile90", - "value": "Percentile90", - "description": "90th percentile" - }, - { - "name": "Percentile95", - "value": "Percentile95", - "description": "95th percentile" - }, - { - "name": "Percentile99", - "value": "Percentile99", - "description": "99th percentile" - } - ] - } - }, - "AppComponent": { - "type": "object", - "description": "An Azure resource object (Refer azure generic resource model :\nhttps://docs.microsoft.com/en-us/rest/api/resources/resources/get-by-id#genericresource)", - "properties": { - "resourceId": { - "type": "string", - "description": "fully qualified resource Id e.g\nsubscriptions/{subId}/resourceGroups/{rg}/providers/Microsoft.LoadTestService/loadtests/{resName}", - "readOnly": true - }, - "resourceName": { - "type": "string", - "description": "Azure resource name, required while creating the app component." - }, - "resourceType": { - "type": "string", - "description": "Azure resource type, required while creating the app component." - }, - "displayName": { - "type": "string", - "description": "Azure resource display name" - }, - "resourceGroup": { - "type": "string", - "description": "Resource group name of the Azure resource", - "readOnly": true - }, - "subscriptionId": { - "type": "string", - "description": "Subscription Id of the Azure resource", - "readOnly": true - }, - "kind": { - "type": "string", - "description": "Kind of Azure resource type" - } - } - }, - "Azure.Core.Foundations.Error": { - "type": "object", - "description": "The error object.", - "properties": { - "code": { - "type": "string", - "description": "One of a server-defined set of error codes." - }, - "message": { - "type": "string", - "description": "A human-readable representation of the error." - }, - "target": { - "type": "string", - "description": "The target of the error." - }, - "details": { - "type": "array", - "description": "An array of details about specific errors that led to this reported error.", - "items": { - "$ref": "#/definitions/Azure.Core.Foundations.Error" - }, - "x-ms-identifiers": [] - }, - "innererror": { - "$ref": "#/definitions/Azure.Core.Foundations.InnerError", - "description": "An object containing more specific information than the current object about the error." - } - }, - "required": [ - "code", - "message" - ] - }, - "Azure.Core.Foundations.ErrorResponse": { - "type": "object", - "description": "A response containing error details.", - "properties": { - "error": { - "$ref": "#/definitions/Azure.Core.Foundations.Error", - "description": "The error object." - } - }, - "required": [ - "error" - ] - }, - "Azure.Core.Foundations.InnerError": { - "type": "object", - "description": "An object containing more specific information about the error. As per Microsoft One API guidelines - https://github.com/Microsoft/api-guidelines/blob/vNext/Guidelines.md#7102-error-condition-responses.", - "properties": { - "code": { - "type": "string", - "description": "One of a server-defined set of error codes." - }, - "innererror": { - "$ref": "#/definitions/Azure.Core.Foundations.InnerError", - "description": "Inner error." - } - } - }, - "CertificateMetadata": { - "type": "object", - "description": "Certificates metadata", - "properties": { - "value": { - "type": "string", - "description": "The value of the certificate for respective type" - }, - "type": { - "$ref": "#/definitions/CertificateType", - "description": "Type of certificate" - }, - "name": { - "type": "string", - "description": "Name of the certificate." - } - } - }, - "CertificateType": { - "type": "string", - "enum": [ - "AKV_CERT_URI" - ], - "x-ms-enum": { - "name": "CertificateType", - "modelAsString": true, - "values": [ - { - "name": "AKV_CERT_URI", - "value": "AKV_CERT_URI", - "description": "If the certificate is stored in an Azure Key Vault" - } - ] - } - }, - "Dimension": { - "type": "object" - }, - "DimensionFilter": { - "type": "object", - "description": "Dimension name and values to filter", - "properties": { - "name": { - "type": "string", - "description": "The dimension name" - }, - "values": { - "type": "array", - "description": "The dimension values. Maximum values can be 20.", - "items": { - "type": "string" - } - } - } - }, - "DimensionValue": { - "type": "object", - "description": "Represents a metric dimension value.", - "properties": { - "name": { - "type": "string", - "description": "The name of the dimension." - }, - "value": { - "type": "string", - "description": "The value of the dimension." - } - } - }, - "DimensionValueList": { - "type": "object", - "properties": { - "value": { - "type": "array", - "items": { - "type": "string" - } - } - }, - "required": [ - "value" - ] - }, - "Error": { - "type": "object", - "description": "Error from a REST request.", - "properties": { - "code": { - "type": "string", - "description": "The error code." - }, - "message": { - "type": "string", - "description": "The error message." - }, - "target": { - "type": "string", - "description": "The error target." - }, - "details": { - "type": "array", - "description": "Additional details and inner errors.", - "items": { - "$ref": "#/definitions/Error" - }, - "x-ms-identifiers": [] - } - }, - "required": [ - "code", - "message" - ] - }, - "ErrorDetails": { - "type": "object", - "description": "Error details if there is any failure in load test run", - "properties": { - "message": { - "type": "string", - "description": "Error details in case test run was not successfully run.", - "readOnly": true - } - } - }, - "ErrorResponseBody": { - "type": "object", - "description": "The definition of an error object.", - "properties": { - "error": { - "$ref": "#/definitions/Error", - "description": "Error from a REST request." - } - }, - "required": [ - "error" - ] - }, - "FileInfo": { - "type": "object", - "description": "File info", - "properties": { - "url": { - "type": "string", - "description": "File URL." - }, - "fileName": { - "type": "string", - "description": "Name of the file." - }, - "fileType": { - "$ref": "#/definitions/FileType", - "description": "File type" - }, - "expireDateTime": { - "type": "string", - "format": "date-time", - "description": "Expiry time of the file (ISO 8601 literal format)" - }, - "validationStatus": { - "$ref": "#/definitions/FileStatus", - "description": "Validation status of the file" - }, - "validationFailureDetails": { - "type": "string", - "description": "Validation failure error details" - } - } - }, - "FileStatus": { - "type": "string", - "enum": [ - "NOT_VALIDATED", - "VALIDATION_SUCCESS", - "VALIDATION_FAILURE", - "VALIDATION_INITIATED", - "VALIDATION_NOT_REQUIRED" - ], - "x-ms-enum": { - "name": "FileStatus", - "modelAsString": true, - "values": [ - { - "name": "NOT_VALIDATED", - "value": "NOT_VALIDATED", - "description": "File is not validated." - }, - { - "name": "VALIDATION_SUCCESS", - "value": "VALIDATION_SUCCESS", - "description": "File is validated." - }, - { - "name": "VALIDATION_FAILURE", - "value": "VALIDATION_FAILURE", - "description": "File validation is failed." - }, - { - "name": "VALIDATION_INITIATED", - "value": "VALIDATION_INITIATED", - "description": "File validation is in progress." - }, - { - "name": "VALIDATION_NOT_REQUIRED", - "value": "VALIDATION_NOT_REQUIRED", - "description": "Validation is not required." - } - ] - } - }, - "FileType": { - "type": "string", - "enum": [ - "JMX_FILE", - "USER_PROPERTIES", - "ADDITIONAL_ARTIFACTS" - ], - "x-ms-enum": { - "name": "FileType", - "modelAsString": true, - "values": [ - { - "name": "JMX_FILE", - "value": "JMX_FILE", - "description": "If file is jmx script" - }, - { - "name": "USER_PROPERTIES", - "value": "USER_PROPERTIES", - "description": "If file is user properties" - }, - { - "name": "ADDITIONAL_ARTIFACTS", - "value": "ADDITIONAL_ARTIFACTS", - "description": "If file is not any of other supported type" - } - ] - } - }, - "Interval": { - "type": "string", - "enum": [ - "PT5S", - "PT10S", - "PT1M", - "PT5M", - "PT1H" - ], - "x-ms-enum": { - "name": "Interval", - "modelAsString": true, - "values": [ - { - "name": "PT5S", - "value": "PT5S", - "description": "5 seconds, available only if test run duration is less than 10 minutes" - }, - { - "name": "PT10S", - "value": "PT10S", - "description": "10 seconds, available only if test run duration is less than 10 minutes" - }, - { - "name": "PT1M", - "value": "PT1M", - "description": "1 minute" - }, - { - "name": "PT5M", - "value": "PT5M", - "description": "5 minutes, available only if test run duration is greater than 1 minute" - }, - { - "name": "PT1H", - "value": "PT1H", - "description": "1 hour, available only if test run duration is greater than 1 minute" - } - ] - } - }, - "LoadTestConfiguration": { - "type": "object", - "description": "The load test configuration.", - "properties": { - "engineInstances": { - "type": "integer", - "format": "int32", - "description": "The number of engine instances to execute load test. Supported values are in\nrange of 1-45. Required for creating a new test." - }, - "splitAllCSVs": { - "type": "boolean", - "description": "If false, Azure Load Testing copies and processes your input files unmodified\nacross all test engine instances. If true, Azure Load Testing splits the CSV\ninput data evenly across all engine instances. If you provide multiple CSV\nfiles, each file will be split evenly." - }, - "quickStartTest": { - "type": "boolean", - "description": "If true, optionalLoadTestConfig is required and JMX script for the load test is\nnot required to upload." - }, - "optionalLoadTestConfig": { - "$ref": "#/definitions/OptionalLoadTestConfig", - "description": "Optional load test config" - } - } - }, - "MetricAvailability": { - "type": "object", - "description": "Metric availability specifies the time grain (aggregation interval or frequency)", - "properties": { - "timeGrain": { - "$ref": "#/definitions/TimeGrain", - "description": "The time grain specifies the aggregation interval for the metric. Expressed as\na duration 'PT1M', 'PT1H', etc." - } - } - }, - "MetricDefinition": { - "type": "object", - "description": "Metric definition", - "properties": { - "dimensions": { - "type": "array", - "description": "List of dimensions", - "items": { - "$ref": "#/definitions/NameAndDesc" - }, - "x-ms-identifiers": [] - }, - "description": { - "type": "string", - "description": "The metric description" - }, - "name": { - "type": "string", - "description": "The metric name" - }, - "namespace": { - "type": "string", - "description": "The namespace the metric belongs to." - }, - "primaryAggregationType": { - "$ref": "#/definitions/AggregationType", - "description": "The primary aggregation type value defining how to use the values for display." - }, - "supportedAggregationTypes": { - "type": "array", - "description": "The collection of what all aggregation types are supported.", - "items": { - "type": "string" - } - }, - "unit": { - "$ref": "#/definitions/MetricUnit", - "description": "The unit of the metric." - }, - "metricAvailabilities": { - "type": "array", - "description": "Metric availability specifies the time grain (aggregation interval or\nfrequency).", - "items": { - "$ref": "#/definitions/MetricAvailability" - }, - "x-ms-identifiers": [] - } - } - }, - "MetricDefinitionCollection": { - "type": "object", - "description": "Represents collection of metric definitions.", - "properties": { - "value": { - "type": "array", - "description": "the values for the metric definitions.", - "items": { - "$ref": "#/definitions/MetricDefinition" - }, - "x-ms-identifiers": [] - } - }, - "required": [ - "value" - ] - }, - "MetricNamespace": { - "type": "object", - "description": "Metric namespace class specifies the metadata for a metric namespace.", - "properties": { - "description": { - "type": "string", - "description": "The namespace description." - }, - "name": { - "type": "string", - "description": "The metric namespace name." - } - } - }, - "MetricNamespaceCollection": { - "type": "object", - "description": "Represents collection of metric namespaces.", - "properties": { - "value": { - "type": "array", - "description": "The values for the metric namespaces.", - "items": { - "$ref": "#/definitions/MetricNamespace" - }, - "x-ms-identifiers": [] - } - }, - "required": [ - "value" - ] - }, - "MetricRequestPayload": { - "type": "object", - "description": "Filters to fetch the set of metric", - "properties": { - "filters": { - "type": "array", - "description": "Get metrics for specific dimension values. Example: Metric contains dimension\nlike SamplerName, Error. To retrieve all the time series data where SamplerName\nis equals to HTTPRequest1 or HTTPRequest2, the DimensionFilter value will be\n{\"SamplerName\", [\"HTTPRequest1\", \"HTTPRequest2\"}", - "items": { - "$ref": "#/definitions/DimensionFilter" - }, - "x-ms-identifiers": [] - } - } - }, - "MetricUnit": { - "type": "string", - "enum": [ - "NotSpecified", - "Percent", - "Count", - "Seconds", - "Milliseconds", - "Bytes", - "BytesPerSecond", - "CountPerSecond" - ], - "x-ms-enum": { - "name": "MetricUnit", - "modelAsString": true, - "values": [ - { - "name": "NotSpecified", - "value": "NotSpecified", - "description": "No unit specified" - }, - { - "name": "Percent", - "value": "Percent", - "description": "Percentage" - }, - { - "name": "Count", - "value": "Count", - "description": "Value count" - }, - { - "name": "Seconds", - "value": "Seconds", - "description": "Seconds" - }, - { - "name": "Milliseconds", - "value": "Milliseconds", - "description": "Milliseconds" - }, - { - "name": "Bytes", - "value": "Bytes", - "description": "Bytes" - }, - { - "name": "BytesPerSecond", - "value": "BytesPerSecond", - "description": "Bytes per second" - }, - { - "name": "CountPerSecond", - "value": "CountPerSecond", - "description": "Count per second" - } - ] - } - }, - "MetricValue": { - "type": "object", - "description": "Represents a metric value.", - "properties": { - "timestamp": { - "type": "string", - "description": "The timestamp for the metric value in ISO 8601 format." - }, - "value": { - "type": "number", - "format": "float", - "description": "The metric value." - } - } - }, - "NameAndDesc": { - "type": "object", - "description": "The name and description", - "properties": { - "description": { - "type": "string", - "description": "The description" - }, - "name": { - "type": "string", - "description": "The name" - } - } - }, - "Oauth2": { - "type": "object", - "description": "The Azure Active Directory OAuth2 Flow", - "properties": { - "type": { - "type": "string", - "description": "OAuth2 authentication", - "enum": [ - "oauth2" - ] - }, - "flows": { - "type": "array", - "description": "Supported OAuth2 flows", - "items": {} - }, - "defaultScopes": { - "type": "array", - "description": "Oauth2 scopes of every flow. Overridden by scope definitions in specific flows", - "items": {} - } - }, - "required": [ - "type", - "flows", - "defaultScopes" - ] - }, - "OptionalLoadTestConfig": { - "type": "object", - "description": "Optional load test config", - "properties": { - "endpointUrl": { - "type": "string", - "description": "Test URL. Provide the complete HTTP URL. For example,\nhttp://contoso-app.azurewebsites.net/login" - }, - "virtualUsers": { - "type": "integer", - "format": "int32", - "description": "No of concurrent virtual users" - }, - "rampUpTime": { - "type": "integer", - "format": "int32", - "description": "Ramp up time" - }, - "duration": { - "type": "integer", - "format": "int32", - "description": "Test run duration" - } - } - }, - "PFAction": { - "type": "string", - "enum": [ - "continue", - "stop" - ], - "x-ms-enum": { - "name": "PFAction", - "modelAsString": true, - "values": [ - { - "name": "continue", - "value": "continue", - "description": "Test will continue to run even if pass fail metric criteria metric gets failed" - }, - { - "name": "stop", - "value": "stop", - "description": "Test run will stop if pass fail criteria metric is not passed." - } - ] - } - }, - "PFAgFunc": { - "type": "string", - "enum": [ - "count", - "percentage", - "avg", - "p50", - "p90", - "p95", - "p99", - "min", - "max" - ], - "x-ms-enum": { - "name": "PFAgFunc", - "modelAsString": true, - "values": [ - { - "name": "count", - "value": "count", - "description": "Criteria applies for count value" - }, - { - "name": "percentage", - "value": "percentage", - "description": "Criteria applies for given percentage value" - }, - { - "name": "avg", - "value": "avg", - "description": "Criteria applies for avg value" - }, - { - "name": "p50", - "value": "p50", - "description": "Criteria applies for 50th percentile value" - }, - { - "name": "p90", - "value": "p90", - "description": "Criteria applies for 90th percentile value" - }, - { - "name": "p95", - "value": "p95", - "description": "Criteria applies for 95th percentile value" - }, - { - "name": "p99", - "value": "p99", - "description": "Criteria applies for 99th percentile value" - }, - { - "name": "min", - "value": "min", - "description": "Criteria applies for minimum value" - }, - { - "name": "max", - "value": "max", - "description": "Criteria applies for maximum value" - } - ] - } - }, - "PFMetrics": { - "type": "string", - "enum": [ - "response_time_ms", - "latency", - "error", - "requests", - "requests_per_sec" - ], - "x-ms-enum": { - "name": "PFMetrics", - "modelAsString": true, - "values": [ - { - "name": "response_time_ms", - "value": "response_time_ms", - "description": "Pass fail criteria for response time metric" - }, - { - "name": "latency", - "value": "latency", - "description": "Pass fail criteria for response time metric" - }, - { - "name": "error", - "value": "error", - "description": "Pass fail criteria for error metric" - }, - { - "name": "requests", - "value": "requests", - "description": "Pass fail criteria for total requests" - }, - { - "name": "requests_per_sec", - "value": "requests_per_sec", - "description": "Pass fail criteria for request rate." - } - ] - } - }, - "PFResult": { - "type": "string", - "enum": [ - "passed", - "undetermined", - "failed" - ], - "x-ms-enum": { - "name": "PFResult", - "modelAsString": true, - "values": [ - { - "name": "passed", - "value": "passed", - "description": "Given pass fail criteria metric has passed." - }, - { - "name": "undetermined", - "value": "undetermined", - "description": "Given pass fail criteria metric couldn't determine." - }, - { - "name": "failed", - "value": "failed", - "description": "Given pass fail criteria metric has failed." - } - ] - } - }, - "PFTestResult": { - "type": "string", - "enum": [ - "PASSED", - "NOT_APPLICABLE", - "FAILED" - ], - "x-ms-enum": { - "name": "PFTestResult", - "modelAsString": true, - "values": [ - { - "name": "PASSED", - "value": "PASSED", - "description": "Pass/fail criteria has passed." - }, - { - "name": "NOT_APPLICABLE", - "value": "NOT_APPLICABLE", - "description": "Pass/fail criteria is not applicable." - }, - { - "name": "FAILED", - "value": "FAILED", - "description": "Pass/fail criteria has failed." - } - ] - } - }, - "PagedDimensionValueList": { - "type": "object", - "description": "Paged collection of DimensionValueList items", - "properties": { - "value": { - "type": "array", - "description": "The DimensionValueList items on this page", - "items": { - "$ref": "#/definitions/DimensionValueList" - }, - "x-ms-identifiers": [] - }, - "nextLink": { - "type": "string", - "format": "uri", - "description": "The link to the next page of items" - } - }, - "required": [ - "value" - ] - }, - "PagedFileInfo": { - "type": "object", - "description": "Collection of files.", - "properties": { - "value": { - "type": "array", - "description": "The FileInfo items on this page", - "items": { - "$ref": "#/definitions/FileInfo" - }, - "x-ms-identifiers": [] - }, - "nextLink": { - "type": "string", - "format": "uri", - "description": "The link to the next page of items" - } - }, - "required": [ - "value" - ] - }, - "PagedTest": { - "type": "object", - "description": "Collection of tests", - "properties": { - "value": { - "type": "array", - "description": "The Test items on this page", - "items": { - "$ref": "#/definitions/Test" - }, - "x-ms-identifiers": [] - }, - "nextLink": { - "type": "string", - "format": "uri", - "description": "The link to the next page of items" - } - }, - "required": [ - "value" - ] - }, - "PagedTestRun": { - "type": "object", - "description": "Collection of test runs", - "properties": { - "value": { - "type": "array", - "description": "The TestRun items on this page", - "items": { - "$ref": "#/definitions/TestRun" - }, - "x-ms-identifiers": [] - }, - "nextLink": { - "type": "string", - "format": "uri", - "description": "The link to the next page of items" - } - }, - "required": [ - "value" - ] - }, - "PagedTimeSeriesElement": { - "type": "object", - "description": "The response to a metrics query.", - "properties": { - "value": { - "type": "array", - "description": "The TimeSeriesElement items on this page", - "items": { - "$ref": "#/definitions/TimeSeriesElement" - }, - "x-ms-identifiers": [] - }, - "nextLink": { - "type": "string", - "format": "uri", - "description": "The link to the next page of items" - } - }, - "required": [ - "value" - ] - }, - "PassFailCriteria": { - "type": "object", - "description": "Pass fail criteria for a test.", - "properties": { - "passFailMetrics": { - "type": "object", - "description": "Map of id and pass fail metrics { id : pass fail metrics }.", - "additionalProperties": { - "$ref": "#/definitions/PassFailMetric" - } - } - } - }, - "PassFailMetric": { - "type": "object", - "description": "Pass fail metric", - "properties": { - "clientMetric": { - "$ref": "#/definitions/PFMetrics", - "description": "The client metric on which the criteria should be applied." - }, - "aggregate": { - "$ref": "#/definitions/PFAgFunc", - "description": "The aggregation function to be applied on the client metric. Allowed functions\n- ‘percentage’ - for error metric , ‘avg’, ‘p50’, ‘p90’, ‘p95’, ‘p99’, ‘min’,\n‘max’ - for response_time_ms and latency metric, ‘avg’ - for requests_per_sec,\n‘count’ - for requests" - }, - "condition": { - "type": "string", - "description": "The comparison operator. Supported types ‘>’, ‘<’ " - }, - "requestName": { - "type": "string", - "description": "Request name for which the Pass fail criteria has to be applied " - }, - "value": { - "type": "number", - "format": "float", - "description": "The value to compare with the client metric. Allowed values - ‘error : [0.0 ,\n100.0] unit- % ’, response_time_ms and latency : any integer value unit- ms." - }, - "action": { - "$ref": "#/definitions/PFAction", - "description": "Action taken after the threshold is met. Default is ‘continue’." - }, - "actualValue": { - "type": "number", - "format": "float", - "description": "The actual value of the client metric for the test run.", - "readOnly": true - }, - "result": { - "$ref": "#/definitions/PFResult", - "description": "Outcome of the test run.", - "readOnly": true - } - } - }, - "ResourceMetric": { - "type": "object", - "description": "Associated metric definition for particular metrics of the azure resource (\nRefer :\nhttps://docs.microsoft.com/en-us/rest/api/monitor/metric-definitions/list#metricdefinition).", - "properties": { - "id": { - "type": "string", - "description": "Unique name for metric.", - "readOnly": true - }, - "resourceId": { - "type": "string", - "description": "Azure resource id." - }, - "metricNamespace": { - "type": "string", - "description": "Metric name space." - }, - "displayDescription": { - "type": "string", - "description": "Metric description." - }, - "name": { - "type": "string", - "description": "The invariant value of metric name" - }, - "aggregation": { - "type": "string", - "description": "Metric aggregation." - }, - "unit": { - "type": "string", - "description": "Metric unit." - }, - "resourceType": { - "type": "string", - "description": "Azure resource type." - } - }, - "required": [ - "resourceId", - "metricNamespace", - "name", - "aggregation", - "resourceType" - ] - }, - "Secret": { - "type": "object", - "description": "Secret", - "properties": { - "value": { - "type": "string", - "description": "The value of the secret for the respective type" - }, - "type": { - "$ref": "#/definitions/SecretType", - "description": "Type of secret" - } - } - }, - "SecretType": { - "type": "string", - "enum": [ - "AKV_SECRET_URI", - "SECRET_VALUE" - ], - "x-ms-enum": { - "name": "SecretType", - "modelAsString": true, - "values": [ - { - "name": "AKV_SECRET_URI", - "value": "AKV_SECRET_URI", - "description": "If the secret is stored in an Azure Key Vault" - }, - { - "name": "SECRET_VALUE", - "value": "SECRET_VALUE", - "description": "If the Plain text secret value provided" - } - ] - } - }, - "Status": { - "type": "string", - "enum": [ - "ACCEPTED", - "NOTSTARTED", - "PROVISIONING", - "PROVISIONED", - "CONFIGURING", - "CONFIGURED", - "EXECUTING", - "EXECUTED", - "DEPROVISIONING", - "DEPROVISIONED", - "DONE", - "CANCELLING", - "CANCELLED", - "FAILED", - "VALIDATION_SUCCESS", - "VALIDATION_FAILURE" - ], - "x-ms-enum": { - "name": "Status", - "modelAsString": true, - "values": [ - { - "name": "ACCEPTED", - "value": "ACCEPTED", - "description": "Test run request is accepted" - }, - { - "name": "NOTSTARTED", - "value": "NOTSTARTED", - "description": "Test run is not yet started." - }, - { - "name": "PROVISIONING", - "value": "PROVISIONING", - "description": "Test run is getting provision" - }, - { - "name": "PROVISIONED", - "value": "PROVISIONED", - "description": "Test run is provisioned" - }, - { - "name": "CONFIGURING", - "value": "CONFIGURING", - "description": "Test run is getting configure" - }, - { - "name": "CONFIGURED", - "value": "CONFIGURED", - "description": "Test run configuration is done" - }, - { - "name": "EXECUTING", - "value": "EXECUTING", - "description": "Test run has started executing" - }, - { - "name": "EXECUTED", - "value": "EXECUTED", - "description": "Test run has been executed" - }, - { - "name": "DEPROVISIONING", - "value": "DEPROVISIONING", - "description": "Test run is getting deprovision" - }, - { - "name": "DEPROVISIONED", - "value": "DEPROVISIONED", - "description": "Test run request is deprovisioned" - }, - { - "name": "DONE", - "value": "DONE", - "description": "Test run request is finished" - }, - { - "name": "CANCELLING", - "value": "CANCELLING", - "description": "Test run request is getting cancelled" - }, - { - "name": "CANCELLED", - "value": "CANCELLED", - "description": "Test run request is cancelled" - }, - { - "name": "FAILED", - "value": "FAILED", - "description": "Test run request is failed" - }, - { - "name": "VALIDATION_SUCCESS", - "value": "VALIDATION_SUCCESS", - "description": "Test run JMX file is validated" - }, - { - "name": "VALIDATION_FAILURE", - "value": "VALIDATION_FAILURE", - "description": "Test run JMX file validation is failed" - } - ] - } - }, - "Test": { - "type": "object", - "description": "Load test model", - "properties": { - "passFailCriteria": { - "$ref": "#/definitions/PassFailCriteria", - "description": "Pass fail criteria for a test." - }, - "secrets": { - "type": "object", - "description": "Secrets can be stored in an Azure Key Vault or any other secret store. If the\nsecret is stored in an Azure Key Vault, the value should be the secret\nidentifier and the type should be AKV_SECRET_URI. If the secret is stored\nelsewhere, the secret value should be provided directly and the type should be\nSECRET_VALUE.", - "additionalProperties": { - "$ref": "#/definitions/Secret" - } - }, - "certificate": { - "$ref": "#/definitions/CertificateMetadata", - "description": "Certificates metadata" - }, - "environmentVariables": { - "type": "object", - "description": "Environment variables which are defined as a set of pairs.", - "additionalProperties": { - "type": "string" - } - }, - "loadTestConfiguration": { - "$ref": "#/definitions/LoadTestConfiguration", - "description": "The load test configuration." - }, - "inputArtifacts": { - "$ref": "#/definitions/TestInputArtifacts", - "description": "The input artifacts for the test.", - "readOnly": true - }, - "testId": { - "type": "string", - "description": "Unique test name as identifier.", - "readOnly": true - }, - "description": { - "type": "string", - "description": "The test description." - }, - "displayName": { - "type": "string", - "description": "Display name of a test." - }, - "subnetId": { - "type": "string", - "description": "Subnet ID on which the load test instances should run." - }, - "keyvaultReferenceIdentityType": { - "type": "string", - "description": "Type of the managed identity referencing the Key vault." - }, - "keyvaultReferenceIdentityId": { - "type": "string", - "description": "Resource Id of the managed identity referencing the Key vault." - }, - "createdDateTime": { - "type": "string", - "format": "date-time", - "description": "The creation datetime(ISO 8601 literal format).", - "readOnly": true - }, - "createdBy": { - "type": "string", - "description": "The user that created.", - "readOnly": true - }, - "lastModifiedDateTime": { - "type": "string", - "format": "date-time", - "description": "The last Modified datetime(ISO 8601 literal format).", - "readOnly": true - }, - "lastModifiedBy": { - "type": "string", - "description": "The user that last modified.", - "readOnly": true - } - } - }, - "TestAppComponents": { - "type": "object", - "description": "Test app component", - "properties": { - "components": { - "type": "object", - "description": "Azure resource collection { resource id (fully qualified resource Id e.g\nsubscriptions/{subId}/resourceGroups/{rg}/providers/Microsoft.LoadTestService/loadtests/{resName})\n: resource object } ", - "additionalProperties": { - "$ref": "#/definitions/AppComponent" - } - }, - "testId": { - "type": "string", - "description": "Test identifier", - "readOnly": true - }, - "createdDateTime": { - "type": "string", - "format": "date-time", - "description": "The creation datetime(ISO 8601 literal format).", - "readOnly": true - }, - "createdBy": { - "type": "string", - "description": "The user that created.", - "readOnly": true - }, - "lastModifiedDateTime": { - "type": "string", - "format": "date-time", - "description": "The last Modified datetime(ISO 8601 literal format).", - "readOnly": true - }, - "lastModifiedBy": { - "type": "string", - "description": "The user that last modified.", - "readOnly": true - } - }, - "required": [ - "components" - ] - }, - "TestAppComponentsUpdate": { - "type": "object", - "description": "Test app component", - "properties": { - "components": { - "type": "object", - "description": "Azure resource collection { resource id (fully qualified resource Id e.g\nsubscriptions/{subId}/resourceGroups/{rg}/providers/Microsoft.LoadTestService/loadtests/{resName})\n: resource object } ", - "additionalProperties": { - "$ref": "#/definitions/AppComponent" - } - } - } - }, - "TestInputArtifacts": { - "type": "object", - "description": "The input artifacts for the test.", - "properties": { - "configFileInfo": { - "$ref": "#/definitions/FileInfo", - "description": "File info" - }, - "testScriptFileInfo": { - "$ref": "#/definitions/FileInfo", - "description": "File info" - }, - "userPropFileInfo": { - "$ref": "#/definitions/FileInfo", - "description": "File info" - }, - "inputArtifactsZipFileInfo": { - "$ref": "#/definitions/FileInfo", - "description": "File info" - }, - "additionalFileInfo": { - "type": "array", - "description": "Additional supported files for the test run", - "items": { - "$ref": "#/definitions/FileInfo" - }, - "readOnly": true, - "x-ms-identifiers": [] - } - } - }, - "TestRun": { - "type": "object", - "description": "Load test run model", - "properties": { - "testRunId": { - "type": "string", - "description": "Unique test run name as identifier", - "readOnly": true - }, - "passFailCriteria": { - "$ref": "#/definitions/PassFailCriteria", - "description": "Pass fail criteria for a test." - }, - "secrets": { - "type": "object", - "description": "Secrets can be stored in an Azure Key Vault or any other secret store. If the\nsecret is stored in an Azure Key Vault, the value should be the secret\nidentifier and the type should be AKV_SECRET_URI. If the secret is stored\nelsewhere, the secret value should be provided directly and the type should be\nSECRET_VALUE.", - "additionalProperties": { - "$ref": "#/definitions/Secret" - } - }, - "certificate": { - "$ref": "#/definitions/CertificateMetadata", - "description": "Certificates metadata" - }, - "environmentVariables": { - "type": "object", - "description": "Environment variables which are defined as a set of pairs.", - "additionalProperties": { - "type": "string" - } - }, - "errorDetails": { - "type": "array", - "description": "Error details if there is any failure in load test run", - "items": { - "$ref": "#/definitions/ErrorDetails" - }, - "readOnly": true, - "x-ms-identifiers": [] - }, - "testRunStatistics": { - "type": "object", - "description": "Test run statistics.", - "additionalProperties": { - "$ref": "#/definitions/TestRunStatistics" - }, - "readOnly": true - }, - "loadTestConfiguration": { - "$ref": "#/definitions/LoadTestConfiguration", - "description": "The load test configuration." - }, - "testArtifacts": { - "$ref": "#/definitions/TestRunArtifacts", - "description": "Collection of test run artifacts", - "readOnly": true - }, - "testResult": { - "$ref": "#/definitions/PFTestResult", - "description": "Test result for pass/Fail criteria used during the test run.", - "readOnly": true - }, - "virtualUsers": { - "type": "integer", - "format": "int32", - "description": "Number of virtual users, for which test has been run.", - "readOnly": true - }, - "displayName": { - "type": "string", - "description": "Display name of a testRun." - }, - "testId": { - "type": "string", - "description": "Associated test Id." - }, - "description": { - "type": "string", - "description": "The test run description." - }, - "status": { - "$ref": "#/definitions/Status", - "description": "The test run status.", - "readOnly": true - }, - "startDateTime": { - "type": "string", - "format": "date-time", - "description": "The test run start DateTime(ISO 8601 literal format).", - "readOnly": true - }, - "endDateTime": { - "type": "string", - "format": "date-time", - "description": "The test run end DateTime(ISO 8601 literal format).", - "readOnly": true - }, - "executedDateTime": { - "type": "string", - "format": "date-time", - "description": "Test run initiated time.", - "readOnly": true - }, - "portalUrl": { - "type": "string", - "description": "Portal url.", - "readOnly": true - }, - "duration": { - "type": "integer", - "format": "int32", - "description": "Test run duration in milliseconds.", - "readOnly": true - }, - "subnetId": { - "type": "string", - "description": "Subnet ID on which the load test instances should run.", - "readOnly": true - }, - "createdDateTime": { - "type": "string", - "format": "date-time", - "description": "The creation datetime(ISO 8601 literal format).", - "readOnly": true - }, - "createdBy": { - "type": "string", - "description": "The user that created.", - "readOnly": true - }, - "lastModifiedDateTime": { - "type": "string", - "format": "date-time", - "description": "The last Modified datetime(ISO 8601 literal format).", - "readOnly": true - }, - "lastModifiedBy": { - "type": "string", - "description": "The user that last modified.", - "readOnly": true - } - }, - "required": [ - "testRunId" - ] - }, - "TestRunAppComponents": { - "type": "object", - "description": "Test run app component", - "properties": { - "components": { - "type": "object", - "description": "Azure resource collection { resource id (fully qualified resource Id e.g\nsubscriptions/{subId}/resourceGroups/{rg}/providers/Microsoft.LoadTestService/loadtests/{resName})\n: resource object } ", - "additionalProperties": { - "$ref": "#/definitions/AppComponent" - } - }, - "testRunId": { - "type": "string", - "description": "Test run identifier", - "readOnly": true - }, - "createdDateTime": { - "type": "string", - "format": "date-time", - "description": "The creation datetime(ISO 8601 literal format).", - "readOnly": true - }, - "createdBy": { - "type": "string", - "description": "The user that created.", - "readOnly": true - }, - "lastModifiedDateTime": { - "type": "string", - "format": "date-time", - "description": "The last Modified datetime(ISO 8601 literal format).", - "readOnly": true - }, - "lastModifiedBy": { - "type": "string", - "description": "The user that last modified.", - "readOnly": true - } - }, - "required": [ - "components" - ] - }, - "TestRunAppComponentsUpdate": { - "type": "object", - "description": "Test run app component", - "properties": { - "components": { - "type": "object", - "description": "Azure resource collection { resource id (fully qualified resource Id e.g\nsubscriptions/{subId}/resourceGroups/{rg}/providers/Microsoft.LoadTestService/loadtests/{resName})\n: resource object } ", - "additionalProperties": { - "$ref": "#/definitions/AppComponent" - } - } - } - }, - "TestRunArtifacts": { - "type": "object", - "description": "Collection of test run artifacts", - "properties": { - "inputArtifacts": { - "$ref": "#/definitions/TestRunInputArtifacts", - "description": "The input artifacts for the test run.", - "readOnly": true - }, - "outputArtifacts": { - "$ref": "#/definitions/TestRunOutputArtifacts", - "description": "The output artifacts for the test run." - } - } - }, - "TestRunCreateOrUpdate": { - "type": "object", - "description": "Load test run model", - "properties": { - "passFailCriteria": { - "$ref": "#/definitions/PassFailCriteria", - "description": "Pass fail criteria for a test." - }, - "secrets": { - "type": "object", - "description": "Secrets can be stored in an Azure Key Vault or any other secret store. If the\nsecret is stored in an Azure Key Vault, the value should be the secret\nidentifier and the type should be AKV_SECRET_URI. If the secret is stored\nelsewhere, the secret value should be provided directly and the type should be\nSECRET_VALUE.", - "additionalProperties": { - "$ref": "#/definitions/Secret" - } - }, - "certificate": { - "$ref": "#/definitions/CertificateMetadata", - "description": "Certificates metadata" - }, - "environmentVariables": { - "type": "object", - "description": "Environment variables which are defined as a set of pairs.", - "additionalProperties": { - "type": "string" - } - }, - "loadTestConfiguration": { - "$ref": "#/definitions/LoadTestConfiguration", - "description": "The load test configuration." - }, - "displayName": { - "type": "string", - "description": "Display name of a testRun." - }, - "testId": { - "type": "string", - "description": "Associated test Id." - }, - "description": { - "type": "string", - "description": "The test run description." - } - } - }, - "TestRunInputArtifacts": { - "type": "object", - "description": "The input artifacts for the test run.", - "properties": { - "configFileInfo": { - "$ref": "#/definitions/FileInfo", - "description": "File info" - }, - "testScriptFileInfo": { - "$ref": "#/definitions/FileInfo", - "description": "File info" - }, - "userPropFileInfo": { - "$ref": "#/definitions/FileInfo", - "description": "File info" - }, - "inputArtifactsZipFileInfo": { - "$ref": "#/definitions/FileInfo", - "description": "File info" - }, - "additionalFileInfo": { - "type": "array", - "description": "Additional supported files for the test run", - "items": { - "$ref": "#/definitions/FileInfo" - }, - "readOnly": true, - "x-ms-identifiers": [] - } - } - }, - "TestRunOutputArtifacts": { - "type": "object", - "description": "The output artifacts for the test run.", - "properties": { - "resultFileInfo": { - "$ref": "#/definitions/FileInfo", - "description": "File info" - }, - "logsFileInfo": { - "$ref": "#/definitions/FileInfo", - "description": "File info" - } - } - }, - "TestRunServerMetricConfig": { - "type": "object", - "description": "Test run server metrics configuration", - "properties": { - "testRunId": { - "type": "string", - "description": "Test run identifier", - "readOnly": true - }, - "metrics": { - "type": "object", - "description": "Azure resource metrics collection {metric id : metrics object} (Refer :\nhttps://docs.microsoft.com/en-us/rest/api/monitor/metric-definitions/list#metricdefinition\nfor metric id).", - "additionalProperties": { - "$ref": "#/definitions/ResourceMetric" - } - }, - "createdDateTime": { - "type": "string", - "format": "date-time", - "description": "The creation datetime(ISO 8601 literal format).", - "readOnly": true - }, - "createdBy": { - "type": "string", - "description": "The user that created.", - "readOnly": true - }, - "lastModifiedDateTime": { - "type": "string", - "format": "date-time", - "description": "The last Modified datetime(ISO 8601 literal format).", - "readOnly": true - }, - "lastModifiedBy": { - "type": "string", - "description": "The user that last modified.", - "readOnly": true - } - } - }, - "TestRunStatistics": { - "type": "object", - "description": "Test run statistics.", - "properties": { - "transaction": { - "type": "string", - "description": "Transaction name.", - "readOnly": true - }, - "sampleCount": { - "type": "number", - "format": "float", - "description": "Sampler count.", - "readOnly": true - }, - "errorCount": { - "type": "number", - "format": "float", - "description": "Error count.", - "readOnly": true - }, - "errorPct": { - "type": "number", - "format": "float", - "description": "Error percentage.", - "readOnly": true - }, - "meanResTime": { - "type": "number", - "format": "float", - "description": "Mean response time.", - "readOnly": true - }, - "medianResTime": { - "type": "number", - "format": "float", - "description": "Median response time.", - "readOnly": true - }, - "maxResTime": { - "type": "number", - "format": "float", - "description": "Max response time.", - "readOnly": true - }, - "minResTime": { - "type": "number", - "format": "float", - "description": "Minimum response time.", - "readOnly": true - }, - "pct1ResTime": { - "type": "number", - "format": "float", - "description": "90 percentile response time.", - "readOnly": true - }, - "pct2ResTime": { - "type": "number", - "format": "float", - "description": "95 percentile response time.", - "readOnly": true - }, - "pct3ResTime": { - "type": "number", - "format": "float", - "description": "99 percentile response time.", - "readOnly": true - }, - "throughput": { - "type": "number", - "format": "float", - "description": "Throughput.", - "readOnly": true - }, - "receivedKBytesPerSec": { - "type": "number", - "format": "float", - "description": "Received network bytes.", - "readOnly": true - }, - "sentKBytesPerSec": { - "type": "number", - "format": "float", - "description": "Send network bytes.", - "readOnly": true - } - } - }, - "TestRuns": { - "type": "object", - "description": "Load test run model", - "properties": { - "testRunId": { - "type": "string", - "description": "Unique test run name as identifier", - "readOnly": true - } - }, - "required": [ - "testRunId" - ] - }, - "TestServerMetricConfig": { - "type": "object", - "description": "Test server metrics configuration", - "properties": { - "testId": { - "type": "string", - "description": "Test identifier", - "readOnly": true - }, - "metrics": { - "type": "object", - "description": "Azure resource metrics collection {metric id : metrics object} (Refer :\nhttps://docs.microsoft.com/en-us/rest/api/monitor/metric-definitions/list#metricdefinition\nfor metric id).", - "additionalProperties": { - "$ref": "#/definitions/ResourceMetric" - } - }, - "createdDateTime": { - "type": "string", - "format": "date-time", - "description": "The creation datetime(ISO 8601 literal format).", - "readOnly": true - }, - "createdBy": { - "type": "string", - "description": "The user that created.", - "readOnly": true - }, - "lastModifiedDateTime": { - "type": "string", - "format": "date-time", - "description": "The last Modified datetime(ISO 8601 literal format).", - "readOnly": true - }, - "lastModifiedBy": { - "type": "string", - "description": "The user that last modified.", - "readOnly": true - } - } - }, - "TimeGrain": { - "type": "string", - "enum": [ - "PT5S", - "PT10S", - "PT1M", - "PT5M", - "PT1H" - ], - "x-ms-enum": { - "name": "TimeGrain", - "modelAsString": true, - "values": [ - { - "name": "PT5S", - "value": "PT5S", - "description": "5 seconds, available only if test run duration is less than 10 minutes" - }, - { - "name": "PT10S", - "value": "PT10S", - "description": "10 seconds, available only if test run duration is less than 10 minutes" - }, - { - "name": "PT1M", - "value": "PT1M", - "description": "1 minute" - }, - { - "name": "PT5M", - "value": "PT5M", - "description": "5 minutes, available only if test run duration is greater than 1 minute" - }, - { - "name": "PT1H", - "value": "PT1H", - "description": "1 hour, available only if test run duration is greater than 1 minute" - } - ] - } - }, - "TimeSeriesElement": { - "type": "object", - "description": "The time series returned when a data query is performed.", - "properties": { - "data": { - "type": "array", - "description": "An array of data points representing the metric values.", - "items": { - "$ref": "#/definitions/MetricValue" - }, - "x-ms-identifiers": [] - }, - "dimensionValues": { - "type": "array", - "description": "The dimension values ", - "items": { - "$ref": "#/definitions/DimensionValue" - }, - "x-ms-identifiers": [] - } - } - } - }, - "parameters": { - "Azure.Core.Foundations.ApiVersionParameter": { - "name": "api-version", - "in": "query", - "description": "The API version to use for this operation.", - "required": true, - "type": "string", - "minLength": 1, - "x-ms-parameter-location": "method", - "x-ms-client-name": "apiVersion" - }, - "MetricDimensions.interval": { - "name": "interval", - "in": "query", - "description": "The interval (i.e. timegrain) of the query.", - "required": false, - "type": "string", - "enum": [ - "PT5S", - "PT10S", - "PT1M", - "PT5M", - "PT1H" - ], - "x-ms-enum": { - "name": "Interval", - "modelAsString": true, - "values": [ - { - "name": "PT5S", - "value": "PT5S", - "description": "5 seconds, available only if test run duration is less than 10 minutes" - }, - { - "name": "PT10S", - "value": "PT10S", - "description": "10 seconds, available only if test run duration is less than 10 minutes" - }, - { - "name": "PT1M", - "value": "PT1M", - "description": "1 minute" - }, - { - "name": "PT5M", - "value": "PT5M", - "description": "5 minutes, available only if test run duration is greater than 1 minute" - }, - { - "name": "PT1H", - "value": "PT1H", - "description": "1 hour, available only if test run duration is greater than 1 minute" - } - ] - }, - "x-ms-parameter-location": "method" - }, - "MetricDimensions.metricName": { - "name": "metricName", - "in": "query", - "description": "Metric name", - "required": false, - "type": "string", - "x-ms-parameter-location": "method" - }, - "MetricDimensions.metricNamespace": { - "name": "metricNamespace", - "in": "query", - "description": "Metric namespace to query metric definitions for.", - "required": true, - "type": "string", - "x-ms-parameter-location": "method" - }, - "MetricDimensions.timespan": { - "name": "timespan", - "in": "query", - "description": "The timespan of the query. It is a string with the following format\n'startDateTime_ISO/endDateTime_ISO'.", - "required": false, - "type": "string", - "x-ms-parameter-location": "method" - } - } -} diff --git a/packages/typespec-test/test/loadTest/generated/typespec-ts/review/load-testing.api.md b/packages/typespec-test/test/loadTest/generated/typespec-ts/review/load-testing.api.md index dac0ef4a3f..c11a48276f 100644 --- a/packages/typespec-test/test/loadTest/generated/typespec-ts/review/load-testing.api.md +++ b/packages/typespec-test/test/loadTest/generated/typespec-ts/review/load-testing.api.md @@ -71,7 +71,7 @@ export type CertificateType = "AKV_CERT_URI"; export type CertificateTypeOutput = "AKV_CERT_URI"; // @public -function createClient(endpointParam: string, credentials: TokenCredential, { apiVersion, ...options }?: AzureLoadTestingClientOptions): AzureLoadTestingClient; +function createClient(endpointParam: string, credentials: TokenCredential, input?: AzureLoadTestingClientOptions): AzureLoadTestingClient; export default createClient; // @public diff --git a/packages/typespec-test/test/openai/generated/typespec-ts/review/openai.api.md b/packages/typespec-test/test/openai/generated/typespec-ts/review/openai.api.md index 32548426ce..3ed43ecfab 100644 --- a/packages/typespec-test/test/openai/generated/typespec-ts/review/openai.api.md +++ b/packages/typespec-test/test/openai/generated/typespec-ts/review/openai.api.md @@ -237,7 +237,7 @@ export interface ContentFilterResultsOutput { export type ContentFilterSeverityOutput = "safe" | "low" | "medium" | "high"; // @public -function createClient(endpointParam: string, credentials: TokenCredential | KeyCredential, { apiVersion, ...options }?: OpenAIClientOptions): OpenAIClient; +function createClient(endpointParam: string, credentials: TokenCredential | KeyCredential, input?: OpenAIClientOptions): OpenAIClient; export default createClient; // @public diff --git a/packages/typespec-test/test/translator/generated/typespec-ts/review/cognitiveservices-translator.api.md b/packages/typespec-test/test/translator/generated/typespec-ts/review/cognitiveservices-translator.api.md index 35305cfa57..90626e1505 100644 --- a/packages/typespec-test/test/translator/generated/typespec-ts/review/cognitiveservices-translator.api.md +++ b/packages/typespec-test/test/translator/generated/typespec-ts/review/cognitiveservices-translator.api.md @@ -106,7 +106,7 @@ export interface CommonScriptModelOutput { } // @public -function createClient(endpointParam: string, { apiVersion, ...options }?: TranslatorClientOptions): TranslatorClient; +function createClient(endpointParam: string, input?: TranslatorClientOptions): TranslatorClient; export default createClient; // @public (undocumented) From 348a2dd36aa5b940d09eacd34476869b4f6cd0e0 Mon Sep 17 00:00:00 2001 From: "Jiao Di (MSFT)" Date: Mon, 2 Feb 2026 14:31:13 +0800 Subject: [PATCH 05/10] revert --- .../generated/openapi/openapi.json | 851 ++++ .../generated/openapi/2022-11-01/openapi.json | 3523 +++++++++++++++++ 2 files changed, 4374 insertions(+) create mode 100644 packages/typespec-test/test/confidentialLedger/generated/openapi/openapi.json create mode 100644 packages/typespec-test/test/loadTest/generated/openapi/2022-11-01/openapi.json diff --git a/packages/typespec-test/test/confidentialLedger/generated/openapi/openapi.json b/packages/typespec-test/test/confidentialLedger/generated/openapi/openapi.json new file mode 100644 index 0000000000..27beacd9db --- /dev/null +++ b/packages/typespec-test/test/confidentialLedger/generated/openapi/openapi.json @@ -0,0 +1,851 @@ +{ + "swagger": "2.0", + "info": { + "title": "Confidential Ledger Service", + "version": "2022-05-13", + "x-typespec-generated": [ + { + "emitter": "@azure-tools/typespec-autorest" + } + ] + }, + "schemes": [ + "https" + ], + "x-ms-parameterized-host": { + "hostTemplate": "{ledgerUri}", + "useSchemePrefix": false, + "parameters": [ + { + "name": "ledgerUri", + "in": "path", + "required": true, + "type": "string", + "format": "uri", + "x-ms-skip-url-encoding": true + } + ] + }, + "produces": [ + "application/json" + ], + "consumes": [ + "application/json" + ], + "security": [ + { + "OAuth2Auth": [ + "https://confidential-ledger.azure.com/.default" + ] + } + ], + "securityDefinitions": { + "OAuth2Auth": { + "type": "oauth2", + "flow": "implicit", + "authorizationUrl": "https://login.microsoftonline.com/common/v2.0/oauth2/authorize", + "scopes": { + "https://confidential-ledger.azure.com/.default": "" + }, + "tokenUrl": "https://login.microsoftonline.com/common/v2.0/oauth2/token" + } + }, + "tags": [], + "paths": { + "/app/collections": { + "get": { + "operationId": "ConfidentialLedger_ListCollections", + "summary": "Retrieves a list of collection ids present in the Confidential Ledger", + "description": "Collection ids are user-created collections of ledger entries", + "parameters": [ + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/Collection" + }, + "x-ms-identifiers": [] + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" + }, + "headers": { + "x-ms-error-code": { + "type": "string", + "description": "String error code indicating what went wrong." + } + } + } + } + } + }, + "/app/enclaveQuotes": { + "get": { + "operationId": "ConfidentialLedger_GetEnclaveQuotes", + "summary": "Gets quotes for all nodes of the Confidential Ledger.", + "description": "A quote is an SGX enclave measurement that can be used to verify the validity of a node and its enclave.", + "parameters": [ + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "The request has succeeded." + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" + }, + "headers": { + "x-ms-error-code": { + "type": "string", + "description": "String error code indicating what went wrong." + } + } + } + } + } + }, + "/app/governance/constitution": { + "get": { + "operationId": "ConfidentialLedger_GetConstitution", + "summary": "Gets the constitution used for governance.", + "description": "The constitution is a script that assesses and applies proposals from consortium members.", + "parameters": [ + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "The request has succeeded." + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" + }, + "headers": { + "x-ms-error-code": { + "type": "string", + "description": "String error code indicating what went wrong." + } + } + } + } + } + }, + "/app/governance/members": { + "get": { + "operationId": "ConfidentialLedger_GetConsortiumMembers", + "summary": "Gets the consortium members.", + "description": "Consortium members can manage the Confidential Ledger.", + "parameters": [ + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "The request has succeeded." + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" + }, + "headers": { + "x-ms-error-code": { + "type": "string", + "description": "String error code indicating what went wrong." + } + } + } + } + } + }, + "/app/transactions": { + "get": { + "operationId": "ConfidentialLedger_ListLedgerEntries", + "summary": "Gets ledger entries from a collection corresponding to a range.", + "description": "A collection id may optionally be specified. Only entries in the specified (or default) collection will be returned.", + "parameters": [ + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "schema": { + "$ref": "#/definitions/PagedLedgerEntries" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" + }, + "headers": { + "x-ms-error-code": { + "type": "string", + "description": "String error code indicating what went wrong." + } + } + } + }, + "x-ms-pageable": { + "nextLinkName": "nextLink" + } + } + }, + "/app/transactions/{transactionId}": { + "get": { + "operationId": "ConfidentialLedger_GetLedgerEntry", + "summary": "Gets the ledger entry at the specified transaction id. A collection id may optionally be specified to indicate the collection from which to fetch the value.", + "description": "Get a LedgerEntry", + "parameters": [ + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + }, + { + "name": "transactionId", + "in": "path", + "description": "A unique identifier for the state of the ledger. If returned as part of a LedgerEntry, it indicates the state from which the entry was read.", + "required": true, + "type": "string" + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "schema": { + "$ref": "#/definitions/LedgerEntry" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" + }, + "headers": { + "x-ms-error-code": { + "type": "string", + "description": "String error code indicating what went wrong." + } + } + } + } + } + }, + "/app/transactions/{transactionId}/receipt": { + "get": { + "operationId": "ConfidentialLedger_GetReceipt", + "summary": "Gets a receipt certifying ledger contents at a particular transaction id.", + "description": "Runs a custom action on LedgerEntry", + "parameters": [ + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + }, + { + "name": "transactionId", + "in": "path", + "description": "A unique identifier for the state of the ledger. If returned as part of a LedgerEntry, it indicates the state from which the entry was read.", + "required": true, + "type": "string" + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "schema": { + "$ref": "#/definitions/TransactionReceipt" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" + }, + "headers": { + "x-ms-error-code": { + "type": "string", + "description": "String error code indicating what went wrong." + } + } + } + } + } + }, + "/app/transactions/{transactionId}/status": { + "get": { + "operationId": "ConfidentialLedger_GetTransactionStatus", + "summary": "Gets a receipt certifying ledger contents at a particular transaction id.", + "description": "Runs a custom action on LedgerEntry", + "parameters": [ + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + }, + { + "name": "transactionId", + "in": "path", + "description": "A unique identifier for the state of the ledger. If returned as part of a LedgerEntry, it indicates the state from which the entry was read.", + "required": true, + "type": "string" + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "schema": { + "$ref": "#/definitions/TransactionStatus" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" + }, + "headers": { + "x-ms-error-code": { + "type": "string", + "description": "String error code indicating what went wrong." + } + } + } + } + } + }, + "/app/transactions/getCurrentLedgerEntry": { + "get": { + "operationId": "ConfidentialLedger_GetCurrentLedgerEntry", + "summary": "Gets the current value available in the ledger.", + "description": "Runs a custom action on LedgerEntry", + "parameters": [ + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + }, + { + "$ref": "#/parameters/CollectionIdParameter" + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "schema": { + "$ref": "#/definitions/LedgerEntry" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" + }, + "headers": { + "x-ms-error-code": { + "type": "string", + "description": "String error code indicating what went wrong." + } + } + } + } + } + }, + "/app/transactions/transactions": { + "post": { + "operationId": "ConfidentialLedger_CreateLedgerEntry", + "summary": "Writes a ledger entry.", + "description": "A collection id may optionally be specified.", + "parameters": [ + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + }, + { + "name": "resource", + "in": "body", + "description": "The resource instance.", + "required": true, + "schema": { + "$ref": "#/definitions/LedgerEntry" + } + } + ], + "responses": { + "201": { + "description": "The request has succeeded and a new resource has been created as a result.", + "headers": { + "Location": { + "type": "string", + "format": "uri", + "description": "The location of an instance of LedgerEntry" + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" + }, + "headers": { + "x-ms-error-code": { + "type": "string", + "description": "String error code indicating what went wrong." + } + } + } + } + } + }, + "/app/users/{userId}": { + "get": { + "operationId": "ConfidentialLedger_GetUser", + "summary": "Gets a user.", + "description": "Get a LedgerUser", + "parameters": [ + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + }, + { + "name": "userId", + "in": "path", + "description": "The user id, either an AAD object ID or certificate fingerprint.", + "required": true, + "type": "string", + "x-ms-skip-url-encoding": true + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "schema": { + "$ref": "#/definitions/LedgerUser" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" + }, + "headers": { + "x-ms-error-code": { + "type": "string", + "description": "String error code indicating what went wrong." + } + } + } + } + }, + "patch": { + "operationId": "ConfidentialLedger_CreateOrUpdateUser", + "summary": "Adds a user or updates a user's fields.", + "description": "Creates or updates a LedgerUser", + "consumes": [ + "application/merge-patch+json" + ], + "parameters": [ + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + }, + { + "name": "userId", + "in": "path", + "description": "The user id, either an AAD object ID or certificate fingerprint.", + "required": true, + "type": "string", + "x-ms-skip-url-encoding": true + }, + { + "name": "resource", + "in": "body", + "description": "The resource instance.", + "required": true, + "schema": { + "$ref": "#/definitions/LedgerUserCreateOrUpdate" + } + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "schema": { + "$ref": "#/definitions/LedgerUser" + } + }, + "201": { + "description": "The request has succeeded and a new resource has been created as a result.", + "schema": { + "$ref": "#/definitions/LedgerUser" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" + }, + "headers": { + "x-ms-error-code": { + "type": "string", + "description": "String error code indicating what went wrong." + } + } + } + } + }, + "delete": { + "operationId": "ConfidentialLedger_DeleteUser", + "summary": "Deletes a user from the Confidential Ledger.", + "description": "Delete a LedgerUser", + "parameters": [ + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + }, + { + "name": "userId", + "in": "path", + "description": "The user id, either an AAD object ID or certificate fingerprint.", + "required": true, + "type": "string", + "x-ms-skip-url-encoding": true + } + ], + "responses": { + "204": { + "description": "There is no content to send for this request, but the headers may be useful. " + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" + }, + "headers": { + "x-ms-error-code": { + "type": "string", + "description": "String error code indicating what went wrong." + } + } + } + } + } + } + }, + "definitions": { + "Azure.Core.Foundations.Error": { + "type": "object", + "description": "The error object.", + "properties": { + "code": { + "type": "string", + "description": "One of a server-defined set of error codes." + }, + "message": { + "type": "string", + "description": "A human-readable representation of the error." + }, + "target": { + "type": "string", + "description": "The target of the error." + }, + "details": { + "type": "array", + "description": "An array of details about specific errors that led to this reported error.", + "items": { + "$ref": "#/definitions/Azure.Core.Foundations.Error" + }, + "x-ms-identifiers": [] + }, + "innererror": { + "$ref": "#/definitions/Azure.Core.Foundations.InnerError", + "description": "An object containing more specific information than the current object about the error." + } + }, + "required": [ + "code", + "message" + ] + }, + "Azure.Core.Foundations.ErrorResponse": { + "type": "object", + "description": "A response containing error details.", + "properties": { + "error": { + "$ref": "#/definitions/Azure.Core.Foundations.Error", + "description": "The error object." + } + }, + "required": [ + "error" + ] + }, + "Azure.Core.Foundations.InnerError": { + "type": "object", + "description": "An object containing more specific information about the error. As per Microsoft One API guidelines - https://github.com/Microsoft/api-guidelines/blob/vNext/Guidelines.md#7102-error-condition-responses.", + "properties": { + "code": { + "type": "string", + "description": "One of a server-defined set of error codes." + }, + "innererror": { + "$ref": "#/definitions/Azure.Core.Foundations.InnerError", + "description": "Inner error." + } + } + }, + "Collection": { + "type": "object", + "description": "Identifier for collections.", + "properties": { + "collectionId": { + "type": "string", + "description": "The collection id.", + "readOnly": true + } + }, + "required": [ + "collectionId" + ] + }, + "LedgerEntry": { + "type": "object", + "description": "Details about a ledger entry.", + "properties": { + "contents": { + "type": "string", + "description": "Contents of the ledger entry." + }, + "collectionId": { + "type": "string", + "description": "The collection id.", + "readOnly": true + }, + "transactionId": { + "$ref": "#/definitions/TransactionId", + "description": "A unique identifier for the state of the ledger. If returned as part of a LedgerEntry, it indicates the state from which the entry was read.", + "readOnly": true + } + }, + "required": [ + "contents", + "collectionId", + "transactionId" + ] + }, + "LedgerQueryState": { + "type": "string", + "description": "State of a ledger query.", + "enum": [ + "Loading", + "Ready" + ], + "x-ms-enum": { + "name": "LedgerQueryState", + "modelAsString": false + } + }, + "LedgerUser": { + "type": "object", + "description": "Details about a Confidential ledger user.", + "properties": { + "userId": { + "type": "string", + "description": "The user id, either an AAD object ID or certificate fingerprint.", + "readOnly": true, + "x-ms-skip-url-encoding": true + }, + "assignedRole": { + "$ref": "#/definitions/LedgerUserRole", + "description": "The user's assigned role." + } + }, + "required": [ + "userId", + "assignedRole" + ] + }, + "LedgerUserCreateOrUpdate": { + "type": "object", + "description": "Details about a Confidential ledger user.", + "properties": { + "assignedRole": { + "$ref": "#/definitions/LedgerUserRole", + "description": "The user's assigned role." + } + } + }, + "LedgerUserRole": { + "type": "string", + "description": "Represents an assignable role.", + "enum": [ + "Administrator", + "Contributor", + "Reader" + ], + "x-ms-enum": { + "name": "LedgerUserRole", + "modelAsString": false + } + }, + "MyFlow": { + "type": "object", + "description": "Define the auth flow", + "properties": { + "type": { + "type": "string", + "description": "type of auth flow", + "enum": [ + "implicit" + ] + }, + "authorizationUrl": { + "type": "string", + "description": "authorizationUrl of auth flow", + "enum": [ + "https://login.microsoftonline.com/common/v2.0/oauth2/authorize" + ], + "x-ms-enum": { + "modelAsString": false + } + }, + "tokenUrl": { + "type": "string", + "description": "tokenUrl of auth flow", + "enum": [ + "https://login.microsoftonline.com/common/v2.0/oauth2/token" + ], + "x-ms-enum": { + "modelAsString": false + } + }, + "scopes": { + "type": "array", + "description": "scopes of auth flow", + "items": {} + } + }, + "required": [ + "type", + "authorizationUrl", + "tokenUrl", + "scopes" + ] + }, + "PagedLedgerEntries": { + "type": "object", + "description": "Paginated ledger entries returned in response to a query.", + "properties": { + "entries": { + "type": "array", + "description": "Array of ledger entries.", + "items": { + "$ref": "#/definitions/LedgerEntry" + }, + "x-ms-identifiers": [] + }, + "state": { + "$ref": "#/definitions/LedgerQueryState", + "description": "State of the ledger query." + }, + "nextLink": { + "type": "string", + "format": "uri", + "description": "Path from which to retrieve the next page of results." + } + }, + "required": [ + "entries", + "state" + ] + }, + "ReceiptContents": { + "type": "object", + "description": "The contents of a receipt." + }, + "TransactionId": { + "type": "string", + "description": "A unique identifier for the state of the ledger. If returned as part of a LedgerEntry, it indicates the state from which the entry was read." + }, + "TransactionReceipt": { + "type": "object", + "description": "A receipt certifying the transaction at the specified id.", + "properties": { + "receipt": { + "$ref": "#/definitions/ReceiptContents", + "description": "The receipt contents." + }, + "state": { + "$ref": "#/definitions/LedgerQueryState", + "description": "The state of the ledger query." + }, + "transactionId": { + "$ref": "#/definitions/TransactionId", + "description": "The transaction ID." + } + }, + "required": [ + "receipt", + "state", + "transactionId" + ] + }, + "TransactionState": { + "type": "string", + "description": "Represents the state of the transaction.", + "enum": [ + "Committed", + "Pending" + ], + "x-ms-enum": { + "name": "TransactionState", + "modelAsString": false + } + }, + "TransactionStatus": { + "type": "object", + "description": "Response returned to a query for the transaction status.", + "properties": { + "state": { + "$ref": "#/definitions/TransactionState", + "description": "The transaction state." + }, + "transactionId": { + "$ref": "#/definitions/TransactionId", + "description": "The transaction ID." + } + }, + "required": [ + "state", + "transactionId" + ] + } + }, + "parameters": { + "Azure.Core.Foundations.ApiVersionParameter": { + "name": "api-version", + "in": "query", + "description": "The API version to use for this operation.", + "required": true, + "type": "string", + "minLength": 1, + "x-ms-parameter-location": "method", + "x-ms-client-name": "apiVersion" + }, + "CollectionIdParameter": { + "name": "collectionId", + "in": "query", + "description": "The collection id.", + "required": false, + "type": "string", + "x-ms-parameter-location": "method" + } + } +} diff --git a/packages/typespec-test/test/loadTest/generated/openapi/2022-11-01/openapi.json b/packages/typespec-test/test/loadTest/generated/openapi/2022-11-01/openapi.json new file mode 100644 index 0000000000..e5ea6ebcf5 --- /dev/null +++ b/packages/typespec-test/test/loadTest/generated/openapi/2022-11-01/openapi.json @@ -0,0 +1,3523 @@ +{ + "swagger": "2.0", + "info": { + "title": "Azure Load Testing", + "version": "2022-11-01", + "description": "These APIs allow end users to create, view and run load tests using Azure Load\nTest Service.", + "x-typespec-generated": [ + { + "emitter": "@azure-tools/typespec-autorest" + } + ] + }, + "schemes": [ + "https" + ], + "x-ms-parameterized-host": { + "hostTemplate": "https://{endpoint}", + "useSchemePrefix": false, + "parameters": [ + { + "name": "endpoint", + "in": "path", + "required": true, + "type": "string" + } + ] + }, + "produces": [ + "application/json" + ], + "consumes": [ + "application/json" + ], + "security": [ + { + "Oauth2": [ + "https://cnt-prod.loadtesting.azure.com/.default" + ] + } + ], + "securityDefinitions": { + "Oauth2": { + "type": "oauth2", + "description": "The Azure Active Directory OAuth2 Flow", + "flow": "implicit", + "authorizationUrl": "https://login.microsoftonline.com/common/oauth2/v2.0/authorize", + "scopes": { + "https://cnt-prod.loadtesting.azure.com/.default": "" + } + } + }, + "tags": [], + "paths": { + "/test-runs": { + "get": { + "operationId": "LoadTestRun_ListTestRuns", + "summary": "Get all test runs with given filters", + "description": "Get all test runs with given filters", + "parameters": [ + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + }, + { + "name": "orderby", + "in": "query", + "description": "Sort on the supported fields in (field asc/desc) format. eg: executedDateTime\nasc. Supported fields - executedDateTime", + "required": false, + "type": "string" + }, + { + "name": "search", + "in": "query", + "description": "Prefix based, case sensitive search on searchable fields - description,\nexecutedUser. For example, to search for a test run, with description 500 VUs,\nthe search parameter can be 500.", + "required": false, + "type": "string" + }, + { + "name": "testId", + "in": "query", + "description": "Unique name of an existing load test.", + "required": false, + "type": "string" + }, + { + "name": "executionFrom", + "in": "query", + "description": "Start DateTime(ISO 8601 literal format) of test-run execution time filter range.", + "required": false, + "type": "string", + "format": "date-time" + }, + { + "name": "executionTo", + "in": "query", + "description": "End DateTime(ISO 8601 literal format) of test-run execution time filter range.", + "required": false, + "type": "string", + "format": "date-time" + }, + { + "name": "status", + "in": "query", + "description": "Comma separated list of test run status.", + "required": false, + "type": "string" + }, + { + "name": "maxpagesize", + "in": "query", + "description": "Number of results in response.", + "required": false, + "type": "integer", + "format": "int32" + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "schema": { + "$ref": "#/definitions/PagedTestRun" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" + }, + "headers": { + "x-ms-error-code": { + "type": "string", + "description": "String error code indicating what went wrong." + } + } + } + }, + "x-ms-pageable": { + "nextLinkName": "nextLink" + } + } + }, + "/test-runs/{testRunId}": { + "get": { + "operationId": "LoadTestRun_GetTestRun", + "summary": "Get test run details by name.", + "description": "Get test run details by name.", + "parameters": [ + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + }, + { + "name": "testRunId", + "in": "path", + "description": "Unique name for the load test run, must contain only lower-case alphabetic,\nnumeric, underscore or hyphen characters.", + "required": true, + "type": "string" + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "schema": { + "$ref": "#/definitions/TestRun" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" + }, + "headers": { + "x-ms-error-code": { + "type": "string", + "description": "String error code indicating what went wrong." + } + } + } + } + }, + "patch": { + "operationId": "LoadTestRun_CreateOrUpdateTestRun", + "summary": "Create and start a new test run with the given name.", + "description": "Create and start a new test run with the given name.", + "consumes": [ + "application/merge-patch+json" + ], + "parameters": [ + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + }, + { + "name": "testRunId", + "in": "path", + "description": "Unique test run name as identifier", + "required": true, + "type": "string" + }, + { + "name": "oldTestRunId", + "in": "query", + "description": "Existing test run identifier that should be rerun, if this is provided, the\ntest will run with the JMX file, configuration and app components from the\nexisting test run. You can override the configuration values for new test run\nin the request body.", + "required": false, + "type": "string" + }, + { + "name": "resource", + "in": "body", + "description": "The resource instance.", + "required": true, + "schema": { + "$ref": "#/definitions/TestRunCreateOrUpdate" + } + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "schema": { + "$ref": "#/definitions/TestRun" + }, + "headers": { + "Operation-Location": { + "type": "string", + "format": "uri", + "description": "The location for monitoring the operation state." + } + } + }, + "201": { + "description": "The request has succeeded and a new resource has been created as a result.", + "schema": { + "$ref": "#/definitions/TestRun" + }, + "headers": { + "Operation-Location": { + "type": "string", + "format": "uri", + "description": "The location for monitoring the operation state." + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" + }, + "headers": { + "x-ms-error-code": { + "type": "string", + "description": "String error code indicating what went wrong." + } + } + } + }, + "x-ms-long-running-operation": true + }, + "delete": { + "operationId": "LoadTestRun_DeleteTestRun", + "summary": "Delete a test run by its name.", + "description": "Delete a test run by its name.", + "parameters": [ + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + }, + { + "name": "testRunId", + "in": "path", + "description": "Unique name for the load test run, must contain only lower-case alphabetic,\nnumeric, underscore or hyphen characters.", + "required": true, + "type": "string" + } + ], + "responses": { + "204": { + "description": "There is no content to send for this request, but the headers may be useful. " + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" + }, + "headers": { + "x-ms-error-code": { + "type": "string", + "description": "String error code indicating what went wrong." + } + } + } + } + } + }, + "/test-runs/{testRunId}:stop": { + "post": { + "operationId": "LoadTestRun_StopTestRun", + "summary": "Stop test run by name.", + "description": "Stop test run by name.", + "parameters": [ + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + }, + { + "name": "testRunId", + "in": "path", + "description": "Unique name for the load test run, must contain only lower-case alphabetic,\nnumeric, underscore or hyphen characters.", + "required": true, + "type": "string" + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "schema": { + "$ref": "#/definitions/TestRun" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" + }, + "headers": { + "x-ms-error-code": { + "type": "string", + "description": "String error code indicating what went wrong." + } + } + } + } + } + }, + "/test-runs/{testRunId}/app-components": { + "get": { + "operationId": "LoadTestRun_GetAppComponents", + "summary": "Get associated app component (collection of azure resources) for the given test\nrun.", + "description": "Get associated app component (collection of azure resources) for the given test\nrun.", + "parameters": [ + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + }, + { + "name": "testRunId", + "in": "path", + "description": "Unique name for the load test run, must contain only lower-case alphabetic,\nnumeric, underscore or hyphen characters.", + "required": true, + "type": "string" + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "schema": { + "$ref": "#/definitions/TestRunAppComponents" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" + }, + "headers": { + "x-ms-error-code": { + "type": "string", + "description": "String error code indicating what went wrong." + } + } + } + } + }, + "patch": { + "operationId": "LoadTestRun_CreateOrUpdateAppComponents", + "summary": "Associate an app component (collection of azure resources) to a test run", + "description": "Associate an app component (collection of azure resources) to a test run", + "consumes": [ + "application/merge-patch+json" + ], + "parameters": [ + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + }, + { + "name": "testRunId", + "in": "path", + "description": "Unique name for the load test run, must contain only lower-case alphabetic,\nnumeric, underscore or hyphen characters.", + "required": true, + "type": "string" + }, + { + "name": "body", + "in": "body", + "description": "App Component model.", + "required": true, + "schema": { + "$ref": "#/definitions/TestRunAppComponentsUpdate" + } + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "schema": { + "$ref": "#/definitions/TestRunAppComponents" + } + }, + "201": { + "description": "The request has succeeded and a new resource has been created as a result.", + "schema": { + "$ref": "#/definitions/TestRunAppComponents" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" + }, + "headers": { + "x-ms-error-code": { + "type": "string", + "description": "String error code indicating what went wrong." + } + } + } + } + } + }, + "/test-runs/{testRunId}/files/{fileName}": { + "get": { + "operationId": "LoadTestRun_GetTestRunFile", + "summary": "Get test run file by file name.", + "description": "Get test run file by file name.", + "parameters": [ + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + }, + { + "name": "testRunId", + "in": "path", + "description": "Unique name for the load test run, must contain only lower-case alphabetic,\nnumeric, underscore or hyphen characters.", + "required": true, + "type": "string" + }, + { + "name": "fileName", + "in": "path", + "description": "Test run file name with file extension", + "required": true, + "type": "string" + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "schema": { + "$ref": "#/definitions/FileInfo" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" + }, + "headers": { + "x-ms-error-code": { + "type": "string", + "description": "String error code indicating what went wrong." + } + } + } + } + } + }, + "/test-runs/{testRunId}/metric-definitions": { + "get": { + "operationId": "LoadTestRun_ListMetricDefinitions", + "summary": "List the metric definitions for a load test run.", + "description": "List the metric definitions for a load test run.", + "parameters": [ + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + }, + { + "name": "testRunId", + "in": "path", + "description": "Unique name for the load test run, must contain only lower-case alphabetic,\nnumeric, underscore or hyphen characters.", + "required": true, + "type": "string" + }, + { + "name": "metricNamespace", + "in": "query", + "description": "Metric namespace to query metric definitions for.", + "required": false, + "type": "string" + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "schema": { + "$ref": "#/definitions/MetricDefinitionCollection" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" + }, + "headers": { + "x-ms-error-code": { + "type": "string", + "description": "String error code indicating what went wrong." + } + } + } + } + } + }, + "/test-runs/{testRunId}/metric-dimensions/{name}/values": { + "get": { + "operationId": "LoadTestRun_ListMetricDimensionValues", + "summary": "List the dimension values for the given metric dimension name.", + "description": "List the dimension values for the given metric dimension name.", + "parameters": [ + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + }, + { + "name": "testRunId", + "in": "path", + "description": "Unique test run name as identifier", + "required": true, + "type": "string" + }, + { + "name": "name", + "in": "path", + "description": "Dimension name", + "required": true, + "type": "string" + }, + { + "$ref": "#/parameters/MetricDimensions.interval" + }, + { + "$ref": "#/parameters/MetricDimensions.metricName" + }, + { + "$ref": "#/parameters/MetricDimensions.metricNamespace" + }, + { + "$ref": "#/parameters/MetricDimensions.timespan" + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "schema": { + "$ref": "#/definitions/PagedDimensionValueList" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" + }, + "headers": { + "x-ms-error-code": { + "type": "string", + "description": "String error code indicating what went wrong." + } + } + } + }, + "x-ms-pageable": { + "nextLinkName": "nextLink" + } + } + }, + "/test-runs/{testRunId}/metric-namespaces": { + "get": { + "operationId": "LoadTestRun_ListMetricNamespaces", + "summary": "List the metric namespaces for a load test run.", + "description": "List the metric namespaces for a load test run.", + "parameters": [ + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + }, + { + "name": "testRunId", + "in": "path", + "description": "Unique name for the load test run, must contain only lower-case alphabetic,\nnumeric, underscore or hyphen characters.", + "required": true, + "type": "string" + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "schema": { + "$ref": "#/definitions/MetricNamespaceCollection" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" + }, + "headers": { + "x-ms-error-code": { + "type": "string", + "description": "String error code indicating what went wrong." + } + } + } + } + } + }, + "/test-runs/{testRunId}/metrics": { + "post": { + "operationId": "LoadTestRun_ListMetrics", + "summary": "List the metric values for a load test run.", + "description": "List the metric values for a load test run.", + "parameters": [ + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + }, + { + "name": "testRunId", + "in": "path", + "description": "Unique name for the load test run, must contain only lower-case alphabetic,\nnumeric, underscore or hyphen characters.", + "required": true, + "type": "string" + }, + { + "name": "aggregation", + "in": "query", + "description": "The aggregation", + "required": false, + "type": "string" + }, + { + "name": "interval", + "in": "query", + "description": "The interval (i.e. timegrain) of the query.", + "required": false, + "type": "string", + "enum": [ + "PT5S", + "PT10S", + "PT1M", + "PT5M", + "PT1H" + ], + "x-ms-enum": { + "name": "Interval", + "modelAsString": true, + "values": [ + { + "name": "PT5S", + "value": "PT5S", + "description": "5 seconds, available only if test run duration is less than 10 minutes" + }, + { + "name": "PT10S", + "value": "PT10S", + "description": "10 seconds, available only if test run duration is less than 10 minutes" + }, + { + "name": "PT1M", + "value": "PT1M", + "description": "1 minute" + }, + { + "name": "PT5M", + "value": "PT5M", + "description": "5 minutes, available only if test run duration is greater than 1 minute" + }, + { + "name": "PT1H", + "value": "PT1H", + "description": "1 hour, available only if test run duration is greater than 1 minute" + } + ] + } + }, + { + "name": "metricName", + "in": "query", + "description": "Metric name", + "required": false, + "type": "string" + }, + { + "name": "metricNamespace", + "in": "query", + "description": "Metric namespace to query metric definitions for.", + "required": false, + "type": "string" + }, + { + "name": "timespan", + "in": "query", + "description": "The timespan of the query. It is a string with the following format\n'startDateTime_ISO/endDateTime_ISO'.", + "required": false, + "type": "string" + }, + { + "name": "body", + "in": "body", + "description": "Metric dimension filter ", + "required": true, + "schema": { + "$ref": "#/definitions/MetricRequestPayload" + } + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "schema": { + "$ref": "#/definitions/PagedTimeSeriesElement" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" + }, + "headers": { + "x-ms-error-code": { + "type": "string", + "description": "String error code indicating what went wrong." + } + } + } + }, + "x-ms-pageable": { + "nextLinkName": "nextLink" + } + } + }, + "/test-runs/{testRunId}/server-metrics-config": { + "get": { + "operationId": "LoadTestRun_GetServerMetricsConfig", + "summary": "List server metrics configuration for the given test run.", + "description": "List server metrics configuration for the given test run.", + "parameters": [ + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + }, + { + "name": "testRunId", + "in": "path", + "description": "Unique name for the load test run, must contain only lower-case alphabetic,\nnumeric, underscore or hyphen characters.", + "required": true, + "type": "string" + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "schema": { + "$ref": "#/definitions/TestRunServerMetricConfig" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" + }, + "headers": { + "x-ms-error-code": { + "type": "string", + "description": "String error code indicating what went wrong." + } + } + } + } + }, + "patch": { + "operationId": "LoadTestRun_CreateOrUpdateServerMetricsConfig", + "summary": "Configure server metrics for a test run", + "description": "Configure server metrics for a test run", + "consumes": [ + "application/merge-patch+json" + ], + "parameters": [ + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + }, + { + "name": "testRunId", + "in": "path", + "description": "Unique name for the load test run, must contain only lower-case alphabetic,\nnumeric, underscore or hyphen characters.", + "required": true, + "type": "string" + }, + { + "name": "body", + "in": "body", + "description": "Server metric configuration model.", + "required": true, + "schema": { + "$ref": "#/definitions/TestRunServerMetricConfig" + } + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "schema": { + "$ref": "#/definitions/TestRunServerMetricConfig" + } + }, + "201": { + "description": "The request has succeeded and a new resource has been created as a result.", + "schema": { + "$ref": "#/definitions/TestRunServerMetricConfig" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" + }, + "headers": { + "x-ms-error-code": { + "type": "string", + "description": "String error code indicating what went wrong." + } + } + } + } + } + }, + "/tests": { + "get": { + "operationId": "LoadTestAdministration_ListTests", + "summary": "Get all load tests by the fully qualified resource Id e.g\nsubscriptions/{subId}/resourceGroups/{rg}/providers/Microsoft.LoadTestService/loadtests/{resName}.", + "description": "Get all load tests by the fully qualified resource Id e.g\nsubscriptions/{subId}/resourceGroups/{rg}/providers/Microsoft.LoadTestService/loadtests/{resName}.", + "parameters": [ + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + }, + { + "name": "orderby", + "in": "query", + "description": "Sort on the supported fields in (field asc/desc) format. eg:\nlastModifiedDateTime asc. Supported fields - lastModifiedDateTime", + "required": false, + "type": "string" + }, + { + "name": "search", + "in": "query", + "description": "Prefix based, case sensitive search on searchable fields - displayName,\ncreatedBy. For example, to search for a test, with display name is Login Test,\nthe search parameter can be Login.", + "required": false, + "type": "string" + }, + { + "name": "lastModifiedStartTime", + "in": "query", + "description": "Start DateTime(ISO 8601 literal format) of the last updated time range to\nfilter tests.", + "required": false, + "type": "string", + "format": "date-time" + }, + { + "name": "lastModifiedEndTime", + "in": "query", + "description": "End DateTime(ISO 8601 literal format) of the last updated time range to filter\ntests.", + "required": false, + "type": "string", + "format": "date-time" + }, + { + "name": "maxpagesize", + "in": "query", + "description": "Number of results in response.", + "required": false, + "type": "integer", + "format": "int32" + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "schema": { + "$ref": "#/definitions/PagedTest" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" + }, + "headers": { + "x-ms-error-code": { + "type": "string", + "description": "String error code indicating what went wrong." + } + } + } + }, + "x-ms-pageable": { + "nextLinkName": "nextLink" + } + } + }, + "/tests/{testId}": { + "get": { + "operationId": "LoadTestAdministration_GetTest", + "summary": "Get load test details by test name", + "description": "Get load test details by test name", + "parameters": [ + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + }, + { + "name": "testId", + "in": "path", + "description": "Unique name for the load test, must contain only lower-case alphabetic,\nnumeric, underscore or hyphen characters.", + "required": true, + "type": "string" + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "schema": { + "$ref": "#/definitions/Test" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" + }, + "headers": { + "x-ms-error-code": { + "type": "string", + "description": "String error code indicating what went wrong." + } + } + } + } + }, + "patch": { + "operationId": "LoadTestAdministration_CreateOrUpdateTest", + "summary": "Create a new test or update an existing test.", + "description": "Create a new test or update an existing test.", + "consumes": [ + "application/merge-patch+json" + ], + "parameters": [ + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + }, + { + "name": "testId", + "in": "path", + "description": "Unique name for the load test, must contain only lower-case alphabetic,\nnumeric, underscore or hyphen characters.", + "required": true, + "type": "string" + }, + { + "name": "body", + "in": "body", + "description": "Load test model", + "required": true, + "schema": { + "$ref": "#/definitions/Test" + } + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "schema": { + "$ref": "#/definitions/Test" + } + }, + "201": { + "description": "The request has succeeded and a new resource has been created as a result.", + "schema": { + "$ref": "#/definitions/Test" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" + }, + "headers": { + "x-ms-error-code": { + "type": "string", + "description": "String error code indicating what went wrong." + } + } + } + } + }, + "delete": { + "operationId": "LoadTestAdministration_DeleteTest", + "summary": "Delete a test by its name.", + "description": "Delete a test by its name.", + "parameters": [ + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + }, + { + "name": "testId", + "in": "path", + "description": "Unique name for the load test, must contain only lower-case alphabetic,\nnumeric, underscore or hyphen characters.", + "required": true, + "type": "string" + } + ], + "responses": { + "204": { + "description": "There is no content to send for this request, but the headers may be useful. " + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" + }, + "headers": { + "x-ms-error-code": { + "type": "string", + "description": "String error code indicating what went wrong." + } + } + } + } + } + }, + "/tests/{testId}/app-components": { + "get": { + "operationId": "LoadTestAdministration_GetAppComponents", + "summary": "Get associated app component (collection of azure resources) for the given test.", + "description": "Get associated app component (collection of azure resources) for the given test.", + "parameters": [ + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + }, + { + "name": "testId", + "in": "path", + "description": "Unique name for the load test, must contain only lower-case alphabetic,\nnumeric, underscore or hyphen characters.", + "required": true, + "type": "string" + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "schema": { + "$ref": "#/definitions/TestAppComponents" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" + }, + "headers": { + "x-ms-error-code": { + "type": "string", + "description": "String error code indicating what went wrong." + } + } + } + } + }, + "patch": { + "operationId": "LoadTestAdministration_CreateOrUpdateAppComponents", + "summary": "Associate an app component (collection of azure resources) to a test", + "description": "Associate an app component (collection of azure resources) to a test", + "consumes": [ + "application/merge-patch+json" + ], + "parameters": [ + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + }, + { + "name": "testId", + "in": "path", + "description": "Unique name for the load test, must contain only lower-case alphabetic,\nnumeric, underscore or hyphen characters.", + "required": true, + "type": "string" + }, + { + "name": "body", + "in": "body", + "description": "App Component model.", + "required": true, + "schema": { + "$ref": "#/definitions/TestAppComponentsUpdate" + } + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "schema": { + "$ref": "#/definitions/TestAppComponents" + } + }, + "201": { + "description": "The request has succeeded and a new resource has been created as a result.", + "schema": { + "$ref": "#/definitions/TestAppComponents" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" + }, + "headers": { + "x-ms-error-code": { + "type": "string", + "description": "String error code indicating what went wrong." + } + } + } + } + } + }, + "/tests/{testId}/files": { + "get": { + "operationId": "LoadTestAdministration_ListTestFiles", + "summary": "Get all test files.", + "description": "Get all test files.", + "parameters": [ + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + }, + { + "name": "testId", + "in": "path", + "description": "Unique name for the load test, must contain only lower-case alphabetic,\nnumeric, underscore or hyphen characters.", + "required": true, + "type": "string" + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "schema": { + "$ref": "#/definitions/PagedFileInfo" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" + }, + "headers": { + "x-ms-error-code": { + "type": "string", + "description": "String error code indicating what went wrong." + } + } + } + }, + "x-ms-pageable": { + "nextLinkName": "nextLink" + } + } + }, + "/tests/{testId}/files/{fileName}": { + "get": { + "operationId": "LoadTestAdministration_GetTestFile", + "summary": "Get test file by the file name.", + "description": "Get test file by the file name.", + "parameters": [ + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + }, + { + "name": "testId", + "in": "path", + "description": "Unique name for the load test, must contain only lower-case alphabetic,\nnumeric, underscore or hyphen characters.", + "required": true, + "type": "string" + }, + { + "name": "fileName", + "in": "path", + "description": "File name with file extension like app.jmx", + "required": true, + "type": "string" + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "schema": { + "$ref": "#/definitions/FileInfo" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" + }, + "headers": { + "x-ms-error-code": { + "type": "string", + "description": "String error code indicating what went wrong." + } + } + } + } + }, + "put": { + "operationId": "LoadTestAdministration_UploadTestFile", + "summary": "Upload input file for a given test name. File size can't be more than 50 MB.\nExisting file with same name for the given test will be overwritten. File\nshould be provided in the request body as application/octet-stream.", + "description": "Upload input file for a given test name. File size can't be more than 50 MB.\nExisting file with same name for the given test will be overwritten. File\nshould be provided in the request body as application/octet-stream.", + "consumes": [ + "application/octet-stream" + ], + "parameters": [ + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + }, + { + "name": "testId", + "in": "path", + "description": "Unique name for the load test, must contain only lower-case alphabetic,\nnumeric, underscore or hyphen characters.", + "required": true, + "type": "string" + }, + { + "name": "fileName", + "in": "path", + "description": "Unique name for test file with file extension like : App.jmx", + "required": true, + "type": "string" + }, + { + "name": "fileType", + "in": "query", + "description": "File type", + "required": false, + "type": "string", + "enum": [ + "JMX_FILE", + "USER_PROPERTIES", + "ADDITIONAL_ARTIFACTS" + ], + "x-ms-enum": { + "name": "FileType", + "modelAsString": true, + "values": [ + { + "name": "JMX_FILE", + "value": "JMX_FILE", + "description": "If file is jmx script" + }, + { + "name": "USER_PROPERTIES", + "value": "USER_PROPERTIES", + "description": "If file is user properties" + }, + { + "name": "ADDITIONAL_ARTIFACTS", + "value": "ADDITIONAL_ARTIFACTS", + "description": "If file is not any of other supported type" + } + ] + } + }, + { + "name": "body", + "in": "body", + "description": "The file content as application/octet-stream.", + "required": true, + "schema": { + "type": "string", + "format": "binary" + } + } + ], + "responses": { + "201": { + "description": "The request has succeeded and a new resource has been created as a result.", + "schema": { + "$ref": "#/definitions/FileInfo" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" + }, + "headers": { + "x-ms-error-code": { + "type": "string", + "description": "String error code indicating what went wrong." + } + } + } + } + }, + "delete": { + "operationId": "LoadTestAdministration_DeleteTestFile", + "summary": "Delete file by the file name for a test", + "description": "Delete file by the file name for a test", + "parameters": [ + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + }, + { + "name": "testId", + "in": "path", + "description": "Unique name for the load test, must contain only lower-case alphabetic,\nnumeric, underscore or hyphen characters.", + "required": true, + "type": "string" + }, + { + "name": "fileName", + "in": "path", + "description": "File name with file extension like app.jmx", + "required": true, + "type": "string" + } + ], + "responses": { + "204": { + "description": "There is no content to send for this request, but the headers may be useful. " + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" + }, + "headers": { + "x-ms-error-code": { + "type": "string", + "description": "String error code indicating what went wrong." + } + } + } + } + } + }, + "/tests/{testId}/server-metrics-config": { + "get": { + "operationId": "LoadTestAdministration_GetServerMetricsConfig", + "summary": "List server metrics configuration for the given test.", + "description": "List server metrics configuration for the given test.", + "parameters": [ + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + }, + { + "name": "testId", + "in": "path", + "description": "Unique name for the load test, must contain only lower-case alphabetic,\nnumeric, underscore or hyphen characters.", + "required": true, + "type": "string" + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "schema": { + "$ref": "#/definitions/TestServerMetricConfig" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" + }, + "headers": { + "x-ms-error-code": { + "type": "string", + "description": "String error code indicating what went wrong." + } + } + } + } + }, + "patch": { + "operationId": "LoadTestAdministration_CreateOrUpdateServerMetricsConfig", + "summary": "Configure server metrics for a test", + "description": "Configure server metrics for a test", + "consumes": [ + "application/merge-patch+json" + ], + "parameters": [ + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + }, + { + "name": "testId", + "in": "path", + "description": "Unique name for the load test, must contain only lower-case alphabetic,\nnumeric, underscore or hyphen characters.", + "required": true, + "type": "string" + }, + { + "name": "body", + "in": "body", + "description": "Server metric configuration model.", + "required": true, + "schema": { + "$ref": "#/definitions/TestServerMetricConfig" + } + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "schema": { + "$ref": "#/definitions/TestServerMetricConfig" + } + }, + "201": { + "description": "The request has succeeded and a new resource has been created as a result.", + "schema": { + "$ref": "#/definitions/TestServerMetricConfig" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" + }, + "headers": { + "x-ms-error-code": { + "type": "string", + "description": "String error code indicating what went wrong." + } + } + } + } + } + } + }, + "definitions": { + "APIVersions": { + "type": "string", + "enum": [ + "2022-11-01" + ], + "x-ms-enum": { + "name": "APIVersions", + "modelAsString": true, + "values": [ + { + "name": "v2022_11_01", + "value": "2022-11-01" + } + ] + } + }, + "AggregationType": { + "type": "string", + "enum": [ + "Average", + "Count", + "None", + "Total", + "Percentile90", + "Percentile95", + "Percentile99" + ], + "x-ms-enum": { + "name": "AggregationType", + "modelAsString": true, + "values": [ + { + "name": "Average", + "value": "Average", + "description": "Average value" + }, + { + "name": "Count", + "value": "Count", + "description": "Total count" + }, + { + "name": "None", + "value": "None", + "description": "Aggregation will be average in this case" + }, + { + "name": "Total", + "value": "Total", + "description": "Total sum" + }, + { + "name": "Percentile90", + "value": "Percentile90", + "description": "90th percentile" + }, + { + "name": "Percentile95", + "value": "Percentile95", + "description": "95th percentile" + }, + { + "name": "Percentile99", + "value": "Percentile99", + "description": "99th percentile" + } + ] + } + }, + "AppComponent": { + "type": "object", + "description": "An Azure resource object (Refer azure generic resource model :\nhttps://docs.microsoft.com/en-us/rest/api/resources/resources/get-by-id#genericresource)", + "properties": { + "resourceId": { + "type": "string", + "description": "fully qualified resource Id e.g\nsubscriptions/{subId}/resourceGroups/{rg}/providers/Microsoft.LoadTestService/loadtests/{resName}", + "readOnly": true + }, + "resourceName": { + "type": "string", + "description": "Azure resource name, required while creating the app component." + }, + "resourceType": { + "type": "string", + "description": "Azure resource type, required while creating the app component." + }, + "displayName": { + "type": "string", + "description": "Azure resource display name" + }, + "resourceGroup": { + "type": "string", + "description": "Resource group name of the Azure resource", + "readOnly": true + }, + "subscriptionId": { + "type": "string", + "description": "Subscription Id of the Azure resource", + "readOnly": true + }, + "kind": { + "type": "string", + "description": "Kind of Azure resource type" + } + } + }, + "Azure.Core.Foundations.Error": { + "type": "object", + "description": "The error object.", + "properties": { + "code": { + "type": "string", + "description": "One of a server-defined set of error codes." + }, + "message": { + "type": "string", + "description": "A human-readable representation of the error." + }, + "target": { + "type": "string", + "description": "The target of the error." + }, + "details": { + "type": "array", + "description": "An array of details about specific errors that led to this reported error.", + "items": { + "$ref": "#/definitions/Azure.Core.Foundations.Error" + }, + "x-ms-identifiers": [] + }, + "innererror": { + "$ref": "#/definitions/Azure.Core.Foundations.InnerError", + "description": "An object containing more specific information than the current object about the error." + } + }, + "required": [ + "code", + "message" + ] + }, + "Azure.Core.Foundations.ErrorResponse": { + "type": "object", + "description": "A response containing error details.", + "properties": { + "error": { + "$ref": "#/definitions/Azure.Core.Foundations.Error", + "description": "The error object." + } + }, + "required": [ + "error" + ] + }, + "Azure.Core.Foundations.InnerError": { + "type": "object", + "description": "An object containing more specific information about the error. As per Microsoft One API guidelines - https://github.com/Microsoft/api-guidelines/blob/vNext/Guidelines.md#7102-error-condition-responses.", + "properties": { + "code": { + "type": "string", + "description": "One of a server-defined set of error codes." + }, + "innererror": { + "$ref": "#/definitions/Azure.Core.Foundations.InnerError", + "description": "Inner error." + } + } + }, + "CertificateMetadata": { + "type": "object", + "description": "Certificates metadata", + "properties": { + "value": { + "type": "string", + "description": "The value of the certificate for respective type" + }, + "type": { + "$ref": "#/definitions/CertificateType", + "description": "Type of certificate" + }, + "name": { + "type": "string", + "description": "Name of the certificate." + } + } + }, + "CertificateType": { + "type": "string", + "enum": [ + "AKV_CERT_URI" + ], + "x-ms-enum": { + "name": "CertificateType", + "modelAsString": true, + "values": [ + { + "name": "AKV_CERT_URI", + "value": "AKV_CERT_URI", + "description": "If the certificate is stored in an Azure Key Vault" + } + ] + } + }, + "Dimension": { + "type": "object" + }, + "DimensionFilter": { + "type": "object", + "description": "Dimension name and values to filter", + "properties": { + "name": { + "type": "string", + "description": "The dimension name" + }, + "values": { + "type": "array", + "description": "The dimension values. Maximum values can be 20.", + "items": { + "type": "string" + } + } + } + }, + "DimensionValue": { + "type": "object", + "description": "Represents a metric dimension value.", + "properties": { + "name": { + "type": "string", + "description": "The name of the dimension." + }, + "value": { + "type": "string", + "description": "The value of the dimension." + } + } + }, + "DimensionValueList": { + "type": "object", + "properties": { + "value": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": [ + "value" + ] + }, + "Error": { + "type": "object", + "description": "Error from a REST request.", + "properties": { + "code": { + "type": "string", + "description": "The error code." + }, + "message": { + "type": "string", + "description": "The error message." + }, + "target": { + "type": "string", + "description": "The error target." + }, + "details": { + "type": "array", + "description": "Additional details and inner errors.", + "items": { + "$ref": "#/definitions/Error" + }, + "x-ms-identifiers": [] + } + }, + "required": [ + "code", + "message" + ] + }, + "ErrorDetails": { + "type": "object", + "description": "Error details if there is any failure in load test run", + "properties": { + "message": { + "type": "string", + "description": "Error details in case test run was not successfully run.", + "readOnly": true + } + } + }, + "ErrorResponseBody": { + "type": "object", + "description": "The definition of an error object.", + "properties": { + "error": { + "$ref": "#/definitions/Error", + "description": "Error from a REST request." + } + }, + "required": [ + "error" + ] + }, + "FileInfo": { + "type": "object", + "description": "File info", + "properties": { + "url": { + "type": "string", + "description": "File URL." + }, + "fileName": { + "type": "string", + "description": "Name of the file." + }, + "fileType": { + "$ref": "#/definitions/FileType", + "description": "File type" + }, + "expireDateTime": { + "type": "string", + "format": "date-time", + "description": "Expiry time of the file (ISO 8601 literal format)" + }, + "validationStatus": { + "$ref": "#/definitions/FileStatus", + "description": "Validation status of the file" + }, + "validationFailureDetails": { + "type": "string", + "description": "Validation failure error details" + } + } + }, + "FileStatus": { + "type": "string", + "enum": [ + "NOT_VALIDATED", + "VALIDATION_SUCCESS", + "VALIDATION_FAILURE", + "VALIDATION_INITIATED", + "VALIDATION_NOT_REQUIRED" + ], + "x-ms-enum": { + "name": "FileStatus", + "modelAsString": true, + "values": [ + { + "name": "NOT_VALIDATED", + "value": "NOT_VALIDATED", + "description": "File is not validated." + }, + { + "name": "VALIDATION_SUCCESS", + "value": "VALIDATION_SUCCESS", + "description": "File is validated." + }, + { + "name": "VALIDATION_FAILURE", + "value": "VALIDATION_FAILURE", + "description": "File validation is failed." + }, + { + "name": "VALIDATION_INITIATED", + "value": "VALIDATION_INITIATED", + "description": "File validation is in progress." + }, + { + "name": "VALIDATION_NOT_REQUIRED", + "value": "VALIDATION_NOT_REQUIRED", + "description": "Validation is not required." + } + ] + } + }, + "FileType": { + "type": "string", + "enum": [ + "JMX_FILE", + "USER_PROPERTIES", + "ADDITIONAL_ARTIFACTS" + ], + "x-ms-enum": { + "name": "FileType", + "modelAsString": true, + "values": [ + { + "name": "JMX_FILE", + "value": "JMX_FILE", + "description": "If file is jmx script" + }, + { + "name": "USER_PROPERTIES", + "value": "USER_PROPERTIES", + "description": "If file is user properties" + }, + { + "name": "ADDITIONAL_ARTIFACTS", + "value": "ADDITIONAL_ARTIFACTS", + "description": "If file is not any of other supported type" + } + ] + } + }, + "Interval": { + "type": "string", + "enum": [ + "PT5S", + "PT10S", + "PT1M", + "PT5M", + "PT1H" + ], + "x-ms-enum": { + "name": "Interval", + "modelAsString": true, + "values": [ + { + "name": "PT5S", + "value": "PT5S", + "description": "5 seconds, available only if test run duration is less than 10 minutes" + }, + { + "name": "PT10S", + "value": "PT10S", + "description": "10 seconds, available only if test run duration is less than 10 minutes" + }, + { + "name": "PT1M", + "value": "PT1M", + "description": "1 minute" + }, + { + "name": "PT5M", + "value": "PT5M", + "description": "5 minutes, available only if test run duration is greater than 1 minute" + }, + { + "name": "PT1H", + "value": "PT1H", + "description": "1 hour, available only if test run duration is greater than 1 minute" + } + ] + } + }, + "LoadTestConfiguration": { + "type": "object", + "description": "The load test configuration.", + "properties": { + "engineInstances": { + "type": "integer", + "format": "int32", + "description": "The number of engine instances to execute load test. Supported values are in\nrange of 1-45. Required for creating a new test." + }, + "splitAllCSVs": { + "type": "boolean", + "description": "If false, Azure Load Testing copies and processes your input files unmodified\nacross all test engine instances. If true, Azure Load Testing splits the CSV\ninput data evenly across all engine instances. If you provide multiple CSV\nfiles, each file will be split evenly." + }, + "quickStartTest": { + "type": "boolean", + "description": "If true, optionalLoadTestConfig is required and JMX script for the load test is\nnot required to upload." + }, + "optionalLoadTestConfig": { + "$ref": "#/definitions/OptionalLoadTestConfig", + "description": "Optional load test config" + } + } + }, + "MetricAvailability": { + "type": "object", + "description": "Metric availability specifies the time grain (aggregation interval or frequency)", + "properties": { + "timeGrain": { + "$ref": "#/definitions/TimeGrain", + "description": "The time grain specifies the aggregation interval for the metric. Expressed as\na duration 'PT1M', 'PT1H', etc." + } + } + }, + "MetricDefinition": { + "type": "object", + "description": "Metric definition", + "properties": { + "dimensions": { + "type": "array", + "description": "List of dimensions", + "items": { + "$ref": "#/definitions/NameAndDesc" + }, + "x-ms-identifiers": [] + }, + "description": { + "type": "string", + "description": "The metric description" + }, + "name": { + "type": "string", + "description": "The metric name" + }, + "namespace": { + "type": "string", + "description": "The namespace the metric belongs to." + }, + "primaryAggregationType": { + "$ref": "#/definitions/AggregationType", + "description": "The primary aggregation type value defining how to use the values for display." + }, + "supportedAggregationTypes": { + "type": "array", + "description": "The collection of what all aggregation types are supported.", + "items": { + "type": "string" + } + }, + "unit": { + "$ref": "#/definitions/MetricUnit", + "description": "The unit of the metric." + }, + "metricAvailabilities": { + "type": "array", + "description": "Metric availability specifies the time grain (aggregation interval or\nfrequency).", + "items": { + "$ref": "#/definitions/MetricAvailability" + }, + "x-ms-identifiers": [] + } + } + }, + "MetricDefinitionCollection": { + "type": "object", + "description": "Represents collection of metric definitions.", + "properties": { + "value": { + "type": "array", + "description": "the values for the metric definitions.", + "items": { + "$ref": "#/definitions/MetricDefinition" + }, + "x-ms-identifiers": [] + } + }, + "required": [ + "value" + ] + }, + "MetricNamespace": { + "type": "object", + "description": "Metric namespace class specifies the metadata for a metric namespace.", + "properties": { + "description": { + "type": "string", + "description": "The namespace description." + }, + "name": { + "type": "string", + "description": "The metric namespace name." + } + } + }, + "MetricNamespaceCollection": { + "type": "object", + "description": "Represents collection of metric namespaces.", + "properties": { + "value": { + "type": "array", + "description": "The values for the metric namespaces.", + "items": { + "$ref": "#/definitions/MetricNamespace" + }, + "x-ms-identifiers": [] + } + }, + "required": [ + "value" + ] + }, + "MetricRequestPayload": { + "type": "object", + "description": "Filters to fetch the set of metric", + "properties": { + "filters": { + "type": "array", + "description": "Get metrics for specific dimension values. Example: Metric contains dimension\nlike SamplerName, Error. To retrieve all the time series data where SamplerName\nis equals to HTTPRequest1 or HTTPRequest2, the DimensionFilter value will be\n{\"SamplerName\", [\"HTTPRequest1\", \"HTTPRequest2\"}", + "items": { + "$ref": "#/definitions/DimensionFilter" + }, + "x-ms-identifiers": [] + } + } + }, + "MetricUnit": { + "type": "string", + "enum": [ + "NotSpecified", + "Percent", + "Count", + "Seconds", + "Milliseconds", + "Bytes", + "BytesPerSecond", + "CountPerSecond" + ], + "x-ms-enum": { + "name": "MetricUnit", + "modelAsString": true, + "values": [ + { + "name": "NotSpecified", + "value": "NotSpecified", + "description": "No unit specified" + }, + { + "name": "Percent", + "value": "Percent", + "description": "Percentage" + }, + { + "name": "Count", + "value": "Count", + "description": "Value count" + }, + { + "name": "Seconds", + "value": "Seconds", + "description": "Seconds" + }, + { + "name": "Milliseconds", + "value": "Milliseconds", + "description": "Milliseconds" + }, + { + "name": "Bytes", + "value": "Bytes", + "description": "Bytes" + }, + { + "name": "BytesPerSecond", + "value": "BytesPerSecond", + "description": "Bytes per second" + }, + { + "name": "CountPerSecond", + "value": "CountPerSecond", + "description": "Count per second" + } + ] + } + }, + "MetricValue": { + "type": "object", + "description": "Represents a metric value.", + "properties": { + "timestamp": { + "type": "string", + "description": "The timestamp for the metric value in ISO 8601 format." + }, + "value": { + "type": "number", + "format": "float", + "description": "The metric value." + } + } + }, + "NameAndDesc": { + "type": "object", + "description": "The name and description", + "properties": { + "description": { + "type": "string", + "description": "The description" + }, + "name": { + "type": "string", + "description": "The name" + } + } + }, + "Oauth2": { + "type": "object", + "description": "The Azure Active Directory OAuth2 Flow", + "properties": { + "type": { + "type": "string", + "description": "OAuth2 authentication", + "enum": [ + "oauth2" + ] + }, + "flows": { + "type": "array", + "description": "Supported OAuth2 flows", + "items": {} + }, + "defaultScopes": { + "type": "array", + "description": "Oauth2 scopes of every flow. Overridden by scope definitions in specific flows", + "items": {} + } + }, + "required": [ + "type", + "flows", + "defaultScopes" + ] + }, + "OptionalLoadTestConfig": { + "type": "object", + "description": "Optional load test config", + "properties": { + "endpointUrl": { + "type": "string", + "description": "Test URL. Provide the complete HTTP URL. For example,\nhttp://contoso-app.azurewebsites.net/login" + }, + "virtualUsers": { + "type": "integer", + "format": "int32", + "description": "No of concurrent virtual users" + }, + "rampUpTime": { + "type": "integer", + "format": "int32", + "description": "Ramp up time" + }, + "duration": { + "type": "integer", + "format": "int32", + "description": "Test run duration" + } + } + }, + "PFAction": { + "type": "string", + "enum": [ + "continue", + "stop" + ], + "x-ms-enum": { + "name": "PFAction", + "modelAsString": true, + "values": [ + { + "name": "continue", + "value": "continue", + "description": "Test will continue to run even if pass fail metric criteria metric gets failed" + }, + { + "name": "stop", + "value": "stop", + "description": "Test run will stop if pass fail criteria metric is not passed." + } + ] + } + }, + "PFAgFunc": { + "type": "string", + "enum": [ + "count", + "percentage", + "avg", + "p50", + "p90", + "p95", + "p99", + "min", + "max" + ], + "x-ms-enum": { + "name": "PFAgFunc", + "modelAsString": true, + "values": [ + { + "name": "count", + "value": "count", + "description": "Criteria applies for count value" + }, + { + "name": "percentage", + "value": "percentage", + "description": "Criteria applies for given percentage value" + }, + { + "name": "avg", + "value": "avg", + "description": "Criteria applies for avg value" + }, + { + "name": "p50", + "value": "p50", + "description": "Criteria applies for 50th percentile value" + }, + { + "name": "p90", + "value": "p90", + "description": "Criteria applies for 90th percentile value" + }, + { + "name": "p95", + "value": "p95", + "description": "Criteria applies for 95th percentile value" + }, + { + "name": "p99", + "value": "p99", + "description": "Criteria applies for 99th percentile value" + }, + { + "name": "min", + "value": "min", + "description": "Criteria applies for minimum value" + }, + { + "name": "max", + "value": "max", + "description": "Criteria applies for maximum value" + } + ] + } + }, + "PFMetrics": { + "type": "string", + "enum": [ + "response_time_ms", + "latency", + "error", + "requests", + "requests_per_sec" + ], + "x-ms-enum": { + "name": "PFMetrics", + "modelAsString": true, + "values": [ + { + "name": "response_time_ms", + "value": "response_time_ms", + "description": "Pass fail criteria for response time metric" + }, + { + "name": "latency", + "value": "latency", + "description": "Pass fail criteria for response time metric" + }, + { + "name": "error", + "value": "error", + "description": "Pass fail criteria for error metric" + }, + { + "name": "requests", + "value": "requests", + "description": "Pass fail criteria for total requests" + }, + { + "name": "requests_per_sec", + "value": "requests_per_sec", + "description": "Pass fail criteria for request rate." + } + ] + } + }, + "PFResult": { + "type": "string", + "enum": [ + "passed", + "undetermined", + "failed" + ], + "x-ms-enum": { + "name": "PFResult", + "modelAsString": true, + "values": [ + { + "name": "passed", + "value": "passed", + "description": "Given pass fail criteria metric has passed." + }, + { + "name": "undetermined", + "value": "undetermined", + "description": "Given pass fail criteria metric couldn't determine." + }, + { + "name": "failed", + "value": "failed", + "description": "Given pass fail criteria metric has failed." + } + ] + } + }, + "PFTestResult": { + "type": "string", + "enum": [ + "PASSED", + "NOT_APPLICABLE", + "FAILED" + ], + "x-ms-enum": { + "name": "PFTestResult", + "modelAsString": true, + "values": [ + { + "name": "PASSED", + "value": "PASSED", + "description": "Pass/fail criteria has passed." + }, + { + "name": "NOT_APPLICABLE", + "value": "NOT_APPLICABLE", + "description": "Pass/fail criteria is not applicable." + }, + { + "name": "FAILED", + "value": "FAILED", + "description": "Pass/fail criteria has failed." + } + ] + } + }, + "PagedDimensionValueList": { + "type": "object", + "description": "Paged collection of DimensionValueList items", + "properties": { + "value": { + "type": "array", + "description": "The DimensionValueList items on this page", + "items": { + "$ref": "#/definitions/DimensionValueList" + }, + "x-ms-identifiers": [] + }, + "nextLink": { + "type": "string", + "format": "uri", + "description": "The link to the next page of items" + } + }, + "required": [ + "value" + ] + }, + "PagedFileInfo": { + "type": "object", + "description": "Collection of files.", + "properties": { + "value": { + "type": "array", + "description": "The FileInfo items on this page", + "items": { + "$ref": "#/definitions/FileInfo" + }, + "x-ms-identifiers": [] + }, + "nextLink": { + "type": "string", + "format": "uri", + "description": "The link to the next page of items" + } + }, + "required": [ + "value" + ] + }, + "PagedTest": { + "type": "object", + "description": "Collection of tests", + "properties": { + "value": { + "type": "array", + "description": "The Test items on this page", + "items": { + "$ref": "#/definitions/Test" + }, + "x-ms-identifiers": [] + }, + "nextLink": { + "type": "string", + "format": "uri", + "description": "The link to the next page of items" + } + }, + "required": [ + "value" + ] + }, + "PagedTestRun": { + "type": "object", + "description": "Collection of test runs", + "properties": { + "value": { + "type": "array", + "description": "The TestRun items on this page", + "items": { + "$ref": "#/definitions/TestRun" + }, + "x-ms-identifiers": [] + }, + "nextLink": { + "type": "string", + "format": "uri", + "description": "The link to the next page of items" + } + }, + "required": [ + "value" + ] + }, + "PagedTimeSeriesElement": { + "type": "object", + "description": "The response to a metrics query.", + "properties": { + "value": { + "type": "array", + "description": "The TimeSeriesElement items on this page", + "items": { + "$ref": "#/definitions/TimeSeriesElement" + }, + "x-ms-identifiers": [] + }, + "nextLink": { + "type": "string", + "format": "uri", + "description": "The link to the next page of items" + } + }, + "required": [ + "value" + ] + }, + "PassFailCriteria": { + "type": "object", + "description": "Pass fail criteria for a test.", + "properties": { + "passFailMetrics": { + "type": "object", + "description": "Map of id and pass fail metrics { id : pass fail metrics }.", + "additionalProperties": { + "$ref": "#/definitions/PassFailMetric" + } + } + } + }, + "PassFailMetric": { + "type": "object", + "description": "Pass fail metric", + "properties": { + "clientMetric": { + "$ref": "#/definitions/PFMetrics", + "description": "The client metric on which the criteria should be applied." + }, + "aggregate": { + "$ref": "#/definitions/PFAgFunc", + "description": "The aggregation function to be applied on the client metric. Allowed functions\n- ‘percentage’ - for error metric , ‘avg’, ‘p50’, ‘p90’, ‘p95’, ‘p99’, ‘min’,\n‘max’ - for response_time_ms and latency metric, ‘avg’ - for requests_per_sec,\n‘count’ - for requests" + }, + "condition": { + "type": "string", + "description": "The comparison operator. Supported types ‘>’, ‘<’ " + }, + "requestName": { + "type": "string", + "description": "Request name for which the Pass fail criteria has to be applied " + }, + "value": { + "type": "number", + "format": "float", + "description": "The value to compare with the client metric. Allowed values - ‘error : [0.0 ,\n100.0] unit- % ’, response_time_ms and latency : any integer value unit- ms." + }, + "action": { + "$ref": "#/definitions/PFAction", + "description": "Action taken after the threshold is met. Default is ‘continue’." + }, + "actualValue": { + "type": "number", + "format": "float", + "description": "The actual value of the client metric for the test run.", + "readOnly": true + }, + "result": { + "$ref": "#/definitions/PFResult", + "description": "Outcome of the test run.", + "readOnly": true + } + } + }, + "ResourceMetric": { + "type": "object", + "description": "Associated metric definition for particular metrics of the azure resource (\nRefer :\nhttps://docs.microsoft.com/en-us/rest/api/monitor/metric-definitions/list#metricdefinition).", + "properties": { + "id": { + "type": "string", + "description": "Unique name for metric.", + "readOnly": true + }, + "resourceId": { + "type": "string", + "description": "Azure resource id." + }, + "metricNamespace": { + "type": "string", + "description": "Metric name space." + }, + "displayDescription": { + "type": "string", + "description": "Metric description." + }, + "name": { + "type": "string", + "description": "The invariant value of metric name" + }, + "aggregation": { + "type": "string", + "description": "Metric aggregation." + }, + "unit": { + "type": "string", + "description": "Metric unit." + }, + "resourceType": { + "type": "string", + "description": "Azure resource type." + } + }, + "required": [ + "resourceId", + "metricNamespace", + "name", + "aggregation", + "resourceType" + ] + }, + "Secret": { + "type": "object", + "description": "Secret", + "properties": { + "value": { + "type": "string", + "description": "The value of the secret for the respective type" + }, + "type": { + "$ref": "#/definitions/SecretType", + "description": "Type of secret" + } + } + }, + "SecretType": { + "type": "string", + "enum": [ + "AKV_SECRET_URI", + "SECRET_VALUE" + ], + "x-ms-enum": { + "name": "SecretType", + "modelAsString": true, + "values": [ + { + "name": "AKV_SECRET_URI", + "value": "AKV_SECRET_URI", + "description": "If the secret is stored in an Azure Key Vault" + }, + { + "name": "SECRET_VALUE", + "value": "SECRET_VALUE", + "description": "If the Plain text secret value provided" + } + ] + } + }, + "Status": { + "type": "string", + "enum": [ + "ACCEPTED", + "NOTSTARTED", + "PROVISIONING", + "PROVISIONED", + "CONFIGURING", + "CONFIGURED", + "EXECUTING", + "EXECUTED", + "DEPROVISIONING", + "DEPROVISIONED", + "DONE", + "CANCELLING", + "CANCELLED", + "FAILED", + "VALIDATION_SUCCESS", + "VALIDATION_FAILURE" + ], + "x-ms-enum": { + "name": "Status", + "modelAsString": true, + "values": [ + { + "name": "ACCEPTED", + "value": "ACCEPTED", + "description": "Test run request is accepted" + }, + { + "name": "NOTSTARTED", + "value": "NOTSTARTED", + "description": "Test run is not yet started." + }, + { + "name": "PROVISIONING", + "value": "PROVISIONING", + "description": "Test run is getting provision" + }, + { + "name": "PROVISIONED", + "value": "PROVISIONED", + "description": "Test run is provisioned" + }, + { + "name": "CONFIGURING", + "value": "CONFIGURING", + "description": "Test run is getting configure" + }, + { + "name": "CONFIGURED", + "value": "CONFIGURED", + "description": "Test run configuration is done" + }, + { + "name": "EXECUTING", + "value": "EXECUTING", + "description": "Test run has started executing" + }, + { + "name": "EXECUTED", + "value": "EXECUTED", + "description": "Test run has been executed" + }, + { + "name": "DEPROVISIONING", + "value": "DEPROVISIONING", + "description": "Test run is getting deprovision" + }, + { + "name": "DEPROVISIONED", + "value": "DEPROVISIONED", + "description": "Test run request is deprovisioned" + }, + { + "name": "DONE", + "value": "DONE", + "description": "Test run request is finished" + }, + { + "name": "CANCELLING", + "value": "CANCELLING", + "description": "Test run request is getting cancelled" + }, + { + "name": "CANCELLED", + "value": "CANCELLED", + "description": "Test run request is cancelled" + }, + { + "name": "FAILED", + "value": "FAILED", + "description": "Test run request is failed" + }, + { + "name": "VALIDATION_SUCCESS", + "value": "VALIDATION_SUCCESS", + "description": "Test run JMX file is validated" + }, + { + "name": "VALIDATION_FAILURE", + "value": "VALIDATION_FAILURE", + "description": "Test run JMX file validation is failed" + } + ] + } + }, + "Test": { + "type": "object", + "description": "Load test model", + "properties": { + "passFailCriteria": { + "$ref": "#/definitions/PassFailCriteria", + "description": "Pass fail criteria for a test." + }, + "secrets": { + "type": "object", + "description": "Secrets can be stored in an Azure Key Vault or any other secret store. If the\nsecret is stored in an Azure Key Vault, the value should be the secret\nidentifier and the type should be AKV_SECRET_URI. If the secret is stored\nelsewhere, the secret value should be provided directly and the type should be\nSECRET_VALUE.", + "additionalProperties": { + "$ref": "#/definitions/Secret" + } + }, + "certificate": { + "$ref": "#/definitions/CertificateMetadata", + "description": "Certificates metadata" + }, + "environmentVariables": { + "type": "object", + "description": "Environment variables which are defined as a set of pairs.", + "additionalProperties": { + "type": "string" + } + }, + "loadTestConfiguration": { + "$ref": "#/definitions/LoadTestConfiguration", + "description": "The load test configuration." + }, + "inputArtifacts": { + "$ref": "#/definitions/TestInputArtifacts", + "description": "The input artifacts for the test.", + "readOnly": true + }, + "testId": { + "type": "string", + "description": "Unique test name as identifier.", + "readOnly": true + }, + "description": { + "type": "string", + "description": "The test description." + }, + "displayName": { + "type": "string", + "description": "Display name of a test." + }, + "subnetId": { + "type": "string", + "description": "Subnet ID on which the load test instances should run." + }, + "keyvaultReferenceIdentityType": { + "type": "string", + "description": "Type of the managed identity referencing the Key vault." + }, + "keyvaultReferenceIdentityId": { + "type": "string", + "description": "Resource Id of the managed identity referencing the Key vault." + }, + "createdDateTime": { + "type": "string", + "format": "date-time", + "description": "The creation datetime(ISO 8601 literal format).", + "readOnly": true + }, + "createdBy": { + "type": "string", + "description": "The user that created.", + "readOnly": true + }, + "lastModifiedDateTime": { + "type": "string", + "format": "date-time", + "description": "The last Modified datetime(ISO 8601 literal format).", + "readOnly": true + }, + "lastModifiedBy": { + "type": "string", + "description": "The user that last modified.", + "readOnly": true + } + } + }, + "TestAppComponents": { + "type": "object", + "description": "Test app component", + "properties": { + "components": { + "type": "object", + "description": "Azure resource collection { resource id (fully qualified resource Id e.g\nsubscriptions/{subId}/resourceGroups/{rg}/providers/Microsoft.LoadTestService/loadtests/{resName})\n: resource object } ", + "additionalProperties": { + "$ref": "#/definitions/AppComponent" + } + }, + "testId": { + "type": "string", + "description": "Test identifier", + "readOnly": true + }, + "createdDateTime": { + "type": "string", + "format": "date-time", + "description": "The creation datetime(ISO 8601 literal format).", + "readOnly": true + }, + "createdBy": { + "type": "string", + "description": "The user that created.", + "readOnly": true + }, + "lastModifiedDateTime": { + "type": "string", + "format": "date-time", + "description": "The last Modified datetime(ISO 8601 literal format).", + "readOnly": true + }, + "lastModifiedBy": { + "type": "string", + "description": "The user that last modified.", + "readOnly": true + } + }, + "required": [ + "components" + ] + }, + "TestAppComponentsUpdate": { + "type": "object", + "description": "Test app component", + "properties": { + "components": { + "type": "object", + "description": "Azure resource collection { resource id (fully qualified resource Id e.g\nsubscriptions/{subId}/resourceGroups/{rg}/providers/Microsoft.LoadTestService/loadtests/{resName})\n: resource object } ", + "additionalProperties": { + "$ref": "#/definitions/AppComponent" + } + } + } + }, + "TestInputArtifacts": { + "type": "object", + "description": "The input artifacts for the test.", + "properties": { + "configFileInfo": { + "$ref": "#/definitions/FileInfo", + "description": "File info" + }, + "testScriptFileInfo": { + "$ref": "#/definitions/FileInfo", + "description": "File info" + }, + "userPropFileInfo": { + "$ref": "#/definitions/FileInfo", + "description": "File info" + }, + "inputArtifactsZipFileInfo": { + "$ref": "#/definitions/FileInfo", + "description": "File info" + }, + "additionalFileInfo": { + "type": "array", + "description": "Additional supported files for the test run", + "items": { + "$ref": "#/definitions/FileInfo" + }, + "readOnly": true, + "x-ms-identifiers": [] + } + } + }, + "TestRun": { + "type": "object", + "description": "Load test run model", + "properties": { + "testRunId": { + "type": "string", + "description": "Unique test run name as identifier", + "readOnly": true + }, + "passFailCriteria": { + "$ref": "#/definitions/PassFailCriteria", + "description": "Pass fail criteria for a test." + }, + "secrets": { + "type": "object", + "description": "Secrets can be stored in an Azure Key Vault or any other secret store. If the\nsecret is stored in an Azure Key Vault, the value should be the secret\nidentifier and the type should be AKV_SECRET_URI. If the secret is stored\nelsewhere, the secret value should be provided directly and the type should be\nSECRET_VALUE.", + "additionalProperties": { + "$ref": "#/definitions/Secret" + } + }, + "certificate": { + "$ref": "#/definitions/CertificateMetadata", + "description": "Certificates metadata" + }, + "environmentVariables": { + "type": "object", + "description": "Environment variables which are defined as a set of pairs.", + "additionalProperties": { + "type": "string" + } + }, + "errorDetails": { + "type": "array", + "description": "Error details if there is any failure in load test run", + "items": { + "$ref": "#/definitions/ErrorDetails" + }, + "readOnly": true, + "x-ms-identifiers": [] + }, + "testRunStatistics": { + "type": "object", + "description": "Test run statistics.", + "additionalProperties": { + "$ref": "#/definitions/TestRunStatistics" + }, + "readOnly": true + }, + "loadTestConfiguration": { + "$ref": "#/definitions/LoadTestConfiguration", + "description": "The load test configuration." + }, + "testArtifacts": { + "$ref": "#/definitions/TestRunArtifacts", + "description": "Collection of test run artifacts", + "readOnly": true + }, + "testResult": { + "$ref": "#/definitions/PFTestResult", + "description": "Test result for pass/Fail criteria used during the test run.", + "readOnly": true + }, + "virtualUsers": { + "type": "integer", + "format": "int32", + "description": "Number of virtual users, for which test has been run.", + "readOnly": true + }, + "displayName": { + "type": "string", + "description": "Display name of a testRun." + }, + "testId": { + "type": "string", + "description": "Associated test Id." + }, + "description": { + "type": "string", + "description": "The test run description." + }, + "status": { + "$ref": "#/definitions/Status", + "description": "The test run status.", + "readOnly": true + }, + "startDateTime": { + "type": "string", + "format": "date-time", + "description": "The test run start DateTime(ISO 8601 literal format).", + "readOnly": true + }, + "endDateTime": { + "type": "string", + "format": "date-time", + "description": "The test run end DateTime(ISO 8601 literal format).", + "readOnly": true + }, + "executedDateTime": { + "type": "string", + "format": "date-time", + "description": "Test run initiated time.", + "readOnly": true + }, + "portalUrl": { + "type": "string", + "description": "Portal url.", + "readOnly": true + }, + "duration": { + "type": "integer", + "format": "int32", + "description": "Test run duration in milliseconds.", + "readOnly": true + }, + "subnetId": { + "type": "string", + "description": "Subnet ID on which the load test instances should run.", + "readOnly": true + }, + "createdDateTime": { + "type": "string", + "format": "date-time", + "description": "The creation datetime(ISO 8601 literal format).", + "readOnly": true + }, + "createdBy": { + "type": "string", + "description": "The user that created.", + "readOnly": true + }, + "lastModifiedDateTime": { + "type": "string", + "format": "date-time", + "description": "The last Modified datetime(ISO 8601 literal format).", + "readOnly": true + }, + "lastModifiedBy": { + "type": "string", + "description": "The user that last modified.", + "readOnly": true + } + }, + "required": [ + "testRunId" + ] + }, + "TestRunAppComponents": { + "type": "object", + "description": "Test run app component", + "properties": { + "components": { + "type": "object", + "description": "Azure resource collection { resource id (fully qualified resource Id e.g\nsubscriptions/{subId}/resourceGroups/{rg}/providers/Microsoft.LoadTestService/loadtests/{resName})\n: resource object } ", + "additionalProperties": { + "$ref": "#/definitions/AppComponent" + } + }, + "testRunId": { + "type": "string", + "description": "Test run identifier", + "readOnly": true + }, + "createdDateTime": { + "type": "string", + "format": "date-time", + "description": "The creation datetime(ISO 8601 literal format).", + "readOnly": true + }, + "createdBy": { + "type": "string", + "description": "The user that created.", + "readOnly": true + }, + "lastModifiedDateTime": { + "type": "string", + "format": "date-time", + "description": "The last Modified datetime(ISO 8601 literal format).", + "readOnly": true + }, + "lastModifiedBy": { + "type": "string", + "description": "The user that last modified.", + "readOnly": true + } + }, + "required": [ + "components" + ] + }, + "TestRunAppComponentsUpdate": { + "type": "object", + "description": "Test run app component", + "properties": { + "components": { + "type": "object", + "description": "Azure resource collection { resource id (fully qualified resource Id e.g\nsubscriptions/{subId}/resourceGroups/{rg}/providers/Microsoft.LoadTestService/loadtests/{resName})\n: resource object } ", + "additionalProperties": { + "$ref": "#/definitions/AppComponent" + } + } + } + }, + "TestRunArtifacts": { + "type": "object", + "description": "Collection of test run artifacts", + "properties": { + "inputArtifacts": { + "$ref": "#/definitions/TestRunInputArtifacts", + "description": "The input artifacts for the test run.", + "readOnly": true + }, + "outputArtifacts": { + "$ref": "#/definitions/TestRunOutputArtifacts", + "description": "The output artifacts for the test run." + } + } + }, + "TestRunCreateOrUpdate": { + "type": "object", + "description": "Load test run model", + "properties": { + "passFailCriteria": { + "$ref": "#/definitions/PassFailCriteria", + "description": "Pass fail criteria for a test." + }, + "secrets": { + "type": "object", + "description": "Secrets can be stored in an Azure Key Vault or any other secret store. If the\nsecret is stored in an Azure Key Vault, the value should be the secret\nidentifier and the type should be AKV_SECRET_URI. If the secret is stored\nelsewhere, the secret value should be provided directly and the type should be\nSECRET_VALUE.", + "additionalProperties": { + "$ref": "#/definitions/Secret" + } + }, + "certificate": { + "$ref": "#/definitions/CertificateMetadata", + "description": "Certificates metadata" + }, + "environmentVariables": { + "type": "object", + "description": "Environment variables which are defined as a set of pairs.", + "additionalProperties": { + "type": "string" + } + }, + "loadTestConfiguration": { + "$ref": "#/definitions/LoadTestConfiguration", + "description": "The load test configuration." + }, + "displayName": { + "type": "string", + "description": "Display name of a testRun." + }, + "testId": { + "type": "string", + "description": "Associated test Id." + }, + "description": { + "type": "string", + "description": "The test run description." + } + } + }, + "TestRunInputArtifacts": { + "type": "object", + "description": "The input artifacts for the test run.", + "properties": { + "configFileInfo": { + "$ref": "#/definitions/FileInfo", + "description": "File info" + }, + "testScriptFileInfo": { + "$ref": "#/definitions/FileInfo", + "description": "File info" + }, + "userPropFileInfo": { + "$ref": "#/definitions/FileInfo", + "description": "File info" + }, + "inputArtifactsZipFileInfo": { + "$ref": "#/definitions/FileInfo", + "description": "File info" + }, + "additionalFileInfo": { + "type": "array", + "description": "Additional supported files for the test run", + "items": { + "$ref": "#/definitions/FileInfo" + }, + "readOnly": true, + "x-ms-identifiers": [] + } + } + }, + "TestRunOutputArtifacts": { + "type": "object", + "description": "The output artifacts for the test run.", + "properties": { + "resultFileInfo": { + "$ref": "#/definitions/FileInfo", + "description": "File info" + }, + "logsFileInfo": { + "$ref": "#/definitions/FileInfo", + "description": "File info" + } + } + }, + "TestRunServerMetricConfig": { + "type": "object", + "description": "Test run server metrics configuration", + "properties": { + "testRunId": { + "type": "string", + "description": "Test run identifier", + "readOnly": true + }, + "metrics": { + "type": "object", + "description": "Azure resource metrics collection {metric id : metrics object} (Refer :\nhttps://docs.microsoft.com/en-us/rest/api/monitor/metric-definitions/list#metricdefinition\nfor metric id).", + "additionalProperties": { + "$ref": "#/definitions/ResourceMetric" + } + }, + "createdDateTime": { + "type": "string", + "format": "date-time", + "description": "The creation datetime(ISO 8601 literal format).", + "readOnly": true + }, + "createdBy": { + "type": "string", + "description": "The user that created.", + "readOnly": true + }, + "lastModifiedDateTime": { + "type": "string", + "format": "date-time", + "description": "The last Modified datetime(ISO 8601 literal format).", + "readOnly": true + }, + "lastModifiedBy": { + "type": "string", + "description": "The user that last modified.", + "readOnly": true + } + } + }, + "TestRunStatistics": { + "type": "object", + "description": "Test run statistics.", + "properties": { + "transaction": { + "type": "string", + "description": "Transaction name.", + "readOnly": true + }, + "sampleCount": { + "type": "number", + "format": "float", + "description": "Sampler count.", + "readOnly": true + }, + "errorCount": { + "type": "number", + "format": "float", + "description": "Error count.", + "readOnly": true + }, + "errorPct": { + "type": "number", + "format": "float", + "description": "Error percentage.", + "readOnly": true + }, + "meanResTime": { + "type": "number", + "format": "float", + "description": "Mean response time.", + "readOnly": true + }, + "medianResTime": { + "type": "number", + "format": "float", + "description": "Median response time.", + "readOnly": true + }, + "maxResTime": { + "type": "number", + "format": "float", + "description": "Max response time.", + "readOnly": true + }, + "minResTime": { + "type": "number", + "format": "float", + "description": "Minimum response time.", + "readOnly": true + }, + "pct1ResTime": { + "type": "number", + "format": "float", + "description": "90 percentile response time.", + "readOnly": true + }, + "pct2ResTime": { + "type": "number", + "format": "float", + "description": "95 percentile response time.", + "readOnly": true + }, + "pct3ResTime": { + "type": "number", + "format": "float", + "description": "99 percentile response time.", + "readOnly": true + }, + "throughput": { + "type": "number", + "format": "float", + "description": "Throughput.", + "readOnly": true + }, + "receivedKBytesPerSec": { + "type": "number", + "format": "float", + "description": "Received network bytes.", + "readOnly": true + }, + "sentKBytesPerSec": { + "type": "number", + "format": "float", + "description": "Send network bytes.", + "readOnly": true + } + } + }, + "TestRuns": { + "type": "object", + "description": "Load test run model", + "properties": { + "testRunId": { + "type": "string", + "description": "Unique test run name as identifier", + "readOnly": true + } + }, + "required": [ + "testRunId" + ] + }, + "TestServerMetricConfig": { + "type": "object", + "description": "Test server metrics configuration", + "properties": { + "testId": { + "type": "string", + "description": "Test identifier", + "readOnly": true + }, + "metrics": { + "type": "object", + "description": "Azure resource metrics collection {metric id : metrics object} (Refer :\nhttps://docs.microsoft.com/en-us/rest/api/monitor/metric-definitions/list#metricdefinition\nfor metric id).", + "additionalProperties": { + "$ref": "#/definitions/ResourceMetric" + } + }, + "createdDateTime": { + "type": "string", + "format": "date-time", + "description": "The creation datetime(ISO 8601 literal format).", + "readOnly": true + }, + "createdBy": { + "type": "string", + "description": "The user that created.", + "readOnly": true + }, + "lastModifiedDateTime": { + "type": "string", + "format": "date-time", + "description": "The last Modified datetime(ISO 8601 literal format).", + "readOnly": true + }, + "lastModifiedBy": { + "type": "string", + "description": "The user that last modified.", + "readOnly": true + } + } + }, + "TimeGrain": { + "type": "string", + "enum": [ + "PT5S", + "PT10S", + "PT1M", + "PT5M", + "PT1H" + ], + "x-ms-enum": { + "name": "TimeGrain", + "modelAsString": true, + "values": [ + { + "name": "PT5S", + "value": "PT5S", + "description": "5 seconds, available only if test run duration is less than 10 minutes" + }, + { + "name": "PT10S", + "value": "PT10S", + "description": "10 seconds, available only if test run duration is less than 10 minutes" + }, + { + "name": "PT1M", + "value": "PT1M", + "description": "1 minute" + }, + { + "name": "PT5M", + "value": "PT5M", + "description": "5 minutes, available only if test run duration is greater than 1 minute" + }, + { + "name": "PT1H", + "value": "PT1H", + "description": "1 hour, available only if test run duration is greater than 1 minute" + } + ] + } + }, + "TimeSeriesElement": { + "type": "object", + "description": "The time series returned when a data query is performed.", + "properties": { + "data": { + "type": "array", + "description": "An array of data points representing the metric values.", + "items": { + "$ref": "#/definitions/MetricValue" + }, + "x-ms-identifiers": [] + }, + "dimensionValues": { + "type": "array", + "description": "The dimension values ", + "items": { + "$ref": "#/definitions/DimensionValue" + }, + "x-ms-identifiers": [] + } + } + } + }, + "parameters": { + "Azure.Core.Foundations.ApiVersionParameter": { + "name": "api-version", + "in": "query", + "description": "The API version to use for this operation.", + "required": true, + "type": "string", + "minLength": 1, + "x-ms-parameter-location": "method", + "x-ms-client-name": "apiVersion" + }, + "MetricDimensions.interval": { + "name": "interval", + "in": "query", + "description": "The interval (i.e. timegrain) of the query.", + "required": false, + "type": "string", + "enum": [ + "PT5S", + "PT10S", + "PT1M", + "PT5M", + "PT1H" + ], + "x-ms-enum": { + "name": "Interval", + "modelAsString": true, + "values": [ + { + "name": "PT5S", + "value": "PT5S", + "description": "5 seconds, available only if test run duration is less than 10 minutes" + }, + { + "name": "PT10S", + "value": "PT10S", + "description": "10 seconds, available only if test run duration is less than 10 minutes" + }, + { + "name": "PT1M", + "value": "PT1M", + "description": "1 minute" + }, + { + "name": "PT5M", + "value": "PT5M", + "description": "5 minutes, available only if test run duration is greater than 1 minute" + }, + { + "name": "PT1H", + "value": "PT1H", + "description": "1 hour, available only if test run duration is greater than 1 minute" + } + ] + }, + "x-ms-parameter-location": "method" + }, + "MetricDimensions.metricName": { + "name": "metricName", + "in": "query", + "description": "Metric name", + "required": false, + "type": "string", + "x-ms-parameter-location": "method" + }, + "MetricDimensions.metricNamespace": { + "name": "metricNamespace", + "in": "query", + "description": "Metric namespace to query metric definitions for.", + "required": true, + "type": "string", + "x-ms-parameter-location": "method" + }, + "MetricDimensions.timespan": { + "name": "timespan", + "in": "query", + "description": "The timespan of the query. It is a string with the following format\n'startDateTime_ISO/endDateTime_ISO'.", + "required": false, + "type": "string", + "x-ms-parameter-location": "method" + } + } +} From 02cb9c5fdd882ae5994d5d42dff6ca4909c081ac Mon Sep 17 00:00:00 2001 From: "Jiao Di (MSFT)" Date: Mon, 2 Feb 2026 15:28:47 +0800 Subject: [PATCH 06/10] fix only LRO export PollerLike --- .../review/arm-networkanalytics.api.md | 24 +++++++++++++++++-- .../sdk/test/arm-test/src/index.ts | 1 + .../typespec-ts/src/modular/buildRootIndex.ts | 14 ++++------- 3 files changed, 27 insertions(+), 12 deletions(-) diff --git a/packages/typespec-test/test/NetworkAnalytics.Management/generated/typespec-ts/sdk/test/arm-test/review/arm-networkanalytics.api.md b/packages/typespec-test/test/NetworkAnalytics.Management/generated/typespec-ts/sdk/test/arm-test/review/arm-networkanalytics.api.md index 79c78bc81a..ae7897fc73 100644 --- a/packages/typespec-test/test/NetworkAnalytics.Management/generated/typespec-ts/sdk/test/arm-test/review/arm-networkanalytics.api.md +++ b/packages/typespec-test/test/NetworkAnalytics.Management/generated/typespec-ts/sdk/test/arm-test/review/arm-networkanalytics.api.md @@ -207,8 +207,6 @@ export interface DataProductsOperations { beginCreate: (resourceGroupName: string, dataProductName: string, resource: DataProduct, options?: DataProductsCreateOptionalParams) => Promise, DataProduct>>; // @deprecated (undocumented) beginCreateAndWait: (resourceGroupName: string, dataProductName: string, resource: DataProduct, options?: DataProductsCreateOptionalParams) => Promise; - // Warning: (ae-forgotten-export) The symbol "SimplePollerLike" needs to be exported by the entry point index.d.ts - // // @deprecated (undocumented) beginDelete: (resourceGroupName: string, dataProductName: string, options?: DataProductsDeleteOptionalParams) => Promise, void>>; // @deprecated (undocumented) @@ -604,6 +602,28 @@ export interface RoleAssignmentDetail { userName: string; } +// @public +export interface SimplePollerLike, TResult> { + getOperationState(): TState; + getResult(): TResult | undefined; + isDone(): boolean; + // @deprecated + isStopped(): boolean; + onProgress(callback: (state: TState) => void): CancelOnProgress; + poll(options?: { + abortSignal?: AbortSignalLike; + }): Promise; + pollUntilDone(pollOptions?: { + abortSignal?: AbortSignalLike; + }): Promise; + serialize(): Promise; + // @deprecated + stopPolling(): void; + submitted(): Promise; + // @deprecated + toString(): string; +} + // @public export interface SystemData { createdAt?: Date; diff --git a/packages/typespec-test/test/NetworkAnalytics.Management/generated/typespec-ts/sdk/test/arm-test/src/index.ts b/packages/typespec-test/test/NetworkAnalytics.Management/generated/typespec-ts/sdk/test/arm-test/src/index.ts index 99e90ff555..4f90224b22 100644 --- a/packages/typespec-test/test/NetworkAnalytics.Management/generated/typespec-ts/sdk/test/arm-test/src/index.ts +++ b/packages/typespec-test/test/NetworkAnalytics.Management/generated/typespec-ts/sdk/test/arm-test/src/index.ts @@ -9,6 +9,7 @@ import { } from "./static-helpers/pagingHelpers.js"; export { NetworkAnalyticsApi } from "./networkAnalyticsApi.js"; +export { SimplePollerLike } from "./static-helpers/simplePollerHelpers.js"; export { restorePoller, RestorePollerOptions } from "./restorePollerHelpers.js"; export { Operation, diff --git a/packages/typespec-ts/src/modular/buildRootIndex.ts b/packages/typespec-ts/src/modular/buildRootIndex.ts index 72117efcbc..2f3dc2ca87 100644 --- a/packages/typespec-ts/src/modular/buildRootIndex.ts +++ b/packages/typespec-ts/src/modular/buildRootIndex.ts @@ -18,10 +18,7 @@ import { join } from "path/posix"; import { useContext } from "../contextManager.js"; import { reportDiagnostic } from "../lib.js"; import { NoTarget } from "@typespec/compiler"; -import { - isLroAndPagingOperation, - isLroOnlyOperation -} from "./helpers/operationHelpers.js"; +import { isLroOnlyOperation } from "./helpers/operationHelpers.js"; import { SdkContext } from "../utils/interfaces.js"; export function buildRootIndex( @@ -215,15 +212,12 @@ function exportSimplePollerLike( const hasLro = Array.from(methodMap.values()).some((operations) => { return operations.some(isLroOnlyOperation); }); - const hasLroPaging = Array.from(methodMap.values()).some((operations) => { - return operations.some(isLroAndPagingOperation); - }); + + // Only export SimplePollerLike if there are pure LRO operations (LRO without paging) + // LRO+Paging operations don't need SimplePollerLike export as they return PagedAsyncIterableIterator if (!hasLro || context.rlcOptions?.compatibilityLro !== true) { return; } - if (!hasLroPaging || context.rlcOptions?.compatibilityLro !== true) { - return; - } const helperFile = project.getSourceFile( `${srcPath}/${ subfolder && subfolder !== "" ? subfolder + "/" : "" From 3dc2a093501ab0ce77fcfa77fb4f9bb53c8ffea2 Mon Sep 17 00:00:00 2001 From: "Jiao Di (MSFT)" Date: Mon, 2 Feb 2026 16:01:56 +0800 Subject: [PATCH 07/10] revert --- .../typespec-ts/src/modular/buildRootIndex.ts | 444 +++--------------- 1 file changed, 61 insertions(+), 383 deletions(-) diff --git a/packages/typespec-ts/src/modular/buildRootIndex.ts b/packages/typespec-ts/src/modular/buildRootIndex.ts index 2f3dc2ca87..51940f519c 100644 --- a/packages/typespec-ts/src/modular/buildRootIndex.ts +++ b/packages/typespec-ts/src/modular/buildRootIndex.ts @@ -1,454 +1,132 @@ -import { NameType, normalizeName } from "@azure-tools/rlc-common"; import { Project, SourceFile } from "ts-morph"; -import { getClassicalClientName } from "./helpers/namingHelpers.js"; -import { ModularEmitterOptions } from "./interfaces.js"; -import { resolveReference } from "../framework/reference.js"; -import { - CloudSettingHelpers, - MultipartHelpers, - PagingHelpers -} from "./static-helpers-metadata.js"; -import { - SdkClientType, - SdkServiceOperation -} from "@azure-tools/typespec-client-generator-core"; -import { getModularClientOptions } from "../utils/clientUtils.js"; -import { getMethodHierarchiesMap } from "../utils/operationUtil.js"; -import { join } from "path/posix"; -import { useContext } from "../contextManager.js"; -import { reportDiagnostic } from "../lib.js"; -import { NoTarget } from "@typespec/compiler"; -import { isLroOnlyOperation } from "./helpers/operationHelpers.js"; -import { SdkContext } from "../utils/interfaces.js"; +import { getClientName } from "./helpers/namingHelpers.js"; +import { Client, ModularCodeModel } from "./modularCodeModel.js"; export function buildRootIndex( - context: SdkContext, - emitterOptions: ModularEmitterOptions, - rootIndexFile: SourceFile, - clientMap?: [string[], SdkClientType] + codeModel: ModularCodeModel, + client: Client, + rootIndexFile: SourceFile ) { - if (!clientMap) { - // we still need to export the models if no client is provided - exportModels(emitterOptions, rootIndexFile); - return; - } - const project = useContext("outputProject"); - const [_, client] = clientMap; - const srcPath = emitterOptions.modularOptions.sourceRoot; - const { subfolder } = getModularClientOptions(clientMap); - const clientName = `${getClassicalClientName(client)}`; + const { project } = codeModel; + const srcPath = codeModel.modularOptions.sourceRoot; + const subfolder = client.subfolder ?? ""; + const clientName = `${getClientName(client)}Client`; const clientFile = project.getSourceFile( - `${srcPath}/${subfolder && subfolder !== "" ? subfolder + "/" : ""}${normalizeName( - clientName, - NameType.File - )}.ts` + `${srcPath}/${subfolder !== "" ? subfolder + "/" : ""}${clientName}.ts` ); if (!clientFile) { - reportDiagnostic(context.program, { - code: "client-file-not-found", - format: { - filePath: `${srcPath}/${normalizeName(clientName, NameType.File)}.ts` - }, - target: NoTarget - }); - return; // Skip exporting this client but continue with others + throw new Error(`Couldn't find client file: ${srcPath}/${clientName}.ts`); } - exportClassicalClient(client, rootIndexFile, subfolder ?? ""); - exportSimplePollerLike( - context, - clientMap, + exportClassicalClient(client, rootIndexFile, subfolder); + exportModules( rootIndexFile, project, srcPath, - subfolder + clientName, + "models", + subfolder, + true ); - exportRestoreHelpers( + exportModules( rootIndexFile, project, srcPath, clientName, + "classic", subfolder, true ); - exportModels(emitterOptions, rootIndexFile, clientName); - exportModules(rootIndexFile, project, srcPath, clientName, "api", { - subfolder, - interfaceOnly: true, - isTopLevel: true - }); - exportModules(rootIndexFile, project, srcPath, clientName, "classic", { - subfolder, - isTopLevel: true - }); - - exportPagingTypes(context, rootIndexFile); - exportFileContentsType(context, rootIndexFile); - exportAzureCloudTypes(context, rootIndexFile); -} - -function exportModels( - emitterOptions: ModularEmitterOptions, - rootIndexFile: SourceFile, - clientName: string = "" -) { - // export models index file if not exists - const project = useContext("outputProject"); - const srcPath = emitterOptions.modularOptions.sourceRoot; - const modelsExportsIndex = rootIndexFile - .getExportDeclarations() - ?.find((i) => { - return i.getModuleSpecifierValue()?.startsWith(`./models/`); - }); - if (!modelsExportsIndex) { - exportModules(rootIndexFile, project, srcPath, clientName, "models", { - isTopLevel: true, - recursive: true - }); - } } -function exportAzureCloudTypes(context: SdkContext, rootIndexFile: SourceFile) { - if (context.arm) { - addExportsToRootIndexFile(rootIndexFile, [ - resolveReference(CloudSettingHelpers.AzureClouds), - resolveReference(CloudSettingHelpers.AzureSupportedClouds) - ]); - } -} - -/** - * This is a temporary solution for adding paging exports. Eventually we will have the binder generate the exports automatically. - */ -function exportPagingTypes(context: SdkContext, rootIndexFile: SourceFile) { - if (!hasPaging(context)) { - return; - } - - addExportsToRootIndexFile(rootIndexFile, [ - resolveReference(PagingHelpers.PageSettings), - resolveReference(PagingHelpers.ContinuablePage), - resolveReference(PagingHelpers.PagedAsyncIterableIterator) - ]); -} - -function hasPaging(context: SdkContext): boolean { - return context.sdkPackage.clients.some((client) => { - const methodMap = getMethodHierarchiesMap(context, client); - for (const [_, operations] of methodMap) { - if ( - operations.some((op) => op.kind === "paging" || op.kind === "lropaging") - ) { - return true; - } - } - return false; - }); -} - -function exportFileContentsType( - context: SdkContext, - rootIndexFile: SourceFile -) { - if ( - context.sdkPackage.models.some((x) => - x.properties.some( - // eslint-disable-next-line - (y) => y.kind === "property" && y.multipartOptions?.isFilePart - ) - ) - ) { - addExportsToRootIndexFile(rootIndexFile, [ - resolveReference(MultipartHelpers.FileContents) - ]); - } -} - -function getExistingExports(rootIndexFile: SourceFile): Set { - return new Set( - rootIndexFile - .getExportDeclarations() - .flatMap((exportDecl) => - exportDecl.getNamedExports().map((namedExport) => namedExport.getName()) - ) - ); -} - -function getNewNamedExports( - namedExports: string[], - existingExports: Set -): string[] { - return namedExports.filter( - (namedExport) => !existingExports.has(namedExport) - ); -} - -function addExportsToRootIndexFile( - rootIndexFile: SourceFile, - namedExports: string[] -) { - const existingExports = getExistingExports(rootIndexFile); - const newNamedExports = getNewNamedExports(namedExports, existingExports); - if (newNamedExports.length > 0) { - rootIndexFile.addExportDeclaration({ - namedExports: newNamedExports - }); - } -} - -function exportSimplePollerLike( - context: SdkContext, - clientMap: [string[], SdkClientType], +function exportClassicalClient( + client: Client, indexFile: SourceFile, - project: Project, - srcPath: string, - subfolder: string = "", - isTopLevel: boolean = false + subfolder: string, + isSubClient: boolean = false ) { - const [_, client] = clientMap; - - const methodMap = getMethodHierarchiesMap(context, client); - const hasLro = Array.from(methodMap.values()).some((operations) => { - return operations.some(isLroOnlyOperation); - }); - - // Only export SimplePollerLike if there are pure LRO operations (LRO without paging) - // LRO+Paging operations don't need SimplePollerLike export as they return PagedAsyncIterableIterator - if (!hasLro || context.rlcOptions?.compatibilityLro !== true) { - return; - } - const helperFile = project.getSourceFile( - `${srcPath}/${ - subfolder && subfolder !== "" ? subfolder + "/" : "" - }static-helpers/simplePollerHelpers.ts` - ); - if (!helperFile) { - return; - } - const moduleSpecifier = `./${ - isTopLevel && subfolder && subfolder !== "" ? subfolder + "/" : "" - }static-helpers/simplePollerHelpers.js`; + const clientName = `${getClientName(client)}Client`; indexFile.addExportDeclaration({ - moduleSpecifier, - namedExports: ["SimplePollerLike"] + namedExports: [clientName, `${clientName}Options`], + moduleSpecifier: `./${ + subfolder !== "" && !isSubClient ? subfolder + "/" : "" + }${clientName}.js` }); } -function exportRestoreHelpers( +function exportModules( indexFile: SourceFile, project: Project, srcPath: string, clientName: string, + moduleName: string, subfolder: string = "", isTopLevel: boolean = false ) { - const helperFile = project.getSourceFile( + const modelsFile = project.getSourceFile( `${srcPath}/${ - subfolder && subfolder !== "" ? subfolder + "/" : "" - }restorePollerHelpers.ts` + subfolder !== "" ? subfolder + "/" : "" + }${moduleName}/index.ts` ); - if (!helperFile) { + if (!modelsFile) { return; } + const exported = [...indexFile.getExportedDeclarations().keys()]; - const namedExports = [...helperFile.getExportedDeclarations().keys()].map( - (helper) => { - if (exported.indexOf(helper) > -1) { - return `${helper} as ${clientName}${helper}`; + const namedExports = [...modelsFile.getExportedDeclarations().keys()].map( + (modelName) => { + if (exported.indexOf(modelName) > -1) { + return `${modelName} as ${clientName}${modelName}`; } - return helper; + return modelName; } ); const moduleSpecifier = `./${ - isTopLevel && subfolder && subfolder !== "" ? subfolder + "/" : "" - }restorePollerHelpers.js`; + isTopLevel && subfolder !== "" ? subfolder + "/" : "" + }${moduleName}/index.js`; indexFile.addExportDeclaration({ moduleSpecifier, namedExports }); } -function exportClassicalClient( - client: SdkClientType, - indexFile: SourceFile, - subfolder: string, - isSubClient: boolean = false -) { - const clientName = client.name; - indexFile.addExportDeclaration({ - namedExports: [clientName], - moduleSpecifier: `./${ - subfolder && subfolder !== "" && !isSubClient ? subfolder + "/" : "" - }${normalizeName(clientName, NameType.File)}.js` - }); -} - -export interface ExportModulesOptions { - interfaceOnly?: boolean; - isTopLevel?: boolean; - subfolder?: string; - recursive?: boolean; -} - -function exportModules( - indexFile: SourceFile, - project: Project, - srcPath: string, - clientName: string, - moduleName: string, - options: ExportModulesOptions = { - interfaceOnly: false, - isTopLevel: false, - subfolder: "", - recursive: false - } -) { - const subfolder = options.subfolder ?? ""; - let folders = []; - if (options.recursive) { - folders = project - .getDirectories() - .filter((dir) => { - const formattedDir = dir.getPath().replace(/\\/g, "/"); - const targetPath = join(srcPath, subfolder, moduleName).replace( - /\\/g, - "/" - ); - return formattedDir.startsWith(targetPath); - }) - .map((dir) => { - return dir.getPath().replace(/\\/g, "/"); - }); - } else if (options.isTopLevel && moduleName === "api") { - folders = project - .getDirectories() - .filter((dir) => { - const formattedDir = dir.getPath().replace(/\\/g, "/"); - const targetPath = join(srcPath, subfolder, moduleName).replace( - /\\/g, - "/" - ); - return formattedDir.startsWith(targetPath); - }) - .map((dir) => { - return dir.getPath().replace(/\\/g, "/"); - }); - } else { - folders = [join(srcPath, subfolder, moduleName).replace(/\\/g, "/")]; - } - for (const folder of folders) { - const apiFilePattern = join(folder, "index.ts").replace(/\\/g, "/"); - const modelsFile = project.getSourceFile(apiFilePattern); - if (!modelsFile) { - continue; - } - - const exported = [...indexFile.getExportedDeclarations().keys()]; - const serializerOrDeserializerRegex = /.*(Serializer|Deserializer)(_\d+)?$/; - const namedExports = [...modelsFile.getExportedDeclarations().entries()] - .filter((exDeclaration) => { - if (exDeclaration[0].startsWith("_")) { - return false; - } - return exDeclaration[1].some((ex) => { - if ( - options.interfaceOnly && - ex.getKindName() !== "InterfaceDeclaration" - ) { - return false; - } - if ( - moduleName === "models" && - ex.getKindName() === "FunctionDeclaration" && - serializerOrDeserializerRegex.test(exDeclaration[0]) - ) { - return false; - } - if ( - options.interfaceOnly && - options.isTopLevel && - exDeclaration[0].endsWith("Context") - ) { - return false; - } - - return true; - }); - }) - .map((exDeclaration) => { - if (exported.indexOf(exDeclaration[0]) > -1) { - return `${exDeclaration[0]} as ${clientName}${exDeclaration[0]}`; - } - return exDeclaration[0]; - }); - const moduleSpecifier = `.${modelsFile - .getFilePath() - .replace(indexFile.getDirectoryPath(), "") - .replace(/\\/g, "/") - .replace(".ts", "")}.js`; - if (namedExports.length > 0) { - indexFile.addExportDeclaration({ - moduleSpecifier, - namedExports - }); - } - } -} - export function buildSubClientIndexFile( - context: SdkContext, - clientMap: [string[], SdkClientType], - emitterOptions: ModularEmitterOptions + codeModel: ModularCodeModel, + client: Client ) { - const project = useContext("outputProject"); - const [_, client] = clientMap; - const { subfolder } = getModularClientOptions(clientMap); - const srcPath = emitterOptions.modularOptions.sourceRoot; - const subClientIndexFile = project.createSourceFile( - `${srcPath}/${subfolder && subfolder !== "" ? subfolder + "/" : ""}index.ts`, + const subfolder = client.subfolder ?? ""; + const srcPath = codeModel.modularOptions.sourceRoot; + const subClientIndexFile = codeModel.project.createSourceFile( + `${srcPath}/${subfolder !== "" ? subfolder + "/" : ""}index.ts`, undefined, { overwrite: true } ); - const clientName = `${getClassicalClientName(client)}`; + const clientName = `${getClientName(client)}Client`; const clientFilePath = `${srcPath}/${ - subfolder && subfolder !== "" ? subfolder + "/" : "" - }${normalizeName(clientName, NameType.File)}.ts`; - const clientFile = project.getSourceFile(clientFilePath); + subfolder !== "" ? subfolder + "/" : "" + }${clientName}.ts`; + const clientFile = codeModel.project.getSourceFile(clientFilePath); if (!clientFile) { - reportDiagnostic(context.program, { - code: "client-file-not-found", - format: { - filePath: clientFilePath - }, - target: NoTarget - }); - return; // Skip exporting this client but continue with others + throw new Error(`Couldn't find client file: ${clientFilePath}`); } - exportClassicalClient(client, subClientIndexFile, subfolder ?? "", true); - exportSimplePollerLike( - context, - clientMap, + exportClassicalClient(client, subClientIndexFile, subfolder, true); + exportModules( subClientIndexFile, - project, + codeModel.project, srcPath, + clientName, + "models", subfolder ); - exportRestoreHelpers( + exportModules( subClientIndexFile, - project, + codeModel.project, srcPath, clientName, + "classic", subfolder ); - exportModules(subClientIndexFile, project, srcPath, clientName, "api", { - subfolder, - interfaceOnly: true, - recursive: true - }); - exportModules(subClientIndexFile, project, srcPath, clientName, "classic", { - subfolder - }); } From 1495f0ba4b7cfc31681e08079eb7c328e1300741 Mon Sep 17 00:00:00 2001 From: "Jiao Di (MSFT)" Date: Mon, 2 Feb 2026 16:41:16 +0800 Subject: [PATCH 08/10] update --- .../typespec-ts/src/modular/buildRootIndex.ts | 443 +++++++++++++++--- 1 file changed, 381 insertions(+), 62 deletions(-) diff --git a/packages/typespec-ts/src/modular/buildRootIndex.ts b/packages/typespec-ts/src/modular/buildRootIndex.ts index 51940f519c..3832fbde78 100644 --- a/packages/typespec-ts/src/modular/buildRootIndex.ts +++ b/packages/typespec-ts/src/modular/buildRootIndex.ts @@ -1,132 +1,451 @@ +import { NameType, normalizeName } from "@azure-tools/rlc-common"; import { Project, SourceFile } from "ts-morph"; -import { getClientName } from "./helpers/namingHelpers.js"; -import { Client, ModularCodeModel } from "./modularCodeModel.js"; +import { getClassicalClientName } from "./helpers/namingHelpers.js"; +import { ModularEmitterOptions } from "./interfaces.js"; +import { resolveReference } from "../framework/reference.js"; +import { + CloudSettingHelpers, + MultipartHelpers, + PagingHelpers +} from "./static-helpers-metadata.js"; +import { + SdkClientType, + SdkServiceOperation +} from "@azure-tools/typespec-client-generator-core"; +import { getModularClientOptions } from "../utils/clientUtils.js"; +import { getMethodHierarchiesMap } from "../utils/operationUtil.js"; +import { join } from "path/posix"; +import { useContext } from "../contextManager.js"; +import { reportDiagnostic } from "../lib.js"; +import { NoTarget } from "@typespec/compiler"; +import { isLroOnlyOperation } from "./helpers/operationHelpers.js"; +import { SdkContext } from "../utils/interfaces.js"; export function buildRootIndex( - codeModel: ModularCodeModel, - client: Client, - rootIndexFile: SourceFile + context: SdkContext, + emitterOptions: ModularEmitterOptions, + rootIndexFile: SourceFile, + clientMap?: [string[], SdkClientType] ) { - const { project } = codeModel; - const srcPath = codeModel.modularOptions.sourceRoot; - const subfolder = client.subfolder ?? ""; - const clientName = `${getClientName(client)}Client`; + if (!clientMap) { + // we still need to export the models if no client is provided + exportModels(emitterOptions, rootIndexFile); + return; + } + const project = useContext("outputProject"); + const [_, client] = clientMap; + const srcPath = emitterOptions.modularOptions.sourceRoot; + const { subfolder } = getModularClientOptions(clientMap); + const clientName = `${getClassicalClientName(client)}`; const clientFile = project.getSourceFile( - `${srcPath}/${subfolder !== "" ? subfolder + "/" : ""}${clientName}.ts` + `${srcPath}/${subfolder && subfolder !== "" ? subfolder + "/" : ""}${normalizeName( + clientName, + NameType.File + )}.ts` ); if (!clientFile) { - throw new Error(`Couldn't find client file: ${srcPath}/${clientName}.ts`); + reportDiagnostic(context.program, { + code: "client-file-not-found", + format: { + filePath: `${srcPath}/${normalizeName(clientName, NameType.File)}.ts` + }, + target: NoTarget + }); + return; // Skip exporting this client but continue with others } - exportClassicalClient(client, rootIndexFile, subfolder); - exportModules( + exportClassicalClient(client, rootIndexFile, subfolder ?? ""); + exportSimplePollerLike( + context, + clientMap, rootIndexFile, project, srcPath, - clientName, - "models", - subfolder, - true + subfolder ); - exportModules( + exportRestoreHelpers( rootIndexFile, project, srcPath, clientName, - "classic", subfolder, true ); + exportModels(emitterOptions, rootIndexFile, clientName); + exportModules(rootIndexFile, project, srcPath, clientName, "api", { + subfolder, + interfaceOnly: true, + isTopLevel: true + }); + exportModules(rootIndexFile, project, srcPath, clientName, "classic", { + subfolder, + isTopLevel: true + }); + + exportPagingTypes(context, rootIndexFile); + exportFileContentsType(context, rootIndexFile); + exportAzureCloudTypes(context, rootIndexFile); } -function exportClassicalClient( - client: Client, +function exportModels( + emitterOptions: ModularEmitterOptions, + rootIndexFile: SourceFile, + clientName: string = "" +) { + // export models index file if not exists + const project = useContext("outputProject"); + const srcPath = emitterOptions.modularOptions.sourceRoot; + const modelsExportsIndex = rootIndexFile + .getExportDeclarations() + ?.find((i) => { + return i.getModuleSpecifierValue()?.startsWith(`./models/`); + }); + if (!modelsExportsIndex) { + exportModules(rootIndexFile, project, srcPath, clientName, "models", { + isTopLevel: true, + recursive: true + }); + } +} + +function exportAzureCloudTypes(context: SdkContext, rootIndexFile: SourceFile) { + if (context.arm) { + addExportsToRootIndexFile(rootIndexFile, [ + resolveReference(CloudSettingHelpers.AzureClouds), + resolveReference(CloudSettingHelpers.AzureSupportedClouds) + ]); + } +} + +/** + * This is a temporary solution for adding paging exports. Eventually we will have the binder generate the exports automatically. + */ +function exportPagingTypes(context: SdkContext, rootIndexFile: SourceFile) { + if (!hasPaging(context)) { + return; + } + + addExportsToRootIndexFile(rootIndexFile, [ + resolveReference(PagingHelpers.PageSettings), + resolveReference(PagingHelpers.ContinuablePage), + resolveReference(PagingHelpers.PagedAsyncIterableIterator) + ]); +} + +function hasPaging(context: SdkContext): boolean { + return context.sdkPackage.clients.some((client) => { + const methodMap = getMethodHierarchiesMap(context, client); + for (const [_, operations] of methodMap) { + if ( + operations.some((op) => op.kind === "paging" || op.kind === "lropaging") + ) { + return true; + } + } + return false; + }); +} + +function exportFileContentsType( + context: SdkContext, + rootIndexFile: SourceFile +) { + if ( + context.sdkPackage.models.some((x) => + x.properties.some( + // eslint-disable-next-line + (y) => y.kind === "property" && y.multipartOptions?.isFilePart + ) + ) + ) { + addExportsToRootIndexFile(rootIndexFile, [ + resolveReference(MultipartHelpers.FileContents) + ]); + } +} + +function getExistingExports(rootIndexFile: SourceFile): Set { + return new Set( + rootIndexFile + .getExportDeclarations() + .flatMap((exportDecl) => + exportDecl.getNamedExports().map((namedExport) => namedExport.getName()) + ) + ); +} + +function getNewNamedExports( + namedExports: string[], + existingExports: Set +): string[] { + return namedExports.filter( + (namedExport) => !existingExports.has(namedExport) + ); +} + +function addExportsToRootIndexFile( + rootIndexFile: SourceFile, + namedExports: string[] +) { + const existingExports = getExistingExports(rootIndexFile); + const newNamedExports = getNewNamedExports(namedExports, existingExports); + if (newNamedExports.length > 0) { + rootIndexFile.addExportDeclaration({ + namedExports: newNamedExports + }); + } +} + +function exportSimplePollerLike( + context: SdkContext, + clientMap: [string[], SdkClientType], indexFile: SourceFile, - subfolder: string, - isSubClient: boolean = false + project: Project, + srcPath: string, + subfolder: string = "", + isTopLevel: boolean = false ) { - const clientName = `${getClientName(client)}Client`; + const [_, client] = clientMap; + + const methodMap = getMethodHierarchiesMap(context, client); + const hasLro = Array.from(methodMap.values()).some((operations) => { + return operations.some(isLroOnlyOperation); + }); + if (!hasLro || context.rlcOptions?.compatibilityLro !== true) { + return; + } + const helperFile = project.getSourceFile( + `${srcPath}/${ + subfolder && subfolder !== "" ? subfolder + "/" : "" + }static-helpers/simplePollerHelpers.ts` + ); + if (!helperFile) { + return; + } + const moduleSpecifier = `./${ + isTopLevel && subfolder && subfolder !== "" ? subfolder + "/" : "" + }static-helpers/simplePollerHelpers.js`; indexFile.addExportDeclaration({ - namedExports: [clientName, `${clientName}Options`], - moduleSpecifier: `./${ - subfolder !== "" && !isSubClient ? subfolder + "/" : "" - }${clientName}.js` + moduleSpecifier, + namedExports: ["SimplePollerLike"] }); } -function exportModules( +function exportRestoreHelpers( indexFile: SourceFile, project: Project, srcPath: string, clientName: string, - moduleName: string, subfolder: string = "", isTopLevel: boolean = false ) { - const modelsFile = project.getSourceFile( + const helperFile = project.getSourceFile( `${srcPath}/${ - subfolder !== "" ? subfolder + "/" : "" - }${moduleName}/index.ts` + subfolder && subfolder !== "" ? subfolder + "/" : "" + }restorePollerHelpers.ts` ); - if (!modelsFile) { + if (!helperFile) { return; } - const exported = [...indexFile.getExportedDeclarations().keys()]; - const namedExports = [...modelsFile.getExportedDeclarations().keys()].map( - (modelName) => { - if (exported.indexOf(modelName) > -1) { - return `${modelName} as ${clientName}${modelName}`; + const namedExports = [...helperFile.getExportedDeclarations().keys()].map( + (helper) => { + if (exported.indexOf(helper) > -1) { + return `${helper} as ${clientName}${helper}`; } - return modelName; + return helper; } ); const moduleSpecifier = `./${ - isTopLevel && subfolder !== "" ? subfolder + "/" : "" - }${moduleName}/index.js`; + isTopLevel && subfolder && subfolder !== "" ? subfolder + "/" : "" + }restorePollerHelpers.js`; indexFile.addExportDeclaration({ moduleSpecifier, namedExports }); } +function exportClassicalClient( + client: SdkClientType, + indexFile: SourceFile, + subfolder: string, + isSubClient: boolean = false +) { + const clientName = client.name; + indexFile.addExportDeclaration({ + namedExports: [clientName], + moduleSpecifier: `./${ + subfolder && subfolder !== "" && !isSubClient ? subfolder + "/" : "" + }${normalizeName(clientName, NameType.File)}.js` + }); +} + +export interface ExportModulesOptions { + interfaceOnly?: boolean; + isTopLevel?: boolean; + subfolder?: string; + recursive?: boolean; +} + +function exportModules( + indexFile: SourceFile, + project: Project, + srcPath: string, + clientName: string, + moduleName: string, + options: ExportModulesOptions = { + interfaceOnly: false, + isTopLevel: false, + subfolder: "", + recursive: false + } +) { + const subfolder = options.subfolder ?? ""; + let folders = []; + if (options.recursive) { + folders = project + .getDirectories() + .filter((dir) => { + const formattedDir = dir.getPath().replace(/\\/g, "/"); + const targetPath = join(srcPath, subfolder, moduleName).replace( + /\\/g, + "/" + ); + return formattedDir.startsWith(targetPath); + }) + .map((dir) => { + return dir.getPath().replace(/\\/g, "/"); + }); + } else if (options.isTopLevel && moduleName === "api") { + folders = project + .getDirectories() + .filter((dir) => { + const formattedDir = dir.getPath().replace(/\\/g, "/"); + const targetPath = join(srcPath, subfolder, moduleName).replace( + /\\/g, + "/" + ); + return formattedDir.startsWith(targetPath); + }) + .map((dir) => { + return dir.getPath().replace(/\\/g, "/"); + }); + } else { + folders = [join(srcPath, subfolder, moduleName).replace(/\\/g, "/")]; + } + for (const folder of folders) { + const apiFilePattern = join(folder, "index.ts").replace(/\\/g, "/"); + const modelsFile = project.getSourceFile(apiFilePattern); + if (!modelsFile) { + continue; + } + + const exported = [...indexFile.getExportedDeclarations().keys()]; + const serializerOrDeserializerRegex = /.*(Serializer|Deserializer)(_\d+)?$/; + const namedExports = [...modelsFile.getExportedDeclarations().entries()] + .filter((exDeclaration) => { + if (exDeclaration[0].startsWith("_")) { + return false; + } + return exDeclaration[1].some((ex) => { + if ( + options.interfaceOnly && + ex.getKindName() !== "InterfaceDeclaration" + ) { + return false; + } + if ( + moduleName === "models" && + ex.getKindName() === "FunctionDeclaration" && + serializerOrDeserializerRegex.test(exDeclaration[0]) + ) { + return false; + } + if ( + options.interfaceOnly && + options.isTopLevel && + exDeclaration[0].endsWith("Context") + ) { + return false; + } + + return true; + }); + }) + .map((exDeclaration) => { + if (exported.indexOf(exDeclaration[0]) > -1) { + return `${exDeclaration[0]} as ${clientName}${exDeclaration[0]}`; + } + return exDeclaration[0]; + }); + const moduleSpecifier = `.${modelsFile + .getFilePath() + .replace(indexFile.getDirectoryPath(), "") + .replace(/\\/g, "/") + .replace(".ts", "")}.js`; + if (namedExports.length > 0) { + indexFile.addExportDeclaration({ + moduleSpecifier, + namedExports + }); + } + } +} + export function buildSubClientIndexFile( - codeModel: ModularCodeModel, - client: Client + context: SdkContext, + clientMap: [string[], SdkClientType], + emitterOptions: ModularEmitterOptions ) { - const subfolder = client.subfolder ?? ""; - const srcPath = codeModel.modularOptions.sourceRoot; - const subClientIndexFile = codeModel.project.createSourceFile( - `${srcPath}/${subfolder !== "" ? subfolder + "/" : ""}index.ts`, + const project = useContext("outputProject"); + const [_, client] = clientMap; + const { subfolder } = getModularClientOptions(clientMap); + const srcPath = emitterOptions.modularOptions.sourceRoot; + const subClientIndexFile = project.createSourceFile( + `${srcPath}/${subfolder && subfolder !== "" ? subfolder + "/" : ""}index.ts`, undefined, { overwrite: true } ); - const clientName = `${getClientName(client)}Client`; + const clientName = `${getClassicalClientName(client)}`; const clientFilePath = `${srcPath}/${ - subfolder !== "" ? subfolder + "/" : "" - }${clientName}.ts`; - const clientFile = codeModel.project.getSourceFile(clientFilePath); + subfolder && subfolder !== "" ? subfolder + "/" : "" + }${normalizeName(clientName, NameType.File)}.ts`; + const clientFile = project.getSourceFile(clientFilePath); if (!clientFile) { - throw new Error(`Couldn't find client file: ${clientFilePath}`); + reportDiagnostic(context.program, { + code: "client-file-not-found", + format: { + filePath: clientFilePath + }, + target: NoTarget + }); + return; // Skip exporting this client but continue with others } - exportClassicalClient(client, subClientIndexFile, subfolder, true); - exportModules( + exportClassicalClient(client, subClientIndexFile, subfolder ?? "", true); + exportSimplePollerLike( + context, + clientMap, subClientIndexFile, - codeModel.project, + project, srcPath, - clientName, - "models", subfolder ); - exportModules( + exportRestoreHelpers( subClientIndexFile, - codeModel.project, + project, srcPath, clientName, - "classic", subfolder ); -} + exportModules(subClientIndexFile, project, srcPath, clientName, "api", { + subfolder, + interfaceOnly: true, + recursive: true + }); + exportModules(subClientIndexFile, project, srcPath, clientName, "classic", { + subfolder + }); +} \ No newline at end of file From a429a2007650bec4957962a2ea33feb0dd6d689f Mon Sep 17 00:00:00 2001 From: "Jiao Di (MSFT)" <80496810+v-jiaodi@users.noreply.github.com> Date: Mon, 2 Feb 2026 16:43:10 +0800 Subject: [PATCH 09/10] Fix missing newline at end of buildRootIndex.ts Add newline at the end of buildRootIndex.ts --- packages/typespec-ts/src/modular/buildRootIndex.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/typespec-ts/src/modular/buildRootIndex.ts b/packages/typespec-ts/src/modular/buildRootIndex.ts index 3832fbde78..c507f9891c 100644 --- a/packages/typespec-ts/src/modular/buildRootIndex.ts +++ b/packages/typespec-ts/src/modular/buildRootIndex.ts @@ -448,4 +448,4 @@ export function buildSubClientIndexFile( exportModules(subClientIndexFile, project, srcPath, clientName, "classic", { subfolder }); -} \ No newline at end of file +} From f0db05a9050368c9f7fbceeba619b45ae33e2234 Mon Sep 17 00:00:00 2001 From: "Jiao Di (MSFT)" Date: Tue, 3 Feb 2026 10:47:47 +0800 Subject: [PATCH 10/10] update --- packages/typespec-ts/src/modular/buildClassicalClient.ts | 4 ++-- .../src/modular/helpers/classicalOperationHelpers.ts | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/typespec-ts/src/modular/buildClassicalClient.ts b/packages/typespec-ts/src/modular/buildClassicalClient.ts index 11aae5e186..f8079cc79c 100644 --- a/packages/typespec-ts/src/modular/buildClassicalClient.ts +++ b/packages/typespec-ts/src/modular/buildClassicalClient.ts @@ -300,7 +300,7 @@ function generateMethod( }); } // For LRO+Paging operations, use different return types and implementation else if (context.rlcOptions?.compatibilityLro && declaration?.isLroPaging) { - const itemType = declaration?.lropagingFinalReturnType ?? "any"; + const returnType = declaration?.lropagingFinalReturnType ?? "void"; const pagedAsyncIterableIteratorReference = resolveReference( PagingHelpers.PagedAsyncIterableIterator ); @@ -314,7 +314,7 @@ function generateMethod( docs: [`@deprecated use ${methodName} instead`], name: beginListAndWaitName, kind: StructureKind.Method, - returnType: `${pagedAsyncIterableIteratorReference}<${itemType}>`, + returnType: `${pagedAsyncIterableIteratorReference}<${returnType}>`, parameters: methodParams, statements: `return ${declarationRefKey}(${methodParamStr});` }); diff --git a/packages/typespec-ts/src/modular/helpers/classicalOperationHelpers.ts b/packages/typespec-ts/src/modular/helpers/classicalOperationHelpers.ts index 32cfa2456b..63870cc55c 100644 --- a/packages/typespec-ts/src/modular/helpers/classicalOperationHelpers.ts +++ b/packages/typespec-ts/src/modular/helpers/classicalOperationHelpers.ts @@ -170,7 +170,7 @@ export function getClassicalOperation( if (operationInfo?.isLroPaging) { // LRO+Paging operation - const itemType = operationInfo?.lropagingFinalReturnType ?? "any"; + const returnType = operationInfo?.lropagingFinalReturnType ?? "void"; const pagedAsyncIterableIteratorReference = resolveReference( PagingHelpers.PagedAsyncIterableIterator ); @@ -178,7 +178,7 @@ export function getClassicalOperation( properties.push({ kind: StructureKind.PropertySignature, name: `${normalizeName(beginListAndWaitName, NameType.Method)}`, - type: `(${paramStr}) => ${pagedAsyncIterableIteratorReference}<${itemType}>`, + type: `(${paramStr}) => ${pagedAsyncIterableIteratorReference}<${returnType}>`, docs: [`@deprecated use ${getClassicalMethodName(d)} instead`] }); } else {