From fd383977a128e2108be947870330f0f1a6687f2f Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Tue, 22 Apr 2025 06:43:26 +0000 Subject: [PATCH] CodeGen from PR 34119 in Azure/azure-rest-api-specs Merge 5ed2be45c2dcfd00dabdbb80b832aeadb6b7487e into 908f30f83295f8afe862310153344468510e3b88 --- common/config/rush/pnpm-lock.yaml | 2 +- .../arm-extendedlocation/CHANGELOG.md | 42 +- .../arm-extendedlocation/LICENSE | 2 +- .../arm-extendedlocation/README.md | 8 +- .../arm-extendedlocation/_meta.json | 12 +- .../arm-extendedlocation/api-extractor.json | 6 +- .../arm-extendedlocation/package.json | 32 +- .../review/arm-extendedlocation.api.md | 158 ++-- .../arm-extendedlocation/sample.env | 5 +- .../src/customLocationsManagementClient.ts | 41 +- .../arm-extendedlocation/src/lroImpl.ts | 54 +- .../arm-extendedlocation/src/models/index.ts | 343 +++++--- .../src/models/mappers.ts | 830 ++++++++++-------- .../src/models/parameters.ts | 120 +-- .../src/operations/customLocations.ts | 528 +++++------ .../src/operations/index.ts | 1 + .../src/operations/operations.ts | 149 ++++ .../src/operations/resourceSyncRules.ts | 319 +++---- .../operationsInterfaces/customLocations.ts | 63 +- .../src/operationsInterfaces/index.ts | 1 + .../src/operationsInterfaces/operations.ts | 22 + .../operationsInterfaces/resourceSyncRules.ts | 53 +- .../arm-extendedlocation/src/pagingHelper.ts | 2 +- .../arm-extendedlocation/test/sampleTest.ts | 40 + .../test/snippets.spec.ts | 19 +- .../tsconfig.browser.config.json | 5 +- .../arm-extendedlocation/tsconfig.json | 5 +- .../tsconfig.samples.json | 4 +- .../arm-extendedlocation/tsconfig.test.json | 5 +- .../vitest.browser.config.ts | 3 +- .../arm-extendedlocation/vitest.config.ts | 1 + .../arm-extendedlocation/vitest.esm.config.ts | 6 +- 32 files changed, 1560 insertions(+), 1321 deletions(-) create mode 100644 sdk/extendedlocation/arm-extendedlocation/src/operations/operations.ts create mode 100644 sdk/extendedlocation/arm-extendedlocation/src/operationsInterfaces/operations.ts create mode 100644 sdk/extendedlocation/arm-extendedlocation/test/sampleTest.ts diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index 789680bf18b1..604cbaf83658 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -2762,7 +2762,7 @@ packages: version: 0.0.0 '@rush-temp/arm-extendedlocation@file:projects/arm-extendedlocation.tgz': - resolution: {integrity: sha512-UeS0DUduxGBGHsHlRlAsTRVje/ZlyViluptSpu57EHYvyEi8upjDNIYP0ZNQ4KwG2SzrCKBphRLcpVqF1/A77Q==, tarball: file:projects/arm-extendedlocation.tgz} + resolution: {integrity: sha512-dHyV3UZz4HaQD8WyrQbuXn1OP4WsMnWPv4NfE14X97kcDQ1rXVJkpSvW0QY8LAUSW9sNMPc+oVY8X/myl3E2Vg==, tarball: file:projects/arm-extendedlocation.tgz} version: 0.0.0 '@rush-temp/arm-fabric@file:projects/arm-fabric.tgz': diff --git a/sdk/extendedlocation/arm-extendedlocation/CHANGELOG.md b/sdk/extendedlocation/arm-extendedlocation/CHANGELOG.md index 03953b845d3b..9b887697f7d7 100644 --- a/sdk/extendedlocation/arm-extendedlocation/CHANGELOG.md +++ b/sdk/extendedlocation/arm-extendedlocation/CHANGELOG.md @@ -1,15 +1,43 @@ # Release History - -## 1.0.0-beta.4 (Unreleased) - + +## 1.0.0-beta.4 (2025-04-22) +Compared with version 1.0.0-beta.3 + ### Features Added -### Breaking Changes + - Added operation group Operations + - Added operation ResourceSyncRules.update + - Added Interface CustomLocationsCreateOrUpdateHeaders + - Added Interface CustomLocationsDeleteHeaders + - Added Interface EnabledResourceTypeListResult + - Added Interface Operation + - Added Interface OperationDisplay + - Added Interface OperationListResult + - Added Interface OperationsListNextOptionalParams + - Added Interface OperationsListOptionalParams + - Added Interface ResourceSyncRulesCreateOrUpdateHeaders + - Added Type Alias ActionType + - Added Type Alias CustomLocationsDeleteResponse + - Added Type Alias OperationsListNextResponse + - Added Type Alias OperationsListResponse + - Added Type Alias Origin + - Interface Resource has a new optional parameter systemData + - Added Enum KnownActionType + - Added Enum KnownOrigin -### Bugs Fixed - -### Other Changes +### Breaking Changes + - Removed operation CustomLocations.listOperations + - Removed operation ResourceSyncRules.beginUpdate + - Removed operation ResourceSyncRules.beginUpdateAndWait + - Interface CustomLocation no longer has parameter systemData + - Interface EnabledResourceType no longer has parameter systemData + - Interface ResourceSyncRule no longer has parameter systemData + - Interface ResourceSyncRulesUpdateOptionalParams no longer has parameter resumeFrom + - Interface ResourceSyncRulesUpdateOptionalParams no longer has parameter updateIntervalInMs + - Parameter value of interface CustomLocationListResult is now required + - Parameter value of interface ResourceSyncRuleListResult is now required + ## 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 b2f52a2bad4e..63447fd8bbbf 100644 --- a/sdk/extendedlocation/arm-extendedlocation/LICENSE +++ b/sdk/extendedlocation/arm-extendedlocation/LICENSE @@ -18,4 +18,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. +SOFTWARE. \ No newline at end of file diff --git a/sdk/extendedlocation/arm-extendedlocation/README.md b/sdk/extendedlocation/arm-extendedlocation/README.md index 747d17847168..ac3b94586983 100644 --- a/sdk/extendedlocation/arm-extendedlocation/README.md +++ b/sdk/extendedlocation/arm-extendedlocation/README.md @@ -44,7 +44,6 @@ npm install @azure/identity ``` You will also need to **register a new AAD application and grant access to Azure CustomLocationsManagement** by assigning the suitable role to your service principal (note: roles such as `"Owner"` will not grant the necessary permissions). -Set the values of the client ID, tenant ID, and client secret of the AAD application as environment variables: `AZURE_CLIENT_ID`, `AZURE_TENANT_ID`, `AZURE_CLIENT_SECRET`. For more information about how to create an Azure AD Application check out [this guide](https://learn.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal). @@ -64,16 +63,14 @@ For browser environments, use the `InteractiveBrowserCredential` from the `@azur import { InteractiveBrowserCredential } from "@azure/identity"; import { CustomLocationsManagementClient } from "@azure/arm-extendedlocation"; -const subscriptionId = "00000000-0000-0000-0000-000000000000"; const credential = new InteractiveBrowserCredential({ tenantId: "", - clientId: "", -}); + clientId: "" + }); const client = new CustomLocationsManagementClient(credential, subscriptionId); ``` ### JavaScript Bundle - To use this client library in the browser, first you need to use a bundler. For details on how to do this, please refer to our [bundling documentation](https://aka.ms/AzureSDKBundling). ## Key concepts @@ -109,7 +106,6 @@ If you'd like to contribute to this library, please read the [contributing guide - [Microsoft Azure SDK for JavaScript](https://github.com/Azure/azure-sdk-for-js) - [azure_cli]: https://learn.microsoft.com/cli/azure [azure_sub]: https://azure.microsoft.com/free/ [azure_sub]: https://azure.microsoft.com/free/ diff --git a/sdk/extendedlocation/arm-extendedlocation/_meta.json b/sdk/extendedlocation/arm-extendedlocation/_meta.json index 6e8d96dd3c97..a7e5c1d9c384 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": "baf8777322441c131e2ba464c895f4feb9f58e5b", + "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.26", + "use": "@autorest/typescript@^6.0.12" +} \ No newline at end of file diff --git a/sdk/extendedlocation/arm-extendedlocation/api-extractor.json b/sdk/extendedlocation/arm-extendedlocation/api-extractor.json index d3441f65ac9f..b8c5959ce3b5 100644 --- a/sdk/extendedlocation/arm-extendedlocation/api-extractor.json +++ b/sdk/extendedlocation/arm-extendedlocation/api-extractor.json @@ -1,6 +1,6 @@ { "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", - "mainEntryPointFilePath": "dist/esm/index.d.ts", + "mainEntryPointFilePath": "./dist-esm/src/index.d.ts", "docModel": { "enabled": true }, @@ -11,7 +11,7 @@ "dtsRollup": { "enabled": true, "untrimmedFilePath": "", - "publicTrimmedFilePath": "dist/arm-extendedlocation.d.ts" + "publicTrimmedFilePath": "./types/arm-extendedlocation.d.ts" }, "messages": { "tsdocMessageReporting": { @@ -28,4 +28,4 @@ } } } -} +} \ No newline at end of file diff --git a/sdk/extendedlocation/arm-extendedlocation/package.json b/sdk/extendedlocation/arm-extendedlocation/package.json index 7d2a833b5f5f..35a6d3cb6360 100644 --- a/sdk/extendedlocation/arm-extendedlocation/package.json +++ b/sdk/extendedlocation/arm-extendedlocation/package.json @@ -10,10 +10,10 @@ "dependencies": { "@azure/abort-controller": "^2.1.2", "@azure/core-auth": "^1.9.0", - "@azure/core-client": "^1.9.2", - "@azure/core-lro": "^2.2.0", + "@azure/core-client": "^1.9.3", + "@azure/core-lro": "^2.5.4", "@azure/core-paging": "^1.6.2", - "@azure/core-rest-pipeline": "^1.18.2", + "@azure/core-rest-pipeline": "^1.19.1", "tslib": "^2.8.1" }, "keywords": [ @@ -21,29 +21,31 @@ "azure", "typescript", "browser", - "isomorphic", - "cloud" + "isomorphic" ], "license": "MIT", "main": "./dist/commonjs/index.js", - "module": "./dist/esm/index.js", + "module": "./dist-esm/src/index.js", "types": "./dist/commonjs/index.d.ts", "devDependencies": { "@azure-tools/test-credential": "^2.0.0", "@azure-tools/test-recorder": "^4.1.0", "@azure-tools/test-utils-vitest": "^1.0.0", "@azure/dev-tool": "^1.0.0", - "@azure/identity": "^4.6.0", + "@azure/identity": "^4.9.1", "@azure/logger": "^1.1.4", "@types/node": "^18.0.0", "@vitest/browser": "^3.0.9", "@vitest/coverage-istanbul": "^3.0.9", "dotenv": "^16.0.0", - "playwright": "^1.50.1", + "playwright": "^1.52.0", "typescript": "~5.8.2", "vitest": "^3.0.9" }, - "repository": "github:Azure/azure-sdk-for-js", + "repository": { + "type": "git", + "url": "https://github.com/Azure/azure-sdk-for-js.git" + }, "bugs": { "url": "https://github.com/Azure/azure-sdk-for-js/issues" }, @@ -69,7 +71,7 @@ "integration-test:browser": "echo skipped", "integration-test:node": "dev-tool run test:vitest --esm", "lint": "echo skipped", - "minify": "echo skipped", + "minify": "dev-tool run vendored uglifyjs -c -m --comments --source-map \"content='./dist/index.js.map'\" -o ./dist/index.min.js ./dist/index.js", "pack": "npm pack 2>&1", "prepack": "npm run build", "test": "npm run integration-test", @@ -91,14 +93,6 @@ }, "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://learn.microsoft.com/javascript/api/@azure/arm-extendedlocation?view=azure-node-preview" - }, "type": "module", "tshy": { "project": "./tsconfig.src.json", @@ -139,4 +133,4 @@ } } } -} +} \ 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..7e2b6955a3da 100644 --- a/sdk/extendedlocation/arm-extendedlocation/review/arm-extendedlocation.api.md +++ b/sdk/extendedlocation/arm-extendedlocation/review/arm-extendedlocation.api.md @@ -6,9 +6,12 @@ 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 ActionType = string; // @public export type CreatedByType = string; @@ -23,7 +26,6 @@ export interface CustomLocation extends TrackedResource { identity?: Identity; namespace?: string; provisioningState?: string; - readonly systemData?: SystemData; } // @public @@ -41,25 +43,8 @@ export interface CustomLocationFindTargetResourceGroupResult { // @public export interface CustomLocationListResult { - readonly nextLink?: string; - readonly value?: CustomLocation[]; -} - -// @public -export interface CustomLocationOperation { - readonly description?: string; - readonly isDataAction?: boolean; - readonly name?: string; - readonly operation?: string; - readonly origin?: string; - readonly provider?: string; - readonly resource?: string; -} - -// @public -export interface CustomLocationOperationsList { nextLink?: string; - value: CustomLocationOperation[]; + value: CustomLocation[]; } // @public @@ -70,19 +55,24 @@ 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>>; - beginDeleteAndWait(resourceGroupName: string, resourceName: string, options?: CustomLocationsDeleteOptionalParams): Promise; + beginDelete(resourceGroupName: string, resourceName: string, options?: CustomLocationsDeleteOptionalParams): Promise, CustomLocationsDeleteResponse>>; + 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; listByResourceGroup(resourceGroupName: string, options?: CustomLocationsListByResourceGroupOptionalParams): PagedAsyncIterableIterator; listBySubscription(options?: CustomLocationsListBySubscriptionOptionalParams): PagedAsyncIterableIterator; listEnabledResourceTypes(resourceGroupName: string, resourceName: string, options?: CustomLocationsListEnabledResourceTypesOptionalParams): PagedAsyncIterableIterator; - listOperations(options?: CustomLocationsListOperationsOptionalParams): PagedAsyncIterableIterator; update(resourceGroupName: string, resourceName: string, options?: CustomLocationsUpdateOptionalParams): Promise; } +// @public +export interface CustomLocationsCreateOrUpdateHeaders { + azureAsyncOperation?: string; + retryAfter?: number; +} + // @public export interface CustomLocationsCreateOrUpdateOptionalParams extends coreClient.OperationOptions { resumeFrom?: string; @@ -92,12 +82,21 @@ export interface CustomLocationsCreateOrUpdateOptionalParams extends coreClient. // @public export type CustomLocationsCreateOrUpdateResponse = CustomLocation; +// @public +export interface CustomLocationsDeleteHeaders { + azureAsyncOperation?: string; + retryAfter?: number; +} + // @public export interface CustomLocationsDeleteOptionalParams extends coreClient.OperationOptions { resumeFrom?: string; updateIntervalInMs?: number; } +// @public +export type CustomLocationsDeleteResponse = CustomLocationsDeleteHeaders; + // @public export interface CustomLocationsFindTargetResourceGroupOptionalParams extends coreClient.OperationOptions { } @@ -145,28 +144,14 @@ export interface CustomLocationsListEnabledResourceTypesNextOptionalParams exten } // @public -export type CustomLocationsListEnabledResourceTypesNextResponse = EnabledResourceTypesListResult; +export type CustomLocationsListEnabledResourceTypesNextResponse = EnabledResourceTypeListResult; // @public export interface CustomLocationsListEnabledResourceTypesOptionalParams extends coreClient.OperationOptions { } // @public -export type CustomLocationsListEnabledResourceTypesResponse = EnabledResourceTypesListResult; - -// @public -export interface CustomLocationsListOperationsNextOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type CustomLocationsListOperationsNextResponse = CustomLocationOperationsList; - -// @public -export interface CustomLocationsListOperationsOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type CustomLocationsListOperationsResponse = CustomLocationOperationsList; +export type CustomLocationsListEnabledResourceTypesResponse = EnabledResourceTypeListResult; // @public (undocumented) export class CustomLocationsManagementClient extends coreClient.ServiceClient { @@ -178,6 +163,8 @@ export class CustomLocationsManagementClient extends coreClient.ServiceClient { // (undocumented) customLocations: CustomLocations; // (undocumented) + operations: Operations; + // (undocumented) resourceSyncRules: ResourceSyncRules; // (undocumented) subscriptionId: string; @@ -212,10 +199,15 @@ export type CustomLocationsUpdateResponse = CustomLocation; export interface EnabledResourceType extends ProxyResource { clusterExtensionId?: string; extensionType?: string; - readonly systemData?: SystemData; typesMetadata?: EnabledResourceTypePropertiesTypesMetadataItem[]; } +// @public +export interface EnabledResourceTypeListResult { + nextLink?: string; + value: EnabledResourceType[]; +} + // @public export interface EnabledResourceTypePropertiesTypesMetadataItem { apiVersion?: string; @@ -223,12 +215,6 @@ export interface EnabledResourceTypePropertiesTypesMetadataItem { resourceType?: string; } -// @public -export interface EnabledResourceTypesListResult { - readonly nextLink?: string; - readonly value?: EnabledResourceType[]; -} - // @public export interface ErrorAdditionalInfo { readonly info?: Record; @@ -262,6 +248,11 @@ export interface Identity { type?: ResourceIdentityType; } +// @public +export enum KnownActionType { + Internal = "Internal" +} + // @public export enum KnownCreatedByType { Application = "Application", @@ -275,6 +266,13 @@ export enum KnownHostType { Kubernetes = "Kubernetes" } +// @public +export enum KnownOrigin { + System = "system", + User = "user", + UserSystem = "user,system" +} + // @public export enum KnownResourceIdentityType { None = "None", @@ -288,6 +286,51 @@ export interface MatchExpressionsProperties { values?: string[]; } +// @public +export interface Operation { + readonly actionType?: ActionType; + display?: OperationDisplay; + readonly isDataAction?: boolean; + readonly name?: string; + readonly origin?: Origin; +} + +// @public +export interface OperationDisplay { + readonly description?: string; + readonly operation?: string; + readonly provider?: string; + readonly resource?: string; +} + +// @public +export interface OperationListResult { + readonly nextLink?: string; + readonly value?: Operation[]; +} + +// @public +export interface Operations { + list(options?: OperationsListOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface OperationsListNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type OperationsListNextResponse = OperationListResult; + +// @public +export interface OperationsListOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type OperationsListResponse = OperationListResult; + +// @public +export type Origin = string; + // @public export interface PatchableCustomLocations { authentication?: CustomLocationPropertiesAuthentication; @@ -322,6 +365,7 @@ export interface ProxyResource extends Resource { export interface Resource { readonly id?: string; readonly name?: string; + readonly systemData?: SystemData; readonly type?: string; } @@ -333,14 +377,13 @@ export interface ResourceSyncRule extends TrackedResource { priority?: number; readonly provisioningState?: string; selector?: ResourceSyncRulePropertiesSelector; - readonly systemData?: SystemData; targetResourceGroup?: string; } // @public export interface ResourceSyncRuleListResult { - readonly nextLink?: string; - readonly value?: ResourceSyncRule[]; + nextLink?: string; + value: ResourceSyncRule[]; } // @public @@ -353,13 +396,18 @@ 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>>; - 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; listByCustomLocationID(resourceGroupName: string, resourceName: string, options?: ResourceSyncRulesListByCustomLocationIDOptionalParams): PagedAsyncIterableIterator; + update(resourceGroupName: string, resourceName: string, childResourceName: string, options?: ResourceSyncRulesUpdateOptionalParams): Promise; +} + +// @public +export interface ResourceSyncRulesCreateOrUpdateHeaders { + azureAsyncOperation?: string; + retryAfter?: number; } // @public @@ -399,13 +447,11 @@ export type ResourceSyncRulesListByCustomLocationIDResponse = ResourceSyncRuleLi // @public export interface ResourceSyncRulesUpdateOptionalParams extends coreClient.OperationOptions { priority?: number; - resumeFrom?: string; selector?: ResourceSyncRulePropertiesSelector; tags?: { [propertyName: string]: string; }; targetResourceGroup?: string; - updateIntervalInMs?: number; } // @public diff --git a/sdk/extendedlocation/arm-extendedlocation/sample.env b/sdk/extendedlocation/arm-extendedlocation/sample.env index 672847a3fea0..508439fc7d62 100644 --- a/sdk/extendedlocation/arm-extendedlocation/sample.env +++ b/sdk/extendedlocation/arm-extendedlocation/sample.env @@ -1,4 +1 @@ -# App registration secret for AAD authentication -AZURE_CLIENT_SECRET= -AZURE_CLIENT_ID= -AZURE_TENANT_ID= \ No newline at end of file +# Feel free to add your own environment variables. \ No newline at end of file diff --git a/sdk/extendedlocation/arm-extendedlocation/src/customLocationsManagementClient.ts b/sdk/extendedlocation/arm-extendedlocation/src/customLocationsManagementClient.ts index f798d2cc7057..c2f3a6bce309 100644 --- a/sdk/extendedlocation/arm-extendedlocation/src/customLocationsManagementClient.ts +++ b/sdk/extendedlocation/arm-extendedlocation/src/customLocationsManagementClient.ts @@ -11,11 +11,19 @@ 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/index.js"; -import { CustomLocations, ResourceSyncRules } from "./operationsInterfaces/index.js"; +import { + OperationsImpl, + CustomLocationsImpl, + ResourceSyncRulesImpl, +} from "./operations/index.js"; +import { + Operations, + CustomLocations, + ResourceSyncRules, +} from "./operationsInterfaces/index.js"; import { CustomLocationsManagementClientOptionalParams } from "./models/index.js"; export class CustomLocationsManagementClient extends coreClient.ServiceClient { @@ -32,7 +40,7 @@ export class CustomLocationsManagementClient extends coreClient.ServiceClient { constructor( credentials: coreAuth.TokenCredential, subscriptionId: string, - options?: CustomLocationsManagementClientOptionalParams + options?: CustomLocationsManagementClientOptionalParams, ) { if (credentials === undefined) { throw new Error("'credentials' cannot be null"); @@ -47,7 +55,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 +68,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 +92,7 @@ export class CustomLocationsManagementClient extends coreClient.ServiceClient { !bearerTokenAuthenticationPolicyFound ) { this.pipeline.removePolicy({ - name: coreRestPipeline.bearerTokenAuthenticationPolicyName + name: coreRestPipeline.bearerTokenAuthenticationPolicyName, }); this.pipeline.addPolicy( coreRestPipeline.bearerTokenAuthenticationPolicy({ @@ -93,9 +102,9 @@ export class CustomLocationsManagementClient extends coreClient.ServiceClient { `${optionsWithDefaults.endpoint}/.default`, challengeCallbacks: { authorizeRequestOnChallenge: - coreClient.authorizeRequestOnClaimChallenge - } - }) + coreClient.authorizeRequestOnClaimChallenge, + }, + }), ); } // Parameter assignments @@ -104,6 +113,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.operations = new OperationsImpl(this); this.customLocations = new CustomLocationsImpl(this); this.resourceSyncRules = new ResourceSyncRulesImpl(this); this.addCustomApiVersionPolicy(options.apiVersion); @@ -118,7 +128,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,11 +142,12 @@ export class CustomLocationsManagementClient extends coreClient.ServiceClient { request.url = param[0] + "?" + newParams.join("&"); } return next(request); - } + }, }; this.pipeline.addPolicy(apiVersionPolicy); } + operations: Operations; customLocations: CustomLocations; resourceSyncRules: ResourceSyncRules; } 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..8756024c405b 100644 --- a/sdk/extendedlocation/arm-extendedlocation/src/models/index.ts +++ b/sdk/extendedlocation/arm-extendedlocation/src/models/index.ts @@ -8,51 +8,68 @@ import * as coreClient from "@azure/core-client"; -/** Lists of Custom Locations operations. */ -export interface CustomLocationOperationsList { - /** Next page of operations. */ - nextLink?: string; - /** Array of customLocationOperation */ - value: CustomLocationOperation[]; -} - -/** Custom Locations operation. */ -export interface CustomLocationOperation { +/** A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to get the next set of results. */ +export interface OperationListResult { /** - * Is this Operation a data plane operation + * List of operations supported by the resource provider * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly isDataAction?: boolean; + readonly value?: Operation[]; + /** + * URL to get the next set of operation list results (if there are any). + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly nextLink?: string; +} + +/** Details of a REST API operation, returned from the Resource Provider Operations API */ +export interface Operation { /** - * The name of the compute operation. + * The name of the operation, as per Resource-Based Access Control (RBAC). Examples: "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action" * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly name?: string; /** - * The origin of the compute operation. + * Whether the operation applies to data-plane. This is "true" for data-plane operations and "false" for ARM/control-plane operations. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly origin?: string; + readonly isDataAction?: boolean; + /** Localized display information for this particular operation. */ + display?: OperationDisplay; /** - * The description of the operation. + * The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value is "user,system" * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly description?: string; + readonly origin?: Origin; /** - * The display name of the compute operation. + * Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly operation?: string; + readonly actionType?: ActionType; +} + +/** Localized display information for this particular operation. */ +export interface OperationDisplay { /** - * The resource provider for the operation. + * The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring Insights" or "Microsoft Compute". * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly provider?: string; /** - * The display name of the resource the operation applies to. + * The localized friendly name of the resource type related to this operation. E.g. "Virtual Machines" or "Job Schedule Collections". * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly resource?: string; + /** + * The concise, localized friendly name for the operation; suitable for dropdowns. E.g. "Create or Update Virtual Machine", "Restart Virtual Machine". + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly operation?: string; + /** + * The short, localized friendly description of the operation; suitable for tool tips and detailed views. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly description?: string; } /** Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.). */ @@ -104,18 +121,20 @@ export interface ErrorAdditionalInfo { readonly info?: Record; } -/** The List Custom Locations operation response. */ +/** The response of a CustomLocation list operation. */ export interface CustomLocationListResult { - /** - * The URL to use for getting the next set of results. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly nextLink?: string; - /** - * The list of Custom Locations. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly value?: CustomLocation[]; + /** The CustomLocation items on this page */ + value: CustomLocation[]; + /** The link to the next page of items */ + nextLink?: string; +} + +/** This is optional input that contains the authentication that should be used to generate the namespace. */ +export interface CustomLocationPropertiesAuthentication { + /** The type of the Custom Locations authentication */ + type?: string; + /** The kubeconfig value. */ + value?: string; } /** Identity for the resource. */ @@ -134,30 +153,6 @@ export interface Identity { type?: ResourceIdentityType; } -/** This is optional input that contains the authentication that should be used to generate the namespace. */ -export interface CustomLocationPropertiesAuthentication { - /** The type of the Custom Locations authentication */ - type?: string; - /** The kubeconfig value. */ - value?: string; -} - -/** Metadata pertaining to creation and last modification of the resource. */ -export interface SystemData { - /** The identity that created the resource. */ - createdBy?: string; - /** The type of identity that created the resource. */ - createdByType?: CreatedByType; - /** The timestamp of resource creation (UTC). */ - createdAt?: Date; - /** The identity that last modified the resource. */ - lastModifiedBy?: string; - /** The type of identity that last modified the resource. */ - lastModifiedByType?: CreatedByType; - /** The timestamp of resource last modification (UTC) */ - lastModifiedAt?: Date; -} - /** Common fields that are returned in the response for all Azure Resource Manager resources */ export interface Resource { /** @@ -175,6 +170,27 @@ export interface Resource { * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly type?: string; + /** + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly systemData?: SystemData; +} + +/** Metadata pertaining to creation and last modification of the resource. */ +export interface SystemData { + /** The identity that created the resource. */ + createdBy?: string; + /** The type of identity that created the resource. */ + createdByType?: CreatedByType; + /** The timestamp of resource creation (UTC). */ + createdAt?: Date; + /** The identity that last modified the resource. */ + lastModifiedBy?: string; + /** The type of identity that last modified the resource. */ + lastModifiedByType?: CreatedByType; + /** The timestamp of resource last modification (UTC) */ + lastModifiedAt?: Date; } /** The Custom Locations patchable resource definition. */ @@ -199,18 +215,12 @@ export interface PatchableCustomLocations { provisioningState?: string; } -/** List of EnabledResourceTypes definition. */ -export interface EnabledResourceTypesListResult { - /** - * The URL to use for getting the next set of results. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly nextLink?: string; - /** - * The list of EnabledResourceTypes available for a customLocation. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly value?: EnabledResourceType[]; +/** The response of a EnabledResourceType list operation. */ +export interface EnabledResourceTypeListResult { + /** The EnabledResourceType items on this page */ + value: EnabledResourceType[]; + /** The link to the next page of items */ + nextLink?: string; } /** Metadata of the Resource Type. */ @@ -243,18 +253,12 @@ export interface CustomLocationFindTargetResourceGroupResult { readonly targetResourceGroup?: string; } -/** The List Resource Sync Rules operation response. */ +/** The response of a ResourceSyncRule list operation. */ export interface ResourceSyncRuleListResult { - /** - * The URL to use for getting the next set of results. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly nextLink?: string; - /** - * The list of Resource Sync Rules. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly value?: ResourceSyncRule[]; + /** The ResourceSyncRule items on this page */ + value: ResourceSyncRule[]; + /** The link to the next page of items */ + nextLink?: string; } /** A label selector is composed of two parts, matchLabels and matchExpressions. The first part, matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is 'key', the operator is 'In', and the values array contains only 'value'. The second part, matchExpressions is a list of resource selector requirements. Valid operators include In, NotIn, Exists, and DoesNotExist. The values set must be non-empty in the case of In and NotIn. The values set must be empty in the case of Exists and DoesNotExist. All of the requirements, from both matchLabels and matchExpressions must all be satisfied in order to match. */ @@ -307,11 +311,6 @@ export interface ProxyResource extends Resource {} export interface CustomLocation extends TrackedResource { /** Identity for the resource. */ identity?: Identity; - /** - * Metadata pertaining to creation and last modification of the resource - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - 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. */ @@ -330,11 +329,6 @@ export interface CustomLocation extends TrackedResource { /** Resource Sync Rules definition. */ export interface ResourceSyncRule extends TrackedResource { - /** - * Metadata pertaining to creation and last modification of the resource - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly systemData?: SystemData; /** Priority represents a priority of the Resource Sync Rule */ priority?: number; /** @@ -350,11 +344,6 @@ export interface ResourceSyncRule extends TrackedResource { /** EnabledResourceType definition. */ export interface EnabledResourceType extends ProxyResource { - /** - * Metadata pertaining to creation and last modification of the resource - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly systemData?: SystemData; /** Cluster Extension ID */ clusterExtensionId?: string; /** Cluster Extension Type */ @@ -363,28 +352,70 @@ export interface EnabledResourceType extends ProxyResource { typesMetadata?: EnabledResourceTypePropertiesTypesMetadataItem[]; } -/** Known values of {@link ResourceIdentityType} that the service accepts. */ -export enum KnownResourceIdentityType { - /** SystemAssigned */ - SystemAssigned = "SystemAssigned", - /** None */ - None = "None" +/** Defines headers for CustomLocations_createOrUpdate operation. */ +export interface CustomLocationsCreateOrUpdateHeaders { + /** A link to the status monitor */ + azureAsyncOperation?: string; + /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ + retryAfter?: number; +} + +/** Defines headers for CustomLocations_delete operation. */ +export interface CustomLocationsDeleteHeaders { + /** A link to the status monitor */ + azureAsyncOperation?: string; + /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ + retryAfter?: number; +} + +/** Defines headers for ResourceSyncRules_createOrUpdate operation. */ +export interface ResourceSyncRulesCreateOrUpdateHeaders { + /** A link to the status monitor */ + azureAsyncOperation?: string; + /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ + retryAfter?: number; +} + +/** Known values of {@link Origin} that the service accepts. */ +export enum KnownOrigin { + /** User */ + User = "user", + /** System */ + System = "system", + /** UserSystem */ + UserSystem = "user,system", } /** - * Defines values for ResourceIdentityType. \ - * {@link KnownResourceIdentityType} can be used interchangeably with ResourceIdentityType, + * Defines values for Origin. \ + * {@link KnownOrigin} can be used interchangeably with Origin, * this enum contains the known values that the service supports. * ### Known values supported by the service - * **SystemAssigned** \ - * **None** + * **user** \ + * **system** \ + * **user,system** */ -export type ResourceIdentityType = string; +export type Origin = string; + +/** Known values of {@link ActionType} that the service accepts. */ +export enum KnownActionType { + /** Internal */ + Internal = "Internal", +} + +/** + * Defines values for ActionType. \ + * {@link KnownActionType} can be used interchangeably with ActionType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Internal** + */ +export type ActionType = string; /** Known values of {@link HostType} that the service accepts. */ export enum KnownHostType { /** Kubernetes */ - Kubernetes = "Kubernetes" + Kubernetes = "Kubernetes", } /** @@ -396,6 +427,24 @@ export enum KnownHostType { */ export type HostType = string; +/** Known values of {@link ResourceIdentityType} that the service accepts. */ +export enum KnownResourceIdentityType { + /** SystemAssigned */ + SystemAssigned = "SystemAssigned", + /** None */ + None = "None", +} + +/** + * Defines values for ResourceIdentityType. \ + * {@link KnownResourceIdentityType} can be used interchangeably with ResourceIdentityType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **SystemAssigned** \ + * **None** + */ +export type ResourceIdentityType = string; + /** Known values of {@link CreatedByType} that the service accepts. */ export enum KnownCreatedByType { /** User */ @@ -405,7 +454,7 @@ export enum KnownCreatedByType { /** ManagedIdentity */ ManagedIdentity = "ManagedIdentity", /** Key */ - Key = "Key" + Key = "Key", } /** @@ -421,25 +470,34 @@ export enum KnownCreatedByType { export type CreatedByType = string; /** Optional parameters. */ -export interface CustomLocationsListOperationsOptionalParams +export interface OperationsListOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the list operation. */ +export type OperationsListResponse = OperationListResult; + +/** Optional parameters. */ +export interface OperationsListNextOptionalParams extends coreClient.OperationOptions {} -/** Contains response data for the listOperations operation. */ -export type CustomLocationsListOperationsResponse = CustomLocationOperationsList; +/** Contains response data for the listNext operation. */ +export type OperationsListNextResponse = OperationListResult; /** 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 @@ -460,15 +518,6 @@ export interface CustomLocationsCreateOrUpdateOptionalParams /** Contains response data for the createOrUpdate operation. */ export type CustomLocationsCreateOrUpdateResponse = CustomLocation; -/** Optional parameters. */ -export interface CustomLocationsDeleteOptionalParams - extends coreClient.OperationOptions { - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; - /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ - resumeFrom?: string; -} - /** Optional parameters. */ export interface CustomLocationsUpdateOptionalParams extends coreClient.OperationOptions { @@ -495,54 +544,65 @@ export interface CustomLocationsUpdateOptionalParams /** Contains response data for the update operation. */ export type CustomLocationsUpdateResponse = CustomLocation; +/** Optional parameters. */ +export interface CustomLocationsDeleteOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Contains response data for the delete operation. */ +export type CustomLocationsDeleteResponse = CustomLocationsDeleteHeaders; + /** Optional parameters. */ export interface CustomLocationsListEnabledResourceTypesOptionalParams extends coreClient.OperationOptions {} /** Contains response data for the listEnabledResourceTypes operation. */ -export type CustomLocationsListEnabledResourceTypesResponse = EnabledResourceTypesListResult; +export type CustomLocationsListEnabledResourceTypesResponse = + EnabledResourceTypeListResult; /** Optional parameters. */ export interface CustomLocationsFindTargetResourceGroupOptionalParams extends coreClient.OperationOptions {} /** Contains response data for the findTargetResourceGroup operation. */ -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 CustomLocationsFindTargetResourceGroupResponse = + CustomLocationFindTargetResourceGroupResult; /** 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 = + EnabledResourceTypeListResult; /** 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 @@ -563,10 +623,6 @@ export interface ResourceSyncRulesCreateOrUpdateOptionalParams /** Contains response data for the createOrUpdate operation. */ export type ResourceSyncRulesCreateOrUpdateResponse = ResourceSyncRule; -/** Optional parameters. */ -export interface ResourceSyncRulesDeleteOptionalParams - extends coreClient.OperationOptions {} - /** Optional parameters. */ export interface ResourceSyncRulesUpdateOptionalParams extends coreClient.OperationOptions { @@ -578,21 +634,22 @@ export interface ResourceSyncRulesUpdateOptionalParams selector?: ResourceSyncRulePropertiesSelector; /** For an unmapped custom resource, its labels will be used to find matching resource sync rules. If this resource sync rule is one of the matching rules with highest priority, then the unmapped custom resource will be projected to the target resource group associated with this resource sync rule. The user creating this resource sync rule should have write permissions on the target resource group and this write permission will be validated when creating the resource sync rule. */ targetResourceGroup?: string; - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; - /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ - resumeFrom?: string; } /** Contains response data for the update operation. */ export type ResourceSyncRulesUpdateResponse = ResourceSyncRule; +/** Optional parameters. */ +export interface ResourceSyncRulesDeleteOptionalParams + extends coreClient.OperationOptions {} + /** Optional parameters. */ 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..86c1e9ccd0c4 100644 --- a/sdk/extendedlocation/arm-extendedlocation/src/models/mappers.ts +++ b/sdk/extendedlocation/arm-extendedlocation/src/models/mappers.ts @@ -8,90 +8,114 @@ import * as coreClient from "@azure/core-client"; -export const CustomLocationOperationsList: coreClient.CompositeMapper = { +export const OperationListResult: coreClient.CompositeMapper = { type: { name: "Composite", - className: "CustomLocationOperationsList", + className: "OperationListResult", modelProperties: { - nextLink: { - serializedName: "nextLink", - type: { - name: "String" - } - }, value: { serializedName: "value", - required: true, + readOnly: true, type: { name: "Sequence", element: { type: { name: "Composite", - className: "CustomLocationOperation" - } - } - } - } - } - } + className: "Operation", + }, + }, + }, + }, + nextLink: { + serializedName: "nextLink", + readOnly: true, + type: { + name: "String", + }, + }, + }, + }, }; -export const CustomLocationOperation: coreClient.CompositeMapper = { +export const Operation: coreClient.CompositeMapper = { type: { name: "Composite", - className: "CustomLocationOperation", + className: "Operation", modelProperties: { + name: { + serializedName: "name", + readOnly: true, + type: { + name: "String", + }, + }, isDataAction: { serializedName: "isDataAction", readOnly: true, type: { - name: "Boolean" - } + name: "Boolean", + }, }, - name: { - serializedName: "name", - readOnly: true, + display: { + serializedName: "display", type: { - name: "String" - } + name: "Composite", + className: "OperationDisplay", + }, }, origin: { serializedName: "origin", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, - description: { - serializedName: "display.description", + actionType: { + serializedName: "actionType", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, - operation: { - serializedName: "display.operation", + }, + }, +}; + +export const OperationDisplay: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "OperationDisplay", + modelProperties: { + provider: { + serializedName: "provider", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, - provider: { - serializedName: "display.provider", + resource: { + serializedName: "resource", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, - resource: { - serializedName: "display.resource", + operation: { + serializedName: "operation", readOnly: true, type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + description: { + serializedName: "description", + readOnly: true, + type: { + name: "String", + }, + }, + }, + }, }; export const ErrorResponse: coreClient.CompositeMapper = { @@ -103,11 +127,11 @@ export const ErrorResponse: coreClient.CompositeMapper = { serializedName: "error", type: { name: "Composite", - className: "ErrorDetail" - } - } - } - } + className: "ErrorDetail", + }, + }, + }, + }, }; export const ErrorDetail: coreClient.CompositeMapper = { @@ -119,22 +143,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 +168,10 @@ export const ErrorDetail: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "ErrorDetail" - } - } - } + className: "ErrorDetail", + }, + }, + }, }, additionalInfo: { serializedName: "additionalInfo", @@ -157,13 +181,13 @@ export const ErrorDetail: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "ErrorAdditionalInfo" - } - } - } - } - } - } + className: "ErrorAdditionalInfo", + }, + }, + }, + }, + }, + }, }; export const ErrorAdditionalInfo: coreClient.CompositeMapper = { @@ -175,19 +199,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 = { @@ -195,30 +219,51 @@ export const CustomLocationListResult: coreClient.CompositeMapper = { name: "Composite", className: "CustomLocationListResult", modelProperties: { - nextLink: { - serializedName: "nextLink", - readOnly: true, - type: { - name: "String" - } - }, value: { serializedName: "value", - readOnly: true, + required: true, type: { name: "Sequence", element: { type: { name: "Composite", - className: "CustomLocation" - } - } - } - } - } - } + className: "CustomLocation", + }, + }, + }, + }, + nextLink: { + serializedName: "nextLink", + 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 Identity: coreClient.CompositeMapper = { type: { name: "Composite", @@ -228,45 +273,61 @@ 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" - } - } - } - } + name: "String", + }, + }, + }, + }, }; -export const CustomLocationPropertiesAuthentication: coreClient.CompositeMapper = { +export const Resource: coreClient.CompositeMapper = { type: { name: "Composite", - className: "CustomLocationPropertiesAuthentication", + className: "Resource", modelProperties: { + id: { + serializedName: "id", + readOnly: true, + type: { + name: "String", + }, + }, + name: { + serializedName: "name", + readOnly: true, + type: { + name: "String", + }, + }, type: { serializedName: "type", + readOnly: true, type: { - name: "String" - } + name: "String", + }, }, - value: { - serializedName: "value", + systemData: { + serializedName: "systemData", type: { - name: "String" - } - } - } - } + name: "Composite", + className: "SystemData", + }, + }, + }, + }, }; export const SystemData: coreClient.CompositeMapper = { @@ -277,71 +338,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" - } - } - } - } -}; - -export const Resource: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "Resource", - modelProperties: { - id: { - serializedName: "id", - readOnly: true, - type: { - name: "String" - } - }, - name: { - serializedName: "name", - readOnly: true, - type: { - name: "String" - } + name: "DateTime", + }, }, - type: { - serializedName: "type", - readOnly: true, - type: { - name: "String" - } - } - } - } + }, + }, }; export const PatchableCustomLocations: coreClient.CompositeMapper = { @@ -353,22 +384,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,167 +407,168 @@ 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 = { +export const EnabledResourceTypeListResult: coreClient.CompositeMapper = { type: { name: "Composite", - className: "EnabledResourceTypesListResult", + className: "EnabledResourceTypeListResult", modelProperties: { - nextLink: { - serializedName: "nextLink", - readOnly: true, - type: { - name: "String" - } - }, value: { serializedName: "value", - readOnly: true, + required: true, type: { name: "Sequence", element: { type: { name: "Composite", - className: "EnabledResourceType" - } - } - } - } - } - } -}; - -export const EnabledResourceTypePropertiesTypesMetadataItem: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "EnabledResourceTypePropertiesTypesMetadataItem", - modelProperties: { - apiVersion: { - serializedName: "apiVersion", - type: { - name: "String" - } + className: "EnabledResourceType", + }, + }, + }, }, - resourceProviderNamespace: { - serializedName: "resourceProviderNamespace", + nextLink: { + serializedName: "nextLink", type: { - name: "String" - } + name: "String", + }, }, - 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: { name: "Composite", className: "ResourceSyncRuleListResult", modelProperties: { - nextLink: { - serializedName: "nextLink", - readOnly: true, - type: { - name: "String" - } - }, value: { serializedName: "value", - readOnly: true, + required: true, type: { name: "Sequence", element: { type: { name: "Composite", - className: "ResourceSyncRule" - } - } - } - } - } - } + className: "ResourceSyncRule", + }, + }, + }, + }, + nextLink: { + serializedName: "nextLink", + type: { + name: "String", + }, + }, + }, + }, }; export const ResourceSyncRulePropertiesSelector: coreClient.CompositeMapper = { @@ -551,20 +583,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 +607,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 +622,13 @@ export const MatchExpressionsProperties: coreClient.CompositeMapper = { name: "Sequence", element: { type: { - name: "String" - } - } - } - } - } - } + name: "String", + }, + }, + }, + }, + }, + }, }; export const PatchableResourceSyncRule: coreClient.CompositeMapper = { @@ -608,37 +640,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 +683,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 +702,9 @@ export const ProxyResource: coreClient.CompositeMapper = { name: "Composite", className: "ProxyResource", modelProperties: { - ...Resource.type.modelProperties - } - } + ...Resource.type.modelProperties, + }, + }, }; export const CustomLocation: coreClient.CompositeMapper = { @@ -685,22 +717,15 @@ export const CustomLocation: coreClient.CompositeMapper = { serializedName: "identity", type: { name: "Composite", - className: "Identity" - } - }, - systemData: { - serializedName: "systemData", - type: { - name: "Composite", - className: "SystemData" - } + className: "Identity", + }, }, authentication: { serializedName: "properties.authentication", type: { name: "Composite", - className: "CustomLocationPropertiesAuthentication" - } + className: "CustomLocationPropertiesAuthentication", + }, }, clusterExtensionIds: { serializedName: "properties.clusterExtensionIds", @@ -708,43 +733,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 = { @@ -753,41 +778,34 @@ export const ResourceSyncRule: coreClient.CompositeMapper = { className: "ResourceSyncRule", modelProperties: { ...TrackedResource.type.modelProperties, - systemData: { - serializedName: "systemData", - type: { - name: "Composite", - 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 = { @@ -796,24 +814,17 @@ export const EnabledResourceType: coreClient.CompositeMapper = { className: "EnabledResourceType", modelProperties: { ...ProxyResource.type.modelProperties, - systemData: { - serializedName: "systemData", - type: { - name: "Composite", - 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 +833,76 @@ export const EnabledResourceType: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "EnabledResourceTypePropertiesTypesMetadataItem" - } - } - } - } - } - } + className: "EnabledResourceTypePropertiesTypesMetadataItem", + }, + }, + }, + }, + }, + }, }; + +export const CustomLocationsCreateOrUpdateHeaders: coreClient.CompositeMapper = + { + type: { + name: "Composite", + className: "CustomLocationsCreateOrUpdateHeaders", + modelProperties: { + azureAsyncOperation: { + serializedName: "azure-asyncoperation", + type: { + name: "String", + }, + }, + retryAfter: { + serializedName: "retry-after", + type: { + name: "Number", + }, + }, + }, + }, + }; + +export const CustomLocationsDeleteHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "CustomLocationsDeleteHeaders", + modelProperties: { + azureAsyncOperation: { + serializedName: "azure-asyncoperation", + type: { + name: "String", + }, + }, + retryAfter: { + serializedName: "retry-after", + type: { + name: "Number", + }, + }, + }, + }, +}; + +export const ResourceSyncRulesCreateOrUpdateHeaders: coreClient.CompositeMapper = + { + type: { + name: "Composite", + className: "ResourceSyncRulesCreateOrUpdateHeaders", + modelProperties: { + azureAsyncOperation: { + serializedName: "azure-asyncoperation", + type: { + name: "String", + }, + }, + retryAfter: { + serializedName: "retry-after", + type: { + name: "Number", + }, + }, + }, + }, + }; diff --git a/sdk/extendedlocation/arm-extendedlocation/src/models/parameters.ts b/sdk/extendedlocation/arm-extendedlocation/src/models/parameters.ts index ebe1a5e0311a..b2380c029e78 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.js"; 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,10 +37,10 @@ export const $host: OperationURLParameter = { serializedName: "$host", required: true, type: { - name: "String" - } + name: "String", + }, }, - skipEncoding: true + skipEncoding: true, }; export const apiVersion: OperationQueryParameter = { @@ -50,23 +50,35 @@ export const apiVersion: OperationQueryParameter = { isConstant: true, serializedName: "api-version", type: { - name: "String" - } - } + name: "String", + }, + }, +}; + +export const nextLink: OperationURLParameter = { + parameterPath: "nextLink", + mapper: { + serializedName: "nextLink", + required: true, + type: { + name: "String", + }, + }, + skipEncoding: true, }; 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 +86,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 +101,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,76 +121,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 -}; - -export const nextLink: OperationURLParameter = { - parameterPath: "nextLink", - mapper: { - serializedName: "nextLink", - required: true, - type: { - name: "String" - } - }, - skipEncoding: true + mapper: CustomLocationFindTargetResourceGroupPropertiesMapper, }; 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 e2d12b6c46b7..82acbc080c21 100644 --- a/sdk/extendedlocation/arm-extendedlocation/src/operations/customLocations.ts +++ b/sdk/extendedlocation/arm-extendedlocation/src/operations/customLocations.ts @@ -13,13 +13,13 @@ import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers.js"; import * as Parameters from "../models/parameters.js"; import { CustomLocationsManagementClient } from "../customLocationsManagementClient.js"; -import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; -import { LroImpl } from "../lroImpl.js"; import { - CustomLocationOperation, - CustomLocationsListOperationsNextOptionalParams, - CustomLocationsListOperationsOptionalParams, - CustomLocationsListOperationsResponse, + SimplePollerLike, + OperationState, + createHttpPoller, +} from "@azure/core-lro"; +import { createLroSpec } from "../lroImpl.js"; +import { CustomLocation, CustomLocationsListBySubscriptionNextOptionalParams, CustomLocationsListBySubscriptionOptionalParams, @@ -35,16 +35,16 @@ import { CustomLocationsGetResponse, CustomLocationsCreateOrUpdateOptionalParams, CustomLocationsCreateOrUpdateResponse, - CustomLocationsDeleteOptionalParams, CustomLocationsUpdateOptionalParams, CustomLocationsUpdateResponse, + CustomLocationsDeleteOptionalParams, + CustomLocationsDeleteResponse, CustomLocationFindTargetResourceGroupProperties, CustomLocationsFindTargetResourceGroupOptionalParams, CustomLocationsFindTargetResourceGroupResponse, - CustomLocationsListOperationsNextResponse, CustomLocationsListBySubscriptionNextResponse, CustomLocationsListByResourceGroupNextResponse, - CustomLocationsListEnabledResourceTypesNextResponse + CustomLocationsListEnabledResourceTypesNextResponse, } from "../models/index.js"; /// @@ -60,67 +60,13 @@ export class CustomLocationsImpl implements CustomLocations { this.client = client; } - /** - * Lists all available Custom Locations operations. - * @param options The options parameters. - */ - public listOperations( - options?: CustomLocationsListOperationsOptionalParams - ): PagedAsyncIterableIterator { - const iter = this.listOperationsPagingAll(options); - return { - next() { - return iter.next(); - }, - [Symbol.asyncIterator]() { - return this; - }, - byPage: (settings?: PageSettings) => { - if (settings?.maxPageSize) { - throw new Error("maxPageSize is not supported by this operation."); - } - return this.listOperationsPagingPage(options, settings); - } - }; - } - - private async *listOperationsPagingPage( - options?: CustomLocationsListOperationsOptionalParams, - settings?: PageSettings - ): AsyncIterableIterator { - let result: CustomLocationsListOperationsResponse; - let continuationToken = settings?.continuationToken; - if (!continuationToken) { - result = await this._listOperations(options); - let page = result.value || []; - continuationToken = result.nextLink; - setContinuationToken(page, continuationToken); - yield page; - } - while (continuationToken) { - result = await this._listOperationsNext(continuationToken, options); - continuationToken = result.nextLink; - let page = result.value || []; - setContinuationToken(page, continuationToken); - yield page; - } - } - - private async *listOperationsPagingAll( - options?: CustomLocationsListOperationsOptionalParams - ): AsyncIterableIterator { - for await (const page of this.listOperationsPagingPage(options)) { - yield* page; - } - } - /** * Gets a list of Custom Locations in the specified subscription. The operation returns properties of * each Custom Location * @param options The options parameters. */ public listBySubscription( - options?: CustomLocationsListBySubscriptionOptionalParams + options?: CustomLocationsListBySubscriptionOptionalParams, ): PagedAsyncIterableIterator { const iter = this.listBySubscriptionPagingAll(options); return { @@ -135,13 +81,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 +108,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 +123,7 @@ export class CustomLocationsImpl implements CustomLocations { */ public listByResourceGroup( resourceGroupName: string, - options?: CustomLocationsListByResourceGroupOptionalParams + options?: CustomLocationsListByResourceGroupOptionalParams, ): PagedAsyncIterableIterator { const iter = this.listByResourceGroupPagingAll(resourceGroupName, options); return { @@ -194,16 +140,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 +164,7 @@ export class CustomLocationsImpl implements CustomLocations { result = await this._listByResourceGroupNext( resourceGroupName, continuationToken, - options + options, ); continuationToken = result.nextLink; let page = result.value || []; @@ -229,11 +175,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 +194,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 +216,9 @@ export class CustomLocationsImpl implements CustomLocations { resourceGroupName, resourceName, options, - settings + settings, ); - } + }, }; } @@ -280,7 +226,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 +234,7 @@ export class CustomLocationsImpl implements CustomLocations { result = await this._listEnabledResourceTypes( resourceGroupName, resourceName, - options + options, ); let page = result.value || []; continuationToken = result.nextLink; @@ -300,7 +246,7 @@ export class CustomLocationsImpl implements CustomLocations { resourceGroupName, resourceName, continuationToken, - options + options, ); continuationToken = result.nextLink; let page = result.value || []; @@ -312,41 +258,28 @@ 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; } } - /** - * Lists all available Custom Locations operations. - * @param options The options parameters. - */ - private _listOperations( - options?: CustomLocationsListOperationsOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { options }, - listOperationsOperationSpec - ); - } - /** * Gets a list of Custom Locations in the specified subscription. The operation returns properties of * each Custom Location * @param options The options parameters. */ private _listBySubscription( - options?: CustomLocationsListBySubscriptionOptionalParams + options?: CustomLocationsListBySubscriptionOptionalParams, ): Promise { return this.client.sendOperationRequest( { options }, - listBySubscriptionOperationSpec + listBySubscriptionOperationSpec, ); } @@ -358,11 +291,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 +308,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 +327,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 +358,8 @@ export class CustomLocationsImpl implements CustomLocations { ...args, options: { ...args.options, - onResponse: callback - } + onResponse: callback, + }, }; const flatResponse = await directSendOperation(updatedArgs, spec); return { @@ -435,20 +367,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,17 +400,35 @@ 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(); } + /** + * Updates a Custom Location with the specified Resource Name in the specified Resource Group and + * Subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName Custom Locations name. + * @param options The options parameters. + */ + update( + resourceGroupName: string, + resourceName: string, + options?: CustomLocationsUpdateOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, resourceName, options }, + updateOperationSpec, + ); + } + /** * 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. @@ -485,25 +438,29 @@ export class CustomLocationsImpl implements CustomLocations { async beginDelete( resourceGroupName: string, resourceName: string, - options?: CustomLocationsDeleteOptionalParams - ): Promise, void>> { + options?: CustomLocationsDeleteOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + CustomLocationsDeleteResponse + > + > { const directSendOperation = async ( args: coreClient.OperationArguments, - spec: coreClient.OperationSpec - ): Promise => { + 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 +469,8 @@ export class CustomLocationsImpl implements CustomLocations { ...args, options: { ...args.options, - onResponse: callback - } + onResponse: callback, + }, }; const flatResponse = await directSendOperation(updatedArgs, spec); return { @@ -521,20 +478,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, options }, - deleteOperationSpec - ); - const poller = new LroEngine(lro, { - resumeFrom: options?.resumeFrom, + const lro = createLroSpec({ + sendOperationFn, + args: { resourceGroupName, resourceName, options }, + spec: deleteOperationSpec, + }); + const poller = await createHttpPoller< + CustomLocationsDeleteResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs, - lroResourceLocationConfig: "azure-async-operation" + resourceLocationConfig: "azure-async-operation", }); await poller.poll(); return poller; @@ -549,34 +509,16 @@ export class CustomLocationsImpl implements CustomLocations { async beginDeleteAndWait( resourceGroupName: string, resourceName: string, - options?: CustomLocationsDeleteOptionalParams - ): Promise { + options?: CustomLocationsDeleteOptionalParams, + ): Promise { const poller = await this.beginDelete( resourceGroupName, resourceName, - options + options, ); return poller.pollUntilDone(); } - /** - * Updates a Custom Location with the specified Resource Name in the specified Resource Group and - * Subscription. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName Custom Locations name. - * @param options The options parameters. - */ - update( - resourceGroupName: string, - resourceName: string, - options?: CustomLocationsUpdateOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, resourceName, options }, - updateOperationSpec - ); - } - /** * Gets the list of the Enabled Resource Types. * @param resourceGroupName The name of the resource group. The name is case insensitive. @@ -586,11 +528,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,26 +548,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 - ); - } - - /** - * ListOperationsNext - * @param nextLink The nextLink from the previous successful call to the ListOperations method. - * @param options The options parameters. - */ - private _listOperationsNext( - nextLink: string, - options?: CustomLocationsListOperationsNextOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { nextLink, options }, - listOperationsNextOperationSpec + findTargetResourceGroupOperationSpec, ); } @@ -636,11 +563,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 +580,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,113 +600,93 @@ 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, ); } } // Operation Specifications const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); -const listOperationsOperationSpec: coreClient.OperationSpec = { - path: "/providers/Microsoft.ExtendedLocation/operations", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.CustomLocationOperationsList - }, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [Parameters.$host], - headerParameters: [Parameters.accept], - 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,46 +694,22 @@ const createOrUpdateOperationSpec: coreClient.OperationSpec = { Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.resourceName + Parameters.resourceName, ], headerParameters: [Parameters.accept, Parameters.contentType], mediaType: "json", - serializer -}; -const deleteOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ExtendedLocation/customLocations/{resourceName}", - httpMethod: "DELETE", - responses: { - 200: {}, - 201: {}, - 202: {}, - 204: {}, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - 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 +721,83 @@ 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 deleteOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ExtendedLocation/customLocations/{resourceName}", + httpMethod: "DELETE", + responses: { + 200: { + headersMapper: Mappers.CustomLocationsDeleteHeaders, + }, + 201: { + headersMapper: Mappers.CustomLocationsDeleteHeaders, + }, + 202: { + headersMapper: Mappers.CustomLocationsDeleteHeaders, + }, + 204: { + headersMapper: Mappers.CustomLocationsDeleteHeaders, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.resourceName, + ], + headerParameters: [Parameters.accept], + 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.EnabledResourceTypeListResult, }, 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 +805,69 @@ const findTargetResourceGroupOperationSpec: coreClient.OperationSpec = { Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.resourceName + Parameters.resourceName, ], headerParameters: [Parameters.accept, Parameters.contentType], mediaType: "json", - serializer -}; -const listOperationsNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.CustomLocationOperationsList - }, - default: { - 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.nextLink, Parameters.subscriptionId, - 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.nextLink, Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.nextLink ], headerParameters: [Parameters.accept], - serializer + serializer, }; const listEnabledResourceTypesNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.EnabledResourceTypesListResult + bodyMapper: Mappers.EnabledResourceTypeListResult, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, urlParameters: [ Parameters.$host, + Parameters.nextLink, Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.resourceName, - Parameters.nextLink ], headerParameters: [Parameters.accept], - serializer + serializer, }; diff --git a/sdk/extendedlocation/arm-extendedlocation/src/operations/index.ts b/sdk/extendedlocation/arm-extendedlocation/src/operations/index.ts index 44b33895be5e..60ec51bd1c45 100644 --- a/sdk/extendedlocation/arm-extendedlocation/src/operations/index.ts +++ b/sdk/extendedlocation/arm-extendedlocation/src/operations/index.ts @@ -6,5 +6,6 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ +export * from "./operations.js"; export * from "./customLocations.js"; export * from "./resourceSyncRules.js"; diff --git a/sdk/extendedlocation/arm-extendedlocation/src/operations/operations.ts b/sdk/extendedlocation/arm-extendedlocation/src/operations/operations.ts new file mode 100644 index 000000000000..a414bad29466 --- /dev/null +++ b/sdk/extendedlocation/arm-extendedlocation/src/operations/operations.ts @@ -0,0 +1,149 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper.js"; +import { Operations } from "../operationsInterfaces/index.js"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers.js"; +import * as Parameters from "../models/parameters.js"; +import { CustomLocationsManagementClient } from "../customLocationsManagementClient.js"; +import { + Operation, + OperationsListNextOptionalParams, + OperationsListOptionalParams, + OperationsListResponse, + OperationsListNextResponse, +} from "../models/index.js"; + +/// +/** Class containing Operations operations. */ +export class OperationsImpl implements Operations { + private readonly client: CustomLocationsManagementClient; + + /** + * Initialize a new instance of the class Operations class. + * @param client Reference to the service client + */ + constructor(client: CustomLocationsManagementClient) { + this.client = client; + } + + /** + * Lists all available Custom Locations operations. + * @param options The options parameters. + */ + public list( + options?: OperationsListOptionalParams, + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll(options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listPagingPage(options, settings); + }, + }; + } + + private async *listPagingPage( + options?: OperationsListOptionalParams, + settings?: PageSettings, + ): AsyncIterableIterator { + let result: OperationsListResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._list(options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listNext(continuationToken, options); + continuationToken = result.nextLink; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *listPagingAll( + options?: OperationsListOptionalParams, + ): AsyncIterableIterator { + for await (const page of this.listPagingPage(options)) { + yield* page; + } + } + + /** + * Lists all available Custom Locations operations. + * @param options The options parameters. + */ + private _list( + options?: OperationsListOptionalParams, + ): Promise { + return this.client.sendOperationRequest({ options }, listOperationSpec); + } + + /** + * ListNext + * @param nextLink The nextLink from the previous successful call to the List method. + * @param options The options parameters. + */ + private _listNext( + nextLink: string, + options?: OperationsListNextOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { nextLink, options }, + listNextOperationSpec, + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.ExtendedLocation/operations", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.OperationListResult, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host], + headerParameters: [Parameters.accept], + serializer, +}; +const listNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.OperationListResult, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + urlParameters: [Parameters.$host, Parameters.nextLink], + headerParameters: [Parameters.accept], + serializer, +}; diff --git a/sdk/extendedlocation/arm-extendedlocation/src/operations/resourceSyncRules.ts b/sdk/extendedlocation/arm-extendedlocation/src/operations/resourceSyncRules.ts index efd36575dce5..d698dbeabf7d 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.js"; import * as Parameters from "../models/parameters.js"; import { CustomLocationsManagementClient } from "../customLocationsManagementClient.js"; -import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; -import { LroImpl } from "../lroImpl.js"; +import { + SimplePollerLike, + OperationState, + createHttpPoller, +} from "@azure/core-lro"; +import { createLroSpec } from "../lroImpl.js"; import { ResourceSyncRule, ResourceSyncRulesListByCustomLocationIDNextOptionalParams, @@ -24,10 +28,10 @@ import { ResourceSyncRulesGetResponse, ResourceSyncRulesCreateOrUpdateOptionalParams, ResourceSyncRulesCreateOrUpdateResponse, - ResourceSyncRulesDeleteOptionalParams, ResourceSyncRulesUpdateOptionalParams, ResourceSyncRulesUpdateResponse, - ResourceSyncRulesListByCustomLocationIDNextResponse + ResourceSyncRulesDeleteOptionalParams, + ResourceSyncRulesListByCustomLocationIDNextResponse, } from "../models/index.js"; /// @@ -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,38 +266,18 @@ 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(); } - /** - * Deletes the Resource Sync Rule with the specified Resource Sync Rule Name, Custom Location Resource - * Name, Resource Group, and Subscription Id. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName Custom Locations name. - * @param childResourceName Resource Sync Rule name. - * @param options The options parameters. - */ - delete( - resourceGroupName: string, - resourceName: string, - childResourceName: string, - options?: ResourceSyncRulesDeleteOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, resourceName, childResourceName, options }, - deleteOperationSpec - ); - } - /** * Updates a Resource Sync Rule with the specified Resource Sync Rule name in the specified Resource * Group, Subscription and Custom Location name. @@ -300,91 +286,36 @@ export class ResourceSyncRulesImpl implements ResourceSyncRules { * @param childResourceName Resource Sync Rule name. * @param options The options parameters. */ - async beginUpdate( + update( resourceGroupName: string, resourceName: string, childResourceName: string, - options?: ResourceSyncRulesUpdateOptionalParams - ): Promise< - PollerLike< - PollOperationState, - ResourceSyncRulesUpdateResponse - > - > { - const directSendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec - ): Promise => { - return this.client.sendOperationRequest(args, spec); - }; - const sendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec - ) => { - let currentRawResponse: - | coreClient.FullOperationResponse - | undefined = undefined; - const providedCallback = args.options?.onResponse; - const callback: coreClient.RawResponseCallback = ( - rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown - ) => { - currentRawResponse = rawResponse; - providedCallback?.(rawResponse, flatResponse); - }; - const updatedArgs = { - ...args, - options: { - ...args.options, - onResponse: callback - } - }; - const flatResponse = await directSendOperation(updatedArgs, spec); - return { - flatResponse, - rawResponse: { - statusCode: currentRawResponse!.status, - body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON() - } - }; - }; - - const lro = new LroImpl( - sendOperation, + options?: ResourceSyncRulesUpdateOptionalParams, + ): Promise { + return this.client.sendOperationRequest( { resourceGroupName, resourceName, childResourceName, options }, - updateOperationSpec + updateOperationSpec, ); - const poller = new LroEngine(lro, { - resumeFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - lroResourceLocationConfig: "azure-async-operation" - }); - await poller.poll(); - return poller; } /** - * Updates a Resource Sync Rule with the specified Resource Sync Rule name in the specified Resource - * Group, Subscription and Custom Location name. + * Deletes the Resource Sync Rule with the specified Resource Sync Rule Name, Custom Location Resource + * Name, Resource Group, and Subscription Id. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName Custom Locations name. * @param childResourceName Resource Sync Rule name. * @param options The options parameters. */ - async beginUpdateAndWait( + delete( resourceGroupName: string, resourceName: string, childResourceName: string, - options?: ResourceSyncRulesUpdateOptionalParams - ): Promise { - const poller = await this.beginUpdate( - resourceGroupName, - resourceName, - childResourceName, - options + options?: ResourceSyncRulesDeleteOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, resourceName, childResourceName, options }, + deleteOperationSpec, ); - return poller.pollUntilDone(); } /** @@ -398,11 +329,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 +341,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 +378,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,63 +410,31 @@ const createOrUpdateOperationSpec: coreClient.OperationSpec = { Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.resourceName, - Parameters.childResourceName + Parameters.childResourceName, ], headerParameters: [Parameters.accept, Parameters.contentType], mediaType: "json", - serializer -}; -const deleteOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ExtendedLocation/customLocations/{resourceName}/resourceSyncRules/{childResourceName}", - httpMethod: "DELETE", - responses: { - 200: {}, - 204: {}, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.resourceName, - 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 - }, - 201: { - bodyMapper: Mappers.ResourceSyncRule - }, - 202: { - 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 +442,51 @@ const updateOperationSpec: 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}", + httpMethod: "DELETE", + responses: { + 200: {}, + 204: {}, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.resourceName, + Parameters.childResourceName, + ], + headerParameters: [Parameters.accept], + 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.nextLink, Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.resourceName, - 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 f7ef841f0d13..4a88e97267fc 100644 --- a/sdk/extendedlocation/arm-extendedlocation/src/operationsInterfaces/customLocations.ts +++ b/sdk/extendedlocation/arm-extendedlocation/src/operationsInterfaces/customLocations.ts @@ -7,10 +7,8 @@ */ import { PagedAsyncIterableIterator } from "@azure/core-paging"; -import { PollerLike, PollOperationState } from "@azure/core-lro"; +import { SimplePollerLike, OperationState } from "@azure/core-lro"; import { - CustomLocationOperation, - CustomLocationsListOperationsOptionalParams, CustomLocation, CustomLocationsListBySubscriptionOptionalParams, CustomLocationsListByResourceGroupOptionalParams, @@ -20,31 +18,25 @@ import { CustomLocationsGetResponse, CustomLocationsCreateOrUpdateOptionalParams, CustomLocationsCreateOrUpdateResponse, - CustomLocationsDeleteOptionalParams, CustomLocationsUpdateOptionalParams, CustomLocationsUpdateResponse, + CustomLocationsDeleteOptionalParams, + CustomLocationsDeleteResponse, CustomLocationFindTargetResourceGroupProperties, CustomLocationsFindTargetResourceGroupOptionalParams, - CustomLocationsFindTargetResourceGroupResponse + CustomLocationsFindTargetResourceGroupResponse, } from "../models/index.js"; /// /** Interface representing a CustomLocations. */ export interface CustomLocations { - /** - * Lists all available Custom Locations operations. - * @param options The options parameters. - */ - listOperations( - options?: CustomLocationsListOperationsOptionalParams - ): PagedAsyncIterableIterator; /** * Gets a list of Custom Locations in the specified subscription. The operation returns properties of * each Custom Location * @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 +46,7 @@ export interface CustomLocations { */ listByResourceGroup( resourceGroupName: string, - options?: CustomLocationsListByResourceGroupOptionalParams + options?: CustomLocationsListByResourceGroupOptionalParams, ): PagedAsyncIterableIterator; /** * Gets the list of the Enabled Resource Types. @@ -65,7 +57,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 +68,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 +81,10 @@ export interface CustomLocations { resourceGroupName: string, resourceName: string, parameters: CustomLocation, - options?: CustomLocationsCreateOrUpdateOptionalParams + options?: CustomLocationsCreateOrUpdateOptionalParams, ): Promise< - PollerLike< - PollOperationState, + SimplePollerLike< + OperationState, CustomLocationsCreateOrUpdateResponse > >; @@ -107,42 +99,47 @@ 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. + * Updates a Custom Location with the specified Resource Name in the specified Resource Group and + * Subscription. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName Custom Locations name. * @param options The options parameters. */ - beginDelete( + update( resourceGroupName: string, resourceName: string, - options?: CustomLocationsDeleteOptionalParams - ): Promise, void>>; + options?: CustomLocationsUpdateOptionalParams, + ): Promise; /** * 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. * @param resourceName Custom Locations name. * @param options The options parameters. */ - beginDeleteAndWait( + beginDelete( resourceGroupName: string, resourceName: string, - options?: CustomLocationsDeleteOptionalParams - ): Promise; + options?: CustomLocationsDeleteOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + CustomLocationsDeleteResponse + > + >; /** - * Updates a Custom Location with the specified Resource Name in the specified Resource Group and - * Subscription. + * 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. * @param resourceName Custom Locations name. * @param options The options parameters. */ - update( + beginDeleteAndWait( resourceGroupName: string, resourceName: string, - options?: CustomLocationsUpdateOptionalParams - ): Promise; + options?: CustomLocationsDeleteOptionalParams, + ): Promise; /** * Returns the target resource group associated with the resource sync rules of the Custom Location * that match the rules passed in with the Find Target Resource Group Request. @@ -155,6 +152,6 @@ export interface CustomLocations { resourceGroupName: string, resourceName: string, parameters: CustomLocationFindTargetResourceGroupProperties, - options?: CustomLocationsFindTargetResourceGroupOptionalParams + options?: CustomLocationsFindTargetResourceGroupOptionalParams, ): Promise; } diff --git a/sdk/extendedlocation/arm-extendedlocation/src/operationsInterfaces/index.ts b/sdk/extendedlocation/arm-extendedlocation/src/operationsInterfaces/index.ts index 44b33895be5e..60ec51bd1c45 100644 --- a/sdk/extendedlocation/arm-extendedlocation/src/operationsInterfaces/index.ts +++ b/sdk/extendedlocation/arm-extendedlocation/src/operationsInterfaces/index.ts @@ -6,5 +6,6 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ +export * from "./operations.js"; export * from "./customLocations.js"; export * from "./resourceSyncRules.js"; diff --git a/sdk/extendedlocation/arm-extendedlocation/src/operationsInterfaces/operations.ts b/sdk/extendedlocation/arm-extendedlocation/src/operationsInterfaces/operations.ts new file mode 100644 index 000000000000..2fb28905ae67 --- /dev/null +++ b/sdk/extendedlocation/arm-extendedlocation/src/operationsInterfaces/operations.ts @@ -0,0 +1,22 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { Operation, OperationsListOptionalParams } from "../models/index.js"; + +/// +/** Interface representing a Operations. */ +export interface Operations { + /** + * Lists all available Custom Locations operations. + * @param options The options parameters. + */ + list( + options?: OperationsListOptionalParams, + ): PagedAsyncIterableIterator; +} diff --git a/sdk/extendedlocation/arm-extendedlocation/src/operationsInterfaces/resourceSyncRules.ts b/sdk/extendedlocation/arm-extendedlocation/src/operationsInterfaces/resourceSyncRules.ts index b142983da34c..6a0b7caf0d25 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, @@ -15,9 +15,9 @@ import { ResourceSyncRulesGetResponse, ResourceSyncRulesCreateOrUpdateOptionalParams, ResourceSyncRulesCreateOrUpdateResponse, - ResourceSyncRulesDeleteOptionalParams, ResourceSyncRulesUpdateOptionalParams, - ResourceSyncRulesUpdateResponse + ResourceSyncRulesUpdateResponse, + ResourceSyncRulesDeleteOptionalParams, } from "../models/index.js"; /// @@ -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,22 +84,8 @@ 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 - * Name, Resource Group, and Subscription Id. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName Custom Locations name. - * @param childResourceName Resource Sync Rule name. - * @param options The options parameters. - */ - delete( - resourceGroupName: string, - resourceName: string, - childResourceName: string, - options?: ResourceSyncRulesDeleteOptionalParams - ): Promise; /** * Updates a Resource Sync Rule with the specified Resource Sync Rule name in the specified Resource * Group, Subscription and Custom Location name. @@ -108,29 +94,24 @@ export interface ResourceSyncRules { * @param childResourceName Resource Sync Rule name. * @param options The options parameters. */ - beginUpdate( + update( resourceGroupName: string, resourceName: string, childResourceName: string, - options?: ResourceSyncRulesUpdateOptionalParams - ): Promise< - PollerLike< - PollOperationState, - ResourceSyncRulesUpdateResponse - > - >; + options?: ResourceSyncRulesUpdateOptionalParams, + ): Promise; /** - * Updates a Resource Sync Rule with the specified Resource Sync Rule name in the specified Resource - * Group, Subscription and Custom Location name. + * Deletes the Resource Sync Rule with the specified Resource Sync Rule Name, Custom Location Resource + * Name, Resource Group, and Subscription Id. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName Custom Locations name. * @param childResourceName Resource Sync Rule name. * @param options The options parameters. */ - beginUpdateAndWait( + delete( resourceGroupName: string, resourceName: string, childResourceName: string, - options?: ResourceSyncRulesUpdateOptionalParams - ): Promise; + options?: ResourceSyncRulesDeleteOptionalParams, + ): 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 new file mode 100644 index 000000000000..a1cf7c25afd2 --- /dev/null +++ b/sdk/extendedlocation/arm-extendedlocation/test/sampleTest.ts @@ -0,0 +1,40 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { + Recorder, + RecorderStartOptions, +} from "@azure-tools/test-recorder"; + +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", +}; + +const recorderOptions: RecorderStartOptions = { + envSetupForPlayback: replaceableVariables, +}; + +describe("My test", () => { + let recorder: Recorder; + + beforeEach(async (ctx) => { + recorder = new Recorder(ctx); + await recorder.start(recorderOptions); + }); + + afterEach(async () => { + await recorder.stop(); + }); + + it("sample test", async function () { + console.log("Hi, I'm a test!"); + }); +}); diff --git a/sdk/extendedlocation/arm-extendedlocation/test/snippets.spec.ts b/sdk/extendedlocation/arm-extendedlocation/test/snippets.spec.ts index c8a65283ab18..81db482558d8 100644 --- a/sdk/extendedlocation/arm-extendedlocation/test/snippets.spec.ts +++ b/sdk/extendedlocation/arm-extendedlocation/test/snippets.spec.ts @@ -1,8 +1,16 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ import { CustomLocationsManagementClient } from "../src/index.js"; -import { DefaultAzureCredential, InteractiveBrowserCredential } from "@azure/identity"; +import { + DefaultAzureCredential, + InteractiveBrowserCredential, +} from "@azure/identity"; import { setLogLevel } from "@azure/logger"; import { describe, it } from "vitest"; @@ -21,7 +29,10 @@ describe("snippets", () => { tenantId: "", clientId: "", }); - const client = new CustomLocationsManagementClient(credential, subscriptionId); + const client = new CustomLocationsManagementClient( + credential, + subscriptionId, + ); }); it("SetLogLevel", async () => { diff --git a/sdk/extendedlocation/arm-extendedlocation/tsconfig.browser.config.json b/sdk/extendedlocation/arm-extendedlocation/tsconfig.browser.config.json index 75871518e3a0..0c8bafa97126 100644 --- a/sdk/extendedlocation/arm-extendedlocation/tsconfig.browser.config.json +++ b/sdk/extendedlocation/arm-extendedlocation/tsconfig.browser.config.json @@ -1,3 +1,6 @@ { - "extends": ["./tsconfig.test.json", "../../../tsconfig.browser.base.json"] + "extends": [ + "./tsconfig.test.json", + "../../../tsconfig.browser.base.json" + ] } diff --git a/sdk/extendedlocation/arm-extendedlocation/tsconfig.json b/sdk/extendedlocation/arm-extendedlocation/tsconfig.json index 19ceb382b521..59ea83c046bf 100644 --- a/sdk/extendedlocation/arm-extendedlocation/tsconfig.json +++ b/sdk/extendedlocation/arm-extendedlocation/tsconfig.json @@ -3,11 +3,8 @@ { "path": "./tsconfig.src.json" }, - { - "path": "./tsconfig.samples.json" - }, { "path": "./tsconfig.test.json" } ] -} +} \ No newline at end of file diff --git a/sdk/extendedlocation/arm-extendedlocation/tsconfig.samples.json b/sdk/extendedlocation/arm-extendedlocation/tsconfig.samples.json index ab5ff24db83c..d066847132f4 100644 --- a/sdk/extendedlocation/arm-extendedlocation/tsconfig.samples.json +++ b/sdk/extendedlocation/arm-extendedlocation/tsconfig.samples.json @@ -2,7 +2,9 @@ "extends": "../../../tsconfig.samples.base.json", "compilerOptions": { "paths": { - "@azure/arm-extendedlocation": ["./dist/esm"] + "@azure/arm-extendedlocation": [ + "./dist/esm" + ] } } } diff --git a/sdk/extendedlocation/arm-extendedlocation/tsconfig.test.json b/sdk/extendedlocation/arm-extendedlocation/tsconfig.test.json index 290ca214aebc..3c2b783a8c1b 100644 --- a/sdk/extendedlocation/arm-extendedlocation/tsconfig.test.json +++ b/sdk/extendedlocation/arm-extendedlocation/tsconfig.test.json @@ -1,3 +1,6 @@ { - "extends": ["./tsconfig.src.json", "../../../tsconfig.test.base.json"] + "extends": [ + "./tsconfig.src.json", + "../../../tsconfig.test.base.json" + ] } diff --git a/sdk/extendedlocation/arm-extendedlocation/vitest.browser.config.ts b/sdk/extendedlocation/arm-extendedlocation/vitest.browser.config.ts index 10e70dbfa8ee..182729ab5ce9 100644 --- a/sdk/extendedlocation/arm-extendedlocation/vitest.browser.config.ts +++ b/sdk/extendedlocation/arm-extendedlocation/vitest.browser.config.ts @@ -1,3 +1,4 @@ + // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. @@ -8,7 +9,7 @@ export default mergeConfig( viteConfig, defineConfig({ test: { - include: ["dist-test/browser/test/**/*.spec.js"], + include: ["dist-test/browser/test/**/*.spec.js",], testTimeout: 1200000, hookTimeout: 1200000, }, diff --git a/sdk/extendedlocation/arm-extendedlocation/vitest.config.ts b/sdk/extendedlocation/arm-extendedlocation/vitest.config.ts index 86a71911ccc2..40e031385dd8 100644 --- a/sdk/extendedlocation/arm-extendedlocation/vitest.config.ts +++ b/sdk/extendedlocation/arm-extendedlocation/vitest.config.ts @@ -1,3 +1,4 @@ + // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. diff --git a/sdk/extendedlocation/arm-extendedlocation/vitest.esm.config.ts b/sdk/extendedlocation/arm-extendedlocation/vitest.esm.config.ts index 5e9735e9b144..a70127279fc9 100644 --- a/sdk/extendedlocation/arm-extendedlocation/vitest.esm.config.ts +++ b/sdk/extendedlocation/arm-extendedlocation/vitest.esm.config.ts @@ -1,3 +1,4 @@ + // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. @@ -5,4 +6,7 @@ import { mergeConfig } from "vitest/config"; import vitestConfig from "./vitest.config.ts"; import vitestEsmConfig from "../../../vitest.esm.shared.config.ts"; -export default mergeConfig(vitestConfig, vitestEsmConfig); +export default mergeConfig( + vitestConfig, + vitestEsmConfig +);