diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index f5137bec8caa..42bdf53f5b22 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -713,6 +713,7 @@ packages: /@azure-tools/test-recorder/2.0.0: resolution: {integrity: sha512-OTic1OwOk25B8ecdMQ4wgyDaUNMMw0qzO4/0sy9ScPXWLmUFGMlkS0+BOQ2K9t8WCksM/wU+NjUZo/5T4zaG6A==} engines: {node: '>=12.0.0'} + deprecated: Bug introduced in v2.0.0, fixed in 3.0.0 dependencies: '@azure/core-auth': 1.4.0 '@azure/core-http': 2.3.1 @@ -3911,7 +3912,7 @@ packages: dependencies: semver: 7.3.8 shelljs: 0.8.5 - typescript: 5.1.0-dev.20230323 + typescript: 5.1.0-dev.20230327 dev: false /ecdsa-sig-formatter/1.0.11: @@ -8771,9 +8772,8 @@ packages: hasBin: true dev: false - /typescript/5.1.0-dev.20230323: - resolution: {integrity: sha512-C/U2MNu/RkpNWJLPqo0q6ZimJLwBaQkd9ktJOjLDyV6/d/HgVfvVI15ga0UH4yj4bKRY0B8Yoth8pyn6jP+IUg==} - + /typescript/5.1.0-dev.20230327: + resolution: {integrity: sha512-tzeS6vmUF8qC4zFdvos88Oer1oNVrg0CVlIaxfI//pDrq8rur4nIUTLRWRlEMCeLQporHhD+z9sESoSr5GL+lw==} engines: {node: '>=12.20'} hasBin: true dev: false @@ -10646,7 +10646,7 @@ packages: dev: false file:projects/arm-changes.tgz: - resolution: {integrity: sha512-p78Uncj2JuxDs3TjtqFlWa36ZWsQQvwse0kbD6SJa9ZiIYW0LRuCaQiYPyI+76ryU/QOjOxiBkvinHUvEu5wNA==, tarball: file:projects/arm-changes.tgz} + resolution: {integrity: sha512-7DuFCbmqVSVPHWsrM1Gj686DW76ux/e9U+EA71mZ3exD7n4/E/8jdyOC9bjOVVdG4O0Xw20crjDF/UEvW7rcMQ==, tarball: file:projects/arm-changes.tgz} name: '@rush-temp/arm-changes' version: 0.0.0 dependencies: @@ -10660,7 +10660,8 @@ packages: '@types/node': 14.18.38 chai: 4.3.7 cross-env: 7.0.3 - mkdirp: 1.0.4 + dotenv: 16.0.3 + mkdirp: 2.1.5 mocha: 7.2.0 rimraf: 3.0.2 rollup: 2.79.1 @@ -12113,7 +12114,7 @@ packages: dev: false file:projects/arm-features.tgz: - resolution: {integrity: sha512-aT0fEUYX5/forS2f/Zvk7q2HL0K0Yet5UA5l9FZe+ud3D/9eTSDnIA7Jqf1C7ZlBSzdQSjkHWVH8xKfXWIKyEg==, tarball: file:projects/arm-features.tgz} + resolution: {integrity: sha512-qgRkXbD2oh2IdBBadYoUnYm2OuZF/LdNM0w4HpF9QfJZddhceyjsa5Iml7mAqPUWY3rSqvGrHG1Uw/9n0K40UA==, tarball: file:projects/arm-features.tgz} name: '@rush-temp/arm-features' version: 0.0.0 dependencies: @@ -12127,7 +12128,8 @@ packages: '@types/node': 14.18.38 chai: 4.3.7 cross-env: 7.0.3 - mkdirp: 1.0.4 + dotenv: 16.0.3 + mkdirp: 2.1.5 mocha: 7.2.0 rimraf: 3.0.2 rollup: 2.79.1 @@ -12721,7 +12723,7 @@ packages: dev: false file:projects/arm-links.tgz: - resolution: {integrity: sha512-26SWjFDxIPrUdFx3K0ucgmf7M14K3Bl2p00pt0X+FF9TzI6sOjTNdKMZKJj/VXaYwGDnTW4Opq4FFs2+F65NRw==, tarball: file:projects/arm-links.tgz} + resolution: {integrity: sha512-R7tSmvpr/Op6Py27rczhOq9vc/fOz7jStmkmGHwNiuK2j8vloV0zsV25ZlNbRddiVooSfOHRlG3RQuKI4pTlew==, tarball: file:projects/arm-links.tgz} name: '@rush-temp/arm-links' version: 0.0.0 dependencies: @@ -12735,7 +12737,8 @@ packages: '@types/node': 14.18.38 chai: 4.3.7 cross-env: 7.0.3 - mkdirp: 1.0.4 + dotenv: 16.0.3 + mkdirp: 2.1.5 mocha: 7.2.0 rimraf: 3.0.2 rollup: 2.79.1 @@ -12804,7 +12807,7 @@ packages: dev: false file:projects/arm-locks.tgz: - resolution: {integrity: sha512-i1t5H0w7SXvIj/aW/Fh/GFh0KgSdl93CjzCHsPus5ZetTJI3OVnFnfFohbDYEP2Fho7jC/PClUirP5IcCczbIA==, tarball: file:projects/arm-locks.tgz} + resolution: {integrity: sha512-/pG+cqdMAuWQLXXSf8NkFpIywxNxK7ZgHCfg+OQTxOJWPpG0FZSNPbef7OknyAZfpkEAtKMKltttME1VZ7MGtg==, tarball: file:projects/arm-locks.tgz} name: '@rush-temp/arm-locks' version: 0.0.0 dependencies: @@ -12818,7 +12821,8 @@ packages: '@types/node': 14.18.38 chai: 4.3.7 cross-env: 7.0.3 - mkdirp: 1.0.4 + dotenv: 16.0.3 + mkdirp: 2.1.5 mocha: 7.2.0 rimraf: 3.0.2 rollup: 2.79.1 @@ -12941,7 +12945,7 @@ packages: dev: false file:projects/arm-managedapplications.tgz: - resolution: {integrity: sha512-TFukoZvkyxNhxK5iZ2C6yVc/ByzCvHXpxPwqYPoLQSyzmPC1TOeU4U8TN+5kFvbWD/PuG1JvMAvnMix2/tIsbQ==, tarball: file:projects/arm-managedapplications.tgz} + resolution: {integrity: sha512-x/JdqsSIJ/W78NtH38h3bEVm2nnVRNMFUQ06jhNgO4C2GF8uMGwQLphTiA7gXIWfwT9m1rYhibragYPuNYMSkw==, tarball: file:projects/arm-managedapplications.tgz} name: '@rush-temp/arm-managedapplications' version: 0.0.0 dependencies: @@ -12955,7 +12959,8 @@ packages: '@types/node': 14.18.38 chai: 4.3.7 cross-env: 7.0.3 - mkdirp: 1.0.4 + dotenv: 16.0.3 + mkdirp: 2.1.5 mocha: 7.2.0 rimraf: 3.0.2 rollup: 2.79.1 @@ -13758,7 +13763,7 @@ packages: dev: false file:projects/arm-policy.tgz: - resolution: {integrity: sha512-TeRM2YNOgHBnenijefXG2vB2NCdBiL5R1C23IFEftIF2vqepw8Xaw8/OJtg3Z1yz3IYK7A3IMWHyAuJ9mg46Yw==, tarball: file:projects/arm-policy.tgz} + resolution: {integrity: sha512-a34IRmRGu+rFYSvulELtwW3FAKg8PpsXjE2wNz3YhIaOJiZG4zUJCHltlvHhA6yCBnaDeTR2WVRzj3kON/MwTw==, tarball: file:projects/arm-policy.tgz} name: '@rush-temp/arm-policy' version: 0.0.0 dependencies: @@ -13772,7 +13777,8 @@ packages: '@types/node': 14.18.38 chai: 4.3.7 cross-env: 7.0.3 - mkdirp: 1.0.4 + dotenv: 16.0.3 + mkdirp: 2.1.5 mocha: 7.2.0 rimraf: 3.0.2 rollup: 2.79.1 @@ -14365,7 +14371,7 @@ packages: dev: false file:projects/arm-resources-subscriptions.tgz: - resolution: {integrity: sha512-M0nuMO0Fg1qJXUOq/IdA4ixcuy25QdC/onMUJJNVpF0CxGrTHBm5E+KjUA5kbLyCHzSKSKlclaFRaVTKhvt0Pw==, tarball: file:projects/arm-resources-subscriptions.tgz} + resolution: {integrity: sha512-QO/iHVW77yNp3YckbdlUNIodNnm12FOZyKScSB0LHdMJ2vBW2aaMB3qS9V3sVnv62uqzr+bSSZKp9Y0hA4asLw==, tarball: file:projects/arm-resources-subscriptions.tgz} name: '@rush-temp/arm-resources-subscriptions' version: 0.0.0 dependencies: @@ -14379,7 +14385,8 @@ packages: '@types/node': 14.18.38 chai: 4.3.7 cross-env: 7.0.3 - mkdirp: 1.0.4 + dotenv: 16.0.3 + mkdirp: 2.1.5 mocha: 7.2.0 rimraf: 3.0.2 rollup: 2.79.1 @@ -15236,7 +15243,7 @@ packages: dev: false file:projects/arm-templatespecs.tgz: - resolution: {integrity: sha512-ZKxHNl9iNMA7cC4x9dYaA3d2SpmqdDrxfVwHpy44pTvCa5z9flxlP/QoqoMxX44kJSD2TIH/13P+bOVItDnYpQ==, tarball: file:projects/arm-templatespecs.tgz} + resolution: {integrity: sha512-1enPjBj1dAGdJ1XHOouopfhZn4ZniLrzlCLmmUfEfE+TRVMpWWRJj8G59cd0OyzFV9ppxWG3NRhp8WKht7Lv1A==, tarball: file:projects/arm-templatespecs.tgz} name: '@rush-temp/arm-templatespecs' version: 0.0.0 dependencies: @@ -15250,7 +15257,8 @@ packages: '@types/node': 14.18.38 chai: 4.3.7 cross-env: 7.0.3 - mkdirp: 1.0.4 + dotenv: 16.0.3 + mkdirp: 2.1.5 mocha: 7.2.0 rimraf: 3.0.2 rollup: 2.79.1 diff --git a/sdk/resources/arm-resources/CHANGELOG.md b/sdk/resources/arm-resources/CHANGELOG.md index 743a5a8c5237..fc5358bb8f48 100644 --- a/sdk/resources/arm-resources/CHANGELOG.md +++ b/sdk/resources/arm-resources/CHANGELOG.md @@ -1,15 +1,32 @@ # Release History + +## 6.0.0 (2023-03-27) + +**Features** -## 5.2.1 (Unreleased) - -### Features Added - -### Breaking Changes - -### Bugs Fixed + - Added operation TagsOperations.beginCreateOrUpdateAtScope + - Added operation TagsOperations.beginCreateOrUpdateAtScopeAndWait + - Added operation TagsOperations.beginDeleteAtScope + - Added operation TagsOperations.beginDeleteAtScopeAndWait + - Added operation TagsOperations.beginUpdateAtScope + - Added operation TagsOperations.beginUpdateAtScopeAndWait + - Added Interface TagsCreateOrUpdateAtScopeHeaders + - Added Interface TagsDeleteAtScopeHeaders + - Added Interface TagsUpdateAtScopeHeaders + - Interface TagsCreateOrUpdateAtScopeOptionalParams has a new optional parameter resumeFrom + - Interface TagsCreateOrUpdateAtScopeOptionalParams has a new optional parameter updateIntervalInMs + - Interface TagsDeleteAtScopeOptionalParams has a new optional parameter resumeFrom + - Interface TagsDeleteAtScopeOptionalParams has a new optional parameter updateIntervalInMs + - Interface TagsUpdateAtScopeOptionalParams has a new optional parameter resumeFrom + - Interface TagsUpdateAtScopeOptionalParams has a new optional parameter updateIntervalInMs -### Other Changes +**Breaking Changes** + - Removed operation TagsOperations.createOrUpdateAtScope + - Removed operation TagsOperations.deleteAtScope + - Removed operation TagsOperations.updateAtScope + + ## 5.2.0 (2023-03-13) **Features** diff --git a/sdk/resources/arm-resources/_meta.json b/sdk/resources/arm-resources/_meta.json index e588fd1b883e..5673a3566433 100644 --- a/sdk/resources/arm-resources/_meta.json +++ b/sdk/resources/arm-resources/_meta.json @@ -1,8 +1,8 @@ { - "commit": "a42f1b58607091c4f255ead152a8ef323fa0b280", - "readme": "specification\\resources\\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=D:\\Git\\azure-sdk-for-js ..\\azure-rest-api-specs\\specification\\resources\\resource-manager\\readme.md --use=@autorest/typescript@6.0.0-rc.9.20230306.1 --generate-sample=true", + "commit": "32f4b34581ce3613834410d1cbeb0fdeed314b79", + "readme": "specification/resources/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=/mnt/vss/_work/1/s/azure-sdk-for-js ../azure-rest-api-specs/specification/resources/resource-manager/readme.md --use=@autorest/typescript@6.0.0-rc.10", "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", - "release_tool": "@azure-tools/js-sdk-release-tools@2.6.2", - "use": "@autorest/typescript@6.0.0-rc.9.20230306.1" + "release_tool": "@azure-tools/js-sdk-release-tools@2.7.0", + "use": "@autorest/typescript@6.0.0-rc.10" } \ No newline at end of file diff --git a/sdk/resources/arm-resources/package.json b/sdk/resources/arm-resources/package.json index a2edcdfb6cab..a70e78916350 100644 --- a/sdk/resources/arm-resources/package.json +++ b/sdk/resources/arm-resources/package.json @@ -3,7 +3,7 @@ "sdk-type": "mgmt", "author": "Microsoft Corporation", "description": "A generated SDK for ResourceManagementClient.", - "version": "5.2.1", + "version": "6.0.0", "engines": { "node": ">=14.0.0" }, @@ -111,13 +111,5 @@ ] }, "autoPublish": true, - "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/resources/arm-resources", - "//sampleConfiguration": { - "productName": "", - "productSlugs": [ - "azure" - ], - "disableDocsMs": true, - "apiRefLink": "https://docs.microsoft.com/javascript/api/@azure/arm-resources?view=azure-node-preview" - } -} + "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/resources/arm-resources" +} \ No newline at end of file diff --git a/sdk/resources/arm-resources/review/arm-resources.api.md b/sdk/resources/arm-resources/review/arm-resources.api.md index 4d8eb74a80a8..05b851a123ed 100644 --- a/sdk/resources/arm-resources/review/arm-resources.api.md +++ b/sdk/resources/arm-resources/review/arm-resources.api.md @@ -1621,8 +1621,15 @@ export interface Tags { }; } +// @public +export interface TagsCreateOrUpdateAtScopeHeaders { + location?: string; +} + // @public export interface TagsCreateOrUpdateAtScopeOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; } // @public @@ -1642,8 +1649,15 @@ export interface TagsCreateOrUpdateValueOptionalParams extends coreClient.Operat // @public export type TagsCreateOrUpdateValueResponse = TagValue; +// @public +export interface TagsDeleteAtScopeHeaders { + location?: string; +} + // @public export interface TagsDeleteAtScopeOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; } // @public @@ -1683,15 +1697,18 @@ export interface TagsListResult { // @public export interface TagsOperations { + beginCreateOrUpdateAtScope(scope: string, parameters: TagsResource, options?: TagsCreateOrUpdateAtScopeOptionalParams): Promise, TagsCreateOrUpdateAtScopeResponse>>; + beginCreateOrUpdateAtScopeAndWait(scope: string, parameters: TagsResource, options?: TagsCreateOrUpdateAtScopeOptionalParams): Promise; + beginDeleteAtScope(scope: string, options?: TagsDeleteAtScopeOptionalParams): Promise, void>>; + beginDeleteAtScopeAndWait(scope: string, options?: TagsDeleteAtScopeOptionalParams): Promise; + beginUpdateAtScope(scope: string, parameters: TagsPatchResource, options?: TagsUpdateAtScopeOptionalParams): Promise, TagsUpdateAtScopeResponse>>; + beginUpdateAtScopeAndWait(scope: string, parameters: TagsPatchResource, options?: TagsUpdateAtScopeOptionalParams): Promise; createOrUpdate(tagName: string, options?: TagsCreateOrUpdateOptionalParams): Promise; - createOrUpdateAtScope(scope: string, parameters: TagsResource, options?: TagsCreateOrUpdateAtScopeOptionalParams): Promise; createOrUpdateValue(tagName: string, tagValue: string, options?: TagsCreateOrUpdateValueOptionalParams): Promise; delete(tagName: string, options?: TagsDeleteOptionalParams): Promise; - deleteAtScope(scope: string, options?: TagsDeleteAtScopeOptionalParams): Promise; deleteValue(tagName: string, tagValue: string, options?: TagsDeleteValueOptionalParams): Promise; getAtScope(scope: string, options?: TagsGetAtScopeOptionalParams): Promise; list(options?: TagsListOptionalParams): PagedAsyncIterableIterator; - updateAtScope(scope: string, parameters: TagsPatchResource, options?: TagsUpdateAtScopeOptionalParams): Promise; } // @public @@ -1711,8 +1728,15 @@ export interface TagsResource { readonly type?: string; } +// @public +export interface TagsUpdateAtScopeHeaders { + location?: string; +} + // @public export interface TagsUpdateAtScopeOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; } // @public diff --git a/sdk/resources/arm-resources/src/models/index.ts b/sdk/resources/arm-resources/src/models/index.ts index 2c57cb76c149..aafd93c81fd1 100644 --- a/sdk/resources/arm-resources/src/models/index.ts +++ b/sdk/resources/arm-resources/src/models/index.ts @@ -1143,6 +1143,24 @@ export interface DeploymentsWhatIfHeaders { retryAfter?: string; } +/** Defines headers for Tags_createOrUpdateAtScope operation. */ +export interface TagsCreateOrUpdateAtScopeHeaders { + /** URL to get status of this long-running operation. */ + location?: string; +} + +/** Defines headers for Tags_updateAtScope operation. */ +export interface TagsUpdateAtScopeHeaders { + /** URL to get status of this long-running operation. */ + location?: string; +} + +/** Defines headers for Tags_deleteAtScope operation. */ +export interface TagsDeleteAtScopeHeaders { + /** URL to get status of this long-running operation. */ + location?: string; +} + /** Known values of {@link ExpressionEvaluationOptionsScopeType} that the service accepts. */ export enum KnownExpressionEvaluationOptionsScopeType { /** NotSpecified */ @@ -1963,7 +1981,7 @@ export interface ResourcesListOptionalParams extends coreClient.OperationOptions { /** The filter to apply on the operation.

Filter comparison operators include `eq` (equals) and `ne` (not equals) and may be used with the following properties: `location`, `resourceType`, `name`, `resourceGroup`, `identity`, `identity/principalId`, `plan`, `plan/publisher`, `plan/product`, `plan/name`, `plan/version`, and `plan/promotionCode`.

For example, to filter by a resource type, use `$filter=resourceType eq 'Microsoft.Network/virtualNetworks'`


`substringof(value, property)` can be used to filter for substrings of the following currently-supported properties: `name` and `resourceGroup`

For example, to get all resources with 'demo' anywhere in the resource name, use `$filter=substringof('demo', name)`

Multiple substring operations can also be combined using `and`/`or` operators.

Note that any truncated number of results queried via `$top` may also not be compatible when using a filter.


Resources can be filtered by tag names and values. For example, to filter for a tag name and value, use `$filter=tagName eq 'tag1' and tagValue eq 'Value1'`. Note that when resources are filtered by tag name and value, the original tags for each resource will not be returned in the results. Any list of additional properties queried via `$expand` may also not be compatible when filtering by tag names/values.

For tag names only, resources can be filtered by prefix using the following syntax: `$filter=startswith(tagName, 'depart')`. This query will return all resources with a tag name prefixed by the phrase `depart` (i.e.`department`, `departureDate`, `departureTime`, etc.)


Note that some properties can be combined when filtering resources, which include the following: `substringof() and/or resourceType`, `plan and plan/publisher and plan/name`, and `identity and identity/principalId`. */ filter?: string; - /** The number of results to return. If null is passed, returns all resources. */ + /** The number of recommendations per page if a paged version of this API is being used. */ top?: number; /** Comma-separated list of additional properties to be included in the response. Valid values include `createdTime`, `changedTime` and `provisioningState`. For example, `$expand=createdTime,changedTime`. */ expand?: string; @@ -2185,14 +2203,24 @@ export type TagsListResponse = TagsListResult; /** Optional parameters. */ export interface TagsCreateOrUpdateAtScopeOptionalParams - extends coreClient.OperationOptions {} + 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 createOrUpdateAtScope operation. */ export type TagsCreateOrUpdateAtScopeResponse = TagsResource; /** Optional parameters. */ export interface TagsUpdateAtScopeOptionalParams - extends coreClient.OperationOptions {} + 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 updateAtScope operation. */ export type TagsUpdateAtScopeResponse = TagsResource; @@ -2206,7 +2234,12 @@ export type TagsGetAtScopeResponse = TagsResource; /** Optional parameters. */ export interface TagsDeleteAtScopeOptionalParams - extends coreClient.OperationOptions {} + 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 TagsListNextOptionalParams diff --git a/sdk/resources/arm-resources/src/models/mappers.ts b/sdk/resources/arm-resources/src/models/mappers.ts index 851900fc8315..1eb78402615d 100644 --- a/sdk/resources/arm-resources/src/models/mappers.ts +++ b/sdk/resources/arm-resources/src/models/mappers.ts @@ -2850,3 +2850,48 @@ export const DeploymentsWhatIfHeaders: coreClient.CompositeMapper = { } } }; + +export const TagsCreateOrUpdateAtScopeHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "TagsCreateOrUpdateAtScopeHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String" + } + } + } + } +}; + +export const TagsUpdateAtScopeHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "TagsUpdateAtScopeHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String" + } + } + } + } +}; + +export const TagsDeleteAtScopeHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "TagsDeleteAtScopeHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String" + } + } + } + } +}; diff --git a/sdk/resources/arm-resources/src/models/parameters.ts b/sdk/resources/arm-resources/src/models/parameters.ts index 4e19dc1f6919..63988e051e3a 100644 --- a/sdk/resources/arm-resources/src/models/parameters.ts +++ b/sdk/resources/arm-resources/src/models/parameters.ts @@ -53,7 +53,7 @@ export const $host: OperationURLParameter = { export const apiVersion: OperationQueryParameter = { parameterPath: "apiVersion", mapper: { - defaultValue: "2021-04-01", + defaultValue: "2022-09-01", isConstant: true, serializedName: "api-version", type: { diff --git a/sdk/resources/arm-resources/src/operations/providers.ts b/sdk/resources/arm-resources/src/operations/providers.ts index 3d1d40950154..28ce66a9a09b 100644 --- a/sdk/resources/arm-resources/src/operations/providers.ts +++ b/sdk/resources/arm-resources/src/operations/providers.ts @@ -173,7 +173,10 @@ export class ProvidersImpl implements Providers { } /** - * Registers a management group with a resource provider. + * Registers a management group with a resource provider. Use this operation to register a resource + * provider with resource types that can be deployed at the management group scope. It does not + * recursively register subscriptions within the management group. Instead, you must register + * subscriptions individually. * @param resourceProviderNamespace The namespace of the resource provider to register. * @param groupId The management group ID. * @param options The options parameters. diff --git a/sdk/resources/arm-resources/src/operations/resources.ts b/sdk/resources/arm-resources/src/operations/resources.ts index 71347bd79aaf..40d36faf9d19 100644 --- a/sdk/resources/arm-resources/src/operations/resources.ts +++ b/sdk/resources/arm-resources/src/operations/resources.ts @@ -831,7 +831,9 @@ export class ResourcesImpl implements Resources { } /** - * Checks by ID whether a resource exists. + * Checks by ID whether a resource exists. This API currently works only for a limited set of Resource + * providers. In the event that a Resource provider does not implement this API, ARM will respond with + * a 405. The alternative then is to use the GET API to check for the existence of the resource. * @param resourceId The fully qualified ID of the resource, including the resource name and resource * type. Use the format, * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name} diff --git a/sdk/resources/arm-resources/src/operations/tagsOperations.ts b/sdk/resources/arm-resources/src/operations/tagsOperations.ts index 121ce4e824ec..732745c9b88e 100644 --- a/sdk/resources/arm-resources/src/operations/tagsOperations.ts +++ b/sdk/resources/arm-resources/src/operations/tagsOperations.ts @@ -13,6 +13,12 @@ import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; import { ResourceManagementClient } from "../resourceManagementClient"; +import { + SimplePollerLike, + OperationState, + createHttpPoller +} from "@azure/core-lro"; +import { createLroSpec } from "../lroImpl"; import { TagDetails, TagsListNextOptionalParams, @@ -192,15 +198,89 @@ export class TagsOperationsImpl implements TagsOperations { * @param parameters Wrapper resource for tags API requests and responses. * @param options The options parameters. */ - createOrUpdateAtScope( + async beginCreateOrUpdateAtScope( + scope: string, + parameters: TagsResource, + options?: TagsCreateOrUpdateAtScopeOptionalParams + ): Promise< + SimplePollerLike< + OperationState, + TagsCreateOrUpdateAtScopeResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = 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 = createLroSpec({ + sendOperationFn, + args: { scope, parameters, options }, + spec: createOrUpdateAtScopeOperationSpec + }); + const poller = await createHttpPoller< + TagsCreateOrUpdateAtScopeResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); + await poller.poll(); + return poller; + } + + /** + * This operation allows adding or replacing the entire set of tags on the specified resource or + * subscription. The specified entity can have a maximum of 50 tags. + * @param scope The resource scope. + * @param parameters Wrapper resource for tags API requests and responses. + * @param options The options parameters. + */ + async beginCreateOrUpdateAtScopeAndWait( scope: string, parameters: TagsResource, options?: TagsCreateOrUpdateAtScopeOptionalParams ): Promise { - return this.client.sendOperationRequest( - { scope, parameters, options }, - createOrUpdateAtScopeOperationSpec + const poller = await this.beginCreateOrUpdateAtScope( + scope, + parameters, + options ); + return poller.pollUntilDone(); } /** @@ -213,15 +293,88 @@ export class TagsOperationsImpl implements TagsOperations { * @param parameters Wrapper resource for tags patch API request only. * @param options The options parameters. */ - updateAtScope( + async beginUpdateAtScope( + scope: string, + parameters: TagsPatchResource, + options?: TagsUpdateAtScopeOptionalParams + ): Promise< + SimplePollerLike< + OperationState, + TagsUpdateAtScopeResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = 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 = createLroSpec({ + sendOperationFn, + args: { scope, parameters, options }, + spec: updateAtScopeOperationSpec + }); + const poller = await createHttpPoller< + TagsUpdateAtScopeResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); + await poller.poll(); + return poller; + } + + /** + * This operation allows replacing, merging or selectively deleting tags on the specified resource or + * subscription. The specified entity can have a maximum of 50 tags at the end of the operation. The + * 'replace' option replaces the entire set of existing tags with a new set. The 'merge' option allows + * adding tags with new names and updating the values of tags with existing names. The 'delete' option + * allows selectively deleting tags based on given names or name/value pairs. + * @param scope The resource scope. + * @param parameters Wrapper resource for tags patch API request only. + * @param options The options parameters. + */ + async beginUpdateAtScopeAndWait( scope: string, parameters: TagsPatchResource, options?: TagsUpdateAtScopeOptionalParams ): Promise { - return this.client.sendOperationRequest( - { scope, parameters, options }, - updateAtScopeOperationSpec - ); + const poller = await this.beginUpdateAtScope(scope, parameters, options); + return poller.pollUntilDone(); } /** @@ -244,14 +397,73 @@ export class TagsOperationsImpl implements TagsOperations { * @param scope The resource scope. * @param options The options parameters. */ - deleteAtScope( + async beginDeleteAtScope( + scope: string, + options?: TagsDeleteAtScopeOptionalParams + ): Promise, void>> { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = 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 = createLroSpec({ + sendOperationFn, + args: { scope, options }, + spec: deleteAtScopeOperationSpec + }); + const poller = await createHttpPoller>(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); + await poller.poll(); + return poller; + } + + /** + * Deletes the entire set of tags on a resource or subscription. + * @param scope The resource scope. + * @param options The options parameters. + */ + async beginDeleteAtScopeAndWait( scope: string, options?: TagsDeleteAtScopeOptionalParams ): Promise { - return this.client.sendOperationRequest( - { scope, options }, - deleteAtScopeOperationSpec - ); + const poller = await this.beginDeleteAtScope(scope, options); + return poller.pollUntilDone(); } /** @@ -383,6 +595,15 @@ const createOrUpdateAtScopeOperationSpec: coreClient.OperationSpec = { 200: { bodyMapper: Mappers.TagsResource }, + 201: { + bodyMapper: Mappers.TagsResource + }, + 202: { + bodyMapper: Mappers.TagsResource + }, + 204: { + bodyMapper: Mappers.TagsResource + }, default: { bodyMapper: Mappers.CloudError } @@ -401,6 +622,15 @@ const updateAtScopeOperationSpec: coreClient.OperationSpec = { 200: { bodyMapper: Mappers.TagsResource }, + 201: { + bodyMapper: Mappers.TagsResource + }, + 202: { + bodyMapper: Mappers.TagsResource + }, + 204: { + bodyMapper: Mappers.TagsResource + }, default: { bodyMapper: Mappers.CloudError } @@ -433,6 +663,9 @@ const deleteAtScopeOperationSpec: coreClient.OperationSpec = { httpMethod: "DELETE", responses: { 200: {}, + 201: {}, + 202: {}, + 204: {}, default: { bodyMapper: Mappers.CloudError } diff --git a/sdk/resources/arm-resources/src/operationsInterfaces/providers.ts b/sdk/resources/arm-resources/src/operationsInterfaces/providers.ts index ee8f17fce3c8..3b6c01bb2895 100644 --- a/sdk/resources/arm-resources/src/operationsInterfaces/providers.ts +++ b/sdk/resources/arm-resources/src/operationsInterfaces/providers.ts @@ -51,7 +51,10 @@ export interface Providers { options?: ProvidersUnregisterOptionalParams ): Promise; /** - * Registers a management group with a resource provider. + * Registers a management group with a resource provider. Use this operation to register a resource + * provider with resource types that can be deployed at the management group scope. It does not + * recursively register subscriptions within the management group. Instead, you must register + * subscriptions individually. * @param resourceProviderNamespace The namespace of the resource provider to register. * @param groupId The management group ID. * @param options The options parameters. diff --git a/sdk/resources/arm-resources/src/operationsInterfaces/resources.ts b/sdk/resources/arm-resources/src/operationsInterfaces/resources.ts index 4a0e0e0452be..dbb3d01e5cb4 100644 --- a/sdk/resources/arm-resources/src/operationsInterfaces/resources.ts +++ b/sdk/resources/arm-resources/src/operationsInterfaces/resources.ts @@ -298,7 +298,9 @@ export interface Resources { options?: ResourcesGetOptionalParams ): Promise; /** - * Checks by ID whether a resource exists. + * Checks by ID whether a resource exists. This API currently works only for a limited set of Resource + * providers. In the event that a Resource provider does not implement this API, ARM will respond with + * a 405. The alternative then is to use the GET API to check for the existence of the resource. * @param resourceId The fully qualified ID of the resource, including the resource name and resource * type. Use the format, * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name} diff --git a/sdk/resources/arm-resources/src/operationsInterfaces/tagsOperations.ts b/sdk/resources/arm-resources/src/operationsInterfaces/tagsOperations.ts index 134193a3164f..612239a66bdd 100644 --- a/sdk/resources/arm-resources/src/operationsInterfaces/tagsOperations.ts +++ b/sdk/resources/arm-resources/src/operationsInterfaces/tagsOperations.ts @@ -7,6 +7,7 @@ */ import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { SimplePollerLike, OperationState } from "@azure/core-lro"; import { TagDetails, TagsListOptionalParams, @@ -91,7 +92,24 @@ export interface TagsOperations { * @param parameters Wrapper resource for tags API requests and responses. * @param options The options parameters. */ - createOrUpdateAtScope( + beginCreateOrUpdateAtScope( + scope: string, + parameters: TagsResource, + options?: TagsCreateOrUpdateAtScopeOptionalParams + ): Promise< + SimplePollerLike< + OperationState, + TagsCreateOrUpdateAtScopeResponse + > + >; + /** + * This operation allows adding or replacing the entire set of tags on the specified resource or + * subscription. The specified entity can have a maximum of 50 tags. + * @param scope The resource scope. + * @param parameters Wrapper resource for tags API requests and responses. + * @param options The options parameters. + */ + beginCreateOrUpdateAtScopeAndWait( scope: string, parameters: TagsResource, options?: TagsCreateOrUpdateAtScopeOptionalParams @@ -106,7 +124,27 @@ export interface TagsOperations { * @param parameters Wrapper resource for tags patch API request only. * @param options The options parameters. */ - updateAtScope( + beginUpdateAtScope( + scope: string, + parameters: TagsPatchResource, + options?: TagsUpdateAtScopeOptionalParams + ): Promise< + SimplePollerLike< + OperationState, + TagsUpdateAtScopeResponse + > + >; + /** + * This operation allows replacing, merging or selectively deleting tags on the specified resource or + * subscription. The specified entity can have a maximum of 50 tags at the end of the operation. The + * 'replace' option replaces the entire set of existing tags with a new set. The 'merge' option allows + * adding tags with new names and updating the values of tags with existing names. The 'delete' option + * allows selectively deleting tags based on given names or name/value pairs. + * @param scope The resource scope. + * @param parameters Wrapper resource for tags patch API request only. + * @param options The options parameters. + */ + beginUpdateAtScopeAndWait( scope: string, parameters: TagsPatchResource, options?: TagsUpdateAtScopeOptionalParams @@ -125,7 +163,16 @@ export interface TagsOperations { * @param scope The resource scope. * @param options The options parameters. */ - deleteAtScope( + beginDeleteAtScope( + scope: string, + options?: TagsDeleteAtScopeOptionalParams + ): Promise, void>>; + /** + * Deletes the entire set of tags on a resource or subscription. + * @param scope The resource scope. + * @param options The options parameters. + */ + beginDeleteAtScopeAndWait( scope: string, options?: TagsDeleteAtScopeOptionalParams ): Promise; diff --git a/sdk/resources/arm-resources/src/resourceManagementClient.ts b/sdk/resources/arm-resources/src/resourceManagementClient.ts index b6e0ea258726..e23a8ee1a16e 100644 --- a/sdk/resources/arm-resources/src/resourceManagementClient.ts +++ b/sdk/resources/arm-resources/src/resourceManagementClient.ts @@ -68,7 +68,7 @@ export class ResourceManagementClient extends coreClient.ServiceClient { credential: credentials }; - const packageDetails = `azsdk-js-arm-resources/5.2.1`; + const packageDetails = `azsdk-js-arm-resources/6.0.0`; const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` @@ -121,7 +121,7 @@ export class ResourceManagementClient extends coreClient.ServiceClient { // Assigning values to Constant parameters this.$host = options.$host || "https://management.azure.com"; - this.apiVersion = options.apiVersion || "2021-04-01"; + this.apiVersion = options.apiVersion || "2022-09-01"; this.operations = new OperationsImpl(this); this.deployments = new DeploymentsImpl(this); this.providers = new ProvidersImpl(this); diff --git a/sdk/resources/arm-resources/test/sampleTest.ts b/sdk/resources/arm-resources/test/sampleTest.ts new file mode 100644 index 000000000000..25aeb3ebcc36 --- /dev/null +++ b/sdk/resources/arm-resources/test/sampleTest.ts @@ -0,0 +1,43 @@ +/* + * 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, + env +} from "@azure-tools/test-recorder"; +import { assert } from "chai"; +import { Context } from "mocha"; + +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 function(this: Context) { + recorder = new Recorder(this.currentTest); + await recorder.start(recorderOptions); + }); + + afterEach(async function() { + await recorder.stop(); + }); + + it("sample test", async function() { + console.log("Hi, I'm a test!"); + }); +}); diff --git a/sdk/resources/arm-resources/tsconfig.json b/sdk/resources/arm-resources/tsconfig.json index b26efa5c66ab..3e6ae96443f3 100644 --- a/sdk/resources/arm-resources/tsconfig.json +++ b/sdk/resources/arm-resources/tsconfig.json @@ -15,17 +15,11 @@ ], "declaration": true, "outDir": "./dist-esm", - "importHelpers": true, - "paths": { - "@azure/arm-resources": [ - "./src/index" - ] - } + "importHelpers": true }, "include": [ "./src/**/*.ts", - "./test/**/*.ts", - "samples-dev/**/*.ts" + "./test/**/*.ts" ], "exclude": [ "node_modules"