Skip to content

Commit

Permalink
CodeGen from PR 20820 in Azure/azure-rest-api-specs
Browse files Browse the repository at this point in the history
[Hub Generated] Review request for Microsoft.RecoveryServices to add version stable/2022-05-01 (Azure#20820)

* Adds base for updating Microsoft.RecoveryServices from version stable/2022-04-01 to version 2022-05-01

* Updates readme

* Updates API version in new specs and examples

* Avocado fix
  • Loading branch information
SDKAuto committed Sep 29, 2022
1 parent d0fb1e5 commit 3355f9a
Show file tree
Hide file tree
Showing 12 changed files with 184 additions and 57 deletions.
12 changes: 6 additions & 6 deletions common/config/rush/pnpm-lock.yaml

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

11 changes: 11 additions & 0 deletions sdk/recoveryservices/arm-recoveryservices/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
# Release History

## 5.2.0 (2022-09-29)

**Features**

- Added Interface ImmutabilitySettings
- Added Interface SecuritySettings
- Added Type Alias ImmutabilityState
- Interface VaultProperties has a new optional parameter securitySettings
- Added Enum KnownImmutabilityState


## 5.1.0 (2022-07-22)

**Features**
Expand Down
2 changes: 1 addition & 1 deletion sdk/recoveryservices/arm-recoveryservices/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Recovery Services Client

### Currently supported environments

- [LTS versions of Node.js](https://github.com/nodejs/release#release-schedule)
- [LTS versions of Node.js](https://nodejs.org/about/releases/)
- Latest versions of Safari, Chrome, Edge and Firefox.

See our [support policy](https://github.com/Azure/azure-sdk-for-js/blob/main/SUPPORT.md) for more details.
Expand Down
8 changes: 4 additions & 4 deletions sdk/recoveryservices/arm-recoveryservices/_meta.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"commit": "405811c51aa09803caedfe17fd305e110db1ca5e",
"commit": "0b5a985b1dbb4883d626b1fdd6fc8efb2874f4dc",
"readme": "specification/recoveryservices/resource-manager/readme.md",
"autorest_command": "autorest --version=3.7.3 --typescript --modelerfour.lenient-model-deduplication --azure-arm --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=D:\\Git\\azure-sdk-for-js ..\\azure-rest-api-specs\\specification\\recoveryservices\\resource-manager\\readme.md --use=@autorest/typescript@6.0.0-rc.1.20220720.1 --generate-sample=true",
"autorest_command": "autorest --version=3.8.4 --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/recoveryservices/resource-manager/readme.md --use=@autorest/typescript@6.0.0-rc.1",
"repository_url": "https://github.com/Azure/azure-rest-api-specs.git",
"release_tool": "@azure-tools/js-sdk-release-tools@2.4.0",
"use": "@autorest/typescript@6.0.0-rc.1.20220720.1"
"release_tool": "@azure-tools/js-sdk-release-tools@2.4.3",
"use": "@autorest/typescript@6.0.0-rc.1"
}
18 changes: 5 additions & 13 deletions sdk/recoveryservices/arm-recoveryservices/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"sdk-type": "mgmt",
"author": "Microsoft Corporation",
"description": "A generated SDK for RecoveryServicesClient.",
"version": "5.1.0",
"version": "5.2.0",
"engines": {
"node": ">=12.0.0"
},
Expand All @@ -28,15 +28,15 @@
"module": "./dist-esm/src/index.js",
"types": "./types/arm-recoveryservices.d.ts",
"devDependencies": {
"@microsoft/api-extractor": "^7.31.1",
"@microsoft/api-extractor": "7.18.11",
"@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",
"rollup-plugin-sourcemaps": "^0.6.3",
"typescript": "~4.6.0",
"typescript": "~4.2.0",
"uglify-js": "^3.4.9",
"rimraf": "^3.0.0",
"@azure/identity": "^2.0.1",
Expand Down Expand Up @@ -109,13 +109,5 @@
}
]
},
"autoPublish": true,
"//sampleConfiguration": {
"productName": "",
"productSlugs": [
"azure"
],
"disableDocsMs": true,
"apiRefLink": "https://docs.microsoft.com/javascript/api/@azure/arm-recoveryservices?view=azure-node-preview"
}
}
"autoPublish": true
}
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,15 @@ export interface IdentityData {
};
}

