From 2cc7ba7b473a4a166d1601081db9a2d4c5aefc99 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Mon, 1 Mar 2021 16:57:58 +0000 Subject: [PATCH] CodeGen from PR 13206 in Azure/azure-rest-api-specs Merge 469075119173c33fd73a344366f62bc0f8c1e0b2 into c265d4f644cea3bb2e02e976ff95fa6caf6d7b30 --- .../arm-recoveryservices/LICENSE.txt | 2 +- .../arm-recoveryservices/src/models/index.ts | 312 +++++++++++++++++- .../src/models/mappers.ts | 308 ++++++++++++++++- .../src/models/operationsMappers.ts | 4 +- .../src/models/parameters.ts | 10 + .../privateLinkResourcesOperationsMappers.ts | 2 + .../src/models/recoveryServicesMappers.ts | 4 +- .../src/models/vaultCertificatesMappers.ts | 7 +- .../vaultExtendedInfoOperationsMappers.ts | 9 +- .../src/models/vaultsMappers.ts | 9 +- .../src/operations/vaults.ts | 111 +++---- .../src/recoveryServicesClient.ts | 129 ++++++++ .../src/recoveryServicesClientContext.ts | 2 +- 13 files changed, 836 insertions(+), 73 deletions(-) diff --git a/sdk/recoveryservices/arm-recoveryservices/LICENSE.txt b/sdk/recoveryservices/arm-recoveryservices/LICENSE.txt index ea8fb1516028..2d3163745319 100644 --- a/sdk/recoveryservices/arm-recoveryservices/LICENSE.txt +++ b/sdk/recoveryservices/arm-recoveryservices/LICENSE.txt @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2020 Microsoft +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 diff --git a/sdk/recoveryservices/arm-recoveryservices/src/models/index.ts b/sdk/recoveryservices/arm-recoveryservices/src/models/index.ts index 38ce19130963..b4c6f23fcffd 100644 --- a/sdk/recoveryservices/arm-recoveryservices/src/models/index.ts +++ b/sdk/recoveryservices/arm-recoveryservices/src/models/index.ts @@ -140,6 +140,10 @@ export interface ResourceCertificateAndAadDetails { * Azure Management Endpoint Audience. */ azureManagementEndpointAudience: string; + /** + * Service Resource Id. + */ + serviceResourceId?: string; } /** @@ -426,7 +430,7 @@ export interface Resource extends BaseResource { /** * Optional ETag. */ - eTag?: string; + etag?: string; } /** @@ -437,6 +441,10 @@ export interface Sku { * The Sku name. Possible values include: 'Standard', 'RS0' */ name: SkuName; + /** + * The Sku tier. + */ + tier?: string; } /** @@ -520,6 +528,22 @@ export interface UpgradeDetails { readonly previousResourceId?: string; } +/** + * A resource identity that is managed by the user of the service. + */ +export interface UserIdentity { + /** + * The principal ID of the user-assigned identity. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly principalId?: string; + /** + * The client ID of the user-assigned identity. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly clientId?: string; +} + /** * Identity for the resource. */ @@ -535,9 +559,18 @@ export interface IdentityData { */ readonly tenantId?: string; /** - * The identity type. Possible values include: 'SystemAssigned', 'None' + * The type of managed identity used. The type 'SystemAssigned, UserAssigned' includes both an + * implicitly created identity and a set of user-assigned identities. The type 'None' will remove + * any identities. Possible values include: 'SystemAssigned', 'None', 'UserAssigned', + * 'SystemAssigned, UserAssigned' */ type: ResourceIdentityType; + /** + * The list of user-assigned identities associated with the resource. The user-assigned identity + * dictionary keys will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + */ + userAssignedIdentities?: { [propertyName: string]: UserIdentity }; } /** @@ -600,6 +633,44 @@ export interface PrivateEndpointConnectionVaultProperties { properties?: PrivateEndpointConnection; } +/** + * The properties of the Key Vault which hosts CMK + */ +export interface CmkKeyVaultProperties { + /** + * The key uri of the Customer Managed Key + */ + keyUri?: string; +} + +/** + * The details of the identity used for CMK + */ +export interface CmkKekIdentity { + /** + * Indicate that system assigned identity should be used. Mutually exclusive with + * 'userAssignedIdentity' field + */ + useSystemAssignedIdentity?: boolean; + /** + * The user assigned identity to be used to grant permissions in case the type of identity used + * is UserAssigned + */ + userAssignedIdentity?: string; +} + +/** + * Customer Managed Key details of the resource. + */ +export interface VaultPropertiesEncryption { + keyVaultProperties?: CmkKeyVaultProperties; + kekIdentity?: CmkKekIdentity; + /** + * Enabling/Disabling the Double Encryption state. Possible values include: 'Enabled', 'Disabled' + */ + infrastructureEncryption?: InfrastructureEncryptionState; +} + /** * Properties of the vault. */ @@ -625,6 +696,42 @@ export interface VaultProperties { * **NOTE: This property will not be serialized. It can only be populated by the server.** */ readonly privateEndpointStateForSiteRecovery?: VaultPrivateEndpointState; + /** + * Customer Managed Key details of the resource. + */ + encryption?: VaultPropertiesEncryption; +} + +/** + * Metadata pertaining to creation and last modification of the resource. + */ +export interface SystemData { + /** + * The identity that created the resource. + */ + createdBy?: string; + /** + * The type of identity that created the resource. Possible values include: 'User', + * 'Application', 'ManagedIdentity', 'Key' + */ + createdByType?: CreatedByType; + /** + * The timestamp of resource creation (UTC). + */ + createdAt?: Date; + /** + * The identity that last modified the resource. + */ + lastModifiedBy?: string; + /** + * The type of identity that last modified the resource. Possible values include: 'User', + * 'Application', 'ManagedIdentity', 'Key' + */ + lastModifiedByType?: CreatedByType; + /** + * The type of identity that last modified the resource. + */ + lastModifiedAt?: Date; } /** @@ -634,6 +741,7 @@ export interface Vault extends TrackedResource { identity?: IdentityData; properties?: VaultProperties; sku?: Sku; + systemData?: SystemData; } /** @@ -704,6 +812,85 @@ export interface PrivateLinkResource { readonly type?: string; } +/** + * The resource management error additional info. + */ +export interface ErrorAdditionalInfo { + /** + * The additional info. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly info?: any; + /** + * The additional info type. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly type?: string; +} + +/** + * The resource management error response. + */ +export interface ErrorModel { + /** + * The error additional info. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly additionalInfo?: ErrorAdditionalInfo[]; + /** + * The error code. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly code?: string; + /** + * The error details. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly details?: ErrorModel[]; + /** + * The error message. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly message?: string; + /** + * The error target. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly target?: string; +} + +/** + * Operation Resource + */ +export interface OperationResource { + /** + * End time of the operation + */ + endTime?: Date; + /** + * Required if status == failed or status == canceled. This is the OData v4 error format, used by + * the RPC and will go into the v2.2 Azure REST API guidelines. + */ + error?: ErrorModel; + /** + * It should match what is used to GET the operation result + */ + id?: string; + /** + * It must match the last segment of the "id" field, and will typically be a GUID / system + * generated value + */ + name?: string; + /** + * The status of the operation. (InProgress/Success/Failed/Cancelled) + */ + status?: string; + /** + * Start time of the operation + */ + startTime?: Date; +} + /** * The name of usage. */ @@ -842,11 +1029,12 @@ export type TriggerType = 'UserTriggered' | 'ForcedUpgrade'; /** * Defines values for ResourceIdentityType. - * Possible values include: 'SystemAssigned', 'None' + * Possible values include: 'SystemAssigned', 'None', 'UserAssigned', 'SystemAssigned, + * UserAssigned' * @readonly * @enum {string} */ -export type ResourceIdentityType = 'SystemAssigned' | 'None'; +export type ResourceIdentityType = 'SystemAssigned' | 'None' | 'UserAssigned' | 'SystemAssigned, UserAssigned'; /** * Defines values for ProvisioningState. @@ -872,6 +1060,22 @@ export type PrivateEndpointConnectionStatus = 'Pending' | 'Approved' | 'Rejected */ export type VaultPrivateEndpointState = 'None' | 'Enabled'; +/** + * Defines values for InfrastructureEncryptionState. + * Possible values include: 'Enabled', 'Disabled' + * @readonly + * @enum {string} + */ +export type InfrastructureEncryptionState = 'Enabled' | 'Disabled'; + +/** + * Defines values for CreatedByType. + * Possible values include: 'User', 'Application', 'ManagedIdentity', 'Key' + * @readonly + * @enum {string} + */ +export type CreatedByType = 'User' | 'Application' | 'ManagedIdentity' | 'Key'; + /** * Defines values for UsagesUnit. * Possible values include: 'Count', 'Bytes', 'Seconds', 'Percent', 'CountPerSecond', @@ -1101,6 +1305,46 @@ export type VaultsUpdateResponse = Vault & { }; }; +/** + * Contains response data for the beginCreateOrUpdate operation. + */ +export type VaultsBeginCreateOrUpdateResponse = Vault & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: Vault; + }; +}; + +/** + * Contains response data for the beginUpdate operation. + */ +export type VaultsBeginUpdateResponse = Vault & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: Vault; + }; +}; + /** * Contains response data for the listBySubscriptionIdNext operation. */ @@ -1241,6 +1485,66 @@ export type VaultExtendedInfoUpdateResponse = VaultExtendedInfoResource & { }; }; +/** + * Contains response data for the getOperationStatus operation. + */ +export type GetOperationStatusResponse = OperationResource & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: OperationResource; + }; +}; + +/** + * Contains response data for the getOperationResult operation. + */ +export type GetOperationResultResponse = Vault & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: Vault; + }; +}; + +/** + * Contains response data for the beginGetOperationResult operation. + */ +export type BeginGetOperationResultResponse = Vault & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: Vault; + }; +}; + /** * Contains response data for the listByVaults operation. */ diff --git a/sdk/recoveryservices/arm-recoveryservices/src/models/mappers.ts b/sdk/recoveryservices/arm-recoveryservices/src/models/mappers.ts index f3645eb5e803..80bd3b0515e6 100644 --- a/sdk/recoveryservices/arm-recoveryservices/src/models/mappers.ts +++ b/sdk/recoveryservices/arm-recoveryservices/src/models/mappers.ts @@ -164,6 +164,12 @@ export const ResourceCertificateAndAadDetails: msRest.CompositeMapper = { type: { name: "String" } + }, + serviceResourceId: { + serializedName: "serviceResourceId", + type: { + name: "String" + } } } } @@ -577,8 +583,8 @@ export const Resource: msRest.CompositeMapper = { name: "String" } }, - eTag: { - serializedName: "eTag", + etag: { + serializedName: "etag", type: { name: "String" } @@ -599,6 +605,12 @@ export const Sku: msRest.CompositeMapper = { type: { name: "String" } + }, + tier: { + serializedName: "tier", + type: { + name: "String" + } } } } @@ -734,6 +746,30 @@ export const UpgradeDetails: msRest.CompositeMapper = { } }; +export const UserIdentity: msRest.CompositeMapper = { + serializedName: "UserIdentity", + type: { + name: "Composite", + className: "UserIdentity", + modelProperties: { + principalId: { + readOnly: true, + serializedName: "principalId", + type: { + name: "String" + } + }, + clientId: { + readOnly: true, + serializedName: "clientId", + type: { + name: "String" + } + } + } + } +}; + export const IdentityData: msRest.CompositeMapper = { serializedName: "IdentityData", type: { @@ -760,6 +796,18 @@ export const IdentityData: msRest.CompositeMapper = { type: { name: "String" } + }, + userAssignedIdentities: { + serializedName: "userAssignedIdentities", + type: { + name: "Dictionary", + value: { + type: { + name: "Composite", + className: "UserIdentity" + } + } + } } } } @@ -868,6 +916,74 @@ export const PrivateEndpointConnectionVaultProperties: msRest.CompositeMapper = } }; +export const CmkKeyVaultProperties: msRest.CompositeMapper = { + serializedName: "CmkKeyVaultProperties", + type: { + name: "Composite", + className: "CmkKeyVaultProperties", + modelProperties: { + keyUri: { + serializedName: "keyUri", + type: { + name: "String" + } + } + } + } +}; + +export const CmkKekIdentity: msRest.CompositeMapper = { + serializedName: "CmkKekIdentity", + type: { + name: "Composite", + className: "CmkKekIdentity", + modelProperties: { + useSystemAssignedIdentity: { + serializedName: "useSystemAssignedIdentity", + type: { + name: "Boolean" + } + }, + userAssignedIdentity: { + serializedName: "userAssignedIdentity", + type: { + name: "String" + } + } + } + } +}; + +export const VaultPropertiesEncryption: msRest.CompositeMapper = { + serializedName: "VaultProperties_encryption", + type: { + name: "Composite", + className: "VaultPropertiesEncryption", + modelProperties: { + keyVaultProperties: { + serializedName: "keyVaultProperties", + type: { + name: "Composite", + className: "CmkKeyVaultProperties" + } + }, + kekIdentity: { + serializedName: "kekIdentity", + type: { + name: "Composite", + className: "CmkKekIdentity" + } + }, + infrastructureEncryption: { + serializedName: "infrastructureEncryption", + type: { + name: "String" + } + } + } + } +}; + export const VaultProperties: msRest.CompositeMapper = { serializedName: "VaultProperties", type: { @@ -914,6 +1030,59 @@ export const VaultProperties: msRest.CompositeMapper = { type: { name: "String" } + }, + encryption: { + serializedName: "encryption", + type: { + name: "Composite", + className: "VaultPropertiesEncryption" + } + } + } + } +}; + +export const SystemData: msRest.CompositeMapper = { + serializedName: "systemData", + type: { + name: "Composite", + className: "SystemData", + modelProperties: { + createdBy: { + serializedName: "createdBy", + type: { + name: "String" + } + }, + createdByType: { + serializedName: "createdByType", + type: { + name: "String" + } + }, + createdAt: { + serializedName: "createdAt", + type: { + name: "DateTime" + } + }, + lastModifiedBy: { + serializedName: "lastModifiedBy", + type: { + name: "String" + } + }, + lastModifiedByType: { + serializedName: "lastModifiedByType", + type: { + name: "String" + } + }, + lastModifiedAt: { + serializedName: "lastModifiedAt", + type: { + name: "DateTime" + } } } } @@ -946,6 +1115,13 @@ export const Vault: msRest.CompositeMapper = { name: "Composite", className: "Sku" } + }, + systemData: { + serializedName: "systemData", + type: { + name: "Composite", + className: "SystemData" + } } } } @@ -1080,6 +1256,134 @@ export const PrivateLinkResource: msRest.CompositeMapper = { } }; +export const ErrorAdditionalInfo: msRest.CompositeMapper = { + serializedName: "ErrorAdditionalInfo", + type: { + name: "Composite", + className: "ErrorAdditionalInfo", + modelProperties: { + info: { + readOnly: true, + serializedName: "info", + type: { + name: "Object" + } + }, + type: { + readOnly: true, + serializedName: "type", + type: { + name: "String" + } + } + } + } +}; + +export const ErrorModel: msRest.CompositeMapper = { + serializedName: "Error", + type: { + name: "Composite", + className: "ErrorModel", + modelProperties: { + additionalInfo: { + readOnly: true, + serializedName: "additionalInfo", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ErrorAdditionalInfo" + } + } + } + }, + code: { + readOnly: true, + serializedName: "code", + type: { + name: "String" + } + }, + details: { + readOnly: true, + serializedName: "details", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ErrorModel" + } + } + } + }, + message: { + readOnly: true, + serializedName: "message", + type: { + name: "String" + } + }, + target: { + readOnly: true, + serializedName: "target", + type: { + name: "String" + } + } + } + } +}; + +export const OperationResource: msRest.CompositeMapper = { + serializedName: "OperationResource", + type: { + name: "Composite", + className: "OperationResource", + modelProperties: { + endTime: { + serializedName: "endTime", + type: { + name: "DateTime" + } + }, + error: { + serializedName: "error", + type: { + name: "Composite", + className: "ErrorModel" + } + }, + id: { + serializedName: "id", + type: { + name: "String" + } + }, + name: { + serializedName: "name", + type: { + name: "String" + } + }, + status: { + serializedName: "status", + type: { + name: "String" + } + }, + startTime: { + serializedName: "startTime", + type: { + name: "DateTime" + } + } + } + } +}; + export const NameInfo: msRest.CompositeMapper = { serializedName: "NameInfo", type: { diff --git a/sdk/recoveryservices/arm-recoveryservices/src/models/operationsMappers.ts b/sdk/recoveryservices/arm-recoveryservices/src/models/operationsMappers.ts index cf239cd893a5..b503924f7fba 100644 --- a/sdk/recoveryservices/arm-recoveryservices/src/models/operationsMappers.ts +++ b/sdk/recoveryservices/arm-recoveryservices/src/models/operationsMappers.ts @@ -14,5 +14,7 @@ export { ClientDiscoveryForServiceSpecification, ClientDiscoveryResponse, ClientDiscoveryValueForSingleApi, - CloudError + CloudError, + ErrorAdditionalInfo, + ErrorModel } from "../models/mappers"; diff --git a/sdk/recoveryservices/arm-recoveryservices/src/models/parameters.ts b/sdk/recoveryservices/arm-recoveryservices/src/models/parameters.ts index 7c4f3dbc4093..0da842c17473 100644 --- a/sdk/recoveryservices/arm-recoveryservices/src/models/parameters.ts +++ b/sdk/recoveryservices/arm-recoveryservices/src/models/parameters.ts @@ -70,6 +70,16 @@ export const nextPageLink: msRest.OperationURLParameter = { }, skipEncoding: true }; +export const operationId: msRest.OperationURLParameter = { + parameterPath: "operationId", + mapper: { + required: true, + serializedName: "operationId", + type: { + name: "String" + } + } +}; export const privateLinkResourceName: msRest.OperationURLParameter = { parameterPath: "privateLinkResourceName", mapper: { diff --git a/sdk/recoveryservices/arm-recoveryservices/src/models/privateLinkResourcesOperationsMappers.ts b/sdk/recoveryservices/arm-recoveryservices/src/models/privateLinkResourcesOperationsMappers.ts index 8b1a986c0039..f9201672ed2f 100644 --- a/sdk/recoveryservices/arm-recoveryservices/src/models/privateLinkResourcesOperationsMappers.ts +++ b/sdk/recoveryservices/arm-recoveryservices/src/models/privateLinkResourcesOperationsMappers.ts @@ -9,6 +9,8 @@ export { discriminators, CloudError, + ErrorAdditionalInfo, + ErrorModel, PrivateLinkResource, PrivateLinkResources } from "../models/mappers"; diff --git a/sdk/recoveryservices/arm-recoveryservices/src/models/recoveryServicesMappers.ts b/sdk/recoveryservices/arm-recoveryservices/src/models/recoveryServicesMappers.ts index 665c4167517e..1e2e76caa085 100644 --- a/sdk/recoveryservices/arm-recoveryservices/src/models/recoveryServicesMappers.ts +++ b/sdk/recoveryservices/arm-recoveryservices/src/models/recoveryServicesMappers.ts @@ -10,5 +10,7 @@ export { discriminators, CheckNameAvailabilityParameters, CheckNameAvailabilityResult, - CloudError + CloudError, + ErrorAdditionalInfo, + ErrorModel } from "../models/mappers"; diff --git a/sdk/recoveryservices/arm-recoveryservices/src/models/vaultCertificatesMappers.ts b/sdk/recoveryservices/arm-recoveryservices/src/models/vaultCertificatesMappers.ts index 038a0ef44654..6edf1f3ecf54 100644 --- a/sdk/recoveryservices/arm-recoveryservices/src/models/vaultCertificatesMappers.ts +++ b/sdk/recoveryservices/arm-recoveryservices/src/models/vaultCertificatesMappers.ts @@ -11,6 +11,8 @@ export { BaseResource, CertificateRequest, CloudError, + CmkKekIdentity, + CmkKeyVaultProperties, IdentityData, PatchTrackedResource, PatchVault, @@ -24,10 +26,13 @@ export { ResourceCertificateAndAcsDetails, ResourceCertificateDetails, Sku, + SystemData, TrackedResource, UpgradeDetails, + UserIdentity, Vault, VaultCertificateResponse, VaultExtendedInfoResource, - VaultProperties + VaultProperties, + VaultPropertiesEncryption } from "../models/mappers"; diff --git a/sdk/recoveryservices/arm-recoveryservices/src/models/vaultExtendedInfoOperationsMappers.ts b/sdk/recoveryservices/arm-recoveryservices/src/models/vaultExtendedInfoOperationsMappers.ts index cbdfd07cd245..148ce456fcca 100644 --- a/sdk/recoveryservices/arm-recoveryservices/src/models/vaultExtendedInfoOperationsMappers.ts +++ b/sdk/recoveryservices/arm-recoveryservices/src/models/vaultExtendedInfoOperationsMappers.ts @@ -10,6 +10,10 @@ export { discriminators, BaseResource, CloudError, + CmkKekIdentity, + CmkKeyVaultProperties, + ErrorAdditionalInfo, + ErrorModel, IdentityData, PatchTrackedResource, PatchVault, @@ -22,10 +26,13 @@ export { ResourceCertificateAndAcsDetails, ResourceCertificateDetails, Sku, + SystemData, TrackedResource, UpgradeDetails, + UserIdentity, Vault, VaultCertificateResponse, VaultExtendedInfoResource, - VaultProperties + VaultProperties, + VaultPropertiesEncryption } from "../models/mappers"; diff --git a/sdk/recoveryservices/arm-recoveryservices/src/models/vaultsMappers.ts b/sdk/recoveryservices/arm-recoveryservices/src/models/vaultsMappers.ts index 9daea6407eac..ade64458d488 100644 --- a/sdk/recoveryservices/arm-recoveryservices/src/models/vaultsMappers.ts +++ b/sdk/recoveryservices/arm-recoveryservices/src/models/vaultsMappers.ts @@ -10,6 +10,10 @@ export { discriminators, BaseResource, CloudError, + CmkKekIdentity, + CmkKeyVaultProperties, + ErrorAdditionalInfo, + ErrorModel, IdentityData, PatchTrackedResource, PatchVault, @@ -22,11 +26,14 @@ export { ResourceCertificateAndAcsDetails, ResourceCertificateDetails, Sku, + SystemData, TrackedResource, UpgradeDetails, + UserIdentity, Vault, VaultCertificateResponse, VaultExtendedInfoResource, VaultList, - VaultProperties + VaultProperties, + VaultPropertiesEncryption } from "../models/mappers"; diff --git a/sdk/recoveryservices/arm-recoveryservices/src/operations/vaults.ts b/sdk/recoveryservices/arm-recoveryservices/src/operations/vaults.ts index 969d6f0b82fa..baa38e377c53 100644 --- a/sdk/recoveryservices/arm-recoveryservices/src/operations/vaults.ts +++ b/sdk/recoveryservices/arm-recoveryservices/src/operations/vaults.ts @@ -8,6 +8,7 @@ */ import * as msRest from "@azure/ms-rest-js"; +import * as msRestAzure from "@azure/ms-rest-azure-js"; import * as Models from "../models"; import * as Mappers from "../models/vaultsMappers"; import * as Parameters from "../models/parameters"; @@ -124,34 +125,9 @@ export class Vaults { * @param [options] The optional parameters * @returns Promise */ - createOrUpdate(resourceGroupName: string, vaultName: string, vault: Models.Vault, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName The name of the resource group where the recovery services vault is - * present. - * @param vaultName The name of the recovery services vault. - * @param vault Recovery Services Vault to be created. - * @param callback The callback - */ - createOrUpdate(resourceGroupName: string, vaultName: string, vault: Models.Vault, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName The name of the resource group where the recovery services vault is - * present. - * @param vaultName The name of the recovery services vault. - * @param vault Recovery Services Vault to be created. - * @param options The optional parameters - * @param callback The callback - */ - createOrUpdate(resourceGroupName: string, vaultName: string, vault: Models.Vault, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - createOrUpdate(resourceGroupName: string, vaultName: string, vault: Models.Vault, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { - resourceGroupName, - vaultName, - vault, - options - }, - createOrUpdateOperationSpec, - callback) as Promise; + createOrUpdate(resourceGroupName: string, vaultName: string, vault: Models.Vault, options?: msRest.RequestOptionsBase): Promise { + return this.beginCreateOrUpdate(resourceGroupName,vaultName,vault,options) + .then(lroPoller => lroPoller.pollUntilFinished()) as Promise; } /** @@ -198,34 +174,51 @@ export class Vaults { * @param [options] The optional parameters * @returns Promise */ - update(resourceGroupName: string, vaultName: string, vault: Models.PatchVault, options?: msRest.RequestOptionsBase): Promise; + update(resourceGroupName: string, vaultName: string, vault: Models.PatchVault, options?: msRest.RequestOptionsBase): Promise { + return this.beginUpdate(resourceGroupName,vaultName,vault,options) + .then(lroPoller => lroPoller.pollUntilFinished()) as Promise; + } + /** + * Creates or updates a Recovery Services vault. * @param resourceGroupName The name of the resource group where the recovery services vault is * present. * @param vaultName The name of the recovery services vault. * @param vault Recovery Services Vault to be created. - * @param callback The callback + * @param [options] The optional parameters + * @returns Promise */ - update(resourceGroupName: string, vaultName: string, vault: Models.PatchVault, callback: msRest.ServiceCallback): void; + beginCreateOrUpdate(resourceGroupName: string, vaultName: string, vault: Models.Vault, options?: msRest.RequestOptionsBase): Promise { + return this.client.sendLRORequest( + { + resourceGroupName, + vaultName, + vault, + options + }, + beginCreateOrUpdateOperationSpec, + options); + } + /** + * Updates the vault. * @param resourceGroupName The name of the resource group where the recovery services vault is * present. * @param vaultName The name of the recovery services vault. * @param vault Recovery Services Vault to be created. - * @param options The optional parameters - * @param callback The callback + * @param [options] The optional parameters + * @returns Promise */ - update(resourceGroupName: string, vaultName: string, vault: Models.PatchVault, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - update(resourceGroupName: string, vaultName: string, vault: Models.PatchVault, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( + beginUpdate(resourceGroupName: string, vaultName: string, vault: Models.PatchVault, options?: msRest.RequestOptionsBase): Promise { + return this.client.sendLRORequest( { resourceGroupName, vaultName, vault, options }, - updateOperationSpec, - callback) as Promise; + beginUpdateOperationSpec, + options); } /** @@ -359,8 +352,8 @@ const getOperationSpec: msRest.OperationSpec = { serializer }; -const createOrUpdateOperationSpec: msRest.OperationSpec = { - httpMethod: "PUT", +const deleteMethodOperationSpec: msRest.OperationSpec = { + httpMethod: "DELETE", path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}", urlParameters: [ Parameters.subscriptionId, @@ -373,20 +366,8 @@ const createOrUpdateOperationSpec: msRest.OperationSpec = { headerParameters: [ Parameters.acceptLanguage ], - requestBody: { - parameterPath: "vault", - mapper: { - ...Mappers.Vault, - required: true - } - }, responses: { - 200: { - bodyMapper: Mappers.Vault - }, - 201: { - bodyMapper: Mappers.Vault - }, + 200: {}, default: { bodyMapper: Mappers.CloudError } @@ -394,8 +375,8 @@ const createOrUpdateOperationSpec: msRest.OperationSpec = { serializer }; -const deleteMethodOperationSpec: msRest.OperationSpec = { - httpMethod: "DELETE", +const beginCreateOrUpdateOperationSpec: msRest.OperationSpec = { + httpMethod: "PUT", path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}", urlParameters: [ Parameters.subscriptionId, @@ -408,8 +389,20 @@ const deleteMethodOperationSpec: msRest.OperationSpec = { headerParameters: [ Parameters.acceptLanguage ], + requestBody: { + parameterPath: "vault", + mapper: { + ...Mappers.Vault, + required: true + } + }, responses: { - 200: {}, + 200: { + bodyMapper: Mappers.Vault + }, + 201: { + bodyMapper: Mappers.Vault + }, default: { bodyMapper: Mappers.CloudError } @@ -417,7 +410,7 @@ const deleteMethodOperationSpec: msRest.OperationSpec = { serializer }; -const updateOperationSpec: msRest.OperationSpec = { +const beginUpdateOperationSpec: msRest.OperationSpec = { httpMethod: "PATCH", path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}", urlParameters: [ @@ -442,9 +435,7 @@ const updateOperationSpec: msRest.OperationSpec = { 200: { bodyMapper: Mappers.Vault }, - 201: { - bodyMapper: Mappers.Vault - }, + 202: {}, default: { bodyMapper: Mappers.CloudError } diff --git a/sdk/recoveryservices/arm-recoveryservices/src/recoveryServicesClient.ts b/sdk/recoveryservices/arm-recoveryservices/src/recoveryServicesClient.ts index 7e1df780c2ed..5ddb18335076 100644 --- a/sdk/recoveryservices/arm-recoveryservices/src/recoveryServicesClient.ts +++ b/sdk/recoveryservices/arm-recoveryservices/src/recoveryServicesClient.ts @@ -8,8 +8,10 @@ */ import * as msRest from "@azure/ms-rest-js"; +import * as msRestAzure from "@azure/ms-rest-azure-js"; import * as Models from "./models"; import * as Mappers from "./models/mappers"; +import * as Parameters from "./models/parameters"; import * as operations from "./operations"; import { RecoveryServicesClientContext } from "./recoveryServicesClientContext"; @@ -44,9 +46,136 @@ class RecoveryServicesClient extends RecoveryServicesClientContext { this.vaultExtendedInfo = new operations.VaultExtendedInfoOperations(this); this.usages = new operations.Usages(this); } + + /** + * Gets the operation status for a resource. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. + * @param vaultName The name of the recovery services vault. + * @param operationId + * @param [options] The optional parameters + * @returns Promise + */ + getOperationStatus(resourceGroupName: string, vaultName: string, operationId: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. + * @param vaultName The name of the recovery services vault. + * @param operationId + * @param callback The callback + */ + getOperationStatus(resourceGroupName: string, vaultName: string, operationId: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. + * @param vaultName The name of the recovery services vault. + * @param operationId + * @param options The optional parameters + * @param callback The callback + */ + getOperationStatus(resourceGroupName: string, vaultName: string, operationId: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + getOperationStatus(resourceGroupName: string, vaultName: string, operationId: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.sendOperationRequest( + { + resourceGroupName, + vaultName, + operationId, + options + }, + getOperationStatusOperationSpec, + callback) as Promise; + } + + /** + * Gets the operation result for a resource. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. + * @param vaultName The name of the recovery services vault. + * @param operationId + * @param [options] The optional parameters + * @returns Promise + */ + getOperationResult(resourceGroupName: string, vaultName: string, operationId: string, options?: msRest.RequestOptionsBase): Promise { + return this.beginGetOperationResult(resourceGroupName,vaultName,operationId,options) + .then(lroPoller => lroPoller.pollUntilFinished()) as Promise; + } + + /** + * Gets the operation result for a resource. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. + * @param vaultName The name of the recovery services vault. + * @param operationId + * @param [options] The optional parameters + * @returns Promise + */ + beginGetOperationResult(resourceGroupName: string, vaultName: string, operationId: string, options?: msRest.RequestOptionsBase): Promise { + return this.sendLRORequest( + { + resourceGroupName, + vaultName, + operationId, + options + }, + beginGetOperationResultOperationSpec, + options); + } } // Operation Specifications +const serializer = new msRest.Serializer(Mappers); +const getOperationStatusOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/operationStatus/{operationId}", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.vaultName, + Parameters.operationId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.OperationResource + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const beginGetOperationResultOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/operationResults/{operationId}", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.vaultName, + Parameters.operationId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.Vault + }, + 202: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; export { RecoveryServicesClient, diff --git a/sdk/recoveryservices/arm-recoveryservices/src/recoveryServicesClientContext.ts b/sdk/recoveryservices/arm-recoveryservices/src/recoveryServicesClientContext.ts index 01afef1bd386..15f7cbda93fa 100644 --- a/sdk/recoveryservices/arm-recoveryservices/src/recoveryServicesClientContext.ts +++ b/sdk/recoveryservices/arm-recoveryservices/src/recoveryServicesClientContext.ts @@ -43,7 +43,7 @@ export class RecoveryServicesClientContext extends msRestAzure.AzureServiceClien super(credentials, options); - this.apiVersion = '2016-06-01'; + this.apiVersion = '2020-10-01'; this.acceptLanguage = 'en-US'; this.longRunningOperationRetryTimeout = 30; this.baseUri = options.baseUri || this.baseUri || "https://management.azure.com";