diff --git a/sdk/databox/azure-resourcemanager-databox/CHANGELOG.md b/sdk/databox/azure-resourcemanager-databox/CHANGELOG.md index 95f9217c5a824..62f2639b21301 100644 --- a/sdk/databox/azure-resourcemanager-databox/CHANGELOG.md +++ b/sdk/databox/azure-resourcemanager-databox/CHANGELOG.md @@ -1,7 +1,8 @@ # Release History -## 1.0.0-beta.2 (Unreleased) +## 1.0.0-beta.1 (2022-01-05) +- Azure Resource Manager DataBox client library for Java. This package contains Microsoft Azure SDK for DataBox Management SDK. Package tag package-2021-08-preview. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). ## 1.0.0-beta.1 (2021-04-14) diff --git a/sdk/databox/azure-resourcemanager-databox/README.md b/sdk/databox/azure-resourcemanager-databox/README.md index 848c2965820bb..8e3249921b6d4 100644 --- a/sdk/databox/azure-resourcemanager-databox/README.md +++ b/sdk/databox/azure-resourcemanager-databox/README.md @@ -2,7 +2,7 @@ Azure Resource Manager DataBox client library for Java. -This package contains Microsoft Azure SDK for DataBox Management SDK. Package tag package-2021-03. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). +This package contains Microsoft Azure SDK for DataBox Management SDK. Package tag package-2021-08-preview. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). ## We'd love to hear your feedback @@ -32,7 +32,7 @@ Various documentation is available to help you get started com.azure.resourcemanager azure-resourcemanager-databox - 1.0.0-beta.1 + 1.0.0-beta.2 ``` [//]: # ({x-version-update-end}) @@ -74,6 +74,9 @@ See [API design][design] for general introduction on design and key concepts on ## Examples +[Code snippets and samples](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/databox/azure-resourcemanager-databox/SAMPLE.md) + + ## Troubleshooting ## Next steps diff --git a/sdk/databox/azure-resourcemanager-databox/SAMPLE.md b/sdk/databox/azure-resourcemanager-databox/SAMPLE.md new file mode 100644 index 0000000000000..f99f99529dac9 --- /dev/null +++ b/sdk/databox/azure-resourcemanager-databox/SAMPLE.md @@ -0,0 +1,1056 @@ +# Code snippets and samples + + +## Jobs + +- [BookShipmentPickUp](#jobs_bookshipmentpickup) +- [Cancel](#jobs_cancel) +- [Create](#jobs_create) +- [Delete](#jobs_delete) +- [GetByResourceGroup](#jobs_getbyresourcegroup) +- [List](#jobs_list) +- [ListByResourceGroup](#jobs_listbyresourcegroup) +- [ListCredentials](#jobs_listcredentials) +- [MarkDevicesShipped](#jobs_markdevicesshipped) +- [Update](#jobs_update) + +## Operations + +- [List](#operations_list) + +## ResourceProvider + +- [Mitigate](#resourceprovider_mitigate) + +## Service + +- [ListAvailableSkusByResourceGroup](#service_listavailableskusbyresourcegroup) +- [RegionConfiguration](#service_regionconfiguration) +- [RegionConfigurationByResourceGroup](#service_regionconfigurationbyresourcegroup) +- [ValidateAddress](#service_validateaddress) +- [ValidateInputs](#service_validateinputs) +- [ValidateInputsByResourceGroup](#service_validateinputsbyresourcegroup) +### Jobs_BookShipmentPickUp + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.databox.models.ShipmentPickUpRequest; +import java.time.OffsetDateTime; + +/** Samples for Jobs BookShipmentPickUp. */ +public final class JobsBookShipmentPickUpSamples { + /* + * x-ms-original-file: specification/databox/resource-manager/Microsoft.DataBox/preview/2021-08-01-preview/examples/BookShipmentPickupPost.json + */ + /** + * Sample code: BookShipmentPickupPost. + * + * @param manager Entry point to DataBoxManager. + */ + public static void bookShipmentPickupPost(com.azure.resourcemanager.databox.DataBoxManager manager) { + manager + .jobs() + .bookShipmentPickUpWithResponse( + "bvttoolrg6", + "TJ-636646322037905056", + new ShipmentPickUpRequest() + .withStartTime(OffsetDateTime.parse("2019-09-20T18:30:00Z")) + .withEndTime(OffsetDateTime.parse("2019-09-22T18:30:00Z")) + .withShipmentLocation("Front desk"), + Context.NONE); + } +} +``` + +### Jobs_Cancel + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.databox.models.CancellationReason; + +/** Samples for Jobs Cancel. */ +public final class JobsCancelSamples { + /* + * x-ms-original-file: specification/databox/resource-manager/Microsoft.DataBox/preview/2021-08-01-preview/examples/JobsCancelPost.json + */ + /** + * Sample code: JobsCancelPost. + * + * @param manager Entry point to DataBoxManager. + */ + public static void jobsCancelPost(com.azure.resourcemanager.databox.DataBoxManager manager) { + manager + .jobs() + .cancelWithResponse( + "SdkRg5154", "SdkJob952", new CancellationReason().withReason("CancelTest"), Context.NONE); + } +} +``` + +### Jobs_Create + +```java +import com.azure.resourcemanager.databox.models.AddressType; +import com.azure.resourcemanager.databox.models.ContactDetails; +import com.azure.resourcemanager.databox.models.DataAccountType; +import com.azure.resourcemanager.databox.models.DataBoxJobDetails; +import com.azure.resourcemanager.databox.models.DataExportDetails; +import com.azure.resourcemanager.databox.models.DataImportDetails; +import com.azure.resourcemanager.databox.models.DoubleEncryption; +import com.azure.resourcemanager.databox.models.EncryptionPreferences; +import com.azure.resourcemanager.databox.models.Preferences; +import com.azure.resourcemanager.databox.models.ResourceIdentity; +import com.azure.resourcemanager.databox.models.ShippingAddress; +import com.azure.resourcemanager.databox.models.Sku; +import com.azure.resourcemanager.databox.models.SkuName; +import com.azure.resourcemanager.databox.models.StorageAccountDetails; +import com.azure.resourcemanager.databox.models.TransferAllDetails; +import com.azure.resourcemanager.databox.models.TransferConfiguration; +import com.azure.resourcemanager.databox.models.TransferConfigurationTransferAllDetails; +import com.azure.resourcemanager.databox.models.TransferConfigurationType; +import com.azure.resourcemanager.databox.models.TransferType; +import com.azure.resourcemanager.databox.models.UserAssignedIdentity; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Jobs Create. */ +public final class JobsCreateSamples { + /* + * x-ms-original-file: specification/databox/resource-manager/Microsoft.DataBox/preview/2021-08-01-preview/examples/JobsCreateDevicePassword.json + */ + /** + * Sample code: JobsCreateDevicePassword. + * + * @param manager Entry point to DataBoxManager. + */ + public static void jobsCreateDevicePassword(com.azure.resourcemanager.databox.DataBoxManager manager) { + manager + .jobs() + .define("SdkJob9640") + .withRegion("westus") + .withExistingResourceGroup("SdkRg7478") + .withSku(new Sku().withName(SkuName.DATA_BOX)) + .withTransferType(TransferType.IMPORT_TO_AZURE) + .withDetails( + new DataBoxJobDetails() + .withContactDetails( + new ContactDetails() + .withContactName("Public SDK Test") + .withPhone("1234567890") + .withPhoneExtension("1234") + .withEmailList(Arrays.asList("testing@microsoft.com"))) + .withShippingAddress( + new ShippingAddress() + .withStreetAddress1("16 TOWNSEND ST") + .withStreetAddress2("Unit 1") + .withCity("San Francisco") + .withStateOrProvince("CA") + .withCountry("US") + .withPostalCode("94107") + .withCompanyName("Microsoft") + .withAddressType(AddressType.COMMERCIAL)) + .withDataImportDetails( + Arrays + .asList( + new DataImportDetails() + .withAccountDetails( + new StorageAccountDetails() + .withSharePassword("") + .withStorageAccountId( + "/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourceGroups/databoxbvt1/providers/Microsoft.Storage/storageAccounts/databoxbvttestaccount2")))) + .withDevicePassword("")) + .create(); + } + + /* + * x-ms-original-file: specification/databox/resource-manager/Microsoft.DataBox/preview/2021-08-01-preview/examples/JobsCreate.json + */ + /** + * Sample code: JobsCreate. + * + * @param manager Entry point to DataBoxManager. + */ + public static void jobsCreate(com.azure.resourcemanager.databox.DataBoxManager manager) { + manager + .jobs() + .define("SdkJob952") + .withRegion("westus") + .withExistingResourceGroup("SdkRg5154") + .withSku(new Sku().withName(SkuName.DATA_BOX)) + .withTransferType(TransferType.IMPORT_TO_AZURE) + .withDetails( + new DataBoxJobDetails() + .withContactDetails( + new ContactDetails() + .withContactName("Public SDK Test") + .withPhone("1234567890") + .withPhoneExtension("1234") + .withEmailList(Arrays.asList("testing@microsoft.com"))) + .withShippingAddress( + new ShippingAddress() + .withStreetAddress1("16 TOWNSEND ST") + .withStreetAddress2("Unit 1") + .withCity("San Francisco") + .withStateOrProvince("CA") + .withCountry("US") + .withPostalCode("94107") + .withCompanyName("Microsoft") + .withAddressType(AddressType.COMMERCIAL)) + .withDataImportDetails( + Arrays + .asList( + new DataImportDetails() + .withAccountDetails( + new StorageAccountDetails() + .withStorageAccountId( + "/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourcegroups/databoxbvt/providers/Microsoft.Storage/storageAccounts/databoxbvttestaccount"))))) + .create(); + } + + /* + * x-ms-original-file: specification/databox/resource-manager/Microsoft.DataBox/preview/2021-08-01-preview/examples/JobsCreateDoubleEncryption.json + */ + /** + * Sample code: JobsCreateDoubleEncryption. + * + * @param manager Entry point to DataBoxManager. + */ + public static void jobsCreateDoubleEncryption(com.azure.resourcemanager.databox.DataBoxManager manager) { + manager + .jobs() + .define("SdkJob6599") + .withRegion("westus") + .withExistingResourceGroup("SdkRg608") + .withSku(new Sku().withName(SkuName.DATA_BOX)) + .withTransferType(TransferType.IMPORT_TO_AZURE) + .withDetails( + new DataBoxJobDetails() + .withContactDetails( + new ContactDetails() + .withContactName("Public SDK Test") + .withPhone("1234567890") + .withPhoneExtension("1234") + .withEmailList(Arrays.asList("testing@microsoft.com"))) + .withShippingAddress( + new ShippingAddress() + .withStreetAddress1("16 TOWNSEND ST") + .withStreetAddress2("Unit 1") + .withCity("San Francisco") + .withStateOrProvince("CA") + .withCountry("US") + .withPostalCode("94107") + .withCompanyName("Microsoft") + .withAddressType(AddressType.COMMERCIAL)) + .withDataImportDetails( + Arrays + .asList( + new DataImportDetails() + .withAccountDetails( + new StorageAccountDetails() + .withStorageAccountId( + "/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourcegroups/databoxbvt/providers/Microsoft.Storage/storageAccounts/databoxbvttestaccount")))) + .withPreferences( + new Preferences() + .withEncryptionPreferences( + new EncryptionPreferences().withDoubleEncryption(DoubleEncryption.ENABLED)))) + .create(); + } + + /* + * x-ms-original-file: specification/databox/resource-manager/Microsoft.DataBox/preview/2021-08-01-preview/examples/JobsCreateWithUserAssignedIdentity.json + */ + /** + * Sample code: JobsCreateWithUserAssignedIdentity. + * + * @param manager Entry point to DataBoxManager. + */ + public static void jobsCreateWithUserAssignedIdentity(com.azure.resourcemanager.databox.DataBoxManager manager) { + manager + .jobs() + .define("SdkJob5337") + .withRegion("westus") + .withExistingResourceGroup("SdkRg7552") + .withSku(new Sku().withName(SkuName.DATA_BOX)) + .withTransferType(TransferType.IMPORT_TO_AZURE) + .withIdentity( + new ResourceIdentity() + .withType("UserAssigned") + .withUserAssignedIdentities( + mapOf( + "/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourceGroups/akvenkat/providers/Microsoft.ManagedIdentity/userAssignedIdentities/sdkIdentity", + new UserAssignedIdentity()))) + .withDetails( + new DataBoxJobDetails() + .withContactDetails( + new ContactDetails() + .withContactName("Public SDK Test") + .withPhone("1234567890") + .withPhoneExtension("1234") + .withEmailList(Arrays.asList("testing@microsoft.com"))) + .withShippingAddress( + new ShippingAddress() + .withStreetAddress1("16 TOWNSEND ST") + .withStreetAddress2("Unit 1") + .withCity("San Francisco") + .withStateOrProvince("CA") + .withCountry("US") + .withPostalCode("94107") + .withCompanyName("Microsoft") + .withAddressType(AddressType.COMMERCIAL)) + .withDataImportDetails( + Arrays + .asList( + new DataImportDetails() + .withAccountDetails( + new StorageAccountDetails() + .withStorageAccountId( + "/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourceGroups/databoxbvt1/providers/Microsoft.Storage/storageAccounts/databoxbvttestaccount2"))))) + .create(); + } + + /* + * x-ms-original-file: specification/databox/resource-manager/Microsoft.DataBox/preview/2021-08-01-preview/examples/JobsCreateExport.json + */ + /** + * Sample code: JobsCreateExport. + * + * @param manager Entry point to DataBoxManager. + */ + public static void jobsCreateExport(com.azure.resourcemanager.databox.DataBoxManager manager) { + manager + .jobs() + .define("SdkJob6429") + .withRegion("westus") + .withExistingResourceGroup("SdkRg8091") + .withSku(new Sku().withName(SkuName.DATA_BOX)) + .withTransferType(TransferType.EXPORT_FROM_AZURE) + .withDetails( + new DataBoxJobDetails() + .withContactDetails( + new ContactDetails() + .withContactName("Public SDK Test") + .withPhone("1234567890") + .withPhoneExtension("1234") + .withEmailList(Arrays.asList("testing@microsoft.com"))) + .withShippingAddress( + new ShippingAddress() + .withStreetAddress1("16 TOWNSEND ST") + .withStreetAddress2("Unit 1") + .withCity("San Francisco") + .withStateOrProvince("CA") + .withCountry("US") + .withPostalCode("94107") + .withCompanyName("Microsoft") + .withAddressType(AddressType.COMMERCIAL)) + .withDataExportDetails( + Arrays + .asList( + new DataExportDetails() + .withTransferConfiguration( + new TransferConfiguration() + .withTransferConfigurationType(TransferConfigurationType.TRANSFER_ALL) + .withTransferAllDetails( + new TransferConfigurationTransferAllDetails() + .withInclude( + new TransferAllDetails() + .withDataAccountType(DataAccountType.STORAGE_ACCOUNT) + .withTransferAllBlobs(true) + .withTransferAllFiles(true)))) + .withAccountDetails( + new StorageAccountDetails() + .withStorageAccountId( + "/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourceGroups/akvenkat/providers/Microsoft.Storage/storageAccounts/aaaaaa2"))))) + .create(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### Jobs_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for Jobs Delete. */ +public final class JobsDeleteSamples { + /* + * x-ms-original-file: specification/databox/resource-manager/Microsoft.DataBox/preview/2021-08-01-preview/examples/JobsDelete.json + */ + /** + * Sample code: JobsDelete. + * + * @param manager Entry point to DataBoxManager. + */ + public static void jobsDelete(com.azure.resourcemanager.databox.DataBoxManager manager) { + manager.jobs().delete("SdkRg5154", "SdkJob952", Context.NONE); + } +} +``` + +### Jobs_GetByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for Jobs GetByResourceGroup. */ +public final class JobsGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/databox/resource-manager/Microsoft.DataBox/preview/2021-08-01-preview/examples/JobsGet.json + */ + /** + * Sample code: JobsGet. + * + * @param manager Entry point to DataBoxManager. + */ + public static void jobsGet(com.azure.resourcemanager.databox.DataBoxManager manager) { + manager.jobs().getByResourceGroupWithResponse("SdkRg5154", "SdkJob952", "details", Context.NONE); + } + + /* + * x-ms-original-file: specification/databox/resource-manager/Microsoft.DataBox/preview/2021-08-01-preview/examples/JobsGetCmk.json + */ + /** + * Sample code: JobsGetCmk. + * + * @param manager Entry point to DataBoxManager. + */ + public static void jobsGetCmk(com.azure.resourcemanager.databox.DataBoxManager manager) { + manager.jobs().getByResourceGroupWithResponse("SdkRg7937", "SdkJob1735", "details", Context.NONE); + } + + /* + * x-ms-original-file: specification/databox/resource-manager/Microsoft.DataBox/preview/2021-08-01-preview/examples/JobsGetExport.json + */ + /** + * Sample code: JobsGetExport. + * + * @param manager Entry point to DataBoxManager. + */ + public static void jobsGetExport(com.azure.resourcemanager.databox.DataBoxManager manager) { + manager.jobs().getByResourceGroupWithResponse("SdkRg8091", "SdkJob6429", "details", Context.NONE); + } + + /* + * x-ms-original-file: specification/databox/resource-manager/Microsoft.DataBox/preview/2021-08-01-preview/examples/JobsGetCopyStuck.json + */ + /** + * Sample code: JobsGetCopyStuck. + * + * @param manager Entry point to DataBoxManager. + */ + public static void jobsGetCopyStuck(com.azure.resourcemanager.databox.DataBoxManager manager) { + manager + .jobs() + .getByResourceGroupWithResponse("dmstestresource", "TJx-637505258985313014", "details", Context.NONE); + } + + /* + * x-ms-original-file: specification/databox/resource-manager/Microsoft.DataBox/preview/2021-08-01-preview/examples/JobsGetWaitingForAction.json + */ + /** + * Sample code: JobsGetWaitingForAction. + * + * @param manager Entry point to DataBoxManager. + */ + public static void jobsGetWaitingForAction(com.azure.resourcemanager.databox.DataBoxManager manager) { + manager + .jobs() + .getByResourceGroupWithResponse("dmstestresource", "TJx-637505258985313014", "details", Context.NONE); + } +} +``` + +### Jobs_List + +```java +import com.azure.core.util.Context; + +/** Samples for Jobs List. */ +public final class JobsListSamples { + /* + * x-ms-original-file: specification/databox/resource-manager/Microsoft.DataBox/preview/2021-08-01-preview/examples/JobsList.json + */ + /** + * Sample code: JobsList. + * + * @param manager Entry point to DataBoxManager. + */ + public static void jobsList(com.azure.resourcemanager.databox.DataBoxManager manager) { + manager.jobs().list(null, Context.NONE); + } +} +``` + +### Jobs_ListByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for Jobs ListByResourceGroup. */ +public final class JobsListByResourceGroupSamples { + /* + * x-ms-original-file: specification/databox/resource-manager/Microsoft.DataBox/preview/2021-08-01-preview/examples/JobsListByResourceGroup.json + */ + /** + * Sample code: JobsListByResourceGroup. + * + * @param manager Entry point to DataBoxManager. + */ + public static void jobsListByResourceGroup(com.azure.resourcemanager.databox.DataBoxManager manager) { + manager.jobs().listByResourceGroup("SdkRg5154", null, Context.NONE); + } +} +``` + +### Jobs_ListCredentials + +```java +import com.azure.core.util.Context; + +/** Samples for Jobs ListCredentials. */ +public final class JobsListCredentialsSamples { + /* + * x-ms-original-file: specification/databox/resource-manager/Microsoft.DataBox/preview/2021-08-01-preview/examples/JobsListCredentials.json + */ + /** + * Sample code: JobsListCredentials. + * + * @param manager Entry point to DataBoxManager. + */ + public static void jobsListCredentials(com.azure.resourcemanager.databox.DataBoxManager manager) { + manager.jobs().listCredentials("bvttoolrg6", "TJ-636646322037905056", Context.NONE); + } +} +``` + +### Jobs_MarkDevicesShipped + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.databox.models.MarkDevicesShippedRequest; +import com.azure.resourcemanager.databox.models.PackageCarrierInfo; + +/** Samples for Jobs MarkDevicesShipped. */ +public final class JobsMarkDevicesShippedSamples { + /* + * x-ms-original-file: specification/databox/resource-manager/Microsoft.DataBox/preview/2021-08-01-preview/examples/MarkDevicesShipped.json + */ + /** + * Sample code: MarkDevicesShipped. + * + * @param manager Entry point to DataBoxManager. + */ + public static void markDevicesShipped(com.azure.resourcemanager.databox.DataBoxManager manager) { + manager + .jobs() + .markDevicesShippedWithResponse( + "SdkJob8367", + "SdkRg9836", + new MarkDevicesShippedRequest() + .withDeliverToDcPackageDetails( + new PackageCarrierInfo().withCarrierName("DHL").withTrackingId("123456")), + Context.NONE); + } +} +``` + +### Jobs_Update + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.databox.models.AddressType; +import com.azure.resourcemanager.databox.models.ContactDetails; +import com.azure.resourcemanager.databox.models.IdentityProperties; +import com.azure.resourcemanager.databox.models.JobResource; +import com.azure.resourcemanager.databox.models.KekType; +import com.azure.resourcemanager.databox.models.KeyEncryptionKey; +import com.azure.resourcemanager.databox.models.ResourceIdentity; +import com.azure.resourcemanager.databox.models.ShippingAddress; +import com.azure.resourcemanager.databox.models.UpdateJobDetails; +import com.azure.resourcemanager.databox.models.UserAssignedIdentity; +import com.azure.resourcemanager.databox.models.UserAssignedProperties; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Jobs Update. */ +public final class JobsUpdateSamples { + /* + * x-ms-original-file: specification/databox/resource-manager/Microsoft.DataBox/preview/2021-08-01-preview/examples/JobsPatchCmk.json + */ + /** + * Sample code: JobsPatchCmk. + * + * @param manager Entry point to DataBoxManager. + */ + public static void jobsPatchCmk(com.azure.resourcemanager.databox.DataBoxManager manager) { + JobResource resource = + manager.jobs().getByResourceGroupWithResponse("SdkRg7937", "SdkJob1735", null, Context.NONE).getValue(); + resource + .update() + .withDetails( + new UpdateJobDetails() + .withKeyEncryptionKey( + new KeyEncryptionKey() + .withKekType(KekType.CUSTOMER_MANAGED) + .withKekUrl("https://sdkkeyvault.vault.azure.net/keys/SSDKEY/") + .withKekVaultResourceId( + "/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourceGroups/akvenkat/providers/Microsoft.KeyVault/vaults/SDKKeyVault"))) + .apply(); + } + + /* + * x-ms-original-file: specification/databox/resource-manager/Microsoft.DataBox/preview/2021-08-01-preview/examples/JobsPatchSystemAssignedToUserAssigned.json + */ + /** + * Sample code: JobsPatchSystemAssignedToUserAssigned. + * + * @param manager Entry point to DataBoxManager. + */ + public static void jobsPatchSystemAssignedToUserAssigned(com.azure.resourcemanager.databox.DataBoxManager manager) { + JobResource resource = + manager.jobs().getByResourceGroupWithResponse("SdkRg9765", "SdkJob2965", null, Context.NONE).getValue(); + resource + .update() + .withIdentity( + new ResourceIdentity() + .withType("SystemAssigned,UserAssigned") + .withUserAssignedIdentities( + mapOf( + "/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourceGroups/akvenkat/providers/Microsoft.ManagedIdentity/userAssignedIdentities/sdkIdentity", + new UserAssignedIdentity()))) + .withDetails( + new UpdateJobDetails() + .withKeyEncryptionKey( + new KeyEncryptionKey() + .withKekType(KekType.CUSTOMER_MANAGED) + .withIdentityProperties( + new IdentityProperties() + .withType("UserAssigned") + .withUserAssigned( + new UserAssignedProperties() + .withResourceId( + "/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourceGroups/akvenkat/providers/Microsoft.ManagedIdentity/userAssignedIdentities/sdkIdentity"))) + .withKekUrl("https://sdkkeyvault.vault.azure.net/keys/SSDKEY/") + .withKekVaultResourceId( + "/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourceGroups/akvenkat/providers/Microsoft.KeyVault/vaults/SDKKeyVault"))) + .apply(); + } + + /* + * x-ms-original-file: specification/databox/resource-manager/Microsoft.DataBox/preview/2021-08-01-preview/examples/JobsPatch.json + */ + /** + * Sample code: JobsPatch. + * + * @param manager Entry point to DataBoxManager. + */ + public static void jobsPatch(com.azure.resourcemanager.databox.DataBoxManager manager) { + JobResource resource = + manager.jobs().getByResourceGroupWithResponse("SdkRg5154", "SdkJob952", "details", Context.NONE).getValue(); + resource + .update() + .withDetails( + new UpdateJobDetails() + .withContactDetails( + new ContactDetails() + .withContactName("Update Job") + .withPhone("1234567890") + .withPhoneExtension("1234") + .withEmailList(Arrays.asList("testing@microsoft.com"))) + .withShippingAddress( + new ShippingAddress() + .withStreetAddress1("16 TOWNSEND ST") + .withStreetAddress2("Unit 1") + .withCity("San Francisco") + .withStateOrProvince("CA") + .withCountry("US") + .withPostalCode("94107") + .withCompanyName("Microsoft") + .withAddressType(AddressType.COMMERCIAL))) + .apply(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### Operations_List + +```java +import com.azure.core.util.Context; + +/** Samples for Operations List. */ +public final class OperationsListSamples { + /* + * x-ms-original-file: specification/databox/resource-manager/Microsoft.DataBox/preview/2021-08-01-preview/examples/OperationsGet.json + */ + /** + * Sample code: OperationsGet. + * + * @param manager Entry point to DataBoxManager. + */ + public static void operationsGet(com.azure.resourcemanager.databox.DataBoxManager manager) { + manager.operations().list(Context.NONE); + } +} +``` + +### ResourceProvider_Mitigate + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.databox.models.CustomerResolutionCode; +import com.azure.resourcemanager.databox.models.MitigateJobRequest; + +/** Samples for ResourceProvider Mitigate. */ +public final class ResourceProviderMitigateSamples { + /* + * x-ms-original-file: specification/databox/resource-manager/Microsoft.DataBox/preview/2021-08-01-preview/examples/JobMitigate.json + */ + /** + * Sample code: Mitigate. + * + * @param manager Entry point to DataBoxManager. + */ + public static void mitigate(com.azure.resourcemanager.databox.DataBoxManager manager) { + manager + .resourceProviders() + .mitigateWithResponse( + "SdkJob8367", + "SdkRg9836", + new MitigateJobRequest().withCustomerResolutionCode(CustomerResolutionCode.MOVE_TO_CLEAN_UP_DEVICE), + Context.NONE); + } +} +``` + +### Service_ListAvailableSkusByResourceGroup + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.databox.models.AvailableSkuRequest; +import com.azure.resourcemanager.databox.models.TransferType; + +/** Samples for Service ListAvailableSkusByResourceGroup. */ +public final class ServiceListAvailableSkusByResourceGroupSamples { + /* + * x-ms-original-file: specification/databox/resource-manager/Microsoft.DataBox/preview/2021-08-01-preview/examples/AvailableSkusPost.json + */ + /** + * Sample code: AvailableSkusPost. + * + * @param manager Entry point to DataBoxManager. + */ + public static void availableSkusPost(com.azure.resourcemanager.databox.DataBoxManager manager) { + manager + .services() + .listAvailableSkusByResourceGroup( + "bvttoolrg6", + "westus", + new AvailableSkuRequest() + .withTransferType(TransferType.IMPORT_TO_AZURE) + .withCountry("US") + .withLocation("westus"), + Context.NONE); + } +} +``` + +### Service_RegionConfiguration + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.databox.models.DataBoxScheduleAvailabilityRequest; +import com.azure.resourcemanager.databox.models.RegionConfigurationRequest; + +/** Samples for Service RegionConfiguration. */ +public final class ServiceRegionConfigurationSamples { + /* + * x-ms-original-file: specification/databox/resource-manager/Microsoft.DataBox/preview/2021-08-01-preview/examples/RegionConfiguration.json + */ + /** + * Sample code: RegionConfiguration. + * + * @param manager Entry point to DataBoxManager. + */ + public static void regionConfiguration(com.azure.resourcemanager.databox.DataBoxManager manager) { + manager + .services() + .regionConfigurationWithResponse( + "westus", + new RegionConfigurationRequest() + .withScheduleAvailabilityRequest( + new DataBoxScheduleAvailabilityRequest().withStorageLocation("westus")), + Context.NONE); + } +} +``` + +### Service_RegionConfigurationByResourceGroup + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.databox.models.DataBoxScheduleAvailabilityRequest; +import com.azure.resourcemanager.databox.models.RegionConfigurationRequest; + +/** Samples for Service RegionConfigurationByResourceGroup. */ +public final class ServiceRegionConfigurationByResourceGroupSamples { + /* + * x-ms-original-file: specification/databox/resource-manager/Microsoft.DataBox/preview/2021-08-01-preview/examples/RegionConfigurationByResourceGroup.json + */ + /** + * Sample code: RegionConfigurationByResourceGroup. + * + * @param manager Entry point to DataBoxManager. + */ + public static void regionConfigurationByResourceGroup(com.azure.resourcemanager.databox.DataBoxManager manager) { + manager + .services() + .regionConfigurationByResourceGroupWithResponse( + "SdkRg4981", + "westus", + new RegionConfigurationRequest() + .withScheduleAvailabilityRequest( + new DataBoxScheduleAvailabilityRequest().withStorageLocation("westus")), + Context.NONE); + } +} +``` + +### Service_ValidateAddress + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.databox.models.AddressType; +import com.azure.resourcemanager.databox.models.ShippingAddress; +import com.azure.resourcemanager.databox.models.SkuName; +import com.azure.resourcemanager.databox.models.ValidateAddress; + +/** Samples for Service ValidateAddress. */ +public final class ServiceValidateAddressSamples { + /* + * x-ms-original-file: specification/databox/resource-manager/Microsoft.DataBox/preview/2021-08-01-preview/examples/ValidateAddressPost.json + */ + /** + * Sample code: ValidateAddressPost. + * + * @param manager Entry point to DataBoxManager. + */ + public static void validateAddressPost(com.azure.resourcemanager.databox.DataBoxManager manager) { + manager + .services() + .validateAddressWithResponse( + "westus", + new ValidateAddress() + .withShippingAddress( + new ShippingAddress() + .withStreetAddress1("16 TOWNSEND ST") + .withStreetAddress2("Unit 1") + .withCity("San Francisco") + .withStateOrProvince("CA") + .withCountry("US") + .withPostalCode("94107") + .withCompanyName("Microsoft") + .withAddressType(AddressType.COMMERCIAL)) + .withDeviceType(SkuName.DATA_BOX), + Context.NONE); + } +} +``` + +### Service_ValidateInputs + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.databox.models.AddressType; +import com.azure.resourcemanager.databox.models.CreateJobValidations; +import com.azure.resourcemanager.databox.models.CreateOrderLimitForSubscriptionValidationRequest; +import com.azure.resourcemanager.databox.models.DataImportDetails; +import com.azure.resourcemanager.databox.models.DataTransferDetailsValidationRequest; +import com.azure.resourcemanager.databox.models.Preferences; +import com.azure.resourcemanager.databox.models.PreferencesValidationRequest; +import com.azure.resourcemanager.databox.models.ShippingAddress; +import com.azure.resourcemanager.databox.models.SkuAvailabilityValidationRequest; +import com.azure.resourcemanager.databox.models.SkuName; +import com.azure.resourcemanager.databox.models.StorageAccountDetails; +import com.azure.resourcemanager.databox.models.SubscriptionIsAllowedToCreateJobValidationRequest; +import com.azure.resourcemanager.databox.models.TransferType; +import com.azure.resourcemanager.databox.models.TransportPreferences; +import com.azure.resourcemanager.databox.models.TransportShipmentTypes; +import com.azure.resourcemanager.databox.models.ValidateAddress; +import java.util.Arrays; + +/** Samples for Service ValidateInputs. */ +public final class ServiceValidateInputsSamples { + /* + * x-ms-original-file: specification/databox/resource-manager/Microsoft.DataBox/preview/2021-08-01-preview/examples/ValidateInputs.json + */ + /** + * Sample code: ValidateInputs. + * + * @param manager Entry point to DataBoxManager. + */ + public static void validateInputs(com.azure.resourcemanager.databox.DataBoxManager manager) { + manager + .services() + .validateInputsWithResponse( + "westus", + new CreateJobValidations() + .withIndividualRequestDetails( + Arrays + .asList( + new DataTransferDetailsValidationRequest() + .withDataImportDetails( + Arrays + .asList( + new DataImportDetails() + .withAccountDetails( + new StorageAccountDetails() + .withStorageAccountId( + "/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourcegroups/databoxbvt/providers/Microsoft.Storage/storageAccounts/databoxbvttestaccount")))) + .withDeviceType(SkuName.DATA_BOX) + .withTransferType(TransferType.IMPORT_TO_AZURE), + new ValidateAddress() + .withShippingAddress( + new ShippingAddress() + .withStreetAddress1("16 TOWNSEND ST") + .withStreetAddress2("Unit 1") + .withCity("San Francisco") + .withStateOrProvince("CA") + .withCountry("US") + .withPostalCode("94107") + .withCompanyName("Microsoft") + .withAddressType(AddressType.COMMERCIAL)) + .withDeviceType(SkuName.DATA_BOX) + .withTransportPreferences( + new TransportPreferences() + .withPreferredShipmentType(TransportShipmentTypes.MICROSOFT_MANAGED)), + new SubscriptionIsAllowedToCreateJobValidationRequest(), + new SkuAvailabilityValidationRequest() + .withDeviceType(SkuName.DATA_BOX) + .withTransferType(TransferType.IMPORT_TO_AZURE) + .withCountry("US") + .withLocation("westus"), + new CreateOrderLimitForSubscriptionValidationRequest().withDeviceType(SkuName.DATA_BOX), + new PreferencesValidationRequest() + .withPreference( + new Preferences() + .withTransportPreferences( + new TransportPreferences() + .withPreferredShipmentType( + TransportShipmentTypes.MICROSOFT_MANAGED))) + .withDeviceType(SkuName.DATA_BOX))), + Context.NONE); + } +} +``` + +### Service_ValidateInputsByResourceGroup + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.databox.models.AddressType; +import com.azure.resourcemanager.databox.models.CreateJobValidations; +import com.azure.resourcemanager.databox.models.CreateOrderLimitForSubscriptionValidationRequest; +import com.azure.resourcemanager.databox.models.DataImportDetails; +import com.azure.resourcemanager.databox.models.DataTransferDetailsValidationRequest; +import com.azure.resourcemanager.databox.models.Preferences; +import com.azure.resourcemanager.databox.models.PreferencesValidationRequest; +import com.azure.resourcemanager.databox.models.ShippingAddress; +import com.azure.resourcemanager.databox.models.SkuAvailabilityValidationRequest; +import com.azure.resourcemanager.databox.models.SkuName; +import com.azure.resourcemanager.databox.models.StorageAccountDetails; +import com.azure.resourcemanager.databox.models.SubscriptionIsAllowedToCreateJobValidationRequest; +import com.azure.resourcemanager.databox.models.TransferType; +import com.azure.resourcemanager.databox.models.TransportPreferences; +import com.azure.resourcemanager.databox.models.TransportShipmentTypes; +import com.azure.resourcemanager.databox.models.ValidateAddress; +import java.util.Arrays; + +/** Samples for Service ValidateInputsByResourceGroup. */ +public final class ServiceValidateInputsByResourceGroupSamples { + /* + * x-ms-original-file: specification/databox/resource-manager/Microsoft.DataBox/preview/2021-08-01-preview/examples/ValidateInputsByResourceGroup.json + */ + /** + * Sample code: ValidateInputsByResourceGroup. + * + * @param manager Entry point to DataBoxManager. + */ + public static void validateInputsByResourceGroup(com.azure.resourcemanager.databox.DataBoxManager manager) { + manager + .services() + .validateInputsByResourceGroupWithResponse( + "SdkRg6861", + "westus", + new CreateJobValidations() + .withIndividualRequestDetails( + Arrays + .asList( + new DataTransferDetailsValidationRequest() + .withDataImportDetails( + Arrays + .asList( + new DataImportDetails() + .withAccountDetails( + new StorageAccountDetails() + .withStorageAccountId( + "/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourcegroups/databoxbvt/providers/Microsoft.Storage/storageAccounts/databoxbvttestaccount")))) + .withDeviceType(SkuName.DATA_BOX) + .withTransferType(TransferType.IMPORT_TO_AZURE), + new ValidateAddress() + .withShippingAddress( + new ShippingAddress() + .withStreetAddress1("16 TOWNSEND ST") + .withStreetAddress2("Unit 1") + .withCity("San Francisco") + .withStateOrProvince("CA") + .withCountry("US") + .withPostalCode("94107") + .withCompanyName("Microsoft") + .withAddressType(AddressType.COMMERCIAL)) + .withDeviceType(SkuName.DATA_BOX) + .withTransportPreferences( + new TransportPreferences() + .withPreferredShipmentType(TransportShipmentTypes.MICROSOFT_MANAGED)), + new SubscriptionIsAllowedToCreateJobValidationRequest(), + new SkuAvailabilityValidationRequest() + .withDeviceType(SkuName.DATA_BOX) + .withTransferType(TransferType.IMPORT_TO_AZURE) + .withCountry("US") + .withLocation("westus"), + new CreateOrderLimitForSubscriptionValidationRequest().withDeviceType(SkuName.DATA_BOX), + new PreferencesValidationRequest() + .withPreference( + new Preferences() + .withTransportPreferences( + new TransportPreferences() + .withPreferredShipmentType( + TransportShipmentTypes.MICROSOFT_MANAGED))) + .withDeviceType(SkuName.DATA_BOX))), + Context.NONE); + } +} +``` + diff --git a/sdk/databox/azure-resourcemanager-databox/pom.xml b/sdk/databox/azure-resourcemanager-databox/pom.xml index c79f70c9712b2..2cec4ed3fa016 100644 --- a/sdk/databox/azure-resourcemanager-databox/pom.xml +++ b/sdk/databox/azure-resourcemanager-databox/pom.xml @@ -1,58 +1,81 @@ - 4.0.0 - - com.azure - azure-client-sdk-parent - 1.7.0 - ../../parents/azure-client-sdk-parent - + 4.0.0 + + com.azure + azure-client-sdk-parent + 1.7.0 + ../../parents/azure-client-sdk-parent + - com.azure.resourcemanager - azure-resourcemanager-databox - 1.0.0-beta.2 - jar + com.azure.resourcemanager + azure-resourcemanager-databox + 1.0.0-beta.2 + jar - Microsoft Azure SDK for DataBox Management - This package contains Microsoft Azure SDK for DataBox Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Package tag package-2021-03. - https://github.com/Azure/azure-sdk-for-java + Microsoft Azure SDK for DataBox Management + This package contains Microsoft Azure SDK for DataBox Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Package tag package-2021-08-preview. + https://github.com/Azure/azure-sdk-for-java - - - The MIT License (MIT) - http://opensource.org/licenses/MIT - repo - - + + + The MIT License (MIT) + http://opensource.org/licenses/MIT + repo + + - - https://github.com/Azure/azure-sdk-for-java - scm:git:git@github.com:Azure/azure-sdk-for-java.git - scm:git:git@github.com:Azure/azure-sdk-for-java.git - HEAD - - - - microsoft - Microsoft - - - - UTF-8 - true + + https://github.com/Azure/azure-sdk-for-java + scm:git:git@github.com:Azure/azure-sdk-for-java.git + scm:git:git@github.com:Azure/azure-sdk-for-java.git + HEAD + + + + microsoft + Microsoft + + + + UTF-8 + true false - - - - com.azure - azure-core - 1.23.1 - - - com.azure - azure-core-management - 1.4.4 - - + + + + com.azure + azure-core + 1.23.1 + + + com.azure + azure-core-management + 1.4.4 + + + + + + org.revapi + revapi-maven-plugin + 0.11.2 + + + + + java.method.addedToInterface + + + true + .* + com\.azure\.resourcemanager(\.[^.]+)+\.fluent(\.[^.]+)* + + + + + + + diff --git a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/DataBoxManager.java b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/DataBoxManager.java index dcc1eadb4a882..49b3f2d6d89b7 100644 --- a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/DataBoxManager.java +++ b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/DataBoxManager.java @@ -8,8 +8,8 @@ import com.azure.core.http.HttpClient; import com.azure.core.http.HttpPipeline; import com.azure.core.http.HttpPipelineBuilder; +import com.azure.core.http.HttpPipelinePosition; import com.azure.core.http.policy.AddDatePolicy; -import com.azure.core.http.policy.BearerTokenAuthenticationPolicy; import com.azure.core.http.policy.HttpLogOptions; import com.azure.core.http.policy.HttpLoggingPolicy; import com.azure.core.http.policy.HttpPipelinePolicy; @@ -17,6 +17,7 @@ import com.azure.core.http.policy.RequestIdPolicy; import com.azure.core.http.policy.RetryPolicy; import com.azure.core.http.policy.UserAgentPolicy; +import com.azure.core.management.http.policy.ArmChallengeAuthenticationPolicy; import com.azure.core.management.profile.AzureProfile; import com.azure.core.util.Configuration; import com.azure.core.util.logging.ClientLogger; @@ -35,6 +36,7 @@ import java.util.ArrayList; import java.util.List; import java.util.Objects; +import java.util.stream.Collectors; /** Entry point to DataBoxManager. */ public final class DataBoxManager { @@ -89,6 +91,7 @@ public static final class Configurable { private HttpClient httpClient; private HttpLogOptions httpLogOptions; private final List policies = new ArrayList<>(); + private final List scopes = new ArrayList<>(); private RetryPolicy retryPolicy; private Duration defaultPollInterval; @@ -128,6 +131,17 @@ public Configurable withPolicy(HttpPipelinePolicy policy) { return this; } + /** + * Adds the scope to permission sets. + * + * @param scope the scope. + * @return the configurable object itself. + */ + public Configurable withScope(String scope) { + this.scopes.add(Objects.requireNonNull(scope, "'scope' cannot be null.")); + return this; + } + /** * Sets the retry policy to the HTTP pipeline. * @@ -184,20 +198,33 @@ public DataBoxManager authenticate(TokenCredential credential, AzureProfile prof userAgentBuilder.append(" (auto-generated)"); } + if (scopes.isEmpty()) { + scopes.add(profile.getEnvironment().getManagementEndpoint() + "/.default"); + } if (retryPolicy == null) { retryPolicy = new RetryPolicy("Retry-After", ChronoUnit.SECONDS); } List policies = new ArrayList<>(); policies.add(new UserAgentPolicy(userAgentBuilder.toString())); policies.add(new RequestIdPolicy()); + policies + .addAll( + this + .policies + .stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL) + .collect(Collectors.toList())); HttpPolicyProviders.addBeforeRetryPolicies(policies); policies.add(retryPolicy); policies.add(new AddDatePolicy()); + policies.add(new ArmChallengeAuthenticationPolicy(credential, scopes.toArray(new String[0]))); policies - .add( - new BearerTokenAuthenticationPolicy( - credential, profile.getEnvironment().getManagementEndpoint() + "/.default")); - policies.addAll(this.policies); + .addAll( + this + .policies + .stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY) + .collect(Collectors.toList())); HttpPolicyProviders.addAfterRetryPolicies(policies); policies.add(new HttpLoggingPolicy(httpLogOptions)); HttpPipeline httpPipeline = diff --git a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/fluent/JobsClient.java b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/fluent/JobsClient.java index c7ea07334dc9f..4d8bc00725e0d 100644 --- a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/fluent/JobsClient.java +++ b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/fluent/JobsClient.java @@ -16,6 +16,7 @@ import com.azure.resourcemanager.databox.fluent.models.UnencryptedCredentialsInner; import com.azure.resourcemanager.databox.models.CancellationReason; import com.azure.resourcemanager.databox.models.JobResourceUpdateParameter; +import com.azure.resourcemanager.databox.models.MarkDevicesShippedRequest; import com.azure.resourcemanager.databox.models.ShipmentPickUpRequest; /** An instance of this class provides access to all the operations defined in JobsClient. */ @@ -43,6 +44,38 @@ public interface JobsClient { @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(String skipToken, Context context); + /** + * Request to mark devices for a given job as shipped. + * + * @param jobName The name of the job Resource within the specified resource group. job names must be between 3 and + * 24 characters in length and use any alphanumeric and underscore only. + * @param resourceGroupName The Resource Group Name. + * @param markDevicesShippedRequest Mark Devices Shipped Request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void markDevicesShipped( + String jobName, String resourceGroupName, MarkDevicesShippedRequest markDevicesShippedRequest); + + /** + * Request to mark devices for a given job as shipped. + * + * @param jobName The name of the job Resource within the specified resource group. job names must be between 3 and + * 24 characters in length and use any alphanumeric and underscore only. + * @param resourceGroupName The Resource Group Name. + * @param markDevicesShippedRequest Mark Devices Shipped Request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response markDevicesShippedWithResponse( + String jobName, String resourceGroupName, MarkDevicesShippedRequest markDevicesShippedRequest, Context context); + /** * Lists all the jobs available under the given resource group. * @@ -113,7 +146,7 @@ Response getByResourceGroupWithResponse( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return job Resource. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, JobResourceInner> beginCreate( String resourceGroupName, String jobName, JobResourceInner jobResource); @@ -131,7 +164,7 @@ SyncPoller, JobResourceInner> beginCreate( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return job Resource. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, JobResourceInner> beginCreate( String resourceGroupName, String jobName, JobResourceInner jobResource, Context context); @@ -179,7 +212,7 @@ SyncPoller, JobResourceInner> beginCreate( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, Void> beginDelete(String resourceGroupName, String jobName); /** @@ -194,7 +227,7 @@ SyncPoller, JobResourceInner> beginCreate( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, Void> beginDelete(String resourceGroupName, String jobName, Context context); /** @@ -238,7 +271,7 @@ SyncPoller, JobResourceInner> beginCreate( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return job Resource. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, JobResourceInner> beginUpdate( String resourceGroupName, String jobName, @@ -260,7 +293,7 @@ SyncPoller, JobResourceInner> beginUpdate( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return job Resource. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, JobResourceInner> beginUpdate( String resourceGroupName, String jobName, diff --git a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/fluent/models/AddressValidationOutputInner.java b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/fluent/models/AddressValidationOutputInner.java index 7271be0712851..f9bb7a3b5e3a5 100644 --- a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/fluent/models/AddressValidationOutputInner.java +++ b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/fluent/models/AddressValidationOutputInner.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.databox.fluent.models; import com.azure.core.annotation.Immutable; -import com.azure.core.annotation.JsonFlatten; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.databox.models.AddressValidationStatus; import com.azure.resourcemanager.databox.models.CloudError; @@ -15,36 +14,23 @@ import java.util.List; /** Output of the address validation api. */ -@JsonFlatten @Immutable -public class AddressValidationOutputInner { +public final class AddressValidationOutputInner { @JsonIgnore private final ClientLogger logger = new ClientLogger(AddressValidationOutputInner.class); /* - * Error code and message of validation response. + * The address validation properties. */ - @JsonProperty(value = "properties.error", access = JsonProperty.Access.WRITE_ONLY) - private CloudError error; - - /* - * The address validation status. - */ - @JsonProperty(value = "properties.validationStatus", access = JsonProperty.Access.WRITE_ONLY) - private AddressValidationStatus validationStatus; - - /* - * List of alternate addresses. - */ - @JsonProperty(value = "properties.alternateAddresses", access = JsonProperty.Access.WRITE_ONLY) - private List alternateAddresses; + @JsonProperty(value = "properties", access = JsonProperty.Access.WRITE_ONLY) + private AddressValidationProperties innerProperties; /** - * Get the error property: Error code and message of validation response. + * Get the innerProperties property: The address validation properties. * - * @return the error value. + * @return the innerProperties value. */ - public CloudError error() { - return this.error; + private AddressValidationProperties innerProperties() { + return this.innerProperties; } /** @@ -53,7 +39,7 @@ public CloudError error() { * @return the validationStatus value. */ public AddressValidationStatus validationStatus() { - return this.validationStatus; + return this.innerProperties() == null ? null : this.innerProperties().validationStatus(); } /** @@ -62,7 +48,16 @@ public AddressValidationStatus validationStatus() { * @return the alternateAddresses value. */ public List alternateAddresses() { - return this.alternateAddresses; + return this.innerProperties() == null ? null : this.innerProperties().alternateAddresses(); + } + + /** + * Get the error property: Error code and message of validation response. + * + * @return the error value. + */ + public CloudError error() { + return this.innerProperties() == null ? null : this.innerProperties().error(); } /** @@ -71,11 +66,8 @@ public List alternateAddresses() { * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (error() != null) { - error().validate(); - } - if (alternateAddresses() != null) { - alternateAddresses().forEach(e -> e.validate()); + if (innerProperties() != null) { + innerProperties().validate(); } } } diff --git a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/AddressValidationProperties.java b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/fluent/models/AddressValidationProperties.java similarity index 88% rename from sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/AddressValidationProperties.java rename to sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/fluent/models/AddressValidationProperties.java index a1af669a02f61..60837a70c81f2 100644 --- a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/AddressValidationProperties.java +++ b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/fluent/models/AddressValidationProperties.java @@ -2,10 +2,13 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.databox.models; +package com.azure.resourcemanager.databox.fluent.models; import com.azure.core.annotation.Immutable; import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.databox.models.AddressValidationStatus; +import com.azure.resourcemanager.databox.models.ShippingAddress; +import com.azure.resourcemanager.databox.models.ValidationInputResponse; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonTypeInfo; diff --git a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/fluent/models/JobProperties.java b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/fluent/models/JobProperties.java new file mode 100644 index 0000000000000..207fecccc4f2e --- /dev/null +++ b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/fluent/models/JobProperties.java @@ -0,0 +1,285 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.databox.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.databox.models.CloudError; +import com.azure.resourcemanager.databox.models.JobDeliveryInfo; +import com.azure.resourcemanager.databox.models.JobDeliveryType; +import com.azure.resourcemanager.databox.models.JobDetails; +import com.azure.resourcemanager.databox.models.StageName; +import com.azure.resourcemanager.databox.models.TransferType; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Job Properties. */ +@Fluent +public final class JobProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(JobProperties.class); + + /* + * Type of the data transfer. + */ + @JsonProperty(value = "transferType", required = true) + private TransferType transferType; + + /* + * Describes whether the job is cancellable or not. + */ + @JsonProperty(value = "isCancellable", access = JsonProperty.Access.WRITE_ONLY) + private Boolean isCancellable; + + /* + * Describes whether the job is deletable or not. + */ + @JsonProperty(value = "isDeletable", access = JsonProperty.Access.WRITE_ONLY) + private Boolean isDeletable; + + /* + * Describes whether the shipping address is editable or not. + */ + @JsonProperty(value = "isShippingAddressEditable", access = JsonProperty.Access.WRITE_ONLY) + private Boolean isShippingAddressEditable; + + /* + * Is Prepare To Ship Enabled on this job + */ + @JsonProperty(value = "isPrepareToShipEnabled", access = JsonProperty.Access.WRITE_ONLY) + private Boolean isPrepareToShipEnabled; + + /* + * Name of the stage which is in progress. + */ + @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) + private StageName status; + + /* + * Time at which the job was started in UTC ISO 8601 format. + */ + @JsonProperty(value = "startTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime startTime; + + /* + * Top level error for the job. + */ + @JsonProperty(value = "error", access = JsonProperty.Access.WRITE_ONLY) + private CloudError error; + + /* + * Details of a job run. This field will only be sent for expand details + * filter. + */ + @JsonProperty(value = "details") + private JobDetails details; + + /* + * Reason for cancellation. + */ + @JsonProperty(value = "cancellationReason", access = JsonProperty.Access.WRITE_ONLY) + private String cancellationReason; + + /* + * Delivery type of Job. + */ + @JsonProperty(value = "deliveryType") + private JobDeliveryType deliveryType; + + /* + * Delivery Info of Job. + */ + @JsonProperty(value = "deliveryInfo") + private JobDeliveryInfo deliveryInfo; + + /* + * Flag to indicate cancellation of scheduled job. + */ + @JsonProperty(value = "isCancellableWithoutFee", access = JsonProperty.Access.WRITE_ONLY) + private Boolean isCancellableWithoutFee; + + /** + * Get the transferType property: Type of the data transfer. + * + * @return the transferType value. + */ + public TransferType transferType() { + return this.transferType; + } + + /** + * Set the transferType property: Type of the data transfer. + * + * @param transferType the transferType value to set. + * @return the JobProperties object itself. + */ + public JobProperties withTransferType(TransferType transferType) { + this.transferType = transferType; + return this; + } + + /** + * Get the isCancellable property: Describes whether the job is cancellable or not. + * + * @return the isCancellable value. + */ + public Boolean isCancellable() { + return this.isCancellable; + } + + /** + * Get the isDeletable property: Describes whether the job is deletable or not. + * + * @return the isDeletable value. + */ + public Boolean isDeletable() { + return this.isDeletable; + } + + /** + * Get the isShippingAddressEditable property: Describes whether the shipping address is editable or not. + * + * @return the isShippingAddressEditable value. + */ + public Boolean isShippingAddressEditable() { + return this.isShippingAddressEditable; + } + + /** + * Get the isPrepareToShipEnabled property: Is Prepare To Ship Enabled on this job. + * + * @return the isPrepareToShipEnabled value. + */ + public Boolean isPrepareToShipEnabled() { + return this.isPrepareToShipEnabled; + } + + /** + * Get the status property: Name of the stage which is in progress. + * + * @return the status value. + */ + public StageName status() { + return this.status; + } + + /** + * Get the startTime property: Time at which the job was started in UTC ISO 8601 format. + * + * @return the startTime value. + */ + public OffsetDateTime startTime() { + return this.startTime; + } + + /** + * Get the error property: Top level error for the job. + * + * @return the error value. + */ + public CloudError error() { + return this.error; + } + + /** + * Get the details property: Details of a job run. This field will only be sent for expand details filter. + * + * @return the details value. + */ + public JobDetails details() { + return this.details; + } + + /** + * Set the details property: Details of a job run. This field will only be sent for expand details filter. + * + * @param details the details value to set. + * @return the JobProperties object itself. + */ + public JobProperties withDetails(JobDetails details) { + this.details = details; + return this; + } + + /** + * Get the cancellationReason property: Reason for cancellation. + * + * @return the cancellationReason value. + */ + public String cancellationReason() { + return this.cancellationReason; + } + + /** + * Get the deliveryType property: Delivery type of Job. + * + * @return the deliveryType value. + */ + public JobDeliveryType deliveryType() { + return this.deliveryType; + } + + /** + * Set the deliveryType property: Delivery type of Job. + * + * @param deliveryType the deliveryType value to set. + * @return the JobProperties object itself. + */ + public JobProperties withDeliveryType(JobDeliveryType deliveryType) { + this.deliveryType = deliveryType; + return this; + } + + /** + * Get the deliveryInfo property: Delivery Info of Job. + * + * @return the deliveryInfo value. + */ + public JobDeliveryInfo deliveryInfo() { + return this.deliveryInfo; + } + + /** + * Set the deliveryInfo property: Delivery Info of Job. + * + * @param deliveryInfo the deliveryInfo value to set. + * @return the JobProperties object itself. + */ + public JobProperties withDeliveryInfo(JobDeliveryInfo deliveryInfo) { + this.deliveryInfo = deliveryInfo; + return this; + } + + /** + * Get the isCancellableWithoutFee property: Flag to indicate cancellation of scheduled job. + * + * @return the isCancellableWithoutFee value. + */ + public Boolean isCancellableWithoutFee() { + return this.isCancellableWithoutFee; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (transferType() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property transferType in model JobProperties")); + } + if (error() != null) { + error().validate(); + } + if (details() != null) { + details().validate(); + } + if (deliveryInfo() != null) { + deliveryInfo().validate(); + } + } +} diff --git a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/fluent/models/JobResourceInner.java b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/fluent/models/JobResourceInner.java index 483ef43dcc657..f77e0457bf017 100644 --- a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/fluent/models/JobResourceInner.java +++ b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/fluent/models/JobResourceInner.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.databox.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.JsonFlatten; import com.azure.core.management.Resource; import com.azure.core.management.SystemData; import com.azure.core.util.logging.ClientLogger; @@ -23,11 +22,16 @@ import java.util.Map; /** Job Resource. */ -@JsonFlatten @Fluent -public class JobResourceInner extends Resource { +public final class JobResourceInner extends Resource { @JsonIgnore private final ClientLogger logger = new ClientLogger(JobResourceInner.class); + /* + * Properties of a job. + */ + @JsonProperty(value = "properties", required = true) + private JobProperties innerProperties = new JobProperties(); + /* * Name of the object. */ @@ -52,85 +56,6 @@ public class JobResourceInner extends Resource { @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) private SystemData systemData; - /* - * Type of the data transfer. - */ - @JsonProperty(value = "properties.transferType", required = true) - private TransferType transferType; - - /* - * Describes whether the job is cancellable or not. - */ - @JsonProperty(value = "properties.isCancellable", access = JsonProperty.Access.WRITE_ONLY) - private Boolean isCancellable; - - /* - * Describes whether the job is deletable or not. - */ - @JsonProperty(value = "properties.isDeletable", access = JsonProperty.Access.WRITE_ONLY) - private Boolean isDeletable; - - /* - * Describes whether the shipping address is editable or not. - */ - @JsonProperty(value = "properties.isShippingAddressEditable", access = JsonProperty.Access.WRITE_ONLY) - private Boolean isShippingAddressEditable; - - /* - * Is Prepare To Ship Enabled on this job - */ - @JsonProperty(value = "properties.isPrepareToShipEnabled", access = JsonProperty.Access.WRITE_ONLY) - private Boolean isPrepareToShipEnabled; - - /* - * Name of the stage which is in progress. - */ - @JsonProperty(value = "properties.status", access = JsonProperty.Access.WRITE_ONLY) - private StageName status; - - /* - * Time at which the job was started in UTC ISO 8601 format. - */ - @JsonProperty(value = "properties.startTime", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime startTime; - - /* - * Top level error for the job. - */ - @JsonProperty(value = "properties.error", access = JsonProperty.Access.WRITE_ONLY) - private CloudError error; - - /* - * Details of a job run. This field will only be sent for expand details - * filter. - */ - @JsonProperty(value = "properties.details") - private JobDetails details; - - /* - * Reason for cancellation. - */ - @JsonProperty(value = "properties.cancellationReason", access = JsonProperty.Access.WRITE_ONLY) - private String cancellationReason; - - /* - * Delivery type of Job. - */ - @JsonProperty(value = "properties.deliveryType") - private JobDeliveryType deliveryType; - - /* - * Delivery Info of Job. - */ - @JsonProperty(value = "properties.deliveryInfo") - private JobDeliveryInfo deliveryInfo; - - /* - * Flag to indicate cancellation of scheduled job. - */ - @JsonProperty(value = "properties.isCancellableWithoutFee", access = JsonProperty.Access.WRITE_ONLY) - private Boolean isCancellableWithoutFee; - /* * The sku type. */ @@ -143,6 +68,15 @@ public class JobResourceInner extends Resource { @JsonProperty(value = "identity") private ResourceIdentity identity; + /** + * Get the innerProperties property: Properties of a job. + * + * @return the innerProperties value. + */ + private JobProperties innerProperties() { + return this.innerProperties; + } + /** * Get the name property: Name of the object. * @@ -179,13 +113,67 @@ public SystemData systemData() { return this.systemData; } + /** + * Get the sku property: The sku type. + * + * @return the sku value. + */ + public Sku sku() { + return this.sku; + } + + /** + * Set the sku property: The sku type. + * + * @param sku the sku value to set. + * @return the JobResourceInner object itself. + */ + public JobResourceInner withSku(Sku sku) { + this.sku = sku; + return this; + } + + /** + * Get the identity property: Msi identity of the resource. + * + * @return the identity value. + */ + public ResourceIdentity identity() { + return this.identity; + } + + /** + * Set the identity property: Msi identity of the resource. + * + * @param identity the identity value to set. + * @return the JobResourceInner object itself. + */ + public JobResourceInner withIdentity(ResourceIdentity identity) { + this.identity = identity; + return this; + } + + /** {@inheritDoc} */ + @Override + public JobResourceInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public JobResourceInner withTags(Map tags) { + super.withTags(tags); + return this; + } + /** * Get the transferType property: Type of the data transfer. * * @return the transferType value. */ public TransferType transferType() { - return this.transferType; + return this.innerProperties() == null ? null : this.innerProperties().transferType(); } /** @@ -195,7 +183,10 @@ public TransferType transferType() { * @return the JobResourceInner object itself. */ public JobResourceInner withTransferType(TransferType transferType) { - this.transferType = transferType; + if (this.innerProperties() == null) { + this.innerProperties = new JobProperties(); + } + this.innerProperties().withTransferType(transferType); return this; } @@ -205,7 +196,7 @@ public JobResourceInner withTransferType(TransferType transferType) { * @return the isCancellable value. */ public Boolean isCancellable() { - return this.isCancellable; + return this.innerProperties() == null ? null : this.innerProperties().isCancellable(); } /** @@ -214,7 +205,7 @@ public Boolean isCancellable() { * @return the isDeletable value. */ public Boolean isDeletable() { - return this.isDeletable; + return this.innerProperties() == null ? null : this.innerProperties().isDeletable(); } /** @@ -223,7 +214,7 @@ public Boolean isDeletable() { * @return the isShippingAddressEditable value. */ public Boolean isShippingAddressEditable() { - return this.isShippingAddressEditable; + return this.innerProperties() == null ? null : this.innerProperties().isShippingAddressEditable(); } /** @@ -232,7 +223,7 @@ public Boolean isShippingAddressEditable() { * @return the isPrepareToShipEnabled value. */ public Boolean isPrepareToShipEnabled() { - return this.isPrepareToShipEnabled; + return this.innerProperties() == null ? null : this.innerProperties().isPrepareToShipEnabled(); } /** @@ -241,7 +232,7 @@ public Boolean isPrepareToShipEnabled() { * @return the status value. */ public StageName status() { - return this.status; + return this.innerProperties() == null ? null : this.innerProperties().status(); } /** @@ -250,7 +241,7 @@ public StageName status() { * @return the startTime value. */ public OffsetDateTime startTime() { - return this.startTime; + return this.innerProperties() == null ? null : this.innerProperties().startTime(); } /** @@ -259,7 +250,7 @@ public OffsetDateTime startTime() { * @return the error value. */ public CloudError error() { - return this.error; + return this.innerProperties() == null ? null : this.innerProperties().error(); } /** @@ -268,7 +259,7 @@ public CloudError error() { * @return the details value. */ public JobDetails details() { - return this.details; + return this.innerProperties() == null ? null : this.innerProperties().details(); } /** @@ -278,7 +269,10 @@ public JobDetails details() { * @return the JobResourceInner object itself. */ public JobResourceInner withDetails(JobDetails details) { - this.details = details; + if (this.innerProperties() == null) { + this.innerProperties = new JobProperties(); + } + this.innerProperties().withDetails(details); return this; } @@ -288,7 +282,7 @@ public JobResourceInner withDetails(JobDetails details) { * @return the cancellationReason value. */ public String cancellationReason() { - return this.cancellationReason; + return this.innerProperties() == null ? null : this.innerProperties().cancellationReason(); } /** @@ -297,7 +291,7 @@ public String cancellationReason() { * @return the deliveryType value. */ public JobDeliveryType deliveryType() { - return this.deliveryType; + return this.innerProperties() == null ? null : this.innerProperties().deliveryType(); } /** @@ -307,7 +301,10 @@ public JobDeliveryType deliveryType() { * @return the JobResourceInner object itself. */ public JobResourceInner withDeliveryType(JobDeliveryType deliveryType) { - this.deliveryType = deliveryType; + if (this.innerProperties() == null) { + this.innerProperties = new JobProperties(); + } + this.innerProperties().withDeliveryType(deliveryType); return this; } @@ -317,7 +314,7 @@ public JobResourceInner withDeliveryType(JobDeliveryType deliveryType) { * @return the deliveryInfo value. */ public JobDeliveryInfo deliveryInfo() { - return this.deliveryInfo; + return this.innerProperties() == null ? null : this.innerProperties().deliveryInfo(); } /** @@ -327,7 +324,10 @@ public JobDeliveryInfo deliveryInfo() { * @return the JobResourceInner object itself. */ public JobResourceInner withDeliveryInfo(JobDeliveryInfo deliveryInfo) { - this.deliveryInfo = deliveryInfo; + if (this.innerProperties() == null) { + this.innerProperties = new JobProperties(); + } + this.innerProperties().withDeliveryInfo(deliveryInfo); return this; } @@ -337,61 +337,7 @@ public JobResourceInner withDeliveryInfo(JobDeliveryInfo deliveryInfo) { * @return the isCancellableWithoutFee value. */ public Boolean isCancellableWithoutFee() { - return this.isCancellableWithoutFee; - } - - /** - * Get the sku property: The sku type. - * - * @return the sku value. - */ - public Sku sku() { - return this.sku; - } - - /** - * Set the sku property: The sku type. - * - * @param sku the sku value to set. - * @return the JobResourceInner object itself. - */ - public JobResourceInner withSku(Sku sku) { - this.sku = sku; - return this; - } - - /** - * Get the identity property: Msi identity of the resource. - * - * @return the identity value. - */ - public ResourceIdentity identity() { - return this.identity; - } - - /** - * Set the identity property: Msi identity of the resource. - * - * @param identity the identity value to set. - * @return the JobResourceInner object itself. - */ - public JobResourceInner withIdentity(ResourceIdentity identity) { - this.identity = identity; - return this; - } - - /** {@inheritDoc} */ - @Override - public JobResourceInner withLocation(String location) { - super.withLocation(location); - return this; - } - - /** {@inheritDoc} */ - @Override - public JobResourceInner withTags(Map tags) { - super.withTags(tags); - return this; + return this.innerProperties() == null ? null : this.innerProperties().isCancellableWithoutFee(); } /** @@ -400,19 +346,13 @@ public JobResourceInner withTags(Map tags) { * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (transferType() == null) { + if (innerProperties() == null) { throw logger .logExceptionAsError( - new IllegalArgumentException("Missing required property transferType in model JobResourceInner")); - } - if (error() != null) { - error().validate(); - } - if (details() != null) { - details().validate(); - } - if (deliveryInfo() != null) { - deliveryInfo().validate(); + new IllegalArgumentException( + "Missing required property innerProperties in model JobResourceInner")); + } else { + innerProperties().validate(); } if (sku() == null) { throw logger diff --git a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/fluent/models/RegionConfigurationResponseInner.java b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/fluent/models/RegionConfigurationResponseInner.java index f6142529fe456..57d24300a0e33 100644 --- a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/fluent/models/RegionConfigurationResponseInner.java +++ b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/fluent/models/RegionConfigurationResponseInner.java @@ -6,6 +6,7 @@ import com.azure.core.annotation.Immutable; import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.databox.models.DatacenterAddressResponse; import com.azure.resourcemanager.databox.models.ScheduleAvailabilityResponse; import com.azure.resourcemanager.databox.models.TransportAvailabilityResponse; import com.fasterxml.jackson.annotation.JsonIgnore; @@ -28,6 +29,12 @@ public final class RegionConfigurationResponseInner { @JsonProperty(value = "transportAvailabilityResponse", access = JsonProperty.Access.WRITE_ONLY) private TransportAvailabilityResponse transportAvailabilityResponse; + /* + * Datacenter address for given sku in a region. + */ + @JsonProperty(value = "datacenterAddressResponse", access = JsonProperty.Access.WRITE_ONLY) + private DatacenterAddressResponse datacenterAddressResponse; + /** * Get the scheduleAvailabilityResponse property: Schedule availability for given sku in a region. * @@ -46,6 +53,15 @@ public TransportAvailabilityResponse transportAvailabilityResponse() { return this.transportAvailabilityResponse; } + /** + * Get the datacenterAddressResponse property: Datacenter address for given sku in a region. + * + * @return the datacenterAddressResponse value. + */ + public DatacenterAddressResponse datacenterAddressResponse() { + return this.datacenterAddressResponse; + } + /** * Validates the instance. * @@ -58,5 +74,8 @@ public void validate() { if (transportAvailabilityResponse() != null) { transportAvailabilityResponse().validate(); } + if (datacenterAddressResponse() != null) { + datacenterAddressResponse().validate(); + } } } diff --git a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/fluent/models/SkuInformationInner.java b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/fluent/models/SkuInformationInner.java index 96fcf59e7722e..3dadb455aabe8 100644 --- a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/fluent/models/SkuInformationInner.java +++ b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/fluent/models/SkuInformationInner.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.databox.fluent.models; import com.azure.core.annotation.Immutable; -import com.azure.core.annotation.JsonFlatten; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.databox.models.DataLocationToServiceLocationMap; import com.azure.resourcemanager.databox.models.Sku; @@ -17,9 +16,8 @@ import java.util.List; /** Information of the sku. */ -@JsonFlatten @Immutable -public class SkuInformationInner { +public final class SkuInformationInner { @JsonIgnore private final ClientLogger logger = new ClientLogger(SkuInformationInner.class); /* @@ -35,46 +33,10 @@ public class SkuInformationInner { private Boolean enabled; /* - * The map of data location to service location. + * Properties of the sku. */ - @JsonProperty(value = "properties.dataLocationToServiceLocationMap", access = JsonProperty.Access.WRITE_ONLY) - private List dataLocationToServiceLocationMap; - - /* - * Capacity of the Sku. - */ - @JsonProperty(value = "properties.capacity", access = JsonProperty.Access.WRITE_ONLY) - private SkuCapacity capacity; - - /* - * Cost of the Sku. - */ - @JsonProperty(value = "properties.costs", access = JsonProperty.Access.WRITE_ONLY) - private List costs; - - /* - * Api versions that support this Sku. - */ - @JsonProperty(value = "properties.apiVersions", access = JsonProperty.Access.WRITE_ONLY) - private List apiVersions; - - /* - * Reason why the Sku is disabled. - */ - @JsonProperty(value = "properties.disabledReason", access = JsonProperty.Access.WRITE_ONLY) - private SkuDisabledReason disabledReason; - - /* - * Message for why the Sku is disabled. - */ - @JsonProperty(value = "properties.disabledReasonMessage", access = JsonProperty.Access.WRITE_ONLY) - private String disabledReasonMessage; - - /* - * Required feature to access the sku. - */ - @JsonProperty(value = "properties.requiredFeature", access = JsonProperty.Access.WRITE_ONLY) - private String requiredFeature; + @JsonProperty(value = "properties", access = JsonProperty.Access.WRITE_ONLY) + private SkuProperties innerProperties; /** * Get the sku property: The Sku. @@ -94,13 +56,22 @@ public Boolean enabled() { return this.enabled; } + /** + * Get the innerProperties property: Properties of the sku. + * + * @return the innerProperties value. + */ + private SkuProperties innerProperties() { + return this.innerProperties; + } + /** * Get the dataLocationToServiceLocationMap property: The map of data location to service location. * * @return the dataLocationToServiceLocationMap value. */ public List dataLocationToServiceLocationMap() { - return this.dataLocationToServiceLocationMap; + return this.innerProperties() == null ? null : this.innerProperties().dataLocationToServiceLocationMap(); } /** @@ -109,7 +80,7 @@ public List dataLocationToServiceLocationMap() * @return the capacity value. */ public SkuCapacity capacity() { - return this.capacity; + return this.innerProperties() == null ? null : this.innerProperties().capacity(); } /** @@ -118,7 +89,7 @@ public SkuCapacity capacity() { * @return the costs value. */ public List costs() { - return this.costs; + return this.innerProperties() == null ? null : this.innerProperties().costs(); } /** @@ -127,7 +98,7 @@ public List costs() { * @return the apiVersions value. */ public List apiVersions() { - return this.apiVersions; + return this.innerProperties() == null ? null : this.innerProperties().apiVersions(); } /** @@ -136,7 +107,7 @@ public List apiVersions() { * @return the disabledReason value. */ public SkuDisabledReason disabledReason() { - return this.disabledReason; + return this.innerProperties() == null ? null : this.innerProperties().disabledReason(); } /** @@ -145,7 +116,7 @@ public SkuDisabledReason disabledReason() { * @return the disabledReasonMessage value. */ public String disabledReasonMessage() { - return this.disabledReasonMessage; + return this.innerProperties() == null ? null : this.innerProperties().disabledReasonMessage(); } /** @@ -154,7 +125,7 @@ public String disabledReasonMessage() { * @return the requiredFeature value. */ public String requiredFeature() { - return this.requiredFeature; + return this.innerProperties() == null ? null : this.innerProperties().requiredFeature(); } /** @@ -166,14 +137,8 @@ public void validate() { if (sku() != null) { sku().validate(); } - if (dataLocationToServiceLocationMap() != null) { - dataLocationToServiceLocationMap().forEach(e -> e.validate()); - } - if (capacity() != null) { - capacity().validate(); - } - if (costs() != null) { - costs().forEach(e -> e.validate()); + if (innerProperties() != null) { + innerProperties().validate(); } } } diff --git a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/fluent/models/SkuProperties.java b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/fluent/models/SkuProperties.java new file mode 100644 index 0000000000000..a89b89a02a90e --- /dev/null +++ b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/fluent/models/SkuProperties.java @@ -0,0 +1,143 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.databox.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.databox.models.DataLocationToServiceLocationMap; +import com.azure.resourcemanager.databox.models.SkuCapacity; +import com.azure.resourcemanager.databox.models.SkuCost; +import com.azure.resourcemanager.databox.models.SkuDisabledReason; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Properties of the sku. */ +@Immutable +public final class SkuProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SkuProperties.class); + + /* + * The map of data location to service location. + */ + @JsonProperty(value = "dataLocationToServiceLocationMap", access = JsonProperty.Access.WRITE_ONLY) + private List dataLocationToServiceLocationMap; + + /* + * Capacity of the Sku. + */ + @JsonProperty(value = "capacity", access = JsonProperty.Access.WRITE_ONLY) + private SkuCapacity capacity; + + /* + * Cost of the Sku. + */ + @JsonProperty(value = "costs", access = JsonProperty.Access.WRITE_ONLY) + private List costs; + + /* + * Api versions that support this Sku. + */ + @JsonProperty(value = "apiVersions", access = JsonProperty.Access.WRITE_ONLY) + private List apiVersions; + + /* + * Reason why the Sku is disabled. + */ + @JsonProperty(value = "disabledReason", access = JsonProperty.Access.WRITE_ONLY) + private SkuDisabledReason disabledReason; + + /* + * Message for why the Sku is disabled. + */ + @JsonProperty(value = "disabledReasonMessage", access = JsonProperty.Access.WRITE_ONLY) + private String disabledReasonMessage; + + /* + * Required feature to access the sku. + */ + @JsonProperty(value = "requiredFeature", access = JsonProperty.Access.WRITE_ONLY) + private String requiredFeature; + + /** + * Get the dataLocationToServiceLocationMap property: The map of data location to service location. + * + * @return the dataLocationToServiceLocationMap value. + */ + public List dataLocationToServiceLocationMap() { + return this.dataLocationToServiceLocationMap; + } + + /** + * Get the capacity property: Capacity of the Sku. + * + * @return the capacity value. + */ + public SkuCapacity capacity() { + return this.capacity; + } + + /** + * Get the costs property: Cost of the Sku. + * + * @return the costs value. + */ + public List costs() { + return this.costs; + } + + /** + * Get the apiVersions property: Api versions that support this Sku. + * + * @return the apiVersions value. + */ + public List apiVersions() { + return this.apiVersions; + } + + /** + * Get the disabledReason property: Reason why the Sku is disabled. + * + * @return the disabledReason value. + */ + public SkuDisabledReason disabledReason() { + return this.disabledReason; + } + + /** + * Get the disabledReasonMessage property: Message for why the Sku is disabled. + * + * @return the disabledReasonMessage value. + */ + public String disabledReasonMessage() { + return this.disabledReasonMessage; + } + + /** + * Get the requiredFeature property: Required feature to access the sku. + * + * @return the requiredFeature value. + */ + public String requiredFeature() { + return this.requiredFeature; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (dataLocationToServiceLocationMap() != null) { + dataLocationToServiceLocationMap().forEach(e -> e.validate()); + } + if (capacity() != null) { + capacity().validate(); + } + if (costs() != null) { + costs().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/fluent/models/UpdateJobProperties.java b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/fluent/models/UpdateJobProperties.java new file mode 100644 index 0000000000000..af9cb6a08ccf6 --- /dev/null +++ b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/fluent/models/UpdateJobProperties.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.databox.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.databox.models.UpdateJobDetails; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Job Properties for update. */ +@Fluent +public final class UpdateJobProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(UpdateJobProperties.class); + + /* + * Details of a job to be updated. + */ + @JsonProperty(value = "details") + private UpdateJobDetails details; + + /** + * Get the details property: Details of a job to be updated. + * + * @return the details value. + */ + public UpdateJobDetails details() { + return this.details; + } + + /** + * Set the details property: Details of a job to be updated. + * + * @param details the details value to set. + * @return the UpdateJobProperties object itself. + */ + public UpdateJobProperties withDetails(UpdateJobDetails details) { + this.details = details; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (details() != null) { + details().validate(); + } + } +} diff --git a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/fluent/models/ValidationResponseInner.java b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/fluent/models/ValidationResponseInner.java index 8bb1ab9e27add..66807b1c07478 100644 --- a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/fluent/models/ValidationResponseInner.java +++ b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/fluent/models/ValidationResponseInner.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.databox.fluent.models; import com.azure.core.annotation.Immutable; -import com.azure.core.annotation.JsonFlatten; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.databox.models.OverallValidationStatus; import com.azure.resourcemanager.databox.models.ValidationInputResponse; @@ -14,23 +13,24 @@ import java.util.List; /** Response of pre job creation validations. */ -@JsonFlatten @Immutable -public class ValidationResponseInner { +public final class ValidationResponseInner { @JsonIgnore private final ClientLogger logger = new ClientLogger(ValidationResponseInner.class); /* - * Overall validation status. + * Properties of pre job creation validation response. */ - @JsonProperty(value = "properties.status", access = JsonProperty.Access.WRITE_ONLY) - private OverallValidationStatus status; + @JsonProperty(value = "properties", access = JsonProperty.Access.WRITE_ONLY) + private ValidationResponseProperties innerProperties; - /* - * List of response details contain validationType and its response as key - * and value respectively. + /** + * Get the innerProperties property: Properties of pre job creation validation response. + * + * @return the innerProperties value. */ - @JsonProperty(value = "properties.individualResponseDetails", access = JsonProperty.Access.WRITE_ONLY) - private List individualResponseDetails; + private ValidationResponseProperties innerProperties() { + return this.innerProperties; + } /** * Get the status property: Overall validation status. @@ -38,7 +38,7 @@ public class ValidationResponseInner { * @return the status value. */ public OverallValidationStatus status() { - return this.status; + return this.innerProperties() == null ? null : this.innerProperties().status(); } /** @@ -48,7 +48,7 @@ public OverallValidationStatus status() { * @return the individualResponseDetails value. */ public List individualResponseDetails() { - return this.individualResponseDetails; + return this.innerProperties() == null ? null : this.innerProperties().individualResponseDetails(); } /** @@ -57,8 +57,8 @@ public List individualResponseDetails() { * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (individualResponseDetails() != null) { - individualResponseDetails().forEach(e -> e.validate()); + if (innerProperties() != null) { + innerProperties().validate(); } } } diff --git a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/fluent/models/ValidationResponseProperties.java b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/fluent/models/ValidationResponseProperties.java new file mode 100644 index 0000000000000..f1a980544f07a --- /dev/null +++ b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/fluent/models/ValidationResponseProperties.java @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.databox.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.databox.models.OverallValidationStatus; +import com.azure.resourcemanager.databox.models.ValidationInputResponse; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Properties of pre job creation validation response. */ +@Immutable +public final class ValidationResponseProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ValidationResponseProperties.class); + + /* + * Overall validation status. + */ + @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) + private OverallValidationStatus status; + + /* + * List of response details contain validationType and its response as key + * and value respectively. + */ + @JsonProperty(value = "individualResponseDetails", access = JsonProperty.Access.WRITE_ONLY) + private List individualResponseDetails; + + /** + * Get the status property: Overall validation status. + * + * @return the status value. + */ + public OverallValidationStatus status() { + return this.status; + } + + /** + * Get the individualResponseDetails property: List of response details contain validationType and its response as + * key and value respectively. + * + * @return the individualResponseDetails value. + */ + public List individualResponseDetails() { + return this.individualResponseDetails; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (individualResponseDetails() != null) { + individualResponseDetails().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/implementation/AddressValidationOutputImpl.java b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/implementation/AddressValidationOutputImpl.java index fcfdd52da7332..1c94805d6142d 100644 --- a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/implementation/AddressValidationOutputImpl.java +++ b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/implementation/AddressValidationOutputImpl.java @@ -23,10 +23,6 @@ public final class AddressValidationOutputImpl implements AddressValidationOutpu this.serviceManager = serviceManager; } - public CloudError error() { - return this.innerModel().error(); - } - public AddressValidationStatus validationStatus() { return this.innerModel().validationStatus(); } @@ -40,6 +36,10 @@ public List alternateAddresses() { } } + public CloudError error() { + return this.innerModel().error(); + } + public AddressValidationOutputInner innerModel() { return this.innerObject; } diff --git a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/implementation/DataBoxManagementClientImpl.java b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/implementation/DataBoxManagementClientImpl.java index 906b858913c12..0e40ae36cb117 100644 --- a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/implementation/DataBoxManagementClientImpl.java +++ b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/implementation/DataBoxManagementClientImpl.java @@ -183,7 +183,7 @@ public ServicesClient getServices() { this.defaultPollInterval = defaultPollInterval; this.subscriptionId = subscriptionId; this.endpoint = endpoint; - this.apiVersion = "2021-03-01"; + this.apiVersion = "2021-08-01-preview"; this.operations = new OperationsClientImpl(this); this.jobs = new JobsClientImpl(this); this.resourceProviders = new ResourceProvidersClientImpl(this); diff --git a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/implementation/JobResourceImpl.java b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/implementation/JobResourceImpl.java index 0796988c89448..e37ef9c502967 100644 --- a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/implementation/JobResourceImpl.java +++ b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/implementation/JobResourceImpl.java @@ -17,6 +17,7 @@ import com.azure.resourcemanager.databox.models.JobDetails; import com.azure.resourcemanager.databox.models.JobResource; import com.azure.resourcemanager.databox.models.JobResourceUpdateParameter; +import com.azure.resourcemanager.databox.models.MarkDevicesShippedRequest; import com.azure.resourcemanager.databox.models.ResourceIdentity; import com.azure.resourcemanager.databox.models.ShipmentPickUpRequest; import com.azure.resourcemanager.databox.models.ShipmentPickUpResponse; @@ -63,6 +64,14 @@ public SystemData systemData() { return this.innerModel().systemData(); } + public Sku sku() { + return this.innerModel().sku(); + } + + public ResourceIdentity identity() { + return this.innerModel().identity(); + } + public TransferType transferType() { return this.innerModel().transferType(); } @@ -115,14 +124,6 @@ public Boolean isCancellableWithoutFee() { return this.innerModel().isCancellableWithoutFee(); } - public Sku sku() { - return this.innerModel().sku(); - } - - public ResourceIdentity identity() { - return this.innerModel().identity(); - } - public Region region() { return Region.fromName(this.regionName()); } @@ -226,6 +227,17 @@ public JobResource refresh(Context context) { return this; } + public void markDevicesShipped(MarkDevicesShippedRequest markDevicesShippedRequest) { + serviceManager.jobs().markDevicesShipped(jobName, resourceGroupName, markDevicesShippedRequest); + } + + public Response markDevicesShippedWithResponse( + MarkDevicesShippedRequest markDevicesShippedRequest, Context context) { + return serviceManager + .jobs() + .markDevicesShippedWithResponse(jobName, resourceGroupName, markDevicesShippedRequest, context); + } + public ShipmentPickUpResponse bookShipmentPickUp(ShipmentPickUpRequest shipmentPickUpRequest) { return serviceManager.jobs().bookShipmentPickUp(resourceGroupName, jobName, shipmentPickUpRequest); } @@ -263,13 +275,13 @@ public JobResourceImpl withRegion(String location) { return this; } - public JobResourceImpl withTransferType(TransferType transferType) { - this.innerModel().withTransferType(transferType); + public JobResourceImpl withSku(Sku sku) { + this.innerModel().withSku(sku); return this; } - public JobResourceImpl withSku(Sku sku) { - this.innerModel().withSku(sku); + public JobResourceImpl withTransferType(TransferType transferType) { + this.innerModel().withTransferType(transferType); return this; } @@ -283,6 +295,16 @@ public JobResourceImpl withTags(Map tags) { } } + public JobResourceImpl withIdentity(ResourceIdentity identity) { + if (isInCreateMode()) { + this.innerModel().withIdentity(identity); + return this; + } else { + this.updateJobResourceUpdateParameter.withIdentity(identity); + return this; + } + } + public JobResourceImpl withDetails(JobDetails details) { this.innerModel().withDetails(details); return this; @@ -298,16 +320,6 @@ public JobResourceImpl withDeliveryInfo(JobDeliveryInfo deliveryInfo) { return this; } - public JobResourceImpl withIdentity(ResourceIdentity identity) { - if (isInCreateMode()) { - this.innerModel().withIdentity(identity); - return this; - } else { - this.updateJobResourceUpdateParameter.withIdentity(identity); - return this; - } - } - public JobResourceImpl withDetails(UpdateJobDetails details) { this.updateJobResourceUpdateParameter.withDetails(details); return this; diff --git a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/implementation/JobsClientImpl.java b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/implementation/JobsClientImpl.java index 8fa80fdd80936..890b0943c6c55 100644 --- a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/implementation/JobsClientImpl.java +++ b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/implementation/JobsClientImpl.java @@ -41,6 +41,7 @@ import com.azure.resourcemanager.databox.models.CancellationReason; import com.azure.resourcemanager.databox.models.JobResourceList; import com.azure.resourcemanager.databox.models.JobResourceUpdateParameter; +import com.azure.resourcemanager.databox.models.MarkDevicesShippedRequest; import com.azure.resourcemanager.databox.models.ShipmentPickUpRequest; import com.azure.resourcemanager.databox.models.UnencryptedCredentialsList; import java.nio.ByteBuffer; @@ -86,6 +87,22 @@ Mono> list( @HeaderParam("Accept") String accept, Context context); + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs" + + "/{jobName}/markDevicesShipped") + @ExpectedResponses({204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> markDevicesShipped( + @HostParam("$host") String endpoint, + @PathParam("jobName") String jobName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") MarkDevicesShippedRequest markDevicesShippedRequest, + @HeaderParam("Accept") String accept, + Context context); + @Headers({"Content-Type: application/json"}) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs") @ExpectedResponses({200}) @@ -394,6 +411,184 @@ public PagedIterable list(String skipToken, Context context) { return new PagedIterable<>(listAsync(skipToken, context)); } + /** + * Request to mark devices for a given job as shipped. + * + * @param jobName The name of the job Resource within the specified resource group. job names must be between 3 and + * 24 characters in length and use any alphanumeric and underscore only. + * @param resourceGroupName The Resource Group Name. + * @param markDevicesShippedRequest Mark Devices Shipped Request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> markDevicesShippedWithResponseAsync( + String jobName, String resourceGroupName, MarkDevicesShippedRequest markDevicesShippedRequest) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (jobName == null) { + return Mono.error(new IllegalArgumentException("Parameter jobName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (markDevicesShippedRequest == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter markDevicesShippedRequest is required and cannot be null.")); + } else { + markDevicesShippedRequest.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .markDevicesShipped( + this.client.getEndpoint(), + jobName, + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + markDevicesShippedRequest, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Request to mark devices for a given job as shipped. + * + * @param jobName The name of the job Resource within the specified resource group. job names must be between 3 and + * 24 characters in length and use any alphanumeric and underscore only. + * @param resourceGroupName The Resource Group Name. + * @param markDevicesShippedRequest Mark Devices Shipped Request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> markDevicesShippedWithResponseAsync( + String jobName, + String resourceGroupName, + MarkDevicesShippedRequest markDevicesShippedRequest, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (jobName == null) { + return Mono.error(new IllegalArgumentException("Parameter jobName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (markDevicesShippedRequest == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter markDevicesShippedRequest is required and cannot be null.")); + } else { + markDevicesShippedRequest.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .markDevicesShipped( + this.client.getEndpoint(), + jobName, + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + markDevicesShippedRequest, + accept, + context); + } + + /** + * Request to mark devices for a given job as shipped. + * + * @param jobName The name of the job Resource within the specified resource group. job names must be between 3 and + * 24 characters in length and use any alphanumeric and underscore only. + * @param resourceGroupName The Resource Group Name. + * @param markDevicesShippedRequest Mark Devices Shipped Request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono markDevicesShippedAsync( + String jobName, String resourceGroupName, MarkDevicesShippedRequest markDevicesShippedRequest) { + return markDevicesShippedWithResponseAsync(jobName, resourceGroupName, markDevicesShippedRequest) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * Request to mark devices for a given job as shipped. + * + * @param jobName The name of the job Resource within the specified resource group. job names must be between 3 and + * 24 characters in length and use any alphanumeric and underscore only. + * @param resourceGroupName The Resource Group Name. + * @param markDevicesShippedRequest Mark Devices Shipped Request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void markDevicesShipped( + String jobName, String resourceGroupName, MarkDevicesShippedRequest markDevicesShippedRequest) { + markDevicesShippedAsync(jobName, resourceGroupName, markDevicesShippedRequest).block(); + } + + /** + * Request to mark devices for a given job as shipped. + * + * @param jobName The name of the job Resource within the specified resource group. job names must be between 3 and + * 24 characters in length and use any alphanumeric and underscore only. + * @param resourceGroupName The Resource Group Name. + * @param markDevicesShippedRequest Mark Devices Shipped Request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response markDevicesShippedWithResponse( + String jobName, + String resourceGroupName, + MarkDevicesShippedRequest markDevicesShippedRequest, + Context context) { + return markDevicesShippedWithResponseAsync(jobName, resourceGroupName, markDevicesShippedRequest, context) + .block(); + } + /** * Lists all the jobs available under the given resource group. * @@ -896,14 +1091,18 @@ private Mono>> createWithResponseAsync( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return job Resource. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, JobResourceInner> beginCreateAsync( String resourceGroupName, String jobName, JobResourceInner jobResource) { Mono>> mono = createWithResponseAsync(resourceGroupName, jobName, jobResource); return this .client .getLroResult( - mono, this.client.getHttpPipeline(), JobResourceInner.class, JobResourceInner.class, Context.NONE); + mono, + this.client.getHttpPipeline(), + JobResourceInner.class, + JobResourceInner.class, + this.client.getContext()); } /** @@ -920,7 +1119,7 @@ private PollerFlux, JobResourceInner> beginCreateAs * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return job Resource. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, JobResourceInner> beginCreateAsync( String resourceGroupName, String jobName, JobResourceInner jobResource, Context context) { context = this.client.mergeContext(context); @@ -945,7 +1144,7 @@ private PollerFlux, JobResourceInner> beginCreateAs * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return job Resource. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, JobResourceInner> beginCreate( String resourceGroupName, String jobName, JobResourceInner jobResource) { return beginCreateAsync(resourceGroupName, jobName, jobResource).getSyncPoller(); @@ -965,7 +1164,7 @@ public SyncPoller, JobResourceInner> beginCreate( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return job Resource. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, JobResourceInner> beginCreate( String resourceGroupName, String jobName, JobResourceInner jobResource, Context context) { return beginCreateAsync(resourceGroupName, jobName, jobResource, context).getSyncPoller(); @@ -1157,12 +1356,13 @@ private Mono>> deleteWithResponseAsync( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String jobName) { Mono>> mono = deleteWithResponseAsync(resourceGroupName, jobName); return this .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); } /** @@ -1177,7 +1377,7 @@ private PollerFlux, Void> beginDeleteAsync(String resourceGroup * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginDeleteAsync( String resourceGroupName, String jobName, Context context) { context = this.client.mergeContext(context); @@ -1198,7 +1398,7 @@ private PollerFlux, Void> beginDeleteAsync( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDelete(String resourceGroupName, String jobName) { return beginDeleteAsync(resourceGroupName, jobName).getSyncPoller(); } @@ -1215,7 +1415,7 @@ public SyncPoller, Void> beginDelete(String resourceGroupName, * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDelete(String resourceGroupName, String jobName, Context context) { return beginDeleteAsync(resourceGroupName, jobName, context).getSyncPoller(); } @@ -1429,7 +1629,7 @@ private Mono>> updateWithResponseAsync( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return job Resource. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, JobResourceInner> beginUpdateAsync( String resourceGroupName, String jobName, @@ -1440,7 +1640,11 @@ private PollerFlux, JobResourceInner> beginUpdateAs return this .client .getLroResult( - mono, this.client.getHttpPipeline(), JobResourceInner.class, JobResourceInner.class, Context.NONE); + mono, + this.client.getHttpPipeline(), + JobResourceInner.class, + JobResourceInner.class, + this.client.getContext()); } /** @@ -1458,7 +1662,7 @@ private PollerFlux, JobResourceInner> beginUpdateAs * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return job Resource. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, JobResourceInner> beginUpdateAsync( String resourceGroupName, String jobName, @@ -1488,7 +1692,7 @@ private PollerFlux, JobResourceInner> beginUpdateAs * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return job Resource. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, JobResourceInner> beginUpdate( String resourceGroupName, String jobName, @@ -1512,7 +1716,7 @@ public SyncPoller, JobResourceInner> beginUpdate( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return job Resource. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, JobResourceInner> beginUpdate( String resourceGroupName, String jobName, diff --git a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/implementation/JobsImpl.java b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/implementation/JobsImpl.java index a1b270e846c82..a3332d9a458fb 100644 --- a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/implementation/JobsImpl.java +++ b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/implementation/JobsImpl.java @@ -16,6 +16,7 @@ import com.azure.resourcemanager.databox.models.CancellationReason; import com.azure.resourcemanager.databox.models.JobResource; import com.azure.resourcemanager.databox.models.Jobs; +import com.azure.resourcemanager.databox.models.MarkDevicesShippedRequest; import com.azure.resourcemanager.databox.models.ShipmentPickUpRequest; import com.azure.resourcemanager.databox.models.ShipmentPickUpResponse; import com.azure.resourcemanager.databox.models.UnencryptedCredentials; @@ -43,6 +44,21 @@ public PagedIterable list(String skipToken, Context context) { return Utils.mapPage(inner, inner1 -> new JobResourceImpl(inner1, this.manager())); } + public void markDevicesShipped( + String jobName, String resourceGroupName, MarkDevicesShippedRequest markDevicesShippedRequest) { + this.serviceClient().markDevicesShipped(jobName, resourceGroupName, markDevicesShippedRequest); + } + + public Response markDevicesShippedWithResponse( + String jobName, + String resourceGroupName, + MarkDevicesShippedRequest markDevicesShippedRequest, + Context context) { + return this + .serviceClient() + .markDevicesShippedWithResponse(jobName, resourceGroupName, markDevicesShippedRequest, context); + } + public PagedIterable listByResourceGroup(String resourceGroupName) { PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); return Utils.mapPage(inner, inner1 -> new JobResourceImpl(inner1, this.manager())); diff --git a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/implementation/RegionConfigurationResponseImpl.java b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/implementation/RegionConfigurationResponseImpl.java index c353222533c18..5b072243eaf9a 100644 --- a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/implementation/RegionConfigurationResponseImpl.java +++ b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/implementation/RegionConfigurationResponseImpl.java @@ -5,6 +5,7 @@ package com.azure.resourcemanager.databox.implementation; import com.azure.resourcemanager.databox.fluent.models.RegionConfigurationResponseInner; +import com.azure.resourcemanager.databox.models.DatacenterAddressResponse; import com.azure.resourcemanager.databox.models.RegionConfigurationResponse; import com.azure.resourcemanager.databox.models.ScheduleAvailabilityResponse; import com.azure.resourcemanager.databox.models.TransportAvailabilityResponse; @@ -28,6 +29,10 @@ public TransportAvailabilityResponse transportAvailabilityResponse() { return this.innerModel().transportAvailabilityResponse(); } + public DatacenterAddressResponse datacenterAddressResponse() { + return this.innerModel().datacenterAddressResponse(); + } + public RegionConfigurationResponseInner innerModel() { return this.innerObject; } diff --git a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/AddressValidationOutput.java b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/AddressValidationOutput.java index 002bfb8d23742..9e1846368141c 100644 --- a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/AddressValidationOutput.java +++ b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/AddressValidationOutput.java @@ -9,13 +9,6 @@ /** An immutable client-side representation of AddressValidationOutput. */ public interface AddressValidationOutput { - /** - * Gets the error property: Error code and message of validation response. - * - * @return the error value. - */ - CloudError error(); - /** * Gets the validationStatus property: The address validation status. * @@ -30,6 +23,13 @@ public interface AddressValidationOutput { */ List alternateAddresses(); + /** + * Gets the error property: Error code and message of validation response. + * + * @return the error value. + */ + CloudError error(); + /** * Gets the inner com.azure.resourcemanager.databox.fluent.models.AddressValidationOutputInner object. * diff --git a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/ClassDiscriminator.java b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/ClassDiscriminator.java index ed8c15ed4f9b8..9fb5101aba911 100644 --- a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/ClassDiscriminator.java +++ b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/ClassDiscriminator.java @@ -16,7 +16,10 @@ public enum ClassDiscriminator { DATA_BOX_DISK("DataBoxDisk"), /** Enum value DataBoxHeavy. */ - DATA_BOX_HEAVY("DataBoxHeavy"); + DATA_BOX_HEAVY("DataBoxHeavy"), + + /** Enum value DataBoxCustomerDisk. */ + DATA_BOX_CUSTOMER_DISK("DataBoxCustomerDisk"); /** The actual serialized value for a ClassDiscriminator instance. */ private final String value; diff --git a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/CopyLogDetails.java b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/CopyLogDetails.java index a0993099f9119..bee70587dd416 100644 --- a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/CopyLogDetails.java +++ b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/CopyLogDetails.java @@ -20,6 +20,7 @@ @JsonTypeName("CopyLogDetails") @JsonSubTypes({ @JsonSubTypes.Type(name = "DataBox", value = DataBoxAccountCopyLogDetails.class), + @JsonSubTypes.Type(name = "DataBoxCustomerDisk", value = DataBoxCustomerDiskCopyLogDetails.class), @JsonSubTypes.Type(name = "DataBoxDisk", value = DataBoxDiskCopyLogDetails.class), @JsonSubTypes.Type(name = "DataBoxHeavy", value = DataBoxHeavyAccountCopyLogDetails.class) }) diff --git a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/CopyProgress.java b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/CopyProgress.java index 3a2ed73779757..414b32c4e79ca 100644 --- a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/CopyProgress.java +++ b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/CopyProgress.java @@ -11,7 +11,7 @@ /** Copy progress. */ @Immutable -public final class CopyProgress { +public class CopyProgress { @JsonIgnore private final ClientLogger logger = new ClientLogger(CopyProgress.class); /* diff --git a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/CopyStatus.java b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/CopyStatus.java index 0cd8c193a3c1e..1069477997433 100644 --- a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/CopyStatus.java +++ b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/CopyStatus.java @@ -4,71 +4,79 @@ package com.azure.resourcemanager.databox.models; +import com.azure.core.util.ExpandableStringEnum; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Collection; /** Defines values for CopyStatus. */ -public enum CopyStatus { - /** Enum value NotStarted. */ - NOT_STARTED("NotStarted"), +public final class CopyStatus extends ExpandableStringEnum { + /** Static value NotStarted for CopyStatus. */ + public static final CopyStatus NOT_STARTED = fromString("NotStarted"); - /** Enum value InProgress. */ - IN_PROGRESS("InProgress"), + /** Static value InProgress for CopyStatus. */ + public static final CopyStatus IN_PROGRESS = fromString("InProgress"); - /** Enum value Completed. */ - COMPLETED("Completed"), + /** Static value Completed for CopyStatus. */ + public static final CopyStatus COMPLETED = fromString("Completed"); - /** Enum value CompletedWithErrors. */ - COMPLETED_WITH_ERRORS("CompletedWithErrors"), + /** Static value CompletedWithErrors for CopyStatus. */ + public static final CopyStatus COMPLETED_WITH_ERRORS = fromString("CompletedWithErrors"); - /** Enum value Failed. */ - FAILED("Failed"), + /** Static value Failed for CopyStatus. */ + public static final CopyStatus FAILED = fromString("Failed"); - /** Enum value NotReturned. */ - NOT_RETURNED("NotReturned"), + /** Static value NotReturned for CopyStatus. */ + public static final CopyStatus NOT_RETURNED = fromString("NotReturned"); - /** Enum value HardwareError. */ - HARDWARE_ERROR("HardwareError"), + /** Static value HardwareError for CopyStatus. */ + public static final CopyStatus HARDWARE_ERROR = fromString("HardwareError"); - /** Enum value DeviceFormatted. */ - DEVICE_FORMATTED("DeviceFormatted"), + /** Static value DeviceFormatted for CopyStatus. */ + public static final CopyStatus DEVICE_FORMATTED = fromString("DeviceFormatted"); - /** Enum value DeviceMetadataModified. */ - DEVICE_METADATA_MODIFIED("DeviceMetadataModified"), + /** Static value DeviceMetadataModified for CopyStatus. */ + public static final CopyStatus DEVICE_METADATA_MODIFIED = fromString("DeviceMetadataModified"); - /** Enum value StorageAccountNotAccessible. */ - STORAGE_ACCOUNT_NOT_ACCESSIBLE("StorageAccountNotAccessible"), + /** Static value StorageAccountNotAccessible for CopyStatus. */ + public static final CopyStatus STORAGE_ACCOUNT_NOT_ACCESSIBLE = fromString("StorageAccountNotAccessible"); - /** Enum value UnsupportedData. */ - UNSUPPORTED_DATA("UnsupportedData"); + /** Static value UnsupportedData for CopyStatus. */ + public static final CopyStatus UNSUPPORTED_DATA = fromString("UnsupportedData"); - /** The actual serialized value for a CopyStatus instance. */ - private final String value; + /** Static value DriveNotReceived for CopyStatus. */ + public static final CopyStatus DRIVE_NOT_RECEIVED = fromString("DriveNotReceived"); - CopyStatus(String value) { - this.value = value; - } + /** Static value UnsupportedDrive for CopyStatus. */ + public static final CopyStatus UNSUPPORTED_DRIVE = fromString("UnsupportedDrive"); + + /** Static value OtherServiceError for CopyStatus. */ + public static final CopyStatus OTHER_SERVICE_ERROR = fromString("OtherServiceError"); + + /** Static value OtherUserError for CopyStatus. */ + public static final CopyStatus OTHER_USER_ERROR = fromString("OtherUserError"); + + /** Static value DriveNotDetected for CopyStatus. */ + public static final CopyStatus DRIVE_NOT_DETECTED = fromString("DriveNotDetected"); + + /** Static value DriveCorrupted for CopyStatus. */ + public static final CopyStatus DRIVE_CORRUPTED = fromString("DriveCorrupted"); + + /** Static value MetadataFilesModifiedOrRemoved for CopyStatus. */ + public static final CopyStatus METADATA_FILES_MODIFIED_OR_REMOVED = fromString("MetadataFilesModifiedOrRemoved"); /** - * Parses a serialized value to a CopyStatus instance. + * Creates or finds a CopyStatus from its string representation. * - * @param value the serialized value to parse. - * @return the parsed CopyStatus object, or null if unable to parse. + * @param name a name to look for. + * @return the corresponding CopyStatus. */ @JsonCreator - public static CopyStatus fromString(String value) { - CopyStatus[] items = CopyStatus.values(); - for (CopyStatus item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; + public static CopyStatus fromString(String name) { + return fromString(name, CopyStatus.class); } - @JsonValue - @Override - public String toString() { - return this.value; + /** @return known CopyStatus values. */ + public static Collection values() { + return values(CopyStatus.class); } } diff --git a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/CreateJobValidations.java b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/CreateJobValidations.java index 9f38df9a6765a..1ec66277103f2 100644 --- a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/CreateJobValidations.java +++ b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/CreateJobValidations.java @@ -4,7 +4,7 @@ package com.azure.resourcemanager.databox.models; -import com.azure.core.annotation.Immutable; +import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonTypeInfo; @@ -14,7 +14,7 @@ /** It does all pre-job creation validations. */ @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "validationCategory") @JsonTypeName("JobCreationValidation") -@Immutable +@Fluent public final class CreateJobValidations extends ValidationRequest { @JsonIgnore private final ClientLogger logger = new ClientLogger(CreateJobValidations.class); diff --git a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/CustomerDiskJobSecrets.java b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/CustomerDiskJobSecrets.java new file mode 100644 index 0000000000000..e9c63eff85d19 --- /dev/null +++ b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/CustomerDiskJobSecrets.java @@ -0,0 +1,64 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.databox.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; + +/** The secrets related to customer disk job. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "jobSecretsType") +@JsonTypeName("DataBoxCustomerDisk") +@Immutable +public final class CustomerDiskJobSecrets extends JobSecrets { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CustomerDiskJobSecrets.class); + + /* + * Contains the list of secrets object for that device. + */ + @JsonProperty(value = "diskSecrets", access = JsonProperty.Access.WRITE_ONLY) + private List diskSecrets; + + /* + * Carrier Account Number of the customer + */ + @JsonProperty(value = "carrierAccountNumber", access = JsonProperty.Access.WRITE_ONLY) + private String carrierAccountNumber; + + /** + * Get the diskSecrets property: Contains the list of secrets object for that device. + * + * @return the diskSecrets value. + */ + public List diskSecrets() { + return this.diskSecrets; + } + + /** + * Get the carrierAccountNumber property: Carrier Account Number of the customer. + * + * @return the carrierAccountNumber value. + */ + public String carrierAccountNumber() { + return this.carrierAccountNumber; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (diskSecrets() != null) { + diskSecrets().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/DataBoxCustomerDiskCopyLogDetails.java b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/DataBoxCustomerDiskCopyLogDetails.java new file mode 100644 index 0000000000000..d7f95166ed809 --- /dev/null +++ b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/DataBoxCustomerDiskCopyLogDetails.java @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.databox.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Copy Log Details for customer disk. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "copyLogDetailsType") +@JsonTypeName("DataBoxCustomerDisk") +@Immutable +public final class DataBoxCustomerDiskCopyLogDetails extends CopyLogDetails { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DataBoxCustomerDiskCopyLogDetails.class); + + /* + * Disk Serial Number. + */ + @JsonProperty(value = "serialNumber", access = JsonProperty.Access.WRITE_ONLY) + private String serialNumber; + + /* + * Link for copy error logs. + */ + @JsonProperty(value = "errorLogLink", access = JsonProperty.Access.WRITE_ONLY) + private String errorLogLink; + + /* + * Link for copy verbose logs. + */ + @JsonProperty(value = "verboseLogLink", access = JsonProperty.Access.WRITE_ONLY) + private String verboseLogLink; + + /** + * Get the serialNumber property: Disk Serial Number. + * + * @return the serialNumber value. + */ + public String serialNumber() { + return this.serialNumber; + } + + /** + * Get the errorLogLink property: Link for copy error logs. + * + * @return the errorLogLink value. + */ + public String errorLogLink() { + return this.errorLogLink; + } + + /** + * Get the verboseLogLink property: Link for copy verbose logs. + * + * @return the verboseLogLink value. + */ + public String verboseLogLink() { + return this.verboseLogLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/DataBoxCustomerDiskCopyProgress.java b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/DataBoxCustomerDiskCopyProgress.java new file mode 100644 index 0000000000000..564e2eee19c8f --- /dev/null +++ b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/DataBoxCustomerDiskCopyProgress.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.databox.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** DataBox CustomerDisk Copy Progress. */ +@Immutable +public final class DataBoxCustomerDiskCopyProgress extends CopyProgress { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DataBoxCustomerDiskCopyProgress.class); + + /* + * Disk Serial Number. + */ + @JsonProperty(value = "serialNumber", access = JsonProperty.Access.WRITE_ONLY) + private String serialNumber; + + /* + * The Status of the copy + */ + @JsonProperty(value = "copyStatus", access = JsonProperty.Access.WRITE_ONLY) + private CopyStatus copyStatus; + + /** + * Get the serialNumber property: Disk Serial Number. + * + * @return the serialNumber value. + */ + public String serialNumber() { + return this.serialNumber; + } + + /** + * Get the copyStatus property: The Status of the copy. + * + * @return the copyStatus value. + */ + public CopyStatus copyStatus() { + return this.copyStatus; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/DataBoxCustomerDiskJobDetails.java b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/DataBoxCustomerDiskJobDetails.java new file mode 100644 index 0000000000000..c3827277da61b --- /dev/null +++ b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/DataBoxCustomerDiskJobDetails.java @@ -0,0 +1,252 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.databox.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; +import java.util.Map; + +/** Customer disk job details. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "jobDetailsType") +@JsonTypeName("DataBoxCustomerDisk") +@Fluent +public final class DataBoxCustomerDiskJobDetails extends JobDetails { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DataBoxCustomerDiskJobDetails.class); + + /* + * Contains the map of disk serial number to the disk details for import + * jobs. + */ + @JsonProperty(value = "importDiskDetailsCollection") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map importDiskDetailsCollection; + + /* + * Contains the map of disk serial number to the disk details for export + * jobs. + */ + @JsonProperty(value = "exportDiskDetailsCollection", access = JsonProperty.Access.WRITE_ONLY) + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map exportDiskDetailsCollection; + + /* + * Copy progress per disk. + */ + @JsonProperty(value = "copyProgress", access = JsonProperty.Access.WRITE_ONLY) + private List copyProgress; + + /* + * Delivery package shipping details. + */ + @JsonProperty(value = "deliverToDcPackageDetails", access = JsonProperty.Access.WRITE_ONLY) + private PackageCarrierInfo deliverToDcPackageDetails; + + /* + * Return package shipping details. + */ + @JsonProperty(value = "returnToCustomerPackageDetails", required = true) + private PackageCarrierDetails returnToCustomerPackageDetails; + + /* + * Flag to indicate if disk manifest should be backed-up in the Storage + * Account. + */ + @JsonProperty(value = "enableManifestBackup") + private Boolean enableManifestBackup; + + /** + * Get the importDiskDetailsCollection property: Contains the map of disk serial number to the disk details for + * import jobs. + * + * @return the importDiskDetailsCollection value. + */ + public Map importDiskDetailsCollection() { + return this.importDiskDetailsCollection; + } + + /** + * Set the importDiskDetailsCollection property: Contains the map of disk serial number to the disk details for + * import jobs. + * + * @param importDiskDetailsCollection the importDiskDetailsCollection value to set. + * @return the DataBoxCustomerDiskJobDetails object itself. + */ + public DataBoxCustomerDiskJobDetails withImportDiskDetailsCollection( + Map importDiskDetailsCollection) { + this.importDiskDetailsCollection = importDiskDetailsCollection; + return this; + } + + /** + * Get the exportDiskDetailsCollection property: Contains the map of disk serial number to the disk details for + * export jobs. + * + * @return the exportDiskDetailsCollection value. + */ + public Map exportDiskDetailsCollection() { + return this.exportDiskDetailsCollection; + } + + /** + * Get the copyProgress property: Copy progress per disk. + * + * @return the copyProgress value. + */ + public List copyProgress() { + return this.copyProgress; + } + + /** + * Get the deliverToDcPackageDetails property: Delivery package shipping details. + * + * @return the deliverToDcPackageDetails value. + */ + public PackageCarrierInfo deliverToDcPackageDetails() { + return this.deliverToDcPackageDetails; + } + + /** + * Get the returnToCustomerPackageDetails property: Return package shipping details. + * + * @return the returnToCustomerPackageDetails value. + */ + public PackageCarrierDetails returnToCustomerPackageDetails() { + return this.returnToCustomerPackageDetails; + } + + /** + * Set the returnToCustomerPackageDetails property: Return package shipping details. + * + * @param returnToCustomerPackageDetails the returnToCustomerPackageDetails value to set. + * @return the DataBoxCustomerDiskJobDetails object itself. + */ + public DataBoxCustomerDiskJobDetails withReturnToCustomerPackageDetails( + PackageCarrierDetails returnToCustomerPackageDetails) { + this.returnToCustomerPackageDetails = returnToCustomerPackageDetails; + return this; + } + + /** + * Get the enableManifestBackup property: Flag to indicate if disk manifest should be backed-up in the Storage + * Account. + * + * @return the enableManifestBackup value. + */ + public Boolean enableManifestBackup() { + return this.enableManifestBackup; + } + + /** + * Set the enableManifestBackup property: Flag to indicate if disk manifest should be backed-up in the Storage + * Account. + * + * @param enableManifestBackup the enableManifestBackup value to set. + * @return the DataBoxCustomerDiskJobDetails object itself. + */ + public DataBoxCustomerDiskJobDetails withEnableManifestBackup(Boolean enableManifestBackup) { + this.enableManifestBackup = enableManifestBackup; + return this; + } + + /** {@inheritDoc} */ + @Override + public DataBoxCustomerDiskJobDetails withContactDetails(ContactDetails contactDetails) { + super.withContactDetails(contactDetails); + return this; + } + + /** {@inheritDoc} */ + @Override + public DataBoxCustomerDiskJobDetails withShippingAddress(ShippingAddress shippingAddress) { + super.withShippingAddress(shippingAddress); + return this; + } + + /** {@inheritDoc} */ + @Override + public DataBoxCustomerDiskJobDetails withDataImportDetails(List dataImportDetails) { + super.withDataImportDetails(dataImportDetails); + return this; + } + + /** {@inheritDoc} */ + @Override + public DataBoxCustomerDiskJobDetails withDataExportDetails(List dataExportDetails) { + super.withDataExportDetails(dataExportDetails); + return this; + } + + /** {@inheritDoc} */ + @Override + public DataBoxCustomerDiskJobDetails withPreferences(Preferences preferences) { + super.withPreferences(preferences); + return this; + } + + /** {@inheritDoc} */ + @Override + public DataBoxCustomerDiskJobDetails withKeyEncryptionKey(KeyEncryptionKey keyEncryptionKey) { + super.withKeyEncryptionKey(keyEncryptionKey); + return this; + } + + /** {@inheritDoc} */ + @Override + public DataBoxCustomerDiskJobDetails withExpectedDataSizeInTeraBytes(Integer expectedDataSizeInTeraBytes) { + super.withExpectedDataSizeInTeraBytes(expectedDataSizeInTeraBytes); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (importDiskDetailsCollection() != null) { + importDiskDetailsCollection() + .values() + .forEach( + e -> { + if (e != null) { + e.validate(); + } + }); + } + if (exportDiskDetailsCollection() != null) { + exportDiskDetailsCollection() + .values() + .forEach( + e -> { + if (e != null) { + e.validate(); + } + }); + } + if (copyProgress() != null) { + copyProgress().forEach(e -> e.validate()); + } + if (deliverToDcPackageDetails() != null) { + deliverToDcPackageDetails().validate(); + } + if (returnToCustomerPackageDetails() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property returnToCustomerPackageDetails in model" + + " DataBoxCustomerDiskJobDetails")); + } else { + returnToCustomerPackageDetails().validate(); + } + } +} diff --git a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/DataBoxDiskJobDetails.java b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/DataBoxDiskJobDetails.java index 1d1cfb6fd582b..be660de779917 100644 --- a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/DataBoxDiskJobDetails.java +++ b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/DataBoxDiskJobDetails.java @@ -7,6 +7,7 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; @@ -26,6 +27,7 @@ public final class DataBoxDiskJobDetails extends JobDetails { * size. Key is string but will be checked against an int. */ @JsonProperty(value = "preferredDisks") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map preferredDisks; /* @@ -39,6 +41,7 @@ public final class DataBoxDiskJobDetails extends JobDetails { * the job. Is returned only after the disks are shipped to the customer. */ @JsonProperty(value = "disksAndSizeDetails", access = JsonProperty.Access.WRITE_ONLY) + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map disksAndSizeDetails; /* diff --git a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/DataBoxScheduleAvailabilityRequest.java b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/DataBoxScheduleAvailabilityRequest.java index fa4bae81f8aca..a5a3835c35b93 100644 --- a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/DataBoxScheduleAvailabilityRequest.java +++ b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/DataBoxScheduleAvailabilityRequest.java @@ -4,7 +4,7 @@ package com.azure.resourcemanager.databox.models; -import com.azure.core.annotation.Immutable; +import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonTypeInfo; @@ -13,7 +13,7 @@ /** Request body to get the availability for scheduling data box orders orders. */ @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "skuName") @JsonTypeName("DataBox") -@Immutable +@Fluent public final class DataBoxScheduleAvailabilityRequest extends ScheduleAvailabilityRequest { @JsonIgnore private final ClientLogger logger = new ClientLogger(DataBoxScheduleAvailabilityRequest.class); diff --git a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/DataCenterCode.java b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/DataCenterCode.java new file mode 100644 index 0000000000000..7f182ee52a769 --- /dev/null +++ b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/DataCenterCode.java @@ -0,0 +1,178 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.databox.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for DataCenterCode. */ +public final class DataCenterCode extends ExpandableStringEnum { + /** Static value Invalid for DataCenterCode. */ + public static final DataCenterCode INVALID = fromString("Invalid"); + + /** Static value BY2 for DataCenterCode. */ + public static final DataCenterCode BY2 = fromString("BY2"); + + /** Static value BY1 for DataCenterCode. */ + public static final DataCenterCode BY1 = fromString("BY1"); + + /** Static value ORK70 for DataCenterCode. */ + public static final DataCenterCode ORK70 = fromString("ORK70"); + + /** Static value AM2 for DataCenterCode. */ + public static final DataCenterCode AM2 = fromString("AM2"); + + /** Static value AMS20 for DataCenterCode. */ + public static final DataCenterCode AMS20 = fromString("AMS20"); + + /** Static value BY21 for DataCenterCode. */ + public static final DataCenterCode BY21 = fromString("BY21"); + + /** Static value BY24 for DataCenterCode. */ + public static final DataCenterCode BY24 = fromString("BY24"); + + /** Static value MWH01 for DataCenterCode. */ + public static final DataCenterCode MWH01 = fromString("MWH01"); + + /** Static value AMS06 for DataCenterCode. */ + public static final DataCenterCode AMS06 = fromString("AMS06"); + + /** Static value SSE90 for DataCenterCode. */ + public static final DataCenterCode SSE90 = fromString("SSE90"); + + /** Static value SYD03 for DataCenterCode. */ + public static final DataCenterCode SYD03 = fromString("SYD03"); + + /** Static value SYD23 for DataCenterCode. */ + public static final DataCenterCode SYD23 = fromString("SYD23"); + + /** Static value CBR20 for DataCenterCode. */ + public static final DataCenterCode CBR20 = fromString("CBR20"); + + /** Static value YTO20 for DataCenterCode. */ + public static final DataCenterCode YTO20 = fromString("YTO20"); + + /** Static value CWL20 for DataCenterCode. */ + public static final DataCenterCode CWL20 = fromString("CWL20"); + + /** Static value LON24 for DataCenterCode. */ + public static final DataCenterCode LON24 = fromString("LON24"); + + /** Static value BOM01 for DataCenterCode. */ + public static final DataCenterCode BOM01 = fromString("BOM01"); + + /** Static value BL20 for DataCenterCode. */ + public static final DataCenterCode BL20 = fromString("BL20"); + + /** Static value BL7 for DataCenterCode. */ + public static final DataCenterCode BL7 = fromString("BL7"); + + /** Static value SEL20 for DataCenterCode. */ + public static final DataCenterCode SEL20 = fromString("SEL20"); + + /** Static value TYO01 for DataCenterCode. */ + public static final DataCenterCode TYO01 = fromString("TYO01"); + + /** Static value BN1 for DataCenterCode. */ + public static final DataCenterCode BN1 = fromString("BN1"); + + /** Static value SN5 for DataCenterCode. */ + public static final DataCenterCode SN5 = fromString("SN5"); + + /** Static value CYS04 for DataCenterCode. */ + public static final DataCenterCode CYS04 = fromString("CYS04"); + + /** Static value TYO22 for DataCenterCode. */ + public static final DataCenterCode TYO22 = fromString("TYO22"); + + /** Static value YTO21 for DataCenterCode. */ + public static final DataCenterCode YTO21 = fromString("YTO21"); + + /** Static value YQB20 for DataCenterCode. */ + public static final DataCenterCode YQB20 = fromString("YQB20"); + + /** Static value FRA22 for DataCenterCode. */ + public static final DataCenterCode FRA22 = fromString("FRA22"); + + /** Static value MAA01 for DataCenterCode. */ + public static final DataCenterCode MAA01 = fromString("MAA01"); + + /** Static value CPQ02 for DataCenterCode. */ + public static final DataCenterCode CPQ02 = fromString("CPQ02"); + + /** Static value CPQ20 for DataCenterCode. */ + public static final DataCenterCode CPQ20 = fromString("CPQ20"); + + /** Static value SIN20 for DataCenterCode. */ + public static final DataCenterCode SIN20 = fromString("SIN20"); + + /** Static value HKG20 for DataCenterCode. */ + public static final DataCenterCode HKG20 = fromString("HKG20"); + + /** Static value SG2 for DataCenterCode. */ + public static final DataCenterCode SG2 = fromString("SG2"); + + /** Static value MEL23 for DataCenterCode. */ + public static final DataCenterCode MEL23 = fromString("MEL23"); + + /** Static value SEL21 for DataCenterCode. */ + public static final DataCenterCode SEL21 = fromString("SEL21"); + + /** Static value OSA20 for DataCenterCode. */ + public static final DataCenterCode OSA20 = fromString("OSA20"); + + /** Static value SHA03 for DataCenterCode. */ + public static final DataCenterCode SHA03 = fromString("SHA03"); + + /** Static value BJB for DataCenterCode. */ + public static final DataCenterCode BJB = fromString("BJB"); + + /** Static value JNB22 for DataCenterCode. */ + public static final DataCenterCode JNB22 = fromString("JNB22"); + + /** Static value JNB21 for DataCenterCode. */ + public static final DataCenterCode JNB21 = fromString("JNB21"); + + /** Static value MNZ21 for DataCenterCode. */ + public static final DataCenterCode MNZ21 = fromString("MNZ21"); + + /** Static value SN8 for DataCenterCode. */ + public static final DataCenterCode SN8 = fromString("SN8"); + + /** Static value AUH20 for DataCenterCode. */ + public static final DataCenterCode AUH20 = fromString("AUH20"); + + /** Static value ZRH20 for DataCenterCode. */ + public static final DataCenterCode ZRH20 = fromString("ZRH20"); + + /** Static value PUS20 for DataCenterCode. */ + public static final DataCenterCode PUS20 = fromString("PUS20"); + + /** Static value AdHoc for DataCenterCode. */ + public static final DataCenterCode AD_HOC = fromString("AdHoc"); + + /** Static value CH1 for DataCenterCode. */ + public static final DataCenterCode CH1 = fromString("CH1"); + + /** Static value DSM05 for DataCenterCode. */ + public static final DataCenterCode DSM05 = fromString("DSM05"); + + /** + * Creates or finds a DataCenterCode from its string representation. + * + * @param name a name to look for. + * @return the corresponding DataCenterCode. + */ + @JsonCreator + public static DataCenterCode fromString(String name) { + return fromString(name, DataCenterCode.class); + } + + /** @return known DataCenterCode values. */ + public static Collection values() { + return values(DataCenterCode.class); + } +} diff --git a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/DataImportDetails.java b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/DataImportDetails.java index f86b61b6df674..d6f9c189234fc 100644 --- a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/DataImportDetails.java +++ b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/DataImportDetails.java @@ -20,6 +20,12 @@ public final class DataImportDetails { @JsonProperty(value = "accountDetails", required = true) private DataAccountDetails accountDetails; + /* + * Level of the logs to be collected. + */ + @JsonProperty(value = "logCollectionLevel") + private LogCollectionLevel logCollectionLevel; + /** * Get the accountDetails property: Account details of the data to be transferred. * @@ -40,6 +46,26 @@ public DataImportDetails withAccountDetails(DataAccountDetails accountDetails) { return this; } + /** + * Get the logCollectionLevel property: Level of the logs to be collected. + * + * @return the logCollectionLevel value. + */ + public LogCollectionLevel logCollectionLevel() { + return this.logCollectionLevel; + } + + /** + * Set the logCollectionLevel property: Level of the logs to be collected. + * + * @param logCollectionLevel the logCollectionLevel value to set. + * @return the DataImportDetails object itself. + */ + public DataImportDetails withLogCollectionLevel(LogCollectionLevel logCollectionLevel) { + this.logCollectionLevel = logCollectionLevel; + return this; + } + /** * Validates the instance. * diff --git a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/DatacenterAddressInstructionResponse.java b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/DatacenterAddressInstructionResponse.java new file mode 100644 index 0000000000000..0969792f6352d --- /dev/null +++ b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/DatacenterAddressInstructionResponse.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.databox.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Datacenter instruction for given storage location. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "datacenterAddressType") +@JsonTypeName("DatacenterAddressInstruction") +@Immutable +public final class DatacenterAddressInstructionResponse extends DatacenterAddressResponse { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DatacenterAddressInstructionResponse.class); + + /* + * Data center communication instruction + */ + @JsonProperty(value = "communicationInstruction", access = JsonProperty.Access.WRITE_ONLY) + private String communicationInstruction; + + /** + * Get the communicationInstruction property: Data center communication instruction. + * + * @return the communicationInstruction value. + */ + public String communicationInstruction() { + return this.communicationInstruction; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/DatacenterAddressLocationResponse.java b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/DatacenterAddressLocationResponse.java new file mode 100644 index 0000000000000..8b448c3646164 --- /dev/null +++ b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/DatacenterAddressLocationResponse.java @@ -0,0 +1,225 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.databox.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Datacenter address for given storage location. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "datacenterAddressType") +@JsonTypeName("DatacenterAddressLocation") +@Immutable +public final class DatacenterAddressLocationResponse extends DatacenterAddressResponse { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DatacenterAddressLocationResponse.class); + + /* + * Contact person name + */ + @JsonProperty(value = "contactPersonName", access = JsonProperty.Access.WRITE_ONLY) + private String contactPersonName; + + /* + * Company name + */ + @JsonProperty(value = "company", access = JsonProperty.Access.WRITE_ONLY) + private String company; + + /* + * Street address line 1 + */ + @JsonProperty(value = "street1", access = JsonProperty.Access.WRITE_ONLY) + private String street1; + + /* + * Street address line 2 + */ + @JsonProperty(value = "street2", access = JsonProperty.Access.WRITE_ONLY) + private String street2; + + /* + * Street address line 3 + */ + @JsonProperty(value = "street3", access = JsonProperty.Access.WRITE_ONLY) + private String street3; + + /* + * City name + */ + @JsonProperty(value = "city", access = JsonProperty.Access.WRITE_ONLY) + private String city; + + /* + * name of the state + */ + @JsonProperty(value = "state", access = JsonProperty.Access.WRITE_ONLY) + private String state; + + /* + * Zip code + */ + @JsonProperty(value = "zip", access = JsonProperty.Access.WRITE_ONLY) + private String zip; + + /* + * name of the country + */ + @JsonProperty(value = "country", access = JsonProperty.Access.WRITE_ONLY) + private String country; + + /* + * Phone number + */ + @JsonProperty(value = "phone", access = JsonProperty.Access.WRITE_ONLY) + private String phone; + + /* + * Phone extension + */ + @JsonProperty(value = "phoneExtension", access = JsonProperty.Access.WRITE_ONLY) + private String phoneExtension; + + /* + * Address type + */ + @JsonProperty(value = "addressType", access = JsonProperty.Access.WRITE_ONLY) + private String addressType; + + /* + * Special instruction for shipping + */ + @JsonProperty(value = "additionalShippingInformation", access = JsonProperty.Access.WRITE_ONLY) + private String additionalShippingInformation; + + /** + * Get the contactPersonName property: Contact person name. + * + * @return the contactPersonName value. + */ + public String contactPersonName() { + return this.contactPersonName; + } + + /** + * Get the company property: Company name. + * + * @return the company value. + */ + public String company() { + return this.company; + } + + /** + * Get the street1 property: Street address line 1. + * + * @return the street1 value. + */ + public String street1() { + return this.street1; + } + + /** + * Get the street2 property: Street address line 2. + * + * @return the street2 value. + */ + public String street2() { + return this.street2; + } + + /** + * Get the street3 property: Street address line 3. + * + * @return the street3 value. + */ + public String street3() { + return this.street3; + } + + /** + * Get the city property: City name. + * + * @return the city value. + */ + public String city() { + return this.city; + } + + /** + * Get the state property: name of the state. + * + * @return the state value. + */ + public String state() { + return this.state; + } + + /** + * Get the zip property: Zip code. + * + * @return the zip value. + */ + public String zip() { + return this.zip; + } + + /** + * Get the country property: name of the country. + * + * @return the country value. + */ + public String country() { + return this.country; + } + + /** + * Get the phone property: Phone number. + * + * @return the phone value. + */ + public String phone() { + return this.phone; + } + + /** + * Get the phoneExtension property: Phone extension. + * + * @return the phoneExtension value. + */ + public String phoneExtension() { + return this.phoneExtension; + } + + /** + * Get the addressType property: Address type. + * + * @return the addressType value. + */ + public String addressType() { + return this.addressType; + } + + /** + * Get the additionalShippingInformation property: Special instruction for shipping. + * + * @return the additionalShippingInformation value. + */ + public String additionalShippingInformation() { + return this.additionalShippingInformation; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/DatacenterAddressRequest.java b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/DatacenterAddressRequest.java new file mode 100644 index 0000000000000..d08cfb6009932 --- /dev/null +++ b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/DatacenterAddressRequest.java @@ -0,0 +1,91 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.databox.models; + +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; + +/** Request body to get the datacenter address. */ +@Fluent +public final class DatacenterAddressRequest { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DatacenterAddressRequest.class); + + /* + * Storage location. For locations check: + * https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01 + */ + @JsonProperty(value = "storageLocation", required = true) + private String storageLocation; + + /* + * Sku Name for which the data center address requested. + */ + @JsonProperty(value = "skuName", required = true) + private SkuName skuName; + + /** + * Get the storageLocation property: Storage location. For locations check: + * https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01. + * + * @return the storageLocation value. + */ + public String storageLocation() { + return this.storageLocation; + } + + /** + * Set the storageLocation property: Storage location. For locations check: + * https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01. + * + * @param storageLocation the storageLocation value to set. + * @return the DatacenterAddressRequest object itself. + */ + public DatacenterAddressRequest withStorageLocation(String storageLocation) { + this.storageLocation = storageLocation; + return this; + } + + /** + * Get the skuName property: Sku Name for which the data center address requested. + * + * @return the skuName value. + */ + public SkuName skuName() { + return this.skuName; + } + + /** + * Set the skuName property: Sku Name for which the data center address requested. + * + * @param skuName the skuName value to set. + * @return the DatacenterAddressRequest object itself. + */ + public DatacenterAddressRequest withSkuName(SkuName skuName) { + this.skuName = skuName; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (storageLocation() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property storageLocation in model DatacenterAddressRequest")); + } + if (skuName() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property skuName in model DatacenterAddressRequest")); + } + } +} diff --git a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/DatacenterAddressResponse.java b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/DatacenterAddressResponse.java new file mode 100644 index 0000000000000..77d157efdbf1d --- /dev/null +++ b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/DatacenterAddressResponse.java @@ -0,0 +1,68 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.databox.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; + +/** Datacenter address for given storage location. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "datacenterAddressType", + defaultImpl = DatacenterAddressResponse.class) +@JsonTypeName("DatacenterAddressResponse") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "DatacenterAddressInstruction", value = DatacenterAddressInstructionResponse.class), + @JsonSubTypes.Type(name = "DatacenterAddressLocation", value = DatacenterAddressLocationResponse.class) +}) +@Immutable +public class DatacenterAddressResponse { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DatacenterAddressResponse.class); + + /* + * List of supported carriers for return shipment. + */ + @JsonProperty(value = "supportedCarriersForReturnShipment", access = JsonProperty.Access.WRITE_ONLY) + private List supportedCarriersForReturnShipment; + + /* + * Azure Location where the Data Center serves primarily. + */ + @JsonProperty(value = "dataCenterAzureLocation", access = JsonProperty.Access.WRITE_ONLY) + private String dataCenterAzureLocation; + + /** + * Get the supportedCarriersForReturnShipment property: List of supported carriers for return shipment. + * + * @return the supportedCarriersForReturnShipment value. + */ + public List supportedCarriersForReturnShipment() { + return this.supportedCarriersForReturnShipment; + } + + /** + * Get the dataCenterAzureLocation property: Azure Location where the Data Center serves primarily. + * + * @return the dataCenterAzureLocation value. + */ + public String dataCenterAzureLocation() { + return this.dataCenterAzureLocation; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/DatacenterAddressType.java b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/DatacenterAddressType.java new file mode 100644 index 0000000000000..6301a535988c2 --- /dev/null +++ b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/DatacenterAddressType.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.databox.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** Defines values for DatacenterAddressType. */ +public enum DatacenterAddressType { + /** Enum value DatacenterAddressLocation. */ + DATACENTER_ADDRESS_LOCATION("DatacenterAddressLocation"), + + /** Enum value DatacenterAddressInstruction. */ + DATACENTER_ADDRESS_INSTRUCTION("DatacenterAddressInstruction"); + + /** The actual serialized value for a DatacenterAddressType instance. */ + private final String value; + + DatacenterAddressType(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a DatacenterAddressType instance. + * + * @param value the serialized value to parse. + * @return the parsed DatacenterAddressType object, or null if unable to parse. + */ + @JsonCreator + public static DatacenterAddressType fromString(String value) { + DatacenterAddressType[] items = DatacenterAddressType.values(); + for (DatacenterAddressType item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/ExportDiskDetails.java b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/ExportDiskDetails.java new file mode 100644 index 0000000000000..02e8f97fad79f --- /dev/null +++ b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/ExportDiskDetails.java @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.databox.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Export disk details. */ +@Immutable +public final class ExportDiskDetails { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ExportDiskDetails.class); + + /* + * The relative path of the manifest file on the disk. + */ + @JsonProperty(value = "manifestFile", access = JsonProperty.Access.WRITE_ONLY) + private String manifestFile; + + /* + * The Base16-encoded MD5 hash of the manifest file on the disk. + */ + @JsonProperty(value = "manifestHash", access = JsonProperty.Access.WRITE_ONLY) + private String manifestHash; + + /* + * Path to backed up manifest, only returned if enableManifestBackup is + * true. + */ + @JsonProperty(value = "backupManifestCloudPath", access = JsonProperty.Access.WRITE_ONLY) + private String backupManifestCloudPath; + + /** + * Get the manifestFile property: The relative path of the manifest file on the disk. + * + * @return the manifestFile value. + */ + public String manifestFile() { + return this.manifestFile; + } + + /** + * Get the manifestHash property: The Base16-encoded MD5 hash of the manifest file on the disk. + * + * @return the manifestHash value. + */ + public String manifestHash() { + return this.manifestHash; + } + + /** + * Get the backupManifestCloudPath property: Path to backed up manifest, only returned if enableManifestBackup is + * true. + * + * @return the backupManifestCloudPath value. + */ + public String backupManifestCloudPath() { + return this.backupManifestCloudPath; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/HeavyScheduleAvailabilityRequest.java b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/HeavyScheduleAvailabilityRequest.java index 18a1a3222c300..c4eae1fadd458 100644 --- a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/HeavyScheduleAvailabilityRequest.java +++ b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/HeavyScheduleAvailabilityRequest.java @@ -4,7 +4,7 @@ package com.azure.resourcemanager.databox.models; -import com.azure.core.annotation.Immutable; +import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonTypeInfo; @@ -13,7 +13,7 @@ /** Request body to get the availability for scheduling heavy orders. */ @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "skuName") @JsonTypeName("DataBoxHeavy") -@Immutable +@Fluent public final class HeavyScheduleAvailabilityRequest extends ScheduleAvailabilityRequest { @JsonIgnore private final ClientLogger logger = new ClientLogger(HeavyScheduleAvailabilityRequest.class); diff --git a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/ImportDiskDetails.java b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/ImportDiskDetails.java new file mode 100644 index 0000000000000..165ac6c6a9c72 --- /dev/null +++ b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/ImportDiskDetails.java @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.databox.models; + +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; + +/** Import disk details. */ +@Fluent +public final class ImportDiskDetails { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ImportDiskDetails.class); + + /* + * The relative path of the manifest file on the disk. + */ + @JsonProperty(value = "manifestFile", required = true) + private String manifestFile; + + /* + * The Base16-encoded MD5 hash of the manifest file on the disk. + */ + @JsonProperty(value = "manifestHash", required = true) + private String manifestHash; + + /* + * BitLocker key used to encrypt the disk. + */ + @JsonProperty(value = "bitLockerKey", required = true) + private String bitLockerKey; + + /* + * Path to backed up manifest, only returned if enableManifestBackup is + * true. + */ + @JsonProperty(value = "backupManifestCloudPath", access = JsonProperty.Access.WRITE_ONLY) + private String backupManifestCloudPath; + + /** + * Get the manifestFile property: The relative path of the manifest file on the disk. + * + * @return the manifestFile value. + */ + public String manifestFile() { + return this.manifestFile; + } + + /** + * Set the manifestFile property: The relative path of the manifest file on the disk. + * + * @param manifestFile the manifestFile value to set. + * @return the ImportDiskDetails object itself. + */ + public ImportDiskDetails withManifestFile(String manifestFile) { + this.manifestFile = manifestFile; + return this; + } + + /** + * Get the manifestHash property: The Base16-encoded MD5 hash of the manifest file on the disk. + * + * @return the manifestHash value. + */ + public String manifestHash() { + return this.manifestHash; + } + + /** + * Set the manifestHash property: The Base16-encoded MD5 hash of the manifest file on the disk. + * + * @param manifestHash the manifestHash value to set. + * @return the ImportDiskDetails object itself. + */ + public ImportDiskDetails withManifestHash(String manifestHash) { + this.manifestHash = manifestHash; + return this; + } + + /** + * Get the bitLockerKey property: BitLocker key used to encrypt the disk. + * + * @return the bitLockerKey value. + */ + public String bitLockerKey() { + return this.bitLockerKey; + } + + /** + * Set the bitLockerKey property: BitLocker key used to encrypt the disk. + * + * @param bitLockerKey the bitLockerKey value to set. + * @return the ImportDiskDetails object itself. + */ + public ImportDiskDetails withBitLockerKey(String bitLockerKey) { + this.bitLockerKey = bitLockerKey; + return this; + } + + /** + * Get the backupManifestCloudPath property: Path to backed up manifest, only returned if enableManifestBackup is + * true. + * + * @return the backupManifestCloudPath value. + */ + public String backupManifestCloudPath() { + return this.backupManifestCloudPath; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (manifestFile() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property manifestFile in model ImportDiskDetails")); + } + if (manifestHash() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property manifestHash in model ImportDiskDetails")); + } + if (bitLockerKey() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property bitLockerKey in model ImportDiskDetails")); + } + } +} diff --git a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/JobDetails.java b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/JobDetails.java index ffd7b72d547e3..e241a8be91012 100644 --- a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/JobDetails.java +++ b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/JobDetails.java @@ -21,6 +21,7 @@ defaultImpl = JobDetails.class) @JsonTypeName("JobDetails") @JsonSubTypes({ + @JsonSubTypes.Type(name = "DataBoxCustomerDisk", value = DataBoxCustomerDiskJobDetails.class), @JsonSubTypes.Type(name = "DataBoxDisk", value = DataBoxDiskJobDetails.class), @JsonSubTypes.Type(name = "DataBoxHeavy", value = DataBoxHeavyJobDetails.class), @JsonSubTypes.Type(name = "DataBox", value = DataBoxJobDetails.class) @@ -120,6 +121,18 @@ public class JobDetails { @JsonProperty(value = "lastMitigationActionOnJob", access = JsonProperty.Access.WRITE_ONLY) private LastMitigationActionOnJob lastMitigationActionOnJob; + /* + * Datacenter address to ship to, for the given sku and storage location. + */ + @JsonProperty(value = "datacenterAddress", access = JsonProperty.Access.WRITE_ONLY) + private DatacenterAddressResponse datacenterAddress; + + /* + * DataCenter code. + */ + @JsonProperty(value = "dataCenterCode", access = JsonProperty.Access.WRITE_ONLY) + private DataCenterCode dataCenterCode; + /** * Get the jobStages property: List of stages that run in the job. * @@ -334,6 +347,24 @@ public LastMitigationActionOnJob lastMitigationActionOnJob() { return this.lastMitigationActionOnJob; } + /** + * Get the datacenterAddress property: Datacenter address to ship to, for the given sku and storage location. + * + * @return the datacenterAddress value. + */ + public DatacenterAddressResponse datacenterAddress() { + return this.datacenterAddress; + } + + /** + * Get the dataCenterCode property: DataCenter code. + * + * @return the dataCenterCode value. + */ + public DataCenterCode dataCenterCode() { + return this.dataCenterCode; + } + /** * Validates the instance. * @@ -377,5 +408,8 @@ public void validate() { if (lastMitigationActionOnJob() != null) { lastMitigationActionOnJob().validate(); } + if (datacenterAddress() != null) { + datacenterAddress().validate(); + } } } diff --git a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/JobResource.java b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/JobResource.java index a4909f3bbccea..76ffa401c9b08 100644 --- a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/JobResource.java +++ b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/JobResource.java @@ -57,6 +57,20 @@ public interface JobResource { */ SystemData systemData(); + /** + * Gets the sku property: The sku type. + * + * @return the sku value. + */ + Sku sku(); + + /** + * Gets the identity property: Msi identity of the resource. + * + * @return the identity value. + */ + ResourceIdentity identity(); + /** * Gets the transferType property: Type of the data transfer. * @@ -148,20 +162,6 @@ public interface JobResource { */ Boolean isCancellableWithoutFee(); - /** - * Gets the sku property: The sku type. - * - * @return the sku value. - */ - Sku sku(); - - /** - * Gets the identity property: Msi identity of the resource. - * - * @return the identity value. - */ - ResourceIdentity identity(); - /** * Gets the region of the resource. * @@ -188,8 +188,8 @@ interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, DefinitionStages.WithResourceGroup, - DefinitionStages.WithTransferType, DefinitionStages.WithSku, + DefinitionStages.WithTransferType, DefinitionStages.WithCreate { } /** The JobResource definition stages. */ @@ -223,27 +223,27 @@ interface WithResourceGroup { * @param resourceGroupName The Resource Group Name. * @return the next definition stage. */ - WithTransferType withExistingResourceGroup(String resourceGroupName); + WithSku withExistingResourceGroup(String resourceGroupName); } - /** The stage of the JobResource definition allowing to specify transferType. */ - interface WithTransferType { + /** The stage of the JobResource definition allowing to specify sku. */ + interface WithSku { /** - * Specifies the transferType property: Type of the data transfer.. + * Specifies the sku property: The sku type.. * - * @param transferType Type of the data transfer. + * @param sku The sku type. * @return the next definition stage. */ - WithSku withTransferType(TransferType transferType); + WithTransferType withSku(Sku sku); } - /** The stage of the JobResource definition allowing to specify sku. */ - interface WithSku { + /** The stage of the JobResource definition allowing to specify transferType. */ + interface WithTransferType { /** - * Specifies the sku property: The sku type.. + * Specifies the transferType property: Type of the data transfer.. * - * @param sku The sku type. + * @param transferType Type of the data transfer. * @return the next definition stage. */ - WithCreate withSku(Sku sku); + WithCreate withTransferType(TransferType transferType); } /** * The stage of the JobResource definition which contains all the minimum required properties for the resource @@ -251,10 +251,10 @@ interface WithSku { */ interface WithCreate extends DefinitionStages.WithTags, + DefinitionStages.WithIdentity, DefinitionStages.WithDetails, DefinitionStages.WithDeliveryType, - DefinitionStages.WithDeliveryInfo, - DefinitionStages.WithIdentity { + DefinitionStages.WithDeliveryInfo { /** * Executes the create request. * @@ -280,6 +280,16 @@ interface WithTags { */ WithCreate withTags(Map tags); } + /** The stage of the JobResource definition allowing to specify identity. */ + interface WithIdentity { + /** + * Specifies the identity property: Msi identity of the resource. + * + * @param identity Msi identity of the resource. + * @return the next definition stage. + */ + WithCreate withIdentity(ResourceIdentity identity); + } /** The stage of the JobResource definition allowing to specify details. */ interface WithDetails { /** @@ -311,16 +321,6 @@ interface WithDeliveryInfo { */ WithCreate withDeliveryInfo(JobDeliveryInfo deliveryInfo); } - /** The stage of the JobResource definition allowing to specify identity. */ - interface WithIdentity { - /** - * Specifies the identity property: Msi identity of the resource. - * - * @param identity Msi identity of the resource. - * @return the next definition stage. - */ - WithCreate withIdentity(ResourceIdentity identity); - } } /** * Begins update for the JobResource resource. @@ -409,6 +409,28 @@ interface WithIfMatch { */ JobResource refresh(Context context); + /** + * Request to mark devices for a given job as shipped. + * + * @param markDevicesShippedRequest Mark Devices Shipped Request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void markDevicesShipped(MarkDevicesShippedRequest markDevicesShippedRequest); + + /** + * Request to mark devices for a given job as shipped. + * + * @param markDevicesShippedRequest Mark Devices Shipped Request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response markDevicesShippedWithResponse(MarkDevicesShippedRequest markDevicesShippedRequest, Context context); + /** * Book shipment pick up. * diff --git a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/JobResourceUpdateParameter.java b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/JobResourceUpdateParameter.java index 15b225e52f565..205321183b67f 100644 --- a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/JobResourceUpdateParameter.java +++ b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/JobResourceUpdateParameter.java @@ -5,23 +5,30 @@ package com.azure.resourcemanager.databox.models; import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.JsonFlatten; import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.databox.fluent.models.UpdateJobProperties; import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.Map; /** The JobResourceUpdateParameter. */ -@JsonFlatten @Fluent -public class JobResourceUpdateParameter { +public final class JobResourceUpdateParameter { @JsonIgnore private final ClientLogger logger = new ClientLogger(JobResourceUpdateParameter.class); + /* + * Properties of a job to be updated. + */ + @JsonProperty(value = "properties") + private UpdateJobProperties innerProperties; + /* * The list of key value pairs that describe the resource. These tags can * be used in viewing and grouping this resource (across resource groups). */ @JsonProperty(value = "tags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map tags; /* @@ -30,11 +37,14 @@ public class JobResourceUpdateParameter { @JsonProperty(value = "identity") private ResourceIdentity identity; - /* - * Details of a job to be updated. + /** + * Get the innerProperties property: Properties of a job to be updated. + * + * @return the innerProperties value. */ - @JsonProperty(value = "properties.details") - private UpdateJobDetails details; + private UpdateJobProperties innerProperties() { + return this.innerProperties; + } /** * Get the tags property: The list of key value pairs that describe the resource. These tags can be used in viewing @@ -84,7 +94,7 @@ public JobResourceUpdateParameter withIdentity(ResourceIdentity identity) { * @return the details value. */ public UpdateJobDetails details() { - return this.details; + return this.innerProperties() == null ? null : this.innerProperties().details(); } /** @@ -94,7 +104,10 @@ public UpdateJobDetails details() { * @return the JobResourceUpdateParameter object itself. */ public JobResourceUpdateParameter withDetails(UpdateJobDetails details) { - this.details = details; + if (this.innerProperties() == null) { + this.innerProperties = new UpdateJobProperties(); + } + this.innerProperties().withDetails(details); return this; } @@ -104,11 +117,11 @@ public JobResourceUpdateParameter withDetails(UpdateJobDetails details) { * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } if (identity() != null) { identity().validate(); } - if (details() != null) { - details().validate(); - } } } diff --git a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/JobSecrets.java b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/JobSecrets.java index 35a61793e93b6..e227dc207ab98 100644 --- a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/JobSecrets.java +++ b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/JobSecrets.java @@ -20,6 +20,7 @@ defaultImpl = JobSecrets.class) @JsonTypeName("JobSecrets") @JsonSubTypes({ + @JsonSubTypes.Type(name = "DataBoxCustomerDisk", value = CustomerDiskJobSecrets.class), @JsonSubTypes.Type(name = "DataBoxDisk", value = DataBoxDiskJobSecrets.class), @JsonSubTypes.Type(name = "DataBoxHeavy", value = DataBoxHeavyJobSecrets.class), @JsonSubTypes.Type(name = "DataBox", value = DataboxJobSecrets.class) diff --git a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/Jobs.java b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/Jobs.java index 0983bba6aa1a3..4c656e4d87eb0 100644 --- a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/Jobs.java +++ b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/Jobs.java @@ -31,6 +31,36 @@ public interface Jobs { */ PagedIterable list(String skipToken, Context context); + /** + * Request to mark devices for a given job as shipped. + * + * @param jobName The name of the job Resource within the specified resource group. job names must be between 3 and + * 24 characters in length and use any alphanumeric and underscore only. + * @param resourceGroupName The Resource Group Name. + * @param markDevicesShippedRequest Mark Devices Shipped Request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void markDevicesShipped( + String jobName, String resourceGroupName, MarkDevicesShippedRequest markDevicesShippedRequest); + + /** + * Request to mark devices for a given job as shipped. + * + * @param jobName The name of the job Resource within the specified resource group. job names must be between 3 and + * 24 characters in length and use any alphanumeric and underscore only. + * @param resourceGroupName The Resource Group Name. + * @param markDevicesShippedRequest Mark Devices Shipped Request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response markDevicesShippedWithResponse( + String jobName, String resourceGroupName, MarkDevicesShippedRequest markDevicesShippedRequest, Context context); + /** * Lists all the jobs available under the given resource group. * diff --git a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/MarkDevicesShippedRequest.java b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/MarkDevicesShippedRequest.java new file mode 100644 index 0000000000000..907882ddaf90e --- /dev/null +++ b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/MarkDevicesShippedRequest.java @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.databox.models; + +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 request body to provide the delivery package details of job. */ +@Fluent +public final class MarkDevicesShippedRequest { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MarkDevicesShippedRequest.class); + + /* + * Delivery package details + */ + @JsonProperty(value = "deliverToDcPackageDetails", required = true) + private PackageCarrierInfo deliverToDcPackageDetails; + + /** + * Get the deliverToDcPackageDetails property: Delivery package details. + * + * @return the deliverToDcPackageDetails value. + */ + public PackageCarrierInfo deliverToDcPackageDetails() { + return this.deliverToDcPackageDetails; + } + + /** + * Set the deliverToDcPackageDetails property: Delivery package details. + * + * @param deliverToDcPackageDetails the deliverToDcPackageDetails value to set. + * @return the MarkDevicesShippedRequest object itself. + */ + public MarkDevicesShippedRequest withDeliverToDcPackageDetails(PackageCarrierInfo deliverToDcPackageDetails) { + this.deliverToDcPackageDetails = deliverToDcPackageDetails; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (deliverToDcPackageDetails() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property deliverToDcPackageDetails in model MarkDevicesShippedRequest")); + } else { + deliverToDcPackageDetails().validate(); + } + } +} diff --git a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/NotificationStageName.java b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/NotificationStageName.java index b99a092b5bdea..117f1b604a720 100644 --- a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/NotificationStageName.java +++ b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/NotificationStageName.java @@ -4,56 +4,49 @@ package com.azure.resourcemanager.databox.models; +import com.azure.core.util.ExpandableStringEnum; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Collection; /** Defines values for NotificationStageName. */ -public enum NotificationStageName { - /** Enum value DevicePrepared. */ - DEVICE_PREPARED("DevicePrepared"), +public final class NotificationStageName extends ExpandableStringEnum { + /** Static value DevicePrepared for NotificationStageName. */ + public static final NotificationStageName DEVICE_PREPARED = fromString("DevicePrepared"); - /** Enum value Dispatched. */ - DISPATCHED("Dispatched"), + /** Static value Dispatched for NotificationStageName. */ + public static final NotificationStageName DISPATCHED = fromString("Dispatched"); - /** Enum value Delivered. */ - DELIVERED("Delivered"), + /** Static value Delivered for NotificationStageName. */ + public static final NotificationStageName DELIVERED = fromString("Delivered"); - /** Enum value PickedUp. */ - PICKED_UP("PickedUp"), + /** Static value PickedUp for NotificationStageName. */ + public static final NotificationStageName PICKED_UP = fromString("PickedUp"); - /** Enum value AtAzureDC. */ - AT_AZURE_DC("AtAzureDC"), + /** Static value AtAzureDC for NotificationStageName. */ + public static final NotificationStageName AT_AZURE_DC = fromString("AtAzureDC"); - /** Enum value DataCopy. */ - DATA_COPY("DataCopy"); + /** Static value DataCopy for NotificationStageName. */ + public static final NotificationStageName DATA_COPY = fromString("DataCopy"); - /** The actual serialized value for a NotificationStageName instance. */ - private final String value; + /** Static value Created for NotificationStageName. */ + public static final NotificationStageName CREATED = fromString("Created"); - NotificationStageName(String value) { - this.value = value; - } + /** Static value ShippedToCustomer for NotificationStageName. */ + public static final NotificationStageName SHIPPED_TO_CUSTOMER = fromString("ShippedToCustomer"); /** - * Parses a serialized value to a NotificationStageName instance. + * Creates or finds a NotificationStageName from its string representation. * - * @param value the serialized value to parse. - * @return the parsed NotificationStageName object, or null if unable to parse. + * @param name a name to look for. + * @return the corresponding NotificationStageName. */ @JsonCreator - public static NotificationStageName fromString(String value) { - NotificationStageName[] items = NotificationStageName.values(); - for (NotificationStageName item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; + public static NotificationStageName fromString(String name) { + return fromString(name, NotificationStageName.class); } - @JsonValue - @Override - public String toString() { - return this.value; + /** @return known NotificationStageName values. */ + public static Collection values() { + return values(NotificationStageName.class); } } diff --git a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/PackageCarrierDetails.java b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/PackageCarrierDetails.java new file mode 100644 index 0000000000000..c9718bb6f4e78 --- /dev/null +++ b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/PackageCarrierDetails.java @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.databox.models; + +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; + +/** Package carrier details. */ +@Fluent +public final class PackageCarrierDetails { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PackageCarrierDetails.class); + + /* + * Carrier Account Number of customer for customer disk. + */ + @JsonProperty(value = "carrierAccountNumber") + private String carrierAccountNumber; + + /* + * Name of the carrier. + */ + @JsonProperty(value = "carrierName") + private String carrierName; + + /* + * Tracking Id of shipment. + */ + @JsonProperty(value = "trackingId") + private String trackingId; + + /** + * Get the carrierAccountNumber property: Carrier Account Number of customer for customer disk. + * + * @return the carrierAccountNumber value. + */ + public String carrierAccountNumber() { + return this.carrierAccountNumber; + } + + /** + * Set the carrierAccountNumber property: Carrier Account Number of customer for customer disk. + * + * @param carrierAccountNumber the carrierAccountNumber value to set. + * @return the PackageCarrierDetails object itself. + */ + public PackageCarrierDetails withCarrierAccountNumber(String carrierAccountNumber) { + this.carrierAccountNumber = carrierAccountNumber; + return this; + } + + /** + * Get the carrierName property: Name of the carrier. + * + * @return the carrierName value. + */ + public String carrierName() { + return this.carrierName; + } + + /** + * Set the carrierName property: Name of the carrier. + * + * @param carrierName the carrierName value to set. + * @return the PackageCarrierDetails object itself. + */ + public PackageCarrierDetails withCarrierName(String carrierName) { + this.carrierName = carrierName; + return this; + } + + /** + * Get the trackingId property: Tracking Id of shipment. + * + * @return the trackingId value. + */ + public String trackingId() { + return this.trackingId; + } + + /** + * Set the trackingId property: Tracking Id of shipment. + * + * @param trackingId the trackingId value to set. + * @return the PackageCarrierDetails object itself. + */ + public PackageCarrierDetails withTrackingId(String trackingId) { + this.trackingId = trackingId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/PackageCarrierInfo.java b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/PackageCarrierInfo.java new file mode 100644 index 0000000000000..8b8b14f44bbee --- /dev/null +++ b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/PackageCarrierInfo.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.databox.models; + +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; + +/** package carrier info. */ +@Fluent +public final class PackageCarrierInfo { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PackageCarrierInfo.class); + + /* + * Name of the carrier. + */ + @JsonProperty(value = "carrierName") + private String carrierName; + + /* + * Tracking Id of shipment. + */ + @JsonProperty(value = "trackingId") + private String trackingId; + + /** + * Get the carrierName property: Name of the carrier. + * + * @return the carrierName value. + */ + public String carrierName() { + return this.carrierName; + } + + /** + * Set the carrierName property: Name of the carrier. + * + * @param carrierName the carrierName value to set. + * @return the PackageCarrierInfo object itself. + */ + public PackageCarrierInfo withCarrierName(String carrierName) { + this.carrierName = carrierName; + return this; + } + + /** + * Get the trackingId property: Tracking Id of shipment. + * + * @return the trackingId value. + */ + public String trackingId() { + return this.trackingId; + } + + /** + * Set the trackingId property: Tracking Id of shipment. + * + * @param trackingId the trackingId value to set. + * @return the PackageCarrierInfo object itself. + */ + public PackageCarrierInfo withTrackingId(String trackingId) { + this.trackingId = trackingId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/PackageShippingDetails.java b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/PackageShippingDetails.java index 035994f5048ff..98a054dd9d67a 100644 --- a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/PackageShippingDetails.java +++ b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/PackageShippingDetails.java @@ -9,11 +9,17 @@ import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; -/** Shipping details. */ +/** package shipping details. */ @Immutable public final class PackageShippingDetails { @JsonIgnore private final ClientLogger logger = new ClientLogger(PackageShippingDetails.class); + /* + * Url where shipment can be tracked. + */ + @JsonProperty(value = "trackingUrl", access = JsonProperty.Access.WRITE_ONLY) + private String trackingUrl; + /* * Name of the carrier. */ @@ -26,11 +32,14 @@ public final class PackageShippingDetails { @JsonProperty(value = "trackingId", access = JsonProperty.Access.WRITE_ONLY) private String trackingId; - /* - * Url where shipment can be tracked. + /** + * Get the trackingUrl property: Url where shipment can be tracked. + * + * @return the trackingUrl value. */ - @JsonProperty(value = "trackingUrl", access = JsonProperty.Access.WRITE_ONLY) - private String trackingUrl; + public String trackingUrl() { + return this.trackingUrl; + } /** * Get the carrierName property: Name of the carrier. @@ -50,15 +59,6 @@ public String trackingId() { return this.trackingId; } - /** - * Get the trackingUrl property: Url where shipment can be tracked. - * - * @return the trackingUrl value. - */ - public String trackingUrl() { - return this.trackingUrl; - } - /** * Validates the instance. * diff --git a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/RegionConfigurationRequest.java b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/RegionConfigurationRequest.java index 322c418ccb6d2..d9f1df5cf4cbc 100644 --- a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/RegionConfigurationRequest.java +++ b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/RegionConfigurationRequest.java @@ -26,6 +26,12 @@ public final class RegionConfigurationRequest { @JsonProperty(value = "transportAvailabilityRequest") private TransportAvailabilityRequest transportAvailabilityRequest; + /* + * Request body to get the datacenter address for given sku. + */ + @JsonProperty(value = "datacenterAddressRequest") + private DatacenterAddressRequest datacenterAddressRequest; + /** * Get the scheduleAvailabilityRequest property: Request body to get the availability for scheduling orders. * @@ -68,6 +74,26 @@ public RegionConfigurationRequest withTransportAvailabilityRequest( return this; } + /** + * Get the datacenterAddressRequest property: Request body to get the datacenter address for given sku. + * + * @return the datacenterAddressRequest value. + */ + public DatacenterAddressRequest datacenterAddressRequest() { + return this.datacenterAddressRequest; + } + + /** + * Set the datacenterAddressRequest property: Request body to get the datacenter address for given sku. + * + * @param datacenterAddressRequest the datacenterAddressRequest value to set. + * @return the RegionConfigurationRequest object itself. + */ + public RegionConfigurationRequest withDatacenterAddressRequest(DatacenterAddressRequest datacenterAddressRequest) { + this.datacenterAddressRequest = datacenterAddressRequest; + return this; + } + /** * Validates the instance. * @@ -80,5 +106,8 @@ public void validate() { if (transportAvailabilityRequest() != null) { transportAvailabilityRequest().validate(); } + if (datacenterAddressRequest() != null) { + datacenterAddressRequest().validate(); + } } } diff --git a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/RegionConfigurationResponse.java b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/RegionConfigurationResponse.java index 7e2e17b769387..258f74271e909 100644 --- a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/RegionConfigurationResponse.java +++ b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/RegionConfigurationResponse.java @@ -22,6 +22,13 @@ public interface RegionConfigurationResponse { */ TransportAvailabilityResponse transportAvailabilityResponse(); + /** + * Gets the datacenterAddressResponse property: Datacenter address for given sku in a region. + * + * @return the datacenterAddressResponse value. + */ + DatacenterAddressResponse datacenterAddressResponse(); + /** * Gets the inner com.azure.resourcemanager.databox.fluent.models.RegionConfigurationResponseInner object. * diff --git a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/ResourceIdentity.java b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/ResourceIdentity.java index 63b28374a643e..664838ca78c5d 100644 --- a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/ResourceIdentity.java +++ b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/ResourceIdentity.java @@ -7,6 +7,7 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.Map; @@ -37,6 +38,7 @@ public class ResourceIdentity { * User Assigned Identities */ @JsonProperty(value = "userAssignedIdentities") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map userAssignedIdentities; /** diff --git a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/SkuName.java b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/SkuName.java index 9f727241afc51..a1aa12b7bbbc9 100644 --- a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/SkuName.java +++ b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/SkuName.java @@ -16,7 +16,10 @@ public enum SkuName { DATA_BOX_DISK("DataBoxDisk"), /** Enum value DataBoxHeavy. */ - DATA_BOX_HEAVY("DataBoxHeavy"); + DATA_BOX_HEAVY("DataBoxHeavy"), + + /** Enum value DataBoxCustomerDisk. */ + DATA_BOX_CUSTOMER_DISK("DataBoxCustomerDisk"); /** The actual serialized value for a SkuName instance. */ private final String value; diff --git a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/StageName.java b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/StageName.java index 7af3e1211144d..0688d0adf065f 100644 --- a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/StageName.java +++ b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/StageName.java @@ -4,86 +4,88 @@ package com.azure.resourcemanager.databox.models; +import com.azure.core.util.ExpandableStringEnum; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Collection; /** Defines values for StageName. */ -public enum StageName { - /** Enum value DeviceOrdered. */ - DEVICE_ORDERED("DeviceOrdered"), +public final class StageName extends ExpandableStringEnum { + /** Static value DeviceOrdered for StageName. */ + public static final StageName DEVICE_ORDERED = fromString("DeviceOrdered"); - /** Enum value DevicePrepared. */ - DEVICE_PREPARED("DevicePrepared"), + /** Static value DevicePrepared for StageName. */ + public static final StageName DEVICE_PREPARED = fromString("DevicePrepared"); - /** Enum value Dispatched. */ - DISPATCHED("Dispatched"), + /** Static value Dispatched for StageName. */ + public static final StageName DISPATCHED = fromString("Dispatched"); - /** Enum value Delivered. */ - DELIVERED("Delivered"), + /** Static value Delivered for StageName. */ + public static final StageName DELIVERED = fromString("Delivered"); - /** Enum value PickedUp. */ - PICKED_UP("PickedUp"), + /** Static value PickedUp for StageName. */ + public static final StageName PICKED_UP = fromString("PickedUp"); - /** Enum value AtAzureDC. */ - AT_AZURE_DC("AtAzureDC"), + /** Static value AtAzureDC for StageName. */ + public static final StageName AT_AZURE_DC = fromString("AtAzureDC"); - /** Enum value DataCopy. */ - DATA_COPY("DataCopy"), + /** Static value DataCopy for StageName. */ + public static final StageName DATA_COPY = fromString("DataCopy"); - /** Enum value Completed. */ - COMPLETED("Completed"), + /** Static value Completed for StageName. */ + public static final StageName COMPLETED = fromString("Completed"); - /** Enum value CompletedWithErrors. */ - COMPLETED_WITH_ERRORS("CompletedWithErrors"), + /** Static value CompletedWithErrors for StageName. */ + public static final StageName COMPLETED_WITH_ERRORS = fromString("CompletedWithErrors"); - /** Enum value Cancelled. */ - CANCELLED("Cancelled"), + /** Static value Cancelled for StageName. */ + public static final StageName CANCELLED = fromString("Cancelled"); - /** Enum value Failed_IssueReportedAtCustomer. */ - FAILED_ISSUE_REPORTED_AT_CUSTOMER("Failed_IssueReportedAtCustomer"), + /** Static value Failed_IssueReportedAtCustomer for StageName. */ + public static final StageName FAILED_ISSUE_REPORTED_AT_CUSTOMER = fromString("Failed_IssueReportedAtCustomer"); - /** Enum value Failed_IssueDetectedAtAzureDC. */ - FAILED_ISSUE_DETECTED_AT_AZURE_DC("Failed_IssueDetectedAtAzureDC"), + /** Static value Failed_IssueDetectedAtAzureDC for StageName. */ + public static final StageName FAILED_ISSUE_DETECTED_AT_AZURE_DC = fromString("Failed_IssueDetectedAtAzureDC"); - /** Enum value Aborted. */ - ABORTED("Aborted"), + /** Static value Aborted for StageName. */ + public static final StageName ABORTED = fromString("Aborted"); - /** Enum value CompletedWithWarnings. */ - COMPLETED_WITH_WARNINGS("CompletedWithWarnings"), + /** Static value CompletedWithWarnings for StageName. */ + public static final StageName COMPLETED_WITH_WARNINGS = fromString("CompletedWithWarnings"); - /** Enum value ReadyToDispatchFromAzureDC. */ - READY_TO_DISPATCH_FROM_AZURE_DC("ReadyToDispatchFromAzureDC"), + /** Static value ReadyToDispatchFromAzureDC for StageName. */ + public static final StageName READY_TO_DISPATCH_FROM_AZURE_DC = fromString("ReadyToDispatchFromAzureDC"); - /** Enum value ReadyToReceiveAtAzureDC. */ - READY_TO_RECEIVE_AT_AZURE_DC("ReadyToReceiveAtAzureDC"); + /** Static value ReadyToReceiveAtAzureDC for StageName. */ + public static final StageName READY_TO_RECEIVE_AT_AZURE_DC = fromString("ReadyToReceiveAtAzureDC"); - /** The actual serialized value for a StageName instance. */ - private final String value; + /** Static value Created for StageName. */ + public static final StageName CREATED = fromString("Created"); - StageName(String value) { - this.value = value; - } + /** Static value ShippedToAzureDC for StageName. */ + public static final StageName SHIPPED_TO_AZURE_DC = fromString("ShippedToAzureDC"); + + /** Static value AwaitingShipmentDetails for StageName. */ + public static final StageName AWAITING_SHIPMENT_DETAILS = fromString("AwaitingShipmentDetails"); + + /** Static value PreparingToShipFromAzureDC for StageName. */ + public static final StageName PREPARING_TO_SHIP_FROM_AZURE_DC = fromString("PreparingToShipFromAzureDC"); + + /** Static value ShippedToCustomer for StageName. */ + public static final StageName SHIPPED_TO_CUSTOMER = fromString("ShippedToCustomer"); /** - * Parses a serialized value to a StageName instance. + * Creates or finds a StageName from its string representation. * - * @param value the serialized value to parse. - * @return the parsed StageName object, or null if unable to parse. + * @param name a name to look for. + * @return the corresponding StageName. */ @JsonCreator - public static StageName fromString(String value) { - StageName[] items = StageName.values(); - for (StageName item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; + public static StageName fromString(String name) { + return fromString(name, StageName.class); } - @JsonValue - @Override - public String toString() { - return this.value; + /** @return known StageName values. */ + public static Collection values() { + return values(StageName.class); } } diff --git a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/StageStatus.java b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/StageStatus.java index 3ac5d3d6cfca0..c1a81b63c9aae 100644 --- a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/StageStatus.java +++ b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/StageStatus.java @@ -34,7 +34,16 @@ public enum StageStatus { WAITING_FOR_CUSTOMER_ACTION("WaitingForCustomerAction"), /** Enum value SucceededWithWarnings. */ - SUCCEEDED_WITH_WARNINGS("SucceededWithWarnings"); + SUCCEEDED_WITH_WARNINGS("SucceededWithWarnings"), + + /** Enum value WaitingForCustomerActionForKek. */ + WAITING_FOR_CUSTOMER_ACTION_FOR_KEK("WaitingForCustomerActionForKek"), + + /** Enum value WaitingForCustomerActionForCleanUp. */ + WAITING_FOR_CUSTOMER_ACTION_FOR_CLEAN_UP("WaitingForCustomerActionForCleanUp"), + + /** Enum value CustomerActionPerformedForCleanUp. */ + CUSTOMER_ACTION_PERFORMED_FOR_CLEAN_UP("CustomerActionPerformedForCleanUp"); /** The actual serialized value for a StageStatus instance. */ private final String value; diff --git a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/UpdateJobDetails.java b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/UpdateJobDetails.java index aa073ff928f76..627ee52fca99e 100644 --- a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/UpdateJobDetails.java +++ b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/UpdateJobDetails.java @@ -32,6 +32,12 @@ public final class UpdateJobDetails { @JsonProperty(value = "keyEncryptionKey") private KeyEncryptionKey keyEncryptionKey; + /* + * Return package details of job. + */ + @JsonProperty(value = "returnToCustomerPackageDetails") + private PackageCarrierDetails returnToCustomerPackageDetails; + /** * Get the contactDetails property: Contact details for notification and shipping. * @@ -92,6 +98,26 @@ public UpdateJobDetails withKeyEncryptionKey(KeyEncryptionKey keyEncryptionKey) return this; } + /** + * Get the returnToCustomerPackageDetails property: Return package details of job. + * + * @return the returnToCustomerPackageDetails value. + */ + public PackageCarrierDetails returnToCustomerPackageDetails() { + return this.returnToCustomerPackageDetails; + } + + /** + * Set the returnToCustomerPackageDetails property: Return package details of job. + * + * @param returnToCustomerPackageDetails the returnToCustomerPackageDetails value to set. + * @return the UpdateJobDetails object itself. + */ + public UpdateJobDetails withReturnToCustomerPackageDetails(PackageCarrierDetails returnToCustomerPackageDetails) { + this.returnToCustomerPackageDetails = returnToCustomerPackageDetails; + return this; + } + /** * Validates the instance. * @@ -107,5 +133,8 @@ public void validate() { if (keyEncryptionKey() != null) { keyEncryptionKey().validate(); } + if (returnToCustomerPackageDetails() != null) { + returnToCustomerPackageDetails().validate(); + } } } diff --git a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/ValidationInputResponse.java b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/ValidationInputResponse.java index be7fad543fddc..3d1fb1f2f6401 100644 --- a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/ValidationInputResponse.java +++ b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/ValidationInputResponse.java @@ -6,6 +6,7 @@ import com.azure.core.annotation.Immutable; import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.databox.fluent.models.AddressValidationProperties; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonSubTypes; diff --git a/sdk/databox/azure-resourcemanager-databox/src/samples/java/com/azure/resourcemanager/databox/generated/JobsBookShipmentPickUpSamples.java b/sdk/databox/azure-resourcemanager-databox/src/samples/java/com/azure/resourcemanager/databox/generated/JobsBookShipmentPickUpSamples.java new file mode 100644 index 0000000000000..6fbfafd00b2aa --- /dev/null +++ b/sdk/databox/azure-resourcemanager-databox/src/samples/java/com/azure/resourcemanager/databox/generated/JobsBookShipmentPickUpSamples.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.databox.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.databox.models.ShipmentPickUpRequest; +import java.time.OffsetDateTime; + +/** Samples for Jobs BookShipmentPickUp. */ +public final class JobsBookShipmentPickUpSamples { + /* + * x-ms-original-file: specification/databox/resource-manager/Microsoft.DataBox/preview/2021-08-01-preview/examples/BookShipmentPickupPost.json + */ + /** + * Sample code: BookShipmentPickupPost. + * + * @param manager Entry point to DataBoxManager. + */ + public static void bookShipmentPickupPost(com.azure.resourcemanager.databox.DataBoxManager manager) { + manager + .jobs() + .bookShipmentPickUpWithResponse( + "bvttoolrg6", + "TJ-636646322037905056", + new ShipmentPickUpRequest() + .withStartTime(OffsetDateTime.parse("2019-09-20T18:30:00Z")) + .withEndTime(OffsetDateTime.parse("2019-09-22T18:30:00Z")) + .withShipmentLocation("Front desk"), + Context.NONE); + } +} diff --git a/sdk/databox/azure-resourcemanager-databox/src/samples/java/com/azure/resourcemanager/databox/generated/JobsCancelSamples.java b/sdk/databox/azure-resourcemanager-databox/src/samples/java/com/azure/resourcemanager/databox/generated/JobsCancelSamples.java new file mode 100644 index 0000000000000..94b26d02c1d21 --- /dev/null +++ b/sdk/databox/azure-resourcemanager-databox/src/samples/java/com/azure/resourcemanager/databox/generated/JobsCancelSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.databox.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.databox.models.CancellationReason; + +/** Samples for Jobs Cancel. */ +public final class JobsCancelSamples { + /* + * x-ms-original-file: specification/databox/resource-manager/Microsoft.DataBox/preview/2021-08-01-preview/examples/JobsCancelPost.json + */ + /** + * Sample code: JobsCancelPost. + * + * @param manager Entry point to DataBoxManager. + */ + public static void jobsCancelPost(com.azure.resourcemanager.databox.DataBoxManager manager) { + manager + .jobs() + .cancelWithResponse( + "SdkRg5154", "SdkJob952", new CancellationReason().withReason("CancelTest"), Context.NONE); + } +} diff --git a/sdk/databox/azure-resourcemanager-databox/src/samples/java/com/azure/resourcemanager/databox/generated/JobsCreateSamples.java b/sdk/databox/azure-resourcemanager-databox/src/samples/java/com/azure/resourcemanager/databox/generated/JobsCreateSamples.java new file mode 100644 index 0000000000000..fcf51a5bcb09a --- /dev/null +++ b/sdk/databox/azure-resourcemanager-databox/src/samples/java/com/azure/resourcemanager/databox/generated/JobsCreateSamples.java @@ -0,0 +1,291 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.databox.generated; + +import com.azure.resourcemanager.databox.models.AddressType; +import com.azure.resourcemanager.databox.models.ContactDetails; +import com.azure.resourcemanager.databox.models.DataAccountType; +import com.azure.resourcemanager.databox.models.DataBoxJobDetails; +import com.azure.resourcemanager.databox.models.DataExportDetails; +import com.azure.resourcemanager.databox.models.DataImportDetails; +import com.azure.resourcemanager.databox.models.DoubleEncryption; +import com.azure.resourcemanager.databox.models.EncryptionPreferences; +import com.azure.resourcemanager.databox.models.Preferences; +import com.azure.resourcemanager.databox.models.ResourceIdentity; +import com.azure.resourcemanager.databox.models.ShippingAddress; +import com.azure.resourcemanager.databox.models.Sku; +import com.azure.resourcemanager.databox.models.SkuName; +import com.azure.resourcemanager.databox.models.StorageAccountDetails; +import com.azure.resourcemanager.databox.models.TransferAllDetails; +import com.azure.resourcemanager.databox.models.TransferConfiguration; +import com.azure.resourcemanager.databox.models.TransferConfigurationTransferAllDetails; +import com.azure.resourcemanager.databox.models.TransferConfigurationType; +import com.azure.resourcemanager.databox.models.TransferType; +import com.azure.resourcemanager.databox.models.UserAssignedIdentity; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Jobs Create. */ +public final class JobsCreateSamples { + /* + * x-ms-original-file: specification/databox/resource-manager/Microsoft.DataBox/preview/2021-08-01-preview/examples/JobsCreateDevicePassword.json + */ + /** + * Sample code: JobsCreateDevicePassword. + * + * @param manager Entry point to DataBoxManager. + */ + public static void jobsCreateDevicePassword(com.azure.resourcemanager.databox.DataBoxManager manager) { + manager + .jobs() + .define("SdkJob9640") + .withRegion("westus") + .withExistingResourceGroup("SdkRg7478") + .withSku(new Sku().withName(SkuName.DATA_BOX)) + .withTransferType(TransferType.IMPORT_TO_AZURE) + .withDetails( + new DataBoxJobDetails() + .withContactDetails( + new ContactDetails() + .withContactName("Public SDK Test") + .withPhone("1234567890") + .withPhoneExtension("1234") + .withEmailList(Arrays.asList("testing@microsoft.com"))) + .withShippingAddress( + new ShippingAddress() + .withStreetAddress1("16 TOWNSEND ST") + .withStreetAddress2("Unit 1") + .withCity("San Francisco") + .withStateOrProvince("CA") + .withCountry("US") + .withPostalCode("94107") + .withCompanyName("Microsoft") + .withAddressType(AddressType.COMMERCIAL)) + .withDataImportDetails( + Arrays + .asList( + new DataImportDetails() + .withAccountDetails( + new StorageAccountDetails() + .withSharePassword("") + .withStorageAccountId( + "/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourceGroups/databoxbvt1/providers/Microsoft.Storage/storageAccounts/databoxbvttestaccount2")))) + .withDevicePassword("")) + .create(); + } + + /* + * x-ms-original-file: specification/databox/resource-manager/Microsoft.DataBox/preview/2021-08-01-preview/examples/JobsCreate.json + */ + /** + * Sample code: JobsCreate. + * + * @param manager Entry point to DataBoxManager. + */ + public static void jobsCreate(com.azure.resourcemanager.databox.DataBoxManager manager) { + manager + .jobs() + .define("SdkJob952") + .withRegion("westus") + .withExistingResourceGroup("SdkRg5154") + .withSku(new Sku().withName(SkuName.DATA_BOX)) + .withTransferType(TransferType.IMPORT_TO_AZURE) + .withDetails( + new DataBoxJobDetails() + .withContactDetails( + new ContactDetails() + .withContactName("Public SDK Test") + .withPhone("1234567890") + .withPhoneExtension("1234") + .withEmailList(Arrays.asList("testing@microsoft.com"))) + .withShippingAddress( + new ShippingAddress() + .withStreetAddress1("16 TOWNSEND ST") + .withStreetAddress2("Unit 1") + .withCity("San Francisco") + .withStateOrProvince("CA") + .withCountry("US") + .withPostalCode("94107") + .withCompanyName("Microsoft") + .withAddressType(AddressType.COMMERCIAL)) + .withDataImportDetails( + Arrays + .asList( + new DataImportDetails() + .withAccountDetails( + new StorageAccountDetails() + .withStorageAccountId( + "/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourcegroups/databoxbvt/providers/Microsoft.Storage/storageAccounts/databoxbvttestaccount"))))) + .create(); + } + + /* + * x-ms-original-file: specification/databox/resource-manager/Microsoft.DataBox/preview/2021-08-01-preview/examples/JobsCreateDoubleEncryption.json + */ + /** + * Sample code: JobsCreateDoubleEncryption. + * + * @param manager Entry point to DataBoxManager. + */ + public static void jobsCreateDoubleEncryption(com.azure.resourcemanager.databox.DataBoxManager manager) { + manager + .jobs() + .define("SdkJob6599") + .withRegion("westus") + .withExistingResourceGroup("SdkRg608") + .withSku(new Sku().withName(SkuName.DATA_BOX)) + .withTransferType(TransferType.IMPORT_TO_AZURE) + .withDetails( + new DataBoxJobDetails() + .withContactDetails( + new ContactDetails() + .withContactName("Public SDK Test") + .withPhone("1234567890") + .withPhoneExtension("1234") + .withEmailList(Arrays.asList("testing@microsoft.com"))) + .withShippingAddress( + new ShippingAddress() + .withStreetAddress1("16 TOWNSEND ST") + .withStreetAddress2("Unit 1") + .withCity("San Francisco") + .withStateOrProvince("CA") + .withCountry("US") + .withPostalCode("94107") + .withCompanyName("Microsoft") + .withAddressType(AddressType.COMMERCIAL)) + .withDataImportDetails( + Arrays + .asList( + new DataImportDetails() + .withAccountDetails( + new StorageAccountDetails() + .withStorageAccountId( + "/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourcegroups/databoxbvt/providers/Microsoft.Storage/storageAccounts/databoxbvttestaccount")))) + .withPreferences( + new Preferences() + .withEncryptionPreferences( + new EncryptionPreferences().withDoubleEncryption(DoubleEncryption.ENABLED)))) + .create(); + } + + /* + * x-ms-original-file: specification/databox/resource-manager/Microsoft.DataBox/preview/2021-08-01-preview/examples/JobsCreateWithUserAssignedIdentity.json + */ + /** + * Sample code: JobsCreateWithUserAssignedIdentity. + * + * @param manager Entry point to DataBoxManager. + */ + public static void jobsCreateWithUserAssignedIdentity(com.azure.resourcemanager.databox.DataBoxManager manager) { + manager + .jobs() + .define("SdkJob5337") + .withRegion("westus") + .withExistingResourceGroup("SdkRg7552") + .withSku(new Sku().withName(SkuName.DATA_BOX)) + .withTransferType(TransferType.IMPORT_TO_AZURE) + .withIdentity( + new ResourceIdentity() + .withType("UserAssigned") + .withUserAssignedIdentities( + mapOf( + "/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourceGroups/akvenkat/providers/Microsoft.ManagedIdentity/userAssignedIdentities/sdkIdentity", + new UserAssignedIdentity()))) + .withDetails( + new DataBoxJobDetails() + .withContactDetails( + new ContactDetails() + .withContactName("Public SDK Test") + .withPhone("1234567890") + .withPhoneExtension("1234") + .withEmailList(Arrays.asList("testing@microsoft.com"))) + .withShippingAddress( + new ShippingAddress() + .withStreetAddress1("16 TOWNSEND ST") + .withStreetAddress2("Unit 1") + .withCity("San Francisco") + .withStateOrProvince("CA") + .withCountry("US") + .withPostalCode("94107") + .withCompanyName("Microsoft") + .withAddressType(AddressType.COMMERCIAL)) + .withDataImportDetails( + Arrays + .asList( + new DataImportDetails() + .withAccountDetails( + new StorageAccountDetails() + .withStorageAccountId( + "/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourceGroups/databoxbvt1/providers/Microsoft.Storage/storageAccounts/databoxbvttestaccount2"))))) + .create(); + } + + /* + * x-ms-original-file: specification/databox/resource-manager/Microsoft.DataBox/preview/2021-08-01-preview/examples/JobsCreateExport.json + */ + /** + * Sample code: JobsCreateExport. + * + * @param manager Entry point to DataBoxManager. + */ + public static void jobsCreateExport(com.azure.resourcemanager.databox.DataBoxManager manager) { + manager + .jobs() + .define("SdkJob6429") + .withRegion("westus") + .withExistingResourceGroup("SdkRg8091") + .withSku(new Sku().withName(SkuName.DATA_BOX)) + .withTransferType(TransferType.EXPORT_FROM_AZURE) + .withDetails( + new DataBoxJobDetails() + .withContactDetails( + new ContactDetails() + .withContactName("Public SDK Test") + .withPhone("1234567890") + .withPhoneExtension("1234") + .withEmailList(Arrays.asList("testing@microsoft.com"))) + .withShippingAddress( + new ShippingAddress() + .withStreetAddress1("16 TOWNSEND ST") + .withStreetAddress2("Unit 1") + .withCity("San Francisco") + .withStateOrProvince("CA") + .withCountry("US") + .withPostalCode("94107") + .withCompanyName("Microsoft") + .withAddressType(AddressType.COMMERCIAL)) + .withDataExportDetails( + Arrays + .asList( + new DataExportDetails() + .withTransferConfiguration( + new TransferConfiguration() + .withTransferConfigurationType(TransferConfigurationType.TRANSFER_ALL) + .withTransferAllDetails( + new TransferConfigurationTransferAllDetails() + .withInclude( + new TransferAllDetails() + .withDataAccountType(DataAccountType.STORAGE_ACCOUNT) + .withTransferAllBlobs(true) + .withTransferAllFiles(true)))) + .withAccountDetails( + new StorageAccountDetails() + .withStorageAccountId( + "/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourceGroups/akvenkat/providers/Microsoft.Storage/storageAccounts/aaaaaa2"))))) + .create(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/databox/azure-resourcemanager-databox/src/samples/java/com/azure/resourcemanager/databox/generated/JobsDeleteSamples.java b/sdk/databox/azure-resourcemanager-databox/src/samples/java/com/azure/resourcemanager/databox/generated/JobsDeleteSamples.java new file mode 100644 index 0000000000000..71b9a970460a8 --- /dev/null +++ b/sdk/databox/azure-resourcemanager-databox/src/samples/java/com/azure/resourcemanager/databox/generated/JobsDeleteSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.databox.generated; + +import com.azure.core.util.Context; + +/** Samples for Jobs Delete. */ +public final class JobsDeleteSamples { + /* + * x-ms-original-file: specification/databox/resource-manager/Microsoft.DataBox/preview/2021-08-01-preview/examples/JobsDelete.json + */ + /** + * Sample code: JobsDelete. + * + * @param manager Entry point to DataBoxManager. + */ + public static void jobsDelete(com.azure.resourcemanager.databox.DataBoxManager manager) { + manager.jobs().delete("SdkRg5154", "SdkJob952", Context.NONE); + } +} diff --git a/sdk/databox/azure-resourcemanager-databox/src/samples/java/com/azure/resourcemanager/databox/generated/JobsGetByResourceGroupSamples.java b/sdk/databox/azure-resourcemanager-databox/src/samples/java/com/azure/resourcemanager/databox/generated/JobsGetByResourceGroupSamples.java new file mode 100644 index 0000000000000..879df0201aaed --- /dev/null +++ b/sdk/databox/azure-resourcemanager-databox/src/samples/java/com/azure/resourcemanager/databox/generated/JobsGetByResourceGroupSamples.java @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.databox.generated; + +import com.azure.core.util.Context; + +/** Samples for Jobs GetByResourceGroup. */ +public final class JobsGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/databox/resource-manager/Microsoft.DataBox/preview/2021-08-01-preview/examples/JobsGet.json + */ + /** + * Sample code: JobsGet. + * + * @param manager Entry point to DataBoxManager. + */ + public static void jobsGet(com.azure.resourcemanager.databox.DataBoxManager manager) { + manager.jobs().getByResourceGroupWithResponse("SdkRg5154", "SdkJob952", "details", Context.NONE); + } + + /* + * x-ms-original-file: specification/databox/resource-manager/Microsoft.DataBox/preview/2021-08-01-preview/examples/JobsGetCmk.json + */ + /** + * Sample code: JobsGetCmk. + * + * @param manager Entry point to DataBoxManager. + */ + public static void jobsGetCmk(com.azure.resourcemanager.databox.DataBoxManager manager) { + manager.jobs().getByResourceGroupWithResponse("SdkRg7937", "SdkJob1735", "details", Context.NONE); + } + + /* + * x-ms-original-file: specification/databox/resource-manager/Microsoft.DataBox/preview/2021-08-01-preview/examples/JobsGetExport.json + */ + /** + * Sample code: JobsGetExport. + * + * @param manager Entry point to DataBoxManager. + */ + public static void jobsGetExport(com.azure.resourcemanager.databox.DataBoxManager manager) { + manager.jobs().getByResourceGroupWithResponse("SdkRg8091", "SdkJob6429", "details", Context.NONE); + } + + /* + * x-ms-original-file: specification/databox/resource-manager/Microsoft.DataBox/preview/2021-08-01-preview/examples/JobsGetCopyStuck.json + */ + /** + * Sample code: JobsGetCopyStuck. + * + * @param manager Entry point to DataBoxManager. + */ + public static void jobsGetCopyStuck(com.azure.resourcemanager.databox.DataBoxManager manager) { + manager + .jobs() + .getByResourceGroupWithResponse("dmstestresource", "TJx-637505258985313014", "details", Context.NONE); + } + + /* + * x-ms-original-file: specification/databox/resource-manager/Microsoft.DataBox/preview/2021-08-01-preview/examples/JobsGetWaitingForAction.json + */ + /** + * Sample code: JobsGetWaitingForAction. + * + * @param manager Entry point to DataBoxManager. + */ + public static void jobsGetWaitingForAction(com.azure.resourcemanager.databox.DataBoxManager manager) { + manager + .jobs() + .getByResourceGroupWithResponse("dmstestresource", "TJx-637505258985313014", "details", Context.NONE); + } +} diff --git a/sdk/databox/azure-resourcemanager-databox/src/samples/java/com/azure/resourcemanager/databox/generated/JobsListByResourceGroupSamples.java b/sdk/databox/azure-resourcemanager-databox/src/samples/java/com/azure/resourcemanager/databox/generated/JobsListByResourceGroupSamples.java new file mode 100644 index 0000000000000..ac95fbcccd658 --- /dev/null +++ b/sdk/databox/azure-resourcemanager-databox/src/samples/java/com/azure/resourcemanager/databox/generated/JobsListByResourceGroupSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.databox.generated; + +import com.azure.core.util.Context; + +/** Samples for Jobs ListByResourceGroup. */ +public final class JobsListByResourceGroupSamples { + /* + * x-ms-original-file: specification/databox/resource-manager/Microsoft.DataBox/preview/2021-08-01-preview/examples/JobsListByResourceGroup.json + */ + /** + * Sample code: JobsListByResourceGroup. + * + * @param manager Entry point to DataBoxManager. + */ + public static void jobsListByResourceGroup(com.azure.resourcemanager.databox.DataBoxManager manager) { + manager.jobs().listByResourceGroup("SdkRg5154", null, Context.NONE); + } +} diff --git a/sdk/databox/azure-resourcemanager-databox/src/samples/java/com/azure/resourcemanager/databox/generated/JobsListCredentialsSamples.java b/sdk/databox/azure-resourcemanager-databox/src/samples/java/com/azure/resourcemanager/databox/generated/JobsListCredentialsSamples.java new file mode 100644 index 0000000000000..a23cd5c757605 --- /dev/null +++ b/sdk/databox/azure-resourcemanager-databox/src/samples/java/com/azure/resourcemanager/databox/generated/JobsListCredentialsSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.databox.generated; + +import com.azure.core.util.Context; + +/** Samples for Jobs ListCredentials. */ +public final class JobsListCredentialsSamples { + /* + * x-ms-original-file: specification/databox/resource-manager/Microsoft.DataBox/preview/2021-08-01-preview/examples/JobsListCredentials.json + */ + /** + * Sample code: JobsListCredentials. + * + * @param manager Entry point to DataBoxManager. + */ + public static void jobsListCredentials(com.azure.resourcemanager.databox.DataBoxManager manager) { + manager.jobs().listCredentials("bvttoolrg6", "TJ-636646322037905056", Context.NONE); + } +} diff --git a/sdk/databox/azure-resourcemanager-databox/src/samples/java/com/azure/resourcemanager/databox/generated/JobsListSamples.java b/sdk/databox/azure-resourcemanager-databox/src/samples/java/com/azure/resourcemanager/databox/generated/JobsListSamples.java new file mode 100644 index 0000000000000..af963136fd7bf --- /dev/null +++ b/sdk/databox/azure-resourcemanager-databox/src/samples/java/com/azure/resourcemanager/databox/generated/JobsListSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.databox.generated; + +import com.azure.core.util.Context; + +/** Samples for Jobs List. */ +public final class JobsListSamples { + /* + * x-ms-original-file: specification/databox/resource-manager/Microsoft.DataBox/preview/2021-08-01-preview/examples/JobsList.json + */ + /** + * Sample code: JobsList. + * + * @param manager Entry point to DataBoxManager. + */ + public static void jobsList(com.azure.resourcemanager.databox.DataBoxManager manager) { + manager.jobs().list(null, Context.NONE); + } +} diff --git a/sdk/databox/azure-resourcemanager-databox/src/samples/java/com/azure/resourcemanager/databox/generated/JobsMarkDevicesShippedSamples.java b/sdk/databox/azure-resourcemanager-databox/src/samples/java/com/azure/resourcemanager/databox/generated/JobsMarkDevicesShippedSamples.java new file mode 100644 index 0000000000000..c23d1194935ea --- /dev/null +++ b/sdk/databox/azure-resourcemanager-databox/src/samples/java/com/azure/resourcemanager/databox/generated/JobsMarkDevicesShippedSamples.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.databox.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.databox.models.MarkDevicesShippedRequest; +import com.azure.resourcemanager.databox.models.PackageCarrierInfo; + +/** Samples for Jobs MarkDevicesShipped. */ +public final class JobsMarkDevicesShippedSamples { + /* + * x-ms-original-file: specification/databox/resource-manager/Microsoft.DataBox/preview/2021-08-01-preview/examples/MarkDevicesShipped.json + */ + /** + * Sample code: MarkDevicesShipped. + * + * @param manager Entry point to DataBoxManager. + */ + public static void markDevicesShipped(com.azure.resourcemanager.databox.DataBoxManager manager) { + manager + .jobs() + .markDevicesShippedWithResponse( + "SdkJob8367", + "SdkRg9836", + new MarkDevicesShippedRequest() + .withDeliverToDcPackageDetails( + new PackageCarrierInfo().withCarrierName("DHL").withTrackingId("123456")), + Context.NONE); + } +} diff --git a/sdk/databox/azure-resourcemanager-databox/src/samples/java/com/azure/resourcemanager/databox/generated/JobsUpdateSamples.java b/sdk/databox/azure-resourcemanager-databox/src/samples/java/com/azure/resourcemanager/databox/generated/JobsUpdateSamples.java new file mode 100644 index 0000000000000..a7b86bf2d4b3d --- /dev/null +++ b/sdk/databox/azure-resourcemanager-databox/src/samples/java/com/azure/resourcemanager/databox/generated/JobsUpdateSamples.java @@ -0,0 +1,131 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.databox.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.databox.models.AddressType; +import com.azure.resourcemanager.databox.models.ContactDetails; +import com.azure.resourcemanager.databox.models.IdentityProperties; +import com.azure.resourcemanager.databox.models.JobResource; +import com.azure.resourcemanager.databox.models.KekType; +import com.azure.resourcemanager.databox.models.KeyEncryptionKey; +import com.azure.resourcemanager.databox.models.ResourceIdentity; +import com.azure.resourcemanager.databox.models.ShippingAddress; +import com.azure.resourcemanager.databox.models.UpdateJobDetails; +import com.azure.resourcemanager.databox.models.UserAssignedIdentity; +import com.azure.resourcemanager.databox.models.UserAssignedProperties; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Jobs Update. */ +public final class JobsUpdateSamples { + /* + * x-ms-original-file: specification/databox/resource-manager/Microsoft.DataBox/preview/2021-08-01-preview/examples/JobsPatchCmk.json + */ + /** + * Sample code: JobsPatchCmk. + * + * @param manager Entry point to DataBoxManager. + */ + public static void jobsPatchCmk(com.azure.resourcemanager.databox.DataBoxManager manager) { + JobResource resource = + manager.jobs().getByResourceGroupWithResponse("SdkRg7937", "SdkJob1735", null, Context.NONE).getValue(); + resource + .update() + .withDetails( + new UpdateJobDetails() + .withKeyEncryptionKey( + new KeyEncryptionKey() + .withKekType(KekType.CUSTOMER_MANAGED) + .withKekUrl("https://sdkkeyvault.vault.azure.net/keys/SSDKEY/") + .withKekVaultResourceId( + "/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourceGroups/akvenkat/providers/Microsoft.KeyVault/vaults/SDKKeyVault"))) + .apply(); + } + + /* + * x-ms-original-file: specification/databox/resource-manager/Microsoft.DataBox/preview/2021-08-01-preview/examples/JobsPatchSystemAssignedToUserAssigned.json + */ + /** + * Sample code: JobsPatchSystemAssignedToUserAssigned. + * + * @param manager Entry point to DataBoxManager. + */ + public static void jobsPatchSystemAssignedToUserAssigned(com.azure.resourcemanager.databox.DataBoxManager manager) { + JobResource resource = + manager.jobs().getByResourceGroupWithResponse("SdkRg9765", "SdkJob2965", null, Context.NONE).getValue(); + resource + .update() + .withIdentity( + new ResourceIdentity() + .withType("SystemAssigned,UserAssigned") + .withUserAssignedIdentities( + mapOf( + "/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourceGroups/akvenkat/providers/Microsoft.ManagedIdentity/userAssignedIdentities/sdkIdentity", + new UserAssignedIdentity()))) + .withDetails( + new UpdateJobDetails() + .withKeyEncryptionKey( + new KeyEncryptionKey() + .withKekType(KekType.CUSTOMER_MANAGED) + .withIdentityProperties( + new IdentityProperties() + .withType("UserAssigned") + .withUserAssigned( + new UserAssignedProperties() + .withResourceId( + "/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourceGroups/akvenkat/providers/Microsoft.ManagedIdentity/userAssignedIdentities/sdkIdentity"))) + .withKekUrl("https://sdkkeyvault.vault.azure.net/keys/SSDKEY/") + .withKekVaultResourceId( + "/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourceGroups/akvenkat/providers/Microsoft.KeyVault/vaults/SDKKeyVault"))) + .apply(); + } + + /* + * x-ms-original-file: specification/databox/resource-manager/Microsoft.DataBox/preview/2021-08-01-preview/examples/JobsPatch.json + */ + /** + * Sample code: JobsPatch. + * + * @param manager Entry point to DataBoxManager. + */ + public static void jobsPatch(com.azure.resourcemanager.databox.DataBoxManager manager) { + JobResource resource = + manager.jobs().getByResourceGroupWithResponse("SdkRg5154", "SdkJob952", "details", Context.NONE).getValue(); + resource + .update() + .withDetails( + new UpdateJobDetails() + .withContactDetails( + new ContactDetails() + .withContactName("Update Job") + .withPhone("1234567890") + .withPhoneExtension("1234") + .withEmailList(Arrays.asList("testing@microsoft.com"))) + .withShippingAddress( + new ShippingAddress() + .withStreetAddress1("16 TOWNSEND ST") + .withStreetAddress2("Unit 1") + .withCity("San Francisco") + .withStateOrProvince("CA") + .withCountry("US") + .withPostalCode("94107") + .withCompanyName("Microsoft") + .withAddressType(AddressType.COMMERCIAL))) + .apply(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/databox/azure-resourcemanager-databox/src/samples/java/com/azure/resourcemanager/databox/generated/OperationsListSamples.java b/sdk/databox/azure-resourcemanager-databox/src/samples/java/com/azure/resourcemanager/databox/generated/OperationsListSamples.java new file mode 100644 index 0000000000000..30f7c7ef3229c --- /dev/null +++ b/sdk/databox/azure-resourcemanager-databox/src/samples/java/com/azure/resourcemanager/databox/generated/OperationsListSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.databox.generated; + +import com.azure.core.util.Context; + +/** Samples for Operations List. */ +public final class OperationsListSamples { + /* + * x-ms-original-file: specification/databox/resource-manager/Microsoft.DataBox/preview/2021-08-01-preview/examples/OperationsGet.json + */ + /** + * Sample code: OperationsGet. + * + * @param manager Entry point to DataBoxManager. + */ + public static void operationsGet(com.azure.resourcemanager.databox.DataBoxManager manager) { + manager.operations().list(Context.NONE); + } +} diff --git a/sdk/databox/azure-resourcemanager-databox/src/samples/java/com/azure/resourcemanager/databox/generated/ResourceProviderMitigateSamples.java b/sdk/databox/azure-resourcemanager-databox/src/samples/java/com/azure/resourcemanager/databox/generated/ResourceProviderMitigateSamples.java new file mode 100644 index 0000000000000..6693113de25ee --- /dev/null +++ b/sdk/databox/azure-resourcemanager-databox/src/samples/java/com/azure/resourcemanager/databox/generated/ResourceProviderMitigateSamples.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.databox.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.databox.models.CustomerResolutionCode; +import com.azure.resourcemanager.databox.models.MitigateJobRequest; + +/** Samples for ResourceProvider Mitigate. */ +public final class ResourceProviderMitigateSamples { + /* + * x-ms-original-file: specification/databox/resource-manager/Microsoft.DataBox/preview/2021-08-01-preview/examples/JobMitigate.json + */ + /** + * Sample code: Mitigate. + * + * @param manager Entry point to DataBoxManager. + */ + public static void mitigate(com.azure.resourcemanager.databox.DataBoxManager manager) { + manager + .resourceProviders() + .mitigateWithResponse( + "SdkJob8367", + "SdkRg9836", + new MitigateJobRequest().withCustomerResolutionCode(CustomerResolutionCode.MOVE_TO_CLEAN_UP_DEVICE), + Context.NONE); + } +} diff --git a/sdk/databox/azure-resourcemanager-databox/src/samples/java/com/azure/resourcemanager/databox/generated/ServiceListAvailableSkusByResourceGroupSamples.java b/sdk/databox/azure-resourcemanager-databox/src/samples/java/com/azure/resourcemanager/databox/generated/ServiceListAvailableSkusByResourceGroupSamples.java new file mode 100644 index 0000000000000..688a689dc42ca --- /dev/null +++ b/sdk/databox/azure-resourcemanager-databox/src/samples/java/com/azure/resourcemanager/databox/generated/ServiceListAvailableSkusByResourceGroupSamples.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.databox.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.databox.models.AvailableSkuRequest; +import com.azure.resourcemanager.databox.models.TransferType; + +/** Samples for Service ListAvailableSkusByResourceGroup. */ +public final class ServiceListAvailableSkusByResourceGroupSamples { + /* + * x-ms-original-file: specification/databox/resource-manager/Microsoft.DataBox/preview/2021-08-01-preview/examples/AvailableSkusPost.json + */ + /** + * Sample code: AvailableSkusPost. + * + * @param manager Entry point to DataBoxManager. + */ + public static void availableSkusPost(com.azure.resourcemanager.databox.DataBoxManager manager) { + manager + .services() + .listAvailableSkusByResourceGroup( + "bvttoolrg6", + "westus", + new AvailableSkuRequest() + .withTransferType(TransferType.IMPORT_TO_AZURE) + .withCountry("US") + .withLocation("westus"), + Context.NONE); + } +} diff --git a/sdk/databox/azure-resourcemanager-databox/src/samples/java/com/azure/resourcemanager/databox/generated/ServiceRegionConfigurationByResourceGroupSamples.java b/sdk/databox/azure-resourcemanager-databox/src/samples/java/com/azure/resourcemanager/databox/generated/ServiceRegionConfigurationByResourceGroupSamples.java new file mode 100644 index 0000000000000..511ad8c14deb9 --- /dev/null +++ b/sdk/databox/azure-resourcemanager-databox/src/samples/java/com/azure/resourcemanager/databox/generated/ServiceRegionConfigurationByResourceGroupSamples.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.databox.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.databox.models.DataBoxScheduleAvailabilityRequest; +import com.azure.resourcemanager.databox.models.RegionConfigurationRequest; + +/** Samples for Service RegionConfigurationByResourceGroup. */ +public final class ServiceRegionConfigurationByResourceGroupSamples { + /* + * x-ms-original-file: specification/databox/resource-manager/Microsoft.DataBox/preview/2021-08-01-preview/examples/RegionConfigurationByResourceGroup.json + */ + /** + * Sample code: RegionConfigurationByResourceGroup. + * + * @param manager Entry point to DataBoxManager. + */ + public static void regionConfigurationByResourceGroup(com.azure.resourcemanager.databox.DataBoxManager manager) { + manager + .services() + .regionConfigurationByResourceGroupWithResponse( + "SdkRg4981", + "westus", + new RegionConfigurationRequest() + .withScheduleAvailabilityRequest( + new DataBoxScheduleAvailabilityRequest().withStorageLocation("westus")), + Context.NONE); + } +} diff --git a/sdk/databox/azure-resourcemanager-databox/src/samples/java/com/azure/resourcemanager/databox/generated/ServiceRegionConfigurationSamples.java b/sdk/databox/azure-resourcemanager-databox/src/samples/java/com/azure/resourcemanager/databox/generated/ServiceRegionConfigurationSamples.java new file mode 100644 index 0000000000000..ad26d07b4b10d --- /dev/null +++ b/sdk/databox/azure-resourcemanager-databox/src/samples/java/com/azure/resourcemanager/databox/generated/ServiceRegionConfigurationSamples.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.databox.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.databox.models.DataBoxScheduleAvailabilityRequest; +import com.azure.resourcemanager.databox.models.RegionConfigurationRequest; + +/** Samples for Service RegionConfiguration. */ +public final class ServiceRegionConfigurationSamples { + /* + * x-ms-original-file: specification/databox/resource-manager/Microsoft.DataBox/preview/2021-08-01-preview/examples/RegionConfiguration.json + */ + /** + * Sample code: RegionConfiguration. + * + * @param manager Entry point to DataBoxManager. + */ + public static void regionConfiguration(com.azure.resourcemanager.databox.DataBoxManager manager) { + manager + .services() + .regionConfigurationWithResponse( + "westus", + new RegionConfigurationRequest() + .withScheduleAvailabilityRequest( + new DataBoxScheduleAvailabilityRequest().withStorageLocation("westus")), + Context.NONE); + } +} diff --git a/sdk/databox/azure-resourcemanager-databox/src/samples/java/com/azure/resourcemanager/databox/generated/ServiceValidateAddressSamples.java b/sdk/databox/azure-resourcemanager-databox/src/samples/java/com/azure/resourcemanager/databox/generated/ServiceValidateAddressSamples.java new file mode 100644 index 0000000000000..bcfc1b2e08686 --- /dev/null +++ b/sdk/databox/azure-resourcemanager-databox/src/samples/java/com/azure/resourcemanager/databox/generated/ServiceValidateAddressSamples.java @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.databox.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.databox.models.AddressType; +import com.azure.resourcemanager.databox.models.ShippingAddress; +import com.azure.resourcemanager.databox.models.SkuName; +import com.azure.resourcemanager.databox.models.ValidateAddress; + +/** Samples for Service ValidateAddress. */ +public final class ServiceValidateAddressSamples { + /* + * x-ms-original-file: specification/databox/resource-manager/Microsoft.DataBox/preview/2021-08-01-preview/examples/ValidateAddressPost.json + */ + /** + * Sample code: ValidateAddressPost. + * + * @param manager Entry point to DataBoxManager. + */ + public static void validateAddressPost(com.azure.resourcemanager.databox.DataBoxManager manager) { + manager + .services() + .validateAddressWithResponse( + "westus", + new ValidateAddress() + .withShippingAddress( + new ShippingAddress() + .withStreetAddress1("16 TOWNSEND ST") + .withStreetAddress2("Unit 1") + .withCity("San Francisco") + .withStateOrProvince("CA") + .withCountry("US") + .withPostalCode("94107") + .withCompanyName("Microsoft") + .withAddressType(AddressType.COMMERCIAL)) + .withDeviceType(SkuName.DATA_BOX), + Context.NONE); + } +} diff --git a/sdk/databox/azure-resourcemanager-databox/src/samples/java/com/azure/resourcemanager/databox/generated/ServiceValidateInputsByResourceGroupSamples.java b/sdk/databox/azure-resourcemanager-databox/src/samples/java/com/azure/resourcemanager/databox/generated/ServiceValidateInputsByResourceGroupSamples.java new file mode 100644 index 0000000000000..f988fcfd3d390 --- /dev/null +++ b/sdk/databox/azure-resourcemanager-databox/src/samples/java/com/azure/resourcemanager/databox/generated/ServiceValidateInputsByResourceGroupSamples.java @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.databox.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.databox.models.AddressType; +import com.azure.resourcemanager.databox.models.CreateJobValidations; +import com.azure.resourcemanager.databox.models.CreateOrderLimitForSubscriptionValidationRequest; +import com.azure.resourcemanager.databox.models.DataImportDetails; +import com.azure.resourcemanager.databox.models.DataTransferDetailsValidationRequest; +import com.azure.resourcemanager.databox.models.Preferences; +import com.azure.resourcemanager.databox.models.PreferencesValidationRequest; +import com.azure.resourcemanager.databox.models.ShippingAddress; +import com.azure.resourcemanager.databox.models.SkuAvailabilityValidationRequest; +import com.azure.resourcemanager.databox.models.SkuName; +import com.azure.resourcemanager.databox.models.StorageAccountDetails; +import com.azure.resourcemanager.databox.models.SubscriptionIsAllowedToCreateJobValidationRequest; +import com.azure.resourcemanager.databox.models.TransferType; +import com.azure.resourcemanager.databox.models.TransportPreferences; +import com.azure.resourcemanager.databox.models.TransportShipmentTypes; +import com.azure.resourcemanager.databox.models.ValidateAddress; +import java.util.Arrays; + +/** Samples for Service ValidateInputsByResourceGroup. */ +public final class ServiceValidateInputsByResourceGroupSamples { + /* + * x-ms-original-file: specification/databox/resource-manager/Microsoft.DataBox/preview/2021-08-01-preview/examples/ValidateInputsByResourceGroup.json + */ + /** + * Sample code: ValidateInputsByResourceGroup. + * + * @param manager Entry point to DataBoxManager. + */ + public static void validateInputsByResourceGroup(com.azure.resourcemanager.databox.DataBoxManager manager) { + manager + .services() + .validateInputsByResourceGroupWithResponse( + "SdkRg6861", + "westus", + new CreateJobValidations() + .withIndividualRequestDetails( + Arrays + .asList( + new DataTransferDetailsValidationRequest() + .withDataImportDetails( + Arrays + .asList( + new DataImportDetails() + .withAccountDetails( + new StorageAccountDetails() + .withStorageAccountId( + "/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourcegroups/databoxbvt/providers/Microsoft.Storage/storageAccounts/databoxbvttestaccount")))) + .withDeviceType(SkuName.DATA_BOX) + .withTransferType(TransferType.IMPORT_TO_AZURE), + new ValidateAddress() + .withShippingAddress( + new ShippingAddress() + .withStreetAddress1("16 TOWNSEND ST") + .withStreetAddress2("Unit 1") + .withCity("San Francisco") + .withStateOrProvince("CA") + .withCountry("US") + .withPostalCode("94107") + .withCompanyName("Microsoft") + .withAddressType(AddressType.COMMERCIAL)) + .withDeviceType(SkuName.DATA_BOX) + .withTransportPreferences( + new TransportPreferences() + .withPreferredShipmentType(TransportShipmentTypes.MICROSOFT_MANAGED)), + new SubscriptionIsAllowedToCreateJobValidationRequest(), + new SkuAvailabilityValidationRequest() + .withDeviceType(SkuName.DATA_BOX) + .withTransferType(TransferType.IMPORT_TO_AZURE) + .withCountry("US") + .withLocation("westus"), + new CreateOrderLimitForSubscriptionValidationRequest().withDeviceType(SkuName.DATA_BOX), + new PreferencesValidationRequest() + .withPreference( + new Preferences() + .withTransportPreferences( + new TransportPreferences() + .withPreferredShipmentType( + TransportShipmentTypes.MICROSOFT_MANAGED))) + .withDeviceType(SkuName.DATA_BOX))), + Context.NONE); + } +} diff --git a/sdk/databox/azure-resourcemanager-databox/src/samples/java/com/azure/resourcemanager/databox/generated/ServiceValidateInputsSamples.java b/sdk/databox/azure-resourcemanager-databox/src/samples/java/com/azure/resourcemanager/databox/generated/ServiceValidateInputsSamples.java new file mode 100644 index 0000000000000..dcef976d1e9d7 --- /dev/null +++ b/sdk/databox/azure-resourcemanager-databox/src/samples/java/com/azure/resourcemanager/databox/generated/ServiceValidateInputsSamples.java @@ -0,0 +1,88 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.databox.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.databox.models.AddressType; +import com.azure.resourcemanager.databox.models.CreateJobValidations; +import com.azure.resourcemanager.databox.models.CreateOrderLimitForSubscriptionValidationRequest; +import com.azure.resourcemanager.databox.models.DataImportDetails; +import com.azure.resourcemanager.databox.models.DataTransferDetailsValidationRequest; +import com.azure.resourcemanager.databox.models.Preferences; +import com.azure.resourcemanager.databox.models.PreferencesValidationRequest; +import com.azure.resourcemanager.databox.models.ShippingAddress; +import com.azure.resourcemanager.databox.models.SkuAvailabilityValidationRequest; +import com.azure.resourcemanager.databox.models.SkuName; +import com.azure.resourcemanager.databox.models.StorageAccountDetails; +import com.azure.resourcemanager.databox.models.SubscriptionIsAllowedToCreateJobValidationRequest; +import com.azure.resourcemanager.databox.models.TransferType; +import com.azure.resourcemanager.databox.models.TransportPreferences; +import com.azure.resourcemanager.databox.models.TransportShipmentTypes; +import com.azure.resourcemanager.databox.models.ValidateAddress; +import java.util.Arrays; + +/** Samples for Service ValidateInputs. */ +public final class ServiceValidateInputsSamples { + /* + * x-ms-original-file: specification/databox/resource-manager/Microsoft.DataBox/preview/2021-08-01-preview/examples/ValidateInputs.json + */ + /** + * Sample code: ValidateInputs. + * + * @param manager Entry point to DataBoxManager. + */ + public static void validateInputs(com.azure.resourcemanager.databox.DataBoxManager manager) { + manager + .services() + .validateInputsWithResponse( + "westus", + new CreateJobValidations() + .withIndividualRequestDetails( + Arrays + .asList( + new DataTransferDetailsValidationRequest() + .withDataImportDetails( + Arrays + .asList( + new DataImportDetails() + .withAccountDetails( + new StorageAccountDetails() + .withStorageAccountId( + "/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourcegroups/databoxbvt/providers/Microsoft.Storage/storageAccounts/databoxbvttestaccount")))) + .withDeviceType(SkuName.DATA_BOX) + .withTransferType(TransferType.IMPORT_TO_AZURE), + new ValidateAddress() + .withShippingAddress( + new ShippingAddress() + .withStreetAddress1("16 TOWNSEND ST") + .withStreetAddress2("Unit 1") + .withCity("San Francisco") + .withStateOrProvince("CA") + .withCountry("US") + .withPostalCode("94107") + .withCompanyName("Microsoft") + .withAddressType(AddressType.COMMERCIAL)) + .withDeviceType(SkuName.DATA_BOX) + .withTransportPreferences( + new TransportPreferences() + .withPreferredShipmentType(TransportShipmentTypes.MICROSOFT_MANAGED)), + new SubscriptionIsAllowedToCreateJobValidationRequest(), + new SkuAvailabilityValidationRequest() + .withDeviceType(SkuName.DATA_BOX) + .withTransferType(TransferType.IMPORT_TO_AZURE) + .withCountry("US") + .withLocation("westus"), + new CreateOrderLimitForSubscriptionValidationRequest().withDeviceType(SkuName.DATA_BOX), + new PreferencesValidationRequest() + .withPreference( + new Preferences() + .withTransportPreferences( + new TransportPreferences() + .withPreferredShipmentType( + TransportShipmentTypes.MICROSOFT_MANAGED))) + .withDeviceType(SkuName.DATA_BOX))), + Context.NONE); + } +}