Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[AutoPR @azure/arm-quantum] Update quantum readme to adapt new autorest #8276

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
791 changes: 415 additions & 376 deletions common/config/rush/pnpm-lock.yaml

Large diffs are not rendered by default.

30 changes: 21 additions & 9 deletions sdk/quantum/arm-quantum/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,27 @@
# Release History

## 1.0.0-beta.2 (2024-01-30)

**Features**

## 1.0.0-beta.2 (Unreleased)
- Added operation Workspace.listKeys
- Added operation Workspace.regenerateKeys
- Added Interface ApiKey
- Added Interface APIKeys
- Added Interface ListKeysResult
- Added Interface WorkspaceListKeysOptionalParams
- Added Interface WorkspaceRegenerateKeysOptionalParams
- Added Type Alias KeyType_2
- Added Type Alias WorkspaceListKeysResponse
- Interface QuantumWorkspace has a new optional parameter apiKeyEnabled
- Interface Resource has a new optional parameter systemData
- Added Enum KnownKeyType

### Features Added

### Breaking Changes

### Bugs Fixed

### Other Changes
**Breaking Changes**

- Interface QuantumWorkspace no longer has parameter systemData


## 1.0.0-beta.1 (2023-07-10)

The package of @azure/arm-quantum is using our next generation design principles. To learn more, please refer to our documentation [Quick Start](https://aka.ms/azsdk/js/mgmt/quickstart ).
The package of @azure/arm-quantum is using our next generation design principles. To learn more, please refer to our documentation [Quick Start](https://aka.ms/js-track2-quickstart).
2 changes: 1 addition & 1 deletion sdk/quantum/arm-quantum/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
8 changes: 4 additions & 4 deletions sdk/quantum/arm-quantum/_meta.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"commit": "0f39a2d56070d2bc4251494525cb8af88583a938",
"commit": "2031e478699f008131cd4d77faa61eb81d449576",
"readme": "specification/quantum/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\\quantum\\resource-manager\\readme.md --use=@autorest/[email protected].5 --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/quantum/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].0",
"use": "@autorest/[email protected].5"
"release_tool": "@azure-tools/[email protected].4",
"use": "@autorest/typescript@^6.0.12"
}
27 changes: 10 additions & 17 deletions sdk/quantum/arm-quantum/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@
"node": ">=18.0.0"
},
"dependencies": {
"@azure/core-lro": "^2.5.3",
"@azure/core-lro": "^2.5.4",
"@azure/abort-controller": "^1.0.0",
"@azure/core-paging": "^1.2.0",
"@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 @@ -30,19 +30,21 @@
"devDependencies": {
"@microsoft/api-extractor": "^7.31.1",
"mkdirp": "^2.1.2",
"typescript": "~5.3.3",
"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"
},
"repository": {
Expand Down Expand Up @@ -76,8 +78,7 @@
"pack": "npm pack 2>&1",
"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,13 +106,5 @@
]
},
"autoPublish": true,
"homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/quantum/arm-quantum",
"//sampleConfiguration": {
"productName": "",
"productSlugs": [
"azure"
],
"disableDocsMs": true,
"apiRefLink": "https://docs.microsoft.com/javascript/api/@azure/arm-quantum?view=azure-node-preview"
}
}
"homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/quantum/arm-quantum"
}
46 changes: 45 additions & 1 deletion sdk/quantum/arm-quantum/review/arm-quantum.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,17 @@ import { OperationState } from '@azure/core-lro';
import { PagedAsyncIterableIterator } from '@azure/core-paging';
import { SimplePollerLike } from '@azure/core-lro';

// @public
export interface ApiKey {
createdAt?: Date;
readonly key?: string;
}

// @public
export interface APIKeys {
keys?: KeyType_2[];
}

