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..fced32d193 --- /dev/null +++ b/packages/typespec-test/test/AppService/generated/typespec-ts/package.json @@ -0,0 +1,267 @@ +{ + "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..d52a9f68ff --- /dev/null +++ b/packages/typespec-test/test/AppService/generated/typespec-ts/src/api/appServiceEnvironmentResources/operations.ts @@ -0,0 +1,238 @@ +// 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 ?? "2025-05-01", + }, + { + 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", + apiVersion: context.apiVersion ?? "2025-05-01", + }, + ) as PollerLike, PathUncheckedResponse>; + + return buildPagedAsyncIterator( + context, + async () => await initialPagingPoller, + _suspendDeserialize, + ["200", "202", "201"], + { itemName: "value", nextLinkName: "nextLink", apiVersion: context.apiVersion ?? "2025-05-01" }, + ); +} + +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 ?? "2025-05-01", + }, + { + 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", + apiVersion: context.apiVersion ?? "2025-05-01", + }, + ) as PollerLike, PathUncheckedResponse>; + + return buildPagedAsyncIterator( + context, + async () => await initialPagingPoller, + _resumeDeserialize, + ["200", "202", "201"], + { itemName: "value", nextLinkName: "nextLink", apiVersion: context.apiVersion ?? "2025-05-01" }, + ); +} + +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 ?? "2025-05-01", + }, + { + 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", + apiVersion: context.apiVersion ?? "2025-05-01", + }, + ) as PollerLike, PathUncheckedResponse>; + + return buildPagedAsyncIterator( + context, + async () => await initialPagingPoller, + _changeVnetDeserialize, + ["200", "202", "201"], + { itemName: "value", nextLinkName: "nextLink", apiVersion: context.apiVersion ?? "2025-05-01" }, + ); +} 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..9b2dd702a6 --- /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 ?? "2025-05-01", + }, + { + 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", apiVersion: context.apiVersion ?? "2025-05-01" }, + ); +} 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..23f4bb99fa --- /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 ?? "2025-05-01", + }, + { + 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..18305914c8 --- /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 ?? "2025-05-01", + }, + { + 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 ?? "2025-05-01", + }, + { + 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 ?? "2025-05-01", + }, + { + 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 ?? "2025-05-01", + }, + { + 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", apiVersion: context.apiVersion ?? "2025-05-01" }, + ); +} + +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 ?? "2025-05-01", + }, + { + 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 ?? "2025-05-01", + 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", apiVersion: context.apiVersion ?? "2025-05-01" }, + ); +} + +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 ?? "2025-05-01", + 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", apiVersion: context.apiVersion ?? "2025-05-01" }, + ); +} + +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 ?? "2025-05-01", + }, + { + 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 ?? "2025-05-01", + 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", apiVersion: context.apiVersion ?? "2025-05-01" }, + ); +} + +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 ?? "2025-05-01", + }, + { + 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", apiVersion: context.apiVersion ?? "2025-05-01" }, + ); +} + +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 ?? "2025-05-01", + }, + { + 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 ?? "2025-05-01", + }, + { + 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 ?? "2025-05-01", + }, + { + 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..b4b3d8efa9 --- /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 ?? "2025-05-01", + }, + { + 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", apiVersion: context.apiVersion ?? "2025-05-01" }, + ); +} 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..0e8f6f7533 --- /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 ?? "2025-05-01", + 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", apiVersion: context.apiVersion ?? "2025-05-01" }, + ); +} + +export function _getWebAppStacksSend( + context: Client, + options: ProviderOperationGroupGetWebAppStacksOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/providers/Microsoft.Web/webAppStacks{?api%2Dversion,stackOsType}", + { + "api%2Dversion": context.apiVersion ?? "2025-05-01", + 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", apiVersion: context.apiVersion ?? "2025-05-01" }, + ); +} + +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 ?? "2025-05-01", + 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", apiVersion: context.apiVersion ?? "2025-05-01" }, + ); +} + +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 ?? "2025-05-01", + 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", apiVersion: context.apiVersion ?? "2025-05-01" }, + ); +} + +export function _getFunctionAppStacksSend( + context: Client, + options: ProviderOperationGroupGetFunctionAppStacksOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/providers/Microsoft.Web/functionAppStacks{?api%2Dversion,stackOsType}", + { + "api%2Dversion": context.apiVersion ?? "2025-05-01", + 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", apiVersion: context.apiVersion ?? "2025-05-01" }, + ); +} + +export function _getAvailableStacksSend( + context: Client, + options: ProviderOperationGroupGetAvailableStacksOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/providers/Microsoft.Web/availableStacks{?api%2Dversion,osTypeSelected}", + { + "api%2Dversion": context.apiVersion ?? "2025-05-01", + 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", apiVersion: context.apiVersion ?? "2025-05-01" }, + ); +} 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..b8557dfeb3 --- /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 ?? "2025-05-01", + }, + { + 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 ?? "2025-05-01", + }, + { + 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 ?? "2025-05-01", + 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", apiVersion: context.apiVersion ?? "2025-05-01" }, + ); +} 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..a09e533265 --- /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 ?? "2025-05-01", + }, + { + 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..a7bb32f46a --- /dev/null +++ b/packages/typespec-test/test/AppService/generated/typespec-ts/src/api/webSiteManagementContext.ts @@ -0,0 +1,48 @@ +// 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 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. */ +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); + const apiVersion = options.apiVersion; + 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..8412742a96 --- /dev/null +++ b/packages/typespec-test/test/AppService/generated/typespec-ts/src/static-helpers/pagingHelpers.ts @@ -0,0 +1,269 @@ +// 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"; + apiVersion?: string; +} + +/** + * 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 apiVersion = options.apiVersion; + const pagedResult: PagedResult = { + getPage: async (pageLink?: string) => { + 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); + 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, + ); + } +} + +/** + * 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 new file mode 100644 index 0000000000..b1bb018377 --- /dev/null +++ b/packages/typespec-test/test/AppService/generated/typespec-ts/src/static-helpers/pollingHelpers.ts @@ -0,0 +1,149 @@ +// 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; + /** + * The api-version of the LRO + */ + apiVersion?: string; +} +export function getLongRunningPoller( + client: Client, + processResponseBody: (result: TResponse) => Promise, + expectedStatuses: string[], + options: GetLongRunningPollerOptions, +): PollerLike, TResult> { + const { restoreFrom, getInitialResponse, apiVersion } = 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 { + const pollingPath = apiVersion ? addApiVersionToUrl(path, apiVersion) : path; + response = await client.pathUnchecked(pollingPath).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, + }, + }; +} + +/** + * 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/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/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..1a6b458746 --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/package.json @@ -0,0 +1,419 @@ +{ + "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..8447de60e7 --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/review/arm-hybridnetwork.api.md @@ -0,0 +1,1996 @@ +## 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) + 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; + 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/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..f830621885 --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/artifactManifests/operations.ts @@ -0,0 +1,511 @@ +// 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 ?? "2025-03-30", + }, + { + 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", + apiVersion: context.apiVersion ?? "2025-03-30", + }) 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 ?? "2025-03-30", + }, + { + 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 ?? "2025-03-30", + }, + { + 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", apiVersion: context.apiVersion ?? "2025-03-30" }, + ); +} + +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 ?? "2025-03-30", + }, + { + 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", + apiVersion: context.apiVersion ?? "2025-03-30", + }) 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 ?? "2025-03-30", + }, + { + 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 ?? "2025-03-30", + }, + { + 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", + apiVersion: context.apiVersion ?? "2025-03-30", + }) 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 ?? "2025-03-30", + }, + { + 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..6069d4cc25 --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/artifactStores/operations.ts @@ -0,0 +1,799 @@ +// 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 ?? "2025-03-30", + }, + { + 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", + apiVersion: context.apiVersion ?? "2025-03-30", + }, + ) as PollerLike, PathUncheckedResponse>; + + return buildPagedAsyncIterator( + context, + async () => await initialPagingPoller, + _listPrivateEndPointsDeserialize, + ["200", "202", "201"], + { itemName: "value", nextLinkName: "nextLink", apiVersion: context.apiVersion ?? "2025-03-30" }, + ); +} + +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 ?? "2025-03-30", + }, + { + 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", + apiVersion: context.apiVersion ?? "2025-03-30", + }) 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 ?? "2025-03-30", + }, + { + 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", + apiVersion: context.apiVersion ?? "2025-03-30", + }) 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 ?? "2025-03-30", + }, + { + 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", + apiVersion: context.apiVersion ?? "2025-03-30", + }, + ) as PollerLike, PathUncheckedResponse>; + + return buildPagedAsyncIterator( + context, + async () => await initialPagingPoller, + _listNetworkFabricControllerPrivateEndPointsDeserialize, + ["200", "202", "201"], + { itemName: "value", nextLinkName: "nextLink", apiVersion: context.apiVersion ?? "2025-03-30" }, + ); +} + +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 ?? "2025-03-30", + }, + { + 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", + apiVersion: context.apiVersion ?? "2025-03-30", + }, + ) 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 ?? "2025-03-30", + }, + { + 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", + apiVersion: context.apiVersion ?? "2025-03-30", + }, + ) 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 ?? "2025-03-30", + }, + { + 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", apiVersion: context.apiVersion ?? "2025-03-30" }, + ); +} + +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 ?? "2025-03-30", + }, + { + 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", + apiVersion: context.apiVersion ?? "2025-03-30", + }) 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 ?? "2025-03-30", + }, + { + 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 ?? "2025-03-30", + }, + { + 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", + apiVersion: context.apiVersion ?? "2025-03-30", + }) 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 ?? "2025-03-30", + }, + { + 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..417a0a58ca --- /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 ?? "2025-03-30", + }, + { + 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", apiVersion: context.apiVersion ?? "2025-03-30" }, + ); +} + +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 ?? "2025-03-30", + }, + { + 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..81f7d116bc --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/configurationGroupSchemas/operations.ts @@ -0,0 +1,425 @@ +// 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 ?? "2025-03-30", + }, + { + 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", + apiVersion: context.apiVersion ?? "2025-03-30", + }) 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 ?? "2025-03-30", + }, + { + 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", apiVersion: context.apiVersion ?? "2025-03-30" }, + ); +} + +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 ?? "2025-03-30", + }, + { + 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", + apiVersion: context.apiVersion ?? "2025-03-30", + }) 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 ?? "2025-03-30", + }, + { + 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 ?? "2025-03-30", + }, + { + 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", + apiVersion: context.apiVersion ?? "2025-03-30", + }) 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 ?? "2025-03-30", + }, + { + 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..3d00a832d1 --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/configurationGroupValues/operations.ts @@ -0,0 +1,366 @@ +// 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 ?? "2025-03-30", + }, + { + 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", apiVersion: context.apiVersion ?? "2025-03-30" }, + ); +} + +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 ?? "2025-03-30", + }, + { + 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", apiVersion: context.apiVersion ?? "2025-03-30" }, + ); +} + +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 ?? "2025-03-30", + }, + { + 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", + apiVersion: context.apiVersion ?? "2025-03-30", + }) 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 ?? "2025-03-30", + }, + { + 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 ?? "2025-03-30", + }, + { + 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", + apiVersion: context.apiVersion ?? "2025-03-30", + }) 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 ?? "2025-03-30", + }, + { + 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..e619baa97d --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/hybridNetworkManagementContext.ts @@ -0,0 +1,48 @@ +// 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 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. */ +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); + const apiVersion = options.apiVersion; + 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..2f473abddb --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/networkFunctionDefinitionGroups/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, + 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 ?? "2025-03-30", + }, + { + 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", apiVersion: context.apiVersion ?? "2025-03-30" }, + ); +} + +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 ?? "2025-03-30", + }, + { + 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", + apiVersion: context.apiVersion ?? "2025-03-30", + }) 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 ?? "2025-03-30", + }, + { + 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 ?? "2025-03-30", + }, + { + 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", + apiVersion: context.apiVersion ?? "2025-03-30", + }) 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 ?? "2025-03-30", + }, + { + 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..caef29a713 --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/networkFunctionDefinitionVersions/operations.ts @@ -0,0 +1,462 @@ +// 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 ?? "2025-03-30", + }, + { + 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", + apiVersion: context.apiVersion ?? "2025-03-30", + }) 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 ?? "2025-03-30", + }, + { + 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", apiVersion: context.apiVersion ?? "2025-03-30" }, + ); +} + +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 ?? "2025-03-30", + }, + { + 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", + apiVersion: context.apiVersion ?? "2025-03-30", + }) 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 ?? "2025-03-30", + }, + { + 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 ?? "2025-03-30", + }, + { + 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", + apiVersion: context.apiVersion ?? "2025-03-30", + }) 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 ?? "2025-03-30", + }, + { + 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..d67e04b389 --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/networkFunctions/operations.ts @@ -0,0 +1,418 @@ +// 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 ?? "2025-03-30", + }, + { + 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", + apiVersion: context.apiVersion ?? "2025-03-30", + }) 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 ?? "2025-03-30", + }, + { + 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", apiVersion: context.apiVersion ?? "2025-03-30" }, + ); +} + +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 ?? "2025-03-30", + }, + { + 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", apiVersion: context.apiVersion ?? "2025-03-30" }, + ); +} + +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 ?? "2025-03-30", + }, + { + 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", + apiVersion: context.apiVersion ?? "2025-03-30", + }) 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 ?? "2025-03-30", + }, + { + 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 ?? "2025-03-30", + }, + { + 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", + apiVersion: context.apiVersion ?? "2025-03-30", + }) 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 ?? "2025-03-30", + }, + { + 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..cefa557029 --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/networkServiceDesignGroups/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, + 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 ?? "2025-03-30", + }, + { + 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", apiVersion: context.apiVersion ?? "2025-03-30" }, + ); +} + +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 ?? "2025-03-30", + }, + { + 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", + apiVersion: context.apiVersion ?? "2025-03-30", + }) 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 ?? "2025-03-30", + }, + { + 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 ?? "2025-03-30", + }, + { + 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", + apiVersion: context.apiVersion ?? "2025-03-30", + }) 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 ?? "2025-03-30", + }, + { + 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..4267bce710 --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/networkServiceDesignVersions/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, + 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 ?? "2025-03-30", + }, + { + 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", + apiVersion: context.apiVersion ?? "2025-03-30", + }) 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 ?? "2025-03-30", + }, + { + 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", apiVersion: context.apiVersion ?? "2025-03-30" }, + ); +} + +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 ?? "2025-03-30", + }, + { + 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", + apiVersion: context.apiVersion ?? "2025-03-30", + }) 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 ?? "2025-03-30", + }, + { + 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 ?? "2025-03-30", + }, + { + 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", + apiVersion: context.apiVersion ?? "2025-03-30", + }) 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 ?? "2025-03-30", + }, + { + 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..c58ac7361d --- /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 ?? "2025-03-30", + }, + { + 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", apiVersion: context.apiVersion ?? "2025-03-30" }, + ); +} 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..e7541438f8 --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/proxyArtifact/operations.ts @@ -0,0 +1,238 @@ +// 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 ?? "2025-03-30", + 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", + apiVersion: context.apiVersion ?? "2025-03-30", + }) 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 ?? "2025-03-30", + 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", apiVersion: context.apiVersion ?? "2025-03-30" }, + ); +} + +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 ?? "2025-03-30", + }, + { + 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", apiVersion: context.apiVersion ?? "2025-03-30" }, + ); +} 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..86497ee6b5 --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/publishers/operations.ts @@ -0,0 +1,348 @@ +// 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 ?? "2025-03-30", + }, + { + 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", apiVersion: context.apiVersion ?? "2025-03-30" }, + ); +} + +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 ?? "2025-03-30", + }, + { + 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", apiVersion: context.apiVersion ?? "2025-03-30" }, + ); +} + +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 ?? "2025-03-30", + }, + { + 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", + apiVersion: context.apiVersion ?? "2025-03-30", + }) 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 ?? "2025-03-30", + }, + { + 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 ?? "2025-03-30", + }, + { + 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", + apiVersion: context.apiVersion ?? "2025-03-30", + }) 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 ?? "2025-03-30", + }, + { + 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..f187d599b1 --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/siteNetworkServices/operations.ts @@ -0,0 +1,411 @@ +// 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 ?? "2025-03-30", + }, + { + 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", + apiVersion: context.apiVersion ?? "2025-03-30", + }) 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 ?? "2025-03-30", + }, + { + 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", apiVersion: context.apiVersion ?? "2025-03-30" }, + ); +} + +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 ?? "2025-03-30", + }, + { + 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", apiVersion: context.apiVersion ?? "2025-03-30" }, + ); +} + +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 ?? "2025-03-30", + }, + { + 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", + apiVersion: context.apiVersion ?? "2025-03-30", + }) 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 ?? "2025-03-30", + }, + { + 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 ?? "2025-03-30", + }, + { + 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", + apiVersion: context.apiVersion ?? "2025-03-30", + }) 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 ?? "2025-03-30", + }, + { + 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..d7d922dc59 --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/api/sites/operations.ts @@ -0,0 +1,347 @@ +// 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 ?? "2025-03-30", + }, + { + 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", apiVersion: context.apiVersion ?? "2025-03-30" }, + ); +} + +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 ?? "2025-03-30", + }, + { + 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", apiVersion: context.apiVersion ?? "2025-03-30" }, + ); +} + +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 ?? "2025-03-30", + }, + { + 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", + apiVersion: context.apiVersion ?? "2025-03-30", + }) 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 ?? "2025-03-30", + }, + { + 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 ?? "2025-03-30", + }, + { + 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", + apiVersion: context.apiVersion ?? "2025-03-30", + }) 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 ?? "2025-03-30", + }, + { + 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..4f9a1e7dd7 --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/restorePollerHelpers.ts @@ -0,0 +1,344 @@ +// 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}.`, + ); + } + const apiVersion = getApiVersionFromUrl(initialRequestUrl); + return getLongRunningPoller( + (client as any)["_client"] ?? client, + deserializeHelper as (result: TResponse) => Promise, + expectedStatuses, + { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + resourceLocationConfig, + restoreFrom: serializedState, + initialRequestUrl, + apiVersion, + }, + ); +} + +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); +} + +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/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..8412742a96 --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/static-helpers/pagingHelpers.ts @@ -0,0 +1,269 @@ +// 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"; + apiVersion?: string; +} + +/** + * 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 apiVersion = options.apiVersion; + const pagedResult: PagedResult = { + getPage: async (pageLink?: string) => { + 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); + 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, + ); + } +} + +/** + * 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 new file mode 100644 index 0000000000..b1bb018377 --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/generated/typespec-ts/src/static-helpers/pollingHelpers.ts @@ -0,0 +1,149 @@ +// 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; + /** + * The api-version of the LRO + */ + apiVersion?: string; +} +export function getLongRunningPoller( + client: Client, + processResponseBody: (result: TResponse) => Promise, + expectedStatuses: string[], + options: GetLongRunningPollerOptions, +): PollerLike, TResult> { + const { restoreFrom, getInitialResponse, apiVersion } = 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 { + const pollingPath = apiVersion ? addApiVersionToUrl(path, apiVersion) : path; + response = await client.pathUnchecked(pollingPath).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, + }, + }; +} + +/** + * 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/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..031889db45 --- /dev/null +++ b/packages/typespec-test/test/HybridNetwork.Management/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/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" diff --git a/packages/typespec-ts/src/modular/buildClassicalClient.ts b/packages/typespec-ts/src/modular/buildClassicalClient.ts index 1d143c2735..f8079cc79c 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 returnType = declaration?.lropagingFinalReturnType ?? "void"; + 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}<${returnType}>`, + parameters: methodParams, + statements: `return ${declarationRefKey}(${methodParamStr});` + }); } return res; diff --git a/packages/typespec-ts/src/modular/helpers/classicalOperationHelpers.ts b/packages/typespec-ts/src/modular/helpers/classicalOperationHelpers.ts index 9c586ccc0f..63870cc55c 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 returnType = operationInfo?.lropagingFinalReturnType ?? "void"; + const pagedAsyncIterableIteratorReference = resolveReference( + PagingHelpers.PagedAsyncIterableIterator + ); + const beginListAndWaitName = `beginList_${getClassicalMethodName(d)}_andWait`; + properties.push({ + kind: StructureKind.PropertySignature, + name: `${normalizeName(beginListAndWaitName, NameType.Method)}`, + type: `(${paramStr}) => ${pagedAsyncIterableIteratorReference}<${returnType}>`, + 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 0f914fe19d..42bd766dc1 100644 --- a/packages/typespec-ts/src/modular/helpers/operationHelpers.ts +++ b/packages/typespec-ts/src/modular/helpers/operationHelpers.ts @@ -540,6 +540,8 @@ export function getOperationFunction( propertyName?: string; isLro?: boolean; lroFinalReturnType?: string; + isLroPaging?: boolean; + lropagingFinalReturnType?: string; } { const operation = method[1]; // Extract required parameters @@ -704,7 +706,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, @@ -765,6 +771,8 @@ function getLroAndPagingOperationFunction( ], isAsync: false, isExported: true, + isLroPaging: true, + lropagingFinalReturnType: returnType.type, name, propertyName: normalizeName(operation.name, NameType.Property), parameters,