From 3a3913c07d47eb93b6db6c85f56c252c0fd7243d Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Tue, 20 Sep 2022 04:47:38 +0000 Subject: [PATCH] CodeGen from PR 20779 in Azure/azure-rest-api-specs Merge 768472b52ec477ce9434fe5ff0f6b9e7bd9ce1c5 into 3751f321654db00858e70649291af5c81e94611e --- .../CHANGELOG.md | 3 +- .../azure-resourcemanager-databox/README.md | 7 +- .../azure-resourcemanager-databox/SAMPLE.md | 1056 +++++++++++++++++ .../azure-resourcemanager-databox/pom.xml | 98 +- .../databox/DataBoxManager.java | 105 +- .../databox/fluent/JobsClient.java | 75 +- .../databox/fluent/OperationsClient.java | 4 +- .../fluent/ResourceProvidersClient.java | 2 +- .../databox/fluent/ServicesClient.java | 14 +- .../models/AddressValidationOutputInner.java | 54 +- .../models/AddressValidationProperties.java | 9 +- .../databox/fluent/models/JobProperties.java | 283 +++++ .../fluent/models/JobResourceInner.java | 275 ++--- .../databox/fluent/models/OperationInner.java | 7 +- .../RegionConfigurationResponseInner.java | 23 +- .../models/ShipmentPickUpResponseInner.java | 7 +- .../fluent/models/SkuInformationInner.java | 83 +- .../databox/fluent/models/SkuProperties.java | 139 +++ .../models/UnencryptedCredentialsInner.java | 4 - .../fluent/models/UpdateJobProperties.java | 50 + .../models/ValidationResponseInner.java | 34 +- .../models/ValidationResponseProperties.java | 57 + .../AddressValidationOutputImpl.java | 8 +- .../DataBoxManagementClientBuilder.java | 62 +- .../DataBoxManagementClientImpl.java | 15 +- .../implementation/JobResourceImpl.java | 60 +- .../implementation/JobsClientImpl.java | 405 +++++-- .../databox/implementation/JobsImpl.java | 35 +- .../implementation/OperationsClientImpl.java | 25 +- .../implementation/OperationsImpl.java | 3 +- .../RegionConfigurationResponseImpl.java | 5 + .../ResourceProvidersClientImpl.java | 13 +- .../implementation/ResourceProvidersImpl.java | 3 +- .../implementation/ServicesClientImpl.java | 124 +- .../databox/implementation/ServicesImpl.java | 3 +- .../databox/models/AccessProtocol.java | 4 + .../models/AccountCredentialDetails.java | 7 +- .../databox/models/AdditionalErrorInfo.java | 50 +- .../databox/models/AddressType.java | 6 +- .../models/AddressValidationOutput.java | 14 +- .../models/AddressValidationStatus.java | 6 +- .../models/ApplianceNetworkConfiguration.java | 4 - .../databox/models/AvailableSkuRequest.java | 11 +- .../databox/models/AvailableSkusResult.java | 4 - .../models/AzureFileFilterDetails.java | 4 - .../databox/models/BlobFilterDetails.java | 4 - .../databox/models/CancellationReason.java | 7 +- .../databox/models/ClassDiscriminator.java | 11 +- .../databox/models/CloudError.java | 84 +- .../databox/models/ContactDetails.java | 11 +- .../databox/models/CopyLogDetails.java | 5 +- .../databox/models/CopyProgress.java | 18 +- .../databox/models/CopyStatus.java | 102 +- .../databox/models/CreateJobValidations.java | 8 +- ...LimitForSubscriptionValidationRequest.java | 8 +- ...scriptionValidationResponseProperties.java | 6 - .../models/CustomerDiskJobSecrets.java | 60 + .../models/CustomerResolutionCode.java | 12 +- .../databox/models/DataAccountDetails.java | 17 +- .../databox/models/DataAccountType.java | 6 +- .../models/DataBoxAccountCopyLogDetails.java | 7 +- .../DataBoxCustomerDiskCopyLogDetails.java | 71 ++ .../DataBoxCustomerDiskCopyProgress.java | 52 + .../models/DataBoxCustomerDiskJobDetails.java | 248 ++++ .../models/DataBoxDiskCopyLogDetails.java | 4 - .../models/DataBoxDiskCopyProgress.java | 4 - .../DataBoxDiskGranularCopyLogDetails.java | 86 ++ .../DataBoxDiskGranularCopyProgress.java | 52 + .../databox/models/DataBoxDiskJobDetails.java | 52 +- .../databox/models/DataBoxDiskJobSecrets.java | 4 - .../DataBoxHeavyAccountCopyLogDetails.java | 7 +- .../models/DataBoxHeavyJobDetails.java | 17 +- .../models/DataBoxHeavyJobSecrets.java | 4 - .../databox/models/DataBoxHeavySecret.java | 4 - .../databox/models/DataBoxJobDetails.java | 17 +- .../DataBoxScheduleAvailabilityRequest.java | 8 +- .../databox/models/DataBoxSecret.java | 4 - .../databox/models/DataCenterCode.java | 209 ++++ .../databox/models/DataExportDetails.java | 9 +- .../databox/models/DataImportDetails.java | 33 +- .../DataLocationToServiceLocationMap.java | 4 - .../DataTransferDetailsValidationRequest.java | 9 +- ...erDetailsValidationResponseProperties.java | 5 - .../databox/models/DataboxJobSecrets.java | 4 - .../DatacenterAddressInstructionResponse.java | 41 + .../DatacenterAddressLocationResponse.java | 221 ++++ .../models/DatacenterAddressRequest.java | 90 ++ .../models/DatacenterAddressResponse.java | 64 + .../databox/models/DatacenterAddressType.java | 51 + .../databox/models/DcAccessSecurityCode.java | 4 - .../databox/models/DeviceErasureDetails.java | 51 + .../DiskScheduleAvailabilityRequest.java | 7 +- .../databox/models/DiskSecret.java | 7 +- .../databox/models/DoubleEncryption.java | 6 +- .../databox/models/EncryptionPreferences.java | 4 - .../databox/models/ExportDiskDetails.java | 66 ++ .../databox/models/FilterFileDetails.java | 9 +- .../databox/models/FilterFileType.java | 6 +- .../models/GranularCopyLogDetails.java | 29 + .../databox/models/GranularCopyProgress.java | 251 ++++ .../HeavyScheduleAvailabilityRequest.java | 8 +- .../databox/models/IdentityProperties.java | 4 - .../databox/models/ImportDiskDetails.java | 132 +++ .../databox/models/JobDeliveryInfo.java | 4 - .../databox/models/JobDeliveryType.java | 6 +- .../databox/models/JobDetails.java | 62 +- .../databox/models/JobResource.java | 113 +- .../databox/models/JobResourceList.java | 4 - .../models/JobResourceUpdateParameter.java | 43 +- .../databox/models/JobSecrets.java | 5 +- .../databox/models/JobStages.java | 4 - .../resourcemanager/databox/models/Jobs.java | 52 +- .../databox/models/KekType.java | 6 +- .../databox/models/KeyEncryptionKey.java | 10 +- .../models/LastMitigationActionOnJob.java | 7 +- .../databox/models/LogCollectionLevel.java | 6 +- .../databox/models/ManagedDiskDetails.java | 12 +- .../models/MarkDevicesShippedRequest.java | 57 + .../databox/models/MitigateJobRequest.java | 7 +- .../models/NotificationPreference.java | 7 +- .../databox/models/NotificationStageName.java | 67 +- .../databox/models/OperationDisplay.java | 4 - .../databox/models/OperationList.java | 4 - .../databox/models/Operations.java | 4 +- .../models/OverallValidationStatus.java | 6 +- .../databox/models/PackageCarrierDetails.java | 98 ++ .../databox/models/PackageCarrierInfo.java | 72 ++ .../models/PackageShippingDetails.java | 30 +- .../databox/models/Preferences.java | 30 +- .../models/PreferencesValidationRequest.java | 7 +- ...eferencesValidationResponseProperties.java | 4 - .../models/RegionConfigurationRequest.java | 33 +- .../models/RegionConfigurationResponse.java | 7 + .../databox/models/ResourceIdentity.java | 6 +- .../databox/models/ResourceProviders.java | 2 +- .../models/ScheduleAvailabilityRequest.java | 7 +- .../models/ScheduleAvailabilityResponse.java | 4 - .../databox/models/Services.java | 14 +- .../models/ShareCredentialDetails.java | 4 - .../models/ShareDestinationFormatType.java | 6 +- .../databox/models/ShipmentPickUpRequest.java | 17 +- .../databox/models/ShippingAddress.java | 9 +- .../resourcemanager/databox/models/Sku.java | 7 +- .../SkuAvailabilityValidationRequest.java | 13 +- ...ilabilityValidationResponseProperties.java | 4 - .../databox/models/SkuCapacity.java | 4 - .../databox/models/SkuCost.java | 9 +- .../databox/models/SkuDisabledReason.java | 6 +- .../databox/models/SkuName.java | 9 +- .../databox/models/StageName.java | 116 +- .../databox/models/StageStatus.java | 20 +- .../databox/models/StorageAccountDetails.java | 7 +- ...IsAllowedToCreateJobValidationRequest.java | 5 - ...CreateJobValidationResponseProperties.java | 6 - .../databox/models/TransferAllDetails.java | 7 +- .../databox/models/TransferConfiguration.java | 15 +- ...ansferConfigurationTransferAllDetails.java | 4 - ...ferConfigurationTransferFilterDetails.java | 4 - .../models/TransferConfigurationType.java | 6 +- .../databox/models/TransferFilterDetails.java | 7 +- .../databox/models/TransferType.java | 6 +- .../models/TransportAvailabilityDetails.java | 4 - .../models/TransportAvailabilityRequest.java | 4 - .../models/TransportAvailabilityResponse.java | 4 - .../databox/models/TransportPreferences.java | 7 +- .../models/TransportShipmentTypes.java | 6 +- .../models/UnencryptedCredentialsList.java | 4 - .../databox/models/UpdateJobDetails.java | 33 +- .../databox/models/UserAssignedIdentity.java | 4 - .../models/UserAssignedProperties.java | 7 +- .../databox/models/ValidateAddress.java | 9 +- .../models/ValidationInputDiscriminator.java | 6 +- .../models/ValidationInputRequest.java | 4 - .../models/ValidationInputResponse.java | 5 +- .../databox/models/ValidationRequest.java | 10 +- .../databox/models/ValidationStatus.java | 6 +- .../JobsBookShipmentPickUpSamples.java | 33 + .../databox/generated/JobsCancelSamples.java | 26 + .../databox/generated/JobsCreateSamples.java | 291 +++++ .../databox/generated/JobsDeleteSamples.java | 22 + .../JobsGetByResourceGroupSamples.java | 74 ++ .../JobsListByResourceGroupSamples.java | 22 + .../generated/JobsListCredentialsSamples.java | 22 + .../databox/generated/JobsListSamples.java | 22 + .../JobsMarkDevicesShippedSamples.java | 32 + .../databox/generated/JobsUpdateSamples.java | 131 ++ .../generated/OperationsListSamples.java | 22 + .../ResourceProviderMitigateSamples.java | 30 + ...stAvailableSkusByResourceGroupSamples.java | 33 + ...onConfigurationByResourceGroupSamples.java | 32 + .../ServiceRegionConfigurationSamples.java | 31 + .../ServiceValidateAddressSamples.java | 42 + ...eValidateInputsByResourceGroupSamples.java | 89 ++ .../ServiceValidateInputsSamples.java | 88 ++ 194 files changed, 6370 insertions(+), 1464 deletions(-) create mode 100644 sdk/databox/azure-resourcemanager-databox/SAMPLE.md rename sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/{ => fluent}/models/AddressValidationProperties.java (87%) create mode 100644 sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/fluent/models/JobProperties.java create mode 100644 sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/fluent/models/SkuProperties.java create mode 100644 sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/fluent/models/UpdateJobProperties.java create mode 100644 sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/fluent/models/ValidationResponseProperties.java create mode 100644 sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/CustomerDiskJobSecrets.java create mode 100644 sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/DataBoxCustomerDiskCopyLogDetails.java create mode 100644 sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/DataBoxCustomerDiskCopyProgress.java create mode 100644 sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/DataBoxCustomerDiskJobDetails.java create mode 100644 sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/DataBoxDiskGranularCopyLogDetails.java create mode 100644 sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/DataBoxDiskGranularCopyProgress.java create mode 100644 sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/DataCenterCode.java create mode 100644 sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/DatacenterAddressInstructionResponse.java create mode 100644 sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/DatacenterAddressLocationResponse.java create mode 100644 sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/DatacenterAddressRequest.java create mode 100644 sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/DatacenterAddressResponse.java create mode 100644 sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/DatacenterAddressType.java create mode 100644 sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/DeviceErasureDetails.java create mode 100644 sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/ExportDiskDetails.java create mode 100644 sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/GranularCopyLogDetails.java create mode 100644 sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/GranularCopyProgress.java create mode 100644 sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/ImportDiskDetails.java create mode 100644 sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/MarkDevicesShippedRequest.java create mode 100644 sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/PackageCarrierDetails.java create mode 100644 sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/PackageCarrierInfo.java create mode 100644 sdk/databox/azure-resourcemanager-databox/src/samples/java/com/azure/resourcemanager/databox/generated/JobsBookShipmentPickUpSamples.java create mode 100644 sdk/databox/azure-resourcemanager-databox/src/samples/java/com/azure/resourcemanager/databox/generated/JobsCancelSamples.java create mode 100644 sdk/databox/azure-resourcemanager-databox/src/samples/java/com/azure/resourcemanager/databox/generated/JobsCreateSamples.java create mode 100644 sdk/databox/azure-resourcemanager-databox/src/samples/java/com/azure/resourcemanager/databox/generated/JobsDeleteSamples.java create mode 100644 sdk/databox/azure-resourcemanager-databox/src/samples/java/com/azure/resourcemanager/databox/generated/JobsGetByResourceGroupSamples.java create mode 100644 sdk/databox/azure-resourcemanager-databox/src/samples/java/com/azure/resourcemanager/databox/generated/JobsListByResourceGroupSamples.java create mode 100644 sdk/databox/azure-resourcemanager-databox/src/samples/java/com/azure/resourcemanager/databox/generated/JobsListCredentialsSamples.java create mode 100644 sdk/databox/azure-resourcemanager-databox/src/samples/java/com/azure/resourcemanager/databox/generated/JobsListSamples.java create mode 100644 sdk/databox/azure-resourcemanager-databox/src/samples/java/com/azure/resourcemanager/databox/generated/JobsMarkDevicesShippedSamples.java create mode 100644 sdk/databox/azure-resourcemanager-databox/src/samples/java/com/azure/resourcemanager/databox/generated/JobsUpdateSamples.java create mode 100644 sdk/databox/azure-resourcemanager-databox/src/samples/java/com/azure/resourcemanager/databox/generated/OperationsListSamples.java create mode 100644 sdk/databox/azure-resourcemanager-databox/src/samples/java/com/azure/resourcemanager/databox/generated/ResourceProviderMitigateSamples.java create mode 100644 sdk/databox/azure-resourcemanager-databox/src/samples/java/com/azure/resourcemanager/databox/generated/ServiceListAvailableSkusByResourceGroupSamples.java create mode 100644 sdk/databox/azure-resourcemanager-databox/src/samples/java/com/azure/resourcemanager/databox/generated/ServiceRegionConfigurationByResourceGroupSamples.java create mode 100644 sdk/databox/azure-resourcemanager-databox/src/samples/java/com/azure/resourcemanager/databox/generated/ServiceRegionConfigurationSamples.java create mode 100644 sdk/databox/azure-resourcemanager-databox/src/samples/java/com/azure/resourcemanager/databox/generated/ServiceValidateAddressSamples.java create mode 100644 sdk/databox/azure-resourcemanager-databox/src/samples/java/com/azure/resourcemanager/databox/generated/ServiceValidateInputsByResourceGroupSamples.java create mode 100644 sdk/databox/azure-resourcemanager-databox/src/samples/java/com/azure/resourcemanager/databox/generated/ServiceValidateInputsSamples.java diff --git a/sdk/databox/azure-resourcemanager-databox/CHANGELOG.md b/sdk/databox/azure-resourcemanager-databox/CHANGELOG.md index 95f9217c5a82..9605a9f54ba4 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-09-20) +- Azure Resource Manager DataBox client library for Java. This package contains Microsoft Azure SDK for DataBox Management SDK. Package tag package-2022-02. 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 848c2965820b..cd2220ce1e53 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-2022-02. 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 000000000000..5db1356a2d63 --- /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/stable/2022-02-01/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/stable/2022-02-01/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/stable/2022-02-01/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/stable/2022-02-01/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/stable/2022-02-01/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/stable/2022-02-01/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/stable/2022-02-01/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/stable/2022-02-01/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/stable/2022-02-01/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/stable/2022-02-01/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/stable/2022-02-01/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/stable/2022-02-01/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/stable/2022-02-01/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/stable/2022-02-01/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/stable/2022-02-01/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/stable/2022-02-01/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/stable/2022-02-01/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/stable/2022-02-01/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/stable/2022-02-01/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/stable/2022-02-01/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/stable/2022-02-01/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/stable/2022-02-01/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/stable/2022-02-01/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/stable/2022-02-01/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/stable/2022-02-01/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/stable/2022-02-01/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/stable/2022-02-01/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/stable/2022-02-01/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 55556ab287ea..a0a498df5799 100644 --- a/sdk/databox/azure-resourcemanager-databox/pom.xml +++ b/sdk/databox/azure-resourcemanager-databox/pom.xml @@ -1,55 +1,55 @@ - 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-2022-02. + 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 - - - - com.azure - azure-core - 1.32.0 - - - com.azure - azure-core-management - 1.8.0 - - + + 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 + + + + com.azure + azure-core + 1.32.0 + + + com.azure + azure-core-management + 1.8.0 + + 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 dcc1eadb4a88..ba1e7c92b1c9 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,15 +8,18 @@ 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.AddHeadersFromContextPolicy; import com.azure.core.http.policy.HttpLogOptions; import com.azure.core.http.policy.HttpLoggingPolicy; import com.azure.core.http.policy.HttpPipelinePolicy; import com.azure.core.http.policy.HttpPolicyProviders; import com.azure.core.http.policy.RequestIdPolicy; +import com.azure.core.http.policy.RetryOptions; 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 +38,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 { @@ -73,6 +77,19 @@ public static DataBoxManager authenticate(TokenCredential credential, AzureProfi return configure().authenticate(credential, profile); } + /** + * Creates an instance of DataBox service API entry point. + * + * @param httpPipeline the {@link HttpPipeline} configured with Azure authentication credential. + * @param profile the Azure profile for client. + * @return the DataBox service API instance. + */ + public static DataBoxManager authenticate(HttpPipeline httpPipeline, AzureProfile profile) { + Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + return new DataBoxManager(httpPipeline, profile, null); + } + /** * Gets a Configurable instance that can be used to create DataBoxManager with optional configuration. * @@ -84,12 +101,14 @@ public static Configurable configure() { /** The Configurable allowing configurations to be set. */ public static final class Configurable { - private final ClientLogger logger = new ClientLogger(Configurable.class); + private static final ClientLogger LOGGER = new ClientLogger(Configurable.class); private HttpClient httpClient; private HttpLogOptions httpLogOptions; private final List policies = new ArrayList<>(); + private final List scopes = new ArrayList<>(); private RetryPolicy retryPolicy; + private RetryOptions retryOptions; private Duration defaultPollInterval; private Configurable() { @@ -128,6 +147,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. * @@ -139,6 +169,19 @@ public Configurable withRetryPolicy(RetryPolicy retryPolicy) { return this; } + /** + * Sets the retry options for the HTTP pipeline retry policy. + * + *

This setting has no effect, if retry policy is set via {@link #withRetryPolicy(RetryPolicy)}. + * + * @param retryOptions the retry options for the HTTP pipeline retry policy. + * @return the configurable object itself. + */ + public Configurable withRetryOptions(RetryOptions retryOptions) { + this.retryOptions = Objects.requireNonNull(retryOptions, "'retryOptions' cannot be null."); + return this; + } + /** * Sets the default poll interval, used when service does not provide "Retry-After" header. * @@ -146,9 +189,11 @@ public Configurable withRetryPolicy(RetryPolicy retryPolicy) { * @return the configurable object itself. */ public Configurable withDefaultPollInterval(Duration defaultPollInterval) { - this.defaultPollInterval = Objects.requireNonNull(defaultPollInterval, "'retryPolicy' cannot be null."); + this.defaultPollInterval = + Objects.requireNonNull(defaultPollInterval, "'defaultPollInterval' cannot be null."); if (this.defaultPollInterval.isNegative()) { - throw logger.logExceptionAsError(new IllegalArgumentException("'httpPipeline' cannot be negative")); + throw LOGGER + .logExceptionAsError(new IllegalArgumentException("'defaultPollInterval' cannot be negative")); } return this; } @@ -184,20 +229,38 @@ 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); + if (retryOptions != null) { + retryPolicy = new RetryPolicy(retryOptions); + } else { + retryPolicy = new RetryPolicy("Retry-After", ChronoUnit.SECONDS); + } } List policies = new ArrayList<>(); policies.add(new UserAgentPolicy(userAgentBuilder.toString())); + policies.add(new AddHeadersFromContextPolicy()); 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 = @@ -209,7 +272,11 @@ public DataBoxManager authenticate(TokenCredential credential, AzureProfile prof } } - /** @return Resource collection API of Operations. */ + /** + * Gets the resource collection API of Operations. + * + * @return Resource collection API of Operations. + */ public Operations operations() { if (this.operations == null) { this.operations = new OperationsImpl(clientObject.getOperations(), this); @@ -217,7 +284,11 @@ public Operations operations() { return operations; } - /** @return Resource collection API of Jobs. */ + /** + * Gets the resource collection API of Jobs. It manages JobResource. + * + * @return Resource collection API of Jobs. + */ public Jobs jobs() { if (this.jobs == null) { this.jobs = new JobsImpl(clientObject.getJobs(), this); @@ -225,7 +296,11 @@ public Jobs jobs() { return jobs; } - /** @return Resource collection API of ResourceProviders. */ + /** + * Gets the resource collection API of ResourceProviders. + * + * @return Resource collection API of ResourceProviders. + */ public ResourceProviders resourceProviders() { if (this.resourceProviders == null) { this.resourceProviders = new ResourceProvidersImpl(clientObject.getResourceProviders(), this); @@ -233,7 +308,11 @@ public ResourceProviders resourceProviders() { return resourceProviders; } - /** @return Resource collection API of Services. */ + /** + * Gets the resource collection API of Services. + * + * @return Resource collection API of Services. + */ public Services services() { if (this.services == null) { this.services = new ServicesImpl(clientObject.getServices(), this); 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 c7ea07334dc9..b2018452e185 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. */ @@ -25,7 +26,7 @@ public interface JobsClient { * * @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 job Resource Collection. + * @return job Resource Collection as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(); @@ -38,11 +39,43 @@ public interface JobsClient { * @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 job Resource Collection. + * @return job Resource Collection as paginated response with {@link PagedIterable}. */ @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 {@link 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. * @@ -50,7 +83,7 @@ public interface JobsClient { * @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 job Resource Collection. + * @return job Resource Collection as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listByResourceGroup(String resourceGroupName); @@ -64,7 +97,7 @@ public interface JobsClient { * @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 job Resource Collection. + * @return job Resource Collection as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listByResourceGroup(String resourceGroupName, String skipToken, Context context); @@ -94,7 +127,7 @@ public interface JobsClient { * @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 information about the specified job. + * @return information about the specified job along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response getByResourceGroupWithResponse( @@ -111,9 +144,9 @@ Response getByResourceGroupWithResponse( * @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 job Resource. + * @return the {@link SyncPoller} for polling of job Resource. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, JobResourceInner> beginCreate( String resourceGroupName, String jobName, JobResourceInner jobResource); @@ -129,9 +162,9 @@ SyncPoller, JobResourceInner> beginCreate( * @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 job Resource. + * @return the {@link SyncPoller} for polling of job Resource. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, JobResourceInner> beginCreate( String resourceGroupName, String jobName, JobResourceInner jobResource, Context context); @@ -177,9 +210,9 @@ SyncPoller, JobResourceInner> beginCreate( * @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 completion. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, Void> beginDelete(String resourceGroupName, String jobName); /** @@ -192,9 +225,9 @@ SyncPoller, JobResourceInner> beginCreate( * @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 completion. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, Void> beginDelete(String resourceGroupName, String jobName, Context context); /** @@ -236,9 +269,9 @@ SyncPoller, JobResourceInner> beginCreate( * @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 job Resource. + * @return the {@link SyncPoller} for polling of job Resource. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, JobResourceInner> beginUpdate( String resourceGroupName, String jobName, @@ -258,9 +291,9 @@ SyncPoller, JobResourceInner> beginUpdate( * @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 job Resource. + * @return the {@link SyncPoller} for polling of job Resource. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, JobResourceInner> beginUpdate( String resourceGroupName, String jobName, @@ -355,7 +388,7 @@ ShipmentPickUpResponseInner bookShipmentPickUp( * @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 shipment pick up response. + * @return shipment pick up response along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response bookShipmentPickUpWithResponse( @@ -386,7 +419,7 @@ Response bookShipmentPickUpWithResponse( * @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. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response cancelWithResponse( @@ -401,7 +434,7 @@ Response cancelWithResponse( * @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 list of unencrypted credentials for accessing device. + * @return list of unencrypted credentials for accessing device as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listCredentials(String resourceGroupName, String jobName); @@ -416,7 +449,7 @@ Response cancelWithResponse( * @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 list of unencrypted credentials for accessing device. + * @return list of unencrypted credentials for accessing device as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listCredentials( diff --git a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/fluent/OperationsClient.java b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/fluent/OperationsClient.java index 8c5ca0f8163e..d969702bbcd6 100644 --- a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/fluent/OperationsClient.java +++ b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/fluent/OperationsClient.java @@ -17,7 +17,7 @@ public interface OperationsClient { * * @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 operation Collection. + * @return operation Collection as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(); @@ -29,7 +29,7 @@ public interface OperationsClient { * @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 operation Collection. + * @return operation Collection as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(Context context); diff --git a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/fluent/ResourceProvidersClient.java b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/fluent/ResourceProvidersClient.java index 7a3f79325b34..57d897fd356e 100644 --- a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/fluent/ResourceProvidersClient.java +++ b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/fluent/ResourceProvidersClient.java @@ -37,7 +37,7 @@ public interface ResourceProvidersClient { * @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. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response mitigateWithResponse( diff --git a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/fluent/ServicesClient.java b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/fluent/ServicesClient.java index c71af55f903a..b4dfcab484bc 100644 --- a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/fluent/ServicesClient.java +++ b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/fluent/ServicesClient.java @@ -29,7 +29,7 @@ public interface ServicesClient { * @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 available skus operation response. + * @return the available skus operation response as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listAvailableSkusByResourceGroup( @@ -45,7 +45,7 @@ PagedIterable listAvailableSkusByResourceGroup( * @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 available skus operation response. + * @return the available skus operation response as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listAvailableSkusByResourceGroup( @@ -75,7 +75,7 @@ PagedIterable listAvailableSkusByResourceGroup( * @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 output of the address validation api. + * @return output of the address validation api along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response validateAddressWithResponse( @@ -106,7 +106,7 @@ ValidationResponseInner validateInputsByResourceGroup( * @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 response of pre job creation validations. + * @return response of pre job creation validations along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response validateInputsByResourceGroupWithResponse( @@ -134,7 +134,7 @@ Response validateInputsByResourceGroupWithResponse( * @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 response of pre job creation validations. + * @return response of pre job creation validations along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response validateInputsWithResponse( @@ -163,7 +163,7 @@ RegionConfigurationResponseInner regionConfiguration( * @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 configuration response specific to a region. + * @return configuration response specific to a region along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response regionConfigurationWithResponse( @@ -194,7 +194,7 @@ RegionConfigurationResponseInner regionConfigurationByResourceGroup( * @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 configuration response specific to a region. + * @return configuration response specific to a region along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response regionConfigurationByResourceGroupWithResponse( 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 7271be071285..ce081211f3c5 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,46 +5,28 @@ 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; import com.azure.resourcemanager.databox.models.ShippingAddress; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; /** Output of the address validation api. */ -@JsonFlatten @Immutable -public class AddressValidationOutputInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(AddressValidationOutputInner.class); - - /* - * Error code and message of validation response. - */ - @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; - +public final class AddressValidationOutputInner { /* - * List of alternate addresses. + * The address validation properties. */ - @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 +35,7 @@ public CloudError error() { * @return the validationStatus value. */ public AddressValidationStatus validationStatus() { - return this.validationStatus; + return this.innerProperties() == null ? null : this.innerProperties().validationStatus(); } /** @@ -62,7 +44,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 +62,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 87% 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 a1af669a02f6..7364d2a2f710 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,11 +2,12 @@ // 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.fasterxml.jackson.annotation.JsonIgnore; +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.JsonProperty; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; @@ -17,8 +18,6 @@ @JsonTypeName("ValidateAddress") @Immutable public final class AddressValidationProperties extends ValidationInputResponse { - @JsonIgnore private final ClientLogger logger = new ClientLogger(AddressValidationProperties.class); - /* * The address validation status. */ 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 000000000000..9d5f17cdb110 --- /dev/null +++ b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/fluent/models/JobProperties.java @@ -0,0 +1,283 @@ +// 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.JsonProperty; +import java.time.OffsetDateTime; + +/** Job Properties. */ +@Fluent +public final class JobProperties { + /* + * 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(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(JobProperties.class); +} 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 483ef43dcc65..9bcd8354c50c 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; @@ -17,16 +16,18 @@ import com.azure.resourcemanager.databox.models.Sku; 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; import java.util.Map; /** Job Resource. */ -@JsonFlatten @Fluent -public class JobResourceInner extends Resource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(JobResourceInner.class); +public final class JobResourceInner extends Resource { + /* + * Properties of a job. + */ + @JsonProperty(value = "properties", required = true) + private JobProperties innerProperties = new JobProperties(); /* * Name of the object. @@ -52,85 +53,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 +65,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 +110,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 +180,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 +193,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 +202,7 @@ public Boolean isCancellable() { * @return the isDeletable value. */ public Boolean isDeletable() { - return this.isDeletable; + return this.innerProperties() == null ? null : this.innerProperties().isDeletable(); } /** @@ -223,7 +211,7 @@ public Boolean isDeletable() { * @return the isShippingAddressEditable value. */ public Boolean isShippingAddressEditable() { - return this.isShippingAddressEditable; + return this.innerProperties() == null ? null : this.innerProperties().isShippingAddressEditable(); } /** @@ -232,7 +220,7 @@ public Boolean isShippingAddressEditable() { * @return the isPrepareToShipEnabled value. */ public Boolean isPrepareToShipEnabled() { - return this.isPrepareToShipEnabled; + return this.innerProperties() == null ? null : this.innerProperties().isPrepareToShipEnabled(); } /** @@ -241,7 +229,7 @@ public Boolean isPrepareToShipEnabled() { * @return the status value. */ public StageName status() { - return this.status; + return this.innerProperties() == null ? null : this.innerProperties().status(); } /** @@ -250,7 +238,7 @@ public StageName status() { * @return the startTime value. */ public OffsetDateTime startTime() { - return this.startTime; + return this.innerProperties() == null ? null : this.innerProperties().startTime(); } /** @@ -259,7 +247,7 @@ public OffsetDateTime startTime() { * @return the error value. */ public CloudError error() { - return this.error; + return this.innerProperties() == null ? null : this.innerProperties().error(); } /** @@ -268,7 +256,7 @@ public CloudError error() { * @return the details value. */ public JobDetails details() { - return this.details; + return this.innerProperties() == null ? null : this.innerProperties().details(); } /** @@ -278,7 +266,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 +279,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 +288,7 @@ public String cancellationReason() { * @return the deliveryType value. */ public JobDeliveryType deliveryType() { - return this.deliveryType; + return this.innerProperties() == null ? null : this.innerProperties().deliveryType(); } /** @@ -307,7 +298,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 +311,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 +321,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 +334,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,22 +343,16 @@ public JobResourceInner withTags(Map tags) { * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (transferType() == null) { - throw logger + 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 + throw LOGGER .logExceptionAsError( new IllegalArgumentException("Missing required property sku in model JobResourceInner")); } else { @@ -425,4 +362,6 @@ public void validate() { identity().validate(); } } + + private static final ClientLogger LOGGER = new ClientLogger(JobResourceInner.class); } diff --git a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/fluent/models/OperationInner.java b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/fluent/models/OperationInner.java index 278520c221ad..269373b7d55f 100644 --- a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/fluent/models/OperationInner.java +++ b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/fluent/models/OperationInner.java @@ -5,19 +5,14 @@ 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.OperationDisplay; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; /** Operation entity. */ @Fluent public final class OperationInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationInner.class); - /* - * Name of the operation. Format: - * {resourceProviderNamespace}/{resourceType}/{read|write|delete|action} + * Name of the operation. Format: {resourceProviderNamespace}/{resourceType}/{read|write|delete|action} */ @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) private String name; 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 f6142529fe45..58b66fbd1da0 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 @@ -5,17 +5,14 @@ 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.DatacenterAddressResponse; import com.azure.resourcemanager.databox.models.ScheduleAvailabilityResponse; import com.azure.resourcemanager.databox.models.TransportAvailabilityResponse; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; /** Configuration response specific to a region. */ @Immutable public final class RegionConfigurationResponseInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(RegionConfigurationResponseInner.class); - /* * Schedule availability for given sku in a region. */ @@ -28,6 +25,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 +49,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 +70,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/ShipmentPickUpResponseInner.java b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/fluent/models/ShipmentPickUpResponseInner.java index b20b834df680..9cfa1a247120 100644 --- a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/fluent/models/ShipmentPickUpResponseInner.java +++ b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/fluent/models/ShipmentPickUpResponseInner.java @@ -5,16 +5,12 @@ package com.azure.resourcemanager.databox.fluent.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 java.time.OffsetDateTime; /** Shipment pick up response. */ @Immutable public final class ShipmentPickUpResponseInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ShipmentPickUpResponseInner.class); - /* * Confirmation number for the pick up request. */ @@ -22,8 +18,7 @@ public final class ShipmentPickUpResponseInner { private String confirmationNumber; /* - * Time by which shipment should be ready for pick up, this is in local - * time of pick up area. + * Time by which shipment should be ready for pick up, this is in local time of pick up area. */ @JsonProperty(value = "readyByTime", access = JsonProperty.Access.WRITE_ONLY) private OffsetDateTime readyByTime; 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 96fcf59e7722..250ac6e811a2 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,23 +5,17 @@ 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; 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; /** Information of the sku. */ -@JsonFlatten @Immutable -public class SkuInformationInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(SkuInformationInner.class); - +public final class SkuInformationInner { /* * The Sku. */ @@ -35,46 +29,10 @@ public class SkuInformationInner { private Boolean enabled; /* - * The map of data location to service location. - */ - @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. + * Properties of the sku. */ - @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 +52,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 +76,7 @@ public List dataLocationToServiceLocationMap() * @return the capacity value. */ public SkuCapacity capacity() { - return this.capacity; + return this.innerProperties() == null ? null : this.innerProperties().capacity(); } /** @@ -118,7 +85,7 @@ public SkuCapacity capacity() { * @return the costs value. */ public List costs() { - return this.costs; + return this.innerProperties() == null ? null : this.innerProperties().costs(); } /** @@ -127,7 +94,7 @@ public List costs() { * @return the apiVersions value. */ public List apiVersions() { - return this.apiVersions; + return this.innerProperties() == null ? null : this.innerProperties().apiVersions(); } /** @@ -136,7 +103,7 @@ public List apiVersions() { * @return the disabledReason value. */ public SkuDisabledReason disabledReason() { - return this.disabledReason; + return this.innerProperties() == null ? null : this.innerProperties().disabledReason(); } /** @@ -145,7 +112,7 @@ public SkuDisabledReason disabledReason() { * @return the disabledReasonMessage value. */ public String disabledReasonMessage() { - return this.disabledReasonMessage; + return this.innerProperties() == null ? null : this.innerProperties().disabledReasonMessage(); } /** @@ -154,7 +121,7 @@ public String disabledReasonMessage() { * @return the requiredFeature value. */ public String requiredFeature() { - return this.requiredFeature; + return this.innerProperties() == null ? null : this.innerProperties().requiredFeature(); } /** @@ -166,14 +133,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 000000000000..98933452325d --- /dev/null +++ b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/fluent/models/SkuProperties.java @@ -0,0 +1,139 @@ +// 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.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.JsonProperty; +import java.util.List; + +/** Properties of the sku. */ +@Immutable +public final class SkuProperties { + /* + * 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/UnencryptedCredentialsInner.java b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/fluent/models/UnencryptedCredentialsInner.java index a03f62932fbf..a4c8dfd54091 100644 --- a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/fluent/models/UnencryptedCredentialsInner.java +++ b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/fluent/models/UnencryptedCredentialsInner.java @@ -5,16 +5,12 @@ 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.JobSecrets; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; /** Unencrypted credentials for accessing device. */ @Immutable public final class UnencryptedCredentialsInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(UnencryptedCredentialsInner.class); - /* * Name of the job. */ 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 000000000000..2cd7142ba156 --- /dev/null +++ b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/fluent/models/UpdateJobProperties.java @@ -0,0 +1,50 @@ +// 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.resourcemanager.databox.models.UpdateJobDetails; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Job Properties for update. */ +@Fluent +public final class UpdateJobProperties { + /* + * 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 8bb1ab9e27ad..400ba314e631 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,32 +5,28 @@ 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; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; /** Response of pre job creation validations. */ -@JsonFlatten @Immutable -public class ValidationResponseInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ValidationResponseInner.class); - +public final class ValidationResponseInner { /* - * 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 +34,7 @@ public class ValidationResponseInner { * @return the status value. */ public OverallValidationStatus status() { - return this.status; + return this.innerProperties() == null ? null : this.innerProperties().status(); } /** @@ -48,7 +44,7 @@ public OverallValidationStatus status() { * @return the individualResponseDetails value. */ public List individualResponseDetails() { - return this.individualResponseDetails; + return this.innerProperties() == null ? null : this.innerProperties().individualResponseDetails(); } /** @@ -57,8 +53,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 000000000000..51375c834939 --- /dev/null +++ b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/fluent/models/ValidationResponseProperties.java @@ -0,0 +1,57 @@ +// 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.resourcemanager.databox.models.OverallValidationStatus; +import com.azure.resourcemanager.databox.models.ValidationInputResponse; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Properties of pre job creation validation response. */ +@Immutable +public final class ValidationResponseProperties { + /* + * 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 fcfdd52da733..1c94805d6142 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/DataBoxManagementClientBuilder.java b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/implementation/DataBoxManagementClientBuilder.java index bb86febc870b..12f16d3eeb31 100644 --- a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/implementation/DataBoxManagementClientBuilder.java +++ b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/implementation/DataBoxManagementClientBuilder.java @@ -7,7 +7,6 @@ import com.azure.core.annotation.ServiceClientBuilder; import com.azure.core.http.HttpPipeline; import com.azure.core.http.HttpPipelineBuilder; -import com.azure.core.http.policy.CookiePolicy; import com.azure.core.http.policy.RetryPolicy; import com.azure.core.http.policy.UserAgentPolicy; import com.azure.core.management.AzureEnvironment; @@ -67,34 +66,34 @@ public DataBoxManagementClientBuilder environment(AzureEnvironment environment) } /* - * The default poll interval for long-running operation + * The HTTP pipeline to send requests through */ - private Duration defaultPollInterval; + private HttpPipeline pipeline; /** - * Sets The default poll interval for long-running operation. + * Sets The HTTP pipeline to send requests through. * - * @param defaultPollInterval the defaultPollInterval value. + * @param pipeline the pipeline value. * @return the DataBoxManagementClientBuilder. */ - public DataBoxManagementClientBuilder defaultPollInterval(Duration defaultPollInterval) { - this.defaultPollInterval = defaultPollInterval; + public DataBoxManagementClientBuilder pipeline(HttpPipeline pipeline) { + this.pipeline = pipeline; return this; } /* - * The HTTP pipeline to send requests through + * The default poll interval for long-running operation */ - private HttpPipeline pipeline; + private Duration defaultPollInterval; /** - * Sets The HTTP pipeline to send requests through. + * Sets The default poll interval for long-running operation. * - * @param pipeline the pipeline value. + * @param defaultPollInterval the defaultPollInterval value. * @return the DataBoxManagementClientBuilder. */ - public DataBoxManagementClientBuilder pipeline(HttpPipeline pipeline) { - this.pipeline = pipeline; + public DataBoxManagementClientBuilder defaultPollInterval(Duration defaultPollInterval) { + this.defaultPollInterval = defaultPollInterval; return this; } @@ -120,27 +119,26 @@ public DataBoxManagementClientBuilder serializerAdapter(SerializerAdapter serial * @return an instance of DataBoxManagementClientImpl. */ public DataBoxManagementClientImpl buildClient() { - if (endpoint == null) { - this.endpoint = "https://management.azure.com"; - } - if (environment == null) { - this.environment = AzureEnvironment.AZURE; - } - if (defaultPollInterval == null) { - this.defaultPollInterval = Duration.ofSeconds(30); - } - if (pipeline == null) { - this.pipeline = - new HttpPipelineBuilder() - .policies(new UserAgentPolicy(), new RetryPolicy(), new CookiePolicy()) - .build(); - } - if (serializerAdapter == null) { - this.serializerAdapter = SerializerFactory.createDefaultManagementSerializerAdapter(); - } + String localEndpoint = (endpoint != null) ? endpoint : "https://management.azure.com"; + AzureEnvironment localEnvironment = (environment != null) ? environment : AzureEnvironment.AZURE; + HttpPipeline localPipeline = + (pipeline != null) + ? pipeline + : new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(); + Duration localDefaultPollInterval = + (defaultPollInterval != null) ? defaultPollInterval : Duration.ofSeconds(30); + SerializerAdapter localSerializerAdapter = + (serializerAdapter != null) + ? serializerAdapter + : SerializerFactory.createDefaultManagementSerializerAdapter(); DataBoxManagementClientImpl client = new DataBoxManagementClientImpl( - pipeline, serializerAdapter, defaultPollInterval, environment, subscriptionId, endpoint); + localPipeline, + localSerializerAdapter, + localDefaultPollInterval, + localEnvironment, + subscriptionId, + localEndpoint); return client; } } 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 906b858913c1..0373c6197f39 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 @@ -15,6 +15,7 @@ import com.azure.core.management.polling.PollResult; import com.azure.core.management.polling.PollerFactory; import com.azure.core.util.Context; +import com.azure.core.util.CoreUtils; import com.azure.core.util.logging.ClientLogger; import com.azure.core.util.polling.AsyncPollResponse; import com.azure.core.util.polling.LongRunningOperationStatus; @@ -32,15 +33,12 @@ import java.nio.charset.Charset; import java.nio.charset.StandardCharsets; import java.time.Duration; -import java.util.Map; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; /** Initializes a new instance of the DataBoxManagementClientImpl type. */ @ServiceClient(builder = DataBoxManagementClientBuilder.class) public final class DataBoxManagementClientImpl implements DataBoxManagementClient { - private final ClientLogger logger = new ClientLogger(DataBoxManagementClientImpl.class); - /** The Subscription Id. */ private final String subscriptionId; @@ -183,7 +181,7 @@ public ServicesClient getServices() { this.defaultPollInterval = defaultPollInterval; this.subscriptionId = subscriptionId; this.endpoint = endpoint; - this.apiVersion = "2021-03-01"; + this.apiVersion = "2022-02-01"; this.operations = new OperationsClientImpl(this); this.jobs = new JobsClientImpl(this); this.resourceProviders = new ResourceProvidersClientImpl(this); @@ -206,10 +204,7 @@ public Context getContext() { * @return the merged context. */ public Context mergeContext(Context context) { - for (Map.Entry entry : this.getContext().getValues().entrySet()) { - context = context.addData(entry.getKey(), entry.getValue()); - } - return context; + return CoreUtils.mergeContexts(this.getContext(), context); } /** @@ -273,7 +268,7 @@ public Mono getLroFinalResultOrError(AsyncPollResponse, managementError = null; } } catch (IOException | RuntimeException ioe) { - logger.logThrowableAsWarning(ioe); + LOGGER.logThrowableAsWarning(ioe); } } } else { @@ -332,4 +327,6 @@ public Mono getBodyAsString(Charset charset) { return Mono.just(new String(responseBody, charset)); } } + + private static final ClientLogger LOGGER = new ClientLogger(DataBoxManagementClientImpl.class); } 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 0796988c8944..44668373e904 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()); } @@ -131,6 +132,10 @@ public String regionName() { return this.location(); } + public String resourceGroupName() { + return resourceGroupName; + } + public JobResourceInner innerModel() { return this.innerObject; } @@ -226,6 +231,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 +279,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 +299,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 +324,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 8fa80fdd8093..5fe595f5f0aa 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 @@ -31,7 +31,6 @@ import com.azure.core.management.polling.PollResult; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; import com.azure.core.util.polling.PollerFlux; import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.databox.fluent.JobsClient; @@ -41,6 +40,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; @@ -49,8 +49,6 @@ /** An instance of this class provides access to all the operations defined in JobsClient. */ public final class JobsClientImpl implements JobsClient { - private final ClientLogger logger = new ClientLogger(JobsClientImpl.class); - /** The proxy service used to perform REST calls. */ private final JobsService service; @@ -86,6 +84,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}) @@ -238,7 +252,7 @@ Mono> listByResourceGroupNext( * @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 job Resource Collection. + * @return job Resource Collection along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync(String skipToken) { @@ -286,7 +300,7 @@ private Mono> listSinglePageAsync(String skipTok * @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 job Resource Collection. + * @return job Resource Collection along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync(String skipToken, Context context) { @@ -330,7 +344,7 @@ private Mono> listSinglePageAsync(String skipTok * @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 job Resource Collection. + * @return job Resource Collection as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(String skipToken) { @@ -342,7 +356,7 @@ private PagedFlux listAsync(String skipToken) { * * @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 job Resource Collection. + * @return job Resource Collection as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync() { @@ -358,7 +372,7 @@ private PagedFlux listAsync() { * @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 job Resource Collection. + * @return job Resource Collection as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(String skipToken, Context context) { @@ -371,7 +385,7 @@ private PagedFlux listAsync(String skipToken, Context context) * * @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 job Resource Collection. + * @return job Resource Collection as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list() { @@ -387,13 +401,191 @@ public PagedIterable list() { * @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 job Resource Collection. + * @return job Resource Collection as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) 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 {@link Response} on successful completion of {@link Mono}. + */ + @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 {@link Response} on successful completion of {@link Mono}. + */ + @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 A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono markDevicesShippedAsync( + String jobName, String resourceGroupName, MarkDevicesShippedRequest markDevicesShippedRequest) { + return markDevicesShippedWithResponseAsync(jobName, resourceGroupName, markDevicesShippedRequest) + .flatMap(ignored -> 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 {@link 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. * @@ -402,7 +594,7 @@ public PagedIterable list(String skipToken, Context context) { * @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 job Resource Collection. + * @return job Resource Collection along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByResourceGroupSinglePageAsync( @@ -457,7 +649,7 @@ private Mono> listByResourceGroupSinglePageAsync * @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 job Resource Collection. + * @return job Resource Collection along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByResourceGroupSinglePageAsync( @@ -508,7 +700,7 @@ private Mono> listByResourceGroupSinglePageAsync * @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 job Resource Collection. + * @return job Resource Collection as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByResourceGroupAsync(String resourceGroupName, String skipToken) { @@ -524,7 +716,7 @@ private PagedFlux listByResourceGroupAsync(String resourceGrou * @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 job Resource Collection. + * @return job Resource Collection as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByResourceGroupAsync(String resourceGroupName) { @@ -543,7 +735,7 @@ private PagedFlux listByResourceGroupAsync(String resourceGrou * @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 job Resource Collection. + * @return job Resource Collection as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByResourceGroupAsync( @@ -560,7 +752,7 @@ private PagedFlux listByResourceGroupAsync( * @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 job Resource Collection. + * @return job Resource Collection as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByResourceGroup(String resourceGroupName) { @@ -577,7 +769,7 @@ public PagedIterable listByResourceGroup(String resourceGroupN * @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 job Resource Collection. + * @return job Resource Collection as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByResourceGroup( @@ -595,7 +787,7 @@ public PagedIterable listByResourceGroup( * @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 information about the specified job. + * @return information about the specified job along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getByResourceGroupWithResponseAsync( @@ -647,7 +839,7 @@ private Mono> getByResourceGroupWithResponseAsync( * @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 information about the specified job. + * @return information about the specified job along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getByResourceGroupWithResponseAsync( @@ -695,19 +887,12 @@ private Mono> getByResourceGroupWithResponseAsync( * @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 information about the specified job. + * @return information about the specified job on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono getByResourceGroupAsync(String resourceGroupName, String jobName, String expand) { return getByResourceGroupWithResponseAsync(resourceGroupName, jobName, expand) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -719,20 +904,13 @@ private Mono getByResourceGroupAsync(String resourceGroupName, * @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 information about the specified job. + * @return information about the specified job on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono getByResourceGroupAsync(String resourceGroupName, String jobName) { final String expand = null; return getByResourceGroupWithResponseAsync(resourceGroupName, jobName, expand) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -763,7 +941,7 @@ public JobResourceInner getByResourceGroup(String resourceGroupName, String jobN * @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 information about the specified job. + * @return information about the specified job along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getByResourceGroupWithResponse( @@ -782,7 +960,7 @@ public Response getByResourceGroupWithResponse( * @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 job Resource. + * @return job Resource along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createWithResponseAsync( @@ -840,7 +1018,7 @@ private Mono>> createWithResponseAsync( * @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 job Resource. + * @return job Resource along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createWithResponseAsync( @@ -894,16 +1072,20 @@ private Mono>> createWithResponseAsync( * @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 job Resource. + * @return the {@link PollerFlux} for polling of 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()); } /** @@ -918,9 +1100,9 @@ private PollerFlux, JobResourceInner> beginCreateAs * @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 job Resource. + * @return the {@link PollerFlux} for polling of 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); @@ -943,9 +1125,9 @@ private PollerFlux, JobResourceInner> beginCreateAs * @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 job Resource. + * @return the {@link SyncPoller} for polling of 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(); @@ -963,9 +1145,9 @@ public SyncPoller, JobResourceInner> beginCreate( * @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 job Resource. + * @return the {@link SyncPoller} for polling of 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(); @@ -982,7 +1164,7 @@ public SyncPoller, JobResourceInner> beginCreate( * @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 job Resource. + * @return job Resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono createAsync(String resourceGroupName, String jobName, JobResourceInner jobResource) { @@ -1003,7 +1185,7 @@ private Mono createAsync(String resourceGroupName, String jobN * @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 job Resource. + * @return job Resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono createAsync( @@ -1060,7 +1242,7 @@ public JobResourceInner create( * @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. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> deleteWithResponseAsync(String resourceGroupName, String jobName) { @@ -1109,7 +1291,7 @@ private Mono>> deleteWithResponseAsync(String resource * @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. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> deleteWithResponseAsync( @@ -1155,14 +1337,15 @@ private Mono>> deleteWithResponseAsync( * @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. + * @return the {@link PollerFlux} for polling of long-running operation. */ - @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()); } /** @@ -1175,9 +1358,9 @@ private PollerFlux, Void> beginDeleteAsync(String resourceGroup * @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. + * @return the {@link PollerFlux} for polling of long-running operation. */ - @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); @@ -1196,9 +1379,9 @@ private PollerFlux, Void> beginDeleteAsync( * @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. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDelete(String resourceGroupName, String jobName) { return beginDeleteAsync(resourceGroupName, jobName).getSyncPoller(); } @@ -1213,9 +1396,9 @@ public SyncPoller, Void> beginDelete(String resourceGroupName, * @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. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @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(); } @@ -1229,7 +1412,7 @@ public SyncPoller, Void> beginDelete(String resourceGroupName, * @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. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono deleteAsync(String resourceGroupName, String jobName) { @@ -1246,7 +1429,7 @@ private Mono deleteAsync(String resourceGroupName, String jobName) { * @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. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono deleteAsync(String resourceGroupName, String jobName, Context context) { @@ -1298,7 +1481,7 @@ public void delete(String resourceGroupName, String jobName, Context context) { * @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 job Resource. + * @return job Resource along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> updateWithResponseAsync( @@ -1364,7 +1547,7 @@ private Mono>> updateWithResponseAsync( * @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 job Resource. + * @return job Resource along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> updateWithResponseAsync( @@ -1427,9 +1610,9 @@ private Mono>> updateWithResponseAsync( * @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 job Resource. + * @return the {@link PollerFlux} for polling of job Resource. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, JobResourceInner> beginUpdateAsync( String resourceGroupName, String jobName, @@ -1440,7 +1623,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()); } /** @@ -1456,9 +1643,9 @@ private PollerFlux, JobResourceInner> beginUpdateAs * @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 job Resource. + * @return the {@link PollerFlux} for polling of job Resource. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, JobResourceInner> beginUpdateAsync( String resourceGroupName, String jobName, @@ -1486,9 +1673,9 @@ private PollerFlux, JobResourceInner> beginUpdateAs * @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 job Resource. + * @return the {@link SyncPoller} for polling of job Resource. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, JobResourceInner> beginUpdate( String resourceGroupName, String jobName, @@ -1510,9 +1697,9 @@ public SyncPoller, JobResourceInner> beginUpdate( * @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 job Resource. + * @return the {@link SyncPoller} for polling of job Resource. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, JobResourceInner> beginUpdate( String resourceGroupName, String jobName, @@ -1535,7 +1722,7 @@ public SyncPoller, JobResourceInner> beginUpdate( * @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 job Resource. + * @return job Resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono updateAsync( @@ -1558,7 +1745,7 @@ private Mono updateAsync( * @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 job Resource. + * @return job Resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono updateAsync( @@ -1582,7 +1769,7 @@ private Mono updateAsync( * @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 job Resource. + * @return job Resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono updateAsync( @@ -1673,7 +1860,7 @@ public JobResourceInner update( * @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 shipment pick up response. + * @return shipment pick up response along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> bookShipmentPickUpWithResponseAsync( @@ -1731,7 +1918,7 @@ private Mono> bookShipmentPickUpWithRespon * @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 shipment pick up response. + * @return shipment pick up response along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> bookShipmentPickUpWithResponseAsync( @@ -1785,20 +1972,13 @@ private Mono> bookShipmentPickUpWithRespon * @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 shipment pick up response. + * @return shipment pick up response on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono bookShipmentPickUpAsync( String resourceGroupName, String jobName, ShipmentPickUpRequest shipmentPickUpRequest) { return bookShipmentPickUpWithResponseAsync(resourceGroupName, jobName, shipmentPickUpRequest) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -1830,7 +2010,7 @@ public ShipmentPickUpResponseInner bookShipmentPickUp( * @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 shipment pick up response. + * @return shipment pick up response along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response bookShipmentPickUpWithResponse( @@ -1848,7 +2028,7 @@ public Response bookShipmentPickUpWithResponse( * @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. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> cancelWithResponseAsync( @@ -1906,7 +2086,7 @@ private Mono> cancelWithResponseAsync( * @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. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> cancelWithResponseAsync( @@ -1960,12 +2140,11 @@ private Mono> cancelWithResponseAsync( * @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. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono cancelAsync(String resourceGroupName, String jobName, CancellationReason cancellationReason) { - return cancelWithResponseAsync(resourceGroupName, jobName, cancellationReason) - .flatMap((Response res) -> Mono.empty()); + return cancelWithResponseAsync(resourceGroupName, jobName, cancellationReason).flatMap(ignored -> Mono.empty()); } /** @@ -1995,7 +2174,7 @@ public void cancel(String resourceGroupName, String jobName, CancellationReason * @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. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response cancelWithResponse( @@ -2012,7 +2191,8 @@ public Response cancelWithResponse( * @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 list of unencrypted credentials for accessing device. + * @return list of unencrypted credentials for accessing device along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listCredentialsSinglePageAsync( @@ -2066,7 +2246,8 @@ private Mono> listCredentialsSinglePa * @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 list of unencrypted credentials for accessing device. + * @return list of unencrypted credentials for accessing device along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listCredentialsSinglePageAsync( @@ -2116,7 +2297,7 @@ private Mono> listCredentialsSinglePa * @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 list of unencrypted credentials for accessing device. + * @return list of unencrypted credentials for accessing device as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listCredentialsAsync(String resourceGroupName, String jobName) { @@ -2133,7 +2314,7 @@ private PagedFlux listCredentialsAsync(String resou * @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 list of unencrypted credentials for accessing device. + * @return list of unencrypted credentials for accessing device as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listCredentialsAsync( @@ -2150,7 +2331,7 @@ private PagedFlux listCredentialsAsync( * @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 list of unencrypted credentials for accessing device. + * @return list of unencrypted credentials for accessing device as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listCredentials(String resourceGroupName, String jobName) { @@ -2167,7 +2348,7 @@ public PagedIterable listCredentials(String resourc * @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 list of unencrypted credentials for accessing device. + * @return list of unencrypted credentials for accessing device as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listCredentials( @@ -2178,11 +2359,12 @@ public PagedIterable listCredentials( /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. * @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 job Resource Collection. + * @return job Resource Collection along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { @@ -2213,12 +2395,13 @@ private Mono> listNextSinglePageAsync(String nex /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. * @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 job Resource Collection. + * @return job Resource Collection along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink, Context context) { @@ -2249,11 +2432,12 @@ private Mono> listNextSinglePageAsync(String nex /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. * @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 job Resource Collection. + * @return job Resource Collection along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { @@ -2285,12 +2469,13 @@ private Mono> listByResourceGroupNextSinglePageA /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. * @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 job Resource Collection. + * @return job Resource Collection along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByResourceGroupNextSinglePageAsync( 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 a1b270e846c8..f04d52c5d10c 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,13 +16,13 @@ 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; -import com.fasterxml.jackson.annotation.JsonIgnore; public final class JobsImpl implements Jobs { - @JsonIgnore private final ClientLogger logger = new ClientLogger(JobsImpl.class); + private static final ClientLogger LOGGER = new ClientLogger(JobsImpl.class); private final JobsClient innerClient; @@ -43,6 +43,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())); @@ -139,7 +154,7 @@ public PagedIterable listCredentials( public JobResource getById(String id) { String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -147,7 +162,7 @@ public JobResource getById(String id) { } String jobName = Utils.getValueFromIdByName(id, "jobs"); if (jobName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'jobs'.", id))); @@ -159,7 +174,7 @@ public JobResource getById(String id) { public Response getByIdWithResponse(String id, String expand, Context context) { String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -167,7 +182,7 @@ public Response getByIdWithResponse(String id, String expand, Conte } String jobName = Utils.getValueFromIdByName(id, "jobs"); if (jobName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'jobs'.", id))); @@ -178,7 +193,7 @@ public Response getByIdWithResponse(String id, String expand, Conte public void deleteById(String id) { String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -186,7 +201,7 @@ public void deleteById(String id) { } String jobName = Utils.getValueFromIdByName(id, "jobs"); if (jobName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'jobs'.", id))); @@ -197,7 +212,7 @@ public void deleteById(String id) { public void deleteByIdWithResponse(String id, Context context) { String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -205,7 +220,7 @@ public void deleteByIdWithResponse(String id, Context context) { } String jobName = Utils.getValueFromIdByName(id, "jobs"); if (jobName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'jobs'.", id))); diff --git a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/implementation/OperationsClientImpl.java b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/implementation/OperationsClientImpl.java index dfcdbfb4e323..cc7213b1c39e 100644 --- a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/implementation/OperationsClientImpl.java +++ b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/implementation/OperationsClientImpl.java @@ -25,7 +25,6 @@ import com.azure.core.management.exception.ManagementException; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.databox.fluent.OperationsClient; import com.azure.resourcemanager.databox.fluent.models.OperationInner; import com.azure.resourcemanager.databox.models.OperationList; @@ -33,8 +32,6 @@ /** An instance of this class provides access to all the operations defined in OperationsClient. */ public final class OperationsClientImpl implements OperationsClient { - private final ClientLogger logger = new ClientLogger(OperationsClientImpl.class); - /** The proxy service used to perform REST calls. */ private final OperationsService service; @@ -85,7 +82,7 @@ Mono> listNext( * * @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 operation Collection. + * @return operation Collection along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync() { @@ -118,7 +115,7 @@ private Mono> listSinglePageAsync() { * @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 operation Collection. + * @return operation Collection along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync(Context context) { @@ -148,7 +145,7 @@ private Mono> listSinglePageAsync(Context context) * * @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 operation Collection. + * @return operation Collection as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync() { @@ -162,7 +159,7 @@ private PagedFlux listAsync() { * @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 operation Collection. + * @return operation Collection as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(Context context) { @@ -175,7 +172,7 @@ private PagedFlux listAsync(Context context) { * * @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 operation Collection. + * @return operation Collection as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list() { @@ -189,7 +186,7 @@ public PagedIterable list() { * @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 operation Collection. + * @return operation Collection as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(Context context) { @@ -199,11 +196,12 @@ public PagedIterable list(Context context) { /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. * @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 operation Collection. + * @return operation Collection along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { @@ -234,12 +232,13 @@ private Mono> listNextSinglePageAsync(String nextL /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. * @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 operation Collection. + * @return operation Collection along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink, Context context) { diff --git a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/implementation/OperationsImpl.java b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/implementation/OperationsImpl.java index 86f6c14ed924..cfbd77850792 100644 --- a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/implementation/OperationsImpl.java +++ b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/implementation/OperationsImpl.java @@ -11,10 +11,9 @@ import com.azure.resourcemanager.databox.fluent.models.OperationInner; import com.azure.resourcemanager.databox.models.Operation; import com.azure.resourcemanager.databox.models.Operations; -import com.fasterxml.jackson.annotation.JsonIgnore; public final class OperationsImpl implements Operations { - @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationsImpl.class); + private static final ClientLogger LOGGER = new ClientLogger(OperationsImpl.class); private final OperationsClient innerClient; 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 c353222533c1..5b072243eaf9 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/implementation/ResourceProvidersClientImpl.java b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/implementation/ResourceProvidersClientImpl.java index 216f5fc70d43..28a6c9702029 100644 --- a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/implementation/ResourceProvidersClientImpl.java +++ b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/implementation/ResourceProvidersClientImpl.java @@ -22,15 +22,12 @@ import com.azure.core.management.exception.ManagementException; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.databox.fluent.ResourceProvidersClient; import com.azure.resourcemanager.databox.models.MitigateJobRequest; import reactor.core.publisher.Mono; /** An instance of this class provides access to all the operations defined in ResourceProvidersClient. */ public final class ResourceProvidersClientImpl implements ResourceProvidersClient { - private final ClientLogger logger = new ClientLogger(ResourceProvidersClientImpl.class); - /** The proxy service used to perform REST calls. */ private final ResourceProvidersService service; @@ -82,7 +79,7 @@ Mono> mitigate( * @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. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> mitigateWithResponseAsync( @@ -140,7 +137,7 @@ private Mono> mitigateWithResponseAsync( * @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. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> mitigateWithResponseAsync( @@ -194,12 +191,12 @@ private Mono> mitigateWithResponseAsync( * @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. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono mitigateAsync(String jobName, String resourceGroupName, MitigateJobRequest mitigateJobRequest) { return mitigateWithResponseAsync(jobName, resourceGroupName, mitigateJobRequest) - .flatMap((Response res) -> Mono.empty()); + .flatMap(ignored -> Mono.empty()); } /** @@ -229,7 +226,7 @@ public void mitigate(String jobName, String resourceGroupName, MitigateJobReques * @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. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response mitigateWithResponse( diff --git a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/implementation/ResourceProvidersImpl.java b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/implementation/ResourceProvidersImpl.java index ef10b19e9cc3..f00385d24bec 100644 --- a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/implementation/ResourceProvidersImpl.java +++ b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/implementation/ResourceProvidersImpl.java @@ -10,10 +10,9 @@ import com.azure.resourcemanager.databox.fluent.ResourceProvidersClient; import com.azure.resourcemanager.databox.models.MitigateJobRequest; import com.azure.resourcemanager.databox.models.ResourceProviders; -import com.fasterxml.jackson.annotation.JsonIgnore; public final class ResourceProvidersImpl implements ResourceProviders { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ResourceProvidersImpl.class); + private static final ClientLogger LOGGER = new ClientLogger(ResourceProvidersImpl.class); private final ResourceProvidersClient innerClient; diff --git a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/implementation/ServicesClientImpl.java b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/implementation/ServicesClientImpl.java index 3eda4a3f3eba..d785c095e2b3 100644 --- a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/implementation/ServicesClientImpl.java +++ b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/implementation/ServicesClientImpl.java @@ -27,7 +27,6 @@ import com.azure.core.management.exception.ManagementException; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.databox.fluent.ServicesClient; import com.azure.resourcemanager.databox.fluent.models.AddressValidationOutputInner; import com.azure.resourcemanager.databox.fluent.models.RegionConfigurationResponseInner; @@ -42,8 +41,6 @@ /** An instance of this class provides access to all the operations defined in ServicesClient. */ public final class ServicesClientImpl implements ServicesClient { - private final ClientLogger logger = new ClientLogger(ServicesClientImpl.class); - /** The proxy service used to perform REST calls. */ private final ServicesService service; @@ -174,7 +171,8 @@ Mono> listAvailableSkusByResourceGroupNext( * @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 available skus operation response. + * @return the available skus operation response along with {@link PagedResponse} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listAvailableSkusByResourceGroupSinglePageAsync( @@ -240,7 +238,8 @@ private Mono> listAvailableSkusByResourceGrou * @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 available skus operation response. + * @return the available skus operation response along with {@link PagedResponse} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listAvailableSkusByResourceGroupSinglePageAsync( @@ -302,7 +301,7 @@ private Mono> listAvailableSkusByResourceGrou * @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 available skus operation response. + * @return the available skus operation response as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAvailableSkusByResourceGroupAsync( @@ -322,7 +321,7 @@ private PagedFlux listAvailableSkusByResourceGroupAsync( * @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 available skus operation response. + * @return the available skus operation response as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAvailableSkusByResourceGroupAsync( @@ -343,7 +342,7 @@ private PagedFlux listAvailableSkusByResourceGroupAsync( * @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 available skus operation response. + * @return the available skus operation response as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listAvailableSkusByResourceGroup( @@ -362,7 +361,7 @@ public PagedIterable listAvailableSkusByResourceGroup( * @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 available skus operation response. + * @return the available skus operation response as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listAvailableSkusByResourceGroup( @@ -380,7 +379,8 @@ public PagedIterable listAvailableSkusByResourceGroup( * @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 output of the address validation api. + * @return output of the address validation api along with {@link Response} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> validateAddressWithResponseAsync( @@ -432,7 +432,8 @@ private Mono> validateAddressWithResponse * @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 output of the address validation api. + * @return output of the address validation api along with {@link Response} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> validateAddressWithResponseAsync( @@ -480,19 +481,12 @@ private Mono> validateAddressWithResponse * @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 output of the address validation api. + * @return output of the address validation api on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono validateAddressAsync(String location, ValidateAddress validateAddress) { return validateAddressWithResponseAsync(location, validateAddress) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -521,7 +515,7 @@ public AddressValidationOutputInner validateAddress(String location, ValidateAdd * @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 output of the address validation api. + * @return output of the address validation api along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response validateAddressWithResponse( @@ -538,7 +532,8 @@ public Response validateAddressWithResponse( * @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 response of pre job creation validations. + * @return response of pre job creation validations along with {@link Response} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> validateInputsByResourceGroupWithResponseAsync( @@ -595,7 +590,8 @@ private Mono> validateInputsByResourceGroupWit * @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 response of pre job creation validations. + * @return response of pre job creation validations along with {@link Response} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> validateInputsByResourceGroupWithResponseAsync( @@ -648,20 +644,13 @@ private Mono> validateInputsByResourceGroupWit * @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 response of pre job creation validations. + * @return response of pre job creation validations on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono validateInputsByResourceGroupAsync( String resourceGroupName, String location, ValidationRequest validationRequest) { return validateInputsByResourceGroupWithResponseAsync(resourceGroupName, location, validationRequest) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -691,7 +680,7 @@ public ValidationResponseInner validateInputsByResourceGroup( * @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 response of pre job creation validations. + * @return response of pre job creation validations along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response validateInputsByResourceGroupWithResponse( @@ -708,7 +697,8 @@ public Response validateInputsByResourceGroupWithRespon * @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 response of pre job creation validations. + * @return response of pre job creation validations along with {@link Response} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> validateInputsWithResponseAsync( @@ -759,7 +749,8 @@ private Mono> validateInputsWithResponseAsync( * @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 response of pre job creation validations. + * @return response of pre job creation validations along with {@link Response} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> validateInputsWithResponseAsync( @@ -806,19 +797,12 @@ private Mono> validateInputsWithResponseAsync( * @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 response of pre job creation validations. + * @return response of pre job creation validations on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono validateInputsAsync(String location, ValidationRequest validationRequest) { return validateInputsWithResponseAsync(location, validationRequest) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -845,7 +829,7 @@ public ValidationResponseInner validateInputs(String location, ValidationRequest * @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 response of pre job creation validations. + * @return response of pre job creation validations along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response validateInputsWithResponse( @@ -861,7 +845,8 @@ public Response validateInputsWithResponse( * @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 configuration response specific to a region. + * @return configuration response specific to a region along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> regionConfigurationWithResponseAsync( @@ -914,7 +899,8 @@ private Mono> regionConfigurationWith * @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 configuration response specific to a region. + * @return configuration response specific to a region along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> regionConfigurationWithResponseAsync( @@ -963,20 +949,13 @@ private Mono> regionConfigurationWith * @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 configuration response specific to a region. + * @return configuration response specific to a region on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono regionConfigurationAsync( String location, RegionConfigurationRequest regionConfigurationRequest) { return regionConfigurationWithResponseAsync(location, regionConfigurationRequest) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -1004,7 +983,7 @@ public RegionConfigurationResponseInner regionConfiguration( * @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 configuration response specific to a region. + * @return configuration response specific to a region along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response regionConfigurationWithResponse( @@ -1021,7 +1000,8 @@ public Response regionConfigurationWithRespons * @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 configuration response specific to a region. + * @return configuration response specific to a region along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> regionConfigurationByResourceGroupWithResponseAsync( @@ -1080,7 +1060,8 @@ private Mono> regionConfigurationByRe * @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 configuration response specific to a region. + * @return configuration response specific to a region along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> regionConfigurationByResourceGroupWithResponseAsync( @@ -1138,21 +1119,14 @@ private Mono> regionConfigurationByRe * @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 configuration response specific to a region. + * @return configuration response specific to a region on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono regionConfigurationByResourceGroupAsync( String resourceGroupName, String location, RegionConfigurationRequest regionConfigurationRequest) { return regionConfigurationByResourceGroupWithResponseAsync( resourceGroupName, location, regionConfigurationRequest) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -1182,7 +1156,7 @@ public RegionConfigurationResponseInner regionConfigurationByResourceGroup( * @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 configuration response specific to a region. + * @return configuration response specific to a region along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response regionConfigurationByResourceGroupWithResponse( @@ -1198,11 +1172,13 @@ public Response regionConfigurationByResourceG /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. * @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 available skus operation response. + * @return the available skus operation response along with {@link PagedResponse} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listAvailableSkusByResourceGroupNextSinglePageAsync( @@ -1236,12 +1212,14 @@ private Mono> listAvailableSkusByResourceGrou /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. * @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 available skus operation response. + * @return the available skus operation response along with {@link PagedResponse} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listAvailableSkusByResourceGroupNextSinglePageAsync( diff --git a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/implementation/ServicesImpl.java b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/implementation/ServicesImpl.java index c6185b32fc3a..1d43ebd3eab0 100644 --- a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/implementation/ServicesImpl.java +++ b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/implementation/ServicesImpl.java @@ -23,10 +23,9 @@ import com.azure.resourcemanager.databox.models.ValidateAddress; import com.azure.resourcemanager.databox.models.ValidationRequest; import com.azure.resourcemanager.databox.models.ValidationResponse; -import com.fasterxml.jackson.annotation.JsonIgnore; public final class ServicesImpl implements Services { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ServicesImpl.class); + private static final ClientLogger LOGGER = new ClientLogger(ServicesImpl.class); private final ServicesClient innerClient; diff --git a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/AccessProtocol.java b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/AccessProtocol.java index 428280949772..91c7b560e989 100644 --- a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/AccessProtocol.java +++ b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/AccessProtocol.java @@ -30,6 +30,9 @@ public enum AccessProtocol { */ @JsonCreator public static AccessProtocol fromString(String value) { + if (value == null) { + return null; + } AccessProtocol[] items = AccessProtocol.values(); for (AccessProtocol item : items) { if (item.toString().equalsIgnoreCase(value)) { @@ -39,6 +42,7 @@ public static AccessProtocol fromString(String value) { return null; } + /** {@inheritDoc} */ @JsonValue @Override public String toString() { diff --git a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/AccountCredentialDetails.java b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/AccountCredentialDetails.java index 19b8eae7ae31..d26c74721c93 100644 --- a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/AccountCredentialDetails.java +++ b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/AccountCredentialDetails.java @@ -5,16 +5,12 @@ 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 java.util.List; /** Credential details of the account. */ @Immutable public final class AccountCredentialDetails { - @JsonIgnore private final ClientLogger logger = new ClientLogger(AccountCredentialDetails.class); - /* * Name of the account. */ @@ -28,8 +24,7 @@ public final class AccountCredentialDetails { private DataAccountType dataAccountType; /* - * Connection string of the account endpoint to use the account as a - * storage endpoint on the device. + * Connection string of the account endpoint to use the account as a storage endpoint on the device. */ @JsonProperty(value = "accountConnectionString", access = JsonProperty.Access.WRITE_ONLY) private String accountConnectionString; diff --git a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/AdditionalErrorInfo.java b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/AdditionalErrorInfo.java index 0cb7fbafdea6..a82672dcbed3 100644 --- a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/AdditionalErrorInfo.java +++ b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/AdditionalErrorInfo.java @@ -5,64 +5,60 @@ 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; -/** Additional error info. */ +/** This class represents additional info which Resource Providers pass when an error occurs. */ @Fluent public final class AdditionalErrorInfo { - @JsonIgnore private final ClientLogger logger = new ClientLogger(AdditionalErrorInfo.class); - /* - * Additional error type. + * Additional information of the type of error. */ - @JsonProperty(value = "type") - private String type; + @JsonProperty(value = "info") + private Object info; /* - * Additional error info. + * Type of error (e.g. CustomerIntervention, PolicyViolation, SecurityViolation). */ - @JsonProperty(value = "info") - private Object info; + @JsonProperty(value = "type") + private String type; /** - * Get the type property: Additional error type. + * Get the info property: Additional information of the type of error. * - * @return the type value. + * @return the info value. */ - public String type() { - return this.type; + public Object info() { + return this.info; } /** - * Set the type property: Additional error type. + * Set the info property: Additional information of the type of error. * - * @param type the type value to set. + * @param info the info value to set. * @return the AdditionalErrorInfo object itself. */ - public AdditionalErrorInfo withType(String type) { - this.type = type; + public AdditionalErrorInfo withInfo(Object info) { + this.info = info; return this; } /** - * Get the info property: Additional error info. + * Get the type property: Type of error (e.g. CustomerIntervention, PolicyViolation, SecurityViolation). * - * @return the info value. + * @return the type value. */ - public Object info() { - return this.info; + public String type() { + return this.type; } /** - * Set the info property: Additional error info. + * Set the type property: Type of error (e.g. CustomerIntervention, PolicyViolation, SecurityViolation). * - * @param info the info value to set. + * @param type the type value to set. * @return the AdditionalErrorInfo object itself. */ - public AdditionalErrorInfo withInfo(Object info) { - this.info = info; + public AdditionalErrorInfo withType(String type) { + this.type = type; return this; } diff --git a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/AddressType.java b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/AddressType.java index a9d21bf78be4..12cc340b214c 100644 --- a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/AddressType.java +++ b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/AddressType.java @@ -7,7 +7,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; -/** Defines values for AddressType. */ +/** Type of address. */ public enum AddressType { /** Enum value None. */ NONE("None"), @@ -33,6 +33,9 @@ public enum AddressType { */ @JsonCreator public static AddressType fromString(String value) { + if (value == null) { + return null; + } AddressType[] items = AddressType.values(); for (AddressType item : items) { if (item.toString().equalsIgnoreCase(value)) { @@ -42,6 +45,7 @@ public static AddressType fromString(String value) { return null; } + /** {@inheritDoc} */ @JsonValue @Override public String toString() { 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 002bfb8d2374..9e1846368141 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/AddressValidationStatus.java b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/AddressValidationStatus.java index f3732ad14a7f..6d4a918c4cc5 100644 --- a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/AddressValidationStatus.java +++ b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/AddressValidationStatus.java @@ -7,7 +7,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; -/** Defines values for AddressValidationStatus. */ +/** The address validation status. */ public enum AddressValidationStatus { /** Enum value Valid. */ VALID("Valid"), @@ -33,6 +33,9 @@ public enum AddressValidationStatus { */ @JsonCreator public static AddressValidationStatus fromString(String value) { + if (value == null) { + return null; + } AddressValidationStatus[] items = AddressValidationStatus.values(); for (AddressValidationStatus item : items) { if (item.toString().equalsIgnoreCase(value)) { @@ -42,6 +45,7 @@ public static AddressValidationStatus fromString(String value) { return null; } + /** {@inheritDoc} */ @JsonValue @Override public String toString() { diff --git a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/ApplianceNetworkConfiguration.java b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/ApplianceNetworkConfiguration.java index da077c46e075..d44b8a5ce60d 100644 --- a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/ApplianceNetworkConfiguration.java +++ b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/ApplianceNetworkConfiguration.java @@ -5,15 +5,11 @@ 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; /** The Network Adapter configuration of a DataBox. */ @Immutable public final class ApplianceNetworkConfiguration { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ApplianceNetworkConfiguration.class); - /* * Name of the network. */ diff --git a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/AvailableSkuRequest.java b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/AvailableSkuRequest.java index dcf63c9e1a20..e76ee1310faf 100644 --- a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/AvailableSkuRequest.java +++ b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/AvailableSkuRequest.java @@ -6,15 +6,12 @@ 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 java.util.List; /** The filters for showing the available skus. */ @Fluent public final class AvailableSkuRequest { - @JsonIgnore private final ClientLogger logger = new ClientLogger(AvailableSkuRequest.class); - /* * Type of the transfer. */ @@ -132,20 +129,22 @@ public AvailableSkuRequest withSkuNames(List skuNames) { */ public void validate() { if (transferType() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( "Missing required property transferType in model AvailableSkuRequest")); } if (country() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException("Missing required property country in model AvailableSkuRequest")); } if (location() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException("Missing required property location in model AvailableSkuRequest")); } } + + private static final ClientLogger LOGGER = new ClientLogger(AvailableSkuRequest.class); } diff --git a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/AvailableSkusResult.java b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/AvailableSkusResult.java index c259babeabc0..702f5fcce29e 100644 --- a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/AvailableSkusResult.java +++ b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/AvailableSkusResult.java @@ -5,17 +5,13 @@ package com.azure.resourcemanager.databox.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.databox.fluent.models.SkuInformationInner; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; /** The available skus operation response. */ @Fluent public final class AvailableSkusResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(AvailableSkusResult.class); - /* * List of available skus. */ diff --git a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/AzureFileFilterDetails.java b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/AzureFileFilterDetails.java index 85113e427086..547b939a9b6d 100644 --- a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/AzureFileFilterDetails.java +++ b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/AzureFileFilterDetails.java @@ -5,16 +5,12 @@ 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 java.util.List; /** Filter details to transfer Azure files. */ @Fluent public final class AzureFileFilterDetails { - @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureFileFilterDetails.class); - /* * Prefix list of the Azure files to be transferred. */ diff --git a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/BlobFilterDetails.java b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/BlobFilterDetails.java index e3758ddafad2..8c4555bdd4c1 100644 --- a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/BlobFilterDetails.java +++ b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/BlobFilterDetails.java @@ -5,16 +5,12 @@ 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 java.util.List; /** Filter details to transfer Azure Blobs. */ @Fluent public final class BlobFilterDetails { - @JsonIgnore private final ClientLogger logger = new ClientLogger(BlobFilterDetails.class); - /* * Prefix list of the Azure blobs to be transferred. */ diff --git a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/CancellationReason.java b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/CancellationReason.java index 5f35b1766402..7cef268bca61 100644 --- a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/CancellationReason.java +++ b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/CancellationReason.java @@ -6,14 +6,11 @@ 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; /** Reason for cancellation. */ @Fluent public final class CancellationReason { - @JsonIgnore private final ClientLogger logger = new ClientLogger(CancellationReason.class); - /* * Reason for cancellation. */ @@ -47,9 +44,11 @@ public CancellationReason withReason(String reason) { */ public void validate() { if (reason() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException("Missing required property reason in model CancellationReason")); } } + + private static final ClientLogger LOGGER = new ClientLogger(CancellationReason.class); } 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 ed8c15ed4f9b..cc7439da658e 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 @@ -7,7 +7,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; -/** Defines values for ClassDiscriminator. */ +/** Indicates the type of job details. */ public enum ClassDiscriminator { /** Enum value DataBox. */ DATA_BOX("DataBox"), @@ -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; @@ -33,6 +36,9 @@ public enum ClassDiscriminator { */ @JsonCreator public static ClassDiscriminator fromString(String value) { + if (value == null) { + return null; + } ClassDiscriminator[] items = ClassDiscriminator.values(); for (ClassDiscriminator item : items) { if (item.toString().equalsIgnoreCase(value)) { @@ -42,6 +48,7 @@ public static ClassDiscriminator fromString(String value) { return null; } + /** {@inheritDoc} */ @JsonValue @Override public String toString() { diff --git a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/CloudError.java b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/CloudError.java index e5dadd1f540e..451ae68bdffb 100644 --- a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/CloudError.java +++ b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/CloudError.java @@ -5,48 +5,53 @@ 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 java.util.List; -/** Cloud error. */ +/** Provides additional information about an http error response. */ @Fluent public final class CloudError { - @JsonIgnore private final ClientLogger logger = new ClientLogger(CloudError.class); + /* + * Gets or sets additional error info. + */ + @JsonProperty(value = "additionalInfo", access = JsonProperty.Access.WRITE_ONLY) + private List additionalInfo; /* - * Cloud error code. + * Error code. */ @JsonProperty(value = "code") private String code; /* - * Cloud error message. + * Gets or sets details for the error. + */ + @JsonProperty(value = "details", access = JsonProperty.Access.WRITE_ONLY) + private List details; + + /* + * The error message parsed from the body of the http error response. */ @JsonProperty(value = "message") private String message; /* - * Cloud error target. + * Gets or sets the target of the error. */ @JsonProperty(value = "target") private String target; - /* - * Cloud error details. - */ - @JsonProperty(value = "details", access = JsonProperty.Access.WRITE_ONLY) - private List details; - - /* - * Cloud error additional info. + /** + * Get the additionalInfo property: Gets or sets additional error info. + * + * @return the additionalInfo value. */ - @JsonProperty(value = "additionalInfo", access = JsonProperty.Access.WRITE_ONLY) - private List additionalInfo; + public List additionalInfo() { + return this.additionalInfo; + } /** - * Get the code property: Cloud error code. + * Get the code property: Error code. * * @return the code value. */ @@ -55,7 +60,7 @@ public String code() { } /** - * Set the code property: Cloud error code. + * Set the code property: Error code. * * @param code the code value to set. * @return the CloudError object itself. @@ -66,7 +71,16 @@ public CloudError withCode(String code) { } /** - * Get the message property: Cloud error message. + * Get the details property: Gets or sets details for the error. + * + * @return the details value. + */ + public List details() { + return this.details; + } + + /** + * Get the message property: The error message parsed from the body of the http error response. * * @return the message value. */ @@ -75,7 +89,7 @@ public String message() { } /** - * Set the message property: Cloud error message. + * Set the message property: The error message parsed from the body of the http error response. * * @param message the message value to set. * @return the CloudError object itself. @@ -86,7 +100,7 @@ public CloudError withMessage(String message) { } /** - * Get the target property: Cloud error target. + * Get the target property: Gets or sets the target of the error. * * @return the target value. */ @@ -95,7 +109,7 @@ public String target() { } /** - * Set the target property: Cloud error target. + * Set the target property: Gets or sets the target of the error. * * @param target the target value to set. * @return the CloudError object itself. @@ -105,35 +119,17 @@ public CloudError withTarget(String target) { return this; } - /** - * Get the details property: Cloud error details. - * - * @return the details value. - */ - public List details() { - return this.details; - } - - /** - * Get the additionalInfo property: Cloud error additional info. - * - * @return the additionalInfo value. - */ - public List additionalInfo() { - return this.additionalInfo; - } - /** * Validates the instance. * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (details() != null) { - details().forEach(e -> e.validate()); - } if (additionalInfo() != null) { additionalInfo().forEach(e -> e.validate()); } + if (details() != null) { + details().forEach(e -> e.validate()); + } } } diff --git a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/ContactDetails.java b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/ContactDetails.java index f0c33ee0a3ea..208524b075df 100644 --- a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/ContactDetails.java +++ b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/ContactDetails.java @@ -6,15 +6,12 @@ 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 java.util.List; /** Contact Details. */ @Fluent public final class ContactDetails { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ContactDetails.class); - /* * Contact name of the person. */ @@ -178,17 +175,17 @@ public ContactDetails withNotificationPreference(List no */ public void validate() { if (contactName() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException("Missing required property contactName in model ContactDetails")); } if (phone() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException("Missing required property phone in model ContactDetails")); } if (emailList() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException("Missing required property emailList in model ContactDetails")); } @@ -196,4 +193,6 @@ public void validate() { notificationPreference().forEach(e -> e.validate()); } } + + private static final ClientLogger LOGGER = new ClientLogger(ContactDetails.class); } 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 a0993099f911..80cac020a69f 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 @@ -5,8 +5,6 @@ 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.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; @@ -20,13 +18,12 @@ @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) }) @Immutable public class CopyLogDetails { - @JsonIgnore private final ClientLogger logger = new ClientLogger(CopyLogDetails.class); - /** * Validates the instance. * 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 3a2ed7377975..37cf8f3a790d 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 @@ -5,18 +5,13 @@ 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; /** Copy progress. */ @Immutable -public final class CopyProgress { - @JsonIgnore private final ClientLogger logger = new ClientLogger(CopyProgress.class); - +public class CopyProgress { /* - * Name of the storage account. This will be empty for data account types - * other than storage account. + * Name of the storage account. This will be empty for data account types other than storage account. */ @JsonProperty(value = "storageAccountName", access = JsonProperty.Access.WRITE_ONLY) private String storageAccountName; @@ -64,22 +59,19 @@ public final class CopyProgress { private Long totalFilesToProcess; /* - * Number of files not adhering to azure naming conventions which were - * processed by automatic renaming + * Number of files not adhering to azure naming conventions which were processed by automatic renaming */ @JsonProperty(value = "invalidFilesProcessed", access = JsonProperty.Access.WRITE_ONLY) private Long invalidFilesProcessed; /* - * Total amount of data not adhering to azure naming conventions which were - * processed by automatic renaming + * Total amount of data not adhering to azure naming conventions which were processed by automatic renaming */ @JsonProperty(value = "invalidFileBytesUploaded", access = JsonProperty.Access.WRITE_ONLY) private Long invalidFileBytesUploaded; /* - * Number of folders not adhering to azure naming conventions which were - * processed by automatic renaming + * Number of folders not adhering to azure naming conventions which were processed by automatic renaming */ @JsonProperty(value = "renamedContainerCount", access = JsonProperty.Access.WRITE_ONLY) private Long renamedContainerCount; 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 0cd8c193a3c1..32accfba15e5 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,83 @@ 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"), +/** The Status of the copy. */ +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; + /** + * Gets known CopyStatus values. + * + * @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 9f38df9a6765..62dd3ac570a3 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,9 +4,7 @@ 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.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import java.util.List; @@ -14,10 +12,8 @@ /** 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); - /** {@inheritDoc} */ @Override public CreateJobValidations withIndividualRequestDetails(List individualRequestDetails) { diff --git a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/CreateOrderLimitForSubscriptionValidationRequest.java b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/CreateOrderLimitForSubscriptionValidationRequest.java index 7fdd71254fe0..785312892c54 100644 --- a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/CreateOrderLimitForSubscriptionValidationRequest.java +++ b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/CreateOrderLimitForSubscriptionValidationRequest.java @@ -6,7 +6,6 @@ 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 com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; @@ -16,9 +15,6 @@ @JsonTypeName("ValidateCreateOrderLimit") @Fluent public final class CreateOrderLimitForSubscriptionValidationRequest extends ValidationInputRequest { - @JsonIgnore - private final ClientLogger logger = new ClientLogger(CreateOrderLimitForSubscriptionValidationRequest.class); - /* * Device type to be used for the job. */ @@ -54,11 +50,13 @@ public CreateOrderLimitForSubscriptionValidationRequest withDeviceType(SkuName d public void validate() { super.validate(); if (deviceType() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( "Missing required property deviceType in model" + " CreateOrderLimitForSubscriptionValidationRequest")); } } + + private static final ClientLogger LOGGER = new ClientLogger(CreateOrderLimitForSubscriptionValidationRequest.class); } diff --git a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/CreateOrderLimitForSubscriptionValidationResponseProperties.java b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/CreateOrderLimitForSubscriptionValidationResponseProperties.java index fcd923a843b9..8b49810ed541 100644 --- a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/CreateOrderLimitForSubscriptionValidationResponseProperties.java +++ b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/CreateOrderLimitForSubscriptionValidationResponseProperties.java @@ -5,8 +5,6 @@ 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; @@ -16,10 +14,6 @@ @JsonTypeName("ValidateCreateOrderLimit") @Immutable public final class CreateOrderLimitForSubscriptionValidationResponseProperties extends ValidationInputResponse { - @JsonIgnore - private final ClientLogger logger = - new ClientLogger(CreateOrderLimitForSubscriptionValidationResponseProperties.class); - /* * Create order limit validation status. */ 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 000000000000..6a609a99afdb --- /dev/null +++ b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/CustomerDiskJobSecrets.java @@ -0,0 +1,60 @@ +// 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.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 { + /* + * 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/CustomerResolutionCode.java b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/CustomerResolutionCode.java index fa43d83764ef..f861725afc3b 100644 --- a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/CustomerResolutionCode.java +++ b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/CustomerResolutionCode.java @@ -16,7 +16,13 @@ public enum CustomerResolutionCode { MOVE_TO_CLEAN_UP_DEVICE("MoveToCleanUpDevice"), /** Enum value Resume. */ - RESUME("Resume"); + RESUME("Resume"), + + /** Enum value Restart. */ + RESTART("Restart"), + + /** Enum value ReachOutToOperation. */ + REACH_OUT_TO_OPERATION("ReachOutToOperation"); /** The actual serialized value for a CustomerResolutionCode instance. */ private final String value; @@ -33,6 +39,9 @@ public enum CustomerResolutionCode { */ @JsonCreator public static CustomerResolutionCode fromString(String value) { + if (value == null) { + return null; + } CustomerResolutionCode[] items = CustomerResolutionCode.values(); for (CustomerResolutionCode item : items) { if (item.toString().equalsIgnoreCase(value)) { @@ -42,6 +51,7 @@ public static CustomerResolutionCode fromString(String value) { return null; } + /** {@inheritDoc} */ @JsonValue @Override public String toString() { diff --git a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/DataAccountDetails.java b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/DataAccountDetails.java index 049c81468c7f..5467cb701d27 100644 --- a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/DataAccountDetails.java +++ b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/DataAccountDetails.java @@ -5,8 +5,6 @@ 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 com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; @@ -25,17 +23,12 @@ }) @Fluent public class DataAccountDetails { - @JsonIgnore private final ClientLogger logger = new ClientLogger(DataAccountDetails.class); - /* - * Password for all the shares to be created on the device. Should not be - * passed for TransferType:ExportFromAzure jobs. If this is not passed, the - * service will generate password itself. This will not be returned in Get - * Call. Password Requirements : Password must be minimum of 12 and - * maximum of 64 characters. Password must have at least one uppercase - * alphabet, one number and one special character. Password cannot have the - * following characters : IilLoO0 Password can have only alphabets, numbers - * and these characters : @#\-$%^!+=;:_()]+ + * Password for all the shares to be created on the device. Should not be passed for TransferType:ExportFromAzure + * jobs. If this is not passed, the service will generate password itself. This will not be returned in Get Call. + * Password Requirements : Password must be minimum of 12 and maximum of 64 characters. Password must have at + * least one uppercase alphabet, one number and one special character. Password cannot have the following + * characters : IilLoO0 Password can have only alphabets, numbers and these characters : @#\-$%^!+=;:_()]+ */ @JsonProperty(value = "sharePassword") private String sharePassword; diff --git a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/DataAccountType.java b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/DataAccountType.java index 5353affea236..57227f328552 100644 --- a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/DataAccountType.java +++ b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/DataAccountType.java @@ -7,7 +7,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; -/** Defines values for DataAccountType. */ +/** Type of the account. */ public enum DataAccountType { /** Enum value StorageAccount. */ STORAGE_ACCOUNT("StorageAccount"), @@ -30,6 +30,9 @@ public enum DataAccountType { */ @JsonCreator public static DataAccountType fromString(String value) { + if (value == null) { + return null; + } DataAccountType[] items = DataAccountType.values(); for (DataAccountType item : items) { if (item.toString().equalsIgnoreCase(value)) { @@ -39,6 +42,7 @@ public static DataAccountType fromString(String value) { return null; } + /** {@inheritDoc} */ @JsonValue @Override public String toString() { diff --git a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/DataBoxAccountCopyLogDetails.java b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/DataBoxAccountCopyLogDetails.java index 953c14c5aa6c..7db850a17c07 100644 --- a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/DataBoxAccountCopyLogDetails.java +++ b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/DataBoxAccountCopyLogDetails.java @@ -5,8 +5,6 @@ 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; @@ -16,8 +14,6 @@ @JsonTypeName("DataBox") @Immutable public final class DataBoxAccountCopyLogDetails extends CopyLogDetails { - @JsonIgnore private final ClientLogger logger = new ClientLogger(DataBoxAccountCopyLogDetails.class); - /* * Account name. */ @@ -31,8 +27,7 @@ public final class DataBoxAccountCopyLogDetails extends CopyLogDetails { private String copyLogLink; /* - * Link for copy verbose logs. This will be set only when - * LogCollectionLevel is set to Verbose. + * Link for copy verbose logs. This will be set only when LogCollectionLevel is set to Verbose. */ @JsonProperty(value = "copyVerboseLogLink", access = JsonProperty.Access.WRITE_ONLY) private String copyVerboseLogLink; 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 000000000000..56030a5d525d --- /dev/null +++ b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/DataBoxCustomerDiskCopyLogDetails.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.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 { + /* + * 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 000000000000..284b9b3e3d89 --- /dev/null +++ b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/DataBoxCustomerDiskCopyProgress.java @@ -0,0 +1,52 @@ +// 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.fasterxml.jackson.annotation.JsonProperty; + +/** DataBox CustomerDisk Copy Progress. */ +@Immutable +public final class DataBoxCustomerDiskCopyProgress extends CopyProgress { + /* + * 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 000000000000..0fe401e12618 --- /dev/null +++ b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/DataBoxCustomerDiskJobDetails.java @@ -0,0 +1,248 @@ +// 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.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 { + /* + * 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(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(DataBoxCustomerDiskJobDetails.class); +} diff --git a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/DataBoxDiskCopyLogDetails.java b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/DataBoxDiskCopyLogDetails.java index cb49c32f85d2..ac6ea97831f2 100644 --- a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/DataBoxDiskCopyLogDetails.java +++ b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/DataBoxDiskCopyLogDetails.java @@ -5,8 +5,6 @@ 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; @@ -16,8 +14,6 @@ @JsonTypeName("DataBoxDisk") @Immutable public final class DataBoxDiskCopyLogDetails extends CopyLogDetails { - @JsonIgnore private final ClientLogger logger = new ClientLogger(DataBoxDiskCopyLogDetails.class); - /* * Disk Serial Number. */ diff --git a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/DataBoxDiskCopyProgress.java b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/DataBoxDiskCopyProgress.java index cdfce7ef8bb4..2739fe109955 100644 --- a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/DataBoxDiskCopyProgress.java +++ b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/DataBoxDiskCopyProgress.java @@ -5,15 +5,11 @@ 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 Disk Copy Progress. */ @Immutable public final class DataBoxDiskCopyProgress { - @JsonIgnore private final ClientLogger logger = new ClientLogger(DataBoxDiskCopyProgress.class); - /* * The serial number of the disk */ diff --git a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/DataBoxDiskGranularCopyLogDetails.java b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/DataBoxDiskGranularCopyLogDetails.java new file mode 100644 index 000000000000..bb53ca26aae9 --- /dev/null +++ b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/DataBoxDiskGranularCopyLogDetails.java @@ -0,0 +1,86 @@ +// 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.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Granular Copy Log Details for customer disk. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "copyLogDetailsType") +@JsonTypeName("DataBoxCustomerDisk") +@Immutable +public final class DataBoxDiskGranularCopyLogDetails extends GranularCopyLogDetails { + /* + * Disk Serial Number. + */ + @JsonProperty(value = "serialNumber", access = JsonProperty.Access.WRITE_ONLY) + private String serialNumber; + + /* + * Account name. + */ + @JsonProperty(value = "accountName", access = JsonProperty.Access.WRITE_ONLY) + private String accountName; + + /* + * 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 accountName property: Account name. + * + * @return the accountName value. + */ + public String accountName() { + return this.accountName; + } + + /** + * 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/DataBoxDiskGranularCopyProgress.java b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/DataBoxDiskGranularCopyProgress.java new file mode 100644 index 000000000000..89893bf10350 --- /dev/null +++ b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/DataBoxDiskGranularCopyProgress.java @@ -0,0 +1,52 @@ +// 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.fasterxml.jackson.annotation.JsonProperty; + +/** DataBox Disk Granular Copy Progress. */ +@Immutable +public final class DataBoxDiskGranularCopyProgress extends GranularCopyProgress { + /* + * 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/DataBoxDiskJobDetails.java b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/DataBoxDiskJobDetails.java index 1d1cfb6fd582..d3eac560bcf2 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 @@ -5,8 +5,7 @@ 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; @@ -18,14 +17,12 @@ @JsonTypeName("DataBoxDisk") @Fluent public final class DataBoxDiskJobDetails extends JobDetails { - @JsonIgnore private final ClientLogger logger = new ClientLogger(DataBoxDiskJobDetails.class); - /* - * User preference on what size disks are needed for the job. The map is - * from the disk size in TB to the count. Eg. {2,5} means 5 disks of 2 TB - * size. Key is string but will be checked against an int. + * User preference on what size disks are needed for the job. The map is from the disk size in TB to the count. Eg. + * {2,5} means 5 disks of 2 TB 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; /* @@ -35,10 +32,23 @@ public final class DataBoxDiskJobDetails extends JobDetails { private List copyProgress; /* - * Contains the map of disk serial number to the disk size being used for - * the job. Is returned only after the disks are shipped to the customer. + * Copy progress per disk. + */ + @JsonProperty(value = "granularCopyProgress", access = JsonProperty.Access.WRITE_ONLY) + private List granularCopyProgress; + + /* + * Copy progress per disk. + */ + @JsonProperty(value = "granularCopyLogDetails", access = JsonProperty.Access.WRITE_ONLY) + private List granularCopyLogDetails; + + /* + * Contains the map of disk serial number to the disk size being used for 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; /* @@ -80,6 +90,24 @@ public List copyProgress() { return this.copyProgress; } + /** + * Get the granularCopyProgress property: Copy progress per disk. + * + * @return the granularCopyProgress value. + */ + public List granularCopyProgress() { + return this.granularCopyProgress; + } + + /** + * Get the granularCopyLogDetails property: Copy progress per disk. + * + * @return the granularCopyLogDetails value. + */ + public List granularCopyLogDetails() { + return this.granularCopyLogDetails; + } + /** * Get the disksAndSizeDetails property: Contains the map of disk serial number to the disk size being used for the * job. Is returned only after the disks are shipped to the customer. @@ -170,5 +198,11 @@ public void validate() { if (copyProgress() != null) { copyProgress().forEach(e -> e.validate()); } + if (granularCopyProgress() != null) { + granularCopyProgress().forEach(e -> e.validate()); + } + if (granularCopyLogDetails() != null) { + granularCopyLogDetails().forEach(e -> e.validate()); + } } } diff --git a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/DataBoxDiskJobSecrets.java b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/DataBoxDiskJobSecrets.java index c103d295e9c8..28257bdceb29 100644 --- a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/DataBoxDiskJobSecrets.java +++ b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/DataBoxDiskJobSecrets.java @@ -5,8 +5,6 @@ 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; @@ -17,8 +15,6 @@ @JsonTypeName("DataBoxDisk") @Immutable public final class DataBoxDiskJobSecrets extends JobSecrets { - @JsonIgnore private final ClientLogger logger = new ClientLogger(DataBoxDiskJobSecrets.class); - /* * Contains the list of secrets object for that device. */ diff --git a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/DataBoxHeavyAccountCopyLogDetails.java b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/DataBoxHeavyAccountCopyLogDetails.java index 3f5ddca12cde..f350df15cc74 100644 --- a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/DataBoxHeavyAccountCopyLogDetails.java +++ b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/DataBoxHeavyAccountCopyLogDetails.java @@ -5,8 +5,6 @@ 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; @@ -17,8 +15,6 @@ @JsonTypeName("DataBoxHeavy") @Immutable public final class DataBoxHeavyAccountCopyLogDetails extends CopyLogDetails { - @JsonIgnore private final ClientLogger logger = new ClientLogger(DataBoxHeavyAccountCopyLogDetails.class); - /* * Account name. */ @@ -32,8 +28,7 @@ public final class DataBoxHeavyAccountCopyLogDetails extends CopyLogDetails { private List copyLogLink; /* - * Link for copy verbose logs. This will be set only when the - * LogCollectionLevel is set to verbose. + * Link for copy verbose logs. This will be set only when the LogCollectionLevel is set to verbose. */ @JsonProperty(value = "copyVerboseLogLink", access = JsonProperty.Access.WRITE_ONLY) private List copyVerboseLogLink; diff --git a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/DataBoxHeavyJobDetails.java b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/DataBoxHeavyJobDetails.java index 3880949671fa..d5aaacda99fb 100644 --- a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/DataBoxHeavyJobDetails.java +++ b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/DataBoxHeavyJobDetails.java @@ -5,8 +5,6 @@ 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 com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; @@ -17,8 +15,6 @@ @JsonTypeName("DataBoxHeavy") @Fluent public final class DataBoxHeavyJobDetails extends JobDetails { - @JsonIgnore private final ClientLogger logger = new ClientLogger(DataBoxHeavyJobDetails.class); - /* * Copy progress per account. */ @@ -26,14 +22,11 @@ public final class DataBoxHeavyJobDetails extends JobDetails { private List copyProgress; /* - * Set Device password for unlocking Databox Heavy. Should not be passed - * for TransferType:ExportFromAzure jobs. If this is not passed, the - * service will generate password itself. This will not be returned in Get - * Call. Password Requirements : Password must be minimum of 12 and - * maximum of 64 characters. Password must have at least one uppercase - * alphabet, one number and one special character. Password cannot have the - * following characters : IilLoO0 Password can have only alphabets, numbers - * and these characters : @#\-$%^!+=;:_()]+ + * Set Device password for unlocking Databox Heavy. Should not be passed for TransferType:ExportFromAzure jobs. If + * this is not passed, the service will generate password itself. This will not be returned in Get Call. Password + * Requirements : Password must be minimum of 12 and maximum of 64 characters. Password must have at least one + * uppercase alphabet, one number and one special character. Password cannot have the following characters : + * IilLoO0 Password can have only alphabets, numbers and these characters : @#\-$%^!+=;:_()]+ */ @JsonProperty(value = "devicePassword") private String devicePassword; diff --git a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/DataBoxHeavyJobSecrets.java b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/DataBoxHeavyJobSecrets.java index 3e757614ac66..a11b85aaf4a9 100644 --- a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/DataBoxHeavyJobSecrets.java +++ b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/DataBoxHeavyJobSecrets.java @@ -5,8 +5,6 @@ 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; @@ -17,8 +15,6 @@ @JsonTypeName("DataBoxHeavy") @Immutable public final class DataBoxHeavyJobSecrets extends JobSecrets { - @JsonIgnore private final ClientLogger logger = new ClientLogger(DataBoxHeavyJobSecrets.class); - /* * Contains the list of secret objects for a databox heavy job. */ diff --git a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/DataBoxHeavySecret.java b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/DataBoxHeavySecret.java index 38ffcf1046bb..d75e9ce74908 100644 --- a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/DataBoxHeavySecret.java +++ b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/DataBoxHeavySecret.java @@ -5,16 +5,12 @@ 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 java.util.List; /** The secrets related to a databox heavy. */ @Immutable public final class DataBoxHeavySecret { - @JsonIgnore private final ClientLogger logger = new ClientLogger(DataBoxHeavySecret.class); - /* * Serial number of the assigned device. */ diff --git a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/DataBoxJobDetails.java b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/DataBoxJobDetails.java index 390eb0d174e4..38a4307af07f 100644 --- a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/DataBoxJobDetails.java +++ b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/DataBoxJobDetails.java @@ -5,8 +5,6 @@ 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 com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; @@ -17,8 +15,6 @@ @JsonTypeName("DataBox") @Fluent public final class DataBoxJobDetails extends JobDetails { - @JsonIgnore private final ClientLogger logger = new ClientLogger(DataBoxJobDetails.class); - /* * Copy progress per storage account. */ @@ -26,14 +22,11 @@ public final class DataBoxJobDetails extends JobDetails { private List copyProgress; /* - * Set Device password for unlocking Databox. Should not be passed for - * TransferType:ExportFromAzure jobs. If this is not passed, the service - * will generate password itself. This will not be returned in Get Call. - * Password Requirements : Password must be minimum of 12 and maximum of - * 64 characters. Password must have at least one uppercase alphabet, one - * number and one special character. Password cannot have the following - * characters : IilLoO0 Password can have only alphabets, numbers and these - * characters : @#\-$%^!+=;:_()]+ + * Set Device password for unlocking Databox. Should not be passed for TransferType:ExportFromAzure jobs. If this + * is not passed, the service will generate password itself. This will not be returned in Get Call. Password + * Requirements : Password must be minimum of 12 and maximum of 64 characters. Password must have at least one + * uppercase alphabet, one number and one special character. Password cannot have the following characters : + * IilLoO0 Password can have only alphabets, numbers and these characters : @#\-$%^!+=;:_()]+ */ @JsonProperty(value = "devicePassword") private String devicePassword; 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 fa4bae81f8ac..74cbe46ccb54 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,19 +4,15 @@ 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.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; /** 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); - /** {@inheritDoc} */ @Override public DataBoxScheduleAvailabilityRequest withStorageLocation(String storageLocation) { diff --git a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/DataBoxSecret.java b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/DataBoxSecret.java index f167a14cf3a2..2ab7205a663d 100644 --- a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/DataBoxSecret.java +++ b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/DataBoxSecret.java @@ -5,16 +5,12 @@ 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 java.util.List; /** The secrets related to a DataBox. */ @Immutable public final class DataBoxSecret { - @JsonIgnore private final ClientLogger logger = new ClientLogger(DataBoxSecret.class); - /* * Serial number of the assigned device. */ 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 000000000000..9e7ead914601 --- /dev/null +++ b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/DataCenterCode.java @@ -0,0 +1,209 @@ +// 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; + +/** DataCenter code. */ +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"); + + /** Static value DUB07 for DataCenterCode. */ + public static final DataCenterCode DUB07 = fromString("DUB07"); + + /** Static value PNQ01 for DataCenterCode. */ + public static final DataCenterCode PNQ01 = fromString("PNQ01"); + + /** Static value SVG20 for DataCenterCode. */ + public static final DataCenterCode SVG20 = fromString("SVG20"); + + /** Static value OSA02 for DataCenterCode. */ + public static final DataCenterCode OSA02 = fromString("OSA02"); + + /** Static value OSA22 for DataCenterCode. */ + public static final DataCenterCode OSA22 = fromString("OSA22"); + + /** Static value PAR22 for DataCenterCode. */ + public static final DataCenterCode PAR22 = fromString("PAR22"); + + /** Static value BN7 for DataCenterCode. */ + public static final DataCenterCode BN7 = fromString("BN7"); + + /** Static value SN6 for DataCenterCode. */ + public static final DataCenterCode SN6 = fromString("SN6"); + + /** Static value BJS20 for DataCenterCode. */ + public static final DataCenterCode BJS20 = fromString("BJS20"); + + /** + * 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); + } + + /** + * Gets known DataCenterCode values. + * + * @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/DataExportDetails.java b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/DataExportDetails.java index 8ee7b3516f05..c92f6eedd9e4 100644 --- a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/DataExportDetails.java +++ b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/DataExportDetails.java @@ -6,14 +6,11 @@ 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; /** Details of the data to be used for exporting data from azure. */ @Fluent public final class DataExportDetails { - @JsonIgnore private final ClientLogger logger = new ClientLogger(DataExportDetails.class); - /* * Configuration for the data transfer. */ @@ -99,7 +96,7 @@ public DataExportDetails withAccountDetails(DataAccountDetails accountDetails) { */ public void validate() { if (transferConfiguration() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( "Missing required property transferConfiguration in model DataExportDetails")); @@ -107,7 +104,7 @@ public void validate() { transferConfiguration().validate(); } if (accountDetails() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( "Missing required property accountDetails in model DataExportDetails")); @@ -115,4 +112,6 @@ public void validate() { accountDetails().validate(); } } + + private static final ClientLogger LOGGER = new ClientLogger(DataExportDetails.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 f86b61b6df67..6f2f90878fd4 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 @@ -6,20 +6,23 @@ 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; /** Details of the data to be used for importing data to azure. */ @Fluent public final class DataImportDetails { - @JsonIgnore private final ClientLogger logger = new ClientLogger(DataImportDetails.class); - /* * Account details of the data to be transferred */ @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 +43,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. * @@ -47,7 +70,7 @@ public DataImportDetails withAccountDetails(DataAccountDetails accountDetails) { */ public void validate() { if (accountDetails() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( "Missing required property accountDetails in model DataImportDetails")); @@ -55,4 +78,6 @@ public void validate() { accountDetails().validate(); } } + + private static final ClientLogger LOGGER = new ClientLogger(DataImportDetails.class); } diff --git a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/DataLocationToServiceLocationMap.java b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/DataLocationToServiceLocationMap.java index 3e94788c4e4f..5186033debaf 100644 --- a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/DataLocationToServiceLocationMap.java +++ b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/DataLocationToServiceLocationMap.java @@ -5,15 +5,11 @@ 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; /** Map of data location to service location. */ @Immutable public final class DataLocationToServiceLocationMap { - @JsonIgnore private final ClientLogger logger = new ClientLogger(DataLocationToServiceLocationMap.class); - /* * Location of the data. */ diff --git a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/DataTransferDetailsValidationRequest.java b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/DataTransferDetailsValidationRequest.java index 07ec1a9e45b7..60d9593f81af 100644 --- a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/DataTransferDetailsValidationRequest.java +++ b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/DataTransferDetailsValidationRequest.java @@ -6,7 +6,6 @@ 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 com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; @@ -17,8 +16,6 @@ @JsonTypeName("ValidateDataTransferDetails") @Fluent public final class DataTransferDetailsValidationRequest extends ValidationInputRequest { - @JsonIgnore private final ClientLogger logger = new ClientLogger(DataTransferDetailsValidationRequest.class); - /* * List of DataTransfer details to be used to export data from azure. */ @@ -138,16 +135,18 @@ public void validate() { dataImportDetails().forEach(e -> e.validate()); } if (deviceType() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( "Missing required property deviceType in model DataTransferDetailsValidationRequest")); } if (transferType() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( "Missing required property transferType in model DataTransferDetailsValidationRequest")); } } + + private static final ClientLogger LOGGER = new ClientLogger(DataTransferDetailsValidationRequest.class); } diff --git a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/DataTransferDetailsValidationResponseProperties.java b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/DataTransferDetailsValidationResponseProperties.java index a4e30bfdc46b..f47e69099811 100644 --- a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/DataTransferDetailsValidationResponseProperties.java +++ b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/DataTransferDetailsValidationResponseProperties.java @@ -5,8 +5,6 @@ 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; @@ -16,9 +14,6 @@ @JsonTypeName("ValidateDataTransferDetails") @Immutable public final class DataTransferDetailsValidationResponseProperties extends ValidationInputResponse { - @JsonIgnore - private final ClientLogger logger = new ClientLogger(DataTransferDetailsValidationResponseProperties.class); - /* * Data transfer details validation status. */ diff --git a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/DataboxJobSecrets.java b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/DataboxJobSecrets.java index e7043682d824..68b86fbc48b5 100644 --- a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/DataboxJobSecrets.java +++ b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/DataboxJobSecrets.java @@ -5,8 +5,6 @@ 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 com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; @@ -17,8 +15,6 @@ @JsonTypeName("DataBox") @Fluent public final class DataboxJobSecrets extends JobSecrets { - @JsonIgnore private final ClientLogger logger = new ClientLogger(DataboxJobSecrets.class); - /* * Contains the list of secret objects for a job. */ 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 000000000000..96625b46c934 --- /dev/null +++ b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/DatacenterAddressInstructionResponse.java @@ -0,0 +1,41 @@ +// 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.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 { + /* + * 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 000000000000..d0718093adc1 --- /dev/null +++ b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/DatacenterAddressLocationResponse.java @@ -0,0 +1,221 @@ +// 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.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 { + /* + * 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 000000000000..5c20b4529f05 --- /dev/null +++ b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/DatacenterAddressRequest.java @@ -0,0 +1,90 @@ +// 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.JsonProperty; + +/** Request body to get the datacenter address. */ +@Fluent +public final class DatacenterAddressRequest { + /* + * 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")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(DatacenterAddressRequest.class); +} 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 000000000000..19a7a2f8572f --- /dev/null +++ b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/DatacenterAddressResponse.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.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 { + /* + * 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 000000000000..38f5e59f2ffd --- /dev/null +++ b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/DatacenterAddressType.java @@ -0,0 +1,51 @@ +// 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; + +/** Data center address type. */ +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) { + if (value == null) { + return null; + } + DatacenterAddressType[] items = DatacenterAddressType.values(); + for (DatacenterAddressType item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + /** {@inheritDoc} */ + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/DcAccessSecurityCode.java b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/DcAccessSecurityCode.java index 3073553bde82..6be2e7025011 100644 --- a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/DcAccessSecurityCode.java +++ b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/DcAccessSecurityCode.java @@ -5,15 +5,11 @@ 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; /** Dc access security code. */ @Fluent public final class DcAccessSecurityCode { - @JsonIgnore private final ClientLogger logger = new ClientLogger(DcAccessSecurityCode.class); - /* * Reverse Dc access security code. */ diff --git a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/DeviceErasureDetails.java b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/DeviceErasureDetails.java new file mode 100644 index 000000000000..cf50bcbb2c44 --- /dev/null +++ b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/DeviceErasureDetails.java @@ -0,0 +1,51 @@ +// 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.fasterxml.jackson.annotation.JsonProperty; + +/** Device erasure details with erasure completion status and erasureordestructionlog sas key. */ +@Immutable +public final class DeviceErasureDetails { + /* + * Holds the device erasure completion status + */ + @JsonProperty(value = "deviceErasureStatus", access = JsonProperty.Access.WRITE_ONLY) + private StageStatus deviceErasureStatus; + + /* + * Shared access key to download cleanup or destruction certificate for device + */ + @JsonProperty(value = "erasureOrDestructionCertificateSasKey", access = JsonProperty.Access.WRITE_ONLY) + private String erasureOrDestructionCertificateSasKey; + + /** + * Get the deviceErasureStatus property: Holds the device erasure completion status. + * + * @return the deviceErasureStatus value. + */ + public StageStatus deviceErasureStatus() { + return this.deviceErasureStatus; + } + + /** + * Get the erasureOrDestructionCertificateSasKey property: Shared access key to download cleanup or destruction + * certificate for device. + * + * @return the erasureOrDestructionCertificateSasKey value. + */ + public String erasureOrDestructionCertificateSasKey() { + return this.erasureOrDestructionCertificateSasKey; + } + + /** + * 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/DiskScheduleAvailabilityRequest.java b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/DiskScheduleAvailabilityRequest.java index 2678990ec206..5a0d36efcb22 100644 --- a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/DiskScheduleAvailabilityRequest.java +++ b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/DiskScheduleAvailabilityRequest.java @@ -5,8 +5,6 @@ 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 com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; @@ -16,11 +14,8 @@ @JsonTypeName("DataBoxDisk") @Fluent public final class DiskScheduleAvailabilityRequest extends ScheduleAvailabilityRequest { - @JsonIgnore private final ClientLogger logger = new ClientLogger(DiskScheduleAvailabilityRequest.class); - /* - * The expected size of the data, which needs to be transferred in this - * job, in terabytes. + * The expected size of the data, which needs to be transferred in this job, in terabytes. */ @JsonProperty(value = "expectedDataSizeInTeraBytes", required = true) private int expectedDataSizeInTeraBytes; diff --git a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/DiskSecret.java b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/DiskSecret.java index 928790986a51..d4619eb498ad 100644 --- a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/DiskSecret.java +++ b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/DiskSecret.java @@ -5,15 +5,11 @@ 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; /** Contains all the secrets of a Disk. */ @Immutable public final class DiskSecret { - @JsonIgnore private final ClientLogger logger = new ClientLogger(DiskSecret.class); - /* * Serial number of the assigned disk. */ @@ -21,8 +17,7 @@ public final class DiskSecret { private String diskSerialNumber; /* - * Bit Locker key of the disk which can be used to unlock the disk to copy - * data. + * Bit Locker key of the disk which can be used to unlock the disk to copy data. */ @JsonProperty(value = "bitLockerKey", access = JsonProperty.Access.WRITE_ONLY) private String bitLockerKey; diff --git a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/DoubleEncryption.java b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/DoubleEncryption.java index b8d076aeb635..e14059909551 100644 --- a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/DoubleEncryption.java +++ b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/DoubleEncryption.java @@ -7,7 +7,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; -/** Defines values for DoubleEncryption. */ +/** Defines secondary layer of software-based encryption enablement. */ public enum DoubleEncryption { /** Enum value Enabled. */ ENABLED("Enabled"), @@ -30,6 +30,9 @@ public enum DoubleEncryption { */ @JsonCreator public static DoubleEncryption fromString(String value) { + if (value == null) { + return null; + } DoubleEncryption[] items = DoubleEncryption.values(); for (DoubleEncryption item : items) { if (item.toString().equalsIgnoreCase(value)) { @@ -39,6 +42,7 @@ public static DoubleEncryption fromString(String value) { return null; } + /** {@inheritDoc} */ @JsonValue @Override public String toString() { diff --git a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/EncryptionPreferences.java b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/EncryptionPreferences.java index bae7ba757982..15b63ffb9856 100644 --- a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/EncryptionPreferences.java +++ b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/EncryptionPreferences.java @@ -5,15 +5,11 @@ 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; /** Preferences related to the Encryption. */ @Fluent public final class EncryptionPreferences { - @JsonIgnore private final ClientLogger logger = new ClientLogger(EncryptionPreferences.class); - /* * Defines secondary layer of software-based encryption enablement. */ 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 000000000000..f91b5d9cd6ab --- /dev/null +++ b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/ExportDiskDetails.java @@ -0,0 +1,66 @@ +// 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.fasterxml.jackson.annotation.JsonProperty; + +/** Export disk details. */ +@Immutable +public final class ExportDiskDetails { + /* + * 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/FilterFileDetails.java b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/FilterFileDetails.java index 00fce152ea34..2d6be34e7682 100644 --- a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/FilterFileDetails.java +++ b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/FilterFileDetails.java @@ -6,14 +6,11 @@ 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; /** Details of the filter files to be used for data transfer. */ @Fluent public final class FilterFileDetails { - @JsonIgnore private final ClientLogger logger = new ClientLogger(FilterFileDetails.class); - /* * Type of the filter file. */ @@ -73,16 +70,18 @@ public FilterFileDetails withFilterFilePath(String filterFilePath) { */ public void validate() { if (filterFileType() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( "Missing required property filterFileType in model FilterFileDetails")); } if (filterFilePath() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( "Missing required property filterFilePath in model FilterFileDetails")); } } + + private static final ClientLogger LOGGER = new ClientLogger(FilterFileDetails.class); } diff --git a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/FilterFileType.java b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/FilterFileType.java index 8af235aebeb1..78addc9e9a4b 100644 --- a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/FilterFileType.java +++ b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/FilterFileType.java @@ -7,7 +7,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; -/** Defines values for FilterFileType. */ +/** Type of the filter file. */ public enum FilterFileType { /** Enum value AzureBlob. */ AZURE_BLOB("AzureBlob"), @@ -30,6 +30,9 @@ public enum FilterFileType { */ @JsonCreator public static FilterFileType fromString(String value) { + if (value == null) { + return null; + } FilterFileType[] items = FilterFileType.values(); for (FilterFileType item : items) { if (item.toString().equalsIgnoreCase(value)) { @@ -39,6 +42,7 @@ public static FilterFileType fromString(String value) { return null; } + /** {@inheritDoc} */ @JsonValue @Override public String toString() { diff --git a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/GranularCopyLogDetails.java b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/GranularCopyLogDetails.java new file mode 100644 index 000000000000..a8b44ebe9346 --- /dev/null +++ b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/GranularCopyLogDetails.java @@ -0,0 +1,29 @@ +// 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.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Granular Details for log generated during copy. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "copyLogDetailsType", + defaultImpl = GranularCopyLogDetails.class) +@JsonTypeName("GranularCopyLogDetails") +@JsonSubTypes({@JsonSubTypes.Type(name = "DataBoxCustomerDisk", value = DataBoxDiskGranularCopyLogDetails.class)}) +@Immutable +public class GranularCopyLogDetails { + /** + * 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/GranularCopyProgress.java b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/GranularCopyProgress.java new file mode 100644 index 000000000000..c57d97827fc9 --- /dev/null +++ b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/GranularCopyProgress.java @@ -0,0 +1,251 @@ +// 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.fasterxml.jackson.annotation.JsonProperty; + +/** Granular Copy progress. */ +@Immutable +public class GranularCopyProgress { + /* + * Name of the storage account. This will be empty for data account types other than storage account. + */ + @JsonProperty(value = "storageAccountName", access = JsonProperty.Access.WRITE_ONLY) + private String storageAccountName; + + /* + * Transfer type of data + */ + @JsonProperty(value = "transferType", access = JsonProperty.Access.WRITE_ONLY) + private TransferType transferType; + + /* + * Data Account Type. + */ + @JsonProperty(value = "dataAccountType", access = JsonProperty.Access.WRITE_ONLY) + private DataAccountType dataAccountType; + + /* + * Id of the account where the data needs to be uploaded. + */ + @JsonProperty(value = "accountId", access = JsonProperty.Access.WRITE_ONLY) + private String accountId; + + /* + * To indicate bytes transferred. + */ + @JsonProperty(value = "bytesProcessed", access = JsonProperty.Access.WRITE_ONLY) + private Long bytesProcessed; + + /* + * Total amount of data to be processed by the job. + */ + @JsonProperty(value = "totalBytesToProcess", access = JsonProperty.Access.WRITE_ONLY) + private Long totalBytesToProcess; + + /* + * Number of files processed + */ + @JsonProperty(value = "filesProcessed", access = JsonProperty.Access.WRITE_ONLY) + private Long filesProcessed; + + /* + * Total files to process + */ + @JsonProperty(value = "totalFilesToProcess", access = JsonProperty.Access.WRITE_ONLY) + private Long totalFilesToProcess; + + /* + * Number of files not adhering to azure naming conventions which were processed by automatic renaming + */ + @JsonProperty(value = "invalidFilesProcessed", access = JsonProperty.Access.WRITE_ONLY) + private Long invalidFilesProcessed; + + /* + * Total amount of data not adhering to azure naming conventions which were processed by automatic renaming + */ + @JsonProperty(value = "invalidFileBytesUploaded", access = JsonProperty.Access.WRITE_ONLY) + private Long invalidFileBytesUploaded; + + /* + * Number of folders not adhering to azure naming conventions which were processed by automatic renaming + */ + @JsonProperty(value = "renamedContainerCount", access = JsonProperty.Access.WRITE_ONLY) + private Long renamedContainerCount; + + /* + * Number of files which could not be copied + */ + @JsonProperty(value = "filesErroredOut", access = JsonProperty.Access.WRITE_ONLY) + private Long filesErroredOut; + + /* + * To indicate directories errored out in the job. + */ + @JsonProperty(value = "directoriesErroredOut", access = JsonProperty.Access.WRITE_ONLY) + private Long directoriesErroredOut; + + /* + * To indicate directories renamed + */ + @JsonProperty(value = "invalidDirectoriesProcessed", access = JsonProperty.Access.WRITE_ONLY) + private Long invalidDirectoriesProcessed; + + /* + * To indicate if enumeration of data is in progress. + * Until this is true, the TotalBytesToProcess may not be valid. + */ + @JsonProperty(value = "isEnumerationInProgress", access = JsonProperty.Access.WRITE_ONLY) + private Boolean isEnumerationInProgress; + + /** + * Get the storageAccountName property: Name of the storage account. This will be empty for data account types other + * than storage account. + * + * @return the storageAccountName value. + */ + public String storageAccountName() { + return this.storageAccountName; + } + + /** + * Get the transferType property: Transfer type of data. + * + * @return the transferType value. + */ + public TransferType transferType() { + return this.transferType; + } + + /** + * Get the dataAccountType property: Data Account Type. + * + * @return the dataAccountType value. + */ + public DataAccountType dataAccountType() { + return this.dataAccountType; + } + + /** + * Get the accountId property: Id of the account where the data needs to be uploaded. + * + * @return the accountId value. + */ + public String accountId() { + return this.accountId; + } + + /** + * Get the bytesProcessed property: To indicate bytes transferred. + * + * @return the bytesProcessed value. + */ + public Long bytesProcessed() { + return this.bytesProcessed; + } + + /** + * Get the totalBytesToProcess property: Total amount of data to be processed by the job. + * + * @return the totalBytesToProcess value. + */ + public Long totalBytesToProcess() { + return this.totalBytesToProcess; + } + + /** + * Get the filesProcessed property: Number of files processed. + * + * @return the filesProcessed value. + */ + public Long filesProcessed() { + return this.filesProcessed; + } + + /** + * Get the totalFilesToProcess property: Total files to process. + * + * @return the totalFilesToProcess value. + */ + public Long totalFilesToProcess() { + return this.totalFilesToProcess; + } + + /** + * Get the invalidFilesProcessed property: Number of files not adhering to azure naming conventions which were + * processed by automatic renaming. + * + * @return the invalidFilesProcessed value. + */ + public Long invalidFilesProcessed() { + return this.invalidFilesProcessed; + } + + /** + * Get the invalidFileBytesUploaded property: Total amount of data not adhering to azure naming conventions which + * were processed by automatic renaming. + * + * @return the invalidFileBytesUploaded value. + */ + public Long invalidFileBytesUploaded() { + return this.invalidFileBytesUploaded; + } + + /** + * Get the renamedContainerCount property: Number of folders not adhering to azure naming conventions which were + * processed by automatic renaming. + * + * @return the renamedContainerCount value. + */ + public Long renamedContainerCount() { + return this.renamedContainerCount; + } + + /** + * Get the filesErroredOut property: Number of files which could not be copied. + * + * @return the filesErroredOut value. + */ + public Long filesErroredOut() { + return this.filesErroredOut; + } + + /** + * Get the directoriesErroredOut property: To indicate directories errored out in the job. + * + * @return the directoriesErroredOut value. + */ + public Long directoriesErroredOut() { + return this.directoriesErroredOut; + } + + /** + * Get the invalidDirectoriesProcessed property: To indicate directories renamed. + * + * @return the invalidDirectoriesProcessed value. + */ + public Long invalidDirectoriesProcessed() { + return this.invalidDirectoriesProcessed; + } + + /** + * Get the isEnumerationInProgress property: To indicate if enumeration of data is in progress. Until this is true, + * the TotalBytesToProcess may not be valid. + * + * @return the isEnumerationInProgress value. + */ + public Boolean isEnumerationInProgress() { + return this.isEnumerationInProgress; + } + + /** + * 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 18a1a3222c30..fd180d1e1bb3 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,19 +4,15 @@ 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.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; /** 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); - /** {@inheritDoc} */ @Override public HeavyScheduleAvailabilityRequest withStorageLocation(String storageLocation) { diff --git a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/IdentityProperties.java b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/IdentityProperties.java index b873a3500fbf..77f04d93e2ba 100644 --- a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/IdentityProperties.java +++ b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/IdentityProperties.java @@ -5,15 +5,11 @@ 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; /** Managed identity properties. */ @Fluent public final class IdentityProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(IdentityProperties.class); - /* * Managed service identity type. */ 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 000000000000..5c112cb7b5ec --- /dev/null +++ b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/ImportDiskDetails.java @@ -0,0 +1,132 @@ +// 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.JsonProperty; + +/** Import disk details. */ +@Fluent +public final class ImportDiskDetails { + /* + * 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")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ImportDiskDetails.class); +} diff --git a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/JobDeliveryInfo.java b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/JobDeliveryInfo.java index 4142e5d455d7..8d6dc522da94 100644 --- a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/JobDeliveryInfo.java +++ b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/JobDeliveryInfo.java @@ -5,16 +5,12 @@ 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 java.time.OffsetDateTime; /** Additional delivery info. */ @Fluent public final class JobDeliveryInfo { - @JsonIgnore private final ClientLogger logger = new ClientLogger(JobDeliveryInfo.class); - /* * Scheduled date time. */ diff --git a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/JobDeliveryType.java b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/JobDeliveryType.java index f6e89ba0258e..ff6b27d3da53 100644 --- a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/JobDeliveryType.java +++ b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/JobDeliveryType.java @@ -7,7 +7,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; -/** Defines values for JobDeliveryType. */ +/** Delivery type of Job. */ public enum JobDeliveryType { /** Enum value NonScheduled. */ NON_SCHEDULED("NonScheduled"), @@ -30,6 +30,9 @@ public enum JobDeliveryType { */ @JsonCreator public static JobDeliveryType fromString(String value) { + if (value == null) { + return null; + } JobDeliveryType[] items = JobDeliveryType.values(); for (JobDeliveryType item : items) { if (item.toString().equalsIgnoreCase(value)) { @@ -39,6 +42,7 @@ public static JobDeliveryType fromString(String value) { return null; } + /** {@inheritDoc} */ @JsonValue @Override public String toString() { 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 ffd7b72d547e..ea087c92d903 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 @@ -6,7 +6,6 @@ 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 com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; @@ -21,14 +20,13 @@ 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) }) @Fluent public class JobDetails { - @JsonIgnore private final ClientLogger logger = new ClientLogger(JobDetails.class); - /* * List of stages that run in the job. */ @@ -95,6 +93,12 @@ public class JobDetails { @JsonProperty(value = "chainOfCustodySasKey", access = JsonProperty.Access.WRITE_ONLY) private String chainOfCustodySasKey; + /* + * Holds device data erasure details + */ + @JsonProperty(value = "deviceErasureDetails", access = JsonProperty.Access.WRITE_ONLY) + private DeviceErasureDetails deviceErasureDetails; + /* * Details about which key encryption type is being used. */ @@ -102,8 +106,7 @@ public class JobDetails { private KeyEncryptionKey keyEncryptionKey; /* - * The expected size of the data, which needs to be transferred in this - * job, in terabytes. + * The expected size of the data, which needs to be transferred in this job, in terabytes. */ @JsonProperty(value = "expectedDataSizeInTeraBytes") private Integer expectedDataSizeInTeraBytes; @@ -120,6 +123,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. * @@ -274,6 +289,15 @@ public String chainOfCustodySasKey() { return this.chainOfCustodySasKey; } + /** + * Get the deviceErasureDetails property: Holds device data erasure details. + * + * @return the deviceErasureDetails value. + */ + public DeviceErasureDetails deviceErasureDetails() { + return this.deviceErasureDetails; + } + /** * Get the keyEncryptionKey property: Details about which key encryption type is being used. * @@ -334,6 +358,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. * @@ -344,7 +386,7 @@ public void validate() { jobStages().forEach(e -> e.validate()); } if (contactDetails() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException("Missing required property contactDetails in model JobDetails")); } else { @@ -371,11 +413,19 @@ public void validate() { if (copyLogDetails() != null) { copyLogDetails().forEach(e -> e.validate()); } + if (deviceErasureDetails() != null) { + deviceErasureDetails().validate(); + } if (keyEncryptionKey() != null) { keyEncryptionKey().validate(); } if (lastMitigationActionOnJob() != null) { lastMitigationActionOnJob().validate(); } + if (datacenterAddress() != null) { + datacenterAddress().validate(); + } } + + private static final ClientLogger LOGGER = new ClientLogger(JobDetails.class); } 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 a4909f3bbcce..1947da8c4883 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. * @@ -176,6 +176,13 @@ public interface JobResource { */ String regionName(); + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + /** * Gets the inner com.azure.resourcemanager.databox.fluent.models.JobResourceInner object. * @@ -188,8 +195,8 @@ interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, DefinitionStages.WithResourceGroup, - DefinitionStages.WithTransferType, DefinitionStages.WithSku, + DefinitionStages.WithTransferType, DefinitionStages.WithCreate { } /** The JobResource definition stages. */ @@ -223,27 +230,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 +258,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 +287,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 +328,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 +416,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 {@link Response}. + */ + Response markDevicesShippedWithResponse(MarkDevicesShippedRequest markDevicesShippedRequest, Context context); + /** * Book shipment pick up. * @@ -428,7 +457,7 @@ interface WithIfMatch { * @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 shipment pick up response. + * @return shipment pick up response along with {@link Response}. */ Response bookShipmentPickUpWithResponse( ShipmentPickUpRequest shipmentPickUpRequest, Context context); @@ -451,7 +480,7 @@ Response bookShipmentPickUpWithResponse( * @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. + * @return the {@link Response}. */ Response cancelWithResponse(CancellationReason cancellationReason, Context context); @@ -460,7 +489,7 @@ Response bookShipmentPickUpWithResponse( * * @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 list of unencrypted credentials for accessing device. + * @return list of unencrypted credentials for accessing device as paginated response with {@link PagedIterable}. */ PagedIterable listCredentials(); @@ -471,7 +500,7 @@ Response bookShipmentPickUpWithResponse( * @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 list of unencrypted credentials for accessing device. + * @return list of unencrypted credentials for accessing device as paginated response with {@link PagedIterable}. */ PagedIterable listCredentials(Context context); } diff --git a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/JobResourceList.java b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/JobResourceList.java index 710e166a4f7d..04c870b8d78c 100644 --- a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/JobResourceList.java +++ b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/JobResourceList.java @@ -5,17 +5,13 @@ package com.azure.resourcemanager.databox.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.databox.fluent.models.JobResourceInner; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; /** Job Resource Collection. */ @Fluent public final class JobResourceList { - @JsonIgnore private final ClientLogger logger = new ClientLogger(JobResourceList.class); - /* * List of job resources. */ 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 15b225e52f56..54a57b80a9ea 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,26 @@ 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.fasterxml.jackson.annotation.JsonIgnore; +import com.azure.resourcemanager.databox.fluent.models.UpdateJobProperties; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.Map; /** The JobResourceUpdateParameter. */ -@JsonFlatten @Fluent -public class JobResourceUpdateParameter { - @JsonIgnore private final ClientLogger logger = new ClientLogger(JobResourceUpdateParameter.class); +public final class JobResourceUpdateParameter { + /* + * 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). + * 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 +33,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 +90,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 +100,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 +113,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 35a61793e93b..2d930bf7d0fc 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 @@ -5,8 +5,6 @@ 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; @@ -20,14 +18,13 @@ 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) }) @Immutable public class JobSecrets { - @JsonIgnore private final ClientLogger logger = new ClientLogger(JobSecrets.class); - /* * Dc Access Security Code for Customer Managed Shipping */ diff --git a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/JobStages.java b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/JobStages.java index d2d1cb69e774..382add229816 100644 --- a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/JobStages.java +++ b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/JobStages.java @@ -5,16 +5,12 @@ 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 java.time.OffsetDateTime; /** Job stages. */ @Immutable public final class JobStages { - @JsonIgnore private final ClientLogger logger = new ClientLogger(JobStages.class); - /* * Name of the job stage. */ 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 0983bba6aa1a..7abdf10f01aa 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 @@ -15,7 +15,7 @@ public interface Jobs { * * @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 job Resource Collection. + * @return job Resource Collection as paginated response with {@link PagedIterable}. */ PagedIterable list(); @@ -27,10 +27,40 @@ public interface Jobs { * @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 job Resource Collection. + * @return job Resource Collection as paginated response with {@link PagedIterable}. */ 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 {@link Response}. + */ + Response markDevicesShippedWithResponse( + String jobName, String resourceGroupName, MarkDevicesShippedRequest markDevicesShippedRequest, Context context); + /** * Lists all the jobs available under the given resource group. * @@ -38,7 +68,7 @@ public interface Jobs { * @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 job Resource Collection. + * @return job Resource Collection as paginated response with {@link PagedIterable}. */ PagedIterable listByResourceGroup(String resourceGroupName); @@ -51,7 +81,7 @@ public interface Jobs { * @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 job Resource Collection. + * @return job Resource Collection as paginated response with {@link PagedIterable}. */ PagedIterable listByResourceGroup(String resourceGroupName, String skipToken, Context context); @@ -79,7 +109,7 @@ public interface Jobs { * @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 information about the specified job. + * @return information about the specified job along with {@link Response}. */ Response getByResourceGroupWithResponse( String resourceGroupName, String jobName, String expand, Context context); @@ -135,7 +165,7 @@ ShipmentPickUpResponse bookShipmentPickUp( * @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 shipment pick up response. + * @return shipment pick up response along with {@link Response}. */ Response bookShipmentPickUpWithResponse( String resourceGroupName, String jobName, ShipmentPickUpRequest shipmentPickUpRequest, Context context); @@ -164,7 +194,7 @@ Response bookShipmentPickUpWithResponse( * @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. + * @return the {@link Response}. */ Response cancelWithResponse( String resourceGroupName, String jobName, CancellationReason cancellationReason, Context context); @@ -178,7 +208,7 @@ Response cancelWithResponse( * @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 list of unencrypted credentials for accessing device. + * @return list of unencrypted credentials for accessing device as paginated response with {@link PagedIterable}. */ PagedIterable listCredentials(String resourceGroupName, String jobName); @@ -192,7 +222,7 @@ Response cancelWithResponse( * @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 list of unencrypted credentials for accessing device. + * @return list of unencrypted credentials for accessing device as paginated response with {@link PagedIterable}. */ PagedIterable listCredentials(String resourceGroupName, String jobName, Context context); @@ -203,7 +233,7 @@ Response cancelWithResponse( * @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 information about the specified job. + * @return information about the specified job along with {@link Response}. */ JobResource getById(String id); @@ -216,7 +246,7 @@ Response cancelWithResponse( * @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 information about the specified job. + * @return information about the specified job along with {@link Response}. */ Response getByIdWithResponse(String id, String expand, Context context); diff --git a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/KekType.java b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/KekType.java index ebe1fbd53561..fc8570d3b533 100644 --- a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/KekType.java +++ b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/KekType.java @@ -7,7 +7,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; -/** Defines values for KekType. */ +/** Type of encryption key used for key encryption. */ public enum KekType { /** Enum value MicrosoftManaged. */ MICROSOFT_MANAGED("MicrosoftManaged"), @@ -30,6 +30,9 @@ public enum KekType { */ @JsonCreator public static KekType fromString(String value) { + if (value == null) { + return null; + } KekType[] items = KekType.values(); for (KekType item : items) { if (item.toString().equalsIgnoreCase(value)) { @@ -39,6 +42,7 @@ public static KekType fromString(String value) { return null; } + /** {@inheritDoc} */ @JsonValue @Override public String toString() { diff --git a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/KeyEncryptionKey.java b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/KeyEncryptionKey.java index 037ed6b54215..d9a4160df78b 100644 --- a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/KeyEncryptionKey.java +++ b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/KeyEncryptionKey.java @@ -6,14 +6,11 @@ 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; /** Encryption key containing details about key to encrypt different keys. */ @Fluent public final class KeyEncryptionKey { - @JsonIgnore private final ClientLogger logger = new ClientLogger(KeyEncryptionKey.class); - /* * Type of encryption key used for key encryption. */ @@ -33,8 +30,7 @@ public final class KeyEncryptionKey { private String kekUrl; /* - * Kek vault resource id. It is required in case of Customer managed - * KekType. + * Kek vault resource id. It is required in case of Customer managed KekType. */ @JsonProperty(value = "kekVaultResourceID") private String kekVaultResourceId; @@ -126,7 +122,7 @@ public KeyEncryptionKey withKekVaultResourceId(String kekVaultResourceId) { */ public void validate() { if (kekType() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException("Missing required property kekType in model KeyEncryptionKey")); } @@ -134,4 +130,6 @@ public void validate() { identityProperties().validate(); } } + + private static final ClientLogger LOGGER = new ClientLogger(KeyEncryptionKey.class); } diff --git a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/LastMitigationActionOnJob.java b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/LastMitigationActionOnJob.java index 9543ef6b853c..634dd7aaabac 100644 --- a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/LastMitigationActionOnJob.java +++ b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/LastMitigationActionOnJob.java @@ -5,16 +5,12 @@ 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 java.time.OffsetDateTime; /** Last Mitigation Action Performed On Job. */ @Fluent public final class LastMitigationActionOnJob { - @JsonIgnore private final ClientLogger logger = new ClientLogger(LastMitigationActionOnJob.class); - /* * Action performed date time */ @@ -23,8 +19,7 @@ public final class LastMitigationActionOnJob { /* * Action performed by customer, - * possibility is that mitigation might happen by customer or service or by - * ops + * possibility is that mitigation might happen by customer or service or by ops */ @JsonProperty(value = "isPerformedByCustomer") private Boolean isPerformedByCustomer; diff --git a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/LogCollectionLevel.java b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/LogCollectionLevel.java index 429dab198c1c..7d8b42b69355 100644 --- a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/LogCollectionLevel.java +++ b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/LogCollectionLevel.java @@ -7,7 +7,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; -/** Defines values for LogCollectionLevel. */ +/** Level of the logs to be collected. */ public enum LogCollectionLevel { /** Enum value Error. */ ERROR("Error"), @@ -30,6 +30,9 @@ public enum LogCollectionLevel { */ @JsonCreator public static LogCollectionLevel fromString(String value) { + if (value == null) { + return null; + } LogCollectionLevel[] items = LogCollectionLevel.values(); for (LogCollectionLevel item : items) { if (item.toString().equalsIgnoreCase(value)) { @@ -39,6 +42,7 @@ public static LogCollectionLevel fromString(String value) { return null; } + /** {@inheritDoc} */ @JsonValue @Override public String toString() { diff --git a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/ManagedDiskDetails.java b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/ManagedDiskDetails.java index 302ccab31ee1..b8f146b4ba0a 100644 --- a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/ManagedDiskDetails.java +++ b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/ManagedDiskDetails.java @@ -6,7 +6,6 @@ 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 com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; @@ -16,8 +15,6 @@ @JsonTypeName("ManagedDisk") @Fluent public final class ManagedDiskDetails extends DataAccountDetails { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ManagedDiskDetails.class); - /* * Resource Group Id of the compute disks. */ @@ -25,8 +22,7 @@ public final class ManagedDiskDetails extends DataAccountDetails { private String resourceGroupId; /* - * Resource Id of the storage account that can be used to copy the vhd for - * staging. + * Resource Id of the storage account that can be used to copy the vhd for staging. */ @JsonProperty(value = "stagingStorageAccountId", required = true) private String stagingStorageAccountId; @@ -89,16 +85,18 @@ public ManagedDiskDetails withSharePassword(String sharePassword) { public void validate() { super.validate(); if (resourceGroupId() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( "Missing required property resourceGroupId in model ManagedDiskDetails")); } if (stagingStorageAccountId() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( "Missing required property stagingStorageAccountId in model ManagedDiskDetails")); } } + + private static final ClientLogger LOGGER = new ClientLogger(ManagedDiskDetails.class); } 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 000000000000..2750852bc522 --- /dev/null +++ b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/MarkDevicesShippedRequest.java @@ -0,0 +1,57 @@ +// 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.JsonProperty; + +/** The request body to provide the delivery package details of job. */ +@Fluent +public final class MarkDevicesShippedRequest { + /* + * 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(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(MarkDevicesShippedRequest.class); +} diff --git a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/MitigateJobRequest.java b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/MitigateJobRequest.java index 3e96db855d73..aea538aee55c 100644 --- a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/MitigateJobRequest.java +++ b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/MitigateJobRequest.java @@ -6,14 +6,11 @@ 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 Mitigate Job captured from request body for Mitigate API. */ @Fluent public final class MitigateJobRequest { - @JsonIgnore private final ClientLogger logger = new ClientLogger(MitigateJobRequest.class); - /* * Resolution code for the job */ @@ -47,10 +44,12 @@ public MitigateJobRequest withCustomerResolutionCode(CustomerResolutionCode cust */ public void validate() { if (customerResolutionCode() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( "Missing required property customerResolutionCode in model MitigateJobRequest")); } } + + private static final ClientLogger LOGGER = new ClientLogger(MitigateJobRequest.class); } diff --git a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/NotificationPreference.java b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/NotificationPreference.java index 37f1122ba5af..b41f21d57024 100644 --- a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/NotificationPreference.java +++ b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/NotificationPreference.java @@ -6,14 +6,11 @@ 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; /** Notification preference for a job stage. */ @Fluent public final class NotificationPreference { - @JsonIgnore private final ClientLogger logger = new ClientLogger(NotificationPreference.class); - /* * Name of the stage. */ @@ -73,10 +70,12 @@ public NotificationPreference withSendNotification(boolean sendNotification) { */ public void validate() { if (stageName() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( "Missing required property stageName in model NotificationPreference")); } } + + private static final ClientLogger LOGGER = new ClientLogger(NotificationPreference.class); } 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 b99a092b5bde..62c454a17825 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,53 @@ 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"), +/** Name of the stage. */ +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; + /** + * Gets known NotificationStageName values. + * + * @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/OperationDisplay.java b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/OperationDisplay.java index 8977531b7bfa..34b483b2a694 100644 --- a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/OperationDisplay.java +++ b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/OperationDisplay.java @@ -5,15 +5,11 @@ 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; /** Operation display. */ @Fluent public final class OperationDisplay { - @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationDisplay.class); - /* * Provider name. */ diff --git a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/OperationList.java b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/OperationList.java index bd089672c751..948947a58ca0 100644 --- a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/OperationList.java +++ b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/OperationList.java @@ -5,17 +5,13 @@ package com.azure.resourcemanager.databox.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.databox.fluent.models.OperationInner; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; /** Operation Collection. */ @Fluent public final class OperationList { - @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationList.class); - /* * List of operations. */ diff --git a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/Operations.java b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/Operations.java index 4607f0dfe846..e2bc84ad18b4 100644 --- a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/Operations.java +++ b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/Operations.java @@ -14,7 +14,7 @@ public interface Operations { * * @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 operation Collection. + * @return operation Collection as paginated response with {@link PagedIterable}. */ PagedIterable list(); @@ -25,7 +25,7 @@ public interface Operations { * @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 operation Collection. + * @return operation Collection as paginated response with {@link PagedIterable}. */ PagedIterable list(Context context); } diff --git a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/OverallValidationStatus.java b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/OverallValidationStatus.java index 3a4c21bdcd83..6cda6350ba49 100644 --- a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/OverallValidationStatus.java +++ b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/OverallValidationStatus.java @@ -7,7 +7,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; -/** Defines values for OverallValidationStatus. */ +/** Overall validation status. */ public enum OverallValidationStatus { /** Enum value AllValidToProceed. */ ALL_VALID_TO_PROCEED("AllValidToProceed"), @@ -33,6 +33,9 @@ public enum OverallValidationStatus { */ @JsonCreator public static OverallValidationStatus fromString(String value) { + if (value == null) { + return null; + } OverallValidationStatus[] items = OverallValidationStatus.values(); for (OverallValidationStatus item : items) { if (item.toString().equalsIgnoreCase(value)) { @@ -42,6 +45,7 @@ public static OverallValidationStatus fromString(String value) { return null; } + /** {@inheritDoc} */ @JsonValue @Override public String toString() { 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 000000000000..8f9e988e83c6 --- /dev/null +++ b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/PackageCarrierDetails.java @@ -0,0 +1,98 @@ +// 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.fasterxml.jackson.annotation.JsonProperty; + +/** Package carrier details. */ +@Fluent +public final class PackageCarrierDetails { + /* + * 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 000000000000..9b7668c43f24 --- /dev/null +++ b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/PackageCarrierInfo.java @@ -0,0 +1,72 @@ +// 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.fasterxml.jackson.annotation.JsonProperty; + +/** package carrier info. */ +@Fluent +public final class PackageCarrierInfo { + /* + * 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 035994f5048f..b0f88485ed9f 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 @@ -5,14 +5,16 @@ 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; -/** 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 +28,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 +55,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/Preferences.java b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/Preferences.java index c00104dd2fe7..05b627878991 100644 --- a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/Preferences.java +++ b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/Preferences.java @@ -5,16 +5,12 @@ 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 java.util.List; /** Preferences related to the order. */ @Fluent public final class Preferences { - @JsonIgnore private final ClientLogger logger = new ClientLogger(Preferences.class); - /* * Preferred data center region. */ @@ -33,6 +29,12 @@ public final class Preferences { @JsonProperty(value = "encryptionPreferences") private EncryptionPreferences encryptionPreferences; + /* + * Preferences related to the Access Tier of storage accounts. + */ + @JsonProperty(value = "storageAccountAccessTierPreferences") + private List storageAccountAccessTierPreferences; + /** * Get the preferredDataCenterRegion property: Preferred data center region. * @@ -93,6 +95,26 @@ public Preferences withEncryptionPreferences(EncryptionPreferences encryptionPre return this; } + /** + * Get the storageAccountAccessTierPreferences property: Preferences related to the Access Tier of storage accounts. + * + * @return the storageAccountAccessTierPreferences value. + */ + public List storageAccountAccessTierPreferences() { + return this.storageAccountAccessTierPreferences; + } + + /** + * Set the storageAccountAccessTierPreferences property: Preferences related to the Access Tier of storage accounts. + * + * @param storageAccountAccessTierPreferences the storageAccountAccessTierPreferences value to set. + * @return the Preferences object itself. + */ + public Preferences withStorageAccountAccessTierPreferences(List storageAccountAccessTierPreferences) { + this.storageAccountAccessTierPreferences = storageAccountAccessTierPreferences; + return this; + } + /** * Validates the instance. * diff --git a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/PreferencesValidationRequest.java b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/PreferencesValidationRequest.java index b4212c809d2f..5515cc17b725 100644 --- a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/PreferencesValidationRequest.java +++ b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/PreferencesValidationRequest.java @@ -6,7 +6,6 @@ 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 com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; @@ -16,8 +15,6 @@ @JsonTypeName("ValidatePreferences") @Fluent public final class PreferencesValidationRequest extends ValidationInputRequest { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PreferencesValidationRequest.class); - /* * Preference of transport and data center. */ @@ -82,10 +79,12 @@ public void validate() { preference().validate(); } if (deviceType() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( "Missing required property deviceType in model PreferencesValidationRequest")); } } + + private static final ClientLogger LOGGER = new ClientLogger(PreferencesValidationRequest.class); } diff --git a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/PreferencesValidationResponseProperties.java b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/PreferencesValidationResponseProperties.java index ef01957a75df..3887e305cdef 100644 --- a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/PreferencesValidationResponseProperties.java +++ b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/PreferencesValidationResponseProperties.java @@ -5,8 +5,6 @@ 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; @@ -16,8 +14,6 @@ @JsonTypeName("ValidatePreferences") @Immutable public final class PreferencesValidationResponseProperties extends ValidationInputResponse { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PreferencesValidationResponseProperties.class); - /* * Validation status of requested data center and transport. */ 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 322c418ccb6d..c37f76436d8a 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 @@ -5,15 +5,11 @@ 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 configuration for the region. */ @Fluent public final class RegionConfigurationRequest { - @JsonIgnore private final ClientLogger logger = new ClientLogger(RegionConfigurationRequest.class); - /* * Request body to get the availability for scheduling orders. */ @@ -26,6 +22,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 +70,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 +102,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 7e2e17b76938..258f74271e90 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 63b28374a643..d275f889191e 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 @@ -5,16 +5,13 @@ 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 java.util.Map; /** Msi identity details of the resource. */ @Fluent public class ResourceIdentity { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ResourceIdentity.class); - /* * Identity type */ @@ -37,6 +34,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/ResourceProviders.java b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/ResourceProviders.java index b37529c6d66f..60a4702a41a2 100644 --- a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/ResourceProviders.java +++ b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/ResourceProviders.java @@ -33,7 +33,7 @@ public interface ResourceProviders { * @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. + * @return the {@link Response}. */ Response mitigateWithResponse( String jobName, String resourceGroupName, MitigateJobRequest mitigateJobRequest, Context context); diff --git a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/ScheduleAvailabilityRequest.java b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/ScheduleAvailabilityRequest.java index 07e5fbd11cfc..42e6e456b8f2 100644 --- a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/ScheduleAvailabilityRequest.java +++ b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/ScheduleAvailabilityRequest.java @@ -6,7 +6,6 @@ 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 com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; @@ -26,8 +25,6 @@ }) @Fluent public class ScheduleAvailabilityRequest { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ScheduleAvailabilityRequest.class); - /* * Location for data transfer. For locations check: * https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01 @@ -90,10 +87,12 @@ public ScheduleAvailabilityRequest withCountry(String country) { */ public void validate() { if (storageLocation() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( "Missing required property storageLocation in model ScheduleAvailabilityRequest")); } } + + private static final ClientLogger LOGGER = new ClientLogger(ScheduleAvailabilityRequest.class); } diff --git a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/ScheduleAvailabilityResponse.java b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/ScheduleAvailabilityResponse.java index 59ccbaca1d7f..7e6700e5ac82 100644 --- a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/ScheduleAvailabilityResponse.java +++ b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/ScheduleAvailabilityResponse.java @@ -5,8 +5,6 @@ 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 java.time.OffsetDateTime; import java.util.List; @@ -14,8 +12,6 @@ /** Schedule availability for given sku in a region. */ @Immutable public final class ScheduleAvailabilityResponse { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ScheduleAvailabilityResponse.class); - /* * List of dates available to schedule */ diff --git a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/Services.java b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/Services.java index f2a81cc9a44e..549e9aa1fea8 100644 --- a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/Services.java +++ b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/Services.java @@ -19,7 +19,7 @@ public interface Services { * @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 available skus operation response. + * @return the available skus operation response as paginated response with {@link PagedIterable}. */ PagedIterable listAvailableSkusByResourceGroup( String resourceGroupName, String location, AvailableSkuRequest availableSkuRequest); @@ -34,7 +34,7 @@ PagedIterable listAvailableSkusByResourceGroup( * @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 available skus operation response. + * @return the available skus operation response as paginated response with {@link PagedIterable}. */ PagedIterable listAvailableSkusByResourceGroup( String resourceGroupName, String location, AvailableSkuRequest availableSkuRequest, Context context); @@ -62,7 +62,7 @@ PagedIterable listAvailableSkusByResourceGroup( * @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 output of the address validation api. + * @return output of the address validation api along with {@link Response}. */ Response validateAddressWithResponse( String location, ValidateAddress validateAddress, Context context); @@ -91,7 +91,7 @@ ValidationResponse validateInputsByResourceGroup( * @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 response of pre job creation validations. + * @return response of pre job creation validations along with {@link Response}. */ Response validateInputsByResourceGroupWithResponse( String resourceGroupName, String location, ValidationRequest validationRequest, Context context); @@ -117,7 +117,7 @@ Response validateInputsByResourceGroupWithResponse( * @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 response of pre job creation validations. + * @return response of pre job creation validations along with {@link Response}. */ Response validateInputsWithResponse( String location, ValidationRequest validationRequest, Context context); @@ -144,7 +144,7 @@ RegionConfigurationResponse regionConfiguration( * @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 configuration response specific to a region. + * @return configuration response specific to a region along with {@link Response}. */ Response regionConfigurationWithResponse( String location, RegionConfigurationRequest regionConfigurationRequest, Context context); @@ -173,7 +173,7 @@ RegionConfigurationResponse regionConfigurationByResourceGroup( * @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 configuration response specific to a region. + * @return configuration response specific to a region along with {@link Response}. */ Response regionConfigurationByResourceGroupWithResponse( String resourceGroupName, diff --git a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/ShareCredentialDetails.java b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/ShareCredentialDetails.java index 9ad9e2f2d7f2..13b113279f49 100644 --- a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/ShareCredentialDetails.java +++ b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/ShareCredentialDetails.java @@ -5,16 +5,12 @@ 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 java.util.List; /** Credential details of the shares in account. */ @Immutable public final class ShareCredentialDetails { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ShareCredentialDetails.class); - /* * Name of the share. */ diff --git a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/ShareDestinationFormatType.java b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/ShareDestinationFormatType.java index 063f7fb26b8b..0d6c13e78d90 100644 --- a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/ShareDestinationFormatType.java +++ b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/ShareDestinationFormatType.java @@ -7,7 +7,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; -/** Defines values for ShareDestinationFormatType. */ +/** Type of the share. */ public enum ShareDestinationFormatType { /** Enum value UnknownType. */ UNKNOWN_TYPE("UnknownType"), @@ -42,6 +42,9 @@ public enum ShareDestinationFormatType { */ @JsonCreator public static ShareDestinationFormatType fromString(String value) { + if (value == null) { + return null; + } ShareDestinationFormatType[] items = ShareDestinationFormatType.values(); for (ShareDestinationFormatType item : items) { if (item.toString().equalsIgnoreCase(value)) { @@ -51,6 +54,7 @@ public static ShareDestinationFormatType fromString(String value) { return null; } + /** {@inheritDoc} */ @JsonValue @Override public String toString() { diff --git a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/ShipmentPickUpRequest.java b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/ShipmentPickUpRequest.java index 9c83fa6328be..d8d8eec0a314 100644 --- a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/ShipmentPickUpRequest.java +++ b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/ShipmentPickUpRequest.java @@ -6,25 +6,20 @@ 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 java.time.OffsetDateTime; /** Shipment pick up request details. */ @Fluent public final class ShipmentPickUpRequest { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ShipmentPickUpRequest.class); - /* - * Minimum date after which the pick up should commence, this must be in - * local time of pick up area. + * Minimum date after which the pick up should commence, this must be in local time of pick up area. */ @JsonProperty(value = "startTime", required = true) private OffsetDateTime startTime; /* - * Maximum date before which the pick up should commence, this must be in - * local time of pick up area. + * Maximum date before which the pick up should commence, this must be in local time of pick up area. */ @JsonProperty(value = "endTime", required = true) private OffsetDateTime endTime; @@ -106,20 +101,22 @@ public ShipmentPickUpRequest withShipmentLocation(String shipmentLocation) { */ public void validate() { if (startTime() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException("Missing required property startTime in model ShipmentPickUpRequest")); } if (endTime() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException("Missing required property endTime in model ShipmentPickUpRequest")); } if (shipmentLocation() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( "Missing required property shipmentLocation in model ShipmentPickUpRequest")); } } + + private static final ClientLogger LOGGER = new ClientLogger(ShipmentPickUpRequest.class); } diff --git a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/ShippingAddress.java b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/ShippingAddress.java index 77cd83beabd2..f839a2063fe5 100644 --- a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/ShippingAddress.java +++ b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/ShippingAddress.java @@ -6,14 +6,11 @@ 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; /** Shipping address where customer wishes to receive the device. */ @Fluent public final class ShippingAddress { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ShippingAddress.class); - /* * Street Address line 1. */ @@ -281,14 +278,16 @@ public ShippingAddress withAddressType(AddressType addressType) { */ public void validate() { if (streetAddress1() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException("Missing required property streetAddress1 in model ShippingAddress")); } if (country() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException("Missing required property country in model ShippingAddress")); } } + + private static final ClientLogger LOGGER = new ClientLogger(ShippingAddress.class); } diff --git a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/Sku.java b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/Sku.java index 206244a2550d..72922b7403ed 100644 --- a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/Sku.java +++ b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/Sku.java @@ -6,14 +6,11 @@ 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 Sku. */ @Fluent public final class Sku { - @JsonIgnore private final ClientLogger logger = new ClientLogger(Sku.class); - /* * The sku name. */ @@ -99,8 +96,10 @@ public Sku withFamily(String family) { */ public void validate() { if (name() == null) { - throw logger + throw LOGGER .logExceptionAsError(new IllegalArgumentException("Missing required property name in model Sku")); } } + + private static final ClientLogger LOGGER = new ClientLogger(Sku.class); } diff --git a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/SkuAvailabilityValidationRequest.java b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/SkuAvailabilityValidationRequest.java index 38d5513319da..89c702e0edb4 100644 --- a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/SkuAvailabilityValidationRequest.java +++ b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/SkuAvailabilityValidationRequest.java @@ -6,7 +6,6 @@ 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 com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; @@ -16,8 +15,6 @@ @JsonTypeName("ValidateSkuAvailability") @Fluent public final class SkuAvailabilityValidationRequest extends ValidationInputRequest { - @JsonIgnore private final ClientLogger logger = new ClientLogger(SkuAvailabilityValidationRequest.class); - /* * Device type to be used for the job. */ @@ -137,28 +134,30 @@ public SkuAvailabilityValidationRequest withLocation(String location) { public void validate() { super.validate(); if (deviceType() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( "Missing required property deviceType in model SkuAvailabilityValidationRequest")); } if (transferType() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( "Missing required property transferType in model SkuAvailabilityValidationRequest")); } if (country() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( "Missing required property country in model SkuAvailabilityValidationRequest")); } if (location() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( "Missing required property location in model SkuAvailabilityValidationRequest")); } } + + private static final ClientLogger LOGGER = new ClientLogger(SkuAvailabilityValidationRequest.class); } diff --git a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/SkuAvailabilityValidationResponseProperties.java b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/SkuAvailabilityValidationResponseProperties.java index 2d1d696a2ed7..9ab2d5883fc6 100644 --- a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/SkuAvailabilityValidationResponseProperties.java +++ b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/SkuAvailabilityValidationResponseProperties.java @@ -5,8 +5,6 @@ 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; @@ -16,8 +14,6 @@ @JsonTypeName("ValidateSkuAvailability") @Immutable public final class SkuAvailabilityValidationResponseProperties extends ValidationInputResponse { - @JsonIgnore private final ClientLogger logger = new ClientLogger(SkuAvailabilityValidationResponseProperties.class); - /* * Sku availability validation status. */ diff --git a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/SkuCapacity.java b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/SkuCapacity.java index b9a054ffd693..d36bec9a11f0 100644 --- a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/SkuCapacity.java +++ b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/SkuCapacity.java @@ -5,15 +5,11 @@ 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; /** Capacity of the sku. */ @Immutable public final class SkuCapacity { - @JsonIgnore private final ClientLogger logger = new ClientLogger(SkuCapacity.class); - /* * Usable capacity in TB. */ diff --git a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/SkuCost.java b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/SkuCost.java index e20fa820e22a..b7ed1a7ec1d7 100644 --- a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/SkuCost.java +++ b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/SkuCost.java @@ -5,15 +5,11 @@ 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; /** Describes metadata for retrieving price info. */ @Immutable public final class SkuCost { - @JsonIgnore private final ClientLogger logger = new ClientLogger(SkuCost.class); - /* * Meter id of the Sku. */ @@ -27,9 +23,8 @@ public final class SkuCost { private String meterType; /* - * Multiplier specifies the region specific value to be multiplied with 1$ - * guid. Eg: Our new regions will be using 1$ shipping guid with - * appropriate multiplier specific to region. + * Multiplier specifies the region specific value to be multiplied with 1$ guid. Eg: Our new regions will be using + * 1$ shipping guid with appropriate multiplier specific to region. */ @JsonProperty(value = "multiplier", access = JsonProperty.Access.WRITE_ONLY) private Double multiplier; diff --git a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/SkuDisabledReason.java b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/SkuDisabledReason.java index 8321992516df..7a4f6e820d9e 100644 --- a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/SkuDisabledReason.java +++ b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/SkuDisabledReason.java @@ -7,7 +7,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; -/** Defines values for SkuDisabledReason. */ +/** Reason why the Sku is disabled. */ public enum SkuDisabledReason { /** Enum value None. */ NONE("None"), @@ -42,6 +42,9 @@ public enum SkuDisabledReason { */ @JsonCreator public static SkuDisabledReason fromString(String value) { + if (value == null) { + return null; + } SkuDisabledReason[] items = SkuDisabledReason.values(); for (SkuDisabledReason item : items) { if (item.toString().equalsIgnoreCase(value)) { @@ -51,6 +54,7 @@ public static SkuDisabledReason fromString(String value) { return null; } + /** {@inheritDoc} */ @JsonValue @Override public String toString() { 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 9f727241afc5..63e10d89e668 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; @@ -33,6 +36,9 @@ public enum SkuName { */ @JsonCreator public static SkuName fromString(String value) { + if (value == null) { + return null; + } SkuName[] items = SkuName.values(); for (SkuName item : items) { if (item.toString().equalsIgnoreCase(value)) { @@ -42,6 +48,7 @@ public static SkuName fromString(String value) { return null; } + /** {@inheritDoc} */ @JsonValue @Override public String toString() { 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 7af3e1211144..f03fe96c072a 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,92 @@ 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"), +/** Name of the stage which is in progress. */ +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; + /** + * Gets known StageName values. + * + * @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 3ac5d3d6cfca..d9ce4680795e 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 @@ -7,7 +7,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; -/** Defines values for StageStatus. */ +/** Holds the device erasure completion status. */ public enum StageStatus { /** Enum value None. */ NONE("None"), @@ -34,7 +34,19 @@ 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"), + + /** Enum value CustomerActionPerformed. */ + CUSTOMER_ACTION_PERFORMED("CustomerActionPerformed"); /** The actual serialized value for a StageStatus instance. */ private final String value; @@ -51,6 +63,9 @@ public enum StageStatus { */ @JsonCreator public static StageStatus fromString(String value) { + if (value == null) { + return null; + } StageStatus[] items = StageStatus.values(); for (StageStatus item : items) { if (item.toString().equalsIgnoreCase(value)) { @@ -60,6 +75,7 @@ public static StageStatus fromString(String value) { return null; } + /** {@inheritDoc} */ @JsonValue @Override public String toString() { diff --git a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/StorageAccountDetails.java b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/StorageAccountDetails.java index 999647c3cac6..2182f4d6237d 100644 --- a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/StorageAccountDetails.java +++ b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/StorageAccountDetails.java @@ -6,7 +6,6 @@ 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 com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; @@ -16,8 +15,6 @@ @JsonTypeName("StorageAccount") @Fluent public final class StorageAccountDetails extends DataAccountDetails { - @JsonIgnore private final ClientLogger logger = new ClientLogger(StorageAccountDetails.class); - /* * Storage Account Resource Id. */ @@ -60,10 +57,12 @@ public StorageAccountDetails withSharePassword(String sharePassword) { public void validate() { super.validate(); if (storageAccountId() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( "Missing required property storageAccountId in model StorageAccountDetails")); } } + + private static final ClientLogger LOGGER = new ClientLogger(StorageAccountDetails.class); } diff --git a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/SubscriptionIsAllowedToCreateJobValidationRequest.java b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/SubscriptionIsAllowedToCreateJobValidationRequest.java index 5291b3f92a0a..c027f2cab276 100644 --- a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/SubscriptionIsAllowedToCreateJobValidationRequest.java +++ b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/SubscriptionIsAllowedToCreateJobValidationRequest.java @@ -5,8 +5,6 @@ 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.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; @@ -15,9 +13,6 @@ @JsonTypeName("ValidateSubscriptionIsAllowedToCreateJob") @Immutable public final class SubscriptionIsAllowedToCreateJobValidationRequest extends ValidationInputRequest { - @JsonIgnore - private final ClientLogger logger = new ClientLogger(SubscriptionIsAllowedToCreateJobValidationRequest.class); - /** * Validates the instance. * diff --git a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/SubscriptionIsAllowedToCreateJobValidationResponseProperties.java b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/SubscriptionIsAllowedToCreateJobValidationResponseProperties.java index 29808923f0e4..58c7a415bf9a 100644 --- a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/SubscriptionIsAllowedToCreateJobValidationResponseProperties.java +++ b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/SubscriptionIsAllowedToCreateJobValidationResponseProperties.java @@ -5,8 +5,6 @@ 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; @@ -16,10 +14,6 @@ @JsonTypeName("ValidateSubscriptionIsAllowedToCreateJob") @Immutable public final class SubscriptionIsAllowedToCreateJobValidationResponseProperties extends ValidationInputResponse { - @JsonIgnore - private final ClientLogger logger = - new ClientLogger(SubscriptionIsAllowedToCreateJobValidationResponseProperties.class); - /* * Validation status of subscription permission to create job. */ diff --git a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/TransferAllDetails.java b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/TransferAllDetails.java index 4fb40089f85d..3265ecc6c129 100644 --- a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/TransferAllDetails.java +++ b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/TransferAllDetails.java @@ -6,14 +6,11 @@ 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; /** Details to transfer all data. */ @Fluent public final class TransferAllDetails { - @JsonIgnore private final ClientLogger logger = new ClientLogger(TransferAllDetails.class); - /* * Type of the account of data */ @@ -99,10 +96,12 @@ public TransferAllDetails withTransferAllFiles(Boolean transferAllFiles) { */ public void validate() { if (dataAccountType() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( "Missing required property dataAccountType in model TransferAllDetails")); } } + + private static final ClientLogger LOGGER = new ClientLogger(TransferAllDetails.class); } diff --git a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/TransferConfiguration.java b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/TransferConfiguration.java index 08752ee8d243..c9d1f206821c 100644 --- a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/TransferConfiguration.java +++ b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/TransferConfiguration.java @@ -6,14 +6,11 @@ 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; /** Configuration for defining the transfer of data. */ @Fluent public final class TransferConfiguration { - @JsonIgnore private final ClientLogger logger = new ClientLogger(TransferConfiguration.class); - /* * Type of the configuration for transfer. */ @@ -21,15 +18,15 @@ public final class TransferConfiguration { private TransferConfigurationType transferConfigurationType; /* - * Map of filter type and the details to filter. This field is required - * only if the TransferConfigurationType is given as TransferUsingFilter. + * Map of filter type and the details to filter. This field is required only if the TransferConfigurationType is + * given as TransferUsingFilter. */ @JsonProperty(value = "transferFilterDetails") private TransferConfigurationTransferFilterDetails transferFilterDetails; /* - * Map of filter type and the details to transfer all data. This field is - * required only if the TransferConfigurationType is given as TransferAll + * Map of filter type and the details to transfer all data. This field is required only if the + * TransferConfigurationType is given as TransferAll */ @JsonProperty(value = "transferAllDetails") private TransferConfigurationTransferAllDetails transferAllDetails; @@ -106,7 +103,7 @@ public TransferConfiguration withTransferAllDetails(TransferConfigurationTransfe */ public void validate() { if (transferConfigurationType() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( "Missing required property transferConfigurationType in model TransferConfiguration")); @@ -118,4 +115,6 @@ public void validate() { transferAllDetails().validate(); } } + + private static final ClientLogger LOGGER = new ClientLogger(TransferConfiguration.class); } diff --git a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/TransferConfigurationTransferAllDetails.java b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/TransferConfigurationTransferAllDetails.java index 8e4d4a893332..48b05b8a7245 100644 --- a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/TransferConfigurationTransferAllDetails.java +++ b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/TransferConfigurationTransferAllDetails.java @@ -5,8 +5,6 @@ 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; /** @@ -15,8 +13,6 @@ */ @Fluent public final class TransferConfigurationTransferAllDetails { - @JsonIgnore private final ClientLogger logger = new ClientLogger(TransferConfigurationTransferAllDetails.class); - /* * Details to transfer all data. */ diff --git a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/TransferConfigurationTransferFilterDetails.java b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/TransferConfigurationTransferFilterDetails.java index b38757374840..a53791960d43 100644 --- a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/TransferConfigurationTransferFilterDetails.java +++ b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/TransferConfigurationTransferFilterDetails.java @@ -5,8 +5,6 @@ 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; /** @@ -15,8 +13,6 @@ */ @Fluent public final class TransferConfigurationTransferFilterDetails { - @JsonIgnore private final ClientLogger logger = new ClientLogger(TransferConfigurationTransferFilterDetails.class); - /* * Details of the filtering the transfer of data. */ diff --git a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/TransferConfigurationType.java b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/TransferConfigurationType.java index 71de8996c3c8..490fd8b47053 100644 --- a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/TransferConfigurationType.java +++ b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/TransferConfigurationType.java @@ -7,7 +7,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; -/** Defines values for TransferConfigurationType. */ +/** Type of the configuration for transfer. */ public enum TransferConfigurationType { /** Enum value TransferAll. */ TRANSFER_ALL("TransferAll"), @@ -30,6 +30,9 @@ public enum TransferConfigurationType { */ @JsonCreator public static TransferConfigurationType fromString(String value) { + if (value == null) { + return null; + } TransferConfigurationType[] items = TransferConfigurationType.values(); for (TransferConfigurationType item : items) { if (item.toString().equalsIgnoreCase(value)) { @@ -39,6 +42,7 @@ public static TransferConfigurationType fromString(String value) { return null; } + /** {@inheritDoc} */ @JsonValue @Override public String toString() { diff --git a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/TransferFilterDetails.java b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/TransferFilterDetails.java index 8db6d12cc869..82e4f876ab7d 100644 --- a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/TransferFilterDetails.java +++ b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/TransferFilterDetails.java @@ -6,15 +6,12 @@ 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 java.util.List; /** Details of the filtering the transfer of data. */ @Fluent public final class TransferFilterDetails { - @JsonIgnore private final ClientLogger logger = new ClientLogger(TransferFilterDetails.class); - /* * Type of the account of data. */ @@ -126,7 +123,7 @@ public TransferFilterDetails withFilterFileDetails(List filte */ public void validate() { if (dataAccountType() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( "Missing required property dataAccountType in model TransferFilterDetails")); @@ -141,4 +138,6 @@ public void validate() { filterFileDetails().forEach(e -> e.validate()); } } + + private static final ClientLogger LOGGER = new ClientLogger(TransferFilterDetails.class); } diff --git a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/TransferType.java b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/TransferType.java index 8fdccb4664f3..b8ac1ff55903 100644 --- a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/TransferType.java +++ b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/TransferType.java @@ -7,7 +7,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; -/** Defines values for TransferType. */ +/** Type of the transfer. */ public enum TransferType { /** Enum value ImportToAzure. */ IMPORT_TO_AZURE("ImportToAzure"), @@ -30,6 +30,9 @@ public enum TransferType { */ @JsonCreator public static TransferType fromString(String value) { + if (value == null) { + return null; + } TransferType[] items = TransferType.values(); for (TransferType item : items) { if (item.toString().equalsIgnoreCase(value)) { @@ -39,6 +42,7 @@ public static TransferType fromString(String value) { return null; } + /** {@inheritDoc} */ @JsonValue @Override public String toString() { diff --git a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/TransportAvailabilityDetails.java b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/TransportAvailabilityDetails.java index 7a28de9e6d71..79f635ca73ee 100644 --- a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/TransportAvailabilityDetails.java +++ b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/TransportAvailabilityDetails.java @@ -5,15 +5,11 @@ 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; /** Transport options availability details for given region. */ @Immutable public final class TransportAvailabilityDetails { - @JsonIgnore private final ClientLogger logger = new ClientLogger(TransportAvailabilityDetails.class); - /* * Transport Shipment Type supported for given region. */ diff --git a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/TransportAvailabilityRequest.java b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/TransportAvailabilityRequest.java index 21a17e54675d..9b8701490dc7 100644 --- a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/TransportAvailabilityRequest.java +++ b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/TransportAvailabilityRequest.java @@ -5,15 +5,11 @@ 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 transport availability for given sku. */ @Fluent public final class TransportAvailabilityRequest { - @JsonIgnore private final ClientLogger logger = new ClientLogger(TransportAvailabilityRequest.class); - /* * Type of the device. */ diff --git a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/TransportAvailabilityResponse.java b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/TransportAvailabilityResponse.java index 0243043dc726..0cd98651a312 100644 --- a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/TransportAvailabilityResponse.java +++ b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/TransportAvailabilityResponse.java @@ -5,16 +5,12 @@ 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 java.util.List; /** Transport options available for given sku in a region. */ @Immutable public final class TransportAvailabilityResponse { - @JsonIgnore private final ClientLogger logger = new ClientLogger(TransportAvailabilityResponse.class); - /* * List of transport availability details for given region */ diff --git a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/TransportPreferences.java b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/TransportPreferences.java index d5cd7a4a24d0..8407b93f0b07 100644 --- a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/TransportPreferences.java +++ b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/TransportPreferences.java @@ -6,14 +6,11 @@ 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; /** Preferences related to the shipment logistics of the sku. */ @Fluent public final class TransportPreferences { - @JsonIgnore private final ClientLogger logger = new ClientLogger(TransportPreferences.class); - /* * Indicates Shipment Logistics type that the customer preferred. */ @@ -47,10 +44,12 @@ public TransportPreferences withPreferredShipmentType(TransportShipmentTypes pre */ public void validate() { if (preferredShipmentType() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( "Missing required property preferredShipmentType in model TransportPreferences")); } } + + private static final ClientLogger LOGGER = new ClientLogger(TransportPreferences.class); } diff --git a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/TransportShipmentTypes.java b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/TransportShipmentTypes.java index 2ae24db76f2a..109a87ce6ea4 100644 --- a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/TransportShipmentTypes.java +++ b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/TransportShipmentTypes.java @@ -7,7 +7,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; -/** Defines values for TransportShipmentTypes. */ +/** Transport Shipment Type supported for given region. */ public enum TransportShipmentTypes { /** Enum value CustomerManaged. */ CUSTOMER_MANAGED("CustomerManaged"), @@ -30,6 +30,9 @@ public enum TransportShipmentTypes { */ @JsonCreator public static TransportShipmentTypes fromString(String value) { + if (value == null) { + return null; + } TransportShipmentTypes[] items = TransportShipmentTypes.values(); for (TransportShipmentTypes item : items) { if (item.toString().equalsIgnoreCase(value)) { @@ -39,6 +42,7 @@ public static TransportShipmentTypes fromString(String value) { return null; } + /** {@inheritDoc} */ @JsonValue @Override public String toString() { diff --git a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/UnencryptedCredentialsList.java b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/UnencryptedCredentialsList.java index 510fd4665f24..1f2dc73e2148 100644 --- a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/UnencryptedCredentialsList.java +++ b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/UnencryptedCredentialsList.java @@ -5,17 +5,13 @@ package com.azure.resourcemanager.databox.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.databox.fluent.models.UnencryptedCredentialsInner; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; /** List of unencrypted credentials for accessing device. */ @Fluent public final class UnencryptedCredentialsList { - @JsonIgnore private final ClientLogger logger = new ClientLogger(UnencryptedCredentialsList.class); - /* * List of unencrypted credentials. */ 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 aa073ff928f7..dd1aa540bb90 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 @@ -5,15 +5,11 @@ 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; /** Job details for update. */ @Fluent public final class UpdateJobDetails { - @JsonIgnore private final ClientLogger logger = new ClientLogger(UpdateJobDetails.class); - /* * Contact details for notification and shipping. */ @@ -32,6 +28,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 +94,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 +129,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/UserAssignedIdentity.java b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/UserAssignedIdentity.java index 99986cb7be6e..678caa27f23c 100644 --- a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/UserAssignedIdentity.java +++ b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/UserAssignedIdentity.java @@ -5,15 +5,11 @@ 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; /** Class defining User assigned identity details. */ @Immutable public class UserAssignedIdentity { - @JsonIgnore private final ClientLogger logger = new ClientLogger(UserAssignedIdentity.class); - /* * The principal id of user assigned identity. */ diff --git a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/UserAssignedProperties.java b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/UserAssignedProperties.java index da63f2e36096..27f82053b344 100644 --- a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/UserAssignedProperties.java +++ b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/UserAssignedProperties.java @@ -5,18 +5,13 @@ 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; /** User assigned identity properties. */ @Fluent public final class UserAssignedProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(UserAssignedProperties.class); - /* - * Arm resource id for user assigned identity to be used to fetch MSI - * token. + * Arm resource id for user assigned identity to be used to fetch MSI token. */ @JsonProperty(value = "resourceId") private String resourceId; diff --git a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/ValidateAddress.java b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/ValidateAddress.java index 8cb51ba0482f..e263aee61af4 100644 --- a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/ValidateAddress.java +++ b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/ValidateAddress.java @@ -6,7 +6,6 @@ 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 com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; @@ -16,8 +15,6 @@ @JsonTypeName("ValidateAddress") @Fluent public final class ValidateAddress extends ValidationInputRequest { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ValidateAddress.class); - /* * Shipping address of the customer. */ @@ -105,14 +102,14 @@ public ValidateAddress withTransportPreferences(TransportPreferences transportPr public void validate() { super.validate(); if (shippingAddress() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException("Missing required property shippingAddress in model ValidateAddress")); } else { shippingAddress().validate(); } if (deviceType() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException("Missing required property deviceType in model ValidateAddress")); } @@ -120,4 +117,6 @@ public void validate() { transportPreferences().validate(); } } + + private static final ClientLogger LOGGER = new ClientLogger(ValidateAddress.class); } diff --git a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/ValidationInputDiscriminator.java b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/ValidationInputDiscriminator.java index ac52f5149739..d2bbd4398c14 100644 --- a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/ValidationInputDiscriminator.java +++ b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/ValidationInputDiscriminator.java @@ -7,7 +7,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; -/** Defines values for ValidationInputDiscriminator. */ +/** Identifies the type of validation request. */ public enum ValidationInputDiscriminator { /** Enum value ValidateAddress. */ VALIDATE_ADDRESS("ValidateAddress"), @@ -42,6 +42,9 @@ public enum ValidationInputDiscriminator { */ @JsonCreator public static ValidationInputDiscriminator fromString(String value) { + if (value == null) { + return null; + } ValidationInputDiscriminator[] items = ValidationInputDiscriminator.values(); for (ValidationInputDiscriminator item : items) { if (item.toString().equalsIgnoreCase(value)) { @@ -51,6 +54,7 @@ public static ValidationInputDiscriminator fromString(String value) { return null; } + /** {@inheritDoc} */ @JsonValue @Override public String toString() { diff --git a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/ValidationInputRequest.java b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/ValidationInputRequest.java index 0c364cb0ffbc..b80f8158083c 100644 --- a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/ValidationInputRequest.java +++ b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/ValidationInputRequest.java @@ -5,8 +5,6 @@ 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.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; @@ -32,8 +30,6 @@ }) @Immutable public class ValidationInputRequest { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ValidationInputRequest.class); - /** * Validates the instance. * 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 be7fad543fdd..f2347871c51d 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 @@ -5,8 +5,7 @@ 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.azure.resourcemanager.databox.fluent.models.AddressValidationProperties; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; @@ -35,8 +34,6 @@ }) @Immutable public class ValidationInputResponse { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ValidationInputResponse.class); - /* * Error code and message of validation response. */ diff --git a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/ValidationRequest.java b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/ValidationRequest.java index 4f0b8f55bba6..6043eaa88db3 100644 --- a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/ValidationRequest.java +++ b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/ValidationRequest.java @@ -6,7 +6,6 @@ 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 com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; @@ -23,11 +22,8 @@ @JsonSubTypes({@JsonSubTypes.Type(name = "JobCreationValidation", value = CreateJobValidations.class)}) @Fluent public class ValidationRequest { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ValidationRequest.class); - /* - * List of request details contain validationType and its request as key - * and value respectively. + * List of request details contain validationType and its request as key and value respectively. */ @JsonProperty(value = "individualRequestDetails", required = true) private List individualRequestDetails; @@ -61,7 +57,7 @@ public ValidationRequest withIndividualRequestDetails(List e.validate()); } } + + private static final ClientLogger LOGGER = new ClientLogger(ValidationRequest.class); } diff --git a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/ValidationStatus.java b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/ValidationStatus.java index ca038f8d8520..46f76cbc2b43 100644 --- a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/ValidationStatus.java +++ b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/ValidationStatus.java @@ -7,7 +7,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; -/** Defines values for ValidationStatus. */ +/** Create order limit validation status. */ public enum ValidationStatus { /** Enum value Valid. */ VALID("Valid"), @@ -33,6 +33,9 @@ public enum ValidationStatus { */ @JsonCreator public static ValidationStatus fromString(String value) { + if (value == null) { + return null; + } ValidationStatus[] items = ValidationStatus.values(); for (ValidationStatus item : items) { if (item.toString().equalsIgnoreCase(value)) { @@ -42,6 +45,7 @@ public static ValidationStatus fromString(String value) { return null; } + /** {@inheritDoc} */ @JsonValue @Override public String toString() { 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 000000000000..b344fcf88862 --- /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/stable/2022-02-01/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 000000000000..5f9af6b3303c --- /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/stable/2022-02-01/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 000000000000..4f4bcf00bb33 --- /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/stable/2022-02-01/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/stable/2022-02-01/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/stable/2022-02-01/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/stable/2022-02-01/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/stable/2022-02-01/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 000000000000..c3a92db5d12f --- /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/stable/2022-02-01/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 000000000000..c217351ada51 --- /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/stable/2022-02-01/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/stable/2022-02-01/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/stable/2022-02-01/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/stable/2022-02-01/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/stable/2022-02-01/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 000000000000..e008c1dde0ec --- /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/stable/2022-02-01/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 000000000000..820179f178ed --- /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/stable/2022-02-01/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 000000000000..95c0beb02e0a --- /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/stable/2022-02-01/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 000000000000..f97bad805917 --- /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/stable/2022-02-01/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 000000000000..79a5852c294c --- /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/stable/2022-02-01/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/stable/2022-02-01/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/stable/2022-02-01/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 000000000000..3ebbf89d1c65 --- /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/stable/2022-02-01/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 000000000000..2802e65ffc52 --- /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/stable/2022-02-01/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 000000000000..ccfaafb31a6a --- /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/stable/2022-02-01/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 000000000000..7e950c290925 --- /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/stable/2022-02-01/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 000000000000..fd6cedefd99e --- /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/stable/2022-02-01/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 000000000000..56f15f365496 --- /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/stable/2022-02-01/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 000000000000..7b541d90c4ba --- /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/stable/2022-02-01/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 000000000000..6841f49af67d --- /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/stable/2022-02-01/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); + } +}