From ea6ab324f3a6b3a1ca4007d341a144e05da2d700 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Tue, 10 Sep 2024 06:39:09 +0000 Subject: [PATCH] CodeGen from PR 30445 in Azure/azure-rest-api-specs Merge 86c705de224eae356de899b32213f9dbcdf2ef75 into 1ad29756bd141a47cac770140105a706d065ae1b --- common/config/rush/pnpm-lock.yaml | 5 +- .../arm-extendedlocation/CHANGELOG.md | 15 +- .../arm-extendedlocation/LICENSE | 2 +- .../arm-extendedlocation/_meta.json | 10 +- .../arm-extendedlocation/package.json | 36 +- .../review/arm-extendedlocation.api.md | 16 +- .../src/customLocationsManagementClient.ts | 51 +- .../arm-extendedlocation/src/lroImpl.ts | 54 +- .../arm-extendedlocation/src/models/index.ts | 68 +- .../src/models/mappers.ts | 630 +++++++++--------- .../src/models/parameters.ts | 104 +-- .../src/operations/customLocations.ts | 353 +++++----- .../src/operations/resourceSyncRules.ts | 235 +++---- .../operationsInterfaces/customLocations.ts | 32 +- .../operationsInterfaces/resourceSyncRules.ts | 26 +- .../arm-extendedlocation/src/pagingHelper.ts | 2 +- .../arm-extendedlocation/test/sampleTest.ts | 8 +- .../arm-extendedlocation/tsconfig.json | 10 +- 18 files changed, 843 insertions(+), 814 deletions(-) diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index abbfee69ff60..7962ae28f07a 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -14751,7 +14751,7 @@ packages: dev: false file:projects/arm-extendedlocation.tgz: - resolution: {integrity: sha512-/1oB6Ijpuu0oWvGgxE1qz+FvBRcGQorcbD9w9rnBoph/sHRVSc/ri43q/dZrUHd/0UiyiEtg8r37cEPdld4/vQ==, tarball: file:projects/arm-extendedlocation.tgz} + resolution: {integrity: sha512-pKcb6OvFtATN0NJxcXWXvYBUdkaQ/nBDEmRuXBUNVA5nAac2E/a1w6flDIhcWEuOPnrp344vchCJg3vjpudjuw==, tarball: file:projects/arm-extendedlocation.tgz} name: '@rush-temp/arm-extendedlocation' version: 0.0.0 dependencies: @@ -14772,6 +14772,7 @@ packages: rimraf: 5.0.10 ts-node: 10.9.2(@types/node@18.19.50)(typescript@5.5.4) tslib: 2.7.0 + tsx: 4.19.0 typescript: 5.5.4 uglify-js: 3.19.3 transitivePeerDependencies: @@ -23642,7 +23643,7 @@ packages: dev: false file:projects/schema-registry.tgz: - resolution: {integrity: sha512-ykg9DG1Gu7IPionLL0+efdSqVe0OlS1QDWaif5POoetpaaOQyZQIsckMD6LTVTz4F6Ripx1S6M7YCXsYV76lWQ==, tarball: file:projects/schema-registry.tgz} + resolution: {integrity: sha512-x72Sp3S5RVjaKQusCeOucvpmDoSQlBbAxc08R99hRkZKNQ8QtuUlcn7sBhwSnpQ6M3G/VQtaSgPWqsusfxZbOQ==, tarball: file:projects/schema-registry.tgz} name: '@rush-temp/schema-registry' version: 0.0.0 dependencies: diff --git a/sdk/extendedlocation/arm-extendedlocation/CHANGELOG.md b/sdk/extendedlocation/arm-extendedlocation/CHANGELOG.md index 03953b845d3b..2ff2cc6454c3 100644 --- a/sdk/extendedlocation/arm-extendedlocation/CHANGELOG.md +++ b/sdk/extendedlocation/arm-extendedlocation/CHANGELOG.md @@ -1,15 +1,16 @@ # Release History - -## 1.0.0-beta.4 (Unreleased) - + +## 1.0.0-beta.4 (2024-09-10) +Compared with version 1.0.0-beta.3 + ### Features Added -### Breaking Changes + - Enum KnownHostType has a new value EdgeCluster -### Bugs Fixed - -### Other Changes +### Breaking Changes + - Class CustomLocationsManagementClient has a new signature + ## 1.0.0-beta.3 (2023-01-10) ### Features Added diff --git a/sdk/extendedlocation/arm-extendedlocation/LICENSE b/sdk/extendedlocation/arm-extendedlocation/LICENSE index 3a1d9b6f24f7..7d5934740965 100644 --- a/sdk/extendedlocation/arm-extendedlocation/LICENSE +++ b/sdk/extendedlocation/arm-extendedlocation/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2023 Microsoft +Copyright (c) 2024 Microsoft Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/sdk/extendedlocation/arm-extendedlocation/_meta.json b/sdk/extendedlocation/arm-extendedlocation/_meta.json index b97a63a6e44a..ee9322071321 100644 --- a/sdk/extendedlocation/arm-extendedlocation/_meta.json +++ b/sdk/extendedlocation/arm-extendedlocation/_meta.json @@ -1,8 +1,8 @@ { - "commit": "ca5d9600e4950afdae3c23c71d9407b6aa3fce63", - "readme": "specification\\extendedlocation\\resource-manager\\readme.md", - "autorest_command": "autorest --version=3.9.3 --typescript --modelerfour.lenient-model-deduplication --azure-arm --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=F:\\azure-sdk-for-js ..\\azure-rest-api-specs\\specification\\extendedlocation\\resource-manager\\readme.md --use=@autorest/typescript@6.0.0-rc.6.20221226.1 --generate-sample=true", + "commit": "14e7c51ff0d252bee62b0b14cadacbd46e32ae06", + "readme": "specification/extendedlocation/resource-manager/readme.md", + "autorest_command": "autorest --version=3.9.7 --typescript --modelerfour.lenient-model-deduplication --azure-arm --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=/mnt/vss/_work/1/s/azure-sdk-for-js ../azure-rest-api-specs/specification/extendedlocation/resource-manager/readme.md --use=@autorest/typescript@^6.0.12", "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", - "release_tool": "@azure-tools/js-sdk-release-tools@2.5.4", - "use": "@autorest/typescript@6.0.0-rc.6.20221226.1" + "release_tool": "@azure-tools/js-sdk-release-tools@2.7.12", + "use": "@autorest/typescript@^6.0.12" } \ No newline at end of file diff --git a/sdk/extendedlocation/arm-extendedlocation/package.json b/sdk/extendedlocation/arm-extendedlocation/package.json index 44852051e5f9..8d9bfed49952 100644 --- a/sdk/extendedlocation/arm-extendedlocation/package.json +++ b/sdk/extendedlocation/arm-extendedlocation/package.json @@ -8,12 +8,12 @@ "node": ">=18.0.0" }, "dependencies": { - "@azure/core-lro": "^2.2.0", - "@azure/abort-controller": "^1.0.0", + "@azure/core-lro": "^2.5.4", + "@azure/abort-controller": "^2.1.2", "@azure/core-paging": "^1.2.0", - "@azure/core-client": "^1.6.1", - "@azure/core-auth": "^1.3.0", - "@azure/core-rest-pipeline": "^1.8.0", + "@azure/core-client": "^1.7.0", + "@azure/core-auth": "^1.6.0", + "@azure/core-rest-pipeline": "^1.14.0", "tslib": "^2.2.0" }, "keywords": [ @@ -32,19 +32,20 @@ "mkdirp": "^3.0.1", "typescript": "~5.5.3", "uglify-js": "^3.4.9", - "rimraf": "^5.0.5", + "rimraf": "^5.0.0", "dotenv": "^16.0.0", - "@azure/identity": "^4.0.1", + "@azure/dev-tool": "^1.0.0", + "@azure/identity": "^4.2.1", "@azure-tools/test-recorder": "^3.0.0", - "@azure-tools/test-credential": "^1.0.0", + "@azure-tools/test-credential": "^1.1.0", "mocha": "^10.0.0", + "@types/mocha": "^10.0.0", + "tsx": "^4.7.1", "@types/chai": "^4.2.8", "chai": "^4.2.0", "cross-env": "^7.0.2", "@types/node": "^18.0.0", - "@azure/dev-tool": "^1.0.0", - "ts-node": "^10.0.0", - "@types/mocha": "^10.0.0" + "ts-node": "^10.0.0" }, "repository": { "type": "git", @@ -77,7 +78,6 @@ "pack": "npm pack 2>&1", "extract-api": "dev-tool run extract-api", "lint": "echo skipped", - "audit": "echo skipped", "clean": "rimraf --glob dist dist-browser dist-esm test-dist temp types *.tgz *.log", "build:node": "echo skipped", "build:browser": "echo skipped", @@ -106,13 +106,5 @@ ] }, "autoPublish": true, - "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/extendedlocation/arm-extendedlocation", - "//sampleConfiguration": { - "productName": "", - "productSlugs": [ - "azure" - ], - "disableDocsMs": true, - "apiRefLink": "https://docs.microsoft.com/javascript/api/@azure/arm-extendedlocation?view=azure-node-preview" - } -} + "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/extendedlocation/arm-extendedlocation" +} \ No newline at end of file diff --git a/sdk/extendedlocation/arm-extendedlocation/review/arm-extendedlocation.api.md b/sdk/extendedlocation/arm-extendedlocation/review/arm-extendedlocation.api.md index 4f360b4b2da0..4f3238903994 100644 --- a/sdk/extendedlocation/arm-extendedlocation/review/arm-extendedlocation.api.md +++ b/sdk/extendedlocation/arm-extendedlocation/review/arm-extendedlocation.api.md @@ -6,9 +6,9 @@ import * as coreAuth from '@azure/core-auth'; import * as coreClient from '@azure/core-client'; +import { OperationState } from '@azure/core-lro'; import { PagedAsyncIterableIterator } from '@azure/core-paging'; -import { PollerLike } from '@azure/core-lro'; -import { PollOperationState } from '@azure/core-lro'; +import { SimplePollerLike } from '@azure/core-lro'; // @public export type CreatedByType = string; @@ -70,9 +70,9 @@ export interface CustomLocationPropertiesAuthentication { // @public export interface CustomLocations { - beginCreateOrUpdate(resourceGroupName: string, resourceName: string, parameters: CustomLocation, options?: CustomLocationsCreateOrUpdateOptionalParams): Promise, CustomLocationsCreateOrUpdateResponse>>; + beginCreateOrUpdate(resourceGroupName: string, resourceName: string, parameters: CustomLocation, options?: CustomLocationsCreateOrUpdateOptionalParams): Promise, CustomLocationsCreateOrUpdateResponse>>; beginCreateOrUpdateAndWait(resourceGroupName: string, resourceName: string, parameters: CustomLocation, options?: CustomLocationsCreateOrUpdateOptionalParams): Promise; - beginDelete(resourceGroupName: string, resourceName: string, options?: CustomLocationsDeleteOptionalParams): Promise, void>>; + beginDelete(resourceGroupName: string, resourceName: string, options?: CustomLocationsDeleteOptionalParams): Promise, void>>; beginDeleteAndWait(resourceGroupName: string, resourceName: string, options?: CustomLocationsDeleteOptionalParams): Promise; findTargetResourceGroup(resourceGroupName: string, resourceName: string, parameters: CustomLocationFindTargetResourceGroupProperties, options?: CustomLocationsFindTargetResourceGroupOptionalParams): Promise; get(resourceGroupName: string, resourceName: string, options?: CustomLocationsGetOptionalParams): Promise; @@ -173,6 +173,7 @@ export class CustomLocationsManagementClient extends coreClient.ServiceClient { // (undocumented) $host: string; constructor(credentials: coreAuth.TokenCredential, subscriptionId: string, options?: CustomLocationsManagementClientOptionalParams); + constructor(credentials: coreAuth.TokenCredential, options?: CustomLocationsManagementClientOptionalParams); // (undocumented) apiVersion: string; // (undocumented) @@ -180,7 +181,7 @@ export class CustomLocationsManagementClient extends coreClient.ServiceClient { // (undocumented) resourceSyncRules: ResourceSyncRules; // (undocumented) - subscriptionId: string; + subscriptionId?: string; } // @public @@ -272,6 +273,7 @@ export enum KnownCreatedByType { // @public export enum KnownHostType { + EdgeCluster = "EdgeCluster", Kubernetes = "Kubernetes" } @@ -353,9 +355,9 @@ export interface ResourceSyncRulePropertiesSelector { // @public export interface ResourceSyncRules { - beginCreateOrUpdate(resourceGroupName: string, resourceName: string, childResourceName: string, parameters: ResourceSyncRule, options?: ResourceSyncRulesCreateOrUpdateOptionalParams): Promise, ResourceSyncRulesCreateOrUpdateResponse>>; + beginCreateOrUpdate(resourceGroupName: string, resourceName: string, childResourceName: string, parameters: ResourceSyncRule, options?: ResourceSyncRulesCreateOrUpdateOptionalParams): Promise, ResourceSyncRulesCreateOrUpdateResponse>>; beginCreateOrUpdateAndWait(resourceGroupName: string, resourceName: string, childResourceName: string, parameters: ResourceSyncRule, options?: ResourceSyncRulesCreateOrUpdateOptionalParams): Promise; - beginUpdate(resourceGroupName: string, resourceName: string, childResourceName: string, options?: ResourceSyncRulesUpdateOptionalParams): Promise, ResourceSyncRulesUpdateResponse>>; + beginUpdate(resourceGroupName: string, resourceName: string, childResourceName: string, options?: ResourceSyncRulesUpdateOptionalParams): Promise, ResourceSyncRulesUpdateResponse>>; beginUpdateAndWait(resourceGroupName: string, resourceName: string, childResourceName: string, options?: ResourceSyncRulesUpdateOptionalParams): Promise; delete(resourceGroupName: string, resourceName: string, childResourceName: string, options?: ResourceSyncRulesDeleteOptionalParams): Promise; get(resourceGroupName: string, resourceName: string, childResourceName: string, options?: ResourceSyncRulesGetOptionalParams): Promise; diff --git a/sdk/extendedlocation/arm-extendedlocation/src/customLocationsManagementClient.ts b/sdk/extendedlocation/arm-extendedlocation/src/customLocationsManagementClient.ts index 926c0d4b4342..0d27f08cfefa 100644 --- a/sdk/extendedlocation/arm-extendedlocation/src/customLocationsManagementClient.ts +++ b/sdk/extendedlocation/arm-extendedlocation/src/customLocationsManagementClient.ts @@ -11,7 +11,7 @@ import * as coreRestPipeline from "@azure/core-rest-pipeline"; import { PipelineRequest, PipelineResponse, - SendRequest + SendRequest, } from "@azure/core-rest-pipeline"; import * as coreAuth from "@azure/core-auth"; import { CustomLocationsImpl, ResourceSyncRulesImpl } from "./operations"; @@ -21,7 +21,7 @@ import { CustomLocationsManagementClientOptionalParams } from "./models"; export class CustomLocationsManagementClient extends coreClient.ServiceClient { $host: string; apiVersion: string; - subscriptionId: string; + subscriptionId?: string; /** * Initializes a new instance of the CustomLocationsManagementClient class. @@ -32,13 +32,29 @@ export class CustomLocationsManagementClient extends coreClient.ServiceClient { constructor( credentials: coreAuth.TokenCredential, subscriptionId: string, - options?: CustomLocationsManagementClientOptionalParams + options?: CustomLocationsManagementClientOptionalParams, + ); + constructor( + credentials: coreAuth.TokenCredential, + options?: CustomLocationsManagementClientOptionalParams, + ); + constructor( + credentials: coreAuth.TokenCredential, + subscriptionIdOrOptions?: + | CustomLocationsManagementClientOptionalParams + | string, + options?: CustomLocationsManagementClientOptionalParams, ) { if (credentials === undefined) { throw new Error("'credentials' cannot be null"); } - if (subscriptionId === undefined) { - throw new Error("'subscriptionId' cannot be null"); + + let subscriptionId: string | undefined; + + if (typeof subscriptionIdOrOptions === "string") { + subscriptionId = subscriptionIdOrOptions; + } else if (typeof subscriptionIdOrOptions === "object") { + options = subscriptionIdOrOptions; } // Initializing default values for options @@ -47,7 +63,7 @@ export class CustomLocationsManagementClient extends coreClient.ServiceClient { } const defaults: CustomLocationsManagementClientOptionalParams = { requestContentType: "application/json; charset=utf-8", - credential: credentials + credential: credentials, }; const packageDetails = `azsdk-js-arm-extendedlocation/1.0.0-beta.4`; @@ -60,20 +76,21 @@ export class CustomLocationsManagementClient extends coreClient.ServiceClient { ...defaults, ...options, userAgentOptions: { - userAgentPrefix + userAgentPrefix, }, endpoint: - options.endpoint ?? options.baseUri ?? "https://management.azure.com" + options.endpoint ?? options.baseUri ?? "https://management.azure.com", }; super(optionsWithDefaults); let bearerTokenAuthenticationPolicyFound: boolean = false; if (options?.pipeline && options.pipeline.getOrderedPolicies().length > 0) { - const pipelinePolicies: coreRestPipeline.PipelinePolicy[] = options.pipeline.getOrderedPolicies(); + const pipelinePolicies: coreRestPipeline.PipelinePolicy[] = + options.pipeline.getOrderedPolicies(); bearerTokenAuthenticationPolicyFound = pipelinePolicies.some( (pipelinePolicy) => pipelinePolicy.name === - coreRestPipeline.bearerTokenAuthenticationPolicyName + coreRestPipeline.bearerTokenAuthenticationPolicyName, ); } if ( @@ -83,7 +100,7 @@ export class CustomLocationsManagementClient extends coreClient.ServiceClient { !bearerTokenAuthenticationPolicyFound ) { this.pipeline.removePolicy({ - name: coreRestPipeline.bearerTokenAuthenticationPolicyName + name: coreRestPipeline.bearerTokenAuthenticationPolicyName, }); this.pipeline.addPolicy( coreRestPipeline.bearerTokenAuthenticationPolicy({ @@ -93,9 +110,9 @@ export class CustomLocationsManagementClient extends coreClient.ServiceClient { `${optionsWithDefaults.endpoint}/.default`, challengeCallbacks: { authorizeRequestOnChallenge: - coreClient.authorizeRequestOnClaimChallenge - } - }) + coreClient.authorizeRequestOnClaimChallenge, + }, + }), ); } // Parameter assignments @@ -103,7 +120,7 @@ export class CustomLocationsManagementClient extends coreClient.ServiceClient { // Assigning values to Constant parameters this.$host = options.$host || "https://management.azure.com"; - this.apiVersion = options.apiVersion || "2021-08-31-preview"; + this.apiVersion = options.apiVersion || "2024-09-15-preview"; this.customLocations = new CustomLocationsImpl(this); this.resourceSyncRules = new ResourceSyncRulesImpl(this); this.addCustomApiVersionPolicy(options.apiVersion); @@ -118,7 +135,7 @@ export class CustomLocationsManagementClient extends coreClient.ServiceClient { name: "CustomApiVersionPolicy", async sendRequest( request: PipelineRequest, - next: SendRequest + next: SendRequest, ): Promise { const param = request.url.split("?"); if (param.length > 1) { @@ -132,7 +149,7 @@ export class CustomLocationsManagementClient extends coreClient.ServiceClient { request.url = param[0] + "?" + newParams.join("&"); } return next(request); - } + }, }; this.pipeline.addPolicy(apiVersionPolicy); } diff --git a/sdk/extendedlocation/arm-extendedlocation/src/lroImpl.ts b/sdk/extendedlocation/arm-extendedlocation/src/lroImpl.ts index 518d5f053b4e..5f88efab981b 100644 --- a/sdk/extendedlocation/arm-extendedlocation/src/lroImpl.ts +++ b/sdk/extendedlocation/arm-extendedlocation/src/lroImpl.ts @@ -6,29 +6,37 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { AbortSignalLike } from "@azure/abort-controller"; import { LongRunningOperation, LroResponse } from "@azure/core-lro"; -export class LroImpl implements LongRunningOperation { - constructor( - private sendOperationFn: (args: any, spec: any) => Promise>, - private args: Record, - private spec: { - readonly requestBody?: unknown; - readonly path?: string; - readonly httpMethod: string; - } & Record, - public requestPath: string = spec.path!, - public requestMethod: string = spec.httpMethod - ) {} - public async sendInitialRequest(): Promise> { - return this.sendOperationFn(this.args, this.spec); - } - public async sendPollRequest(path: string): Promise> { - const { requestBody, ...restSpec } = this.spec; - return this.sendOperationFn(this.args, { - ...restSpec, - path, - httpMethod: "GET" - }); - } +export function createLroSpec(inputs: { + sendOperationFn: (args: any, spec: any) => Promise>; + args: Record; + spec: { + readonly requestBody?: unknown; + readonly path?: string; + readonly httpMethod: string; + } & Record; +}): LongRunningOperation { + const { args, spec, sendOperationFn } = inputs; + return { + requestMethod: spec.httpMethod, + requestPath: spec.path!, + sendInitialRequest: () => sendOperationFn(args, spec), + sendPollRequest: ( + path: string, + options?: { abortSignal?: AbortSignalLike }, + ) => { + const { requestBody, ...restSpec } = spec; + return sendOperationFn(args, { + ...restSpec, + httpMethod: "GET", + path, + abortSignal: options?.abortSignal, + }); + }, + }; } diff --git a/sdk/extendedlocation/arm-extendedlocation/src/models/index.ts b/sdk/extendedlocation/arm-extendedlocation/src/models/index.ts index f7eb622ab698..7f42adbd3402 100644 --- a/sdk/extendedlocation/arm-extendedlocation/src/models/index.ts +++ b/sdk/extendedlocation/arm-extendedlocation/src/models/index.ts @@ -185,15 +185,15 @@ export interface PatchableCustomLocations { tags?: { [propertyName: string]: string }; /** This is optional input that contains the authentication that should be used to generate the namespace. */ authentication?: CustomLocationPropertiesAuthentication; - /** Contains the reference to the add-on that contains charts to deploy CRDs and operators. */ + /** Contains the reference to the add-on that contains charts to deploy CRDs and operators. Optional for EdgeCluster hostType. */ clusterExtensionIds?: string[]; /** Display name for the Custom Locations location. */ displayName?: string; - /** Connected Cluster or AKS Cluster. The Custom Locations RP will perform a checkAccess API for listAdminCredentials permissions. */ + /** Connected Cluster, AKS Cluster or Edge Cluster. The Custom Locations RP will perform a checkAccess API for listAdminCredentials permissions for Connected Cluster and AKS Cluster. */ hostResourceId?: string; - /** Type of host the Custom Locations is referencing (Kubernetes, etc...). */ + /** Type of host the Custom Locations is referencing (Kubernetes, EdgeCluster, etc...). */ hostType?: HostType; - /** Kubernetes namespace that will be created on the specified cluster. */ + /** Kubernetes namespace that will be created on the specified cluster. Optional for EdgeCluster hostType. */ namespace?: string; /** Provisioning State for the Custom Location. */ provisioningState?: string; @@ -314,15 +314,15 @@ export interface CustomLocation extends TrackedResource { readonly systemData?: SystemData; /** This is optional input that contains the authentication that should be used to generate the namespace. */ authentication?: CustomLocationPropertiesAuthentication; - /** Contains the reference to the add-on that contains charts to deploy CRDs and operators. */ + /** Contains the reference to the add-on that contains charts to deploy CRDs and operators. Optional for EdgeCluster hostType. */ clusterExtensionIds?: string[]; /** Display name for the Custom Locations location. */ displayName?: string; - /** Connected Cluster or AKS Cluster. The Custom Locations RP will perform a checkAccess API for listAdminCredentials permissions. */ + /** Connected Cluster, AKS Cluster or Edge Cluster. The Custom Locations RP will perform a checkAccess API for listAdminCredentials permissions for Connected Cluster and AKS Cluster. */ hostResourceId?: string; - /** Type of host the Custom Locations is referencing (Kubernetes, etc...). */ + /** Type of host the Custom Locations is referencing (Kubernetes, EdgeCluster, etc...). */ hostType?: HostType; - /** Kubernetes namespace that will be created on the specified cluster. */ + /** Kubernetes namespace that will be created on the specified cluster. Optional for EdgeCluster hostType. */ namespace?: string; /** Provisioning State for the Custom Location. */ provisioningState?: string; @@ -368,7 +368,7 @@ export enum KnownResourceIdentityType { /** SystemAssigned */ SystemAssigned = "SystemAssigned", /** None */ - None = "None" + None = "None", } /** @@ -384,7 +384,9 @@ export type ResourceIdentityType = string; /** Known values of {@link HostType} that the service accepts. */ export enum KnownHostType { /** Kubernetes */ - Kubernetes = "Kubernetes" + Kubernetes = "Kubernetes", + /** EdgeCluster */ + EdgeCluster = "EdgeCluster", } /** @@ -392,7 +394,8 @@ export enum KnownHostType { * {@link KnownHostType} can be used interchangeably with HostType, * this enum contains the known values that the service supports. * ### Known values supported by the service - * **Kubernetes** + * **Kubernetes** \ + * **EdgeCluster** */ export type HostType = string; @@ -405,7 +408,7 @@ export enum KnownCreatedByType { /** ManagedIdentity */ ManagedIdentity = "ManagedIdentity", /** Key */ - Key = "Key" + Key = "Key", } /** @@ -425,21 +428,24 @@ export interface CustomLocationsListOperationsOptionalParams extends coreClient.OperationOptions {} /** Contains response data for the listOperations operation. */ -export type CustomLocationsListOperationsResponse = CustomLocationOperationsList; +export type CustomLocationsListOperationsResponse = + CustomLocationOperationsList; /** Optional parameters. */ export interface CustomLocationsListBySubscriptionOptionalParams extends coreClient.OperationOptions {} /** Contains response data for the listBySubscription operation. */ -export type CustomLocationsListBySubscriptionResponse = CustomLocationListResult; +export type CustomLocationsListBySubscriptionResponse = + CustomLocationListResult; /** Optional parameters. */ export interface CustomLocationsListByResourceGroupOptionalParams extends coreClient.OperationOptions {} /** Contains response data for the listByResourceGroup operation. */ -export type CustomLocationsListByResourceGroupResponse = CustomLocationListResult; +export type CustomLocationsListByResourceGroupResponse = + CustomLocationListResult; /** Optional parameters. */ export interface CustomLocationsGetOptionalParams @@ -478,15 +484,15 @@ export interface CustomLocationsUpdateOptionalParams tags?: { [propertyName: string]: string }; /** This is optional input that contains the authentication that should be used to generate the namespace. */ authentication?: CustomLocationPropertiesAuthentication; - /** Contains the reference to the add-on that contains charts to deploy CRDs and operators. */ + /** Contains the reference to the add-on that contains charts to deploy CRDs and operators. Optional for EdgeCluster hostType. */ clusterExtensionIds?: string[]; /** Display name for the Custom Locations location. */ displayName?: string; - /** Connected Cluster or AKS Cluster. The Custom Locations RP will perform a checkAccess API for listAdminCredentials permissions. */ + /** Connected Cluster, AKS Cluster or Edge Cluster. The Custom Locations RP will perform a checkAccess API for listAdminCredentials permissions for Connected Cluster and AKS Cluster. */ hostResourceId?: string; - /** Type of host the Custom Locations is referencing (Kubernetes, etc...). */ + /** Type of host the Custom Locations is referencing (Kubernetes, EdgeCluster, etc...). */ hostType?: HostType; - /** Kubernetes namespace that will be created on the specified cluster. */ + /** Kubernetes namespace that will be created on the specified cluster. Optional for EdgeCluster hostType. */ namespace?: string; /** Provisioning State for the Custom Location. */ provisioningState?: string; @@ -500,49 +506,56 @@ export interface CustomLocationsListEnabledResourceTypesOptionalParams extends coreClient.OperationOptions {} /** Contains response data for the listEnabledResourceTypes operation. */ -export type CustomLocationsListEnabledResourceTypesResponse = EnabledResourceTypesListResult; +export type CustomLocationsListEnabledResourceTypesResponse = + EnabledResourceTypesListResult; /** Optional parameters. */ export interface CustomLocationsFindTargetResourceGroupOptionalParams extends coreClient.OperationOptions {} /** Contains response data for the findTargetResourceGroup operation. */ -export type CustomLocationsFindTargetResourceGroupResponse = CustomLocationFindTargetResourceGroupResult; +export type CustomLocationsFindTargetResourceGroupResponse = + CustomLocationFindTargetResourceGroupResult; /** Optional parameters. */ export interface CustomLocationsListOperationsNextOptionalParams extends coreClient.OperationOptions {} /** Contains response data for the listOperationsNext operation. */ -export type CustomLocationsListOperationsNextResponse = CustomLocationOperationsList; +export type CustomLocationsListOperationsNextResponse = + CustomLocationOperationsList; /** Optional parameters. */ export interface CustomLocationsListBySubscriptionNextOptionalParams extends coreClient.OperationOptions {} /** Contains response data for the listBySubscriptionNext operation. */ -export type CustomLocationsListBySubscriptionNextResponse = CustomLocationListResult; +export type CustomLocationsListBySubscriptionNextResponse = + CustomLocationListResult; /** Optional parameters. */ export interface CustomLocationsListByResourceGroupNextOptionalParams extends coreClient.OperationOptions {} /** Contains response data for the listByResourceGroupNext operation. */ -export type CustomLocationsListByResourceGroupNextResponse = CustomLocationListResult; +export type CustomLocationsListByResourceGroupNextResponse = + CustomLocationListResult; /** Optional parameters. */ export interface CustomLocationsListEnabledResourceTypesNextOptionalParams extends coreClient.OperationOptions {} /** Contains response data for the listEnabledResourceTypesNext operation. */ -export type CustomLocationsListEnabledResourceTypesNextResponse = EnabledResourceTypesListResult; +export type CustomLocationsListEnabledResourceTypesNextResponse = + EnabledResourceTypesListResult; /** Optional parameters. */ export interface ResourceSyncRulesListByCustomLocationIDOptionalParams extends coreClient.OperationOptions {} /** Contains response data for the listByCustomLocationID operation. */ -export type ResourceSyncRulesListByCustomLocationIDResponse = ResourceSyncRuleListResult; +export type ResourceSyncRulesListByCustomLocationIDResponse = + ResourceSyncRuleListResult; /** Optional parameters. */ export interface ResourceSyncRulesGetOptionalParams @@ -592,7 +605,8 @@ export interface ResourceSyncRulesListByCustomLocationIDNextOptionalParams extends coreClient.OperationOptions {} /** Contains response data for the listByCustomLocationIDNext operation. */ -export type ResourceSyncRulesListByCustomLocationIDNextResponse = ResourceSyncRuleListResult; +export type ResourceSyncRulesListByCustomLocationIDNextResponse = + ResourceSyncRuleListResult; /** Optional parameters. */ export interface CustomLocationsManagementClientOptionalParams diff --git a/sdk/extendedlocation/arm-extendedlocation/src/models/mappers.ts b/sdk/extendedlocation/arm-extendedlocation/src/models/mappers.ts index 0cfad5d4232f..91c0abaf6f9a 100644 --- a/sdk/extendedlocation/arm-extendedlocation/src/models/mappers.ts +++ b/sdk/extendedlocation/arm-extendedlocation/src/models/mappers.ts @@ -16,8 +16,8 @@ export const CustomLocationOperationsList: coreClient.CompositeMapper = { nextLink: { serializedName: "nextLink", type: { - name: "String" - } + name: "String", + }, }, value: { serializedName: "value", @@ -27,13 +27,13 @@ export const CustomLocationOperationsList: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "CustomLocationOperation" - } - } - } - } - } - } + className: "CustomLocationOperation", + }, + }, + }, + }, + }, + }, }; export const CustomLocationOperation: coreClient.CompositeMapper = { @@ -45,53 +45,53 @@ export const CustomLocationOperation: coreClient.CompositeMapper = { serializedName: "isDataAction", readOnly: true, type: { - name: "Boolean" - } + name: "Boolean", + }, }, name: { serializedName: "name", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, origin: { serializedName: "origin", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, description: { serializedName: "display.description", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, operation: { serializedName: "display.operation", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, provider: { serializedName: "display.provider", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, resource: { serializedName: "display.resource", readOnly: true, type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; export const ErrorResponse: coreClient.CompositeMapper = { @@ -103,11 +103,11 @@ export const ErrorResponse: coreClient.CompositeMapper = { serializedName: "error", type: { name: "Composite", - className: "ErrorDetail" - } - } - } - } + className: "ErrorDetail", + }, + }, + }, + }, }; export const ErrorDetail: coreClient.CompositeMapper = { @@ -119,22 +119,22 @@ export const ErrorDetail: coreClient.CompositeMapper = { serializedName: "code", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, message: { serializedName: "message", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, target: { serializedName: "target", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, details: { serializedName: "details", @@ -144,10 +144,10 @@ export const ErrorDetail: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "ErrorDetail" - } - } - } + className: "ErrorDetail", + }, + }, + }, }, additionalInfo: { serializedName: "additionalInfo", @@ -157,13 +157,13 @@ export const ErrorDetail: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "ErrorAdditionalInfo" - } - } - } - } - } - } + className: "ErrorAdditionalInfo", + }, + }, + }, + }, + }, + }, }; export const ErrorAdditionalInfo: coreClient.CompositeMapper = { @@ -175,19 +175,19 @@ export const ErrorAdditionalInfo: coreClient.CompositeMapper = { serializedName: "type", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, info: { serializedName: "info", readOnly: true, type: { name: "Dictionary", - value: { type: { name: "any" } } - } - } - } - } + value: { type: { name: "any" } }, + }, + }, + }, + }, }; export const CustomLocationListResult: coreClient.CompositeMapper = { @@ -199,8 +199,8 @@ export const CustomLocationListResult: coreClient.CompositeMapper = { serializedName: "nextLink", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, value: { serializedName: "value", @@ -210,13 +210,13 @@ export const CustomLocationListResult: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "CustomLocation" - } - } - } - } - } - } + className: "CustomLocation", + }, + }, + }, + }, + }, + }, }; export const Identity: coreClient.CompositeMapper = { @@ -228,47 +228,48 @@ export const Identity: coreClient.CompositeMapper = { serializedName: "principalId", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, tenantId: { serializedName: "tenantId", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, type: { serializedName: "type", type: { - name: "String" - } - } - } - } -}; - -export const CustomLocationPropertiesAuthentication: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "CustomLocationPropertiesAuthentication", - modelProperties: { - type: { - serializedName: "type", - type: { - name: "String" - } + name: "String", + }, }, - value: { - serializedName: "value", - type: { - name: "String" - } - } - } - } + }, + }, }; +export const CustomLocationPropertiesAuthentication: coreClient.CompositeMapper = + { + type: { + name: "Composite", + className: "CustomLocationPropertiesAuthentication", + modelProperties: { + type: { + serializedName: "type", + type: { + name: "String", + }, + }, + value: { + serializedName: "value", + type: { + name: "String", + }, + }, + }, + }, + }; + export const SystemData: coreClient.CompositeMapper = { type: { name: "Composite", @@ -277,41 +278,41 @@ export const SystemData: coreClient.CompositeMapper = { createdBy: { serializedName: "createdBy", type: { - name: "String" - } + name: "String", + }, }, createdByType: { serializedName: "createdByType", type: { - name: "String" - } + name: "String", + }, }, createdAt: { serializedName: "createdAt", type: { - name: "DateTime" - } + name: "DateTime", + }, }, lastModifiedBy: { serializedName: "lastModifiedBy", type: { - name: "String" - } + name: "String", + }, }, lastModifiedByType: { serializedName: "lastModifiedByType", type: { - name: "String" - } + name: "String", + }, }, lastModifiedAt: { serializedName: "lastModifiedAt", type: { - name: "DateTime" - } - } - } - } + name: "DateTime", + }, + }, + }, + }, }; export const Resource: coreClient.CompositeMapper = { @@ -323,25 +324,25 @@ export const Resource: coreClient.CompositeMapper = { serializedName: "id", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, name: { serializedName: "name", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, type: { serializedName: "type", readOnly: true, type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; export const PatchableCustomLocations: coreClient.CompositeMapper = { @@ -353,22 +354,22 @@ export const PatchableCustomLocations: coreClient.CompositeMapper = { serializedName: "identity", type: { name: "Composite", - className: "Identity" - } + className: "Identity", + }, }, tags: { serializedName: "tags", type: { name: "Dictionary", - value: { type: { name: "String" } } - } + value: { type: { name: "String" } }, + }, }, authentication: { serializedName: "properties.authentication", type: { name: "Composite", - className: "CustomLocationPropertiesAuthentication" - } + className: "CustomLocationPropertiesAuthentication", + }, }, clusterExtensionIds: { serializedName: "properties.clusterExtensionIds", @@ -376,43 +377,43 @@ export const PatchableCustomLocations: coreClient.CompositeMapper = { name: "Sequence", element: { type: { - name: "String" - } - } - } + name: "String", + }, + }, + }, }, displayName: { serializedName: "properties.displayName", type: { - name: "String" - } + name: "String", + }, }, hostResourceId: { serializedName: "properties.hostResourceId", type: { - name: "String" - } + name: "String", + }, }, hostType: { serializedName: "properties.hostType", type: { - name: "String" - } + name: "String", + }, }, namespace: { serializedName: "properties.namespace", type: { - name: "String" - } + name: "String", + }, }, provisioningState: { serializedName: "properties.provisioningState", type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; export const EnabledResourceTypesListResult: coreClient.CompositeMapper = { @@ -424,8 +425,8 @@ export const EnabledResourceTypesListResult: coreClient.CompositeMapper = { serializedName: "nextLink", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, value: { serializedName: "value", @@ -435,80 +436,83 @@ export const EnabledResourceTypesListResult: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "EnabledResourceType" - } - } - } - } - } - } -}; - -export const EnabledResourceTypePropertiesTypesMetadataItem: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "EnabledResourceTypePropertiesTypesMetadataItem", - modelProperties: { - apiVersion: { - serializedName: "apiVersion", - type: { - name: "String" - } - }, - resourceProviderNamespace: { - serializedName: "resourceProviderNamespace", - type: { - name: "String" - } + className: "EnabledResourceType", + }, + }, + }, }, - resourceType: { - serializedName: "resourceType", - type: { - name: "String" - } - } - } - } + }, + }, }; -export const CustomLocationFindTargetResourceGroupProperties: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "CustomLocationFindTargetResourceGroupProperties", - modelProperties: { - labels: { - serializedName: "labels", - type: { - name: "Dictionary", - value: { type: { name: "String" } } - } - } - } - } -}; +export const EnabledResourceTypePropertiesTypesMetadataItem: coreClient.CompositeMapper = + { + type: { + name: "Composite", + className: "EnabledResourceTypePropertiesTypesMetadataItem", + modelProperties: { + apiVersion: { + serializedName: "apiVersion", + type: { + name: "String", + }, + }, + resourceProviderNamespace: { + serializedName: "resourceProviderNamespace", + type: { + name: "String", + }, + }, + resourceType: { + serializedName: "resourceType", + type: { + name: "String", + }, + }, + }, + }, + }; -export const CustomLocationFindTargetResourceGroupResult: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "CustomLocationFindTargetResourceGroupResult", - modelProperties: { - matchedResourceSyncRule: { - serializedName: "matchedResourceSyncRule", - readOnly: true, - type: { - name: "String" - } - }, - targetResourceGroup: { - serializedName: "targetResourceGroup", - readOnly: true, - type: { - name: "String" - } - } - } - } -}; +export const CustomLocationFindTargetResourceGroupProperties: coreClient.CompositeMapper = + { + type: { + name: "Composite", + className: "CustomLocationFindTargetResourceGroupProperties", + modelProperties: { + labels: { + serializedName: "labels", + type: { + name: "Dictionary", + value: { type: { name: "String" } }, + }, + }, + }, + }, + }; + +export const CustomLocationFindTargetResourceGroupResult: coreClient.CompositeMapper = + { + type: { + name: "Composite", + className: "CustomLocationFindTargetResourceGroupResult", + modelProperties: { + matchedResourceSyncRule: { + serializedName: "matchedResourceSyncRule", + readOnly: true, + type: { + name: "String", + }, + }, + targetResourceGroup: { + serializedName: "targetResourceGroup", + readOnly: true, + type: { + name: "String", + }, + }, + }, + }, + }; export const ResourceSyncRuleListResult: coreClient.CompositeMapper = { type: { @@ -519,8 +523,8 @@ export const ResourceSyncRuleListResult: coreClient.CompositeMapper = { serializedName: "nextLink", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, value: { serializedName: "value", @@ -530,13 +534,13 @@ export const ResourceSyncRuleListResult: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "ResourceSyncRule" - } - } - } - } - } - } + className: "ResourceSyncRule", + }, + }, + }, + }, + }, + }, }; export const ResourceSyncRulePropertiesSelector: coreClient.CompositeMapper = { @@ -551,20 +555,20 @@ export const ResourceSyncRulePropertiesSelector: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "MatchExpressionsProperties" - } - } - } + className: "MatchExpressionsProperties", + }, + }, + }, }, matchLabels: { serializedName: "matchLabels", type: { name: "Dictionary", - value: { type: { name: "String" } } - } - } - } - } + value: { type: { name: "String" } }, + }, + }, + }, + }, }; export const MatchExpressionsProperties: coreClient.CompositeMapper = { @@ -575,14 +579,14 @@ export const MatchExpressionsProperties: coreClient.CompositeMapper = { key: { serializedName: "key", type: { - name: "String" - } + name: "String", + }, }, operator: { serializedName: "operator", type: { - name: "String" - } + name: "String", + }, }, values: { serializedName: "values", @@ -590,13 +594,13 @@ export const MatchExpressionsProperties: coreClient.CompositeMapper = { name: "Sequence", element: { type: { - name: "String" - } - } - } - } - } - } + name: "String", + }, + }, + }, + }, + }, + }, }; export const PatchableResourceSyncRule: coreClient.CompositeMapper = { @@ -608,37 +612,37 @@ export const PatchableResourceSyncRule: coreClient.CompositeMapper = { serializedName: "tags", type: { name: "Dictionary", - value: { type: { name: "String" } } - } + value: { type: { name: "String" } }, + }, }, priority: { serializedName: "properties.priority", type: { - name: "Number" - } + name: "Number", + }, }, provisioningState: { serializedName: "properties.provisioningState", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, selector: { serializedName: "properties.selector", type: { name: "Composite", - className: "ResourceSyncRulePropertiesSelector" - } + className: "ResourceSyncRulePropertiesSelector", + }, }, targetResourceGroup: { serializedName: "properties.targetResourceGroup", type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; export const TrackedResource: coreClient.CompositeMapper = { @@ -651,18 +655,18 @@ export const TrackedResource: coreClient.CompositeMapper = { serializedName: "tags", type: { name: "Dictionary", - value: { type: { name: "String" } } - } + value: { type: { name: "String" } }, + }, }, location: { serializedName: "location", required: true, type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; export const ProxyResource: coreClient.CompositeMapper = { @@ -670,9 +674,9 @@ export const ProxyResource: coreClient.CompositeMapper = { name: "Composite", className: "ProxyResource", modelProperties: { - ...Resource.type.modelProperties - } - } + ...Resource.type.modelProperties, + }, + }, }; export const CustomLocation: coreClient.CompositeMapper = { @@ -685,22 +689,22 @@ export const CustomLocation: coreClient.CompositeMapper = { serializedName: "identity", type: { name: "Composite", - className: "Identity" - } + className: "Identity", + }, }, systemData: { serializedName: "systemData", type: { name: "Composite", - className: "SystemData" - } + className: "SystemData", + }, }, authentication: { serializedName: "properties.authentication", type: { name: "Composite", - className: "CustomLocationPropertiesAuthentication" - } + className: "CustomLocationPropertiesAuthentication", + }, }, clusterExtensionIds: { serializedName: "properties.clusterExtensionIds", @@ -708,43 +712,43 @@ export const CustomLocation: coreClient.CompositeMapper = { name: "Sequence", element: { type: { - name: "String" - } - } - } + name: "String", + }, + }, + }, }, displayName: { serializedName: "properties.displayName", type: { - name: "String" - } + name: "String", + }, }, hostResourceId: { serializedName: "properties.hostResourceId", type: { - name: "String" - } + name: "String", + }, }, hostType: { serializedName: "properties.hostType", type: { - name: "String" - } + name: "String", + }, }, namespace: { serializedName: "properties.namespace", type: { - name: "String" - } + name: "String", + }, }, provisioningState: { serializedName: "properties.provisioningState", type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; export const ResourceSyncRule: coreClient.CompositeMapper = { @@ -757,37 +761,37 @@ export const ResourceSyncRule: coreClient.CompositeMapper = { serializedName: "systemData", type: { name: "Composite", - className: "SystemData" - } + className: "SystemData", + }, }, priority: { serializedName: "properties.priority", type: { - name: "Number" - } + name: "Number", + }, }, provisioningState: { serializedName: "properties.provisioningState", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, selector: { serializedName: "properties.selector", type: { name: "Composite", - className: "ResourceSyncRulePropertiesSelector" - } + className: "ResourceSyncRulePropertiesSelector", + }, }, targetResourceGroup: { serializedName: "properties.targetResourceGroup", type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; export const EnabledResourceType: coreClient.CompositeMapper = { @@ -800,20 +804,20 @@ export const EnabledResourceType: coreClient.CompositeMapper = { serializedName: "systemData", type: { name: "Composite", - className: "SystemData" - } + className: "SystemData", + }, }, clusterExtensionId: { serializedName: "properties.clusterExtensionId", type: { - name: "String" - } + name: "String", + }, }, extensionType: { serializedName: "properties.extensionType", type: { - name: "String" - } + name: "String", + }, }, typesMetadata: { serializedName: "properties.typesMetadata", @@ -822,11 +826,11 @@ export const EnabledResourceType: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "EnabledResourceTypePropertiesTypesMetadataItem" - } - } - } - } - } - } + className: "EnabledResourceTypePropertiesTypesMetadataItem", + }, + }, + }, + }, + }, + }, }; diff --git a/sdk/extendedlocation/arm-extendedlocation/src/models/parameters.ts b/sdk/extendedlocation/arm-extendedlocation/src/models/parameters.ts index 1a5aa79337f9..e8cb743fc822 100644 --- a/sdk/extendedlocation/arm-extendedlocation/src/models/parameters.ts +++ b/sdk/extendedlocation/arm-extendedlocation/src/models/parameters.ts @@ -9,14 +9,14 @@ import { OperationParameter, OperationURLParameter, - OperationQueryParameter + OperationQueryParameter, } from "@azure/core-client"; import { CustomLocation as CustomLocationMapper, PatchableCustomLocations as PatchableCustomLocationsMapper, CustomLocationFindTargetResourceGroupProperties as CustomLocationFindTargetResourceGroupPropertiesMapper, ResourceSyncRule as ResourceSyncRuleMapper, - PatchableResourceSyncRule as PatchableResourceSyncRuleMapper + PatchableResourceSyncRule as PatchableResourceSyncRuleMapper, } from "../models/mappers"; export const accept: OperationParameter = { @@ -26,9 +26,9 @@ export const accept: OperationParameter = { isConstant: true, serializedName: "Accept", type: { - name: "String" - } - } + name: "String", + }, + }, }; export const $host: OperationURLParameter = { @@ -37,36 +37,36 @@ export const $host: OperationURLParameter = { serializedName: "$host", required: true, type: { - name: "String" - } + name: "String", + }, }, - skipEncoding: true + skipEncoding: true, }; export const apiVersion: OperationQueryParameter = { parameterPath: "apiVersion", mapper: { - defaultValue: "2021-08-31-preview", + defaultValue: "2024-09-15-preview", isConstant: true, serializedName: "api-version", type: { - name: "String" - } - } + name: "String", + }, + }, }; export const subscriptionId: OperationURLParameter = { parameterPath: "subscriptionId", mapper: { constraints: { - MinLength: 1 + MinLength: 1, }, serializedName: "subscriptionId", required: true, type: { - name: "String" - } - } + name: "String", + }, + }, }; export const resourceGroupName: OperationURLParameter = { @@ -74,14 +74,14 @@ export const resourceGroupName: OperationURLParameter = { mapper: { constraints: { MaxLength: 90, - MinLength: 1 + MinLength: 1, }, serializedName: "resourceGroupName", required: true, type: { - name: "String" - } - } + name: "String", + }, + }, }; export const resourceName: OperationURLParameter = { @@ -89,17 +89,17 @@ export const resourceName: OperationURLParameter = { mapper: { constraints: { Pattern: new RegExp( - "^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$" + "^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$", ), MaxLength: 63, - MinLength: 1 + MinLength: 1, }, serializedName: "resourceName", required: true, type: { - name: "String" - } - } + name: "String", + }, + }, }; export const contentType: OperationParameter = { @@ -109,64 +109,64 @@ export const contentType: OperationParameter = { isConstant: true, serializedName: "Content-Type", type: { - name: "String" - } - } + name: "String", + }, + }, }; export const parameters: OperationParameter = { parameterPath: "parameters", - mapper: CustomLocationMapper + mapper: CustomLocationMapper, }; export const identity: OperationParameter = { parameterPath: ["options", "identity"], - mapper: PatchableCustomLocationsMapper + mapper: PatchableCustomLocationsMapper, }; export const tags: OperationParameter = { parameterPath: ["options", "tags"], - mapper: PatchableCustomLocationsMapper + mapper: PatchableCustomLocationsMapper, }; export const authentication: OperationParameter = { parameterPath: ["options", "authentication"], - mapper: PatchableCustomLocationsMapper + mapper: PatchableCustomLocationsMapper, }; export const clusterExtensionIds: OperationParameter = { parameterPath: ["options", "clusterExtensionIds"], - mapper: PatchableCustomLocationsMapper + mapper: PatchableCustomLocationsMapper, }; export const displayName: OperationParameter = { parameterPath: ["options", "displayName"], - mapper: PatchableCustomLocationsMapper + mapper: PatchableCustomLocationsMapper, }; export const hostResourceId: OperationParameter = { parameterPath: ["options", "hostResourceId"], - mapper: PatchableCustomLocationsMapper + mapper: PatchableCustomLocationsMapper, }; export const hostType: OperationParameter = { parameterPath: ["options", "hostType"], - mapper: PatchableCustomLocationsMapper + mapper: PatchableCustomLocationsMapper, }; export const namespace: OperationParameter = { parameterPath: ["options", "namespace"], - mapper: PatchableCustomLocationsMapper + mapper: PatchableCustomLocationsMapper, }; export const provisioningState: OperationParameter = { parameterPath: ["options", "provisioningState"], - mapper: PatchableCustomLocationsMapper + mapper: PatchableCustomLocationsMapper, }; export const parameters2: OperationParameter = { parameterPath: "parameters", - mapper: CustomLocationFindTargetResourceGroupPropertiesMapper + mapper: CustomLocationFindTargetResourceGroupPropertiesMapper, }; export const nextLink: OperationURLParameter = { @@ -175,10 +175,10 @@ export const nextLink: OperationURLParameter = { serializedName: "nextLink", required: true, type: { - name: "String" - } + name: "String", + }, }, - skipEncoding: true + skipEncoding: true, }; export const childResourceName: OperationURLParameter = { @@ -186,40 +186,40 @@ export const childResourceName: OperationURLParameter = { mapper: { constraints: { Pattern: new RegExp( - "^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$" + "^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$", ), MaxLength: 63, - MinLength: 1 + MinLength: 1, }, serializedName: "childResourceName", required: true, type: { - name: "String" - } - } + name: "String", + }, + }, }; export const parameters3: OperationParameter = { parameterPath: "parameters", - mapper: ResourceSyncRuleMapper + mapper: ResourceSyncRuleMapper, }; export const tags1: OperationParameter = { parameterPath: ["options", "tags"], - mapper: PatchableResourceSyncRuleMapper + mapper: PatchableResourceSyncRuleMapper, }; export const priority: OperationParameter = { parameterPath: ["options", "priority"], - mapper: PatchableResourceSyncRuleMapper + mapper: PatchableResourceSyncRuleMapper, }; export const selector: OperationParameter = { parameterPath: ["options", "selector"], - mapper: PatchableResourceSyncRuleMapper + mapper: PatchableResourceSyncRuleMapper, }; export const targetResourceGroup: OperationParameter = { parameterPath: ["options", "targetResourceGroup"], - mapper: PatchableResourceSyncRuleMapper + mapper: PatchableResourceSyncRuleMapper, }; diff --git a/sdk/extendedlocation/arm-extendedlocation/src/operations/customLocations.ts b/sdk/extendedlocation/arm-extendedlocation/src/operations/customLocations.ts index ca65ce6ea97a..30a5774d84f1 100644 --- a/sdk/extendedlocation/arm-extendedlocation/src/operations/customLocations.ts +++ b/sdk/extendedlocation/arm-extendedlocation/src/operations/customLocations.ts @@ -13,8 +13,12 @@ import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; import { CustomLocationsManagementClient } from "../customLocationsManagementClient"; -import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; -import { LroImpl } from "../lroImpl"; +import { + SimplePollerLike, + OperationState, + createHttpPoller, +} from "@azure/core-lro"; +import { createLroSpec } from "../lroImpl"; import { CustomLocationOperation, CustomLocationsListOperationsNextOptionalParams, @@ -44,7 +48,7 @@ import { CustomLocationsListOperationsNextResponse, CustomLocationsListBySubscriptionNextResponse, CustomLocationsListByResourceGroupNextResponse, - CustomLocationsListEnabledResourceTypesNextResponse + CustomLocationsListEnabledResourceTypesNextResponse, } from "../models"; /// @@ -65,7 +69,7 @@ export class CustomLocationsImpl implements CustomLocations { * @param options The options parameters. */ public listOperations( - options?: CustomLocationsListOperationsOptionalParams + options?: CustomLocationsListOperationsOptionalParams, ): PagedAsyncIterableIterator { const iter = this.listOperationsPagingAll(options); return { @@ -80,13 +84,13 @@ export class CustomLocationsImpl implements CustomLocations { throw new Error("maxPageSize is not supported by this operation."); } return this.listOperationsPagingPage(options, settings); - } + }, }; } private async *listOperationsPagingPage( options?: CustomLocationsListOperationsOptionalParams, - settings?: PageSettings + settings?: PageSettings, ): AsyncIterableIterator { let result: CustomLocationsListOperationsResponse; let continuationToken = settings?.continuationToken; @@ -107,7 +111,7 @@ export class CustomLocationsImpl implements CustomLocations { } private async *listOperationsPagingAll( - options?: CustomLocationsListOperationsOptionalParams + options?: CustomLocationsListOperationsOptionalParams, ): AsyncIterableIterator { for await (const page of this.listOperationsPagingPage(options)) { yield* page; @@ -120,7 +124,7 @@ export class CustomLocationsImpl implements CustomLocations { * @param options The options parameters. */ public listBySubscription( - options?: CustomLocationsListBySubscriptionOptionalParams + options?: CustomLocationsListBySubscriptionOptionalParams, ): PagedAsyncIterableIterator { const iter = this.listBySubscriptionPagingAll(options); return { @@ -135,13 +139,13 @@ export class CustomLocationsImpl implements CustomLocations { throw new Error("maxPageSize is not supported by this operation."); } return this.listBySubscriptionPagingPage(options, settings); - } + }, }; } private async *listBySubscriptionPagingPage( options?: CustomLocationsListBySubscriptionOptionalParams, - settings?: PageSettings + settings?: PageSettings, ): AsyncIterableIterator { let result: CustomLocationsListBySubscriptionResponse; let continuationToken = settings?.continuationToken; @@ -162,7 +166,7 @@ export class CustomLocationsImpl implements CustomLocations { } private async *listBySubscriptionPagingAll( - options?: CustomLocationsListBySubscriptionOptionalParams + options?: CustomLocationsListBySubscriptionOptionalParams, ): AsyncIterableIterator { for await (const page of this.listBySubscriptionPagingPage(options)) { yield* page; @@ -177,7 +181,7 @@ export class CustomLocationsImpl implements CustomLocations { */ public listByResourceGroup( resourceGroupName: string, - options?: CustomLocationsListByResourceGroupOptionalParams + options?: CustomLocationsListByResourceGroupOptionalParams, ): PagedAsyncIterableIterator { const iter = this.listByResourceGroupPagingAll(resourceGroupName, options); return { @@ -194,16 +198,16 @@ export class CustomLocationsImpl implements CustomLocations { return this.listByResourceGroupPagingPage( resourceGroupName, options, - settings + settings, ); - } + }, }; } private async *listByResourceGroupPagingPage( resourceGroupName: string, options?: CustomLocationsListByResourceGroupOptionalParams, - settings?: PageSettings + settings?: PageSettings, ): AsyncIterableIterator { let result: CustomLocationsListByResourceGroupResponse; let continuationToken = settings?.continuationToken; @@ -218,7 +222,7 @@ export class CustomLocationsImpl implements CustomLocations { result = await this._listByResourceGroupNext( resourceGroupName, continuationToken, - options + options, ); continuationToken = result.nextLink; let page = result.value || []; @@ -229,11 +233,11 @@ export class CustomLocationsImpl implements CustomLocations { private async *listByResourceGroupPagingAll( resourceGroupName: string, - options?: CustomLocationsListByResourceGroupOptionalParams + options?: CustomLocationsListByResourceGroupOptionalParams, ): AsyncIterableIterator { for await (const page of this.listByResourceGroupPagingPage( resourceGroupName, - options + options, )) { yield* page; } @@ -248,12 +252,12 @@ export class CustomLocationsImpl implements CustomLocations { public listEnabledResourceTypes( resourceGroupName: string, resourceName: string, - options?: CustomLocationsListEnabledResourceTypesOptionalParams + options?: CustomLocationsListEnabledResourceTypesOptionalParams, ): PagedAsyncIterableIterator { const iter = this.listEnabledResourceTypesPagingAll( resourceGroupName, resourceName, - options + options, ); return { next() { @@ -270,9 +274,9 @@ export class CustomLocationsImpl implements CustomLocations { resourceGroupName, resourceName, options, - settings + settings, ); - } + }, }; } @@ -280,7 +284,7 @@ export class CustomLocationsImpl implements CustomLocations { resourceGroupName: string, resourceName: string, options?: CustomLocationsListEnabledResourceTypesOptionalParams, - settings?: PageSettings + settings?: PageSettings, ): AsyncIterableIterator { let result: CustomLocationsListEnabledResourceTypesResponse; let continuationToken = settings?.continuationToken; @@ -288,7 +292,7 @@ export class CustomLocationsImpl implements CustomLocations { result = await this._listEnabledResourceTypes( resourceGroupName, resourceName, - options + options, ); let page = result.value || []; continuationToken = result.nextLink; @@ -300,7 +304,7 @@ export class CustomLocationsImpl implements CustomLocations { resourceGroupName, resourceName, continuationToken, - options + options, ); continuationToken = result.nextLink; let page = result.value || []; @@ -312,12 +316,12 @@ export class CustomLocationsImpl implements CustomLocations { private async *listEnabledResourceTypesPagingAll( resourceGroupName: string, resourceName: string, - options?: CustomLocationsListEnabledResourceTypesOptionalParams + options?: CustomLocationsListEnabledResourceTypesOptionalParams, ): AsyncIterableIterator { for await (const page of this.listEnabledResourceTypesPagingPage( resourceGroupName, resourceName, - options + options, )) { yield* page; } @@ -328,11 +332,11 @@ export class CustomLocationsImpl implements CustomLocations { * @param options The options parameters. */ private _listOperations( - options?: CustomLocationsListOperationsOptionalParams + options?: CustomLocationsListOperationsOptionalParams, ): Promise { return this.client.sendOperationRequest( { options }, - listOperationsOperationSpec + listOperationsOperationSpec, ); } @@ -342,11 +346,11 @@ export class CustomLocationsImpl implements CustomLocations { * @param options The options parameters. */ private _listBySubscription( - options?: CustomLocationsListBySubscriptionOptionalParams + options?: CustomLocationsListBySubscriptionOptionalParams, ): Promise { return this.client.sendOperationRequest( { options }, - listBySubscriptionOperationSpec + listBySubscriptionOperationSpec, ); } @@ -358,11 +362,11 @@ export class CustomLocationsImpl implements CustomLocations { */ private _listByResourceGroup( resourceGroupName: string, - options?: CustomLocationsListByResourceGroupOptionalParams + options?: CustomLocationsListByResourceGroupOptionalParams, ): Promise { return this.client.sendOperationRequest( { resourceGroupName, options }, - listByResourceGroupOperationSpec + listByResourceGroupOperationSpec, ); } @@ -375,11 +379,11 @@ export class CustomLocationsImpl implements CustomLocations { get( resourceGroupName: string, resourceName: string, - options?: CustomLocationsGetOptionalParams + options?: CustomLocationsGetOptionalParams, ): Promise { return this.client.sendOperationRequest( { resourceGroupName, resourceName, options }, - getOperationSpec + getOperationSpec, ); } @@ -394,30 +398,29 @@ export class CustomLocationsImpl implements CustomLocations { resourceGroupName: string, resourceName: string, parameters: CustomLocation, - options?: CustomLocationsCreateOrUpdateOptionalParams + options?: CustomLocationsCreateOrUpdateOptionalParams, ): Promise< - PollerLike< - PollOperationState, + SimplePollerLike< + OperationState, CustomLocationsCreateOrUpdateResponse > > { const directSendOperation = async ( args: coreClient.OperationArguments, - spec: coreClient.OperationSpec + spec: coreClient.OperationSpec, ): Promise => { return this.client.sendOperationRequest(args, spec); }; - const sendOperation = async ( + const sendOperationFn = async ( args: coreClient.OperationArguments, - spec: coreClient.OperationSpec + spec: coreClient.OperationSpec, ) => { - let currentRawResponse: - | coreClient.FullOperationResponse - | undefined = undefined; + let currentRawResponse: coreClient.FullOperationResponse | undefined = + undefined; const providedCallback = args.options?.onResponse; const callback: coreClient.RawResponseCallback = ( rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown + flatResponse: unknown, ) => { currentRawResponse = rawResponse; providedCallback?.(rawResponse, flatResponse); @@ -426,8 +429,8 @@ export class CustomLocationsImpl implements CustomLocations { ...args, options: { ...args.options, - onResponse: callback - } + onResponse: callback, + }, }; const flatResponse = await directSendOperation(updatedArgs, spec); return { @@ -435,20 +438,23 @@ export class CustomLocationsImpl implements CustomLocations { rawResponse: { statusCode: currentRawResponse!.status, body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON() - } + headers: currentRawResponse!.headers.toJSON(), + }, }; }; - const lro = new LroImpl( - sendOperation, - { resourceGroupName, resourceName, parameters, options }, - createOrUpdateOperationSpec - ); - const poller = new LroEngine(lro, { - resumeFrom: options?.resumeFrom, + const lro = createLroSpec({ + sendOperationFn, + args: { resourceGroupName, resourceName, parameters, options }, + spec: createOrUpdateOperationSpec, + }); + const poller = await createHttpPoller< + CustomLocationsCreateOrUpdateResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs, - lroResourceLocationConfig: "azure-async-operation" + resourceLocationConfig: "azure-async-operation", }); await poller.poll(); return poller; @@ -465,13 +471,13 @@ export class CustomLocationsImpl implements CustomLocations { resourceGroupName: string, resourceName: string, parameters: CustomLocation, - options?: CustomLocationsCreateOrUpdateOptionalParams + options?: CustomLocationsCreateOrUpdateOptionalParams, ): Promise { const poller = await this.beginCreateOrUpdate( resourceGroupName, resourceName, parameters, - options + options, ); return poller.pollUntilDone(); } @@ -485,25 +491,24 @@ export class CustomLocationsImpl implements CustomLocations { async beginDelete( resourceGroupName: string, resourceName: string, - options?: CustomLocationsDeleteOptionalParams - ): Promise, void>> { + options?: CustomLocationsDeleteOptionalParams, + ): Promise, void>> { const directSendOperation = async ( args: coreClient.OperationArguments, - spec: coreClient.OperationSpec + spec: coreClient.OperationSpec, ): Promise => { return this.client.sendOperationRequest(args, spec); }; - const sendOperation = async ( + const sendOperationFn = async ( args: coreClient.OperationArguments, - spec: coreClient.OperationSpec + spec: coreClient.OperationSpec, ) => { - let currentRawResponse: - | coreClient.FullOperationResponse - | undefined = undefined; + let currentRawResponse: coreClient.FullOperationResponse | undefined = + undefined; const providedCallback = args.options?.onResponse; const callback: coreClient.RawResponseCallback = ( rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown + flatResponse: unknown, ) => { currentRawResponse = rawResponse; providedCallback?.(rawResponse, flatResponse); @@ -512,8 +517,8 @@ export class CustomLocationsImpl implements CustomLocations { ...args, options: { ...args.options, - onResponse: callback - } + onResponse: callback, + }, }; const flatResponse = await directSendOperation(updatedArgs, spec); return { @@ -521,20 +526,20 @@ export class CustomLocationsImpl implements CustomLocations { rawResponse: { statusCode: currentRawResponse!.status, body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON() - } + headers: currentRawResponse!.headers.toJSON(), + }, }; }; - const lro = new LroImpl( - sendOperation, - { resourceGroupName, resourceName, options }, - deleteOperationSpec - ); - const poller = new LroEngine(lro, { - resumeFrom: options?.resumeFrom, + const lro = createLroSpec({ + sendOperationFn, + args: { resourceGroupName, resourceName, options }, + spec: deleteOperationSpec, + }); + const poller = await createHttpPoller>(lro, { + restoreFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs, - lroResourceLocationConfig: "azure-async-operation" + resourceLocationConfig: "azure-async-operation", }); await poller.poll(); return poller; @@ -549,12 +554,12 @@ export class CustomLocationsImpl implements CustomLocations { async beginDeleteAndWait( resourceGroupName: string, resourceName: string, - options?: CustomLocationsDeleteOptionalParams + options?: CustomLocationsDeleteOptionalParams, ): Promise { const poller = await this.beginDelete( resourceGroupName, resourceName, - options + options, ); return poller.pollUntilDone(); } @@ -569,11 +574,11 @@ export class CustomLocationsImpl implements CustomLocations { update( resourceGroupName: string, resourceName: string, - options?: CustomLocationsUpdateOptionalParams + options?: CustomLocationsUpdateOptionalParams, ): Promise { return this.client.sendOperationRequest( { resourceGroupName, resourceName, options }, - updateOperationSpec + updateOperationSpec, ); } @@ -586,11 +591,11 @@ export class CustomLocationsImpl implements CustomLocations { private _listEnabledResourceTypes( resourceGroupName: string, resourceName: string, - options?: CustomLocationsListEnabledResourceTypesOptionalParams + options?: CustomLocationsListEnabledResourceTypesOptionalParams, ): Promise { return this.client.sendOperationRequest( { resourceGroupName, resourceName, options }, - listEnabledResourceTypesOperationSpec + listEnabledResourceTypesOperationSpec, ); } @@ -606,11 +611,11 @@ export class CustomLocationsImpl implements CustomLocations { resourceGroupName: string, resourceName: string, parameters: CustomLocationFindTargetResourceGroupProperties, - options?: CustomLocationsFindTargetResourceGroupOptionalParams + options?: CustomLocationsFindTargetResourceGroupOptionalParams, ): Promise { return this.client.sendOperationRequest( { resourceGroupName, resourceName, parameters, options }, - findTargetResourceGroupOperationSpec + findTargetResourceGroupOperationSpec, ); } @@ -621,11 +626,11 @@ export class CustomLocationsImpl implements CustomLocations { */ private _listOperationsNext( nextLink: string, - options?: CustomLocationsListOperationsNextOptionalParams + options?: CustomLocationsListOperationsNextOptionalParams, ): Promise { return this.client.sendOperationRequest( { nextLink, options }, - listOperationsNextOperationSpec + listOperationsNextOperationSpec, ); } @@ -636,11 +641,11 @@ export class CustomLocationsImpl implements CustomLocations { */ private _listBySubscriptionNext( nextLink: string, - options?: CustomLocationsListBySubscriptionNextOptionalParams + options?: CustomLocationsListBySubscriptionNextOptionalParams, ): Promise { return this.client.sendOperationRequest( { nextLink, options }, - listBySubscriptionNextOperationSpec + listBySubscriptionNextOperationSpec, ); } @@ -653,11 +658,11 @@ export class CustomLocationsImpl implements CustomLocations { private _listByResourceGroupNext( resourceGroupName: string, nextLink: string, - options?: CustomLocationsListByResourceGroupNextOptionalParams + options?: CustomLocationsListByResourceGroupNextOptionalParams, ): Promise { return this.client.sendOperationRequest( { resourceGroupName, nextLink, options }, - listByResourceGroupNextOperationSpec + listByResourceGroupNextOperationSpec, ); } @@ -673,11 +678,11 @@ export class CustomLocationsImpl implements CustomLocations { resourceGroupName: string, resourceName: string, nextLink: string, - options?: CustomLocationsListEnabledResourceTypesNextOptionalParams + options?: CustomLocationsListEnabledResourceTypesNextOptionalParams, ): Promise { return this.client.sendOperationRequest( { resourceGroupName, resourceName, nextLink, options }, - listEnabledResourceTypesNextOperationSpec + listEnabledResourceTypesNextOperationSpec, ); } } @@ -689,97 +694,93 @@ const listOperationsOperationSpec: coreClient.OperationSpec = { httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.CustomLocationOperationsList + bodyMapper: Mappers.CustomLocationOperationsList, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [Parameters.$host], headerParameters: [Parameters.accept], - serializer + serializer, }; const listBySubscriptionOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/providers/Microsoft.ExtendedLocation/customLocations", + path: "/subscriptions/{subscriptionId}/providers/Microsoft.ExtendedLocation/customLocations", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.CustomLocationListResult + bodyMapper: Mappers.CustomLocationListResult, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [Parameters.$host, Parameters.subscriptionId], headerParameters: [Parameters.accept], - serializer + serializer, }; const listByResourceGroupOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ExtendedLocation/customLocations", + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ExtendedLocation/customLocations", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.CustomLocationListResult + bodyMapper: Mappers.CustomLocationListResult, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.subscriptionId, - Parameters.resourceGroupName + Parameters.resourceGroupName, ], headerParameters: [Parameters.accept], - serializer + serializer, }; const getOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ExtendedLocation/customLocations/{resourceName}", + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ExtendedLocation/customLocations/{resourceName}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.CustomLocation + bodyMapper: Mappers.CustomLocation, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.resourceName + Parameters.resourceName, ], headerParameters: [Parameters.accept], - serializer + serializer, }; const createOrUpdateOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ExtendedLocation/customLocations/{resourceName}", + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ExtendedLocation/customLocations/{resourceName}", httpMethod: "PUT", responses: { 200: { - bodyMapper: Mappers.CustomLocation + bodyMapper: Mappers.CustomLocation, }, 201: { - bodyMapper: Mappers.CustomLocation + bodyMapper: Mappers.CustomLocation, }, 202: { - bodyMapper: Mappers.CustomLocation + bodyMapper: Mappers.CustomLocation, }, 204: { - bodyMapper: Mappers.CustomLocation + bodyMapper: Mappers.CustomLocation, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, requestBody: Parameters.parameters, queryParameters: [Parameters.apiVersion], @@ -787,15 +788,14 @@ const createOrUpdateOperationSpec: coreClient.OperationSpec = { Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.resourceName + Parameters.resourceName, ], headerParameters: [Parameters.accept, Parameters.contentType], mediaType: "json", - serializer + serializer, }; const deleteOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ExtendedLocation/customLocations/{resourceName}", + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ExtendedLocation/customLocations/{resourceName}", httpMethod: "DELETE", responses: { 200: {}, @@ -803,30 +803,29 @@ const deleteOperationSpec: coreClient.OperationSpec = { 202: {}, 204: {}, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.resourceName + Parameters.resourceName, ], headerParameters: [Parameters.accept], - serializer + serializer, }; const updateOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ExtendedLocation/customLocations/{resourceName}", + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ExtendedLocation/customLocations/{resourceName}", httpMethod: "PATCH", responses: { 200: { - bodyMapper: Mappers.CustomLocation + bodyMapper: Mappers.CustomLocation, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, requestBody: { parameterPath: { @@ -838,55 +837,53 @@ const updateOperationSpec: coreClient.OperationSpec = { hostResourceId: ["options", "hostResourceId"], hostType: ["options", "hostType"], namespace: ["options", "namespace"], - provisioningState: ["options", "provisioningState"] + provisioningState: ["options", "provisioningState"], }, - mapper: { ...Mappers.PatchableCustomLocations, required: true } + mapper: { ...Mappers.PatchableCustomLocations, required: true }, }, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.resourceName + Parameters.resourceName, ], headerParameters: [Parameters.accept, Parameters.contentType], mediaType: "json", - serializer + serializer, }; const listEnabledResourceTypesOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ExtendedLocation/customLocations/{resourceName}/enabledResourceTypes", + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ExtendedLocation/customLocations/{resourceName}/enabledResourceTypes", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.EnabledResourceTypesListResult + bodyMapper: Mappers.EnabledResourceTypesListResult, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.resourceName + Parameters.resourceName, ], headerParameters: [Parameters.accept], - serializer + serializer, }; const findTargetResourceGroupOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ExtendedLocation/customLocations/{resourceName}/findTargetResourceGroup", + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ExtendedLocation/customLocations/{resourceName}/findTargetResourceGroup", httpMethod: "POST", responses: { 200: { - bodyMapper: Mappers.CustomLocationFindTargetResourceGroupResult + bodyMapper: Mappers.CustomLocationFindTargetResourceGroupResult, }, 204: {}, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, requestBody: Parameters.parameters2, queryParameters: [Parameters.apiVersion], @@ -894,84 +891,84 @@ const findTargetResourceGroupOperationSpec: coreClient.OperationSpec = { Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.resourceName + Parameters.resourceName, ], headerParameters: [Parameters.accept, Parameters.contentType], mediaType: "json", - serializer + serializer, }; const listOperationsNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.CustomLocationOperationsList + bodyMapper: Mappers.CustomLocationOperationsList, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, urlParameters: [Parameters.$host, Parameters.nextLink], headerParameters: [Parameters.accept], - serializer + serializer, }; const listBySubscriptionNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.CustomLocationListResult + bodyMapper: Mappers.CustomLocationListResult, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, urlParameters: [ Parameters.$host, Parameters.subscriptionId, - Parameters.nextLink + Parameters.nextLink, ], headerParameters: [Parameters.accept], - serializer + serializer, }; const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.CustomLocationListResult + bodyMapper: Mappers.CustomLocationListResult, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, urlParameters: [ Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.nextLink + Parameters.nextLink, ], headerParameters: [Parameters.accept], - serializer + serializer, }; const listEnabledResourceTypesNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.EnabledResourceTypesListResult + bodyMapper: Mappers.EnabledResourceTypesListResult, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, urlParameters: [ Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.resourceName, - Parameters.nextLink + Parameters.nextLink, ], headerParameters: [Parameters.accept], - serializer + serializer, }; diff --git a/sdk/extendedlocation/arm-extendedlocation/src/operations/resourceSyncRules.ts b/sdk/extendedlocation/arm-extendedlocation/src/operations/resourceSyncRules.ts index 4bc53ed30cf0..f71a1d16c635 100644 --- a/sdk/extendedlocation/arm-extendedlocation/src/operations/resourceSyncRules.ts +++ b/sdk/extendedlocation/arm-extendedlocation/src/operations/resourceSyncRules.ts @@ -13,8 +13,12 @@ import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; import { CustomLocationsManagementClient } from "../customLocationsManagementClient"; -import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; -import { LroImpl } from "../lroImpl"; +import { + SimplePollerLike, + OperationState, + createHttpPoller, +} from "@azure/core-lro"; +import { createLroSpec } from "../lroImpl"; import { ResourceSyncRule, ResourceSyncRulesListByCustomLocationIDNextOptionalParams, @@ -27,7 +31,7 @@ import { ResourceSyncRulesDeleteOptionalParams, ResourceSyncRulesUpdateOptionalParams, ResourceSyncRulesUpdateResponse, - ResourceSyncRulesListByCustomLocationIDNextResponse + ResourceSyncRulesListByCustomLocationIDNextResponse, } from "../models"; /// @@ -53,12 +57,12 @@ export class ResourceSyncRulesImpl implements ResourceSyncRules { public listByCustomLocationID( resourceGroupName: string, resourceName: string, - options?: ResourceSyncRulesListByCustomLocationIDOptionalParams + options?: ResourceSyncRulesListByCustomLocationIDOptionalParams, ): PagedAsyncIterableIterator { const iter = this.listByCustomLocationIDPagingAll( resourceGroupName, resourceName, - options + options, ); return { next() { @@ -75,9 +79,9 @@ export class ResourceSyncRulesImpl implements ResourceSyncRules { resourceGroupName, resourceName, options, - settings + settings, ); - } + }, }; } @@ -85,7 +89,7 @@ export class ResourceSyncRulesImpl implements ResourceSyncRules { resourceGroupName: string, resourceName: string, options?: ResourceSyncRulesListByCustomLocationIDOptionalParams, - settings?: PageSettings + settings?: PageSettings, ): AsyncIterableIterator { let result: ResourceSyncRulesListByCustomLocationIDResponse; let continuationToken = settings?.continuationToken; @@ -93,7 +97,7 @@ export class ResourceSyncRulesImpl implements ResourceSyncRules { result = await this._listByCustomLocationID( resourceGroupName, resourceName, - options + options, ); let page = result.value || []; continuationToken = result.nextLink; @@ -105,7 +109,7 @@ export class ResourceSyncRulesImpl implements ResourceSyncRules { resourceGroupName, resourceName, continuationToken, - options + options, ); continuationToken = result.nextLink; let page = result.value || []; @@ -117,12 +121,12 @@ export class ResourceSyncRulesImpl implements ResourceSyncRules { private async *listByCustomLocationIDPagingAll( resourceGroupName: string, resourceName: string, - options?: ResourceSyncRulesListByCustomLocationIDOptionalParams + options?: ResourceSyncRulesListByCustomLocationIDOptionalParams, ): AsyncIterableIterator { for await (const page of this.listByCustomLocationIDPagingPage( resourceGroupName, resourceName, - options + options, )) { yield* page; } @@ -138,11 +142,11 @@ export class ResourceSyncRulesImpl implements ResourceSyncRules { private _listByCustomLocationID( resourceGroupName: string, resourceName: string, - options?: ResourceSyncRulesListByCustomLocationIDOptionalParams + options?: ResourceSyncRulesListByCustomLocationIDOptionalParams, ): Promise { return this.client.sendOperationRequest( { resourceGroupName, resourceName, options }, - listByCustomLocationIDOperationSpec + listByCustomLocationIDOperationSpec, ); } @@ -158,11 +162,11 @@ export class ResourceSyncRulesImpl implements ResourceSyncRules { resourceGroupName: string, resourceName: string, childResourceName: string, - options?: ResourceSyncRulesGetOptionalParams + options?: ResourceSyncRulesGetOptionalParams, ): Promise { return this.client.sendOperationRequest( { resourceGroupName, resourceName, childResourceName, options }, - getOperationSpec + getOperationSpec, ); } @@ -180,30 +184,29 @@ export class ResourceSyncRulesImpl implements ResourceSyncRules { resourceName: string, childResourceName: string, parameters: ResourceSyncRule, - options?: ResourceSyncRulesCreateOrUpdateOptionalParams + options?: ResourceSyncRulesCreateOrUpdateOptionalParams, ): Promise< - PollerLike< - PollOperationState, + SimplePollerLike< + OperationState, ResourceSyncRulesCreateOrUpdateResponse > > { const directSendOperation = async ( args: coreClient.OperationArguments, - spec: coreClient.OperationSpec + spec: coreClient.OperationSpec, ): Promise => { return this.client.sendOperationRequest(args, spec); }; - const sendOperation = async ( + const sendOperationFn = async ( args: coreClient.OperationArguments, - spec: coreClient.OperationSpec + spec: coreClient.OperationSpec, ) => { - let currentRawResponse: - | coreClient.FullOperationResponse - | undefined = undefined; + let currentRawResponse: coreClient.FullOperationResponse | undefined = + undefined; const providedCallback = args.options?.onResponse; const callback: coreClient.RawResponseCallback = ( rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown + flatResponse: unknown, ) => { currentRawResponse = rawResponse; providedCallback?.(rawResponse, flatResponse); @@ -212,8 +215,8 @@ export class ResourceSyncRulesImpl implements ResourceSyncRules { ...args, options: { ...args.options, - onResponse: callback - } + onResponse: callback, + }, }; const flatResponse = await directSendOperation(updatedArgs, spec); return { @@ -221,26 +224,29 @@ export class ResourceSyncRulesImpl implements ResourceSyncRules { rawResponse: { statusCode: currentRawResponse!.status, body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON() - } + headers: currentRawResponse!.headers.toJSON(), + }, }; }; - const lro = new LroImpl( - sendOperation, - { + const lro = createLroSpec({ + sendOperationFn, + args: { resourceGroupName, resourceName, childResourceName, parameters, - options + options, }, - createOrUpdateOperationSpec - ); - const poller = new LroEngine(lro, { - resumeFrom: options?.resumeFrom, + spec: createOrUpdateOperationSpec, + }); + const poller = await createHttpPoller< + ResourceSyncRulesCreateOrUpdateResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs, - lroResourceLocationConfig: "azure-async-operation" + resourceLocationConfig: "azure-async-operation", }); await poller.poll(); return poller; @@ -260,14 +266,14 @@ export class ResourceSyncRulesImpl implements ResourceSyncRules { resourceName: string, childResourceName: string, parameters: ResourceSyncRule, - options?: ResourceSyncRulesCreateOrUpdateOptionalParams + options?: ResourceSyncRulesCreateOrUpdateOptionalParams, ): Promise { const poller = await this.beginCreateOrUpdate( resourceGroupName, resourceName, childResourceName, parameters, - options + options, ); return poller.pollUntilDone(); } @@ -284,11 +290,11 @@ export class ResourceSyncRulesImpl implements ResourceSyncRules { resourceGroupName: string, resourceName: string, childResourceName: string, - options?: ResourceSyncRulesDeleteOptionalParams + options?: ResourceSyncRulesDeleteOptionalParams, ): Promise { return this.client.sendOperationRequest( { resourceGroupName, resourceName, childResourceName, options }, - deleteOperationSpec + deleteOperationSpec, ); } @@ -304,30 +310,29 @@ export class ResourceSyncRulesImpl implements ResourceSyncRules { resourceGroupName: string, resourceName: string, childResourceName: string, - options?: ResourceSyncRulesUpdateOptionalParams + options?: ResourceSyncRulesUpdateOptionalParams, ): Promise< - PollerLike< - PollOperationState, + SimplePollerLike< + OperationState, ResourceSyncRulesUpdateResponse > > { const directSendOperation = async ( args: coreClient.OperationArguments, - spec: coreClient.OperationSpec + spec: coreClient.OperationSpec, ): Promise => { return this.client.sendOperationRequest(args, spec); }; - const sendOperation = async ( + const sendOperationFn = async ( args: coreClient.OperationArguments, - spec: coreClient.OperationSpec + spec: coreClient.OperationSpec, ) => { - let currentRawResponse: - | coreClient.FullOperationResponse - | undefined = undefined; + let currentRawResponse: coreClient.FullOperationResponse | undefined = + undefined; const providedCallback = args.options?.onResponse; const callback: coreClient.RawResponseCallback = ( rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown + flatResponse: unknown, ) => { currentRawResponse = rawResponse; providedCallback?.(rawResponse, flatResponse); @@ -336,8 +341,8 @@ export class ResourceSyncRulesImpl implements ResourceSyncRules { ...args, options: { ...args.options, - onResponse: callback - } + onResponse: callback, + }, }; const flatResponse = await directSendOperation(updatedArgs, spec); return { @@ -345,20 +350,23 @@ export class ResourceSyncRulesImpl implements ResourceSyncRules { rawResponse: { statusCode: currentRawResponse!.status, body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON() - } + headers: currentRawResponse!.headers.toJSON(), + }, }; }; - const lro = new LroImpl( - sendOperation, - { resourceGroupName, resourceName, childResourceName, options }, - updateOperationSpec - ); - const poller = new LroEngine(lro, { - resumeFrom: options?.resumeFrom, + const lro = createLroSpec({ + sendOperationFn, + args: { resourceGroupName, resourceName, childResourceName, options }, + spec: updateOperationSpec, + }); + const poller = await createHttpPoller< + ResourceSyncRulesUpdateResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs, - lroResourceLocationConfig: "azure-async-operation" + resourceLocationConfig: "azure-async-operation", }); await poller.poll(); return poller; @@ -376,13 +384,13 @@ export class ResourceSyncRulesImpl implements ResourceSyncRules { resourceGroupName: string, resourceName: string, childResourceName: string, - options?: ResourceSyncRulesUpdateOptionalParams + options?: ResourceSyncRulesUpdateOptionalParams, ): Promise { const poller = await this.beginUpdate( resourceGroupName, resourceName, childResourceName, - options + options, ); return poller.pollUntilDone(); } @@ -398,11 +406,11 @@ export class ResourceSyncRulesImpl implements ResourceSyncRules { resourceGroupName: string, resourceName: string, nextLink: string, - options?: ResourceSyncRulesListByCustomLocationIDNextOptionalParams + options?: ResourceSyncRulesListByCustomLocationIDNextOptionalParams, ): Promise { return this.client.sendOperationRequest( { resourceGroupName, resourceName, nextLink, options }, - listByCustomLocationIDNextOperationSpec + listByCustomLocationIDNextOperationSpec, ); } } @@ -410,38 +418,36 @@ export class ResourceSyncRulesImpl implements ResourceSyncRules { const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); const listByCustomLocationIDOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ExtendedLocation/customLocations/{resourceName}/resourceSyncRules", + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ExtendedLocation/customLocations/{resourceName}/resourceSyncRules", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.ResourceSyncRuleListResult + bodyMapper: Mappers.ResourceSyncRuleListResult, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.resourceName + Parameters.resourceName, ], headerParameters: [Parameters.accept], - serializer + serializer, }; const getOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ExtendedLocation/customLocations/{resourceName}/resourceSyncRules/{childResourceName}", + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ExtendedLocation/customLocations/{resourceName}/resourceSyncRules/{childResourceName}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.ResourceSyncRule + bodyMapper: Mappers.ResourceSyncRule, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [ @@ -449,31 +455,30 @@ const getOperationSpec: coreClient.OperationSpec = { Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.resourceName, - Parameters.childResourceName + Parameters.childResourceName, ], headerParameters: [Parameters.accept], - serializer + serializer, }; const createOrUpdateOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ExtendedLocation/customLocations/{resourceName}/resourceSyncRules/{childResourceName}", + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ExtendedLocation/customLocations/{resourceName}/resourceSyncRules/{childResourceName}", httpMethod: "PUT", responses: { 200: { - bodyMapper: Mappers.ResourceSyncRule + bodyMapper: Mappers.ResourceSyncRule, }, 201: { - bodyMapper: Mappers.ResourceSyncRule + bodyMapper: Mappers.ResourceSyncRule, }, 202: { - bodyMapper: Mappers.ResourceSyncRule + bodyMapper: Mappers.ResourceSyncRule, }, 204: { - bodyMapper: Mappers.ResourceSyncRule + bodyMapper: Mappers.ResourceSyncRule, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, requestBody: Parameters.parameters3, queryParameters: [Parameters.apiVersion], @@ -482,22 +487,21 @@ const createOrUpdateOperationSpec: coreClient.OperationSpec = { Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.resourceName, - Parameters.childResourceName + Parameters.childResourceName, ], headerParameters: [Parameters.accept, Parameters.contentType], mediaType: "json", - serializer + serializer, }; const deleteOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ExtendedLocation/customLocations/{resourceName}/resourceSyncRules/{childResourceName}", + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ExtendedLocation/customLocations/{resourceName}/resourceSyncRules/{childResourceName}", httpMethod: "DELETE", responses: { 200: {}, 204: {}, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [ @@ -505,40 +509,39 @@ const deleteOperationSpec: coreClient.OperationSpec = { Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.resourceName, - Parameters.childResourceName + Parameters.childResourceName, ], headerParameters: [Parameters.accept], - serializer + serializer, }; const updateOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ExtendedLocation/customLocations/{resourceName}/resourceSyncRules/{childResourceName}", + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ExtendedLocation/customLocations/{resourceName}/resourceSyncRules/{childResourceName}", httpMethod: "PATCH", responses: { 200: { - bodyMapper: Mappers.ResourceSyncRule + bodyMapper: Mappers.ResourceSyncRule, }, 201: { - bodyMapper: Mappers.ResourceSyncRule + bodyMapper: Mappers.ResourceSyncRule, }, 202: { - bodyMapper: Mappers.ResourceSyncRule + bodyMapper: Mappers.ResourceSyncRule, }, 204: { - bodyMapper: Mappers.ResourceSyncRule + bodyMapper: Mappers.ResourceSyncRule, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, requestBody: { parameterPath: { tags: ["options", "tags"], priority: ["options", "priority"], selector: ["options", "selector"], - targetResourceGroup: ["options", "targetResourceGroup"] + targetResourceGroup: ["options", "targetResourceGroup"], }, - mapper: { ...Mappers.PatchableResourceSyncRule, required: true } + mapper: { ...Mappers.PatchableResourceSyncRule, required: true }, }, queryParameters: [Parameters.apiVersion], urlParameters: [ @@ -546,30 +549,30 @@ const updateOperationSpec: coreClient.OperationSpec = { Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.resourceName, - Parameters.childResourceName + Parameters.childResourceName, ], headerParameters: [Parameters.accept, Parameters.contentType], mediaType: "json", - serializer + serializer, }; const listByCustomLocationIDNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.ResourceSyncRuleListResult + bodyMapper: Mappers.ResourceSyncRuleListResult, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, urlParameters: [ Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.resourceName, - Parameters.nextLink + Parameters.nextLink, ], headerParameters: [Parameters.accept], - serializer + serializer, }; diff --git a/sdk/extendedlocation/arm-extendedlocation/src/operationsInterfaces/customLocations.ts b/sdk/extendedlocation/arm-extendedlocation/src/operationsInterfaces/customLocations.ts index 1ab3a256394f..941f8e8ecb4d 100644 --- a/sdk/extendedlocation/arm-extendedlocation/src/operationsInterfaces/customLocations.ts +++ b/sdk/extendedlocation/arm-extendedlocation/src/operationsInterfaces/customLocations.ts @@ -7,7 +7,7 @@ */ import { PagedAsyncIterableIterator } from "@azure/core-paging"; -import { PollerLike, PollOperationState } from "@azure/core-lro"; +import { SimplePollerLike, OperationState } from "@azure/core-lro"; import { CustomLocationOperation, CustomLocationsListOperationsOptionalParams, @@ -25,7 +25,7 @@ import { CustomLocationsUpdateResponse, CustomLocationFindTargetResourceGroupProperties, CustomLocationsFindTargetResourceGroupOptionalParams, - CustomLocationsFindTargetResourceGroupResponse + CustomLocationsFindTargetResourceGroupResponse, } from "../models"; /// @@ -36,7 +36,7 @@ export interface CustomLocations { * @param options The options parameters. */ listOperations( - options?: CustomLocationsListOperationsOptionalParams + options?: CustomLocationsListOperationsOptionalParams, ): PagedAsyncIterableIterator; /** * Gets a list of Custom Locations in the specified subscription. The operation returns properties of @@ -44,7 +44,7 @@ export interface CustomLocations { * @param options The options parameters. */ listBySubscription( - options?: CustomLocationsListBySubscriptionOptionalParams + options?: CustomLocationsListBySubscriptionOptionalParams, ): PagedAsyncIterableIterator; /** * Gets a list of Custom Locations in the specified subscription and resource group. The operation @@ -54,7 +54,7 @@ export interface CustomLocations { */ listByResourceGroup( resourceGroupName: string, - options?: CustomLocationsListByResourceGroupOptionalParams + options?: CustomLocationsListByResourceGroupOptionalParams, ): PagedAsyncIterableIterator; /** * Gets the list of the Enabled Resource Types. @@ -65,7 +65,7 @@ export interface CustomLocations { listEnabledResourceTypes( resourceGroupName: string, resourceName: string, - options?: CustomLocationsListEnabledResourceTypesOptionalParams + options?: CustomLocationsListEnabledResourceTypesOptionalParams, ): PagedAsyncIterableIterator; /** * Gets the details of the customLocation with a specified resource group and name. @@ -76,7 +76,7 @@ export interface CustomLocations { get( resourceGroupName: string, resourceName: string, - options?: CustomLocationsGetOptionalParams + options?: CustomLocationsGetOptionalParams, ): Promise; /** * Creates or updates a Custom Location in the specified Subscription and Resource Group @@ -89,10 +89,10 @@ export interface CustomLocations { resourceGroupName: string, resourceName: string, parameters: CustomLocation, - options?: CustomLocationsCreateOrUpdateOptionalParams + options?: CustomLocationsCreateOrUpdateOptionalParams, ): Promise< - PollerLike< - PollOperationState, + SimplePollerLike< + OperationState, CustomLocationsCreateOrUpdateResponse > >; @@ -107,7 +107,7 @@ export interface CustomLocations { resourceGroupName: string, resourceName: string, parameters: CustomLocation, - options?: CustomLocationsCreateOrUpdateOptionalParams + options?: CustomLocationsCreateOrUpdateOptionalParams, ): Promise; /** * Deletes the Custom Location with the specified Resource Name, Resource Group, and Subscription Id. @@ -118,8 +118,8 @@ export interface CustomLocations { beginDelete( resourceGroupName: string, resourceName: string, - options?: CustomLocationsDeleteOptionalParams - ): Promise, void>>; + options?: CustomLocationsDeleteOptionalParams, + ): Promise, void>>; /** * Deletes the Custom Location with the specified Resource Name, Resource Group, and Subscription Id. * @param resourceGroupName The name of the resource group. The name is case insensitive. @@ -129,7 +129,7 @@ export interface CustomLocations { beginDeleteAndWait( resourceGroupName: string, resourceName: string, - options?: CustomLocationsDeleteOptionalParams + options?: CustomLocationsDeleteOptionalParams, ): Promise; /** * Updates a Custom Location with the specified Resource Name in the specified Resource Group and @@ -141,7 +141,7 @@ export interface CustomLocations { update( resourceGroupName: string, resourceName: string, - options?: CustomLocationsUpdateOptionalParams + options?: CustomLocationsUpdateOptionalParams, ): Promise; /** * Returns the target resource group associated with the resource sync rules of the Custom Location @@ -155,6 +155,6 @@ export interface CustomLocations { resourceGroupName: string, resourceName: string, parameters: CustomLocationFindTargetResourceGroupProperties, - options?: CustomLocationsFindTargetResourceGroupOptionalParams + options?: CustomLocationsFindTargetResourceGroupOptionalParams, ): Promise; } diff --git a/sdk/extendedlocation/arm-extendedlocation/src/operationsInterfaces/resourceSyncRules.ts b/sdk/extendedlocation/arm-extendedlocation/src/operationsInterfaces/resourceSyncRules.ts index 3e89ab70adff..48d48e6c862b 100644 --- a/sdk/extendedlocation/arm-extendedlocation/src/operationsInterfaces/resourceSyncRules.ts +++ b/sdk/extendedlocation/arm-extendedlocation/src/operationsInterfaces/resourceSyncRules.ts @@ -7,7 +7,7 @@ */ import { PagedAsyncIterableIterator } from "@azure/core-paging"; -import { PollerLike, PollOperationState } from "@azure/core-lro"; +import { SimplePollerLike, OperationState } from "@azure/core-lro"; import { ResourceSyncRule, ResourceSyncRulesListByCustomLocationIDOptionalParams, @@ -17,7 +17,7 @@ import { ResourceSyncRulesCreateOrUpdateResponse, ResourceSyncRulesDeleteOptionalParams, ResourceSyncRulesUpdateOptionalParams, - ResourceSyncRulesUpdateResponse + ResourceSyncRulesUpdateResponse, } from "../models"; /// @@ -33,7 +33,7 @@ export interface ResourceSyncRules { listByCustomLocationID( resourceGroupName: string, resourceName: string, - options?: ResourceSyncRulesListByCustomLocationIDOptionalParams + options?: ResourceSyncRulesListByCustomLocationIDOptionalParams, ): PagedAsyncIterableIterator; /** * Gets the details of the resourceSyncRule with a specified resource group, subscription id Custom @@ -47,7 +47,7 @@ export interface ResourceSyncRules { resourceGroupName: string, resourceName: string, childResourceName: string, - options?: ResourceSyncRulesGetOptionalParams + options?: ResourceSyncRulesGetOptionalParams, ): Promise; /** * Creates or updates a Resource Sync Rule in the parent Custom Location, Subscription Id and Resource @@ -63,10 +63,10 @@ export interface ResourceSyncRules { resourceName: string, childResourceName: string, parameters: ResourceSyncRule, - options?: ResourceSyncRulesCreateOrUpdateOptionalParams + options?: ResourceSyncRulesCreateOrUpdateOptionalParams, ): Promise< - PollerLike< - PollOperationState, + SimplePollerLike< + OperationState, ResourceSyncRulesCreateOrUpdateResponse > >; @@ -84,7 +84,7 @@ export interface ResourceSyncRules { resourceName: string, childResourceName: string, parameters: ResourceSyncRule, - options?: ResourceSyncRulesCreateOrUpdateOptionalParams + options?: ResourceSyncRulesCreateOrUpdateOptionalParams, ): Promise; /** * Deletes the Resource Sync Rule with the specified Resource Sync Rule Name, Custom Location Resource @@ -98,7 +98,7 @@ export interface ResourceSyncRules { resourceGroupName: string, resourceName: string, childResourceName: string, - options?: ResourceSyncRulesDeleteOptionalParams + options?: ResourceSyncRulesDeleteOptionalParams, ): Promise; /** * Updates a Resource Sync Rule with the specified Resource Sync Rule name in the specified Resource @@ -112,10 +112,10 @@ export interface ResourceSyncRules { resourceGroupName: string, resourceName: string, childResourceName: string, - options?: ResourceSyncRulesUpdateOptionalParams + options?: ResourceSyncRulesUpdateOptionalParams, ): Promise< - PollerLike< - PollOperationState, + SimplePollerLike< + OperationState, ResourceSyncRulesUpdateResponse > >; @@ -131,6 +131,6 @@ export interface ResourceSyncRules { resourceGroupName: string, resourceName: string, childResourceName: string, - options?: ResourceSyncRulesUpdateOptionalParams + options?: ResourceSyncRulesUpdateOptionalParams, ): Promise; } diff --git a/sdk/extendedlocation/arm-extendedlocation/src/pagingHelper.ts b/sdk/extendedlocation/arm-extendedlocation/src/pagingHelper.ts index 269a2b9814b5..205cccc26592 100644 --- a/sdk/extendedlocation/arm-extendedlocation/src/pagingHelper.ts +++ b/sdk/extendedlocation/arm-extendedlocation/src/pagingHelper.ts @@ -28,7 +28,7 @@ export function getContinuationToken(page: unknown): string | undefined { export function setContinuationToken( page: unknown, - continuationToken: string | undefined + continuationToken: string | undefined, ): void { if (typeof page !== "object" || page === null || !continuationToken) { return; diff --git a/sdk/extendedlocation/arm-extendedlocation/test/sampleTest.ts b/sdk/extendedlocation/arm-extendedlocation/test/sampleTest.ts index 8ff7deb0acbe..d64be981b694 100644 --- a/sdk/extendedlocation/arm-extendedlocation/test/sampleTest.ts +++ b/sdk/extendedlocation/arm-extendedlocation/test/sampleTest.ts @@ -9,7 +9,7 @@ import { Recorder, RecorderStartOptions, - env + env, } from "@azure-tools/test-recorder"; import { assert } from "chai"; import { Context } from "mocha"; @@ -18,15 +18,11 @@ const replaceableVariables: Record = { AZURE_CLIENT_ID: "azure_client_id", AZURE_CLIENT_SECRET: "azure_client_secret", AZURE_TENANT_ID: "88888888-8888-8888-8888-888888888888", - SUBSCRIPTION_ID: "azure_subscription_id" + SUBSCRIPTION_ID: "azure_subscription_id", }; const recorderOptions: RecorderStartOptions = { envSetupForPlayback: replaceableVariables, - removeCentralSanitizers: [ - "AZSDK3493", // .name in the body is not a secret and is listed below in the beforeEach section - "AZSDK3430", // .id in the body is not a secret and is listed below in the beforeEach section - ], }; describe("My test", () => { diff --git a/sdk/extendedlocation/arm-extendedlocation/tsconfig.json b/sdk/extendedlocation/arm-extendedlocation/tsconfig.json index d67561b69bde..3e6ae96443f3 100644 --- a/sdk/extendedlocation/arm-extendedlocation/tsconfig.json +++ b/sdk/extendedlocation/arm-extendedlocation/tsconfig.json @@ -15,17 +15,11 @@ ], "declaration": true, "outDir": "./dist-esm", - "importHelpers": true, - "paths": { - "@azure/arm-extendedlocation": [ - "./src/index" - ] - } + "importHelpers": true }, "include": [ "./src/**/*.ts", - "./test/**/*.ts", - "samples-dev/**/*.ts" + "./test/**/*.ts" ], "exclude": [ "node_modules"