Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@

package com.azure.management.compute;

import com.azure.core.annotation.Fluent;
import com.azure.core.annotation.Immutable;
import com.azure.core.management.exception.ManagementError;
import com.azure.core.util.logging.ClientLogger;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;

/** The ApiError model. */
@Fluent
@Immutable
public final class ApiError extends ManagementError {
@JsonIgnore private final ClientLogger logger = new ClientLogger(ApiError.class);

Expand All @@ -36,5 +36,8 @@ public InnerError getInnererror() {
* @throws IllegalArgumentException thrown if the instance is not valid.
*/
public void validate() {
if (innererror != null) {
innererror.validate();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ public final class CreationData {
private DiskCreateOption createOption;

/*
* If createOption is Import, the Azure Resource Manager identifier of the
* storage account containing the blob to import as a disk. Required only
* if the blob is in a different subscription
* Required if createOption is Import. The Azure Resource Manager
* identifier of the storage account containing the blob to import as a
* disk.
*/
@JsonProperty(value = "storageAccountId")
private String storageAccountId;
Expand Down Expand Up @@ -85,9 +85,8 @@ public CreationData withCreateOption(DiskCreateOption createOption) {
}

/**
* Get the storageAccountId property: If createOption is Import, the Azure Resource Manager identifier of the
* storage account containing the blob to import as a disk. Required only if the blob is in a different
* subscription.
* Get the storageAccountId property: Required if createOption is Import. The Azure Resource Manager identifier of
* the storage account containing the blob to import as a disk.
*
* @return the storageAccountId value.
*/
Expand All @@ -96,9 +95,8 @@ public String storageAccountId() {
}

/**
* Set the storageAccountId property: If createOption is Import, the Azure Resource Manager identifier of the
* storage account containing the blob to import as a disk. Required only if the blob is in a different
* subscription.
* Set the storageAccountId property: Required if createOption is Import. The Azure Resource Manager identifier of
* the storage account containing the blob to import as a disk.
*
* @param storageAccountId the storageAccountId value to set.
* @return the CreationData object itself.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.

package com.azure.management.compute;

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;

/** Defines values for DiskEncryptionSetIdentityType. */
public enum DiskEncryptionSetIdentityType {
/** Enum value SystemAssigned. */
SYSTEM_ASSIGNED("SystemAssigned");

/** The actual serialized value for a DiskEncryptionSetIdentityType instance. */
private final String value;

DiskEncryptionSetIdentityType(String value) {
this.value = value;
}

/**
* Parses a serialized value to a DiskEncryptionSetIdentityType instance.
*
* @param value the serialized value to parse.
* @return the parsed DiskEncryptionSetIdentityType object, or null if unable to parse.
*/
@JsonCreator
public static DiskEncryptionSetIdentityType fromString(String value) {
DiskEncryptionSetIdentityType[] items = DiskEncryptionSetIdentityType.values();
for (DiskEncryptionSetIdentityType item : items) {
if (item.toString().equalsIgnoreCase(value)) {
return item;
}
}
return null;
}

@JsonValue
@Override
public String toString() {
return this.value;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.

package com.azure.management.compute;

import com.azure.core.annotation.Fluent;
import com.azure.core.annotation.JsonFlatten;
import com.azure.core.util.logging.ClientLogger;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.Map;

/** The DiskEncryptionSetUpdate model. */
@JsonFlatten
@Fluent
public class DiskEncryptionSetUpdate {
@JsonIgnore private final ClientLogger logger = new ClientLogger(DiskEncryptionSetUpdate.class);

/*
* Resource tags
*/
@JsonProperty(value = "tags")
private Map<String, String> tags;

/*
* Key Vault Key Url and vault id of KeK, KeK is optional and when provided
* is used to unwrap the encryptionKey
*/
@JsonProperty(value = "properties.activeKey")
private KeyVaultAndKeyReference activeKey;

/**
* Get the tags property: Resource tags.
*
* @return the tags value.
*/
public Map<String, String> tags() {
return this.tags;
}

/**
* Set the tags property: Resource tags.
*
* @param tags the tags value to set.
* @return the DiskEncryptionSetUpdate object itself.
*/
public DiskEncryptionSetUpdate withTags(Map<String, String> tags) {
this.tags = tags;
return this;
}

/**
* Get the activeKey property: Key Vault Key Url and vault id of KeK, KeK is optional and when provided is used to
* unwrap the encryptionKey.
*
* @return the activeKey value.
*/
public KeyVaultAndKeyReference activeKey() {
return this.activeKey;
}

/**
* Set the activeKey property: Key Vault Key Url and vault id of KeK, KeK is optional and when provided is used to
* unwrap the encryptionKey.
*
* @param activeKey the activeKey value to set.
* @return the DiskEncryptionSetUpdate object itself.
*/
public DiskEncryptionSetUpdate withActiveKey(KeyVaultAndKeyReference activeKey) {
this.activeKey = activeKey;
return this;
}

/**
* Validates the instance.
*
* @throws IllegalArgumentException thrown if the instance is not valid.
*/
public void validate() {
if (activeKey() != null) {
activeKey().validate();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,13 @@ public class DiskUpdate {
@JsonProperty(value = "properties.diskMBpsReadWrite")
private Integer diskMBpsReadWrite;

/*
* Encryption property can be used to encrypt data at rest with customer
* managed keys or platform managed keys.
*/
@JsonProperty(value = "properties.encryption")
private Encryption encryption;

/**
* Get the tags property: Resource tags.
*
Expand Down Expand Up @@ -220,6 +227,28 @@ public DiskUpdate withDiskMBpsReadWrite(Integer diskMBpsReadWrite) {
return this;
}

/**
* Get the encryption property: Encryption property can be used to encrypt data at rest with customer managed keys
* or platform managed keys.
*
* @return the encryption value.
*/
public Encryption encryption() {
return this.encryption;
}

/**
* Set the encryption property: Encryption property can be used to encrypt data at rest with customer managed keys
* or platform managed keys.
*
* @param encryption the encryption value to set.
* @return the DiskUpdate object itself.
*/
public DiskUpdate withEncryption(Encryption encryption) {
this.encryption = encryption;
return this;
}

/**
* Validates the instance.
*
Expand All @@ -232,5 +261,8 @@ public void validate() {
if (encryptionSettingsCollection() != null) {
encryptionSettingsCollection().validate();
}
if (encryption() != null) {
encryption().validate();
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.

package com.azure.management.compute;

import com.azure.core.annotation.Fluent;
import com.azure.core.util.logging.ClientLogger;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;

/** The Encryption model. */
@Fluent
public final class Encryption {
@JsonIgnore private final ClientLogger logger = new ClientLogger(Encryption.class);

/*
* ResourceId of the disk encryption set to use for enabling encryption at
* rest.
*/
@JsonProperty(value = "diskEncryptionSetId")
private String diskEncryptionSetId;

/*
* The type of key used to encrypt the data of the disk.
*/
@JsonProperty(value = "type", required = true)
private EncryptionType type;

/**
* Get the diskEncryptionSetId property: ResourceId of the disk encryption set to use for enabling encryption at
* rest.
*
* @return the diskEncryptionSetId value.
*/
public String diskEncryptionSetId() {
return this.diskEncryptionSetId;
}

/**
* Set the diskEncryptionSetId property: ResourceId of the disk encryption set to use for enabling encryption at
* rest.
*
* @param diskEncryptionSetId the diskEncryptionSetId value to set.
* @return the Encryption object itself.
*/
public Encryption withDiskEncryptionSetId(String diskEncryptionSetId) {
this.diskEncryptionSetId = diskEncryptionSetId;
return this;
}

/**
* Get the type property: The type of key used to encrypt the data of the disk.
*
* @return the type value.
*/
public EncryptionType type() {
return this.type;
}

/**
* Set the type property: The type of key used to encrypt the data of the disk.
*
* @param type the type value to set.
* @return the Encryption object itself.
*/
public Encryption withType(EncryptionType type) {
this.type = type;
return this;
}

/**
* Validates the instance.
*
* @throws IllegalArgumentException thrown if the instance is not valid.
*/
public void validate() {
if (type() == null) {
throw logger
.logExceptionAsError(
new IllegalArgumentException("Missing required property type in model Encryption"));
}
}
}
Loading