Skip to content

Commit

Permalink
CodeGen from PR 31713 in Azure/azure-rest-api-specs
Browse files Browse the repository at this point in the history
Merge 2908f1b210e67dfed27b3670ff37244a6a567379 into 14c133b2ae3654b2b9f5ef20a711c8e66662ea3c
  • Loading branch information
SDKAuto committed Dec 6, 2024
1 parent 4aac125 commit da253cc
Show file tree
Hide file tree
Showing 38 changed files with 2,303 additions and 2,293 deletions.
3 changes: 2 additions & 1 deletion common/config/rush/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 6 additions & 9 deletions sdk/keyvault/arm-keyvault/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
# Release History

## 3.1.1 (Unreleased)

## 3.2.0 (2024-12-06)
### Features Added

### Breaking Changes

### Bugs Fixed

### Other Changes

- Enum KnownManagedHsmSkuFamily has a new value C


## 3.1.0 (2023-10-18)

### Features Added
Expand Down
2 changes: 1 addition & 1 deletion sdk/keyvault/arm-keyvault/LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2023 Microsoft
Copyright (c) 2024 Microsoft

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
1 change: 0 additions & 1 deletion sdk/keyvault/arm-keyvault/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ npm install @azure/identity
```

You will also need to **register a new AAD application and grant access to Azure KeyVaultManagement** 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://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal).

Expand Down
8 changes: 4 additions & 4 deletions sdk/keyvault/arm-keyvault/_meta.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"commit": "0a25ea9680cf080b7d34e8c5f35f564425c6b1f7",
"commit": "9e45e56832f5f45fdddcb649eba30b0026a3c7d9",
"readme": "specification/keyvault/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=D:\\Git\\azure-sdk-for-js ..\\azure-rest-api-specs\\specification\\keyvault\\resource-manager\\readme.md --use=@autorest/[email protected].11 --generate-sample=true",
"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/keyvault/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/[email protected].2",
"use": "@autorest/[email protected].11"
"release_tool": "@azure-tools/[email protected].16",
"use": "@autorest/typescript@^6.0.12"
}
67 changes: 30 additions & 37 deletions sdk/keyvault/arm-keyvault/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 KeyVaultManagementClient.",
"version": "3.1.1",
"version": "3.2.0",
"engines": {
"node": ">=18.0.0"
},
"dependencies": {
"@azure/abort-controller": "^1.0.0",
"@azure/core-auth": "^1.3.0",
"@azure/core-client": "^1.7.0",
"@azure/core-lro": "^2.5.4",
"@azure/abort-controller": "^2.1.2",
"@azure/core-paging": "^1.2.0",
"@azure/core-rest-pipeline": "^1.12.0",
"@azure/core-client": "^1.7.0",
"@azure/core-auth": "^1.6.0",
"@azure/core-rest-pipeline": "^1.14.0",
"tslib": "^2.2.0"
},
"keywords": [
Expand All @@ -28,18 +28,19 @@
"module": "./dist-esm/src/index.js",
"types": "./types/arm-keyvault.d.ts",
"devDependencies": {
"@azure-tools/test-credential": "^1.0.0",
"@azure-tools/test-recorder": "^3.0.0",
"typescript": "~5.6.2",
"dotenv": "^16.0.0",
"@azure/dev-tool": "^1.0.0",
"@azure/identity": "^4.0.1",
"@types/chai": "^4.2.8",
"@azure/identity": "^4.2.1",
"@azure-tools/test-recorder": "^3.0.0",
"@azure-tools/test-credential": "^1.1.0",
"mocha": "^10.0.0",
"@types/mocha": "^10.0.0",
"@types/node": "^18.0.0",
"tsx": "^4.7.1",
"@types/chai": "^4.2.8",
"chai": "^4.2.0",
"dotenv": "^16.0.0",
"mocha": "^10.0.0",
"ts-node": "^10.0.0",
"typescript": "~5.6.2"
"@types/node": "^18.0.0",
"ts-node": "^10.0.0"
},
"repository": {
"type": "git",
Expand Down Expand Up @@ -67,28 +68,28 @@
],
"scripts": {
"build": "npm run clean && tsc && dev-tool run bundle && npm run minify && dev-tool run vendored mkdirp ./review && npm run extract-api",
"build:browser": "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",
"prepack": "npm run build",
"pack": "npm pack 2>&1",
"extract-api": "dev-tool run extract-api",
"lint": "echo skipped",
"clean": "dev-tool run vendored rimraf --glob dist dist-browser dist-esm test-dist temp types *.tgz *.log",
"build:node": "echo skipped",
"build:samples": "echo skipped.",
"build:browser": "echo skipped",
"build:test": "echo skipped",
"build:samples": "echo skipped.",
"check-format": "echo skipped",
"clean": "dev-tool run vendored rimraf --glob dist dist-browser dist-esm test-dist temp types *.tgz *.log",
"execute:samples": "echo skipped",
"extract-api": "dev-tool run extract-api",
"format": "echo skipped",
"integration-test": "npm run integration-test:node && npm run integration-test:browser",
"integration-test:browser": "echo skipped",
"integration-test:node": "dev-tool run test:node-ts-input -- --timeout 1200000 'test/*.ts'",
"lint": "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",
"test:browser": "echo skipped",
"test:node": "echo skipped",
"test:browser": "echo skipped",
"unit-test": "npm run unit-test:node && npm run unit-test:browser",
"unit-test:browser": "echo skipped",
"unit-test:node": "dev-tool run vendored cross-env TEST_MODE=playback npm run integration-test:node",
"unit-test:browser": "echo skipped",
"integration-test": "npm run integration-test:node && npm run integration-test:browser",
"integration-test:node": "dev-tool run test:node-ts-input -- --timeout 1200000 'test/*.ts'",
"integration-test:browser": "echo skipped",
"update-snippets": "echo skipped"
},
"sideEffects": false,
Expand All @@ -101,13 +102,5 @@
]
},
"autoPublish": true,
"homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/keyvault/arm-keyvault",
"//sampleConfiguration": {
"productName": "",
"productSlugs": [
"azure"
],
"disableDocsMs": true,
"apiRefLink": "https://docs.microsoft.com/javascript/api/@azure/arm-keyvault?view=azure-node-preview"
}
}
"homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/keyvault/arm-keyvault"
}
6 changes: 4 additions & 2 deletions sdk/keyvault/arm-keyvault/review/arm-keyvault.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -455,7 +455,9 @@ export enum KnownKeyPermissions {
// @public
export enum KnownManagedHsmSkuFamily {
// (undocumented)
B = "B"
B = "B",
// (undocumented)
C = "C"
}

// @public
Expand Down Expand Up @@ -841,7 +843,7 @@ export interface ManagedHsmSku {
export type ManagedHsmSkuFamily = string;

// @public
export type ManagedHsmSkuName = "Standard_B1" | "Custom_B32" | "Custom_B6";
export type ManagedHsmSkuName = "Standard_B1" | "Custom_B32" | "Custom_B6" | "Custom_C42" | "Custom_C10";

// @public
export interface ManagedHsmsListByResourceGroupNextOptionalParams extends coreClient.OperationOptions {
Expand Down
5 changes: 1 addition & 4 deletions sdk/keyvault/arm-keyvault/sample.env
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
# App registration secret for AAD authentication
AZURE_CLIENT_SECRET=
AZURE_CLIENT_ID=
AZURE_TENANT_ID=
# Feel free to add your own environment variables.
40 changes: 20 additions & 20 deletions sdk/keyvault/arm-keyvault/src/keyVaultManagementClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import * as coreRestPipeline from "@azure/core-rest-pipeline";
import {
PipelineRequest,
PipelineResponse,
SendRequest
SendRequest,
} from "@azure/core-rest-pipeline";
import * as coreAuth from "@azure/core-auth";
import {
Expand All @@ -25,7 +25,7 @@ import {
MhsmPrivateLinkResourcesImpl,
MhsmRegionsImpl,
OperationsImpl,
SecretsImpl
SecretsImpl,
} from "./operations";
import {
Keys,
Expand All @@ -38,7 +38,7 @@ import {
MhsmPrivateLinkResources,
MhsmRegions,
Operations,
Secrets
Secrets,
} from "./operationsInterfaces";
import { KeyVaultManagementClientOptionalParams } from "./models";

Expand All @@ -57,7 +57,7 @@ export class KeyVaultManagementClient extends coreClient.ServiceClient {
constructor(
credentials: coreAuth.TokenCredential,
subscriptionId: string,
options?: KeyVaultManagementClientOptionalParams
options?: KeyVaultManagementClientOptionalParams,
) {
if (credentials === undefined) {
throw new Error("'credentials' cannot be null");
Expand All @@ -72,10 +72,10 @@ export class KeyVaultManagementClient extends coreClient.ServiceClient {
}
const defaults: KeyVaultManagementClientOptionalParams = {
requestContentType: "application/json; charset=utf-8",
credential: credentials
credential: credentials,
};

const packageDetails = `azsdk-js-arm-keyvault/3.1.1`;
const packageDetails = `azsdk-js-arm-keyvault/3.2.0`;
const userAgentPrefix =
options.userAgentOptions && options.userAgentOptions.userAgentPrefix
? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`
Expand All @@ -85,20 +85,21 @@ export class KeyVaultManagementClient 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 (
Expand All @@ -108,7 +109,7 @@ export class KeyVaultManagementClient extends coreClient.ServiceClient {
!bearerTokenAuthenticationPolicyFound
) {
this.pipeline.removePolicy({
name: coreRestPipeline.bearerTokenAuthenticationPolicyName
name: coreRestPipeline.bearerTokenAuthenticationPolicyName,
});
this.pipeline.addPolicy(
coreRestPipeline.bearerTokenAuthenticationPolicy({
Expand All @@ -118,26 +119,25 @@ export class KeyVaultManagementClient extends coreClient.ServiceClient {
`${optionsWithDefaults.endpoint}/.default`,
challengeCallbacks: {
authorizeRequestOnChallenge:
coreClient.authorizeRequestOnClaimChallenge
}
})
coreClient.authorizeRequestOnClaimChallenge,
},
}),
);
}
// Parameter assignments
this.subscriptionId = subscriptionId;

