Skip to content

Commit

Permalink
CodeGen from PR 27033 in Azure/azure-rest-api-specs
Browse files Browse the repository at this point in the history
Merge 0ff690d7298720c374b9062ff06f584630b1756e into be0d1c383d683a8eb22ab5fd5b75e380ac3c2eea
  • Loading branch information
SDKAuto committed Jan 4, 2024
1 parent 648c957 commit b7f81c6
Show file tree
Hide file tree
Showing 18 changed files with 593 additions and 662 deletions.
773 changes: 396 additions & 377 deletions common/config/rush/pnpm-lock.yaml

Large diffs are not rendered by default.

46 changes: 35 additions & 11 deletions sdk/managementgroups/arm-managementgroups/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,39 @@
# Release History

## 3.0.0 (2024-01-04)

**Features**

## 2.0.3 (Unreleased)

### Features Added

### Breaking Changes

### Bugs Fixed

### Other Changes

- Added Type Alias EntitySearchType
- Added Type Alias EntityViewParameterType
- Added Type Alias ManagementGroupExpandType
- Added Enum KnownEntitySearchType
- Added Enum KnownEntityViewParameterType
- Added Enum KnownManagementGroupExpandType

**Breaking Changes**

- Interface EntitiesListNextOptionalParams no longer has parameter filter
- Interface EntitiesListNextOptionalParams no longer has parameter groupName
- Interface EntitiesListNextOptionalParams no longer has parameter search
- Interface EntitiesListNextOptionalParams no longer has parameter select
- Interface EntitiesListNextOptionalParams no longer has parameter skip
- Interface EntitiesListNextOptionalParams no longer has parameter skiptoken
- Interface EntitiesListNextOptionalParams no longer has parameter top
- Interface EntitiesListNextOptionalParams no longer has parameter view
- Interface ManagementGroupsGetDescendantsNextOptionalParams no longer has parameter skiptoken
- Interface ManagementGroupsGetDescendantsNextOptionalParams no longer has parameter top
- Interface ManagementGroupsListNextOptionalParams no longer has parameter skiptoken
- Interface ManagementGroupSubscriptionsGetSubscriptionsUnderManagementGroupNextOptionalParams no longer has parameter skiptoken
- Type of parameter search of interface EntitiesListOptionalParams is changed from Enum2 to EntitySearchType
- Type of parameter view of interface EntitiesListOptionalParams is changed from Enum3 to EntityViewParameterType
- Type of parameter expand of interface ManagementGroupsGetOptionalParams is changed from Enum0 to ManagementGroupExpandType
- Removed Enum KnownEnum0
- Removed Enum KnownEnum2
- Removed Enum KnownEnum3
- Removed Enum KnownManagementGroupChildType
- Removed Enum KnownPermissions

## 2.0.2 (2022-12-05)

