diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index 618cd74b6549..4ae03319138d 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -3928,7 +3928,7 @@ packages: dependencies: semver: 7.3.8 shelljs: 0.8.5 - typescript: 5.0.0-dev.20230216 + typescript: 5.0.0-dev.20230219 dev: false /downlevel-dts/0.7.0: @@ -8712,8 +8712,8 @@ packages: hasBin: true dev: false - /typescript/5.0.0-dev.20230216: - resolution: {integrity: sha512-yeZZGWiNc5pbGg4J/bgN7vq2Lrs4YTNzhG5dv8owIe1PyYX4tMDla8NnXipy9h4Cmw6+DQA8FG9XZbymgmzSbA==} + /typescript/5.0.0-dev.20230219: + resolution: {integrity: sha512-CjlwGu0BGvavGAPs7/2sng1K0EYubaZc3irzGboNBs83OI2+ij4QixjS8+nXcoR4H3uumDnyd7Vo/LoIgdSa7Q==} engines: {node: '>=4.2.0'} hasBin: true dev: false @@ -10912,15 +10912,15 @@ packages: dev: false file:projects/arm-confidentialledger.tgz: - resolution: {integrity: sha512-4qXPYrskPkhJwdQ/yJaWnQ/a6JqFIVlW/GObTMBr5I6UL+6szp78Hbpx0cAI5C4TM19ojn25CeJIIEw80IzmJw==, tarball: file:projects/arm-confidentialledger.tgz} + resolution: {integrity: sha512-03xgxDzG6cxGN2Do+X54YshQojnT7QU55QwTL+vKGM6ruQ+ny9ndYAYCToMwonUZO/sk/d8QATTDw6CG3kfGdg==, tarball: file:projects/arm-confidentialledger.tgz} name: '@rush-temp/arm-confidentialledger' version: 0.0.0 dependencies: '@azure/identity': 2.1.0 '@microsoft/api-extractor': 7.34.3_@types+node@14.18.36 - '@rollup/plugin-commonjs': 24.0.1_rollup@2.79.1 - '@rollup/plugin-json': 6.0.0_rollup@2.79.1 - '@rollup/plugin-multi-entry': 6.0.0_rollup@2.79.1 + '@rollup/plugin-commonjs': 21.1.0_rollup@2.79.1 + '@rollup/plugin-json': 4.1.0_rollup@2.79.1 + '@rollup/plugin-multi-entry': 4.1.0_rollup@2.79.1 '@rollup/plugin-node-resolve': 13.3.0_rollup@2.79.1 '@types/chai': 4.3.4 '@types/node': 14.18.36 diff --git a/sdk/confidentialledger/arm-confidentialledger/CHANGELOG.md b/sdk/confidentialledger/arm-confidentialledger/CHANGELOG.md index 2309d57e5428..183520520a89 100644 --- a/sdk/confidentialledger/arm-confidentialledger/CHANGELOG.md +++ b/sdk/confidentialledger/arm-confidentialledger/CHANGELOG.md @@ -1,15 +1,38 @@ # Release History + +## 1.3.0-beta.1 (2023-02-20) + +**Features** -## 1.2.1 (Unreleased) - -### Features Added - -### Breaking Changes - -### Bugs Fixed - -### Other Changes - + - Added operation group ManagedCCFOperations + - Added Interface CertificateTags + - Added Interface DeploymentType + - Added Interface ManagedCCF + - Added Interface ManagedCCFCreateOptionalParams + - Added Interface ManagedCCFDeleteOptionalParams + - Added Interface ManagedCCFGetOptionalParams + - Added Interface ManagedCCFList + - Added Interface ManagedCCFListByResourceGroupNextOptionalParams + - Added Interface ManagedCCFListByResourceGroupOptionalParams + - Added Interface ManagedCCFListBySubscriptionNextOptionalParams + - Added Interface ManagedCCFListBySubscriptionOptionalParams + - Added Interface ManagedCCFProperties + - Added Interface ManagedCCFUpdateOptionalParams + - Added Interface MemberIdentityCertificate + - Added Interface TrackedResource + - Added Type Alias LanguageRuntime + - Added Type Alias ManagedCCFCreateResponse + - Added Type Alias ManagedCCFGetResponse + - Added Type Alias ManagedCCFListByResourceGroupNextResponse + - Added Type Alias ManagedCCFListByResourceGroupResponse + - Added Type Alias ManagedCCFListBySubscriptionNextResponse + - Added Type Alias ManagedCCFListBySubscriptionResponse + - Added Type Alias RunningState + - Interface ConfidentialLedger has a new optional parameter runningState + - Added Enum KnownLanguageRuntime + - Added Enum KnownRunningState + + ## 1.2.0 (2023-01-12) **Features** diff --git a/sdk/confidentialledger/arm-confidentialledger/README.md b/sdk/confidentialledger/arm-confidentialledger/README.md index f30526cc93c2..58330e3f12f0 100644 --- a/sdk/confidentialledger/arm-confidentialledger/README.md +++ b/sdk/confidentialledger/arm-confidentialledger/README.md @@ -6,7 +6,7 @@ Microsoft Azure Confidential Compute Ledger Control Plane REST API version 2020- [Source code](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/confidentialledger/arm-confidentialledger) | [Package (NPM)](https://www.npmjs.com/package/@azure/arm-confidentialledger) | -[API reference documentation](https://docs.microsoft.com/javascript/api/@azure/arm-confidentialledger) | +[API reference documentation](https://docs.microsoft.com/javascript/api/@azure/arm-confidentialledger?view=azure-node-preview) | [Samples](https://github.com/Azure-Samples/azure-samples-js-management) ## Getting started diff --git a/sdk/confidentialledger/arm-confidentialledger/_meta.json b/sdk/confidentialledger/arm-confidentialledger/_meta.json index f4529d259913..18ea890c62e6 100644 --- a/sdk/confidentialledger/arm-confidentialledger/_meta.json +++ b/sdk/confidentialledger/arm-confidentialledger/_meta.json @@ -1,8 +1,8 @@ { - "commit": "ac155b972d0619a6e5bf665a863fb05ee7eeb30f", - "readme": "specification\\confidentialledger\\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=F:\\azure-sdk-for-js ..\\azure-rest-api-specs\\specification\\confidentialledger\\resource-manager\\readme.md --use=@autorest/typescript@6.0.0-rc.5.20221215.1 --generate-sample=true", + "commit": "d6b373e6eb1ff1d68b27e394a3b754359fb61470", + "readme": "specification/confidentialledger/resource-manager/readme.md", + "autorest_command": "autorest --version=3.9.3 --typescript --modelerfour.lenient-model-deduplication --azure-arm --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=/mnt/vss/_work/1/s/azure-sdk-for-js ../azure-rest-api-specs/specification/confidentialledger/resource-manager/readme.md --use=@autorest/typescript@6.0.0-rc.5", "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", - "release_tool": "@azure-tools/js-sdk-release-tools@2.5.4", - "use": "@autorest/typescript@6.0.0-rc.5.20221215.1" + "release_tool": "@azure-tools/js-sdk-release-tools@2.6.2", + "use": "@autorest/typescript@6.0.0-rc.5" } \ No newline at end of file diff --git a/sdk/confidentialledger/arm-confidentialledger/package.json b/sdk/confidentialledger/arm-confidentialledger/package.json index 04d5e6e6fc6f..75d6661915ac 100644 --- a/sdk/confidentialledger/arm-confidentialledger/package.json +++ b/sdk/confidentialledger/arm-confidentialledger/package.json @@ -3,7 +3,7 @@ "sdk-type": "mgmt", "author": "Microsoft Corporation", "description": "A generated SDK for ConfidentialLedgerClient.", - "version": "1.2.1", + "version": "1.3.0-beta.1", "engines": { "node": ">=14.0.0" }, @@ -29,9 +29,9 @@ "types": "./types/arm-confidentialledger.d.ts", "devDependencies": { "@microsoft/api-extractor": "^7.31.1", - "@rollup/plugin-commonjs": "^24.0.0", - "@rollup/plugin-json": "^6.0.0", - "@rollup/plugin-multi-entry": "^6.0.0", + "@rollup/plugin-commonjs": "^21.0.1", + "@rollup/plugin-json": "^4.1.0", + "@rollup/plugin-multi-entry": "^4.1.0", "@rollup/plugin-node-resolve": "^13.1.3", "mkdirp": "^1.0.4", "rollup": "^2.66.1", @@ -39,7 +39,6 @@ "typescript": "~4.8.0", "uglify-js": "^3.4.9", "rimraf": "^3.0.0", - "dotenv": "^8.2.0", "@azure/identity": "^2.0.1", "@azure-tools/test-recorder": "^2.0.0", "@azure-tools/test-credential": "^1.0.0", @@ -50,6 +49,7 @@ "@types/node": "^14.0.0", "@azure/dev-tool": "^1.0.0" }, + "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/confidentialledger/arm-confidentialledger", "repository": { "type": "git", "url": "https://github.com/Azure/azure-sdk-for-js.git" @@ -110,14 +110,5 @@ } ] }, - "autoPublish": true, - "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/confidentialledger/arm-confidentialledger", - "//sampleConfiguration": { - "productName": "", - "productSlugs": [ - "azure" - ], - "disableDocsMs": true, - "apiRefLink": "https://docs.microsoft.com/javascript/api/@azure/arm-confidentialledger?view=azure-node-preview" - } -} + "autoPublish": true +} \ No newline at end of file diff --git a/sdk/confidentialledger/arm-confidentialledger/review/arm-confidentialledger.api.md b/sdk/confidentialledger/arm-confidentialledger/review/arm-confidentialledger.api.md index 1be70804aed1..271a12666269 100644 --- a/sdk/confidentialledger/arm-confidentialledger/review/arm-confidentialledger.api.md +++ b/sdk/confidentialledger/arm-confidentialledger/review/arm-confidentialledger.api.md @@ -23,6 +23,13 @@ export interface CertBasedSecurityPrincipal { ledgerRoleName?: LedgerRoleName; } +// @public +export interface CertificateTags { + tags?: { + [propertyName: string]: string; + }; +} + // @public export type CheckNameAvailabilityOperationResponse = CheckNameAvailabilityResponse; @@ -47,8 +54,9 @@ export interface CheckNameAvailabilityResponse { } // @public -export interface ConfidentialLedger extends Resource, ResourceLocation, Tags { +export interface ConfidentialLedger extends TrackedResource, Tags { properties?: LedgerProperties; + runningState?: RunningState; } // @public (undocumented) @@ -62,6 +70,8 @@ export class ConfidentialLedgerClient extends coreClient.ServiceClient { // (undocumented) ledger: Ledger; // (undocumented) + managedCCFOperations: ManagedCCFOperations; + // (undocumented) operations: Operations; // (undocumented) subscriptionId: string; @@ -83,6 +93,12 @@ export interface ConfidentialLedgerList { // @public export type CreatedByType = string; +// @public +export interface DeploymentType { + appSourceUri?: string; + languageRuntime?: LanguageRuntime; +} + // @public export interface ErrorAdditionalInfo { readonly info?: Record; @@ -120,6 +136,12 @@ export enum KnownCreatedByType { User = "User" } +// @public +export enum KnownLanguageRuntime { + CPP = "CPP", + JS = "JS" +} + // @public export enum KnownLedgerRoleName { Administrator = "Administrator", @@ -145,6 +167,18 @@ export enum KnownProvisioningState { Updating = "Updating" } +// @public +export enum KnownRunningState { + Active = "Active", + Paused = "Paused", + Pausing = "Pausing", + Resuming = "Resuming", + Unknown = "Unknown" +} + +// @public +export type LanguageRuntime = string; + // @public export interface Ledger { beginCreate(resourceGroupName: string, ledgerName: string, confidentialLedger: ConfidentialLedger, options?: LedgerCreateOptionalParams): Promise, LedgerCreateResponse>>; @@ -237,6 +271,105 @@ export interface LedgerUpdateOptionalParams extends coreClient.OperationOptions // @public export type LedgerUpdateResponse = ConfidentialLedger; +// @public +export interface ManagedCCF extends TrackedResource { + properties?: ManagedCCFProperties; +} + +// @public +export interface ManagedCCFCreateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type ManagedCCFCreateResponse = ManagedCCF; + +// @public +export interface ManagedCCFDeleteOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export interface ManagedCCFGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ManagedCCFGetResponse = ManagedCCF; + +// @public +export interface ManagedCCFList { + nextLink?: string; + value?: ManagedCCF[]; +} + +// @public +export interface ManagedCCFListByResourceGroupNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ManagedCCFListByResourceGroupNextResponse = ManagedCCFList; + +// @public +export interface ManagedCCFListByResourceGroupOptionalParams extends coreClient.OperationOptions { + filter?: string; +} + +// @public +export type ManagedCCFListByResourceGroupResponse = ManagedCCFList; + +// @public +export interface ManagedCCFListBySubscriptionNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ManagedCCFListBySubscriptionNextResponse = ManagedCCFList; + +// @public +export interface ManagedCCFListBySubscriptionOptionalParams extends coreClient.OperationOptions { + filter?: string; +} + +// @public +export type ManagedCCFListBySubscriptionResponse = ManagedCCFList; + +// @public +export interface ManagedCCFOperations { + beginCreate(resourceGroupName: string, appName: string, managedCCF: ManagedCCF, options?: ManagedCCFCreateOptionalParams): Promise, ManagedCCFCreateResponse>>; + beginCreateAndWait(resourceGroupName: string, appName: string, managedCCF: ManagedCCF, options?: ManagedCCFCreateOptionalParams): Promise; + beginDelete(resourceGroupName: string, appName: string, options?: ManagedCCFDeleteOptionalParams): Promise, void>>; + beginDeleteAndWait(resourceGroupName: string, appName: string, options?: ManagedCCFDeleteOptionalParams): Promise; + beginUpdate(resourceGroupName: string, appName: string, managedCCF: ManagedCCF, options?: ManagedCCFUpdateOptionalParams): Promise, void>>; + beginUpdateAndWait(resourceGroupName: string, appName: string, managedCCF: ManagedCCF, options?: ManagedCCFUpdateOptionalParams): Promise; + get(resourceGroupName: string, appName: string, options?: ManagedCCFGetOptionalParams): Promise; + listByResourceGroup(resourceGroupName: string, options?: ManagedCCFListByResourceGroupOptionalParams): PagedAsyncIterableIterator; + listBySubscription(options?: ManagedCCFListBySubscriptionOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface ManagedCCFProperties { + readonly appName?: string; + readonly appUri?: string; + deploymentType?: DeploymentType; + readonly identityServiceUri?: string; + memberIdentityCertificates?: MemberIdentityCertificate[]; + readonly provisioningState?: ProvisioningState; +} + +// @public +export interface ManagedCCFUpdateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export interface MemberIdentityCertificate { + certificate?: string; + encryptionkey?: string; + tags?: any; +} + // @public export interface Operations { list(options?: OperationsListOptionalParams): PagedAsyncIterableIterator; @@ -267,11 +400,6 @@ export interface Resource { readonly type?: string; } -// @public -export interface ResourceLocation { - location?: string; -} - // @public export interface ResourceProviderOperationDefinition { display?: ResourceProviderOperationDisplay; @@ -293,6 +421,9 @@ export interface ResourceProviderOperationList { readonly value?: ResourceProviderOperationDefinition[]; } +// @public +export type RunningState = string; + // @public export interface SystemData { createdAt?: Date; @@ -310,6 +441,14 @@ export interface Tags { }; } +// @public +export interface TrackedResource extends Resource { + location: string; + tags?: { + [propertyName: string]: string; + }; +} + // (No @packageDocumentation comment for this package) ``` diff --git a/sdk/confidentialledger/arm-confidentialledger/src/confidentialLedgerClient.ts b/sdk/confidentialledger/arm-confidentialledger/src/confidentialLedgerClient.ts index 6a8b9541d8dd..c43fd325218e 100644 --- a/sdk/confidentialledger/arm-confidentialledger/src/confidentialLedgerClient.ts +++ b/sdk/confidentialledger/arm-confidentialledger/src/confidentialLedgerClient.ts @@ -14,8 +14,16 @@ import { SendRequest } from "@azure/core-rest-pipeline"; import * as coreAuth from "@azure/core-auth"; -import { OperationsImpl, LedgerImpl } from "./operations"; -import { Operations, Ledger } from "./operationsInterfaces"; +import { + OperationsImpl, + LedgerImpl, + ManagedCCFOperationsImpl +} from "./operations"; +import { + Operations, + Ledger, + ManagedCCFOperations +} from "./operationsInterfaces"; import * as Parameters from "./models/parameters"; import * as Mappers from "./models/mappers"; import { @@ -33,8 +41,7 @@ export class ConfidentialLedgerClient extends coreClient.ServiceClient { /** * Initializes a new instance of the ConfidentialLedgerClient class. * @param credentials Subscription credentials which uniquely identify client subscription. - * @param subscriptionId The Azure subscription ID. This is a GUID-formatted string (e.g. - * 00000000-0000-0000-0000-000000000000) + * @param subscriptionId The ID of the target subscription. * @param options The parameter options */ constructor( @@ -58,7 +65,7 @@ export class ConfidentialLedgerClient extends coreClient.ServiceClient { credential: credentials }; - const packageDetails = `azsdk-js-arm-confidentialledger/1.2.1`; + const packageDetails = `azsdk-js-arm-confidentialledger/1.3.0-beta.1`; const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` @@ -111,9 +118,10 @@ export class ConfidentialLedgerClient extends coreClient.ServiceClient { // Assigning values to Constant parameters this.$host = options.$host || "https://management.azure.com"; - this.apiVersion = options.apiVersion || "2022-05-13"; + this.apiVersion = options.apiVersion || "2023-01-26-preview"; this.operations = new OperationsImpl(this); this.ledger = new LedgerImpl(this); + this.managedCCFOperations = new ManagedCCFOperationsImpl(this); this.addCustomApiVersionPolicy(options.apiVersion); } @@ -162,6 +170,7 @@ export class ConfidentialLedgerClient extends coreClient.ServiceClient { operations: Operations; ledger: Ledger; + managedCCFOperations: ManagedCCFOperations; } // Operation Specifications const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); diff --git a/sdk/confidentialledger/arm-confidentialledger/src/models/index.ts b/sdk/confidentialledger/arm-confidentialledger/src/models/index.ts index 8ad6ffad13b2..9fb21dff0970 100644 --- a/sdk/confidentialledger/arm-confidentialledger/src/models/index.ts +++ b/sdk/confidentialledger/arm-confidentialledger/src/models/index.ts @@ -164,25 +164,25 @@ export interface CertBasedSecurityPrincipal { ledgerRoleName?: LedgerRoleName; } -/** An Azure resource. */ +/** Common fields that are returned in the response for all Azure Resource Manager resources */ export interface Resource { /** - * Name of the Resource. + * Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly name?: string; + readonly id?: string; /** - * Fully qualified resource Id for the resource. + * The name of the resource * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly id?: string; + readonly name?: string; /** - * The type of the resource. + * The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly type?: string; /** - * Metadata pertaining to creation and last modification of the resource + * Azure Resource Manager metadata containing createdBy and modifiedBy information. * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly systemData?: SystemData; @@ -204,12 +204,6 @@ export interface SystemData { lastModifiedAt?: Date; } -/** Location of the ARM Resource */ -export interface ResourceLocation { - /** The Azure location where the Confidential Ledger is running. */ - location?: string; -} - /** Tags for Confidential Ledger Resource */ export interface Tags { /** Additional tags for Confidential Ledger */ @@ -224,12 +218,88 @@ export interface ConfidentialLedgerList { nextLink?: string; } +/** Additional Managed CCF properties. */ +export interface ManagedCCFProperties { + /** + * Unique name for the Managed CCF. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly appName?: string; + /** + * Endpoint for calling Managed CCF Service. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly appUri?: string; + /** + * Endpoint for accessing network identity. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly identityServiceUri?: string; + /** List of member identity certificates for Managed CCF */ + memberIdentityCertificates?: MemberIdentityCertificate[]; + /** Deployment Type of Managed CCF */ + deploymentType?: DeploymentType; + /** + * Provisioning state of Ledger Resource + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly provisioningState?: ProvisioningState; +} + +/** Object representing MemberIdentityCertificate for Managed CCF. */ +export interface MemberIdentityCertificate { + /** Member Identity Certificate */ + certificate?: string; + /** Member Identity Certificate Encryption Key */ + encryptionkey?: string; + /** Anything */ + tags?: any; +} + +/** Object representing DeploymentType for Managed CCF. */ +export interface DeploymentType { + /** Unique name for the Managed CCF. */ + languageRuntime?: LanguageRuntime; + /** Source Uri containing ManagedCCF code */ + appSourceUri?: string; +} + +/** Object that includes an array of Managed CCF and a possible link for next set. */ +export interface ManagedCCFList { + /** List of Managed CCF */ + value?: ManagedCCF[]; + /** The URL the client should use to fetch the next page (per server side paging). */ + nextLink?: string; +} + +/** Tags for Managed CCF Certificates */ +export interface CertificateTags { + /** Additional tags for Managed CCF Certificates */ + tags?: { [propertyName: string]: string }; +} + +/** The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location' */ +export interface TrackedResource extends Resource { + /** Resource tags. */ + tags?: { [propertyName: string]: string }; + /** The geo-location where the resource lives */ + location: string; +} + /** Confidential Ledger. Contains the properties of Confidential Ledger Resource. */ -export interface ConfidentialLedger extends Resource, ResourceLocation, Tags { +export interface ConfidentialLedger extends TrackedResource, Tags { + /** Object representing RunningState for Ledger. */ + runningState?: RunningState; /** Properties of Confidential Ledger Resource. */ properties?: LedgerProperties; } +/** Managed CCF. Contains the properties of Managed CCF Resource. */ +export interface ManagedCCF extends TrackedResource { + /** Properties of Managed CCF Resource. */ + properties?: ManagedCCFProperties; +} + /** Known values of {@link CheckNameAvailabilityReason} that the service accepts. */ export enum KnownCheckNameAvailabilityReason { /** Invalid */ @@ -248,6 +318,33 @@ export enum KnownCheckNameAvailabilityReason { */ export type CheckNameAvailabilityReason = string; +/** Known values of {@link RunningState} that the service accepts. */ +export enum KnownRunningState { + /** Active */ + Active = "Active", + /** Paused */ + Paused = "Paused", + /** Unknown */ + Unknown = "Unknown", + /** Pausing */ + Pausing = "Pausing", + /** Resuming */ + Resuming = "Resuming" +} + +/** + * Defines values for RunningState. \ + * {@link KnownRunningState} can be used interchangeably with RunningState, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Active** \ + * **Paused** \ + * **Unknown** \ + * **Pausing** \ + * **Resuming** + */ +export type RunningState = string; + /** Known values of {@link LedgerType} that the service accepts. */ export enum KnownLedgerType { /** Unknown */ @@ -347,6 +444,24 @@ export enum KnownCreatedByType { */ export type CreatedByType = string; +/** Known values of {@link LanguageRuntime} that the service accepts. */ +export enum KnownLanguageRuntime { + /** CPP */ + CPP = "CPP", + /** JS */ + JS = "JS" +} + +/** + * Defines values for LanguageRuntime. \ + * {@link KnownLanguageRuntime} can be used interchangeably with LanguageRuntime, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **CPP** \ + * **JS** + */ +export type LanguageRuntime = string; + /** Optional parameters. */ export interface OperationsListOptionalParams extends coreClient.OperationOptions {} @@ -441,6 +556,77 @@ export interface LedgerListBySubscriptionNextOptionalParams /** Contains response data for the listBySubscriptionNext operation. */ export type LedgerListBySubscriptionNextResponse = ConfidentialLedgerList; +/** Optional parameters. */ +export interface ManagedCCFGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type ManagedCCFGetResponse = ManagedCCF; + +/** Optional parameters. */ +export interface ManagedCCFDeleteOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Optional parameters. */ +export interface ManagedCCFCreateOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Contains response data for the create operation. */ +export type ManagedCCFCreateResponse = ManagedCCF; + +/** Optional parameters. */ +export interface ManagedCCFUpdateOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Optional parameters. */ +export interface ManagedCCFListByResourceGroupOptionalParams + extends coreClient.OperationOptions { + /** The filter to apply on the list operation. eg. $filter=ledgerType eq 'Public' */ + filter?: string; +} + +/** Contains response data for the listByResourceGroup operation. */ +export type ManagedCCFListByResourceGroupResponse = ManagedCCFList; + +/** Optional parameters. */ +export interface ManagedCCFListBySubscriptionOptionalParams + extends coreClient.OperationOptions { + /** The filter to apply on the list operation. eg. $filter=ledgerType eq 'Public' */ + filter?: string; +} + +/** Contains response data for the listBySubscription operation. */ +export type ManagedCCFListBySubscriptionResponse = ManagedCCFList; + +/** Optional parameters. */ +export interface ManagedCCFListByResourceGroupNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByResourceGroupNext operation. */ +export type ManagedCCFListByResourceGroupNextResponse = ManagedCCFList; + +/** Optional parameters. */ +export interface ManagedCCFListBySubscriptionNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listBySubscriptionNext operation. */ +export type ManagedCCFListBySubscriptionNextResponse = ManagedCCFList; + /** Optional parameters. */ export interface ConfidentialLedgerClientOptionalParams extends coreClient.ServiceClientOptions { diff --git a/sdk/confidentialledger/arm-confidentialledger/src/models/mappers.ts b/sdk/confidentialledger/arm-confidentialledger/src/models/mappers.ts index 1793484fb218..71d4bacf94b9 100644 --- a/sdk/confidentialledger/arm-confidentialledger/src/models/mappers.ts +++ b/sdk/confidentialledger/arm-confidentialledger/src/models/mappers.ts @@ -369,15 +369,15 @@ export const Resource: coreClient.CompositeMapper = { name: "Composite", className: "Resource", modelProperties: { - name: { - serializedName: "name", + id: { + serializedName: "id", readOnly: true, type: { name: "String" } }, - id: { - serializedName: "id", + name: { + serializedName: "name", readOnly: true, type: { name: "String" @@ -446,13 +446,41 @@ export const SystemData: coreClient.CompositeMapper = { } }; -export const ResourceLocation: coreClient.CompositeMapper = { +export const Tags: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ResourceLocation", + className: "Tags", modelProperties: { - location: { - serializedName: "location", + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { type: { name: "String" } } + } + } + } + } +}; + +export const ConfidentialLedgerList: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ConfidentialLedgerList", + modelProperties: { + value: { + serializedName: "value", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ConfidentialLedger" + } + } + } + }, + nextLink: { + serializedName: "nextLink", type: { name: "String" } @@ -461,26 +489,114 @@ export const ResourceLocation: coreClient.CompositeMapper = { } }; -export const Tags: coreClient.CompositeMapper = { +export const ManagedCCFProperties: coreClient.CompositeMapper = { type: { name: "Composite", - className: "Tags", + className: "ManagedCCFProperties", modelProperties: { + appName: { + serializedName: "appName", + readOnly: true, + type: { + name: "String" + } + }, + appUri: { + serializedName: "appUri", + readOnly: true, + type: { + name: "String" + } + }, + identityServiceUri: { + serializedName: "identityServiceUri", + readOnly: true, + type: { + name: "String" + } + }, + memberIdentityCertificates: { + serializedName: "memberIdentityCertificates", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "MemberIdentityCertificate" + } + } + } + }, + deploymentType: { + serializedName: "deploymentType", + type: { + name: "Composite", + className: "DeploymentType" + } + }, + provisioningState: { + serializedName: "provisioningState", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const MemberIdentityCertificate: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "MemberIdentityCertificate", + modelProperties: { + certificate: { + serializedName: "certificate", + type: { + name: "String" + } + }, + encryptionkey: { + serializedName: "encryptionkey", + type: { + name: "String" + } + }, tags: { serializedName: "tags", type: { - name: "Dictionary", - value: { type: { name: "String" } } + name: "any" } } } } }; -export const ConfidentialLedgerList: coreClient.CompositeMapper = { +export const DeploymentType: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ConfidentialLedgerList", + className: "DeploymentType", + modelProperties: { + languageRuntime: { + serializedName: "languageRuntime", + type: { + name: "String" + } + }, + appSourceUri: { + serializedName: "appSourceUri", + type: { + name: "String" + } + } + } + } +}; + +export const ManagedCCFList: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ManagedCCFList", modelProperties: { value: { serializedName: "value", @@ -489,7 +605,7 @@ export const ConfidentialLedgerList: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "ConfidentialLedger" + className: "ManagedCCF" } } } @@ -504,14 +620,59 @@ export const ConfidentialLedgerList: coreClient.CompositeMapper = { } }; +export const CertificateTags: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "CertificateTags", + modelProperties: { + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { type: { name: "String" } } + } + } + } + } +}; + +export const TrackedResource: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "TrackedResource", + modelProperties: { + ...Resource.type.modelProperties, + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { type: { name: "String" } } + } + }, + location: { + serializedName: "location", + required: true, + type: { + name: "String" + } + } + } + } +}; + export const ConfidentialLedger: coreClient.CompositeMapper = { type: { name: "Composite", className: "ConfidentialLedger", modelProperties: { - ...Resource.type.modelProperties, - ...ResourceLocation.type.modelProperties, + ...TrackedResource.type.modelProperties, ...Tags.type.modelProperties, + runningState: { + serializedName: "runningState", + type: { + name: "String" + } + }, properties: { serializedName: "properties", type: { @@ -522,3 +683,20 @@ export const ConfidentialLedger: coreClient.CompositeMapper = { } } }; + +export const ManagedCCF: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ManagedCCF", + modelProperties: { + ...TrackedResource.type.modelProperties, + properties: { + serializedName: "properties", + type: { + name: "Composite", + className: "ManagedCCFProperties" + } + } + } + } +}; diff --git a/sdk/confidentialledger/arm-confidentialledger/src/models/parameters.ts b/sdk/confidentialledger/arm-confidentialledger/src/models/parameters.ts index 4ffa6f786f43..c5e868499cc2 100644 --- a/sdk/confidentialledger/arm-confidentialledger/src/models/parameters.ts +++ b/sdk/confidentialledger/arm-confidentialledger/src/models/parameters.ts @@ -13,7 +13,8 @@ import { } from "@azure/core-client"; import { CheckNameAvailabilityRequest as CheckNameAvailabilityRequestMapper, - ConfidentialLedger as ConfidentialLedgerMapper + ConfidentialLedger as ConfidentialLedgerMapper, + ManagedCCF as ManagedCCFMapper } from "../models/mappers"; export const accept: OperationParameter = { @@ -43,7 +44,7 @@ export const $host: OperationURLParameter = { export const apiVersion: OperationQueryParameter = { parameterPath: "apiVersion", mapper: { - defaultValue: "2022-05-13", + defaultValue: "2023-01-26-preview", isConstant: true, serializedName: "api-version", type: { @@ -84,6 +85,9 @@ export const nameAvailabilityRequest: OperationParameter = { export const subscriptionId: OperationURLParameter = { parameterPath: "subscriptionId", mapper: { + constraints: { + MinLength: 1 + }, serializedName: "subscriptionId", required: true, type: { @@ -97,7 +101,7 @@ export const resourceGroupName: OperationURLParameter = { mapper: { constraints: { MaxLength: 90, - MinLength: 3 + MinLength: 1 }, serializedName: "resourceGroupName", required: true, @@ -135,3 +139,22 @@ export const filter: OperationQueryParameter = { } } }; + +export const appName: OperationURLParameter = { + parameterPath: "appName", + mapper: { + constraints: { + Pattern: new RegExp("^[a-zA-Z0-9]") + }, + serializedName: "appName", + required: true, + type: { + name: "String" + } + } +}; + +export const managedCCF: OperationParameter = { + parameterPath: "managedCCF", + mapper: ManagedCCFMapper +}; diff --git a/sdk/confidentialledger/arm-confidentialledger/src/operations/index.ts b/sdk/confidentialledger/arm-confidentialledger/src/operations/index.ts index 55550f1acb43..62062ecc15d3 100644 --- a/sdk/confidentialledger/arm-confidentialledger/src/operations/index.ts +++ b/sdk/confidentialledger/arm-confidentialledger/src/operations/index.ts @@ -8,3 +8,4 @@ export * from "./operations"; export * from "./ledger"; +export * from "./managedCCFOperations"; diff --git a/sdk/confidentialledger/arm-confidentialledger/src/operations/ledger.ts b/sdk/confidentialledger/arm-confidentialledger/src/operations/ledger.ts index e278ad97e929..96fcaafc39c7 100644 --- a/sdk/confidentialledger/arm-confidentialledger/src/operations/ledger.ts +++ b/sdk/confidentialledger/arm-confidentialledger/src/operations/ledger.ts @@ -49,7 +49,7 @@ export class LedgerImpl implements Ledger { /** * Retrieves the properties of all Confidential Ledgers. - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param options The options parameters. */ public listByResourceGroup( @@ -172,7 +172,7 @@ export class LedgerImpl implements Ledger { /** * Retrieves the properties of a Confidential Ledger. - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param ledgerName Name of the Confidential Ledger * @param options The options parameters. */ @@ -189,7 +189,7 @@ export class LedgerImpl implements Ledger { /** * Deletes an existing Confidential Ledger. - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param ledgerName Name of the Confidential Ledger * @param options The options parameters. */ @@ -252,7 +252,7 @@ export class LedgerImpl implements Ledger { /** * Deletes an existing Confidential Ledger. - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param ledgerName Name of the Confidential Ledger * @param options The options parameters. */ @@ -271,7 +271,7 @@ export class LedgerImpl implements Ledger { /** * Creates a Confidential Ledger with the specified ledger parameters. - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param ledgerName Name of the Confidential Ledger * @param confidentialLedger Confidential Ledger Create Request Body * @param options The options parameters. @@ -339,7 +339,7 @@ export class LedgerImpl implements Ledger { /** * Creates a Confidential Ledger with the specified ledger parameters. - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param ledgerName Name of the Confidential Ledger * @param confidentialLedger Confidential Ledger Create Request Body * @param options The options parameters. @@ -361,7 +361,7 @@ export class LedgerImpl implements Ledger { /** * Updates properties of Confidential Ledger - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param ledgerName Name of the Confidential Ledger * @param confidentialLedger Confidential Ledger request body for Updating Ledger * @param options The options parameters. @@ -428,7 +428,7 @@ export class LedgerImpl implements Ledger { /** * Updates properties of Confidential Ledger - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param ledgerName Name of the Confidential Ledger * @param confidentialLedger Confidential Ledger request body for Updating Ledger * @param options The options parameters. @@ -450,7 +450,7 @@ export class LedgerImpl implements Ledger { /** * Retrieves the properties of all Confidential Ledgers. - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param options The options parameters. */ private _listByResourceGroup( @@ -478,7 +478,7 @@ export class LedgerImpl implements Ledger { /** * ListByResourceGroupNext - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param nextLink The nextLink from the previous successful call to the ListByResourceGroup method. * @param options The options parameters. */ diff --git a/sdk/confidentialledger/arm-confidentialledger/src/operations/managedCCFOperations.ts b/sdk/confidentialledger/arm-confidentialledger/src/operations/managedCCFOperations.ts new file mode 100644 index 000000000000..23e5a9693800 --- /dev/null +++ b/sdk/confidentialledger/arm-confidentialledger/src/operations/managedCCFOperations.ts @@ -0,0 +1,689 @@ +/* + * 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, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; +import { ManagedCCFOperations } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { ConfidentialLedgerClient } from "../confidentialLedgerClient"; +import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; +import { LroImpl } from "../lroImpl"; +import { + ManagedCCF, + ManagedCCFListByResourceGroupNextOptionalParams, + ManagedCCFListByResourceGroupOptionalParams, + ManagedCCFListByResourceGroupResponse, + ManagedCCFListBySubscriptionNextOptionalParams, + ManagedCCFListBySubscriptionOptionalParams, + ManagedCCFListBySubscriptionResponse, + ManagedCCFGetOptionalParams, + ManagedCCFGetResponse, + ManagedCCFDeleteOptionalParams, + ManagedCCFCreateOptionalParams, + ManagedCCFCreateResponse, + ManagedCCFUpdateOptionalParams, + ManagedCCFListByResourceGroupNextResponse, + ManagedCCFListBySubscriptionNextResponse +} from "../models"; + +/// +/** Class containing ManagedCCFOperations operations. */ +export class ManagedCCFOperationsImpl implements ManagedCCFOperations { + private readonly client: ConfidentialLedgerClient; + + /** + * Initialize a new instance of the class ManagedCCFOperations class. + * @param client Reference to the service client + */ + constructor(client: ConfidentialLedgerClient) { + this.client = client; + } + + /** + * Retrieves the properties of all Managed CCF apps. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param options The options parameters. + */ + public listByResourceGroup( + resourceGroupName: string, + options?: ManagedCCFListByResourceGroupOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listByResourceGroupPagingAll(resourceGroupName, options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listByResourceGroupPagingPage( + resourceGroupName, + options, + settings + ); + } + }; + } + + private async *listByResourceGroupPagingPage( + resourceGroupName: string, + options?: ManagedCCFListByResourceGroupOptionalParams, + settings?: PageSettings + ): AsyncIterableIterator { + let result: ManagedCCFListByResourceGroupResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listByResourceGroup(resourceGroupName, options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listByResourceGroupNext( + resourceGroupName, + continuationToken, + options + ); + continuationToken = result.nextLink; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *listByResourceGroupPagingAll( + resourceGroupName: string, + options?: ManagedCCFListByResourceGroupOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByResourceGroupPagingPage( + resourceGroupName, + options + )) { + yield* page; + } + } + + /** + * Retrieves the properties of all Managed CCF. + * @param options The options parameters. + */ + public listBySubscription( + options?: ManagedCCFListBySubscriptionOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listBySubscriptionPagingAll(options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listBySubscriptionPagingPage(options, settings); + } + }; + } + + private async *listBySubscriptionPagingPage( + options?: ManagedCCFListBySubscriptionOptionalParams, + settings?: PageSettings + ): AsyncIterableIterator { + let result: ManagedCCFListBySubscriptionResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listBySubscription(options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listBySubscriptionNext(continuationToken, options); + continuationToken = result.nextLink; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *listBySubscriptionPagingAll( + options?: ManagedCCFListBySubscriptionOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listBySubscriptionPagingPage(options)) { + yield* page; + } + } + + /** + * Retrieves the properties of a Managed CCF app. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appName Name of the Managed CCF + * @param options The options parameters. + */ + get( + resourceGroupName: string, + appName: string, + options?: ManagedCCFGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, appName, options }, + getOperationSpec + ); + } + + /** + * Deletes an existing Managed CCF. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appName Name of the Managed CCF + * @param options The options parameters. + */ + async beginDelete( + resourceGroupName: string, + appName: string, + options?: ManagedCCFDeleteOptionalParams + ): Promise, void>> { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = new LroImpl( + sendOperation, + { resourceGroupName, appName, options }, + deleteOperationSpec + ); + const poller = new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); + await poller.poll(); + return poller; + } + + /** + * Deletes an existing Managed CCF. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appName Name of the Managed CCF + * @param options The options parameters. + */ + async beginDeleteAndWait( + resourceGroupName: string, + appName: string, + options?: ManagedCCFDeleteOptionalParams + ): Promise { + const poller = await this.beginDelete(resourceGroupName, appName, options); + return poller.pollUntilDone(); + } + + /** + * Creates a Managed CCF with the specified Managed CCF parameters. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appName Name of the Managed CCF + * @param managedCCF Managed CCF Create Request Body + * @param options The options parameters. + */ + async beginCreate( + resourceGroupName: string, + appName: string, + managedCCF: ManagedCCF, + options?: ManagedCCFCreateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + ManagedCCFCreateResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = new LroImpl( + sendOperation, + { resourceGroupName, appName, managedCCF, options }, + createOperationSpec + ); + const poller = new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + lroResourceLocationConfig: "azure-async-operation" + }); + await poller.poll(); + return poller; + } + + /** + * Creates a Managed CCF with the specified Managed CCF parameters. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appName Name of the Managed CCF + * @param managedCCF Managed CCF Create Request Body + * @param options The options parameters. + */ + async beginCreateAndWait( + resourceGroupName: string, + appName: string, + managedCCF: ManagedCCF, + options?: ManagedCCFCreateOptionalParams + ): Promise { + const poller = await this.beginCreate( + resourceGroupName, + appName, + managedCCF, + options + ); + return poller.pollUntilDone(); + } + + /** + * Updates properties of Managed CCF + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appName Name of the Managed CCF + * @param managedCCF Request body for Updating Managed CCF App + * @param options The options parameters. + */ + async beginUpdate( + resourceGroupName: string, + appName: string, + managedCCF: ManagedCCF, + options?: ManagedCCFUpdateOptionalParams + ): Promise, void>> { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = new LroImpl( + sendOperation, + { resourceGroupName, appName, managedCCF, options }, + updateOperationSpec + ); + const poller = new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); + await poller.poll(); + return poller; + } + + /** + * Updates properties of Managed CCF + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appName Name of the Managed CCF + * @param managedCCF Request body for Updating Managed CCF App + * @param options The options parameters. + */ + async beginUpdateAndWait( + resourceGroupName: string, + appName: string, + managedCCF: ManagedCCF, + options?: ManagedCCFUpdateOptionalParams + ): Promise { + const poller = await this.beginUpdate( + resourceGroupName, + appName, + managedCCF, + options + ); + return poller.pollUntilDone(); + } + + /** + * Retrieves the properties of all Managed CCF apps. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param options The options parameters. + */ + private _listByResourceGroup( + resourceGroupName: string, + options?: ManagedCCFListByResourceGroupOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, options }, + listByResourceGroupOperationSpec + ); + } + + /** + * Retrieves the properties of all Managed CCF. + * @param options The options parameters. + */ + private _listBySubscription( + options?: ManagedCCFListBySubscriptionOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { options }, + listBySubscriptionOperationSpec + ); + } + + /** + * ListByResourceGroupNext + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param nextLink The nextLink from the previous successful call to the ListByResourceGroup method. + * @param options The options parameters. + */ + private _listByResourceGroupNext( + resourceGroupName: string, + nextLink: string, + options?: ManagedCCFListByResourceGroupNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, nextLink, options }, + listByResourceGroupNextOperationSpec + ); + } + + /** + * ListBySubscriptionNext + * @param nextLink The nextLink from the previous successful call to the ListBySubscription method. + * @param options The options parameters. + */ + private _listBySubscriptionNext( + nextLink: string, + options?: ManagedCCFListBySubscriptionNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { nextLink, options }, + listBySubscriptionNextOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConfidentialLedger/managedCCFs/{appName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.ManagedCCF + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.appName + ], + headerParameters: [Parameters.accept], + serializer +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConfidentialLedger/managedCCFs/{appName}", + httpMethod: "DELETE", + responses: { + 200: {}, + 201: {}, + 202: {}, + 204: {}, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.appName + ], + headerParameters: [Parameters.accept], + serializer +}; +const createOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConfidentialLedger/managedCCFs/{appName}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.ManagedCCF + }, + 201: { + bodyMapper: Mappers.ManagedCCF + }, + 202: { + bodyMapper: Mappers.ManagedCCF + }, + 204: { + bodyMapper: Mappers.ManagedCCF + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.managedCCF, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.appName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const updateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConfidentialLedger/managedCCFs/{appName}", + httpMethod: "PATCH", + responses: { + 200: {}, + 201: {}, + 202: {}, + 204: {}, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.managedCCF, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.appName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const listByResourceGroupOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConfidentialLedger/managedCCFs", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.ManagedCCFList + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion, Parameters.filter], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName + ], + headerParameters: [Parameters.accept], + serializer +}; +const listBySubscriptionOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/providers/Microsoft.ConfidentialLedger/managedCCFs/", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.ManagedCCFList + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion, Parameters.filter], + urlParameters: [Parameters.$host, Parameters.subscriptionId], + headerParameters: [Parameters.accept], + serializer +}; +const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.ManagedCCFList + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + urlParameters: [ + Parameters.$host, + Parameters.nextLink, + Parameters.subscriptionId, + Parameters.resourceGroupName + ], + headerParameters: [Parameters.accept], + serializer +}; +const listBySubscriptionNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.ManagedCCFList + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + urlParameters: [ + Parameters.$host, + Parameters.nextLink, + Parameters.subscriptionId + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/confidentialledger/arm-confidentialledger/src/operationsInterfaces/index.ts b/sdk/confidentialledger/arm-confidentialledger/src/operationsInterfaces/index.ts index 55550f1acb43..62062ecc15d3 100644 --- a/sdk/confidentialledger/arm-confidentialledger/src/operationsInterfaces/index.ts +++ b/sdk/confidentialledger/arm-confidentialledger/src/operationsInterfaces/index.ts @@ -8,3 +8,4 @@ export * from "./operations"; export * from "./ledger"; +export * from "./managedCCFOperations"; diff --git a/sdk/confidentialledger/arm-confidentialledger/src/operationsInterfaces/ledger.ts b/sdk/confidentialledger/arm-confidentialledger/src/operationsInterfaces/ledger.ts index 249212c68f9f..7b586b90367e 100644 --- a/sdk/confidentialledger/arm-confidentialledger/src/operationsInterfaces/ledger.ts +++ b/sdk/confidentialledger/arm-confidentialledger/src/operationsInterfaces/ledger.ts @@ -26,7 +26,7 @@ import { export interface Ledger { /** * Retrieves the properties of all Confidential Ledgers. - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param options The options parameters. */ listByResourceGroup( @@ -42,7 +42,7 @@ export interface Ledger { ): PagedAsyncIterableIterator; /** * Retrieves the properties of a Confidential Ledger. - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param ledgerName Name of the Confidential Ledger * @param options The options parameters. */ @@ -53,7 +53,7 @@ export interface Ledger { ): Promise; /** * Deletes an existing Confidential Ledger. - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param ledgerName Name of the Confidential Ledger * @param options The options parameters. */ @@ -64,7 +64,7 @@ export interface Ledger { ): Promise, void>>; /** * Deletes an existing Confidential Ledger. - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param ledgerName Name of the Confidential Ledger * @param options The options parameters. */ @@ -75,7 +75,7 @@ export interface Ledger { ): Promise; /** * Creates a Confidential Ledger with the specified ledger parameters. - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param ledgerName Name of the Confidential Ledger * @param confidentialLedger Confidential Ledger Create Request Body * @param options The options parameters. @@ -90,7 +90,7 @@ export interface Ledger { >; /** * Creates a Confidential Ledger with the specified ledger parameters. - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param ledgerName Name of the Confidential Ledger * @param confidentialLedger Confidential Ledger Create Request Body * @param options The options parameters. @@ -103,7 +103,7 @@ export interface Ledger { ): Promise; /** * Updates properties of Confidential Ledger - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param ledgerName Name of the Confidential Ledger * @param confidentialLedger Confidential Ledger request body for Updating Ledger * @param options The options parameters. @@ -118,7 +118,7 @@ export interface Ledger { >; /** * Updates properties of Confidential Ledger - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param ledgerName Name of the Confidential Ledger * @param confidentialLedger Confidential Ledger request body for Updating Ledger * @param options The options parameters. diff --git a/sdk/confidentialledger/arm-confidentialledger/src/operationsInterfaces/managedCCFOperations.ts b/sdk/confidentialledger/arm-confidentialledger/src/operationsInterfaces/managedCCFOperations.ts new file mode 100644 index 000000000000..e43e10b589b4 --- /dev/null +++ b/sdk/confidentialledger/arm-confidentialledger/src/operationsInterfaces/managedCCFOperations.ts @@ -0,0 +1,132 @@ +/* + * 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 { PollerLike, PollOperationState } from "@azure/core-lro"; +import { + ManagedCCF, + ManagedCCFListByResourceGroupOptionalParams, + ManagedCCFListBySubscriptionOptionalParams, + ManagedCCFGetOptionalParams, + ManagedCCFGetResponse, + ManagedCCFDeleteOptionalParams, + ManagedCCFCreateOptionalParams, + ManagedCCFCreateResponse, + ManagedCCFUpdateOptionalParams +} from "../models"; + +/// +/** Interface representing a ManagedCCFOperations. */ +export interface ManagedCCFOperations { + /** + * Retrieves the properties of all Managed CCF apps. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param options The options parameters. + */ + listByResourceGroup( + resourceGroupName: string, + options?: ManagedCCFListByResourceGroupOptionalParams + ): PagedAsyncIterableIterator; + /** + * Retrieves the properties of all Managed CCF. + * @param options The options parameters. + */ + listBySubscription( + options?: ManagedCCFListBySubscriptionOptionalParams + ): PagedAsyncIterableIterator; + /** + * Retrieves the properties of a Managed CCF app. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appName Name of the Managed CCF + * @param options The options parameters. + */ + get( + resourceGroupName: string, + appName: string, + options?: ManagedCCFGetOptionalParams + ): Promise; + /** + * Deletes an existing Managed CCF. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appName Name of the Managed CCF + * @param options The options parameters. + */ + beginDelete( + resourceGroupName: string, + appName: string, + options?: ManagedCCFDeleteOptionalParams + ): Promise, void>>; + /** + * Deletes an existing Managed CCF. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appName Name of the Managed CCF + * @param options The options parameters. + */ + beginDeleteAndWait( + resourceGroupName: string, + appName: string, + options?: ManagedCCFDeleteOptionalParams + ): Promise; + /** + * Creates a Managed CCF with the specified Managed CCF parameters. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appName Name of the Managed CCF + * @param managedCCF Managed CCF Create Request Body + * @param options The options parameters. + */ + beginCreate( + resourceGroupName: string, + appName: string, + managedCCF: ManagedCCF, + options?: ManagedCCFCreateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + ManagedCCFCreateResponse + > + >; + /** + * Creates a Managed CCF with the specified Managed CCF parameters. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appName Name of the Managed CCF + * @param managedCCF Managed CCF Create Request Body + * @param options The options parameters. + */ + beginCreateAndWait( + resourceGroupName: string, + appName: string, + managedCCF: ManagedCCF, + options?: ManagedCCFCreateOptionalParams + ): Promise; + /** + * Updates properties of Managed CCF + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appName Name of the Managed CCF + * @param managedCCF Request body for Updating Managed CCF App + * @param options The options parameters. + */ + beginUpdate( + resourceGroupName: string, + appName: string, + managedCCF: ManagedCCF, + options?: ManagedCCFUpdateOptionalParams + ): Promise, void>>; + /** + * Updates properties of Managed CCF + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appName Name of the Managed CCF + * @param managedCCF Request body for Updating Managed CCF App + * @param options The options parameters. + */ + beginUpdateAndWait( + resourceGroupName: string, + appName: string, + managedCCF: ManagedCCF, + options?: ManagedCCFUpdateOptionalParams + ): Promise; +} diff --git a/sdk/confidentialledger/arm-confidentialledger/tsconfig.json b/sdk/confidentialledger/arm-confidentialledger/tsconfig.json index 125d598a0eb4..3e6ae96443f3 100644 --- a/sdk/confidentialledger/arm-confidentialledger/tsconfig.json +++ b/sdk/confidentialledger/arm-confidentialledger/tsconfig.json @@ -15,17 +15,11 @@ ], "declaration": true, "outDir": "./dist-esm", - "importHelpers": true, - "paths": { - "@azure/arm-confidentialledger": [ - "./src/index" - ] - } + "importHelpers": true }, "include": [ "./src/**/*.ts", - "./test/**/*.ts", - "samples-dev/**/*.ts" + "./test/**/*.ts" ], "exclude": [ "node_modules"