// Assigning values to Constant parameters
this.$host = options.$host || "https://management.azure.com";
this.apiVersion = options.apiVersion || "2023-07-01";
this.apiVersion = options.apiVersion || "2024-11-01";
this.keys = new KeysImpl(this);
this.managedHsmKeys = new ManagedHsmKeysImpl(this);
this.vaults = new VaultsImpl(this);
this.privateEndpointConnections = new PrivateEndpointConnectionsImpl(this);
this.privateLinkResources = new PrivateLinkResourcesImpl(this);
this.managedHsms = new ManagedHsmsImpl(this);
this.mhsmPrivateEndpointConnections = new MhsmPrivateEndpointConnectionsImpl(
this
);
this.mhsmPrivateEndpointConnections =
new MhsmPrivateEndpointConnectionsImpl(this);
this.mhsmPrivateLinkResources = new MhsmPrivateLinkResourcesImpl(this);
this.mhsmRegions = new MhsmRegionsImpl(this);
this.operations = new OperationsImpl(this);
Expand All @@ -154,7 +154,7 @@ export class KeyVaultManagementClient extends coreClient.ServiceClient {
name: "CustomApiVersionPolicy",
async sendRequest(
request: PipelineRequest,
next: SendRequest
next: SendRequest,
): Promise<PipelineResponse> {
const param = request.url.split("?");
if (param.length > 1) {
Expand All @@ -168,7 +168,7 @@ export class KeyVaultManagementClient extends coreClient.ServiceClient {
request.url = param[0] + "?" + newParams.join("&");
}
return next(request);
}
},
};
this.pipeline.addPolicy(apiVersionPolicy);
}
Expand Down
6 changes: 3 additions & 3 deletions sdk/keyvault/arm-keyvault/src/lroImpl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,15 @@ export function createLroSpec<T>(inputs: {
sendInitialRequest: () => sendOperationFn(args, spec),
sendPollRequest: (
path: string,
options?: { abortSignal?: AbortSignalLike }
options?: { abortSignal?: AbortSignalLike },
) => {
const { requestBody, ...restSpec } = spec;
return sendOperationFn(args, {
...restSpec,
httpMethod: "GET",
path,
abortSignal: options?.abortSignal
abortSignal: options?.abortSignal,
});
}
},
};
}
Loading

0 comments on commit da253cc

Please sign in to comment.