From dbda699e957385803bac78e67c3f9db2df2b8f63 Mon Sep 17 00:00:00 2001 From: kazrael2119 <98569699+kazrael2119@users.noreply.github.com> Date: Fri, 27 Dec 2024 17:39:27 +0800 Subject: [PATCH 01/16] Migration: Update package.json, tsconfig.json, and api-extractor.json --- .../arm-servicefabric-rest/api-extractor.json | 27 +- .../arm-servicefabric-rest/package.json | 74 +-- .../src/clientDefinitions.ts | 252 +++++----- .../src/isUnexpected.ts | 452 ++++++++++-------- .../arm-servicefabric-rest/src/logger.ts | 5 + .../arm-servicefabric-rest/src/models.ts | 225 +++++---- .../src/outputModels.ts | 202 ++++++-- .../src/paginateHelper.ts | 186 ++++++- .../arm-servicefabric-rest/src/parameters.ts | 35 +- .../src/pollingHelper.ts | 181 ++++++- .../arm-servicefabric-rest/src/responses.ts | 119 ++--- .../src/serviceFabricClient.ts | 68 ++- .../arm-servicefabric-rest/swagger/README.md | 4 + .../test/public/utils/env.browser.ts | 2 - .../test/public/utils/env.ts | 6 - .../test/public/utils/recordedClient.ts | 1 - .../arm-servicefabric-rest/tsconfig.json | 18 +- .../tsconfig.samples.json | 10 + .../arm-servicefabric-rest/tsconfig.src.json | 3 + .../arm-servicefabric-rest/tsconfig.test.json | 6 + 20 files changed, 1245 insertions(+), 631 deletions(-) create mode 100644 sdk/servicefabric/arm-servicefabric-rest/src/logger.ts delete mode 100644 sdk/servicefabric/arm-servicefabric-rest/test/public/utils/env.browser.ts delete mode 100644 sdk/servicefabric/arm-servicefabric-rest/test/public/utils/env.ts create mode 100644 sdk/servicefabric/arm-servicefabric-rest/tsconfig.samples.json create mode 100644 sdk/servicefabric/arm-servicefabric-rest/tsconfig.src.json create mode 100644 sdk/servicefabric/arm-servicefabric-rest/tsconfig.test.json diff --git a/sdk/servicefabric/arm-servicefabric-rest/api-extractor.json b/sdk/servicefabric/arm-servicefabric-rest/api-extractor.json index ba311620986d..4b97f8bf3f2d 100644 --- a/sdk/servicefabric/arm-servicefabric-rest/api-extractor.json +++ b/sdk/servicefabric/arm-servicefabric-rest/api-extractor.json @@ -1,18 +1,31 @@ { "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", - "mainEntryPointFilePath": "./types/src/index.d.ts", - "docModel": { "enabled": true }, - "apiReport": { "enabled": true, "reportFolder": "./review" }, + "mainEntryPointFilePath": "dist/esm/index.d.ts", + "docModel": { + "enabled": true + }, + "apiReport": { + "enabled": true, + "reportFolder": "./review" + }, "dtsRollup": { "enabled": true, "untrimmedFilePath": "", - "publicTrimmedFilePath": "./types/arm-servicefabric.d.ts" + "publicTrimmedFilePath": "dist/arm-servicefabric.d.ts" }, "messages": { - "tsdocMessageReporting": { "default": { "logLevel": "none" } }, + "tsdocMessageReporting": { + "default": { + "logLevel": "none" + } + }, "extractorMessageReporting": { - "ae-missing-release-tag": { "logLevel": "none" }, - "ae-unresolved-link": { "logLevel": "none" } + "ae-missing-release-tag": { + "logLevel": "none" + }, + "ae-unresolved-link": { + "logLevel": "none" + } } } } diff --git a/sdk/servicefabric/arm-servicefabric-rest/package.json b/sdk/servicefabric/arm-servicefabric-rest/package.json index 07cf2b41308a..9e918bb2ed14 100644 --- a/sdk/servicefabric/arm-servicefabric-rest/package.json +++ b/sdk/servicefabric/arm-servicefabric-rest/package.json @@ -23,11 +23,8 @@ }, "files": [ "dist/", - "dist-esm/src/", - "types/arm-servicefabric.d.ts", "README.md", - "LICENSE", - "review/*" + "LICENSE" ], "//metadata": { "constantPaths": [ @@ -41,12 +38,12 @@ "node": ">=18.0.0" }, "scripts": { - "build": "npm run clean && tsc -p . && dev-tool run bundle && dev-tool run vendored mkdirp ./review && dev-tool run extract-api", - "build:browser": "tsc -p . && dev-tool run bundle", - "build:debug": "tsc -p . && dev-tool run bundle && dev-tool run extract-api", - "build:node": "tsc -p . && dev-tool run bundle --browser-test false", + "build": "npm run clean && dev-tool run build-package && dev-tool run vendored mkdirp ./review && dev-tool run extract-api", + "build:browser": "dev-tool run build-package && dev-tool run bundle", + "build:debug": "dev-tool run build-package && dev-tool run bundle && dev-tool run extract-api", + "build:node": "dev-tool run build-package && dev-tool run bundle --browser-test false", "build:samples": "echo skipped.", - "build:test": "tsc -p . && dev-tool run bundle", + "build:test": "dev-tool run build-package && dev-tool run bundle", "check-format": "dev-tool run vendored prettier --list-different --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.ts\" \"test/**/*.ts\" \"samples-dev/**/*.ts\" \"*.{js,json}\"", "clean": "dev-tool run vendored rimraf --glob dist dist-browser dist-esm test-dist temp types *.tgz *.log", "execute:samples": "dev-tool samples run samples-dev", @@ -63,53 +60,40 @@ "test:browser": "npm run clean && npm run build:test && npm run unit-test:browser", "test:node": "npm run clean && npm run build:test && npm run unit-test:node", "unit-test": "npm run unit-test:node && npm run unit-test:browser", - "unit-test:browser": "dev-tool run test:browser", - "unit-test:node": "dev-tool run test:node-ts-input -- --timeout 1200000 --exclude 'test/**/browser/*.spec.ts' 'test/**/*.spec.ts'", + "unit-test:browser": "npm run clean && dev-tool run build-package && dev-tool run build-test && dev-tool run test:vitest --browser", + "unit-test:node": "dev-tool run test:vitest", "update-snippets": "echo skipped" }, "sideEffects": false, "autoPublish": false, "dependencies": { "@azure-rest/core-client": "^1.0.0", + "@azure/abort-controller": "^2.1.2", "@azure/core-auth": "^1.3.0", - "@azure/core-lro": "^2.2.0", + "@azure/core-lro": "^3.1.0", "@azure/core-paging": "^1.2.0", "@azure/core-rest-pipeline": "^1.8.0", "@azure/logger": "^1.0.0", "tslib": "^2.2.0" }, "devDependencies": { - "@azure-tools/test-credential": "^1.0.0", - "@azure-tools/test-recorder": "^3.0.0", + "@azure-tools/test-credential": "^2.0.0", + "@azure-tools/test-recorder": "^4.1.0", + "@azure-tools/test-utils-vitest": "^1.0.0", "@azure/dev-tool": "^1.0.0", "@azure/eslint-plugin-azure-sdk": "^3.0.0", "@azure/identity": "^4.0.1", - "@types/chai": "^4.2.8", - "@types/mocha": "^10.0.0", "@types/node": "^18.0.0", + "@vitest/browser": "^2.1.8", + "@vitest/coverage-istanbul": "^2.1.8", "autorest": "latest", - "chai": "^4.2.0", "dotenv": "^16.0.0", "eslint": "^9.9.0", - "karma": "^6.2.0", - "karma-chrome-launcher": "^3.0.0", - "karma-coverage": "^2.0.0", - "karma-env-preprocessor": "^0.1.1", - "karma-firefox-launcher": "^2.1.3", - "karma-junit-reporter": "^2.0.1", - "karma-mocha": "^2.0.1", - "karma-mocha-reporter": "^2.2.5", - "karma-source-map-support": "~1.4.0", - "karma-sourcemap-loader": "^0.3.8", - "mocha": "^11.0.2", - "nyc": "^17.0.0", - "source-map-support": "^0.5.9", - "ts-node": "^10.0.0", - "typescript": "~5.7.2" - }, - "browser": { - "./dist-esm/test/public/utils/env.js": "./dist-esm/test/public/utils/env.browser.js" + "playwright": "^1.49.1", + "typescript": "~5.7.2", + "vitest": "^2.1.8" }, + "browser": "./dist/browser/index.js", "//sampleConfiguration": { "productName": "", "productSlugs": [ @@ -117,5 +101,23 @@ ], "disableDocsMs": true, "apiRefLink": "https://docs.microsoft.com/javascript/api/@azure-rest/arm-servicefabric?view=azure-node-preview" - } + }, + "type": "module", + "tshy": { + "project": "./tsconfig.src.json", + "exports": { + "./package.json": "./package.json", + ".": "./src/index.ts" + }, + "dialects": [ + "esm", + "commonjs" + ], + "esmDialects": [ + "browser", + "react-native" + ], + "selfLink": false + }, + "react-native": "./dist/react-native/index.js" } diff --git a/sdk/servicefabric/arm-servicefabric-rest/src/clientDefinitions.ts b/sdk/servicefabric/arm-servicefabric-rest/src/clientDefinitions.ts index 7fe1a6cbd3d2..be389adb17bd 100644 --- a/sdk/servicefabric/arm-servicefabric-rest/src/clientDefinitions.ts +++ b/sdk/servicefabric/arm-servicefabric-rest/src/clientDefinitions.ts @@ -1,133 +1,137 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -import type { - ApplicationTypeVersionsCreateOrUpdateParameters, - ApplicationTypeVersionsDeleteParameters, - ApplicationTypeVersionsGetParameters, - ApplicationTypeVersionsListParameters, - ApplicationTypesCreateOrUpdateParameters, - ApplicationTypesDeleteParameters, - ApplicationTypesGetParameters, - ApplicationTypesListParameters, - ApplicationsCreateOrUpdateParameters, - ApplicationsDeleteParameters, - ApplicationsGetParameters, - ApplicationsListParameters, - ApplicationsUpdateParameters, - ClusterVersionsGetByEnvironmentParameters, - ClusterVersionsGetParameters, - ClusterVersionsListByEnvironmentParameters, - ClusterVersionsListParameters, +import { + ClustersGetParameters, ClustersCreateOrUpdateParameters, + ClustersUpdateParameters, ClustersDeleteParameters, - ClustersGetParameters, ClustersListByResourceGroupParameters, ClustersListParameters, ClustersListUpgradableVersionsParameters, - ClustersUpdateParameters, + ClusterVersionsGetParameters, + ClusterVersionsGetByEnvironmentParameters, + ClusterVersionsListParameters, + ClusterVersionsListByEnvironmentParameters, OperationsListParameters, + ApplicationTypesGetParameters, + ApplicationTypesCreateOrUpdateParameters, + ApplicationTypesDeleteParameters, + ApplicationTypesListParameters, + ApplicationTypeVersionsGetParameters, + ApplicationTypeVersionsCreateOrUpdateParameters, + ApplicationTypeVersionsDeleteParameters, + ApplicationTypeVersionsListParameters, + ApplicationsGetParameters, + ApplicationsCreateOrUpdateParameters, + ApplicationsUpdateParameters, + ApplicationsDeleteParameters, + ApplicationsListParameters, + ServicesGetParameters, ServicesCreateOrUpdateParameters, + ServicesUpdateParameters, ServicesDeleteParameters, - ServicesGetParameters, ServicesListParameters, - ServicesUpdateParameters, } from "./parameters"; -import type { - ApplicationTypeVersionsCreateOrUpdate202Response, - ApplicationTypeVersionsCreateOrUpdatedefaultResponse, - ApplicationTypeVersionsDelete202Response, - ApplicationTypeVersionsDelete204Response, - ApplicationTypeVersionsDeletedefaultResponse, - ApplicationTypeVersionsGet200Response, - ApplicationTypeVersionsGetdefaultResponse, - ApplicationTypeVersionsList200Response, - ApplicationTypeVersionsListdefaultResponse, +import { + ClustersGet200Response, + ClustersGetDefaultResponse, + ClustersCreateOrUpdate200Response, + ClustersCreateOrUpdate202Response, + ClustersCreateOrUpdateDefaultResponse, + ClustersUpdate200Response, + ClustersUpdate202Response, + ClustersUpdateDefaultResponse, + ClustersDelete200Response, + ClustersDelete204Response, + ClustersDeleteDefaultResponse, + ClustersListByResourceGroup200Response, + ClustersListByResourceGroupDefaultResponse, + ClustersList200Response, + ClustersListDefaultResponse, + ClustersListUpgradableVersions200Response, + ClustersListUpgradableVersionsDefaultResponse, + ClusterVersionsGet200Response, + ClusterVersionsGetDefaultResponse, + ClusterVersionsGetByEnvironment200Response, + ClusterVersionsGetByEnvironmentDefaultResponse, + ClusterVersionsList200Response, + ClusterVersionsListDefaultResponse, + ClusterVersionsListByEnvironment200Response, + ClusterVersionsListByEnvironmentDefaultResponse, + OperationsList200Response, + OperationsListDefaultResponse, + ApplicationTypesGet200Response, + ApplicationTypesGetDefaultResponse, ApplicationTypesCreateOrUpdate200Response, - ApplicationTypesCreateOrUpdatedefaultResponse, + ApplicationTypesCreateOrUpdateDefaultResponse, ApplicationTypesDelete202Response, ApplicationTypesDelete204Response, - ApplicationTypesDeletedefaultResponse, - ApplicationTypesGet200Response, - ApplicationTypesGetdefaultResponse, + ApplicationTypesDeleteDefaultResponse, ApplicationTypesList200Response, - ApplicationTypesListdefaultResponse, + ApplicationTypesListDefaultResponse, + ApplicationTypeVersionsGet200Response, + ApplicationTypeVersionsGetDefaultResponse, + ApplicationTypeVersionsCreateOrUpdate202Response, + ApplicationTypeVersionsCreateOrUpdateDefaultResponse, + ApplicationTypeVersionsDelete202Response, + ApplicationTypeVersionsDelete204Response, + ApplicationTypeVersionsDeleteDefaultResponse, + ApplicationTypeVersionsList200Response, + ApplicationTypeVersionsListDefaultResponse, + ApplicationsGet200Response, + ApplicationsGetDefaultResponse, ApplicationsCreateOrUpdate202Response, - ApplicationsCreateOrUpdatedefaultResponse, + ApplicationsCreateOrUpdateDefaultResponse, + ApplicationsUpdate202Response, + ApplicationsUpdateDefaultResponse, ApplicationsDelete202Response, ApplicationsDelete204Response, - ApplicationsDeletedefaultResponse, - ApplicationsGet200Response, - ApplicationsGetdefaultResponse, + ApplicationsDeleteDefaultResponse, ApplicationsList200Response, - ApplicationsListdefaultResponse, - ApplicationsUpdate202Response, - ApplicationsUpdatedefaultResponse, - ClusterVersionsGet200Response, - ClusterVersionsGetByEnvironment200Response, - ClusterVersionsGetByEnvironmentdefaultResponse, - ClusterVersionsGetdefaultResponse, - ClusterVersionsList200Response, - ClusterVersionsListByEnvironment200Response, - ClusterVersionsListByEnvironmentdefaultResponse, - ClusterVersionsListdefaultResponse, - ClustersCreateOrUpdate200Response, - ClustersCreateOrUpdate202Response, - ClustersCreateOrUpdatedefaultResponse, - ClustersDelete200Response, - ClustersDelete204Response, - ClustersDeletedefaultResponse, - ClustersGet200Response, - ClustersGetdefaultResponse, - ClustersList200Response, - ClustersListByResourceGroup200Response, - ClustersListByResourceGroupdefaultResponse, - ClustersListUpgradableVersions200Response, - ClustersListUpgradableVersionsdefaultResponse, - ClustersListdefaultResponse, - ClustersUpdate200Response, - ClustersUpdate202Response, - ClustersUpdatedefaultResponse, - OperationsList200Response, - OperationsListdefaultResponse, + ApplicationsListDefaultResponse, + ServicesGet200Response, + ServicesGetDefaultResponse, ServicesCreateOrUpdate202Response, - ServicesCreateOrUpdatedefaultResponse, + ServicesCreateOrUpdateDefaultResponse, + ServicesUpdate202Response, + ServicesUpdateDefaultResponse, ServicesDelete202Response, ServicesDelete204Response, - ServicesDeletedefaultResponse, - ServicesGet200Response, - ServicesGetdefaultResponse, + ServicesDeleteDefaultResponse, ServicesList200Response, - ServicesListdefaultResponse, - ServicesUpdate202Response, - ServicesUpdatedefaultResponse, + ServicesListDefaultResponse, } from "./responses"; -import type { Client, StreamableMethod } from "@azure-rest/core-client"; +import { Client, StreamableMethod } from "@azure-rest/core-client"; export interface ClustersGet { /** Get a Service Fabric cluster resource created or in the process of being created in the specified resource group. */ get( options?: ClustersGetParameters, - ): StreamableMethod; + ): StreamableMethod; /** Create or update a Service Fabric cluster resource with the specified name. */ put( options: ClustersCreateOrUpdateParameters, ): StreamableMethod< | ClustersCreateOrUpdate200Response | ClustersCreateOrUpdate202Response - | ClustersCreateOrUpdatedefaultResponse + | ClustersCreateOrUpdateDefaultResponse >; /** Update the configuration of a Service Fabric cluster resource with the specified name. */ patch( options: ClustersUpdateParameters, ): StreamableMethod< - ClustersUpdate200Response | ClustersUpdate202Response | ClustersUpdatedefaultResponse + | ClustersUpdate200Response + | ClustersUpdate202Response + | ClustersUpdateDefaultResponse >; /** Delete a Service Fabric cluster resource with the specified name. */ delete( options?: ClustersDeleteParameters, ): StreamableMethod< - ClustersDelete200Response | ClustersDelete204Response | ClustersDeletedefaultResponse + | ClustersDelete200Response + | ClustersDelete204Response + | ClustersDeleteDefaultResponse >; } @@ -136,7 +140,8 @@ export interface ClustersListByResourceGroup { get( options?: ClustersListByResourceGroupParameters, ): StreamableMethod< - ClustersListByResourceGroup200Response | ClustersListByResourceGroupdefaultResponse + | ClustersListByResourceGroup200Response + | ClustersListByResourceGroupDefaultResponse >; } @@ -144,7 +149,7 @@ export interface ClustersList { /** Gets all Service Fabric cluster resources created or in the process of being created in the subscription. */ get( options?: ClustersListParameters, - ): StreamableMethod; + ): StreamableMethod; } export interface ClustersListUpgradableVersions { @@ -152,7 +157,8 @@ export interface ClustersListUpgradableVersions { post( options?: ClustersListUpgradableVersionsParameters, ): StreamableMethod< - ClustersListUpgradableVersions200Response | ClustersListUpgradableVersionsdefaultResponse + | ClustersListUpgradableVersions200Response + | ClustersListUpgradableVersionsDefaultResponse >; } @@ -160,7 +166,9 @@ export interface ClusterVersionsGet { /** Gets information about an available Service Fabric cluster code version. */ get( options?: ClusterVersionsGetParameters, - ): StreamableMethod; + ): StreamableMethod< + ClusterVersionsGet200Response | ClusterVersionsGetDefaultResponse + >; } export interface ClusterVersionsGetByEnvironment { @@ -168,7 +176,8 @@ export interface ClusterVersionsGetByEnvironment { get( options?: ClusterVersionsGetByEnvironmentParameters, ): StreamableMethod< - ClusterVersionsGetByEnvironment200Response | ClusterVersionsGetByEnvironmentdefaultResponse + | ClusterVersionsGetByEnvironment200Response + | ClusterVersionsGetByEnvironmentDefaultResponse >; } @@ -176,7 +185,9 @@ export interface ClusterVersionsList { /** Gets all available code versions for Service Fabric cluster resources by location. */ get( options?: ClusterVersionsListParameters, - ): StreamableMethod; + ): StreamableMethod< + ClusterVersionsList200Response | ClusterVersionsListDefaultResponse + >; } export interface ClusterVersionsListByEnvironment { @@ -184,7 +195,8 @@ export interface ClusterVersionsListByEnvironment { get( options?: ClusterVersionsListByEnvironmentParameters, ): StreamableMethod< - ClusterVersionsListByEnvironment200Response | ClusterVersionsListByEnvironmentdefaultResponse + | ClusterVersionsListByEnvironment200Response + | ClusterVersionsListByEnvironmentDefaultResponse >; } @@ -192,19 +204,24 @@ export interface OperationsList { /** Get the list of available Service Fabric resource provider API operations. */ get( options?: OperationsListParameters, - ): StreamableMethod; + ): StreamableMethod< + OperationsList200Response | OperationsListDefaultResponse + >; } export interface ApplicationTypesGet { /** Get a Service Fabric application type name resource created or in the process of being created in the Service Fabric cluster resource. */ get( options?: ApplicationTypesGetParameters, - ): StreamableMethod; + ): StreamableMethod< + ApplicationTypesGet200Response | ApplicationTypesGetDefaultResponse + >; /** Create or update a Service Fabric application type name resource with the specified name. */ put( options: ApplicationTypesCreateOrUpdateParameters, ): StreamableMethod< - ApplicationTypesCreateOrUpdate200Response | ApplicationTypesCreateOrUpdatedefaultResponse + | ApplicationTypesCreateOrUpdate200Response + | ApplicationTypesCreateOrUpdateDefaultResponse >; /** Delete a Service Fabric application type name resource with the specified name. */ delete( @@ -212,7 +229,7 @@ export interface ApplicationTypesGet { ): StreamableMethod< | ApplicationTypesDelete202Response | ApplicationTypesDelete204Response - | ApplicationTypesDeletedefaultResponse + | ApplicationTypesDeleteDefaultResponse >; } @@ -220,7 +237,9 @@ export interface ApplicationTypesList { /** Gets all application type name resources created or in the process of being created in the Service Fabric cluster resource. */ get( options?: ApplicationTypesListParameters, - ): StreamableMethod; + ): StreamableMethod< + ApplicationTypesList200Response | ApplicationTypesListDefaultResponse + >; } export interface ApplicationTypeVersionsGet { @@ -228,14 +247,15 @@ export interface ApplicationTypeVersionsGet { get( options?: ApplicationTypeVersionsGetParameters, ): StreamableMethod< - ApplicationTypeVersionsGet200Response | ApplicationTypeVersionsGetdefaultResponse + | ApplicationTypeVersionsGet200Response + | ApplicationTypeVersionsGetDefaultResponse >; /** Create or update a Service Fabric application type version resource with the specified name. */ put( options: ApplicationTypeVersionsCreateOrUpdateParameters, ): StreamableMethod< | ApplicationTypeVersionsCreateOrUpdate202Response - | ApplicationTypeVersionsCreateOrUpdatedefaultResponse + | ApplicationTypeVersionsCreateOrUpdateDefaultResponse >; /** Delete a Service Fabric application type version resource with the specified name. */ delete( @@ -243,7 +263,7 @@ export interface ApplicationTypeVersionsGet { ): StreamableMethod< | ApplicationTypeVersionsDelete202Response | ApplicationTypeVersionsDelete204Response - | ApplicationTypeVersionsDeletedefaultResponse + | ApplicationTypeVersionsDeleteDefaultResponse >; } @@ -252,7 +272,8 @@ export interface ApplicationTypeVersionsList { get( options?: ApplicationTypeVersionsListParameters, ): StreamableMethod< - ApplicationTypeVersionsList200Response | ApplicationTypeVersionsListdefaultResponse + | ApplicationTypeVersionsList200Response + | ApplicationTypeVersionsListDefaultResponse >; } @@ -260,24 +281,29 @@ export interface ApplicationsGet { /** Get a Service Fabric application resource created or in the process of being created in the Service Fabric cluster resource. */ get( options?: ApplicationsGetParameters, - ): StreamableMethod; + ): StreamableMethod< + ApplicationsGet200Response | ApplicationsGetDefaultResponse + >; /** Create or update a Service Fabric application resource with the specified name. */ put( options: ApplicationsCreateOrUpdateParameters, ): StreamableMethod< - ApplicationsCreateOrUpdate202Response | ApplicationsCreateOrUpdatedefaultResponse + | ApplicationsCreateOrUpdate202Response + | ApplicationsCreateOrUpdateDefaultResponse >; /** Update a Service Fabric application resource with the specified name. */ patch( options: ApplicationsUpdateParameters, - ): StreamableMethod; + ): StreamableMethod< + ApplicationsUpdate202Response | ApplicationsUpdateDefaultResponse + >; /** Delete a Service Fabric application resource with the specified name. */ delete( options?: ApplicationsDeleteParameters, ): StreamableMethod< | ApplicationsDelete202Response | ApplicationsDelete204Response - | ApplicationsDeletedefaultResponse + | ApplicationsDeleteDefaultResponse >; } @@ -285,27 +311,35 @@ export interface ApplicationsList { /** Gets all application resources created or in the process of being created in the Service Fabric cluster resource. */ get( options?: ApplicationsListParameters, - ): StreamableMethod; + ): StreamableMethod< + ApplicationsList200Response | ApplicationsListDefaultResponse + >; } export interface ServicesGet { /** Get a Service Fabric service resource created or in the process of being created in the Service Fabric application resource. */ get( options?: ServicesGetParameters, - ): StreamableMethod; + ): StreamableMethod; /** Create or update a Service Fabric service resource with the specified name. */ put( options: ServicesCreateOrUpdateParameters, - ): StreamableMethod; + ): StreamableMethod< + ServicesCreateOrUpdate202Response | ServicesCreateOrUpdateDefaultResponse + >; /** Update a Service Fabric service resource with the specified name. */ patch( options: ServicesUpdateParameters, - ): StreamableMethod; + ): StreamableMethod< + ServicesUpdate202Response | ServicesUpdateDefaultResponse + >; /** Delete a Service Fabric service resource with the specified name. */ delete( options?: ServicesDeleteParameters, ): StreamableMethod< - ServicesDelete202Response | ServicesDelete204Response | ServicesDeletedefaultResponse + | ServicesDelete202Response + | ServicesDelete204Response + | ServicesDeleteDefaultResponse >; } @@ -313,7 +347,7 @@ export interface ServicesList { /** Gets all service resources created or in the process of being created in the Service Fabric application resource. */ get( options?: ServicesListParameters, - ): StreamableMethod; + ): StreamableMethod; } export interface Routes { diff --git a/sdk/servicefabric/arm-servicefabric-rest/src/isUnexpected.ts b/sdk/servicefabric/arm-servicefabric-rest/src/isUnexpected.ts index fc2e61352ded..081372049bc0 100644 --- a/sdk/servicefabric/arm-servicefabric-rest/src/isUnexpected.ts +++ b/sdk/servicefabric/arm-servicefabric-rest/src/isUnexpected.ts @@ -1,74 +1,74 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -import type { - ApplicationTypeVersionsCreateOrUpdate202Response, - ApplicationTypeVersionsCreateOrUpdatedefaultResponse, - ApplicationTypeVersionsDelete202Response, - ApplicationTypeVersionsDelete204Response, - ApplicationTypeVersionsDeletedefaultResponse, - ApplicationTypeVersionsGet200Response, - ApplicationTypeVersionsGetdefaultResponse, - ApplicationTypeVersionsList200Response, - ApplicationTypeVersionsListdefaultResponse, +import { + ClustersGet200Response, + ClustersGetDefaultResponse, + ClustersCreateOrUpdate200Response, + ClustersCreateOrUpdate202Response, + ClustersCreateOrUpdateDefaultResponse, + ClustersUpdate200Response, + ClustersUpdate202Response, + ClustersUpdateDefaultResponse, + ClustersDelete200Response, + ClustersDelete204Response, + ClustersDeleteDefaultResponse, + ClustersListByResourceGroup200Response, + ClustersListByResourceGroupDefaultResponse, + ClustersList200Response, + ClustersListDefaultResponse, + ClustersListUpgradableVersions200Response, + ClustersListUpgradableVersionsDefaultResponse, + ClusterVersionsGet200Response, + ClusterVersionsGetDefaultResponse, + ClusterVersionsGetByEnvironment200Response, + ClusterVersionsGetByEnvironmentDefaultResponse, + ClusterVersionsList200Response, + ClusterVersionsListDefaultResponse, + ClusterVersionsListByEnvironment200Response, + ClusterVersionsListByEnvironmentDefaultResponse, + OperationsList200Response, + OperationsListDefaultResponse, + ApplicationTypesGet200Response, + ApplicationTypesGetDefaultResponse, ApplicationTypesCreateOrUpdate200Response, - ApplicationTypesCreateOrUpdatedefaultResponse, + ApplicationTypesCreateOrUpdateDefaultResponse, ApplicationTypesDelete202Response, ApplicationTypesDelete204Response, - ApplicationTypesDeletedefaultResponse, - ApplicationTypesGet200Response, - ApplicationTypesGetdefaultResponse, + ApplicationTypesDeleteDefaultResponse, ApplicationTypesList200Response, - ApplicationTypesListdefaultResponse, + ApplicationTypesListDefaultResponse, + ApplicationTypeVersionsGet200Response, + ApplicationTypeVersionsGetDefaultResponse, + ApplicationTypeVersionsCreateOrUpdate202Response, + ApplicationTypeVersionsCreateOrUpdateDefaultResponse, + ApplicationTypeVersionsDelete202Response, + ApplicationTypeVersionsDelete204Response, + ApplicationTypeVersionsDeleteDefaultResponse, + ApplicationTypeVersionsList200Response, + ApplicationTypeVersionsListDefaultResponse, + ApplicationsGet200Response, + ApplicationsGetDefaultResponse, ApplicationsCreateOrUpdate202Response, - ApplicationsCreateOrUpdatedefaultResponse, + ApplicationsCreateOrUpdateDefaultResponse, + ApplicationsUpdate202Response, + ApplicationsUpdateDefaultResponse, ApplicationsDelete202Response, ApplicationsDelete204Response, - ApplicationsDeletedefaultResponse, - ApplicationsGet200Response, - ApplicationsGetdefaultResponse, + ApplicationsDeleteDefaultResponse, ApplicationsList200Response, - ApplicationsListdefaultResponse, - ApplicationsUpdate202Response, - ApplicationsUpdatedefaultResponse, - ClusterVersionsGet200Response, - ClusterVersionsGetByEnvironment200Response, - ClusterVersionsGetByEnvironmentdefaultResponse, - ClusterVersionsGetdefaultResponse, - ClusterVersionsList200Response, - ClusterVersionsListByEnvironment200Response, - ClusterVersionsListByEnvironmentdefaultResponse, - ClusterVersionsListdefaultResponse, - ClustersCreateOrUpdate200Response, - ClustersCreateOrUpdate202Response, - ClustersCreateOrUpdatedefaultResponse, - ClustersDelete200Response, - ClustersDelete204Response, - ClustersDeletedefaultResponse, - ClustersGet200Response, - ClustersGetdefaultResponse, - ClustersList200Response, - ClustersListByResourceGroup200Response, - ClustersListByResourceGroupdefaultResponse, - ClustersListUpgradableVersions200Response, - ClustersListUpgradableVersionsdefaultResponse, - ClustersListdefaultResponse, - ClustersUpdate200Response, - ClustersUpdate202Response, - ClustersUpdatedefaultResponse, - OperationsList200Response, - OperationsListdefaultResponse, + ApplicationsListDefaultResponse, + ServicesGet200Response, + ServicesGetDefaultResponse, ServicesCreateOrUpdate202Response, - ServicesCreateOrUpdatedefaultResponse, + ServicesCreateOrUpdateDefaultResponse, + ServicesUpdate202Response, + ServicesUpdateDefaultResponse, ServicesDelete202Response, ServicesDelete204Response, - ServicesDeletedefaultResponse, - ServicesGet200Response, - ServicesGetdefaultResponse, + ServicesDeleteDefaultResponse, ServicesList200Response, - ServicesListdefaultResponse, - ServicesUpdate202Response, - ServicesUpdatedefaultResponse, + ServicesListDefaultResponse, } from "./responses"; const responseMap: Record = { @@ -82,7 +82,8 @@ const responseMap: Record = { ["200", "204"], "GET /subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters": ["200"], - "GET /subscriptions/{subscriptionId}/providers/Microsoft.ServiceFabric/clusters": ["200"], + "GET /subscriptions/{subscriptionId}/providers/Microsoft.ServiceFabric/clusters": + ["200"], "POST /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/listUpgradableVersions": ["200"], "GET /subscriptions/{subscriptionId}/providers/Microsoft.ServiceFabric/locations/{location}/clusterVersions/{clusterVersion}": @@ -133,275 +134,314 @@ const responseMap: Record = { }; export function isUnexpected( - response: ClustersGet200Response | ClustersGetdefaultResponse, -): response is ClustersGetdefaultResponse; + response: ClustersGet200Response | ClustersGetDefaultResponse, +): response is ClustersGetDefaultResponse; export function isUnexpected( response: | ClustersCreateOrUpdate200Response | ClustersCreateOrUpdate202Response - | ClustersCreateOrUpdatedefaultResponse, -): response is ClustersCreateOrUpdatedefaultResponse; + | ClustersCreateOrUpdateDefaultResponse, +): response is ClustersCreateOrUpdateDefaultResponse; export function isUnexpected( - response: ClustersUpdate200Response | ClustersUpdate202Response | ClustersUpdatedefaultResponse, -): response is ClustersUpdatedefaultResponse; + response: + | ClustersUpdate200Response + | ClustersUpdate202Response + | ClustersUpdateDefaultResponse, +): response is ClustersUpdateDefaultResponse; export function isUnexpected( - response: ClustersDelete200Response | ClustersDelete204Response | ClustersDeletedefaultResponse, -): response is ClustersDeletedefaultResponse; + response: + | ClustersDelete200Response + | ClustersDelete204Response + | ClustersDeleteDefaultResponse, +): response is ClustersDeleteDefaultResponse; export function isUnexpected( - response: ClustersListByResourceGroup200Response | ClustersListByResourceGroupdefaultResponse, -): response is ClustersListByResourceGroupdefaultResponse; + response: + | ClustersListByResourceGroup200Response + | ClustersListByResourceGroupDefaultResponse, +): response is ClustersListByResourceGroupDefaultResponse; export function isUnexpected( - response: ClustersList200Response | ClustersListdefaultResponse, -): response is ClustersListdefaultResponse; + response: ClustersList200Response | ClustersListDefaultResponse, +): response is ClustersListDefaultResponse; export function isUnexpected( response: | ClustersListUpgradableVersions200Response - | ClustersListUpgradableVersionsdefaultResponse, -): response is ClustersListUpgradableVersionsdefaultResponse; + | ClustersListUpgradableVersionsDefaultResponse, +): response is ClustersListUpgradableVersionsDefaultResponse; export function isUnexpected( - response: ClusterVersionsGet200Response | ClusterVersionsGetdefaultResponse, -): response is ClusterVersionsGetdefaultResponse; + response: ClusterVersionsGet200Response | ClusterVersionsGetDefaultResponse, +): response is ClusterVersionsGetDefaultResponse; export function isUnexpected( response: | ClusterVersionsGetByEnvironment200Response - | ClusterVersionsGetByEnvironmentdefaultResponse, -): response is ClusterVersionsGetByEnvironmentdefaultResponse; + | ClusterVersionsGetByEnvironmentDefaultResponse, +): response is ClusterVersionsGetByEnvironmentDefaultResponse; export function isUnexpected( - response: ClusterVersionsList200Response | ClusterVersionsListdefaultResponse, -): response is ClusterVersionsListdefaultResponse; + response: ClusterVersionsList200Response | ClusterVersionsListDefaultResponse, +): response is ClusterVersionsListDefaultResponse; export function isUnexpected( response: | ClusterVersionsListByEnvironment200Response - | ClusterVersionsListByEnvironmentdefaultResponse, -): response is ClusterVersionsListByEnvironmentdefaultResponse; + | ClusterVersionsListByEnvironmentDefaultResponse, +): response is ClusterVersionsListByEnvironmentDefaultResponse; export function isUnexpected( - response: OperationsList200Response | OperationsListdefaultResponse, -): response is OperationsListdefaultResponse; + response: OperationsList200Response | OperationsListDefaultResponse, +): response is OperationsListDefaultResponse; export function isUnexpected( - response: ApplicationTypesGet200Response | ApplicationTypesGetdefaultResponse, -): response is ApplicationTypesGetdefaultResponse; + response: ApplicationTypesGet200Response | ApplicationTypesGetDefaultResponse, +): response is ApplicationTypesGetDefaultResponse; export function isUnexpected( response: | ApplicationTypesCreateOrUpdate200Response - | ApplicationTypesCreateOrUpdatedefaultResponse, -): response is ApplicationTypesCreateOrUpdatedefaultResponse; + | ApplicationTypesCreateOrUpdateDefaultResponse, +): response is ApplicationTypesCreateOrUpdateDefaultResponse; export function isUnexpected( response: | ApplicationTypesDelete202Response | ApplicationTypesDelete204Response - | ApplicationTypesDeletedefaultResponse, -): response is ApplicationTypesDeletedefaultResponse; + | ApplicationTypesDeleteDefaultResponse, +): response is ApplicationTypesDeleteDefaultResponse; export function isUnexpected( - response: ApplicationTypesList200Response | ApplicationTypesListdefaultResponse, -): response is ApplicationTypesListdefaultResponse; + response: + | ApplicationTypesList200Response + | ApplicationTypesListDefaultResponse, +): response is ApplicationTypesListDefaultResponse; export function isUnexpected( - response: ApplicationTypeVersionsGet200Response | ApplicationTypeVersionsGetdefaultResponse, -): response is ApplicationTypeVersionsGetdefaultResponse; + response: + | ApplicationTypeVersionsGet200Response + | ApplicationTypeVersionsGetDefaultResponse, +): response is ApplicationTypeVersionsGetDefaultResponse; export function isUnexpected( response: | ApplicationTypeVersionsCreateOrUpdate202Response - | ApplicationTypeVersionsCreateOrUpdatedefaultResponse, -): response is ApplicationTypeVersionsCreateOrUpdatedefaultResponse; + | ApplicationTypeVersionsCreateOrUpdateDefaultResponse, +): response is ApplicationTypeVersionsCreateOrUpdateDefaultResponse; export function isUnexpected( response: | ApplicationTypeVersionsDelete202Response | ApplicationTypeVersionsDelete204Response - | ApplicationTypeVersionsDeletedefaultResponse, -): response is ApplicationTypeVersionsDeletedefaultResponse; + | ApplicationTypeVersionsDeleteDefaultResponse, +): response is ApplicationTypeVersionsDeleteDefaultResponse; export function isUnexpected( - response: ApplicationTypeVersionsList200Response | ApplicationTypeVersionsListdefaultResponse, -): response is ApplicationTypeVersionsListdefaultResponse; + response: + | ApplicationTypeVersionsList200Response + | ApplicationTypeVersionsListDefaultResponse, +): response is ApplicationTypeVersionsListDefaultResponse; export function isUnexpected( - response: ApplicationsGet200Response | ApplicationsGetdefaultResponse, -): response is ApplicationsGetdefaultResponse; + response: ApplicationsGet200Response | ApplicationsGetDefaultResponse, +): response is ApplicationsGetDefaultResponse; export function isUnexpected( - response: ApplicationsCreateOrUpdate202Response | ApplicationsCreateOrUpdatedefaultResponse, -): response is ApplicationsCreateOrUpdatedefaultResponse; + response: + | ApplicationsCreateOrUpdate202Response + | ApplicationsCreateOrUpdateDefaultResponse, +): response is ApplicationsCreateOrUpdateDefaultResponse; export function isUnexpected( - response: ApplicationsUpdate202Response | ApplicationsUpdatedefaultResponse, -): response is ApplicationsUpdatedefaultResponse; + response: ApplicationsUpdate202Response | ApplicationsUpdateDefaultResponse, +): response is ApplicationsUpdateDefaultResponse; export function isUnexpected( response: | ApplicationsDelete202Response | ApplicationsDelete204Response - | ApplicationsDeletedefaultResponse, -): response is ApplicationsDeletedefaultResponse; + | ApplicationsDeleteDefaultResponse, +): response is ApplicationsDeleteDefaultResponse; export function isUnexpected( - response: ApplicationsList200Response | ApplicationsListdefaultResponse, -): response is ApplicationsListdefaultResponse; + response: ApplicationsList200Response | ApplicationsListDefaultResponse, +): response is ApplicationsListDefaultResponse; export function isUnexpected( - response: ServicesGet200Response | ServicesGetdefaultResponse, -): response is ServicesGetdefaultResponse; + response: ServicesGet200Response | ServicesGetDefaultResponse, +): response is ServicesGetDefaultResponse; export function isUnexpected( - response: ServicesCreateOrUpdate202Response | ServicesCreateOrUpdatedefaultResponse, -): response is ServicesCreateOrUpdatedefaultResponse; + response: + | ServicesCreateOrUpdate202Response + | ServicesCreateOrUpdateDefaultResponse, +): response is ServicesCreateOrUpdateDefaultResponse; export function isUnexpected( - response: ServicesUpdate202Response | ServicesUpdatedefaultResponse, -): response is ServicesUpdatedefaultResponse; + response: ServicesUpdate202Response | ServicesUpdateDefaultResponse, +): response is ServicesUpdateDefaultResponse; export function isUnexpected( - response: ServicesDelete202Response | ServicesDelete204Response | ServicesDeletedefaultResponse, -): response is ServicesDeletedefaultResponse; + response: + | ServicesDelete202Response + | ServicesDelete204Response + | ServicesDeleteDefaultResponse, +): response is ServicesDeleteDefaultResponse; export function isUnexpected( - response: ServicesList200Response | ServicesListdefaultResponse, -): response is ServicesListdefaultResponse; + response: ServicesList200Response | ServicesListDefaultResponse, +): response is ServicesListDefaultResponse; export function isUnexpected( response: | ClustersGet200Response - | ClustersGetdefaultResponse + | ClustersGetDefaultResponse | ClustersCreateOrUpdate200Response | ClustersCreateOrUpdate202Response - | ClustersCreateOrUpdatedefaultResponse + | ClustersCreateOrUpdateDefaultResponse | ClustersUpdate200Response | ClustersUpdate202Response - | ClustersUpdatedefaultResponse + | ClustersUpdateDefaultResponse | ClustersDelete200Response | ClustersDelete204Response - | ClustersDeletedefaultResponse + | ClustersDeleteDefaultResponse | ClustersListByResourceGroup200Response - | ClustersListByResourceGroupdefaultResponse + | ClustersListByResourceGroupDefaultResponse | ClustersList200Response - | ClustersListdefaultResponse + | ClustersListDefaultResponse | ClustersListUpgradableVersions200Response - | ClustersListUpgradableVersionsdefaultResponse + | ClustersListUpgradableVersionsDefaultResponse | ClusterVersionsGet200Response - | ClusterVersionsGetdefaultResponse + | ClusterVersionsGetDefaultResponse | ClusterVersionsGetByEnvironment200Response - | ClusterVersionsGetByEnvironmentdefaultResponse + | ClusterVersionsGetByEnvironmentDefaultResponse | ClusterVersionsList200Response - | ClusterVersionsListdefaultResponse + | ClusterVersionsListDefaultResponse | ClusterVersionsListByEnvironment200Response - | ClusterVersionsListByEnvironmentdefaultResponse + | ClusterVersionsListByEnvironmentDefaultResponse | OperationsList200Response - | OperationsListdefaultResponse + | OperationsListDefaultResponse | ApplicationTypesGet200Response - | ApplicationTypesGetdefaultResponse + | ApplicationTypesGetDefaultResponse | ApplicationTypesCreateOrUpdate200Response - | ApplicationTypesCreateOrUpdatedefaultResponse + | ApplicationTypesCreateOrUpdateDefaultResponse | ApplicationTypesDelete202Response | ApplicationTypesDelete204Response - | ApplicationTypesDeletedefaultResponse + | ApplicationTypesDeleteDefaultResponse | ApplicationTypesList200Response - | ApplicationTypesListdefaultResponse + | ApplicationTypesListDefaultResponse | ApplicationTypeVersionsGet200Response - | ApplicationTypeVersionsGetdefaultResponse + | ApplicationTypeVersionsGetDefaultResponse | ApplicationTypeVersionsCreateOrUpdate202Response - | ApplicationTypeVersionsCreateOrUpdatedefaultResponse + | ApplicationTypeVersionsCreateOrUpdateDefaultResponse | ApplicationTypeVersionsDelete202Response | ApplicationTypeVersionsDelete204Response - | ApplicationTypeVersionsDeletedefaultResponse + | ApplicationTypeVersionsDeleteDefaultResponse | ApplicationTypeVersionsList200Response - | ApplicationTypeVersionsListdefaultResponse + | ApplicationTypeVersionsListDefaultResponse | ApplicationsGet200Response - | ApplicationsGetdefaultResponse + | ApplicationsGetDefaultResponse | ApplicationsCreateOrUpdate202Response - | ApplicationsCreateOrUpdatedefaultResponse + | ApplicationsCreateOrUpdateDefaultResponse | ApplicationsUpdate202Response - | ApplicationsUpdatedefaultResponse + | ApplicationsUpdateDefaultResponse | ApplicationsDelete202Response | ApplicationsDelete204Response - | ApplicationsDeletedefaultResponse + | ApplicationsDeleteDefaultResponse | ApplicationsList200Response - | ApplicationsListdefaultResponse + | ApplicationsListDefaultResponse | ServicesGet200Response - | ServicesGetdefaultResponse + | ServicesGetDefaultResponse | ServicesCreateOrUpdate202Response - | ServicesCreateOrUpdatedefaultResponse + | ServicesCreateOrUpdateDefaultResponse | ServicesUpdate202Response - | ServicesUpdatedefaultResponse + | ServicesUpdateDefaultResponse | ServicesDelete202Response | ServicesDelete204Response - | ServicesDeletedefaultResponse + | ServicesDeleteDefaultResponse | ServicesList200Response - | ServicesListdefaultResponse, + | ServicesListDefaultResponse, ): response is - | ClustersGetdefaultResponse - | ClustersCreateOrUpdatedefaultResponse - | ClustersUpdatedefaultResponse - | ClustersDeletedefaultResponse - | ClustersListByResourceGroupdefaultResponse - | ClustersListdefaultResponse - | ClustersListUpgradableVersionsdefaultResponse - | ClusterVersionsGetdefaultResponse - | ClusterVersionsGetByEnvironmentdefaultResponse - | ClusterVersionsListdefaultResponse - | ClusterVersionsListByEnvironmentdefaultResponse - | OperationsListdefaultResponse - | ApplicationTypesGetdefaultResponse - | ApplicationTypesCreateOrUpdatedefaultResponse - | ApplicationTypesDeletedefaultResponse - | ApplicationTypesListdefaultResponse - | ApplicationTypeVersionsGetdefaultResponse - | ApplicationTypeVersionsCreateOrUpdatedefaultResponse - | ApplicationTypeVersionsDeletedefaultResponse - | ApplicationTypeVersionsListdefaultResponse - | ApplicationsGetdefaultResponse - | ApplicationsCreateOrUpdatedefaultResponse - | ApplicationsUpdatedefaultResponse - | ApplicationsDeletedefaultResponse - | ApplicationsListdefaultResponse - | ServicesGetdefaultResponse - | ServicesCreateOrUpdatedefaultResponse - | ServicesUpdatedefaultResponse - | ServicesDeletedefaultResponse - | ServicesListdefaultResponse { + | ClustersGetDefaultResponse + | ClustersCreateOrUpdateDefaultResponse + | ClustersUpdateDefaultResponse + | ClustersDeleteDefaultResponse + | ClustersListByResourceGroupDefaultResponse + | ClustersListDefaultResponse + | ClustersListUpgradableVersionsDefaultResponse + | ClusterVersionsGetDefaultResponse + | ClusterVersionsGetByEnvironmentDefaultResponse + | ClusterVersionsListDefaultResponse + | ClusterVersionsListByEnvironmentDefaultResponse + | OperationsListDefaultResponse + | ApplicationTypesGetDefaultResponse + | ApplicationTypesCreateOrUpdateDefaultResponse + | ApplicationTypesDeleteDefaultResponse + | ApplicationTypesListDefaultResponse + | ApplicationTypeVersionsGetDefaultResponse + | ApplicationTypeVersionsCreateOrUpdateDefaultResponse + | ApplicationTypeVersionsDeleteDefaultResponse + | ApplicationTypeVersionsListDefaultResponse + | ApplicationsGetDefaultResponse + | ApplicationsCreateOrUpdateDefaultResponse + | ApplicationsUpdateDefaultResponse + | ApplicationsDeleteDefaultResponse + | ApplicationsListDefaultResponse + | ServicesGetDefaultResponse + | ServicesCreateOrUpdateDefaultResponse + | ServicesUpdateDefaultResponse + | ServicesDeleteDefaultResponse + | ServicesListDefaultResponse { const lroOriginal = response.headers["x-ms-original-url"]; const url = new URL(lroOriginal ?? response.request.url); const method = response.request.method; let pathDetails = responseMap[`${method} ${url.pathname}`]; if (!pathDetails) { - pathDetails = geParametrizedPathSuccess(url.pathname); + pathDetails = getParametrizedPathSuccess(method, url.pathname); } return !pathDetails.includes(response.status); } -function geParametrizedPathSuccess(path: string): string[] { +function getParametrizedPathSuccess(method: string, path: string): string[] { 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: string[] = []; + // Iterate the responseMap to find a match for (const [key, value] of Object.entries(responseMap)) { // 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("/"); - // If the candidate and actual paths don't match in size - // we move on to the next candidate path - if (candidateParts.length === pathParts.length && hasParametrizedPath(key)) { - // track if we have found a match to return the values found. - let found = true; - for (let i = 0; i < candidateParts.length; i++) { - if (candidateParts[i].startsWith("{") && candidateParts[i].endsWith("}")) { - // If the current part of the candidate is a "template" part - // it is a match with the actual path part on hand - // skip as the parameterized part can match anything - continue; - } + // 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 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[i]) { + if (!isMatched) { found = false; break; } + continue; } - // We finished evaluating the current candidate parts - // if all parts matched we return the success values form - // the path mapping. - if (found) { - return value; + // 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; } } - } - // No match was found, return an empty array. - return []; -} + // 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; + } + } -function hasParametrizedPath(path: string): boolean { - return path.includes("/{"); + return matchedValue; } function getPathFromMapKey(mapKey: string): string { diff --git a/sdk/servicefabric/arm-servicefabric-rest/src/logger.ts b/sdk/servicefabric/arm-servicefabric-rest/src/logger.ts new file mode 100644 index 000000000000..e52c764d1228 --- /dev/null +++ b/sdk/servicefabric/arm-servicefabric-rest/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-servicefabric"); diff --git a/sdk/servicefabric/arm-servicefabric-rest/src/models.ts b/sdk/servicefabric/arm-servicefabric-rest/src/models.ts index 8f57b52fb81a..3d20175dcee2 100644 --- a/sdk/servicefabric/arm-servicefabric-rest/src/models.ts +++ b/sdk/servicefabric/arm-servicefabric-rest/src/models.ts @@ -1,18 +1,24 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. +/** + * The cluster resource + * + */ export interface Cluster extends Resource { /** The cluster resource properties */ properties?: ClusterProperties; } +/** Describes the cluster resource properties. */ export interface ClusterProperties { /** The list of add-on features to enable in the cluster. */ addOnFeatures?: Array< - "RepairManager" | "DnsService" | "BackupRestoreService" | "ResourceMonitorService" + | "RepairManager" + | "DnsService" + | "BackupRestoreService" + | "ResourceMonitorService" >; - /** The Service Fabric runtime versions available for this cluster. */ - availableClusterVersions?: Array; /** The AAD authentication settings of the cluster. */ azureActiveDirectory?: AzureActiveDirectory; /** The certificate to use for securing the cluster. The certificate provided will be used for node to node security within the cluster, SSL certificate for cluster management endpoint and default admin client. */ @@ -25,36 +31,6 @@ export interface ClusterProperties { clientCertificateThumbprints?: Array; /** The Service Fabric runtime version of the cluster. This property can only by set the user when **upgradeMode** is set to 'Manual'. To get list of available Service Fabric versions for new clusters use [ClusterVersion API](./ClusterVersion.md). To get the list of available version for existing clusters use **availableClusterVersions**. */ clusterCodeVersion?: string; - /** The Azure Resource Provider endpoint. A system service in the cluster connects to this endpoint. */ - clusterEndpoint?: string; - /** A service generated unique identifier for the cluster resource. */ - clusterId?: string; - /** - * The current state of the cluster. - * - * - WaitingForNodes - Indicates that the cluster resource is created and the resource provider is waiting for Service Fabric VM extension to boot up and report to it. - * - Deploying - Indicates that the Service Fabric runtime is being installed on the VMs. Cluster resource will be in this state until the cluster boots up and system services are up. - * - BaselineUpgrade - Indicates that the cluster is upgrading to establishes the cluster version. This upgrade is automatically initiated when the cluster boots up for the first time. - * - UpdatingUserConfiguration - Indicates that the cluster is being upgraded with the user provided configuration. - * - UpdatingUserCertificate - Indicates that the cluster is being upgraded with the user provided certificate. - * - UpdatingInfrastructure - Indicates that the cluster is being upgraded with the latest Service Fabric runtime version. This happens only when the **upgradeMode** is set to 'Automatic'. - * - EnforcingClusterVersion - Indicates that cluster is on a different version than expected and the cluster is being upgraded to the expected version. - * - UpgradeServiceUnreachable - Indicates that the system service in the cluster is no longer polling the Resource Provider. Clusters in this state cannot be managed by the Resource Provider. - * - AutoScale - Indicates that the ReliabilityLevel of the cluster is being adjusted. - * - Ready - Indicates that the cluster is in a stable state. - * - */ - clusterState?: - | "WaitingForNodes" - | "Deploying" - | "BaselineUpgrade" - | "UpdatingUserConfiguration" - | "UpdatingUserCertificate" - | "UpdatingInfrastructure" - | "EnforcingClusterVersion" - | "UpgradeServiceUnreachable" - | "AutoScale" - | "Ready"; /** The storage account information for storing Service Fabric diagnostic logs. */ diagnosticsStorageAccountConfig?: DiagnosticsStorageAccountConfig; /** Indicates if the event store service is enabled. */ @@ -65,8 +41,6 @@ export interface ClusterProperties { managementEndpoint: string; /** The list of node types in the cluster. */ nodeTypes: Array; - /** The provisioning state of the cluster resource. */ - provisioningState?: "Updating" | "Succeeded" | "Failed" | "Canceled"; /** * The reliability level sets the replica set size of system services. Learn about [ReliabilityLevel](https://docs.microsoft.com/azure/service-fabric/service-fabric-cluster-capacity). * @@ -108,6 +82,7 @@ export interface ClusterProperties { notifications?: Array; } +/** The detail of the Service Fabric runtime version result */ export interface ClusterVersionDetails { /** The Service Fabric runtime version of the cluster. */ codeVersion?: string; @@ -117,6 +92,7 @@ export interface ClusterVersionDetails { environment?: "Windows" | "Linux"; } +/** The settings to enable AAD authentication on the cluster. */ export interface AzureActiveDirectory { /** Azure active directory tenant id. */ tenantId?: string; @@ -126,6 +102,7 @@ export interface AzureActiveDirectory { clientApplication?: string; } +/** Describes the certificate details. */ export interface CertificateDescription { /** Thumbprint of the primary certificate. */ thumbprint: string; @@ -143,6 +120,7 @@ export interface CertificateDescription { | "TrustedPublisher"; } +/** Describes a list of server certificates referenced by common name that are used to secure the cluster. */ export interface ServerCertificateCommonNames { /** The list of server certificates referenced by common name that are used to secure the cluster. */ commonNames?: Array; @@ -158,6 +136,7 @@ export interface ServerCertificateCommonNames { | "TrustedPublisher"; } +/** Describes the server certificate details using common name. */ export interface ServerCertificateCommonName { /** The common name of the server certificate. */ certificateCommonName: string; @@ -165,6 +144,7 @@ export interface ServerCertificateCommonName { certificateIssuerThumbprint: string; } +/** Describes the client certificate details using common name. */ export interface ClientCertificateCommonName { /** Indicates if the client certificate has admin access to the cluster. Non admin clients can perform only read only operations on the cluster. */ isAdmin: boolean; @@ -174,6 +154,7 @@ export interface ClientCertificateCommonName { certificateIssuerThumbprint: string; } +/** Describes the client certificate details using thumbprint. */ export interface ClientCertificateThumbprint { /** Indicates if the client certificate has admin access to the cluster. Non admin clients can perform only read only operations on the cluster. */ isAdmin: boolean; @@ -181,6 +162,7 @@ export interface ClientCertificateThumbprint { certificateThumbprint: string; } +/** The storage account information for storing Service Fabric diagnostic logs. */ export interface DiagnosticsStorageAccountConfig { /** The Azure storage account name. */ storageAccountName: string; @@ -196,6 +178,7 @@ export interface DiagnosticsStorageAccountConfig { tableEndpoint: string; } +/** Describes a section in the fabric settings of the cluster. */ export interface SettingsSectionDescription { /** The section name of the fabric settings. */ name: string; @@ -203,6 +186,7 @@ export interface SettingsSectionDescription { parameters: Array; } +/** Describes a parameter in fabric settings of the cluster. */ export interface SettingsParameterDescription { /** The parameter name of fabric setting. */ name: string; @@ -210,6 +194,7 @@ export interface SettingsParameterDescription { value: string; } +/** Describes a node type in the cluster, each node type represents sub set of nodes in the cluster. */ export interface NodeTypeDescription { /** The name of the node type. */ name: string; @@ -246,6 +231,7 @@ export interface NodeTypeDescription { multipleAvailabilityZones?: boolean; } +/** Port range details */ export interface EndpointRangeDescription { /** Starting port of a range of ports */ startPort: number; @@ -253,6 +239,7 @@ export interface EndpointRangeDescription { endPort: number; } +/** Describes the policy used when upgrading the cluster. */ export interface ClusterUpgradePolicy { /** If true, then processes are forcefully restarted during upgrade even when the code version has not changed (the upgrade only changes configuration or data). */ forceRestart?: boolean; @@ -274,6 +261,10 @@ export interface ClusterUpgradePolicy { deltaHealthPolicy?: ClusterUpgradeDeltaHealthPolicy; } +/** + * Defines a health policy used to evaluate the health of the cluster or of a cluster node. + * + */ export interface ClusterHealthPolicy { /** * The maximum allowed percentage of unhealthy nodes before reporting an error. For example, to allow 10% of nodes to be unhealthy, this value would be 10. @@ -301,6 +292,10 @@ export interface ClusterHealthPolicy { applicationHealthPolicies?: Record; } +/** + * Defines a health policy used to evaluate the health of an application or one of its children entities. + * + */ export interface ApplicationHealthPolicy { /** The health policy used by default to evaluate the health of a service type. */ defaultServiceTypeHealthPolicy?: ServiceTypeHealthPolicy; @@ -308,6 +303,10 @@ export interface ApplicationHealthPolicy { serviceTypeHealthPolicies?: Record; } +/** + * Represents the health policy used to evaluate the health of services belonging to a service type. + * + */ export interface ServiceTypeHealthPolicy { /** * The maximum percentage of services allowed to be unhealthy before your application is considered in error. @@ -316,6 +315,7 @@ export interface ServiceTypeHealthPolicy { maxPercentUnhealthyServices?: number; } +/** Describes the delta health policies for the cluster upgrade. */ export interface ClusterUpgradeDeltaHealthPolicy { /** * The maximum allowed percentage of nodes health degradation allowed during cluster upgrades. @@ -342,6 +342,10 @@ export interface ClusterUpgradeDeltaHealthPolicy { applicationDeltaHealthPolicies?: Record; } +/** + * Defines a delta health policy used to evaluate the health of an application or one of its child entities when upgrading the cluster. + * + */ export interface ApplicationDeltaHealthPolicy { /** The delta health policy used by default to evaluate the health of a service type when upgrading the cluster. */ defaultServiceTypeDeltaHealthPolicy?: ServiceTypeDeltaHealthPolicy; @@ -349,6 +353,10 @@ export interface ApplicationDeltaHealthPolicy { serviceTypeDeltaHealthPolicies?: Record; } +/** + * Represents the delta health policy used to evaluate the health of services belonging to a service type when upgrading the cluster. + * + */ export interface ServiceTypeDeltaHealthPolicy { /** * The maximum allowed percentage of services health degradation allowed during cluster upgrades. @@ -364,6 +372,7 @@ export interface ApplicationTypeVersionsCleanupPolicy { maxUnusedVersionsToKeep: number; } +/** Describes the notification channel for cluster events. */ export interface Notification { /** Indicates if the notification is enabled. */ isEnabled: boolean; @@ -375,6 +384,7 @@ export interface Notification { notificationTargets: Array; } +/** Describes the notification target properties. */ export interface NotificationTarget { /** The notification channel indicates the type of receivers subscribed to the notification, either user or subscription. */ notificationChannel: "EmailUser" | "EmailSubscription"; @@ -382,23 +392,15 @@ export interface NotificationTarget { receivers: Array; } +/** The resource model definition. */ export interface Resource { - /** Azure resource identifier. */ - id?: string; - /** Azure resource name. */ - name?: string; - /** Azure resource type. */ - type?: string; /** Azure resource location. */ location: string; /** Azure resource tags. */ tags?: Record; - /** Azure resource etag. */ - etag?: string; - /** Metadata pertaining to creation and last modification of the resource. */ - systemData?: SystemData; } +/** Metadata pertaining to creation and last modification of the resource. */ export interface SystemData { /** The identity that created the resource. */ createdBy?: string; @@ -414,6 +416,7 @@ export interface SystemData { lastModifiedAt?: Date | string; } +/** Cluster update request */ export interface ClusterUpdateParameters { /** Describes the cluster resource properties that can be updated during PATCH operation. */ properties?: ClusterPropertiesUpdateParameters; @@ -421,10 +424,14 @@ export interface ClusterUpdateParameters { tags?: Record; } +/** Describes the cluster resource properties that can be updated during PATCH operation. */ export interface ClusterPropertiesUpdateParameters { /** The list of add-on features to enable in the cluster. */ addOnFeatures?: Array< - "RepairManager" | "DnsService" | "BackupRestoreService" | "ResourceMonitorService" + | "RepairManager" + | "DnsService" + | "BackupRestoreService" + | "ResourceMonitorService" >; /** The certificate to use for securing the cluster. The certificate provided will be used for node to node security within the cluster, SSL certificate for cluster management endpoint and default admin client. */ certificate?: CertificateDescription; @@ -484,47 +491,36 @@ export interface UpgradableVersionsDescription { targetVersion: string; } +/** The application type name resource */ export interface ApplicationTypeResource extends ProxyResource { /** The application type name properties */ properties?: ApplicationTypeResourceProperties; } -export interface ApplicationTypeResourceProperties { - /** The current deployment or provisioning state, which only appears in the response. */ - provisioningState?: string; -} +/** The application type name properties */ +export interface ApplicationTypeResourceProperties {} +/** The resource model definition for proxy-only resource. */ export interface ProxyResource { - /** Azure resource identifier. */ - id?: string; - /** Azure resource name. */ - name?: string; - /** Azure resource type. */ - type?: string; /** It will be deprecated in New API, resource location depends on the parent resource. */ location?: string; /** Azure resource tags. */ tags?: Record; - /** Azure resource etag. */ - etag?: string; - /** Metadata pertaining to creation and last modification of the resource. */ - systemData?: SystemData; } +/** An application type version resource for the specified application type name resource. */ export interface ApplicationTypeVersionResource extends ProxyResource { /** The properties of the application type version resource. */ properties?: ApplicationTypeVersionResourceProperties; } +/** The properties of the application type version resource. */ export interface ApplicationTypeVersionResourceProperties { - /** The current deployment or provisioning state, which only appears in the response */ - provisioningState?: string; /** The URL to the application package */ appPackageUrl: string; - /** List of application type parameters that can be overridden when creating or updating the application. */ - defaultParameterList?: Record; } +/** The application resource. */ export interface ApplicationResource extends ProxyResource { /** Describes the managed identities for an Azure resource. */ identity?: ManagedIdentity; @@ -532,13 +528,14 @@ export interface ApplicationResource extends ProxyResource { properties?: ApplicationResourceProperties; } +/** Describes the managed identities for an Azure resource. */ export interface ManagedIdentity { - /** The principal id of the managed identity. This property will only be provided for a system assigned identity. */ - principalId?: string; - /** The tenant id of the managed identity. This property will only be provided for a system assigned identity. */ - tenantId?: string; /** The type of managed identity for the resource. */ - type?: "SystemAssigned" | "UserAssigned" | "SystemAssigned, UserAssigned" | "None"; + type?: + | "SystemAssigned" + | "UserAssigned" + | "SystemAssigned, UserAssigned" + | "None"; /** * The list of user 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}'. @@ -547,20 +544,16 @@ export interface ManagedIdentity { userAssignedIdentities?: Record; } -export interface UserAssignedIdentity { - /** The principal id of user assigned identity. */ - principalId?: string; - /** The client id of user assigned identity. */ - clientId?: string; -} +export interface UserAssignedIdentity {} -export interface ApplicationResourceProperties extends ApplicationResourceUpdateProperties { - /** The current deployment or provisioning state, which only appears in the response */ - provisioningState?: string; +/** The application resource properties. */ +export interface ApplicationResourceProperties + extends ApplicationResourceUpdateProperties { /** The application type name as defined in the application manifest. */ typeName?: string; } +/** The application resource properties for patch operations. */ export interface ApplicationResourceUpdateProperties { /** The version of the application type as defined in the application manifest. */ typeVersion?: string; @@ -580,6 +573,7 @@ export interface ApplicationResourceUpdateProperties { managedIdentities?: Array; } +/** Describes the policy for a monitored application upgrade. */ export interface ApplicationUpgradePolicy { /** The maximum amount of time to block processing of an upgrade domain and prevent loss of availability when there are unexpected issues. When this timeout expires, processing of the upgrade domain will proceed regardless of availability loss issues. The timeout is reset at the start of each upgrade domain. Valid values are between 0 and 42949672925 inclusive. (unsigned 32-bit integer). */ upgradeReplicaSetCheckTimeout?: string; @@ -593,11 +587,16 @@ export interface ApplicationUpgradePolicy { */ applicationHealthPolicy?: ArmApplicationHealthPolicy; /** The mode used to monitor health during a rolling upgrade. The values are UnmonitoredAuto, UnmonitoredManual, and Monitored. */ - upgradeMode?: "Invalid" | "UnmonitoredAuto" | "UnmonitoredManual" | "Monitored"; + upgradeMode?: + | "Invalid" + | "UnmonitoredAuto" + | "UnmonitoredManual" + | "Monitored"; /** Determines whether the application should be recreated on update. If value=true, the rest of the upgrade policy parameters are not allowed and it will result in availability loss. */ recreateApplication?: boolean; } +/** The policy used for monitoring the application upgrade */ export interface ArmRollingUpgradeMonitoringPolicy { /** The activation Mode of the service package */ failureAction?: "Rollback" | "Manual"; @@ -613,6 +612,10 @@ export interface ArmRollingUpgradeMonitoringPolicy { upgradeDomainTimeout?: string; } +/** + * Defines a health policy used to evaluate the health of an application or one of its children entities. + * + */ export interface ArmApplicationHealthPolicy { /** Indicates whether warnings are treated with the same severity as errors. */ considerWarningAsError?: boolean; @@ -630,6 +633,10 @@ export interface ArmApplicationHealthPolicy { serviceTypeHealthPolicyMap?: Record; } +/** + * Represents the health policy used to evaluate the health of services belonging to a service type. + * + */ export interface ArmServiceTypeHealthPolicy { /** * The maximum percentage of services allowed to be unhealthy before your application is considered in error. @@ -648,6 +655,10 @@ export interface ArmServiceTypeHealthPolicy { maxPercentUnhealthyReplicasPerPartition?: number; } +/** + * Describes capacity information for a custom resource balancing metric. This can be used to limit the total consumption of this metric by the services of this application. + * + */ export interface ApplicationMetricDescription { /** The name of the metric. */ name?: string; @@ -685,19 +696,21 @@ export interface ApplicationUserAssignedIdentity { principalId: string; } +/** The application resource for patch operations. */ export interface ApplicationResourceUpdate extends ProxyResource { /** The application resource properties for patch operations. */ properties?: ApplicationResourceUpdateProperties; } +/** The service resource. */ export interface ServiceResource extends ProxyResource { /** The service resource properties. */ properties?: ServiceResourceProperties; } -export interface ServiceResourcePropertiesParent extends ServiceResourcePropertiesBase { - /** The current deployment or provisioning state, which only appears in the response */ - provisioningState?: string; +/** The service resource properties. */ +export interface ServiceResourcePropertiesParent + extends ServiceResourcePropertiesBase { /** The name of the service type */ serviceTypeName?: string; /** Describes how the service is partitioned. */ @@ -709,10 +722,16 @@ export interface ServiceResourcePropertiesParent extends ServiceResourceProperti serviceKind: "ServiceResourceProperties" | "Stateful" | "Stateless"; } +/** Describes how the service is partitioned. */ export interface PartitionSchemeDescriptionParent { - partitionScheme: "PartitionSchemeDescription" | "Named" | "Singleton" | "UniformInt64Range"; + partitionScheme: + | "PartitionSchemeDescription" + | "Named" + | "Singleton" + | "UniformInt64Range"; } +/** The common service resource properties. */ export interface ServiceResourcePropertiesBase { /** The placement constraints as a string. Placement constraints are boolean expressions on node properties and allow for restricting a service to particular nodes based on the service requirements. For example, to place a service on nodes where NodeType is blue specify the following: "NodeColor == blue)". */ placementConstraints?: string; @@ -726,6 +745,7 @@ export interface ServiceResourcePropertiesBase { defaultMoveCost?: "Zero" | "Low" | "Medium" | "High"; } +/** Creates a particular correlation between services. */ export interface ServiceCorrelationDescription { /** The ServiceCorrelationScheme which describes the relationship between this service and the service specified via ServiceName. */ scheme: "Invalid" | "Affinity" | "AlignedAffinity" | "NonAlignedAffinity"; @@ -733,6 +753,7 @@ export interface ServiceCorrelationDescription { serviceName: string; } +/** Specifies a metric to load balance a service during runtime. */ export interface ServiceLoadMetricDescription { /** The name of the metric. If the service chooses to report load during runtime, the load metric name should match the name that is specified in Name exactly. Note that metric names are case sensitive. */ name: string; @@ -746,20 +767,26 @@ export interface ServiceLoadMetricDescription { defaultLoad?: number; } +/** Describes the policy to be used for placement of a Service Fabric service. */ export interface ServicePlacementPolicyDescription { type: "ServicePlacementPolicyDescription"; } +/** The service resource for patch operations. */ export interface ServiceResourceUpdate extends ProxyResource { /** The service resource properties for patch operations. */ properties?: ServiceResourceUpdateProperties; } -export interface ServiceResourceUpdatePropertiesParent extends ServiceResourcePropertiesBase { +/** The service resource properties for patch operations. */ +export interface ServiceResourceUpdatePropertiesParent + extends ServiceResourcePropertiesBase { serviceKind: "ServiceResourceUpdateProperties" | "Stateful" | "Stateless"; } -export interface NamedPartitionSchemeDescription extends PartitionSchemeDescriptionParent { +/** Describes the named partition scheme of the service. */ +export interface NamedPartitionSchemeDescription + extends PartitionSchemeDescriptionParent { /** The number of partitions. */ count: number; /** Array of size specified by the ‘count’ parameter, for the names of the partitions. */ @@ -767,11 +794,15 @@ export interface NamedPartitionSchemeDescription extends PartitionSchemeDescript partitionScheme: "Named"; } -export interface SingletonPartitionSchemeDescription extends PartitionSchemeDescriptionParent { +/** SingletonPartitionSchemeDescription */ +export interface SingletonPartitionSchemeDescription + extends PartitionSchemeDescriptionParent { partitionScheme: "Singleton"; } -export interface StatefulServiceProperties extends ServiceResourcePropertiesParent { +/** The properties of a stateful service resource. */ +export interface StatefulServiceProperties + extends ServiceResourcePropertiesParent { /** A flag indicating whether this is a persistent service which stores states on the local disk. If it is then the value of this property is true, if not it is false. */ hasPersistedState?: boolean; /** The target replica set size as a number. */ @@ -787,7 +818,9 @@ export interface StatefulServiceProperties extends ServiceResourcePropertiesPare serviceKind: "Stateful"; } -export interface StatefulServiceUpdateProperties extends ServiceResourceUpdatePropertiesParent { +/** The properties of a stateful service resource for patch operations. */ +export interface StatefulServiceUpdateProperties + extends ServiceResourceUpdatePropertiesParent { /** The target replica set size as a number. */ targetReplicaSetSize?: number; /** The minimum replica set size as a number. */ @@ -801,7 +834,9 @@ export interface StatefulServiceUpdateProperties extends ServiceResourceUpdatePr serviceKind: "Stateful"; } -export interface StatelessServiceProperties extends ServiceResourcePropertiesParent { +/** The properties of a stateless service resource. */ +export interface StatelessServiceProperties + extends ServiceResourcePropertiesParent { /** The instance count. */ instanceCount?: number; /** Delay duration for RequestDrain feature to ensures that the endpoint advertised by the stateless instance is removed before the delay starts prior to closing the instance. This delay enables existing requests to drain gracefully before the instance actually goes down (https://docs.microsoft.com/en-us/azure/service-fabric/service-fabric-application-upgrade-advanced#avoid-connection-drops-during-stateless-service-planned-downtime-preview). It is represented in ISO 8601 format (hh:mm:ss.s). */ @@ -809,7 +844,9 @@ export interface StatelessServiceProperties extends ServiceResourcePropertiesPar serviceKind: "Stateless"; } -export interface StatelessServiceUpdateProperties extends ServiceResourceUpdatePropertiesParent { +/** The properties of a stateless service resource for patch operations. */ +export interface StatelessServiceUpdateProperties + extends ServiceResourceUpdatePropertiesParent { /** The instance count. */ instanceCount?: number; /** Delay duration for RequestDrain feature to ensures that the endpoint advertised by the stateless instance is removed before the delay starts prior to closing the instance. This delay enables existing requests to drain gracefully before the instance actually goes down (https://docs.microsoft.com/en-us/azure/service-fabric/service-fabric-application-upgrade-advanced#avoid-connection-drops-during-stateless-service-planned-downtime-preview). It is first interpreted as a string representing an ISO 8601 duration. It is represented in ISO 8601 format (hh:mm:ss.s). */ @@ -817,6 +854,7 @@ export interface StatelessServiceUpdateProperties extends ServiceResourceUpdateP serviceKind: "Stateless"; } +/** Describes a partitioning scheme where an integer range is allocated evenly across a number of partitions. */ export interface UniformInt64RangePartitionSchemeDescription extends PartitionSchemeDescriptionParent { /** The number of partitions. */ @@ -836,11 +874,16 @@ export interface UniformInt64RangePartitionSchemeDescription partitionScheme: "UniformInt64Range"; } -export type ServiceResourceProperties = StatefulServiceProperties | StatelessServiceProperties; +/** The service resource properties. */ +export type ServiceResourceProperties = + | StatefulServiceProperties + | StatelessServiceProperties; +/** Describes how the service is partitioned. */ export type PartitionSchemeDescription = | NamedPartitionSchemeDescription | SingletonPartitionSchemeDescription | UniformInt64RangePartitionSchemeDescription; +/** The service resource properties for patch operations. */ export type ServiceResourceUpdateProperties = | StatefulServiceUpdateProperties | StatelessServiceUpdateProperties; diff --git a/sdk/servicefabric/arm-servicefabric-rest/src/outputModels.ts b/sdk/servicefabric/arm-servicefabric-rest/src/outputModels.ts index d94dcf6ef65f..e3dc3fd46cd3 100644 --- a/sdk/servicefabric/arm-servicefabric-rest/src/outputModels.ts +++ b/sdk/servicefabric/arm-servicefabric-rest/src/outputModels.ts @@ -1,18 +1,26 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. +/** + * The cluster resource + * + */ export interface ClusterOutput extends ResourceOutput { /** The cluster resource properties */ properties?: ClusterPropertiesOutput; } +/** Describes the cluster resource properties. */ export interface ClusterPropertiesOutput { /** The list of add-on features to enable in the cluster. */ addOnFeatures?: Array< - "RepairManager" | "DnsService" | "BackupRestoreService" | "ResourceMonitorService" + | "RepairManager" + | "DnsService" + | "BackupRestoreService" + | "ResourceMonitorService" >; /** The Service Fabric runtime versions available for this cluster. */ - availableClusterVersions?: Array; + readonly availableClusterVersions?: Array; /** The AAD authentication settings of the cluster. */ azureActiveDirectory?: AzureActiveDirectoryOutput; /** The certificate to use for securing the cluster. The certificate provided will be used for node to node security within the cluster, SSL certificate for cluster management endpoint and default admin client. */ @@ -26,9 +34,9 @@ export interface ClusterPropertiesOutput { /** The Service Fabric runtime version of the cluster. This property can only by set the user when **upgradeMode** is set to 'Manual'. To get list of available Service Fabric versions for new clusters use [ClusterVersion API](./ClusterVersion.md). To get the list of available version for existing clusters use **availableClusterVersions**. */ clusterCodeVersion?: string; /** The Azure Resource Provider endpoint. A system service in the cluster connects to this endpoint. */ - clusterEndpoint?: string; + readonly clusterEndpoint?: string; /** A service generated unique identifier for the cluster resource. */ - clusterId?: string; + readonly clusterId?: string; /** * The current state of the cluster. * @@ -44,7 +52,7 @@ export interface ClusterPropertiesOutput { * - Ready - Indicates that the cluster is in a stable state. * */ - clusterState?: + readonly clusterState?: | "WaitingForNodes" | "Deploying" | "BaselineUpgrade" @@ -66,7 +74,7 @@ export interface ClusterPropertiesOutput { /** The list of node types in the cluster. */ nodeTypes: Array; /** The provisioning state of the cluster resource. */ - provisioningState?: "Updating" | "Succeeded" | "Failed" | "Canceled"; + readonly provisioningState?: "Updating" | "Succeeded" | "Failed" | "Canceled"; /** * The reliability level sets the replica set size of system services. Learn about [ReliabilityLevel](https://docs.microsoft.com/azure/service-fabric/service-fabric-cluster-capacity). * @@ -108,6 +116,7 @@ export interface ClusterPropertiesOutput { notifications?: Array; } +/** The detail of the Service Fabric runtime version result */ export interface ClusterVersionDetailsOutput { /** The Service Fabric runtime version of the cluster. */ codeVersion?: string; @@ -117,6 +126,7 @@ export interface ClusterVersionDetailsOutput { environment?: "Windows" | "Linux"; } +/** The settings to enable AAD authentication on the cluster. */ export interface AzureActiveDirectoryOutput { /** Azure active directory tenant id. */ tenantId?: string; @@ -126,6 +136,7 @@ export interface AzureActiveDirectoryOutput { clientApplication?: string; } +/** Describes the certificate details. */ export interface CertificateDescriptionOutput { /** Thumbprint of the primary certificate. */ thumbprint: string; @@ -143,6 +154,7 @@ export interface CertificateDescriptionOutput { | "TrustedPublisher"; } +/** Describes a list of server certificates referenced by common name that are used to secure the cluster. */ export interface ServerCertificateCommonNamesOutput { /** The list of server certificates referenced by common name that are used to secure the cluster. */ commonNames?: Array; @@ -158,6 +170,7 @@ export interface ServerCertificateCommonNamesOutput { | "TrustedPublisher"; } +/** Describes the server certificate details using common name. */ export interface ServerCertificateCommonNameOutput { /** The common name of the server certificate. */ certificateCommonName: string; @@ -165,6 +178,7 @@ export interface ServerCertificateCommonNameOutput { certificateIssuerThumbprint: string; } +/** Describes the client certificate details using common name. */ export interface ClientCertificateCommonNameOutput { /** Indicates if the client certificate has admin access to the cluster. Non admin clients can perform only read only operations on the cluster. */ isAdmin: boolean; @@ -174,6 +188,7 @@ export interface ClientCertificateCommonNameOutput { certificateIssuerThumbprint: string; } +/** Describes the client certificate details using thumbprint. */ export interface ClientCertificateThumbprintOutput { /** Indicates if the client certificate has admin access to the cluster. Non admin clients can perform only read only operations on the cluster. */ isAdmin: boolean; @@ -181,6 +196,7 @@ export interface ClientCertificateThumbprintOutput { certificateThumbprint: string; } +/** The storage account information for storing Service Fabric diagnostic logs. */ export interface DiagnosticsStorageAccountConfigOutput { /** The Azure storage account name. */ storageAccountName: string; @@ -196,6 +212,7 @@ export interface DiagnosticsStorageAccountConfigOutput { tableEndpoint: string; } +/** Describes a section in the fabric settings of the cluster. */ export interface SettingsSectionDescriptionOutput { /** The section name of the fabric settings. */ name: string; @@ -203,6 +220,7 @@ export interface SettingsSectionDescriptionOutput { parameters: Array; } +/** Describes a parameter in fabric settings of the cluster. */ export interface SettingsParameterDescriptionOutput { /** The parameter name of fabric setting. */ name: string; @@ -210,6 +228,7 @@ export interface SettingsParameterDescriptionOutput { value: string; } +/** Describes a node type in the cluster, each node type represents sub set of nodes in the cluster. */ export interface NodeTypeDescriptionOutput { /** The name of the node type. */ name: string; @@ -246,6 +265,7 @@ export interface NodeTypeDescriptionOutput { multipleAvailabilityZones?: boolean; } +/** Port range details */ export interface EndpointRangeDescriptionOutput { /** Starting port of a range of ports */ startPort: number; @@ -253,6 +273,7 @@ export interface EndpointRangeDescriptionOutput { endPort: number; } +/** Describes the policy used when upgrading the cluster. */ export interface ClusterUpgradePolicyOutput { /** If true, then processes are forcefully restarted during upgrade even when the code version has not changed (the upgrade only changes configuration or data). */ forceRestart?: boolean; @@ -274,6 +295,10 @@ export interface ClusterUpgradePolicyOutput { deltaHealthPolicy?: ClusterUpgradeDeltaHealthPolicyOutput; } +/** + * Defines a health policy used to evaluate the health of the cluster or of a cluster node. + * + */ export interface ClusterHealthPolicyOutput { /** * The maximum allowed percentage of unhealthy nodes before reporting an error. For example, to allow 10% of nodes to be unhealthy, this value would be 10. @@ -301,6 +326,10 @@ export interface ClusterHealthPolicyOutput { applicationHealthPolicies?: Record; } +/** + * Defines a health policy used to evaluate the health of an application or one of its children entities. + * + */ export interface ApplicationHealthPolicyOutput { /** The health policy used by default to evaluate the health of a service type. */ defaultServiceTypeHealthPolicy?: ServiceTypeHealthPolicyOutput; @@ -308,6 +337,10 @@ export interface ApplicationHealthPolicyOutput { serviceTypeHealthPolicies?: Record; } +/** + * Represents the health policy used to evaluate the health of services belonging to a service type. + * + */ export interface ServiceTypeHealthPolicyOutput { /** * The maximum percentage of services allowed to be unhealthy before your application is considered in error. @@ -316,6 +349,7 @@ export interface ServiceTypeHealthPolicyOutput { maxPercentUnhealthyServices?: number; } +/** Describes the delta health policies for the cluster upgrade. */ export interface ClusterUpgradeDeltaHealthPolicyOutput { /** * The maximum allowed percentage of nodes health degradation allowed during cluster upgrades. @@ -339,16 +373,30 @@ export interface ClusterUpgradeDeltaHealthPolicyOutput { */ maxPercentDeltaUnhealthyApplications: number; /** Defines the application delta health policy map used to evaluate the health of an application or one of its child entities when upgrading the cluster. */ - applicationDeltaHealthPolicies?: Record; + applicationDeltaHealthPolicies?: Record< + string, + ApplicationDeltaHealthPolicyOutput + >; } +/** + * Defines a delta health policy used to evaluate the health of an application or one of its child entities when upgrading the cluster. + * + */ export interface ApplicationDeltaHealthPolicyOutput { /** The delta health policy used by default to evaluate the health of a service type when upgrading the cluster. */ defaultServiceTypeDeltaHealthPolicy?: ServiceTypeDeltaHealthPolicyOutput; /** The map with service type delta health policy per service type name. The map is empty by default. */ - serviceTypeDeltaHealthPolicies?: Record; + serviceTypeDeltaHealthPolicies?: Record< + string, + ServiceTypeDeltaHealthPolicyOutput + >; } +/** + * Represents the delta health policy used to evaluate the health of services belonging to a service type when upgrading the cluster. + * + */ export interface ServiceTypeDeltaHealthPolicyOutput { /** * The maximum allowed percentage of services health degradation allowed during cluster upgrades. @@ -364,6 +412,7 @@ export interface ApplicationTypeVersionsCleanupPolicyOutput { maxUnusedVersionsToKeep: number; } +/** Describes the notification channel for cluster events. */ export interface NotificationOutput { /** Indicates if the notification is enabled. */ isEnabled: boolean; @@ -375,6 +424,7 @@ export interface NotificationOutput { notificationTargets: Array; } +/** Describes the notification target properties. */ export interface NotificationTargetOutput { /** The notification channel indicates the type of receivers subscribed to the notification, either user or subscription. */ notificationChannel: "EmailUser" | "EmailSubscription"; @@ -382,23 +432,25 @@ export interface NotificationTargetOutput { receivers: Array; } +/** The resource model definition. */ export interface ResourceOutput { /** Azure resource identifier. */ - id?: string; + readonly id?: string; /** Azure resource name. */ - name?: string; + readonly name?: string; /** Azure resource type. */ - type?: string; + readonly type?: string; /** Azure resource location. */ location: string; /** Azure resource tags. */ tags?: Record; /** Azure resource etag. */ - etag?: string; + readonly etag?: string; /** Metadata pertaining to creation and last modification of the resource. */ - systemData?: SystemDataOutput; + readonly systemData?: SystemDataOutput; } +/** Metadata pertaining to creation and last modification of the resource. */ export interface SystemDataOutput { /** The identity that created the resource. */ createdBy?: string; @@ -414,11 +466,13 @@ export interface SystemDataOutput { lastModifiedAt?: string; } +/** The structure of the error. */ export interface ErrorModelOutput { /** The error details. */ error?: ErrorModelErrorOutput; } +/** The error details. */ export interface ErrorModelErrorOutput { /** The error code. */ code?: string; @@ -426,18 +480,21 @@ export interface ErrorModelErrorOutput { message?: string; } +/** Cluster list results */ export interface ClusterListResultOutput { value?: Array; /** The URL to use for getting the next set of results. */ nextLink?: string; } +/** The list results of the Service Fabric runtime versions. */ export interface ClusterCodeVersionsListResultOutput { value?: Array; /** The URL to use for getting the next set of results. */ nextLink?: string; } +/** The result of the Service Fabric runtime versions */ export interface ClusterCodeVersionsResultOutput { /** The identification of the result */ id?: string; @@ -449,17 +506,20 @@ export interface ClusterCodeVersionsResultOutput { properties?: ClusterVersionDetailsOutput; } +/** The list of intermediate cluster code versions for an upgrade or downgrade. Or minimum and maximum upgradable version if no target was given */ export interface UpgradableVersionPathResultOutput { supportedPath?: Array; } +/** Describes the result of the request to list Service Fabric resource provider operations. */ export interface OperationListResultOutput { /** List of operations supported by the Service Fabric resource provider. */ value?: Array; /** URL to get the next set of operation list results if there are any. */ - nextLink?: string; + readonly nextLink?: string; } +/** Available operation list result */ export interface OperationResultOutput { /** The name of the operation. */ name?: string; @@ -473,6 +533,7 @@ export interface OperationResultOutput { nextLink?: string; } +/** Operation supported by the Service Fabric resource provider */ export interface AvailableOperationDisplayOutput { /** The name of the provider. */ provider?: string; @@ -484,59 +545,68 @@ export interface AvailableOperationDisplayOutput { description?: string; } +/** The application type name resource */ export interface ApplicationTypeResourceOutput extends ProxyResourceOutput { /** The application type name properties */ properties?: ApplicationTypeResourcePropertiesOutput; } +/** The application type name properties */ export interface ApplicationTypeResourcePropertiesOutput { /** The current deployment or provisioning state, which only appears in the response. */ - provisioningState?: string; + readonly provisioningState?: string; } +/** The resource model definition for proxy-only resource. */ export interface ProxyResourceOutput { /** Azure resource identifier. */ - id?: string; + readonly id?: string; /** Azure resource name. */ - name?: string; + readonly name?: string; /** Azure resource type. */ - type?: string; + readonly type?: string; /** It will be deprecated in New API, resource location depends on the parent resource. */ location?: string; /** Azure resource tags. */ tags?: Record; /** Azure resource etag. */ - etag?: string; + readonly etag?: string; /** Metadata pertaining to creation and last modification of the resource. */ - systemData?: SystemDataOutput; + readonly systemData?: SystemDataOutput; } +/** The list of application type names. */ export interface ApplicationTypeResourceListOutput { value?: Array; /** URL to get the next set of application type list results if there are any. */ - nextLink?: string; + readonly nextLink?: string; } -export interface ApplicationTypeVersionResourceOutput extends ProxyResourceOutput { +/** An application type version resource for the specified application type name resource. */ +export interface ApplicationTypeVersionResourceOutput + extends ProxyResourceOutput { /** The properties of the application type version resource. */ properties?: ApplicationTypeVersionResourcePropertiesOutput; } +/** The properties of the application type version resource. */ export interface ApplicationTypeVersionResourcePropertiesOutput { /** The current deployment or provisioning state, which only appears in the response */ - provisioningState?: string; + readonly provisioningState?: string; /** The URL to the application package */ appPackageUrl: string; /** List of application type parameters that can be overridden when creating or updating the application. */ - defaultParameterList?: Record; + readonly defaultParameterList?: Record; } +/** The list of application type version resources for the specified application type name resource. */ export interface ApplicationTypeVersionResourceListOutput { value?: Array; /** URL to get the next set of application type version list results if there are any. */ - nextLink?: string; + readonly nextLink?: string; } +/** The application resource. */ export interface ApplicationResourceOutput extends ProxyResourceOutput { /** Describes the managed identities for an Azure resource. */ identity?: ManagedIdentityOutput; @@ -544,13 +614,18 @@ export interface ApplicationResourceOutput extends ProxyResourceOutput { properties?: ApplicationResourcePropertiesOutput; } +/** Describes the managed identities for an Azure resource. */ export interface ManagedIdentityOutput { /** The principal id of the managed identity. This property will only be provided for a system assigned identity. */ - principalId?: string; + readonly principalId?: string; /** The tenant id of the managed identity. This property will only be provided for a system assigned identity. */ - tenantId?: string; + readonly tenantId?: string; /** The type of managed identity for the resource. */ - type?: "SystemAssigned" | "UserAssigned" | "SystemAssigned, UserAssigned" | "None"; + type?: + | "SystemAssigned" + | "UserAssigned" + | "SystemAssigned, UserAssigned" + | "None"; /** * The list of user 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}'. @@ -561,19 +636,21 @@ export interface ManagedIdentityOutput { export interface UserAssignedIdentityOutput { /** The principal id of user assigned identity. */ - principalId?: string; + readonly principalId?: string; /** The client id of user assigned identity. */ - clientId?: string; + readonly clientId?: string; } +/** The application resource properties. */ export interface ApplicationResourcePropertiesOutput extends ApplicationResourceUpdatePropertiesOutput { /** The current deployment or provisioning state, which only appears in the response */ - provisioningState?: string; + readonly provisioningState?: string; /** The application type name as defined in the application manifest. */ typeName?: string; } +/** The application resource properties for patch operations. */ export interface ApplicationResourceUpdatePropertiesOutput { /** The version of the application type as defined in the application manifest. */ typeVersion?: string; @@ -593,6 +670,7 @@ export interface ApplicationResourceUpdatePropertiesOutput { managedIdentities?: Array; } +/** Describes the policy for a monitored application upgrade. */ export interface ApplicationUpgradePolicyOutput { /** The maximum amount of time to block processing of an upgrade domain and prevent loss of availability when there are unexpected issues. When this timeout expires, processing of the upgrade domain will proceed regardless of availability loss issues. The timeout is reset at the start of each upgrade domain. Valid values are between 0 and 42949672925 inclusive. (unsigned 32-bit integer). */ upgradeReplicaSetCheckTimeout?: string; @@ -606,11 +684,16 @@ export interface ApplicationUpgradePolicyOutput { */ applicationHealthPolicy?: ArmApplicationHealthPolicyOutput; /** The mode used to monitor health during a rolling upgrade. The values are UnmonitoredAuto, UnmonitoredManual, and Monitored. */ - upgradeMode?: "Invalid" | "UnmonitoredAuto" | "UnmonitoredManual" | "Monitored"; + upgradeMode?: + | "Invalid" + | "UnmonitoredAuto" + | "UnmonitoredManual" + | "Monitored"; /** Determines whether the application should be recreated on update. If value=true, the rest of the upgrade policy parameters are not allowed and it will result in availability loss. */ recreateApplication?: boolean; } +/** The policy used for monitoring the application upgrade */ export interface ArmRollingUpgradeMonitoringPolicyOutput { /** The activation Mode of the service package */ failureAction?: "Rollback" | "Manual"; @@ -626,6 +709,10 @@ export interface ArmRollingUpgradeMonitoringPolicyOutput { upgradeDomainTimeout?: string; } +/** + * Defines a health policy used to evaluate the health of an application or one of its children entities. + * + */ export interface ArmApplicationHealthPolicyOutput { /** Indicates whether warnings are treated with the same severity as errors. */ considerWarningAsError?: boolean; @@ -643,6 +730,10 @@ export interface ArmApplicationHealthPolicyOutput { serviceTypeHealthPolicyMap?: Record; } +/** + * Represents the health policy used to evaluate the health of services belonging to a service type. + * + */ export interface ArmServiceTypeHealthPolicyOutput { /** * The maximum percentage of services allowed to be unhealthy before your application is considered in error. @@ -661,6 +752,10 @@ export interface ArmServiceTypeHealthPolicyOutput { maxPercentUnhealthyReplicasPerPartition?: number; } +/** + * Describes capacity information for a custom resource balancing metric. This can be used to limit the total consumption of this metric by the services of this application. + * + */ export interface ApplicationMetricDescriptionOutput { /** The name of the metric. */ name?: string; @@ -698,25 +793,30 @@ export interface ApplicationUserAssignedIdentityOutput { principalId: string; } +/** The application resource for patch operations. */ export interface ApplicationResourceUpdateOutput extends ProxyResourceOutput { /** The application resource properties for patch operations. */ properties?: ApplicationResourceUpdatePropertiesOutput; } +/** The list of application resources. */ export interface ApplicationResourceListOutput { value?: Array; /** URL to get the next set of application list results if there are any. */ - nextLink?: string; + readonly nextLink?: string; } +/** The service resource. */ export interface ServiceResourceOutput extends ProxyResourceOutput { /** The service resource properties. */ properties?: ServiceResourcePropertiesOutput; } -export interface ServiceResourcePropertiesOutputParent extends ServiceResourcePropertiesBaseOutput { +/** The service resource properties. */ +export interface ServiceResourcePropertiesOutputParent + extends ServiceResourcePropertiesBaseOutput { /** The current deployment or provisioning state, which only appears in the response */ - provisioningState?: string; + readonly provisioningState?: string; /** The name of the service type */ serviceTypeName?: string; /** Describes how the service is partitioned. */ @@ -728,10 +828,16 @@ export interface ServiceResourcePropertiesOutputParent extends ServiceResourcePr serviceKind: "ServiceResourceProperties" | "Stateful" | "Stateless"; } +/** Describes how the service is partitioned. */ export interface PartitionSchemeDescriptionOutputParent { - partitionScheme: "PartitionSchemeDescription" | "Named" | "Singleton" | "UniformInt64Range"; + partitionScheme: + | "PartitionSchemeDescription" + | "Named" + | "Singleton" + | "UniformInt64Range"; } +/** The common service resource properties. */ export interface ServiceResourcePropertiesBaseOutput { /** The placement constraints as a string. Placement constraints are boolean expressions on node properties and allow for restricting a service to particular nodes based on the service requirements. For example, to place a service on nodes where NodeType is blue specify the following: "NodeColor == blue)". */ placementConstraints?: string; @@ -745,6 +851,7 @@ export interface ServiceResourcePropertiesBaseOutput { defaultMoveCost?: "Zero" | "Low" | "Medium" | "High"; } +/** Creates a particular correlation between services. */ export interface ServiceCorrelationDescriptionOutput { /** The ServiceCorrelationScheme which describes the relationship between this service and the service specified via ServiceName. */ scheme: "Invalid" | "Affinity" | "AlignedAffinity" | "NonAlignedAffinity"; @@ -752,6 +859,7 @@ export interface ServiceCorrelationDescriptionOutput { serviceName: string; } +/** Specifies a metric to load balance a service during runtime. */ export interface ServiceLoadMetricDescriptionOutput { /** The name of the metric. If the service chooses to report load during runtime, the load metric name should match the name that is specified in Name exactly. Note that metric names are case sensitive. */ name: string; @@ -765,26 +873,31 @@ export interface ServiceLoadMetricDescriptionOutput { defaultLoad?: number; } +/** Describes the policy to be used for placement of a Service Fabric service. */ export interface ServicePlacementPolicyDescriptionOutput { type: "ServicePlacementPolicyDescription"; } +/** The service resource for patch operations. */ export interface ServiceResourceUpdateOutput extends ProxyResourceOutput { /** The service resource properties for patch operations. */ properties?: ServiceResourceUpdatePropertiesOutput; } +/** The service resource properties for patch operations. */ export interface ServiceResourceUpdatePropertiesOutputParent extends ServiceResourcePropertiesBaseOutput { serviceKind: "ServiceResourceUpdateProperties" | "Stateful" | "Stateless"; } +/** The list of service resources. */ export interface ServiceResourceListOutput { value?: Array; /** URL to get the next set of service list results if there are any. */ - nextLink?: string; + readonly nextLink?: string; } +/** Describes the named partition scheme of the service. */ export interface NamedPartitionSchemeDescriptionOutput extends PartitionSchemeDescriptionOutputParent { /** The number of partitions. */ @@ -794,12 +907,15 @@ export interface NamedPartitionSchemeDescriptionOutput partitionScheme: "Named"; } +/** SingletonPartitionSchemeDescription */ export interface SingletonPartitionSchemeDescriptionOutput extends PartitionSchemeDescriptionOutputParent { partitionScheme: "Singleton"; } -export interface StatefulServicePropertiesOutput extends ServiceResourcePropertiesOutputParent { +/** The properties of a stateful service resource. */ +export interface StatefulServicePropertiesOutput + extends ServiceResourcePropertiesOutputParent { /** A flag indicating whether this is a persistent service which stores states on the local disk. If it is then the value of this property is true, if not it is false. */ hasPersistedState?: boolean; /** The target replica set size as a number. */ @@ -815,6 +931,7 @@ export interface StatefulServicePropertiesOutput extends ServiceResourceProperti serviceKind: "Stateful"; } +/** The properties of a stateful service resource for patch operations. */ export interface StatefulServiceUpdatePropertiesOutput extends ServiceResourceUpdatePropertiesOutputParent { /** The target replica set size as a number. */ @@ -830,7 +947,9 @@ export interface StatefulServiceUpdatePropertiesOutput serviceKind: "Stateful"; } -export interface StatelessServicePropertiesOutput extends ServiceResourcePropertiesOutputParent { +/** The properties of a stateless service resource. */ +export interface StatelessServicePropertiesOutput + extends ServiceResourcePropertiesOutputParent { /** The instance count. */ instanceCount?: number; /** Delay duration for RequestDrain feature to ensures that the endpoint advertised by the stateless instance is removed before the delay starts prior to closing the instance. This delay enables existing requests to drain gracefully before the instance actually goes down (https://docs.microsoft.com/en-us/azure/service-fabric/service-fabric-application-upgrade-advanced#avoid-connection-drops-during-stateless-service-planned-downtime-preview). It is represented in ISO 8601 format (hh:mm:ss.s). */ @@ -838,6 +957,7 @@ export interface StatelessServicePropertiesOutput extends ServiceResourcePropert serviceKind: "Stateless"; } +/** The properties of a stateless service resource for patch operations. */ export interface StatelessServiceUpdatePropertiesOutput extends ServiceResourceUpdatePropertiesOutputParent { /** The instance count. */ @@ -847,6 +967,7 @@ export interface StatelessServiceUpdatePropertiesOutput serviceKind: "Stateless"; } +/** Describes a partitioning scheme where an integer range is allocated evenly across a number of partitions. */ export interface UniformInt64RangePartitionSchemeDescriptionOutput extends PartitionSchemeDescriptionOutputParent { /** The number of partitions. */ @@ -866,13 +987,16 @@ export interface UniformInt64RangePartitionSchemeDescriptionOutput partitionScheme: "UniformInt64Range"; } +/** The service resource properties. */ export type ServiceResourcePropertiesOutput = | StatefulServicePropertiesOutput | StatelessServicePropertiesOutput; +/** Describes how the service is partitioned. */ export type PartitionSchemeDescriptionOutput = | NamedPartitionSchemeDescriptionOutput | SingletonPartitionSchemeDescriptionOutput | UniformInt64RangePartitionSchemeDescriptionOutput; +/** The service resource properties for patch operations. */ export type ServiceResourceUpdatePropertiesOutput = | StatefulServiceUpdatePropertiesOutput | StatelessServiceUpdatePropertiesOutput; diff --git a/sdk/servicefabric/arm-servicefabric-rest/src/paginateHelper.ts b/sdk/servicefabric/arm-servicefabric-rest/src/paginateHelper.ts index 5d541b4e406d..5ef95e5ea0a3 100644 --- a/sdk/servicefabric/arm-servicefabric-rest/src/paginateHelper.ts +++ b/sdk/servicefabric/arm-servicefabric-rest/src/paginateHelper.ts @@ -1,10 +1,162 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -import type { PagedAsyncIterableIterator, PagedResult } from "@azure/core-paging"; -import { getPagedAsyncIterator } from "@azure/core-paging"; -import type { Client, PathUncheckedResponse } from "@azure-rest/core-client"; -import { createRestError } from "@azure-rest/core-client"; +import { + Client, + createRestError, + PathUncheckedResponse, +} from "@azure-rest/core-client"; + +/** + * 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 = PageSettings, + TLink = string, +>( + pagedResult: PagedResult, +): PagedAsyncIterableIterator { + const iter = getItemAsyncIterator( + pagedResult, + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: + pagedResult?.byPage ?? + (((settings?: PageSettings) => { + const { continuationToken } = settings ?? {}; + return getPageAsyncIterator(pagedResult, { + pageLink: continuationToken as unknown as TLink | undefined, + }); + }) as unknown as ( + settings?: TPageSettings, + ) => AsyncIterableIterator), + }; +} + +async function* getItemAsyncIterator( + pagedResult: PagedResult, +): AsyncIterableIterator { + const pages = getPageAsyncIterator(pagedResult); + const firstVal = await pages.next(); + // if the result does not have an array shape, i.e. TPage = TElement, then we return it as is + if (!Array.isArray(firstVal.value)) { + // can extract elements from this page + const { toElements } = pagedResult; + if (toElements) { + yield* toElements(firstVal.value) as TElement[]; + for await (const page of pages) { + yield* toElements(page) as TElement[]; + } + } else { + yield firstVal.value; + // `pages` is of type `AsyncIterableIterator` but TPage = TElement in this case + yield* pages as unknown as AsyncIterableIterator; + } + } else { + yield* firstVal.value; + for await (const page of pages) { + // pages is of type `AsyncIterableIterator` so `page` is of type `TPage`. In this branch, + // it must be the case that `TPage = TElement[]` + yield* page as unknown as TElement[]; + } + } +} + +async function* getPageAsyncIterator( + pagedResult: PagedResult, + options: { + pageLink?: TLink; + } = {}, +): AsyncIterableIterator { + const { pageLink } = options; + let response = await pagedResult.getPage( + pageLink ?? pagedResult.firstPageLink, + ); + if (!response) { + return; + } + yield response.page; + while (response.nextPageLink) { + response = await pagedResult.getPage(response.nextPageLink); + if (!response) { + return; + } + yield response.page; + } +} + +/** + * An interface that tracks the settings for paged iteration + */ +export interface PageSettings { + /** + * 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 = 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< + TElement, + TPage, + TPageSettings + >; + /** + * Return an AsyncIterableIterator that works a page at a time + */ + byPage: (settings?: TPageSettings) => AsyncIterableIterator; +} + +/** + * An interface that describes how to communicate with the service. + */ +interface PagedResult { + /** + * Link to the first page of results. + */ + firstPageLink: TLink; + /** + * A method that returns a page of results. + */ + getPage: ( + pageLink: TLink, + ) => Promise<{ page: TPage; nextPageLink?: TLink } | 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) => unknown[]; +} /** * Helper type to extract the type of an array @@ -14,10 +166,7 @@ export type GetArrayType = T extends Array ? TData : never; /** * The type of a custom function that defines how to get a page and a link to the next one if any. */ -export type GetPage = ( - pageLink: string, - maxPageSize?: number, -) => Promise<{ +export type GetPage = (pageLink: string) => Promise<{ page: TPage; nextPageLink?: string; }>; @@ -69,7 +218,9 @@ export function paginate( typeof customGetPage === "function" ? customGetPage : async (pageLink: string) => { - const result = firstRun ? initialResponse : await client.pathUnchecked(pageLink).get(); + const result = firstRun + ? initialResponse + : await client.pathUnchecked(pageLink).get(); firstRun = false; checkPagingRequest(result); const nextLink = getNextLink(result.body, nextLinkName); @@ -95,7 +246,9 @@ function getNextLink(body: unknown, nextLinkName?: string): string | undefined { const nextLink = (body as Record)[nextLinkName]; if (typeof nextLink !== "string" && typeof nextLink !== "undefined") { - throw new Error(`Body Property ${nextLinkName} should be a string or undefined`); + throw new Error( + `Body Property ${nextLinkName} should be a string or undefined`, + ); } return nextLink; @@ -123,7 +276,18 @@ function getElements(body: unknown, itemName: string): T[] { * Checks if a request failed */ function checkPagingRequest(response: PathUncheckedResponse): void { - const Http2xxStatusCodes = ["200", "201", "202", "203", "204", "205", "206", "207", "208", "226"]; + const Http2xxStatusCodes = [ + "200", + "201", + "202", + "203", + "204", + "205", + "206", + "207", + "208", + "226", + ]; if (!Http2xxStatusCodes.includes(response.status)) { throw createRestError( `Pagination failed with unexpected statusCode ${response.status}`, diff --git a/sdk/servicefabric/arm-servicefabric-rest/src/parameters.ts b/sdk/servicefabric/arm-servicefabric-rest/src/parameters.ts index 76af4682fc88..0ac27932550e 100644 --- a/sdk/servicefabric/arm-servicefabric-rest/src/parameters.ts +++ b/sdk/servicefabric/arm-servicefabric-rest/src/parameters.ts @@ -1,17 +1,17 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -import type { RequestParameters } from "@azure-rest/core-client"; -import type { - ApplicationResource, - ApplicationResourceUpdate, - ApplicationTypeResource, - ApplicationTypeVersionResource, +import { RequestParameters } from "@azure-rest/core-client"; +import { Cluster, ClusterUpdateParameters, + UpgradableVersionsDescription, + ApplicationTypeResource, + ApplicationTypeVersionResource, + ApplicationResource, + ApplicationResourceUpdate, ServiceResource, ServiceResourceUpdate, - UpgradableVersionsDescription, } from "./models"; export type ClustersGetParameters = RequestParameters; @@ -26,9 +26,10 @@ export interface ClustersCreateOrUpdateMediaTypesParam { contentType?: "application/json"; } -export type ClustersCreateOrUpdateParameters = ClustersCreateOrUpdateMediaTypesParam & - ClustersCreateOrUpdateBodyParam & - RequestParameters; +export type ClustersCreateOrUpdateParameters = + ClustersCreateOrUpdateMediaTypesParam & + ClustersCreateOrUpdateBodyParam & + RequestParameters; export interface ClustersUpdateBodyParam { /** The parameters which contains the property value and property name which used to update the cluster configuration. */ @@ -114,9 +115,10 @@ export interface ApplicationsCreateOrUpdateMediaTypesParam { contentType?: "application/json"; } -export type ApplicationsCreateOrUpdateParameters = ApplicationsCreateOrUpdateMediaTypesParam & - ApplicationsCreateOrUpdateBodyParam & - RequestParameters; +export type ApplicationsCreateOrUpdateParameters = + ApplicationsCreateOrUpdateMediaTypesParam & + ApplicationsCreateOrUpdateBodyParam & + RequestParameters; export interface ApplicationsUpdateBodyParam { /** The application resource for patch operations. */ @@ -145,9 +147,10 @@ export interface ServicesCreateOrUpdateMediaTypesParam { contentType?: "application/json"; } -export type ServicesCreateOrUpdateParameters = ServicesCreateOrUpdateMediaTypesParam & - ServicesCreateOrUpdateBodyParam & - RequestParameters; +export type ServicesCreateOrUpdateParameters = + ServicesCreateOrUpdateMediaTypesParam & + ServicesCreateOrUpdateBodyParam & + RequestParameters; export interface ServicesUpdateBodyParam { /** The service resource for patch operations. */ diff --git a/sdk/servicefabric/arm-servicefabric-rest/src/pollingHelper.ts b/sdk/servicefabric/arm-servicefabric-rest/src/pollingHelper.ts index d25daede0b1c..131043e0b2d0 100644 --- a/sdk/servicefabric/arm-servicefabric-rest/src/pollingHelper.ts +++ b/sdk/servicefabric/arm-servicefabric-rest/src/pollingHelper.ts @@ -1,15 +1,87 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -import type { Client, HttpResponse } from "@azure-rest/core-client"; -import type { - LongRunningOperation, - LroEngineOptions, - LroResponse, - PollOperationState, - PollerLike, +import { Client, HttpResponse } from "@azure-rest/core-client"; +import { AbortSignalLike } from "@azure/abort-controller"; +import { + CancelOnProgress, + CreateHttpPollerOptions, + RunningOperation, + OperationResponse, + OperationState, + createHttpPoller, } from "@azure/core-lro"; -import { LroEngine } from "@azure/core-lro"; + +/** + * A simple poller that can be used to poll a long running operation. + */ +export interface SimplePollerLike< + TState extends OperationState, + 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; +} /** * Helper function that builds a Poller object to help polling a long running operation. @@ -18,43 +90,108 @@ import { LroEngine } from "@azure/core-lro"; * @param options - Options to set a resume state or custom polling interval. * @returns - A poller object to poll for operation state updates and eventually get the final response. */ -export function getLongRunningPoller( +export async function getLongRunningPoller( client: Client, initialResponse: TResult, - options: LroEngineOptions> = {}, -): PollerLike, TResult> { - const poller: LongRunningOperation = { - requestMethod: initialResponse.request.method, - requestPath: initialResponse.request.url, + options: CreateHttpPollerOptions> = {}, +): Promise, TResult>> { + const abortController = new AbortController(); + const poller: RunningOperation = { sendInitialRequest: async () => { // In the case of Rest Clients we are building the LRO poller object from a response that's the reason // we are not triggering the initial request here, just extracting the information from the // response we were provided. return getLroResponse(initialResponse); }, - sendPollRequest: async (path) => { + sendPollRequest: async ( + path: string, + pollOptions?: { abortSignal?: AbortSignalLike }, + ) => { // This is the callback that is going to be called to poll the service // to get the latest status. We use the client provided and the polling path // which is an opaque URL provided by caller, the service sends this in one of the following headers: operation-location, azure-asyncoperation or location // depending on the lro pattern that the service implements. If non is provided we default to the initial path. - const response = await client.pathUnchecked(path ?? initialResponse.request.url).get(); + function abortListener(): void { + abortController.abort(); + } + const inputAbortSignal = pollOptions?.abortSignal; + const abortSignal = abortController.signal; + if (inputAbortSignal?.aborted) { + abortController.abort(); + } else if (!abortSignal.aborted) { + inputAbortSignal?.addEventListener("abort", abortListener, { + once: true, + }); + } + let response; + try { + response = await client + .pathUnchecked(path ?? initialResponse.request.url) + .get({ abortSignal }); + } finally { + inputAbortSignal?.removeEventListener("abort", abortListener); + } const lroResponse = getLroResponse(response as TResult); - lroResponse.rawResponse.headers["x-ms-original-url"] = initialResponse.request.url; + lroResponse.rawResponse.headers["x-ms-original-url"] = + initialResponse.request.url; return lroResponse; }, }; - return new LroEngine(poller, options); + options.resolveOnUnsuccessful = options.resolveOnUnsuccessful ?? true; + const httpPoller = createHttpPoller(poller, options); + const simplePoller: SimplePollerLike, TResult> = { + isDone() { + return httpPoller.isDone; + }, + isStopped() { + return abortController.signal.aborted; + }, + getOperationState() { + if (!httpPoller.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 httpPoller.operationState; + }, + getResult() { + return httpPoller.result; + }, + toString() { + if (!httpPoller.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: httpPoller.operationState, + }); + }, + stopPolling() { + abortController.abort(); + }, + onProgress: httpPoller.onProgress, + poll: httpPoller.poll, + pollUntilDone: httpPoller.pollUntilDone, + serialize: httpPoller.serialize, + submitted: httpPoller.submitted, + }; + return simplePoller; } /** - * Converts a Rest Client response to a response that the LRO engine knows about + * Converts a Rest Client response to a response that the LRO implementation understands * @param response - a rest client http response - * @returns - An LRO response that the LRO engine can work with + * @returns - An LRO response that the LRO implementation understands */ -function getLroResponse(response: TResult): LroResponse { +function getLroResponse( + response: TResult, +): OperationResponse { if (Number.isNaN(response.status)) { - throw new TypeError(`Status code of the response is not a number. Value: ${response.status}`); + throw new TypeError( + `Status code of the response is not a number. Value: ${response.status}`, + ); } return { diff --git a/sdk/servicefabric/arm-servicefabric-rest/src/responses.ts b/sdk/servicefabric/arm-servicefabric-rest/src/responses.ts index 47c76472f8d8..7a181954dcd9 100644 --- a/sdk/servicefabric/arm-servicefabric-rest/src/responses.ts +++ b/sdk/servicefabric/arm-servicefabric-rest/src/responses.ts @@ -1,22 +1,22 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -import type { HttpResponse } from "@azure-rest/core-client"; -import type { - ApplicationResourceListOutput, - ApplicationResourceOutput, - ApplicationTypeResourceListOutput, - ApplicationTypeResourceOutput, - ApplicationTypeVersionResourceListOutput, - ApplicationTypeVersionResourceOutput, - ClusterCodeVersionsListResultOutput, - ClusterListResultOutput, +import { HttpResponse } from "@azure-rest/core-client"; +import { ClusterOutput, ErrorModelOutput, + ClusterListResultOutput, + UpgradableVersionPathResultOutput, + ClusterCodeVersionsListResultOutput, OperationListResultOutput, - ServiceResourceListOutput, + ApplicationTypeResourceOutput, + ApplicationTypeResourceListOutput, + ApplicationTypeVersionResourceOutput, + ApplicationTypeVersionResourceListOutput, + ApplicationResourceOutput, + ApplicationResourceListOutput, ServiceResourceOutput, - UpgradableVersionPathResultOutput, + ServiceResourceListOutput, } from "./outputModels"; /** Get a Service Fabric cluster resource created or in the process of being created in the specified resource group. */ @@ -26,7 +26,7 @@ export interface ClustersGet200Response extends HttpResponse { } /** Get a Service Fabric cluster resource created or in the process of being created in the specified resource group. */ -export interface ClustersGetdefaultResponse extends HttpResponse { +export interface ClustersGetDefaultResponse extends HttpResponse { status: string; body: ErrorModelOutput; } @@ -44,7 +44,7 @@ export interface ClustersCreateOrUpdate202Response extends HttpResponse { } /** Create or update a Service Fabric cluster resource with the specified name. */ -export interface ClustersCreateOrUpdatedefaultResponse extends HttpResponse { +export interface ClustersCreateOrUpdateDefaultResponse extends HttpResponse { status: string; body: ErrorModelOutput; } @@ -62,7 +62,7 @@ export interface ClustersUpdate202Response extends HttpResponse { } /** Update the configuration of a Service Fabric cluster resource with the specified name. */ -export interface ClustersUpdatedefaultResponse extends HttpResponse { +export interface ClustersUpdateDefaultResponse extends HttpResponse { status: string; body: ErrorModelOutput; } @@ -70,17 +70,15 @@ export interface ClustersUpdatedefaultResponse extends HttpResponse { /** Delete a Service Fabric cluster resource with the specified name. */ export interface ClustersDelete200Response extends HttpResponse { status: "200"; - body: Record; } /** Delete a Service Fabric cluster resource with the specified name. */ export interface ClustersDelete204Response extends HttpResponse { status: "204"; - body: Record; } /** Delete a Service Fabric cluster resource with the specified name. */ -export interface ClustersDeletedefaultResponse extends HttpResponse { +export interface ClustersDeleteDefaultResponse extends HttpResponse { status: string; body: ErrorModelOutput; } @@ -92,7 +90,8 @@ export interface ClustersListByResourceGroup200Response extends HttpResponse { } /** Gets all Service Fabric cluster resources created or in the process of being created in the resource group. */ -export interface ClustersListByResourceGroupdefaultResponse extends HttpResponse { +export interface ClustersListByResourceGroupDefaultResponse + extends HttpResponse { status: string; body: ErrorModelOutput; } @@ -104,19 +103,21 @@ export interface ClustersList200Response extends HttpResponse { } /** Gets all Service Fabric cluster resources created or in the process of being created in the subscription. */ -export interface ClustersListdefaultResponse extends HttpResponse { +export interface ClustersListDefaultResponse extends HttpResponse { status: string; body: ErrorModelOutput; } /** If a target is not provided, it will get the minimum and maximum versions available from the current cluster version. If a target is given, it will provide the required path to get from the current cluster version to the target version. */ -export interface ClustersListUpgradableVersions200Response extends HttpResponse { +export interface ClustersListUpgradableVersions200Response + extends HttpResponse { status: "200"; body: UpgradableVersionPathResultOutput; } /** If a target is not provided, it will get the minimum and maximum versions available from the current cluster version. If a target is given, it will provide the required path to get from the current cluster version to the target version. */ -export interface ClustersListUpgradableVersionsdefaultResponse extends HttpResponse { +export interface ClustersListUpgradableVersionsDefaultResponse + extends HttpResponse { status: string; body: ErrorModelOutput; } @@ -128,19 +129,21 @@ export interface ClusterVersionsGet200Response extends HttpResponse { } /** Gets information about an available Service Fabric cluster code version. */ -export interface ClusterVersionsGetdefaultResponse extends HttpResponse { +export interface ClusterVersionsGetDefaultResponse extends HttpResponse { status: string; body: ErrorModelOutput; } /** Gets information about an available Service Fabric cluster code version by environment. */ -export interface ClusterVersionsGetByEnvironment200Response extends HttpResponse { +export interface ClusterVersionsGetByEnvironment200Response + extends HttpResponse { status: "200"; body: ClusterCodeVersionsListResultOutput; } /** Gets information about an available Service Fabric cluster code version by environment. */ -export interface ClusterVersionsGetByEnvironmentdefaultResponse extends HttpResponse { +export interface ClusterVersionsGetByEnvironmentDefaultResponse + extends HttpResponse { status: string; body: ErrorModelOutput; } @@ -152,19 +155,21 @@ export interface ClusterVersionsList200Response extends HttpResponse { } /** Gets all available code versions for Service Fabric cluster resources by location. */ -export interface ClusterVersionsListdefaultResponse extends HttpResponse { +export interface ClusterVersionsListDefaultResponse extends HttpResponse { status: string; body: ErrorModelOutput; } /** Gets all available code versions for Service Fabric cluster resources by environment. */ -export interface ClusterVersionsListByEnvironment200Response extends HttpResponse { +export interface ClusterVersionsListByEnvironment200Response + extends HttpResponse { status: "200"; body: ClusterCodeVersionsListResultOutput; } /** Gets all available code versions for Service Fabric cluster resources by environment. */ -export interface ClusterVersionsListByEnvironmentdefaultResponse extends HttpResponse { +export interface ClusterVersionsListByEnvironmentDefaultResponse + extends HttpResponse { status: string; body: ErrorModelOutput; } @@ -176,7 +181,7 @@ export interface OperationsList200Response extends HttpResponse { } /** Get the list of available Service Fabric resource provider API operations. */ -export interface OperationsListdefaultResponse extends HttpResponse { +export interface OperationsListDefaultResponse extends HttpResponse { status: string; body: ErrorModelOutput; } @@ -188,19 +193,21 @@ export interface ApplicationTypesGet200Response extends HttpResponse { } /** Get a Service Fabric application type name resource created or in the process of being created in the Service Fabric cluster resource. */ -export interface ApplicationTypesGetdefaultResponse extends HttpResponse { +export interface ApplicationTypesGetDefaultResponse extends HttpResponse { status: string; body: ErrorModelOutput; } /** Create or update a Service Fabric application type name resource with the specified name. */ -export interface ApplicationTypesCreateOrUpdate200Response extends HttpResponse { +export interface ApplicationTypesCreateOrUpdate200Response + extends HttpResponse { status: "200"; body: ApplicationTypeResourceOutput; } /** Create or update a Service Fabric application type name resource with the specified name. */ -export interface ApplicationTypesCreateOrUpdatedefaultResponse extends HttpResponse { +export interface ApplicationTypesCreateOrUpdateDefaultResponse + extends HttpResponse { status: string; body: ErrorModelOutput; } @@ -208,17 +215,15 @@ export interface ApplicationTypesCreateOrUpdatedefaultResponse extends HttpRespo /** Delete a Service Fabric application type name resource with the specified name. */ export interface ApplicationTypesDelete202Response extends HttpResponse { status: "202"; - body: Record; } /** Delete a Service Fabric application type name resource with the specified name. */ export interface ApplicationTypesDelete204Response extends HttpResponse { status: "204"; - body: Record; } /** Delete a Service Fabric application type name resource with the specified name. */ -export interface ApplicationTypesDeletedefaultResponse extends HttpResponse { +export interface ApplicationTypesDeleteDefaultResponse extends HttpResponse { status: string; body: ErrorModelOutput; } @@ -230,7 +235,7 @@ export interface ApplicationTypesList200Response extends HttpResponse { } /** Gets all application type name resources created or in the process of being created in the Service Fabric cluster resource. */ -export interface ApplicationTypesListdefaultResponse extends HttpResponse { +export interface ApplicationTypesListDefaultResponse extends HttpResponse { status: string; body: ErrorModelOutput; } @@ -242,19 +247,22 @@ export interface ApplicationTypeVersionsGet200Response extends HttpResponse { } /** Get a Service Fabric application type version resource created or in the process of being created in the Service Fabric application type name resource. */ -export interface ApplicationTypeVersionsGetdefaultResponse extends HttpResponse { +export interface ApplicationTypeVersionsGetDefaultResponse + extends HttpResponse { status: string; body: ErrorModelOutput; } /** Create or update a Service Fabric application type version resource with the specified name. */ -export interface ApplicationTypeVersionsCreateOrUpdate202Response extends HttpResponse { +export interface ApplicationTypeVersionsCreateOrUpdate202Response + extends HttpResponse { status: "202"; body: ApplicationTypeVersionResourceOutput; } /** Create or update a Service Fabric application type version resource with the specified name. */ -export interface ApplicationTypeVersionsCreateOrUpdatedefaultResponse extends HttpResponse { +export interface ApplicationTypeVersionsCreateOrUpdateDefaultResponse + extends HttpResponse { status: string; body: ErrorModelOutput; } @@ -262,17 +270,16 @@ export interface ApplicationTypeVersionsCreateOrUpdatedefaultResponse extends Ht /** Delete a Service Fabric application type version resource with the specified name. */ export interface ApplicationTypeVersionsDelete202Response extends HttpResponse { status: "202"; - body: Record; } /** Delete a Service Fabric application type version resource with the specified name. */ export interface ApplicationTypeVersionsDelete204Response extends HttpResponse { status: "204"; - body: Record; } /** Delete a Service Fabric application type version resource with the specified name. */ -export interface ApplicationTypeVersionsDeletedefaultResponse extends HttpResponse { +export interface ApplicationTypeVersionsDeleteDefaultResponse + extends HttpResponse { status: string; body: ErrorModelOutput; } @@ -284,7 +291,8 @@ export interface ApplicationTypeVersionsList200Response extends HttpResponse { } /** Gets all application type version resources created or in the process of being created in the Service Fabric application type name resource. */ -export interface ApplicationTypeVersionsListdefaultResponse extends HttpResponse { +export interface ApplicationTypeVersionsListDefaultResponse + extends HttpResponse { status: string; body: ErrorModelOutput; } @@ -296,7 +304,7 @@ export interface ApplicationsGet200Response extends HttpResponse { } /** Get a Service Fabric application resource created or in the process of being created in the Service Fabric cluster resource. */ -export interface ApplicationsGetdefaultResponse extends HttpResponse { +export interface ApplicationsGetDefaultResponse extends HttpResponse { status: string; body: ErrorModelOutput; } @@ -308,7 +316,8 @@ export interface ApplicationsCreateOrUpdate202Response extends HttpResponse { } /** Create or update a Service Fabric application resource with the specified name. */ -export interface ApplicationsCreateOrUpdatedefaultResponse extends HttpResponse { +export interface ApplicationsCreateOrUpdateDefaultResponse + extends HttpResponse { status: string; body: ErrorModelOutput; } @@ -320,7 +329,7 @@ export interface ApplicationsUpdate202Response extends HttpResponse { } /** Update a Service Fabric application resource with the specified name. */ -export interface ApplicationsUpdatedefaultResponse extends HttpResponse { +export interface ApplicationsUpdateDefaultResponse extends HttpResponse { status: string; body: ErrorModelOutput; } @@ -328,17 +337,15 @@ export interface ApplicationsUpdatedefaultResponse extends HttpResponse { /** Delete a Service Fabric application resource with the specified name. */ export interface ApplicationsDelete202Response extends HttpResponse { status: "202"; - body: Record; } /** Delete a Service Fabric application resource with the specified name. */ export interface ApplicationsDelete204Response extends HttpResponse { status: "204"; - body: Record; } /** Delete a Service Fabric application resource with the specified name. */ -export interface ApplicationsDeletedefaultResponse extends HttpResponse { +export interface ApplicationsDeleteDefaultResponse extends HttpResponse { status: string; body: ErrorModelOutput; } @@ -350,7 +357,7 @@ export interface ApplicationsList200Response extends HttpResponse { } /** Gets all application resources created or in the process of being created in the Service Fabric cluster resource. */ -export interface ApplicationsListdefaultResponse extends HttpResponse { +export interface ApplicationsListDefaultResponse extends HttpResponse { status: string; body: ErrorModelOutput; } @@ -362,7 +369,7 @@ export interface ServicesGet200Response extends HttpResponse { } /** Get a Service Fabric service resource created or in the process of being created in the Service Fabric application resource. */ -export interface ServicesGetdefaultResponse extends HttpResponse { +export interface ServicesGetDefaultResponse extends HttpResponse { status: string; body: ErrorModelOutput; } @@ -374,7 +381,7 @@ export interface ServicesCreateOrUpdate202Response extends HttpResponse { } /** Create or update a Service Fabric service resource with the specified name. */ -export interface ServicesCreateOrUpdatedefaultResponse extends HttpResponse { +export interface ServicesCreateOrUpdateDefaultResponse extends HttpResponse { status: string; body: ErrorModelOutput; } @@ -386,7 +393,7 @@ export interface ServicesUpdate202Response extends HttpResponse { } /** Update a Service Fabric service resource with the specified name. */ -export interface ServicesUpdatedefaultResponse extends HttpResponse { +export interface ServicesUpdateDefaultResponse extends HttpResponse { status: string; body: ErrorModelOutput; } @@ -394,17 +401,15 @@ export interface ServicesUpdatedefaultResponse extends HttpResponse { /** Delete a Service Fabric service resource with the specified name. */ export interface ServicesDelete202Response extends HttpResponse { status: "202"; - body: Record; } /** Delete a Service Fabric service resource with the specified name. */ export interface ServicesDelete204Response extends HttpResponse { status: "204"; - body: Record; } /** Delete a Service Fabric service resource with the specified name. */ -export interface ServicesDeletedefaultResponse extends HttpResponse { +export interface ServicesDeleteDefaultResponse extends HttpResponse { status: string; body: ErrorModelOutput; } @@ -416,7 +421,7 @@ export interface ServicesList200Response extends HttpResponse { } /** Gets all service resources created or in the process of being created in the Service Fabric application resource. */ -export interface ServicesListdefaultResponse extends HttpResponse { +export interface ServicesListDefaultResponse extends HttpResponse { status: string; body: ErrorModelOutput; } diff --git a/sdk/servicefabric/arm-servicefabric-rest/src/serviceFabricClient.ts b/sdk/servicefabric/arm-servicefabric-rest/src/serviceFabricClient.ts index 7f0f0ac1ae4c..7241576acf37 100644 --- a/sdk/servicefabric/arm-servicefabric-rest/src/serviceFabricClient.ts +++ b/sdk/servicefabric/arm-servicefabric-rest/src/serviceFabricClient.ts @@ -1,26 +1,29 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -import type { ClientOptions } from "@azure-rest/core-client"; -import { getClient } from "@azure-rest/core-client"; -import type { TokenCredential } from "@azure/core-auth"; -import type { ServiceFabricClient } from "./clientDefinitions"; -import { customizedApiVersionPolicy } from "./customizedApiVersionPolicy"; +import { getClient, ClientOptions } from "@azure-rest/core-client"; +import { logger } from "./logger"; +import { TokenCredential } from "@azure/core-auth"; +import { ServiceFabricClient } from "./clientDefinitions"; +/** The optional parameters for the client */ +export interface ServiceFabricClientOptions extends ClientOptions { + /** The api version option of the client */ + apiVersion?: string; +} + +/** + * Initialize a new instance of `ServiceFabricClient` + * @param credentials - uniquely identify client credential + * @param options - the parameter for all optional parameters + */ export default function createClient( credentials: TokenCredential, - options: ClientOptions = {}, + { apiVersion = "2021-06-01", ...options }: ServiceFabricClientOptions = {}, ): ServiceFabricClient { - const baseUrl = options.baseUrl ?? "https://management.azure.com"; - options.apiVersion = options.apiVersion ?? "2021-06-01"; - options = { - ...options, - credentials: { - scopes: ["https://management.azure.com/.default"], - }, - }; - - const userAgentInfo = `azsdk-js-arm-servicefabric-rest/1.0.0-beta.1`; + const endpointUrl = + options.endpoint ?? options.baseUrl ?? `https://management.azure.com`; + const userAgentInfo = `azsdk-js-arm-servicefabric-rest/1.0.0-beta.2`; const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix ? `${options.userAgentOptions.userAgentPrefix} ${userAgentInfo}` @@ -30,14 +33,37 @@ export default function createClient( userAgentOptions: { userAgentPrefix, }, + loggingOptions: { + logger: options.loggingOptions?.logger ?? logger.info, + }, + credentials: { + scopes: options.credentials?.scopes ?? [ + "https://management.azure.com/.default", + ], + }, }; + const client = getClient( + endpointUrl, + credentials, + options, + ) as ServiceFabricClient; + + client.pipeline.removePolicy({ name: "ApiVersionPolicy" }); + client.pipeline.addPolicy({ + name: "ClientApiVersionPolicy", + sendRequest: (req, next) => { + // Use the apiVersion defined in request url directly + // Append one if there is no apiVersion and we have one at client options + const url = new URL(req.url); + if (!url.searchParams.get("api-version") && apiVersion) { + req.url = `${req.url}${ + Array.from(url.searchParams.keys()).length > 0 ? "&" : "?" + }api-version=${apiVersion}`; + } - const client = getClient(baseUrl, credentials, options) as ServiceFabricClient; - // Considering ApiVersionPolicy in core has bugs so we replace with our customized one - client.pipeline.removePolicy({ - name: "ApiVersionPolicy", + return next(req); + }, }); - client.pipeline.addPolicy(customizedApiVersionPolicy(options)); return client; } diff --git a/sdk/servicefabric/arm-servicefabric-rest/swagger/README.md b/sdk/servicefabric/arm-servicefabric-rest/swagger/README.md index d1fb9f2ef33a..3eb438740608 100644 --- a/sdk/servicefabric/arm-servicefabric-rest/swagger/README.md +++ b/sdk/servicefabric/arm-servicefabric-rest/swagger/README.md @@ -4,6 +4,8 @@ ## Configuration ```yaml +flavor: azure +openapi-type: arm package-name: "@azure-rest/arm-servicefabric" title: ServiceFabricClient description: Service Fabric Client @@ -18,4 +20,6 @@ package-version: 1.0.0-beta.2 rest-level-client: true security: AADToken security-scopes: "https://management.azure.com/.default" +use-extension: + "@autorest/typescript": "latest" ``` diff --git a/sdk/servicefabric/arm-servicefabric-rest/test/public/utils/env.browser.ts b/sdk/servicefabric/arm-servicefabric-rest/test/public/utils/env.browser.ts deleted file mode 100644 index fc36ab244fad..000000000000 --- a/sdk/servicefabric/arm-servicefabric-rest/test/public/utils/env.browser.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. diff --git a/sdk/servicefabric/arm-servicefabric-rest/test/public/utils/env.ts b/sdk/servicefabric/arm-servicefabric-rest/test/public/utils/env.ts deleted file mode 100644 index 866412f4082d..000000000000 --- a/sdk/servicefabric/arm-servicefabric-rest/test/public/utils/env.ts +++ /dev/null @@ -1,6 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import * as dotenv from "dotenv"; - -dotenv.config(); diff --git a/sdk/servicefabric/arm-servicefabric-rest/test/public/utils/recordedClient.ts b/sdk/servicefabric/arm-servicefabric-rest/test/public/utils/recordedClient.ts index a5b3c9040c21..51a6fe8639a3 100644 --- a/sdk/servicefabric/arm-servicefabric-rest/test/public/utils/recordedClient.ts +++ b/sdk/servicefabric/arm-servicefabric-rest/test/public/utils/recordedClient.ts @@ -8,7 +8,6 @@ import type { ClientOptions } from "@azure-rest/core-client"; import { createTestCredential } from "@azure-tools/test-credential"; import type { ServiceFabricClient } from "../../../src/index"; import ServiceFabricManagementClient from "../../../src/index"; -import "./env"; const envSetupForPlayback: Record = { ENDPOINT: "https://endpoint", diff --git a/sdk/servicefabric/arm-servicefabric-rest/tsconfig.json b/sdk/servicefabric/arm-servicefabric-rest/tsconfig.json index 9686c443aef8..19ceb382b521 100644 --- a/sdk/servicefabric/arm-servicefabric-rest/tsconfig.json +++ b/sdk/servicefabric/arm-servicefabric-rest/tsconfig.json @@ -1,9 +1,13 @@ { - "extends": "../../../tsconfig", - "compilerOptions": { - "outDir": "./dist-esm", - "declarationDir": "./types", - "paths": { "@azure-rest/arm-servicefabric": ["./src/index"] } - }, - "include": ["src/**/*.ts", "./test/**/*.ts", "samples-dev/**/*.ts"] + "references": [ + { + "path": "./tsconfig.src.json" + }, + { + "path": "./tsconfig.samples.json" + }, + { + "path": "./tsconfig.test.json" + } + ] } diff --git a/sdk/servicefabric/arm-servicefabric-rest/tsconfig.samples.json b/sdk/servicefabric/arm-servicefabric-rest/tsconfig.samples.json new file mode 100644 index 000000000000..e06f2e66008d --- /dev/null +++ b/sdk/servicefabric/arm-servicefabric-rest/tsconfig.samples.json @@ -0,0 +1,10 @@ +{ + "extends": "../../../tsconfig.samples.base.json", + "compilerOptions": { + "paths": { + "@azure-rest/arm-servicefabric": [ + "./dist/esm" + ] + } + } +} diff --git a/sdk/servicefabric/arm-servicefabric-rest/tsconfig.src.json b/sdk/servicefabric/arm-servicefabric-rest/tsconfig.src.json new file mode 100644 index 000000000000..bae70752dd38 --- /dev/null +++ b/sdk/servicefabric/arm-servicefabric-rest/tsconfig.src.json @@ -0,0 +1,3 @@ +{ + "extends": "../../../tsconfig.lib.json" +} diff --git a/sdk/servicefabric/arm-servicefabric-rest/tsconfig.test.json b/sdk/servicefabric/arm-servicefabric-rest/tsconfig.test.json new file mode 100644 index 000000000000..3c2b783a8c1b --- /dev/null +++ b/sdk/servicefabric/arm-servicefabric-rest/tsconfig.test.json @@ -0,0 +1,6 @@ +{ + "extends": [ + "./tsconfig.src.json", + "../../../tsconfig.test.base.json" + ] +} From 145562237e47a51c24e86a722965852ac0ec8a4f Mon Sep 17 00:00:00 2001 From: kazrael2119 <98569699+kazrael2119@users.noreply.github.com> Date: Fri, 27 Dec 2024 17:39:28 +0800 Subject: [PATCH 02/16] Migration: Update test config --- .../tsconfig.browser.config.json | 17 +++++++++++++++++ .../vitest.browser.config.ts | 17 +++++++++++++++++ .../arm-servicefabric-rest/vitest.config.ts | 7 +++++++ .../arm-servicefabric-rest/vitest.esm.config.ts | 12 ++++++++++++ 4 files changed, 53 insertions(+) create mode 100644 sdk/servicefabric/arm-servicefabric-rest/tsconfig.browser.config.json create mode 100644 sdk/servicefabric/arm-servicefabric-rest/vitest.browser.config.ts create mode 100644 sdk/servicefabric/arm-servicefabric-rest/vitest.config.ts create mode 100644 sdk/servicefabric/arm-servicefabric-rest/vitest.esm.config.ts diff --git a/sdk/servicefabric/arm-servicefabric-rest/tsconfig.browser.config.json b/sdk/servicefabric/arm-servicefabric-rest/tsconfig.browser.config.json new file mode 100644 index 000000000000..b6586181d006 --- /dev/null +++ b/sdk/servicefabric/arm-servicefabric-rest/tsconfig.browser.config.json @@ -0,0 +1,17 @@ +{ + "extends": "./.tshy/build.json", + "include": [ + "./src/**/*.ts", + "./src/**/*.mts", + "./test/**/*.spec.ts", + "./test/**/*.mts" + ], + "exclude": [ + "./test/**/node/**/*.ts" + ], + "compilerOptions": { + "outDir": "./dist-test/browser", + "rootDir": ".", + "skipLibCheck": true + } +} diff --git a/sdk/servicefabric/arm-servicefabric-rest/vitest.browser.config.ts b/sdk/servicefabric/arm-servicefabric-rest/vitest.browser.config.ts new file mode 100644 index 000000000000..b48c61b2ef46 --- /dev/null +++ b/sdk/servicefabric/arm-servicefabric-rest/vitest.browser.config.ts @@ -0,0 +1,17 @@ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { defineConfig, mergeConfig } from "vitest/config"; +import viteConfig from "../../../vitest.browser.shared.config.ts"; + +export default mergeConfig( + viteConfig, + defineConfig({ + test: { + include: [ + "dist-test/browser/test/**/*.spec.js", + ], + }, + }), +); diff --git a/sdk/servicefabric/arm-servicefabric-rest/vitest.config.ts b/sdk/servicefabric/arm-servicefabric-rest/vitest.config.ts new file mode 100644 index 000000000000..cc5cd85d4131 --- /dev/null +++ b/sdk/servicefabric/arm-servicefabric-rest/vitest.config.ts @@ -0,0 +1,7 @@ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import viteConfig from "../../../vitest.shared.config.ts"; + +export default viteConfig; diff --git a/sdk/servicefabric/arm-servicefabric-rest/vitest.esm.config.ts b/sdk/servicefabric/arm-servicefabric-rest/vitest.esm.config.ts new file mode 100644 index 000000000000..a70127279fc9 --- /dev/null +++ b/sdk/servicefabric/arm-servicefabric-rest/vitest.esm.config.ts @@ -0,0 +1,12 @@ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { mergeConfig } from "vitest/config"; +import vitestConfig from "./vitest.config.ts"; +import vitestEsmConfig from "../../../vitest.esm.shared.config.ts"; + +export default mergeConfig( + vitestConfig, + vitestEsmConfig +); From fddb6d8f679a42729cf59c2185eb9353a61131d7 Mon Sep 17 00:00:00 2001 From: kazrael2119 <98569699+kazrael2119@users.noreply.github.com> Date: Fri, 27 Dec 2024 17:39:28 +0800 Subject: [PATCH 03/16] Migration: Clean up files --- .../arm-servicefabric-rest/karma.conf.js | 133 ------------------ 1 file changed, 133 deletions(-) delete mode 100644 sdk/servicefabric/arm-servicefabric-rest/karma.conf.js diff --git a/sdk/servicefabric/arm-servicefabric-rest/karma.conf.js b/sdk/servicefabric/arm-servicefabric-rest/karma.conf.js deleted file mode 100644 index 4fdf26c79ac0..000000000000 --- a/sdk/servicefabric/arm-servicefabric-rest/karma.conf.js +++ /dev/null @@ -1,133 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -// https://github.com/karma-runner/karma-chrome-launcher -process.env.CHROME_BIN = require("puppeteer").executablePath(); -require("dotenv").config(); -const { relativeRecordingsPath } = require("@azure-tools/test-recorder"); -process.env.RECORDINGS_RELATIVE_PATH = relativeRecordingsPath(); - -module.exports = function (config) { - config.set({ - // base path that will be used to resolve all patterns (eg. files, exclude) - basePath: "./", - - // frameworks to use - // available frameworks: https://npmjs.org/browse/keyword/karma-adapter - frameworks: ["source-map-support", "mocha"], - - plugins: [ - "karma-mocha", - "karma-mocha-reporter", - "karma-chrome-launcher", - "karma-firefox-launcher", - "karma-env-preprocessor", - "karma-coverage", - "karma-sourcemap-loader", - "karma-junit-reporter", - "karma-source-map-support", - ], - - // list of files / patterns to load in the browser - files: [ - "dist-test/index.browser.js", - { - pattern: "dist-test/index.browser.js.map", - type: "html", - included: false, - served: true, - }, - ], - - // list of files / patterns to exclude - exclude: [], - - // preprocess matching files before serving them to the browser - // available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor - preprocessors: { - "**/*.js": ["sourcemap", "env"], - // IMPORTANT: COMMENT following line if you want to debug in your browsers!! - // Preprocess source file to calculate code coverage, however this will make source file unreadable - // "dist-test/index.js": ["coverage"] - }, - - envPreprocessor: [ - "TEST_MODE", - "ENDPOINT", - "AZURE_CLIENT_SECRET", - "AZURE_CLIENT_ID", - "AZURE_TENANT_ID", - "SUBSCRIPTION_ID", - "RECORDINGS_RELATIVE_PATH", - ], - - // test results reporter to use - // possible values: 'dots', 'progress' - // available reporters: https://npmjs.org/browse/keyword/karma-reporter - reporters: ["mocha", "coverage", "junit"], - - coverageReporter: { - // specify a common output directory - dir: "coverage-browser/", - reporters: [ - { type: "json", subdir: ".", file: "coverage.json" }, - { type: "lcovonly", subdir: ".", file: "lcov.info" }, - { type: "html", subdir: "html" }, - { type: "cobertura", subdir: ".", file: "cobertura-coverage.xml" }, - ], - }, - - junitReporter: { - outputDir: "", // results will be saved as $outputDir/$browserName.xml - outputFile: "test-results.browser.xml", // if included, results will be saved as $outputDir/$browserName/$outputFile - suite: "", // suite will become the package name attribute in xml testsuite element - useBrowserName: false, // add browser name to report and classes names - nameFormatter: undefined, // function (browser, result) to customize the name attribute in xml testcase element - classNameFormatter: undefined, // function (browser, result) to customize the classname attribute in xml testcase element - properties: {}, // key value pair of properties to add to the section of the report - }, - - // web server port - port: 9876, - - // enable / disable colors in the output (reporters and logs) - colors: true, - - // level of logging - // possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG - logLevel: config.LOG_INFO, - - // enable / disable watching file and executing tests whenever any file changes - autoWatch: false, - - // --no-sandbox allows our tests to run in Linux without having to change the system. - // --disable-web-security allows us to authenticate from the browser without having to write tests using interactive auth, which would be far more complex. - browsers: ["ChromeHeadlessNoSandbox"], - customLaunchers: { - ChromeHeadlessNoSandbox: { - base: "ChromeHeadless", - flags: ["--no-sandbox", "--disable-web-security"], - }, - }, - - // Continuous Integration mode - // if true, Karma captures browsers, runs the tests and exits - singleRun: false, - - // Concurrency level - // how many browser should be started simultaneous - concurrency: 1, - - browserNoActivityTimeout: 60000000, - browserDisconnectTimeout: 10000, - browserDisconnectTolerance: 3, - - client: { - mocha: { - // change Karma's debug.html to the mocha web reporter - reporter: "html", - timeout: "600000", - }, - }, - }); -}; From e7c408de52eff7cc22ed70d122716fed3cb63c84 Mon Sep 17 00:00:00 2001 From: kazrael2119 <98569699+kazrael2119@users.noreply.github.com> Date: Fri, 27 Dec 2024 17:39:50 +0800 Subject: [PATCH 04/16] Migration: Apply codemod: "fixSourceFile" --- .../src/clientDefinitions.ts | 4 ++-- .../arm-servicefabric-rest/src/index.ts | 20 +++++++++---------- .../src/isUnexpected.ts | 2 +- .../arm-servicefabric-rest/src/parameters.ts | 2 +- .../arm-servicefabric-rest/src/responses.ts | 2 +- .../src/serviceFabricClient.ts | 4 ++-- .../test/public/servicefabric.spec.ts | 11 +++++----- .../test/public/utils/recordedClient.ts | 4 ++-- 8 files changed, 24 insertions(+), 25 deletions(-) diff --git a/sdk/servicefabric/arm-servicefabric-rest/src/clientDefinitions.ts b/sdk/servicefabric/arm-servicefabric-rest/src/clientDefinitions.ts index be389adb17bd..2752c1fe0ec3 100644 --- a/sdk/servicefabric/arm-servicefabric-rest/src/clientDefinitions.ts +++ b/sdk/servicefabric/arm-servicefabric-rest/src/clientDefinitions.ts @@ -32,7 +32,7 @@ import { ServicesUpdateParameters, ServicesDeleteParameters, ServicesListParameters, -} from "./parameters"; +} from "./parameters.js"; import { ClustersGet200Response, ClustersGetDefaultResponse, @@ -101,7 +101,7 @@ import { ServicesDeleteDefaultResponse, ServicesList200Response, ServicesListDefaultResponse, -} from "./responses"; +} from "./responses.js"; import { Client, StreamableMethod } from "@azure-rest/core-client"; export interface ClustersGet { diff --git a/sdk/servicefabric/arm-servicefabric-rest/src/index.ts b/sdk/servicefabric/arm-servicefabric-rest/src/index.ts index afb2f83dfb0c..a5ae5dd49060 100644 --- a/sdk/servicefabric/arm-servicefabric-rest/src/index.ts +++ b/sdk/servicefabric/arm-servicefabric-rest/src/index.ts @@ -1,16 +1,16 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -import ServiceFabricClient from "./serviceFabricClient"; +import ServiceFabricClient from "./serviceFabricClient.js"; -export * from "./serviceFabricClient"; -export * from "./parameters"; -export * from "./responses"; -export * from "./clientDefinitions"; -export * from "./isUnexpected"; -export * from "./models"; -export * from "./outputModels"; -export * from "./paginateHelper"; -export * from "./pollingHelper"; +export * from "./serviceFabricClient.js"; +export * from "./parameters.js"; +export * from "./responses.js"; +export * from "./clientDefinitions.js"; +export * from "./isUnexpected.js"; +export * from "./models.js"; +export * from "./outputModels.js"; +export * from "./paginateHelper.js"; +export * from "./pollingHelper.js"; export default ServiceFabricClient; diff --git a/sdk/servicefabric/arm-servicefabric-rest/src/isUnexpected.ts b/sdk/servicefabric/arm-servicefabric-rest/src/isUnexpected.ts index 081372049bc0..ed60f0445055 100644 --- a/sdk/servicefabric/arm-servicefabric-rest/src/isUnexpected.ts +++ b/sdk/servicefabric/arm-servicefabric-rest/src/isUnexpected.ts @@ -69,7 +69,7 @@ import { ServicesDeleteDefaultResponse, ServicesList200Response, ServicesListDefaultResponse, -} from "./responses"; +} from "./responses.js"; const responseMap: Record = { "GET /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}": diff --git a/sdk/servicefabric/arm-servicefabric-rest/src/parameters.ts b/sdk/servicefabric/arm-servicefabric-rest/src/parameters.ts index 0ac27932550e..449e57ed00cf 100644 --- a/sdk/servicefabric/arm-servicefabric-rest/src/parameters.ts +++ b/sdk/servicefabric/arm-servicefabric-rest/src/parameters.ts @@ -12,7 +12,7 @@ import { ApplicationResourceUpdate, ServiceResource, ServiceResourceUpdate, -} from "./models"; +} from "./models.js"; export type ClustersGetParameters = RequestParameters; diff --git a/sdk/servicefabric/arm-servicefabric-rest/src/responses.ts b/sdk/servicefabric/arm-servicefabric-rest/src/responses.ts index 7a181954dcd9..848b666cab27 100644 --- a/sdk/servicefabric/arm-servicefabric-rest/src/responses.ts +++ b/sdk/servicefabric/arm-servicefabric-rest/src/responses.ts @@ -17,7 +17,7 @@ import { ApplicationResourceListOutput, ServiceResourceOutput, ServiceResourceListOutput, -} from "./outputModels"; +} from "./outputModels.js"; /** Get a Service Fabric cluster resource created or in the process of being created in the specified resource group. */ export interface ClustersGet200Response extends HttpResponse { diff --git a/sdk/servicefabric/arm-servicefabric-rest/src/serviceFabricClient.ts b/sdk/servicefabric/arm-servicefabric-rest/src/serviceFabricClient.ts index 7241576acf37..edd7babd65dc 100644 --- a/sdk/servicefabric/arm-servicefabric-rest/src/serviceFabricClient.ts +++ b/sdk/servicefabric/arm-servicefabric-rest/src/serviceFabricClient.ts @@ -2,9 +2,9 @@ // Licensed under the MIT License. import { getClient, ClientOptions } from "@azure-rest/core-client"; -import { logger } from "./logger"; +import { logger } from "./logger.js"; import { TokenCredential } from "@azure/core-auth"; -import { ServiceFabricClient } from "./clientDefinitions"; +import { ServiceFabricClient } from "./clientDefinitions.js"; /** The optional parameters for the client */ export interface ServiceFabricClientOptions extends ClientOptions { diff --git a/sdk/servicefabric/arm-servicefabric-rest/test/public/servicefabric.spec.ts b/sdk/servicefabric/arm-servicefabric-rest/test/public/servicefabric.spec.ts index e126a801bb73..f3844f690370 100644 --- a/sdk/servicefabric/arm-servicefabric-rest/test/public/servicefabric.spec.ts +++ b/sdk/servicefabric/arm-servicefabric-rest/test/public/servicefabric.spec.ts @@ -4,8 +4,7 @@ import type { Recorder } from "@azure-tools/test-recorder"; import { env, isPlaybackMode } from "@azure-tools/test-recorder"; import { assert } from "chai"; -import { createClient, createRecorder } from "./utils/recordedClient"; -import type { Context } from "mocha"; +import { createClient, createRecorder } from "./utils/recordedClient.js"; import type { ApplicationTypeResourceListOutput, ApplicationTypeResourceOutput, @@ -15,8 +14,8 @@ import type { ClustersCreateOrUpdateParameters, ClustersUpdateParameters, ServiceFabricClient, -} from "../../src/index"; -import { getLongRunningPoller } from "../../src/index"; +} from "../../src/index.js"; +import { getLongRunningPoller } from "../../src/index.js"; export const testPollingOptions = { intervalInMs: isPlaybackMode() ? 0 : undefined, @@ -31,7 +30,7 @@ describe("Service Fabric Rest Level Client Test", () => { let clusterName: string; let applicationTypeName: string; - beforeEach(async function (this: Context) { + beforeEach(async function () { recorder = await createRecorder(this); subscriptionId = env.SUBSCRIPTION_ID || ""; // This is an example of how the environment variables are used @@ -199,7 +198,7 @@ describe("Service Fabric Rest Level Client Test", () => { it("clusters update test", async function () { if (isPlaybackMode()) { - this.skip(); + ctx.skip(); } const parameters: ClustersUpdateParameters = { body: { diff --git a/sdk/servicefabric/arm-servicefabric-rest/test/public/utils/recordedClient.ts b/sdk/servicefabric/arm-servicefabric-rest/test/public/utils/recordedClient.ts index 51a6fe8639a3..7e0df3acbd83 100644 --- a/sdk/servicefabric/arm-servicefabric-rest/test/public/utils/recordedClient.ts +++ b/sdk/servicefabric/arm-servicefabric-rest/test/public/utils/recordedClient.ts @@ -6,8 +6,8 @@ import type { RecorderStartOptions } from "@azure-tools/test-recorder"; import { Recorder } from "@azure-tools/test-recorder"; import type { ClientOptions } from "@azure-rest/core-client"; import { createTestCredential } from "@azure-tools/test-credential"; -import type { ServiceFabricClient } from "../../../src/index"; -import ServiceFabricManagementClient from "../../../src/index"; +import type { ServiceFabricClient } from "../../../src/index.js"; +import ServiceFabricManagementClient from "../../../src/index.js"; const envSetupForPlayback: Record = { ENDPOINT: "https://endpoint", From 0de79aad5a01e46cef02e812be26ffc2858b0c26 Mon Sep 17 00:00:00 2001 From: kazrael2119 <98569699+kazrael2119@users.noreply.github.com> Date: Fri, 27 Dec 2024 17:39:52 +0800 Subject: [PATCH 05/16] Migration: Apply codemod: "fixTestingImports" --- .../arm-servicefabric-rest/test/public/servicefabric.spec.ts | 2 +- .../arm-servicefabric-rest/test/public/utils/recordedClient.ts | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/sdk/servicefabric/arm-servicefabric-rest/test/public/servicefabric.spec.ts b/sdk/servicefabric/arm-servicefabric-rest/test/public/servicefabric.spec.ts index f3844f690370..14a9f09d81b9 100644 --- a/sdk/servicefabric/arm-servicefabric-rest/test/public/servicefabric.spec.ts +++ b/sdk/servicefabric/arm-servicefabric-rest/test/public/servicefabric.spec.ts @@ -3,7 +3,6 @@ import type { Recorder } from "@azure-tools/test-recorder"; import { env, isPlaybackMode } from "@azure-tools/test-recorder"; -import { assert } from "chai"; import { createClient, createRecorder } from "./utils/recordedClient.js"; import type { ApplicationTypeResourceListOutput, @@ -16,6 +15,7 @@ import type { ServiceFabricClient, } from "../../src/index.js"; import { getLongRunningPoller } from "../../src/index.js"; +import { describe, it, assert, beforeEach, afterEach } from "vitest"; export const testPollingOptions = { intervalInMs: isPlaybackMode() ? 0 : undefined, diff --git a/sdk/servicefabric/arm-servicefabric-rest/test/public/utils/recordedClient.ts b/sdk/servicefabric/arm-servicefabric-rest/test/public/utils/recordedClient.ts index 7e0df3acbd83..d5141c6bdafa 100644 --- a/sdk/servicefabric/arm-servicefabric-rest/test/public/utils/recordedClient.ts +++ b/sdk/servicefabric/arm-servicefabric-rest/test/public/utils/recordedClient.ts @@ -1,7 +1,5 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. - -import type { Context } from "mocha"; import type { RecorderStartOptions } from "@azure-tools/test-recorder"; import { Recorder } from "@azure-tools/test-recorder"; import type { ClientOptions } from "@azure-rest/core-client"; From 8b41ffb2ffaa841052ede7ef8c691a5afb7030bc Mon Sep 17 00:00:00 2001 From: kazrael2119 <98569699+kazrael2119@users.noreply.github.com> Date: Fri, 27 Dec 2024 17:39:54 +0800 Subject: [PATCH 06/16] Migration: Apply codemod: "replaceAssertIsRejected" From 2b7ef224a0c8467e2e1141cbe3bf8d4e060bebc2 Mon Sep 17 00:00:00 2001 From: kazrael2119 <98569699+kazrael2119@users.noreply.github.com> Date: Fri, 27 Dec 2024 17:39:55 +0800 Subject: [PATCH 07/16] Migration: Apply codemod: "replaceSinonStub" From 3a87d1104dc2c5256ea9688f7d497566bf99f41e Mon Sep 17 00:00:00 2001 From: kazrael2119 <98569699+kazrael2119@users.noreply.github.com> Date: Fri, 27 Dec 2024 17:39:56 +0800 Subject: [PATCH 08/16] Migration: Apply codemod: "addViHelper" From bdf1aa7997b6aac44134fcbdd98d0333c3cbcb76 Mon Sep 17 00:00:00 2001 From: kazrael2119 <98569699+kazrael2119@users.noreply.github.com> Date: Fri, 27 Dec 2024 17:39:57 +0800 Subject: [PATCH 09/16] Migration: Apply codemod: "replaceSupportTracing" From 31667ec23a3c8f7c9d4ea8ffe3eed8745f4f7692 Mon Sep 17 00:00:00 2001 From: kazrael2119 <98569699+kazrael2119@users.noreply.github.com> Date: Fri, 27 Dec 2024 17:39:58 +0800 Subject: [PATCH 10/16] Migration: Apply codemod: "replaceTestUtils" From cc55db20457f487b98959c5318dcab0cd9e5e4a3 Mon Sep 17 00:00:00 2001 From: kazrael2119 <98569699+kazrael2119@users.noreply.github.com> Date: Fri, 27 Dec 2024 17:40:16 +0800 Subject: [PATCH 11/16] Migration: rushx format --- .../src/clientDefinitions.ts | 76 +++++-------------- .../src/isUnexpected.ts | 59 ++++---------- .../arm-servicefabric-rest/src/models.ts | 59 ++++---------- .../src/outputModels.ts | 45 +++-------- .../src/paginateHelper.ts | 49 +++--------- .../arm-servicefabric-rest/src/parameters.ts | 21 +++-- .../src/pollingHelper.ts | 21 ++--- .../arm-servicefabric-rest/src/responses.ts | 45 ++++------- .../src/serviceFabricClient.ts | 13 +--- .../tsconfig.browser.config.json | 11 +-- .../tsconfig.samples.json | 4 +- .../arm-servicefabric-rest/tsconfig.test.json | 5 +- 12 files changed, 106 insertions(+), 302 deletions(-) diff --git a/sdk/servicefabric/arm-servicefabric-rest/src/clientDefinitions.ts b/sdk/servicefabric/arm-servicefabric-rest/src/clientDefinitions.ts index 2752c1fe0ec3..bd32c4b4d82b 100644 --- a/sdk/servicefabric/arm-servicefabric-rest/src/clientDefinitions.ts +++ b/sdk/servicefabric/arm-servicefabric-rest/src/clientDefinitions.ts @@ -121,17 +121,13 @@ export interface ClustersGet { patch( options: ClustersUpdateParameters, ): StreamableMethod< - | ClustersUpdate200Response - | ClustersUpdate202Response - | ClustersUpdateDefaultResponse + ClustersUpdate200Response | ClustersUpdate202Response | ClustersUpdateDefaultResponse >; /** Delete a Service Fabric cluster resource with the specified name. */ delete( options?: ClustersDeleteParameters, ): StreamableMethod< - | ClustersDelete200Response - | ClustersDelete204Response - | ClustersDeleteDefaultResponse + ClustersDelete200Response | ClustersDelete204Response | ClustersDeleteDefaultResponse >; } @@ -140,8 +136,7 @@ export interface ClustersListByResourceGroup { get( options?: ClustersListByResourceGroupParameters, ): StreamableMethod< - | ClustersListByResourceGroup200Response - | ClustersListByResourceGroupDefaultResponse + ClustersListByResourceGroup200Response | ClustersListByResourceGroupDefaultResponse >; } @@ -157,8 +152,7 @@ export interface ClustersListUpgradableVersions { post( options?: ClustersListUpgradableVersionsParameters, ): StreamableMethod< - | ClustersListUpgradableVersions200Response - | ClustersListUpgradableVersionsDefaultResponse + ClustersListUpgradableVersions200Response | ClustersListUpgradableVersionsDefaultResponse >; } @@ -166,9 +160,7 @@ export interface ClusterVersionsGet { /** Gets information about an available Service Fabric cluster code version. */ get( options?: ClusterVersionsGetParameters, - ): StreamableMethod< - ClusterVersionsGet200Response | ClusterVersionsGetDefaultResponse - >; + ): StreamableMethod; } export interface ClusterVersionsGetByEnvironment { @@ -176,8 +168,7 @@ export interface ClusterVersionsGetByEnvironment { get( options?: ClusterVersionsGetByEnvironmentParameters, ): StreamableMethod< - | ClusterVersionsGetByEnvironment200Response - | ClusterVersionsGetByEnvironmentDefaultResponse + ClusterVersionsGetByEnvironment200Response | ClusterVersionsGetByEnvironmentDefaultResponse >; } @@ -185,9 +176,7 @@ export interface ClusterVersionsList { /** Gets all available code versions for Service Fabric cluster resources by location. */ get( options?: ClusterVersionsListParameters, - ): StreamableMethod< - ClusterVersionsList200Response | ClusterVersionsListDefaultResponse - >; + ): StreamableMethod; } export interface ClusterVersionsListByEnvironment { @@ -195,8 +184,7 @@ export interface ClusterVersionsListByEnvironment { get( options?: ClusterVersionsListByEnvironmentParameters, ): StreamableMethod< - | ClusterVersionsListByEnvironment200Response - | ClusterVersionsListByEnvironmentDefaultResponse + ClusterVersionsListByEnvironment200Response | ClusterVersionsListByEnvironmentDefaultResponse >; } @@ -204,24 +192,19 @@ export interface OperationsList { /** Get the list of available Service Fabric resource provider API operations. */ get( options?: OperationsListParameters, - ): StreamableMethod< - OperationsList200Response | OperationsListDefaultResponse - >; + ): StreamableMethod; } export interface ApplicationTypesGet { /** Get a Service Fabric application type name resource created or in the process of being created in the Service Fabric cluster resource. */ get( options?: ApplicationTypesGetParameters, - ): StreamableMethod< - ApplicationTypesGet200Response | ApplicationTypesGetDefaultResponse - >; + ): StreamableMethod; /** Create or update a Service Fabric application type name resource with the specified name. */ put( options: ApplicationTypesCreateOrUpdateParameters, ): StreamableMethod< - | ApplicationTypesCreateOrUpdate200Response - | ApplicationTypesCreateOrUpdateDefaultResponse + ApplicationTypesCreateOrUpdate200Response | ApplicationTypesCreateOrUpdateDefaultResponse >; /** Delete a Service Fabric application type name resource with the specified name. */ delete( @@ -237,9 +220,7 @@ export interface ApplicationTypesList { /** Gets all application type name resources created or in the process of being created in the Service Fabric cluster resource. */ get( options?: ApplicationTypesListParameters, - ): StreamableMethod< - ApplicationTypesList200Response | ApplicationTypesListDefaultResponse - >; + ): StreamableMethod; } export interface ApplicationTypeVersionsGet { @@ -247,8 +228,7 @@ export interface ApplicationTypeVersionsGet { get( options?: ApplicationTypeVersionsGetParameters, ): StreamableMethod< - | ApplicationTypeVersionsGet200Response - | ApplicationTypeVersionsGetDefaultResponse + ApplicationTypeVersionsGet200Response | ApplicationTypeVersionsGetDefaultResponse >; /** Create or update a Service Fabric application type version resource with the specified name. */ put( @@ -272,8 +252,7 @@ export interface ApplicationTypeVersionsList { get( options?: ApplicationTypeVersionsListParameters, ): StreamableMethod< - | ApplicationTypeVersionsList200Response - | ApplicationTypeVersionsListDefaultResponse + ApplicationTypeVersionsList200Response | ApplicationTypeVersionsListDefaultResponse >; } @@ -281,22 +260,17 @@ export interface ApplicationsGet { /** Get a Service Fabric application resource created or in the process of being created in the Service Fabric cluster resource. */ get( options?: ApplicationsGetParameters, - ): StreamableMethod< - ApplicationsGet200Response | ApplicationsGetDefaultResponse - >; + ): StreamableMethod; /** Create or update a Service Fabric application resource with the specified name. */ put( options: ApplicationsCreateOrUpdateParameters, ): StreamableMethod< - | ApplicationsCreateOrUpdate202Response - | ApplicationsCreateOrUpdateDefaultResponse + ApplicationsCreateOrUpdate202Response | ApplicationsCreateOrUpdateDefaultResponse >; /** Update a Service Fabric application resource with the specified name. */ patch( options: ApplicationsUpdateParameters, - ): StreamableMethod< - ApplicationsUpdate202Response | ApplicationsUpdateDefaultResponse - >; + ): StreamableMethod; /** Delete a Service Fabric application resource with the specified name. */ delete( options?: ApplicationsDeleteParameters, @@ -311,9 +285,7 @@ export interface ApplicationsList { /** Gets all application resources created or in the process of being created in the Service Fabric cluster resource. */ get( options?: ApplicationsListParameters, - ): StreamableMethod< - ApplicationsList200Response | ApplicationsListDefaultResponse - >; + ): StreamableMethod; } export interface ServicesGet { @@ -324,22 +296,16 @@ export interface ServicesGet { /** Create or update a Service Fabric service resource with the specified name. */ put( options: ServicesCreateOrUpdateParameters, - ): StreamableMethod< - ServicesCreateOrUpdate202Response | ServicesCreateOrUpdateDefaultResponse - >; + ): StreamableMethod; /** Update a Service Fabric service resource with the specified name. */ patch( options: ServicesUpdateParameters, - ): StreamableMethod< - ServicesUpdate202Response | ServicesUpdateDefaultResponse - >; + ): StreamableMethod; /** Delete a Service Fabric service resource with the specified name. */ delete( options?: ServicesDeleteParameters, ): StreamableMethod< - | ServicesDelete202Response - | ServicesDelete204Response - | ServicesDeleteDefaultResponse + ServicesDelete202Response | ServicesDelete204Response | ServicesDeleteDefaultResponse >; } diff --git a/sdk/servicefabric/arm-servicefabric-rest/src/isUnexpected.ts b/sdk/servicefabric/arm-servicefabric-rest/src/isUnexpected.ts index ed60f0445055..11c31748d95a 100644 --- a/sdk/servicefabric/arm-servicefabric-rest/src/isUnexpected.ts +++ b/sdk/servicefabric/arm-servicefabric-rest/src/isUnexpected.ts @@ -82,8 +82,7 @@ const responseMap: Record = { ["200", "204"], "GET /subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters": ["200"], - "GET /subscriptions/{subscriptionId}/providers/Microsoft.ServiceFabric/clusters": - ["200"], + "GET /subscriptions/{subscriptionId}/providers/Microsoft.ServiceFabric/clusters": ["200"], "POST /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/listUpgradableVersions": ["200"], "GET /subscriptions/{subscriptionId}/providers/Microsoft.ServiceFabric/locations/{location}/clusterVersions/{clusterVersion}": @@ -143,21 +142,13 @@ export function isUnexpected( | ClustersCreateOrUpdateDefaultResponse, ): response is ClustersCreateOrUpdateDefaultResponse; export function isUnexpected( - response: - | ClustersUpdate200Response - | ClustersUpdate202Response - | ClustersUpdateDefaultResponse, + response: ClustersUpdate200Response | ClustersUpdate202Response | ClustersUpdateDefaultResponse, ): response is ClustersUpdateDefaultResponse; export function isUnexpected( - response: - | ClustersDelete200Response - | ClustersDelete204Response - | ClustersDeleteDefaultResponse, + response: ClustersDelete200Response | ClustersDelete204Response | ClustersDeleteDefaultResponse, ): response is ClustersDeleteDefaultResponse; export function isUnexpected( - response: - | ClustersListByResourceGroup200Response - | ClustersListByResourceGroupDefaultResponse, + response: ClustersListByResourceGroup200Response | ClustersListByResourceGroupDefaultResponse, ): response is ClustersListByResourceGroupDefaultResponse; export function isUnexpected( response: ClustersList200Response | ClustersListDefaultResponse, @@ -201,14 +192,10 @@ export function isUnexpected( | ApplicationTypesDeleteDefaultResponse, ): response is ApplicationTypesDeleteDefaultResponse; export function isUnexpected( - response: - | ApplicationTypesList200Response - | ApplicationTypesListDefaultResponse, + response: ApplicationTypesList200Response | ApplicationTypesListDefaultResponse, ): response is ApplicationTypesListDefaultResponse; export function isUnexpected( - response: - | ApplicationTypeVersionsGet200Response - | ApplicationTypeVersionsGetDefaultResponse, + response: ApplicationTypeVersionsGet200Response | ApplicationTypeVersionsGetDefaultResponse, ): response is ApplicationTypeVersionsGetDefaultResponse; export function isUnexpected( response: @@ -222,17 +209,13 @@ export function isUnexpected( | ApplicationTypeVersionsDeleteDefaultResponse, ): response is ApplicationTypeVersionsDeleteDefaultResponse; export function isUnexpected( - response: - | ApplicationTypeVersionsList200Response - | ApplicationTypeVersionsListDefaultResponse, + response: ApplicationTypeVersionsList200Response | ApplicationTypeVersionsListDefaultResponse, ): response is ApplicationTypeVersionsListDefaultResponse; export function isUnexpected( response: ApplicationsGet200Response | ApplicationsGetDefaultResponse, ): response is ApplicationsGetDefaultResponse; export function isUnexpected( - response: - | ApplicationsCreateOrUpdate202Response - | ApplicationsCreateOrUpdateDefaultResponse, + response: ApplicationsCreateOrUpdate202Response | ApplicationsCreateOrUpdateDefaultResponse, ): response is ApplicationsCreateOrUpdateDefaultResponse; export function isUnexpected( response: ApplicationsUpdate202Response | ApplicationsUpdateDefaultResponse, @@ -250,18 +233,13 @@ export function isUnexpected( response: ServicesGet200Response | ServicesGetDefaultResponse, ): response is ServicesGetDefaultResponse; export function isUnexpected( - response: - | ServicesCreateOrUpdate202Response - | ServicesCreateOrUpdateDefaultResponse, + response: ServicesCreateOrUpdate202Response | ServicesCreateOrUpdateDefaultResponse, ): response is ServicesCreateOrUpdateDefaultResponse; export function isUnexpected( response: ServicesUpdate202Response | ServicesUpdateDefaultResponse, ): response is ServicesUpdateDefaultResponse; export function isUnexpected( - response: - | ServicesDelete202Response - | ServicesDelete204Response - | ServicesDeleteDefaultResponse, + response: ServicesDelete202Response | ServicesDelete204Response | ServicesDeleteDefaultResponse, ): response is ServicesDeleteDefaultResponse; export function isUnexpected( response: ServicesList200Response | ServicesListDefaultResponse, @@ -398,24 +376,17 @@ function getParametrizedPathSuccess(method: string, path: string): string[] { // 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 - ) { + 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] || ""); + const isMatched = new RegExp(`${candidateParts[i]?.slice(start, end)}`).test( + pathParts[j] || "", + ); if (!isMatched) { found = false; diff --git a/sdk/servicefabric/arm-servicefabric-rest/src/models.ts b/sdk/servicefabric/arm-servicefabric-rest/src/models.ts index 3d20175dcee2..c3aae3efba19 100644 --- a/sdk/servicefabric/arm-servicefabric-rest/src/models.ts +++ b/sdk/servicefabric/arm-servicefabric-rest/src/models.ts @@ -14,10 +14,7 @@ export interface Cluster extends Resource { export interface ClusterProperties { /** The list of add-on features to enable in the cluster. */ addOnFeatures?: Array< - | "RepairManager" - | "DnsService" - | "BackupRestoreService" - | "ResourceMonitorService" + "RepairManager" | "DnsService" | "BackupRestoreService" | "ResourceMonitorService" >; /** The AAD authentication settings of the cluster. */ azureActiveDirectory?: AzureActiveDirectory; @@ -428,10 +425,7 @@ export interface ClusterUpdateParameters { export interface ClusterPropertiesUpdateParameters { /** The list of add-on features to enable in the cluster. */ addOnFeatures?: Array< - | "RepairManager" - | "DnsService" - | "BackupRestoreService" - | "ResourceMonitorService" + "RepairManager" | "DnsService" | "BackupRestoreService" | "ResourceMonitorService" >; /** The certificate to use for securing the cluster. The certificate provided will be used for node to node security within the cluster, SSL certificate for cluster management endpoint and default admin client. */ certificate?: CertificateDescription; @@ -531,11 +525,7 @@ export interface ApplicationResource extends ProxyResource { /** Describes the managed identities for an Azure resource. */ export interface ManagedIdentity { /** The type of managed identity for the resource. */ - type?: - | "SystemAssigned" - | "UserAssigned" - | "SystemAssigned, UserAssigned" - | "None"; + type?: "SystemAssigned" | "UserAssigned" | "SystemAssigned, UserAssigned" | "None"; /** * The list of user 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}'. @@ -547,8 +537,7 @@ export interface ManagedIdentity { export interface UserAssignedIdentity {} /** The application resource properties. */ -export interface ApplicationResourceProperties - extends ApplicationResourceUpdateProperties { +export interface ApplicationResourceProperties extends ApplicationResourceUpdateProperties { /** The application type name as defined in the application manifest. */ typeName?: string; } @@ -587,11 +576,7 @@ export interface ApplicationUpgradePolicy { */ applicationHealthPolicy?: ArmApplicationHealthPolicy; /** The mode used to monitor health during a rolling upgrade. The values are UnmonitoredAuto, UnmonitoredManual, and Monitored. */ - upgradeMode?: - | "Invalid" - | "UnmonitoredAuto" - | "UnmonitoredManual" - | "Monitored"; + upgradeMode?: "Invalid" | "UnmonitoredAuto" | "UnmonitoredManual" | "Monitored"; /** Determines whether the application should be recreated on update. If value=true, the rest of the upgrade policy parameters are not allowed and it will result in availability loss. */ recreateApplication?: boolean; } @@ -709,8 +694,7 @@ export interface ServiceResource extends ProxyResource { } /** The service resource properties. */ -export interface ServiceResourcePropertiesParent - extends ServiceResourcePropertiesBase { +export interface ServiceResourcePropertiesParent extends ServiceResourcePropertiesBase { /** The name of the service type */ serviceTypeName?: string; /** Describes how the service is partitioned. */ @@ -724,11 +708,7 @@ export interface ServiceResourcePropertiesParent /** Describes how the service is partitioned. */ export interface PartitionSchemeDescriptionParent { - partitionScheme: - | "PartitionSchemeDescription" - | "Named" - | "Singleton" - | "UniformInt64Range"; + partitionScheme: "PartitionSchemeDescription" | "Named" | "Singleton" | "UniformInt64Range"; } /** The common service resource properties. */ @@ -779,14 +759,12 @@ export interface ServiceResourceUpdate extends ProxyResource { } /** The service resource properties for patch operations. */ -export interface ServiceResourceUpdatePropertiesParent - extends ServiceResourcePropertiesBase { +export interface ServiceResourceUpdatePropertiesParent extends ServiceResourcePropertiesBase { serviceKind: "ServiceResourceUpdateProperties" | "Stateful" | "Stateless"; } /** Describes the named partition scheme of the service. */ -export interface NamedPartitionSchemeDescription - extends PartitionSchemeDescriptionParent { +export interface NamedPartitionSchemeDescription extends PartitionSchemeDescriptionParent { /** The number of partitions. */ count: number; /** Array of size specified by the ‘count’ parameter, for the names of the partitions. */ @@ -795,14 +773,12 @@ export interface NamedPartitionSchemeDescription } /** SingletonPartitionSchemeDescription */ -export interface SingletonPartitionSchemeDescription - extends PartitionSchemeDescriptionParent { +export interface SingletonPartitionSchemeDescription extends PartitionSchemeDescriptionParent { partitionScheme: "Singleton"; } /** The properties of a stateful service resource. */ -export interface StatefulServiceProperties - extends ServiceResourcePropertiesParent { +export interface StatefulServiceProperties extends ServiceResourcePropertiesParent { /** A flag indicating whether this is a persistent service which stores states on the local disk. If it is then the value of this property is true, if not it is false. */ hasPersistedState?: boolean; /** The target replica set size as a number. */ @@ -819,8 +795,7 @@ export interface StatefulServiceProperties } /** The properties of a stateful service resource for patch operations. */ -export interface StatefulServiceUpdateProperties - extends ServiceResourceUpdatePropertiesParent { +export interface StatefulServiceUpdateProperties extends ServiceResourceUpdatePropertiesParent { /** The target replica set size as a number. */ targetReplicaSetSize?: number; /** The minimum replica set size as a number. */ @@ -835,8 +810,7 @@ export interface StatefulServiceUpdateProperties } /** The properties of a stateless service resource. */ -export interface StatelessServiceProperties - extends ServiceResourcePropertiesParent { +export interface StatelessServiceProperties extends ServiceResourcePropertiesParent { /** The instance count. */ instanceCount?: number; /** Delay duration for RequestDrain feature to ensures that the endpoint advertised by the stateless instance is removed before the delay starts prior to closing the instance. This delay enables existing requests to drain gracefully before the instance actually goes down (https://docs.microsoft.com/en-us/azure/service-fabric/service-fabric-application-upgrade-advanced#avoid-connection-drops-during-stateless-service-planned-downtime-preview). It is represented in ISO 8601 format (hh:mm:ss.s). */ @@ -845,8 +819,7 @@ export interface StatelessServiceProperties } /** The properties of a stateless service resource for patch operations. */ -export interface StatelessServiceUpdateProperties - extends ServiceResourceUpdatePropertiesParent { +export interface StatelessServiceUpdateProperties extends ServiceResourceUpdatePropertiesParent { /** The instance count. */ instanceCount?: number; /** Delay duration for RequestDrain feature to ensures that the endpoint advertised by the stateless instance is removed before the delay starts prior to closing the instance. This delay enables existing requests to drain gracefully before the instance actually goes down (https://docs.microsoft.com/en-us/azure/service-fabric/service-fabric-application-upgrade-advanced#avoid-connection-drops-during-stateless-service-planned-downtime-preview). It is first interpreted as a string representing an ISO 8601 duration. It is represented in ISO 8601 format (hh:mm:ss.s). */ @@ -875,9 +848,7 @@ export interface UniformInt64RangePartitionSchemeDescription } /** The service resource properties. */ -export type ServiceResourceProperties = - | StatefulServiceProperties - | StatelessServiceProperties; +export type ServiceResourceProperties = StatefulServiceProperties | StatelessServiceProperties; /** Describes how the service is partitioned. */ export type PartitionSchemeDescription = | NamedPartitionSchemeDescription diff --git a/sdk/servicefabric/arm-servicefabric-rest/src/outputModels.ts b/sdk/servicefabric/arm-servicefabric-rest/src/outputModels.ts index e3dc3fd46cd3..9e244c1de7b4 100644 --- a/sdk/servicefabric/arm-servicefabric-rest/src/outputModels.ts +++ b/sdk/servicefabric/arm-servicefabric-rest/src/outputModels.ts @@ -14,10 +14,7 @@ export interface ClusterOutput extends ResourceOutput { export interface ClusterPropertiesOutput { /** The list of add-on features to enable in the cluster. */ addOnFeatures?: Array< - | "RepairManager" - | "DnsService" - | "BackupRestoreService" - | "ResourceMonitorService" + "RepairManager" | "DnsService" | "BackupRestoreService" | "ResourceMonitorService" >; /** The Service Fabric runtime versions available for this cluster. */ readonly availableClusterVersions?: Array; @@ -373,10 +370,7 @@ export interface ClusterUpgradeDeltaHealthPolicyOutput { */ maxPercentDeltaUnhealthyApplications: number; /** Defines the application delta health policy map used to evaluate the health of an application or one of its child entities when upgrading the cluster. */ - applicationDeltaHealthPolicies?: Record< - string, - ApplicationDeltaHealthPolicyOutput - >; + applicationDeltaHealthPolicies?: Record; } /** @@ -387,10 +381,7 @@ export interface ApplicationDeltaHealthPolicyOutput { /** The delta health policy used by default to evaluate the health of a service type when upgrading the cluster. */ defaultServiceTypeDeltaHealthPolicy?: ServiceTypeDeltaHealthPolicyOutput; /** The map with service type delta health policy per service type name. The map is empty by default. */ - serviceTypeDeltaHealthPolicies?: Record< - string, - ServiceTypeDeltaHealthPolicyOutput - >; + serviceTypeDeltaHealthPolicies?: Record; } /** @@ -583,8 +574,7 @@ export interface ApplicationTypeResourceListOutput { } /** An application type version resource for the specified application type name resource. */ -export interface ApplicationTypeVersionResourceOutput - extends ProxyResourceOutput { +export interface ApplicationTypeVersionResourceOutput extends ProxyResourceOutput { /** The properties of the application type version resource. */ properties?: ApplicationTypeVersionResourcePropertiesOutput; } @@ -621,11 +611,7 @@ export interface ManagedIdentityOutput { /** The tenant id of the managed identity. This property will only be provided for a system assigned identity. */ readonly tenantId?: string; /** The type of managed identity for the resource. */ - type?: - | "SystemAssigned" - | "UserAssigned" - | "SystemAssigned, UserAssigned" - | "None"; + type?: "SystemAssigned" | "UserAssigned" | "SystemAssigned, UserAssigned" | "None"; /** * The list of user 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}'. @@ -684,11 +670,7 @@ export interface ApplicationUpgradePolicyOutput { */ applicationHealthPolicy?: ArmApplicationHealthPolicyOutput; /** The mode used to monitor health during a rolling upgrade. The values are UnmonitoredAuto, UnmonitoredManual, and Monitored. */ - upgradeMode?: - | "Invalid" - | "UnmonitoredAuto" - | "UnmonitoredManual" - | "Monitored"; + upgradeMode?: "Invalid" | "UnmonitoredAuto" | "UnmonitoredManual" | "Monitored"; /** Determines whether the application should be recreated on update. If value=true, the rest of the upgrade policy parameters are not allowed and it will result in availability loss. */ recreateApplication?: boolean; } @@ -813,8 +795,7 @@ export interface ServiceResourceOutput extends ProxyResourceOutput { } /** The service resource properties. */ -export interface ServiceResourcePropertiesOutputParent - extends ServiceResourcePropertiesBaseOutput { +export interface ServiceResourcePropertiesOutputParent extends ServiceResourcePropertiesBaseOutput { /** The current deployment or provisioning state, which only appears in the response */ readonly provisioningState?: string; /** The name of the service type */ @@ -830,11 +811,7 @@ export interface ServiceResourcePropertiesOutputParent /** Describes how the service is partitioned. */ export interface PartitionSchemeDescriptionOutputParent { - partitionScheme: - | "PartitionSchemeDescription" - | "Named" - | "Singleton" - | "UniformInt64Range"; + partitionScheme: "PartitionSchemeDescription" | "Named" | "Singleton" | "UniformInt64Range"; } /** The common service resource properties. */ @@ -914,8 +891,7 @@ export interface SingletonPartitionSchemeDescriptionOutput } /** The properties of a stateful service resource. */ -export interface StatefulServicePropertiesOutput - extends ServiceResourcePropertiesOutputParent { +export interface StatefulServicePropertiesOutput extends ServiceResourcePropertiesOutputParent { /** A flag indicating whether this is a persistent service which stores states on the local disk. If it is then the value of this property is true, if not it is false. */ hasPersistedState?: boolean; /** The target replica set size as a number. */ @@ -948,8 +924,7 @@ export interface StatefulServiceUpdatePropertiesOutput } /** The properties of a stateless service resource. */ -export interface StatelessServicePropertiesOutput - extends ServiceResourcePropertiesOutputParent { +export interface StatelessServicePropertiesOutput extends ServiceResourcePropertiesOutputParent { /** The instance count. */ instanceCount?: number; /** Delay duration for RequestDrain feature to ensures that the endpoint advertised by the stateless instance is removed before the delay starts prior to closing the instance. This delay enables existing requests to drain gracefully before the instance actually goes down (https://docs.microsoft.com/en-us/azure/service-fabric/service-fabric-application-upgrade-advanced#avoid-connection-drops-during-stateless-service-planned-downtime-preview). It is represented in ISO 8601 format (hh:mm:ss.s). */ diff --git a/sdk/servicefabric/arm-servicefabric-rest/src/paginateHelper.ts b/sdk/servicefabric/arm-servicefabric-rest/src/paginateHelper.ts index 5ef95e5ea0a3..a5ee77d86caf 100644 --- a/sdk/servicefabric/arm-servicefabric-rest/src/paginateHelper.ts +++ b/sdk/servicefabric/arm-servicefabric-rest/src/paginateHelper.ts @@ -1,11 +1,7 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -import { - Client, - createRestError, - PathUncheckedResponse, -} from "@azure-rest/core-client"; +import { Client, createRestError, PathUncheckedResponse } from "@azure-rest/core-client"; /** * returns an async iterator that iterates over results. It also has a `byPage` @@ -22,9 +18,7 @@ function getPagedAsyncIterator< >( pagedResult: PagedResult, ): PagedAsyncIterableIterator { - const iter = getItemAsyncIterator( - pagedResult, - ); + const iter = getItemAsyncIterator(pagedResult); return { next() { return iter.next(); @@ -39,9 +33,7 @@ function getPagedAsyncIterator< return getPageAsyncIterator(pagedResult, { pageLink: continuationToken as unknown as TLink | undefined, }); - }) as unknown as ( - settings?: TPageSettings, - ) => AsyncIterableIterator), + }) as unknown as (settings?: TPageSettings) => AsyncIterableIterator), }; } @@ -81,9 +73,7 @@ async function* getPageAsyncIterator( } = {}, ): AsyncIterableIterator { const { pageLink } = options; - let response = await pagedResult.getPage( - pageLink ?? pagedResult.firstPageLink, - ); + let response = await pagedResult.getPage(pageLink ?? pagedResult.firstPageLink); if (!response) { return; } @@ -122,11 +112,7 @@ export interface PagedAsyncIterableIterator< /** * The connection to the async iterator, part of the iteration protocol */ - [Symbol.asyncIterator](): PagedAsyncIterableIterator< - TElement, - TPage, - TPageSettings - >; + [Symbol.asyncIterator](): PagedAsyncIterableIterator; /** * Return an AsyncIterableIterator that works a page at a time */ @@ -144,9 +130,7 @@ interface PagedResult { /** * A method that returns a page of results. */ - getPage: ( - pageLink: TLink, - ) => Promise<{ page: TPage; nextPageLink?: TLink } | undefined>; + getPage: (pageLink: TLink) => Promise<{ page: TPage; nextPageLink?: TLink } | undefined>; /** * a function to implement the `byPage` method on the paged async iterator. */ @@ -218,9 +202,7 @@ export function paginate( typeof customGetPage === "function" ? customGetPage : async (pageLink: string) => { - const result = firstRun - ? initialResponse - : await client.pathUnchecked(pageLink).get(); + const result = firstRun ? initialResponse : await client.pathUnchecked(pageLink).get(); firstRun = false; checkPagingRequest(result); const nextLink = getNextLink(result.body, nextLinkName); @@ -246,9 +228,7 @@ function getNextLink(body: unknown, nextLinkName?: string): string | undefined { const nextLink = (body as Record)[nextLinkName]; if (typeof nextLink !== "string" && typeof nextLink !== "undefined") { - throw new Error( - `Body Property ${nextLinkName} should be a string or undefined`, - ); + throw new Error(`Body Property ${nextLinkName} should be a string or undefined`); } return nextLink; @@ -276,18 +256,7 @@ function getElements(body: unknown, itemName: string): T[] { * Checks if a request failed */ function checkPagingRequest(response: PathUncheckedResponse): void { - const Http2xxStatusCodes = [ - "200", - "201", - "202", - "203", - "204", - "205", - "206", - "207", - "208", - "226", - ]; + const Http2xxStatusCodes = ["200", "201", "202", "203", "204", "205", "206", "207", "208", "226"]; if (!Http2xxStatusCodes.includes(response.status)) { throw createRestError( `Pagination failed with unexpected statusCode ${response.status}`, diff --git a/sdk/servicefabric/arm-servicefabric-rest/src/parameters.ts b/sdk/servicefabric/arm-servicefabric-rest/src/parameters.ts index 449e57ed00cf..a1421c9a1b0f 100644 --- a/sdk/servicefabric/arm-servicefabric-rest/src/parameters.ts +++ b/sdk/servicefabric/arm-servicefabric-rest/src/parameters.ts @@ -26,10 +26,9 @@ export interface ClustersCreateOrUpdateMediaTypesParam { contentType?: "application/json"; } -export type ClustersCreateOrUpdateParameters = - ClustersCreateOrUpdateMediaTypesParam & - ClustersCreateOrUpdateBodyParam & - RequestParameters; +export type ClustersCreateOrUpdateParameters = ClustersCreateOrUpdateMediaTypesParam & + ClustersCreateOrUpdateBodyParam & + RequestParameters; export interface ClustersUpdateBodyParam { /** The parameters which contains the property value and property name which used to update the cluster configuration. */ @@ -115,10 +114,9 @@ export interface ApplicationsCreateOrUpdateMediaTypesParam { contentType?: "application/json"; } -export type ApplicationsCreateOrUpdateParameters = - ApplicationsCreateOrUpdateMediaTypesParam & - ApplicationsCreateOrUpdateBodyParam & - RequestParameters; +export type ApplicationsCreateOrUpdateParameters = ApplicationsCreateOrUpdateMediaTypesParam & + ApplicationsCreateOrUpdateBodyParam & + RequestParameters; export interface ApplicationsUpdateBodyParam { /** The application resource for patch operations. */ @@ -147,10 +145,9 @@ export interface ServicesCreateOrUpdateMediaTypesParam { contentType?: "application/json"; } -export type ServicesCreateOrUpdateParameters = - ServicesCreateOrUpdateMediaTypesParam & - ServicesCreateOrUpdateBodyParam & - RequestParameters; +export type ServicesCreateOrUpdateParameters = ServicesCreateOrUpdateMediaTypesParam & + ServicesCreateOrUpdateBodyParam & + RequestParameters; export interface ServicesUpdateBodyParam { /** The service resource for patch operations. */ diff --git a/sdk/servicefabric/arm-servicefabric-rest/src/pollingHelper.ts b/sdk/servicefabric/arm-servicefabric-rest/src/pollingHelper.ts index 131043e0b2d0..0ff7c2fe9be1 100644 --- a/sdk/servicefabric/arm-servicefabric-rest/src/pollingHelper.ts +++ b/sdk/servicefabric/arm-servicefabric-rest/src/pollingHelper.ts @@ -15,10 +15,7 @@ import { /** * A simple poller that can be used to poll a long running operation. */ -export interface SimplePollerLike< - TState extends OperationState, - TResult, -> { +export interface SimplePollerLike, TResult> { /** * Returns true if the poller has finished polling. */ @@ -42,9 +39,7 @@ export interface SimplePollerLike< /** * Returns a promise that will resolve once the underlying operation is completed. */ - pollUntilDone(pollOptions?: { - abortSignal?: AbortSignalLike; - }): Promise; + pollUntilDone(pollOptions?: { abortSignal?: AbortSignalLike }): Promise; /** * Invokes the provided callback after each polling is completed, * sending the current state of the poller's operation. @@ -103,10 +98,7 @@ export async function getLongRunningPoller( // response we were provided. return getLroResponse(initialResponse); }, - sendPollRequest: async ( - path: string, - pollOptions?: { abortSignal?: AbortSignalLike }, - ) => { + sendPollRequest: async (path: string, pollOptions?: { abortSignal?: AbortSignalLike }) => { // This is the callback that is going to be called to poll the service // to get the latest status. We use the client provided and the polling path // which is an opaque URL provided by caller, the service sends this in one of the following headers: operation-location, azure-asyncoperation or location @@ -132,8 +124,7 @@ export async function getLongRunningPoller( inputAbortSignal?.removeEventListener("abort", abortListener); } const lroResponse = getLroResponse(response as TResult); - lroResponse.rawResponse.headers["x-ms-original-url"] = - initialResponse.request.url; + lroResponse.rawResponse.headers["x-ms-original-url"] = initialResponse.request.url; return lroResponse; }, }; @@ -189,9 +180,7 @@ function getLroResponse( response: TResult, ): OperationResponse { if (Number.isNaN(response.status)) { - throw new TypeError( - `Status code of the response is not a number. Value: ${response.status}`, - ); + throw new TypeError(`Status code of the response is not a number. Value: ${response.status}`); } return { diff --git a/sdk/servicefabric/arm-servicefabric-rest/src/responses.ts b/sdk/servicefabric/arm-servicefabric-rest/src/responses.ts index 848b666cab27..1ddb9b9736ed 100644 --- a/sdk/servicefabric/arm-servicefabric-rest/src/responses.ts +++ b/sdk/servicefabric/arm-servicefabric-rest/src/responses.ts @@ -90,8 +90,7 @@ export interface ClustersListByResourceGroup200Response extends HttpResponse { } /** Gets all Service Fabric cluster resources created or in the process of being created in the resource group. */ -export interface ClustersListByResourceGroupDefaultResponse - extends HttpResponse { +export interface ClustersListByResourceGroupDefaultResponse extends HttpResponse { status: string; body: ErrorModelOutput; } @@ -109,15 +108,13 @@ export interface ClustersListDefaultResponse extends HttpResponse { } /** If a target is not provided, it will get the minimum and maximum versions available from the current cluster version. If a target is given, it will provide the required path to get from the current cluster version to the target version. */ -export interface ClustersListUpgradableVersions200Response - extends HttpResponse { +export interface ClustersListUpgradableVersions200Response extends HttpResponse { status: "200"; body: UpgradableVersionPathResultOutput; } /** If a target is not provided, it will get the minimum and maximum versions available from the current cluster version. If a target is given, it will provide the required path to get from the current cluster version to the target version. */ -export interface ClustersListUpgradableVersionsDefaultResponse - extends HttpResponse { +export interface ClustersListUpgradableVersionsDefaultResponse extends HttpResponse { status: string; body: ErrorModelOutput; } @@ -135,15 +132,13 @@ export interface ClusterVersionsGetDefaultResponse extends HttpResponse { } /** Gets information about an available Service Fabric cluster code version by environment. */ -export interface ClusterVersionsGetByEnvironment200Response - extends HttpResponse { +export interface ClusterVersionsGetByEnvironment200Response extends HttpResponse { status: "200"; body: ClusterCodeVersionsListResultOutput; } /** Gets information about an available Service Fabric cluster code version by environment. */ -export interface ClusterVersionsGetByEnvironmentDefaultResponse - extends HttpResponse { +export interface ClusterVersionsGetByEnvironmentDefaultResponse extends HttpResponse { status: string; body: ErrorModelOutput; } @@ -161,15 +156,13 @@ export interface ClusterVersionsListDefaultResponse extends HttpResponse { } /** Gets all available code versions for Service Fabric cluster resources by environment. */ -export interface ClusterVersionsListByEnvironment200Response - extends HttpResponse { +export interface ClusterVersionsListByEnvironment200Response extends HttpResponse { status: "200"; body: ClusterCodeVersionsListResultOutput; } /** Gets all available code versions for Service Fabric cluster resources by environment. */ -export interface ClusterVersionsListByEnvironmentDefaultResponse - extends HttpResponse { +export interface ClusterVersionsListByEnvironmentDefaultResponse extends HttpResponse { status: string; body: ErrorModelOutput; } @@ -199,15 +192,13 @@ export interface ApplicationTypesGetDefaultResponse extends HttpResponse { } /** Create or update a Service Fabric application type name resource with the specified name. */ -export interface ApplicationTypesCreateOrUpdate200Response - extends HttpResponse { +export interface ApplicationTypesCreateOrUpdate200Response extends HttpResponse { status: "200"; body: ApplicationTypeResourceOutput; } /** Create or update a Service Fabric application type name resource with the specified name. */ -export interface ApplicationTypesCreateOrUpdateDefaultResponse - extends HttpResponse { +export interface ApplicationTypesCreateOrUpdateDefaultResponse extends HttpResponse { status: string; body: ErrorModelOutput; } @@ -247,22 +238,19 @@ export interface ApplicationTypeVersionsGet200Response extends HttpResponse { } /** Get a Service Fabric application type version resource created or in the process of being created in the Service Fabric application type name resource. */ -export interface ApplicationTypeVersionsGetDefaultResponse - extends HttpResponse { +export interface ApplicationTypeVersionsGetDefaultResponse extends HttpResponse { status: string; body: ErrorModelOutput; } /** Create or update a Service Fabric application type version resource with the specified name. */ -export interface ApplicationTypeVersionsCreateOrUpdate202Response - extends HttpResponse { +export interface ApplicationTypeVersionsCreateOrUpdate202Response extends HttpResponse { status: "202"; body: ApplicationTypeVersionResourceOutput; } /** Create or update a Service Fabric application type version resource with the specified name. */ -export interface ApplicationTypeVersionsCreateOrUpdateDefaultResponse - extends HttpResponse { +export interface ApplicationTypeVersionsCreateOrUpdateDefaultResponse extends HttpResponse { status: string; body: ErrorModelOutput; } @@ -278,8 +266,7 @@ export interface ApplicationTypeVersionsDelete204Response extends HttpResponse { } /** Delete a Service Fabric application type version resource with the specified name. */ -export interface ApplicationTypeVersionsDeleteDefaultResponse - extends HttpResponse { +export interface ApplicationTypeVersionsDeleteDefaultResponse extends HttpResponse { status: string; body: ErrorModelOutput; } @@ -291,8 +278,7 @@ export interface ApplicationTypeVersionsList200Response extends HttpResponse { } /** Gets all application type version resources created or in the process of being created in the Service Fabric application type name resource. */ -export interface ApplicationTypeVersionsListDefaultResponse - extends HttpResponse { +export interface ApplicationTypeVersionsListDefaultResponse extends HttpResponse { status: string; body: ErrorModelOutput; } @@ -316,8 +302,7 @@ export interface ApplicationsCreateOrUpdate202Response extends HttpResponse { } /** Create or update a Service Fabric application resource with the specified name. */ -export interface ApplicationsCreateOrUpdateDefaultResponse - extends HttpResponse { +export interface ApplicationsCreateOrUpdateDefaultResponse extends HttpResponse { status: string; body: ErrorModelOutput; } diff --git a/sdk/servicefabric/arm-servicefabric-rest/src/serviceFabricClient.ts b/sdk/servicefabric/arm-servicefabric-rest/src/serviceFabricClient.ts index edd7babd65dc..90c43480fd7b 100644 --- a/sdk/servicefabric/arm-servicefabric-rest/src/serviceFabricClient.ts +++ b/sdk/servicefabric/arm-servicefabric-rest/src/serviceFabricClient.ts @@ -21,8 +21,7 @@ export default function createClient( credentials: TokenCredential, { apiVersion = "2021-06-01", ...options }: ServiceFabricClientOptions = {}, ): ServiceFabricClient { - const endpointUrl = - options.endpoint ?? options.baseUrl ?? `https://management.azure.com`; + const endpointUrl = options.endpoint ?? options.baseUrl ?? `https://management.azure.com`; const userAgentInfo = `azsdk-js-arm-servicefabric-rest/1.0.0-beta.2`; const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix @@ -37,16 +36,10 @@ export default function createClient( logger: options.loggingOptions?.logger ?? logger.info, }, credentials: { - scopes: options.credentials?.scopes ?? [ - "https://management.azure.com/.default", - ], + scopes: options.credentials?.scopes ?? ["https://management.azure.com/.default"], }, }; - const client = getClient( - endpointUrl, - credentials, - options, - ) as ServiceFabricClient; + const client = getClient(endpointUrl, credentials, options) as ServiceFabricClient; client.pipeline.removePolicy({ name: "ApiVersionPolicy" }); client.pipeline.addPolicy({ diff --git a/sdk/servicefabric/arm-servicefabric-rest/tsconfig.browser.config.json b/sdk/servicefabric/arm-servicefabric-rest/tsconfig.browser.config.json index b6586181d006..f772e6eb3b76 100644 --- a/sdk/servicefabric/arm-servicefabric-rest/tsconfig.browser.config.json +++ b/sdk/servicefabric/arm-servicefabric-rest/tsconfig.browser.config.json @@ -1,14 +1,7 @@ { "extends": "./.tshy/build.json", - "include": [ - "./src/**/*.ts", - "./src/**/*.mts", - "./test/**/*.spec.ts", - "./test/**/*.mts" - ], - "exclude": [ - "./test/**/node/**/*.ts" - ], + "include": ["./src/**/*.ts", "./src/**/*.mts", "./test/**/*.spec.ts", "./test/**/*.mts"], + "exclude": ["./test/**/node/**/*.ts"], "compilerOptions": { "outDir": "./dist-test/browser", "rootDir": ".", diff --git a/sdk/servicefabric/arm-servicefabric-rest/tsconfig.samples.json b/sdk/servicefabric/arm-servicefabric-rest/tsconfig.samples.json index e06f2e66008d..396a751add04 100644 --- a/sdk/servicefabric/arm-servicefabric-rest/tsconfig.samples.json +++ b/sdk/servicefabric/arm-servicefabric-rest/tsconfig.samples.json @@ -2,9 +2,7 @@ "extends": "../../../tsconfig.samples.base.json", "compilerOptions": { "paths": { - "@azure-rest/arm-servicefabric": [ - "./dist/esm" - ] + "@azure-rest/arm-servicefabric": ["./dist/esm"] } } } diff --git a/sdk/servicefabric/arm-servicefabric-rest/tsconfig.test.json b/sdk/servicefabric/arm-servicefabric-rest/tsconfig.test.json index 3c2b783a8c1b..290ca214aebc 100644 --- a/sdk/servicefabric/arm-servicefabric-rest/tsconfig.test.json +++ b/sdk/servicefabric/arm-servicefabric-rest/tsconfig.test.json @@ -1,6 +1,3 @@ { - "extends": [ - "./tsconfig.src.json", - "../../../tsconfig.test.base.json" - ] + "extends": ["./tsconfig.src.json", "../../../tsconfig.test.base.json"] } From e65cb9f1eddb43ba55d8bb6d02b615b64c8d0333 Mon Sep 17 00:00:00 2001 From: kazrael2119 <98569699+kazrael2119@users.noreply.github.com> Date: Fri, 27 Dec 2024 17:45:52 +0800 Subject: [PATCH 12/16] update --- common/config/rush/pnpm-lock.yaml | 48 +- .../arm-servicefabric-rest/package.json | 29 +- .../review/arm-servicefabric.api.md | 624 +++++++++--------- .../applicationTypesDeleteSample.ts | 2 +- .../clustersCreateOrUpdateSample.ts | 4 +- .../samples-dev/clustersUpdateSample.ts | 2 +- .../applicationTypesDeleteSample.js | 2 +- .../clustersCreateOrUpdateSample.js | 4 +- .../javascript/clustersUpdateSample.js | 2 +- .../src/applicationTypesDeleteSample.ts | 2 +- .../src/clustersCreateOrUpdateSample.ts | 4 +- .../typescript/src/clustersUpdateSample.ts | 2 +- .../test/public/servicefabric.spec.ts | 32 +- .../test/public/utils/recordedClient.ts | 6 +- .../arm-servicefabric-rest/vitest.config.ts | 12 +- 15 files changed, 388 insertions(+), 387 deletions(-) diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index 78970280806a..db75fffdc63b 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -702,7 +702,7 @@ importers: version: file:projects/arm-servicebus.tgz '@rush-temp/arm-servicefabric': specifier: file:./projects/arm-servicefabric.tgz - version: file:projects/arm-servicefabric.tgz + version: file:projects/arm-servicefabric.tgz(msw@2.7.0(@types/node@22.7.9)(typescript@5.7.2))(vite@5.4.11(@types/node@22.7.9)) '@rush-temp/arm-servicefabric-1': specifier: file:./projects/arm-servicefabric-1.tgz version: file:projects/arm-servicefabric-1.tgz @@ -3411,7 +3411,7 @@ packages: version: 0.0.0 '@rush-temp/arm-servicefabric@file:projects/arm-servicefabric.tgz': - resolution: {integrity: sha512-onlinX89I6AcQvlV8+4aNVn8e/yXskZBfMMemAFYVM9GS9AX3Em6JTXRO/3ZD9qu7Zf+wyrE2yRr6OmcJn/jEg==, tarball: file:projects/arm-servicefabric.tgz} + resolution: {integrity: sha512-T6bNn8jCYAsb8rtLUdc44u0lBaehljxhAf1KcwXmNWR4PRIAZsPqx4UvF7JrgTiXBf38OwZObQkp3doLI/ly/g==, tarball: file:projects/arm-servicefabric.tgz} version: 0.0.0 '@rush-temp/arm-servicefabricmanagedclusters@file:projects/arm-servicefabricmanagedclusters.tgz': @@ -14862,43 +14862,39 @@ snapshots: - '@swc/wasm' - supports-color - '@rush-temp/arm-servicefabric@file:projects/arm-servicefabric.tgz': + '@rush-temp/arm-servicefabric@file:projects/arm-servicefabric.tgz(msw@2.7.0(@types/node@22.7.9)(typescript@5.7.2))(vite@5.4.11(@types/node@22.7.9))': dependencies: '@azure-rest/core-client': 1.4.0 - '@azure-tools/test-credential': 1.3.1 - '@azure-tools/test-recorder': 3.5.2 - '@azure/core-lro': 2.7.2 - '@types/chai': 4.3.20 - '@types/mocha': 10.0.10 '@types/node': 18.19.68 + '@vitest/browser': 2.1.8(@types/node@18.19.68)(playwright@1.49.1)(typescript@5.7.2)(vite@5.4.11(@types/node@22.7.9))(vitest@2.1.8) + '@vitest/coverage-istanbul': 2.1.8(vitest@2.1.8) autorest: 3.7.1 - chai: 4.5.0 dotenv: 16.4.7 eslint: 9.17.0 - karma: 6.4.4 - karma-chrome-launcher: 3.2.0 - karma-coverage: 2.2.1 - karma-env-preprocessor: 0.1.1 - karma-firefox-launcher: 2.1.3 - karma-junit-reporter: 2.0.1(karma@6.4.4) - karma-mocha: 2.0.1 - karma-mocha-reporter: 2.2.5(karma@6.4.4) - karma-source-map-support: 1.4.0 - karma-sourcemap-loader: 0.3.8 - mocha: 11.0.2 - nyc: 17.1.0 - source-map-support: 0.5.21 - ts-node: 10.9.2(@types/node@18.19.68)(typescript@5.7.2) + playwright: 1.49.1 tslib: 2.8.1 typescript: 5.7.2 + vitest: 2.1.8(@types/node@18.19.68)(@vitest/browser@2.1.8)(msw@2.7.0(@types/node@22.7.9)(typescript@5.7.2)) transitivePeerDependencies: - - '@swc/core' - - '@swc/wasm' + - '@edge-runtime/vm' + - '@vitest/ui' - bufferutil - - debug + - happy-dom - jiti + - jsdom + - less + - lightningcss + - msw + - safaridriver + - sass + - sass-embedded + - stylus + - sugarss - supports-color + - terser - utf-8-validate + - vite + - webdriverio '@rush-temp/arm-servicefabricmanagedclusters@file:projects/arm-servicefabricmanagedclusters.tgz': dependencies: diff --git a/sdk/servicefabric/arm-servicefabric-rest/package.json b/sdk/servicefabric/arm-servicefabric-rest/package.json index 9e918bb2ed14..bf6ffe56cc63 100644 --- a/sdk/servicefabric/arm-servicefabric-rest/package.json +++ b/sdk/servicefabric/arm-servicefabric-rest/package.json @@ -13,9 +13,9 @@ "isomorphic" ], "license": "MIT", - "main": "dist/index.js", - "module": "./dist-esm/src/index.js", - "types": "./types/arm-servicefabric.d.ts", + "main": "./dist/commonjs/index.js", + "module": "./dist/esm/index.js", + "types": "./dist/commonjs/index.d.ts", "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/servicefabric/arm-servicefabric-rest/README.md", "repository": "github:Azure/azure-sdk-for-js", "bugs": { @@ -119,5 +119,26 @@ ], "selfLink": false }, - "react-native": "./dist/react-native/index.js" + "react-native": "./dist/react-native/index.js", + "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" + } + } + } } diff --git a/sdk/servicefabric/arm-servicefabric-rest/review/arm-servicefabric.api.md b/sdk/servicefabric/arm-servicefabric-rest/review/arm-servicefabric.api.md index a0033d6df5f4..18cf7310fbc7 100644 --- a/sdk/servicefabric/arm-servicefabric-rest/review/arm-servicefabric.api.md +++ b/sdk/servicefabric/arm-servicefabric-rest/review/arm-servicefabric.api.md @@ -4,43 +4,43 @@ ```ts -import type { Client } from '@azure-rest/core-client'; -import type { ClientOptions } from '@azure-rest/core-client'; -import type { HttpResponse } from '@azure-rest/core-client'; -import type { LroEngineOptions } from '@azure/core-lro'; -import type { PagedAsyncIterableIterator } from '@azure/core-paging'; -import type { PathUncheckedResponse } from '@azure-rest/core-client'; -import type { PollerLike } from '@azure/core-lro'; -import type { PollOperationState } from '@azure/core-lro'; -import type { RequestParameters } from '@azure-rest/core-client'; -import type { StreamableMethod } from '@azure-rest/core-client'; -import type { TokenCredential } from '@azure/core-auth'; +import { AbortSignalLike } from '@azure/abort-controller'; +import { CancelOnProgress } from '@azure/core-lro'; +import { Client } from '@azure-rest/core-client'; +import { ClientOptions } from '@azure-rest/core-client'; +import { CreateHttpPollerOptions } from '@azure/core-lro'; +import { HttpResponse } from '@azure-rest/core-client'; +import { OperationState } from '@azure/core-lro'; +import { PathUncheckedResponse } from '@azure-rest/core-client'; +import { RequestParameters } from '@azure-rest/core-client'; +import { StreamableMethod } from '@azure-rest/core-client'; +import { TokenCredential } from '@azure/core-auth'; -// @public (undocumented) +// @public export interface ApplicationDeltaHealthPolicy { defaultServiceTypeDeltaHealthPolicy?: ServiceTypeDeltaHealthPolicy; serviceTypeDeltaHealthPolicies?: Record; } -// @public (undocumented) +// @public export interface ApplicationDeltaHealthPolicyOutput { defaultServiceTypeDeltaHealthPolicy?: ServiceTypeDeltaHealthPolicyOutput; serviceTypeDeltaHealthPolicies?: Record; } -// @public (undocumented) +// @public export interface ApplicationHealthPolicy { defaultServiceTypeHealthPolicy?: ServiceTypeHealthPolicy; serviceTypeHealthPolicies?: Record; } -// @public (undocumented) +// @public export interface ApplicationHealthPolicyOutput { defaultServiceTypeHealthPolicy?: ServiceTypeHealthPolicyOutput; serviceTypeHealthPolicies?: Record; } -// @public (undocumented) +// @public export interface ApplicationMetricDescription { maximumCapacity?: number; name?: string; @@ -48,7 +48,7 @@ export interface ApplicationMetricDescription { totalApplicationCapacity?: number; } -// @public (undocumented) +// @public export interface ApplicationMetricDescriptionOutput { maximumCapacity?: number; name?: string; @@ -56,48 +56,47 @@ export interface ApplicationMetricDescriptionOutput { totalApplicationCapacity?: number; } -// @public (undocumented) +// @public export interface ApplicationResource extends ProxyResource { identity?: ManagedIdentity; properties?: ApplicationResourceProperties; } -// @public (undocumented) +// @public export interface ApplicationResourceListOutput { - nextLink?: string; + readonly nextLink?: string; // (undocumented) value?: Array; } -// @public (undocumented) +// @public export interface ApplicationResourceOutput extends ProxyResourceOutput { identity?: ManagedIdentityOutput; properties?: ApplicationResourcePropertiesOutput; } -// @public (undocumented) +// @public export interface ApplicationResourceProperties extends ApplicationResourceUpdateProperties { - provisioningState?: string; typeName?: string; } -// @public (undocumented) +// @public export interface ApplicationResourcePropertiesOutput extends ApplicationResourceUpdatePropertiesOutput { - provisioningState?: string; + readonly provisioningState?: string; typeName?: string; } -// @public (undocumented) +// @public export interface ApplicationResourceUpdate extends ProxyResource { properties?: ApplicationResourceUpdateProperties; } -// @public (undocumented) +// @public export interface ApplicationResourceUpdateOutput extends ProxyResourceOutput { properties?: ApplicationResourceUpdatePropertiesOutput; } -// @public (undocumented) +// @public export interface ApplicationResourceUpdateProperties { managedIdentities?: Array; maximumNodes?: number; @@ -109,7 +108,7 @@ export interface ApplicationResourceUpdateProperties { upgradePolicy?: ApplicationUpgradePolicy; } -// @public (undocumented) +// @public export interface ApplicationResourceUpdatePropertiesOutput { managedIdentities?: Array; maximumNodes?: number; @@ -135,7 +134,7 @@ export interface ApplicationsCreateOrUpdateBodyParam { } // @public -export interface ApplicationsCreateOrUpdatedefaultResponse extends HttpResponse { +export interface ApplicationsCreateOrUpdateDefaultResponse extends HttpResponse { // (undocumented) body: ErrorModelOutput; // (undocumented) @@ -152,22 +151,18 @@ export type ApplicationsCreateOrUpdateParameters = ApplicationsCreateOrUpdateMed // @public export interface ApplicationsDelete202Response extends HttpResponse { - // (undocumented) - body: Record; // (undocumented) status: "202"; } // @public export interface ApplicationsDelete204Response extends HttpResponse { - // (undocumented) - body: Record; // (undocumented) status: "204"; } // @public -export interface ApplicationsDeletedefaultResponse extends HttpResponse { +export interface ApplicationsDeleteDefaultResponse extends HttpResponse { // (undocumented) body: ErrorModelOutput; // (undocumented) @@ -179,10 +174,10 @@ export type ApplicationsDeleteParameters = RequestParameters; // @public (undocumented) export interface ApplicationsGet { - delete(options?: ApplicationsDeleteParameters): StreamableMethod; - get(options?: ApplicationsGetParameters): StreamableMethod; - patch(options: ApplicationsUpdateParameters): StreamableMethod; - put(options: ApplicationsCreateOrUpdateParameters): StreamableMethod; + delete(options?: ApplicationsDeleteParameters): StreamableMethod; + get(options?: ApplicationsGetParameters): StreamableMethod; + patch(options: ApplicationsUpdateParameters): StreamableMethod; + put(options: ApplicationsCreateOrUpdateParameters): StreamableMethod; } // @public @@ -194,7 +189,7 @@ export interface ApplicationsGet200Response extends HttpResponse { } // @public -export interface ApplicationsGetdefaultResponse extends HttpResponse { +export interface ApplicationsGetDefaultResponse extends HttpResponse { // (undocumented) body: ErrorModelOutput; // (undocumented) @@ -206,7 +201,7 @@ export type ApplicationsGetParameters = RequestParameters; // @public (undocumented) export interface ApplicationsList { - get(options?: ApplicationsListParameters): StreamableMethod; + get(options?: ApplicationsListParameters): StreamableMethod; } // @public @@ -218,7 +213,7 @@ export interface ApplicationsList200Response extends HttpResponse { } // @public -export interface ApplicationsListdefaultResponse extends HttpResponse { +export interface ApplicationsListDefaultResponse extends HttpResponse { // (undocumented) body: ErrorModelOutput; // (undocumented) @@ -242,7 +237,7 @@ export interface ApplicationsUpdateBodyParam { } // @public -export interface ApplicationsUpdatedefaultResponse extends HttpResponse { +export interface ApplicationsUpdateDefaultResponse extends HttpResponse { // (undocumented) body: ErrorModelOutput; // (undocumented) @@ -257,31 +252,30 @@ export interface ApplicationsUpdateMediaTypesParam { // @public (undocumented) export type ApplicationsUpdateParameters = ApplicationsUpdateMediaTypesParam & ApplicationsUpdateBodyParam & RequestParameters; -// @public (undocumented) +// @public export interface ApplicationTypeResource extends ProxyResource { properties?: ApplicationTypeResourceProperties; } -// @public (undocumented) +// @public export interface ApplicationTypeResourceListOutput { - nextLink?: string; + readonly nextLink?: string; // (undocumented) value?: Array; } -// @public (undocumented) +// @public export interface ApplicationTypeResourceOutput extends ProxyResourceOutput { properties?: ApplicationTypeResourcePropertiesOutput; } -// @public (undocumented) +// @public export interface ApplicationTypeResourceProperties { - provisioningState?: string; } -// @public (undocumented) +// @public export interface ApplicationTypeResourcePropertiesOutput { - provisioningState?: string; + readonly provisioningState?: string; } // @public @@ -298,7 +292,7 @@ export interface ApplicationTypesCreateOrUpdateBodyParam { } // @public -export interface ApplicationTypesCreateOrUpdatedefaultResponse extends HttpResponse { +export interface ApplicationTypesCreateOrUpdateDefaultResponse extends HttpResponse { // (undocumented) body: ErrorModelOutput; // (undocumented) @@ -315,22 +309,18 @@ export type ApplicationTypesCreateOrUpdateParameters = ApplicationTypesCreateOrU // @public export interface ApplicationTypesDelete202Response extends HttpResponse { - // (undocumented) - body: Record; // (undocumented) status: "202"; } // @public export interface ApplicationTypesDelete204Response extends HttpResponse { - // (undocumented) - body: Record; // (undocumented) status: "204"; } // @public -export interface ApplicationTypesDeletedefaultResponse extends HttpResponse { +export interface ApplicationTypesDeleteDefaultResponse extends HttpResponse { // (undocumented) body: ErrorModelOutput; // (undocumented) @@ -342,9 +332,9 @@ export type ApplicationTypesDeleteParameters = RequestParameters; // @public (undocumented) export interface ApplicationTypesGet { - delete(options?: ApplicationTypesDeleteParameters): StreamableMethod; - get(options?: ApplicationTypesGetParameters): StreamableMethod; - put(options: ApplicationTypesCreateOrUpdateParameters): StreamableMethod; + delete(options?: ApplicationTypesDeleteParameters): StreamableMethod; + get(options?: ApplicationTypesGetParameters): StreamableMethod; + put(options: ApplicationTypesCreateOrUpdateParameters): StreamableMethod; } // @public @@ -356,7 +346,7 @@ export interface ApplicationTypesGet200Response extends HttpResponse { } // @public -export interface ApplicationTypesGetdefaultResponse extends HttpResponse { +export interface ApplicationTypesGetDefaultResponse extends HttpResponse { // (undocumented) body: ErrorModelOutput; // (undocumented) @@ -368,7 +358,7 @@ export type ApplicationTypesGetParameters = RequestParameters; // @public (undocumented) export interface ApplicationTypesList { - get(options?: ApplicationTypesListParameters): StreamableMethod; + get(options?: ApplicationTypesListParameters): StreamableMethod; } // @public @@ -380,7 +370,7 @@ export interface ApplicationTypesList200Response extends HttpResponse { } // @public -export interface ApplicationTypesListdefaultResponse extends HttpResponse { +export interface ApplicationTypesListDefaultResponse extends HttpResponse { // (undocumented) body: ErrorModelOutput; // (undocumented) @@ -390,35 +380,33 @@ export interface ApplicationTypesListdefaultResponse extends HttpResponse { // @public (undocumented) export type ApplicationTypesListParameters = RequestParameters; -// @public (undocumented) +// @public export interface ApplicationTypeVersionResource extends ProxyResource { properties?: ApplicationTypeVersionResourceProperties; } -// @public (undocumented) +// @public export interface ApplicationTypeVersionResourceListOutput { - nextLink?: string; + readonly nextLink?: string; // (undocumented) value?: Array; } -// @public (undocumented) +// @public export interface ApplicationTypeVersionResourceOutput extends ProxyResourceOutput { properties?: ApplicationTypeVersionResourcePropertiesOutput; } -// @public (undocumented) +// @public export interface ApplicationTypeVersionResourceProperties { appPackageUrl: string; - defaultParameterList?: Record; - provisioningState?: string; } -// @public (undocumented) +// @public export interface ApplicationTypeVersionResourcePropertiesOutput { appPackageUrl: string; - defaultParameterList?: Record; - provisioningState?: string; + readonly defaultParameterList?: Record; + readonly provisioningState?: string; } // @public (undocumented) @@ -445,7 +433,7 @@ export interface ApplicationTypeVersionsCreateOrUpdateBodyParam { } // @public -export interface ApplicationTypeVersionsCreateOrUpdatedefaultResponse extends HttpResponse { +export interface ApplicationTypeVersionsCreateOrUpdateDefaultResponse extends HttpResponse { // (undocumented) body: ErrorModelOutput; // (undocumented) @@ -462,22 +450,18 @@ export type ApplicationTypeVersionsCreateOrUpdateParameters = ApplicationTypeVer // @public export interface ApplicationTypeVersionsDelete202Response extends HttpResponse { - // (undocumented) - body: Record; // (undocumented) status: "202"; } // @public export interface ApplicationTypeVersionsDelete204Response extends HttpResponse { - // (undocumented) - body: Record; // (undocumented) status: "204"; } // @public -export interface ApplicationTypeVersionsDeletedefaultResponse extends HttpResponse { +export interface ApplicationTypeVersionsDeleteDefaultResponse extends HttpResponse { // (undocumented) body: ErrorModelOutput; // (undocumented) @@ -489,9 +473,9 @@ export type ApplicationTypeVersionsDeleteParameters = RequestParameters; // @public (undocumented) export interface ApplicationTypeVersionsGet { - delete(options?: ApplicationTypeVersionsDeleteParameters): StreamableMethod; - get(options?: ApplicationTypeVersionsGetParameters): StreamableMethod; - put(options: ApplicationTypeVersionsCreateOrUpdateParameters): StreamableMethod; + delete(options?: ApplicationTypeVersionsDeleteParameters): StreamableMethod; + get(options?: ApplicationTypeVersionsGetParameters): StreamableMethod; + put(options: ApplicationTypeVersionsCreateOrUpdateParameters): StreamableMethod; } // @public @@ -503,7 +487,7 @@ export interface ApplicationTypeVersionsGet200Response extends HttpResponse { } // @public -export interface ApplicationTypeVersionsGetdefaultResponse extends HttpResponse { +export interface ApplicationTypeVersionsGetDefaultResponse extends HttpResponse { // (undocumented) body: ErrorModelOutput; // (undocumented) @@ -515,7 +499,7 @@ export type ApplicationTypeVersionsGetParameters = RequestParameters; // @public (undocumented) export interface ApplicationTypeVersionsList { - get(options?: ApplicationTypeVersionsListParameters): StreamableMethod; + get(options?: ApplicationTypeVersionsListParameters): StreamableMethod; } // @public @@ -527,7 +511,7 @@ export interface ApplicationTypeVersionsList200Response extends HttpResponse { } // @public -export interface ApplicationTypeVersionsListdefaultResponse extends HttpResponse { +export interface ApplicationTypeVersionsListDefaultResponse extends HttpResponse { // (undocumented) body: ErrorModelOutput; // (undocumented) @@ -537,7 +521,7 @@ export interface ApplicationTypeVersionsListdefaultResponse extends HttpResponse // @public (undocumented) export type ApplicationTypeVersionsListParameters = RequestParameters; -// @public (undocumented) +// @public export interface ApplicationUpgradePolicy { applicationHealthPolicy?: ArmApplicationHealthPolicy; forceRestart?: boolean; @@ -547,7 +531,7 @@ export interface ApplicationUpgradePolicy { upgradeReplicaSetCheckTimeout?: string; } -// @public (undocumented) +// @public export interface ApplicationUpgradePolicyOutput { applicationHealthPolicy?: ArmApplicationHealthPolicyOutput; forceRestart?: boolean; @@ -569,7 +553,7 @@ export interface ApplicationUserAssignedIdentityOutput { principalId: string; } -// @public (undocumented) +// @public export interface ArmApplicationHealthPolicy { considerWarningAsError?: boolean; defaultServiceTypeHealthPolicy?: ArmServiceTypeHealthPolicy; @@ -577,7 +561,7 @@ export interface ArmApplicationHealthPolicy { serviceTypeHealthPolicyMap?: Record; } -// @public (undocumented) +// @public export interface ArmApplicationHealthPolicyOutput { considerWarningAsError?: boolean; defaultServiceTypeHealthPolicy?: ArmServiceTypeHealthPolicyOutput; @@ -585,7 +569,7 @@ export interface ArmApplicationHealthPolicyOutput { serviceTypeHealthPolicyMap?: Record; } -// @public (undocumented) +// @public export interface ArmRollingUpgradeMonitoringPolicy { failureAction?: "Rollback" | "Manual"; healthCheckRetryTimeout?: string; @@ -595,7 +579,7 @@ export interface ArmRollingUpgradeMonitoringPolicy { upgradeTimeout?: string; } -// @public (undocumented) +// @public export interface ArmRollingUpgradeMonitoringPolicyOutput { failureAction?: "Rollback" | "Manual"; healthCheckRetryTimeout?: string; @@ -605,21 +589,21 @@ export interface ArmRollingUpgradeMonitoringPolicyOutput { upgradeTimeout?: string; } -// @public (undocumented) +// @public export interface ArmServiceTypeHealthPolicy { maxPercentUnhealthyPartitionsPerService?: number; maxPercentUnhealthyReplicasPerPartition?: number; maxPercentUnhealthyServices?: number; } -// @public (undocumented) +// @public export interface ArmServiceTypeHealthPolicyOutput { maxPercentUnhealthyPartitionsPerService?: number; maxPercentUnhealthyReplicasPerPartition?: number; maxPercentUnhealthyServices?: number; } -// @public (undocumented) +// @public export interface AvailableOperationDisplayOutput { description?: string; operation?: string; @@ -627,73 +611,73 @@ export interface AvailableOperationDisplayOutput { resource?: string; } -// @public (undocumented) +// @public export interface AzureActiveDirectory { clientApplication?: string; clusterApplication?: string; tenantId?: string; } -// @public (undocumented) +// @public export interface AzureActiveDirectoryOutput { clientApplication?: string; clusterApplication?: string; tenantId?: string; } -// @public (undocumented) +// @public export interface CertificateDescription { thumbprint: string; thumbprintSecondary?: string; x509StoreName?: "AddressBook" | "AuthRoot" | "CertificateAuthority" | "Disallowed" | "My" | "Root" | "TrustedPeople" | "TrustedPublisher"; } -// @public (undocumented) +// @public export interface CertificateDescriptionOutput { thumbprint: string; thumbprintSecondary?: string; x509StoreName?: "AddressBook" | "AuthRoot" | "CertificateAuthority" | "Disallowed" | "My" | "Root" | "TrustedPeople" | "TrustedPublisher"; } -// @public (undocumented) +// @public export interface ClientCertificateCommonName { certificateCommonName: string; certificateIssuerThumbprint: string; isAdmin: boolean; } -// @public (undocumented) +// @public export interface ClientCertificateCommonNameOutput { certificateCommonName: string; certificateIssuerThumbprint: string; isAdmin: boolean; } -// @public (undocumented) +// @public export interface ClientCertificateThumbprint { certificateThumbprint: string; isAdmin: boolean; } -// @public (undocumented) +// @public export interface ClientCertificateThumbprintOutput { certificateThumbprint: string; isAdmin: boolean; } -// @public (undocumented) +// @public export interface Cluster extends Resource { properties?: ClusterProperties; } -// @public (undocumented) +// @public export interface ClusterCodeVersionsListResultOutput { nextLink?: string; // (undocumented) value?: Array; } -// @public (undocumented) +// @public export interface ClusterCodeVersionsResultOutput { id?: string; name?: string; @@ -701,54 +685,49 @@ export interface ClusterCodeVersionsResultOutput { type?: string; } -// @public (undocumented) +// @public export interface ClusterHealthPolicy { applicationHealthPolicies?: Record; maxPercentUnhealthyApplications?: number; maxPercentUnhealthyNodes?: number; } -// @public (undocumented) +// @public export interface ClusterHealthPolicyOutput { applicationHealthPolicies?: Record; maxPercentUnhealthyApplications?: number; maxPercentUnhealthyNodes?: number; } -// @public (undocumented) +// @public export interface ClusterListResultOutput { nextLink?: string; // (undocumented) value?: Array; } -// @public (undocumented) +// @public export interface ClusterOutput extends ResourceOutput { properties?: ClusterPropertiesOutput; } -// @public (undocumented) +// @public export interface ClusterProperties { addOnFeatures?: Array<"RepairManager" | "DnsService" | "BackupRestoreService" | "ResourceMonitorService">; applicationTypeVersionsCleanupPolicy?: ApplicationTypeVersionsCleanupPolicy; - availableClusterVersions?: Array; azureActiveDirectory?: AzureActiveDirectory; certificate?: CertificateDescription; certificateCommonNames?: ServerCertificateCommonNames; clientCertificateCommonNames?: Array; clientCertificateThumbprints?: Array; clusterCodeVersion?: string; - clusterEndpoint?: string; - clusterId?: string; - clusterState?: "WaitingForNodes" | "Deploying" | "BaselineUpgrade" | "UpdatingUserConfiguration" | "UpdatingUserCertificate" | "UpdatingInfrastructure" | "EnforcingClusterVersion" | "UpgradeServiceUnreachable" | "AutoScale" | "Ready"; diagnosticsStorageAccountConfig?: DiagnosticsStorageAccountConfig; eventStoreServiceEnabled?: boolean; fabricSettings?: Array; infrastructureServiceManager?: boolean; managementEndpoint: string; nodeTypes: Array; - notifications?: Array; - provisioningState?: "Updating" | "Succeeded" | "Failed" | "Canceled"; + notifications?: Array; reliabilityLevel?: "None" | "Bronze" | "Silver" | "Gold" | "Platinum"; reverseProxyCertificate?: CertificateDescription; reverseProxyCertificateCommonNames?: ServerCertificateCommonNames; @@ -763,20 +742,20 @@ export interface ClusterProperties { waveUpgradePaused?: boolean; } -// @public (undocumented) +// @public export interface ClusterPropertiesOutput { addOnFeatures?: Array<"RepairManager" | "DnsService" | "BackupRestoreService" | "ResourceMonitorService">; applicationTypeVersionsCleanupPolicy?: ApplicationTypeVersionsCleanupPolicyOutput; - availableClusterVersions?: Array; + readonly availableClusterVersions?: Array; azureActiveDirectory?: AzureActiveDirectoryOutput; certificate?: CertificateDescriptionOutput; certificateCommonNames?: ServerCertificateCommonNamesOutput; clientCertificateCommonNames?: Array; clientCertificateThumbprints?: Array; clusterCodeVersion?: string; - clusterEndpoint?: string; - clusterId?: string; - clusterState?: "WaitingForNodes" | "Deploying" | "BaselineUpgrade" | "UpdatingUserConfiguration" | "UpdatingUserCertificate" | "UpdatingInfrastructure" | "EnforcingClusterVersion" | "UpgradeServiceUnreachable" | "AutoScale" | "Ready"; + readonly clusterEndpoint?: string; + readonly clusterId?: string; + readonly clusterState?: "WaitingForNodes" | "Deploying" | "BaselineUpgrade" | "UpdatingUserConfiguration" | "UpdatingUserCertificate" | "UpdatingInfrastructure" | "EnforcingClusterVersion" | "UpgradeServiceUnreachable" | "AutoScale" | "Ready"; diagnosticsStorageAccountConfig?: DiagnosticsStorageAccountConfigOutput; eventStoreServiceEnabled?: boolean; fabricSettings?: Array; @@ -784,7 +763,7 @@ export interface ClusterPropertiesOutput { managementEndpoint: string; nodeTypes: Array; notifications?: Array; - provisioningState?: "Updating" | "Succeeded" | "Failed" | "Canceled"; + readonly provisioningState?: "Updating" | "Succeeded" | "Failed" | "Canceled"; reliabilityLevel?: "None" | "Bronze" | "Silver" | "Gold" | "Platinum"; reverseProxyCertificate?: CertificateDescriptionOutput; reverseProxyCertificateCommonNames?: ServerCertificateCommonNamesOutput; @@ -799,7 +778,7 @@ export interface ClusterPropertiesOutput { waveUpgradePaused?: boolean; } -// @public (undocumented) +// @public export interface ClusterPropertiesUpdateParameters { addOnFeatures?: Array<"RepairManager" | "DnsService" | "BackupRestoreService" | "ResourceMonitorService">; applicationTypeVersionsCleanupPolicy?: ApplicationTypeVersionsCleanupPolicy; @@ -812,7 +791,7 @@ export interface ClusterPropertiesUpdateParameters { fabricSettings?: Array; infrastructureServiceManager?: boolean; nodeTypes?: Array; - notifications?: Array; + notifications?: Array; reliabilityLevel?: "None" | "Bronze" | "Silver" | "Gold" | "Platinum"; reverseProxyCertificate?: CertificateDescription; sfZonalUpgradeMode?: "Parallel" | "Hierarchical"; @@ -847,7 +826,7 @@ export interface ClustersCreateOrUpdateBodyParam { } // @public -export interface ClustersCreateOrUpdatedefaultResponse extends HttpResponse { +export interface ClustersCreateOrUpdateDefaultResponse extends HttpResponse { // (undocumented) body: ErrorModelOutput; // (undocumented) @@ -864,22 +843,18 @@ export type ClustersCreateOrUpdateParameters = ClustersCreateOrUpdateMediaTypesP // @public export interface ClustersDelete200Response extends HttpResponse { - // (undocumented) - body: Record; // (undocumented) status: "200"; } // @public export interface ClustersDelete204Response extends HttpResponse { - // (undocumented) - body: Record; // (undocumented) status: "204"; } // @public -export interface ClustersDeletedefaultResponse extends HttpResponse { +export interface ClustersDeleteDefaultResponse extends HttpResponse { // (undocumented) body: ErrorModelOutput; // (undocumented) @@ -891,10 +866,10 @@ export type ClustersDeleteParameters = RequestParameters; // @public (undocumented) export interface ClustersGet { - delete(options?: ClustersDeleteParameters): StreamableMethod; - get(options?: ClustersGetParameters): StreamableMethod; - patch(options: ClustersUpdateParameters): StreamableMethod; - put(options: ClustersCreateOrUpdateParameters): StreamableMethod; + delete(options?: ClustersDeleteParameters): StreamableMethod; + get(options?: ClustersGetParameters): StreamableMethod; + patch(options: ClustersUpdateParameters): StreamableMethod; + put(options: ClustersCreateOrUpdateParameters): StreamableMethod; } // @public @@ -906,7 +881,7 @@ export interface ClustersGet200Response extends HttpResponse { } // @public -export interface ClustersGetdefaultResponse extends HttpResponse { +export interface ClustersGetDefaultResponse extends HttpResponse { // (undocumented) body: ErrorModelOutput; // (undocumented) @@ -918,7 +893,7 @@ export type ClustersGetParameters = RequestParameters; // @public (undocumented) export interface ClustersList { - get(options?: ClustersListParameters): StreamableMethod; + get(options?: ClustersListParameters): StreamableMethod; } // @public @@ -931,7 +906,7 @@ export interface ClustersList200Response extends HttpResponse { // @public (undocumented) export interface ClustersListByResourceGroup { - get(options?: ClustersListByResourceGroupParameters): StreamableMethod; + get(options?: ClustersListByResourceGroupParameters): StreamableMethod; } // @public @@ -943,7 +918,7 @@ export interface ClustersListByResourceGroup200Response extends HttpResponse { } // @public -export interface ClustersListByResourceGroupdefaultResponse extends HttpResponse { +export interface ClustersListByResourceGroupDefaultResponse extends HttpResponse { // (undocumented) body: ErrorModelOutput; // (undocumented) @@ -954,7 +929,7 @@ export interface ClustersListByResourceGroupdefaultResponse extends HttpResponse export type ClustersListByResourceGroupParameters = RequestParameters; // @public -export interface ClustersListdefaultResponse extends HttpResponse { +export interface ClustersListDefaultResponse extends HttpResponse { // (undocumented) body: ErrorModelOutput; // (undocumented) @@ -966,7 +941,7 @@ export type ClustersListParameters = RequestParameters; // @public (undocumented) export interface ClustersListUpgradableVersions { - post(options?: ClustersListUpgradableVersionsParameters): StreamableMethod; + post(options?: ClustersListUpgradableVersionsParameters): StreamableMethod; } // @public @@ -983,7 +958,7 @@ export interface ClustersListUpgradableVersionsBodyParam { } // @public -export interface ClustersListUpgradableVersionsdefaultResponse extends HttpResponse { +export interface ClustersListUpgradableVersionsDefaultResponse extends HttpResponse { // (undocumented) body: ErrorModelOutput; // (undocumented) @@ -1020,7 +995,7 @@ export interface ClustersUpdateBodyParam { } // @public -export interface ClustersUpdatedefaultResponse extends HttpResponse { +export interface ClustersUpdateDefaultResponse extends HttpResponse { // (undocumented) body: ErrorModelOutput; // (undocumented) @@ -1035,13 +1010,13 @@ export interface ClustersUpdateMediaTypesParam { // @public (undocumented) export type ClustersUpdateParameters = ClustersUpdateMediaTypesParam & ClustersUpdateBodyParam & RequestParameters; -// @public (undocumented) +// @public export interface ClusterUpdateParameters { properties?: ClusterPropertiesUpdateParameters; tags?: Record; } -// @public (undocumented) +// @public export interface ClusterUpgradeDeltaHealthPolicy { applicationDeltaHealthPolicies?: Record; maxPercentDeltaUnhealthyApplications: number; @@ -1049,7 +1024,7 @@ export interface ClusterUpgradeDeltaHealthPolicy { maxPercentUpgradeDomainDeltaUnhealthyNodes: number; } -// @public (undocumented) +// @public export interface ClusterUpgradeDeltaHealthPolicyOutput { applicationDeltaHealthPolicies?: Record; maxPercentDeltaUnhealthyApplications: number; @@ -1057,7 +1032,7 @@ export interface ClusterUpgradeDeltaHealthPolicyOutput { maxPercentUpgradeDomainDeltaUnhealthyNodes: number; } -// @public (undocumented) +// @public export interface ClusterUpgradePolicy { deltaHealthPolicy?: ClusterUpgradeDeltaHealthPolicy; forceRestart?: boolean; @@ -1070,7 +1045,7 @@ export interface ClusterUpgradePolicy { upgradeTimeout: string; } -// @public (undocumented) +// @public export interface ClusterUpgradePolicyOutput { deltaHealthPolicy?: ClusterUpgradeDeltaHealthPolicyOutput; forceRestart?: boolean; @@ -1083,14 +1058,14 @@ export interface ClusterUpgradePolicyOutput { upgradeTimeout: string; } -// @public (undocumented) +// @public export interface ClusterVersionDetails { codeVersion?: string; environment?: "Windows" | "Linux"; supportExpiryUtc?: string; } -// @public (undocumented) +// @public export interface ClusterVersionDetailsOutput { codeVersion?: string; environment?: "Windows" | "Linux"; @@ -1099,7 +1074,7 @@ export interface ClusterVersionDetailsOutput { // @public (undocumented) export interface ClusterVersionsGet { - get(options?: ClusterVersionsGetParameters): StreamableMethod; + get(options?: ClusterVersionsGetParameters): StreamableMethod; } // @public @@ -1112,7 +1087,7 @@ export interface ClusterVersionsGet200Response extends HttpResponse { // @public (undocumented) export interface ClusterVersionsGetByEnvironment { - get(options?: ClusterVersionsGetByEnvironmentParameters): StreamableMethod; + get(options?: ClusterVersionsGetByEnvironmentParameters): StreamableMethod; } // @public @@ -1124,7 +1099,7 @@ export interface ClusterVersionsGetByEnvironment200Response extends HttpResponse } // @public -export interface ClusterVersionsGetByEnvironmentdefaultResponse extends HttpResponse { +export interface ClusterVersionsGetByEnvironmentDefaultResponse extends HttpResponse { // (undocumented) body: ErrorModelOutput; // (undocumented) @@ -1135,7 +1110,7 @@ export interface ClusterVersionsGetByEnvironmentdefaultResponse extends HttpResp export type ClusterVersionsGetByEnvironmentParameters = RequestParameters; // @public -export interface ClusterVersionsGetdefaultResponse extends HttpResponse { +export interface ClusterVersionsGetDefaultResponse extends HttpResponse { // (undocumented) body: ErrorModelOutput; // (undocumented) @@ -1147,7 +1122,7 @@ export type ClusterVersionsGetParameters = RequestParameters; // @public (undocumented) export interface ClusterVersionsList { - get(options?: ClusterVersionsListParameters): StreamableMethod; + get(options?: ClusterVersionsListParameters): StreamableMethod; } // @public @@ -1160,7 +1135,7 @@ export interface ClusterVersionsList200Response extends HttpResponse { // @public (undocumented) export interface ClusterVersionsListByEnvironment { - get(options?: ClusterVersionsListByEnvironmentParameters): StreamableMethod; + get(options?: ClusterVersionsListByEnvironmentParameters): StreamableMethod; } // @public @@ -1172,7 +1147,7 @@ export interface ClusterVersionsListByEnvironment200Response extends HttpRespons } // @public -export interface ClusterVersionsListByEnvironmentdefaultResponse extends HttpResponse { +export interface ClusterVersionsListByEnvironmentDefaultResponse extends HttpResponse { // (undocumented) body: ErrorModelOutput; // (undocumented) @@ -1183,7 +1158,7 @@ export interface ClusterVersionsListByEnvironmentdefaultResponse extends HttpRes export type ClusterVersionsListByEnvironmentParameters = RequestParameters; // @public -export interface ClusterVersionsListdefaultResponse extends HttpResponse { +export interface ClusterVersionsListDefaultResponse extends HttpResponse { // (undocumented) body: ErrorModelOutput; // (undocumented) @@ -1193,11 +1168,11 @@ export interface ClusterVersionsListdefaultResponse extends HttpResponse { // @public (undocumented) export type ClusterVersionsListParameters = RequestParameters; -// @public (undocumented) -function createClient(credentials: TokenCredential, options?: ClientOptions): ServiceFabricClient; +// @public +function createClient(credentials: TokenCredential, { apiVersion, ...options }?: ServiceFabricClientOptions): ServiceFabricClient; export default createClient; -// @public (undocumented) +// @public export interface DiagnosticsStorageAccountConfig { blobEndpoint: string; protectedAccountKeyName: string; @@ -1207,7 +1182,7 @@ export interface DiagnosticsStorageAccountConfig { tableEndpoint: string; } -// @public (undocumented) +// @public export interface DiagnosticsStorageAccountConfigOutput { blobEndpoint: string; protectedAccountKeyName: string; @@ -1217,25 +1192,25 @@ export interface DiagnosticsStorageAccountConfigOutput { tableEndpoint: string; } -// @public (undocumented) +// @public export interface EndpointRangeDescription { endPort: number; startPort: number; } -// @public (undocumented) +// @public export interface EndpointRangeDescriptionOutput { endPort: number; startPort: number; } -// @public (undocumented) +// @public export interface ErrorModelErrorOutput { code?: string; message?: string; } -// @public (undocumented) +// @public export interface ErrorModelOutput { error?: ErrorModelErrorOutput; } @@ -1244,121 +1219,119 @@ export interface ErrorModelOutput { export type GetArrayType = T extends Array ? TData : never; // @public -export function getLongRunningPoller(client: Client, initialResponse: TResult, options?: LroEngineOptions>): PollerLike, TResult>; +export function getLongRunningPoller(client: Client, initialResponse: TResult, options?: CreateHttpPollerOptions>): Promise, TResult>>; // @public -export type GetPage = (pageLink: string, maxPageSize?: number) => Promise<{ +export type GetPage = (pageLink: string) => Promise<{ page: TPage; nextPageLink?: string; }>; // @public (undocumented) -export function isUnexpected(response: ClustersGet200Response | ClustersGetdefaultResponse): response is ClustersGetdefaultResponse; +export function isUnexpected(response: ClustersGet200Response | ClustersGetDefaultResponse): response is ClustersGetDefaultResponse; // @public (undocumented) -export function isUnexpected(response: ClustersCreateOrUpdate200Response | ClustersCreateOrUpdate202Response | ClustersCreateOrUpdatedefaultResponse): response is ClustersCreateOrUpdatedefaultResponse; +export function isUnexpected(response: ClustersCreateOrUpdate200Response | ClustersCreateOrUpdate202Response | ClustersCreateOrUpdateDefaultResponse): response is ClustersCreateOrUpdateDefaultResponse; // @public (undocumented) -export function isUnexpected(response: ClustersUpdate200Response | ClustersUpdate202Response | ClustersUpdatedefaultResponse): response is ClustersUpdatedefaultResponse; +export function isUnexpected(response: ClustersUpdate200Response | ClustersUpdate202Response | ClustersUpdateDefaultResponse): response is ClustersUpdateDefaultResponse; // @public (undocumented) -export function isUnexpected(response: ClustersDelete200Response | ClustersDelete204Response | ClustersDeletedefaultResponse): response is ClustersDeletedefaultResponse; +export function isUnexpected(response: ClustersDelete200Response | ClustersDelete204Response | ClustersDeleteDefaultResponse): response is ClustersDeleteDefaultResponse; // @public (undocumented) -export function isUnexpected(response: ClustersListByResourceGroup200Response | ClustersListByResourceGroupdefaultResponse): response is ClustersListByResourceGroupdefaultResponse; +export function isUnexpected(response: ClustersListByResourceGroup200Response | ClustersListByResourceGroupDefaultResponse): response is ClustersListByResourceGroupDefaultResponse; // @public (undocumented) -export function isUnexpected(response: ClustersList200Response | ClustersListdefaultResponse): response is ClustersListdefaultResponse; +export function isUnexpected(response: ClustersList200Response | ClustersListDefaultResponse): response is ClustersListDefaultResponse; // @public (undocumented) -export function isUnexpected(response: ClustersListUpgradableVersions200Response | ClustersListUpgradableVersionsdefaultResponse): response is ClustersListUpgradableVersionsdefaultResponse; +export function isUnexpected(response: ClustersListUpgradableVersions200Response | ClustersListUpgradableVersionsDefaultResponse): response is ClustersListUpgradableVersionsDefaultResponse; // @public (undocumented) -export function isUnexpected(response: ClusterVersionsGet200Response | ClusterVersionsGetdefaultResponse): response is ClusterVersionsGetdefaultResponse; +export function isUnexpected(response: ClusterVersionsGet200Response | ClusterVersionsGetDefaultResponse): response is ClusterVersionsGetDefaultResponse; // @public (undocumented) -export function isUnexpected(response: ClusterVersionsGetByEnvironment200Response | ClusterVersionsGetByEnvironmentdefaultResponse): response is ClusterVersionsGetByEnvironmentdefaultResponse; +export function isUnexpected(response: ClusterVersionsGetByEnvironment200Response | ClusterVersionsGetByEnvironmentDefaultResponse): response is ClusterVersionsGetByEnvironmentDefaultResponse; // @public (undocumented) -export function isUnexpected(response: ClusterVersionsList200Response | ClusterVersionsListdefaultResponse): response is ClusterVersionsListdefaultResponse; +export function isUnexpected(response: ClusterVersionsList200Response | ClusterVersionsListDefaultResponse): response is ClusterVersionsListDefaultResponse; // @public (undocumented) -export function isUnexpected(response: ClusterVersionsListByEnvironment200Response | ClusterVersionsListByEnvironmentdefaultResponse): response is ClusterVersionsListByEnvironmentdefaultResponse; +export function isUnexpected(response: ClusterVersionsListByEnvironment200Response | ClusterVersionsListByEnvironmentDefaultResponse): response is ClusterVersionsListByEnvironmentDefaultResponse; // @public (undocumented) -export function isUnexpected(response: OperationsList200Response | OperationsListdefaultResponse): response is OperationsListdefaultResponse; +export function isUnexpected(response: OperationsList200Response | OperationsListDefaultResponse): response is OperationsListDefaultResponse; // @public (undocumented) -export function isUnexpected(response: ApplicationTypesGet200Response | ApplicationTypesGetdefaultResponse): response is ApplicationTypesGetdefaultResponse; +export function isUnexpected(response: ApplicationTypesGet200Response | ApplicationTypesGetDefaultResponse): response is ApplicationTypesGetDefaultResponse; // @public (undocumented) -export function isUnexpected(response: ApplicationTypesCreateOrUpdate200Response | ApplicationTypesCreateOrUpdatedefaultResponse): response is ApplicationTypesCreateOrUpdatedefaultResponse; +export function isUnexpected(response: ApplicationTypesCreateOrUpdate200Response | ApplicationTypesCreateOrUpdateDefaultResponse): response is ApplicationTypesCreateOrUpdateDefaultResponse; // @public (undocumented) -export function isUnexpected(response: ApplicationTypesDelete202Response | ApplicationTypesDelete204Response | ApplicationTypesDeletedefaultResponse): response is ApplicationTypesDeletedefaultResponse; +export function isUnexpected(response: ApplicationTypesDelete202Response | ApplicationTypesDelete204Response | ApplicationTypesDeleteDefaultResponse): response is ApplicationTypesDeleteDefaultResponse; // @public (undocumented) -export function isUnexpected(response: ApplicationTypesList200Response | ApplicationTypesListdefaultResponse): response is ApplicationTypesListdefaultResponse; +export function isUnexpected(response: ApplicationTypesList200Response | ApplicationTypesListDefaultResponse): response is ApplicationTypesListDefaultResponse; // @public (undocumented) -export function isUnexpected(response: ApplicationTypeVersionsGet200Response | ApplicationTypeVersionsGetdefaultResponse): response is ApplicationTypeVersionsGetdefaultResponse; +export function isUnexpected(response: ApplicationTypeVersionsGet200Response | ApplicationTypeVersionsGetDefaultResponse): response is ApplicationTypeVersionsGetDefaultResponse; // @public (undocumented) -export function isUnexpected(response: ApplicationTypeVersionsCreateOrUpdate202Response | ApplicationTypeVersionsCreateOrUpdatedefaultResponse): response is ApplicationTypeVersionsCreateOrUpdatedefaultResponse; +export function isUnexpected(response: ApplicationTypeVersionsCreateOrUpdate202Response | ApplicationTypeVersionsCreateOrUpdateDefaultResponse): response is ApplicationTypeVersionsCreateOrUpdateDefaultResponse; // @public (undocumented) -export function isUnexpected(response: ApplicationTypeVersionsDelete202Response | ApplicationTypeVersionsDelete204Response | ApplicationTypeVersionsDeletedefaultResponse): response is ApplicationTypeVersionsDeletedefaultResponse; +export function isUnexpected(response: ApplicationTypeVersionsDelete202Response | ApplicationTypeVersionsDelete204Response | ApplicationTypeVersionsDeleteDefaultResponse): response is ApplicationTypeVersionsDeleteDefaultResponse; // @public (undocumented) -export function isUnexpected(response: ApplicationTypeVersionsList200Response | ApplicationTypeVersionsListdefaultResponse): response is ApplicationTypeVersionsListdefaultResponse; +export function isUnexpected(response: ApplicationTypeVersionsList200Response | ApplicationTypeVersionsListDefaultResponse): response is ApplicationTypeVersionsListDefaultResponse; // @public (undocumented) -export function isUnexpected(response: ApplicationsGet200Response | ApplicationsGetdefaultResponse): response is ApplicationsGetdefaultResponse; +export function isUnexpected(response: ApplicationsGet200Response | ApplicationsGetDefaultResponse): response is ApplicationsGetDefaultResponse; // @public (undocumented) -export function isUnexpected(response: ApplicationsCreateOrUpdate202Response | ApplicationsCreateOrUpdatedefaultResponse): response is ApplicationsCreateOrUpdatedefaultResponse; +export function isUnexpected(response: ApplicationsCreateOrUpdate202Response | ApplicationsCreateOrUpdateDefaultResponse): response is ApplicationsCreateOrUpdateDefaultResponse; // @public (undocumented) -export function isUnexpected(response: ApplicationsUpdate202Response | ApplicationsUpdatedefaultResponse): response is ApplicationsUpdatedefaultResponse; +export function isUnexpected(response: ApplicationsUpdate202Response | ApplicationsUpdateDefaultResponse): response is ApplicationsUpdateDefaultResponse; // @public (undocumented) -export function isUnexpected(response: ApplicationsDelete202Response | ApplicationsDelete204Response | ApplicationsDeletedefaultResponse): response is ApplicationsDeletedefaultResponse; +export function isUnexpected(response: ApplicationsDelete202Response | ApplicationsDelete204Response | ApplicationsDeleteDefaultResponse): response is ApplicationsDeleteDefaultResponse; // @public (undocumented) -export function isUnexpected(response: ApplicationsList200Response | ApplicationsListdefaultResponse): response is ApplicationsListdefaultResponse; +export function isUnexpected(response: ApplicationsList200Response | ApplicationsListDefaultResponse): response is ApplicationsListDefaultResponse; // @public (undocumented) -export function isUnexpected(response: ServicesGet200Response | ServicesGetdefaultResponse): response is ServicesGetdefaultResponse; +export function isUnexpected(response: ServicesGet200Response | ServicesGetDefaultResponse): response is ServicesGetDefaultResponse; // @public (undocumented) -export function isUnexpected(response: ServicesCreateOrUpdate202Response | ServicesCreateOrUpdatedefaultResponse): response is ServicesCreateOrUpdatedefaultResponse; +export function isUnexpected(response: ServicesCreateOrUpdate202Response | ServicesCreateOrUpdateDefaultResponse): response is ServicesCreateOrUpdateDefaultResponse; // @public (undocumented) -export function isUnexpected(response: ServicesUpdate202Response | ServicesUpdatedefaultResponse): response is ServicesUpdatedefaultResponse; +export function isUnexpected(response: ServicesUpdate202Response | ServicesUpdateDefaultResponse): response is ServicesUpdateDefaultResponse; // @public (undocumented) -export function isUnexpected(response: ServicesDelete202Response | ServicesDelete204Response | ServicesDeletedefaultResponse): response is ServicesDeletedefaultResponse; +export function isUnexpected(response: ServicesDelete202Response | ServicesDelete204Response | ServicesDeleteDefaultResponse): response is ServicesDeleteDefaultResponse; // @public (undocumented) -export function isUnexpected(response: ServicesList200Response | ServicesListdefaultResponse): response is ServicesListdefaultResponse; +export function isUnexpected(response: ServicesList200Response | ServicesListDefaultResponse): response is ServicesListDefaultResponse; -// @public (undocumented) +// @public export interface ManagedIdentity { - principalId?: string; - tenantId?: string; type?: "SystemAssigned" | "UserAssigned" | "SystemAssigned, UserAssigned" | "None"; userAssignedIdentities?: Record; } -// @public (undocumented) +// @public export interface ManagedIdentityOutput { - principalId?: string; - tenantId?: string; + readonly principalId?: string; + readonly tenantId?: string; type?: "SystemAssigned" | "UserAssigned" | "SystemAssigned, UserAssigned" | "None"; userAssignedIdentities?: Record; } -// @public (undocumented) +// @public export interface NamedPartitionSchemeDescription extends PartitionSchemeDescriptionParent { count: number; names: Array; @@ -1366,7 +1339,7 @@ export interface NamedPartitionSchemeDescription extends PartitionSchemeDescript partitionScheme: "Named"; } -// @public (undocumented) +// @public export interface NamedPartitionSchemeDescriptionOutput extends PartitionSchemeDescriptionOutputParent { count: number; names: Array; @@ -1374,7 +1347,7 @@ export interface NamedPartitionSchemeDescriptionOutput extends PartitionSchemeDe partitionScheme: "Named"; } -// @public (undocumented) +// @public export interface NodeTypeDescription { applicationPorts?: EndpointRangeDescription; capacities?: Record; @@ -1391,7 +1364,7 @@ export interface NodeTypeDescription { vmInstanceCount: number; } -// @public (undocumented) +// @public export interface NodeTypeDescriptionOutput { applicationPorts?: EndpointRangeDescriptionOutput; capacities?: Record; @@ -1408,15 +1381,16 @@ export interface NodeTypeDescriptionOutput { vmInstanceCount: number; } -// @public (undocumented) -export interface Notification { +// @public +interface Notification_2 { isEnabled: boolean; notificationCategory: "WaveProgress"; notificationLevel: "Critical" | "All"; notificationTargets: Array; } +export { Notification_2 as Notification } -// @public (undocumented) +// @public export interface NotificationOutput { isEnabled: boolean; notificationCategory: "WaveProgress"; @@ -1424,25 +1398,25 @@ export interface NotificationOutput { notificationTargets: Array; } -// @public (undocumented) +// @public export interface NotificationTarget { notificationChannel: "EmailUser" | "EmailSubscription"; receivers: Array; } -// @public (undocumented) +// @public export interface NotificationTargetOutput { notificationChannel: "EmailUser" | "EmailSubscription"; receivers: Array; } -// @public (undocumented) +// @public export interface OperationListResultOutput { - nextLink?: string; + readonly nextLink?: string; value?: Array; } -// @public (undocumented) +// @public export interface OperationResultOutput { display?: AvailableOperationDisplayOutput; isDataAction?: boolean; @@ -1453,7 +1427,7 @@ export interface OperationResultOutput { // @public (undocumented) export interface OperationsList { - get(options?: OperationsListParameters): StreamableMethod; + get(options?: OperationsListParameters): StreamableMethod; } // @public @@ -1465,7 +1439,7 @@ export interface OperationsList200Response extends HttpResponse { } // @public -export interface OperationsListdefaultResponse extends HttpResponse { +export interface OperationsListDefaultResponse extends HttpResponse { // (undocumented) body: ErrorModelOutput; // (undocumented) @@ -1475,6 +1449,18 @@ export interface OperationsListdefaultResponse extends HttpResponse { // @public (undocumented) export type OperationsListParameters = RequestParameters; +// @public +export interface PagedAsyncIterableIterator { + [Symbol.asyncIterator](): PagedAsyncIterableIterator; + byPage: (settings?: TPageSettings) => AsyncIterableIterator; + next(): Promise>; +} + +// @public +export interface PageSettings { + continuationToken?: string; +} + // @public export function paginate(client: Client, initialResponse: TResponse, options?: PagingOptions): PagedAsyncIterableIterator>; @@ -1490,66 +1476,56 @@ export interface PagingOptions { customGetPage?: GetPage[]>; } -// @public (undocumented) +// @public export type PartitionSchemeDescription = NamedPartitionSchemeDescription | SingletonPartitionSchemeDescription | UniformInt64RangePartitionSchemeDescription; -// @public (undocumented) +// @public export type PartitionSchemeDescriptionOutput = NamedPartitionSchemeDescriptionOutput | SingletonPartitionSchemeDescriptionOutput | UniformInt64RangePartitionSchemeDescriptionOutput; -// @public (undocumented) +// @public export interface PartitionSchemeDescriptionOutputParent { // (undocumented) partitionScheme: "PartitionSchemeDescription" | "Named" | "Singleton" | "UniformInt64Range"; } -// @public (undocumented) +// @public export interface PartitionSchemeDescriptionParent { // (undocumented) partitionScheme: "PartitionSchemeDescription" | "Named" | "Singleton" | "UniformInt64Range"; } -// @public (undocumented) +// @public export interface ProxyResource { - etag?: string; - id?: string; location?: string; - name?: string; - systemData?: SystemData; tags?: Record; - type?: string; } -// @public (undocumented) +// @public export interface ProxyResourceOutput { - etag?: string; - id?: string; + readonly etag?: string; + readonly id?: string; location?: string; - name?: string; - systemData?: SystemDataOutput; + readonly name?: string; + readonly systemData?: SystemDataOutput; tags?: Record; - type?: string; + readonly type?: string; } -// @public (undocumented) +// @public export interface Resource { - etag?: string; - id?: string; location: string; - name?: string; - systemData?: SystemData; tags?: Record; - type?: string; } -// @public (undocumented) +// @public export interface ResourceOutput { - etag?: string; - id?: string; + readonly etag?: string; + readonly id?: string; location: string; - name?: string; - systemData?: SystemDataOutput; + readonly name?: string; + readonly systemData?: SystemDataOutput; tags?: Record; - type?: string; + readonly type?: string; } // @public (undocumented) @@ -1573,37 +1549,37 @@ export interface Routes { (path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applications/{applicationName}/services", subscriptionId: string, resourceGroupName: string, clusterName: string, applicationName: string): ServicesList; } -// @public (undocumented) +// @public export interface ServerCertificateCommonName { certificateCommonName: string; certificateIssuerThumbprint: string; } -// @public (undocumented) +// @public export interface ServerCertificateCommonNameOutput { certificateCommonName: string; certificateIssuerThumbprint: string; } -// @public (undocumented) +// @public export interface ServerCertificateCommonNames { commonNames?: Array; x509StoreName?: "AddressBook" | "AuthRoot" | "CertificateAuthority" | "Disallowed" | "My" | "Root" | "TrustedPeople" | "TrustedPublisher"; } -// @public (undocumented) +// @public export interface ServerCertificateCommonNamesOutput { commonNames?: Array; x509StoreName?: "AddressBook" | "AuthRoot" | "CertificateAuthority" | "Disallowed" | "My" | "Root" | "TrustedPeople" | "TrustedPublisher"; } -// @public (undocumented) +// @public export interface ServiceCorrelationDescription { scheme: "Invalid" | "Affinity" | "AlignedAffinity" | "NonAlignedAffinity"; serviceName: string; } -// @public (undocumented) +// @public export interface ServiceCorrelationDescriptionOutput { scheme: "Invalid" | "Affinity" | "AlignedAffinity" | "NonAlignedAffinity"; serviceName: string; @@ -1614,7 +1590,12 @@ export type ServiceFabricClient = Client & { path: Routes; }; -// @public (undocumented) +// @public +export interface ServiceFabricClientOptions extends ClientOptions { + apiVersion?: string; +} + +// @public export interface ServiceLoadMetricDescription { defaultLoad?: number; name: string; @@ -1623,7 +1604,7 @@ export interface ServiceLoadMetricDescription { weight?: "Zero" | "Low" | "Medium" | "High"; } -// @public (undocumented) +// @public export interface ServiceLoadMetricDescriptionOutput { defaultLoad?: number; name: string; @@ -1632,39 +1613,39 @@ export interface ServiceLoadMetricDescriptionOutput { weight?: "Zero" | "Low" | "Medium" | "High"; } -// @public (undocumented) +// @public export interface ServicePlacementPolicyDescription { // (undocumented) type: "ServicePlacementPolicyDescription"; } -// @public (undocumented) +// @public export interface ServicePlacementPolicyDescriptionOutput { // (undocumented) type: "ServicePlacementPolicyDescription"; } -// @public (undocumented) +// @public export interface ServiceResource extends ProxyResource { properties?: ServiceResourceProperties; } -// @public (undocumented) +// @public export interface ServiceResourceListOutput { - nextLink?: string; + readonly nextLink?: string; // (undocumented) value?: Array; } -// @public (undocumented) +// @public export interface ServiceResourceOutput extends ProxyResourceOutput { properties?: ServiceResourcePropertiesOutput; } -// @public (undocumented) +// @public export type ServiceResourceProperties = StatefulServiceProperties | StatelessServiceProperties; -// @public (undocumented) +// @public export interface ServiceResourcePropertiesBase { correlationScheme?: Array; defaultMoveCost?: "Zero" | "Low" | "Medium" | "High"; @@ -1673,7 +1654,7 @@ export interface ServiceResourcePropertiesBase { servicePlacementPolicies?: Array; } -// @public (undocumented) +// @public export interface ServiceResourcePropertiesBaseOutput { correlationScheme?: Array; defaultMoveCost?: "Zero" | "Low" | "Medium" | "High"; @@ -1682,13 +1663,13 @@ export interface ServiceResourcePropertiesBaseOutput { servicePlacementPolicies?: Array; } -// @public (undocumented) +// @public export type ServiceResourcePropertiesOutput = StatefulServicePropertiesOutput | StatelessServicePropertiesOutput; -// @public (undocumented) +// @public export interface ServiceResourcePropertiesOutputParent extends ServiceResourcePropertiesBaseOutput { partitionDescription?: PartitionSchemeDescriptionOutput; - provisioningState?: string; + readonly provisioningState?: string; serviceDnsName?: string; // (undocumented) serviceKind: "ServiceResourceProperties" | "Stateful" | "Stateless"; @@ -1696,10 +1677,9 @@ export interface ServiceResourcePropertiesOutputParent extends ServiceResourcePr serviceTypeName?: string; } -// @public (undocumented) +// @public export interface ServiceResourcePropertiesParent extends ServiceResourcePropertiesBase { partitionDescription?: PartitionSchemeDescription; - provisioningState?: string; serviceDnsName?: string; // (undocumented) serviceKind: "ServiceResourceProperties" | "Stateful" | "Stateless"; @@ -1707,29 +1687,29 @@ export interface ServiceResourcePropertiesParent extends ServiceResourceProperti serviceTypeName?: string; } -// @public (undocumented) +// @public export interface ServiceResourceUpdate extends ProxyResource { properties?: ServiceResourceUpdateProperties; } -// @public (undocumented) +// @public export interface ServiceResourceUpdateOutput extends ProxyResourceOutput { properties?: ServiceResourceUpdatePropertiesOutput; } -// @public (undocumented) +// @public export type ServiceResourceUpdateProperties = StatefulServiceUpdateProperties | StatelessServiceUpdateProperties; -// @public (undocumented) +// @public export type ServiceResourceUpdatePropertiesOutput = StatefulServiceUpdatePropertiesOutput | StatelessServiceUpdatePropertiesOutput; -// @public (undocumented) +// @public export interface ServiceResourceUpdatePropertiesOutputParent extends ServiceResourcePropertiesBaseOutput { // (undocumented) serviceKind: "ServiceResourceUpdateProperties" | "Stateful" | "Stateless"; } -// @public (undocumented) +// @public export interface ServiceResourceUpdatePropertiesParent extends ServiceResourcePropertiesBase { // (undocumented) serviceKind: "ServiceResourceUpdateProperties" | "Stateful" | "Stateless"; @@ -1749,7 +1729,7 @@ export interface ServicesCreateOrUpdateBodyParam { } // @public -export interface ServicesCreateOrUpdatedefaultResponse extends HttpResponse { +export interface ServicesCreateOrUpdateDefaultResponse extends HttpResponse { // (undocumented) body: ErrorModelOutput; // (undocumented) @@ -1766,22 +1746,18 @@ export type ServicesCreateOrUpdateParameters = ServicesCreateOrUpdateMediaTypesP // @public export interface ServicesDelete202Response extends HttpResponse { - // (undocumented) - body: Record; // (undocumented) status: "202"; } // @public export interface ServicesDelete204Response extends HttpResponse { - // (undocumented) - body: Record; // (undocumented) status: "204"; } // @public -export interface ServicesDeletedefaultResponse extends HttpResponse { +export interface ServicesDeleteDefaultResponse extends HttpResponse { // (undocumented) body: ErrorModelOutput; // (undocumented) @@ -1793,10 +1769,10 @@ export type ServicesDeleteParameters = RequestParameters; // @public (undocumented) export interface ServicesGet { - delete(options?: ServicesDeleteParameters): StreamableMethod; - get(options?: ServicesGetParameters): StreamableMethod; - patch(options: ServicesUpdateParameters): StreamableMethod; - put(options: ServicesCreateOrUpdateParameters): StreamableMethod; + delete(options?: ServicesDeleteParameters): StreamableMethod; + get(options?: ServicesGetParameters): StreamableMethod; + patch(options: ServicesUpdateParameters): StreamableMethod; + put(options: ServicesCreateOrUpdateParameters): StreamableMethod; } // @public @@ -1808,7 +1784,7 @@ export interface ServicesGet200Response extends HttpResponse { } // @public -export interface ServicesGetdefaultResponse extends HttpResponse { +export interface ServicesGetDefaultResponse extends HttpResponse { // (undocumented) body: ErrorModelOutput; // (undocumented) @@ -1820,7 +1796,7 @@ export type ServicesGetParameters = RequestParameters; // @public (undocumented) export interface ServicesList { - get(options?: ServicesListParameters): StreamableMethod; + get(options?: ServicesListParameters): StreamableMethod; } // @public @@ -1832,7 +1808,7 @@ export interface ServicesList200Response extends HttpResponse { } // @public -export interface ServicesListdefaultResponse extends HttpResponse { +export interface ServicesListDefaultResponse extends HttpResponse { // (undocumented) body: ErrorModelOutput; // (undocumented) @@ -1856,7 +1832,7 @@ export interface ServicesUpdateBodyParam { } // @public -export interface ServicesUpdatedefaultResponse extends HttpResponse { +export interface ServicesUpdateDefaultResponse extends HttpResponse { // (undocumented) body: ErrorModelOutput; // (undocumented) @@ -1871,63 +1847,85 @@ export interface ServicesUpdateMediaTypesParam { // @public (undocumented) export type ServicesUpdateParameters = ServicesUpdateMediaTypesParam & ServicesUpdateBodyParam & RequestParameters; -// @public (undocumented) +// @public export interface ServiceTypeDeltaHealthPolicy { maxPercentDeltaUnhealthyServices?: number; } -// @public (undocumented) +// @public export interface ServiceTypeDeltaHealthPolicyOutput { maxPercentDeltaUnhealthyServices?: number; } -// @public (undocumented) +// @public export interface ServiceTypeHealthPolicy { maxPercentUnhealthyServices?: number; } -// @public (undocumented) +// @public export interface ServiceTypeHealthPolicyOutput { maxPercentUnhealthyServices?: number; } -// @public (undocumented) +// @public export interface SettingsParameterDescription { name: string; value: string; } -// @public (undocumented) +// @public export interface SettingsParameterDescriptionOutput { name: string; value: string; } -// @public (undocumented) +// @public export interface SettingsSectionDescription { name: string; parameters: Array; } -// @public (undocumented) +// @public export interface SettingsSectionDescriptionOutput { name: string; parameters: Array; } -// @public (undocumented) +// @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 SingletonPartitionSchemeDescription extends PartitionSchemeDescriptionParent { // (undocumented) partitionScheme: "Singleton"; } -// @public (undocumented) +// @public export interface SingletonPartitionSchemeDescriptionOutput extends PartitionSchemeDescriptionOutputParent { // (undocumented) partitionScheme: "Singleton"; } -// @public (undocumented) +// @public export interface StatefulServiceProperties extends ServiceResourcePropertiesParent { hasPersistedState?: boolean; minReplicaSetSize?: number; @@ -1939,7 +1937,7 @@ export interface StatefulServiceProperties extends ServiceResourcePropertiesPare targetReplicaSetSize?: number; } -// @public (undocumented) +// @public export interface StatefulServicePropertiesOutput extends ServiceResourcePropertiesOutputParent { hasPersistedState?: boolean; minReplicaSetSize?: number; @@ -1951,7 +1949,7 @@ export interface StatefulServicePropertiesOutput extends ServiceResourceProperti targetReplicaSetSize?: number; } -// @public (undocumented) +// @public export interface StatefulServiceUpdateProperties extends ServiceResourceUpdatePropertiesParent { minReplicaSetSize?: number; quorumLossWaitDuration?: Date | string; @@ -1962,7 +1960,7 @@ export interface StatefulServiceUpdateProperties extends ServiceResourceUpdatePr targetReplicaSetSize?: number; } -// @public (undocumented) +// @public export interface StatefulServiceUpdatePropertiesOutput extends ServiceResourceUpdatePropertiesOutputParent { minReplicaSetSize?: number; quorumLossWaitDuration?: string; @@ -1973,7 +1971,7 @@ export interface StatefulServiceUpdatePropertiesOutput extends ServiceResourceUp targetReplicaSetSize?: number; } -// @public (undocumented) +// @public export interface StatelessServiceProperties extends ServiceResourcePropertiesParent { instanceCloseDelayDuration?: string; instanceCount?: number; @@ -1981,7 +1979,7 @@ export interface StatelessServiceProperties extends ServiceResourcePropertiesPar serviceKind: "Stateless"; } -// @public (undocumented) +// @public export interface StatelessServicePropertiesOutput extends ServiceResourcePropertiesOutputParent { instanceCloseDelayDuration?: string; instanceCount?: number; @@ -1989,7 +1987,7 @@ export interface StatelessServicePropertiesOutput extends ServiceResourcePropert serviceKind: "Stateless"; } -// @public (undocumented) +// @public export interface StatelessServiceUpdateProperties extends ServiceResourceUpdatePropertiesParent { instanceCloseDelayDuration?: string; instanceCount?: number; @@ -1997,7 +1995,7 @@ export interface StatelessServiceUpdateProperties extends ServiceResourceUpdateP serviceKind: "Stateless"; } -// @public (undocumented) +// @public export interface StatelessServiceUpdatePropertiesOutput extends ServiceResourceUpdatePropertiesOutputParent { instanceCloseDelayDuration?: string; instanceCount?: number; @@ -2005,7 +2003,7 @@ export interface StatelessServiceUpdatePropertiesOutput extends ServiceResourceU serviceKind: "Stateless"; } -// @public (undocumented) +// @public export interface SystemData { createdAt?: Date | string; createdBy?: string; @@ -2015,7 +2013,7 @@ export interface SystemData { lastModifiedByType?: string; } -// @public (undocumented) +// @public export interface SystemDataOutput { createdAt?: string; createdBy?: string; @@ -2025,7 +2023,7 @@ export interface SystemDataOutput { lastModifiedByType?: string; } -// @public (undocumented) +// @public export interface UniformInt64RangePartitionSchemeDescription extends PartitionSchemeDescriptionParent { count: number; highKey: string; @@ -2034,7 +2032,7 @@ export interface UniformInt64RangePartitionSchemeDescription extends PartitionSc partitionScheme: "UniformInt64Range"; } -// @public (undocumented) +// @public export interface UniformInt64RangePartitionSchemeDescriptionOutput extends PartitionSchemeDescriptionOutputParent { count: number; highKey: string; @@ -2043,7 +2041,7 @@ export interface UniformInt64RangePartitionSchemeDescriptionOutput extends Parti partitionScheme: "UniformInt64Range"; } -// @public (undocumented) +// @public export interface UpgradableVersionPathResultOutput { // (undocumented) supportedPath?: Array; @@ -2056,14 +2054,12 @@ export interface UpgradableVersionsDescription { // @public (undocumented) export interface UserAssignedIdentity { - clientId?: string; - principalId?: string; } // @public (undocumented) export interface UserAssignedIdentityOutput { - clientId?: string; - principalId?: string; + readonly clientId?: string; + readonly principalId?: string; } // (No @packageDocumentation comment for this package) diff --git a/sdk/servicefabric/arm-servicefabric-rest/samples-dev/applicationTypesDeleteSample.ts b/sdk/servicefabric/arm-servicefabric-rest/samples-dev/applicationTypesDeleteSample.ts index a36140fc488f..2c2c6cb31a92 100644 --- a/sdk/servicefabric/arm-servicefabric-rest/samples-dev/applicationTypesDeleteSample.ts +++ b/sdk/servicefabric/arm-servicefabric-rest/samples-dev/applicationTypesDeleteSample.ts @@ -33,7 +33,7 @@ async function deleteAnApplicationType() { applicationTypeName, ) .delete(); - const poller = getLongRunningPoller(client, initialResponse); + const poller = await getLongRunningPoller(client, initialResponse); const result = await poller.pollUntilDone(); console.log(result); } diff --git a/sdk/servicefabric/arm-servicefabric-rest/samples-dev/clustersCreateOrUpdateSample.ts b/sdk/servicefabric/arm-servicefabric-rest/samples-dev/clustersCreateOrUpdateSample.ts index 42457bba6244..8084237480c0 100644 --- a/sdk/servicefabric/arm-servicefabric-rest/samples-dev/clustersCreateOrUpdateSample.ts +++ b/sdk/servicefabric/arm-servicefabric-rest/samples-dev/clustersCreateOrUpdateSample.ts @@ -192,7 +192,7 @@ async function putAClusterWithMaximumParameters() { clusterName, ) .put(parameters); - const poller = getLongRunningPoller(client, initialResponse); + const poller = await getLongRunningPoller(client, initialResponse); const result = await poller.pollUntilDone(); console.log(result); } @@ -256,7 +256,7 @@ async function putAClusterWithMinimumParameters() { clusterName, ) .put(parameters); - const poller = getLongRunningPoller(client, initialResponse); + const poller = await getLongRunningPoller(client, initialResponse); const result = await poller.pollUntilDone(); console.log(result); } diff --git a/sdk/servicefabric/arm-servicefabric-rest/samples-dev/clustersUpdateSample.ts b/sdk/servicefabric/arm-servicefabric-rest/samples-dev/clustersUpdateSample.ts index 66f0b4401ef5..21a87cf06b0e 100644 --- a/sdk/servicefabric/arm-servicefabric-rest/samples-dev/clustersUpdateSample.ts +++ b/sdk/servicefabric/arm-servicefabric-rest/samples-dev/clustersUpdateSample.ts @@ -69,7 +69,7 @@ async function patchACluster() { clusterName, ) .patch(parameters); - const poller = getLongRunningPoller(client, initialResponse); + const poller = await getLongRunningPoller(client, initialResponse); const result = await poller.pollUntilDone(); console.log(result); } diff --git a/sdk/servicefabric/arm-servicefabric-rest/samples/v1-beta/javascript/applicationTypesDeleteSample.js b/sdk/servicefabric/arm-servicefabric-rest/samples/v1-beta/javascript/applicationTypesDeleteSample.js index d68d3bb25d18..0ee4282f020e 100644 --- a/sdk/servicefabric/arm-servicefabric-rest/samples/v1-beta/javascript/applicationTypesDeleteSample.js +++ b/sdk/servicefabric/arm-servicefabric-rest/samples/v1-beta/javascript/applicationTypesDeleteSample.js @@ -34,7 +34,7 @@ async function deleteAnApplicationType() { applicationTypeName ) .delete(); - const poller = getLongRunningPoller(client, initialResponse); + const poller = await getLongRunningPoller(client, initialResponse); const result = await poller.pollUntilDone(); console.log(result); } diff --git a/sdk/servicefabric/arm-servicefabric-rest/samples/v1-beta/javascript/clustersCreateOrUpdateSample.js b/sdk/servicefabric/arm-servicefabric-rest/samples/v1-beta/javascript/clustersCreateOrUpdateSample.js index e457e9c291f3..c5bb8a2c03d5 100644 --- a/sdk/servicefabric/arm-servicefabric-rest/samples/v1-beta/javascript/clustersCreateOrUpdateSample.js +++ b/sdk/servicefabric/arm-servicefabric-rest/samples/v1-beta/javascript/clustersCreateOrUpdateSample.js @@ -190,7 +190,7 @@ async function putAClusterWithMaximumParameters() { clusterName ) .put(parameters); - const poller = getLongRunningPoller(client, initialResponse); + const poller = await getLongRunningPoller(client, initialResponse); const result = await poller.pollUntilDone(); console.log(result); } @@ -254,7 +254,7 @@ async function putAClusterWithMinimumParameters() { clusterName ) .put(parameters); - const poller = getLongRunningPoller(client, initialResponse); + const poller = await getLongRunningPoller(client, initialResponse); const result = await poller.pollUntilDone(); console.log(result); } diff --git a/sdk/servicefabric/arm-servicefabric-rest/samples/v1-beta/javascript/clustersUpdateSample.js b/sdk/servicefabric/arm-servicefabric-rest/samples/v1-beta/javascript/clustersUpdateSample.js index 29ac1d0e3d3c..c990ac7cb14e 100644 --- a/sdk/servicefabric/arm-servicefabric-rest/samples/v1-beta/javascript/clustersUpdateSample.js +++ b/sdk/servicefabric/arm-servicefabric-rest/samples/v1-beta/javascript/clustersUpdateSample.js @@ -67,7 +67,7 @@ async function patchACluster() { clusterName ) .patch(parameters); - const poller = getLongRunningPoller(client, initialResponse); + const poller = await getLongRunningPoller(client, initialResponse); const result = await poller.pollUntilDone(); console.log(result); } diff --git a/sdk/servicefabric/arm-servicefabric-rest/samples/v1-beta/typescript/src/applicationTypesDeleteSample.ts b/sdk/servicefabric/arm-servicefabric-rest/samples/v1-beta/typescript/src/applicationTypesDeleteSample.ts index 09c970c8e022..82cfbf7ee4b0 100644 --- a/sdk/servicefabric/arm-servicefabric-rest/samples/v1-beta/typescript/src/applicationTypesDeleteSample.ts +++ b/sdk/servicefabric/arm-servicefabric-rest/samples/v1-beta/typescript/src/applicationTypesDeleteSample.ts @@ -33,7 +33,7 @@ async function deleteAnApplicationType() { applicationTypeName ) .delete(); - const poller = getLongRunningPoller(client, initialResponse); + const poller = await getLongRunningPoller(client, initialResponse); const result = await poller.pollUntilDone(); console.log(result); } diff --git a/sdk/servicefabric/arm-servicefabric-rest/samples/v1-beta/typescript/src/clustersCreateOrUpdateSample.ts b/sdk/servicefabric/arm-servicefabric-rest/samples/v1-beta/typescript/src/clustersCreateOrUpdateSample.ts index 9236d4b3341c..fe02a8b23552 100644 --- a/sdk/servicefabric/arm-servicefabric-rest/samples/v1-beta/typescript/src/clustersCreateOrUpdateSample.ts +++ b/sdk/servicefabric/arm-servicefabric-rest/samples/v1-beta/typescript/src/clustersCreateOrUpdateSample.ts @@ -190,7 +190,7 @@ async function putAClusterWithMaximumParameters() { resourceGroupName, clusterName ).put(parameters); - const poller = getLongRunningPoller(client, initialResponse); + const poller = await getLongRunningPoller(client, initialResponse); const result = await poller.pollUntilDone(); console.log(result); } @@ -254,7 +254,7 @@ async function putAClusterWithMinimumParameters() { clusterName ) .put(parameters); - const poller = getLongRunningPoller(client, initialResponse); + const poller = await getLongRunningPoller(client, initialResponse); const result = await poller.pollUntilDone(); console.log(result); } diff --git a/sdk/servicefabric/arm-servicefabric-rest/samples/v1-beta/typescript/src/clustersUpdateSample.ts b/sdk/servicefabric/arm-servicefabric-rest/samples/v1-beta/typescript/src/clustersUpdateSample.ts index c15c93d987c3..defde6a5fe81 100644 --- a/sdk/servicefabric/arm-servicefabric-rest/samples/v1-beta/typescript/src/clustersUpdateSample.ts +++ b/sdk/servicefabric/arm-servicefabric-rest/samples/v1-beta/typescript/src/clustersUpdateSample.ts @@ -69,7 +69,7 @@ async function patchACluster() { clusterName ) .patch(parameters); - const poller = getLongRunningPoller(client, initialResponse); + const poller = await getLongRunningPoller(client, initialResponse); const result = await poller.pollUntilDone(); console.log(result); } diff --git a/sdk/servicefabric/arm-servicefabric-rest/test/public/servicefabric.spec.ts b/sdk/servicefabric/arm-servicefabric-rest/test/public/servicefabric.spec.ts index 14a9f09d81b9..f940225da7bb 100644 --- a/sdk/servicefabric/arm-servicefabric-rest/test/public/servicefabric.spec.ts +++ b/sdk/servicefabric/arm-servicefabric-rest/test/public/servicefabric.spec.ts @@ -30,8 +30,8 @@ describe("Service Fabric Rest Level Client Test", () => { let clusterName: string; let applicationTypeName: string; - beforeEach(async function () { - recorder = await createRecorder(this); + beforeEach(async function (ctx) { + recorder = await createRecorder(ctx); subscriptionId = env.SUBSCRIPTION_ID || ""; // This is an example of how the environment variables are used client = await createClient(recorder); @@ -48,16 +48,7 @@ describe("Service Fabric Rest Level Client Test", () => { it("clusters create test", async function () { const parameters: ClustersCreateOrUpdateParameters = { body: { - type: "Microsoft.ServiceFabric/clusters", location: location, - id: - "/subscriptions/" + - subscriptionId + - "/resourceGroups/" + - resourceGroup + - "/providers/Microsoft.ServiceFabric/clusters/" + - clusterName, - name: clusterName, properties: { managementEndpoint: "http://myCluster.eastus.cloudapp.azure.com:19080", fabricSettings: [ @@ -109,7 +100,7 @@ describe("Service Fabric Rest Level Client Test", () => { clusterName, ) .put(parameters); - const poller = getLongRunningPoller(client, initialResponse, testPollingOptions); + const poller = await getLongRunningPoller(client, initialResponse, testPollingOptions); const result = await poller.pollUntilDone(); assert.equal(result.status, "200"); assert.equal((result.body as ClusterOutput).name, clusterName); @@ -118,18 +109,7 @@ describe("Service Fabric Rest Level Client Test", () => { it("applicationTypes create test", async function () { const parameters: ApplicationTypesCreateOrUpdateParameters = { body: { - type: "applicationTypes", location: location, - id: - "/subscriptions/" + - subscriptionId + - "/resourceGroups/" + - resourceGroup + - "/providers/Microsoft.ServiceFabric/clusters/" + - clusterName + - "/applicationTypes/" + - applicationTypeName, - name: "myCluster", }, }; const result = await client @@ -196,7 +176,7 @@ describe("Service Fabric Rest Level Client Test", () => { assert.equal((result.body as ApplicationTypeResourceListOutput).value?.length, 1); }); - it("clusters update test", async function () { + it("clusters update test", async function (ctx) { if (isPlaybackMode()) { ctx.skip(); } @@ -254,7 +234,7 @@ describe("Service Fabric Rest Level Client Test", () => { clusterName, ) .patch(parameters); - const poller = getLongRunningPoller(client, initialResponse, testPollingOptions); + const poller = await getLongRunningPoller(client, initialResponse, testPollingOptions); const result = await poller.pollUntilDone(); assert.equal(result.status, "200"); assert.equal((result.body as ClusterOutput).properties?.upgradeMode, "Automatic"); @@ -270,7 +250,7 @@ describe("Service Fabric Rest Level Client Test", () => { applicationTypeName, ) .delete(); - const poller = getLongRunningPoller(client, initialResponse, testPollingOptions); + const poller = await getLongRunningPoller(client, initialResponse, testPollingOptions); const deleteResult = await poller.pollUntilDone(); assert.equal(deleteResult.status, "204"); diff --git a/sdk/servicefabric/arm-servicefabric-rest/test/public/utils/recordedClient.ts b/sdk/servicefabric/arm-servicefabric-rest/test/public/utils/recordedClient.ts index d5141c6bdafa..d5701fe6cbd9 100644 --- a/sdk/servicefabric/arm-servicefabric-rest/test/public/utils/recordedClient.ts +++ b/sdk/servicefabric/arm-servicefabric-rest/test/public/utils/recordedClient.ts @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -import type { RecorderStartOptions } from "@azure-tools/test-recorder"; +import type { RecorderStartOptions, TestInfo } from "@azure-tools/test-recorder"; import { Recorder } from "@azure-tools/test-recorder"; import type { ClientOptions } from "@azure-rest/core-client"; import { createTestCredential } from "@azure-tools/test-credential"; @@ -28,8 +28,8 @@ const recorderEnvSetup: RecorderStartOptions = { * Should be called first in the test suite to make sure environment variables are * read before they are being used. */ -export async function createRecorder(context: Context): Promise { - const recorder = new Recorder(context.currentTest); +export async function createRecorder(context: TestInfo): Promise { + const recorder = new Recorder(context); await recorder.start(recorderEnvSetup); return recorder; } diff --git a/sdk/servicefabric/arm-servicefabric-rest/vitest.config.ts b/sdk/servicefabric/arm-servicefabric-rest/vitest.config.ts index cc5cd85d4131..2a4750c84292 100644 --- a/sdk/servicefabric/arm-servicefabric-rest/vitest.config.ts +++ b/sdk/servicefabric/arm-servicefabric-rest/vitest.config.ts @@ -1,7 +1,15 @@ - // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. +import { defineConfig, mergeConfig } from "vitest/config"; import viteConfig from "../../../vitest.shared.config.ts"; -export default viteConfig; +export default mergeConfig( + viteConfig, + defineConfig({ + test: { + hookTimeout: 1200000, + testTimeout: 1200000, + }, + }), +); From c37ccb510b8112e2504f4e891830ee4d01db4d78 Mon Sep 17 00:00:00 2001 From: kazrael2119 <98569699+kazrael2119@users.noreply.github.com> Date: Tue, 31 Dec 2024 13:47:17 +0800 Subject: [PATCH 13/16] Update CHANGELOG.md --- sdk/servicefabric/arm-servicefabric-rest/CHANGELOG.md | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/sdk/servicefabric/arm-servicefabric-rest/CHANGELOG.md b/sdk/servicefabric/arm-servicefabric-rest/CHANGELOG.md index d8bec637860f..1938588c9239 100644 --- a/sdk/servicefabric/arm-servicefabric-rest/CHANGELOG.md +++ b/sdk/servicefabric/arm-servicefabric-rest/CHANGELOG.md @@ -1,14 +1,10 @@ # Release History -## 1.0.0-beta.2 (Unreleased) +## 1.0.0-beta.2 (2024-12-31) ### Features Added -### Breaking Changes - -### Bugs Fixed - -### Other Changes +- refresh sdk with latest codegen ## 1.0.0-beta.1 (2022-07-15) From d14c3768f7b23baadc376497d4091be745a536d1 Mon Sep 17 00:00:00 2001 From: ZiWei Chen <98569699+kazrael2119@users.noreply.github.com> Date: Tue, 31 Dec 2024 13:56:21 +0800 Subject: [PATCH 14/16] Update sdk/servicefabric/arm-servicefabric-rest/CHANGELOG.md --- sdk/servicefabric/arm-servicefabric-rest/CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/servicefabric/arm-servicefabric-rest/CHANGELOG.md b/sdk/servicefabric/arm-servicefabric-rest/CHANGELOG.md index 1938588c9239..3ec7d6fb1e6d 100644 --- a/sdk/servicefabric/arm-servicefabric-rest/CHANGELOG.md +++ b/sdk/servicefabric/arm-servicefabric-rest/CHANGELOG.md @@ -4,7 +4,7 @@ ### Features Added -- refresh sdk with latest codegen +- Refresh sdk with latest codegen ## 1.0.0-beta.1 (2022-07-15) From f862c44f7d5250e462383219bc587a25e22e32ee Mon Sep 17 00:00:00 2001 From: kazrael2119 <98569699+kazrael2119@users.noreply.github.com> Date: Thu, 2 Jan 2025 10:08:52 +0800 Subject: [PATCH 15/16] format --- .../arm-servicefabric-rest/src/pollingHelper.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/sdk/servicefabric/arm-servicefabric-rest/src/pollingHelper.ts b/sdk/servicefabric/arm-servicefabric-rest/src/pollingHelper.ts index 75a3d3db6e98..a2668fc5d9c7 100644 --- a/sdk/servicefabric/arm-servicefabric-rest/src/pollingHelper.ts +++ b/sdk/servicefabric/arm-servicefabric-rest/src/pollingHelper.ts @@ -8,10 +8,9 @@ import type { CreateHttpPollerOptions, RunningOperation, OperationResponse, - OperationState} from "@azure/core-lro"; -import { - createHttpPoller, + OperationState, } from "@azure/core-lro"; +import { createHttpPoller } from "@azure/core-lro"; /** * A simple poller that can be used to poll a long running operation. From 8dd2d1f3b743430a4aba90dac6a0e267997938d3 Mon Sep 17 00:00:00 2001 From: kazrael2119 <98569699+kazrael2119@users.noreply.github.com> Date: Thu, 2 Jan 2025 14:32:46 +0800 Subject: [PATCH 16/16] update --- sdk/servicefabric/arm-servicefabric-rest/assets.json | 2 +- .../arm-servicefabric-rest/vitest.browser.config.ts | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/sdk/servicefabric/arm-servicefabric-rest/assets.json b/sdk/servicefabric/arm-servicefabric-rest/assets.json index 9d2dbe0a9565..a3f6cc6c3d54 100644 --- a/sdk/servicefabric/arm-servicefabric-rest/assets.json +++ b/sdk/servicefabric/arm-servicefabric-rest/assets.json @@ -2,5 +2,5 @@ "AssetsRepo": "Azure/azure-sdk-assets", "AssetsRepoPrefixPath": "js", "TagPrefix": "js/servicefabric/arm-servicefabric-rest", - "Tag": "js/servicefabric/arm-servicefabric-rest_965429c300" + "Tag": "js/servicefabric/arm-servicefabric-rest_3628a15791" } diff --git a/sdk/servicefabric/arm-servicefabric-rest/vitest.browser.config.ts b/sdk/servicefabric/arm-servicefabric-rest/vitest.browser.config.ts index b48c61b2ef46..0ee1aecbc47e 100644 --- a/sdk/servicefabric/arm-servicefabric-rest/vitest.browser.config.ts +++ b/sdk/servicefabric/arm-servicefabric-rest/vitest.browser.config.ts @@ -12,6 +12,8 @@ export default mergeConfig( include: [ "dist-test/browser/test/**/*.spec.js", ], + hookTimeout: 1200000, + testTimeout: 1200000, }, }), );