From d99bda19a4fcc92ed390dccdb1e2f91db5aa5d53 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Tue, 22 Nov 2022 08:56:42 +0000 Subject: [PATCH] CodeGen from PR 21625 in Azure/azure-rest-api-specs Merge 20468dbcb26733e216e282d3639035b5f352f099 into ddbdba6d960f83647257d6dc08be7b81dc5eb8f8 --- .../CHANGELOG.md | 3 +- .../azure-resourcemanager-databox/README.md | 30 +- .../azure-resourcemanager-databox/SAMPLE.md | 1056 +++++++++++++++++ .../azure-resourcemanager-databox/pom.xml | 98 +- .../databox/DataBoxManager.java | 105 +- .../databox/fluent/JobsClient.java | 131 +- .../databox/fluent/OperationsClient.java | 4 +- .../fluent/ResourceProvidersClient.java | 10 +- .../databox/fluent/ServicesClient.java | 66 +- .../models/AddressValidationOutputInner.java | 64 +- .../databox/fluent/models/JobProperties.java | 319 +++++ .../fluent/models/JobResourceInner.java | 299 ++--- .../databox/fluent/models/OperationInner.java | 11 +- .../RegionConfigurationResponseInner.java | 27 +- .../models/ShipmentPickUpResponseInner.java | 11 +- .../fluent/models/SkuInformationInner.java | 95 +- .../databox/fluent/models/SkuProperties.java | 159 +++ .../models/UnencryptedCredentialsInner.java | 8 +- .../fluent/models/UpdateJobProperties.java | 54 + .../models/ValidationResponseInner.java | 38 +- .../models/ValidationResponseProperties.java | 61 + .../AddressValidationOutputImpl.java | 23 +- .../DataBoxManagementClientBuilder.java | 62 +- .../DataBoxManagementClientImpl.java | 15 +- .../implementation/JobResourceImpl.java | 78 +- .../implementation/JobsClientImpl.java | 523 +++++--- .../databox/implementation/JobsImpl.java | 79 +- .../implementation/OperationsClientImpl.java | 27 +- .../implementation/OperationsImpl.java | 3 +- .../RegionConfigurationResponseImpl.java | 5 + .../ResourceProvidersClientImpl.java | 27 +- .../implementation/ResourceProvidersImpl.java | 11 +- .../implementation/ServicesClientImpl.java | 207 ++-- .../databox/implementation/ServicesImpl.java | 55 +- .../implementation/SkuInformationImpl.java | 9 + .../databox/models/AccessProtocol.java | 4 + .../models/AccountCredentialDetails.java | 11 +- .../databox/models/AdditionalErrorInfo.java | 52 +- .../databox/models/AddressType.java | 6 +- .../models/AddressValidationOutput.java | 21 +- .../models/AddressValidationProperties.java | 8 +- .../models/AddressValidationStatus.java | 6 +- .../models/ApplianceNetworkConfiguration.java | 8 +- .../databox/models/AvailableSkuRequest.java | 15 +- .../databox/models/AvailableSkusResult.java | 8 +- .../models/AzureFileFilterDetails.java | 8 +- .../databox/models/BlobFilterDetails.java | 8 +- .../databox/models/CancellationReason.java | 11 +- .../databox/models/ClassDiscriminator.java | 11 +- .../databox/models/CloudError.java | 86 +- .../databox/models/ContactDetails.java | 15 +- .../databox/models/ContactInfo.java | 141 +++ .../databox/models/CopyLogDetails.java | 7 +- .../databox/models/CopyProgress.java | 22 +- .../databox/models/CopyStatus.java | 102 +- .../databox/models/CreateJobValidations.java | 10 +- ...LimitForSubscriptionValidationRequest.java | 12 +- ...scriptionValidationResponseProperties.java | 10 +- .../models/CustomerDiskJobSecrets.java | 64 + .../models/CustomerResolutionCode.java | 12 +- .../databox/models/DataAccountDetails.java | 21 +- .../databox/models/DataAccountType.java | 6 +- .../models/DataBoxAccountCopyLogDetails.java | 11 +- .../DataBoxCustomerDiskCopyLogDetails.java | 75 ++ .../DataBoxCustomerDiskCopyProgress.java | 56 + .../models/DataBoxCustomerDiskJobDetails.java | 259 ++++ .../models/DataBoxDiskCopyLogDetails.java | 8 +- .../models/DataBoxDiskCopyProgress.java | 8 +- .../DataBoxDiskGranularCopyLogDetails.java | 90 ++ .../DataBoxDiskGranularCopyProgress.java | 56 + .../databox/models/DataBoxDiskJobDetails.java | 63 +- .../databox/models/DataBoxDiskJobSecrets.java | 8 +- .../DataBoxHeavyAccountCopyLogDetails.java | 11 +- .../models/DataBoxHeavyJobDetails.java | 28 +- .../models/DataBoxHeavyJobSecrets.java | 8 +- .../databox/models/DataBoxHeavySecret.java | 8 +- .../databox/models/DataBoxJobDetails.java | 28 +- .../DataBoxScheduleAvailabilityRequest.java | 10 +- .../databox/models/DataBoxSecret.java | 8 +- .../databox/models/DataCenterCode.java | 209 ++++ .../databox/models/DataExportDetails.java | 13 +- .../databox/models/DataImportDetails.java | 37 +- .../DataLocationToServiceLocationMap.java | 8 +- .../DataTransferDetailsValidationRequest.java | 13 +- ...erDetailsValidationResponseProperties.java | 9 +- .../databox/models/DataboxJobSecrets.java | 8 +- .../DatacenterAddressInstructionResponse.java | 45 + .../DatacenterAddressLocationResponse.java | 225 ++++ .../models/DatacenterAddressRequest.java | 94 ++ .../models/DatacenterAddressResponse.java | 68 ++ .../databox/models/DatacenterAddressType.java | 51 + .../databox/models/DcAccessSecurityCode.java | 8 +- .../databox/models/DeviceErasureDetails.java | 55 + .../DiskScheduleAvailabilityRequest.java | 11 +- .../databox/models/DiskSecret.java | 11 +- .../databox/models/DoubleEncryption.java | 6 +- .../databox/models/EncryptionPreferences.java | 8 +- .../databox/models/ExportDiskDetails.java | 70 ++ .../databox/models/FilterFileDetails.java | 13 +- .../databox/models/FilterFileType.java | 6 +- .../models/GranularCopyLogDetails.java | 33 + .../databox/models/GranularCopyProgress.java | 255 ++++ .../HeavyScheduleAvailabilityRequest.java | 10 +- .../databox/models/IdentityProperties.java | 8 +- .../databox/models/ImportDiskDetails.java | 136 +++ .../databox/models/JobDeliveryInfo.java | 8 +- .../databox/models/JobDeliveryType.java | 6 +- .../databox/models/JobDetails.java | 95 +- .../databox/models/JobResource.java | 142 ++- .../databox/models/JobResourceList.java | 8 +- .../models/JobResourceUpdateParameter.java | 47 +- .../databox/models/JobSecrets.java | 9 +- .../databox/models/JobStages.java | 8 +- .../resourcemanager/databox/models/Jobs.java | 80 +- .../databox/models/KekType.java | 6 +- .../databox/models/KeyEncryptionKey.java | 14 +- .../models/LastMitigationActionOnJob.java | 11 +- .../databox/models/LogCollectionLevel.java | 6 +- .../databox/models/ManagedDiskDetails.java | 16 +- .../models/MarkDevicesShippedRequest.java | 61 + .../databox/models/MitigateJobRequest.java | 11 +- .../models/NotificationPreference.java | 11 +- .../databox/models/NotificationStageName.java | 67 +- .../databox/models/OperationDisplay.java | 8 +- .../databox/models/OperationList.java | 8 +- .../databox/models/Operations.java | 4 +- .../models/OverallValidationStatus.java | 6 +- .../databox/models/PackageCarrierDetails.java | 102 ++ .../databox/models/PackageCarrierInfo.java | 76 ++ .../models/PackageShippingDetails.java | 34 +- .../databox/models/Preferences.java | 65 +- .../models/PreferencesValidationRequest.java | 11 +- ...eferencesValidationResponseProperties.java | 8 +- .../models/RegionConfigurationRequest.java | 37 +- .../models/RegionConfigurationResponse.java | 7 + .../databox/models/ResourceIdentity.java | 10 +- .../databox/models/ResourceProviders.java | 10 +- .../models/ReverseShippingDetails.java | 99 ++ .../ReverseShippingDetailsEditStatus.java | 54 + .../ReverseTransportPreferenceEditStatus.java | 54 + .../models/ScheduleAvailabilityRequest.java | 11 +- .../models/ScheduleAvailabilityResponse.java | 8 +- .../databox/models/Services.java | 66 +- .../models/ShareCredentialDetails.java | 8 +- .../models/ShareDestinationFormatType.java | 6 +- .../databox/models/ShipmentPickUpRequest.java | 21 +- .../databox/models/ShippingAddress.java | 13 +- .../resourcemanager/databox/models/Sku.java | 11 +- .../SkuAvailabilityValidationRequest.java | 17 +- ...ilabilityValidationResponseProperties.java | 8 +- .../databox/models/SkuCapacity.java | 8 +- .../databox/models/SkuCost.java | 13 +- .../databox/models/SkuDisabledReason.java | 6 +- .../databox/models/SkuInformation.java | 8 + .../databox/models/SkuName.java | 9 +- .../databox/models/StageName.java | 116 +- .../databox/models/StageStatus.java | 20 +- .../databox/models/StorageAccountDetails.java | 11 +- ...IsAllowedToCreateJobValidationRequest.java | 7 +- ...CreateJobValidationResponseProperties.java | 10 +- .../databox/models/TransferAllDetails.java | 11 +- .../databox/models/TransferConfiguration.java | 19 +- ...ansferConfigurationTransferAllDetails.java | 8 +- ...ferConfigurationTransferFilterDetails.java | 8 +- .../models/TransferConfigurationType.java | 6 +- .../databox/models/TransferFilterDetails.java | 11 +- .../databox/models/TransferType.java | 6 +- .../models/TransportAvailabilityDetails.java | 8 +- .../models/TransportAvailabilityRequest.java | 8 +- .../models/TransportAvailabilityResponse.java | 8 +- .../databox/models/TransportPreferences.java | 28 +- .../models/TransportShipmentTypes.java | 6 +- .../models/UnencryptedCredentialsList.java | 8 +- .../databox/models/UpdateJobDetails.java | 95 +- .../databox/models/UserAssignedIdentity.java | 8 +- .../models/UserAssignedProperties.java | 11 +- .../databox/models/ValidateAddress.java | 13 +- .../models/ValidationInputDiscriminator.java | 6 +- .../models/ValidationInputRequest.java | 6 +- .../models/ValidationInputResponse.java | 8 +- .../databox/models/ValidationRequest.java | 14 +- .../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 ++ 200 files changed, 7721 insertions(+), 1802 deletions(-) create mode 100644 sdk/databox/azure-resourcemanager-databox/SAMPLE.md 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/ContactInfo.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/main/java/com/azure/resourcemanager/databox/models/ReverseShippingDetails.java create mode 100644 sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/ReverseShippingDetailsEditStatus.java create mode 100644 sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/ReverseTransportPreferenceEditStatus.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..3f1c94063527 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-11-22) +- Azure Resource Manager DataBox client library for Java. This package contains Microsoft Azure SDK for DataBox Management SDK. Package tag package-2022-09. 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..2e0f01eb764a 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-09. 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}) @@ -41,19 +41,19 @@ Various documentation is available to help you get started Azure Management Libraries require a `TokenCredential` implementation for authentication and an `HttpClient` implementation for HTTP client. -[Azure Identity][azure_identity] package and [Azure Core Netty HTTP][azure_core_http_netty] package provide the default implementation. +[Azure Identity][azure_identity] and [Azure Core Netty HTTP][azure_core_http_netty] packages provide the default implementation. ### Authentication -By default, Azure Active Directory token authentication depends on correct configure of following environment variables. +By default, Azure Active Directory token authentication depends on correct configuration of the following environment variables. - `AZURE_CLIENT_ID` for Azure client ID. - `AZURE_TENANT_ID` for Azure tenant ID. - `AZURE_CLIENT_SECRET` or `AZURE_CLIENT_CERTIFICATE_PATH` for client secret or client certificate. -In addition, Azure subscription ID can be configured via environment variable `AZURE_SUBSCRIPTION_ID`. +In addition, Azure subscription ID can be configured via `AZURE_SUBSCRIPTION_ID` environment variable. -With above configuration, `azure` client can be authenticated by following code: +With above configuration, `azure` client can be authenticated using the following code: ```java AzureProfile profile = new AzureProfile(AzureEnvironment.AZURE); @@ -74,19 +74,22 @@ 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 ## Contributing -For details on contributing to this repository, see the [contributing guide](https://github.com/Azure/azure-sdk-for-java/blob/main/CONTRIBUTING.md). +For details on contributing to this repository, see the [contributing guide][cg]. + +This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit . + +When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repositories using our CLA. -1. Fork it -1. Create your feature branch (`git checkout -b my-new-feature`) -1. Commit your changes (`git commit -am 'Add some feature'`) -1. Push to the branch (`git push origin my-new-feature`) -1. Create new Pull Request +This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For more information see the [Code of Conduct FAQ][coc_faq] or contact with any additional questions or comments. [survey]: https://microsoft.qualtrics.com/jfe/form/SV_ehN0lIk2FKEBkwd?Q_CHL=DOCS @@ -97,3 +100,6 @@ For details on contributing to this repository, see the [contributing guide](htt [azure_core_http_netty]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/core/azure-core-http-netty [authenticate]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/AUTH.md [design]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/DESIGN.md +[cg]: https://github.com/Azure/azure-sdk-for-java/blob/main/CONTRIBUTING.md +[coc]: https://opensource.microsoft.com/codeofconduct/ +[coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/ diff --git a/sdk/databox/azure-resourcemanager-databox/SAMPLE.md b/sdk/databox/azure-resourcemanager-databox/SAMPLE.md new file mode 100644 index 000000000000..75ad45cb23aa --- /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-09-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-09-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-09-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("fakeTokenPlaceholder") + .withCompanyName("Microsoft") + .withAddressType(AddressType.COMMERCIAL)) + .withDataImportDetails( + Arrays + .asList( + new DataImportDetails() + .withAccountDetails( + new StorageAccountDetails() + .withSharePassword("fakeTokenPlaceholder") + .withStorageAccountId( + "/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourceGroups/databoxbvt1/providers/Microsoft.Storage/storageAccounts/databoxbvttestaccount2")))) + .withDevicePassword("fakeTokenPlaceholder")) + .create(); + } + + /* + * x-ms-original-file: specification/databox/resource-manager/Microsoft.DataBox/stable/2022-09-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("fakeTokenPlaceholder") + .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-09-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("fakeTokenPlaceholder") + .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-09-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("fakeTokenPlaceholder") + .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-09-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("fakeTokenPlaceholder") + .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-09-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-09-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-09-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-09-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-09-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-09-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-09-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-09-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-09-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-09-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-09-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-09-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-09-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("fakeTokenPlaceholder") + .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-09-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-09-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-09-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-09-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-09-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-09-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("fakeTokenPlaceholder") + .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-09-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("fakeTokenPlaceholder") + .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-09-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("fakeTokenPlaceholder") + .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 120acb43967e..70a5a5c7fd0f 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-09. + 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.34.0 - - - com.azure - azure-core-management - 1.9.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.34.0 + + + com.azure + azure-core-management + 1.9.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..1c6194f67a9d 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. + * @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); + + /** + * 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); + /** * 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); @@ -75,13 +108,16 @@ public interface JobsClient { * @param resourceGroupName The Resource Group Name. * @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 expand $expand is supported on details parameter for job, which provides details on the job stages. + * @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 information about the specified job. + * @return information about the specified job along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - JobResourceInner getByResourceGroup(String resourceGroupName, String jobName); + Response getByResourceGroupWithResponse( + String resourceGroupName, String jobName, String expand, Context context); /** * Gets information about the specified job. @@ -89,16 +125,13 @@ public interface JobsClient { * @param resourceGroupName The Resource Group Name. * @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 expand $expand is supported on details parameter for job, which provides details on the job stages. - * @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 information about the specified job. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getByResourceGroupWithResponse( - String resourceGroupName, String jobName, String expand, Context context); + JobResourceInner getByResourceGroup(String resourceGroupName, String jobName); /** * Creates a new job with the specified parameters. Existing job cannot be updated with this API and should instead @@ -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); /** @@ -231,19 +264,14 @@ SyncPoller, JobResourceInner> beginCreate( * @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 jobResourceUpdateParameter Job update parameters from request body. - * @param ifMatch Defines the If-Match condition. The patch will be performed only if the ETag of the job on the - * server matches this value. * @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, - JobResourceUpdateParameter jobResourceUpdateParameter, - String ifMatch); + String resourceGroupName, String jobName, JobResourceUpdateParameter jobResourceUpdateParameter); /** * Updates the properties of an existing job. @@ -258,9 +286,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, @@ -268,27 +296,6 @@ SyncPoller, JobResourceInner> beginUpdate( String ifMatch, Context context); - /** - * Updates the properties of an existing job. - * - * @param resourceGroupName The Resource Group Name. - * @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 jobResourceUpdateParameter Job update parameters from request body. - * @param ifMatch Defines the If-Match condition. The patch will be performed only if the ETag of the job on the - * server matches this value. - * @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. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - JobResourceInner update( - String resourceGroupName, - String jobName, - JobResourceUpdateParameter jobResourceUpdateParameter, - String ifMatch); - /** * Updates the properties of an existing job. * @@ -335,14 +342,15 @@ JobResourceInner update( * @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 shipmentPickUpRequest Details of shipment pick up 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 shipment pick up response. + * @return shipment pick up response along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - ShipmentPickUpResponseInner bookShipmentPickUp( - String resourceGroupName, String jobName, ShipmentPickUpRequest shipmentPickUpRequest); + Response bookShipmentPickUpWithResponse( + String resourceGroupName, String jobName, ShipmentPickUpRequest shipmentPickUpRequest, Context context); /** * Book shipment pick up. @@ -351,15 +359,14 @@ ShipmentPickUpResponseInner bookShipmentPickUp( * @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 shipmentPickUpRequest Details of shipment pick up 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 shipment pick up response. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response bookShipmentPickUpWithResponse( - String resourceGroupName, String jobName, ShipmentPickUpRequest shipmentPickUpRequest, Context context); + ShipmentPickUpResponseInner bookShipmentPickUp( + String resourceGroupName, String jobName, ShipmentPickUpRequest shipmentPickUpRequest); /** * CancelJob. @@ -368,12 +375,15 @@ Response bookShipmentPickUpWithResponse( * @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 cancellationReason Reason for cancellation. + * @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) - void cancel(String resourceGroupName, String jobName, CancellationReason cancellationReason); + Response cancelWithResponse( + String resourceGroupName, String jobName, CancellationReason cancellationReason, Context context); /** * CancelJob. @@ -382,15 +392,12 @@ Response bookShipmentPickUpWithResponse( * @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 cancellationReason Reason for cancellation. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response cancelWithResponse( - String resourceGroupName, String jobName, CancellationReason cancellationReason, Context context); + void cancel(String resourceGroupName, String jobName, CancellationReason cancellationReason); /** * This method gets the unencrypted secrets related to the job. @@ -401,7 +408,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 +423,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..50ef8c2b8a37 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 @@ -19,12 +19,15 @@ public interface ResourceProvidersClient { * 24 characters in length and use any alphanumeric and underscore only. * @param resourceGroupName The Resource Group Name. * @param mitigateJobRequest Mitigation 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) - void mitigate(String jobName, String resourceGroupName, MitigateJobRequest mitigateJobRequest); + Response mitigateWithResponse( + String jobName, String resourceGroupName, MitigateJobRequest mitigateJobRequest, Context context); /** * Request to mitigate for a given job. @@ -33,13 +36,10 @@ public interface ResourceProvidersClient { * 24 characters in length and use any alphanumeric and underscore only. * @param resourceGroupName The Resource Group Name. * @param mitigateJobRequest Mitigation Request. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response mitigateWithResponse( - String jobName, String resourceGroupName, MitigateJobRequest mitigateJobRequest, Context context); + void mitigate(String jobName, String resourceGroupName, MitigateJobRequest mitigateJobRequest); } 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..6153f7584d66 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( @@ -57,13 +57,15 @@ PagedIterable listAvailableSkusByResourceGroup( * * @param location The location of the resource. * @param validateAddress Shipping address of the customer. + * @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 output of the address validation api. + * @return output of the address validation api along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - AddressValidationOutputInner validateAddress(String location, ValidateAddress validateAddress); + Response validateAddressWithResponse( + String location, ValidateAddress validateAddress, Context context); /** * [DEPRECATED NOTICE: This operation will soon be removed]. This method validates the customer shipping address and @@ -71,15 +73,13 @@ PagedIterable listAvailableSkusByResourceGroup( * * @param location The location of the resource. * @param validateAddress Shipping address of the customer. - * @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 output of the address validation api. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response validateAddressWithResponse( - String location, ValidateAddress validateAddress, Context context); + AddressValidationOutputInner validateAddress(String location, ValidateAddress validateAddress); /** * This method does all necessary pre-job creation validation under resource group. @@ -87,14 +87,15 @@ Response validateAddressWithResponse( * @param resourceGroupName The Resource Group Name. * @param location The location of the resource. * @param validationRequest Inputs of the customer. + * @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 response of pre job creation validations. + * @return response of pre job creation validations along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - ValidationResponseInner validateInputsByResourceGroup( - String resourceGroupName, String location, ValidationRequest validationRequest); + Response validateInputsByResourceGroupWithResponse( + String resourceGroupName, String location, ValidationRequest validationRequest, Context context); /** * This method does all necessary pre-job creation validation under resource group. @@ -102,72 +103,71 @@ ValidationResponseInner validateInputsByResourceGroup( * @param resourceGroupName The Resource Group Name. * @param location The location of the resource. * @param validationRequest Inputs of the customer. - * @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 response of pre job creation validations. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response validateInputsByResourceGroupWithResponse( - String resourceGroupName, String location, ValidationRequest validationRequest, Context context); + ValidationResponseInner validateInputsByResourceGroup( + String resourceGroupName, String location, ValidationRequest validationRequest); /** * This method does all necessary pre-job creation validation under subscription. * * @param location The location of the resource. * @param validationRequest Inputs of the customer. + * @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 response of pre job creation validations. + * @return response of pre job creation validations along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - ValidationResponseInner validateInputs(String location, ValidationRequest validationRequest); + Response validateInputsWithResponse( + String location, ValidationRequest validationRequest, Context context); /** * This method does all necessary pre-job creation validation under subscription. * * @param location The location of the resource. * @param validationRequest Inputs of the customer. - * @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 response of pre job creation validations. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response validateInputsWithResponse( - String location, ValidationRequest validationRequest, Context context); + ValidationResponseInner validateInputs(String location, ValidationRequest validationRequest); /** * This API provides configuration details specific to given region/location at Subscription level. * * @param location The location of the resource. * @param regionConfigurationRequest Request body to get the configuration for the region. + * @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 configuration response specific to a region. + * @return configuration response specific to a region along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - RegionConfigurationResponseInner regionConfiguration( - String location, RegionConfigurationRequest regionConfigurationRequest); + Response regionConfigurationWithResponse( + String location, RegionConfigurationRequest regionConfigurationRequest, Context context); /** * This API provides configuration details specific to given region/location at Subscription level. * * @param location The location of the resource. * @param regionConfigurationRequest Request body to get the configuration for the region. - * @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 configuration response specific to a region. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response regionConfigurationWithResponse( - String location, RegionConfigurationRequest regionConfigurationRequest, Context context); + RegionConfigurationResponseInner regionConfiguration( + String location, RegionConfigurationRequest regionConfigurationRequest); /** * This API provides configuration details specific to given region/location at Resource group level. @@ -175,14 +175,18 @@ Response regionConfigurationWithResponse( * @param resourceGroupName The Resource Group Name. * @param location The location of the resource. * @param regionConfigurationRequest Request body to get the configuration for the region at resource group level. + * @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 configuration response specific to a region. + * @return configuration response specific to a region along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - RegionConfigurationResponseInner regionConfigurationByResourceGroup( - String resourceGroupName, String location, RegionConfigurationRequest regionConfigurationRequest); + Response regionConfigurationByResourceGroupWithResponse( + String resourceGroupName, + String location, + RegionConfigurationRequest regionConfigurationRequest, + Context context); /** * This API provides configuration details specific to given region/location at Resource group level. @@ -190,16 +194,12 @@ RegionConfigurationResponseInner regionConfigurationByResourceGroup( * @param resourceGroupName The Resource Group Name. * @param location The location of the resource. * @param regionConfigurationRequest Request body to get the configuration for the region at resource group level. - * @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 configuration response specific to a region. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response regionConfigurationByResourceGroupWithResponse( - String resourceGroupName, - String location, - RegionConfigurationRequest regionConfigurationRequest, - Context context); + RegionConfigurationResponseInner regionConfigurationByResourceGroup( + String resourceGroupName, String location, RegionConfigurationRequest regionConfigurationRequest); } 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..9bc992af2658 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,64 +5,29 @@ 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.azure.resourcemanager.databox.models.AddressValidationProperties; 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; - +public final class AddressValidationOutputInner { /* - * The address validation status. - */ - @JsonProperty(value = "properties.validationStatus", access = JsonProperty.Access.WRITE_ONLY) - private AddressValidationStatus validationStatus; - - /* - * List of alternate addresses. - */ - @JsonProperty(value = "properties.alternateAddresses", access = JsonProperty.Access.WRITE_ONLY) - private List alternateAddresses; - - /** - * Get the error property: Error code and message of validation response. - * - * @return the error value. + * The address validation properties. */ - public CloudError error() { - return this.error; - } + @JsonProperty(value = "properties", access = JsonProperty.Access.WRITE_ONLY) + private AddressValidationProperties properties; - /** - * Get the validationStatus property: The address validation status. - * - * @return the validationStatus value. - */ - public AddressValidationStatus validationStatus() { - return this.validationStatus; + /** Creates an instance of AddressValidationOutputInner class. */ + public AddressValidationOutputInner() { } /** - * Get the alternateAddresses property: List of alternate addresses. + * Get the properties property: The address validation properties. * - * @return the alternateAddresses value. + * @return the properties value. */ - public List alternateAddresses() { - return this.alternateAddresses; + public AddressValidationProperties properties() { + return this.properties; } /** @@ -71,11 +36,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 (properties() != null) { + properties().validate(); } } } 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..66fad04c035c --- /dev/null +++ b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/fluent/models/JobProperties.java @@ -0,0 +1,319 @@ +// 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.ReverseShippingDetailsEditStatus; +import com.azure.resourcemanager.databox.models.ReverseTransportPreferenceEditStatus; +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; + + /* + * The Editable status for Reverse Shipping Address and Contact Info + */ + @JsonProperty(value = "reverseShippingDetailsUpdate", access = JsonProperty.Access.WRITE_ONLY) + private ReverseShippingDetailsEditStatus reverseShippingDetailsUpdate; + + /* + * The Editable status for Reverse Transport preferences + */ + @JsonProperty(value = "reverseTransportPreferenceUpdate", access = JsonProperty.Access.WRITE_ONLY) + private ReverseTransportPreferenceEditStatus reverseTransportPreferenceUpdate; + + /* + * 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; + + /** Creates an instance of JobProperties class. */ + public JobProperties() { + } + + /** + * 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 reverseShippingDetailsUpdate property: The Editable status for Reverse Shipping Address and Contact Info. + * + * @return the reverseShippingDetailsUpdate value. + */ + public ReverseShippingDetailsEditStatus reverseShippingDetailsUpdate() { + return this.reverseShippingDetailsUpdate; + } + + /** + * Get the reverseTransportPreferenceUpdate property: The Editable status for Reverse Transport preferences. + * + * @return the reverseTransportPreferenceUpdate value. + */ + public ReverseTransportPreferenceEditStatus reverseTransportPreferenceUpdate() { + return this.reverseTransportPreferenceUpdate; + } + + /** + * 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..af6ebfee2a99 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; @@ -14,19 +13,23 @@ import com.azure.resourcemanager.databox.models.JobDeliveryType; import com.azure.resourcemanager.databox.models.JobDetails; import com.azure.resourcemanager.databox.models.ResourceIdentity; +import com.azure.resourcemanager.databox.models.ReverseShippingDetailsEditStatus; +import com.azure.resourcemanager.databox.models.ReverseTransportPreferenceEditStatus; 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 +55,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 +67,19 @@ public class JobResourceInner extends Resource { @JsonProperty(value = "identity") private ResourceIdentity identity; + /** Creates an instance of JobResourceInner class. */ + public JobResourceInner() { + } + + /** + * 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 +116,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 +186,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 +199,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 +208,7 @@ public Boolean isCancellable() { * @return the isDeletable value. */ public Boolean isDeletable() { - return this.isDeletable; + return this.innerProperties() == null ? null : this.innerProperties().isDeletable(); } /** @@ -223,7 +217,25 @@ public Boolean isDeletable() { * @return the isShippingAddressEditable value. */ public Boolean isShippingAddressEditable() { - return this.isShippingAddressEditable; + return this.innerProperties() == null ? null : this.innerProperties().isShippingAddressEditable(); + } + + /** + * Get the reverseShippingDetailsUpdate property: The Editable status for Reverse Shipping Address and Contact Info. + * + * @return the reverseShippingDetailsUpdate value. + */ + public ReverseShippingDetailsEditStatus reverseShippingDetailsUpdate() { + return this.innerProperties() == null ? null : this.innerProperties().reverseShippingDetailsUpdate(); + } + + /** + * Get the reverseTransportPreferenceUpdate property: The Editable status for Reverse Transport preferences. + * + * @return the reverseTransportPreferenceUpdate value. + */ + public ReverseTransportPreferenceEditStatus reverseTransportPreferenceUpdate() { + return this.innerProperties() == null ? null : this.innerProperties().reverseTransportPreferenceUpdate(); } /** @@ -232,7 +244,7 @@ public Boolean isShippingAddressEditable() { * @return the isPrepareToShipEnabled value. */ public Boolean isPrepareToShipEnabled() { - return this.isPrepareToShipEnabled; + return this.innerProperties() == null ? null : this.innerProperties().isPrepareToShipEnabled(); } /** @@ -241,7 +253,7 @@ public Boolean isPrepareToShipEnabled() { * @return the status value. */ public StageName status() { - return this.status; + return this.innerProperties() == null ? null : this.innerProperties().status(); } /** @@ -250,7 +262,7 @@ public StageName status() { * @return the startTime value. */ public OffsetDateTime startTime() { - return this.startTime; + return this.innerProperties() == null ? null : this.innerProperties().startTime(); } /** @@ -259,7 +271,7 @@ public OffsetDateTime startTime() { * @return the error value. */ public CloudError error() { - return this.error; + return this.innerProperties() == null ? null : this.innerProperties().error(); } /** @@ -268,7 +280,7 @@ public CloudError error() { * @return the details value. */ public JobDetails details() { - return this.details; + return this.innerProperties() == null ? null : this.innerProperties().details(); } /** @@ -278,7 +290,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 +303,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 +312,7 @@ public String cancellationReason() { * @return the deliveryType value. */ public JobDeliveryType deliveryType() { - return this.deliveryType; + return this.innerProperties() == null ? null : this.innerProperties().deliveryType(); } /** @@ -307,7 +322,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 +335,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 +345,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 +358,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 +367,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 +386,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..cd020bbb40ce 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; @@ -46,6 +41,10 @@ public final class OperationInner { @JsonProperty(value = "isDataAction") private Boolean isDataAction; + /** Creates an instance of OperationInner class. */ + public OperationInner() { + } + /** * Get the name property: Name of the operation. Format: * {resourceProviderNamespace}/{resourceType}/{read|write|delete|action}. 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..3edc15a865f3 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,16 @@ 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; + + /** Creates an instance of RegionConfigurationResponseInner class. */ + public RegionConfigurationResponseInner() { + } + /** * Get the scheduleAvailabilityResponse property: Schedule availability for given sku in a region. * @@ -46,6 +53,15 @@ public TransportAvailabilityResponse transportAvailabilityResponse() { return this.transportAvailabilityResponse; } + /** + * Get the datacenterAddressResponse property: Datacenter address for given sku in a region. + * + * @return the datacenterAddressResponse value. + */ + public DatacenterAddressResponse datacenterAddressResponse() { + return this.datacenterAddressResponse; + } + /** * Validates the instance. * @@ -58,5 +74,8 @@ public void validate() { if (transportAvailabilityResponse() != null) { transportAvailabilityResponse().validate(); } + if (datacenterAddressResponse() != null) { + datacenterAddressResponse().validate(); + } } } diff --git a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/fluent/models/ShipmentPickUpResponseInner.java b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/fluent/models/ShipmentPickUpResponseInner.java index b20b834df680..d433e51a82b7 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,12 +18,15 @@ 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; + /** Creates an instance of ShipmentPickUpResponseInner class. */ + public ShipmentPickUpResponseInner() { + } + /** * Get the confirmationNumber property: Confirmation number for the pick up request. * 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..5a2e7bee87b8 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,14 @@ 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. - */ - @JsonProperty(value = "properties.disabledReason", access = JsonProperty.Access.WRITE_ONLY) - private SkuDisabledReason disabledReason; - - /* - * Message for why the Sku is disabled. + * Properties of the sku. */ - @JsonProperty(value = "properties.disabledReasonMessage", access = JsonProperty.Access.WRITE_ONLY) - private String disabledReasonMessage; + @JsonProperty(value = "properties", access = JsonProperty.Access.WRITE_ONLY) + private SkuProperties innerProperties; - /* - * Required feature to access the sku. - */ - @JsonProperty(value = "properties.requiredFeature", access = JsonProperty.Access.WRITE_ONLY) - private String requiredFeature; + /** Creates an instance of SkuInformationInner class. */ + public SkuInformationInner() { + } /** * Get the sku property: The Sku. @@ -94,13 +56,22 @@ public Boolean enabled() { return this.enabled; } + /** + * Get the innerProperties property: Properties of the sku. + * + * @return the innerProperties value. + */ + private SkuProperties innerProperties() { + return this.innerProperties; + } + /** * Get the dataLocationToServiceLocationMap property: The map of data location to service location. * * @return the dataLocationToServiceLocationMap value. */ public List dataLocationToServiceLocationMap() { - return this.dataLocationToServiceLocationMap; + return this.innerProperties() == null ? null : this.innerProperties().dataLocationToServiceLocationMap(); } /** @@ -109,7 +80,7 @@ public List dataLocationToServiceLocationMap() * @return the capacity value. */ public SkuCapacity capacity() { - return this.capacity; + return this.innerProperties() == null ? null : this.innerProperties().capacity(); } /** @@ -118,7 +89,7 @@ public SkuCapacity capacity() { * @return the costs value. */ public List costs() { - return this.costs; + return this.innerProperties() == null ? null : this.innerProperties().costs(); } /** @@ -127,7 +98,7 @@ public List costs() { * @return the apiVersions value. */ public List apiVersions() { - return this.apiVersions; + return this.innerProperties() == null ? null : this.innerProperties().apiVersions(); } /** @@ -136,7 +107,7 @@ public List apiVersions() { * @return the disabledReason value. */ public SkuDisabledReason disabledReason() { - return this.disabledReason; + return this.innerProperties() == null ? null : this.innerProperties().disabledReason(); } /** @@ -145,7 +116,7 @@ public SkuDisabledReason disabledReason() { * @return the disabledReasonMessage value. */ public String disabledReasonMessage() { - return this.disabledReasonMessage; + return this.innerProperties() == null ? null : this.innerProperties().disabledReasonMessage(); } /** @@ -154,7 +125,17 @@ public String disabledReasonMessage() { * @return the requiredFeature value. */ public String requiredFeature() { - return this.requiredFeature; + return this.innerProperties() == null ? null : this.innerProperties().requiredFeature(); + } + + /** + * Get the countriesWithinCommerceBoundary property: List of all the Countries in the SKU specific commerce + * boundary. + * + * @return the countriesWithinCommerceBoundary value. + */ + public List countriesWithinCommerceBoundary() { + return this.innerProperties() == null ? null : this.innerProperties().countriesWithinCommerceBoundary(); } /** @@ -166,14 +147,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..814405d4f85c --- /dev/null +++ b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/fluent/models/SkuProperties.java @@ -0,0 +1,159 @@ +// 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; + + /* + * List of all the Countries in the SKU specific commerce boundary + */ + @JsonProperty(value = "countriesWithinCommerceBoundary", access = JsonProperty.Access.WRITE_ONLY) + private List countriesWithinCommerceBoundary; + + /** Creates an instance of SkuProperties class. */ + public SkuProperties() { + } + + /** + * 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; + } + + /** + * Get the countriesWithinCommerceBoundary property: List of all the Countries in the SKU specific commerce + * boundary. + * + * @return the countriesWithinCommerceBoundary value. + */ + public List countriesWithinCommerceBoundary() { + return this.countriesWithinCommerceBoundary; + } + + /** + * 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..570398cc052a 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. */ @@ -27,6 +23,10 @@ public final class UnencryptedCredentialsInner { @JsonProperty(value = "jobSecrets", access = JsonProperty.Access.WRITE_ONLY) private JobSecrets jobSecrets; + /** Creates an instance of UnencryptedCredentialsInner class. */ + public UnencryptedCredentialsInner() { + } + /** * Get the jobName property: 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..7276a6f78a2c --- /dev/null +++ b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/fluent/models/UpdateJobProperties.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.databox.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.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; + + /** Creates an instance of UpdateJobProperties class. */ + public UpdateJobProperties() { + } + + /** + * 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..1dc392cce7cc 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,32 @@ 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. + /** Creates an instance of ValidationResponseInner class. */ + public ValidationResponseInner() { + } + + /** + * Get the innerProperties property: Properties of pre job creation validation response. + * + * @return the innerProperties value. */ - @JsonProperty(value = "properties.individualResponseDetails", access = JsonProperty.Access.WRITE_ONLY) - private List individualResponseDetails; + private ValidationResponseProperties innerProperties() { + return this.innerProperties; + } /** * Get the status property: Overall validation status. @@ -38,7 +38,7 @@ public class ValidationResponseInner { * @return the status value. */ public OverallValidationStatus status() { - return this.status; + return this.innerProperties() == null ? null : this.innerProperties().status(); } /** @@ -48,7 +48,7 @@ public OverallValidationStatus status() { * @return the individualResponseDetails value. */ public List individualResponseDetails() { - return this.individualResponseDetails; + return this.innerProperties() == null ? null : this.innerProperties().individualResponseDetails(); } /** @@ -57,8 +57,8 @@ public List individualResponseDetails() { * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (individualResponseDetails() != null) { - individualResponseDetails().forEach(e -> e.validate()); + if (innerProperties() != null) { + innerProperties().validate(); } } } diff --git a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/fluent/models/ValidationResponseProperties.java b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/fluent/models/ValidationResponseProperties.java new file mode 100644 index 000000000000..85282f2693c5 --- /dev/null +++ b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/fluent/models/ValidationResponseProperties.java @@ -0,0 +1,61 @@ +// 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; + + /** Creates an instance of ValidationResponseProperties class. */ + public ValidationResponseProperties() { + } + + /** + * 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..b49a3bb73754 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 @@ -6,11 +6,7 @@ import com.azure.resourcemanager.databox.fluent.models.AddressValidationOutputInner; import com.azure.resourcemanager.databox.models.AddressValidationOutput; -import com.azure.resourcemanager.databox.models.AddressValidationStatus; -import com.azure.resourcemanager.databox.models.CloudError; -import com.azure.resourcemanager.databox.models.ShippingAddress; -import java.util.Collections; -import java.util.List; +import com.azure.resourcemanager.databox.models.AddressValidationProperties; public final class AddressValidationOutputImpl implements AddressValidationOutput { private AddressValidationOutputInner innerObject; @@ -23,21 +19,8 @@ public final class AddressValidationOutputImpl implements AddressValidationOutpu this.serviceManager = serviceManager; } - public CloudError error() { - return this.innerModel().error(); - } - - public AddressValidationStatus validationStatus() { - return this.innerModel().validationStatus(); - } - - public List alternateAddresses() { - List inner = this.innerModel().alternateAddresses(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } + public AddressValidationProperties properties() { + return this.innerModel().properties(); } public AddressValidationOutputInner innerModel() { 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..b44c8e85b8e1 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-09-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..fb03aba9fbb5 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,7 +17,10 @@ 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.ReverseShippingDetailsEditStatus; +import com.azure.resourcemanager.databox.models.ReverseTransportPreferenceEditStatus; import com.azure.resourcemanager.databox.models.ShipmentPickUpRequest; import com.azure.resourcemanager.databox.models.ShipmentPickUpResponse; import com.azure.resourcemanager.databox.models.Sku; @@ -63,6 +66,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(); } @@ -79,6 +90,14 @@ public Boolean isShippingAddressEditable() { return this.innerModel().isShippingAddressEditable(); } + public ReverseShippingDetailsEditStatus reverseShippingDetailsUpdate() { + return this.innerModel().reverseShippingDetailsUpdate(); + } + + public ReverseTransportPreferenceEditStatus reverseTransportPreferenceUpdate() { + return this.innerModel().reverseTransportPreferenceUpdate(); + } + public Boolean isPrepareToShipEnabled() { return this.innerModel().isPrepareToShipEnabled(); } @@ -115,14 +134,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 +142,10 @@ public String regionName() { return this.location(); } + public String resourceGroupName() { + return resourceGroupName; + } + public JobResourceInner innerModel() { return this.innerObject; } @@ -226,8 +241,15 @@ public JobResource refresh(Context context) { return this; } - public ShipmentPickUpResponse bookShipmentPickUp(ShipmentPickUpRequest shipmentPickUpRequest) { - return serviceManager.jobs().bookShipmentPickUp(resourceGroupName, jobName, shipmentPickUpRequest); + public Response markDevicesShippedWithResponse( + MarkDevicesShippedRequest markDevicesShippedRequest, Context context) { + return serviceManager + .jobs() + .markDevicesShippedWithResponse(jobName, resourceGroupName, markDevicesShippedRequest, context); + } + + public void markDevicesShipped(MarkDevicesShippedRequest markDevicesShippedRequest) { + serviceManager.jobs().markDevicesShipped(jobName, resourceGroupName, markDevicesShippedRequest); } public Response bookShipmentPickUpWithResponse( @@ -237,14 +259,18 @@ public Response bookShipmentPickUpWithResponse( .bookShipmentPickUpWithResponse(resourceGroupName, jobName, shipmentPickUpRequest, context); } - public void cancel(CancellationReason cancellationReason) { - serviceManager.jobs().cancel(resourceGroupName, jobName, cancellationReason); + public ShipmentPickUpResponse bookShipmentPickUp(ShipmentPickUpRequest shipmentPickUpRequest) { + return serviceManager.jobs().bookShipmentPickUp(resourceGroupName, jobName, shipmentPickUpRequest); } public Response cancelWithResponse(CancellationReason cancellationReason, Context context) { return serviceManager.jobs().cancelWithResponse(resourceGroupName, jobName, cancellationReason, context); } + public void cancel(CancellationReason cancellationReason) { + serviceManager.jobs().cancel(resourceGroupName, jobName, cancellationReason); + } + public PagedIterable listCredentials() { return serviceManager.jobs().listCredentials(resourceGroupName, jobName); } @@ -263,13 +289,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 +309,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 +334,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..502ae3f68979 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; @@ -73,7 +71,7 @@ public final class JobsClientImpl implements JobsClient { */ @Host("{$host}") @ServiceInterface(name = "DataBoxManagementCli") - private interface JobsService { + public interface JobsService { @Headers({"Content-Type: application/json"}) @Get("/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/jobs") @ExpectedResponses({200}) @@ -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. + * @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(); + } + + /** + * 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) { + markDevicesShippedWithResponse(jobName, resourceGroupName, markDevicesShippedRequest, Context.NONE); + } + /** * 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( @@ -691,48 +883,16 @@ private Mono> getByResourceGroupWithResponseAsync( * @param resourceGroupName The Resource Group Name. * @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 expand $expand is supported on details parameter for job, which provides details on the job stages. * @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. - */ - @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(); - } - }); - } - - /** - * Gets information about the specified job. - * - * @param resourceGroupName The Resource Group Name. - * @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. - * @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())); } /** @@ -741,15 +901,17 @@ private Mono getByResourceGroupAsync(String resourceGroupName, * @param resourceGroupName The Resource Group Name. * @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 expand $expand is supported on details parameter for job, which provides details on the job stages. + * @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 information about the specified job. + * @return information about the specified job along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public JobResourceInner getByResourceGroup(String resourceGroupName, String jobName) { - final String expand = null; - return getByResourceGroupAsync(resourceGroupName, jobName, expand).block(); + public Response getByResourceGroupWithResponse( + String resourceGroupName, String jobName, String expand, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, jobName, expand, context).block(); } /** @@ -758,17 +920,15 @@ public JobResourceInner getByResourceGroup(String resourceGroupName, String jobN * @param resourceGroupName The Resource Group Name. * @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 expand $expand is supported on details parameter for job, which provides details on the job stages. - * @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 information about the specified job. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getByResourceGroupWithResponse( - String resourceGroupName, String jobName, String expand, Context context) { - return getByResourceGroupWithResponseAsync(resourceGroupName, jobName, expand, context).block(); + public JobResourceInner getByResourceGroup(String resourceGroupName, String jobName) { + final String expand = null; + return getByResourceGroupWithResponse(resourceGroupName, jobName, expand, Context.NONE).getValue(); } /** @@ -782,7 +942,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 +1000,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 +1054,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 +1082,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 +1107,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 +1127,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 +1146,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 +1167,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 +1224,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 +1273,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 +1319,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 +1340,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 +1361,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 +1378,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 +1394,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 +1411,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 +1463,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 +1529,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 +1592,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 +1605,39 @@ 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()); + } + + /** + * Updates the properties of an existing job. + * + * @param resourceGroupName The Resource Group Name. + * @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 jobResourceUpdateParameter Job update parameters from request body. + * @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 PollerFlux} for polling of job Resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, JobResourceInner> beginUpdateAsync( + String resourceGroupName, String jobName, JobResourceUpdateParameter jobResourceUpdateParameter) { + final String ifMatch = null; + Mono>> mono = + updateWithResponseAsync(resourceGroupName, jobName, jobResourceUpdateParameter, ifMatch); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + JobResourceInner.class, + JobResourceInner.class, + this.client.getContext()); } /** @@ -1456,9 +1653,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, @@ -1481,19 +1678,15 @@ private PollerFlux, JobResourceInner> beginUpdateAs * @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 jobResourceUpdateParameter Job update parameters from request body. - * @param ifMatch Defines the If-Match condition. The patch will be performed only if the ETag of the job on the - * server matches this value. * @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, - JobResourceUpdateParameter jobResourceUpdateParameter, - String ifMatch) { + String resourceGroupName, String jobName, JobResourceUpdateParameter jobResourceUpdateParameter) { + final String ifMatch = null; return beginUpdateAsync(resourceGroupName, jobName, jobResourceUpdateParameter, ifMatch).getSyncPoller(); } @@ -1510,9 +1703,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 +1728,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 +1751,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 +1775,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( @@ -1596,29 +1789,6 @@ private Mono updateAsync( .flatMap(this.client::getLroFinalResultOrError); } - /** - * Updates the properties of an existing job. - * - * @param resourceGroupName The Resource Group Name. - * @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 jobResourceUpdateParameter Job update parameters from request body. - * @param ifMatch Defines the If-Match condition. The patch will be performed only if the ETag of the job on the - * server matches this value. - * @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. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public JobResourceInner update( - String resourceGroupName, - String jobName, - JobResourceUpdateParameter jobResourceUpdateParameter, - String ifMatch) { - return updateAsync(resourceGroupName, jobName, jobResourceUpdateParameter, ifMatch).block(); - } - /** * Updates the properties of an existing job. * @@ -1673,7 +1843,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 +1901,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 +1955,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())); } /** @@ -1808,15 +1971,16 @@ private Mono bookShipmentPickUpAsync( * @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 shipmentPickUpRequest Details of shipment pick up 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 shipment pick up response. + * @return shipment pick up response along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ShipmentPickUpResponseInner bookShipmentPickUp( - String resourceGroupName, String jobName, ShipmentPickUpRequest shipmentPickUpRequest) { - return bookShipmentPickUpAsync(resourceGroupName, jobName, shipmentPickUpRequest).block(); + public Response bookShipmentPickUpWithResponse( + String resourceGroupName, String jobName, ShipmentPickUpRequest shipmentPickUpRequest, Context context) { + return bookShipmentPickUpWithResponseAsync(resourceGroupName, jobName, shipmentPickUpRequest, context).block(); } /** @@ -1826,16 +1990,16 @@ public ShipmentPickUpResponseInner bookShipmentPickUp( * @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 shipmentPickUpRequest Details of shipment pick up 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 shipment pick up response. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response bookShipmentPickUpWithResponse( - String resourceGroupName, String jobName, ShipmentPickUpRequest shipmentPickUpRequest, Context context) { - return bookShipmentPickUpWithResponseAsync(resourceGroupName, jobName, shipmentPickUpRequest, context).block(); + public ShipmentPickUpResponseInner bookShipmentPickUp( + String resourceGroupName, String jobName, ShipmentPickUpRequest shipmentPickUpRequest) { + return bookShipmentPickUpWithResponse(resourceGroupName, jobName, shipmentPickUpRequest, Context.NONE) + .getValue(); } /** @@ -1848,7 +2012,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 +2070,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 +2124,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()); } /** @@ -1975,13 +2138,16 @@ private Mono cancelAsync(String resourceGroupName, String jobName, Cancell * @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 cancellationReason Reason for cancellation. + * @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 void cancel(String resourceGroupName, String jobName, CancellationReason cancellationReason) { - cancelAsync(resourceGroupName, jobName, cancellationReason).block(); + public Response cancelWithResponse( + String resourceGroupName, String jobName, CancellationReason cancellationReason, Context context) { + return cancelWithResponseAsync(resourceGroupName, jobName, cancellationReason, context).block(); } /** @@ -1991,16 +2157,13 @@ public void cancel(String resourceGroupName, String jobName, CancellationReason * @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 cancellationReason Reason for cancellation. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response cancelWithResponse( - String resourceGroupName, String jobName, CancellationReason cancellationReason, Context context) { - return cancelWithResponseAsync(resourceGroupName, jobName, cancellationReason, context).block(); + public void cancel(String resourceGroupName, String jobName, CancellationReason cancellationReason) { + cancelWithResponse(resourceGroupName, jobName, cancellationReason, Context.NONE); } /** @@ -2012,7 +2175,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 +2230,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 +2281,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 +2298,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 +2315,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 +2332,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 +2343,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 +2379,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 +2416,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 +2453,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..4de620b3e929 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 Response markDevicesShippedWithResponse( + String jobName, + String resourceGroupName, + MarkDevicesShippedRequest markDevicesShippedRequest, + Context context) { + return this + .serviceClient() + .markDevicesShippedWithResponse(jobName, resourceGroupName, markDevicesShippedRequest, context); + } + + public void markDevicesShipped( + String jobName, String resourceGroupName, MarkDevicesShippedRequest markDevicesShippedRequest) { + this.serviceClient().markDevicesShipped(jobName, resourceGroupName, markDevicesShippedRequest); + } + public PagedIterable listByResourceGroup(String resourceGroupName) { PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); return Utils.mapPage(inner, inner1 -> new JobResourceImpl(inner1, this.manager())); @@ -54,15 +69,6 @@ public PagedIterable listByResourceGroup(String resourceGroupName, return Utils.mapPage(inner, inner1 -> new JobResourceImpl(inner1, this.manager())); } - public JobResource getByResourceGroup(String resourceGroupName, String jobName) { - JobResourceInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, jobName); - if (inner != null) { - return new JobResourceImpl(inner, this.manager()); - } else { - return null; - } - } - public Response getByResourceGroupWithResponse( String resourceGroupName, String jobName, String expand, Context context) { Response inner = @@ -78,6 +84,15 @@ public Response getByResourceGroupWithResponse( } } + public JobResource getByResourceGroup(String resourceGroupName, String jobName) { + JobResourceInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, jobName); + if (inner != null) { + return new JobResourceImpl(inner, this.manager()); + } else { + return null; + } + } + public void deleteByResourceGroup(String resourceGroupName, String jobName) { this.serviceClient().delete(resourceGroupName, jobName); } @@ -86,17 +101,6 @@ public void delete(String resourceGroupName, String jobName, Context context) { this.serviceClient().delete(resourceGroupName, jobName, context); } - public ShipmentPickUpResponse bookShipmentPickUp( - String resourceGroupName, String jobName, ShipmentPickUpRequest shipmentPickUpRequest) { - ShipmentPickUpResponseInner inner = - this.serviceClient().bookShipmentPickUp(resourceGroupName, jobName, shipmentPickUpRequest); - if (inner != null) { - return new ShipmentPickUpResponseImpl(inner, this.manager()); - } else { - return null; - } - } - public Response bookShipmentPickUpWithResponse( String resourceGroupName, String jobName, ShipmentPickUpRequest shipmentPickUpRequest, Context context) { Response inner = @@ -114,8 +118,15 @@ public Response bookShipmentPickUpWithResponse( } } - public void cancel(String resourceGroupName, String jobName, CancellationReason cancellationReason) { - this.serviceClient().cancel(resourceGroupName, jobName, cancellationReason); + public ShipmentPickUpResponse bookShipmentPickUp( + String resourceGroupName, String jobName, ShipmentPickUpRequest shipmentPickUpRequest) { + ShipmentPickUpResponseInner inner = + this.serviceClient().bookShipmentPickUp(resourceGroupName, jobName, shipmentPickUpRequest); + if (inner != null) { + return new ShipmentPickUpResponseImpl(inner, this.manager()); + } else { + return null; + } } public Response cancelWithResponse( @@ -123,6 +134,10 @@ public Response cancelWithResponse( return this.serviceClient().cancelWithResponse(resourceGroupName, jobName, cancellationReason, context); } + public void cancel(String resourceGroupName, String jobName, CancellationReason cancellationReason) { + this.serviceClient().cancel(resourceGroupName, jobName, cancellationReason); + } + public PagedIterable listCredentials(String resourceGroupName, String jobName) { PagedIterable inner = this.serviceClient().listCredentials(resourceGroupName, jobName); @@ -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..b32964726e5f 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; @@ -58,7 +55,7 @@ public final class OperationsClientImpl implements OperationsClient { */ @Host("{$host}") @ServiceInterface(name = "DataBoxManagementCli") - private interface OperationsService { + public interface OperationsService { @Headers({"Content-Type: application/json"}) @Get("/providers/Microsoft.DataBox/operations") @ExpectedResponses({200}) @@ -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..dd55f4f9c3ea 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; @@ -54,7 +51,7 @@ public final class ResourceProvidersClientImpl implements ResourceProvidersClien */ @Host("{$host}") @ServiceInterface(name = "DataBoxManagementCli") - private interface ResourceProvidersService { + public interface ResourceProvidersService { @Headers({"Content-Type: application/json"}) @Post( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs" @@ -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()); } /** @@ -209,13 +206,16 @@ private Mono mitigateAsync(String jobName, String resourceGroupName, Mitig * 24 characters in length and use any alphanumeric and underscore only. * @param resourceGroupName The Resource Group Name. * @param mitigateJobRequest Mitigation 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 void mitigate(String jobName, String resourceGroupName, MitigateJobRequest mitigateJobRequest) { - mitigateAsync(jobName, resourceGroupName, mitigateJobRequest).block(); + public Response mitigateWithResponse( + String jobName, String resourceGroupName, MitigateJobRequest mitigateJobRequest, Context context) { + return mitigateWithResponseAsync(jobName, resourceGroupName, mitigateJobRequest, context).block(); } /** @@ -225,15 +225,12 @@ public void mitigate(String jobName, String resourceGroupName, MitigateJobReques * 24 characters in length and use any alphanumeric and underscore only. * @param resourceGroupName The Resource Group Name. * @param mitigateJobRequest Mitigation Request. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response mitigateWithResponse( - String jobName, String resourceGroupName, MitigateJobRequest mitigateJobRequest, Context context) { - return mitigateWithResponseAsync(jobName, resourceGroupName, mitigateJobRequest, context).block(); + public void mitigate(String jobName, String resourceGroupName, MitigateJobRequest mitigateJobRequest) { + mitigateWithResponse(jobName, resourceGroupName, mitigateJobRequest, Context.NONE); } } 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..06b5f9a7d7e2 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; @@ -25,15 +24,15 @@ public ResourceProvidersImpl( this.serviceManager = serviceManager; } - public void mitigate(String jobName, String resourceGroupName, MitigateJobRequest mitigateJobRequest) { - this.serviceClient().mitigate(jobName, resourceGroupName, mitigateJobRequest); - } - public Response mitigateWithResponse( String jobName, String resourceGroupName, MitigateJobRequest mitigateJobRequest, Context context) { return this.serviceClient().mitigateWithResponse(jobName, resourceGroupName, mitigateJobRequest, context); } + public void mitigate(String jobName, String resourceGroupName, MitigateJobRequest mitigateJobRequest) { + this.serviceClient().mitigate(jobName, resourceGroupName, mitigateJobRequest); + } + private ResourceProvidersClient serviceClient() { return this.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..ea1a1efd6d82 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; @@ -66,7 +63,7 @@ public final class ServicesClientImpl implements ServicesClient { */ @Host("{$host}") @ServiceInterface(name = "DataBoxManagementCli") - private interface ServicesService { + public interface ServicesService { @Headers({"Content-Type: application/json"}) @Post( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/locations" @@ -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())); } /** @@ -501,14 +495,16 @@ private Mono validateAddressAsync(String location, * * @param location The location of the resource. * @param validateAddress Shipping address of the customer. + * @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 output of the address validation api. + * @return output of the address validation api along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public AddressValidationOutputInner validateAddress(String location, ValidateAddress validateAddress) { - return validateAddressAsync(location, validateAddress).block(); + public Response validateAddressWithResponse( + String location, ValidateAddress validateAddress, Context context) { + return validateAddressWithResponseAsync(location, validateAddress, context).block(); } /** @@ -517,16 +513,14 @@ public AddressValidationOutputInner validateAddress(String location, ValidateAdd * * @param location The location of the resource. * @param validateAddress Shipping address of the customer. - * @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 output of the address validation api. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response validateAddressWithResponse( - String location, ValidateAddress validateAddress, Context context) { - return validateAddressWithResponseAsync(location, validateAddress, context).block(); + public AddressValidationOutputInner validateAddress(String location, ValidateAddress validateAddress) { + return validateAddressWithResponse(location, validateAddress, Context.NONE).getValue(); } /** @@ -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())); } /** @@ -670,15 +659,17 @@ private Mono validateInputsByResourceGroupAsync( * @param resourceGroupName The Resource Group Name. * @param location The location of the resource. * @param validationRequest Inputs of the customer. + * @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 response of pre job creation validations. + * @return response of pre job creation validations along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ValidationResponseInner validateInputsByResourceGroup( - String resourceGroupName, String location, ValidationRequest validationRequest) { - return validateInputsByResourceGroupAsync(resourceGroupName, location, validationRequest).block(); + public Response validateInputsByResourceGroupWithResponse( + String resourceGroupName, String location, ValidationRequest validationRequest, Context context) { + return validateInputsByResourceGroupWithResponseAsync(resourceGroupName, location, validationRequest, context) + .block(); } /** @@ -687,17 +678,16 @@ public ValidationResponseInner validateInputsByResourceGroup( * @param resourceGroupName The Resource Group Name. * @param location The location of the resource. * @param validationRequest Inputs of the customer. - * @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 response of pre job creation validations. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response validateInputsByResourceGroupWithResponse( - String resourceGroupName, String location, ValidationRequest validationRequest, Context context) { - return validateInputsByResourceGroupWithResponseAsync(resourceGroupName, location, validationRequest, context) - .block(); + public ValidationResponseInner validateInputsByResourceGroup( + String resourceGroupName, String location, ValidationRequest validationRequest) { + return validateInputsByResourceGroupWithResponse(resourceGroupName, location, validationRequest, Context.NONE) + .getValue(); } /** @@ -708,7 +698,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 +750,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 +798,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())); } /** @@ -826,14 +811,16 @@ private Mono validateInputsAsync(String location, Valid * * @param location The location of the resource. * @param validationRequest Inputs of the customer. + * @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 response of pre job creation validations. + * @return response of pre job creation validations along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ValidationResponseInner validateInputs(String location, ValidationRequest validationRequest) { - return validateInputsAsync(location, validationRequest).block(); + public Response validateInputsWithResponse( + String location, ValidationRequest validationRequest, Context context) { + return validateInputsWithResponseAsync(location, validationRequest, context).block(); } /** @@ -841,16 +828,14 @@ public ValidationResponseInner validateInputs(String location, ValidationRequest * * @param location The location of the resource. * @param validationRequest Inputs of the customer. - * @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 response of pre job creation validations. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response validateInputsWithResponse( - String location, ValidationRequest validationRequest, Context context) { - return validateInputsWithResponseAsync(location, validationRequest, context).block(); + public ValidationResponseInner validateInputs(String location, ValidationRequest validationRequest) { + return validateInputsWithResponse(location, validationRequest, Context.NONE).getValue(); } /** @@ -861,7 +846,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 +900,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 +950,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())); } /** @@ -984,15 +964,16 @@ private Mono regionConfigurationAsync( * * @param location The location of the resource. * @param regionConfigurationRequest Request body to get the configuration for the region. + * @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 configuration response specific to a region. + * @return configuration response specific to a region along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public RegionConfigurationResponseInner regionConfiguration( - String location, RegionConfigurationRequest regionConfigurationRequest) { - return regionConfigurationAsync(location, regionConfigurationRequest).block(); + public Response regionConfigurationWithResponse( + String location, RegionConfigurationRequest regionConfigurationRequest, Context context) { + return regionConfigurationWithResponseAsync(location, regionConfigurationRequest, context).block(); } /** @@ -1000,16 +981,15 @@ public RegionConfigurationResponseInner regionConfiguration( * * @param location The location of the resource. * @param regionConfigurationRequest Request body to get the configuration for the region. - * @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 configuration response specific to a region. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response regionConfigurationWithResponse( - String location, RegionConfigurationRequest regionConfigurationRequest, Context context) { - return regionConfigurationWithResponseAsync(location, regionConfigurationRequest, context).block(); + public RegionConfigurationResponseInner regionConfiguration( + String location, RegionConfigurationRequest regionConfigurationRequest) { + return regionConfigurationWithResponse(location, regionConfigurationRequest, Context.NONE).getValue(); } /** @@ -1021,7 +1001,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 +1061,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 +1120,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())); } /** @@ -1161,15 +1136,21 @@ private Mono regionConfigurationByResourceGrou * @param resourceGroupName The Resource Group Name. * @param location The location of the resource. * @param regionConfigurationRequest Request body to get the configuration for the region at resource group level. + * @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 configuration response specific to a region. + * @return configuration response specific to a region along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public RegionConfigurationResponseInner regionConfigurationByResourceGroup( - String resourceGroupName, String location, RegionConfigurationRequest regionConfigurationRequest) { - return regionConfigurationByResourceGroupAsync(resourceGroupName, location, regionConfigurationRequest).block(); + public Response regionConfigurationByResourceGroupWithResponse( + String resourceGroupName, + String location, + RegionConfigurationRequest regionConfigurationRequest, + Context context) { + return regionConfigurationByResourceGroupWithResponseAsync( + resourceGroupName, location, regionConfigurationRequest, context) + .block(); } /** @@ -1178,31 +1159,29 @@ public RegionConfigurationResponseInner regionConfigurationByResourceGroup( * @param resourceGroupName The Resource Group Name. * @param location The location of the resource. * @param regionConfigurationRequest Request body to get the configuration for the region at resource group level. - * @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 configuration response specific to a region. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response regionConfigurationByResourceGroupWithResponse( - String resourceGroupName, - String location, - RegionConfigurationRequest regionConfigurationRequest, - Context context) { - return regionConfigurationByResourceGroupWithResponseAsync( - resourceGroupName, location, regionConfigurationRequest, context) - .block(); + public RegionConfigurationResponseInner regionConfigurationByResourceGroup( + String resourceGroupName, String location, RegionConfigurationRequest regionConfigurationRequest) { + return regionConfigurationByResourceGroupWithResponse( + resourceGroupName, location, regionConfigurationRequest, Context.NONE) + .getValue(); } /** * 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 +1215,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..62d37cb9616a 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; @@ -53,15 +52,6 @@ public PagedIterable listAvailableSkusByResourceGroup( return Utils.mapPage(inner, inner1 -> new SkuInformationImpl(inner1, this.manager())); } - public AddressValidationOutput validateAddress(String location, ValidateAddress validateAddress) { - AddressValidationOutputInner inner = this.serviceClient().validateAddress(location, validateAddress); - if (inner != null) { - return new AddressValidationOutputImpl(inner, this.manager()); - } else { - return null; - } - } - public Response validateAddressWithResponse( String location, ValidateAddress validateAddress, Context context) { Response inner = @@ -77,12 +67,10 @@ public Response validateAddressWithResponse( } } - public ValidationResponse validateInputsByResourceGroup( - String resourceGroupName, String location, ValidationRequest validationRequest) { - ValidationResponseInner inner = - this.serviceClient().validateInputsByResourceGroup(resourceGroupName, location, validationRequest); + public AddressValidationOutput validateAddress(String location, ValidateAddress validateAddress) { + AddressValidationOutputInner inner = this.serviceClient().validateAddress(location, validateAddress); if (inner != null) { - return new ValidationResponseImpl(inner, this.manager()); + return new AddressValidationOutputImpl(inner, this.manager()); } else { return null; } @@ -105,8 +93,10 @@ public Response validateInputsByResourceGroupWithResponse( } } - public ValidationResponse validateInputs(String location, ValidationRequest validationRequest) { - ValidationResponseInner inner = this.serviceClient().validateInputs(location, validationRequest); + public ValidationResponse validateInputsByResourceGroup( + String resourceGroupName, String location, ValidationRequest validationRequest) { + ValidationResponseInner inner = + this.serviceClient().validateInputsByResourceGroup(resourceGroupName, location, validationRequest); if (inner != null) { return new ValidationResponseImpl(inner, this.manager()); } else { @@ -129,12 +119,10 @@ public Response validateInputsWithResponse( } } - public RegionConfigurationResponse regionConfiguration( - String location, RegionConfigurationRequest regionConfigurationRequest) { - RegionConfigurationResponseInner inner = - this.serviceClient().regionConfiguration(location, regionConfigurationRequest); + public ValidationResponse validateInputs(String location, ValidationRequest validationRequest) { + ValidationResponseInner inner = this.serviceClient().validateInputs(location, validationRequest); if (inner != null) { - return new RegionConfigurationResponseImpl(inner, this.manager()); + return new ValidationResponseImpl(inner, this.manager()); } else { return null; } @@ -155,12 +143,10 @@ public Response regionConfigurationWithResponse( } } - public RegionConfigurationResponse regionConfigurationByResourceGroup( - String resourceGroupName, String location, RegionConfigurationRequest regionConfigurationRequest) { + public RegionConfigurationResponse regionConfiguration( + String location, RegionConfigurationRequest regionConfigurationRequest) { RegionConfigurationResponseInner inner = - this - .serviceClient() - .regionConfigurationByResourceGroup(resourceGroupName, location, regionConfigurationRequest); + this.serviceClient().regionConfiguration(location, regionConfigurationRequest); if (inner != null) { return new RegionConfigurationResponseImpl(inner, this.manager()); } else { @@ -189,6 +175,19 @@ public Response regionConfigurationByResourceGroupW } } + public RegionConfigurationResponse regionConfigurationByResourceGroup( + String resourceGroupName, String location, RegionConfigurationRequest regionConfigurationRequest) { + RegionConfigurationResponseInner inner = + this + .serviceClient() + .regionConfigurationByResourceGroup(resourceGroupName, location, regionConfigurationRequest); + if (inner != null) { + return new RegionConfigurationResponseImpl(inner, this.manager()); + } else { + return null; + } + } + private ServicesClient serviceClient() { return this.innerClient; } diff --git a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/implementation/SkuInformationImpl.java b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/implementation/SkuInformationImpl.java index deced71a9bc1..5a0e9b3a7597 100644 --- a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/implementation/SkuInformationImpl.java +++ b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/implementation/SkuInformationImpl.java @@ -76,6 +76,15 @@ public String requiredFeature() { return this.innerModel().requiredFeature(); } + public List countriesWithinCommerceBoundary() { + List inner = this.innerModel().countriesWithinCommerceBoundary(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + public SkuInformationInner innerModel() { return this.innerObject; } 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..525ce73be4ef 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; @@ -40,6 +35,10 @@ public final class AccountCredentialDetails { @JsonProperty(value = "shareCredentialDetails", access = JsonProperty.Access.WRITE_ONLY) private List shareCredentialDetails; + /** Creates an instance of AccountCredentialDetails class. */ + public AccountCredentialDetails() { + } + /** * Get the accountName property: Name of the account. * 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..02820674bc7b 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,64 @@ 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 information of the type of error. + */ + @JsonProperty(value = "info") + private Object info; /* - * Additional error type. + * Type of error (e.g. CustomerIntervention, PolicyViolation, SecurityViolation). */ @JsonProperty(value = "type") private String type; - /* - * Additional error info. - */ - @JsonProperty(value = "info") - private Object info; + /** Creates an instance of AdditionalErrorInfo class. */ + public AdditionalErrorInfo() { + } /** - * 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..128f5acd86f4 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 @@ -5,30 +5,15 @@ package com.azure.resourcemanager.databox.models; import com.azure.resourcemanager.databox.fluent.models.AddressValidationOutputInner; -import java.util.List; /** An immutable client-side representation of AddressValidationOutput. */ public interface AddressValidationOutput { /** - * Gets the error property: Error code and message of validation response. + * Gets the properties property: The address validation properties. * - * @return the error value. + * @return the properties value. */ - CloudError error(); - - /** - * Gets the validationStatus property: The address validation status. - * - * @return the validationStatus value. - */ - AddressValidationStatus validationStatus(); - - /** - * Gets the alternateAddresses property: List of alternate addresses. - * - * @return the alternateAddresses value. - */ - List alternateAddresses(); + AddressValidationProperties properties(); /** * 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/AddressValidationProperties.java b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/AddressValidationProperties.java index a1af669a02f6..9688da71b55a 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/models/AddressValidationProperties.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("ValidateAddress") @Immutable public final class AddressValidationProperties extends ValidationInputResponse { - @JsonIgnore private final ClientLogger logger = new ClientLogger(AddressValidationProperties.class); - /* * The address validation status. */ @@ -31,6 +27,10 @@ public final class AddressValidationProperties extends ValidationInputResponse { @JsonProperty(value = "alternateAddresses", access = JsonProperty.Access.WRITE_ONLY) private List alternateAddresses; + /** Creates an instance of AddressValidationProperties class. */ + public AddressValidationProperties() { + } + /** * Get the validationStatus property: The address validation status. * 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..4c08411fe660 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. */ @@ -26,6 +22,10 @@ public final class ApplianceNetworkConfiguration { @JsonProperty(value = "macAddress", access = JsonProperty.Access.WRITE_ONLY) private String macAddress; + /** Creates an instance of ApplianceNetworkConfiguration class. */ + public ApplianceNetworkConfiguration() { + } + /** * Get the name property: 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..855ffd37e0a9 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. */ @@ -41,6 +38,10 @@ public final class AvailableSkuRequest { @JsonProperty(value = "skuNames") private List skuNames; + /** Creates an instance of AvailableSkuRequest class. */ + public AvailableSkuRequest() { + } + /** * Get the transferType property: Type of the transfer. * @@ -132,20 +133,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..5b9de8306b84 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. */ @@ -28,6 +24,10 @@ public final class AvailableSkusResult { @JsonProperty(value = "nextLink") private String nextLink; + /** Creates an instance of AvailableSkusResult class. */ + public AvailableSkusResult() { + } + /** * Get the value property: 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..55e3be5be018 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. */ @@ -33,6 +29,10 @@ public final class AzureFileFilterDetails { @JsonProperty(value = "fileShareList") private List fileShareList; + /** Creates an instance of AzureFileFilterDetails class. */ + public AzureFileFilterDetails() { + } + /** * Get the filePrefixList property: 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..5c2c34a3b2a0 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. */ @@ -33,6 +29,10 @@ public final class BlobFilterDetails { @JsonProperty(value = "containerList") private List containerList; + /** Creates an instance of BlobFilterDetails class. */ + public BlobFilterDetails() { + } + /** * Get the blobPrefixList property: 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..641a59694338 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,20 +6,21 @@ 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. */ @JsonProperty(value = "reason", required = true) private String reason; + /** Creates an instance of CancellationReason class. */ + public CancellationReason() { + } + /** * Get the reason property: Reason for cancellation. * @@ -47,9 +48,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..3b14e6519b4f 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,57 @@ 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; + /** Creates an instance of CloudError class. */ + public CloudError() { + } - /* - * 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 +64,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 +75,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 +93,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 +104,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 +113,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 +123,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..6323f89c1c21 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. */ @@ -51,6 +48,10 @@ public final class ContactDetails { @JsonProperty(value = "notificationPreference") private List notificationPreference; + /** Creates an instance of ContactDetails class. */ + public ContactDetails() { + } + /** * Get the contactName property: Contact name of the person. * @@ -178,17 +179,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 +197,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/ContactInfo.java b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/ContactInfo.java new file mode 100644 index 000000000000..0388ea606435 --- /dev/null +++ b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/ContactInfo.java @@ -0,0 +1,141 @@ +// 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; + +/** Contact Info. */ +@Fluent +public final class ContactInfo { + /* + * Contact name of the person. + */ + @JsonProperty(value = "contactName", required = true) + private String contactName; + + /* + * Phone number of the contact person. + */ + @JsonProperty(value = "phone", required = true) + private String phone; + + /* + * Phone extension number of the contact person. + */ + @JsonProperty(value = "phoneExtension") + private String phoneExtension; + + /* + * Mobile number of the contact person. + */ + @JsonProperty(value = "mobile") + private String mobile; + + /** Creates an instance of ContactInfo class. */ + public ContactInfo() { + } + + /** + * Get the contactName property: Contact name of the person. + * + * @return the contactName value. + */ + public String contactName() { + return this.contactName; + } + + /** + * Set the contactName property: Contact name of the person. + * + * @param contactName the contactName value to set. + * @return the ContactInfo object itself. + */ + public ContactInfo withContactName(String contactName) { + this.contactName = contactName; + return this; + } + + /** + * Get the phone property: Phone number of the contact person. + * + * @return the phone value. + */ + public String phone() { + return this.phone; + } + + /** + * Set the phone property: Phone number of the contact person. + * + * @param phone the phone value to set. + * @return the ContactInfo object itself. + */ + public ContactInfo withPhone(String phone) { + this.phone = phone; + return this; + } + + /** + * Get the phoneExtension property: Phone extension number of the contact person. + * + * @return the phoneExtension value. + */ + public String phoneExtension() { + return this.phoneExtension; + } + + /** + * Set the phoneExtension property: Phone extension number of the contact person. + * + * @param phoneExtension the phoneExtension value to set. + * @return the ContactInfo object itself. + */ + public ContactInfo withPhoneExtension(String phoneExtension) { + this.phoneExtension = phoneExtension; + return this; + } + + /** + * Get the mobile property: Mobile number of the contact person. + * + * @return the mobile value. + */ + public String mobile() { + return this.mobile; + } + + /** + * Set the mobile property: Mobile number of the contact person. + * + * @param mobile the mobile value to set. + * @return the ContactInfo object itself. + */ + public ContactInfo withMobile(String mobile) { + this.mobile = mobile; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (contactName() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property contactName in model ContactInfo")); + } + if (phone() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property phone in model ContactInfo")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ContactInfo.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..028fea00319e 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,12 +18,15 @@ @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); + /** Creates an instance of CopyLogDetails class. */ + public CopyLogDetails() { + } /** * 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..6526be1f7a18 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; @@ -109,6 +101,10 @@ public final class CopyProgress { @JsonProperty(value = "isEnumerationInProgress", access = JsonProperty.Access.WRITE_ONLY) private Boolean isEnumerationInProgress; + /** Creates an instance of CopyProgress class. */ + public CopyProgress() { + } + /** * Get the storageAccountName property: Name of the storage account. This will be empty for data account types other * than storage account. 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..afe5543a2297 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,9 +12,11 @@ /** 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); + /** Creates an instance of CreateJobValidations class. */ + public CreateJobValidations() { + } /** {@inheritDoc} */ @Override 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..19218bad207b 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,15 +15,16 @@ @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. */ @JsonProperty(value = "deviceType", required = true) private SkuName deviceType; + /** Creates an instance of CreateOrderLimitForSubscriptionValidationRequest class. */ + public CreateOrderLimitForSubscriptionValidationRequest() { + } + /** * Get the deviceType property: Device type to be used for the job. * @@ -54,11 +54,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..1661ecb7519e 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,16 +14,16 @@ @JsonTypeName("ValidateCreateOrderLimit") @Immutable public final class CreateOrderLimitForSubscriptionValidationResponseProperties extends ValidationInputResponse { - @JsonIgnore - private final ClientLogger logger = - new ClientLogger(CreateOrderLimitForSubscriptionValidationResponseProperties.class); - /* * Create order limit validation status. */ @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) private ValidationStatus status; + /** Creates an instance of CreateOrderLimitForSubscriptionValidationResponseProperties class. */ + public CreateOrderLimitForSubscriptionValidationResponseProperties() { + } + /** * Get the status property: 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..fa8ed81857fd --- /dev/null +++ b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/CustomerDiskJobSecrets.java @@ -0,0 +1,64 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.databox.models; + +import com.azure.core.annotation.Immutable; +import com.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; + + /** Creates an instance of CustomerDiskJobSecrets class. */ + public CustomerDiskJobSecrets() { + } + + /** + * 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..d561b820f347 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,21 +23,20 @@ }) @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; + /** Creates an instance of DataAccountDetails class. */ + public DataAccountDetails() { + } + /** * Get the sharePassword property: 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 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..a07755805313 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,12 +27,15 @@ 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; + /** Creates an instance of DataBoxAccountCopyLogDetails class. */ + public DataBoxAccountCopyLogDetails() { + } + /** * Get the accountName property: Account name. * 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..6a004d31f9b8 --- /dev/null +++ b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/DataBoxCustomerDiskCopyLogDetails.java @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.databox.models; + +import com.azure.core.annotation.Immutable; +import com.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; + + /** Creates an instance of DataBoxCustomerDiskCopyLogDetails class. */ + public DataBoxCustomerDiskCopyLogDetails() { + } + + /** + * 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..c390d1d946d8 --- /dev/null +++ b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/DataBoxCustomerDiskCopyProgress.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.databox.models; + +import com.azure.core.annotation.Immutable; +import com.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; + + /** Creates an instance of DataBoxCustomerDiskCopyProgress class. */ + public DataBoxCustomerDiskCopyProgress() { + } + + /** + * 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..cd793d24e42f --- /dev/null +++ b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/DataBoxCustomerDiskJobDetails.java @@ -0,0 +1,259 @@ +// 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; + + /** Creates an instance of DataBoxCustomerDiskJobDetails class. */ + public DataBoxCustomerDiskJobDetails() { + } + + /** + * 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 withReverseShippingDetails(ReverseShippingDetails reverseShippingDetails) { + super.withReverseShippingDetails(reverseShippingDetails); + 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..941cf427d302 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. */ @@ -36,6 +32,10 @@ public final class DataBoxDiskCopyLogDetails extends CopyLogDetails { @JsonProperty(value = "verboseLogLink", access = JsonProperty.Access.WRITE_ONLY) private String verboseLogLink; + /** Creates an instance of DataBoxDiskCopyLogDetails class. */ + public DataBoxDiskCopyLogDetails() { + } + /** * Get the diskSerialNumber property: 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..36eb75848094 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 */ @@ -38,6 +34,10 @@ public final class DataBoxDiskCopyProgress { @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) private CopyStatus status; + /** Creates an instance of DataBoxDiskCopyProgress class. */ + public DataBoxDiskCopyProgress() { + } + /** * Get the serialNumber property: 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..e20ab2537ebb --- /dev/null +++ b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/DataBoxDiskGranularCopyLogDetails.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.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 id. + */ + @JsonProperty(value = "accountId", access = JsonProperty.Access.WRITE_ONLY) + private String accountId; + + /* + * 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; + + /** Creates an instance of DataBoxDiskGranularCopyLogDetails class. */ + public DataBoxDiskGranularCopyLogDetails() { + } + + /** + * Get the serialNumber property: Disk Serial Number. + * + * @return the serialNumber value. + */ + public String serialNumber() { + return this.serialNumber; + } + + /** + * Get the accountId property: Account id. + * + * @return the accountId value. + */ + public String accountId() { + return this.accountId; + } + + /** + * 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..fee969a8d90a --- /dev/null +++ b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/DataBoxDiskGranularCopyProgress.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.databox.models; + +import com.azure.core.annotation.Immutable; +import com.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; + + /** Creates an instance of DataBoxDiskGranularCopyProgress class. */ + public DataBoxDiskGranularCopyProgress() { + } + + /** + * 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..04f430c6e283 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; /* @@ -47,6 +57,10 @@ public final class DataBoxDiskJobDetails extends JobDetails { @JsonProperty(value = "passkey") private String passkey; + /** Creates an instance of DataBoxDiskJobDetails class. */ + public DataBoxDiskJobDetails() { + } + /** * Get the preferredDisks property: 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 @@ -80,6 +94,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. @@ -145,6 +177,13 @@ public DataBoxDiskJobDetails withPreferences(Preferences preferences) { return this; } + /** {@inheritDoc} */ + @Override + public DataBoxDiskJobDetails withReverseShippingDetails(ReverseShippingDetails reverseShippingDetails) { + super.withReverseShippingDetails(reverseShippingDetails); + return this; + } + /** {@inheritDoc} */ @Override public DataBoxDiskJobDetails withKeyEncryptionKey(KeyEncryptionKey keyEncryptionKey) { @@ -170,5 +209,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..76de1027a5f3 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. */ @@ -37,6 +33,10 @@ public final class DataBoxDiskJobSecrets extends JobSecrets { @JsonProperty(value = "isPasskeyUserDefined", access = JsonProperty.Access.WRITE_ONLY) private Boolean isPasskeyUserDefined; + /** Creates an instance of DataBoxDiskJobSecrets class. */ + public DataBoxDiskJobSecrets() { + } + /** * Get the diskSecrets property: 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..ca91683261ed 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,12 +28,15 @@ 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; + /** Creates an instance of DataBoxHeavyAccountCopyLogDetails class. */ + public DataBoxHeavyAccountCopyLogDetails() { + } + /** * Get the accountName property: Account name. * 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..0ff5c3cdceea 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,18 +22,19 @@ 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; + /** Creates an instance of DataBoxHeavyJobDetails class. */ + public DataBoxHeavyJobDetails() { + } + /** * Get the copyProgress property: Copy progress per account. * @@ -112,6 +109,13 @@ public DataBoxHeavyJobDetails withPreferences(Preferences preferences) { return this; } + /** {@inheritDoc} */ + @Override + public DataBoxHeavyJobDetails withReverseShippingDetails(ReverseShippingDetails reverseShippingDetails) { + super.withReverseShippingDetails(reverseShippingDetails); + return this; + } + /** {@inheritDoc} */ @Override public DataBoxHeavyJobDetails withKeyEncryptionKey(KeyEncryptionKey keyEncryptionKey) { 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..cf4fcc5b435b 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,14 +15,16 @@ @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. */ @JsonProperty(value = "cabinetPodSecrets", access = JsonProperty.Access.WRITE_ONLY) private List cabinetPodSecrets; + /** Creates an instance of DataBoxHeavyJobSecrets class. */ + public DataBoxHeavyJobSecrets() { + } + /** * Get the cabinetPodSecrets property: 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..ba7feb72df20 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. */ @@ -45,6 +41,10 @@ public final class DataBoxHeavySecret { @JsonProperty(value = "accountCredentialDetails", access = JsonProperty.Access.WRITE_ONLY) private List accountCredentialDetails; + /** Creates an instance of DataBoxHeavySecret class. */ + public DataBoxHeavySecret() { + } + /** * Get the deviceSerialNumber property: 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..9452b0e274fa 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,18 +22,19 @@ 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; + /** Creates an instance of DataBoxJobDetails class. */ + public DataBoxJobDetails() { + } + /** * Get the copyProgress property: Copy progress per storage account. * @@ -112,6 +109,13 @@ public DataBoxJobDetails withPreferences(Preferences preferences) { return this; } + /** {@inheritDoc} */ + @Override + public DataBoxJobDetails withReverseShippingDetails(ReverseShippingDetails reverseShippingDetails) { + super.withReverseShippingDetails(reverseShippingDetails); + return this; + } + /** {@inheritDoc} */ @Override public DataBoxJobDetails withKeyEncryptionKey(KeyEncryptionKey keyEncryptionKey) { 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..dd3c40e541e1 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,18 +4,18 @@ 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); + /** Creates an instance of DataBoxScheduleAvailabilityRequest class. */ + public DataBoxScheduleAvailabilityRequest() { + } /** {@inheritDoc} */ @Override 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..19d02ad12730 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. */ @@ -45,6 +41,10 @@ public final class DataBoxSecret { @JsonProperty(value = "accountCredentialDetails", access = JsonProperty.Access.WRITE_ONLY) private List accountCredentialDetails; + /** Creates an instance of DataBoxSecret class. */ + public DataBoxSecret() { + } + /** * Get the deviceSerialNumber property: 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..c31c56d03e04 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. */ @@ -32,6 +29,10 @@ public final class DataExportDetails { @JsonProperty(value = "accountDetails", required = true) private DataAccountDetails accountDetails; + /** Creates an instance of DataExportDetails class. */ + public DataExportDetails() { + } + /** * Get the transferConfiguration property: Configuration for the data transfer. * @@ -99,7 +100,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 +108,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 +116,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..6c3a4054585a 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,27 @@ 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; + + /** Creates an instance of DataImportDetails class. */ + public DataImportDetails() { + } + /** * Get the accountDetails property: Account details of the data to be transferred. * @@ -40,6 +47,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 +74,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 +82,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..16e531c23dbb 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. */ @@ -26,6 +22,10 @@ public final class DataLocationToServiceLocationMap { @JsonProperty(value = "serviceLocation", access = JsonProperty.Access.WRITE_ONLY) private String serviceLocation; + /** Creates an instance of DataLocationToServiceLocationMap class. */ + public DataLocationToServiceLocationMap() { + } + /** * Get the dataLocation property: 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..8870e577228c 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. */ @@ -43,6 +40,10 @@ public final class DataTransferDetailsValidationRequest extends ValidationInputR @JsonProperty(value = "transferType", required = true) private TransferType transferType; + /** Creates an instance of DataTransferDetailsValidationRequest class. */ + public DataTransferDetailsValidationRequest() { + } + /** * Get the dataExportDetails property: List of DataTransfer details to be used to export data from azure. * @@ -138,16 +139,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..05a5138bf77a 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,15 +14,16 @@ @JsonTypeName("ValidateDataTransferDetails") @Immutable public final class DataTransferDetailsValidationResponseProperties extends ValidationInputResponse { - @JsonIgnore - private final ClientLogger logger = new ClientLogger(DataTransferDetailsValidationResponseProperties.class); - /* * Data transfer details validation status. */ @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) private ValidationStatus status; + /** Creates an instance of DataTransferDetailsValidationResponseProperties class. */ + public DataTransferDetailsValidationResponseProperties() { + } + /** * Get the status property: 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..ba5b66f4feb2 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,14 +15,16 @@ @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. */ @JsonProperty(value = "podSecrets") private List podSecrets; + /** Creates an instance of DataboxJobSecrets class. */ + public DataboxJobSecrets() { + } + /** * Get the podSecrets property: 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..817be5f1cc87 --- /dev/null +++ b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/DatacenterAddressInstructionResponse.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.databox.models; + +import com.azure.core.annotation.Immutable; +import com.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; + + /** Creates an instance of DatacenterAddressInstructionResponse class. */ + public DatacenterAddressInstructionResponse() { + } + + /** + * 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..b17b6f1f7306 --- /dev/null +++ b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/DatacenterAddressLocationResponse.java @@ -0,0 +1,225 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.databox.models; + +import com.azure.core.annotation.Immutable; +import com.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; + + /** Creates an instance of DatacenterAddressLocationResponse class. */ + public DatacenterAddressLocationResponse() { + } + + /** + * 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..ae79e9d2aa55 --- /dev/null +++ b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/DatacenterAddressRequest.java @@ -0,0 +1,94 @@ +// 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; + + /** Creates an instance of DatacenterAddressRequest class. */ + public DatacenterAddressRequest() { + } + + /** + * 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..7ed97d0e50ac --- /dev/null +++ b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/DatacenterAddressResponse.java @@ -0,0 +1,68 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.databox.models; + +import com.azure.core.annotation.Immutable; +import com.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; + + /** Creates an instance of DatacenterAddressResponse class. */ + public DatacenterAddressResponse() { + } + + /** + * 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..aebaa4150d6f 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. */ @@ -26,6 +22,10 @@ public final class DcAccessSecurityCode { @JsonProperty(value = "forwardDCAccessCode") private String forwardDCAccessCode; + /** Creates an instance of DcAccessSecurityCode class. */ + public DcAccessSecurityCode() { + } + /** * Get the reverseDCAccessCode property: 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..1829e7f9b3e1 --- /dev/null +++ b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/DeviceErasureDetails.java @@ -0,0 +1,55 @@ +// 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; + + /** Creates an instance of DeviceErasureDetails class. */ + public DeviceErasureDetails() { + } + + /** + * 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..e78857854d35 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,15 +14,16 @@ @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; + /** Creates an instance of DiskScheduleAvailabilityRequest class. */ + public DiskScheduleAvailabilityRequest() { + } + /** * Get the expectedDataSizeInTeraBytes property: The expected size of the data, which needs to be transferred in * this job, in terabytes. 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..e70a522df186 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,12 +17,15 @@ 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; + /** Creates an instance of DiskSecret class. */ + public DiskSecret() { + } + /** * Get the diskSerialNumber property: Serial number of the assigned disk. * 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..9afaede4e120 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,21 +5,21 @@ 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. */ @JsonProperty(value = "doubleEncryption") private DoubleEncryption doubleEncryption; + /** Creates an instance of EncryptionPreferences class. */ + public EncryptionPreferences() { + } + /** * Get the doubleEncryption property: 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..f10f728c7b01 --- /dev/null +++ b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/ExportDiskDetails.java @@ -0,0 +1,70 @@ +// 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; + + /** Creates an instance of ExportDiskDetails class. */ + public ExportDiskDetails() { + } + + /** + * 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..cc29fbefe726 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. */ @@ -26,6 +23,10 @@ public final class FilterFileDetails { @JsonProperty(value = "filterFilePath", required = true) private String filterFilePath; + /** Creates an instance of FilterFileDetails class. */ + public FilterFileDetails() { + } + /** * Get the filterFileType property: Type of the filter file. * @@ -73,16 +74,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..bafc7c26c496 --- /dev/null +++ b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/GranularCopyLogDetails.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.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 { + /** Creates an instance of GranularCopyLogDetails class. */ + public 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..b54a9660d2db --- /dev/null +++ b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/GranularCopyProgress.java @@ -0,0 +1,255 @@ +// 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; + + /** Creates an instance of GranularCopyProgress class. */ + public GranularCopyProgress() { + } + + /** + * 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..d15cca0f9dcd 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,18 +4,18 @@ 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); + /** Creates an instance of HeavyScheduleAvailabilityRequest class. */ + public HeavyScheduleAvailabilityRequest() { + } /** {@inheritDoc} */ @Override 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..9c4e1d632d28 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. */ @@ -26,6 +22,10 @@ public final class IdentityProperties { @JsonProperty(value = "userAssigned") private UserAssignedProperties userAssigned; + /** Creates an instance of IdentityProperties class. */ + public IdentityProperties() { + } + /** * Get the type property: 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..5d90213190af --- /dev/null +++ b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/ImportDiskDetails.java @@ -0,0 +1,136 @@ +// 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; + + /** Creates an instance of ImportDiskDetails class. */ + public ImportDiskDetails() { + } + + /** + * 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..044fb585ff50 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,22 +5,22 @@ 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. */ @JsonProperty(value = "scheduledDateTime") private OffsetDateTime scheduledDateTime; + /** Creates an instance of JobDeliveryInfo class. */ + public JobDeliveryInfo() { + } + /** * Get the scheduledDateTime property: 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..7e594a55b66c 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. */ @@ -77,6 +75,12 @@ public class JobDetails { @JsonProperty(value = "preferences") private Preferences preferences; + /* + * Optional Reverse Shipping details for order. + */ + @JsonProperty(value = "reverseShippingDetails") + private ReverseShippingDetails reverseShippingDetails; + /* * List of copy log details. */ @@ -95,6 +99,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 +112,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 +129,22 @@ 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; + + /** Creates an instance of JobDetails class. */ + public JobDetails() { + } + /** * Get the jobStages property: List of stages that run in the job. * @@ -247,6 +272,26 @@ public JobDetails withPreferences(Preferences preferences) { return this; } + /** + * Get the reverseShippingDetails property: Optional Reverse Shipping details for order. + * + * @return the reverseShippingDetails value. + */ + public ReverseShippingDetails reverseShippingDetails() { + return this.reverseShippingDetails; + } + + /** + * Set the reverseShippingDetails property: Optional Reverse Shipping details for order. + * + * @param reverseShippingDetails the reverseShippingDetails value to set. + * @return the JobDetails object itself. + */ + public JobDetails withReverseShippingDetails(ReverseShippingDetails reverseShippingDetails) { + this.reverseShippingDetails = reverseShippingDetails; + return this; + } + /** * Get the copyLogDetails property: List of copy log details. * @@ -274,6 +319,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 +388,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 +416,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 { @@ -368,14 +440,25 @@ public void validate() { if (preferences() != null) { preferences().validate(); } + if (reverseShippingDetails() != null) { + reverseShippingDetails().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..084fec2b8b27 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. * @@ -85,6 +99,21 @@ public interface JobResource { */ Boolean isShippingAddressEditable(); + /** + * Gets the reverseShippingDetailsUpdate property: The Editable status for Reverse Shipping Address and Contact + * Info. + * + * @return the reverseShippingDetailsUpdate value. + */ + ReverseShippingDetailsEditStatus reverseShippingDetailsUpdate(); + + /** + * Gets the reverseTransportPreferenceUpdate property: The Editable status for Reverse Transport preferences. + * + * @return the reverseTransportPreferenceUpdate value. + */ + ReverseTransportPreferenceEditStatus reverseTransportPreferenceUpdate(); + /** * Gets the isPrepareToShipEnabled property: Is Prepare To Ship Enabled on this job. * @@ -148,20 +177,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 +191,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 +210,8 @@ interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, DefinitionStages.WithResourceGroup, - DefinitionStages.WithTransferType, DefinitionStages.WithSku, + DefinitionStages.WithTransferType, DefinitionStages.WithCreate { } /** The JobResource definition stages. */ @@ -223,27 +245,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 +273,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 +302,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 +343,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. @@ -410,15 +432,26 @@ interface WithIfMatch { JobResource refresh(Context context); /** - * Book shipment pick up. + * Request to mark devices for a given job as shipped. * - * @param shipmentPickUpRequest Details of shipment pick up request. + * @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 shipment pick up response. + * @return the {@link Response}. */ - ShipmentPickUpResponse bookShipmentPickUp(ShipmentPickUpRequest shipmentPickUpRequest); + Response markDevicesShippedWithResponse(MarkDevicesShippedRequest markDevicesShippedRequest, 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); /** * Book shipment pick up. @@ -428,20 +461,21 @@ 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); /** - * CancelJob. + * Book shipment pick up. * - * @param cancellationReason Reason for cancellation. + * @param shipmentPickUpRequest Details of shipment pick up 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. + * @return shipment pick up response. */ - void cancel(CancellationReason cancellationReason); + ShipmentPickUpResponse bookShipmentPickUp(ShipmentPickUpRequest shipmentPickUpRequest); /** * CancelJob. @@ -451,16 +485,26 @@ 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); + /** + * CancelJob. + * + * @param cancellationReason Reason for cancellation. + * @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 cancel(CancellationReason cancellationReason); + /** * This method gets the unencrypted secrets related to the job. * * @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 +515,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..7e42a5e4e67b 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. */ @@ -28,6 +24,10 @@ public final class JobResourceList { @JsonProperty(value = "nextLink") private String nextLink; + /** Creates an instance of JobResourceList class. */ + public JobResourceList() { + } + /** * Get the value property: 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..fa5782e257bc 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,18 @@ public class JobResourceUpdateParameter { @JsonProperty(value = "identity") private ResourceIdentity identity; - /* - * Details of a job to be updated. + /** Creates an instance of JobResourceUpdateParameter class. */ + public JobResourceUpdateParameter() { + } + + /** + * Get the innerProperties property: Properties of a job to be updated. + * + * @return the innerProperties value. */ - @JsonProperty(value = "properties.details") - private UpdateJobDetails details; + private UpdateJobProperties innerProperties() { + return this.innerProperties; + } /** * Get the tags property: The list of key value pairs that describe the resource. These tags can be used in viewing @@ -84,7 +94,7 @@ public JobResourceUpdateParameter withIdentity(ResourceIdentity identity) { * @return the details value. */ public UpdateJobDetails details() { - return this.details; + return this.innerProperties() == null ? null : this.innerProperties().details(); } /** @@ -94,7 +104,10 @@ public UpdateJobDetails details() { * @return the JobResourceUpdateParameter object itself. */ public JobResourceUpdateParameter withDetails(UpdateJobDetails details) { - this.details = details; + if (this.innerProperties() == null) { + this.innerProperties = new UpdateJobProperties(); + } + this.innerProperties().withDetails(details); return this; } @@ -104,11 +117,11 @@ public JobResourceUpdateParameter withDetails(UpdateJobDetails details) { * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } if (identity() != null) { identity().validate(); } - if (details() != null) { - details().validate(); - } } } diff --git a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/JobSecrets.java b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/JobSecrets.java index 35a61793e93b..76a60cf0593f 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 */ @@ -40,6 +37,10 @@ public class JobSecrets { @JsonProperty(value = "error", access = JsonProperty.Access.WRITE_ONLY) private CloudError error; + /** Creates an instance of JobSecrets class. */ + public JobSecrets() { + } + /** * Get the dcAccessSecurityCode property: 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..4ef53e7531bf 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. */ @@ -45,6 +41,10 @@ public final class JobStages { @JsonProperty(value = "jobStageDetails", access = JsonProperty.Access.WRITE_ONLY) private Object jobStageDetails; + /** Creates an instance of JobStages class. */ + public JobStages() { + } + /** * Get the stageName property: 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..5372e9242a1a 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. + * @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); + + /** + * 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); + /** * 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); @@ -61,12 +91,15 @@ public interface Jobs { * @param resourceGroupName The Resource Group Name. * @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 expand $expand is supported on details parameter for job, which provides details on the job stages. + * @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 information about the specified job. + * @return information about the specified job along with {@link Response}. */ - JobResource getByResourceGroup(String resourceGroupName, String jobName); + Response getByResourceGroupWithResponse( + String resourceGroupName, String jobName, String expand, Context context); /** * Gets information about the specified job. @@ -74,15 +107,12 @@ public interface Jobs { * @param resourceGroupName The Resource Group Name. * @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 expand $expand is supported on details parameter for job, which provides details on the job stages. - * @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 information about the specified job. */ - Response getByResourceGroupWithResponse( - String resourceGroupName, String jobName, String expand, Context context); + JobResource getByResourceGroup(String resourceGroupName, String jobName); /** * Deletes a job. @@ -116,13 +146,14 @@ Response getByResourceGroupWithResponse( * @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 shipmentPickUpRequest Details of shipment pick up 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 shipment pick up response. + * @return shipment pick up response along with {@link Response}. */ - ShipmentPickUpResponse bookShipmentPickUp( - String resourceGroupName, String jobName, ShipmentPickUpRequest shipmentPickUpRequest); + Response bookShipmentPickUpWithResponse( + String resourceGroupName, String jobName, ShipmentPickUpRequest shipmentPickUpRequest, Context context); /** * Book shipment pick up. @@ -131,14 +162,13 @@ ShipmentPickUpResponse bookShipmentPickUp( * @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 shipmentPickUpRequest Details of shipment pick up 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 shipment pick up response. */ - Response bookShipmentPickUpWithResponse( - String resourceGroupName, String jobName, ShipmentPickUpRequest shipmentPickUpRequest, Context context); + ShipmentPickUpResponse bookShipmentPickUp( + String resourceGroupName, String jobName, ShipmentPickUpRequest shipmentPickUpRequest); /** * CancelJob. @@ -147,11 +177,14 @@ Response bookShipmentPickUpWithResponse( * @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 cancellationReason Reason for cancellation. + * @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}. */ - void cancel(String resourceGroupName, String jobName, CancellationReason cancellationReason); + Response cancelWithResponse( + String resourceGroupName, String jobName, CancellationReason cancellationReason, Context context); /** * CancelJob. @@ -160,14 +193,11 @@ Response bookShipmentPickUpWithResponse( * @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 cancellationReason Reason for cancellation. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. */ - Response cancelWithResponse( - String resourceGroupName, String jobName, CancellationReason cancellationReason, Context context); + void cancel(String resourceGroupName, String jobName, CancellationReason cancellationReason); /** * This method gets the unencrypted secrets related to the job. @@ -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..fef46764d7a5 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,12 +30,15 @@ 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; + /** Creates an instance of KeyEncryptionKey class. */ + public KeyEncryptionKey() { + } + /** * Get the kekType property: Type of encryption key used for key encryption. * @@ -126,7 +126,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 +134,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..886304072170 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; @@ -35,6 +30,10 @@ public final class LastMitigationActionOnJob { @JsonProperty(value = "customerResolution") private CustomerResolutionCode customerResolution; + /** Creates an instance of LastMitigationActionOnJob class. */ + public LastMitigationActionOnJob() { + } + /** * Get the actionDateTimeInUtc property: Action performed date time. * 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..7ab9ca672f32 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,12 +22,15 @@ 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; + /** Creates an instance of ManagedDiskDetails class. */ + public ManagedDiskDetails() { + } + /** * Get the resourceGroupId property: Resource Group Id of the compute disks. * @@ -89,16 +89,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..68bdbaa03853 --- /dev/null +++ b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/MarkDevicesShippedRequest.java @@ -0,0 +1,61 @@ +// 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; + + /** Creates an instance of MarkDevicesShippedRequest class. */ + public MarkDevicesShippedRequest() { + } + + /** + * 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..580be705767e 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,20 +6,21 @@ 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 */ @JsonProperty(value = "customerResolutionCode", required = true) private CustomerResolutionCode customerResolutionCode; + /** Creates an instance of MitigateJobRequest class. */ + public MitigateJobRequest() { + } + /** * Get the customerResolutionCode property: Resolution code for the job. * @@ -47,10 +48,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..5c03a1f925a1 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. */ @@ -26,6 +23,10 @@ public final class NotificationPreference { @JsonProperty(value = "sendNotification", required = true) private boolean sendNotification; + /** Creates an instance of NotificationPreference class. */ + public NotificationPreference() { + } + /** * Get the stageName property: Name of the stage. * @@ -73,10 +74,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..c48b0b2dfb01 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. */ @@ -38,6 +34,10 @@ public final class OperationDisplay { @JsonProperty(value = "description") private String description; + /** Creates an instance of OperationDisplay class. */ + public OperationDisplay() { + } + /** * Get the provider property: 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..37f5812dbb31 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. */ @@ -28,6 +24,10 @@ public final class OperationList { @JsonProperty(value = "nextLink") private String nextLink; + /** Creates an instance of OperationList class. */ + public OperationList() { + } + /** * Get the value property: 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..ae213bbe55d8 --- /dev/null +++ b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/PackageCarrierDetails.java @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.databox.models; + +import com.azure.core.annotation.Fluent; +import com.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; + + /** Creates an instance of PackageCarrierDetails class. */ + public PackageCarrierDetails() { + } + + /** + * 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..6dfaafa6fce5 --- /dev/null +++ b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/PackageCarrierInfo.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.databox.models; + +import com.azure.core.annotation.Fluent; +import com.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; + + /** Creates an instance of PackageCarrierInfo class. */ + public PackageCarrierInfo() { + } + + /** + * 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..fbc2fc5ee982 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,18 @@ public final class PackageShippingDetails { @JsonProperty(value = "trackingId", access = JsonProperty.Access.WRITE_ONLY) private String trackingId; - /* - * Url where shipment can be tracked. + /** Creates an instance of PackageShippingDetails class. */ + public PackageShippingDetails() { + } + + /** + * Get the trackingUrl property: Url where shipment can be tracked. + * + * @return the trackingUrl value. */ - @JsonProperty(value = "trackingUrl", access = JsonProperty.Access.WRITE_ONLY) - private String trackingUrl; + public String trackingUrl() { + return this.trackingUrl; + } /** * Get the carrierName property: Name of the carrier. @@ -50,15 +59,6 @@ public String trackingId() { return this.trackingId; } - /** - * Get the trackingUrl property: Url where shipment can be tracked. - * - * @return the trackingUrl value. - */ - public String trackingUrl() { - return this.trackingUrl; - } - /** * Validates the instance. * diff --git a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/Preferences.java b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/Preferences.java index c00104dd2fe7..31c8c675cf66 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. */ @@ -27,12 +23,28 @@ public final class Preferences { @JsonProperty(value = "transportPreferences") private TransportPreferences transportPreferences; + /* + * Optional Preferences related to the reverse shipment logistics of the sku. + */ + @JsonProperty(value = "reverseTransportPreferences") + private TransportPreferences reverseTransportPreferences; + /* * Preferences related to the Encryption. */ @JsonProperty(value = "encryptionPreferences") private EncryptionPreferences encryptionPreferences; + /* + * Preferences related to the Access Tier of storage accounts. + */ + @JsonProperty(value = "storageAccountAccessTierPreferences") + private List storageAccountAccessTierPreferences; + + /** Creates an instance of Preferences class. */ + public Preferences() { + } + /** * Get the preferredDataCenterRegion property: Preferred data center region. * @@ -73,6 +85,28 @@ public Preferences withTransportPreferences(TransportPreferences transportPrefer return this; } + /** + * Get the reverseTransportPreferences property: Optional Preferences related to the reverse shipment logistics of + * the sku. + * + * @return the reverseTransportPreferences value. + */ + public TransportPreferences reverseTransportPreferences() { + return this.reverseTransportPreferences; + } + + /** + * Set the reverseTransportPreferences property: Optional Preferences related to the reverse shipment logistics of + * the sku. + * + * @param reverseTransportPreferences the reverseTransportPreferences value to set. + * @return the Preferences object itself. + */ + public Preferences withReverseTransportPreferences(TransportPreferences reverseTransportPreferences) { + this.reverseTransportPreferences = reverseTransportPreferences; + return this; + } + /** * Get the encryptionPreferences property: Preferences related to the Encryption. * @@ -93,6 +127,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. * @@ -102,6 +156,9 @@ public void validate() { if (transportPreferences() != null) { transportPreferences().validate(); } + if (reverseTransportPreferences() != null) { + reverseTransportPreferences().validate(); + } if (encryptionPreferences() != null) { encryptionPreferences().validate(); } 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..e34c053d6c80 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. */ @@ -30,6 +27,10 @@ public final class PreferencesValidationRequest extends ValidationInputRequest { @JsonProperty(value = "deviceType", required = true) private SkuName deviceType; + /** Creates an instance of PreferencesValidationRequest class. */ + public PreferencesValidationRequest() { + } + /** * Get the preference property: Preference of transport and data center. * @@ -82,10 +83,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..9fa5bd55e658 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,14 +14,16 @@ @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. */ @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) private ValidationStatus status; + /** Creates an instance of PreferencesValidationResponseProperties class. */ + public PreferencesValidationResponseProperties() { + } + /** * Get the status property: 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..931c98cd232f 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,16 @@ 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; + + /** Creates an instance of RegionConfigurationRequest class. */ + public RegionConfigurationRequest() { + } + /** * Get the scheduleAvailabilityRequest property: Request body to get the availability for scheduling orders. * @@ -68,6 +74,26 @@ public RegionConfigurationRequest withTransportAvailabilityRequest( return this; } + /** + * Get the datacenterAddressRequest property: Request body to get the datacenter address for given sku. + * + * @return the datacenterAddressRequest value. + */ + public DatacenterAddressRequest datacenterAddressRequest() { + return this.datacenterAddressRequest; + } + + /** + * Set the datacenterAddressRequest property: Request body to get the datacenter address for given sku. + * + * @param datacenterAddressRequest the datacenterAddressRequest value to set. + * @return the RegionConfigurationRequest object itself. + */ + public RegionConfigurationRequest withDatacenterAddressRequest(DatacenterAddressRequest datacenterAddressRequest) { + this.datacenterAddressRequest = datacenterAddressRequest; + return this; + } + /** * Validates the instance. * @@ -80,5 +106,8 @@ public void validate() { if (transportAvailabilityRequest() != null) { transportAvailabilityRequest().validate(); } + if (datacenterAddressRequest() != null) { + datacenterAddressRequest().validate(); + } } } diff --git a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/RegionConfigurationResponse.java b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/RegionConfigurationResponse.java index 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..0cd6c4c41141 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,8 +34,13 @@ public class ResourceIdentity { * User Assigned Identities */ @JsonProperty(value = "userAssignedIdentities") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map userAssignedIdentities; + /** Creates an instance of ResourceIdentity class. */ + public ResourceIdentity() { + } + /** * Get the type property: Identity type. * 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..5183164aa85c 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 @@ -16,11 +16,14 @@ public interface ResourceProviders { * 24 characters in length and use any alphanumeric and underscore only. * @param resourceGroupName The Resource Group Name. * @param mitigateJobRequest Mitigation 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}. */ - void mitigate(String jobName, String resourceGroupName, MitigateJobRequest mitigateJobRequest); + Response mitigateWithResponse( + String jobName, String resourceGroupName, MitigateJobRequest mitigateJobRequest, Context context); /** * Request to mitigate for a given job. @@ -29,12 +32,9 @@ public interface ResourceProviders { * 24 characters in length and use any alphanumeric and underscore only. * @param resourceGroupName The Resource Group Name. * @param mitigateJobRequest Mitigation Request. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. */ - Response mitigateWithResponse( - String jobName, String resourceGroupName, MitigateJobRequest mitigateJobRequest, Context context); + void mitigate(String jobName, String resourceGroupName, MitigateJobRequest mitigateJobRequest); } diff --git a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/ReverseShippingDetails.java b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/ReverseShippingDetails.java new file mode 100644 index 000000000000..cd8c37c74a26 --- /dev/null +++ b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/ReverseShippingDetails.java @@ -0,0 +1,99 @@ +// 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; + +/** Reverse Shipping Address and contact details for a job. */ +@Fluent +public final class ReverseShippingDetails { + /* + * Contact Info. + */ + @JsonProperty(value = "contactDetails") + private ContactInfo contactDetails; + + /* + * Shipping address where customer wishes to receive the device. + */ + @JsonProperty(value = "shippingAddress") + private ShippingAddress shippingAddress; + + /* + * A flag to indicate whether Reverse Shipping details are updated or not after device has been prepared. + * Read only field + */ + @JsonProperty(value = "isUpdated", access = JsonProperty.Access.WRITE_ONLY) + private Boolean isUpdated; + + /** Creates an instance of ReverseShippingDetails class. */ + public ReverseShippingDetails() { + } + + /** + * Get the contactDetails property: Contact Info. + * + * @return the contactDetails value. + */ + public ContactInfo contactDetails() { + return this.contactDetails; + } + + /** + * Set the contactDetails property: Contact Info. + * + * @param contactDetails the contactDetails value to set. + * @return the ReverseShippingDetails object itself. + */ + public ReverseShippingDetails withContactDetails(ContactInfo contactDetails) { + this.contactDetails = contactDetails; + return this; + } + + /** + * Get the shippingAddress property: Shipping address where customer wishes to receive the device. + * + * @return the shippingAddress value. + */ + public ShippingAddress shippingAddress() { + return this.shippingAddress; + } + + /** + * Set the shippingAddress property: Shipping address where customer wishes to receive the device. + * + * @param shippingAddress the shippingAddress value to set. + * @return the ReverseShippingDetails object itself. + */ + public ReverseShippingDetails withShippingAddress(ShippingAddress shippingAddress) { + this.shippingAddress = shippingAddress; + return this; + } + + /** + * Get the isUpdated property: A flag to indicate whether Reverse Shipping details are updated or not after device + * has been prepared. Read only field. + * + * @return the isUpdated value. + */ + public Boolean isUpdated() { + return this.isUpdated; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (contactDetails() != null) { + contactDetails().validate(); + } + if (shippingAddress() != null) { + shippingAddress().validate(); + } + } +} diff --git a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/ReverseShippingDetailsEditStatus.java b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/ReverseShippingDetailsEditStatus.java new file mode 100644 index 000000000000..17090f64539a --- /dev/null +++ b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/ReverseShippingDetailsEditStatus.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.databox.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** The Editable status for Reverse Shipping Address and Contact Info. */ +public enum ReverseShippingDetailsEditStatus { + /** Enum value Enabled. */ + ENABLED("Enabled"), + + /** Enum value Disabled. */ + DISABLED("Disabled"), + + /** Enum value NotSupported. */ + NOT_SUPPORTED("NotSupported"); + + /** The actual serialized value for a ReverseShippingDetailsEditStatus instance. */ + private final String value; + + ReverseShippingDetailsEditStatus(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a ReverseShippingDetailsEditStatus instance. + * + * @param value the serialized value to parse. + * @return the parsed ReverseShippingDetailsEditStatus object, or null if unable to parse. + */ + @JsonCreator + public static ReverseShippingDetailsEditStatus fromString(String value) { + if (value == null) { + return null; + } + ReverseShippingDetailsEditStatus[] items = ReverseShippingDetailsEditStatus.values(); + for (ReverseShippingDetailsEditStatus 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/ReverseTransportPreferenceEditStatus.java b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/ReverseTransportPreferenceEditStatus.java new file mode 100644 index 000000000000..a2e6b51dbca6 --- /dev/null +++ b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/ReverseTransportPreferenceEditStatus.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.databox.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** The Editable status for Reverse Transport preferences. */ +public enum ReverseTransportPreferenceEditStatus { + /** Enum value Enabled. */ + ENABLED("Enabled"), + + /** Enum value Disabled. */ + DISABLED("Disabled"), + + /** Enum value NotSupported. */ + NOT_SUPPORTED("NotSupported"); + + /** The actual serialized value for a ReverseTransportPreferenceEditStatus instance. */ + private final String value; + + ReverseTransportPreferenceEditStatus(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a ReverseTransportPreferenceEditStatus instance. + * + * @param value the serialized value to parse. + * @return the parsed ReverseTransportPreferenceEditStatus object, or null if unable to parse. + */ + @JsonCreator + public static ReverseTransportPreferenceEditStatus fromString(String value) { + if (value == null) { + return null; + } + ReverseTransportPreferenceEditStatus[] items = ReverseTransportPreferenceEditStatus.values(); + for (ReverseTransportPreferenceEditStatus 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/ScheduleAvailabilityRequest.java b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/ScheduleAvailabilityRequest.java index 07e5fbd11cfc..dda84762c0c6 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 @@ -41,6 +38,10 @@ public class ScheduleAvailabilityRequest { @JsonProperty(value = "country") private String country; + /** Creates an instance of ScheduleAvailabilityRequest class. */ + public ScheduleAvailabilityRequest() { + } + /** * Get the storageLocation property: Location for data transfer. For locations check: * https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01. @@ -90,10 +91,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..33e878857b51 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,14 +12,16 @@ /** 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 */ @JsonProperty(value = "availableDates", access = JsonProperty.Access.WRITE_ONLY) private List availableDates; + /** Creates an instance of ScheduleAvailabilityResponse class. */ + public ScheduleAvailabilityResponse() { + } + /** * Get the availableDates property: 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..df43a1298eff 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); @@ -45,12 +45,14 @@ PagedIterable listAvailableSkusByResourceGroup( * * @param location The location of the resource. * @param validateAddress Shipping address of the customer. + * @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 output of the address validation api. + * @return output of the address validation api along with {@link Response}. */ - AddressValidationOutput validateAddress(String location, ValidateAddress validateAddress); + Response validateAddressWithResponse( + String location, ValidateAddress validateAddress, Context context); /** * [DEPRECATED NOTICE: This operation will soon be removed]. This method validates the customer shipping address and @@ -58,14 +60,12 @@ PagedIterable listAvailableSkusByResourceGroup( * * @param location The location of the resource. * @param validateAddress Shipping address of the customer. - * @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 output of the address validation api. */ - Response validateAddressWithResponse( - String location, ValidateAddress validateAddress, Context context); + AddressValidationOutput validateAddress(String location, ValidateAddress validateAddress); /** * This method does all necessary pre-job creation validation under resource group. @@ -73,13 +73,14 @@ Response validateAddressWithResponse( * @param resourceGroupName The Resource Group Name. * @param location The location of the resource. * @param validationRequest Inputs of the customer. + * @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 response of pre job creation validations. + * @return response of pre job creation validations along with {@link Response}. */ - ValidationResponse validateInputsByResourceGroup( - String resourceGroupName, String location, ValidationRequest validationRequest); + Response validateInputsByResourceGroupWithResponse( + String resourceGroupName, String location, ValidationRequest validationRequest, Context context); /** * This method does all necessary pre-job creation validation under resource group. @@ -87,67 +88,66 @@ ValidationResponse validateInputsByResourceGroup( * @param resourceGroupName The Resource Group Name. * @param location The location of the resource. * @param validationRequest Inputs of the customer. - * @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 response of pre job creation validations. */ - Response validateInputsByResourceGroupWithResponse( - String resourceGroupName, String location, ValidationRequest validationRequest, Context context); + ValidationResponse validateInputsByResourceGroup( + String resourceGroupName, String location, ValidationRequest validationRequest); /** * This method does all necessary pre-job creation validation under subscription. * * @param location The location of the resource. * @param validationRequest Inputs of the customer. + * @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 response of pre job creation validations. + * @return response of pre job creation validations along with {@link Response}. */ - ValidationResponse validateInputs(String location, ValidationRequest validationRequest); + Response validateInputsWithResponse( + String location, ValidationRequest validationRequest, Context context); /** * This method does all necessary pre-job creation validation under subscription. * * @param location The location of the resource. * @param validationRequest Inputs of the customer. - * @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 response of pre job creation validations. */ - Response validateInputsWithResponse( - String location, ValidationRequest validationRequest, Context context); + ValidationResponse validateInputs(String location, ValidationRequest validationRequest); /** * This API provides configuration details specific to given region/location at Subscription level. * * @param location The location of the resource. * @param regionConfigurationRequest Request body to get the configuration for the region. + * @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 configuration response specific to a region. + * @return configuration response specific to a region along with {@link Response}. */ - RegionConfigurationResponse regionConfiguration( - String location, RegionConfigurationRequest regionConfigurationRequest); + Response regionConfigurationWithResponse( + String location, RegionConfigurationRequest regionConfigurationRequest, Context context); /** * This API provides configuration details specific to given region/location at Subscription level. * * @param location The location of the resource. * @param regionConfigurationRequest Request body to get the configuration for the region. - * @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 configuration response specific to a region. */ - Response regionConfigurationWithResponse( - String location, RegionConfigurationRequest regionConfigurationRequest, Context context); + RegionConfigurationResponse regionConfiguration( + String location, RegionConfigurationRequest regionConfigurationRequest); /** * This API provides configuration details specific to given region/location at Resource group level. @@ -155,13 +155,17 @@ Response regionConfigurationWithResponse( * @param resourceGroupName The Resource Group Name. * @param location The location of the resource. * @param regionConfigurationRequest Request body to get the configuration for the region at resource group level. + * @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 configuration response specific to a region. + * @return configuration response specific to a region along with {@link Response}. */ - RegionConfigurationResponse regionConfigurationByResourceGroup( - String resourceGroupName, String location, RegionConfigurationRequest regionConfigurationRequest); + Response regionConfigurationByResourceGroupWithResponse( + String resourceGroupName, + String location, + RegionConfigurationRequest regionConfigurationRequest, + Context context); /** * This API provides configuration details specific to given region/location at Resource group level. @@ -169,15 +173,11 @@ RegionConfigurationResponse regionConfigurationByResourceGroup( * @param resourceGroupName The Resource Group Name. * @param location The location of the resource. * @param regionConfigurationRequest Request body to get the configuration for the region at resource group level. - * @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 configuration response specific to a region. */ - Response regionConfigurationByResourceGroupWithResponse( - String resourceGroupName, - String location, - RegionConfigurationRequest regionConfigurationRequest, - Context context); + RegionConfigurationResponse regionConfigurationByResourceGroup( + String resourceGroupName, String location, RegionConfigurationRequest regionConfigurationRequest); } 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..35acb9ce8b6c 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. */ @@ -45,6 +41,10 @@ public final class ShareCredentialDetails { @JsonProperty(value = "supportedAccessProtocols", access = JsonProperty.Access.WRITE_ONLY) private List supportedAccessProtocols; + /** Creates an instance of ShareCredentialDetails class. */ + public ShareCredentialDetails() { + } + /** * Get the shareName property: 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..a0c0a3fb5448 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; @@ -35,6 +30,10 @@ public final class ShipmentPickUpRequest { @JsonProperty(value = "shipmentLocation", required = true) private String shipmentLocation; + /** Creates an instance of ShipmentPickUpRequest class. */ + public ShipmentPickUpRequest() { + } + /** * Get the startTime property: Minimum date after which the pick up should commence, this must be in local time of * pick up area. @@ -106,20 +105,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..f7734a03eff0 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. */ @@ -74,6 +71,10 @@ public final class ShippingAddress { @JsonProperty(value = "addressType") private AddressType addressType; + /** Creates an instance of ShippingAddress class. */ + public ShippingAddress() { + } + /** * Get the streetAddress1 property: Street Address line 1. * @@ -281,14 +282,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..8987a464f687 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. */ @@ -32,6 +29,10 @@ public final class Sku { @JsonProperty(value = "family") private String family; + /** Creates an instance of Sku class. */ + public Sku() { + } + /** * Get the name property: The sku name. * @@ -99,8 +100,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..38cf8ad58ed0 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. */ @@ -44,6 +41,10 @@ public final class SkuAvailabilityValidationRequest extends ValidationInputReque @JsonProperty(value = "location", required = true) private String location; + /** Creates an instance of SkuAvailabilityValidationRequest class. */ + public SkuAvailabilityValidationRequest() { + } + /** * Get the deviceType property: Device type to be used for the job. * @@ -137,28 +138,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..a501ac026a19 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,14 +14,16 @@ @JsonTypeName("ValidateSkuAvailability") @Immutable public final class SkuAvailabilityValidationResponseProperties extends ValidationInputResponse { - @JsonIgnore private final ClientLogger logger = new ClientLogger(SkuAvailabilityValidationResponseProperties.class); - /* * Sku availability validation status. */ @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) private ValidationStatus status; + /** Creates an instance of SkuAvailabilityValidationResponseProperties class. */ + public SkuAvailabilityValidationResponseProperties() { + } + /** * Get the status property: 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..3b7f8576e450 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. */ @@ -26,6 +22,10 @@ public final class SkuCapacity { @JsonProperty(value = "maximum", access = JsonProperty.Access.WRITE_ONLY) private String maximum; + /** Creates an instance of SkuCapacity class. */ + public SkuCapacity() { + } + /** * Get the usable property: 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..ff50e363d0cd 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,13 +23,16 @@ 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; + /** Creates an instance of SkuCost class. */ + public SkuCost() { + } + /** * Get the meterId property: Meter id of the Sku. * 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/SkuInformation.java b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/SkuInformation.java index 3fd4df6c6612..e9bfe695c5a0 100644 --- a/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/SkuInformation.java +++ b/sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/SkuInformation.java @@ -72,6 +72,14 @@ public interface SkuInformation { */ String requiredFeature(); + /** + * Gets the countriesWithinCommerceBoundary property: List of all the Countries in the SKU specific commerce + * boundary. + * + * @return the countriesWithinCommerceBoundary value. + */ + List countriesWithinCommerceBoundary(); + /** * Gets the inner com.azure.resourcemanager.databox.fluent.models.SkuInformationInner object. * 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..7e1f4e67ff18 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,14 +15,16 @@ @JsonTypeName("StorageAccount") @Fluent public final class StorageAccountDetails extends DataAccountDetails { - @JsonIgnore private final ClientLogger logger = new ClientLogger(StorageAccountDetails.class); - /* * Storage Account Resource Id. */ @JsonProperty(value = "storageAccountId", required = true) private String storageAccountId; + /** Creates an instance of StorageAccountDetails class. */ + public StorageAccountDetails() { + } + /** * Get the storageAccountId property: Storage Account Resource Id. * @@ -60,10 +61,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..12f0d052485f 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,8 +13,9 @@ @JsonTypeName("ValidateSubscriptionIsAllowedToCreateJob") @Immutable public final class SubscriptionIsAllowedToCreateJobValidationRequest extends ValidationInputRequest { - @JsonIgnore - private final ClientLogger logger = new ClientLogger(SubscriptionIsAllowedToCreateJobValidationRequest.class); + /** Creates an instance of SubscriptionIsAllowedToCreateJobValidationRequest class. */ + public SubscriptionIsAllowedToCreateJobValidationRequest() { + } /** * 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..8dcdbaa38656 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,16 +14,16 @@ @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. */ @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) private ValidationStatus status; + /** Creates an instance of SubscriptionIsAllowedToCreateJobValidationResponseProperties class. */ + public SubscriptionIsAllowedToCreateJobValidationResponseProperties() { + } + /** * Get the status property: 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..cfa2c60716d8 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 */ @@ -32,6 +29,10 @@ public final class TransferAllDetails { @JsonProperty(value = "transferAllFiles") private Boolean transferAllFiles; + /** Creates an instance of TransferAllDetails class. */ + public TransferAllDetails() { + } + /** * Get the dataAccountType property: Type of the account of data. * @@ -99,10 +100,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..c56603fd70a5 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,19 +18,23 @@ 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; + /** Creates an instance of TransferConfiguration class. */ + public TransferConfiguration() { + } + /** * Get the transferConfigurationType property: Type of the configuration for transfer. * @@ -106,7 +107,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 +119,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..30a101260630 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,14 +13,16 @@ */ @Fluent public final class TransferConfigurationTransferAllDetails { - @JsonIgnore private final ClientLogger logger = new ClientLogger(TransferConfigurationTransferAllDetails.class); - /* * Details to transfer all data. */ @JsonProperty(value = "include") private TransferAllDetails include; + /** Creates an instance of TransferConfigurationTransferAllDetails class. */ + public TransferConfigurationTransferAllDetails() { + } + /** * Get the include property: 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..a80d3695c353 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,14 +13,16 @@ */ @Fluent public final class TransferConfigurationTransferFilterDetails { - @JsonIgnore private final ClientLogger logger = new ClientLogger(TransferConfigurationTransferFilterDetails.class); - /* * Details of the filtering the transfer of data. */ @JsonProperty(value = "include") private TransferFilterDetails include; + /** Creates an instance of TransferConfigurationTransferFilterDetails class. */ + public TransferConfigurationTransferFilterDetails() { + } + /** * Get the include property: 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..1f72d6e437ed 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. */ @@ -39,6 +36,10 @@ public final class TransferFilterDetails { @JsonProperty(value = "filterFileDetails") private List filterFileDetails; + /** Creates an instance of TransferFilterDetails class. */ + public TransferFilterDetails() { + } + /** * Get the dataAccountType property: Type of the account of data. * @@ -126,7 +127,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 +142,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..f03f5c820552 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,21 +5,21 @@ 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. */ @JsonProperty(value = "shipmentType", access = JsonProperty.Access.WRITE_ONLY) private TransportShipmentTypes shipmentType; + /** Creates an instance of TransportAvailabilityDetails class. */ + public TransportAvailabilityDetails() { + } + /** * Get the shipmentType property: 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..ed5d9731479d 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,21 +5,21 @@ 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. */ @JsonProperty(value = "skuName") private SkuName skuName; + /** Creates an instance of TransportAvailabilityRequest class. */ + public TransportAvailabilityRequest() { + } + /** * Get the skuName property: 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..519d40d0d988 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,22 +5,22 @@ 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 */ @JsonProperty(value = "transportAvailabilityDetails", access = JsonProperty.Access.WRITE_ONLY) private List transportAvailabilityDetails; + /** Creates an instance of TransportAvailabilityResponse class. */ + public TransportAvailabilityResponse() { + } + /** * Get the transportAvailabilityDetails property: 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..9d4bbe5654f6 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,20 +6,28 @@ 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. */ @JsonProperty(value = "preferredShipmentType", required = true) private TransportShipmentTypes preferredShipmentType; + /* + * Read only property which indicates whether transport preferences has been updated or not after device is + * prepared. + */ + @JsonProperty(value = "isUpdated", access = JsonProperty.Access.WRITE_ONLY) + private Boolean isUpdated; + + /** Creates an instance of TransportPreferences class. */ + public TransportPreferences() { + } + /** * Get the preferredShipmentType property: Indicates Shipment Logistics type that the customer preferred. * @@ -40,6 +48,16 @@ public TransportPreferences withPreferredShipmentType(TransportShipmentTypes pre return this; } + /** + * Get the isUpdated property: Read only property which indicates whether transport preferences has been updated or + * not after device is prepared. + * + * @return the isUpdated value. + */ + public Boolean isUpdated() { + return this.isUpdated; + } + /** * Validates the instance. * @@ -47,10 +65,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..27ad91aa4450 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. */ @@ -28,6 +24,10 @@ public final class UnencryptedCredentialsList { @JsonProperty(value = "nextLink") private String nextLink; + /** Creates an instance of UnencryptedCredentialsList class. */ + public UnencryptedCredentialsList() { + } + /** * Get the value property: 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..6b8137d4c8e0 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. */ @@ -26,12 +22,34 @@ public final class UpdateJobDetails { @JsonProperty(value = "shippingAddress") private ShippingAddress shippingAddress; + /* + * Reverse Shipping Address and contact details for a job. + */ + @JsonProperty(value = "reverseShippingDetails") + private ReverseShippingDetails reverseShippingDetails; + + /* + * Preferences related to the order + */ + @JsonProperty(value = "preferences") + private Preferences preferences; + /* * Key encryption key for the job. */ @JsonProperty(value = "keyEncryptionKey") private KeyEncryptionKey keyEncryptionKey; + /* + * Return package details of job. + */ + @JsonProperty(value = "returnToCustomerPackageDetails") + private PackageCarrierDetails returnToCustomerPackageDetails; + + /** Creates an instance of UpdateJobDetails class. */ + public UpdateJobDetails() { + } + /** * Get the contactDetails property: Contact details for notification and shipping. * @@ -72,6 +90,46 @@ public UpdateJobDetails withShippingAddress(ShippingAddress shippingAddress) { return this; } + /** + * Get the reverseShippingDetails property: Reverse Shipping Address and contact details for a job. + * + * @return the reverseShippingDetails value. + */ + public ReverseShippingDetails reverseShippingDetails() { + return this.reverseShippingDetails; + } + + /** + * Set the reverseShippingDetails property: Reverse Shipping Address and contact details for a job. + * + * @param reverseShippingDetails the reverseShippingDetails value to set. + * @return the UpdateJobDetails object itself. + */ + public UpdateJobDetails withReverseShippingDetails(ReverseShippingDetails reverseShippingDetails) { + this.reverseShippingDetails = reverseShippingDetails; + return this; + } + + /** + * Get the preferences property: Preferences related to the order. + * + * @return the preferences value. + */ + public Preferences preferences() { + return this.preferences; + } + + /** + * Set the preferences property: Preferences related to the order. + * + * @param preferences the preferences value to set. + * @return the UpdateJobDetails object itself. + */ + public UpdateJobDetails withPreferences(Preferences preferences) { + this.preferences = preferences; + return this; + } + /** * Get the keyEncryptionKey property: Key encryption key for the job. * @@ -92,6 +150,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. * @@ -104,8 +182,17 @@ public void validate() { if (shippingAddress() != null) { shippingAddress().validate(); } + if (reverseShippingDetails() != null) { + reverseShippingDetails().validate(); + } + if (preferences() != null) { + preferences().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..1ab44fb4d530 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. */ @@ -26,6 +22,10 @@ public class UserAssignedIdentity { @JsonProperty(value = "clientId", access = JsonProperty.Access.WRITE_ONLY) private String clientId; + /** Creates an instance of UserAssignedIdentity class. */ + public UserAssignedIdentity() { + } + /** * Get the principalId property: 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..ab0c9723dba6 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,22 +5,21 @@ 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; + /** Creates an instance of UserAssignedProperties class. */ + public UserAssignedProperties() { + } + /** * Get the resourceId property: Arm resource id for user assigned identity to be used to fetch MSI token. * 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..3686fb7fc295 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. */ @@ -36,6 +33,10 @@ public final class ValidateAddress extends ValidationInputRequest { @JsonProperty(value = "transportPreferences") private TransportPreferences transportPreferences; + /** Creates an instance of ValidateAddress class. */ + public ValidateAddress() { + } + /** * Get the shippingAddress property: Shipping address of the customer. * @@ -105,14 +106,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 +121,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..e2fa891553c6 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,7 +30,9 @@ }) @Immutable public class ValidationInputRequest { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ValidationInputRequest.class); + /** Creates an instance of ValidationInputRequest class. */ + public ValidationInputRequest() { + } /** * 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..a6f445d5967d 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,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; @@ -35,14 +33,16 @@ }) @Immutable public class ValidationInputResponse { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ValidationInputResponse.class); - /* * Error code and message of validation response. */ @JsonProperty(value = "error", access = JsonProperty.Access.WRITE_ONLY) private CloudError error; + /** Creates an instance of ValidationInputResponse class. */ + public ValidationInputResponse() { + } + /** * Get the error property: 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..e68a99edf039 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,15 +22,16 @@ @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; + /** Creates an instance of ValidationRequest class. */ + public ValidationRequest() { + } + /** * Get the individualRequestDetails property: List of request details contain validationType and its request as key * and value respectively. @@ -61,7 +61,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..c332e2d18285 --- /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-09-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..142542941c8c --- /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-09-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..31154f8d1e72 --- /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-09-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("fakeTokenPlaceholder") + .withCompanyName("Microsoft") + .withAddressType(AddressType.COMMERCIAL)) + .withDataImportDetails( + Arrays + .asList( + new DataImportDetails() + .withAccountDetails( + new StorageAccountDetails() + .withSharePassword("fakeTokenPlaceholder") + .withStorageAccountId( + "/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourceGroups/databoxbvt1/providers/Microsoft.Storage/storageAccounts/databoxbvttestaccount2")))) + .withDevicePassword("fakeTokenPlaceholder")) + .create(); + } + + /* + * x-ms-original-file: specification/databox/resource-manager/Microsoft.DataBox/stable/2022-09-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("fakeTokenPlaceholder") + .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-09-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("fakeTokenPlaceholder") + .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-09-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("fakeTokenPlaceholder") + .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-09-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("fakeTokenPlaceholder") + .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..6c5085be191b --- /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-09-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..22c5c1381c7d --- /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-09-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-09-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-09-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-09-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-09-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..919f7b9caf11 --- /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-09-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..26a2490f1715 --- /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-09-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..949b3cd3a17a --- /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-09-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..5e3645273f08 --- /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-09-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..a615f8043928 --- /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-09-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-09-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-09-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("fakeTokenPlaceholder") + .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..e06adac5143c --- /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-09-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..50c8c700f64a --- /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-09-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..b425656734af --- /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-09-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..e41cc8d0ba7e --- /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-09-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..ccafda0506e1 --- /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-09-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..3b8a098d32d7 --- /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-09-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("fakeTokenPlaceholder") + .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..1a1623cc9f36 --- /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-09-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("fakeTokenPlaceholder") + .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..12802f21968e --- /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-09-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("fakeTokenPlaceholder") + .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); + } +}