// @public
export interface ImmutabilitySettings {
// (undocumented)
state?: ImmutabilityState;
}

// @public
export type ImmutabilityState = string;

// @public
export type InfrastructureEncryptionState = string;

Expand Down Expand Up @@ -198,6 +207,13 @@ export enum KnownCrossRegionRestore {
Enabled = "Enabled"
}

// @public
export enum KnownImmutabilityState {
Disabled = "Disabled",
Locked = "Locked",
Unlocked = "Unlocked"
}

// @public
export enum KnownInfrastructureEncryptionState {
Disabled = "Disabled",
Expand Down Expand Up @@ -570,6 +586,11 @@ export type ResourceIdentityType = string;
// @public
export type ResourceMoveState = string;

// @public
export interface SecuritySettings {
immutabilitySettings?: ImmutabilitySettings;
}

// @public
export interface Sku {
capacity?: string;
Expand Down Expand Up @@ -726,6 +747,7 @@ export interface VaultProperties {
readonly privateEndpointStateForSiteRecovery?: VaultPrivateEndpointState;
readonly provisioningState?: string;
redundancySettings?: VaultPropertiesRedundancySettings;
securitySettings?: SecuritySettings;
upgradeDetails?: UpgradeDetails;
}

Expand Down
34 changes: 34 additions & 0 deletions sdk/recoveryservices/arm-recoveryservices/src/models/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,8 @@ export interface VaultProperties {
monitoringSettings?: MonitoringSettings;
/** The redundancy Settings of a Vault */
redundancySettings?: VaultPropertiesRedundancySettings;
/** Security Settings of the vault */
securitySettings?: SecuritySettings;
}

/** Details for upgrading vault. */
Expand Down Expand Up @@ -517,6 +519,17 @@ export interface VaultPropertiesRedundancySettings {
readonly crossRegionRestore?: CrossRegionRestore;
}

/** Security Settings of the vault */
export interface SecuritySettings {
/** Immutability Settings of a vault */
immutabilitySettings?: ImmutabilitySettings;
}

/** Immutability Settings of vault */
export interface ImmutabilitySettings {
state?: ImmutabilityState;
}

/** Identifies the unique system identifier for each Azure resource. */
export interface Sku {
/** Name of SKU is RS0 (Recovery Services 0th version) and the tier is standard tier. They do not have affect on backend storage redundancy or any other vault settings. To manage storage redundancy, use the backupstorageconfig */
Expand Down Expand Up @@ -1052,6 +1065,27 @@ export enum KnownCrossRegionRestore {
*/
export type CrossRegionRestore = string;

/** Known values of {@link ImmutabilityState} that the service accepts. */
export enum KnownImmutabilityState {
/** Disabled */
Disabled = "Disabled",
/** Unlocked */
Unlocked = "Unlocked",
/** Locked */
Locked = "Locked"
}

/**
* Defines values for ImmutabilityState. \
* {@link KnownImmutabilityState} can be used interchangeably with ImmutabilityState,
* this enum contains the known values that the service supports.
* ### Known values supported by the service
* **Disabled** \
* **Unlocked** \
* **Locked**
*/
export type ImmutabilityState = string;

/** Known values of {@link SkuName} that the service accepts. */
export enum KnownSkuName {
/** Standard */
Expand Down
38 changes: 38 additions & 0 deletions sdk/recoveryservices/arm-recoveryservices/src/models/mappers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -698,6 +698,13 @@ export const VaultProperties: coreClient.CompositeMapper = {
name: "Composite",
className: "VaultPropertiesRedundancySettings"
}
},
securitySettings: {
serializedName: "securitySettings",
type: {
name: "Composite",
className: "SecuritySettings"
}
}
}
}
Expand Down Expand Up @@ -1080,6 +1087,37 @@ export const VaultPropertiesRedundancySettings: coreClient.CompositeMapper = {
}
};

export const SecuritySettings: coreClient.CompositeMapper = {
type: {
name: "Composite",
className: "SecuritySettings",
modelProperties: {
immutabilitySettings: {
serializedName: "immutabilitySettings",
type: {
name: "Composite",
className: "ImmutabilitySettings"
}
}
}
}
};

export const ImmutabilitySettings: coreClient.CompositeMapper = {
type: {
name: "Composite",
className: "ImmutabilitySettings",
modelProperties: {
state: {
serializedName: "state",
type: {
name: "String"
}
}
}
}
};

export const Sku: coreClient.CompositeMapper = {
type: {
name: "Composite",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ export const subscriptionId: OperationURLParameter = {
export const apiVersion: OperationQueryParameter = {
parameterPath: "apiVersion",
mapper: {
defaultValue: "2022-04-01",
defaultValue: "2022-08-01",
isConstant: true,
serializedName: "api-version",
type: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ export class RecoveryServicesClient extends coreClient.ServiceClient {
credential: credentials
};

const packageDetails = `azsdk-js-arm-recoveryservices/5.1.0`;
const packageDetails = `azsdk-js-arm-recoveryservices/5.2.0`;
const userAgentPrefix =
options.userAgentOptions && options.userAgentOptions.userAgentPrefix
? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`
Expand All @@ -98,41 +98,34 @@ export class RecoveryServicesClient extends coreClient.ServiceClient {
};
super(optionsWithDefaults);

let bearerTokenAuthenticationPolicyFound: boolean = false;
if (options?.pipeline && options.pipeline.getOrderedPolicies().length > 0) {
const pipelinePolicies: coreRestPipeline.PipelinePolicy[] = options.pipeline.getOrderedPolicies();
bearerTokenAuthenticationPolicyFound = pipelinePolicies.some(
const bearerTokenAuthenticationPolicyFound = pipelinePolicies.some(
(pipelinePolicy) =>
pipelinePolicy.name ===
coreRestPipeline.bearerTokenAuthenticationPolicyName
);
}
if (
!options ||
!options.pipeline ||
options.pipeline.getOrderedPolicies().length == 0 ||
!bearerTokenAuthenticationPolicyFound
) {
this.pipeline.removePolicy({
name: coreRestPipeline.bearerTokenAuthenticationPolicyName
});
this.pipeline.addPolicy(
coreRestPipeline.bearerTokenAuthenticationPolicy({
credential: credentials,
scopes: `${optionsWithDefaults.credentialScopes}`,
challengeCallbacks: {
authorizeRequestOnChallenge:
coreClient.authorizeRequestOnClaimChallenge
}
})
);
if (!bearerTokenAuthenticationPolicyFound) {
this.pipeline.removePolicy({
name: coreRestPipeline.bearerTokenAuthenticationPolicyName
});
this.pipeline.addPolicy(
coreRestPipeline.bearerTokenAuthenticationPolicy({
scopes: `${optionsWithDefaults.baseUri}/.default`,
challengeCallbacks: {
authorizeRequestOnChallenge:
coreClient.authorizeRequestOnClaimChallenge
}
})
);
}
}
// Parameter assignments
this.subscriptionId = subscriptionId;

// Assigning values to Constant parameters
this.$host = options.$host || "https://management.azure.com";
this.apiVersion = options.apiVersion || "2022-04-01";
this.apiVersion = options.apiVersion || "2022-08-01";
this.vaultCertificates = new VaultCertificatesImpl(this);
this.registeredIdentities = new RegisteredIdentitiesImpl(this);
this.replicationUsages = new ReplicationUsagesImpl(this);
Expand Down
Loading

0 comments on commit 3355f9a

Please sign in to comment.