**Features**
Expand All @@ -34,4 +58,4 @@ To understand the detail of the change, please refer to [Changelog](https://aka.

To migrate the existing applications to the latest version, please refer to [Migration Guide](https://aka.ms/js-track2-migration-guide).

To learn more, please refer to our documentation [Quick Start](https://aka.ms/azsdk/js/mgmt/quickstart ).
To learn more, please refer to our documentation [Quick Start](https://aka.ms/js-track2-quickstart).
2 changes: 1 addition & 1 deletion sdk/managementgroups/arm-managementgroups/LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2022 Microsoft
Copyright (c) 2024 Microsoft

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
10 changes: 5 additions & 5 deletions sdk/managementgroups/arm-managementgroups/_meta.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"commit": "184b23b63ee3a79fb41ca3aa55a31a8d9e636772",
"readme": "specification\\managementgroups\\resource-manager\\readme.md",
"autorest_command": "autorest --version=3.8.4 --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\\managementgroups\\resource-manager\\readme.md --use=@autorest/typescript@6.0.0-rc.3.20221108.1 --generate-sample=true",
"commit": "57ed968bee052cf190854e7f19f6eb03edafa433",
"readme": "specification/managementgroups/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/managementgroups/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.4.2",
"use": "@autorest/typescript@6.0.0-rc.3.20221108.1"
"release_tool": "@azure-tools/js-sdk-release-tools@2.7.4",
"use": "@autorest/typescript@^6.0.12"
}
31 changes: 13 additions & 18 deletions sdk/managementgroups/arm-managementgroups/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,17 @@
"sdk-type": "mgmt",
"author": "Microsoft Corporation",
"description": "A generated SDK for ManagementGroupsAPI.",
"version": "2.0.3",
"version": "3.0.0",
"engines": {
"node": ">=18.0.0"
},
"dependencies": {
"@azure/core-lro": "^2.2.0",
"@azure/core-lro": "^2.5.4",
"@azure/abort-controller": "^1.0.0",
"@azure/core-paging": "^1.2.0",
"@azure/core-client": "^1.6.1",
"@azure/core-client": "^1.7.0",
"@azure/core-auth": "^1.3.0",
"@azure/core-rest-pipeline": "^1.8.0",
"@azure/core-rest-pipeline": "^1.12.0",
"tslib": "^2.2.0"
},
"keywords": [
Expand All @@ -29,22 +29,24 @@
"types": "./types/arm-managementgroups.d.ts",
"devDependencies": {
"@microsoft/api-extractor": "^7.31.1",
"mkdirp": "^1.0.4",
"mkdirp": "^2.1.2",
"typescript": "~5.2.0",
"uglify-js": "^3.4.9",
"rimraf": "^3.0.0",
"rimraf": "^5.0.0",
"dotenv": "^16.0.0",
"@azure/dev-tool": "^1.0.0",
"@azure/identity": "^3.3.0",
"@azure-tools/test-recorder": "^3.0.0",
"@azure-tools/test-credential": "^1.0.0",
"mocha": "^10.0.0",
"@types/mocha": "^10.0.0",
"esm": "^3.2.18",
"@types/chai": "^4.2.8",
"chai": "^4.2.0",
"cross-env": "^7.0.2",
"@types/node": "^18.0.0",
"@azure/dev-tool": "^1.0.0",
"ts-node": "^10.0.0"
},
"homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/managementgroups/arm-managementgroups",
"repository": {
"type": "git",
"url": "https://github.com/Azure/azure-sdk-for-js.git"
Expand Down Expand Up @@ -77,7 +79,7 @@
"extract-api": "api-extractor run --local",
"lint": "echo skipped",
"audit": "echo skipped",
"clean": "rimraf dist dist-browser dist-esm test-dist temp types *.tgz *.log",
"clean": "rimraf --glob dist dist-browser dist-esm test-dist temp types *.tgz *.log",
"build:node": "echo skipped",
"build:browser": "echo skipped",
"build:test": "echo skipped",
Expand Down Expand Up @@ -105,12 +107,5 @@
]
},
"autoPublish": true,
"//sampleConfiguration": {
"productName": "",
"productSlugs": [
"azure"
],
"disableDocsMs": true,
"apiRefLink": "https://docs.microsoft.com/javascript/api/@azure/arm-managementgroups?view=azure-node-preview"
}
}
"homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/managementgroups/arm-managementgroups"
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@

import * as coreAuth from '@azure/core-auth';
import * as coreClient from '@azure/core-client';
import { OperationState } from '@azure/core-lro';
import { PagedAsyncIterableIterator } from '@azure/core-paging';
import { PollerLike } from '@azure/core-lro';
import { PollOperationState } from '@azure/core-lro';
import { SimplePollerLike } from '@azure/core-lro';

// @public
export interface AzureAsyncOperationResults {
Expand Down Expand Up @@ -109,14 +109,6 @@ export interface Entities {
// @public
export interface EntitiesListNextOptionalParams extends coreClient.OperationOptions {
cacheControl?: string;
filter?: string;
groupName?: string;
search?: Enum2;
select?: string;
skip?: number;
skiptoken?: string;
top?: number;
view?: Enum3;
}

// @public
Expand All @@ -127,12 +119,12 @@ export interface EntitiesListOptionalParams extends coreClient.OperationOptions
cacheControl?: string;
filter?: string;
groupName?: string;
search?: Enum2;
search?: EntitySearchType;
select?: string;
skip?: number;
skiptoken?: string;
top?: number;
view?: Enum3;
view?: EntityViewParameterType;
}

// @public
Expand Down Expand Up @@ -178,13 +170,10 @@ export interface EntityParentGroupInfo {
}

// @public
export type Enum0 = string;
export type EntitySearchType = string;

// @public
export type Enum2 = string;

// @public
export type Enum3 = string;
export type EntityViewParameterType = string;

// @public
export interface ErrorDetails {
Expand Down Expand Up @@ -269,14 +258,7 @@ export interface HierarchySettingsUpdateOptionalParams extends coreClient.Operat
export type HierarchySettingsUpdateResponse = HierarchySettings;

// @public
export enum KnownEnum0 {
Ancestors = "ancestors",
Children = "children",
Path = "path"
}

// @public
export enum KnownEnum2 {
export enum KnownEntitySearchType {
AllowedChildren = "AllowedChildren",
AllowedParents = "AllowedParents",
ChildrenOnly = "ChildrenOnly",
Expand All @@ -285,25 +267,18 @@ export enum KnownEnum2 {
}

// @public
export enum KnownEnum3 {
export enum KnownEntityViewParameterType {
Audit = "Audit",
FullHierarchy = "FullHierarchy",
GroupsOnly = "GroupsOnly",
SubscriptionsOnly = "SubscriptionsOnly"
}

// @public
export enum KnownManagementGroupChildType {
MicrosoftManagementManagementGroups = "Microsoft.Management/managementGroups",
Subscriptions = "/subscriptions"
}

// @public
export enum KnownPermissions {
Delete = "delete",
Edit = "edit",
Noaccess = "noaccess",
View = "view"
export enum KnownManagementGroupExpandType {
Ancestors = "ancestors",
Children = "children",
Path = "path"
}

// @public
Expand Down Expand Up @@ -333,7 +308,7 @@ export interface ManagementGroupChildInfo {
}

// @public
export type ManagementGroupChildType = string;
export type ManagementGroupChildType = "Microsoft.Management/managementGroups" | "/subscriptions";

// @public
export interface ManagementGroupDetails {
Expand All @@ -346,6 +321,9 @@ export interface ManagementGroupDetails {
version?: number;
}

// @public
export type ManagementGroupExpandType = string;

// @public
export interface ManagementGroupInfo {
displayName?: string;
Expand All @@ -369,9 +347,9 @@ export interface ManagementGroupPathElement {

// @public
export interface ManagementGroups {
beginCreateOrUpdate(groupId: string, createManagementGroupRequest: CreateManagementGroupRequest, options?: ManagementGroupsCreateOrUpdateOptionalParams): Promise<PollerLike<PollOperationState<ManagementGroupsCreateOrUpdateResponse>, ManagementGroupsCreateOrUpdateResponse>>;
beginCreateOrUpdate(groupId: string, createManagementGroupRequest: CreateManagementGroupRequest, options?: ManagementGroupsCreateOrUpdateOptionalParams): Promise<SimplePollerLike<OperationState<ManagementGroupsCreateOrUpdateResponse>, ManagementGroupsCreateOrUpdateResponse>>;
beginCreateOrUpdateAndWait(groupId: string, createManagementGroupRequest: CreateManagementGroupRequest, options?: ManagementGroupsCreateOrUpdateOptionalParams): Promise<ManagementGroupsCreateOrUpdateResponse>;
beginDelete(groupId: string, options?: ManagementGroupsDeleteOptionalParams): Promise<PollerLike<PollOperationState<ManagementGroupsDeleteResponse>, ManagementGroupsDeleteResponse>>;
beginDelete(groupId: string, options?: ManagementGroupsDeleteOptionalParams): Promise<SimplePollerLike<OperationState<ManagementGroupsDeleteResponse>, ManagementGroupsDeleteResponse>>;
beginDeleteAndWait(groupId: string, options?: ManagementGroupsDeleteOptionalParams): Promise<ManagementGroupsDeleteResponse>;
get(groupId: string, options?: ManagementGroupsGetOptionalParams): Promise<ManagementGroupsGetResponse>;
list(options?: ManagementGroupsListOptionalParams): PagedAsyncIterableIterator<ManagementGroupInfo>;
Expand Down Expand Up @@ -442,8 +420,6 @@ export type ManagementGroupsDeleteResponse = ManagementGroupsDeleteHeaders & Azu

// @public
export interface ManagementGroupsGetDescendantsNextOptionalParams extends coreClient.OperationOptions {
skiptoken?: string;
top?: number;
}

// @public
Expand All @@ -461,7 +437,7 @@ export type ManagementGroupsGetDescendantsResponse = DescendantListResult;
// @public
export interface ManagementGroupsGetOptionalParams extends coreClient.OperationOptions {
cacheControl?: string;
expand?: Enum0;
expand?: ManagementGroupExpandType;
filter?: string;
recurse?: boolean;
}
Expand All @@ -472,7 +448,6 @@ export type ManagementGroupsGetResponse = ManagementGroup;
// @public
export interface ManagementGroupsListNextOptionalParams extends coreClient.OperationOptions {
cacheControl?: string;
skiptoken?: string;
}

// @public
Expand Down Expand Up @@ -518,7 +493,6 @@ export type ManagementGroupSubscriptionsGetSubscriptionResponse = SubscriptionUn

// @public
export interface ManagementGroupSubscriptionsGetSubscriptionsUnderManagementGroupNextOptionalParams extends coreClient.OperationOptions {
skiptoken?: string;
}

// @public
Expand Down Expand Up @@ -602,7 +576,7 @@ export interface PatchManagementGroupRequest {
}

// @public
type Permissions_2 = string;
type Permissions_2 = "noaccess" | "view" | "edit" | "delete";
export { Permissions_2 as Permissions }

// @public
Expand Down
54 changes: 31 additions & 23 deletions sdk/managementgroups/arm-managementgroups/src/lroImpl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<T> implements LongRunningOperation<T> {
constructor(
private sendOperationFn: (args: any, spec: any) => Promise<LroResponse<T>>,
private args: Record<string, unknown>,
private spec: {
readonly requestBody?: unknown;
readonly path?: string;
readonly httpMethod: string;
} & Record<string, any>,
public requestPath: string = spec.path!,
public requestMethod: string = spec.httpMethod
) {}
public async sendInitialRequest(): Promise<LroResponse<T>> {
return this.sendOperationFn(this.args, this.spec);
}
public async sendPollRequest(path: string): Promise<LroResponse<T>> {
const { requestBody, ...restSpec } = this.spec;
return this.sendOperationFn(this.args, {
...restSpec,
path,
httpMethod: "GET"
});
}
export function createLroSpec<T>(inputs: {
sendOperationFn: (args: any, spec: any) => Promise<LroResponse<T>>;
args: Record<string, unknown>;
spec: {
readonly requestBody?: unknown;
readonly path?: string;
readonly httpMethod: string;
} & Record<string, any>;
}): LongRunningOperation<T> {
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
});
}
};
}
Loading

0 comments on commit b7f81c6

Please sign in to comment.