// @public (undocumented)
export class AzureQuantumManagementClient extends coreClient.ServiceClient {
// (undocumented)
Expand Down Expand Up @@ -75,6 +86,10 @@ export interface ErrorResponse {
// @public
export function getContinuationToken(page: unknown): string | undefined;

// @public
type KeyType_2 = string;
export { KeyType_2 as KeyType }

// @public
export enum KnownCreatedByType {
Application = "Application",
Expand All @@ -83,6 +98,12 @@ export enum KnownCreatedByType {
User = "User"
}

// @public
export enum KnownKeyType {
Primary = "Primary",
Secondary = "Secondary"
}

// @public
export enum KnownProvisioningStatus {
Failed = "Failed",
Expand Down Expand Up @@ -116,6 +137,15 @@ export enum KnownUsableStatus {
Yes = "Yes"
}

// @public
export interface ListKeysResult {
apiKeyEnabled?: boolean;
readonly primaryConnectionString?: string;
primaryKey?: ApiKey;
readonly secondaryConnectionString?: string;
secondaryKey?: ApiKey;
}

// @public
export interface Offerings {
list(locationName: string, options?: OfferingsListOptionalParams): PagedAsyncIterableIterator<ProviderDescription>;
Expand Down Expand Up @@ -241,12 +271,12 @@ export type ProvisioningStatus = string;

// @public
export interface QuantumWorkspace extends TrackedResource {
apiKeyEnabled?: boolean;
readonly endpointUri?: string;
identity?: QuantumWorkspaceIdentity;
providers?: Provider[];
readonly provisioningState?: ProvisioningStatus;
storageAccount?: string;
readonly systemData?: SystemData;
readonly usable?: UsableStatus;
}

Expand All @@ -273,6 +303,7 @@ export interface QuotaDimension {
export interface Resource {
readonly id?: string;
readonly name?: string;
readonly systemData?: SystemData;
readonly type?: string;
}

Expand Down Expand Up @@ -335,6 +366,8 @@ export type UsableStatus = string;
// @public
export interface Workspace {
checkNameAvailability(locationName: string, checkNameAvailabilityParameters: CheckNameAvailabilityParameters, options?: WorkspaceCheckNameAvailabilityOptionalParams): Promise<WorkspaceCheckNameAvailabilityResponse>;
listKeys(resourceGroupName: string, workspaceName: string, options?: WorkspaceListKeysOptionalParams): Promise<WorkspaceListKeysResponse>;
regenerateKeys(resourceGroupName: string, workspaceName: string, keySpecification: APIKeys, options?: WorkspaceRegenerateKeysOptionalParams): Promise<void>;
}

// @public
Expand All @@ -344,12 +377,23 @@ export interface WorkspaceCheckNameAvailabilityOptionalParams extends coreClient
// @public
export type WorkspaceCheckNameAvailabilityResponse = CheckNameAvailabilityResult;

// @public
export interface WorkspaceListKeysOptionalParams extends coreClient.OperationOptions {
}

// @public
export type WorkspaceListKeysResponse = ListKeysResult;

// @public
export interface WorkspaceListResult {
nextLink?: string;
value?: QuantumWorkspace[];
}

// @public
export interface WorkspaceRegenerateKeysOptionalParams extends coreClient.OperationOptions {
}

// @public
export interface Workspaces {
beginCreateOrUpdate(resourceGroupName: string, workspaceName: string, quantumWorkspace: QuantumWorkspace, options?: WorkspacesCreateOrUpdateOptionalParams): Promise<SimplePollerLike<OperationState<WorkspacesCreateOrUpdateResponse>, WorkspacesCreateOrUpdateResponse>>;
Expand Down
35 changes: 18 additions & 17 deletions sdk/quantum/arm-quantum/src/azureQuantumManagementClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,20 @@ 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 {
WorkspacesImpl,
OfferingsImpl,
OperationsImpl,
WorkspaceImpl
WorkspaceImpl,
} from "./operations";
import {
Workspaces,
Offerings,
Operations,
Workspace
Workspace,
} from "./operationsInterfaces";
import { AzureQuantumManagementClientOptionalParams } from "./models";

Expand All @@ -36,13 +36,13 @@ export class AzureQuantumManagementClient extends coreClient.ServiceClient {
/**
* Initializes a new instance of the AzureQuantumManagementClient class.
* @param credentials Subscription credentials which uniquely identify client subscription.
* @param subscriptionId The Azure subscription ID.
* @param subscriptionId The ID of the target subscription. The value must be an UUID.
* @param options The parameter options
*/
constructor(
credentials: coreAuth.TokenCredential,
subscriptionId: string,
options?: AzureQuantumManagementClientOptionalParams
options?: AzureQuantumManagementClientOptionalParams,
) {
if (credentials === undefined) {
throw new Error("'credentials' cannot be null");
Expand All @@ -57,7 +57,7 @@ export class AzureQuantumManagementClient extends coreClient.ServiceClient {
}
const defaults: AzureQuantumManagementClientOptionalParams = {
requestContentType: "application/json; charset=utf-8",
credential: credentials
credential: credentials,
};

const packageDetails = `azsdk-js-arm-quantum/1.0.0-beta.2`;
Expand All @@ -70,20 +70,21 @@ export class AzureQuantumManagementClient 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 @@ -93,7 +94,7 @@ export class AzureQuantumManagementClient extends coreClient.ServiceClient {
!bearerTokenAuthenticationPolicyFound
) {
this.pipeline.removePolicy({
name: coreRestPipeline.bearerTokenAuthenticationPolicyName
name: coreRestPipeline.bearerTokenAuthenticationPolicyName,
});
this.pipeline.addPolicy(
coreRestPipeline.bearerTokenAuthenticationPolicy({
Expand All @@ -103,17 +104,17 @@ export class AzureQuantumManagementClient 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 || "2022-01-10-preview";
this.apiVersion = options.apiVersion || "2023-11-13-preview";
this.workspaces = new WorkspacesImpl(this);
this.offerings = new OfferingsImpl(this);
this.operations = new OperationsImpl(this);
Expand All @@ -130,7 +131,7 @@ export class AzureQuantumManagementClient 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 @@ -144,7 +145,7 @@ export class AzureQuantumManagementClient 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/quantum/arm-quantum/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
Loading