From 2ae30272158cfb6172345b32838c319ea344e6f1 Mon Sep 17 00:00:00 2001 From: Sarangan Rajamanickam Date: Fri, 22 Jan 2021 09:31:15 -0800 Subject: [PATCH 01/15] Configuration file for Quantum SDK --- sdk/quantum/quantum/swagger/readme.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 sdk/quantum/quantum/swagger/readme.md diff --git a/sdk/quantum/quantum/swagger/readme.md b/sdk/quantum/quantum/swagger/readme.md new file mode 100644 index 000000000000..030559f6d552 --- /dev/null +++ b/sdk/quantum/quantum/swagger/readme.md @@ -0,0 +1,19 @@ +# Azure Quantum SDK + +> see https://aka.ms/autorest + +## Configuration + +```yaml +package-name: "@azure/quantum" +generate-metadata: true +license-header: MICROSOFT_MIT_NO_VERSION +output-folder: ../ +source-code-folder-path: ./src/ +input-file: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/master/specification/quantum/data-plane/Microsoft.Quantum/preview/2019-11-04-preview/quantum.json +add-credentials: false +title: QuantumClient +v3: true +use-extension: + "@autorest/typescript": "6.0.0-dev.20210121.2" +``` From a59629487b4d67ad1b08aeb410ac1f886614dcc3 Mon Sep 17 00:00:00 2001 From: Sarangan Rajamanickam Date: Fri, 22 Jan 2021 09:32:46 -0800 Subject: [PATCH 02/15] Generated Code --- sdk/quantum/quantum/LICENSE.txt | 21 + sdk/quantum/quantum/README.md | 27 ++ sdk/quantum/quantum/api-extractor.json | 18 + sdk/quantum/quantum/package.json | 53 +++ sdk/quantum/quantum/rollup.config.js | 36 ++ sdk/quantum/quantum/src/index.ts | 12 + sdk/quantum/quantum/src/models/index.ts | 393 ++++++++++++++++ sdk/quantum/quantum/src/models/mappers.ts | 422 ++++++++++++++++++ sdk/quantum/quantum/src/models/parameters.ts | 115 +++++ sdk/quantum/quantum/src/operations/index.ts | 12 + sdk/quantum/quantum/src/operations/jobs.ts | 278 ++++++++++++ .../quantum/src/operations/providers.ts | 153 +++++++ sdk/quantum/quantum/src/operations/quotas.ts | 149 +++++++ sdk/quantum/quantum/src/operations/storage.ts | 72 +++ sdk/quantum/quantum/src/quantumClient.ts | 39 ++ .../quantum/src/quantumClientContext.ts | 69 +++ sdk/quantum/quantum/tsconfig.json | 20 + 17 files changed, 1889 insertions(+) create mode 100644 sdk/quantum/quantum/LICENSE.txt create mode 100644 sdk/quantum/quantum/README.md create mode 100644 sdk/quantum/quantum/api-extractor.json create mode 100644 sdk/quantum/quantum/package.json create mode 100644 sdk/quantum/quantum/rollup.config.js create mode 100644 sdk/quantum/quantum/src/index.ts create mode 100644 sdk/quantum/quantum/src/models/index.ts create mode 100644 sdk/quantum/quantum/src/models/mappers.ts create mode 100644 sdk/quantum/quantum/src/models/parameters.ts create mode 100644 sdk/quantum/quantum/src/operations/index.ts create mode 100644 sdk/quantum/quantum/src/operations/jobs.ts create mode 100644 sdk/quantum/quantum/src/operations/providers.ts create mode 100644 sdk/quantum/quantum/src/operations/quotas.ts create mode 100644 sdk/quantum/quantum/src/operations/storage.ts create mode 100644 sdk/quantum/quantum/src/quantumClient.ts create mode 100644 sdk/quantum/quantum/src/quantumClientContext.ts create mode 100644 sdk/quantum/quantum/tsconfig.json diff --git a/sdk/quantum/quantum/LICENSE.txt b/sdk/quantum/quantum/LICENSE.txt new file mode 100644 index 000000000000..ccb63b166732 --- /dev/null +++ b/sdk/quantum/quantum/LICENSE.txt @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2021 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 +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +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. \ No newline at end of file diff --git a/sdk/quantum/quantum/README.md b/sdk/quantum/quantum/README.md new file mode 100644 index 000000000000..6e22a9d3b485 --- /dev/null +++ b/sdk/quantum/quantum/README.md @@ -0,0 +1,27 @@ +## Azure QuantumClient SDK for JavaScript + +This package contains an isomorphic SDK for QuantumClient. + +### Currently supported environments + +- Node.js version 8.x.x or higher +- Browser JavaScript + +### How to Install + +```bash +npm install @azure/quantum +``` + +### How to use + +#### Sample code + +Refer the sample code in the [azure-sdk-for-js/samples](https://github.com/Azure/azure-sdk-for-js/tree/master/samples) folder. + +## Related projects + +- [Microsoft Azure SDK for Javascript](https://github.com/Azure/azure-sdk-for-js) + + +![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Fcdn%2Farm-cdn%2FREADME.png) \ No newline at end of file diff --git a/sdk/quantum/quantum/api-extractor.json b/sdk/quantum/quantum/api-extractor.json new file mode 100644 index 000000000000..5fb5b21b56f2 --- /dev/null +++ b/sdk/quantum/quantum/api-extractor.json @@ -0,0 +1,18 @@ +{ + "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", + "mainEntryPointFilePath": "./esm/index.d.ts", + "docModel": { "enabled": true }, + "apiReport": { "enabled": true, "reportFolder": "./review" }, + "dtsRollup": { + "enabled": true, + "untrimmedFilePath": "", + "publicTrimmedFilePath": "./esm/index.d.ts" + }, + "messages": { + "tsdocMessageReporting": { "default": { "logLevel": "none" } }, + "extractorMessageReporting": { + "ae-missing-release-tag": { "logLevel": "none" }, + "ae-unresolved-link": { "logLevel": "none" } + } + } +} diff --git a/sdk/quantum/quantum/package.json b/sdk/quantum/quantum/package.json new file mode 100644 index 000000000000..341f5b1b6ed1 --- /dev/null +++ b/sdk/quantum/quantum/package.json @@ -0,0 +1,53 @@ +{ + "name": "@azure/quantum", + "author": "Microsoft Corporation", + "description": "Azure Quantum REST API client", + "version": "1.0.0-beta.1", + "dependencies": { + "@azure/core-paging": "^1.1.1", + "@azure/core-http": "^1.2.0", + "tslib": "^2.0.0" + }, + "keywords": ["node", "azure", "typescript", "browser", "isomorphic"], + "license": "MIT", + "main": "./dist/quantum.js", + "module": "./esm/index.js", + "types": "./esm/index.d.ts", + "devDependencies": { + "typescript": "4.1.2", + "rollup": "^1.16.3", + "rollup-plugin-node-resolve": "^3.4.0", + "rollup-plugin-sourcemaps": "^0.4.2", + "uglify-js": "^3.4.9", + "@microsoft/api-extractor": "7.7.11", + "mkdirp": "^1.0.4" + }, + "homepage": "https://github.com/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" }, + "files": [ + "dist/**/*.js", + "dist/**/*.js.map", + "dist/**/*.d.ts", + "dist/**/*.d.ts.map", + "esm/**/*.js", + "esm/**/*.js.map", + "esm/**/*.d.ts", + "esm/**/*.d.ts.map", + "./src//**/*.ts", + "README.md", + "rollup.config.js", + "tsconfig.json" + ], + "scripts": { + "build": "tsc && rollup -c rollup.config.js && npm run minify && mkdirp ./review && npm run extract-api", + "minify": "uglifyjs -c -m --comments --source-map \"content='./dist/quantum.js.map'\" -o ./dist/quantum.min.js ./dist/quantum.js", + "prepack": "npm install && npm run build", + "extract-api": "api-extractor run --local" + }, + "sideEffects": false, + "autoPublish": true +} diff --git a/sdk/quantum/quantum/rollup.config.js b/sdk/quantum/quantum/rollup.config.js new file mode 100644 index 000000000000..afd141f56bb5 --- /dev/null +++ b/sdk/quantum/quantum/rollup.config.js @@ -0,0 +1,36 @@ +/* + * 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 rollup from "rollup"; +import nodeResolve from "rollup-plugin-node-resolve"; +import sourcemaps from "rollup-plugin-sourcemaps"; + +/** @type {rollup.RollupFileOptions} */ +const config = { + input: "./esm/quantumClient.js", + external: ["@azure/core-http"], + output: { + file: "./dist/quantum.js", + format: "umd", + name: "Azure.Quantum", + sourcemap: true, + globals: { + "@azure/core-http": "coreHttp" + }, + banner: `/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ ` + }, + plugins: [nodeResolve({ module: true }), sourcemaps()] +}; + +export default config; diff --git a/sdk/quantum/quantum/src/index.ts b/sdk/quantum/quantum/src/index.ts new file mode 100644 index 000000000000..d33f9aebee8f --- /dev/null +++ b/sdk/quantum/quantum/src/index.ts @@ -0,0 +1,12 @@ +/* + * 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. + */ + +/// +export * from "./models"; +export { QuantumClient } from "./quantumClient"; +export { QuantumClientContext } from "./quantumClientContext"; diff --git a/sdk/quantum/quantum/src/models/index.ts b/sdk/quantum/quantum/src/models/index.ts new file mode 100644 index 000000000000..8856ecfcbcee --- /dev/null +++ b/sdk/quantum/quantum/src/models/index.ts @@ -0,0 +1,393 @@ +/* + * 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 * as coreHttp from "@azure/core-http"; + +/** List of job details. */ +export interface JobDetailsList { + /** NOTE: This property will not be serialized. It can only be populated by the server. */ + readonly value?: JobDetails[]; + /** Total records count number. */ + count?: number; + /** + * Link to the next page of results. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly nextLink?: string; +} + +/** Job details. */ +export interface JobDetails { + /** The job id. */ + id?: string; + /** The job name. Is not required for the name to be unique and it's only used for display purposes. */ + name?: string; + /** The blob container SAS uri, the container is used to host job data. */ + containerUri: string; + /** The input blob SAS uri, if specified, it will override the default input blob in the container. */ + inputDataUri?: string; + /** The format of the input data. */ + inputDataFormat: string; + /** The input parameters for the job. JSON object used by the target solver. It is expected that the size of this object is small and only used to specify parameters for the execution target, not the input data. */ + inputParams?: any; + /** The unique identifier for the provider. */ + providerId: string; + /** The target identifier to run the job. */ + target: string; + /** The job metadata. Metadata provides client the ability to store client-specific information */ + metadata?: { [propertyName: string]: string }; + /** The output blob SAS uri. When a job finishes successfully, results will be uploaded to this blob. */ + outputDataUri?: string; + /** The format of the output data. */ + outputDataFormat?: string; + /** + * The job status. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly status?: JobStatus; + /** + * The creation time of the job. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly creationTime?: Date; + /** + * The time when the job began execution. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly beginExecutionTime?: Date; + /** + * The time when the job finished execution. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly endExecutionTime?: Date; + /** + * The time when a job was successfully cancelled. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly cancellationTime?: Date; + /** + * The error data for the job. This is expected only when Status 'Failed'. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly errorData?: ErrorData; +} + +/** An error response from Azure. */ +export interface ErrorData { + /** An identifier for the error. Codes are invariant and are intended to be consumed programmatically. */ + code?: string; + /** A message describing the error, intended to be suitable for displaying in a user interface. */ + message?: string; +} + +/** Error information returned by the API */ +export interface RestError { + /** An error response from Azure. */ + error?: ErrorData; +} + +/** Providers status. */ +export interface ProviderStatusList { + /** NOTE: This property will not be serialized. It can only be populated by the server. */ + readonly value?: ProviderStatus[]; + /** + * Link to the next page of results. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly nextLink?: string; +} + +/** Providers status. */ +export interface ProviderStatus { + /** + * Provider id. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly id?: string; + /** + * Provider availability. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly currentAvailability?: ProviderAvailability; + /** NOTE: This property will not be serialized. It can only be populated by the server. */ + readonly targets?: TargetStatus[]; +} + +/** Target status. */ +export interface TargetStatus { + /** + * Target id. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly id?: string; + /** + * Target availability. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly currentAvailability?: TargetAvailability; + /** + * Average queue time in seconds. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly averageQueueTime?: number; + /** + * A page with detailed status of the provider. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly statusPage?: string; +} + +/** Blob details. */ +export interface BlobDetails { + /** The container name. */ + containerName: string; + /** The blob name. */ + blobName?: string; +} + +/** Get SAS URL operation response. */ +export interface SasUriResponse { + /** A URL with a SAS token to upload a blob for execution in the given workspace. */ + sasUri?: string; +} + +/** List of quotas. */ +export interface QuotaList { + /** NOTE: This property will not be serialized. It can only be populated by the server. */ + readonly value?: Quota[]; + /** + * Link to the next page of results. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly nextLink?: string; +} + +/** Quota information. */ +export interface Quota { + /** The name of the dimension associated with the quota. */ + dimension?: string; + /** The scope at which the quota is applied. */ + scope?: DimensionScope; + /** The unique identifier for the provider. */ + providerId?: string; + /** The amount of the usage that has been applied for the current period. */ + utilization?: number; + /** The amount of the usage that has been reserved but not applied for the current period. */ + holds?: number; + /** The maximum amount of usage allowed for the current period. */ + limit?: number; + /** The time period in which the quota's underlying meter is accumulated. Based on calendar year. 'None' is used for concurrent quotas. */ + period?: MeterPeriod; +} + +/** Known values of {@link JobStatus} that the service accepts. */ +export const enum KnownJobStatus { + Waiting = "Waiting", + Executing = "Executing", + Succeeded = "Succeeded", + Failed = "Failed", + Cancelled = "Cancelled" +} + +/** + * Defines values for JobStatus. \ + * {@link KnownJobStatus} can be used interchangeably with JobStatus, + * this enum contains the known values that the service supports. + * ### Know values supported by the service + * **Waiting** \ + * **Executing** \ + * **Succeeded** \ + * **Failed** \ + * **Cancelled** + */ +export type JobStatus = string; + +/** Known values of {@link ProviderAvailability} that the service accepts. */ +export const enum KnownProviderAvailability { + Available = "Available", + Degraded = "Degraded", + Unavailable = "Unavailable" +} + +/** + * Defines values for ProviderAvailability. \ + * {@link KnownProviderAvailability} can be used interchangeably with ProviderAvailability, + * this enum contains the known values that the service supports. + * ### Know values supported by the service + * **Available** \ + * **Degraded** \ + * **Unavailable** + */ +export type ProviderAvailability = string; + +/** Known values of {@link TargetAvailability} that the service accepts. */ +export const enum KnownTargetAvailability { + Available = "Available", + Degraded = "Degraded", + Unavailable = "Unavailable" +} + +/** + * Defines values for TargetAvailability. \ + * {@link KnownTargetAvailability} can be used interchangeably with TargetAvailability, + * this enum contains the known values that the service supports. + * ### Know values supported by the service + * **Available** \ + * **Degraded** \ + * **Unavailable** + */ +export type TargetAvailability = string; + +/** Known values of {@link DimensionScope} that the service accepts. */ +export const enum KnownDimensionScope { + Workspace = "Workspace", + Subscription = "Subscription" +} + +/** + * Defines values for DimensionScope. \ + * {@link KnownDimensionScope} can be used interchangeably with DimensionScope, + * this enum contains the known values that the service supports. + * ### Know values supported by the service + * **Workspace** \ + * **Subscription** + */ +export type DimensionScope = string; + +/** Known values of {@link MeterPeriod} that the service accepts. */ +export const enum KnownMeterPeriod { + None = "None", + Monthly = "Monthly" +} + +/** + * Defines values for MeterPeriod. \ + * {@link KnownMeterPeriod} can be used interchangeably with MeterPeriod, + * this enum contains the known values that the service supports. + * ### Know values supported by the service + * **None** \ + * **Monthly** + */ +export type MeterPeriod = string; + +/** Contains response data for the list operation. */ +export type JobsListResponse = JobDetailsList & { + /** The underlying HTTP response. */ + _response: coreHttp.HttpResponse & { + /** The response body as text (string format) */ + bodyAsText: string; + + /** The response body as parsed JSON or XML */ + parsedBody: JobDetailsList; + }; +}; + +/** Contains response data for the get operation. */ +export type JobsGetResponse = JobDetails & { + /** The underlying HTTP response. */ + _response: coreHttp.HttpResponse & { + /** The response body as text (string format) */ + bodyAsText: string; + + /** The response body as parsed JSON or XML */ + parsedBody: JobDetails; + }; +}; + +/** Contains response data for the create operation. */ +export type JobsCreateResponse = JobDetails & { + /** The underlying HTTP response. */ + _response: coreHttp.HttpResponse & { + /** The response body as text (string format) */ + bodyAsText: string; + + /** The response body as parsed JSON or XML */ + parsedBody: JobDetails; + }; +}; + +/** Contains response data for the listNext operation. */ +export type JobsListNextResponse = JobDetailsList & { + /** The underlying HTTP response. */ + _response: coreHttp.HttpResponse & { + /** The response body as text (string format) */ + bodyAsText: string; + + /** The response body as parsed JSON or XML */ + parsedBody: JobDetailsList; + }; +}; + +/** Contains response data for the getStatus operation. */ +export type ProvidersGetStatusResponse = ProviderStatusList & { + /** The underlying HTTP response. */ + _response: coreHttp.HttpResponse & { + /** The response body as text (string format) */ + bodyAsText: string; + + /** The response body as parsed JSON or XML */ + parsedBody: ProviderStatusList; + }; +}; + +/** Contains response data for the getStatusNext operation. */ +export type ProvidersGetStatusNextResponse = ProviderStatusList & { + /** The underlying HTTP response. */ + _response: coreHttp.HttpResponse & { + /** The response body as text (string format) */ + bodyAsText: string; + + /** The response body as parsed JSON or XML */ + parsedBody: ProviderStatusList; + }; +}; + +/** Contains response data for the sasUri operation. */ +export type StorageSasUriResponse = SasUriResponse & { + /** The underlying HTTP response. */ + _response: coreHttp.HttpResponse & { + /** The response body as text (string format) */ + bodyAsText: string; + + /** The response body as parsed JSON or XML */ + parsedBody: SasUriResponse; + }; +}; + +/** Contains response data for the list operation. */ +export type QuotasListResponse = QuotaList & { + /** The underlying HTTP response. */ + _response: coreHttp.HttpResponse & { + /** The response body as text (string format) */ + bodyAsText: string; + + /** The response body as parsed JSON or XML */ + parsedBody: QuotaList; + }; +}; + +/** Contains response data for the listNext operation. */ +export type QuotasListNextResponse = QuotaList & { + /** The underlying HTTP response. */ + _response: coreHttp.HttpResponse & { + /** The response body as text (string format) */ + bodyAsText: string; + + /** The response body as parsed JSON or XML */ + parsedBody: QuotaList; + }; +}; + +/** Optional parameters. */ +export interface QuantumClientOptionalParams + extends coreHttp.ServiceClientOptions { + /** server parameter */ + $host?: string; + /** Overrides client endpoint. */ + endpoint?: string; +} diff --git a/sdk/quantum/quantum/src/models/mappers.ts b/sdk/quantum/quantum/src/models/mappers.ts new file mode 100644 index 000000000000..e92c94c4dee0 --- /dev/null +++ b/sdk/quantum/quantum/src/models/mappers.ts @@ -0,0 +1,422 @@ +/* + * 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 * as coreHttp from "@azure/core-http"; + +export const JobDetailsList: coreHttp.CompositeMapper = { + type: { + name: "Composite", + className: "JobDetailsList", + modelProperties: { + value: { + serializedName: "value", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "JobDetails" + } + } + } + }, + count: { + serializedName: "count", + type: { + name: "Number" + } + }, + nextLink: { + serializedName: "nextLink", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const JobDetails: coreHttp.CompositeMapper = { + type: { + name: "Composite", + className: "JobDetails", + modelProperties: { + id: { + serializedName: "id", + type: { + name: "String" + } + }, + name: { + serializedName: "name", + type: { + name: "String" + } + }, + containerUri: { + serializedName: "containerUri", + required: true, + type: { + name: "String" + } + }, + inputDataUri: { + serializedName: "inputDataUri", + type: { + name: "String" + } + }, + inputDataFormat: { + serializedName: "inputDataFormat", + required: true, + type: { + name: "String" + } + }, + inputParams: { + serializedName: "inputParams", + type: { + name: "any" + } + }, + providerId: { + serializedName: "providerId", + required: true, + type: { + name: "String" + } + }, + target: { + serializedName: "target", + required: true, + type: { + name: "String" + } + }, + metadata: { + serializedName: "metadata", + type: { + name: "Dictionary", + value: { type: { name: "String" } } + } + }, + outputDataUri: { + serializedName: "outputDataUri", + type: { + name: "String" + } + }, + outputDataFormat: { + serializedName: "outputDataFormat", + type: { + name: "String" + } + }, + status: { + serializedName: "status", + readOnly: true, + type: { + name: "String" + } + }, + creationTime: { + serializedName: "creationTime", + readOnly: true, + type: { + name: "DateTime" + } + }, + beginExecutionTime: { + serializedName: "beginExecutionTime", + readOnly: true, + type: { + name: "DateTime" + } + }, + endExecutionTime: { + serializedName: "endExecutionTime", + readOnly: true, + type: { + name: "DateTime" + } + }, + cancellationTime: { + serializedName: "cancellationTime", + readOnly: true, + type: { + name: "DateTime" + } + }, + errorData: { + serializedName: "errorData", + type: { + name: "Composite", + className: "ErrorData" + } + } + } + } +}; + +export const ErrorData: coreHttp.CompositeMapper = { + type: { + name: "Composite", + className: "ErrorData", + modelProperties: { + code: { + serializedName: "code", + type: { + name: "String" + } + }, + message: { + serializedName: "message", + type: { + name: "String" + } + } + } + } +}; + +export const RestError: coreHttp.CompositeMapper = { + type: { + name: "Composite", + className: "RestError", + modelProperties: { + error: { + serializedName: "error", + type: { + name: "Composite", + className: "ErrorData" + } + } + } + } +}; + +export const ProviderStatusList: coreHttp.CompositeMapper = { + type: { + name: "Composite", + className: "ProviderStatusList", + modelProperties: { + value: { + serializedName: "value", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ProviderStatus" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const ProviderStatus: coreHttp.CompositeMapper = { + type: { + name: "Composite", + className: "ProviderStatus", + modelProperties: { + id: { + serializedName: "id", + readOnly: true, + type: { + name: "String" + } + }, + currentAvailability: { + serializedName: "currentAvailability", + readOnly: true, + type: { + name: "String" + } + }, + targets: { + serializedName: "targets", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "TargetStatus" + } + } + } + } + } + } +}; + +export const TargetStatus: coreHttp.CompositeMapper = { + type: { + name: "Composite", + className: "TargetStatus", + modelProperties: { + id: { + serializedName: "id", + readOnly: true, + type: { + name: "String" + } + }, + currentAvailability: { + serializedName: "currentAvailability", + readOnly: true, + type: { + name: "String" + } + }, + averageQueueTime: { + serializedName: "averageQueueTime", + readOnly: true, + type: { + name: "Number" + } + }, + statusPage: { + serializedName: "statusPage", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const BlobDetails: coreHttp.CompositeMapper = { + type: { + name: "Composite", + className: "BlobDetails", + modelProperties: { + containerName: { + serializedName: "containerName", + required: true, + type: { + name: "String" + } + }, + blobName: { + serializedName: "blobName", + type: { + name: "String" + } + } + } + } +}; + +export const SasUriResponse: coreHttp.CompositeMapper = { + type: { + name: "Composite", + className: "SasUriResponse", + modelProperties: { + sasUri: { + serializedName: "sasUri", + type: { + name: "String" + } + } + } + } +}; + +export const QuotaList: coreHttp.CompositeMapper = { + type: { + name: "Composite", + className: "QuotaList", + modelProperties: { + value: { + serializedName: "value", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Quota" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const Quota: coreHttp.CompositeMapper = { + type: { + name: "Composite", + className: "Quota", + modelProperties: { + dimension: { + serializedName: "dimension", + type: { + name: "String" + } + }, + scope: { + serializedName: "scope", + type: { + name: "String" + } + }, + providerId: { + serializedName: "providerId", + type: { + name: "String" + } + }, + utilization: { + serializedName: "utilization", + type: { + name: "Number" + } + }, + holds: { + serializedName: "holds", + type: { + name: "Number" + } + }, + limit: { + serializedName: "limit", + type: { + name: "Number" + } + }, + period: { + serializedName: "period", + type: { + name: "String" + } + } + } + } +}; diff --git a/sdk/quantum/quantum/src/models/parameters.ts b/sdk/quantum/quantum/src/models/parameters.ts new file mode 100644 index 000000000000..030f9eba07db --- /dev/null +++ b/sdk/quantum/quantum/src/models/parameters.ts @@ -0,0 +1,115 @@ +/* + * 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 { OperationParameter, OperationURLParameter } from "@azure/core-http"; +import { + JobDetails as JobDetailsMapper, + BlobDetails as BlobDetailsMapper +} from "../models/mappers"; + +export const accept: OperationParameter = { + parameterPath: "accept", + mapper: { + defaultValue: "application/json", + isConstant: true, + serializedName: "Accept", + type: { + name: "String" + } + } +}; + +export const $host: OperationURLParameter = { + parameterPath: "$host", + mapper: { + serializedName: "$host", + required: true, + type: { + name: "String" + } + }, + skipEncoding: true +}; + +export const subscriptionId: OperationURLParameter = { + parameterPath: "subscriptionId", + mapper: { + serializedName: "subscriptionId", + required: true, + type: { + name: "String" + } + } +}; + +export const resourceGroupName: OperationURLParameter = { + parameterPath: "resourceGroupName", + mapper: { + serializedName: "resourceGroupName", + required: true, + type: { + name: "String" + } + } +}; + +export const workspaceName: OperationURLParameter = { + parameterPath: "workspaceName", + mapper: { + serializedName: "workspaceName", + required: true, + type: { + name: "String" + } + } +}; + +export const jobId: OperationURLParameter = { + parameterPath: "jobId", + mapper: { + serializedName: "jobId", + required: true, + type: { + name: "String" + } + } +}; + +export const contentType: OperationParameter = { + parameterPath: ["options", "contentType"], + mapper: { + defaultValue: "application/json", + isConstant: true, + serializedName: "Content-Type", + type: { + name: "String" + } + } +}; + +export const job: OperationParameter = { + parameterPath: "job", + mapper: JobDetailsMapper +}; + +export const nextLink: OperationURLParameter = { + parameterPath: "nextLink", + mapper: { + serializedName: "nextLink", + required: true, + type: { + name: "String" + } + }, + skipEncoding: true +}; + +export const blobDetails: OperationParameter = { + parameterPath: "blobDetails", + mapper: BlobDetailsMapper +}; diff --git a/sdk/quantum/quantum/src/operations/index.ts b/sdk/quantum/quantum/src/operations/index.ts new file mode 100644 index 000000000000..8b016cdcb134 --- /dev/null +++ b/sdk/quantum/quantum/src/operations/index.ts @@ -0,0 +1,12 @@ +/* + * 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. + */ + +export * from "./jobs"; +export * from "./providers"; +export * from "./storage"; +export * from "./quotas"; diff --git a/sdk/quantum/quantum/src/operations/jobs.ts b/sdk/quantum/quantum/src/operations/jobs.ts new file mode 100644 index 000000000000..341e1627d90b --- /dev/null +++ b/sdk/quantum/quantum/src/operations/jobs.ts @@ -0,0 +1,278 @@ +/* + * 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 * as coreHttp from "@azure/core-http"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { QuantumClient } from "../quantumClient"; +import { + JobDetails, + JobsListResponse, + JobsGetResponse, + JobsCreateResponse, + JobsListNextResponse +} from "../models"; + +/** Class representing a Jobs. */ +export class Jobs { + private readonly client: QuantumClient; + + /** + * Initialize a new instance of the class Jobs class. + * @param client Reference to the service client + */ + constructor(client: QuantumClient) { + this.client = client; + } + + /** + * List jobs. + * @param options The options parameters. + */ + public list( + options?: coreHttp.OperationOptions + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll(options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listPagingPage(options); + } + }; + } + + private async *listPagingPage( + options?: coreHttp.OperationOptions + ): AsyncIterableIterator { + let result = await this._list(options); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listNext(continuationToken, options); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listPagingAll( + options?: coreHttp.OperationOptions + ): AsyncIterableIterator { + for await (const page of this.listPagingPage(options)) { + yield* page; + } + } + + /** + * List jobs. + * @param options The options parameters. + */ + private _list( + options?: coreHttp.OperationOptions + ): Promise { + const operationArguments: coreHttp.OperationArguments = { + options: coreHttp.operationOptionsToRequestOptionsBase(options || {}) + }; + return this.client.sendOperationRequest( + operationArguments, + listOperationSpec + ) as Promise; + } + + /** + * Get job by id + * @param jobId Id of the job. + * @param options The options parameters. + */ + get( + jobId: string, + options?: coreHttp.OperationOptions + ): Promise { + const operationArguments: coreHttp.OperationArguments = { + jobId, + options: coreHttp.operationOptionsToRequestOptionsBase(options || {}) + }; + return this.client.sendOperationRequest( + operationArguments, + getOperationSpec + ) as Promise; + } + + /** + * Create a job. + * @param jobId Id of the job. + * @param job The complete metadata of the job to submit. + * @param options The options parameters. + */ + create( + jobId: string, + job: JobDetails, + options?: coreHttp.OperationOptions + ): Promise { + const operationArguments: coreHttp.OperationArguments = { + jobId, + job, + options: coreHttp.operationOptionsToRequestOptionsBase(options || {}) + }; + return this.client.sendOperationRequest( + operationArguments, + createOperationSpec + ) as Promise; + } + + /** + * Cancel a job. + * @param jobId Id of the job. + * @param options The options parameters. + */ + cancel( + jobId: string, + options?: coreHttp.OperationOptions + ): Promise { + const operationArguments: coreHttp.OperationArguments = { + jobId, + options: coreHttp.operationOptionsToRequestOptionsBase(options || {}) + }; + return this.client.sendOperationRequest( + operationArguments, + cancelOperationSpec + ) as Promise; + } + + /** + * ListNext + * @param nextLink The nextLink from the previous successful call to the List method. + * @param options The options parameters. + */ + private _listNext( + nextLink: string, + options?: coreHttp.OperationOptions + ): Promise { + const operationArguments: coreHttp.OperationArguments = { + nextLink, + options: coreHttp.operationOptionsToRequestOptionsBase(options || {}) + }; + return this.client.sendOperationRequest( + operationArguments, + listNextOperationSpec + ) as Promise; + } +} +// Operation Specifications +const serializer = new coreHttp.Serializer(Mappers, /* isXml */ false); + +const listOperationSpec: coreHttp.OperationSpec = { + path: + "/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Quantum/workspaces/{workspaceName}/jobs", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.JobDetailsList + } + }, + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.workspaceName + ], + headerParameters: [Parameters.accept], + serializer +}; +const getOperationSpec: coreHttp.OperationSpec = { + path: + "/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Quantum/workspaces/{workspaceName}/jobs/{jobId}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.JobDetails + }, + default: { + bodyMapper: Mappers.RestError + } + }, + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.workspaceName, + Parameters.jobId + ], + headerParameters: [Parameters.accept], + serializer +}; +const createOperationSpec: coreHttp.OperationSpec = { + path: + "/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Quantum/workspaces/{workspaceName}/jobs/{jobId}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.JobDetails + }, + 201: { + bodyMapper: Mappers.JobDetails + }, + default: { + bodyMapper: Mappers.RestError + } + }, + requestBody: Parameters.job, + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.workspaceName, + Parameters.jobId + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const cancelOperationSpec: coreHttp.OperationSpec = { + path: + "/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Quantum/workspaces/{workspaceName}/jobs/{jobId}", + httpMethod: "DELETE", + responses: { + 204: {}, + default: { + bodyMapper: Mappers.RestError + } + }, + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.workspaceName, + Parameters.jobId + ], + headerParameters: [Parameters.accept], + serializer +}; +const listNextOperationSpec: coreHttp.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.JobDetailsList + } + }, + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.workspaceName, + Parameters.nextLink + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/quantum/quantum/src/operations/providers.ts b/sdk/quantum/quantum/src/operations/providers.ts new file mode 100644 index 000000000000..6cc75ca016b9 --- /dev/null +++ b/sdk/quantum/quantum/src/operations/providers.ts @@ -0,0 +1,153 @@ +/* + * 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 * as coreHttp from "@azure/core-http"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { QuantumClient } from "../quantumClient"; +import { + ProviderStatus, + ProvidersGetStatusResponse, + ProvidersGetStatusNextResponse +} from "../models"; + +/** Class representing a Providers. */ +export class Providers { + private readonly client: QuantumClient; + + /** + * Initialize a new instance of the class Providers class. + * @param client Reference to the service client + */ + constructor(client: QuantumClient) { + this.client = client; + } + + /** + * Get provider status. + * @param options The options parameters. + */ + public listStatus( + options?: coreHttp.OperationOptions + ): PagedAsyncIterableIterator { + const iter = this.getStatusPagingAll(options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.getStatusPagingPage(options); + } + }; + } + + private async *getStatusPagingPage( + options?: coreHttp.OperationOptions + ): AsyncIterableIterator { + let result = await this._getStatus(options); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._getStatusNext(continuationToken, options); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *getStatusPagingAll( + options?: coreHttp.OperationOptions + ): AsyncIterableIterator { + for await (const page of this.getStatusPagingPage(options)) { + yield* page; + } + } + + /** + * Get provider status. + * @param options The options parameters. + */ + private _getStatus( + options?: coreHttp.OperationOptions + ): Promise { + const operationArguments: coreHttp.OperationArguments = { + options: coreHttp.operationOptionsToRequestOptionsBase(options || {}) + }; + return this.client.sendOperationRequest( + operationArguments, + getStatusOperationSpec + ) as Promise; + } + + /** + * GetStatusNext + * @param nextLink The nextLink from the previous successful call to the GetStatus method. + * @param options The options parameters. + */ + private _getStatusNext( + nextLink: string, + options?: coreHttp.OperationOptions + ): Promise { + const operationArguments: coreHttp.OperationArguments = { + nextLink, + options: coreHttp.operationOptionsToRequestOptionsBase(options || {}) + }; + return this.client.sendOperationRequest( + operationArguments, + getStatusNextOperationSpec + ) as Promise; + } +} +// Operation Specifications +const serializer = new coreHttp.Serializer(Mappers, /* isXml */ false); + +const getStatusOperationSpec: coreHttp.OperationSpec = { + path: + "/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Quantum/workspaces/{workspaceName}/providerStatus", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.ProviderStatusList + }, + default: { + bodyMapper: Mappers.RestError + } + }, + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.workspaceName + ], + headerParameters: [Parameters.accept], + serializer +}; +const getStatusNextOperationSpec: coreHttp.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.ProviderStatusList + }, + default: { + bodyMapper: Mappers.RestError + } + }, + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.workspaceName, + Parameters.nextLink + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/quantum/quantum/src/operations/quotas.ts b/sdk/quantum/quantum/src/operations/quotas.ts new file mode 100644 index 000000000000..dc7fd11320e5 --- /dev/null +++ b/sdk/quantum/quantum/src/operations/quotas.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 } from "@azure/core-paging"; +import * as coreHttp from "@azure/core-http"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { QuantumClient } from "../quantumClient"; +import { Quota, QuotasListResponse, QuotasListNextResponse } from "../models"; + +/** Class representing a Quotas. */ +export class Quotas { + private readonly client: QuantumClient; + + /** + * Initialize a new instance of the class Quotas class. + * @param client Reference to the service client + */ + constructor(client: QuantumClient) { + this.client = client; + } + + /** + * List quotas for the given workspace. + * @param options The options parameters. + */ + public list( + options?: coreHttp.OperationOptions + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll(options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listPagingPage(options); + } + }; + } + + private async *listPagingPage( + options?: coreHttp.OperationOptions + ): AsyncIterableIterator { + let result = await this._list(options); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listNext(continuationToken, options); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listPagingAll( + options?: coreHttp.OperationOptions + ): AsyncIterableIterator { + for await (const page of this.listPagingPage(options)) { + yield* page; + } + } + + /** + * List quotas for the given workspace. + * @param options The options parameters. + */ + private _list( + options?: coreHttp.OperationOptions + ): Promise { + const operationArguments: coreHttp.OperationArguments = { + options: coreHttp.operationOptionsToRequestOptionsBase(options || {}) + }; + return this.client.sendOperationRequest( + operationArguments, + listOperationSpec + ) as Promise; + } + + /** + * ListNext + * @param nextLink The nextLink from the previous successful call to the List method. + * @param options The options parameters. + */ + private _listNext( + nextLink: string, + options?: coreHttp.OperationOptions + ): Promise { + const operationArguments: coreHttp.OperationArguments = { + nextLink, + options: coreHttp.operationOptionsToRequestOptionsBase(options || {}) + }; + return this.client.sendOperationRequest( + operationArguments, + listNextOperationSpec + ) as Promise; + } +} +// Operation Specifications +const serializer = new coreHttp.Serializer(Mappers, /* isXml */ false); + +const listOperationSpec: coreHttp.OperationSpec = { + path: + "/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Quantum/workspaces/{workspaceName}/quotas", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.QuotaList + }, + default: { + bodyMapper: Mappers.RestError + } + }, + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.workspaceName + ], + headerParameters: [Parameters.accept], + serializer +}; +const listNextOperationSpec: coreHttp.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.QuotaList + }, + default: { + bodyMapper: Mappers.RestError + } + }, + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.workspaceName, + Parameters.nextLink + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/quantum/quantum/src/operations/storage.ts b/sdk/quantum/quantum/src/operations/storage.ts new file mode 100644 index 000000000000..7c18e6d8481c --- /dev/null +++ b/sdk/quantum/quantum/src/operations/storage.ts @@ -0,0 +1,72 @@ +/* + * 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 * as coreHttp from "@azure/core-http"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { QuantumClient } from "../quantumClient"; +import { BlobDetails, StorageSasUriResponse } from "../models"; + +/** Class representing a Storage. */ +export class Storage { + private readonly client: QuantumClient; + + /** + * Initialize a new instance of the class Storage class. + * @param client Reference to the service client + */ + constructor(client: QuantumClient) { + this.client = client; + } + + /** + * Gets a URL with SAS token for a container/blob in the storage account associated with the workspace. + * The SAS URL can be used to upload job input and/or download job output. + * @param blobDetails The details (name and container) of the blob to store or download data. + * @param options The options parameters. + */ + sasUri( + blobDetails: BlobDetails, + options?: coreHttp.OperationOptions + ): Promise { + const operationArguments: coreHttp.OperationArguments = { + blobDetails, + options: coreHttp.operationOptionsToRequestOptionsBase(options || {}) + }; + return this.client.sendOperationRequest( + operationArguments, + sasUriOperationSpec + ) as Promise; + } +} +// Operation Specifications +const serializer = new coreHttp.Serializer(Mappers, /* isXml */ false); + +const sasUriOperationSpec: coreHttp.OperationSpec = { + path: + "/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Quantum/workspaces/{workspaceName}/storage/sasUri", + httpMethod: "POST", + responses: { + 200: { + bodyMapper: Mappers.SasUriResponse + }, + default: { + bodyMapper: Mappers.RestError + } + }, + requestBody: Parameters.blobDetails, + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.workspaceName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; diff --git a/sdk/quantum/quantum/src/quantumClient.ts b/sdk/quantum/quantum/src/quantumClient.ts new file mode 100644 index 000000000000..ca3883db3e9d --- /dev/null +++ b/sdk/quantum/quantum/src/quantumClient.ts @@ -0,0 +1,39 @@ +/* + * 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 { Jobs, Providers, Storage, Quotas } from "./operations"; +import { QuantumClientContext } from "./quantumClientContext"; +import { QuantumClientOptionalParams } from "./models"; + +export class QuantumClient extends QuantumClientContext { + /** + * Initializes a new instance of the QuantumClient class. + * @param subscriptionId The Azure subscription ID. This is a GUID-formatted string (e.g. + * 00000000-0000-0000-0000-000000000000) + * @param resourceGroupName Name of an Azure resource group. + * @param workspaceName Name of the workspace. + * @param options The parameter options + */ + constructor( + subscriptionId: string, + resourceGroupName: string, + workspaceName: string, + options?: QuantumClientOptionalParams + ) { + super(subscriptionId, resourceGroupName, workspaceName, options); + this.jobs = new Jobs(this); + this.providers = new Providers(this); + this.storage = new Storage(this); + this.quotas = new Quotas(this); + } + + jobs: Jobs; + providers: Providers; + storage: Storage; + quotas: Quotas; +} diff --git a/sdk/quantum/quantum/src/quantumClientContext.ts b/sdk/quantum/quantum/src/quantumClientContext.ts new file mode 100644 index 000000000000..cb90d9d6aded --- /dev/null +++ b/sdk/quantum/quantum/src/quantumClientContext.ts @@ -0,0 +1,69 @@ +/* + * 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 * as coreHttp from "@azure/core-http"; +import { QuantumClientOptionalParams } from "./models"; + +const packageName = "@azure/quantum"; +const packageVersion = "1.0.0-beta.1"; + +export class QuantumClientContext extends coreHttp.ServiceClient { + $host: string; + subscriptionId: string; + resourceGroupName: string; + workspaceName: string; + + /** + * Initializes a new instance of the QuantumClientContext class. + * @param subscriptionId The Azure subscription ID. This is a GUID-formatted string (e.g. + * 00000000-0000-0000-0000-000000000000) + * @param resourceGroupName Name of an Azure resource group. + * @param workspaceName Name of the workspace. + * @param options The parameter options + */ + constructor( + subscriptionId: string, + resourceGroupName: string, + workspaceName: string, + options?: QuantumClientOptionalParams + ) { + if (subscriptionId === undefined) { + throw new Error("'subscriptionId' cannot be null"); + } + if (resourceGroupName === undefined) { + throw new Error("'resourceGroupName' cannot be null"); + } + if (workspaceName === undefined) { + throw new Error("'workspaceName' cannot be null"); + } + + // Initializing default values for options + if (!options) { + options = {}; + } + + if (!options.userAgent) { + const defaultUserAgent = coreHttp.getDefaultUserAgentValue(); + options.userAgent = `${packageName}/${packageVersion} ${defaultUserAgent}`; + } + + super(undefined, options); + + this.requestContentType = "application/json; charset=utf-8"; + + this.baseUri = options.endpoint || "https://quantum.azure.com"; + + // Parameter assignments + this.subscriptionId = subscriptionId; + this.resourceGroupName = resourceGroupName; + this.workspaceName = workspaceName; + + // Assigning values to Constant parameters + this.$host = options.$host || "https://quantum.azure.com"; + } +} diff --git a/sdk/quantum/quantum/tsconfig.json b/sdk/quantum/quantum/tsconfig.json new file mode 100644 index 000000000000..0290d6707a44 --- /dev/null +++ b/sdk/quantum/quantum/tsconfig.json @@ -0,0 +1,20 @@ +{ + "compilerOptions": { + "module": "es6", + "moduleResolution": "node", + "strict": true, + "target": "es5", + "sourceMap": true, + "declarationMap": true, + "esModuleInterop": true, + "allowSyntheticDefaultImports": true, + "forceConsistentCasingInFileNames": true, + "preserveConstEnums": true, + "lib": ["es6", "dom"], + "declaration": true, + "outDir": "./esm", + "importHelpers": true + }, + "include": ["./src/**/*.ts"], + "exclude": ["node_modules"] +} From 60e9019bf23188a01a86acb07e66657d5dc72692 Mon Sep 17 00:00:00 2001 From: Sarangan Rajamanickam Date: Fri, 22 Jan 2021 09:33:13 -0800 Subject: [PATCH 03/15] Generated Code II --- sdk/quantum/quantum/README.md | 3 +- sdk/quantum/quantum/package.json | 12 +- sdk/quantum/quantum/review/quantum.api.md | 280 ++++++++++++++++++ sdk/quantum/quantum/src/models/index.ts | 3 +- sdk/quantum/quantum/src/operations/jobs.ts | 53 ++-- .../quantum/src/operations/providers.ts | 11 +- sdk/quantum/quantum/src/operations/quotas.ts | 26 +- sdk/quantum/quantum/src/operations/storage.ts | 7 +- 8 files changed, 327 insertions(+), 68 deletions(-) create mode 100644 sdk/quantum/quantum/review/quantum.api.md diff --git a/sdk/quantum/quantum/README.md b/sdk/quantum/quantum/README.md index 6e22a9d3b485..ff9a6d043bbc 100644 --- a/sdk/quantum/quantum/README.md +++ b/sdk/quantum/quantum/README.md @@ -23,5 +23,4 @@ Refer the sample code in the [azure-sdk-for-js/samples](https://github.com/Azure - [Microsoft Azure SDK for Javascript](https://github.com/Azure/azure-sdk-for-js) - -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Fcdn%2Farm-cdn%2FREADME.png) \ No newline at end of file +![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Fcdn%2Farm-cdn%2FREADME.png) diff --git a/sdk/quantum/quantum/package.json b/sdk/quantum/quantum/package.json index 341f5b1b6ed1..919c2283756a 100644 --- a/sdk/quantum/quantum/package.json +++ b/sdk/quantum/quantum/package.json @@ -8,7 +8,13 @@ "@azure/core-http": "^1.2.0", "tslib": "^2.0.0" }, - "keywords": ["node", "azure", "typescript", "browser", "isomorphic"], + "keywords": [ + "node", + "azure", + "typescript", + "browser", + "isomorphic" + ], "license": "MIT", "main": "./dist/quantum.js", "module": "./esm/index.js", @@ -27,7 +33,9 @@ "type": "git", "url": "https://github.com/Azure/azure-sdk-for-js.git" }, - "bugs": { "url": "https://github.com/Azure/azure-sdk-for-js/issues" }, + "bugs": { + "url": "https://github.com/Azure/azure-sdk-for-js/issues" + }, "files": [ "dist/**/*.js", "dist/**/*.js.map", diff --git a/sdk/quantum/quantum/review/quantum.api.md b/sdk/quantum/quantum/review/quantum.api.md new file mode 100644 index 000000000000..d9afbd126e84 --- /dev/null +++ b/sdk/quantum/quantum/review/quantum.api.md @@ -0,0 +1,280 @@ +## API Report File for "@azure/quantum" + +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). + +```ts + +import * as coreHttp from '@azure/core-http'; +import { PagedAsyncIterableIterator } from '@azure/core-paging'; + +// @public +export interface BlobDetails { + blobName?: string; + containerName: string; +} + +// @public +export type DimensionScope = string; + +// @public +export interface ErrorData { + code?: string; + message?: string; +} + +// @public +export interface JobDetails { + readonly beginExecutionTime?: Date; + readonly cancellationTime?: Date; + containerUri: string; + readonly creationTime?: Date; + readonly endExecutionTime?: Date; + readonly errorData?: ErrorData; + id?: string; + inputDataFormat: string; + inputDataUri?: string; + inputParams?: any; + metadata?: { + [propertyName: string]: string; + }; + name?: string; + outputDataFormat?: string; + outputDataUri?: string; + providerId: string; + readonly status?: JobStatus; + target: string; +} + +// @public +export interface JobDetailsList { + count?: number; + readonly nextLink?: string; + readonly value?: JobDetails[]; +} + +// @public +export type JobsCreateResponse = JobDetails & { + _response: coreHttp.HttpResponse & { + bodyAsText: string; + parsedBody: JobDetails; + }; +}; + +// @public +export type JobsGetResponse = JobDetails & { + _response: coreHttp.HttpResponse & { + bodyAsText: string; + parsedBody: JobDetails; + }; +}; + +// @public +export type JobsListNextResponse = JobDetailsList & { + _response: coreHttp.HttpResponse & { + bodyAsText: string; + parsedBody: JobDetailsList; + }; +}; + +// @public +export type JobsListResponse = JobDetailsList & { + _response: coreHttp.HttpResponse & { + bodyAsText: string; + parsedBody: JobDetailsList; + }; +}; + +// @public +export type JobStatus = string; + +// @public +export const enum KnownDimensionScope { + // (undocumented) + Subscription = "Subscription", + // (undocumented) + Workspace = "Workspace" +} + +// @public +export const enum KnownJobStatus { + // (undocumented) + Cancelled = "Cancelled", + // (undocumented) + Executing = "Executing", + // (undocumented) + Failed = "Failed", + // (undocumented) + Succeeded = "Succeeded", + // (undocumented) + Waiting = "Waiting" +} + +// @public +export const enum KnownMeterPeriod { + // (undocumented) + Monthly = "Monthly", + // (undocumented) + None = "None" +} + +// @public +export const enum KnownProviderAvailability { + // (undocumented) + Available = "Available", + // (undocumented) + Degraded = "Degraded", + // (undocumented) + Unavailable = "Unavailable" +} + +// @public +export const enum KnownTargetAvailability { + // (undocumented) + Available = "Available", + // (undocumented) + Degraded = "Degraded", + // (undocumented) + Unavailable = "Unavailable" +} + +// @public +export type MeterPeriod = string; + +// @public +export type ProviderAvailability = string; + +// @public +export type ProvidersGetStatusNextResponse = ProviderStatusList & { + _response: coreHttp.HttpResponse & { + bodyAsText: string; + parsedBody: ProviderStatusList; + }; +}; + +// @public +export type ProvidersGetStatusResponse = ProviderStatusList & { + _response: coreHttp.HttpResponse & { + bodyAsText: string; + parsedBody: ProviderStatusList; + }; +}; + +// @public +export interface ProviderStatus { + readonly currentAvailability?: ProviderAvailability; + readonly id?: string; + readonly targets?: TargetStatus[]; +} + +// @public +export interface ProviderStatusList { + readonly nextLink?: string; + readonly value?: ProviderStatus[]; +} + +// @public (undocumented) +export class QuantumClient extends QuantumClientContext { + constructor(subscriptionId: string, resourceGroupName: string, workspaceName: string, options?: QuantumClientOptionalParams); + // Warning: (ae-forgotten-export) The symbol "Jobs" needs to be exported by the entry point index.d.ts + // + // (undocumented) + jobs: Jobs; + // Warning: (ae-forgotten-export) The symbol "Providers" needs to be exported by the entry point index.d.ts + // + // (undocumented) + providers: Providers; + // Warning: (ae-forgotten-export) The symbol "Quotas" needs to be exported by the entry point index.d.ts + // + // (undocumented) + quotas: Quotas; + // Warning: (ae-forgotten-export) The symbol "Storage" needs to be exported by the entry point index.d.ts + // + // (undocumented) + storage: Storage; +} + +// @public (undocumented) +export class QuantumClientContext extends coreHttp.ServiceClient { + // (undocumented) + $host: string; + constructor(subscriptionId: string, resourceGroupName: string, workspaceName: string, options?: QuantumClientOptionalParams); + // (undocumented) + resourceGroupName: string; + // (undocumented) + subscriptionId: string; + // (undocumented) + workspaceName: string; +} + +// @public +export interface QuantumClientOptionalParams extends coreHttp.ServiceClientOptions { + $host?: string; + endpoint?: string; +} + +// @public +export interface Quota { + dimension?: string; + holds?: number; + limit?: number; + period?: MeterPeriod; + providerId?: string; + scope?: DimensionScope; + utilization?: number; +} + +// @public +export interface QuotaList { + readonly nextLink?: string; + readonly value?: Quota[]; +} + +// @public +export type QuotasListNextResponse = QuotaList & { + _response: coreHttp.HttpResponse & { + bodyAsText: string; + parsedBody: QuotaList; + }; +}; + +// @public +export type QuotasListResponse = QuotaList & { + _response: coreHttp.HttpResponse & { + bodyAsText: string; + parsedBody: QuotaList; + }; +}; + +// @public +export interface RestError { + error?: ErrorData; +} + +// @public +export interface SasUriResponse { + sasUri?: string; +} + +// @public +export type StorageSasUriResponse = SasUriResponse & { + _response: coreHttp.HttpResponse & { + bodyAsText: string; + parsedBody: SasUriResponse; + }; +}; + +// @public +export type TargetAvailability = string; + +// @public +export interface TargetStatus { + readonly averageQueueTime?: number; + readonly currentAvailability?: TargetAvailability; + readonly id?: string; + readonly statusPage?: string; +} + + +// (No @packageDocumentation comment for this package) + +``` diff --git a/sdk/quantum/quantum/src/models/index.ts b/sdk/quantum/quantum/src/models/index.ts index 8856ecfcbcee..6be9e58b8741 100644 --- a/sdk/quantum/quantum/src/models/index.ts +++ b/sdk/quantum/quantum/src/models/index.ts @@ -384,8 +384,7 @@ export type QuotasListNextResponse = QuotaList & { }; /** Optional parameters. */ -export interface QuantumClientOptionalParams - extends coreHttp.ServiceClientOptions { +export interface QuantumClientOptionalParams extends coreHttp.ServiceClientOptions { /** server parameter */ $host?: string; /** Overrides client endpoint. */ diff --git a/sdk/quantum/quantum/src/operations/jobs.ts b/sdk/quantum/quantum/src/operations/jobs.ts index 341e1627d90b..b4f26fbe77d8 100644 --- a/sdk/quantum/quantum/src/operations/jobs.ts +++ b/sdk/quantum/quantum/src/operations/jobs.ts @@ -35,9 +35,7 @@ export class Jobs { * List jobs. * @param options The options parameters. */ - public list( - options?: coreHttp.OperationOptions - ): PagedAsyncIterableIterator { + public list(options?: coreHttp.OperationOptions): PagedAsyncIterableIterator { const iter = this.listPagingAll(options); return { next() { @@ -77,16 +75,13 @@ export class Jobs { * List jobs. * @param options The options parameters. */ - private _list( - options?: coreHttp.OperationOptions - ): Promise { + private _list(options?: coreHttp.OperationOptions): Promise { const operationArguments: coreHttp.OperationArguments = { options: coreHttp.operationOptionsToRequestOptionsBase(options || {}) }; - return this.client.sendOperationRequest( - operationArguments, - listOperationSpec - ) as Promise; + return this.client.sendOperationRequest(operationArguments, listOperationSpec) as Promise< + JobsListResponse + >; } /** @@ -94,18 +89,14 @@ export class Jobs { * @param jobId Id of the job. * @param options The options parameters. */ - get( - jobId: string, - options?: coreHttp.OperationOptions - ): Promise { + get(jobId: string, options?: coreHttp.OperationOptions): Promise { const operationArguments: coreHttp.OperationArguments = { jobId, options: coreHttp.operationOptionsToRequestOptionsBase(options || {}) }; - return this.client.sendOperationRequest( - operationArguments, - getOperationSpec - ) as Promise; + return this.client.sendOperationRequest(operationArguments, getOperationSpec) as Promise< + JobsGetResponse + >; } /** @@ -124,10 +115,9 @@ export class Jobs { job, options: coreHttp.operationOptionsToRequestOptionsBase(options || {}) }; - return this.client.sendOperationRequest( - operationArguments, - createOperationSpec - ) as Promise; + return this.client.sendOperationRequest(operationArguments, createOperationSpec) as Promise< + JobsCreateResponse + >; } /** @@ -135,18 +125,14 @@ export class Jobs { * @param jobId Id of the job. * @param options The options parameters. */ - cancel( - jobId: string, - options?: coreHttp.OperationOptions - ): Promise { + cancel(jobId: string, options?: coreHttp.OperationOptions): Promise { const operationArguments: coreHttp.OperationArguments = { jobId, options: coreHttp.operationOptionsToRequestOptionsBase(options || {}) }; - return this.client.sendOperationRequest( - operationArguments, - cancelOperationSpec - ) as Promise; + return this.client.sendOperationRequest(operationArguments, cancelOperationSpec) as Promise< + coreHttp.RestResponse + >; } /** @@ -162,10 +148,9 @@ export class Jobs { nextLink, options: coreHttp.operationOptionsToRequestOptionsBase(options || {}) }; - return this.client.sendOperationRequest( - operationArguments, - listNextOperationSpec - ) as Promise; + return this.client.sendOperationRequest(operationArguments, listNextOperationSpec) as Promise< + JobsListNextResponse + >; } } // Operation Specifications diff --git a/sdk/quantum/quantum/src/operations/providers.ts b/sdk/quantum/quantum/src/operations/providers.ts index 6cc75ca016b9..9766cade599a 100644 --- a/sdk/quantum/quantum/src/operations/providers.ts +++ b/sdk/quantum/quantum/src/operations/providers.ts @@ -75,16 +75,13 @@ export class Providers { * Get provider status. * @param options The options parameters. */ - private _getStatus( - options?: coreHttp.OperationOptions - ): Promise { + private _getStatus(options?: coreHttp.OperationOptions): Promise { const operationArguments: coreHttp.OperationArguments = { options: coreHttp.operationOptionsToRequestOptionsBase(options || {}) }; - return this.client.sendOperationRequest( - operationArguments, - getStatusOperationSpec - ) as Promise; + return this.client.sendOperationRequest(operationArguments, getStatusOperationSpec) as Promise< + ProvidersGetStatusResponse + >; } /** diff --git a/sdk/quantum/quantum/src/operations/quotas.ts b/sdk/quantum/quantum/src/operations/quotas.ts index dc7fd11320e5..9e8518d118be 100644 --- a/sdk/quantum/quantum/src/operations/quotas.ts +++ b/sdk/quantum/quantum/src/operations/quotas.ts @@ -29,9 +29,7 @@ export class Quotas { * List quotas for the given workspace. * @param options The options parameters. */ - public list( - options?: coreHttp.OperationOptions - ): PagedAsyncIterableIterator { + public list(options?: coreHttp.OperationOptions): PagedAsyncIterableIterator { const iter = this.listPagingAll(options); return { next() { @@ -59,9 +57,7 @@ export class Quotas { } } - private async *listPagingAll( - options?: coreHttp.OperationOptions - ): AsyncIterableIterator { + private async *listPagingAll(options?: coreHttp.OperationOptions): AsyncIterableIterator { for await (const page of this.listPagingPage(options)) { yield* page; } @@ -71,16 +67,13 @@ export class Quotas { * List quotas for the given workspace. * @param options The options parameters. */ - private _list( - options?: coreHttp.OperationOptions - ): Promise { + private _list(options?: coreHttp.OperationOptions): Promise { const operationArguments: coreHttp.OperationArguments = { options: coreHttp.operationOptionsToRequestOptionsBase(options || {}) }; - return this.client.sendOperationRequest( - operationArguments, - listOperationSpec - ) as Promise; + return this.client.sendOperationRequest(operationArguments, listOperationSpec) as Promise< + QuotasListResponse + >; } /** @@ -96,10 +89,9 @@ export class Quotas { nextLink, options: coreHttp.operationOptionsToRequestOptionsBase(options || {}) }; - return this.client.sendOperationRequest( - operationArguments, - listNextOperationSpec - ) as Promise; + return this.client.sendOperationRequest(operationArguments, listNextOperationSpec) as Promise< + QuotasListNextResponse + >; } } // Operation Specifications diff --git a/sdk/quantum/quantum/src/operations/storage.ts b/sdk/quantum/quantum/src/operations/storage.ts index 7c18e6d8481c..8c9df3f8431a 100644 --- a/sdk/quantum/quantum/src/operations/storage.ts +++ b/sdk/quantum/quantum/src/operations/storage.ts @@ -38,10 +38,9 @@ export class Storage { blobDetails, options: coreHttp.operationOptionsToRequestOptionsBase(options || {}) }; - return this.client.sendOperationRequest( - operationArguments, - sasUriOperationSpec - ) as Promise; + return this.client.sendOperationRequest(operationArguments, sasUriOperationSpec) as Promise< + StorageSasUriResponse + >; } } // Operation Specifications From 799cc1bad546a21cf0d96af20d508bd56b7575ba Mon Sep 17 00:00:00 2001 From: Sarangan Rajamanickam Date: Fri, 22 Jan 2021 09:33:32 -0800 Subject: [PATCH 04/15] Rush Related Changes --- common/config/rush/pnpm-lock.yaml | 31 +++++++++++++++++++++++++++++-- rush.json | 5 +++++ 2 files changed, 34 insertions(+), 2 deletions(-) diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index e37bcb0dd06f..fa34c7595f35 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -38,6 +38,7 @@ dependencies: '@rush-temp/keyvault-secrets': file:projects/keyvault-secrets.tgz '@rush-temp/logger': file:projects/logger.tgz '@rush-temp/opentelemetry-exporter-azure-monitor': file:projects/opentelemetry-exporter-azure-monitor.tgz + '@rush-temp/quantum': file:projects/quantum.tgz '@rush-temp/schema-registry': file:projects/schema-registry.tgz '@rush-temp/schema-registry-avro': file:projects/schema-registry-avro.tgz '@rush-temp/search-documents': file:projects/search-documents.tgz @@ -5109,6 +5110,13 @@ packages: hasBin: true resolution: integrity: sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ== + /mkdirp/1.0.4: + dev: false + engines: + node: '>=10' + hasBin: true + resolution: + integrity: sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw== /mocha-junit-reporter/1.23.3_mocha@7.2.0: dependencies: debug: 2.6.9 @@ -9786,6 +9794,22 @@ packages: integrity: sha512-tRQxKK1wEKaiouodTlCH0qHRNsnv4vvOic2VIs8FZ5pvQkDrTF20avK00bpf7iBXMwvK7U11qwLIndCnh7uipQ== tarball: file:projects/opentelemetry-exporter-azure-monitor.tgz version: 0.0.0 + file:projects/quantum.tgz: + dependencies: + '@microsoft/api-extractor': 7.7.11 + mkdirp: 1.0.4 + rollup: 1.32.1 + rollup-plugin-node-resolve: 3.4.0 + rollup-plugin-sourcemaps: 0.4.2_rollup@1.32.1 + tslib: 2.1.0 + typescript: 4.1.2 + uglify-js: 3.12.4 + dev: false + name: '@rush-temp/quantum' + resolution: + integrity: sha512-6DoNUUys3OKWvSmCYcbjfgp3vlDH1ViWGfzDXwkEXPWSVuOJfbG3WRLpvko05YFYMDCNNxwCvEV06h+Mkq9UpA== + tarball: file:projects/quantum.tgz + version: 0.0.0 file:projects/schema-registry-avro.tgz: dependencies: '@microsoft/api-extractor': 7.7.11 @@ -10092,6 +10116,7 @@ packages: '@rollup/plugin-replace': 2.3.4_rollup@1.32.1 '@types/mocha': 7.0.2 '@types/node': 8.10.66 + '@types/node-fetch': 2.5.8 assert: 1.5.0 cross-env: 7.0.3 dotenv: 8.2.0 @@ -10116,6 +10141,7 @@ packages: karma-remap-istanbul: 0.6.0_karma@5.2.3 mocha: 7.2.0 mocha-junit-reporter: 1.23.3_mocha@7.2.0 + node-fetch: 2.6.1 nyc: 14.1.1 prettier: 1.19.1 puppeteer: 3.3.0 @@ -10134,7 +10160,7 @@ packages: dev: false name: '@rush-temp/storage-blob' resolution: - integrity: sha512-ANo4mmoPCyN/WlANRbNoW7OxTSHR1P/8u+cENKv0DfmYjrS3SLo4m478WvMD0fdJ+XiidDHTX4BDJ0KbQ+E4PQ== + integrity: sha512-rU6NFKPmPn9U/qHTsuCT5UYzWs1n6ppeTnCpyG/ySExrVElh8BwErLE9njGr3eGauhIWtSn/0S4HDI1KbIF0HQ== tarball: file:projects/storage-blob.tgz version: 0.0.0 file:projects/storage-file-datalake.tgz: @@ -10252,7 +10278,7 @@ packages: dev: false name: '@rush-temp/storage-file-share' resolution: - integrity: sha512-EWcAbZhKxRWu1c+tbPXuqkzm8591VftpYXmmMZp3myfyJ0yg8DzxfibkNe3X7MFQ7l6WtXM5lY8ttmpzIOfBHQ== + integrity: sha512-mPeZ3yhsHvsflEJ9TVjBN8tyGEGu+vToPeh4eK5xW6UIh5y5Rk7Auz72tdz/bp+ewTUTuPbyWToqGTD5qoijOw== tarball: file:projects/storage-file-share.tgz version: 0.0.0 file:projects/storage-internal-avro.tgz: @@ -10672,6 +10698,7 @@ specifiers: '@rush-temp/keyvault-secrets': file:./projects/keyvault-secrets.tgz '@rush-temp/logger': file:./projects/logger.tgz '@rush-temp/opentelemetry-exporter-azure-monitor': file:./projects/opentelemetry-exporter-azure-monitor.tgz + '@rush-temp/quantum': file:./projects/quantum.tgz '@rush-temp/schema-registry': file:./projects/schema-registry.tgz '@rush-temp/schema-registry-avro': file:./projects/schema-registry-avro.tgz '@rush-temp/search-documents': file:./projects/search-documents.tgz diff --git a/rush.json b/rush.json index ce3974754dd1..07868dd32ff3 100644 --- a/rush.json +++ b/rush.json @@ -362,6 +362,11 @@ "projectFolder": "sdk/attestation/attestation", "versionPolicyName": "client" }, + { + "packageName": "@azure/quantum", + "projectFolder": "sdk/quantum/quantum", + "versionPolicyName": "client" + }, { "packageName": "@azure/communication-administration", "projectFolder": "sdk/communication/communication-administration", From cf421dc14e11e653f74d4260c947ca3149bbb52e Mon Sep 17 00:00:00 2001 From: Sarangan Rajamanickam Date: Fri, 22 Jan 2021 09:34:49 -0800 Subject: [PATCH 05/15] Minor Changes --- sdk/quantum/quantum/review/quantum.api.md | 35 +++++++++++++++++------ sdk/quantum/quantum/src/index.ts | 1 + 2 files changed, 28 insertions(+), 8 deletions(-) diff --git a/sdk/quantum/quantum/review/quantum.api.md b/sdk/quantum/quantum/review/quantum.api.md index d9afbd126e84..8095fcd87646 100644 --- a/sdk/quantum/quantum/review/quantum.api.md +++ b/sdk/quantum/quantum/review/quantum.api.md @@ -52,6 +52,15 @@ export interface JobDetailsList { readonly value?: JobDetails[]; } +// @public +export class Jobs { + constructor(client: QuantumClient); + cancel(jobId: string, options?: coreHttp.OperationOptions): Promise; + create(jobId: string, job: JobDetails, options?: coreHttp.OperationOptions): Promise; + get(jobId: string, options?: coreHttp.OperationOptions): Promise; + list(options?: coreHttp.OperationOptions): PagedAsyncIterableIterator; + } + // @public export type JobsCreateResponse = JobDetails & { _response: coreHttp.HttpResponse & { @@ -143,6 +152,12 @@ export type MeterPeriod = string; // @public export type ProviderAvailability = string; +// @public +export class Providers { + constructor(client: QuantumClient); + listStatus(options?: coreHttp.OperationOptions): PagedAsyncIterableIterator; +} + // @public export type ProvidersGetStatusNextResponse = ProviderStatusList & { _response: coreHttp.HttpResponse & { @@ -175,20 +190,12 @@ export interface ProviderStatusList { // @public (undocumented) export class QuantumClient extends QuantumClientContext { constructor(subscriptionId: string, resourceGroupName: string, workspaceName: string, options?: QuantumClientOptionalParams); - // Warning: (ae-forgotten-export) The symbol "Jobs" needs to be exported by the entry point index.d.ts - // // (undocumented) jobs: Jobs; - // Warning: (ae-forgotten-export) The symbol "Providers" needs to be exported by the entry point index.d.ts - // // (undocumented) providers: Providers; - // Warning: (ae-forgotten-export) The symbol "Quotas" needs to be exported by the entry point index.d.ts - // // (undocumented) quotas: Quotas; - // Warning: (ae-forgotten-export) The symbol "Storage" needs to be exported by the entry point index.d.ts - // // (undocumented) storage: Storage; } @@ -229,6 +236,12 @@ export interface QuotaList { readonly value?: Quota[]; } +// @public +export class Quotas { + constructor(client: QuantumClient); + list(options?: coreHttp.OperationOptions): PagedAsyncIterableIterator; + } + // @public export type QuotasListNextResponse = QuotaList & { _response: coreHttp.HttpResponse & { @@ -255,6 +268,12 @@ export interface SasUriResponse { sasUri?: string; } +// @public +export class Storage { + constructor(client: QuantumClient); + sasUri(blobDetails: BlobDetails, options?: coreHttp.OperationOptions): Promise; +} + // @public export type StorageSasUriResponse = SasUriResponse & { _response: coreHttp.HttpResponse & { diff --git a/sdk/quantum/quantum/src/index.ts b/sdk/quantum/quantum/src/index.ts index d33f9aebee8f..adc75fc233de 100644 --- a/sdk/quantum/quantum/src/index.ts +++ b/sdk/quantum/quantum/src/index.ts @@ -8,5 +8,6 @@ /// export * from "./models"; +export * from "./operations"; export { QuantumClient } from "./quantumClient"; export { QuantumClientContext } from "./quantumClientContext"; From dfa84bca4661150b19432bb04039162fd581272c Mon Sep 17 00:00:00 2001 From: Sarangan Rajamanickam Date: Fri, 22 Jan 2021 09:37:32 -0800 Subject: [PATCH 06/15] Mark Generate Metadata to false --- sdk/quantum/quantum/swagger/readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/quantum/quantum/swagger/readme.md b/sdk/quantum/quantum/swagger/readme.md index 030559f6d552..d0a72385c758 100644 --- a/sdk/quantum/quantum/swagger/readme.md +++ b/sdk/quantum/quantum/swagger/readme.md @@ -6,7 +6,7 @@ ```yaml package-name: "@azure/quantum" -generate-metadata: true +generate-metadata: false license-header: MICROSOFT_MIT_NO_VERSION output-folder: ../ source-code-folder-path: ./src/ From d12c5f620f88cf3d4650d59da99cb3a8852d774f Mon Sep 17 00:00:00 2001 From: Sarangan Rajamanickam Date: Fri, 22 Jan 2021 09:45:43 -0800 Subject: [PATCH 07/15] TS Config Update --- sdk/quantum/quantum/tsconfig.json | 28 ++++++++++++---------------- 1 file changed, 12 insertions(+), 16 deletions(-) diff --git a/sdk/quantum/quantum/tsconfig.json b/sdk/quantum/quantum/tsconfig.json index 0290d6707a44..d67e8b8b1748 100644 --- a/sdk/quantum/quantum/tsconfig.json +++ b/sdk/quantum/quantum/tsconfig.json @@ -1,20 +1,16 @@ { + "extends": "../../../tsconfig.package", "compilerOptions": { - "module": "es6", - "moduleResolution": "node", - "strict": true, - "target": "es5", - "sourceMap": true, - "declarationMap": true, - "esModuleInterop": true, - "allowSyntheticDefaultImports": true, - "forceConsistentCasingInFileNames": true, - "preserveConstEnums": true, - "lib": ["es6", "dom"], - "declaration": true, - "outDir": "./esm", - "importHelpers": true + "outDir": "./dist-esm", + "declarationDir": "./types" }, - "include": ["./src/**/*.ts"], - "exclude": ["node_modules"] + "exclude": [ + "node_modules", + "types", + "temp", + "browser", + "dist", + "dist-esm", + "./samples/**/*.ts" + ] } From d5c8453e7ce608fa111931e0aa16816c7b90f359 Mon Sep 17 00:00:00 2001 From: Sarangan Rajamanickam Date: Fri, 22 Jan 2021 09:54:35 -0800 Subject: [PATCH 08/15] Format Changes --- sdk/quantum/quantum/tsconfig.json | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/sdk/quantum/quantum/tsconfig.json b/sdk/quantum/quantum/tsconfig.json index d67e8b8b1748..733a8ef32522 100644 --- a/sdk/quantum/quantum/tsconfig.json +++ b/sdk/quantum/quantum/tsconfig.json @@ -4,13 +4,5 @@ "outDir": "./dist-esm", "declarationDir": "./types" }, - "exclude": [ - "node_modules", - "types", - "temp", - "browser", - "dist", - "dist-esm", - "./samples/**/*.ts" - ] + "exclude": ["node_modules", "types", "temp", "browser", "dist", "dist-esm", "./samples/**/*.ts"] } From fe346a0f2ce0fa36107b7943c5dd7faac2318ccf Mon Sep 17 00:00:00 2001 From: Sarangan Rajamanickam Date: Fri, 22 Jan 2021 12:03:55 -0800 Subject: [PATCH 09/15] Remove Uglify Minification from Build Step for now --- sdk/quantum/quantum/api-extractor.json | 2 +- sdk/quantum/quantum/package.json | 5 ++--- sdk/quantum/quantum/rollup.config.js | 2 +- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/sdk/quantum/quantum/api-extractor.json b/sdk/quantum/quantum/api-extractor.json index 5fb5b21b56f2..39fb341950f7 100644 --- a/sdk/quantum/quantum/api-extractor.json +++ b/sdk/quantum/quantum/api-extractor.json @@ -1,6 +1,6 @@ { "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", - "mainEntryPointFilePath": "./esm/index.d.ts", + "mainEntryPointFilePath": "./types/index.d.ts", "docModel": { "enabled": true }, "apiReport": { "enabled": true, "reportFolder": "./review" }, "dtsRollup": { diff --git a/sdk/quantum/quantum/package.json b/sdk/quantum/quantum/package.json index 919c2283756a..0830d859b1fc 100644 --- a/sdk/quantum/quantum/package.json +++ b/sdk/quantum/quantum/package.json @@ -51,11 +51,10 @@ "tsconfig.json" ], "scripts": { - "build": "tsc && rollup -c rollup.config.js && npm run minify && mkdirp ./review && npm run extract-api", + "build": "tsc && rollup -c rollup.config.js && mkdirp ./review && npm run extract-api", "minify": "uglifyjs -c -m --comments --source-map \"content='./dist/quantum.js.map'\" -o ./dist/quantum.min.js ./dist/quantum.js", "prepack": "npm install && npm run build", "extract-api": "api-extractor run --local" }, - "sideEffects": false, - "autoPublish": true + "sideEffects": false } diff --git a/sdk/quantum/quantum/rollup.config.js b/sdk/quantum/quantum/rollup.config.js index afd141f56bb5..eaa8c84a3ff4 100644 --- a/sdk/quantum/quantum/rollup.config.js +++ b/sdk/quantum/quantum/rollup.config.js @@ -12,7 +12,7 @@ import sourcemaps from "rollup-plugin-sourcemaps"; /** @type {rollup.RollupFileOptions} */ const config = { - input: "./esm/quantumClient.js", + input: "./dist-esm/quantumClient.js", external: ["@azure/core-http"], output: { file: "./dist/quantum.js", From 42e2666c52860f3fae5ce9478034df6503483da5 Mon Sep 17 00:00:00 2001 From: Sarangan Rajamanickam Date: Fri, 22 Jan 2021 12:45:25 -0800 Subject: [PATCH 10/15] Added build:samples command to package.json --- sdk/quantum/quantum/package.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sdk/quantum/quantum/package.json b/sdk/quantum/quantum/package.json index 0830d859b1fc..609c15814e32 100644 --- a/sdk/quantum/quantum/package.json +++ b/sdk/quantum/quantum/package.json @@ -54,7 +54,8 @@ "build": "tsc && rollup -c rollup.config.js && mkdirp ./review && npm run extract-api", "minify": "uglifyjs -c -m --comments --source-map \"content='./dist/quantum.js.map'\" -o ./dist/quantum.min.js ./dist/quantum.js", "prepack": "npm install && npm run build", - "extract-api": "api-extractor run --local" + "extract-api": "api-extractor run --local", + "build:samples": "echo skip" }, "sideEffects": false } From d19ed97564732ddc51797cb50eb802b9e736b41b Mon Sep 17 00:00:00 2001 From: Sarangan Rajamanickam Date: Fri, 22 Jan 2021 12:49:54 -0800 Subject: [PATCH 11/15] Added build:test command to package.json --- sdk/quantum/quantum/package.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sdk/quantum/quantum/package.json b/sdk/quantum/quantum/package.json index 609c15814e32..667155c03736 100644 --- a/sdk/quantum/quantum/package.json +++ b/sdk/quantum/quantum/package.json @@ -55,7 +55,8 @@ "minify": "uglifyjs -c -m --comments --source-map \"content='./dist/quantum.js.map'\" -o ./dist/quantum.min.js ./dist/quantum.js", "prepack": "npm install && npm run build", "extract-api": "api-extractor run --local", - "build:samples": "echo skip" + "build:samples": "echo skip", + "build:test": "echo skip" }, "sideEffects": false } From 6874bcaeb2db16058df5cf60c3528f3fe7456660 Mon Sep 17 00:00:00 2001 From: Sarangan Rajamanickam Date: Fri, 22 Jan 2021 13:19:20 -0800 Subject: [PATCH 12/15] Added missing commands to package.json --- sdk/quantum/quantum/package.json | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/sdk/quantum/quantum/package.json b/sdk/quantum/quantum/package.json index 667155c03736..e3b5d52c8541 100644 --- a/sdk/quantum/quantum/package.json +++ b/sdk/quantum/quantum/package.json @@ -54,9 +54,33 @@ "build": "tsc && rollup -c rollup.config.js && mkdirp ./review && npm run extract-api", "minify": "uglifyjs -c -m --comments --source-map \"content='./dist/quantum.js.map'\" -o ./dist/quantum.min.js ./dist/quantum.js", "prepack": "npm install && npm run build", + "clean": "rimraf dist dist-esm dist-browser test-dist test-browser types *.tgz *.log", "extract-api": "api-extractor run --local", "build:samples": "echo skip", - "build:test": "echo skip" + "build:node": "echo skip", + "build:browser": "echo skip", + "build:test": "echo skip", + "build:test:node": "echo skip", + "build:test:browser": "echo skip", + "check-format": "echo skip", + "coverage": "echo skip", + "execute:samples": "echo skip", + "format": "echo skip", + "lint:fix": "echo skip", + "lint": "echo skip", + "prebuild": "echo skip", + "pack": "echo skip", + "swagger": "echo skip", + "integration-test": "echo skip", + "integration-test:browser": "echo skip", + "integration-test:node": "echo skip", + "test:browser": "echo skip", + "test:node": "echo skip", + "test": "echo skip", + "unit-test:browser": "echo skip", + "unit-test:node": "echo skip", + "unit-test": "echo skip", + "docs": "echo skip" }, "sideEffects": false } From 1be908cbe489828709820625e526d84cdc54f1f0 Mon Sep 17 00:00:00 2001 From: Sarangan Rajamanickam Date: Fri, 22 Jan 2021 13:53:18 -0800 Subject: [PATCH 13/15] Added missing commands to package.json --- sdk/quantum/quantum/README.md | 31 +++++++++++++++++++++---------- sdk/quantum/quantum/package.json | 8 ++++---- 2 files changed, 25 insertions(+), 14 deletions(-) diff --git a/sdk/quantum/quantum/README.md b/sdk/quantum/quantum/README.md index ff9a6d043bbc..0c337dedcc23 100644 --- a/sdk/quantum/quantum/README.md +++ b/sdk/quantum/quantum/README.md @@ -2,25 +2,36 @@ This package contains an isomorphic SDK for QuantumClient. -### Currently supported environments +## Getting started -- Node.js version 8.x.x or higher -- Browser JavaScript - -### How to Install +### Install the package ```bash npm install @azure/quantum ``` -### How to use +### Prerequisites + +- Node.js version 8.x.x or higher + +## Key concepts + +**TO BE FILLED** + +## Examples + +**TO BE FILLED** + +## Next steps + +**TO BE FILLED** -#### Sample code +## Contributing -Refer the sample code in the [azure-sdk-for-js/samples](https://github.com/Azure/azure-sdk-for-js/tree/master/samples) folder. +**TO BE FILLED** ## Related projects -- [Microsoft Azure SDK for Javascript](https://github.com/Azure/azure-sdk-for-js) +**TO BE FILLED** -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Fcdn%2Farm-cdn%2FREADME.png) +![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Fappconfiguration%2Fapp-configuration%2FREADME.png) diff --git a/sdk/quantum/quantum/package.json b/sdk/quantum/quantum/package.json index e3b5d52c8541..9ce912d6b713 100644 --- a/sdk/quantum/quantum/package.json +++ b/sdk/quantum/quantum/package.json @@ -62,9 +62,9 @@ "build:test": "echo skip", "build:test:node": "echo skip", "build:test:browser": "echo skip", - "check-format": "echo skip", + "check-format": "echo skip", "coverage": "echo skip", - "execute:samples": "echo skip", + "execute:samples": "echo skip", "format": "echo skip", "lint:fix": "echo skip", "lint": "echo skip", @@ -74,12 +74,12 @@ "integration-test": "echo skip", "integration-test:browser": "echo skip", "integration-test:node": "echo skip", + "test": "echo skip", "test:browser": "echo skip", "test:node": "echo skip", - "test": "echo skip", + "unit-test": "echo skip", "unit-test:browser": "echo skip", "unit-test:node": "echo skip", - "unit-test": "echo skip", "docs": "echo skip" }, "sideEffects": false From b567d3b75d32b5a6acbbe65fd869a9226e836bca Mon Sep 17 00:00:00 2001 From: Sarangan Rajamanickam Date: Fri, 22 Jan 2021 14:30:32 -0800 Subject: [PATCH 14/15] Added Info to Readme --- sdk/quantum/quantum/README.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sdk/quantum/quantum/README.md b/sdk/quantum/quantum/README.md index 0c337dedcc23..2210870e785d 100644 --- a/sdk/quantum/quantum/README.md +++ b/sdk/quantum/quantum/README.md @@ -1,4 +1,4 @@ -## Azure QuantumClient SDK for JavaScript +## Azure QuantumClient client library for JavaScript This package contains an isomorphic SDK for QuantumClient. @@ -34,4 +34,8 @@ npm install @azure/quantum **TO BE FILLED** +## Troubleshooting + +**TO BE FILLED** + ![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Fappconfiguration%2Fapp-configuration%2FREADME.png) From e752670204c7187ba650a83e1fa9ee4d5916c5e4 Mon Sep 17 00:00:00 2001 From: Sarangan Rajamanickam Date: Fri, 22 Jan 2021 15:37:45 -0800 Subject: [PATCH 15/15] Removed minify & prepack scripts --- sdk/quantum/quantum/package.json | 2 -- 1 file changed, 2 deletions(-) diff --git a/sdk/quantum/quantum/package.json b/sdk/quantum/quantum/package.json index 9ce912d6b713..2e85a276536f 100644 --- a/sdk/quantum/quantum/package.json +++ b/sdk/quantum/quantum/package.json @@ -52,8 +52,6 @@ ], "scripts": { "build": "tsc && rollup -c rollup.config.js && mkdirp ./review && npm run extract-api", - "minify": "uglifyjs -c -m --comments --source-map \"content='./dist/quantum.js.map'\" -o ./dist/quantum.min.js ./dist/quantum.js", - "prepack": "npm install && npm run build", "clean": "rimraf dist dist-esm dist-browser test-dist test-browser types *.tgz *.log", "extract-api": "api-extractor run --local", "build:samples": "echo skip",