diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/CHANGELOG.md b/sdk/databoxedge/azure-resourcemanager-databoxedge/CHANGELOG.md index 5f0c9a81a52a..5c2b54d26cb6 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/CHANGELOG.md +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/CHANGELOG.md @@ -1,6 +1,8 @@ # Release History -## 1.1.0-beta.1 (Unreleased) +## 1.1.0-beta.1 (2025-11-12) + +- Azure Resource Manager DataBoxEdge client library for Java. This package contains Microsoft Azure SDK for DataBoxEdge Management SDK. // (missing-service-description) Add service description. Package api-version 2023-12-01. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). ### Features Added diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/README.md b/sdk/databoxedge/azure-resourcemanager-databoxedge/README.md index f4a969457776..1dc1b00bde1f 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/README.md +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/README.md @@ -2,7 +2,7 @@ Azure Resource Manager DataBoxEdge client library for Java. -This package contains Microsoft Azure SDK for DataBoxEdge Management SDK. Package tag package-2019-08. 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 DataBoxEdge Management SDK. // (missing-service-description) Add service description. Package api-version 2023-12-01. 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 @@ -52,7 +52,7 @@ Azure subscription ID can be configured via `AZURE_SUBSCRIPTION_ID` environment Assuming the use of the `DefaultAzureCredential` credential class, the client can be authenticated using the following code: ```java -AzureProfile profile = new AzureProfile(AzureEnvironment.AZURE); +AzureProfile profile = new AzureProfile(AzureCloud.AZURE_PUBLIC_CLOUD); TokenCredential credential = new DefaultAzureCredentialBuilder() .authorityHost(profile.getEnvironment().getActiveDirectoryEndpoint()) .build(); @@ -60,7 +60,7 @@ DataBoxEdgeManager manager = DataBoxEdgeManager .authenticate(credential, profile); ``` -The sample code assumes global Azure. Please change `AzureEnvironment.AZURE` variable if otherwise. +The sample code assumes global Azure. Please change the `AzureCloud.AZURE_PUBLIC_CLOUD` variable if otherwise. See [Authentication][authenticate] for more options. @@ -100,5 +100,3 @@ This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For m [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/databoxedge/azure-resourcemanager-databoxedge/SAMPLE.md b/sdk/databoxedge/azure-resourcemanager-databoxedge/SAMPLE.md index 8b14c7bd8acc..a928b2dcd281 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/SAMPLE.md +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/SAMPLE.md @@ -1,11 +1,22 @@ # Code snippets and samples +## Addons + +- [CreateOrUpdate](#addons_createorupdate) +- [Delete](#addons_delete) +- [Get](#addons_get) +- [ListByRole](#addons_listbyrole) + ## Alerts - [Get](#alerts_get) - [ListByDataBoxEdgeDevice](#alerts_listbydataboxedgedevice) +## AvailableSkus + +- [List](#availableskus_list) + ## BandwidthSchedules - [CreateOrUpdate](#bandwidthschedules_createorupdate) @@ -21,12 +32,21 @@ - [ListByStorageAccount](#containers_listbystorageaccount) - [Refresh](#containers_refresh) +## DeviceCapacityCheck + +- [CheckResourceCreationFeasibility](#devicecapacitycheck_checkresourcecreationfeasibility) + +## DeviceCapacityInfo + +- [GetDeviceCapacityInfo](#devicecapacityinfo_getdevicecapacityinfo) + ## Devices - [CreateOrUpdate](#devices_createorupdate) - [CreateOrUpdateSecuritySettings](#devices_createorupdatesecuritysettings) - [Delete](#devices_delete) - [DownloadUpdates](#devices_downloadupdates) +- [GenerateCertificate](#devices_generatecertificate) - [GetByResourceGroup](#devices_getbyresourcegroup) - [GetExtendedInformation](#devices_getextendedinformation) - [GetNetworkSettings](#devices_getnetworksettings) @@ -36,12 +56,27 @@ - [ListByResourceGroup](#devices_listbyresourcegroup) - [ScanForUpdates](#devices_scanforupdates) - [Update](#devices_update) +- [UpdateExtendedInformation](#devices_updateextendedinformation) - [UploadCertificate](#devices_uploadcertificate) +## DiagnosticSettings + +- [GetDiagnosticProactiveLogCollectionSettings](#diagnosticsettings_getdiagnosticproactivelogcollectionsettings) +- [GetDiagnosticRemoteSupportSettings](#diagnosticsettings_getdiagnosticremotesupportsettings) +- [UpdateDiagnosticProactiveLogCollectionSettings](#diagnosticsettings_updatediagnosticproactivelogcollectionsettings) +- [UpdateDiagnosticRemoteSupportSettings](#diagnosticsettings_updatediagnosticremotesupportsettings) + ## Jobs - [Get](#jobs_get) +## MonitoringConfig + +- [CreateOrUpdate](#monitoringconfig_createorupdate) +- [Delete](#monitoringconfig_delete) +- [Get](#monitoringconfig_get) +- [List](#monitoringconfig_list) + ## Nodes - [ListByDataBoxEdgeDevice](#nodes_listbydataboxedgedevice) @@ -60,6 +95,7 @@ - [Delete](#orders_delete) - [Get](#orders_get) - [ListByDataBoxEdgeDevice](#orders_listbydataboxedgedevice) +- [ListDCAccessCode](#orders_listdcaccesscode) ## Roles @@ -76,10 +112,6 @@ - [ListByDataBoxEdgeDevice](#shares_listbydataboxedgedevice) - [Refresh](#shares_refresh) -## Skus - -- [List](#skus_list) - ## StorageAccountCredentials - [CreateOrUpdate](#storageaccountcredentials_createorupdate) @@ -94,6 +126,10 @@ - [Get](#storageaccounts_get) - [ListByDataBoxEdgeDevice](#storageaccounts_listbydataboxedgedevice) +## SupportPackages + +- [TriggerSupportPackage](#supportpackages_triggersupportpackage) + ## Triggers - [CreateOrUpdate](#triggers_createorupdate) @@ -107,6 +143,100 @@ - [Delete](#users_delete) - [Get](#users_get) - [ListByDataBoxEdgeDevice](#users_listbydataboxedgedevice) +### Addons_CreateOrUpdate + +```java +import com.azure.resourcemanager.databoxedge.models.AddonProperties; +import com.azure.resourcemanager.databoxedge.models.AddonType; + +/** + * Samples for Addons CreateOrUpdate. + */ +public final class AddonsCreateOrUpdateSamples { + /* + * x-ms-original-file: 2023-12-01/PutAddons.json + */ + /** + * Sample code: PutAddOns. + * + * @param manager Entry point to DataBoxEdgeManager. + */ + public static void putAddOns(com.azure.resourcemanager.databoxedge.DataBoxEdgeManager manager) { + manager.addons() + .define("arcName") + .withExistingDataBoxEdgeDevice("GroupForEdgeAutomation", "testedgedevice") + .withKind(AddonType.ARC_FOR_KUBERNETES) + .withProperties(new AddonProperties()) + .create(); + } +} +``` + +### Addons_Delete + +```java +/** + * Samples for Addons Delete. + */ +public final class AddonsDeleteSamples { + /* + * x-ms-original-file: 2023-12-01/DeleteAddons.json + */ + /** + * Sample code: DeleteAddOns. + * + * @param manager Entry point to DataBoxEdgeManager. + */ + public static void deleteAddOns(com.azure.resourcemanager.databoxedge.DataBoxEdgeManager manager) { + manager.addons() + .delete("GroupForEdgeAutomation", "testedgedevice", "arcName", com.azure.core.util.Context.NONE); + } +} +``` + +### Addons_Get + +```java +/** + * Samples for Addons Get. + */ +public final class AddonsGetSamples { + /* + * x-ms-original-file: 2023-12-01/GetAddons.json + */ + /** + * Sample code: GetAddOns. + * + * @param manager Entry point to DataBoxEdgeManager. + */ + public static void getAddOns(com.azure.resourcemanager.databoxedge.DataBoxEdgeManager manager) { + manager.addons() + .getWithResponse("GroupForEdgeAutomation", "testedgedevice", "arcName", com.azure.core.util.Context.NONE); + } +} +``` + +### Addons_ListByRole + +```java +/** + * Samples for Addons ListByRole. + */ +public final class AddonsListByRoleSamples { + /* + * x-ms-original-file: 2023-12-01/RoleListAddOns.json + */ + /** + * Sample code: RoleListAddOns. + * + * @param manager Entry point to DataBoxEdgeManager. + */ + public static void roleListAddOns(com.azure.resourcemanager.databoxedge.DataBoxEdgeManager manager) { + manager.addons().listByRole("GroupForEdgeAutomation", "testedgedevice", com.azure.core.util.Context.NONE); + } +} +``` + ### Alerts_Get ```java @@ -115,8 +245,7 @@ */ public final class AlertsGetSamples { /* - * x-ms-original-file: - * specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2019-08-01/examples/AlertGet.json + * x-ms-original-file: 2023-12-01/AlertGet.json */ /** * Sample code: AlertGet. @@ -125,7 +254,7 @@ public final class AlertsGetSamples { */ public static void alertGet(com.azure.resourcemanager.databoxedge.DataBoxEdgeManager manager) { manager.alerts() - .getWithResponse("testedgedevice", "159a00c7-8543-4343-9435-263ac87df3bb", "GroupForEdgeAutomation", + .getWithResponse("GroupForEdgeAutomation", "testedgedevice", "159a00c7-8543-4343-9435-263ac87df3bb", com.azure.core.util.Context.NONE); } } @@ -139,9 +268,7 @@ public final class AlertsGetSamples { */ public final class AlertsListByDataBoxEdgeDeviceSamples { /* - * x-ms-original-file: - * specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2019-08-01/examples/AlertGetAllInDevice. - * json + * x-ms-original-file: 2023-12-01/AlertGetAllInDevice.json */ /** * Sample code: AlertGetAllInDevice. @@ -150,7 +277,28 @@ public final class AlertsListByDataBoxEdgeDeviceSamples { */ public static void alertGetAllInDevice(com.azure.resourcemanager.databoxedge.DataBoxEdgeManager manager) { manager.alerts() - .listByDataBoxEdgeDevice("testedgedevice", "GroupForEdgeAutomation", com.azure.core.util.Context.NONE); + .listByDataBoxEdgeDevice("GroupForEdgeAutomation", "testedgedevice", com.azure.core.util.Context.NONE); + } +} +``` + +### AvailableSkus_List + +```java +/** + * Samples for AvailableSkus List. + */ +public final class AvailableSkusListSamples { + /* + * x-ms-original-file: 2023-12-01/AvailableSkusList.json + */ + /** + * Sample code: AvailableSkus. + * + * @param manager Entry point to DataBoxEdgeManager. + */ + public static void availableSkus(com.azure.resourcemanager.databoxedge.DataBoxEdgeManager manager) { + manager.availableSkus().listWithResponse(com.azure.core.util.Context.NONE); } } ``` @@ -166,9 +314,7 @@ import java.util.Arrays; */ public final class BandwidthSchedulesCreateOrUpdateSamples { /* - * x-ms-original-file: - * specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2019-08-01/examples/BandwidthSchedulePut. - * json + * x-ms-original-file: 2023-12-01/BandwidthSchedulePut.json */ /** * Sample code: BandwidthSchedulePut. @@ -178,7 +324,7 @@ public final class BandwidthSchedulesCreateOrUpdateSamples { public static void bandwidthSchedulePut(com.azure.resourcemanager.databoxedge.DataBoxEdgeManager manager) { manager.bandwidthSchedules() .define("bandwidth-1") - .withExistingDataBoxEdgeDevice("testedgedevice", "GroupForEdgeAutomation") + .withExistingDataBoxEdgeDevice("GroupForEdgeAutomation", "testedgedevice") .withStart("0:0:0") .withStop("13:59:0") .withRateInMbps(100) @@ -196,8 +342,7 @@ public final class BandwidthSchedulesCreateOrUpdateSamples { */ public final class BandwidthSchedulesDeleteSamples { /* - * x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2019-08-01/examples/ - * BandwidthScheduleDelete.json + * x-ms-original-file: 2023-12-01/BandwidthScheduleDelete.json */ /** * Sample code: BandwidthScheduleDelete. @@ -206,7 +351,7 @@ public final class BandwidthSchedulesDeleteSamples { */ public static void bandwidthScheduleDelete(com.azure.resourcemanager.databoxedge.DataBoxEdgeManager manager) { manager.bandwidthSchedules() - .delete("testedgedevice", "bandwidth-1", "GroupForEdgeAutomation", com.azure.core.util.Context.NONE); + .delete("GroupForEdgeAutomation", "testedgedevice", "bandwidth-1", com.azure.core.util.Context.NONE); } } ``` @@ -219,9 +364,7 @@ public final class BandwidthSchedulesDeleteSamples { */ public final class BandwidthSchedulesGetSamples { /* - * x-ms-original-file: - * specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2019-08-01/examples/BandwidthScheduleGet. - * json + * x-ms-original-file: 2023-12-01/BandwidthScheduleGet.json */ /** * Sample code: BandwidthScheduleGet. @@ -230,7 +373,7 @@ public final class BandwidthSchedulesGetSamples { */ public static void bandwidthScheduleGet(com.azure.resourcemanager.databoxedge.DataBoxEdgeManager manager) { manager.bandwidthSchedules() - .getWithResponse("testedgedevice", "bandwidth-1", "GroupForEdgeAutomation", + .getWithResponse("GroupForEdgeAutomation", "testedgedevice", "bandwidth-1", com.azure.core.util.Context.NONE); } } @@ -244,8 +387,7 @@ public final class BandwidthSchedulesGetSamples { */ public final class BandwidthSchedulesListByDataBoxEdgeDeviceSamples { /* - * x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2019-08-01/examples/ - * BandwidthScheduleGetAllInDevice.json + * x-ms-original-file: 2023-12-01/BandwidthScheduleGetAllInDevice.json */ /** * Sample code: BandwidthScheduleGetAllInDevice. @@ -255,7 +397,7 @@ public final class BandwidthSchedulesListByDataBoxEdgeDeviceSamples { public static void bandwidthScheduleGetAllInDevice(com.azure.resourcemanager.databoxedge.DataBoxEdgeManager manager) { manager.bandwidthSchedules() - .listByDataBoxEdgeDevice("testedgedevice", "GroupForEdgeAutomation", com.azure.core.util.Context.NONE); + .listByDataBoxEdgeDevice("GroupForEdgeAutomation", "testedgedevice", com.azure.core.util.Context.NONE); } } ``` @@ -270,8 +412,7 @@ import com.azure.resourcemanager.databoxedge.models.AzureContainerDataFormat; */ public final class ContainersCreateOrUpdateSamples { /* - * x-ms-original-file: - * specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2019-08-01/examples/ContainerPut.json + * x-ms-original-file: 2023-12-01/ContainerPut.json */ /** * Sample code: ContainerPut. @@ -281,7 +422,7 @@ public final class ContainersCreateOrUpdateSamples { public static void containerPut(com.azure.resourcemanager.databoxedge.DataBoxEdgeManager manager) { manager.containers() .define("blobcontainer1") - .withExistingStorageAccount("testedgedevice", "storageaccount1", "GroupForEdgeAutomation") + .withExistingStorageAccount("GroupForEdgeAutomation", "testedgedevice", "storageaccount1") .withDataFormat(AzureContainerDataFormat.BLOCK_BLOB) .create(); } @@ -296,8 +437,7 @@ public final class ContainersCreateOrUpdateSamples { */ public final class ContainersDeleteSamples { /* - * x-ms-original-file: - * specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2019-08-01/examples/ContainerDelete.json + * x-ms-original-file: 2023-12-01/ContainerDelete.json */ /** * Sample code: ContainerDelete. @@ -306,7 +446,7 @@ public final class ContainersDeleteSamples { */ public static void containerDelete(com.azure.resourcemanager.databoxedge.DataBoxEdgeManager manager) { manager.containers() - .delete("testedgedevice", "storageaccount1", "blobcontainer1", "GroupForEdgeAutomation", + .delete("GroupForEdgeAutomation", "testedgedevice", "storageaccount1", "blobcontainer1", com.azure.core.util.Context.NONE); } } @@ -320,8 +460,7 @@ public final class ContainersDeleteSamples { */ public final class ContainersGetSamples { /* - * x-ms-original-file: - * specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2019-08-01/examples/ContainerGet.json + * x-ms-original-file: 2023-12-01/ContainerGet.json */ /** * Sample code: ContainerGet. @@ -330,7 +469,7 @@ public final class ContainersGetSamples { */ public static void containerGet(com.azure.resourcemanager.databoxedge.DataBoxEdgeManager manager) { manager.containers() - .getWithResponse("testedgedevice", "storageaccount1", "blobcontainer1", "GroupForEdgeAutomation", + .getWithResponse("GroupForEdgeAutomation", "testedgedevice", "storageaccount1", "blobcontainer1", com.azure.core.util.Context.NONE); } } @@ -344,8 +483,7 @@ public final class ContainersGetSamples { */ public final class ContainersListByStorageAccountSamples { /* - * x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2019-08-01/examples/ - * ContainerListAllInDevice.json + * x-ms-original-file: 2023-12-01/ContainerListAllInDevice.json */ /** * Sample code: ContainerListAllInDevice. @@ -354,7 +492,7 @@ public final class ContainersListByStorageAccountSamples { */ public static void containerListAllInDevice(com.azure.resourcemanager.databoxedge.DataBoxEdgeManager manager) { manager.containers() - .listByStorageAccount("testedgedevice", "storageaccount1", "GroupForEdgeAutomation", + .listByStorageAccount("GroupForEdgeAutomation", "testedgedevice", "storageaccount1", com.azure.core.util.Context.NONE); } } @@ -368,8 +506,7 @@ public final class ContainersListByStorageAccountSamples { */ public final class ContainersRefreshSamples { /* - * x-ms-original-file: - * specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2019-08-01/examples/ContainerRefresh.json + * x-ms-original-file: 2023-12-01/ContainerRefresh.json */ /** * Sample code: ContainerRefresh. @@ -378,7 +515,57 @@ public final class ContainersRefreshSamples { */ public static void containerRefresh(com.azure.resourcemanager.databoxedge.DataBoxEdgeManager manager) { manager.containers() - .refresh("testedgedevice", "storageaccount1", "blobcontainer1", "GroupForEdgeAutomation", + .refresh("GroupForEdgeAutomation", "testedgedevice", "storageaccount1", "blobcontainer1", + com.azure.core.util.Context.NONE); + } +} +``` + +### DeviceCapacityCheck_CheckResourceCreationFeasibility + +```java +import com.azure.resourcemanager.databoxedge.models.DeviceCapacityRequestInfo; +import java.util.Arrays; + +/** + * Samples for DeviceCapacityCheck CheckResourceCreationFeasibility. + */ +public final class DeviceCapacityCheckCheckResourceCreationFeasibilitySamples { + /* + * x-ms-original-file: 2023-12-01/DeviceCapacityRequestPost.json + */ + /** + * Sample code: DeviceCapacityRequestPost. + * + * @param manager Entry point to DataBoxEdgeManager. + */ + public static void deviceCapacityRequestPost(com.azure.resourcemanager.databoxedge.DataBoxEdgeManager manager) { + manager.deviceCapacityChecks() + .checkResourceCreationFeasibility("GroupForEdgeAutomation", "testedgedevice", + new DeviceCapacityRequestInfo().withVmPlacementQuery(Arrays.asList(Arrays.asList("Standard_D2_v2"))), + null, com.azure.core.util.Context.NONE); + } +} +``` + +### DeviceCapacityInfo_GetDeviceCapacityInfo + +```java +/** + * Samples for DeviceCapacityInfo GetDeviceCapacityInfo. + */ +public final class DeviceCapacityInfoGetDeviceCapacityInfoSamples { + /* + * x-ms-original-file: 2023-12-01/DeviceCapacityGet.json + */ + /** + * Sample code: DeviceCapacityGet. + * + * @param manager Entry point to DataBoxEdgeManager. + */ + public static void deviceCapacityGet(com.azure.resourcemanager.databoxedge.DataBoxEdgeManager manager) { + manager.deviceCapacityInfoes() + .getDeviceCapacityInfoWithResponse("GroupForEdgeAutomation", "testedgedevice", com.azure.core.util.Context.NONE); } } @@ -387,6 +574,8 @@ public final class ContainersRefreshSamples { ### Devices_CreateOrUpdate ```java +import com.azure.resourcemanager.databoxedge.models.DataResidency; +import com.azure.resourcemanager.databoxedge.models.DataResidencyType; import com.azure.resourcemanager.databoxedge.models.Sku; import com.azure.resourcemanager.databoxedge.models.SkuName; import com.azure.resourcemanager.databoxedge.models.SkuTier; @@ -398,9 +587,27 @@ import java.util.Map; */ public final class DevicesCreateOrUpdateSamples { /* - * x-ms-original-file: - * specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2019-08-01/examples/DataBoxEdgeDevicePut. - * json + * x-ms-original-file: 2023-12-01/DataBoxEdgeDevicePutWithDataResidency.json + */ + /** + * Sample code: DataBoxEdgeDevicePutWithDataResidency. + * + * @param manager Entry point to DataBoxEdgeManager. + */ + public static void + dataBoxEdgeDevicePutWithDataResidency(com.azure.resourcemanager.databoxedge.DataBoxEdgeManager manager) { + manager.devices() + .define("testedgedevice") + .withRegion("WUS") + .withExistingResourceGroup("GroupForEdgeAutomation") + .withTags(mapOf()) + .withSku(new Sku().withName(SkuName.EDGE).withTier(SkuTier.STANDARD)) + .withDataResidency(new DataResidency().withType(DataResidencyType.ZONE_REPLICATION)) + .create(); + } + + /* + * x-ms-original-file: 2023-12-01/DataBoxEdgeDevicePut.json */ /** * Sample code: DataBoxEdgeDevicePut. @@ -410,7 +617,7 @@ public final class DevicesCreateOrUpdateSamples { public static void dataBoxEdgeDevicePut(com.azure.resourcemanager.databoxedge.DataBoxEdgeManager manager) { manager.devices() .define("testedgedevice") - .withRegion("eastus") + .withRegion("WUS") .withExistingResourceGroup("GroupForEdgeAutomation") .withTags(mapOf()) .withSku(new Sku().withName(SkuName.EDGE).withTier(SkuTier.STANDARD)) @@ -443,8 +650,7 @@ import com.azure.resourcemanager.databoxedge.models.SecuritySettings; */ public final class DevicesCreateOrUpdateSecuritySettingsSamples { /* - * x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2019-08-01/examples/ - * SecuritySettingsUpdatePost.json + * x-ms-original-file: 2023-12-01/SecuritySettingsUpdatePost.json */ /** * Sample code: CreateOrUpdateSecuritySettings. @@ -454,10 +660,11 @@ public final class DevicesCreateOrUpdateSecuritySettingsSamples { public static void createOrUpdateSecuritySettings(com.azure.resourcemanager.databoxedge.DataBoxEdgeManager manager) { manager.devices() - .createOrUpdateSecuritySettings("testedgedevice", "AzureVM", - new SecuritySettings().withDeviceAdminPassword(new AsymmetricEncryptedSecret().withValue("") - .withEncryptionCertThumbprint("7DCBDFC44ED968D232C9A998FC105B5C70E84BE0") - .withEncryptionAlgorithm(EncryptionAlgorithm.AES256)), + .createOrUpdateSecuritySettings("AzureVM", "testedgedevice", + new SecuritySettings() + .withDeviceAdminPassword(new AsymmetricEncryptedSecret().withValue("") + .withEncryptionCertThumbprint("") + .withEncryptionAlgorithm(EncryptionAlgorithm.AES256)), com.azure.core.util.Context.NONE); } } @@ -471,8 +678,7 @@ public final class DevicesCreateOrUpdateSecuritySettingsSamples { */ public final class DevicesDeleteSamples { /* - * x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2019-08-01/examples/ - * DataBoxEdgeDeviceDelete.json + * x-ms-original-file: 2023-12-01/DataBoxEdgeDeviceDelete.json */ /** * Sample code: DataBoxEdgeDeviceDelete. @@ -493,9 +699,7 @@ public final class DevicesDeleteSamples { */ public final class DevicesDownloadUpdatesSamples { /* - * x-ms-original-file: - * specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2019-08-01/examples/DownloadUpdatesPost. - * json + * x-ms-original-file: 2023-12-01/DownloadUpdatesPost.json */ /** * Sample code: DownloadUpdatesPost. @@ -503,7 +707,30 @@ public final class DevicesDownloadUpdatesSamples { * @param manager Entry point to DataBoxEdgeManager. */ public static void downloadUpdatesPost(com.azure.resourcemanager.databoxedge.DataBoxEdgeManager manager) { - manager.devices().downloadUpdates("testedgedevice", "GroupForEdgeAutomation", com.azure.core.util.Context.NONE); + manager.devices().downloadUpdates("GroupForEdgeAutomation", "testedgedevice", com.azure.core.util.Context.NONE); + } +} +``` + +### Devices_GenerateCertificate + +```java +/** + * Samples for Devices GenerateCertificate. + */ +public final class DevicesGenerateCertificateSamples { + /* + * x-ms-original-file: 2023-12-01/GenerateCertificate.json + */ + /** + * Sample code: GenerateCertificate. + * + * @param manager Entry point to DataBoxEdgeManager. + */ + public static void generateCertificate(com.azure.resourcemanager.databoxedge.DataBoxEdgeManager manager) { + manager.devices() + .generateCertificateWithResponse("GroupForEdgeAutomation", "testedgedevice", + com.azure.core.util.Context.NONE); } } ``` @@ -516,8 +743,7 @@ public final class DevicesDownloadUpdatesSamples { */ public final class DevicesGetByResourceGroupSamples { /* - * x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2019-08-01/examples/ - * DataBoxEdgeDeviceGetByName.json + * x-ms-original-file: 2023-12-01/DataBoxEdgeDeviceGetByName.json */ /** * Sample code: DataBoxEdgeDeviceGetByName. @@ -529,6 +755,21 @@ public final class DevicesGetByResourceGroupSamples { .getByResourceGroupWithResponse("GroupForEdgeAutomation", "testedgedevice", com.azure.core.util.Context.NONE); } + + /* + * x-ms-original-file: 2023-12-01/DataBoxEdgeDeviceGetByNameWithDataResidency.json + */ + /** + * Sample code: DataBoxEdgeDeviceGetByNameWithDataResidency. + * + * @param manager Entry point to DataBoxEdgeManager. + */ + public static void + dataBoxEdgeDeviceGetByNameWithDataResidency(com.azure.resourcemanager.databoxedge.DataBoxEdgeManager manager) { + manager.devices() + .getByResourceGroupWithResponse("GroupForEdgeAutomation", "testedgedevice", + com.azure.core.util.Context.NONE); + } } ``` @@ -540,8 +781,7 @@ public final class DevicesGetByResourceGroupSamples { */ public final class DevicesGetExtendedInformationSamples { /* - * x-ms-original-file: - * specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2019-08-01/examples/ExtendedInfoPost.json + * x-ms-original-file: 2023-12-01/ExtendedInfoPost.json */ /** * Sample code: ExtendedInfoPost. @@ -550,7 +790,7 @@ public final class DevicesGetExtendedInformationSamples { */ public static void extendedInfoPost(com.azure.resourcemanager.databoxedge.DataBoxEdgeManager manager) { manager.devices() - .getExtendedInformationWithResponse("testedgedevice", "GroupForEdgeAutomation", + .getExtendedInformationWithResponse("GroupForEdgeAutomation", "testedgedevice", com.azure.core.util.Context.NONE); } } @@ -564,9 +804,7 @@ public final class DevicesGetExtendedInformationSamples { */ public final class DevicesGetNetworkSettingsSamples { /* - * x-ms-original-file: - * specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2019-08-01/examples/NetworkSettingsGet. - * json + * x-ms-original-file: 2023-12-01/NetworkSettingsGet.json */ /** * Sample code: NetworkSettingsGet. @@ -575,7 +813,7 @@ public final class DevicesGetNetworkSettingsSamples { */ public static void networkSettingsGet(com.azure.resourcemanager.databoxedge.DataBoxEdgeManager manager) { manager.devices() - .getNetworkSettingsWithResponse("testedgedevice", "GroupForEdgeAutomation", + .getNetworkSettingsWithResponse("GroupForEdgeAutomation", "testedgedevice", com.azure.core.util.Context.NONE); } } @@ -589,8 +827,7 @@ public final class DevicesGetNetworkSettingsSamples { */ public final class DevicesGetUpdateSummarySamples { /* - * x-ms-original-file: - * specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2019-08-01/examples/UpdateSummaryGet.json + * x-ms-original-file: 2023-12-01/UpdateSummaryGet.json */ /** * Sample code: UpdateSummaryGet. @@ -599,7 +836,7 @@ public final class DevicesGetUpdateSummarySamples { */ public static void updateSummaryGet(com.azure.resourcemanager.databoxedge.DataBoxEdgeManager manager) { manager.devices() - .getUpdateSummaryWithResponse("testedgedevice", "GroupForEdgeAutomation", com.azure.core.util.Context.NONE); + .getUpdateSummaryWithResponse("GroupForEdgeAutomation", "testedgedevice", com.azure.core.util.Context.NONE); } } ``` @@ -612,9 +849,7 @@ public final class DevicesGetUpdateSummarySamples { */ public final class DevicesInstallUpdatesSamples { /* - * x-ms-original-file: - * specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2019-08-01/examples/InstallUpdatesPost. - * json + * x-ms-original-file: 2023-12-01/InstallUpdatesPost.json */ /** * Sample code: InstallUpdatesPost. @@ -622,7 +857,7 @@ public final class DevicesInstallUpdatesSamples { * @param manager Entry point to DataBoxEdgeManager. */ public static void installUpdatesPost(com.azure.resourcemanager.databoxedge.DataBoxEdgeManager manager) { - manager.devices().installUpdates("testedgedevice", "GroupForEdgeAutomation", com.azure.core.util.Context.NONE); + manager.devices().installUpdates("GroupForEdgeAutomation", "testedgedevice", com.azure.core.util.Context.NONE); } } ``` @@ -635,8 +870,7 @@ public final class DevicesInstallUpdatesSamples { */ public final class DevicesListSamples { /* - * x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2019-08-01/examples/ - * DataBoxEdgeDeviceGetBySubscription.json + * x-ms-original-file: 2023-12-01/DataBoxEdgeDeviceGetBySubscription.json */ /** * Sample code: DataBoxEdgeDeviceGetBySubscription. @@ -658,8 +892,7 @@ public final class DevicesListSamples { */ public final class DevicesListByResourceGroupSamples { /* - * x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2019-08-01/examples/ - * DataBoxEdgeDeviceGetByResourceGroup.json + * x-ms-original-file: 2023-12-01/DataBoxEdgeDeviceGetByResourceGroup.json */ /** * Sample code: DataBoxEdgeDeviceGetByResourceGroup. @@ -681,9 +914,7 @@ public final class DevicesListByResourceGroupSamples { */ public final class DevicesScanForUpdatesSamples { /* - * x-ms-original-file: - * specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2019-08-01/examples/ScanForUpdatesPost. - * json + * x-ms-original-file: 2023-12-01/ScanForUpdatesPost.json */ /** * Sample code: ScanForUpdatesPost. @@ -691,7 +922,7 @@ public final class DevicesScanForUpdatesSamples { * @param manager Entry point to DataBoxEdgeManager. */ public static void scanForUpdatesPost(com.azure.resourcemanager.databoxedge.DataBoxEdgeManager manager) { - manager.devices().scanForUpdates("testedgedevice", "GroupForEdgeAutomation", com.azure.core.util.Context.NONE); + manager.devices().scanForUpdates("GroupForEdgeAutomation", "testedgedevice", com.azure.core.util.Context.NONE); } } ``` @@ -700,16 +931,15 @@ public final class DevicesScanForUpdatesSamples { ```java import com.azure.resourcemanager.databoxedge.models.DataBoxEdgeDevice; -import java.util.HashMap; -import java.util.Map; +import com.azure.resourcemanager.databoxedge.models.EdgeProfilePatch; +import com.azure.resourcemanager.databoxedge.models.EdgeProfileSubscriptionPatch; /** * Samples for Devices Update. */ public final class DevicesUpdateSamples { /* - * x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2019-08-01/examples/ - * DataBoxEdgeDevicePatch.json + * x-ms-original-file: 2023-12-01/DataBoxEdgeDevicePatch.json */ /** * Sample code: DataBoxEdgeDevicePatch. @@ -721,19 +951,35 @@ public final class DevicesUpdateSamples { .getByResourceGroupWithResponse("GroupForEdgeAutomation", "testedgedevice", com.azure.core.util.Context.NONE) .getValue(); - resource.update().withTags(mapOf("Key1", "fakeTokenPlaceholder", "Key2", "fakeTokenPlaceholder")).apply(); + resource.update() + .withEdgeProfile(new EdgeProfilePatch().withSubscription(new EdgeProfileSubscriptionPatch().withId( + "/subscriptions/0d44739e-0563-474f-97e7-24a0cdb23b29/resourceGroups/rapvs-rg/providers/Microsoft.AzureStack/linkedSubscriptions/ca014ddc-5cf2-45f8-b390-e901e4a0ae87"))) + .apply(); } +} +``` - // Use "Map.of" if available - @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; +### Devices_UpdateExtendedInformation + +```java +import com.azure.resourcemanager.databoxedge.models.DataBoxEdgeDeviceExtendedInfoPatch; + +/** + * Samples for Devices UpdateExtendedInformation. + */ +public final class DevicesUpdateExtendedInformationSamples { + /* + * x-ms-original-file: 2023-12-01/GetUpdateExtendedInfo.json + */ + /** + * Sample code: GetUpdateExtendedInfo. + * + * @param manager Entry point to DataBoxEdgeManager. + */ + public static void getUpdateExtendedInfo(com.azure.resourcemanager.databoxedge.DataBoxEdgeManager manager) { + manager.devices() + .updateExtendedInformationWithResponse("GroupForEdgeAutomation", "testedgedevice", + new DataBoxEdgeDeviceExtendedInfoPatch(), com.azure.core.util.Context.NONE); } } ``` @@ -748,9 +994,7 @@ import com.azure.resourcemanager.databoxedge.models.UploadCertificateRequest; */ public final class DevicesUploadCertificateSamples { /* - * x-ms-original-file: - * specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2019-08-01/examples/UploadCertificatePost - * .json + * x-ms-original-file: 2023-12-01/UploadCertificatePost.json */ /** * Sample code: UploadCertificatePost. @@ -759,7 +1003,7 @@ public final class DevicesUploadCertificateSamples { */ public static void uploadCertificatePost(com.azure.resourcemanager.databoxedge.DataBoxEdgeManager manager) { manager.devices() - .uploadCertificateWithResponse("testedgedevice", "GroupForEdgeAutomation", + .uploadCertificateWithResponse("GroupForEdgeAutomation", "testedgedevice", new UploadCertificateRequest().withCertificate( "MIIC9DCCAdygAwIBAgIQWJae7GNjiI9Mcv/gJyrOPTANBgkqhkiG9w0BAQUFADASMRAwDgYDVQQDDAdXaW5kb3dzMB4XDTE4MTEyNzAwMTA0NVoXDTIxMTEyODAwMTA0NVowEjEQMA4GA1UEAwwHV2luZG93czCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAKxkRExqxf0qH1avnyORptIbRC2yQwqe3EIbJ2FPKr5jtAppGeX/dGKrFSnX+7/0HFr77aJHafdpEAtOiLyJ4zCAVs0obZCCIq4qJdmjYUTU0UXH/w/YzXfQA0d9Zh9AN+NJBX9xj05NzgsT24fkgsK2v6mWJQXT7YcWAsl5sEYPnx1e+MrupNyVSL/RUJmrS+etJSysHtFeWRhsUhVAs1DD5ExJvBLU3WH0IsojEvpXcjrutB5/MDQNrd/StGI6WovoSSPH7FyT9tgERx+q+Yg3YUGzfaIPCctlrRGehcdtzdNoKd0rsX62yCq0U6POoSfwe22NJu41oAUMd7e6R8cCAwEAAaNGMEQwEwYDVR0lBAwwCgYIKwYBBQUHAwIwHQYDVR0OBBYEFDd0VxnS3LnMIfwc7xW4b4IZWG5GMA4GA1UdDwEB/wQEAwIFIDANBgkqhkiG9w0BAQUFAAOCAQEAPQRby2u9celvtvL/DLEb5Vt3/tPStRQC5MyTD62L5RT/q8E6EMCXVZNkXF5WlWucLJi/18tY+9PNgP9xWLJh7kpSWlWdi9KPtwMqKDlEH8L2TnQdjimt9XuiCrTnoFy/1X2BGLY/rCaUJNSd15QCkz2xeW+Z+YSk2GwAc/A/4YfNpqSIMfNuPrT76o02VdD9WmJUA3fS/HY0sU9qgQRS/3F5/0EPS+HYQ0SvXCK9tggcCd4O050ytNBMJC9qMOJ7yE0iOrFfOJSCfDAuPhn/rHFh79Kn1moF+/CE+nc0/2RPiLC8r54/rt5dYyyxJDfXg0a3VrrX39W69WZGW5OXiw=="), com.azure.core.util.Context.NONE); @@ -767,6 +1011,118 @@ public final class DevicesUploadCertificateSamples { } ``` +### DiagnosticSettings_GetDiagnosticProactiveLogCollectionSettings + +```java +/** + * Samples for DiagnosticSettings GetDiagnosticProactiveLogCollectionSettings. + */ +public final class DiagnosticSettingsGetDiagnosticProactiveLogCollectionSettingsSamples { + /* + * x-ms-original-file: 2023-12-01/GetDiagnosticProactiveLogCollectionSettings.json + */ + /** + * Sample code: GetDiagnosticProactiveLogCollectionSettings. + * + * @param manager Entry point to DataBoxEdgeManager. + */ + public static void + getDiagnosticProactiveLogCollectionSettings(com.azure.resourcemanager.databoxedge.DataBoxEdgeManager manager) { + manager.diagnosticSettings() + .getDiagnosticProactiveLogCollectionSettingsWithResponse("GroupForEdgeAutomation", "testedgedevice", + com.azure.core.util.Context.NONE); + } +} +``` + +### DiagnosticSettings_GetDiagnosticRemoteSupportSettings + +```java +/** + * Samples for DiagnosticSettings GetDiagnosticRemoteSupportSettings. + */ +public final class DiagnosticSettingsGetDiagnosticRemoteSupportSettingsSamples { + /* + * x-ms-original-file: 2023-12-01/GetDiagnosticRemoteSupportSettings.json + */ + /** + * Sample code: GetDiagnosticRemoteSupportSettings. + * + * @param manager Entry point to DataBoxEdgeManager. + */ + public static void + getDiagnosticRemoteSupportSettings(com.azure.resourcemanager.databoxedge.DataBoxEdgeManager manager) { + manager.diagnosticSettings() + .getDiagnosticRemoteSupportSettingsWithResponse("GroupForEdgeAutomation", "testedgedevice", + com.azure.core.util.Context.NONE); + } +} +``` + +### DiagnosticSettings_UpdateDiagnosticProactiveLogCollectionSettings + +```java +import com.azure.resourcemanager.databoxedge.fluent.models.DiagnosticProactiveLogCollectionSettingsInner; +import com.azure.resourcemanager.databoxedge.models.ProactiveDiagnosticsConsent; + +/** + * Samples for DiagnosticSettings UpdateDiagnosticProactiveLogCollectionSettings. + */ +public final class DiagnosticSettingsUpdateDiagnosticProactiveLogCollectionSettingsSamples { + /* + * x-ms-original-file: 2023-12-01/UpdateDiagnosticProactiveLogCollectionSettings.json + */ + /** + * Sample code: UpdateDiagnosticProactiveLogCollectionSettings. + * + * @param manager Entry point to DataBoxEdgeManager. + */ + public static void updateDiagnosticProactiveLogCollectionSettings( + com.azure.resourcemanager.databoxedge.DataBoxEdgeManager manager) { + manager.diagnosticSettings() + .updateDiagnosticProactiveLogCollectionSettings("GroupForEdgeAutomation", "testedgedevice", + new DiagnosticProactiveLogCollectionSettingsInner() + .withUserConsent(ProactiveDiagnosticsConsent.ENABLED), + com.azure.core.util.Context.NONE); + } +} +``` + +### DiagnosticSettings_UpdateDiagnosticRemoteSupportSettings + +```java +import com.azure.resourcemanager.databoxedge.fluent.models.DiagnosticRemoteSupportSettingsInner; +import com.azure.resourcemanager.databoxedge.models.AccessLevel; +import com.azure.resourcemanager.databoxedge.models.RemoteApplicationType; +import com.azure.resourcemanager.databoxedge.models.RemoteSupportSettings; +import java.time.OffsetDateTime; +import java.util.Arrays; + +/** + * Samples for DiagnosticSettings UpdateDiagnosticRemoteSupportSettings. + */ +public final class DiagnosticSettingsUpdateDiagnosticRemoteSupportSettingsSamples { + /* + * x-ms-original-file: 2023-12-01/UpdateDiagnosticRemoteSupportSettings.json + */ + /** + * Sample code: UpdateDiagnosticRemoteSupportSettings. + * + * @param manager Entry point to DataBoxEdgeManager. + */ + public static void + updateDiagnosticRemoteSupportSettings(com.azure.resourcemanager.databoxedge.DataBoxEdgeManager manager) { + manager.diagnosticSettings() + .updateDiagnosticRemoteSupportSettings("GroupForEdgeAutomation", "testedgedevice", + new DiagnosticRemoteSupportSettingsInner().withRemoteSupportSettingsList(Arrays + .asList(new RemoteSupportSettings().withRemoteApplicationType(RemoteApplicationType.POWERSHELL) + .withAccessLevel(AccessLevel.READ_WRITE) + .withExpirationTimeStampInUTC(OffsetDateTime.parse("2021-07-07T00:00:00+00:00")))), + com.azure.core.util.Context.NONE); + } +} +``` + ### Jobs_Get ```java @@ -775,8 +1131,7 @@ public final class DevicesUploadCertificateSamples { */ public final class JobsGetSamples { /* - * x-ms-original-file: - * specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2019-08-01/examples/JobsGet.json + * x-ms-original-file: 2023-12-01/JobsGet.json */ /** * Sample code: JobsGet. @@ -785,12 +1140,111 @@ public final class JobsGetSamples { */ public static void jobsGet(com.azure.resourcemanager.databoxedge.DataBoxEdgeManager manager) { manager.jobs() - .getWithResponse("testedgedevice", "159a00c7-8543-4343-9435-263ac87df3bb", "GroupForEdgeAutomation", + .getWithResponse("GroupForEdgeAutomation", "testedgedevice", "159a00c7-8543-4343-9435-263ac87df3bb", com.azure.core.util.Context.NONE); } } ``` +### MonitoringConfig_CreateOrUpdate + +```java +import com.azure.resourcemanager.databoxedge.fluent.models.MonitoringMetricConfigurationInner; +import com.azure.resourcemanager.databoxedge.models.MetricConfiguration; +import com.azure.resourcemanager.databoxedge.models.MetricCounter; +import com.azure.resourcemanager.databoxedge.models.MetricCounterSet; +import java.util.Arrays; + +/** + * Samples for MonitoringConfig CreateOrUpdate. + */ +public final class MonitoringConfigCreateOrUpdateSamples { + /* + * x-ms-original-file: 2023-12-01/PutMonitoringConfig.json + */ + /** + * Sample code: PutMonitoringConfig. + * + * @param manager Entry point to DataBoxEdgeManager. + */ + public static void putMonitoringConfig(com.azure.resourcemanager.databoxedge.DataBoxEdgeManager manager) { + manager.monitoringConfigs() + .createOrUpdate("GroupForEdgeAutomation", "testedgedevice", new MonitoringMetricConfigurationInner() + .withMetricConfigurations(Arrays.asList(new MetricConfiguration().withResourceId("test") + .withMdmAccount("test") + .withMetricNameSpace("test") + .withCounterSets(Arrays.asList( + new MetricCounterSet().withCounters(Arrays.asList(new MetricCounter().withName("test"))))))), + com.azure.core.util.Context.NONE); + } +} +``` + +### MonitoringConfig_Delete + +```java +/** + * Samples for MonitoringConfig Delete. + */ +public final class MonitoringConfigDeleteSamples { + /* + * x-ms-original-file: 2023-12-01/DeleteMonitoringConfig.json + */ + /** + * Sample code: DeleteMonitoringConfig. + * + * @param manager Entry point to DataBoxEdgeManager. + */ + public static void deleteMonitoringConfig(com.azure.resourcemanager.databoxedge.DataBoxEdgeManager manager) { + manager.monitoringConfigs() + .delete("GroupForEdgeAutomation", "testedgedevice", com.azure.core.util.Context.NONE); + } +} +``` + +### MonitoringConfig_Get + +```java +/** + * Samples for MonitoringConfig Get. + */ +public final class MonitoringConfigGetSamples { + /* + * x-ms-original-file: 2023-12-01/GetMonitoringConfig.json + */ + /** + * Sample code: GetMonitoringConfig. + * + * @param manager Entry point to DataBoxEdgeManager. + */ + public static void getMonitoringConfig(com.azure.resourcemanager.databoxedge.DataBoxEdgeManager manager) { + manager.monitoringConfigs() + .getWithResponse("GroupForEdgeAutomation", "testedgedevice", com.azure.core.util.Context.NONE); + } +} +``` + +### MonitoringConfig_List + +```java +/** + * Samples for MonitoringConfig List. + */ +public final class MonitoringConfigListSamples { + /* + * x-ms-original-file: 2023-12-01/ListMonitoringConfig.json + */ + /** + * Sample code: ListMonitoringConfig. + * + * @param manager Entry point to DataBoxEdgeManager. + */ + public static void listMonitoringConfig(com.azure.resourcemanager.databoxedge.DataBoxEdgeManager manager) { + manager.monitoringConfigs().list("GroupForEdgeAutomation", "testedgedevice", com.azure.core.util.Context.NONE); + } +} +``` + ### Nodes_ListByDataBoxEdgeDevice ```java @@ -799,9 +1253,7 @@ public final class JobsGetSamples { */ public final class NodesListByDataBoxEdgeDeviceSamples { /* - * x-ms-original-file: - * specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2019-08-01/examples/NodeGetAllInDevice. - * json + * x-ms-original-file: 2023-12-01/NodeGetAllInDevice.json */ /** * Sample code: NodesGetAllInDevice. @@ -810,7 +1262,7 @@ public final class NodesListByDataBoxEdgeDeviceSamples { */ public static void nodesGetAllInDevice(com.azure.resourcemanager.databoxedge.DataBoxEdgeManager manager) { manager.nodes() - .listByDataBoxEdgeDevice("testedgedevice", "GroupForEdgeAutomation", com.azure.core.util.Context.NONE); + .listByDataBoxEdgeDevice("GroupForEdgeAutomation", "testedgedevice", com.azure.core.util.Context.NONE); } } ``` @@ -823,8 +1275,7 @@ public final class NodesListByDataBoxEdgeDeviceSamples { */ public final class OperationsListSamples { /* - * x-ms-original-file: - * specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2019-08-01/examples/OperationsGet.json + * x-ms-original-file: 2023-12-01/OperationsGet.json */ /** * Sample code: OperationsGet. @@ -845,9 +1296,7 @@ public final class OperationsListSamples { */ public final class OperationsStatusGetSamples { /* - * x-ms-original-file: - * specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2019-08-01/examples/OperationsStatusGet. - * json + * x-ms-original-file: 2023-12-01/OperationsStatusGet.json */ /** * Sample code: OperationsStatusGet. @@ -856,7 +1305,7 @@ public final class OperationsStatusGetSamples { */ public static void operationsStatusGet(com.azure.resourcemanager.databoxedge.DataBoxEdgeManager manager) { manager.operationsStatus() - .getWithResponse("testedgedevice", "159a00c7-8543-4343-9435-263ac87df3bb", "GroupForEdgeAutomation", + .getWithResponse("GroupForEdgeAutomation", "testedgedevice", "159a00c7-8543-4343-9435-263ac87df3bb", com.azure.core.util.Context.NONE); } } @@ -875,8 +1324,7 @@ import java.util.Arrays; */ public final class OrdersCreateOrUpdateSamples { /* - * x-ms-original-file: - * specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2019-08-01/examples/OrderPut.json + * x-ms-original-file: 2023-12-01/OrderPut.json */ /** * Sample code: OrderPut. @@ -885,7 +1333,7 @@ public final class OrdersCreateOrUpdateSamples { */ public static void orderPut(com.azure.resourcemanager.databoxedge.DataBoxEdgeManager manager) { manager.orders() - .createOrUpdate("testedgedevice", "GroupForEdgeAutomation", + .createOrUpdate("GroupForEdgeAutomation", "testedgedevice", new OrderInner() .withContactInformation(new ContactDetails().withContactPerson("John Mcclane") .withCompanyName("Microsoft") @@ -911,8 +1359,7 @@ public final class OrdersCreateOrUpdateSamples { */ public final class OrdersDeleteSamples { /* - * x-ms-original-file: - * specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2019-08-01/examples/OrderDelete.json + * x-ms-original-file: 2023-12-01/OrderDelete.json */ /** * Sample code: OrderDelete. @@ -920,7 +1367,7 @@ public final class OrdersDeleteSamples { * @param manager Entry point to DataBoxEdgeManager. */ public static void orderDelete(com.azure.resourcemanager.databoxedge.DataBoxEdgeManager manager) { - manager.orders().delete("testedgedevice", "GroupForEdgeAutomation", com.azure.core.util.Context.NONE); + manager.orders().delete("GroupForEdgeAutomation", "testedgedevice", com.azure.core.util.Context.NONE); } } ``` @@ -933,8 +1380,7 @@ public final class OrdersDeleteSamples { */ public final class OrdersGetSamples { /* - * x-ms-original-file: - * specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2019-08-01/examples/OrderGet.json + * x-ms-original-file: 2023-12-01/OrderGet.json */ /** * Sample code: OrderGet. @@ -942,7 +1388,7 @@ public final class OrdersGetSamples { * @param manager Entry point to DataBoxEdgeManager. */ public static void orderGet(com.azure.resourcemanager.databoxedge.DataBoxEdgeManager manager) { - manager.orders().getWithResponse("testedgedevice", "GroupForEdgeAutomation", com.azure.core.util.Context.NONE); + manager.orders().getWithResponse("GroupForEdgeAutomation", "testedgedevice", com.azure.core.util.Context.NONE); } } ``` @@ -955,9 +1401,7 @@ public final class OrdersGetSamples { */ public final class OrdersListByDataBoxEdgeDeviceSamples { /* - * x-ms-original-file: - * specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2019-08-01/examples/OrderGetAllInDevice. - * json + * x-ms-original-file: 2023-12-01/OrderGetAllInDevice.json */ /** * Sample code: OrderGetAllInDevice. @@ -966,7 +1410,29 @@ public final class OrdersListByDataBoxEdgeDeviceSamples { */ public static void orderGetAllInDevice(com.azure.resourcemanager.databoxedge.DataBoxEdgeManager manager) { manager.orders() - .listByDataBoxEdgeDevice("testedgedevice", "GroupForEdgeAutomation", com.azure.core.util.Context.NONE); + .listByDataBoxEdgeDevice("GroupForEdgeAutomation", "testedgedevice", com.azure.core.util.Context.NONE); + } +} +``` + +### Orders_ListDCAccessCode + +```java +/** + * Samples for Orders ListDCAccessCode. + */ +public final class OrdersListDCAccessCodeSamples { + /* + * x-ms-original-file: 2023-12-01/GetDCAccessCode.json + */ + /** + * Sample code: GetDCAccessCode. + * + * @param manager Entry point to DataBoxEdgeManager. + */ + public static void getDCAccessCode(com.azure.resourcemanager.databoxedge.DataBoxEdgeManager manager) { + manager.orders() + .listDCAccessCodeWithResponse("GroupForEdgeAutomation", "testedgedevice", com.azure.core.util.Context.NONE); } } ``` @@ -974,23 +1440,15 @@ public final class OrdersListByDataBoxEdgeDeviceSamples { ### Roles_CreateOrUpdate ```java -import com.azure.resourcemanager.databoxedge.models.AsymmetricEncryptedSecret; -import com.azure.resourcemanager.databoxedge.models.Authentication; -import com.azure.resourcemanager.databoxedge.models.EncryptionAlgorithm; -import com.azure.resourcemanager.databoxedge.models.IoTDeviceInfo; -import com.azure.resourcemanager.databoxedge.models.IoTRole; -import com.azure.resourcemanager.databoxedge.models.PlatformType; -import com.azure.resourcemanager.databoxedge.models.RoleStatus; -import com.azure.resourcemanager.databoxedge.models.SymmetricKey; -import java.util.Arrays; +import com.azure.resourcemanager.databoxedge.models.RoleProperties; +import com.azure.resourcemanager.databoxedge.models.RoleTypes; /** * Samples for Roles CreateOrUpdate. */ public final class RolesCreateOrUpdateSamples { /* - * x-ms-original-file: - * specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2019-08-01/examples/RolePut.json + * x-ms-original-file: 2023-12-01/RolePut.json */ /** * Sample code: RolePut. @@ -999,24 +1457,11 @@ public final class RolesCreateOrUpdateSamples { */ public static void rolePut(com.azure.resourcemanager.databoxedge.DataBoxEdgeManager manager) { manager.roles() - .createOrUpdate("testedgedevice", "IoTRole1", "GroupForEdgeAutomation", new IoTRole() - .withHostPlatform(PlatformType.LINUX) - .withIoTDeviceDetails(new IoTDeviceInfo().withDeviceId("iotdevice") - .withIoTHostHub("iothub.azure-devices.net") - .withAuthentication(new Authentication().withSymmetricKey( - new SymmetricKey().withConnectionString(new AsymmetricEncryptedSecret().withValue( - "Encrypted<>") - .withEncryptionCertThumbprint("348586569999244") - .withEncryptionAlgorithm(EncryptionAlgorithm.AES256))))) - .withIoTEdgeDeviceDetails(new IoTDeviceInfo().withDeviceId("iotEdge") - .withIoTHostHub("iothub.azure-devices.net") - .withAuthentication(new Authentication().withSymmetricKey( - new SymmetricKey().withConnectionString(new AsymmetricEncryptedSecret().withValue( - "Encrypted<>") - .withEncryptionCertThumbprint("1245475856069999244") - .withEncryptionAlgorithm(EncryptionAlgorithm.AES256))))) - .withShareMappings(Arrays.asList()) - .withRoleStatus(RoleStatus.ENABLED), com.azure.core.util.Context.NONE); + .define("IoTRole1") + .withExistingDataBoxEdgeDevice("GroupForEdgeAutomation", "testedgedevice") + .withKind(RoleTypes.IOT) + .withProperties(new RoleProperties()) + .create(); } } ``` @@ -1029,8 +1474,7 @@ public final class RolesCreateOrUpdateSamples { */ public final class RolesDeleteSamples { /* - * x-ms-original-file: - * specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2019-08-01/examples/RoleDelete.json + * x-ms-original-file: 2023-12-01/RoleDelete.json */ /** * Sample code: RoleDelete. @@ -1039,7 +1483,7 @@ public final class RolesDeleteSamples { */ public static void roleDelete(com.azure.resourcemanager.databoxedge.DataBoxEdgeManager manager) { manager.roles() - .delete("testedgedevice", "IoTRole1", "GroupForEdgeAutomation", com.azure.core.util.Context.NONE); + .delete("GroupForEdgeAutomation", "testedgedevice", "IoTRole1", com.azure.core.util.Context.NONE); } } ``` @@ -1052,8 +1496,7 @@ public final class RolesDeleteSamples { */ public final class RolesGetSamples { /* - * x-ms-original-file: - * specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2019-08-01/examples/RoleGet.json + * x-ms-original-file: 2023-12-01/RoleGet.json */ /** * Sample code: RoleGet. @@ -1062,7 +1505,7 @@ public final class RolesGetSamples { */ public static void roleGet(com.azure.resourcemanager.databoxedge.DataBoxEdgeManager manager) { manager.roles() - .getWithResponse("testedgedevice", "IoTRole1", "GroupForEdgeAutomation", com.azure.core.util.Context.NONE); + .getWithResponse("GroupForEdgeAutomation", "testedgedevice", "IoTRole1", com.azure.core.util.Context.NONE); } } ``` @@ -1075,9 +1518,7 @@ public final class RolesGetSamples { */ public final class RolesListByDataBoxEdgeDeviceSamples { /* - * x-ms-original-file: - * specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2019-08-01/examples/RoleGetAllInDevice. - * json + * x-ms-original-file: 2023-12-01/RoleGetAllInDevice.json */ /** * Sample code: RoleGetAllInDevice. @@ -1086,7 +1527,7 @@ public final class RolesListByDataBoxEdgeDeviceSamples { */ public static void roleGetAllInDevice(com.azure.resourcemanager.databoxedge.DataBoxEdgeManager manager) { manager.roles() - .listByDataBoxEdgeDevice("testedgedevice", "GroupForEdgeAutomation", com.azure.core.util.Context.NONE); + .listByDataBoxEdgeDevice("GroupForEdgeAutomation", "testedgedevice", com.azure.core.util.Context.NONE); } } ``` @@ -1109,8 +1550,7 @@ import java.util.Arrays; */ public final class SharesCreateOrUpdateSamples { /* - * x-ms-original-file: - * specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2019-08-01/examples/SharePut.json + * x-ms-original-file: 2023-12-01/SharePut.json */ /** * Sample code: SharePut. @@ -1120,7 +1560,7 @@ public final class SharesCreateOrUpdateSamples { public static void sharePut(com.azure.resourcemanager.databoxedge.DataBoxEdgeManager manager) { manager.shares() .define("smbshare") - .withExistingDataBoxEdgeDevice("testedgedevice", "GroupForEdgeAutomation") + .withExistingDataBoxEdgeDevice("GroupForEdgeAutomation", "testedgedevice") .withShareStatus(ShareStatus.fromString("Online")) .withMonitoringStatus(MonitoringStatus.ENABLED) .withAccessProtocol(ShareAccessProtocol.SMB) @@ -1145,8 +1585,7 @@ public final class SharesCreateOrUpdateSamples { */ public final class SharesDeleteSamples { /* - * x-ms-original-file: - * specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2019-08-01/examples/ShareDelete.json + * x-ms-original-file: 2023-12-01/ShareDelete.json */ /** * Sample code: ShareDelete. @@ -1155,7 +1594,7 @@ public final class SharesDeleteSamples { */ public static void shareDelete(com.azure.resourcemanager.databoxedge.DataBoxEdgeManager manager) { manager.shares() - .delete("testedgedevice", "smbshare", "GroupForEdgeAutomation", com.azure.core.util.Context.NONE); + .delete("GroupForEdgeAutomation", "testedgedevice", "smbshare", com.azure.core.util.Context.NONE); } } ``` @@ -1168,8 +1607,7 @@ public final class SharesDeleteSamples { */ public final class SharesGetSamples { /* - * x-ms-original-file: - * specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2019-08-01/examples/ShareGet.json + * x-ms-original-file: 2023-12-01/ShareGet.json */ /** * Sample code: ShareGet. @@ -1178,7 +1616,7 @@ public final class SharesGetSamples { */ public static void shareGet(com.azure.resourcemanager.databoxedge.DataBoxEdgeManager manager) { manager.shares() - .getWithResponse("testedgedevice", "smbshare", "GroupForEdgeAutomation", com.azure.core.util.Context.NONE); + .getWithResponse("GroupForEdgeAutomation", "testedgedevice", "smbshare", com.azure.core.util.Context.NONE); } } ``` @@ -1191,9 +1629,7 @@ public final class SharesGetSamples { */ public final class SharesListByDataBoxEdgeDeviceSamples { /* - * x-ms-original-file: - * specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2019-08-01/examples/ShareGetAllInDevice. - * json + * x-ms-original-file: 2023-12-01/ShareGetAllInDevice.json */ /** * Sample code: ShareGetAllInDevice. @@ -1202,7 +1638,7 @@ public final class SharesListByDataBoxEdgeDeviceSamples { */ public static void shareGetAllInDevice(com.azure.resourcemanager.databoxedge.DataBoxEdgeManager manager) { manager.shares() - .listByDataBoxEdgeDevice("testedgedevice", "GroupForEdgeAutomation", com.azure.core.util.Context.NONE); + .listByDataBoxEdgeDevice("GroupForEdgeAutomation", "testedgedevice", com.azure.core.util.Context.NONE); } } ``` @@ -1215,8 +1651,7 @@ public final class SharesListByDataBoxEdgeDeviceSamples { */ public final class SharesRefreshSamples { /* - * x-ms-original-file: - * specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2019-08-01/examples/ShareRefreshPost.json + * x-ms-original-file: 2023-12-01/ShareRefreshPost.json */ /** * Sample code: ShareRefreshPost. @@ -1225,29 +1660,7 @@ public final class SharesRefreshSamples { */ public static void shareRefreshPost(com.azure.resourcemanager.databoxedge.DataBoxEdgeManager manager) { manager.shares() - .refresh("testedgedevice", "smbshare", "GroupForEdgeAutomation", com.azure.core.util.Context.NONE); - } -} -``` - -### Skus_List - -```java -/** - * Samples for Skus List. - */ -public final class SkusListSamples { - /* - * x-ms-original-file: - * specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2019-08-01/examples/ListSkus.json - */ - /** - * Sample code: ListSkus. - * - * @param manager Entry point to DataBoxEdgeManager. - */ - public static void listSkus(com.azure.resourcemanager.databoxedge.DataBoxEdgeManager manager) { - manager.skus().list(null, com.azure.core.util.Context.NONE); + .refresh("GroupForEdgeAutomation", "testedgedevice", "smbshare", com.azure.core.util.Context.NONE); } } ``` @@ -1258,15 +1671,14 @@ public final class SkusListSamples { import com.azure.resourcemanager.databoxedge.models.AccountType; import com.azure.resourcemanager.databoxedge.models.AsymmetricEncryptedSecret; import com.azure.resourcemanager.databoxedge.models.EncryptionAlgorithm; -import com.azure.resourcemanager.databoxedge.models.SslStatus; +import com.azure.resourcemanager.databoxedge.models.SSLStatus; /** * Samples for StorageAccountCredentials CreateOrUpdate. */ public final class StorageAccountCredentialsCreateOrUpdateSamples { /* - * x-ms-original-file: - * specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2019-08-01/examples/SACPut.json + * x-ms-original-file: 2023-12-01/SACPut.json */ /** * Sample code: SACPut. @@ -1276,11 +1688,11 @@ public final class StorageAccountCredentialsCreateOrUpdateSamples { public static void sACPut(com.azure.resourcemanager.databoxedge.DataBoxEdgeManager manager) { manager.storageAccountCredentials() .define("sac1") - .withExistingDataBoxEdgeDevice("testedgedevice", "GroupForEdgeAutomation") + .withExistingDataBoxEdgeDevice("GroupForEdgeAutomation", "testedgedevice") .withAlias("sac1") - .withSslStatus(SslStatus.DISABLED) + .withSslStatus(SSLStatus.DISABLED) .withAccountType(AccountType.BLOB_STORAGE) - .withUsername("cisbvt") + .withUserName("cisbvt") .withAccountKey(new AsymmetricEncryptedSecret().withValue( "lAeZEYi6rNP1/EyNaVUYmTSZEYyaIaWmwUsGwek0+xiZj54GM9Ue9/UA2ed/ClC03wuSit2XzM/cLRU5eYiFBwks23rGwiQOr3sruEL2a74EjPD050xYjA6M1I2hu/w2yjVHhn5j+DbXS4Xzi+rHHNZK3DgfDO3PkbECjPck+PbpSBjy9+6Mrjcld5DIZhUAeMlMHrFlg+WKRKB14o/og56u5/xX6WKlrMLEQ+y6E18dUwvWs2elTNoVO8PBE8SM/CfooX4AMNvaNdSObNBPdP+F6Lzc556nFNWXrBLRt0vC7s9qTiVRO4x/qCNaK/B4y7IqXMllwQFf4Np9UQ2ECA==") .withEncryptionCertThumbprint("2A9D8D6BE51574B5461230AEF02F162C5F01AD31") @@ -1298,8 +1710,7 @@ public final class StorageAccountCredentialsCreateOrUpdateSamples { */ public final class StorageAccountCredentialsDeleteSamples { /* - * x-ms-original-file: - * specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2019-08-01/examples/SACDelete.json + * x-ms-original-file: 2023-12-01/SACDelete.json */ /** * Sample code: SACDelete. @@ -1308,7 +1719,7 @@ public final class StorageAccountCredentialsDeleteSamples { */ public static void sACDelete(com.azure.resourcemanager.databoxedge.DataBoxEdgeManager manager) { manager.storageAccountCredentials() - .delete("testedgedevice", "sac1", "GroupForEdgeAutomation", com.azure.core.util.Context.NONE); + .delete("GroupForEdgeAutomation", "testedgedevice", "sac1", com.azure.core.util.Context.NONE); } } ``` @@ -1321,8 +1732,7 @@ public final class StorageAccountCredentialsDeleteSamples { */ public final class StorageAccountCredentialsGetSamples { /* - * x-ms-original-file: - * specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2019-08-01/examples/SACGet.json + * x-ms-original-file: 2023-12-01/SACGet.json */ /** * Sample code: SACGet. @@ -1331,7 +1741,7 @@ public final class StorageAccountCredentialsGetSamples { */ public static void sACGet(com.azure.resourcemanager.databoxedge.DataBoxEdgeManager manager) { manager.storageAccountCredentials() - .getWithResponse("testedgedevice", "sac1", "GroupForEdgeAutomation", com.azure.core.util.Context.NONE); + .getWithResponse("GroupForEdgeAutomation", "testedgedevice", "sac1", com.azure.core.util.Context.NONE); } } ``` @@ -1344,9 +1754,7 @@ public final class StorageAccountCredentialsGetSamples { */ public final class StorageAccountCredentialsListByDataBoxEdgeDeviceSamples { /* - * x-ms-original-file: - * specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2019-08-01/examples/SACGetAllInDevice. - * json + * x-ms-original-file: 2023-12-01/SACGetAllInDevice.json */ /** * Sample code: SACGetAllInDevice. @@ -1355,7 +1763,7 @@ public final class StorageAccountCredentialsListByDataBoxEdgeDeviceSamples { */ public static void sACGetAllInDevice(com.azure.resourcemanager.databoxedge.DataBoxEdgeManager manager) { manager.storageAccountCredentials() - .listByDataBoxEdgeDevice("testedgedevice", "GroupForEdgeAutomation", com.azure.core.util.Context.NONE); + .listByDataBoxEdgeDevice("GroupForEdgeAutomation", "testedgedevice", com.azure.core.util.Context.NONE); } } ``` @@ -1371,9 +1779,7 @@ import com.azure.resourcemanager.databoxedge.models.StorageAccountStatus; */ public final class StorageAccountsCreateOrUpdateSamples { /* - * x-ms-original-file: - * specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2019-08-01/examples/StorageAccountPut. - * json + * x-ms-original-file: 2023-12-01/StorageAccountPut.json */ /** * Sample code: StorageAccountPut. @@ -1383,10 +1789,10 @@ public final class StorageAccountsCreateOrUpdateSamples { public static void storageAccountPut(com.azure.resourcemanager.databoxedge.DataBoxEdgeManager manager) { manager.storageAccounts() .define("blobstorageaccount1") - .withExistingDataBoxEdgeDevice("testedgedevice", "GroupForEdgeAutomation") + .withExistingDataBoxEdgeDevice("GroupForEdgeAutomation", "testedgedevice") + .withDataPolicy(DataPolicy.CLOUD) .withDescription("It's an awesome storage account") .withStorageAccountStatus(StorageAccountStatus.OK) - .withDataPolicy(DataPolicy.CLOUD) .withStorageAccountCredentialId( "/subscriptions/4385cf00-2d3a-425a-832f-f4285b1c9dce/resourceGroups/GroupForDataBoxEdgeAutomation/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/testedgedevice/storageAccountCredentials/cisbvt") .create(); @@ -1402,9 +1808,7 @@ public final class StorageAccountsCreateOrUpdateSamples { */ public final class StorageAccountsDeleteSamples { /* - * x-ms-original-file: - * specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2019-08-01/examples/StorageAccountDelete. - * json + * x-ms-original-file: 2023-12-01/StorageAccountDelete.json */ /** * Sample code: StorageAccountDelete. @@ -1413,7 +1817,7 @@ public final class StorageAccountsDeleteSamples { */ public static void storageAccountDelete(com.azure.resourcemanager.databoxedge.DataBoxEdgeManager manager) { manager.storageAccounts() - .delete("testedgedevice", "storageaccount1", "GroupForEdgeAutomation", com.azure.core.util.Context.NONE); + .delete("GroupForEdgeAutomation", "testedgedevice", "storageaccount1", com.azure.core.util.Context.NONE); } } ``` @@ -1426,9 +1830,7 @@ public final class StorageAccountsDeleteSamples { */ public final class StorageAccountsGetSamples { /* - * x-ms-original-file: - * specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2019-08-01/examples/StorageAccountGet. - * json + * x-ms-original-file: 2023-12-01/StorageAccountGet.json */ /** * Sample code: StorageAccountGet. @@ -1437,7 +1839,7 @@ public final class StorageAccountsGetSamples { */ public static void storageAccountGet(com.azure.resourcemanager.databoxedge.DataBoxEdgeManager manager) { manager.storageAccounts() - .getWithResponse("testedgedevice", "blobstorageaccount1", "GroupForEdgeAutomation", + .getWithResponse("GroupForEdgeAutomation", "testedgedevice", "blobstorageaccount1", com.azure.core.util.Context.NONE); } } @@ -1451,8 +1853,7 @@ public final class StorageAccountsGetSamples { */ public final class StorageAccountsListByDataBoxEdgeDeviceSamples { /* - * x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2019-08-01/examples/ - * StorageAccountGetAllInDevice.json + * x-ms-original-file: 2023-12-01/StorageAccountGetAllInDevice.json */ /** * Sample code: StorageAccountGetAllInDevice. @@ -1461,7 +1862,37 @@ public final class StorageAccountsListByDataBoxEdgeDeviceSamples { */ public static void storageAccountGetAllInDevice(com.azure.resourcemanager.databoxedge.DataBoxEdgeManager manager) { manager.storageAccounts() - .listByDataBoxEdgeDevice("testedgedevice", "GroupForEdgeAutomation", com.azure.core.util.Context.NONE); + .listByDataBoxEdgeDevice("GroupForEdgeAutomation", "testedgedevice", com.azure.core.util.Context.NONE); + } +} +``` + +### SupportPackages_TriggerSupportPackage + +```java +import com.azure.resourcemanager.databoxedge.models.TriggerSupportPackageRequest; +import java.time.OffsetDateTime; + +/** + * Samples for SupportPackages TriggerSupportPackage. + */ +public final class SupportPackagesTriggerSupportPackageSamples { + /* + * x-ms-original-file: 2023-12-01/TriggerSupportPackage.json + */ + /** + * Sample code: TriggerSupportPackage. + * + * @param manager Entry point to DataBoxEdgeManager. + */ + public static void triggerSupportPackage(com.azure.resourcemanager.databoxedge.DataBoxEdgeManager manager) { + manager.supportPackages() + .triggerSupportPackage("GroupForEdgeAutomation", "testedgedevice", + new TriggerSupportPackageRequest() + .withMinimumTimeStamp(OffsetDateTime.parse("2018-12-18T02:18:51.4270267Z")) + .withMaximumTimeStamp(OffsetDateTime.parse("2018-12-18T02:19:51.4270267Z")) + .withInclude("DefaultWithDumps"), + com.azure.core.util.Context.NONE); } } ``` @@ -1469,17 +1900,15 @@ public final class StorageAccountsListByDataBoxEdgeDeviceSamples { ### Triggers_CreateOrUpdate ```java -import com.azure.resourcemanager.databoxedge.models.FileEventTrigger; -import com.azure.resourcemanager.databoxedge.models.FileSourceInfo; -import com.azure.resourcemanager.databoxedge.models.RoleSinkInfo; +import com.azure.resourcemanager.databoxedge.models.TriggerEventType; +import com.azure.resourcemanager.databoxedge.models.TriggerProperties; /** * Samples for Triggers CreateOrUpdate. */ public final class TriggersCreateOrUpdateSamples { /* - * x-ms-original-file: - * specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2019-08-01/examples/TriggerPut.json + * x-ms-original-file: 2023-12-01/TriggerPut.json */ /** * Sample code: TriggerPut. @@ -1488,12 +1917,11 @@ public final class TriggersCreateOrUpdateSamples { */ public static void triggerPut(com.azure.resourcemanager.databoxedge.DataBoxEdgeManager manager) { manager.triggers() - .createOrUpdate("testedgedevice", "trigger1", "GroupForEdgeAutomation", new FileEventTrigger() - .withSourceInfo(new FileSourceInfo().withShareId( - "/subscriptions/4385cf00-2d3a-425a-832f-f4285b1c9dce/resourceGroups/GroupForEdgeAutomation/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/testedgedevice/shares/share1")) - .withSinkInfo(new RoleSinkInfo().withRoleId( - "/subscriptions/4385cf00-2d3a-425a-832f-f4285b1c9dce/resourceGroups/GroupForEdgeAutomation/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/testedgedevice/roles/role1")) - .withCustomContextTag("CustomContextTags-1235346475"), com.azure.core.util.Context.NONE); + .define("trigger1") + .withExistingDataBoxEdgeDevice("GroupForEdgeAutomation", "testedgedevice") + .withKind(TriggerEventType.FILE_EVENT) + .withProperties(new TriggerProperties()) + .create(); } } ``` @@ -1506,8 +1934,7 @@ public final class TriggersCreateOrUpdateSamples { */ public final class TriggersDeleteSamples { /* - * x-ms-original-file: - * specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2019-08-01/examples/TriggerDelete.json + * x-ms-original-file: 2023-12-01/TriggerDelete.json */ /** * Sample code: TriggerDelete. @@ -1516,7 +1943,7 @@ public final class TriggersDeleteSamples { */ public static void triggerDelete(com.azure.resourcemanager.databoxedge.DataBoxEdgeManager manager) { manager.triggers() - .delete("testedgedevice", "trigger1", "GroupForEdgeAutomation", com.azure.core.util.Context.NONE); + .delete("GroupForEdgeAutomation", "testedgedevice", "trigger1", com.azure.core.util.Context.NONE); } } ``` @@ -1529,8 +1956,7 @@ public final class TriggersDeleteSamples { */ public final class TriggersGetSamples { /* - * x-ms-original-file: - * specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2019-08-01/examples/TriggerGet.json + * x-ms-original-file: 2023-12-01/TriggerGet.json */ /** * Sample code: TriggerGet. @@ -1539,7 +1965,7 @@ public final class TriggersGetSamples { */ public static void triggerGet(com.azure.resourcemanager.databoxedge.DataBoxEdgeManager manager) { manager.triggers() - .getWithResponse("testedgedevice", "trigger1", "GroupForEdgeAutomation", com.azure.core.util.Context.NONE); + .getWithResponse("GroupForEdgeAutomation", "testedgedevice", "trigger1", com.azure.core.util.Context.NONE); } } ``` @@ -1552,9 +1978,7 @@ public final class TriggersGetSamples { */ public final class TriggersListByDataBoxEdgeDeviceSamples { /* - * x-ms-original-file: - * specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2019-08-01/examples/TriggerGetAllInDevice - * .json + * x-ms-original-file: 2023-12-01/TriggerGetAllInDevice.json */ /** * Sample code: TriggerGetAllInDevice. @@ -1563,7 +1987,7 @@ public final class TriggersListByDataBoxEdgeDeviceSamples { */ public static void triggerGetAllInDevice(com.azure.resourcemanager.databoxedge.DataBoxEdgeManager manager) { manager.triggers() - .listByDataBoxEdgeDevice("testedgedevice", "GroupForEdgeAutomation", null, + .listByDataBoxEdgeDevice("GroupForEdgeAutomation", "testedgedevice", null, com.azure.core.util.Context.NONE); } } @@ -1575,15 +1999,13 @@ public final class TriggersListByDataBoxEdgeDeviceSamples { import com.azure.resourcemanager.databoxedge.models.AsymmetricEncryptedSecret; import com.azure.resourcemanager.databoxedge.models.EncryptionAlgorithm; import com.azure.resourcemanager.databoxedge.models.UserType; -import java.util.Arrays; /** * Samples for Users CreateOrUpdate. */ public final class UsersCreateOrUpdateSamples { /* - * x-ms-original-file: - * specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2019-08-01/examples/UserPut.json + * x-ms-original-file: 2023-12-01/UserPut.json */ /** * Sample code: UserPut. @@ -1593,12 +2015,11 @@ public final class UsersCreateOrUpdateSamples { public static void userPut(com.azure.resourcemanager.databoxedge.DataBoxEdgeManager manager) { manager.users() .define("user1") - .withExistingDataBoxEdgeDevice("testedgedevice", "GroupForEdgeAutomation") + .withExistingDataBoxEdgeDevice("GroupForEdgeAutomation", "testedgedevice") .withUserType(UserType.SHARE) .withEncryptedPassword(new AsymmetricEncryptedSecret().withValue("") .withEncryptionCertThumbprint("blah") .withEncryptionAlgorithm(EncryptionAlgorithm.NONE)) - .withShareAccessRights(Arrays.asList()) .create(); } } @@ -1612,8 +2033,7 @@ public final class UsersCreateOrUpdateSamples { */ public final class UsersDeleteSamples { /* - * x-ms-original-file: - * specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2019-08-01/examples/UserDelete.json + * x-ms-original-file: 2023-12-01/UserDelete.json */ /** * Sample code: UserDelete. @@ -1621,7 +2041,7 @@ public final class UsersDeleteSamples { * @param manager Entry point to DataBoxEdgeManager. */ public static void userDelete(com.azure.resourcemanager.databoxedge.DataBoxEdgeManager manager) { - manager.users().delete("testedgedevice", "user1", "GroupForEdgeAutomation", com.azure.core.util.Context.NONE); + manager.users().delete("GroupForEdgeAutomation", "testedgedevice", "user1", com.azure.core.util.Context.NONE); } } ``` @@ -1634,8 +2054,7 @@ public final class UsersDeleteSamples { */ public final class UsersGetSamples { /* - * x-ms-original-file: - * specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2019-08-01/examples/UserGet.json + * x-ms-original-file: 2023-12-01/UserGet.json */ /** * Sample code: UserGet. @@ -1644,7 +2063,7 @@ public final class UsersGetSamples { */ public static void userGet(com.azure.resourcemanager.databoxedge.DataBoxEdgeManager manager) { manager.users() - .getWithResponse("testedgedevice", "user1", "GroupForEdgeAutomation", com.azure.core.util.Context.NONE); + .getWithResponse("GroupForEdgeAutomation", "testedgedevice", "user1", com.azure.core.util.Context.NONE); } } ``` @@ -1657,9 +2076,7 @@ public final class UsersGetSamples { */ public final class UsersListByDataBoxEdgeDeviceSamples { /* - * x-ms-original-file: - * specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2019-08-01/examples/UserGetAllInDevice. - * json + * x-ms-original-file: 2023-12-01/UserGetAllInDevice.json */ /** * Sample code: UserGetAllInDevice. @@ -1668,7 +2085,7 @@ public final class UsersListByDataBoxEdgeDeviceSamples { */ public static void userGetAllInDevice(com.azure.resourcemanager.databoxedge.DataBoxEdgeManager manager) { manager.users() - .listByDataBoxEdgeDevice("testedgedevice", "GroupForEdgeAutomation", null, + .listByDataBoxEdgeDevice("GroupForEdgeAutomation", "testedgedevice", null, com.azure.core.util.Context.NONE); } } diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/pom.xml b/sdk/databoxedge/azure-resourcemanager-databoxedge/pom.xml index 7e30b0e25e6d..00ef317daaa5 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/pom.xml +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/pom.xml @@ -1,7 +1,7 @@ 4.0.0 @@ -18,7 +18,7 @@ jar Microsoft Azure SDK for DataBoxEdge Management - This package contains Microsoft Azure SDK for DataBoxEdge Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Package tag package-2019-08. + This package contains Microsoft Azure SDK for DataBoxEdge Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. // (missing-service-description) Add service description. Package api-version 2023-12-01. https://github.com/Azure/azure-sdk-for-java @@ -45,7 +45,7 @@ UTF-8 0 0 - false + true diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/DataBoxEdgeManager.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/DataBoxEdgeManager.java index c60593ce2ce2..3246717dd617 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/DataBoxEdgeManager.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/DataBoxEdgeManager.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge; @@ -22,50 +22,65 @@ import com.azure.core.http.policy.UserAgentPolicy; import com.azure.core.management.profile.AzureProfile; import com.azure.core.util.Configuration; +import com.azure.core.util.CoreUtils; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.databoxedge.fluent.DataBoxEdgeManagementClient; +import com.azure.resourcemanager.databoxedge.implementation.AddonsImpl; import com.azure.resourcemanager.databoxedge.implementation.AlertsImpl; +import com.azure.resourcemanager.databoxedge.implementation.AvailableSkusImpl; import com.azure.resourcemanager.databoxedge.implementation.BandwidthSchedulesImpl; import com.azure.resourcemanager.databoxedge.implementation.ContainersImpl; import com.azure.resourcemanager.databoxedge.implementation.DataBoxEdgeManagementClientBuilder; +import com.azure.resourcemanager.databoxedge.implementation.DeviceCapacityChecksImpl; +import com.azure.resourcemanager.databoxedge.implementation.DeviceCapacityInfoesImpl; import com.azure.resourcemanager.databoxedge.implementation.DevicesImpl; +import com.azure.resourcemanager.databoxedge.implementation.DiagnosticSettingsImpl; import com.azure.resourcemanager.databoxedge.implementation.JobsImpl; +import com.azure.resourcemanager.databoxedge.implementation.MonitoringConfigsImpl; import com.azure.resourcemanager.databoxedge.implementation.NodesImpl; import com.azure.resourcemanager.databoxedge.implementation.OperationsImpl; import com.azure.resourcemanager.databoxedge.implementation.OperationsStatusImpl; import com.azure.resourcemanager.databoxedge.implementation.OrdersImpl; import com.azure.resourcemanager.databoxedge.implementation.RolesImpl; import com.azure.resourcemanager.databoxedge.implementation.SharesImpl; -import com.azure.resourcemanager.databoxedge.implementation.SkusImpl; import com.azure.resourcemanager.databoxedge.implementation.StorageAccountCredentialsImpl; import com.azure.resourcemanager.databoxedge.implementation.StorageAccountsImpl; +import com.azure.resourcemanager.databoxedge.implementation.SupportPackagesImpl; import com.azure.resourcemanager.databoxedge.implementation.TriggersImpl; import com.azure.resourcemanager.databoxedge.implementation.UsersImpl; +import com.azure.resourcemanager.databoxedge.models.Addons; import com.azure.resourcemanager.databoxedge.models.Alerts; +import com.azure.resourcemanager.databoxedge.models.AvailableSkus; import com.azure.resourcemanager.databoxedge.models.BandwidthSchedules; import com.azure.resourcemanager.databoxedge.models.Containers; +import com.azure.resourcemanager.databoxedge.models.DeviceCapacityChecks; +import com.azure.resourcemanager.databoxedge.models.DeviceCapacityInfoes; import com.azure.resourcemanager.databoxedge.models.Devices; +import com.azure.resourcemanager.databoxedge.models.DiagnosticSettings; import com.azure.resourcemanager.databoxedge.models.Jobs; +import com.azure.resourcemanager.databoxedge.models.MonitoringConfigs; import com.azure.resourcemanager.databoxedge.models.Nodes; import com.azure.resourcemanager.databoxedge.models.Operations; import com.azure.resourcemanager.databoxedge.models.OperationsStatus; import com.azure.resourcemanager.databoxedge.models.Orders; import com.azure.resourcemanager.databoxedge.models.Roles; import com.azure.resourcemanager.databoxedge.models.Shares; -import com.azure.resourcemanager.databoxedge.models.Skus; import com.azure.resourcemanager.databoxedge.models.StorageAccountCredentials; import com.azure.resourcemanager.databoxedge.models.StorageAccounts; +import com.azure.resourcemanager.databoxedge.models.SupportPackages; import com.azure.resourcemanager.databoxedge.models.Triggers; import com.azure.resourcemanager.databoxedge.models.Users; import java.time.Duration; import java.time.temporal.ChronoUnit; import java.util.ArrayList; import java.util.List; +import java.util.Map; import java.util.Objects; import java.util.stream.Collectors; /** * Entry point to DataBoxEdgeManager. + * // (missing-service-description) Add service description. */ public final class DataBoxEdgeManager { private Operations operations; @@ -76,9 +91,9 @@ public final class DataBoxEdgeManager { private BandwidthSchedules bandwidthSchedules; - private Jobs jobs; + private DiagnosticSettings diagnosticSettings; - private Nodes nodes; + private Jobs jobs; private OperationsStatus operationsStatus; @@ -86,6 +101,8 @@ public final class DataBoxEdgeManager { private Roles roles; + private Addons addons; + private Shares shares; private StorageAccountCredentials storageAccountCredentials; @@ -98,7 +115,17 @@ public final class DataBoxEdgeManager { private Users users; - private Skus skus; + private DeviceCapacityChecks deviceCapacityChecks; + + private Nodes nodes; + + private SupportPackages supportPackages; + + private DeviceCapacityInfoes deviceCapacityInfoes; + + private MonitoringConfigs monitoringConfigs; + + private AvailableSkus availableSkus; private final DataBoxEdgeManagementClient clientObject; @@ -152,6 +179,9 @@ public static Configurable configure() { */ public static final class Configurable { private static final ClientLogger LOGGER = new ClientLogger(Configurable.class); + private static final String SDK_VERSION = "version"; + private static final Map PROPERTIES + = CoreUtils.getProperties("azure-resourcemanager-databoxedge.properties"); private HttpClient httpClient; private HttpLogOptions httpLogOptions; @@ -259,12 +289,14 @@ public DataBoxEdgeManager authenticate(TokenCredential credential, AzureProfile Objects.requireNonNull(credential, "'credential' cannot be null."); Objects.requireNonNull(profile, "'profile' cannot be null."); + String clientVersion = PROPERTIES.getOrDefault(SDK_VERSION, "UnknownVersion"); + StringBuilder userAgentBuilder = new StringBuilder(); userAgentBuilder.append("azsdk-java") .append("-") .append("com.azure.resourcemanager.databoxedge") .append("/") - .append("1.0.0"); + .append(clientVersion); if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) { userAgentBuilder.append(" (") .append(Configuration.getGlobalConfiguration().get("java.version")) @@ -359,27 +391,27 @@ public BandwidthSchedules bandwidthSchedules() { } /** - * Gets the resource collection API of Jobs. + * Gets the resource collection API of DiagnosticSettings. * - * @return Resource collection API of Jobs. + * @return Resource collection API of DiagnosticSettings. */ - public Jobs jobs() { - if (this.jobs == null) { - this.jobs = new JobsImpl(clientObject.getJobs(), this); + public DiagnosticSettings diagnosticSettings() { + if (this.diagnosticSettings == null) { + this.diagnosticSettings = new DiagnosticSettingsImpl(clientObject.getDiagnosticSettings(), this); } - return jobs; + return diagnosticSettings; } /** - * Gets the resource collection API of Nodes. + * Gets the resource collection API of Jobs. * - * @return Resource collection API of Nodes. + * @return Resource collection API of Jobs. */ - public Nodes nodes() { - if (this.nodes == null) { - this.nodes = new NodesImpl(clientObject.getNodes(), this); + public Jobs jobs() { + if (this.jobs == null) { + this.jobs = new JobsImpl(clientObject.getJobs(), this); } - return nodes; + return jobs; } /** @@ -407,7 +439,7 @@ public Orders orders() { } /** - * Gets the resource collection API of Roles. + * Gets the resource collection API of Roles. It manages Role. * * @return Resource collection API of Roles. */ @@ -418,6 +450,18 @@ public Roles roles() { return roles; } + /** + * Gets the resource collection API of Addons. It manages Addon. + * + * @return Resource collection API of Addons. + */ + public Addons addons() { + if (this.addons == null) { + this.addons = new AddonsImpl(clientObject.getAddons(), this); + } + return addons; + } + /** * Gets the resource collection API of Shares. It manages Share. * @@ -468,7 +512,7 @@ public Containers containers() { } /** - * Gets the resource collection API of Triggers. + * Gets the resource collection API of Triggers. It manages Trigger. * * @return Resource collection API of Triggers. */ @@ -492,15 +536,75 @@ public Users users() { } /** - * Gets the resource collection API of Skus. + * Gets the resource collection API of DeviceCapacityChecks. + * + * @return Resource collection API of DeviceCapacityChecks. + */ + public DeviceCapacityChecks deviceCapacityChecks() { + if (this.deviceCapacityChecks == null) { + this.deviceCapacityChecks = new DeviceCapacityChecksImpl(clientObject.getDeviceCapacityChecks(), this); + } + return deviceCapacityChecks; + } + + /** + * Gets the resource collection API of Nodes. + * + * @return Resource collection API of Nodes. + */ + public Nodes nodes() { + if (this.nodes == null) { + this.nodes = new NodesImpl(clientObject.getNodes(), this); + } + return nodes; + } + + /** + * Gets the resource collection API of SupportPackages. + * + * @return Resource collection API of SupportPackages. + */ + public SupportPackages supportPackages() { + if (this.supportPackages == null) { + this.supportPackages = new SupportPackagesImpl(clientObject.getSupportPackages(), this); + } + return supportPackages; + } + + /** + * Gets the resource collection API of DeviceCapacityInfoes. + * + * @return Resource collection API of DeviceCapacityInfoes. + */ + public DeviceCapacityInfoes deviceCapacityInfoes() { + if (this.deviceCapacityInfoes == null) { + this.deviceCapacityInfoes = new DeviceCapacityInfoesImpl(clientObject.getDeviceCapacityInfoes(), this); + } + return deviceCapacityInfoes; + } + + /** + * Gets the resource collection API of MonitoringConfigs. + * + * @return Resource collection API of MonitoringConfigs. + */ + public MonitoringConfigs monitoringConfigs() { + if (this.monitoringConfigs == null) { + this.monitoringConfigs = new MonitoringConfigsImpl(clientObject.getMonitoringConfigs(), this); + } + return monitoringConfigs; + } + + /** + * Gets the resource collection API of AvailableSkus. * - * @return Resource collection API of Skus. + * @return Resource collection API of AvailableSkus. */ - public Skus skus() { - if (this.skus == null) { - this.skus = new SkusImpl(clientObject.getSkus(), this); + public AvailableSkus availableSkus() { + if (this.availableSkus == null) { + this.availableSkus = new AvailableSkusImpl(clientObject.getAvailableSkus(), this); } - return skus; + return availableSkus; } /** diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/AddonsClient.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/AddonsClient.java new file mode 100644 index 000000000000..85809267398b --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/AddonsClient.java @@ -0,0 +1,200 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.databoxedge.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.databoxedge.fluent.models.AddonInner; + +/** + * An instance of this class provides access to all the operations defined in AddonsClient. + */ +public interface AddonsClient { + /** + * Gets a specific addon by name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @param addonName The addon name. + * @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 a specific addon by name along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String deviceName, String addonName, + Context context); + + /** + * Gets a specific addon by name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @param addonName The addon name. + * @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 a specific addon by name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AddonInner get(String resourceGroupName, String deviceName, String addonName); + + /** + * Create or update a addon. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @param addonName The addon name. + * @param addon The addon properties. + * @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 SyncPoller} for polling of role Addon. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, AddonInner> beginCreateOrUpdate(String resourceGroupName, String deviceName, + String addonName, AddonInner addon); + + /** + * Create or update a addon. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @param addonName The addon name. + * @param addon The addon properties. + * @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 SyncPoller} for polling of role Addon. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, AddonInner> beginCreateOrUpdate(String resourceGroupName, String deviceName, + String addonName, AddonInner addon, Context context); + + /** + * Create or update a addon. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @param addonName The addon name. + * @param addon The addon properties. + * @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 role Addon. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AddonInner createOrUpdate(String resourceGroupName, String deviceName, String addonName, AddonInner addon); + + /** + * Create or update a addon. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @param addonName The addon name. + * @param addon The addon properties. + * @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 role Addon. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AddonInner createOrUpdate(String resourceGroupName, String deviceName, String addonName, AddonInner addon, + Context context); + + /** + * Deletes the addon on the device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @param addonName The addon name. + * @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 SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String deviceName, String addonName); + + /** + * Deletes the addon on the device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @param addonName The addon name. + * @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 SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String deviceName, String addonName, + Context context); + + /** + * Deletes the addon on the device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @param addonName The addon name. + * @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 delete(String resourceGroupName, String deviceName, String addonName); + + /** + * Deletes the addon on the device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @param addonName The addon name. + * @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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String deviceName, String addonName, Context context); + + /** + * Lists all the addons configured in the role. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @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 collection of all the Role addon on the Azure Stack Edge device as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByRole(String resourceGroupName, String deviceName); + + /** + * Lists all the addons configured in the role. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @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 collection of all the Role addon on the Azure Stack Edge device as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByRole(String resourceGroupName, String deviceName, Context context); +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/AlertsClient.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/AlertsClient.java index 42e6866fa092..4951ba3e6852 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/AlertsClient.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/AlertsClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.fluent; @@ -16,60 +16,60 @@ */ public interface AlertsClient { /** - * Gets all the alerts for a Data Box Edge/Data Box Gateway device. + * Gets an alert by name. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param resourceGroupName The resource group name. + * @param name The alert name. + * @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 all the alerts for a Data Box Edge/Data Box Gateway device as paginated response with - * {@link PagedIterable}. + * @return an alert by name along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByDataBoxEdgeDevice(String deviceName, String resourceGroupName); + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String deviceName, String name, Context context); /** - * Gets all the alerts for a Data Box Edge/Data Box Gateway device. + * Gets an alert by name. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param resourceGroupName The resource group name. - * @param context The context to associate with this operation. + * @param name The alert name. * @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 all the alerts for a Data Box Edge/Data Box Gateway device as paginated response with - * {@link PagedIterable}. + * @return an alert by name. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByDataBoxEdgeDevice(String deviceName, String resourceGroupName, Context context); + @ServiceMethod(returns = ReturnType.SINGLE) + AlertInner get(String resourceGroupName, String deviceName, String name); /** - * Gets an alert by name. + * Gets all the alerts for a Data Box Edge/Data Box Gateway device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param name The alert name. - * @param resourceGroupName The resource group name. - * @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 an alert by name along with {@link Response}. + * @return all the alerts for a Data Box Edge/Data Box Gateway device as paginated response with + * {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String deviceName, String name, String resourceGroupName, Context context); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByDataBoxEdgeDevice(String resourceGroupName, String deviceName); /** - * Gets an alert by name. + * Gets all the alerts for a Data Box Edge/Data Box Gateway device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param name The alert name. - * @param resourceGroupName The resource group name. + * @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 an alert by name. + * @return all the alerts for a Data Box Edge/Data Box Gateway device as paginated response with + * {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - AlertInner get(String deviceName, String name, String resourceGroupName); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByDataBoxEdgeDevice(String resourceGroupName, String deviceName, Context context); } diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/AvailableSkusClient.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/AvailableSkusClient.java new file mode 100644 index 000000000000..c21587c93807 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/AvailableSkusClient.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.databoxedge.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.databoxedge.fluent.models.DataBoxEdgeSkuListInner; + +/** + * An instance of this class provides access to all the operations defined in AvailableSkusClient. + */ +public interface AvailableSkusClient { + /** + * List all the available Skus and information related to them. + * + * @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 list of SKU Information objects along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listWithResponse(Context context); + + /** + * List all the available Skus and information related to them. + * + * @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 SKU Information objects. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DataBoxEdgeSkuListInner list(); +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/BandwidthSchedulesClient.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/BandwidthSchedulesClient.java index ccd38af81dc2..85d34b76b238 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/BandwidthSchedulesClient.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/BandwidthSchedulesClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.fluent; @@ -17,42 +17,12 @@ * An instance of this class provides access to all the operations defined in BandwidthSchedulesClient. */ public interface BandwidthSchedulesClient { - /** - * Gets all the bandwidth schedules for a Data Box Edge/Data Box Gateway device. - * - * @param deviceName The device name. - * @param resourceGroupName The resource group name. - * @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 all the bandwidth schedules for a Data Box Edge/Data Box Gateway device as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByDataBoxEdgeDevice(String deviceName, String resourceGroupName); - - /** - * Gets all the bandwidth schedules for a Data Box Edge/Data Box Gateway device. - * - * @param deviceName The device name. - * @param resourceGroupName The resource group name. - * @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 all the bandwidth schedules for a Data Box Edge/Data Box Gateway device as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByDataBoxEdgeDevice(String deviceName, String resourceGroupName, - Context context); - /** * Gets the properties of the specified bandwidth schedule. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. * @param name The bandwidth schedule name. - * @param resourceGroupName The resource group name. * @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. @@ -60,29 +30,29 @@ PagedIterable listByDataBoxEdgeDevice(String deviceName, * @return the properties of the specified bandwidth schedule along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String deviceName, String name, String resourceGroupName, + Response getWithResponse(String resourceGroupName, String deviceName, String name, Context context); /** * Gets the properties of the specified bandwidth schedule. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. * @param name The bandwidth schedule name. - * @param resourceGroupName The resource group name. * @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 properties of the specified bandwidth schedule. */ @ServiceMethod(returns = ReturnType.SINGLE) - BandwidthScheduleInner get(String deviceName, String name, String resourceGroupName); + BandwidthScheduleInner get(String resourceGroupName, String deviceName, String name); /** * Creates or updates a bandwidth schedule. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param name The bandwidth schedule name which needs to be added/updated. - * @param resourceGroupName The resource group name. + * @param name The bandwidth schedule name. * @param parameters The bandwidth schedule to be added or updated. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -90,15 +60,15 @@ Response getWithResponse(String deviceName, String name, * @return the {@link SyncPoller} for polling of the bandwidth schedule details. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, BandwidthScheduleInner> beginCreateOrUpdate(String deviceName, - String name, String resourceGroupName, BandwidthScheduleInner parameters); + SyncPoller, BandwidthScheduleInner> beginCreateOrUpdate(String resourceGroupName, + String deviceName, String name, BandwidthScheduleInner parameters); /** * Creates or updates a bandwidth schedule. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param name The bandwidth schedule name which needs to be added/updated. - * @param resourceGroupName The resource group name. + * @param name The bandwidth schedule name. * @param parameters The bandwidth schedule to be added or updated. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -107,15 +77,15 @@ SyncPoller, BandwidthScheduleInner> beginCrea * @return the {@link SyncPoller} for polling of the bandwidth schedule details. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, BandwidthScheduleInner> beginCreateOrUpdate(String deviceName, - String name, String resourceGroupName, BandwidthScheduleInner parameters, Context context); + SyncPoller, BandwidthScheduleInner> beginCreateOrUpdate(String resourceGroupName, + String deviceName, String name, BandwidthScheduleInner parameters, Context context); /** * Creates or updates a bandwidth schedule. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param name The bandwidth schedule name which needs to be added/updated. - * @param resourceGroupName The resource group name. + * @param name The bandwidth schedule name. * @param parameters The bandwidth schedule to be added or updated. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -123,15 +93,15 @@ SyncPoller, BandwidthScheduleInner> beginCrea * @return the bandwidth schedule details. */ @ServiceMethod(returns = ReturnType.SINGLE) - BandwidthScheduleInner createOrUpdate(String deviceName, String name, String resourceGroupName, + BandwidthScheduleInner createOrUpdate(String resourceGroupName, String deviceName, String name, BandwidthScheduleInner parameters); /** * Creates or updates a bandwidth schedule. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param name The bandwidth schedule name which needs to be added/updated. - * @param resourceGroupName The resource group name. + * @param name The bandwidth schedule name. * @param parameters The bandwidth schedule to be added or updated. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -140,29 +110,29 @@ BandwidthScheduleInner createOrUpdate(String deviceName, String name, String res * @return the bandwidth schedule details. */ @ServiceMethod(returns = ReturnType.SINGLE) - BandwidthScheduleInner createOrUpdate(String deviceName, String name, String resourceGroupName, + BandwidthScheduleInner createOrUpdate(String resourceGroupName, String deviceName, String name, BandwidthScheduleInner parameters, Context context); /** * Deletes the specified bandwidth schedule. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. * @param name The bandwidth schedule name. - * @param resourceGroupName The resource group name. * @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 SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDelete(String deviceName, String name, String resourceGroupName); + SyncPoller, Void> beginDelete(String resourceGroupName, String deviceName, String name); /** * Deletes the specified bandwidth schedule. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. * @param name The bandwidth schedule name. - * @param resourceGroupName The resource group name. * @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. @@ -170,33 +140,63 @@ BandwidthScheduleInner createOrUpdate(String deviceName, String name, String res * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDelete(String deviceName, String name, String resourceGroupName, + SyncPoller, Void> beginDelete(String resourceGroupName, String deviceName, String name, Context context); /** * Deletes the specified bandwidth schedule. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. * @param name The bandwidth schedule name. - * @param resourceGroupName The resource group name. * @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 delete(String deviceName, String name, String resourceGroupName); + void delete(String resourceGroupName, String deviceName, String name); /** * Deletes the specified bandwidth schedule. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. * @param name The bandwidth schedule name. - * @param resourceGroupName The resource group name. * @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. */ @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String deviceName, String name, String resourceGroupName, Context context); + void delete(String resourceGroupName, String deviceName, String name, Context context); + + /** + * Gets all the bandwidth schedules for a Data Box Edge/Data Box Gateway device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @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 all the bandwidth schedules for a Data Box Edge/Data Box Gateway device as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByDataBoxEdgeDevice(String resourceGroupName, String deviceName); + + /** + * Gets all the bandwidth schedules for a Data Box Edge/Data Box Gateway device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @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 all the bandwidth schedules for a Data Box Edge/Data Box Gateway device as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByDataBoxEdgeDevice(String resourceGroupName, String deviceName, + Context context); } diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/ContainersClient.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/ContainersClient.java index ad069e054800..9b24feb20e75 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/ContainersClient.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/ContainersClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.fluent; @@ -17,46 +17,13 @@ * An instance of this class provides access to all the operations defined in ContainersClient. */ public interface ContainersClient { - /** - * Lists all the containers of a storage Account in a Data Box Edge/Data Box Gateway device. - * - * @param deviceName The device name. - * @param storageAccountName The storage Account name. - * @param resourceGroupName The resource group name. - * @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 collection of all the containers on the Data Box Edge/Gateway device as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByStorageAccount(String deviceName, String storageAccountName, - String resourceGroupName); - - /** - * Lists all the containers of a storage Account in a Data Box Edge/Data Box Gateway device. - * - * @param deviceName The device name. - * @param storageAccountName The storage Account name. - * @param resourceGroupName The resource group name. - * @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 collection of all the containers on the Data Box Edge/Gateway device as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByStorageAccount(String deviceName, String storageAccountName, - String resourceGroupName, Context context); - /** * Gets a container by name. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param storageAccountName The Storage Account Name. + * @param storageAccountName The storage account name. * @param containerName The container Name. - * @param resourceGroupName The resource group name. * @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. @@ -64,31 +31,31 @@ PagedIterable listByStorageAccount(String deviceName, String sto * @return a container by name along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String deviceName, String storageAccountName, String containerName, - String resourceGroupName, Context context); + Response getWithResponse(String resourceGroupName, String deviceName, String storageAccountName, + String containerName, Context context); /** * Gets a container by name. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param storageAccountName The Storage Account Name. + * @param storageAccountName The storage account name. * @param containerName The container Name. - * @param resourceGroupName The resource group name. * @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 a container by name. */ @ServiceMethod(returns = ReturnType.SINGLE) - ContainerInner get(String deviceName, String storageAccountName, String containerName, String resourceGroupName); + ContainerInner get(String resourceGroupName, String deviceName, String storageAccountName, String containerName); /** * Creates a new container or updates an existing container on the device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param storageAccountName The Storage Account Name. - * @param containerName The container name. - * @param resourceGroupName The resource group name. + * @param storageAccountName The storage account name. + * @param containerName The container Name. * @param container The container properties. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -96,16 +63,16 @@ Response getWithResponse(String deviceName, String storageAccoun * @return the {@link SyncPoller} for polling of represents a container on the Data Box Edge/Gateway device. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, ContainerInner> beginCreateOrUpdate(String deviceName, - String storageAccountName, String containerName, String resourceGroupName, ContainerInner container); + SyncPoller, ContainerInner> beginCreateOrUpdate(String resourceGroupName, + String deviceName, String storageAccountName, String containerName, ContainerInner container); /** * Creates a new container or updates an existing container on the device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param storageAccountName The Storage Account Name. - * @param containerName The container name. - * @param resourceGroupName The resource group name. + * @param storageAccountName The storage account name. + * @param containerName The container Name. * @param container The container properties. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -114,17 +81,16 @@ SyncPoller, ContainerInner> beginCreateOrUpdate(Strin * @return the {@link SyncPoller} for polling of represents a container on the Data Box Edge/Gateway device. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, ContainerInner> beginCreateOrUpdate(String deviceName, - String storageAccountName, String containerName, String resourceGroupName, ContainerInner container, - Context context); + SyncPoller, ContainerInner> beginCreateOrUpdate(String resourceGroupName, + String deviceName, String storageAccountName, String containerName, ContainerInner container, Context context); /** * Creates a new container or updates an existing container on the device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param storageAccountName The Storage Account Name. - * @param containerName The container name. - * @param resourceGroupName The resource group name. + * @param storageAccountName The storage account name. + * @param containerName The container Name. * @param container The container properties. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -132,16 +98,16 @@ SyncPoller, ContainerInner> beginCreateOrUpdate(Strin * @return represents a container on the Data Box Edge/Gateway device. */ @ServiceMethod(returns = ReturnType.SINGLE) - ContainerInner createOrUpdate(String deviceName, String storageAccountName, String containerName, - String resourceGroupName, ContainerInner container); + ContainerInner createOrUpdate(String resourceGroupName, String deviceName, String storageAccountName, + String containerName, ContainerInner container); /** * Creates a new container or updates an existing container on the device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param storageAccountName The Storage Account Name. - * @param containerName The container name. - * @param resourceGroupName The resource group name. + * @param storageAccountName The storage account name. + * @param containerName The container Name. * @param container The container properties. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -150,32 +116,32 @@ ContainerInner createOrUpdate(String deviceName, String storageAccountName, Stri * @return represents a container on the Data Box Edge/Gateway device. */ @ServiceMethod(returns = ReturnType.SINGLE) - ContainerInner createOrUpdate(String deviceName, String storageAccountName, String containerName, - String resourceGroupName, ContainerInner container, Context context); + ContainerInner createOrUpdate(String resourceGroupName, String deviceName, String storageAccountName, + String containerName, ContainerInner container, Context context); /** * Deletes the container on the Data Box Edge/Data Box Gateway device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param storageAccountName The Storage Account Name. - * @param containerName The container name. - * @param resourceGroupName The resource group name. + * @param storageAccountName The storage account name. + * @param containerName The container Name. * @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 SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDelete(String deviceName, String storageAccountName, String containerName, - String resourceGroupName); + SyncPoller, Void> beginDelete(String resourceGroupName, String deviceName, + String storageAccountName, String containerName); /** * Deletes the container on the Data Box Edge/Data Box Gateway device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param storageAccountName The Storage Account Name. - * @param containerName The container name. - * @param resourceGroupName The resource group name. + * @param storageAccountName The storage account name. + * @param containerName The container Name. * @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. @@ -183,62 +149,95 @@ SyncPoller, Void> beginDelete(String deviceName, String storage * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDelete(String deviceName, String storageAccountName, String containerName, - String resourceGroupName, Context context); + SyncPoller, Void> beginDelete(String resourceGroupName, String deviceName, + String storageAccountName, String containerName, Context context); /** * Deletes the container on the Data Box Edge/Data Box Gateway device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param storageAccountName The Storage Account Name. - * @param containerName The container name. - * @param resourceGroupName The resource group name. + * @param storageAccountName The storage account name. + * @param containerName The container Name. * @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 delete(String deviceName, String storageAccountName, String containerName, String resourceGroupName); + void delete(String resourceGroupName, String deviceName, String storageAccountName, String containerName); /** * Deletes the container on the Data Box Edge/Data Box Gateway device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param storageAccountName The Storage Account Name. - * @param containerName The container name. - * @param resourceGroupName The resource group name. + * @param storageAccountName The storage account name. + * @param containerName The container Name. * @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. */ @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String deviceName, String storageAccountName, String containerName, String resourceGroupName, + void delete(String resourceGroupName, String deviceName, String storageAccountName, String containerName, Context context); + /** + * Lists all the containers of a storage Account in a Data Box Edge/Data Box Gateway device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @param storageAccountName The storage account name. + * @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 collection of all the containers on the Data Box Edge/Gateway device as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByStorageAccount(String resourceGroupName, String deviceName, + String storageAccountName); + + /** + * Lists all the containers of a storage Account in a Data Box Edge/Data Box Gateway device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @param storageAccountName The storage account name. + * @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 collection of all the containers on the Data Box Edge/Gateway device as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByStorageAccount(String resourceGroupName, String deviceName, + String storageAccountName, Context context); + /** * Refreshes the container metadata with the data from the cloud. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param storageAccountName The Storage Account Name. - * @param containerName The container name. - * @param resourceGroupName The resource group name. + * @param storageAccountName The storage account name. + * @param containerName The container Name. * @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 SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginRefresh(String deviceName, String storageAccountName, String containerName, - String resourceGroupName); + SyncPoller, Void> beginRefresh(String resourceGroupName, String deviceName, + String storageAccountName, String containerName); /** * Refreshes the container metadata with the data from the cloud. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param storageAccountName The Storage Account Name. - * @param containerName The container name. - * @param resourceGroupName The resource group name. + * @param storageAccountName The storage account name. + * @param containerName The container Name. * @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. @@ -246,36 +245,36 @@ SyncPoller, Void> beginRefresh(String deviceName, String storag * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginRefresh(String deviceName, String storageAccountName, String containerName, - String resourceGroupName, Context context); + SyncPoller, Void> beginRefresh(String resourceGroupName, String deviceName, + String storageAccountName, String containerName, Context context); /** * Refreshes the container metadata with the data from the cloud. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param storageAccountName The Storage Account Name. - * @param containerName The container name. - * @param resourceGroupName The resource group name. + * @param storageAccountName The storage account name. + * @param containerName The container Name. * @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 refresh(String deviceName, String storageAccountName, String containerName, String resourceGroupName); + void refresh(String resourceGroupName, String deviceName, String storageAccountName, String containerName); /** * Refreshes the container metadata with the data from the cloud. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param storageAccountName The Storage Account Name. - * @param containerName The container name. - * @param resourceGroupName The resource group name. + * @param storageAccountName The storage account name. + * @param containerName The container Name. * @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. */ @ServiceMethod(returns = ReturnType.SINGLE) - void refresh(String deviceName, String storageAccountName, String containerName, String resourceGroupName, + void refresh(String resourceGroupName, String deviceName, String storageAccountName, String containerName, Context context); } diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/DataBoxEdgeManagementClient.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/DataBoxEdgeManagementClient.java index cd856a6c9dc8..b41e51494a00 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/DataBoxEdgeManagementClient.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/DataBoxEdgeManagementClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.fluent; @@ -12,26 +12,26 @@ */ public interface DataBoxEdgeManagementClient { /** - * Gets The subscription ID. - * - * @return the subscriptionId value. - */ - String getSubscriptionId(); - - /** - * Gets server parameter. + * Gets Service host. * * @return the endpoint value. */ String getEndpoint(); /** - * Gets Api Version. + * Gets Version parameter. * * @return the apiVersion value. */ String getApiVersion(); + /** + * Gets The ID of the target subscription. The value must be an UUID. + * + * @return the subscriptionId value. + */ + String getSubscriptionId(); + /** * Gets The HTTP pipeline to send requests through. * @@ -75,18 +75,18 @@ public interface DataBoxEdgeManagementClient { BandwidthSchedulesClient getBandwidthSchedules(); /** - * Gets the JobsClient object to access its operations. + * Gets the DiagnosticSettingsClient object to access its operations. * - * @return the JobsClient object. + * @return the DiagnosticSettingsClient object. */ - JobsClient getJobs(); + DiagnosticSettingsClient getDiagnosticSettings(); /** - * Gets the NodesClient object to access its operations. + * Gets the JobsClient object to access its operations. * - * @return the NodesClient object. + * @return the JobsClient object. */ - NodesClient getNodes(); + JobsClient getJobs(); /** * Gets the OperationsStatusClient object to access its operations. @@ -109,6 +109,13 @@ public interface DataBoxEdgeManagementClient { */ RolesClient getRoles(); + /** + * Gets the AddonsClient object to access its operations. + * + * @return the AddonsClient object. + */ + AddonsClient getAddons(); + /** * Gets the SharesClient object to access its operations. * @@ -152,9 +159,44 @@ public interface DataBoxEdgeManagementClient { UsersClient getUsers(); /** - * Gets the SkusClient object to access its operations. + * Gets the DeviceCapacityChecksClient object to access its operations. + * + * @return the DeviceCapacityChecksClient object. + */ + DeviceCapacityChecksClient getDeviceCapacityChecks(); + + /** + * Gets the NodesClient object to access its operations. + * + * @return the NodesClient object. + */ + NodesClient getNodes(); + + /** + * Gets the SupportPackagesClient object to access its operations. + * + * @return the SupportPackagesClient object. + */ + SupportPackagesClient getSupportPackages(); + + /** + * Gets the DeviceCapacityInfoesClient object to access its operations. + * + * @return the DeviceCapacityInfoesClient object. + */ + DeviceCapacityInfoesClient getDeviceCapacityInfoes(); + + /** + * Gets the MonitoringConfigsClient object to access its operations. + * + * @return the MonitoringConfigsClient object. + */ + MonitoringConfigsClient getMonitoringConfigs(); + + /** + * Gets the AvailableSkusClient object to access its operations. * - * @return the SkusClient object. + * @return the AvailableSkusClient object. */ - SkusClient getSkus(); + AvailableSkusClient getAvailableSkus(); } diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/DeviceCapacityChecksClient.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/DeviceCapacityChecksClient.java new file mode 100644 index 000000000000..e76bc1ebb688 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/DeviceCapacityChecksClient.java @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.databoxedge.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.databoxedge.models.DeviceCapacityRequestInfo; + +/** + * An instance of this class provides access to all the operations defined in DeviceCapacityChecksClient. + */ +public interface DeviceCapacityChecksClient { + /** + * Posts the device capacity request info to check feasibility. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @param deviceCapacityRequestInfo The device capacity request info. + * @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 SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginCheckResourceCreationFeasibility(String resourceGroupName, + String deviceName, DeviceCapacityRequestInfo deviceCapacityRequestInfo); + + /** + * Posts the device capacity request info to check feasibility. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @param deviceCapacityRequestInfo The device capacity request info. + * @param capacityName The capacity name. + * @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 SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginCheckResourceCreationFeasibility(String resourceGroupName, + String deviceName, DeviceCapacityRequestInfo deviceCapacityRequestInfo, String capacityName, Context context); + + /** + * Posts the device capacity request info to check feasibility. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @param deviceCapacityRequestInfo The device capacity request info. + * @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 checkResourceCreationFeasibility(String resourceGroupName, String deviceName, + DeviceCapacityRequestInfo deviceCapacityRequestInfo); + + /** + * Posts the device capacity request info to check feasibility. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @param deviceCapacityRequestInfo The device capacity request info. + * @param capacityName The capacity name. + * @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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void checkResourceCreationFeasibility(String resourceGroupName, String deviceName, + DeviceCapacityRequestInfo deviceCapacityRequestInfo, String capacityName, Context context); +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/DeviceCapacityInfoesClient.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/DeviceCapacityInfoesClient.java new file mode 100644 index 000000000000..a9f03412b405 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/DeviceCapacityInfoesClient.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.databoxedge.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.databoxedge.fluent.models.DeviceCapacityInfoInner; + +/** + * An instance of this class provides access to all the operations defined in DeviceCapacityInfoesClient. + */ +public interface DeviceCapacityInfoesClient { + /** + * Gets the properties of the specified device capacity info. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @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 properties of the specified device capacity info along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getDeviceCapacityInfoWithResponse(String resourceGroupName, String deviceName, + Context context); + + /** + * Gets the properties of the specified device capacity info. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @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 properties of the specified device capacity info. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DeviceCapacityInfoInner getDeviceCapacityInfo(String resourceGroupName, String deviceName); +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/DevicesClient.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/DevicesClient.java index 7927c5b564bf..d6dbc53c655d 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/DevicesClient.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/DevicesClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.fluent; @@ -13,9 +13,11 @@ import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.databoxedge.fluent.models.DataBoxEdgeDeviceExtendedInfoInner; import com.azure.resourcemanager.databoxedge.fluent.models.DataBoxEdgeDeviceInner; +import com.azure.resourcemanager.databoxedge.fluent.models.GenerateCertResponseInner; import com.azure.resourcemanager.databoxedge.fluent.models.NetworkSettingsInner; import com.azure.resourcemanager.databoxedge.fluent.models.UpdateSummaryInner; import com.azure.resourcemanager.databoxedge.fluent.models.UploadCertificateResponseInner; +import com.azure.resourcemanager.databoxedge.models.DataBoxEdgeDeviceExtendedInfoPatch; import com.azure.resourcemanager.databoxedge.models.DataBoxEdgeDevicePatch; import com.azure.resourcemanager.databoxedge.models.SecuritySettings; import com.azure.resourcemanager.databoxedge.models.UploadCertificateRequest; @@ -25,64 +27,37 @@ */ public interface DevicesClient { /** - * Gets all the Data Box Edge/Data Box Gateway devices in a subscription. - * - * @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 all the Data Box Edge/Data Box Gateway devices in a subscription as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); - - /** - * Gets all the Data Box Edge/Data Box Gateway devices in a subscription. + * Gets the network settings of the specified Data Box Edge/Data Box Gateway device. * - * @param expand Specify $expand=details to populate additional fields related to the resource or Specify - * $skipToken=<token> to populate the next page in the list. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. * @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 all the Data Box Edge/Data Box Gateway devices in a subscription as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String expand, Context context); - - /** - * Gets all the Data Box Edge/Data Box Gateway devices in a resource group. - * - * @param resourceGroupName The resource group name. - * @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 all the Data Box Edge/Data Box Gateway devices in a resource group as paginated response with - * {@link PagedIterable}. + * @return the network settings of the specified Data Box Edge/Data Box Gateway device along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName); + @ServiceMethod(returns = ReturnType.SINGLE) + Response getNetworkSettingsWithResponse(String resourceGroupName, String deviceName, + Context context); /** - * Gets all the Data Box Edge/Data Box Gateway devices in a resource group. + * Gets the network settings of the specified Data Box Edge/Data Box Gateway device. * - * @param resourceGroupName The resource group name. - * @param expand Specify $expand=details to populate additional fields related to the resource or Specify - * $skipToken=<token> to populate the next page in the list. - * @param context The context to associate with this operation. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. * @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 all the Data Box Edge/Data Box Gateway devices in a resource group as paginated response with - * {@link PagedIterable}. + * @return the network settings of the specified Data Box Edge/Data Box Gateway device. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName, String expand, Context context); + @ServiceMethod(returns = ReturnType.SINGLE) + NetworkSettingsInner getNetworkSettings(String resourceGroupName, String deviceName); /** * Gets the properties of the Data Box Edge/Data Box Gateway device. * - * @param resourceGroupName The resource group name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -97,7 +72,7 @@ Response getByResourceGroupWithResponse(String resourceG /** * Gets the properties of the Data Box Edge/Data Box Gateway device. * - * @param resourceGroupName The resource group name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -110,69 +85,68 @@ Response getByResourceGroupWithResponse(String resourceG /** * Creates or updates a Data Box Edge/Data Box Gateway resource. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param resourceGroupName The resource group name. * @param dataBoxEdgeDevice The resource object. + * @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 SyncPoller} for polling of the Data Box Edge/Gateway device. + * @return the Data Box Edge/Gateway device along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, DataBoxEdgeDeviceInner> beginCreateOrUpdate(String deviceName, - String resourceGroupName, DataBoxEdgeDeviceInner dataBoxEdgeDevice); + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateWithResponse(String resourceGroupName, String deviceName, + DataBoxEdgeDeviceInner dataBoxEdgeDevice, Context context); /** * Creates or updates a Data Box Edge/Data Box Gateway resource. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param resourceGroupName The resource group name. * @param dataBoxEdgeDevice The resource object. - * @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 SyncPoller} for polling of the Data Box Edge/Gateway device. + * @return the Data Box Edge/Gateway device. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, DataBoxEdgeDeviceInner> beginCreateOrUpdate(String deviceName, - String resourceGroupName, DataBoxEdgeDeviceInner dataBoxEdgeDevice, Context context); + @ServiceMethod(returns = ReturnType.SINGLE) + DataBoxEdgeDeviceInner createOrUpdate(String resourceGroupName, String deviceName, + DataBoxEdgeDeviceInner dataBoxEdgeDevice); /** - * Creates or updates a Data Box Edge/Data Box Gateway resource. + * Modifies a Data Box Edge/Data Box Gateway resource. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param resourceGroupName The resource group name. - * @param dataBoxEdgeDevice The resource object. + * @param parameters The resource parameters. + * @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 Data Box Edge/Gateway device. + * @return the Data Box Edge/Gateway device along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - DataBoxEdgeDeviceInner createOrUpdate(String deviceName, String resourceGroupName, - DataBoxEdgeDeviceInner dataBoxEdgeDevice); + Response updateWithResponse(String resourceGroupName, String deviceName, + DataBoxEdgeDevicePatch parameters, Context context); /** - * Creates or updates a Data Box Edge/Data Box Gateway resource. + * Modifies a Data Box Edge/Data Box Gateway resource. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param resourceGroupName The resource group name. - * @param dataBoxEdgeDevice The resource object. - * @param context The context to associate with this operation. + * @param parameters The resource parameters. * @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 Data Box Edge/Gateway device. */ @ServiceMethod(returns = ReturnType.SINGLE) - DataBoxEdgeDeviceInner createOrUpdate(String deviceName, String resourceGroupName, - DataBoxEdgeDeviceInner dataBoxEdgeDevice, Context context); + DataBoxEdgeDeviceInner update(String resourceGroupName, String deviceName, DataBoxEdgeDevicePatch parameters); /** * Deletes the Data Box Edge/Data Box Gateway device. * - * @param resourceGroupName The resource group name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -185,7 +159,7 @@ DataBoxEdgeDeviceInner createOrUpdate(String deviceName, String resourceGroupNam /** * Deletes the Data Box Edge/Data Box Gateway device. * - * @param resourceGroupName The resource group name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -199,7 +173,7 @@ DataBoxEdgeDeviceInner createOrUpdate(String deviceName, String resourceGroupNam /** * Deletes the Data Box Edge/Data Box Gateway device. * - * @param resourceGroupName The resource group name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -211,7 +185,7 @@ DataBoxEdgeDeviceInner createOrUpdate(String deviceName, String resourceGroupNam /** * Deletes the Data Box Edge/Data Box Gateway device. * - * @param resourceGroupName The resource group name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -222,53 +196,78 @@ DataBoxEdgeDeviceInner createOrUpdate(String deviceName, String resourceGroupNam void delete(String resourceGroupName, String deviceName, Context context); /** - * Modifies a Data Box Edge/Data Box Gateway resource. + * Gets all the Data Box Edge/Data Box Gateway devices in a resource group. * - * @param deviceName The device name. - * @param resourceGroupName The resource group name. - * @param parameters The resource parameters. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 all the Data Box Edge/Data Box Gateway devices in a resource group as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Gets all the Data Box Edge/Data Box Gateway devices in a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param expand Specify $expand=details to populate additional fields related to the resource or Specify + * $skipToken=<token> to populate the next page in the list. * @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 Data Box Edge/Gateway device along with {@link Response}. + * @return all the Data Box Edge/Data Box Gateway devices in a resource group as paginated response with + * {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response updateWithResponse(String deviceName, String resourceGroupName, - DataBoxEdgeDevicePatch parameters, Context context); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, String expand, Context context); /** - * Modifies a Data Box Edge/Data Box Gateway resource. + * Gets all the Data Box Edge/Data Box Gateway devices in a subscription. * - * @param deviceName The device name. - * @param resourceGroupName The resource group name. - * @param parameters The resource parameters. + * @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 all the Data Box Edge/Data Box Gateway devices in a subscription as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Gets all the Data Box Edge/Data Box Gateway devices in a subscription. + * + * @param expand Specify $expand=details to populate additional fields related to the resource or Specify + * $skipToken=<token> to populate the next page in the list. + * @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 Data Box Edge/Gateway device. + * @return all the Data Box Edge/Data Box Gateway devices in a subscription as paginated response with + * {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - DataBoxEdgeDeviceInner update(String deviceName, String resourceGroupName, DataBoxEdgeDevicePatch parameters); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String expand, Context context); /** * Downloads the updates on a Data Box Edge/Data Box Gateway device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param resourceGroupName The resource group name. * @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 SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDownloadUpdates(String deviceName, String resourceGroupName); + SyncPoller, Void> beginDownloadUpdates(String resourceGroupName, String deviceName); /** * Downloads the updates on a Data Box Edge/Data Box Gateway device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param resourceGroupName The resource group name. * @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. @@ -276,162 +275,162 @@ Response updateWithResponse(String deviceName, String re * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDownloadUpdates(String deviceName, String resourceGroupName, + SyncPoller, Void> beginDownloadUpdates(String resourceGroupName, String deviceName, Context context); /** * Downloads the updates on a Data Box Edge/Data Box Gateway device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param resourceGroupName The resource group name. * @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 downloadUpdates(String deviceName, String resourceGroupName); + void downloadUpdates(String resourceGroupName, String deviceName); /** * Downloads the updates on a Data Box Edge/Data Box Gateway device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param resourceGroupName The resource group name. * @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. */ @ServiceMethod(returns = ReturnType.SINGLE) - void downloadUpdates(String deviceName, String resourceGroupName, Context context); + void downloadUpdates(String resourceGroupName, String deviceName, Context context); /** - * Gets additional information for the specified Data Box Edge/Data Box Gateway device. + * Generates certificate for activation key. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param resourceGroupName The resource group name. * @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 additional information for the specified Data Box Edge/Data Box Gateway device along with - * {@link Response}. + * @return used in activation key generation flow along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getExtendedInformationWithResponse(String deviceName, - String resourceGroupName, Context context); + Response generateCertificateWithResponse(String resourceGroupName, String deviceName, + Context context); /** - * Gets additional information for the specified Data Box Edge/Data Box Gateway device. + * Generates certificate for activation key. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param resourceGroupName The resource group name. * @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 additional information for the specified Data Box Edge/Data Box Gateway device. + * @return used in activation key generation flow. */ @ServiceMethod(returns = ReturnType.SINGLE) - DataBoxEdgeDeviceExtendedInfoInner getExtendedInformation(String deviceName, String resourceGroupName); + GenerateCertResponseInner generateCertificate(String resourceGroupName, String deviceName); /** - * Installs the updates on the Data Box Edge/Data Box Gateway device. + * Gets additional information for the specified Azure Stack Edge/Data Box Gateway device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param resourceGroupName The resource group name. + * @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 SyncPoller} for polling of long-running operation. + * @return additional information for the specified Azure Stack Edge/Data Box Gateway device along with + * {@link Response}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginInstallUpdates(String deviceName, String resourceGroupName); + @ServiceMethod(returns = ReturnType.SINGLE) + Response getExtendedInformationWithResponse(String resourceGroupName, + String deviceName, Context context); /** - * Installs the updates on the Data Box Edge/Data Box Gateway device. + * Gets additional information for the specified Azure Stack Edge/Data Box Gateway device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param resourceGroupName The resource group name. - * @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 SyncPoller} for polling of long-running operation. + * @return additional information for the specified Azure Stack Edge/Data Box Gateway device. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginInstallUpdates(String deviceName, String resourceGroupName, - Context context); + @ServiceMethod(returns = ReturnType.SINGLE) + DataBoxEdgeDeviceExtendedInfoInner getExtendedInformation(String resourceGroupName, String deviceName); /** * Installs the updates on the Data Box Edge/Data Box Gateway device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param resourceGroupName The resource group name. * @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 SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) - void installUpdates(String deviceName, String resourceGroupName); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginInstallUpdates(String resourceGroupName, String deviceName); /** * Installs the updates on the Data Box Edge/Data Box Gateway device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param resourceGroupName The resource group name. * @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 SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) - void installUpdates(String deviceName, String resourceGroupName, Context context); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginInstallUpdates(String resourceGroupName, String deviceName, + Context context); /** - * Gets the network settings of the specified Data Box Edge/Data Box Gateway device. + * Installs the updates on the Data Box Edge/Data Box Gateway device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param resourceGroupName The resource group name. - * @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 network settings of the specified Data Box Edge/Data Box Gateway device along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getNetworkSettingsWithResponse(String deviceName, String resourceGroupName, - Context context); + void installUpdates(String resourceGroupName, String deviceName); /** - * Gets the network settings of the specified Data Box Edge/Data Box Gateway device. + * Installs the updates on the Data Box Edge/Data Box Gateway device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param resourceGroupName The resource group name. + * @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 network settings of the specified Data Box Edge/Data Box Gateway device. */ @ServiceMethod(returns = ReturnType.SINGLE) - NetworkSettingsInner getNetworkSettings(String deviceName, String resourceGroupName); + void installUpdates(String resourceGroupName, String deviceName, Context context); /** * Scans for updates on a Data Box Edge/Data Box Gateway device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param resourceGroupName The resource group name. * @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 SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginScanForUpdates(String deviceName, String resourceGroupName); + SyncPoller, Void> beginScanForUpdates(String resourceGroupName, String deviceName); /** * Scans for updates on a Data Box Edge/Data Box Gateway device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param resourceGroupName The resource group name. * @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. @@ -439,39 +438,39 @@ Response getNetworkSettingsWithResponse(String deviceName, * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginScanForUpdates(String deviceName, String resourceGroupName, + SyncPoller, Void> beginScanForUpdates(String resourceGroupName, String deviceName, Context context); /** * Scans for updates on a Data Box Edge/Data Box Gateway device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param resourceGroupName The resource group name. * @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 scanForUpdates(String deviceName, String resourceGroupName); + void scanForUpdates(String resourceGroupName, String deviceName); /** * Scans for updates on a Data Box Edge/Data Box Gateway device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param resourceGroupName The resource group name. * @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. */ @ServiceMethod(returns = ReturnType.SINGLE) - void scanForUpdates(String deviceName, String resourceGroupName, Context context); + void scanForUpdates(String resourceGroupName, String deviceName, Context context); /** * Updates the security settings on a Data Box Edge/Data Box Gateway device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param resourceGroupName The resource group name. * @param securitySettings The security settings. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -479,14 +478,14 @@ SyncPoller, Void> beginScanForUpdates(String deviceName, String * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginCreateOrUpdateSecuritySettings(String deviceName, String resourceGroupName, + SyncPoller, Void> beginCreateOrUpdateSecuritySettings(String resourceGroupName, String deviceName, SecuritySettings securitySettings); /** * Updates the security settings on a Data Box Edge/Data Box Gateway device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param resourceGroupName The resource group name. * @param securitySettings The security settings. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -495,27 +494,27 @@ SyncPoller, Void> beginCreateOrUpdateSecuritySettings(String de * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginCreateOrUpdateSecuritySettings(String deviceName, String resourceGroupName, + SyncPoller, Void> beginCreateOrUpdateSecuritySettings(String resourceGroupName, String deviceName, SecuritySettings securitySettings, Context context); /** * Updates the security settings on a Data Box Edge/Data Box Gateway device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param resourceGroupName The resource group name. * @param securitySettings The security settings. * @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 createOrUpdateSecuritySettings(String deviceName, String resourceGroupName, SecuritySettings securitySettings); + void createOrUpdateSecuritySettings(String resourceGroupName, String deviceName, SecuritySettings securitySettings); /** * Updates the security settings on a Data Box Edge/Data Box Gateway device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param resourceGroupName The resource group name. * @param securitySettings The security settings. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -523,45 +522,46 @@ SyncPoller, Void> beginCreateOrUpdateSecuritySettings(String de * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ @ServiceMethod(returns = ReturnType.SINGLE) - void createOrUpdateSecuritySettings(String deviceName, String resourceGroupName, SecuritySettings securitySettings, + void createOrUpdateSecuritySettings(String resourceGroupName, String deviceName, SecuritySettings securitySettings, Context context); /** - * Gets information about the availability of updates based on the last scan of the device. It also gets information - * about any ongoing download or install jobs on the device. + * Gets additional information for the specified Data Box Edge/Data Box Gateway device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param resourceGroupName The resource group name. + * @param parameters The patch object. * @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 availability of updates based on the last scan of the device along with + * @return additional information for the specified Data Box Edge/Data Box Gateway device along with * {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getUpdateSummaryWithResponse(String deviceName, String resourceGroupName, - Context context); + Response updateExtendedInformationWithResponse(String resourceGroupName, + String deviceName, DataBoxEdgeDeviceExtendedInfoPatch parameters, Context context); /** - * Gets information about the availability of updates based on the last scan of the device. It also gets information - * about any ongoing download or install jobs on the device. + * Gets additional information for the specified Data Box Edge/Data Box Gateway device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param resourceGroupName The resource group name. + * @param parameters The patch object. * @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 availability of updates based on the last scan of the device. + * @return additional information for the specified Data Box Edge/Data Box Gateway device. */ @ServiceMethod(returns = ReturnType.SINGLE) - UpdateSummaryInner getUpdateSummary(String deviceName, String resourceGroupName); + DataBoxEdgeDeviceExtendedInfoInner updateExtendedInformation(String resourceGroupName, String deviceName, + DataBoxEdgeDeviceExtendedInfoPatch parameters); /** * Uploads registration certificate for the device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param resourceGroupName The resource group name. * @param parameters The upload certificate request. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -570,14 +570,14 @@ Response getUpdateSummaryWithResponse(String deviceName, Str * @return the upload registration certificate response along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response uploadCertificateWithResponse(String deviceName, String resourceGroupName, + Response uploadCertificateWithResponse(String resourceGroupName, String deviceName, UploadCertificateRequest parameters, Context context); /** * Uploads registration certificate for the device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param resourceGroupName The resource group name. * @param parameters The upload certificate request. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -585,6 +585,37 @@ Response uploadCertificateWithResponse(String de * @return the upload registration certificate response. */ @ServiceMethod(returns = ReturnType.SINGLE) - UploadCertificateResponseInner uploadCertificate(String deviceName, String resourceGroupName, + UploadCertificateResponseInner uploadCertificate(String resourceGroupName, String deviceName, UploadCertificateRequest parameters); + + /** + * Gets information about the availability of updates based on the last scan of the device. It also gets information + * about any ongoing download or install jobs on the device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @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 availability of updates based on the last scan of the device along with + * {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getUpdateSummaryWithResponse(String resourceGroupName, String deviceName, + Context context); + + /** + * Gets information about the availability of updates based on the last scan of the device. It also gets information + * about any ongoing download or install jobs on the device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @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 availability of updates based on the last scan of the device. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + UpdateSummaryInner getUpdateSummary(String resourceGroupName, String deviceName); } diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/DiagnosticSettingsClient.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/DiagnosticSettingsClient.java new file mode 100644 index 000000000000..c2e73a668f59 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/DiagnosticSettingsClient.java @@ -0,0 +1,209 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.databoxedge.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.databoxedge.fluent.models.DiagnosticProactiveLogCollectionSettingsInner; +import com.azure.resourcemanager.databoxedge.fluent.models.DiagnosticRemoteSupportSettingsInner; + +/** + * An instance of this class provides access to all the operations defined in DiagnosticSettingsClient. + */ +public interface DiagnosticSettingsClient { + /** + * Gets the proactive log collection settings of the specified Data Box Edge/Data Box Gateway device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @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 proactive log collection settings of the specified Data Box Edge/Data Box Gateway device along with + * {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getDiagnosticProactiveLogCollectionSettingsWithResponse( + String resourceGroupName, String deviceName, Context context); + + /** + * Gets the proactive log collection settings of the specified Data Box Edge/Data Box Gateway device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @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 proactive log collection settings of the specified Data Box Edge/Data Box Gateway device. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DiagnosticProactiveLogCollectionSettingsInner getDiagnosticProactiveLogCollectionSettings(String resourceGroupName, + String deviceName); + + /** + * Updates the proactive log collection settings on a Data Box Edge/Data Box Gateway device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @param proactiveLogCollectionSettings The proactive log collection settings. + * @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 SyncPoller} for polling of the diagnostic proactive log collection settings of a device. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, DiagnosticProactiveLogCollectionSettingsInner> + beginUpdateDiagnosticProactiveLogCollectionSettings(String resourceGroupName, String deviceName, + DiagnosticProactiveLogCollectionSettingsInner proactiveLogCollectionSettings); + + /** + * Updates the proactive log collection settings on a Data Box Edge/Data Box Gateway device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @param proactiveLogCollectionSettings The proactive log collection settings. + * @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 SyncPoller} for polling of the diagnostic proactive log collection settings of a device. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, DiagnosticProactiveLogCollectionSettingsInner> + beginUpdateDiagnosticProactiveLogCollectionSettings(String resourceGroupName, String deviceName, + DiagnosticProactiveLogCollectionSettingsInner proactiveLogCollectionSettings, Context context); + + /** + * Updates the proactive log collection settings on a Data Box Edge/Data Box Gateway device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @param proactiveLogCollectionSettings The proactive log collection settings. + * @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 diagnostic proactive log collection settings of a device. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DiagnosticProactiveLogCollectionSettingsInner updateDiagnosticProactiveLogCollectionSettings( + String resourceGroupName, String deviceName, + DiagnosticProactiveLogCollectionSettingsInner proactiveLogCollectionSettings); + + /** + * Updates the proactive log collection settings on a Data Box Edge/Data Box Gateway device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @param proactiveLogCollectionSettings The proactive log collection settings. + * @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 diagnostic proactive log collection settings of a device. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DiagnosticProactiveLogCollectionSettingsInner updateDiagnosticProactiveLogCollectionSettings( + String resourceGroupName, String deviceName, + DiagnosticProactiveLogCollectionSettingsInner proactiveLogCollectionSettings, Context context); + + /** + * Gets the diagnostic remote support settings of the specified Data Box Edge/Data Box Gateway device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @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 diagnostic remote support settings of the specified Data Box Edge/Data Box Gateway device along with + * {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response + getDiagnosticRemoteSupportSettingsWithResponse(String resourceGroupName, String deviceName, Context context); + + /** + * Gets the diagnostic remote support settings of the specified Data Box Edge/Data Box Gateway device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @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 diagnostic remote support settings of the specified Data Box Edge/Data Box Gateway device. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DiagnosticRemoteSupportSettingsInner getDiagnosticRemoteSupportSettings(String resourceGroupName, + String deviceName); + + /** + * Updates the diagnostic remote support settings on a Data Box Edge/Data Box Gateway device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @param diagnosticRemoteSupportSettings The diagnostic remote support settings. + * @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 SyncPoller} for polling of the remote support settings of a device. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, DiagnosticRemoteSupportSettingsInner> + beginUpdateDiagnosticRemoteSupportSettings(String resourceGroupName, String deviceName, + DiagnosticRemoteSupportSettingsInner diagnosticRemoteSupportSettings); + + /** + * Updates the diagnostic remote support settings on a Data Box Edge/Data Box Gateway device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @param diagnosticRemoteSupportSettings The diagnostic remote support settings. + * @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 SyncPoller} for polling of the remote support settings of a device. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, DiagnosticRemoteSupportSettingsInner> + beginUpdateDiagnosticRemoteSupportSettings(String resourceGroupName, String deviceName, + DiagnosticRemoteSupportSettingsInner diagnosticRemoteSupportSettings, Context context); + + /** + * Updates the diagnostic remote support settings on a Data Box Edge/Data Box Gateway device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @param diagnosticRemoteSupportSettings The diagnostic remote support settings. + * @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 remote support settings of a device. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DiagnosticRemoteSupportSettingsInner updateDiagnosticRemoteSupportSettings(String resourceGroupName, + String deviceName, DiagnosticRemoteSupportSettingsInner diagnosticRemoteSupportSettings); + + /** + * Updates the diagnostic remote support settings on a Data Box Edge/Data Box Gateway device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @param diagnosticRemoteSupportSettings The diagnostic remote support settings. + * @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 remote support settings of a device. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DiagnosticRemoteSupportSettingsInner updateDiagnosticRemoteSupportSettings(String resourceGroupName, + String deviceName, DiagnosticRemoteSupportSettingsInner diagnosticRemoteSupportSettings, Context context); +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/JobsClient.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/JobsClient.java index 37493880ff06..66a13d042c0c 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/JobsClient.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/JobsClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.fluent; @@ -17,9 +17,9 @@ public interface JobsClient { /** * Gets the details of a specified job on a Data Box Edge/Data Box Gateway device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. * @param name The job name. - * @param resourceGroupName The resource group name. * @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. @@ -27,19 +27,19 @@ public interface JobsClient { * @return the details of a specified job on a Data Box Edge/Data Box Gateway device along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String deviceName, String name, String resourceGroupName, Context context); + Response getWithResponse(String resourceGroupName, String deviceName, String name, Context context); /** * Gets the details of a specified job on a Data Box Edge/Data Box Gateway device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. * @param name The job name. - * @param resourceGroupName The resource group name. * @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 details of a specified job on a Data Box Edge/Data Box Gateway device. */ @ServiceMethod(returns = ReturnType.SINGLE) - JobInner get(String deviceName, String name, String resourceGroupName); + JobInner get(String resourceGroupName, String deviceName, String name); } diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/MonitoringConfigsClient.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/MonitoringConfigsClient.java new file mode 100644 index 000000000000..089adbc9a971 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/MonitoringConfigsClient.java @@ -0,0 +1,190 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.databoxedge.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.databoxedge.fluent.models.MonitoringMetricConfigurationInner; + +/** + * An instance of this class provides access to all the operations defined in MonitoringConfigsClient. + */ +public interface MonitoringConfigsClient { + /** + * Gets a metric configuration of a role. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @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 a metric configuration of a role along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String deviceName, + Context context); + + /** + * Gets a metric configuration of a role. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @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 a metric configuration of a role. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + MonitoringMetricConfigurationInner get(String resourceGroupName, String deviceName); + + /** + * Creates a new metric configuration or updates an existing one for a role. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @param monitoringMetricConfiguration The metric configuration. + * @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 SyncPoller} for polling of the metric setting details for the role. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, MonitoringMetricConfigurationInner> beginCreateOrUpdate( + String resourceGroupName, String deviceName, MonitoringMetricConfigurationInner monitoringMetricConfiguration); + + /** + * Creates a new metric configuration or updates an existing one for a role. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @param monitoringMetricConfiguration The metric configuration. + * @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 SyncPoller} for polling of the metric setting details for the role. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, MonitoringMetricConfigurationInner> beginCreateOrUpdate( + String resourceGroupName, String deviceName, MonitoringMetricConfigurationInner monitoringMetricConfiguration, + Context context); + + /** + * Creates a new metric configuration or updates an existing one for a role. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @param monitoringMetricConfiguration The metric configuration. + * @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 metric setting details for the role. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + MonitoringMetricConfigurationInner createOrUpdate(String resourceGroupName, String deviceName, + MonitoringMetricConfigurationInner monitoringMetricConfiguration); + + /** + * Creates a new metric configuration or updates an existing one for a role. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @param monitoringMetricConfiguration The metric configuration. + * @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 metric setting details for the role. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + MonitoringMetricConfigurationInner createOrUpdate(String resourceGroupName, String deviceName, + MonitoringMetricConfigurationInner monitoringMetricConfiguration, Context context); + + /** + * deletes a new metric configuration for a role. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @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 SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String deviceName); + + /** + * deletes a new metric configuration for a role. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @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 SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String deviceName, Context context); + + /** + * deletes a new metric configuration for a role. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @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 delete(String resourceGroupName, String deviceName); + + /** + * deletes a new metric configuration for a role. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String deviceName, Context context); + + /** + * Lists metric configurations in a role. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @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 collection of metric configurations as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String deviceName); + + /** + * Lists metric configurations in a role. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @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 collection of metric configurations as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String deviceName, + Context context); +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/NodesClient.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/NodesClient.java index 11e6b30b183b..042eabcc08e0 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/NodesClient.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/NodesClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.fluent; @@ -17,8 +17,8 @@ public interface NodesClient { /** * Gets all the nodes currently configured under this Data Box Edge device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param resourceGroupName The resource group name. * @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. @@ -26,13 +26,13 @@ public interface NodesClient { * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByDataBoxEdgeDevice(String deviceName, String resourceGroupName); + PagedIterable listByDataBoxEdgeDevice(String resourceGroupName, String deviceName); /** * Gets all the nodes currently configured under this Data Box Edge device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param resourceGroupName The resource group name. * @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. @@ -41,5 +41,5 @@ public interface NodesClient { * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByDataBoxEdgeDevice(String deviceName, String resourceGroupName, Context context); + PagedIterable listByDataBoxEdgeDevice(String resourceGroupName, String deviceName, Context context); } diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/OperationsClient.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/OperationsClient.java index d03b8c776eb3..1cab17cd9418 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/OperationsClient.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/OperationsClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.fluent; @@ -15,24 +15,24 @@ */ public interface OperationsClient { /** - * List all the supported operations. + * List the operations for the provider. * * @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 list of operations used for the discovery of available provider operations as paginated response with + * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(); /** - * List all the supported operations. + * List the operations for the provider. * * @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 list of operations used for the discovery of available provider operations as paginated response with + * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/OperationsStatusClient.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/OperationsStatusClient.java index cd2a86da0cc3..1d44cbda96b8 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/OperationsStatusClient.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/OperationsStatusClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.fluent; @@ -17,9 +17,9 @@ public interface OperationsStatusClient { /** * Gets the details of a specified job on a Data Box Edge/Data Box Gateway device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. * @param name The job name. - * @param resourceGroupName The resource group name. * @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. @@ -27,19 +27,19 @@ public interface OperationsStatusClient { * @return the details of a specified job on a Data Box Edge/Data Box Gateway device along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String deviceName, String name, String resourceGroupName, Context context); + Response getWithResponse(String resourceGroupName, String deviceName, String name, Context context); /** * Gets the details of a specified job on a Data Box Edge/Data Box Gateway device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. * @param name The job name. - * @param resourceGroupName The resource group name. * @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 details of a specified job on a Data Box Edge/Data Box Gateway device. */ @ServiceMethod(returns = ReturnType.SINGLE) - JobInner get(String deviceName, String name, String resourceGroupName); + JobInner get(String resourceGroupName, String deviceName, String name); } diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/OrdersClient.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/OrdersClient.java index 0be139d9891e..2b0218b0e9bc 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/OrdersClient.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/OrdersClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.fluent; @@ -11,44 +11,18 @@ import com.azure.core.management.polling.PollResult; import com.azure.core.util.Context; import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.databoxedge.fluent.models.DCAccessCodeInner; import com.azure.resourcemanager.databoxedge.fluent.models.OrderInner; /** * An instance of this class provides access to all the operations defined in OrdersClient. */ public interface OrdersClient { - /** - * Lists all the orders related to a Data Box Edge/Data Box Gateway device. - * - * @param deviceName The device name. - * @param resourceGroupName The resource group name. - * @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 order entities as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByDataBoxEdgeDevice(String deviceName, String resourceGroupName); - - /** - * Lists all the orders related to a Data Box Edge/Data Box Gateway device. - * - * @param deviceName The device name. - * @param resourceGroupName The resource group name. - * @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 list of order entities as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByDataBoxEdgeDevice(String deviceName, String resourceGroupName, Context context); - /** * Gets a specific order by name. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param resourceGroupName The resource group name. * @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. @@ -56,26 +30,26 @@ public interface OrdersClient { * @return a specific order by name along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String deviceName, String resourceGroupName, Context context); + Response getWithResponse(String resourceGroupName, String deviceName, Context context); /** * Gets a specific order by name. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param resourceGroupName The resource group name. * @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 a specific order by name. */ @ServiceMethod(returns = ReturnType.SINGLE) - OrderInner get(String deviceName, String resourceGroupName); + OrderInner get(String resourceGroupName, String deviceName); /** * Creates or updates an order. * - * @param deviceName The order details of a device. - * @param resourceGroupName The resource group name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. * @param order The order to be created or updated. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -83,14 +57,14 @@ public interface OrdersClient { * @return the {@link SyncPoller} for polling of the order details. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, OrderInner> beginCreateOrUpdate(String deviceName, String resourceGroupName, + SyncPoller, OrderInner> beginCreateOrUpdate(String resourceGroupName, String deviceName, OrderInner order); /** * Creates or updates an order. * - * @param deviceName The order details of a device. - * @param resourceGroupName The resource group name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. * @param order The order to be created or updated. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -99,14 +73,14 @@ SyncPoller, OrderInner> beginCreateOrUpdate(String device * @return the {@link SyncPoller} for polling of the order details. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, OrderInner> beginCreateOrUpdate(String deviceName, String resourceGroupName, + SyncPoller, OrderInner> beginCreateOrUpdate(String resourceGroupName, String deviceName, OrderInner order, Context context); /** * Creates or updates an order. * - * @param deviceName The order details of a device. - * @param resourceGroupName The resource group name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. * @param order The order to be created or updated. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -114,13 +88,13 @@ SyncPoller, OrderInner> beginCreateOrUpdate(String device * @return the order details. */ @ServiceMethod(returns = ReturnType.SINGLE) - OrderInner createOrUpdate(String deviceName, String resourceGroupName, OrderInner order); + OrderInner createOrUpdate(String resourceGroupName, String deviceName, OrderInner order); /** * Creates or updates an order. * - * @param deviceName The order details of a device. - * @param resourceGroupName The resource group name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. * @param order The order to be created or updated. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -129,26 +103,26 @@ SyncPoller, OrderInner> beginCreateOrUpdate(String device * @return the order details. */ @ServiceMethod(returns = ReturnType.SINGLE) - OrderInner createOrUpdate(String deviceName, String resourceGroupName, OrderInner order, Context context); + OrderInner createOrUpdate(String resourceGroupName, String deviceName, OrderInner order, Context context); /** * Deletes the order related to the device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param resourceGroupName The resource group name. * @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 SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDelete(String deviceName, String resourceGroupName); + SyncPoller, Void> beginDelete(String resourceGroupName, String deviceName); /** * Deletes the order related to the device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param resourceGroupName The resource group name. * @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. @@ -156,30 +130,85 @@ SyncPoller, OrderInner> beginCreateOrUpdate(String device * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDelete(String deviceName, String resourceGroupName, Context context); + SyncPoller, Void> beginDelete(String resourceGroupName, String deviceName, Context context); /** * Deletes the order related to the device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param resourceGroupName The resource group name. * @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 delete(String deviceName, String resourceGroupName); + void delete(String resourceGroupName, String deviceName); /** * Deletes the order related to the device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param resourceGroupName The resource group name. * @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. */ @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String deviceName, String resourceGroupName, Context context); + void delete(String resourceGroupName, String deviceName, Context context); + + /** + * Lists all the orders related to a Data Box Edge/Data Box Gateway device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @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 order entities as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByDataBoxEdgeDevice(String resourceGroupName, String deviceName); + + /** + * Lists all the orders related to a Data Box Edge/Data Box Gateway device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @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 list of order entities as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByDataBoxEdgeDevice(String resourceGroupName, String deviceName, Context context); + + /** + * Gets the DCAccess Code. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @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 DCAccess Code along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listDCAccessCodeWithResponse(String resourceGroupName, String deviceName, + Context context); + + /** + * Gets the DCAccess Code. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @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 DCAccess Code. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DCAccessCodeInner listDCAccessCode(String resourceGroupName, String deviceName); } diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/RolesClient.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/RolesClient.java index 7ec4e4e48aca..967955266db4 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/RolesClient.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/RolesClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.fluent; @@ -17,39 +17,12 @@ * An instance of this class provides access to all the operations defined in RolesClient. */ public interface RolesClient { - /** - * Lists all the roles configured in a Data Box Edge/Data Box Gateway device. - * - * @param deviceName The device name. - * @param resourceGroupName The resource group name. - * @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 collection of all the roles on the Data Box Edge device as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByDataBoxEdgeDevice(String deviceName, String resourceGroupName); - - /** - * Lists all the roles configured in a Data Box Edge/Data Box Gateway device. - * - * @param deviceName The device name. - * @param resourceGroupName The resource group name. - * @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 collection of all the roles on the Data Box Edge device as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByDataBoxEdgeDevice(String deviceName, String resourceGroupName, Context context); - /** * Gets a specific role by name. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. * @param name The role name. - * @param resourceGroupName The resource group name. * @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. @@ -57,28 +30,28 @@ public interface RolesClient { * @return a specific role by name along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String deviceName, String name, String resourceGroupName, Context context); + Response getWithResponse(String resourceGroupName, String deviceName, String name, Context context); /** * Gets a specific role by name. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. * @param name The role name. - * @param resourceGroupName The resource group name. * @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 a specific role by name. */ @ServiceMethod(returns = ReturnType.SINGLE) - RoleInner get(String deviceName, String name, String resourceGroupName); + RoleInner get(String resourceGroupName, String deviceName, String name); /** * Create or update a role. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. * @param name The role name. - * @param resourceGroupName The resource group name. * @param role The role properties. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -86,15 +59,15 @@ public interface RolesClient { * @return the {@link SyncPoller} for polling of compute role. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, RoleInner> beginCreateOrUpdate(String deviceName, String name, - String resourceGroupName, RoleInner role); + SyncPoller, RoleInner> beginCreateOrUpdate(String resourceGroupName, String deviceName, + String name, RoleInner role); /** * Create or update a role. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. * @param name The role name. - * @param resourceGroupName The resource group name. * @param role The role properties. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -103,15 +76,15 @@ SyncPoller, RoleInner> beginCreateOrUpdate(String deviceNa * @return the {@link SyncPoller} for polling of compute role. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, RoleInner> beginCreateOrUpdate(String deviceName, String name, - String resourceGroupName, RoleInner role, Context context); + SyncPoller, RoleInner> beginCreateOrUpdate(String resourceGroupName, String deviceName, + String name, RoleInner role, Context context); /** * Create or update a role. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. * @param name The role name. - * @param resourceGroupName The resource group name. * @param role The role properties. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -119,14 +92,14 @@ SyncPoller, RoleInner> beginCreateOrUpdate(String deviceNa * @return compute role. */ @ServiceMethod(returns = ReturnType.SINGLE) - RoleInner createOrUpdate(String deviceName, String name, String resourceGroupName, RoleInner role); + RoleInner createOrUpdate(String resourceGroupName, String deviceName, String name, RoleInner role); /** * Create or update a role. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. * @param name The role name. - * @param resourceGroupName The resource group name. * @param role The role properties. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -135,28 +108,28 @@ SyncPoller, RoleInner> beginCreateOrUpdate(String deviceNa * @return compute role. */ @ServiceMethod(returns = ReturnType.SINGLE) - RoleInner createOrUpdate(String deviceName, String name, String resourceGroupName, RoleInner role, Context context); + RoleInner createOrUpdate(String resourceGroupName, String deviceName, String name, RoleInner role, Context context); /** * Deletes the role on the device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. * @param name The role name. - * @param resourceGroupName The resource group name. * @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 SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDelete(String deviceName, String name, String resourceGroupName); + SyncPoller, Void> beginDelete(String resourceGroupName, String deviceName, String name); /** * Deletes the role on the device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. * @param name The role name. - * @param resourceGroupName The resource group name. * @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. @@ -164,33 +137,60 @@ SyncPoller, RoleInner> beginCreateOrUpdate(String deviceNa * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDelete(String deviceName, String name, String resourceGroupName, + SyncPoller, Void> beginDelete(String resourceGroupName, String deviceName, String name, Context context); /** * Deletes the role on the device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. * @param name The role name. - * @param resourceGroupName The resource group name. * @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 delete(String deviceName, String name, String resourceGroupName); + void delete(String resourceGroupName, String deviceName, String name); /** * Deletes the role on the device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. * @param name The role name. - * @param resourceGroupName The resource group name. * @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. */ @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String deviceName, String name, String resourceGroupName, Context context); + void delete(String resourceGroupName, String deviceName, String name, Context context); + + /** + * Lists all the roles configured in a Data Box Edge/Data Box Gateway device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @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 collection of all the roles on the Data Box Edge device as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByDataBoxEdgeDevice(String resourceGroupName, String deviceName); + + /** + * Lists all the roles configured in a Data Box Edge/Data Box Gateway device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @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 collection of all the roles on the Data Box Edge device as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByDataBoxEdgeDevice(String resourceGroupName, String deviceName, Context context); } diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/SharesClient.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/SharesClient.java index a51f788e26be..dbe6bb20d2c6 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/SharesClient.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/SharesClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.fluent; @@ -17,41 +17,12 @@ * An instance of this class provides access to all the operations defined in SharesClient. */ public interface SharesClient { - /** - * Lists all the shares in a Data Box Edge/Data Box Gateway device. - * - * @param deviceName The device name. - * @param resourceGroupName The resource group name. - * @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 collection of all the shares on the Data Box Edge/Gateway device as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByDataBoxEdgeDevice(String deviceName, String resourceGroupName); - - /** - * Lists all the shares in a Data Box Edge/Data Box Gateway device. - * - * @param deviceName The device name. - * @param resourceGroupName The resource group name. - * @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 collection of all the shares on the Data Box Edge/Gateway device as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByDataBoxEdgeDevice(String deviceName, String resourceGroupName, Context context); - /** * Gets a share by name. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. * @param name The share name. - * @param resourceGroupName The resource group name. * @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. @@ -59,28 +30,28 @@ public interface SharesClient { * @return a share by name along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String deviceName, String name, String resourceGroupName, Context context); + Response getWithResponse(String resourceGroupName, String deviceName, String name, Context context); /** * Gets a share by name. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. * @param name The share name. - * @param resourceGroupName The resource group name. * @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 a share by name. */ @ServiceMethod(returns = ReturnType.SINGLE) - ShareInner get(String deviceName, String name, String resourceGroupName); + ShareInner get(String resourceGroupName, String deviceName, String name); /** * Creates a new share or updates an existing share on the device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. * @param name The share name. - * @param resourceGroupName The resource group name. * @param share The share properties. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -88,15 +59,15 @@ public interface SharesClient { * @return the {@link SyncPoller} for polling of represents a share on the Data Box Edge/Gateway device. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, ShareInner> beginCreateOrUpdate(String deviceName, String name, - String resourceGroupName, ShareInner share); + SyncPoller, ShareInner> beginCreateOrUpdate(String resourceGroupName, String deviceName, + String name, ShareInner share); /** * Creates a new share or updates an existing share on the device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. * @param name The share name. - * @param resourceGroupName The resource group name. * @param share The share properties. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -105,15 +76,15 @@ SyncPoller, ShareInner> beginCreateOrUpdate(String device * @return the {@link SyncPoller} for polling of represents a share on the Data Box Edge/Gateway device. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, ShareInner> beginCreateOrUpdate(String deviceName, String name, - String resourceGroupName, ShareInner share, Context context); + SyncPoller, ShareInner> beginCreateOrUpdate(String resourceGroupName, String deviceName, + String name, ShareInner share, Context context); /** * Creates a new share or updates an existing share on the device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. * @param name The share name. - * @param resourceGroupName The resource group name. * @param share The share properties. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -121,14 +92,14 @@ SyncPoller, ShareInner> beginCreateOrUpdate(String device * @return represents a share on the Data Box Edge/Gateway device. */ @ServiceMethod(returns = ReturnType.SINGLE) - ShareInner createOrUpdate(String deviceName, String name, String resourceGroupName, ShareInner share); + ShareInner createOrUpdate(String resourceGroupName, String deviceName, String name, ShareInner share); /** * Creates a new share or updates an existing share on the device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. * @param name The share name. - * @param resourceGroupName The resource group name. * @param share The share properties. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -137,29 +108,29 @@ SyncPoller, ShareInner> beginCreateOrUpdate(String device * @return represents a share on the Data Box Edge/Gateway device. */ @ServiceMethod(returns = ReturnType.SINGLE) - ShareInner createOrUpdate(String deviceName, String name, String resourceGroupName, ShareInner share, + ShareInner createOrUpdate(String resourceGroupName, String deviceName, String name, ShareInner share, Context context); /** * Deletes the share on the Data Box Edge/Data Box Gateway device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. * @param name The share name. - * @param resourceGroupName The resource group name. * @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 SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDelete(String deviceName, String name, String resourceGroupName); + SyncPoller, Void> beginDelete(String resourceGroupName, String deviceName, String name); /** * Deletes the share on the Data Box Edge/Data Box Gateway device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. * @param name The share name. - * @param resourceGroupName The resource group name. * @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. @@ -167,56 +138,85 @@ ShareInner createOrUpdate(String deviceName, String name, String resourceGroupNa * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDelete(String deviceName, String name, String resourceGroupName, + SyncPoller, Void> beginDelete(String resourceGroupName, String deviceName, String name, Context context); /** * Deletes the share on the Data Box Edge/Data Box Gateway device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. * @param name The share name. - * @param resourceGroupName The resource group name. * @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 delete(String deviceName, String name, String resourceGroupName); + void delete(String resourceGroupName, String deviceName, String name); /** * Deletes the share on the Data Box Edge/Data Box Gateway device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. * @param name The share name. - * @param resourceGroupName The resource group name. * @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. */ @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String deviceName, String name, String resourceGroupName, Context context); + void delete(String resourceGroupName, String deviceName, String name, Context context); + + /** + * Lists all the shares in a Data Box Edge/Data Box Gateway device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @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 collection of all the shares on the Data Box Edge/Gateway device as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByDataBoxEdgeDevice(String resourceGroupName, String deviceName); + + /** + * Lists all the shares in a Data Box Edge/Data Box Gateway device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @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 collection of all the shares on the Data Box Edge/Gateway device as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByDataBoxEdgeDevice(String resourceGroupName, String deviceName, Context context); /** * Refreshes the share metadata with the data from the cloud. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. * @param name The share name. - * @param resourceGroupName The resource group name. * @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 SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginRefresh(String deviceName, String name, String resourceGroupName); + SyncPoller, Void> beginRefresh(String resourceGroupName, String deviceName, String name); /** * Refreshes the share metadata with the data from the cloud. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. * @param name The share name. - * @param resourceGroupName The resource group name. * @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. @@ -224,33 +224,33 @@ SyncPoller, Void> beginDelete(String deviceName, String name, S * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginRefresh(String deviceName, String name, String resourceGroupName, + SyncPoller, Void> beginRefresh(String resourceGroupName, String deviceName, String name, Context context); /** * Refreshes the share metadata with the data from the cloud. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. * @param name The share name. - * @param resourceGroupName The resource group name. * @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 refresh(String deviceName, String name, String resourceGroupName); + void refresh(String resourceGroupName, String deviceName, String name); /** * Refreshes the share metadata with the data from the cloud. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. * @param name The share name. - * @param resourceGroupName The resource group name. * @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. */ @ServiceMethod(returns = ReturnType.SINGLE) - void refresh(String deviceName, String name, String resourceGroupName, Context context); + void refresh(String resourceGroupName, String deviceName, String name, Context context); } diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/StorageAccountCredentialsClient.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/StorageAccountCredentialsClient.java index 2cddb18b32e2..7a38c4135925 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/StorageAccountCredentialsClient.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/StorageAccountCredentialsClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.fluent; @@ -17,42 +17,12 @@ * An instance of this class provides access to all the operations defined in StorageAccountCredentialsClient. */ public interface StorageAccountCredentialsClient { - /** - * Gets all the storage account credentials in a Data Box Edge/Data Box Gateway device. - * - * @param deviceName The device name. - * @param resourceGroupName The resource group name. - * @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 all the storage account credentials in a Data Box Edge/Data Box Gateway device as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByDataBoxEdgeDevice(String deviceName, String resourceGroupName); - - /** - * Gets all the storage account credentials in a Data Box Edge/Data Box Gateway device. - * - * @param deviceName The device name. - * @param resourceGroupName The resource group name. - * @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 all the storage account credentials in a Data Box Edge/Data Box Gateway device as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByDataBoxEdgeDevice(String deviceName, String resourceGroupName, - Context context); - /** * Gets the properties of the specified storage account credential. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. * @param name The storage account credential name. - * @param resourceGroupName The resource group name. * @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. @@ -60,29 +30,29 @@ PagedIterable listByDataBoxEdgeDevice(String devi * @return the properties of the specified storage account credential along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String deviceName, String name, String resourceGroupName, + Response getWithResponse(String resourceGroupName, String deviceName, String name, Context context); /** * Gets the properties of the specified storage account credential. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. * @param name The storage account credential name. - * @param resourceGroupName The resource group name. * @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 properties of the specified storage account credential. */ @ServiceMethod(returns = ReturnType.SINGLE) - StorageAccountCredentialInner get(String deviceName, String name, String resourceGroupName); + StorageAccountCredentialInner get(String resourceGroupName, String deviceName, String name); /** * Creates or updates the storage account credential. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. * @param name The storage account credential name. - * @param resourceGroupName The resource group name. * @param storageAccountCredential The storage account credential. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -91,15 +61,15 @@ Response getWithResponse(String deviceName, Strin */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, StorageAccountCredentialInner> beginCreateOrUpdate( - String deviceName, String name, String resourceGroupName, + String resourceGroupName, String deviceName, String name, StorageAccountCredentialInner storageAccountCredential); /** * Creates or updates the storage account credential. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. * @param name The storage account credential name. - * @param resourceGroupName The resource group name. * @param storageAccountCredential The storage account credential. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -109,15 +79,15 @@ SyncPoller, StorageAccountCredentialIn */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, StorageAccountCredentialInner> beginCreateOrUpdate( - String deviceName, String name, String resourceGroupName, + String resourceGroupName, String deviceName, String name, StorageAccountCredentialInner storageAccountCredential, Context context); /** * Creates or updates the storage account credential. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. * @param name The storage account credential name. - * @param resourceGroupName The resource group name. * @param storageAccountCredential The storage account credential. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -125,15 +95,15 @@ SyncPoller, StorageAccountCredentialIn * @return the storage account credential. */ @ServiceMethod(returns = ReturnType.SINGLE) - StorageAccountCredentialInner createOrUpdate(String deviceName, String name, String resourceGroupName, + StorageAccountCredentialInner createOrUpdate(String resourceGroupName, String deviceName, String name, StorageAccountCredentialInner storageAccountCredential); /** * Creates or updates the storage account credential. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. * @param name The storage account credential name. - * @param resourceGroupName The resource group name. * @param storageAccountCredential The storage account credential. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -142,29 +112,29 @@ StorageAccountCredentialInner createOrUpdate(String deviceName, String name, Str * @return the storage account credential. */ @ServiceMethod(returns = ReturnType.SINGLE) - StorageAccountCredentialInner createOrUpdate(String deviceName, String name, String resourceGroupName, + StorageAccountCredentialInner createOrUpdate(String resourceGroupName, String deviceName, String name, StorageAccountCredentialInner storageAccountCredential, Context context); /** * Deletes the storage account credential. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. * @param name The storage account credential name. - * @param resourceGroupName The resource group name. * @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 SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDelete(String deviceName, String name, String resourceGroupName); + SyncPoller, Void> beginDelete(String resourceGroupName, String deviceName, String name); /** * Deletes the storage account credential. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. * @param name The storage account credential name. - * @param resourceGroupName The resource group name. * @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. @@ -172,33 +142,63 @@ StorageAccountCredentialInner createOrUpdate(String deviceName, String name, Str * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDelete(String deviceName, String name, String resourceGroupName, + SyncPoller, Void> beginDelete(String resourceGroupName, String deviceName, String name, Context context); /** * Deletes the storage account credential. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. * @param name The storage account credential name. - * @param resourceGroupName The resource group name. * @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 delete(String deviceName, String name, String resourceGroupName); + void delete(String resourceGroupName, String deviceName, String name); /** * Deletes the storage account credential. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. * @param name The storage account credential name. - * @param resourceGroupName The resource group name. * @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. */ @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String deviceName, String name, String resourceGroupName, Context context); + void delete(String resourceGroupName, String deviceName, String name, Context context); + + /** + * Gets all the storage account credentials in a Data Box Edge/Data Box Gateway device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @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 all the storage account credentials in a Data Box Edge/Data Box Gateway device as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByDataBoxEdgeDevice(String resourceGroupName, String deviceName); + + /** + * Gets all the storage account credentials in a Data Box Edge/Data Box Gateway device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @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 all the storage account credentials in a Data Box Edge/Data Box Gateway device as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByDataBoxEdgeDevice(String resourceGroupName, String deviceName, + Context context); } diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/StorageAccountsClient.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/StorageAccountsClient.java index c4c49752e229..7d2bd0e035bf 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/StorageAccountsClient.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/StorageAccountsClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.fluent; @@ -17,42 +17,12 @@ * An instance of this class provides access to all the operations defined in StorageAccountsClient. */ public interface StorageAccountsClient { - /** - * Lists all the storage accounts in a Data Box Edge/Data Box Gateway device. - * - * @param deviceName The device name. - * @param resourceGroupName The resource group name. - * @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 collection of all the Storage Accounts on the Data Box Edge/Gateway device as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByDataBoxEdgeDevice(String deviceName, String resourceGroupName); - - /** - * Lists all the storage accounts in a Data Box Edge/Data Box Gateway device. - * - * @param deviceName The device name. - * @param resourceGroupName The resource group name. - * @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 collection of all the Storage Accounts on the Data Box Edge/Gateway device as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByDataBoxEdgeDevice(String deviceName, String resourceGroupName, - Context context); - /** * Gets a StorageAccount by name. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. * @param storageAccountName The storage account name. - * @param resourceGroupName The resource group name. * @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. @@ -60,29 +30,29 @@ PagedIterable listByDataBoxEdgeDevice(String deviceName, St * @return a StorageAccount by name along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String deviceName, String storageAccountName, - String resourceGroupName, Context context); + Response getWithResponse(String resourceGroupName, String deviceName, + String storageAccountName, Context context); /** * Gets a StorageAccount by name. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. * @param storageAccountName The storage account name. - * @param resourceGroupName The resource group name. * @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 a StorageAccount by name. */ @ServiceMethod(returns = ReturnType.SINGLE) - StorageAccountInner get(String deviceName, String storageAccountName, String resourceGroupName); + StorageAccountInner get(String resourceGroupName, String deviceName, String storageAccountName); /** * Creates a new StorageAccount or updates an existing StorageAccount on the device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param storageAccountName The StorageAccount name. - * @param resourceGroupName The resource group name. + * @param storageAccountName The storage account name. * @param storageAccount The StorageAccount properties. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -90,15 +60,15 @@ Response getWithResponse(String deviceName, String storageA * @return the {@link SyncPoller} for polling of represents a Storage Account on the Data Box Edge/Gateway device. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, StorageAccountInner> beginCreateOrUpdate(String deviceName, - String storageAccountName, String resourceGroupName, StorageAccountInner storageAccount); + SyncPoller, StorageAccountInner> beginCreateOrUpdate(String resourceGroupName, + String deviceName, String storageAccountName, StorageAccountInner storageAccount); /** * Creates a new StorageAccount or updates an existing StorageAccount on the device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param storageAccountName The StorageAccount name. - * @param resourceGroupName The resource group name. + * @param storageAccountName The storage account name. * @param storageAccount The StorageAccount properties. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -107,15 +77,15 @@ SyncPoller, StorageAccountInner> beginCreateOrUp * @return the {@link SyncPoller} for polling of represents a Storage Account on the Data Box Edge/Gateway device. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, StorageAccountInner> beginCreateOrUpdate(String deviceName, - String storageAccountName, String resourceGroupName, StorageAccountInner storageAccount, Context context); + SyncPoller, StorageAccountInner> beginCreateOrUpdate(String resourceGroupName, + String deviceName, String storageAccountName, StorageAccountInner storageAccount, Context context); /** * Creates a new StorageAccount or updates an existing StorageAccount on the device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param storageAccountName The StorageAccount name. - * @param resourceGroupName The resource group name. + * @param storageAccountName The storage account name. * @param storageAccount The StorageAccount properties. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -123,15 +93,15 @@ SyncPoller, StorageAccountInner> beginCreateOrUp * @return represents a Storage Account on the Data Box Edge/Gateway device. */ @ServiceMethod(returns = ReturnType.SINGLE) - StorageAccountInner createOrUpdate(String deviceName, String storageAccountName, String resourceGroupName, + StorageAccountInner createOrUpdate(String resourceGroupName, String deviceName, String storageAccountName, StorageAccountInner storageAccount); /** * Creates a new StorageAccount or updates an existing StorageAccount on the device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param storageAccountName The StorageAccount name. - * @param resourceGroupName The resource group name. + * @param storageAccountName The storage account name. * @param storageAccount The StorageAccount properties. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -140,30 +110,30 @@ StorageAccountInner createOrUpdate(String deviceName, String storageAccountName, * @return represents a Storage Account on the Data Box Edge/Gateway device. */ @ServiceMethod(returns = ReturnType.SINGLE) - StorageAccountInner createOrUpdate(String deviceName, String storageAccountName, String resourceGroupName, + StorageAccountInner createOrUpdate(String resourceGroupName, String deviceName, String storageAccountName, StorageAccountInner storageAccount, Context context); /** * Deletes the StorageAccount on the Data Box Edge/Data Box Gateway device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param storageAccountName The StorageAccount name. - * @param resourceGroupName The resource group name. + * @param storageAccountName The storage account name. * @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 SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDelete(String deviceName, String storageAccountName, - String resourceGroupName); + SyncPoller, Void> beginDelete(String resourceGroupName, String deviceName, + String storageAccountName); /** * Deletes the StorageAccount on the Data Box Edge/Data Box Gateway device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param storageAccountName The StorageAccount name. - * @param resourceGroupName The resource group name. + * @param storageAccountName The storage account name. * @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. @@ -171,33 +141,63 @@ SyncPoller, Void> beginDelete(String deviceName, String storage * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDelete(String deviceName, String storageAccountName, - String resourceGroupName, Context context); + SyncPoller, Void> beginDelete(String resourceGroupName, String deviceName, + String storageAccountName, Context context); /** * Deletes the StorageAccount on the Data Box Edge/Data Box Gateway device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param storageAccountName The StorageAccount name. - * @param resourceGroupName The resource group name. + * @param storageAccountName The storage account name. * @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 delete(String deviceName, String storageAccountName, String resourceGroupName); + void delete(String resourceGroupName, String deviceName, String storageAccountName); /** * Deletes the StorageAccount on the Data Box Edge/Data Box Gateway device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param storageAccountName The StorageAccount name. - * @param resourceGroupName The resource group name. + * @param storageAccountName The storage account name. * @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. */ @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String deviceName, String storageAccountName, String resourceGroupName, Context context); + void delete(String resourceGroupName, String deviceName, String storageAccountName, Context context); + + /** + * Lists all the StorageAccounts in a Data Box Edge/Data Box Gateway device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @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 collection of all the Storage Accounts on the Data Box Edge/Gateway device as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByDataBoxEdgeDevice(String resourceGroupName, String deviceName); + + /** + * Lists all the StorageAccounts in a Data Box Edge/Data Box Gateway device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @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 collection of all the Storage Accounts on the Data Box Edge/Gateway device as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByDataBoxEdgeDevice(String resourceGroupName, String deviceName, + Context context); } diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/SupportPackagesClient.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/SupportPackagesClient.java new file mode 100644 index 000000000000..387c5cf0f162 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/SupportPackagesClient.java @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.databoxedge.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.databoxedge.models.TriggerSupportPackageRequest; + +/** + * An instance of this class provides access to all the operations defined in SupportPackagesClient. + */ +public interface SupportPackagesClient { + /** + * Triggers support package on the device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @param triggerSupportPackageRequest The trigger support package request object. + * @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 SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginTriggerSupportPackage(String resourceGroupName, String deviceName, + TriggerSupportPackageRequest triggerSupportPackageRequest); + + /** + * Triggers support package on the device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @param triggerSupportPackageRequest The trigger support package request object. + * @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 SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginTriggerSupportPackage(String resourceGroupName, String deviceName, + TriggerSupportPackageRequest triggerSupportPackageRequest, Context context); + + /** + * Triggers support package on the device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @param triggerSupportPackageRequest The trigger support package request object. + * @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 triggerSupportPackage(String resourceGroupName, String deviceName, + TriggerSupportPackageRequest triggerSupportPackageRequest); + + /** + * Triggers support package on the device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @param triggerSupportPackageRequest The trigger support package request object. + * @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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void triggerSupportPackage(String resourceGroupName, String deviceName, + TriggerSupportPackageRequest triggerSupportPackageRequest, Context context); +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/TriggersClient.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/TriggersClient.java index 05f88ebc6eb0..49208a8eedba 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/TriggersClient.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/TriggersClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.fluent; @@ -17,41 +17,12 @@ * An instance of this class provides access to all the operations defined in TriggersClient. */ public interface TriggersClient { - /** - * Lists all the triggers configured in the device. - * - * @param deviceName The device name. - * @param resourceGroupName The resource group name. - * @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 collection of all trigger on the data box edge device as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByDataBoxEdgeDevice(String deviceName, String resourceGroupName); - - /** - * Lists all the triggers configured in the device. - * - * @param deviceName The device name. - * @param resourceGroupName The resource group name. - * @param filter Specify $filter='CustomContextTag eq <tag>' to filter on custom context tag property. - * @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 collection of all trigger on the data box edge device as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByDataBoxEdgeDevice(String deviceName, String resourceGroupName, String filter, - Context context); - /** * Get a specific trigger by name. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. * @param name The trigger name. - * @param resourceGroupName The resource group name. * @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. @@ -59,28 +30,28 @@ PagedIterable listByDataBoxEdgeDevice(String deviceName, String re * @return a specific trigger by name along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String deviceName, String name, String resourceGroupName, Context context); + Response getWithResponse(String resourceGroupName, String deviceName, String name, Context context); /** * Get a specific trigger by name. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. * @param name The trigger name. - * @param resourceGroupName The resource group name. * @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 a specific trigger by name. */ @ServiceMethod(returns = ReturnType.SINGLE) - TriggerInner get(String deviceName, String name, String resourceGroupName); + TriggerInner get(String resourceGroupName, String deviceName, String name); /** * Creates or updates a trigger. * - * @param deviceName Creates or updates a trigger. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. * @param name The trigger name. - * @param resourceGroupName The resource group name. * @param trigger The trigger. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -88,15 +59,15 @@ PagedIterable listByDataBoxEdgeDevice(String deviceName, String re * @return the {@link SyncPoller} for polling of trigger details. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, TriggerInner> beginCreateOrUpdate(String deviceName, String name, - String resourceGroupName, TriggerInner trigger); + SyncPoller, TriggerInner> beginCreateOrUpdate(String resourceGroupName, String deviceName, + String name, TriggerInner trigger); /** * Creates or updates a trigger. * - * @param deviceName Creates or updates a trigger. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. * @param name The trigger name. - * @param resourceGroupName The resource group name. * @param trigger The trigger. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -105,15 +76,15 @@ SyncPoller, TriggerInner> beginCreateOrUpdate(String de * @return the {@link SyncPoller} for polling of trigger details. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, TriggerInner> beginCreateOrUpdate(String deviceName, String name, - String resourceGroupName, TriggerInner trigger, Context context); + SyncPoller, TriggerInner> beginCreateOrUpdate(String resourceGroupName, String deviceName, + String name, TriggerInner trigger, Context context); /** * Creates or updates a trigger. * - * @param deviceName Creates or updates a trigger. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. * @param name The trigger name. - * @param resourceGroupName The resource group name. * @param trigger The trigger. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -121,14 +92,14 @@ SyncPoller, TriggerInner> beginCreateOrUpdate(String de * @return trigger details. */ @ServiceMethod(returns = ReturnType.SINGLE) - TriggerInner createOrUpdate(String deviceName, String name, String resourceGroupName, TriggerInner trigger); + TriggerInner createOrUpdate(String resourceGroupName, String deviceName, String name, TriggerInner trigger); /** * Creates or updates a trigger. * - * @param deviceName Creates or updates a trigger. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. * @param name The trigger name. - * @param resourceGroupName The resource group name. * @param trigger The trigger. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -137,29 +108,29 @@ SyncPoller, TriggerInner> beginCreateOrUpdate(String de * @return trigger details. */ @ServiceMethod(returns = ReturnType.SINGLE) - TriggerInner createOrUpdate(String deviceName, String name, String resourceGroupName, TriggerInner trigger, + TriggerInner createOrUpdate(String resourceGroupName, String deviceName, String name, TriggerInner trigger, Context context); /** * Deletes the trigger on the gateway device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. * @param name The trigger name. - * @param resourceGroupName The resource group name. * @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 SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDelete(String deviceName, String name, String resourceGroupName); + SyncPoller, Void> beginDelete(String resourceGroupName, String deviceName, String name); /** * Deletes the trigger on the gateway device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. * @param name The trigger name. - * @param resourceGroupName The resource group name. * @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. @@ -167,33 +138,62 @@ TriggerInner createOrUpdate(String deviceName, String name, String resourceGroup * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDelete(String deviceName, String name, String resourceGroupName, + SyncPoller, Void> beginDelete(String resourceGroupName, String deviceName, String name, Context context); /** * Deletes the trigger on the gateway device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. * @param name The trigger name. - * @param resourceGroupName The resource group name. * @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 delete(String deviceName, String name, String resourceGroupName); + void delete(String resourceGroupName, String deviceName, String name); /** * Deletes the trigger on the gateway device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. * @param name The trigger name. - * @param resourceGroupName The resource group name. * @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. */ @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String deviceName, String name, String resourceGroupName, Context context); + void delete(String resourceGroupName, String deviceName, String name, Context context); + + /** + * Lists all the triggers configured in the device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @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 collection of all trigger on the data box edge device as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByDataBoxEdgeDevice(String resourceGroupName, String deviceName); + + /** + * Lists all the triggers configured in the device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @param filter Specify $filter='CustomContextTag eq <tag>' to filter on custom context tag property. + * @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 collection of all trigger on the data box edge device as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByDataBoxEdgeDevice(String resourceGroupName, String deviceName, String filter, + Context context); } diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/UsersClient.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/UsersClient.java index 1e71697082dc..7a0695b5ef3b 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/UsersClient.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/UsersClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.fluent; @@ -17,43 +17,12 @@ * An instance of this class provides access to all the operations defined in UsersClient. */ public interface UsersClient { - /** - * Gets all the users registered on a Data Box Edge/Data Box Gateway device. - * - * @param deviceName The device name. - * @param resourceGroupName The resource group name. - * @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 all the users registered on a Data Box Edge/Data Box Gateway device as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByDataBoxEdgeDevice(String deviceName, String resourceGroupName); - - /** - * Gets all the users registered on a Data Box Edge/Data Box Gateway device. - * - * @param deviceName The device name. - * @param resourceGroupName The resource group name. - * @param filter Specify $filter='UserType eq <type>' to filter on user type property. - * @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 all the users registered on a Data Box Edge/Data Box Gateway device as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByDataBoxEdgeDevice(String deviceName, String resourceGroupName, String filter, - Context context); - /** * Gets the properties of the specified user. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. * @param name The user name. - * @param resourceGroupName The resource group name. * @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. @@ -61,28 +30,28 @@ PagedIterable listByDataBoxEdgeDevice(String deviceName, String resou * @return the properties of the specified user along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String deviceName, String name, String resourceGroupName, Context context); + Response getWithResponse(String resourceGroupName, String deviceName, String name, Context context); /** * Gets the properties of the specified user. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. * @param name The user name. - * @param resourceGroupName The resource group name. * @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 properties of the specified user. */ @ServiceMethod(returns = ReturnType.SINGLE) - UserInner get(String deviceName, String name, String resourceGroupName); + UserInner get(String resourceGroupName, String deviceName, String name); /** * Creates a new user or updates an existing user's information on a Data Box Edge/Data Box Gateway device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. * @param name The user name. - * @param resourceGroupName The resource group name. * @param user The user details. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -91,15 +60,15 @@ PagedIterable listByDataBoxEdgeDevice(String deviceName, String resou * Box Edge/Gateway device. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, UserInner> beginCreateOrUpdate(String deviceName, String name, - String resourceGroupName, UserInner user); + SyncPoller, UserInner> beginCreateOrUpdate(String resourceGroupName, String deviceName, + String name, UserInner user); /** * Creates a new user or updates an existing user's information on a Data Box Edge/Data Box Gateway device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. * @param name The user name. - * @param resourceGroupName The resource group name. * @param user The user details. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -109,15 +78,15 @@ SyncPoller, UserInner> beginCreateOrUpdate(String deviceNa * Box Edge/Gateway device. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, UserInner> beginCreateOrUpdate(String deviceName, String name, - String resourceGroupName, UserInner user, Context context); + SyncPoller, UserInner> beginCreateOrUpdate(String resourceGroupName, String deviceName, + String name, UserInner user, Context context); /** * Creates a new user or updates an existing user's information on a Data Box Edge/Data Box Gateway device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. * @param name The user name. - * @param resourceGroupName The resource group name. * @param user The user details. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -125,14 +94,14 @@ SyncPoller, UserInner> beginCreateOrUpdate(String deviceNa * @return represents a user who has access to one or more shares on the Data Box Edge/Gateway device. */ @ServiceMethod(returns = ReturnType.SINGLE) - UserInner createOrUpdate(String deviceName, String name, String resourceGroupName, UserInner user); + UserInner createOrUpdate(String resourceGroupName, String deviceName, String name, UserInner user); /** * Creates a new user or updates an existing user's information on a Data Box Edge/Data Box Gateway device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. * @param name The user name. - * @param resourceGroupName The resource group name. * @param user The user details. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -141,28 +110,28 @@ SyncPoller, UserInner> beginCreateOrUpdate(String deviceNa * @return represents a user who has access to one or more shares on the Data Box Edge/Gateway device. */ @ServiceMethod(returns = ReturnType.SINGLE) - UserInner createOrUpdate(String deviceName, String name, String resourceGroupName, UserInner user, Context context); + UserInner createOrUpdate(String resourceGroupName, String deviceName, String name, UserInner user, Context context); /** * Deletes the user on a databox edge/gateway device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. * @param name The user name. - * @param resourceGroupName The resource group name. * @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 SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDelete(String deviceName, String name, String resourceGroupName); + SyncPoller, Void> beginDelete(String resourceGroupName, String deviceName, String name); /** * Deletes the user on a databox edge/gateway device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. * @param name The user name. - * @param resourceGroupName The resource group name. * @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. @@ -170,33 +139,64 @@ SyncPoller, UserInner> beginCreateOrUpdate(String deviceNa * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDelete(String deviceName, String name, String resourceGroupName, + SyncPoller, Void> beginDelete(String resourceGroupName, String deviceName, String name, Context context); /** * Deletes the user on a databox edge/gateway device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. * @param name The user name. - * @param resourceGroupName The resource group name. * @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 delete(String deviceName, String name, String resourceGroupName); + void delete(String resourceGroupName, String deviceName, String name); /** * Deletes the user on a databox edge/gateway device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. * @param name The user name. - * @param resourceGroupName The resource group name. * @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. */ @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String deviceName, String name, String resourceGroupName, Context context); + void delete(String resourceGroupName, String deviceName, String name, Context context); + + /** + * Gets all the users registered on a Data Box Edge/Data Box Gateway device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @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 all the users registered on a Data Box Edge/Data Box Gateway device as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByDataBoxEdgeDevice(String resourceGroupName, String deviceName); + + /** + * Gets all the users registered on a Data Box Edge/Data Box Gateway device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @param filter Specify $filter='Type eq <type>' to filter on user type property. + * @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 all the users registered on a Data Box Edge/Data Box Gateway device as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByDataBoxEdgeDevice(String resourceGroupName, String deviceName, String filter, + Context context); } diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/AddonInner.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/AddonInner.java new file mode 100644 index 000000000000..b8d2c6814807 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/AddonInner.java @@ -0,0 +1,184 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.databoxedge.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.databoxedge.models.AddonProperties; +import com.azure.resourcemanager.databoxedge.models.AddonType; +import java.io.IOException; + +/** + * Role Addon. + */ +@Fluent +public final class AddonInner extends ProxyResource { + /* + * The resource-specific properties for this resource. + */ + private AddonProperties properties; + + /* + * Addon type. + */ + private AddonType kind; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of AddonInner class. + */ + public AddonInner() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public AddonProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the AddonInner object itself. + */ + public AddonInner withProperties(AddonProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the kind property: Addon type. + * + * @return the kind value. + */ + public AddonType kind() { + return this.kind; + } + + /** + * Set the kind property: Addon type. + * + * @param kind the kind value to set. + * @return the AddonInner object itself. + */ + public AddonInner withKind(AddonType kind) { + this.kind = kind; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AddonInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AddonInner if the JsonReader was pointing to an instance of it, or null if it was pointing + * to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the AddonInner. + */ + public static AddonInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AddonInner deserializedAddonInner = new AddonInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedAddonInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedAddonInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedAddonInner.type = reader.getString(); + } else if ("kind".equals(fieldName)) { + deserializedAddonInner.kind = AddonType.fromString(reader.getString()); + } else if ("properties".equals(fieldName)) { + deserializedAddonInner.properties = AddonProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedAddonInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedAddonInner; + }); + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/AlertInner.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/AlertInner.java index b35455415f83..edec0598f0e0 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/AlertInner.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/AlertInner.java @@ -1,16 +1,17 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.fluent.models; import com.azure.core.annotation.Immutable; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; import com.azure.json.JsonReader; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; import com.azure.resourcemanager.databoxedge.models.AlertErrorDetails; import com.azure.resourcemanager.databoxedge.models.AlertSeverity; -import com.azure.resourcemanager.databoxedge.models.ArmBaseModel; import java.io.IOException; import java.time.OffsetDateTime; import java.util.Map; @@ -19,12 +20,17 @@ * Alert on the data box edge/gateway device. */ @Immutable -public final class AlertInner extends ArmBaseModel { +public final class AlertInner extends ProxyResource { /* * Properties of alert. */ private AlertProperties innerProperties; + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + /* * The type of the resource. */ @@ -43,7 +49,7 @@ public final class AlertInner extends ArmBaseModel { /** * Creates an instance of AlertInner class. */ - public AlertInner() { + private AlertInner() { } /** @@ -55,6 +61,15 @@ private AlertProperties innerProperties() { return this.innerProperties; } + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + /** * Get the type property: The type of the resource. * @@ -148,24 +163,13 @@ public Map detailedInformation() { return this.innerProperties() == null ? null : this.innerProperties().detailedInformation(); } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } - /** * {@inheritDoc} */ @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); return jsonWriter.writeEndObject(); } @@ -193,6 +197,8 @@ public static AlertInner fromJson(JsonReader jsonReader) throws IOException { deserializedAlertInner.type = reader.getString(); } else if ("properties".equals(fieldName)) { deserializedAlertInner.innerProperties = AlertProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedAlertInner.systemData = SystemData.fromJson(reader); } else { reader.skipChildren(); } diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/AlertProperties.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/AlertProperties.java index 53da71b5db1e..ed2f63b6e01b 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/AlertProperties.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/AlertProperties.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.fluent.models; @@ -59,7 +59,7 @@ public final class AlertProperties implements JsonSerializable /** * Creates an instance of AlertProperties class. */ - public AlertProperties() { + private AlertProperties() { } /** @@ -125,17 +125,6 @@ public Map detailedInformation() { return this.detailedInformation; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (errorDetails() != null) { - errorDetails().validate(); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/BandwidthScheduleInner.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/BandwidthScheduleInner.java index 873e0d97440e..ea608427d5e4 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/BandwidthScheduleInner.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/BandwidthScheduleInner.java @@ -1,15 +1,15 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; import com.azure.json.JsonReader; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; -import com.azure.resourcemanager.databoxedge.models.ArmBaseModel; import com.azure.resourcemanager.databoxedge.models.DayOfWeek; import java.io.IOException; import java.util.List; @@ -18,12 +18,17 @@ * The bandwidth schedule details. */ @Fluent -public final class BandwidthScheduleInner extends ArmBaseModel { +public final class BandwidthScheduleInner extends ProxyResource { /* * The properties of the bandwidth schedule. */ private BandwidthScheduleProperties innerProperties = new BandwidthScheduleProperties(); + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + /* * The type of the resource. */ @@ -54,6 +59,15 @@ private BandwidthScheduleProperties innerProperties() { return this.innerProperties; } + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + /** * Get the type property: The type of the resource. * @@ -176,24 +190,6 @@ public BandwidthScheduleInner withDays(List days) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - if (innerProperties() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property innerProperties in model BandwidthScheduleInner")); - } else { - innerProperties().validate(); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(BandwidthScheduleInner.class); - /** * {@inheritDoc} */ @@ -228,6 +224,8 @@ public static BandwidthScheduleInner fromJson(JsonReader jsonReader) throws IOEx deserializedBandwidthScheduleInner.type = reader.getString(); } else if ("properties".equals(fieldName)) { deserializedBandwidthScheduleInner.innerProperties = BandwidthScheduleProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedBandwidthScheduleInner.systemData = SystemData.fromJson(reader); } else { reader.skipChildren(); } diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/BandwidthScheduleProperties.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/BandwidthScheduleProperties.java index 71d6c9249b53..4027d10a573c 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/BandwidthScheduleProperties.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/BandwidthScheduleProperties.java @@ -1,11 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -125,31 +124,6 @@ public BandwidthScheduleProperties withDays(List days) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (start() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property start in model BandwidthScheduleProperties")); - } - if (stop() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property stop in model BandwidthScheduleProperties")); - } - if (days() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property days in model BandwidthScheduleProperties")); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(BandwidthScheduleProperties.class); - /** * {@inheritDoc} */ diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/ContainerInner.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/ContainerInner.java index 60bf2fba8688..3ec374a09afa 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/ContainerInner.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/ContainerInner.java @@ -1,15 +1,15 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; import com.azure.json.JsonReader; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; -import com.azure.resourcemanager.databoxedge.models.ArmBaseModel; import com.azure.resourcemanager.databoxedge.models.AzureContainerDataFormat; import com.azure.resourcemanager.databoxedge.models.ContainerStatus; import com.azure.resourcemanager.databoxedge.models.RefreshDetails; @@ -20,12 +20,17 @@ * Represents a container on the Data Box Edge/Gateway device. */ @Fluent -public final class ContainerInner extends ArmBaseModel { +public final class ContainerInner extends ProxyResource { /* * The container properties. */ private ContainerProperties innerProperties = new ContainerProperties(); + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + /* * The type of the resource. */ @@ -56,6 +61,15 @@ private ContainerProperties innerProperties() { return this.innerProperties; } + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + /** * Get the type property: The type of the resource. * @@ -136,23 +150,6 @@ public OffsetDateTime createdDateTime() { return this.innerProperties() == null ? null : this.innerProperties().createdDateTime(); } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - if (innerProperties() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Missing required property innerProperties in model ContainerInner")); - } else { - innerProperties().validate(); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(ContainerInner.class); - /** * {@inheritDoc} */ @@ -187,6 +184,8 @@ public static ContainerInner fromJson(JsonReader jsonReader) throws IOException deserializedContainerInner.type = reader.getString(); } else if ("properties".equals(fieldName)) { deserializedContainerInner.innerProperties = ContainerProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedContainerInner.systemData = SystemData.fromJson(reader); } else { reader.skipChildren(); } diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/ContainerProperties.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/ContainerProperties.java index 8880b648030d..0ee73a224522 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/ContainerProperties.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/ContainerProperties.java @@ -1,12 +1,11 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.fluent.models; import com.azure.core.annotation.Fluent; import com.azure.core.util.CoreUtils; -import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -95,23 +94,6 @@ public OffsetDateTime createdDateTime() { return this.createdDateTime; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (dataFormat() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Missing required property dataFormat in model ContainerProperties")); - } - if (refreshDetails() != null) { - refreshDetails().validate(); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(ContainerProperties.class); - /** * {@inheritDoc} */ diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/DCAccessCodeInner.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/DCAccessCodeInner.java new file mode 100644 index 000000000000..78c87f83533a --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/DCAccessCodeInner.java @@ -0,0 +1,83 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.databoxedge.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * DC Access code in the case of Self Managed Shipping. + */ +@Immutable +public final class DCAccessCodeInner implements JsonSerializable { + /* + * DCAccessCode properties. + */ + private DCAccessCodeProperties innerProperties; + + /** + * Creates an instance of DCAccessCodeInner class. + */ + private DCAccessCodeInner() { + } + + /** + * Get the innerProperties property: DCAccessCode properties. + * + * @return the innerProperties value. + */ + private DCAccessCodeProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the authCode property: DCAccess Code for the Self Managed shipment. + * + * @return the authCode value. + */ + public String authCode() { + return this.innerProperties() == null ? null : this.innerProperties().authCode(); + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DCAccessCodeInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DCAccessCodeInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the DCAccessCodeInner. + */ + public static DCAccessCodeInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DCAccessCodeInner deserializedDCAccessCodeInner = new DCAccessCodeInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("properties".equals(fieldName)) { + deserializedDCAccessCodeInner.innerProperties = DCAccessCodeProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedDCAccessCodeInner; + }); + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/DCAccessCodeProperties.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/DCAccessCodeProperties.java new file mode 100644 index 000000000000..6fbc1304ac47 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/DCAccessCodeProperties.java @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.databoxedge.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * DCAccessCode Properties. + */ +@Immutable +public final class DCAccessCodeProperties implements JsonSerializable { + /* + * DCAccess Code for the Self Managed shipment. + */ + private String authCode; + + /** + * Creates an instance of DCAccessCodeProperties class. + */ + private DCAccessCodeProperties() { + } + + /** + * Get the authCode property: DCAccess Code for the Self Managed shipment. + * + * @return the authCode value. + */ + public String authCode() { + return this.authCode; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("authCode", this.authCode); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DCAccessCodeProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DCAccessCodeProperties if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the DCAccessCodeProperties. + */ + public static DCAccessCodeProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DCAccessCodeProperties deserializedDCAccessCodeProperties = new DCAccessCodeProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("authCode".equals(fieldName)) { + deserializedDCAccessCodeProperties.authCode = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedDCAccessCodeProperties; + }); + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/DataBoxEdgeDeviceExtendedInfoInner.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/DataBoxEdgeDeviceExtendedInfoInner.java index c8c10b35a381..6c724c676f07 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/DataBoxEdgeDeviceExtendedInfoInner.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/DataBoxEdgeDeviceExtendedInfoInner.java @@ -1,45 +1,55 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.fluent.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; +import com.azure.core.management.SystemData; import com.azure.json.JsonReader; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; -import com.azure.resourcemanager.databoxedge.models.ArmBaseModel; +import com.azure.resourcemanager.databoxedge.models.ARMBaseModel; +import com.azure.resourcemanager.databoxedge.models.ClusterWitnessType; +import com.azure.resourcemanager.databoxedge.models.KeyVaultSyncStatus; +import com.azure.resourcemanager.databoxedge.models.Secret; import java.io.IOException; +import java.util.Map; /** * The extended Info of the Data Box Edge/Gateway device. */ -@Fluent -public final class DataBoxEdgeDeviceExtendedInfoInner extends ArmBaseModel { +@Immutable +public final class DataBoxEdgeDeviceExtendedInfoInner extends ARMBaseModel { /* * The extended info properties. */ private DataBoxEdgeDeviceExtendedInfoProperties innerProperties; /* - * The type of the resource. + * Metadata pertaining to creation and last modification of DataBoxEdgeDevice + */ + private SystemData systemData; + + /* + * The hierarchical type of the object. */ private String type; /* - * The name of the resource. + * The object name. */ private String name; /* - * Fully qualified resource Id for the resource. + * The path ID that uniquely identifies the object. */ private String id; /** * Creates an instance of DataBoxEdgeDeviceExtendedInfoInner class. */ - public DataBoxEdgeDeviceExtendedInfoInner() { + private DataBoxEdgeDeviceExtendedInfoInner() { } /** @@ -52,7 +62,16 @@ private DataBoxEdgeDeviceExtendedInfoProperties innerProperties() { } /** - * Get the type property: The type of the resource. + * Get the systemData property: Metadata pertaining to creation and last modification of DataBoxEdgeDevice. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The hierarchical type of the object. * * @return the type value. */ @@ -62,7 +81,7 @@ public String type() { } /** - * Get the name property: The name of the resource. + * Get the name property: The object name. * * @return the name value. */ @@ -72,7 +91,7 @@ public String name() { } /** - * Get the id property: Fully qualified resource Id for the resource. + * Get the id property: The path ID that uniquely identifies the object. * * @return the id value. */ @@ -90,20 +109,6 @@ public String encryptionKeyThumbprint() { return this.innerProperties() == null ? null : this.innerProperties().encryptionKeyThumbprint(); } - /** - * Set the encryptionKeyThumbprint property: The digital signature of encrypted certificate. - * - * @param encryptionKeyThumbprint the encryptionKeyThumbprint value to set. - * @return the DataBoxEdgeDeviceExtendedInfoInner object itself. - */ - public DataBoxEdgeDeviceExtendedInfoInner withEncryptionKeyThumbprint(String encryptionKeyThumbprint) { - if (this.innerProperties() == null) { - this.innerProperties = new DataBoxEdgeDeviceExtendedInfoProperties(); - } - this.innerProperties().withEncryptionKeyThumbprint(encryptionKeyThumbprint); - return this; - } - /** * Get the encryptionKey property: The public part of the encryption certificate. Client uses this to encrypt any * secret. @@ -115,39 +120,120 @@ public String encryptionKey() { } /** - * Set the encryptionKey property: The public part of the encryption certificate. Client uses this to encrypt any - * secret. + * Get the resourceKey property: The Resource ID of the Resource. * - * @param encryptionKey the encryptionKey value to set. - * @return the DataBoxEdgeDeviceExtendedInfoInner object itself. + * @return the resourceKey value. */ - public DataBoxEdgeDeviceExtendedInfoInner withEncryptionKey(String encryptionKey) { - if (this.innerProperties() == null) { - this.innerProperties = new DataBoxEdgeDeviceExtendedInfoProperties(); - } - this.innerProperties().withEncryptionKey(encryptionKey); - return this; + public String resourceKey() { + return this.innerProperties() == null ? null : this.innerProperties().resourceKey(); } /** - * Get the resourceKey property: The Resource ID of the Resource. + * Get the clientSecretStoreId property: The Key Vault ARM Id for client secrets. * - * @return the resourceKey value. + * @return the clientSecretStoreId value. */ - public String resourceKey() { - return this.innerProperties() == null ? null : this.innerProperties().resourceKey(); + public String clientSecretStoreId() { + return this.innerProperties() == null ? null : this.innerProperties().clientSecretStoreId(); } /** - * Validates the instance. + * Get the clientSecretStoreUrl property: The url to access the Client Key Vault. * - * @throws IllegalArgumentException thrown if the instance is not valid. + * @return the clientSecretStoreUrl value. */ - @Override - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } + public String clientSecretStoreUrl() { + return this.innerProperties() == null ? null : this.innerProperties().clientSecretStoreUrl(); + } + + /** + * Get the channelIntegrityKeyName property: The name of Channel Integrity Key stored in the Client Key Vault. + * + * @return the channelIntegrityKeyName value. + */ + public String channelIntegrityKeyName() { + return this.innerProperties() == null ? null : this.innerProperties().channelIntegrityKeyName(); + } + + /** + * Get the channelIntegrityKeyVersion property: The version of Channel Integrity Key stored in the Client Key Vault. + * + * @return the channelIntegrityKeyVersion value. + */ + public String channelIntegrityKeyVersion() { + return this.innerProperties() == null ? null : this.innerProperties().channelIntegrityKeyVersion(); + } + + /** + * Get the keyVaultSyncStatus property: Key vault sync status. + * + * @return the keyVaultSyncStatus value. + */ + public KeyVaultSyncStatus keyVaultSyncStatus() { + return this.innerProperties() == null ? null : this.innerProperties().keyVaultSyncStatus(); + } + + /** + * Get the deviceSecrets property: Device secrets, will be returned only with ODataFilter $expand=deviceSecrets. + * + * @return the deviceSecrets value. + */ + public Map deviceSecrets() { + return this.innerProperties() == null ? null : this.innerProperties().deviceSecrets(); + } + + /** + * Get the clusterWitnessType property: Cluster Witness Type. + * + * @return the clusterWitnessType value. + */ + public ClusterWitnessType clusterWitnessType() { + return this.innerProperties() == null ? null : this.innerProperties().clusterWitnessType(); + } + + /** + * Get the fileShareWitnessLocation property: The witness location of file share. + * + * @return the fileShareWitnessLocation value. + */ + public String fileShareWitnessLocation() { + return this.innerProperties() == null ? null : this.innerProperties().fileShareWitnessLocation(); + } + + /** + * Get the fileShareWitnessUsername property: The username of file share. + * + * @return the fileShareWitnessUsername value. + */ + public String fileShareWitnessUsername() { + return this.innerProperties() == null ? null : this.innerProperties().fileShareWitnessUsername(); + } + + /** + * Get the cloudWitnessStorageAccountName property: The Cloud Witness Storage account name. + * + * @return the cloudWitnessStorageAccountName value. + */ + public String cloudWitnessStorageAccountName() { + return this.innerProperties() == null ? null : this.innerProperties().cloudWitnessStorageAccountName(); + } + + /** + * Get the cloudWitnessContainerName property: The Container for cloud witness in the storage account. + * + * @return the cloudWitnessContainerName value. + */ + public String cloudWitnessContainerName() { + return this.innerProperties() == null ? null : this.innerProperties().cloudWitnessContainerName(); + } + + /** + * Get the cloudWitnessStorageEndpoint property: The Azure service endpoint of the cloud witness storage account. + * + * @return the cloudWitnessStorageEndpoint value. + */ + public String cloudWitnessStorageEndpoint() { + return this.innerProperties() == null ? null : this.innerProperties().cloudWitnessStorageEndpoint(); } /** @@ -166,7 +252,6 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { * @param jsonReader The JsonReader being read. * @return An instance of DataBoxEdgeDeviceExtendedInfoInner if the JsonReader was pointing to an instance of it, or * null if it was pointing to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. * @throws IOException If an error occurs while reading the DataBoxEdgeDeviceExtendedInfoInner. */ public static DataBoxEdgeDeviceExtendedInfoInner fromJson(JsonReader jsonReader) throws IOException { @@ -186,6 +271,8 @@ public static DataBoxEdgeDeviceExtendedInfoInner fromJson(JsonReader jsonReader) } else if ("properties".equals(fieldName)) { deserializedDataBoxEdgeDeviceExtendedInfoInner.innerProperties = DataBoxEdgeDeviceExtendedInfoProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedDataBoxEdgeDeviceExtendedInfoInner.systemData = SystemData.fromJson(reader); } else { reader.skipChildren(); } diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/DataBoxEdgeDeviceExtendedInfoProperties.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/DataBoxEdgeDeviceExtendedInfoProperties.java index 1a3c08d41569..37c0c560bcf1 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/DataBoxEdgeDeviceExtendedInfoProperties.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/DataBoxEdgeDeviceExtendedInfoProperties.java @@ -1,20 +1,24 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.fluent.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; +import com.azure.resourcemanager.databoxedge.models.ClusterWitnessType; +import com.azure.resourcemanager.databoxedge.models.KeyVaultSyncStatus; +import com.azure.resourcemanager.databoxedge.models.Secret; import java.io.IOException; +import java.util.Map; /** * The properties of the Data Box Edge/Gateway device extended info. */ -@Fluent +@Immutable public final class DataBoxEdgeDeviceExtendedInfoProperties implements JsonSerializable { /* @@ -32,10 +36,70 @@ public final class DataBoxEdgeDeviceExtendedInfoProperties */ private String resourceKey; + /* + * The Key Vault ARM Id for client secrets + */ + private String clientSecretStoreId; + + /* + * The url to access the Client Key Vault + */ + private String clientSecretStoreUrl; + + /* + * The name of Channel Integrity Key stored in the Client Key Vault + */ + private String channelIntegrityKeyName; + + /* + * The version of Channel Integrity Key stored in the Client Key Vault + */ + private String channelIntegrityKeyVersion; + + /* + * Key vault sync status + */ + private KeyVaultSyncStatus keyVaultSyncStatus; + + /* + * Device secrets, will be returned only with ODataFilter $expand=deviceSecrets + */ + private Map deviceSecrets; + + /* + * Cluster Witness Type + */ + private ClusterWitnessType clusterWitnessType; + + /* + * The witness location of file share. + */ + private String fileShareWitnessLocation; + + /* + * The username of file share. + */ + private String fileShareWitnessUsername; + + /* + * The Cloud Witness Storage account name. + */ + private String cloudWitnessStorageAccountName; + + /* + * The Container for cloud witness in the storage account. + */ + private String cloudWitnessContainerName; + + /* + * The Azure service endpoint of the cloud witness storage account. + */ + private String cloudWitnessStorageEndpoint; + /** * Creates an instance of DataBoxEdgeDeviceExtendedInfoProperties class. */ - public DataBoxEdgeDeviceExtendedInfoProperties() { + private DataBoxEdgeDeviceExtendedInfoProperties() { } /** @@ -47,17 +111,6 @@ public String encryptionKeyThumbprint() { return this.encryptionKeyThumbprint; } - /** - * Set the encryptionKeyThumbprint property: The digital signature of encrypted certificate. - * - * @param encryptionKeyThumbprint the encryptionKeyThumbprint value to set. - * @return the DataBoxEdgeDeviceExtendedInfoProperties object itself. - */ - public DataBoxEdgeDeviceExtendedInfoProperties withEncryptionKeyThumbprint(String encryptionKeyThumbprint) { - this.encryptionKeyThumbprint = encryptionKeyThumbprint; - return this; - } - /** * Get the encryptionKey property: The public part of the encryption certificate. Client uses this to encrypt any * secret. @@ -69,32 +122,120 @@ public String encryptionKey() { } /** - * Set the encryptionKey property: The public part of the encryption certificate. Client uses this to encrypt any - * secret. + * Get the resourceKey property: The Resource ID of the Resource. * - * @param encryptionKey the encryptionKey value to set. - * @return the DataBoxEdgeDeviceExtendedInfoProperties object itself. + * @return the resourceKey value. */ - public DataBoxEdgeDeviceExtendedInfoProperties withEncryptionKey(String encryptionKey) { - this.encryptionKey = encryptionKey; - return this; + public String resourceKey() { + return this.resourceKey; } /** - * Get the resourceKey property: The Resource ID of the Resource. + * Get the clientSecretStoreId property: The Key Vault ARM Id for client secrets. * - * @return the resourceKey value. + * @return the clientSecretStoreId value. */ - public String resourceKey() { - return this.resourceKey; + public String clientSecretStoreId() { + return this.clientSecretStoreId; + } + + /** + * Get the clientSecretStoreUrl property: The url to access the Client Key Vault. + * + * @return the clientSecretStoreUrl value. + */ + public String clientSecretStoreUrl() { + return this.clientSecretStoreUrl; + } + + /** + * Get the channelIntegrityKeyName property: The name of Channel Integrity Key stored in the Client Key Vault. + * + * @return the channelIntegrityKeyName value. + */ + public String channelIntegrityKeyName() { + return this.channelIntegrityKeyName; + } + + /** + * Get the channelIntegrityKeyVersion property: The version of Channel Integrity Key stored in the Client Key Vault. + * + * @return the channelIntegrityKeyVersion value. + */ + public String channelIntegrityKeyVersion() { + return this.channelIntegrityKeyVersion; + } + + /** + * Get the keyVaultSyncStatus property: Key vault sync status. + * + * @return the keyVaultSyncStatus value. + */ + public KeyVaultSyncStatus keyVaultSyncStatus() { + return this.keyVaultSyncStatus; + } + + /** + * Get the deviceSecrets property: Device secrets, will be returned only with ODataFilter $expand=deviceSecrets. + * + * @return the deviceSecrets value. + */ + public Map deviceSecrets() { + return this.deviceSecrets; + } + + /** + * Get the clusterWitnessType property: Cluster Witness Type. + * + * @return the clusterWitnessType value. + */ + public ClusterWitnessType clusterWitnessType() { + return this.clusterWitnessType; + } + + /** + * Get the fileShareWitnessLocation property: The witness location of file share. + * + * @return the fileShareWitnessLocation value. + */ + public String fileShareWitnessLocation() { + return this.fileShareWitnessLocation; + } + + /** + * Get the fileShareWitnessUsername property: The username of file share. + * + * @return the fileShareWitnessUsername value. + */ + public String fileShareWitnessUsername() { + return this.fileShareWitnessUsername; + } + + /** + * Get the cloudWitnessStorageAccountName property: The Cloud Witness Storage account name. + * + * @return the cloudWitnessStorageAccountName value. + */ + public String cloudWitnessStorageAccountName() { + return this.cloudWitnessStorageAccountName; + } + + /** + * Get the cloudWitnessContainerName property: The Container for cloud witness in the storage account. + * + * @return the cloudWitnessContainerName value. + */ + public String cloudWitnessContainerName() { + return this.cloudWitnessContainerName; } /** - * Validates the instance. + * Get the cloudWitnessStorageEndpoint property: The Azure service endpoint of the cloud witness storage account. * - * @throws IllegalArgumentException thrown if the instance is not valid. + * @return the cloudWitnessStorageEndpoint value. */ - public void validate() { + public String cloudWitnessStorageEndpoint() { + return this.cloudWitnessStorageEndpoint; } /** @@ -105,6 +246,12 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); jsonWriter.writeStringField("encryptionKeyThumbprint", this.encryptionKeyThumbprint); jsonWriter.writeStringField("encryptionKey", this.encryptionKey); + jsonWriter.writeStringField("clientSecretStoreId", this.clientSecretStoreId); + jsonWriter.writeStringField("clientSecretStoreUrl", this.clientSecretStoreUrl); + jsonWriter.writeStringField("channelIntegrityKeyName", this.channelIntegrityKeyName); + jsonWriter.writeStringField("channelIntegrityKeyVersion", this.channelIntegrityKeyVersion); + jsonWriter.writeStringField("keyVaultSyncStatus", + this.keyVaultSyncStatus == null ? null : this.keyVaultSyncStatus.toString()); return jsonWriter.writeEndObject(); } @@ -130,6 +277,35 @@ public static DataBoxEdgeDeviceExtendedInfoProperties fromJson(JsonReader jsonRe deserializedDataBoxEdgeDeviceExtendedInfoProperties.encryptionKey = reader.getString(); } else if ("resourceKey".equals(fieldName)) { deserializedDataBoxEdgeDeviceExtendedInfoProperties.resourceKey = reader.getString(); + } else if ("clientSecretStoreId".equals(fieldName)) { + deserializedDataBoxEdgeDeviceExtendedInfoProperties.clientSecretStoreId = reader.getString(); + } else if ("clientSecretStoreUrl".equals(fieldName)) { + deserializedDataBoxEdgeDeviceExtendedInfoProperties.clientSecretStoreUrl = reader.getString(); + } else if ("channelIntegrityKeyName".equals(fieldName)) { + deserializedDataBoxEdgeDeviceExtendedInfoProperties.channelIntegrityKeyName = reader.getString(); + } else if ("channelIntegrityKeyVersion".equals(fieldName)) { + deserializedDataBoxEdgeDeviceExtendedInfoProperties.channelIntegrityKeyVersion = reader.getString(); + } else if ("keyVaultSyncStatus".equals(fieldName)) { + deserializedDataBoxEdgeDeviceExtendedInfoProperties.keyVaultSyncStatus + = KeyVaultSyncStatus.fromString(reader.getString()); + } else if ("deviceSecrets".equals(fieldName)) { + Map deviceSecrets = reader.readMap(reader1 -> Secret.fromJson(reader1)); + deserializedDataBoxEdgeDeviceExtendedInfoProperties.deviceSecrets = deviceSecrets; + } else if ("clusterWitnessType".equals(fieldName)) { + deserializedDataBoxEdgeDeviceExtendedInfoProperties.clusterWitnessType + = ClusterWitnessType.fromString(reader.getString()); + } else if ("fileShareWitnessLocation".equals(fieldName)) { + deserializedDataBoxEdgeDeviceExtendedInfoProperties.fileShareWitnessLocation = reader.getString(); + } else if ("fileShareWitnessUsername".equals(fieldName)) { + deserializedDataBoxEdgeDeviceExtendedInfoProperties.fileShareWitnessUsername = reader.getString(); + } else if ("cloudWitnessStorageAccountName".equals(fieldName)) { + deserializedDataBoxEdgeDeviceExtendedInfoProperties.cloudWitnessStorageAccountName + = reader.getString(); + } else if ("cloudWitnessContainerName".equals(fieldName)) { + deserializedDataBoxEdgeDeviceExtendedInfoProperties.cloudWitnessContainerName = reader.getString(); + } else if ("cloudWitnessStorageEndpoint".equals(fieldName)) { + deserializedDataBoxEdgeDeviceExtendedInfoProperties.cloudWitnessStorageEndpoint + = reader.getString(); } else { reader.skipChildren(); } diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/DataBoxEdgeDeviceInner.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/DataBoxEdgeDeviceInner.java index 86650ae8a7ba..62548be3df56 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/DataBoxEdgeDeviceInner.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/DataBoxEdgeDeviceInner.java @@ -1,17 +1,22 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; import com.azure.json.JsonReader; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; -import com.azure.resourcemanager.databoxedge.models.ArmBaseModel; +import com.azure.resourcemanager.databoxedge.models.DataBoxEdgeDeviceKind; import com.azure.resourcemanager.databoxedge.models.DataBoxEdgeDeviceStatus; +import com.azure.resourcemanager.databoxedge.models.DataResidency; import com.azure.resourcemanager.databoxedge.models.DeviceType; +import com.azure.resourcemanager.databoxedge.models.EdgeProfile; +import com.azure.resourcemanager.databoxedge.models.ResourceIdentity; +import com.azure.resourcemanager.databoxedge.models.ResourceMoveDetails; import com.azure.resourcemanager.databoxedge.models.RoleTypes; import com.azure.resourcemanager.databoxedge.models.Sku; import java.io.IOException; @@ -22,19 +27,11 @@ * The Data Box Edge/Gateway device. */ @Fluent -public final class DataBoxEdgeDeviceInner extends ArmBaseModel { +public final class DataBoxEdgeDeviceInner extends Resource { /* - * The location of the device. This is a supported and registered Azure geographical region (for example, West US, - * East US, or Southeast Asia). The geographical region of a device cannot be changed once it is created, but if an - * identical geographical region is specified on update, the request will succeed. - */ - private String location; - - /* - * The list of tags that describe the device. These tags can be used to view and group this device (across resource - * groups). + * The properties of the Data Box Edge/Gateway device. */ - private Map tags; + private DataBoxEdgeDeviceProperties innerProperties; /* * The SKU type. @@ -47,9 +44,19 @@ public final class DataBoxEdgeDeviceInner extends ArmBaseModel { private String etag; /* - * The properties of the Data Box Edge/Gateway device. + * Msi identity of the resource */ - private DataBoxEdgeDeviceProperties innerProperties; + private ResourceIdentity identity; + + /* + * The kind of the device. + */ + private DataBoxEdgeDeviceKind kind; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; /* * The type of the resource. @@ -73,49 +80,12 @@ public DataBoxEdgeDeviceInner() { } /** - * Get the location property: The location of the device. This is a supported and registered Azure geographical - * region (for example, West US, East US, or Southeast Asia). The geographical region of a device cannot be changed - * once it is created, but if an identical geographical region is specified on update, the request will succeed. - * - * @return the location value. - */ - public String location() { - return this.location; - } - - /** - * Set the location property: The location of the device. This is a supported and registered Azure geographical - * region (for example, West US, East US, or Southeast Asia). The geographical region of a device cannot be changed - * once it is created, but if an identical geographical region is specified on update, the request will succeed. - * - * @param location the location value to set. - * @return the DataBoxEdgeDeviceInner object itself. - */ - public DataBoxEdgeDeviceInner withLocation(String location) { - this.location = location; - return this; - } - - /** - * Get the tags property: The list of tags that describe the device. These tags can be used to view and group this - * device (across resource groups). - * - * @return the tags value. - */ - public Map tags() { - return this.tags; - } - - /** - * Set the tags property: The list of tags that describe the device. These tags can be used to view and group this - * device (across resource groups). + * Get the innerProperties property: The properties of the Data Box Edge/Gateway device. * - * @param tags the tags value to set. - * @return the DataBoxEdgeDeviceInner object itself. + * @return the innerProperties value. */ - public DataBoxEdgeDeviceInner withTags(Map tags) { - this.tags = tags; - return this; + private DataBoxEdgeDeviceProperties innerProperties() { + return this.innerProperties; } /** @@ -159,12 +129,41 @@ public DataBoxEdgeDeviceInner withEtag(String etag) { } /** - * Get the innerProperties property: The properties of the Data Box Edge/Gateway device. + * Get the identity property: Msi identity of the resource. * - * @return the innerProperties value. + * @return the identity value. */ - private DataBoxEdgeDeviceProperties innerProperties() { - return this.innerProperties; + public ResourceIdentity identity() { + return this.identity; + } + + /** + * Set the identity property: Msi identity of the resource. + * + * @param identity the identity value to set. + * @return the DataBoxEdgeDeviceInner object itself. + */ + public DataBoxEdgeDeviceInner withIdentity(ResourceIdentity identity) { + this.identity = identity; + return this; + } + + /** + * Get the kind property: The kind of the device. + * + * @return the kind value. + */ + public DataBoxEdgeDeviceKind kind() { + return this.kind; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; } /** @@ -198,26 +197,39 @@ public String id() { } /** - * Get the dataBoxEdgeDeviceStatus property: The status of the Data Box Edge/Gateway device. + * {@inheritDoc} + */ + @Override + public DataBoxEdgeDeviceInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public DataBoxEdgeDeviceInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Get the systemData property: DataBoxEdge Device Properties. * - * @return the dataBoxEdgeDeviceStatus value. + * @return the systemData value. */ - public DataBoxEdgeDeviceStatus dataBoxEdgeDeviceStatus() { - return this.innerProperties() == null ? null : this.innerProperties().dataBoxEdgeDeviceStatus(); + public SystemData systemDataPropertiesSystemData() { + return this.innerProperties() == null ? null : this.innerProperties().systemData(); } /** - * Set the dataBoxEdgeDeviceStatus property: The status of the Data Box Edge/Gateway device. + * Get the dataBoxEdgeDeviceStatus property: The status of the Data Box Edge/Gateway device. * - * @param dataBoxEdgeDeviceStatus the dataBoxEdgeDeviceStatus value to set. - * @return the DataBoxEdgeDeviceInner object itself. + * @return the dataBoxEdgeDeviceStatus value. */ - public DataBoxEdgeDeviceInner withDataBoxEdgeDeviceStatus(DataBoxEdgeDeviceStatus dataBoxEdgeDeviceStatus) { - if (this.innerProperties() == null) { - this.innerProperties = new DataBoxEdgeDeviceProperties(); - } - this.innerProperties().withDataBoxEdgeDeviceStatus(dataBoxEdgeDeviceStatus); - return this; + public DataBoxEdgeDeviceStatus dataBoxEdgeDeviceStatus() { + return this.innerProperties() == null ? null : this.innerProperties().dataBoxEdgeDeviceStatus(); } /** @@ -238,20 +250,6 @@ public String description() { return this.innerProperties() == null ? null : this.innerProperties().description(); } - /** - * Set the description property: The Description of the Data Box Edge/Gateway device. - * - * @param description the description value to set. - * @return the DataBoxEdgeDeviceInner object itself. - */ - public DataBoxEdgeDeviceInner withDescription(String description) { - if (this.innerProperties() == null) { - this.innerProperties = new DataBoxEdgeDeviceProperties(); - } - this.innerProperties().withDescription(description); - return this; - } - /** * Get the modelDescription property: The description of the Data Box Edge/Gateway device model. * @@ -261,20 +259,6 @@ public String modelDescription() { return this.innerProperties() == null ? null : this.innerProperties().modelDescription(); } - /** - * Set the modelDescription property: The description of the Data Box Edge/Gateway device model. - * - * @param modelDescription the modelDescription value to set. - * @return the DataBoxEdgeDeviceInner object itself. - */ - public DataBoxEdgeDeviceInner withModelDescription(String modelDescription) { - if (this.innerProperties() == null) { - this.innerProperties = new DataBoxEdgeDeviceProperties(); - } - this.innerProperties().withModelDescription(modelDescription); - return this; - } - /** * Get the deviceType property: The type of the Data Box Edge/Gateway device. * @@ -293,20 +277,6 @@ public String friendlyName() { return this.innerProperties() == null ? null : this.innerProperties().friendlyName(); } - /** - * Set the friendlyName property: The Data Box Edge/Gateway device name. - * - * @param friendlyName the friendlyName value to set. - * @return the DataBoxEdgeDeviceInner object itself. - */ - public DataBoxEdgeDeviceInner withFriendlyName(String friendlyName) { - if (this.innerProperties() == null) { - this.innerProperties = new DataBoxEdgeDeviceProperties(); - } - this.innerProperties().withFriendlyName(friendlyName); - return this; - } - /** * Get the culture property: The Data Box Edge/Gateway device culture. * @@ -380,26 +350,54 @@ public Integer nodeCount() { } /** - * Validates the instance. + * Get the resourceMoveDetails property: The details of the move operation on this resource. * - * @throws IllegalArgumentException thrown if the instance is not valid. + * @return the resourceMoveDetails value. */ - @Override - public void validate() { - if (location() == null) { - throw LOGGER.atError() - .log( - new IllegalArgumentException("Missing required property location in model DataBoxEdgeDeviceInner")); - } - if (sku() != null) { - sku().validate(); - } - if (innerProperties() != null) { - innerProperties().validate(); + public ResourceMoveDetails resourceMoveDetails() { + return this.innerProperties() == null ? null : this.innerProperties().resourceMoveDetails(); + } + + /** + * Get the edgeProfile property: The details of Edge Profile for this resource. + * + * @return the edgeProfile value. + */ + public EdgeProfile edgeProfile() { + return this.innerProperties() == null ? null : this.innerProperties().edgeProfile(); + } + + /** + * Get the dataResidency property: The details of data-residency related properties for this resource. + * + * @return the dataResidency value. + */ + public DataResidency dataResidency() { + return this.innerProperties() == null ? null : this.innerProperties().dataResidency(); + } + + /** + * Set the dataResidency property: The details of data-residency related properties for this resource. + * + * @param dataResidency the dataResidency value to set. + * @return the DataBoxEdgeDeviceInner object itself. + */ + public DataBoxEdgeDeviceInner withDataResidency(DataResidency dataResidency) { + if (this.innerProperties() == null) { + this.innerProperties = new DataBoxEdgeDeviceProperties(); } + this.innerProperties().withDataResidency(dataResidency); + return this; } - private static final ClientLogger LOGGER = new ClientLogger(DataBoxEdgeDeviceInner.class); + /** + * Get the kubernetesWorkloadProfile property: Kubernetes Workload Profile. + * + * @return the kubernetesWorkloadProfile value. + */ + public String kubernetesWorkloadProfile() { + return this.innerProperties() == null ? null : this.innerProperties().kubernetesWorkloadProfile(); + } /** * {@inheritDoc} @@ -407,11 +405,12 @@ public void validate() { @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); - jsonWriter.writeStringField("location", this.location); - jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.innerProperties); jsonWriter.writeJsonField("sku", this.sku); jsonWriter.writeStringField("etag", this.etag); - jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeJsonField("identity", this.identity); return jsonWriter.writeEndObject(); } @@ -438,16 +437,22 @@ public static DataBoxEdgeDeviceInner fromJson(JsonReader jsonReader) throws IOEx } else if ("type".equals(fieldName)) { deserializedDataBoxEdgeDeviceInner.type = reader.getString(); } else if ("location".equals(fieldName)) { - deserializedDataBoxEdgeDeviceInner.location = reader.getString(); + deserializedDataBoxEdgeDeviceInner.withLocation(reader.getString()); } else if ("tags".equals(fieldName)) { Map tags = reader.readMap(reader1 -> reader1.getString()); - deserializedDataBoxEdgeDeviceInner.tags = tags; + deserializedDataBoxEdgeDeviceInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedDataBoxEdgeDeviceInner.innerProperties = DataBoxEdgeDeviceProperties.fromJson(reader); } else if ("sku".equals(fieldName)) { deserializedDataBoxEdgeDeviceInner.sku = Sku.fromJson(reader); } else if ("etag".equals(fieldName)) { deserializedDataBoxEdgeDeviceInner.etag = reader.getString(); - } else if ("properties".equals(fieldName)) { - deserializedDataBoxEdgeDeviceInner.innerProperties = DataBoxEdgeDeviceProperties.fromJson(reader); + } else if ("identity".equals(fieldName)) { + deserializedDataBoxEdgeDeviceInner.identity = ResourceIdentity.fromJson(reader); + } else if ("kind".equals(fieldName)) { + deserializedDataBoxEdgeDeviceInner.kind = DataBoxEdgeDeviceKind.fromString(reader.getString()); + } else if ("systemData".equals(fieldName)) { + deserializedDataBoxEdgeDeviceInner.systemData = SystemData.fromJson(reader); } else { reader.skipChildren(); } diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/DataBoxEdgeDeviceProperties.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/DataBoxEdgeDeviceProperties.java index 3e58ce79da4d..a4822b7eb252 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/DataBoxEdgeDeviceProperties.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/DataBoxEdgeDeviceProperties.java @@ -1,16 +1,20 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.fluent.models; import com.azure.core.annotation.Fluent; +import com.azure.core.management.SystemData; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; import com.azure.resourcemanager.databoxedge.models.DataBoxEdgeDeviceStatus; +import com.azure.resourcemanager.databoxedge.models.DataResidency; import com.azure.resourcemanager.databoxedge.models.DeviceType; +import com.azure.resourcemanager.databoxedge.models.EdgeProfile; +import com.azure.resourcemanager.databoxedge.models.ResourceMoveDetails; import com.azure.resourcemanager.databoxedge.models.RoleTypes; import java.io.IOException; import java.util.List; @@ -20,6 +24,11 @@ */ @Fluent public final class DataBoxEdgeDeviceProperties implements JsonSerializable { + /* + * DataBoxEdge Device Properties + */ + private SystemData systemData; + /* * The status of the Data Box Edge/Gateway device. */ @@ -90,6 +99,26 @@ public final class DataBoxEdgeDeviceProperties implements JsonSerializable { + /* + * Edge Profile property of the Data Box Edge/Gateway device + */ + private EdgeProfilePatch edgeProfile; + + /** + * Creates an instance of DataBoxEdgeDevicePropertiesPatch class. + */ + public DataBoxEdgeDevicePropertiesPatch() { + } + + /** + * Get the edgeProfile property: Edge Profile property of the Data Box Edge/Gateway device. + * + * @return the edgeProfile value. + */ + public EdgeProfilePatch edgeProfile() { + return this.edgeProfile; + } + + /** + * Set the edgeProfile property: Edge Profile property of the Data Box Edge/Gateway device. + * + * @param edgeProfile the edgeProfile value to set. + * @return the DataBoxEdgeDevicePropertiesPatch object itself. + */ + public DataBoxEdgeDevicePropertiesPatch withEdgeProfile(EdgeProfilePatch edgeProfile) { + this.edgeProfile = edgeProfile; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("edgeProfile", this.edgeProfile); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DataBoxEdgeDevicePropertiesPatch from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DataBoxEdgeDevicePropertiesPatch if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the DataBoxEdgeDevicePropertiesPatch. + */ + public static DataBoxEdgeDevicePropertiesPatch fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DataBoxEdgeDevicePropertiesPatch deserializedDataBoxEdgeDevicePropertiesPatch + = new DataBoxEdgeDevicePropertiesPatch(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("edgeProfile".equals(fieldName)) { + deserializedDataBoxEdgeDevicePropertiesPatch.edgeProfile = EdgeProfilePatch.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedDataBoxEdgeDevicePropertiesPatch; + }); + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/DataBoxEdgeSkuListInner.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/DataBoxEdgeSkuListInner.java new file mode 100644 index 000000000000..2f4e5567a9a8 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/DataBoxEdgeSkuListInner.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.databoxedge.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.databoxedge.models.DataBoxEdgeSku; +import java.io.IOException; +import java.util.List; + +/** + * List of SKU Information objects. + */ +@Immutable +public final class DataBoxEdgeSkuListInner implements JsonSerializable { + /* + * The DataBoxEdgeSku items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of DataBoxEdgeSkuListInner class. + */ + private DataBoxEdgeSkuListInner() { + } + + /** + * Get the value property: The DataBoxEdgeSku items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DataBoxEdgeSkuListInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DataBoxEdgeSkuListInner if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the DataBoxEdgeSkuListInner. + */ + public static DataBoxEdgeSkuListInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DataBoxEdgeSkuListInner deserializedDataBoxEdgeSkuListInner = new DataBoxEdgeSkuListInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> DataBoxEdgeSku.fromJson(reader1)); + deserializedDataBoxEdgeSkuListInner.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedDataBoxEdgeSkuListInner.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedDataBoxEdgeSkuListInner; + }); + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/DeviceCapacityInfoInner.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/DeviceCapacityInfoInner.java new file mode 100644 index 000000000000..76059926523e --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/DeviceCapacityInfoInner.java @@ -0,0 +1,184 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.databoxedge.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.databoxedge.models.ClusterCapacityViewData; +import com.azure.resourcemanager.databoxedge.models.ClusterStorageViewData; +import com.azure.resourcemanager.databoxedge.models.HostCapacity; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.Map; + +/** + * Object for Capturing DeviceCapacityInfo. + */ +@Immutable +public final class DeviceCapacityInfoInner extends ProxyResource { + /* + * The device capacity properties. + */ + private DeviceCapacityInfoProperties innerProperties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of DeviceCapacityInfoInner class. + */ + private DeviceCapacityInfoInner() { + } + + /** + * Get the innerProperties property: The device capacity properties. + * + * @return the innerProperties value. + */ + private DeviceCapacityInfoProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Get the timeStamp property: Timestamp of request in UTC. + * + * @return the timeStamp value. + */ + public OffsetDateTime timeStamp() { + return this.innerProperties() == null ? null : this.innerProperties().timeStamp(); + } + + /** + * Get the clusterStorageCapacityInfo property: Cluster capacity data for storage resources (CSV). + * + * @return the clusterStorageCapacityInfo value. + */ + public ClusterStorageViewData clusterStorageCapacityInfo() { + return this.innerProperties() == null ? null : this.innerProperties().clusterStorageCapacityInfo(); + } + + /** + * Get the clusterComputeCapacityInfo property: Cluster capacity data for compute resources (Memory and GPU). + * + * @return the clusterComputeCapacityInfo value. + */ + public ClusterCapacityViewData clusterComputeCapacityInfo() { + return this.innerProperties() == null ? null : this.innerProperties().clusterComputeCapacityInfo(); + } + + /** + * Get the nodeCapacityInfos property: The dictionary of individual node names and node capacities in the cluster. + * + * @return the nodeCapacityInfos value. + */ + public Map nodeCapacityInfos() { + return this.innerProperties() == null ? null : this.innerProperties().nodeCapacityInfos(); + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DeviceCapacityInfoInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DeviceCapacityInfoInner if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the DeviceCapacityInfoInner. + */ + public static DeviceCapacityInfoInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DeviceCapacityInfoInner deserializedDeviceCapacityInfoInner = new DeviceCapacityInfoInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedDeviceCapacityInfoInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedDeviceCapacityInfoInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedDeviceCapacityInfoInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedDeviceCapacityInfoInner.innerProperties = DeviceCapacityInfoProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedDeviceCapacityInfoInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedDeviceCapacityInfoInner; + }); + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/DeviceCapacityInfoProperties.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/DeviceCapacityInfoProperties.java new file mode 100644 index 000000000000..585d496df08d --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/DeviceCapacityInfoProperties.java @@ -0,0 +1,139 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.databoxedge.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.databoxedge.models.ClusterCapacityViewData; +import com.azure.resourcemanager.databoxedge.models.ClusterStorageViewData; +import com.azure.resourcemanager.databoxedge.models.HostCapacity; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.Map; + +/** + * The properties of Device Capacity Info. + */ +@Immutable +public final class DeviceCapacityInfoProperties implements JsonSerializable { + /* + * Timestamp of request in UTC + */ + private OffsetDateTime timeStamp; + + /* + * Cluster capacity data for storage resources (CSV). + */ + private ClusterStorageViewData clusterStorageCapacityInfo; + + /* + * Cluster capacity data for compute resources (Memory and GPU). + */ + private ClusterCapacityViewData clusterComputeCapacityInfo; + + /* + * The dictionary of individual node names and node capacities in the cluster. + */ + private Map nodeCapacityInfos; + + /** + * Creates an instance of DeviceCapacityInfoProperties class. + */ + private DeviceCapacityInfoProperties() { + } + + /** + * Get the timeStamp property: Timestamp of request in UTC. + * + * @return the timeStamp value. + */ + public OffsetDateTime timeStamp() { + return this.timeStamp; + } + + /** + * Get the clusterStorageCapacityInfo property: Cluster capacity data for storage resources (CSV). + * + * @return the clusterStorageCapacityInfo value. + */ + public ClusterStorageViewData clusterStorageCapacityInfo() { + return this.clusterStorageCapacityInfo; + } + + /** + * Get the clusterComputeCapacityInfo property: Cluster capacity data for compute resources (Memory and GPU). + * + * @return the clusterComputeCapacityInfo value. + */ + public ClusterCapacityViewData clusterComputeCapacityInfo() { + return this.clusterComputeCapacityInfo; + } + + /** + * Get the nodeCapacityInfos property: The dictionary of individual node names and node capacities in the cluster. + * + * @return the nodeCapacityInfos value. + */ + public Map nodeCapacityInfos() { + return this.nodeCapacityInfos; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("timeStamp", + this.timeStamp == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.timeStamp)); + jsonWriter.writeJsonField("clusterStorageCapacityInfo", this.clusterStorageCapacityInfo); + jsonWriter.writeJsonField("clusterComputeCapacityInfo", this.clusterComputeCapacityInfo); + jsonWriter.writeMapField("nodeCapacityInfos", this.nodeCapacityInfos, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DeviceCapacityInfoProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DeviceCapacityInfoProperties if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the DeviceCapacityInfoProperties. + */ + public static DeviceCapacityInfoProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DeviceCapacityInfoProperties deserializedDeviceCapacityInfoProperties = new DeviceCapacityInfoProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("timeStamp".equals(fieldName)) { + deserializedDeviceCapacityInfoProperties.timeStamp = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("clusterStorageCapacityInfo".equals(fieldName)) { + deserializedDeviceCapacityInfoProperties.clusterStorageCapacityInfo + = ClusterStorageViewData.fromJson(reader); + } else if ("clusterComputeCapacityInfo".equals(fieldName)) { + deserializedDeviceCapacityInfoProperties.clusterComputeCapacityInfo + = ClusterCapacityViewData.fromJson(reader); + } else if ("nodeCapacityInfos".equals(fieldName)) { + Map nodeCapacityInfos + = reader.readMap(reader1 -> HostCapacity.fromJson(reader1)); + deserializedDeviceCapacityInfoProperties.nodeCapacityInfos = nodeCapacityInfos; + } else { + reader.skipChildren(); + } + } + + return deserializedDeviceCapacityInfoProperties; + }); + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/DeviceCapacityRequestInfoProperties.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/DeviceCapacityRequestInfoProperties.java new file mode 100644 index 000000000000..4616de77890b --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/DeviceCapacityRequestInfoProperties.java @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.databoxedge.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.databoxedge.models.VmPlacementRequestResult; +import java.io.IOException; +import java.util.List; + +/** + * Properties of Device Capacity Request Info containing VM's to be checked and their corresponding results. + */ +@Fluent +public final class DeviceCapacityRequestInfoProperties + implements JsonSerializable { + /* + * Array containing the sizes of the VMs for checking if its feasible to create them on the appliance. + */ + private List> vmPlacementQuery; + + /* + * Array of the VMs of the sizes in VmSizes can be provisioned on the appliance. + */ + private List vmPlacementResults; + + /** + * Creates an instance of DeviceCapacityRequestInfoProperties class. + */ + public DeviceCapacityRequestInfoProperties() { + } + + /** + * Get the vmPlacementQuery property: Array containing the sizes of the VMs for checking if its feasible to create + * them on the appliance. + * + * @return the vmPlacementQuery value. + */ + public List> vmPlacementQuery() { + return this.vmPlacementQuery; + } + + /** + * Set the vmPlacementQuery property: Array containing the sizes of the VMs for checking if its feasible to create + * them on the appliance. + * + * @param vmPlacementQuery the vmPlacementQuery value to set. + * @return the DeviceCapacityRequestInfoProperties object itself. + */ + public DeviceCapacityRequestInfoProperties withVmPlacementQuery(List> vmPlacementQuery) { + this.vmPlacementQuery = vmPlacementQuery; + return this; + } + + /** + * Get the vmPlacementResults property: Array of the VMs of the sizes in VmSizes can be provisioned on the + * appliance. + * + * @return the vmPlacementResults value. + */ + public List vmPlacementResults() { + return this.vmPlacementResults; + } + + /** + * Set the vmPlacementResults property: Array of the VMs of the sizes in VmSizes can be provisioned on the + * appliance. + * + * @param vmPlacementResults the vmPlacementResults value to set. + * @return the DeviceCapacityRequestInfoProperties object itself. + */ + public DeviceCapacityRequestInfoProperties + withVmPlacementResults(List vmPlacementResults) { + this.vmPlacementResults = vmPlacementResults; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("vmPlacementQuery", this.vmPlacementQuery, + (writer, element) -> writer.writeArray(element, (writer1, element1) -> writer1.writeString(element1))); + jsonWriter.writeArrayField("vmPlacementResults", this.vmPlacementResults, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DeviceCapacityRequestInfoProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DeviceCapacityRequestInfoProperties if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the DeviceCapacityRequestInfoProperties. + */ + public static DeviceCapacityRequestInfoProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DeviceCapacityRequestInfoProperties deserializedDeviceCapacityRequestInfoProperties + = new DeviceCapacityRequestInfoProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("vmPlacementQuery".equals(fieldName)) { + List> vmPlacementQuery + = reader.readArray(reader1 -> reader1.readArray(reader2 -> reader2.getString())); + deserializedDeviceCapacityRequestInfoProperties.vmPlacementQuery = vmPlacementQuery; + } else if ("vmPlacementResults".equals(fieldName)) { + List vmPlacementResults + = reader.readArray(reader1 -> VmPlacementRequestResult.fromJson(reader1)); + deserializedDeviceCapacityRequestInfoProperties.vmPlacementResults = vmPlacementResults; + } else { + reader.skipChildren(); + } + } + + return deserializedDeviceCapacityRequestInfoProperties; + }); + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/DiagnosticProactiveLogCollectionSettingsInner.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/DiagnosticProactiveLogCollectionSettingsInner.java new file mode 100644 index 000000000000..8c0800259ff6 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/DiagnosticProactiveLogCollectionSettingsInner.java @@ -0,0 +1,169 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.databoxedge.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.databoxedge.models.ProactiveDiagnosticsConsent; +import java.io.IOException; + +/** + * The diagnostic proactive log collection settings of a device. + */ +@Fluent +public final class DiagnosticProactiveLogCollectionSettingsInner extends ProxyResource { + /* + * Properties of the diagnostic proactive log collection settings. + */ + private ProactiveLogCollectionSettingsProperties innerProperties = new ProactiveLogCollectionSettingsProperties(); + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of DiagnosticProactiveLogCollectionSettingsInner class. + */ + public DiagnosticProactiveLogCollectionSettingsInner() { + } + + /** + * Get the innerProperties property: Properties of the diagnostic proactive log collection settings. + * + * @return the innerProperties value. + */ + private ProactiveLogCollectionSettingsProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Get the userConsent property: Proactive diagnostic collection consent flag. + * + * @return the userConsent value. + */ + public ProactiveDiagnosticsConsent userConsent() { + return this.innerProperties() == null ? null : this.innerProperties().userConsent(); + } + + /** + * Set the userConsent property: Proactive diagnostic collection consent flag. + * + * @param userConsent the userConsent value to set. + * @return the DiagnosticProactiveLogCollectionSettingsInner object itself. + */ + public DiagnosticProactiveLogCollectionSettingsInner withUserConsent(ProactiveDiagnosticsConsent userConsent) { + if (this.innerProperties() == null) { + this.innerProperties = new ProactiveLogCollectionSettingsProperties(); + } + this.innerProperties().withUserConsent(userConsent); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DiagnosticProactiveLogCollectionSettingsInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DiagnosticProactiveLogCollectionSettingsInner if the JsonReader was pointing to an + * instance of it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the DiagnosticProactiveLogCollectionSettingsInner. + */ + public static DiagnosticProactiveLogCollectionSettingsInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DiagnosticProactiveLogCollectionSettingsInner deserializedDiagnosticProactiveLogCollectionSettingsInner + = new DiagnosticProactiveLogCollectionSettingsInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedDiagnosticProactiveLogCollectionSettingsInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedDiagnosticProactiveLogCollectionSettingsInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedDiagnosticProactiveLogCollectionSettingsInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedDiagnosticProactiveLogCollectionSettingsInner.innerProperties + = ProactiveLogCollectionSettingsProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedDiagnosticProactiveLogCollectionSettingsInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedDiagnosticProactiveLogCollectionSettingsInner; + }); + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/DiagnosticRemoteSupportSettingsInner.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/DiagnosticRemoteSupportSettingsInner.java new file mode 100644 index 000000000000..22a69262bb90 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/DiagnosticRemoteSupportSettingsInner.java @@ -0,0 +1,171 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.databoxedge.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.databoxedge.models.RemoteSupportSettings; +import java.io.IOException; +import java.util.List; + +/** + * The remote support settings of a device. + */ +@Fluent +public final class DiagnosticRemoteSupportSettingsInner extends ProxyResource { + /* + * Properties of the remote support settings. + */ + private DiagnosticRemoteSupportSettingsProperties innerProperties = new DiagnosticRemoteSupportSettingsProperties(); + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of DiagnosticRemoteSupportSettingsInner class. + */ + public DiagnosticRemoteSupportSettingsInner() { + } + + /** + * Get the innerProperties property: Properties of the remote support settings. + * + * @return the innerProperties value. + */ + private DiagnosticRemoteSupportSettingsProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Get the remoteSupportSettingsList property: Remote support settings list according to the RemoteApplicationType. + * + * @return the remoteSupportSettingsList value. + */ + public List remoteSupportSettingsList() { + return this.innerProperties() == null ? null : this.innerProperties().remoteSupportSettingsList(); + } + + /** + * Set the remoteSupportSettingsList property: Remote support settings list according to the RemoteApplicationType. + * + * @param remoteSupportSettingsList the remoteSupportSettingsList value to set. + * @return the DiagnosticRemoteSupportSettingsInner object itself. + */ + public DiagnosticRemoteSupportSettingsInner + withRemoteSupportSettingsList(List remoteSupportSettingsList) { + if (this.innerProperties() == null) { + this.innerProperties = new DiagnosticRemoteSupportSettingsProperties(); + } + this.innerProperties().withRemoteSupportSettingsList(remoteSupportSettingsList); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DiagnosticRemoteSupportSettingsInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DiagnosticRemoteSupportSettingsInner if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the DiagnosticRemoteSupportSettingsInner. + */ + public static DiagnosticRemoteSupportSettingsInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DiagnosticRemoteSupportSettingsInner deserializedDiagnosticRemoteSupportSettingsInner + = new DiagnosticRemoteSupportSettingsInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedDiagnosticRemoteSupportSettingsInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedDiagnosticRemoteSupportSettingsInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedDiagnosticRemoteSupportSettingsInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedDiagnosticRemoteSupportSettingsInner.innerProperties + = DiagnosticRemoteSupportSettingsProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedDiagnosticRemoteSupportSettingsInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedDiagnosticRemoteSupportSettingsInner; + }); + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/DiagnosticRemoteSupportSettingsProperties.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/DiagnosticRemoteSupportSettingsProperties.java new file mode 100644 index 000000000000..1e4112dab41c --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/DiagnosticRemoteSupportSettingsProperties.java @@ -0,0 +1,94 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.databoxedge.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.databoxedge.models.RemoteSupportSettings; +import java.io.IOException; +import java.util.List; + +/** + * The properties of remote support settings. + */ +@Fluent +public final class DiagnosticRemoteSupportSettingsProperties + implements JsonSerializable { + /* + * Remote support settings list according to the RemoteApplicationType + */ + private List remoteSupportSettingsList; + + /** + * Creates an instance of DiagnosticRemoteSupportSettingsProperties class. + */ + public DiagnosticRemoteSupportSettingsProperties() { + } + + /** + * Get the remoteSupportSettingsList property: Remote support settings list according to the RemoteApplicationType. + * + * @return the remoteSupportSettingsList value. + */ + public List remoteSupportSettingsList() { + return this.remoteSupportSettingsList; + } + + /** + * Set the remoteSupportSettingsList property: Remote support settings list according to the RemoteApplicationType. + * + * @param remoteSupportSettingsList the remoteSupportSettingsList value to set. + * @return the DiagnosticRemoteSupportSettingsProperties object itself. + */ + public DiagnosticRemoteSupportSettingsProperties + withRemoteSupportSettingsList(List remoteSupportSettingsList) { + this.remoteSupportSettingsList = remoteSupportSettingsList; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("remoteSupportSettingsList", this.remoteSupportSettingsList, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DiagnosticRemoteSupportSettingsProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DiagnosticRemoteSupportSettingsProperties if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the DiagnosticRemoteSupportSettingsProperties. + */ + public static DiagnosticRemoteSupportSettingsProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DiagnosticRemoteSupportSettingsProperties deserializedDiagnosticRemoteSupportSettingsProperties + = new DiagnosticRemoteSupportSettingsProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("remoteSupportSettingsList".equals(fieldName)) { + List remoteSupportSettingsList + = reader.readArray(reader1 -> RemoteSupportSettings.fromJson(reader1)); + deserializedDiagnosticRemoteSupportSettingsProperties.remoteSupportSettingsList + = remoteSupportSettingsList; + } else { + reader.skipChildren(); + } + } + + return deserializedDiagnosticRemoteSupportSettingsProperties; + }); + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/GenerateCertResponseInner.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/GenerateCertResponseInner.java new file mode 100644 index 000000000000..e3d335dadd01 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/GenerateCertResponseInner.java @@ -0,0 +1,112 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.databoxedge.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Used in activation key generation flow. + */ +@Immutable +public final class GenerateCertResponseInner implements JsonSerializable { + /* + * Gets or sets base64 encoded certificate raw data, + * this is the public part needed to be uploaded to cert vault + */ + private String publicKey; + + /* + * Gets or sets base64 encoded private part of the certificate, + * needed to form the activation key + */ + private String privateKey; + + /* + * Gets or sets expiry time in UTC + */ + private String expiryTimeInUTC; + + /** + * Creates an instance of GenerateCertResponseInner class. + */ + private GenerateCertResponseInner() { + } + + /** + * Get the publicKey property: Gets or sets base64 encoded certificate raw data, + * this is the public part needed to be uploaded to cert vault. + * + * @return the publicKey value. + */ + public String publicKey() { + return this.publicKey; + } + + /** + * Get the privateKey property: Gets or sets base64 encoded private part of the certificate, + * needed to form the activation key. + * + * @return the privateKey value. + */ + public String privateKey() { + return this.privateKey; + } + + /** + * Get the expiryTimeInUTC property: Gets or sets expiry time in UTC. + * + * @return the expiryTimeInUTC value. + */ + public String expiryTimeInUTC() { + return this.expiryTimeInUTC; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("publicKey", this.publicKey); + jsonWriter.writeStringField("privateKey", this.privateKey); + jsonWriter.writeStringField("expiryTimeInUTC", this.expiryTimeInUTC); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of GenerateCertResponseInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of GenerateCertResponseInner if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the GenerateCertResponseInner. + */ + public static GenerateCertResponseInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + GenerateCertResponseInner deserializedGenerateCertResponseInner = new GenerateCertResponseInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("publicKey".equals(fieldName)) { + deserializedGenerateCertResponseInner.publicKey = reader.getString(); + } else if ("privateKey".equals(fieldName)) { + deserializedGenerateCertResponseInner.privateKey = reader.getString(); + } else if ("expiryTimeInUTC".equals(fieldName)) { + deserializedGenerateCertResponseInner.expiryTimeInUTC = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedGenerateCertResponseInner; + }); + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/JobInner.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/JobInner.java index 4e90e64710b8..2805a565d613 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/JobInner.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/JobInner.java @@ -1,13 +1,14 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.fluent.models; import com.azure.core.annotation.Immutable; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; import com.azure.core.util.CoreUtils; import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; import com.azure.resourcemanager.databoxedge.models.JobErrorDetails; @@ -23,21 +24,11 @@ * A device job. */ @Immutable -public final class JobInner implements JsonSerializable { +public final class JobInner extends ProxyResource { /* - * The path ID that uniquely identifies the object. - */ - private String id; - - /* - * The name of the object. - */ - private String name; - - /* - * The hierarchical type of the object. + * The properties of the job. */ - private String type; + private JobProperties innerProperties; /* * The current status of the job. @@ -65,41 +56,38 @@ public final class JobInner implements JsonSerializable { private JobErrorDetails error; /* - * The properties of the job. + * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ - private JobProperties innerProperties; + private SystemData systemData; - /** - * Creates an instance of JobInner class. + /* + * The type of the resource. */ - public JobInner() { - } + private String type; - /** - * Get the id property: The path ID that uniquely identifies the object. - * - * @return the id value. + /* + * The name of the resource. */ - public String id() { - return this.id; - } + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; /** - * Get the name property: The name of the object. - * - * @return the name value. + * Creates an instance of JobInner class. */ - public String name() { - return this.name; + private JobInner() { } /** - * Get the type property: The hierarchical type of the object. + * Get the innerProperties property: The properties of the job. * - * @return the type value. + * @return the innerProperties value. */ - public String type() { - return this.type; + private JobProperties innerProperties() { + return this.innerProperties; } /** @@ -148,12 +136,42 @@ public JobErrorDetails error() { } /** - * Get the innerProperties property: The properties of the job. + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * - * @return the innerProperties value. + * @return the systemData value. */ - private JobProperties innerProperties() { - return this.innerProperties; + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; } /** @@ -230,41 +248,13 @@ public String folder() { return this.innerProperties() == null ? null : this.innerProperties().folder(); } - /** - * Set the folder property: If only subfolders need to be refreshed, then the subfolder path inside the share or - * container. (The path is empty if there are no subfolders.). - * - * @param folder the folder value to set. - * @return the JobInner object itself. - */ - public JobInner withFolder(String folder) { - if (this.innerProperties() == null) { - this.innerProperties = new JobProperties(); - } - this.innerProperties().withFolder(folder); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (error() != null) { - error().validate(); - } - if (innerProperties() != null) { - innerProperties().validate(); - } - } - /** * {@inheritDoc} */ @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); return jsonWriter.writeEndObject(); } @@ -274,6 +264,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { * @param jsonReader The JsonReader being read. * @return An instance of JobInner if the JsonReader was pointing to an instance of it, or null if it was pointing * to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. * @throws IOException If an error occurs while reading the JobInner. */ public static JobInner fromJson(JsonReader jsonReader) throws IOException { @@ -289,6 +280,8 @@ public static JobInner fromJson(JsonReader jsonReader) throws IOException { deserializedJobInner.name = reader.getString(); } else if ("type".equals(fieldName)) { deserializedJobInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedJobInner.innerProperties = JobProperties.fromJson(reader); } else if ("status".equals(fieldName)) { deserializedJobInner.status = JobStatus.fromString(reader.getString()); } else if ("startTime".equals(fieldName)) { @@ -301,8 +294,8 @@ public static JobInner fromJson(JsonReader jsonReader) throws IOException { deserializedJobInner.percentComplete = reader.getNullable(JsonReader::getInt); } else if ("error".equals(fieldName)) { deserializedJobInner.error = JobErrorDetails.fromJson(reader); - } else if ("properties".equals(fieldName)) { - deserializedJobInner.innerProperties = JobProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedJobInner.systemData = SystemData.fromJson(reader); } else { reader.skipChildren(); } diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/JobProperties.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/JobProperties.java index df571fe30367..6f6fb2af4393 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/JobProperties.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/JobProperties.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.fluent.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -18,7 +18,7 @@ /** * The properties for the job. */ -@Fluent +@Immutable public final class JobProperties implements JsonSerializable { /* * The type of the job. @@ -64,7 +64,7 @@ public final class JobProperties implements JsonSerializable { /** * Creates an instance of JobProperties class. */ - public JobProperties() { + private JobProperties() { } /** @@ -141,32 +141,6 @@ public String folder() { return this.folder; } - /** - * Set the folder property: If only subfolders need to be refreshed, then the subfolder path inside the share or - * container. (The path is empty if there are no subfolders.). - * - * @param folder the folder value to set. - * @return the JobProperties object itself. - */ - public JobProperties withFolder(String folder) { - this.folder = folder; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (downloadProgress() != null) { - downloadProgress().validate(); - } - if (installProgress() != null) { - installProgress().validate(); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/MonitoringMetricConfigurationInner.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/MonitoringMetricConfigurationInner.java new file mode 100644 index 000000000000..162df9617221 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/MonitoringMetricConfigurationInner.java @@ -0,0 +1,170 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.databoxedge.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.databoxedge.models.MetricConfiguration; +import java.io.IOException; +import java.util.List; + +/** + * The metric setting details for the role. + */ +@Fluent +public final class MonitoringMetricConfigurationInner extends ProxyResource { + /* + * The metric setting properties. + */ + private MonitoringMetricConfigurationProperties innerProperties = new MonitoringMetricConfigurationProperties(); + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of MonitoringMetricConfigurationInner class. + */ + public MonitoringMetricConfigurationInner() { + } + + /** + * Get the innerProperties property: The metric setting properties. + * + * @return the innerProperties value. + */ + private MonitoringMetricConfigurationProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Get the metricConfigurations property: The metrics configuration details. + * + * @return the metricConfigurations value. + */ + public List metricConfigurations() { + return this.innerProperties() == null ? null : this.innerProperties().metricConfigurations(); + } + + /** + * Set the metricConfigurations property: The metrics configuration details. + * + * @param metricConfigurations the metricConfigurations value to set. + * @return the MonitoringMetricConfigurationInner object itself. + */ + public MonitoringMetricConfigurationInner withMetricConfigurations(List metricConfigurations) { + if (this.innerProperties() == null) { + this.innerProperties = new MonitoringMetricConfigurationProperties(); + } + this.innerProperties().withMetricConfigurations(metricConfigurations); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MonitoringMetricConfigurationInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MonitoringMetricConfigurationInner if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the MonitoringMetricConfigurationInner. + */ + public static MonitoringMetricConfigurationInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MonitoringMetricConfigurationInner deserializedMonitoringMetricConfigurationInner + = new MonitoringMetricConfigurationInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedMonitoringMetricConfigurationInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedMonitoringMetricConfigurationInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedMonitoringMetricConfigurationInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedMonitoringMetricConfigurationInner.innerProperties + = MonitoringMetricConfigurationProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedMonitoringMetricConfigurationInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedMonitoringMetricConfigurationInner; + }); + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/MonitoringMetricConfigurationProperties.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/MonitoringMetricConfigurationProperties.java new file mode 100644 index 000000000000..6be63e54cf23 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/MonitoringMetricConfigurationProperties.java @@ -0,0 +1,94 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.databoxedge.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.databoxedge.models.MetricConfiguration; +import java.io.IOException; +import java.util.List; + +/** + * Metrics properties. + */ +@Fluent +public final class MonitoringMetricConfigurationProperties + implements JsonSerializable { + /* + * The metrics configuration details + */ + private List metricConfigurations; + + /** + * Creates an instance of MonitoringMetricConfigurationProperties class. + */ + public MonitoringMetricConfigurationProperties() { + } + + /** + * Get the metricConfigurations property: The metrics configuration details. + * + * @return the metricConfigurations value. + */ + public List metricConfigurations() { + return this.metricConfigurations; + } + + /** + * Set the metricConfigurations property: The metrics configuration details. + * + * @param metricConfigurations the metricConfigurations value to set. + * @return the MonitoringMetricConfigurationProperties object itself. + */ + public MonitoringMetricConfigurationProperties + withMetricConfigurations(List metricConfigurations) { + this.metricConfigurations = metricConfigurations; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("metricConfigurations", this.metricConfigurations, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MonitoringMetricConfigurationProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MonitoringMetricConfigurationProperties if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the MonitoringMetricConfigurationProperties. + */ + public static MonitoringMetricConfigurationProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MonitoringMetricConfigurationProperties deserializedMonitoringMetricConfigurationProperties + = new MonitoringMetricConfigurationProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("metricConfigurations".equals(fieldName)) { + List metricConfigurations + = reader.readArray(reader1 -> MetricConfiguration.fromJson(reader1)); + deserializedMonitoringMetricConfigurationProperties.metricConfigurations = metricConfigurations; + } else { + reader.skipChildren(); + } + } + + return deserializedMonitoringMetricConfigurationProperties; + }); + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/NetworkSettingsInner.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/NetworkSettingsInner.java index 0331e119725d..e85b5e077967 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/NetworkSettingsInner.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/NetworkSettingsInner.java @@ -1,14 +1,15 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.fluent.models; import com.azure.core.annotation.Immutable; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; import com.azure.json.JsonReader; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; -import com.azure.resourcemanager.databoxedge.models.ArmBaseModel; import com.azure.resourcemanager.databoxedge.models.NetworkAdapter; import java.io.IOException; import java.util.List; @@ -17,12 +18,17 @@ * The network settings of a device. */ @Immutable -public final class NetworkSettingsInner extends ArmBaseModel { +public final class NetworkSettingsInner extends ProxyResource { /* * The properties of network settings of a device. */ private NetworkSettingsProperties innerProperties; + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + /* * The type of the resource. */ @@ -41,7 +47,7 @@ public final class NetworkSettingsInner extends ArmBaseModel { /** * Creates an instance of NetworkSettingsInner class. */ - public NetworkSettingsInner() { + private NetworkSettingsInner() { } /** @@ -53,6 +59,15 @@ private NetworkSettingsProperties innerProperties() { return this.innerProperties; } + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + /** * Get the type property: The type of the resource. * @@ -92,24 +107,13 @@ public List networkAdapters() { return this.innerProperties() == null ? null : this.innerProperties().networkAdapters(); } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } - /** * {@inheritDoc} */ @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); return jsonWriter.writeEndObject(); } @@ -137,6 +141,8 @@ public static NetworkSettingsInner fromJson(JsonReader jsonReader) throws IOExce deserializedNetworkSettingsInner.type = reader.getString(); } else if ("properties".equals(fieldName)) { deserializedNetworkSettingsInner.innerProperties = NetworkSettingsProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedNetworkSettingsInner.systemData = SystemData.fromJson(reader); } else { reader.skipChildren(); } diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/NetworkSettingsProperties.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/NetworkSettingsProperties.java index 52d404f52d5d..32b77e4a6b36 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/NetworkSettingsProperties.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/NetworkSettingsProperties.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.fluent.models; @@ -26,7 +26,7 @@ public final class NetworkSettingsProperties implements JsonSerializable networkAdapters() { return this.networkAdapters; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (networkAdapters() != null) { - networkAdapters().forEach(e -> e.validate()); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/NodeInner.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/NodeInner.java index 59cbdf6c6b6e..849f46a14fe4 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/NodeInner.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/NodeInner.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.fluent.models; @@ -8,7 +8,7 @@ import com.azure.json.JsonReader; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; -import com.azure.resourcemanager.databoxedge.models.ArmBaseModel; +import com.azure.resourcemanager.databoxedge.models.ARMBaseModel; import com.azure.resourcemanager.databoxedge.models.NodeStatus; import java.io.IOException; @@ -18,31 +18,31 @@ * Multi-node Edge devices will have more than 1 nodes. */ @Immutable -public final class NodeInner extends ArmBaseModel { +public final class NodeInner extends ARMBaseModel { /* * The properties of the node */ private NodeProperties innerProperties; /* - * The type of the resource. + * The hierarchical type of the object. */ private String type; /* - * The name of the resource. + * The object name. */ private String name; /* - * Fully qualified resource Id for the resource. + * The path ID that uniquely identifies the object. */ private String id; /** * Creates an instance of NodeInner class. */ - public NodeInner() { + private NodeInner() { } /** @@ -55,7 +55,7 @@ private NodeProperties innerProperties() { } /** - * Get the type property: The type of the resource. + * Get the type property: The hierarchical type of the object. * * @return the type value. */ @@ -65,7 +65,7 @@ public String type() { } /** - * Get the name property: The name of the resource. + * Get the name property: The object name. * * @return the name value. */ @@ -75,7 +75,7 @@ public String name() { } /** - * Get the id property: Fully qualified resource Id for the resource. + * Get the id property: The path ID that uniquely identifies the object. * * @return the id value. */ @@ -148,18 +148,6 @@ public String nodeInstanceId() { return this.innerProperties() == null ? null : this.innerProperties().nodeInstanceId(); } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } - /** * {@inheritDoc} */ @@ -175,7 +163,6 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { * @param jsonReader The JsonReader being read. * @return An instance of NodeInner if the JsonReader was pointing to an instance of it, or null if it was pointing * to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. * @throws IOException If an error occurs while reading the NodeInner. */ public static NodeInner fromJson(JsonReader jsonReader) throws IOException { diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/NodeProperties.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/NodeProperties.java index 8f19a2cdcb0c..f1ff6e96a515 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/NodeProperties.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/NodeProperties.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.fluent.models; @@ -55,7 +55,7 @@ public final class NodeProperties implements JsonSerializable { /** * Creates an instance of NodeProperties class. */ - public NodeProperties() { + private NodeProperties() { } /** @@ -122,14 +122,6 @@ public String nodeInstanceId() { return this.nodeInstanceId; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/OperationInner.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/OperationInner.java index 60e508521c8f..069c8c2795fa 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/OperationInner.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/OperationInner.java @@ -1,51 +1,63 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.fluent.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; +import com.azure.resourcemanager.databoxedge.models.ActionType; import com.azure.resourcemanager.databoxedge.models.OperationDisplay; -import com.azure.resourcemanager.databoxedge.models.ServiceSpecification; +import com.azure.resourcemanager.databoxedge.models.Origin; import java.io.IOException; /** - * Operations. + * REST API Operation + * + * Details of a REST API operation, returned from the Resource Provider Operations API. */ -@Fluent +@Immutable public final class OperationInner implements JsonSerializable { /* - * Name of the operation. + * The name of the operation, as per Resource-Based Access Control (RBAC). Examples: + * "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action" */ private String name; /* - * Properties displayed for the operation. + * Whether the operation applies to data-plane. This is "true" for data-plane operations and "false" for Azure + * Resource Manager/control-plane operations. + */ + private Boolean isDataAction; + + /* + * Localized display information for this particular operation. */ private OperationDisplay display; /* - * Origin of the operation. + * The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default + * value is "user,system" */ - private String origin; + private Origin origin; /* - * Operation properties. + * Extensible enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. */ - private OperationProperties innerProperties; + private ActionType actionType; /** * Creates an instance of OperationInner class. */ - public OperationInner() { + private OperationInner() { } /** - * Get the name property: Name of the operation. + * Get the name property: The name of the operation, as per Resource-Based Access Control (RBAC). Examples: + * "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action". * * @return the name value. */ @@ -54,18 +66,17 @@ public String name() { } /** - * Set the name property: Name of the operation. + * Get the isDataAction property: Whether the operation applies to data-plane. This is "true" for data-plane + * operations and "false" for Azure Resource Manager/control-plane operations. * - * @param name the name value to set. - * @return the OperationInner object itself. + * @return the isDataAction value. */ - public OperationInner withName(String name) { - this.name = name; - return this; + public Boolean isDataAction() { + return this.isDataAction; } /** - * Get the display property: Properties displayed for the operation. + * Get the display property: Localized display information for this particular operation. * * @return the display value. */ @@ -74,80 +85,23 @@ public OperationDisplay display() { } /** - * Set the display property: Properties displayed for the operation. - * - * @param display the display value to set. - * @return the OperationInner object itself. - */ - public OperationInner withDisplay(OperationDisplay display) { - this.display = display; - return this; - } - - /** - * Get the origin property: Origin of the operation. + * Get the origin property: The intended executor of the operation; as in Resource Based Access Control (RBAC) and + * audit logs UX. Default value is "user,system". * * @return the origin value. */ - public String origin() { + public Origin origin() { return this.origin; } /** - * Set the origin property: Origin of the operation. - * - * @param origin the origin value to set. - * @return the OperationInner object itself. - */ - public OperationInner withOrigin(String origin) { - this.origin = origin; - return this; - } - - /** - * Get the innerProperties property: Operation properties. - * - * @return the innerProperties value. - */ - private OperationProperties innerProperties() { - return this.innerProperties; - } - - /** - * Get the serviceSpecification property: Service specification. - * - * @return the serviceSpecification value. - */ - public ServiceSpecification serviceSpecification() { - return this.innerProperties() == null ? null : this.innerProperties().serviceSpecification(); - } - - /** - * Set the serviceSpecification property: Service specification. - * - * @param serviceSpecification the serviceSpecification value to set. - * @return the OperationInner object itself. - */ - public OperationInner withServiceSpecification(ServiceSpecification serviceSpecification) { - if (this.innerProperties() == null) { - this.innerProperties = new OperationProperties(); - } - this.innerProperties().withServiceSpecification(serviceSpecification); - return this; - } - - /** - * Validates the instance. + * Get the actionType property: Extensible enum. Indicates the action type. "Internal" refers to actions that are + * for internal only APIs. * - * @throws IllegalArgumentException thrown if the instance is not valid. + * @return the actionType value. */ - public void validate() { - if (display() != null) { - display().validate(); - } - if (innerProperties() != null) { - innerProperties().validate(); - } + public ActionType actionType() { + return this.actionType; } /** @@ -156,10 +110,7 @@ public void validate() { @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); - jsonWriter.writeStringField("name", this.name); jsonWriter.writeJsonField("display", this.display); - jsonWriter.writeStringField("origin", this.origin); - jsonWriter.writeJsonField("properties", this.innerProperties); return jsonWriter.writeEndObject(); } @@ -180,12 +131,14 @@ public static OperationInner fromJson(JsonReader jsonReader) throws IOException if ("name".equals(fieldName)) { deserializedOperationInner.name = reader.getString(); + } else if ("isDataAction".equals(fieldName)) { + deserializedOperationInner.isDataAction = reader.getNullable(JsonReader::getBoolean); } else if ("display".equals(fieldName)) { deserializedOperationInner.display = OperationDisplay.fromJson(reader); } else if ("origin".equals(fieldName)) { - deserializedOperationInner.origin = reader.getString(); - } else if ("properties".equals(fieldName)) { - deserializedOperationInner.innerProperties = OperationProperties.fromJson(reader); + deserializedOperationInner.origin = Origin.fromString(reader.getString()); + } else if ("actionType".equals(fieldName)) { + deserializedOperationInner.actionType = ActionType.fromString(reader.getString()); } else { reader.skipChildren(); } diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/OrderInner.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/OrderInner.java index 89742d193be8..96384b411662 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/OrderInner.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/OrderInner.java @@ -1,17 +1,19 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.fluent.models; import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; import com.azure.json.JsonReader; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; import com.azure.resourcemanager.databoxedge.models.Address; -import com.azure.resourcemanager.databoxedge.models.ArmBaseModel; import com.azure.resourcemanager.databoxedge.models.ContactDetails; import com.azure.resourcemanager.databoxedge.models.OrderStatus; +import com.azure.resourcemanager.databoxedge.models.ShipmentType; import com.azure.resourcemanager.databoxedge.models.TrackingInfo; import java.io.IOException; import java.util.List; @@ -20,12 +22,22 @@ * The order details. */ @Fluent -public final class OrderInner extends ArmBaseModel { +public final class OrderInner extends ProxyResource { /* * The order properties. */ private OrderProperties innerProperties; + /* + * It specify the order api version. + */ + private String kind; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + /* * The type of the resource. */ @@ -56,6 +68,24 @@ private OrderProperties innerProperties() { return this.innerProperties; } + /** + * Get the kind property: It specify the order api version. + * + * @return the kind value. + */ + public String kind() { + return this.kind; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + /** * Get the type property: The type of the resource. * @@ -86,6 +116,15 @@ public String id() { return this.id; } + /** + * Get the orderId property: It specify the order resource id. + * + * @return the orderId value. + */ + public String orderId() { + return this.innerProperties() == null ? null : this.innerProperties().orderId(); + } + /** * Get the contactInformation property: The contact details. * @@ -141,20 +180,6 @@ public OrderStatus currentStatus() { return this.innerProperties() == null ? null : this.innerProperties().currentStatus(); } - /** - * Set the currentStatus property: Current status of the order. - * - * @param currentStatus the currentStatus value to set. - * @return the OrderInner object itself. - */ - public OrderInner withCurrentStatus(OrderStatus currentStatus) { - if (this.innerProperties() == null) { - this.innerProperties = new OrderProperties(); - } - this.innerProperties().withCurrentStatus(currentStatus); - return this; - } - /** * Get the orderHistory property: List of status changes in the order. * @@ -194,15 +219,26 @@ public List returnTrackingInfo() { } /** - * Validates the instance. + * Get the shipmentType property: ShipmentType of the order. * - * @throws IllegalArgumentException thrown if the instance is not valid. + * @return the shipmentType value. */ - @Override - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); + public ShipmentType shipmentType() { + return this.innerProperties() == null ? null : this.innerProperties().shipmentType(); + } + + /** + * Set the shipmentType property: ShipmentType of the order. + * + * @param shipmentType the shipmentType value to set. + * @return the OrderInner object itself. + */ + public OrderInner withShipmentType(ShipmentType shipmentType) { + if (this.innerProperties() == null) { + this.innerProperties = new OrderProperties(); } + this.innerProperties().withShipmentType(shipmentType); + return this; } /** @@ -239,6 +275,10 @@ public static OrderInner fromJson(JsonReader jsonReader) throws IOException { deserializedOrderInner.type = reader.getString(); } else if ("properties".equals(fieldName)) { deserializedOrderInner.innerProperties = OrderProperties.fromJson(reader); + } else if ("kind".equals(fieldName)) { + deserializedOrderInner.kind = reader.getString(); + } else if ("systemData".equals(fieldName)) { + deserializedOrderInner.systemData = SystemData.fromJson(reader); } else { reader.skipChildren(); } diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/OrderProperties.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/OrderProperties.java index 9cb728987dac..3ddd8f394fba 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/OrderProperties.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/OrderProperties.java @@ -1,11 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -13,6 +12,7 @@ import com.azure.resourcemanager.databoxedge.models.Address; import com.azure.resourcemanager.databoxedge.models.ContactDetails; import com.azure.resourcemanager.databoxedge.models.OrderStatus; +import com.azure.resourcemanager.databoxedge.models.ShipmentType; import com.azure.resourcemanager.databoxedge.models.TrackingInfo; import java.io.IOException; import java.util.List; @@ -22,6 +22,11 @@ */ @Fluent public final class OrderProperties implements JsonSerializable { + /* + * It specify the order resource id. + */ + private String orderId; + /* * The contact details. */ @@ -59,12 +64,26 @@ public final class OrderProperties implements JsonSerializable */ private List returnTrackingInfo; + /* + * ShipmentType of the order + */ + private ShipmentType shipmentType; + /** * Creates an instance of OrderProperties class. */ public OrderProperties() { } + /** + * Get the orderId property: It specify the order resource id. + * + * @return the orderId value. + */ + public String orderId() { + return this.orderId; + } + /** * Get the contactInformation property: The contact details. * @@ -114,17 +133,6 @@ public OrderStatus currentStatus() { return this.currentStatus; } - /** - * Set the currentStatus property: Current status of the order. - * - * @param currentStatus the currentStatus value to set. - * @return the OrderProperties object itself. - */ - public OrderProperties withCurrentStatus(OrderStatus currentStatus) { - this.currentStatus = currentStatus; - return this; - } - /** * Get the orderHistory property: List of status changes in the order. * @@ -164,40 +172,24 @@ public List returnTrackingInfo() { } /** - * Validates the instance. + * Get the shipmentType property: ShipmentType of the order. * - * @throws IllegalArgumentException thrown if the instance is not valid. + * @return the shipmentType value. */ - public void validate() { - if (contactInformation() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property contactInformation in model OrderProperties")); - } else { - contactInformation().validate(); - } - if (shippingAddress() == null) { - throw LOGGER.atError() - .log( - new IllegalArgumentException("Missing required property shippingAddress in model OrderProperties")); - } else { - shippingAddress().validate(); - } - if (currentStatus() != null) { - currentStatus().validate(); - } - if (orderHistory() != null) { - orderHistory().forEach(e -> e.validate()); - } - if (deliveryTrackingInfo() != null) { - deliveryTrackingInfo().forEach(e -> e.validate()); - } - if (returnTrackingInfo() != null) { - returnTrackingInfo().forEach(e -> e.validate()); - } + public ShipmentType shipmentType() { + return this.shipmentType; } - private static final ClientLogger LOGGER = new ClientLogger(OrderProperties.class); + /** + * Set the shipmentType property: ShipmentType of the order. + * + * @param shipmentType the shipmentType value to set. + * @return the OrderProperties object itself. + */ + public OrderProperties withShipmentType(ShipmentType shipmentType) { + this.shipmentType = shipmentType; + return this; + } /** * {@inheritDoc} @@ -207,7 +199,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); jsonWriter.writeJsonField("contactInformation", this.contactInformation); jsonWriter.writeJsonField("shippingAddress", this.shippingAddress); - jsonWriter.writeJsonField("currentStatus", this.currentStatus); + jsonWriter.writeStringField("shipmentType", this.shipmentType == null ? null : this.shipmentType.toString()); return jsonWriter.writeEndObject(); } @@ -229,6 +221,8 @@ public static OrderProperties fromJson(JsonReader jsonReader) throws IOException if ("contactInformation".equals(fieldName)) { deserializedOrderProperties.contactInformation = ContactDetails.fromJson(reader); + } else if ("orderId".equals(fieldName)) { + deserializedOrderProperties.orderId = reader.getString(); } else if ("shippingAddress".equals(fieldName)) { deserializedOrderProperties.shippingAddress = Address.fromJson(reader); } else if ("currentStatus".equals(fieldName)) { @@ -245,6 +239,8 @@ public static OrderProperties fromJson(JsonReader jsonReader) throws IOException } else if ("returnTrackingInfo".equals(fieldName)) { List returnTrackingInfo = reader.readArray(reader1 -> TrackingInfo.fromJson(reader1)); deserializedOrderProperties.returnTrackingInfo = returnTrackingInfo; + } else if ("shipmentType".equals(fieldName)) { + deserializedOrderProperties.shipmentType = ShipmentType.fromString(reader.getString()); } else { reader.skipChildren(); } diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/ProactiveLogCollectionSettingsProperties.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/ProactiveLogCollectionSettingsProperties.java new file mode 100644 index 000000000000..666bb20450de --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/ProactiveLogCollectionSettingsProperties.java @@ -0,0 +1,90 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.databoxedge.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.databoxedge.models.ProactiveDiagnosticsConsent; +import java.io.IOException; + +/** + * The properties of proactive log collection settings. + */ +@Fluent +public final class ProactiveLogCollectionSettingsProperties + implements JsonSerializable { + /* + * Proactive diagnostic collection consent flag + */ + private ProactiveDiagnosticsConsent userConsent; + + /** + * Creates an instance of ProactiveLogCollectionSettingsProperties class. + */ + public ProactiveLogCollectionSettingsProperties() { + } + + /** + * Get the userConsent property: Proactive diagnostic collection consent flag. + * + * @return the userConsent value. + */ + public ProactiveDiagnosticsConsent userConsent() { + return this.userConsent; + } + + /** + * Set the userConsent property: Proactive diagnostic collection consent flag. + * + * @param userConsent the userConsent value to set. + * @return the ProactiveLogCollectionSettingsProperties object itself. + */ + public ProactiveLogCollectionSettingsProperties withUserConsent(ProactiveDiagnosticsConsent userConsent) { + this.userConsent = userConsent; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("userConsent", this.userConsent == null ? null : this.userConsent.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ProactiveLogCollectionSettingsProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ProactiveLogCollectionSettingsProperties if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ProactiveLogCollectionSettingsProperties. + */ + public static ProactiveLogCollectionSettingsProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ProactiveLogCollectionSettingsProperties deserializedProactiveLogCollectionSettingsProperties + = new ProactiveLogCollectionSettingsProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("userConsent".equals(fieldName)) { + deserializedProactiveLogCollectionSettingsProperties.userConsent + = ProactiveDiagnosticsConsent.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedProactiveLogCollectionSettingsProperties; + }); + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/RawCertificateData.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/RawCertificateData.java index e26f09840c22..f7af09c24cea 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/RawCertificateData.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/RawCertificateData.java @@ -1,11 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -74,20 +73,6 @@ public RawCertificateData withCertificate(String certificate) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (certificate() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Missing required property certificate in model RawCertificateData")); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(RawCertificateData.class); - /** * {@inheritDoc} */ diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/RoleInner.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/RoleInner.java index 060a67e2df93..729edf6b88f6 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/RoleInner.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/RoleInner.java @@ -1,27 +1,38 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.fluent.models; -import com.azure.core.annotation.Immutable; +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; import com.azure.json.JsonReader; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; -import com.azure.resourcemanager.databoxedge.models.ArmBaseModel; -import com.azure.resourcemanager.databoxedge.models.IoTRole; +import com.azure.resourcemanager.databoxedge.models.RoleProperties; import com.azure.resourcemanager.databoxedge.models.RoleTypes; import java.io.IOException; /** * Compute role. */ -@Immutable -public class RoleInner extends ArmBaseModel { +@Fluent +public final class RoleInner extends ProxyResource { + /* + * The resource-specific properties for this resource. + */ + private RoleProperties properties; + /* * Role type. */ - private RoleTypes kind = RoleTypes.fromString("Role"); + private RoleTypes kind; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; /* * The type of the resource. @@ -44,6 +55,26 @@ public class RoleInner extends ArmBaseModel { public RoleInner() { } + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public RoleProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the RoleInner object itself. + */ + public RoleInner withProperties(RoleProperties properties) { + this.properties = properties; + return this; + } + /** * Get the kind property: Role type. * @@ -53,6 +84,26 @@ public RoleTypes kind() { return this.kind; } + /** + * Set the kind property: Role type. + * + * @param kind the kind value to set. + * @return the RoleInner object itself. + */ + public RoleInner withKind(RoleTypes kind) { + this.kind = kind; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + /** * Get the type property: The type of the resource. * @@ -83,15 +134,6 @@ public String id() { return this.id; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - } - /** * {@inheritDoc} */ @@ -99,6 +141,7 @@ public void validate() { public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); + jsonWriter.writeJsonField("properties", this.properties); return jsonWriter.writeEndObject(); } @@ -112,31 +155,6 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { * @throws IOException If an error occurs while reading the RoleInner. */ public static RoleInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - String discriminatorValue = null; - try (JsonReader readerToUse = reader.bufferObject()) { - readerToUse.nextToken(); // Prepare for reading - while (readerToUse.nextToken() != JsonToken.END_OBJECT) { - String fieldName = readerToUse.getFieldName(); - readerToUse.nextToken(); - if ("kind".equals(fieldName)) { - discriminatorValue = readerToUse.getString(); - break; - } else { - readerToUse.skipChildren(); - } - } - // Use the discriminator value to determine which subtype should be deserialized. - if ("IOT".equals(discriminatorValue)) { - return IoTRole.fromJson(readerToUse.reset()); - } else { - return fromJsonKnownDiscriminator(readerToUse.reset()); - } - } - }); - } - - static RoleInner fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { return jsonReader.readObject(reader -> { RoleInner deserializedRoleInner = new RoleInner(); while (reader.nextToken() != JsonToken.END_OBJECT) { @@ -151,6 +169,10 @@ static RoleInner fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOExce deserializedRoleInner.type = reader.getString(); } else if ("kind".equals(fieldName)) { deserializedRoleInner.kind = RoleTypes.fromString(reader.getString()); + } else if ("properties".equals(fieldName)) { + deserializedRoleInner.properties = RoleProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedRoleInner.systemData = SystemData.fromJson(reader); } else { reader.skipChildren(); } diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/SecuritySettingsProperties.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/SecuritySettingsProperties.java index 272c275c6e3e..5790dcbe5d45 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/SecuritySettingsProperties.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/SecuritySettingsProperties.java @@ -1,11 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -55,23 +54,6 @@ public SecuritySettingsProperties withDeviceAdminPassword(AsymmetricEncryptedSec return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (deviceAdminPassword() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property deviceAdminPassword in model SecuritySettingsProperties")); - } else { - deviceAdminPassword().validate(); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(SecuritySettingsProperties.class); - /** * {@inheritDoc} */ diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/ShareInner.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/ShareInner.java index eac50a6f54cd..e90b6f627c4d 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/ShareInner.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/ShareInner.java @@ -1,15 +1,15 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; import com.azure.json.JsonReader; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; -import com.azure.resourcemanager.databoxedge.models.ArmBaseModel; import com.azure.resourcemanager.databoxedge.models.AzureContainerInfo; import com.azure.resourcemanager.databoxedge.models.ClientAccessRight; import com.azure.resourcemanager.databoxedge.models.DataPolicy; @@ -26,12 +26,17 @@ * Represents a share on the Data Box Edge/Gateway device. */ @Fluent -public final class ShareInner extends ArmBaseModel { +public final class ShareInner extends ProxyResource { /* * The share properties. */ private ShareProperties innerProperties = new ShareProperties(); + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + /* * The type of the resource. */ @@ -62,6 +67,15 @@ private ShareProperties innerProperties() { return this.innerProperties; } + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + /** * Get the type property: The type of the resource. * @@ -312,23 +326,6 @@ public ShareInner withDataPolicy(DataPolicy dataPolicy) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - if (innerProperties() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Missing required property innerProperties in model ShareInner")); - } else { - innerProperties().validate(); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(ShareInner.class); - /** * {@inheritDoc} */ @@ -363,6 +360,8 @@ public static ShareInner fromJson(JsonReader jsonReader) throws IOException { deserializedShareInner.type = reader.getString(); } else if ("properties".equals(fieldName)) { deserializedShareInner.innerProperties = ShareProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedShareInner.systemData = SystemData.fromJson(reader); } else { reader.skipChildren(); } diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/ShareProperties.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/ShareProperties.java index 52e2cd2c2504..ce3fa007a476 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/ShareProperties.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/ShareProperties.java @@ -1,11 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -276,44 +275,6 @@ public ShareProperties withDataPolicy(DataPolicy dataPolicy) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (shareStatus() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Missing required property shareStatus in model ShareProperties")); - } - if (monitoringStatus() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property monitoringStatus in model ShareProperties")); - } - if (azureContainerInfo() != null) { - azureContainerInfo().validate(); - } - if (accessProtocol() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Missing required property accessProtocol in model ShareProperties")); - } - if (userAccessRights() != null) { - userAccessRights().forEach(e -> e.validate()); - } - if (clientAccessRights() != null) { - clientAccessRights().forEach(e -> e.validate()); - } - if (refreshDetails() != null) { - refreshDetails().validate(); - } - if (shareMappings() != null) { - shareMappings().forEach(e -> e.validate()); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(ShareProperties.class); - /** * {@inheritDoc} */ diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/StorageAccountCredentialInner.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/StorageAccountCredentialInner.java index a6e8810dc904..769108809634 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/StorageAccountCredentialInner.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/StorageAccountCredentialInner.java @@ -1,30 +1,35 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; import com.azure.json.JsonReader; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; import com.azure.resourcemanager.databoxedge.models.AccountType; -import com.azure.resourcemanager.databoxedge.models.ArmBaseModel; import com.azure.resourcemanager.databoxedge.models.AsymmetricEncryptedSecret; -import com.azure.resourcemanager.databoxedge.models.SslStatus; +import com.azure.resourcemanager.databoxedge.models.SSLStatus; import java.io.IOException; /** * The storage account credential. */ @Fluent -public final class StorageAccountCredentialInner extends ArmBaseModel { +public final class StorageAccountCredentialInner extends ProxyResource { /* * The storage account credential properties. */ private StorageAccountCredentialProperties innerProperties = new StorageAccountCredentialProperties(); + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + /* * The type of the resource. */ @@ -55,6 +60,15 @@ private StorageAccountCredentialProperties innerProperties() { return this.innerProperties; } + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + /** * Get the type property: The type of the resource. * @@ -109,25 +123,25 @@ public StorageAccountCredentialInner withAlias(String alias) { } /** - * Get the username property: Username for the storage account. + * Get the userName property: Username for the storage account. * - * @return the username value. + * @return the userName value. */ - public String username() { - return this.innerProperties() == null ? null : this.innerProperties().username(); + public String userName() { + return this.innerProperties() == null ? null : this.innerProperties().userName(); } /** - * Set the username property: Username for the storage account. + * Set the userName property: Username for the storage account. * - * @param username the username value to set. + * @param userName the userName value to set. * @return the StorageAccountCredentialInner object itself. */ - public StorageAccountCredentialInner withUsername(String username) { + public StorageAccountCredentialInner withUserName(String userName) { if (this.innerProperties() == null) { this.innerProperties = new StorageAccountCredentialProperties(); } - this.innerProperties().withUsername(username); + this.innerProperties().withUserName(userName); return this; } @@ -184,7 +198,7 @@ public StorageAccountCredentialInner withConnectionString(String connectionStrin * * @return the sslStatus value. */ - public SslStatus sslStatus() { + public SSLStatus sslStatus() { return this.innerProperties() == null ? null : this.innerProperties().sslStatus(); } @@ -194,7 +208,7 @@ public SslStatus sslStatus() { * @param sslStatus the sslStatus value to set. * @return the StorageAccountCredentialInner object itself. */ - public StorageAccountCredentialInner withSslStatus(SslStatus sslStatus) { + public StorageAccountCredentialInner withSslStatus(SSLStatus sslStatus) { if (this.innerProperties() == null) { this.innerProperties = new StorageAccountCredentialProperties(); } @@ -271,24 +285,6 @@ public StorageAccountCredentialInner withStorageAccountId(String storageAccountI return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - if (innerProperties() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property innerProperties in model StorageAccountCredentialInner")); - } else { - innerProperties().validate(); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(StorageAccountCredentialInner.class); - /** * {@inheritDoc} */ @@ -325,6 +321,8 @@ public static StorageAccountCredentialInner fromJson(JsonReader jsonReader) thro } else if ("properties".equals(fieldName)) { deserializedStorageAccountCredentialInner.innerProperties = StorageAccountCredentialProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedStorageAccountCredentialInner.systemData = SystemData.fromJson(reader); } else { reader.skipChildren(); } diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/StorageAccountCredentialProperties.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/StorageAccountCredentialProperties.java index f90d6256e215..809bffb1612b 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/StorageAccountCredentialProperties.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/StorageAccountCredentialProperties.java @@ -1,18 +1,17 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; import com.azure.resourcemanager.databoxedge.models.AccountType; import com.azure.resourcemanager.databoxedge.models.AsymmetricEncryptedSecret; -import com.azure.resourcemanager.databoxedge.models.SslStatus; +import com.azure.resourcemanager.databoxedge.models.SSLStatus; import java.io.IOException; /** @@ -28,7 +27,7 @@ public final class StorageAccountCredentialProperties implements JsonSerializabl /* * Username for the storage account. */ - private String username; + private String userName; /* * Encrypted storage key. @@ -43,7 +42,7 @@ public final class StorageAccountCredentialProperties implements JsonSerializabl /* * Signifies whether SSL needs to be enabled or not. */ - private SslStatus sslStatus; + private SSLStatus sslStatus; /* * Blob end point for private clouds. @@ -87,22 +86,22 @@ public StorageAccountCredentialProperties withAlias(String alias) { } /** - * Get the username property: Username for the storage account. + * Get the userName property: Username for the storage account. * - * @return the username value. + * @return the userName value. */ - public String username() { - return this.username; + public String userName() { + return this.userName; } /** - * Set the username property: Username for the storage account. + * Set the userName property: Username for the storage account. * - * @param username the username value to set. + * @param userName the userName value to set. * @return the StorageAccountCredentialProperties object itself. */ - public StorageAccountCredentialProperties withUsername(String username) { - this.username = username; + public StorageAccountCredentialProperties withUserName(String userName) { + this.userName = userName; return this; } @@ -153,7 +152,7 @@ public StorageAccountCredentialProperties withConnectionString(String connection * * @return the sslStatus value. */ - public SslStatus sslStatus() { + public SSLStatus sslStatus() { return this.sslStatus; } @@ -163,7 +162,7 @@ public SslStatus sslStatus() { * @param sslStatus the sslStatus value to set. * @return the StorageAccountCredentialProperties object itself. */ - public StorageAccountCredentialProperties withSslStatus(SslStatus sslStatus) { + public StorageAccountCredentialProperties withSslStatus(SSLStatus sslStatus) { this.sslStatus = sslStatus; return this; } @@ -228,34 +227,6 @@ public StorageAccountCredentialProperties withStorageAccountId(String storageAcc return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (alias() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property alias in model StorageAccountCredentialProperties")); - } - if (accountKey() != null) { - accountKey().validate(); - } - if (sslStatus() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property sslStatus in model StorageAccountCredentialProperties")); - } - if (accountType() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property accountType in model StorageAccountCredentialProperties")); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(StorageAccountCredentialProperties.class); - /** * {@inheritDoc} */ @@ -265,7 +236,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStringField("alias", this.alias); jsonWriter.writeStringField("sslStatus", this.sslStatus == null ? null : this.sslStatus.toString()); jsonWriter.writeStringField("accountType", this.accountType == null ? null : this.accountType.toString()); - jsonWriter.writeStringField("userName", this.username); + jsonWriter.writeStringField("userName", this.userName); jsonWriter.writeJsonField("accountKey", this.accountKey); jsonWriter.writeStringField("connectionString", this.connectionString); jsonWriter.writeStringField("blobDomainName", this.blobDomainName); @@ -293,12 +264,12 @@ public static StorageAccountCredentialProperties fromJson(JsonReader jsonReader) if ("alias".equals(fieldName)) { deserializedStorageAccountCredentialProperties.alias = reader.getString(); } else if ("sslStatus".equals(fieldName)) { - deserializedStorageAccountCredentialProperties.sslStatus = SslStatus.fromString(reader.getString()); + deserializedStorageAccountCredentialProperties.sslStatus = SSLStatus.fromString(reader.getString()); } else if ("accountType".equals(fieldName)) { deserializedStorageAccountCredentialProperties.accountType = AccountType.fromString(reader.getString()); } else if ("userName".equals(fieldName)) { - deserializedStorageAccountCredentialProperties.username = reader.getString(); + deserializedStorageAccountCredentialProperties.userName = reader.getString(); } else if ("accountKey".equals(fieldName)) { deserializedStorageAccountCredentialProperties.accountKey = AsymmetricEncryptedSecret.fromJson(reader); diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/StorageAccountInner.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/StorageAccountInner.java index 7b697c86e670..5fcbbb6e26f2 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/StorageAccountInner.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/StorageAccountInner.java @@ -1,15 +1,15 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; import com.azure.json.JsonReader; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; -import com.azure.resourcemanager.databoxedge.models.ArmBaseModel; import com.azure.resourcemanager.databoxedge.models.DataPolicy; import com.azure.resourcemanager.databoxedge.models.StorageAccountStatus; import java.io.IOException; @@ -18,12 +18,17 @@ * Represents a Storage Account on the Data Box Edge/Gateway device. */ @Fluent -public final class StorageAccountInner extends ArmBaseModel { +public final class StorageAccountInner extends ProxyResource { /* * The Storage Account properties. */ private StorageAccountProperties innerProperties = new StorageAccountProperties(); + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + /* * The type of the resource. */ @@ -54,6 +59,15 @@ private StorageAccountProperties innerProperties() { return this.innerProperties; } + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + /** * Get the type property: The type of the resource. * @@ -195,24 +209,6 @@ public Integer containerCount() { return this.innerProperties() == null ? null : this.innerProperties().containerCount(); } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - if (innerProperties() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property innerProperties in model StorageAccountInner")); - } else { - innerProperties().validate(); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(StorageAccountInner.class); - /** * {@inheritDoc} */ @@ -247,6 +243,8 @@ public static StorageAccountInner fromJson(JsonReader jsonReader) throws IOExcep deserializedStorageAccountInner.type = reader.getString(); } else if ("properties".equals(fieldName)) { deserializedStorageAccountInner.innerProperties = StorageAccountProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedStorageAccountInner.systemData = SystemData.fromJson(reader); } else { reader.skipChildren(); } diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/StorageAccountProperties.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/StorageAccountProperties.java index 44f0da2d25f3..98211984a913 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/StorageAccountProperties.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/StorageAccountProperties.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.fluent.models; @@ -153,24 +153,16 @@ public Integer containerCount() { return this.containerCount; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); + jsonWriter.writeStringField("dataPolicy", this.dataPolicy == null ? null : this.dataPolicy.toString()); jsonWriter.writeStringField("description", this.description); jsonWriter.writeStringField("storageAccountStatus", this.storageAccountStatus == null ? null : this.storageAccountStatus.toString()); - jsonWriter.writeStringField("dataPolicy", this.dataPolicy == null ? null : this.dataPolicy.toString()); jsonWriter.writeStringField("storageAccountCredentialId", this.storageAccountCredentialId); return jsonWriter.writeEndObject(); } @@ -181,6 +173,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { * @param jsonReader The JsonReader being read. * @return An instance of StorageAccountProperties if the JsonReader was pointing to an instance of it, or null if * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. * @throws IOException If an error occurs while reading the StorageAccountProperties. */ public static StorageAccountProperties fromJson(JsonReader jsonReader) throws IOException { @@ -190,13 +183,13 @@ public static StorageAccountProperties fromJson(JsonReader jsonReader) throws IO String fieldName = reader.getFieldName(); reader.nextToken(); - if ("description".equals(fieldName)) { + if ("dataPolicy".equals(fieldName)) { + deserializedStorageAccountProperties.dataPolicy = DataPolicy.fromString(reader.getString()); + } else if ("description".equals(fieldName)) { deserializedStorageAccountProperties.description = reader.getString(); } else if ("storageAccountStatus".equals(fieldName)) { deserializedStorageAccountProperties.storageAccountStatus = StorageAccountStatus.fromString(reader.getString()); - } else if ("dataPolicy".equals(fieldName)) { - deserializedStorageAccountProperties.dataPolicy = DataPolicy.fromString(reader.getString()); } else if ("storageAccountCredentialId".equals(fieldName)) { deserializedStorageAccountProperties.storageAccountCredentialId = reader.getString(); } else if ("blobEndpoint".equals(fieldName)) { diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/SubscriptionProperties.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/SubscriptionProperties.java new file mode 100644 index 000000000000..6cbf54eae702 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/SubscriptionProperties.java @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.databoxedge.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.databoxedge.models.SubscriptionRegisteredFeatures; +import java.io.IOException; +import java.util.List; + +/** + * The SubscriptionProperties model. + */ +@Immutable +public final class SubscriptionProperties implements JsonSerializable { + /* + * The tenantId property. + */ + private String tenantId; + + /* + * The locationPlacementId property. + */ + private String locationPlacementId; + + /* + * The quotaId property. + */ + private String quotaId; + + /* + * The serializedDetails property. + */ + private String serializedDetails; + + /* + * The registeredFeatures property. + */ + private List registeredFeatures; + + /** + * Creates an instance of SubscriptionProperties class. + */ + private SubscriptionProperties() { + } + + /** + * Get the tenantId property: The tenantId property. + * + * @return the tenantId value. + */ + public String tenantId() { + return this.tenantId; + } + + /** + * Get the locationPlacementId property: The locationPlacementId property. + * + * @return the locationPlacementId value. + */ + public String locationPlacementId() { + return this.locationPlacementId; + } + + /** + * Get the quotaId property: The quotaId property. + * + * @return the quotaId value. + */ + public String quotaId() { + return this.quotaId; + } + + /** + * Get the serializedDetails property: The serializedDetails property. + * + * @return the serializedDetails value. + */ + public String serializedDetails() { + return this.serializedDetails; + } + + /** + * Get the registeredFeatures property: The registeredFeatures property. + * + * @return the registeredFeatures value. + */ + public List registeredFeatures() { + return this.registeredFeatures; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("tenantId", this.tenantId); + jsonWriter.writeStringField("locationPlacementId", this.locationPlacementId); + jsonWriter.writeStringField("quotaId", this.quotaId); + jsonWriter.writeStringField("serializedDetails", this.serializedDetails); + jsonWriter.writeArrayField("registeredFeatures", this.registeredFeatures, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SubscriptionProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SubscriptionProperties if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the SubscriptionProperties. + */ + public static SubscriptionProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SubscriptionProperties deserializedSubscriptionProperties = new SubscriptionProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tenantId".equals(fieldName)) { + deserializedSubscriptionProperties.tenantId = reader.getString(); + } else if ("locationPlacementId".equals(fieldName)) { + deserializedSubscriptionProperties.locationPlacementId = reader.getString(); + } else if ("quotaId".equals(fieldName)) { + deserializedSubscriptionProperties.quotaId = reader.getString(); + } else if ("serializedDetails".equals(fieldName)) { + deserializedSubscriptionProperties.serializedDetails = reader.getString(); + } else if ("registeredFeatures".equals(fieldName)) { + List registeredFeatures + = reader.readArray(reader1 -> SubscriptionRegisteredFeatures.fromJson(reader1)); + deserializedSubscriptionProperties.registeredFeatures = registeredFeatures; + } else { + reader.skipChildren(); + } + } + + return deserializedSubscriptionProperties; + }); + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/SupportPackageRequestProperties.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/SupportPackageRequestProperties.java new file mode 100644 index 000000000000..0503a0f15c29 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/SupportPackageRequestProperties.java @@ -0,0 +1,159 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.databoxedge.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; + +/** + * The share properties. + */ +@Fluent +public final class SupportPackageRequestProperties implements JsonSerializable { + /* + * MinimumTimeStamp from where logs need to be collected + */ + private OffsetDateTime minimumTimeStamp; + + /* + * Start of the timespan of the log collection + */ + private OffsetDateTime maximumTimeStamp; + + /* + * Type of files, which need to be included in the logs + * This will contain the type of logs (Default/DefaultWithDumps/None/All/DefaultWithArchived) + * or a comma separated list of log types that are required + */ + private String include; + + /** + * Creates an instance of SupportPackageRequestProperties class. + */ + public SupportPackageRequestProperties() { + } + + /** + * Get the minimumTimeStamp property: MinimumTimeStamp from where logs need to be collected. + * + * @return the minimumTimeStamp value. + */ + public OffsetDateTime minimumTimeStamp() { + return this.minimumTimeStamp; + } + + /** + * Set the minimumTimeStamp property: MinimumTimeStamp from where logs need to be collected. + * + * @param minimumTimeStamp the minimumTimeStamp value to set. + * @return the SupportPackageRequestProperties object itself. + */ + public SupportPackageRequestProperties withMinimumTimeStamp(OffsetDateTime minimumTimeStamp) { + this.minimumTimeStamp = minimumTimeStamp; + return this; + } + + /** + * Get the maximumTimeStamp property: Start of the timespan of the log collection. + * + * @return the maximumTimeStamp value. + */ + public OffsetDateTime maximumTimeStamp() { + return this.maximumTimeStamp; + } + + /** + * Set the maximumTimeStamp property: Start of the timespan of the log collection. + * + * @param maximumTimeStamp the maximumTimeStamp value to set. + * @return the SupportPackageRequestProperties object itself. + */ + public SupportPackageRequestProperties withMaximumTimeStamp(OffsetDateTime maximumTimeStamp) { + this.maximumTimeStamp = maximumTimeStamp; + return this; + } + + /** + * Get the include property: Type of files, which need to be included in the logs + * This will contain the type of logs (Default/DefaultWithDumps/None/All/DefaultWithArchived) + * or a comma separated list of log types that are required. + * + * @return the include value. + */ + public String include() { + return this.include; + } + + /** + * Set the include property: Type of files, which need to be included in the logs + * This will contain the type of logs (Default/DefaultWithDumps/None/All/DefaultWithArchived) + * or a comma separated list of log types that are required. + * + * @param include the include value to set. + * @return the SupportPackageRequestProperties object itself. + */ + public SupportPackageRequestProperties withInclude(String include) { + this.include = include; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("minimumTimeStamp", + this.minimumTimeStamp == null + ? null + : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.minimumTimeStamp)); + jsonWriter.writeStringField("maximumTimeStamp", + this.maximumTimeStamp == null + ? null + : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.maximumTimeStamp)); + jsonWriter.writeStringField("include", this.include); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SupportPackageRequestProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SupportPackageRequestProperties if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the SupportPackageRequestProperties. + */ + public static SupportPackageRequestProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SupportPackageRequestProperties deserializedSupportPackageRequestProperties + = new SupportPackageRequestProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("minimumTimeStamp".equals(fieldName)) { + deserializedSupportPackageRequestProperties.minimumTimeStamp = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("maximumTimeStamp".equals(fieldName)) { + deserializedSupportPackageRequestProperties.maximumTimeStamp = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("include".equals(fieldName)) { + deserializedSupportPackageRequestProperties.include = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedSupportPackageRequestProperties; + }); + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/TriggerInner.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/TriggerInner.java index 49b3bb7cba43..52969215fd00 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/TriggerInner.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/TriggerInner.java @@ -1,28 +1,38 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.fluent.models; -import com.azure.core.annotation.Immutable; +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; import com.azure.json.JsonReader; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; -import com.azure.resourcemanager.databoxedge.models.ArmBaseModel; -import com.azure.resourcemanager.databoxedge.models.FileEventTrigger; -import com.azure.resourcemanager.databoxedge.models.PeriodicTimerEventTrigger; import com.azure.resourcemanager.databoxedge.models.TriggerEventType; +import com.azure.resourcemanager.databoxedge.models.TriggerProperties; import java.io.IOException; /** * Trigger details. */ -@Immutable -public class TriggerInner extends ArmBaseModel { +@Fluent +public final class TriggerInner extends ProxyResource { + /* + * The resource-specific properties for this resource. + */ + private TriggerProperties properties; + /* * Trigger Kind. */ - private TriggerEventType kind = TriggerEventType.fromString("Trigger"); + private TriggerEventType kind; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; /* * The type of the resource. @@ -45,6 +55,26 @@ public class TriggerInner extends ArmBaseModel { public TriggerInner() { } + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public TriggerProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the TriggerInner object itself. + */ + public TriggerInner withProperties(TriggerProperties properties) { + this.properties = properties; + return this; + } + /** * Get the kind property: Trigger Kind. * @@ -54,6 +84,26 @@ public TriggerEventType kind() { return this.kind; } + /** + * Set the kind property: Trigger Kind. + * + * @param kind the kind value to set. + * @return the TriggerInner object itself. + */ + public TriggerInner withKind(TriggerEventType kind) { + this.kind = kind; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + /** * Get the type property: The type of the resource. * @@ -84,15 +134,6 @@ public String id() { return this.id; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - } - /** * {@inheritDoc} */ @@ -100,6 +141,7 @@ public void validate() { public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); + jsonWriter.writeJsonField("properties", this.properties); return jsonWriter.writeEndObject(); } @@ -113,33 +155,6 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { * @throws IOException If an error occurs while reading the TriggerInner. */ public static TriggerInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - String discriminatorValue = null; - try (JsonReader readerToUse = reader.bufferObject()) { - readerToUse.nextToken(); // Prepare for reading - while (readerToUse.nextToken() != JsonToken.END_OBJECT) { - String fieldName = readerToUse.getFieldName(); - readerToUse.nextToken(); - if ("kind".equals(fieldName)) { - discriminatorValue = readerToUse.getString(); - break; - } else { - readerToUse.skipChildren(); - } - } - // Use the discriminator value to determine which subtype should be deserialized. - if ("FileEvent".equals(discriminatorValue)) { - return FileEventTrigger.fromJson(readerToUse.reset()); - } else if ("PeriodicTimerEvent".equals(discriminatorValue)) { - return PeriodicTimerEventTrigger.fromJson(readerToUse.reset()); - } else { - return fromJsonKnownDiscriminator(readerToUse.reset()); - } - } - }); - } - - static TriggerInner fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { return jsonReader.readObject(reader -> { TriggerInner deserializedTriggerInner = new TriggerInner(); while (reader.nextToken() != JsonToken.END_OBJECT) { @@ -154,6 +169,10 @@ static TriggerInner fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOE deserializedTriggerInner.type = reader.getString(); } else if ("kind".equals(fieldName)) { deserializedTriggerInner.kind = TriggerEventType.fromString(reader.getString()); + } else if ("properties".equals(fieldName)) { + deserializedTriggerInner.properties = TriggerProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedTriggerInner.systemData = SystemData.fromJson(reader); } else { reader.skipChildren(); } diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/UpdateSummaryInner.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/UpdateSummaryInner.java index 88af630924b7..d012fca6d4f2 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/UpdateSummaryInner.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/UpdateSummaryInner.java @@ -1,15 +1,18 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.fluent.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; import com.azure.json.JsonReader; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; -import com.azure.resourcemanager.databoxedge.models.ArmBaseModel; import com.azure.resourcemanager.databoxedge.models.InstallRebootBehavior; +import com.azure.resourcemanager.databoxedge.models.JobStatus; +import com.azure.resourcemanager.databoxedge.models.UpdateDetails; import com.azure.resourcemanager.databoxedge.models.UpdateOperation; import java.io.IOException; import java.time.OffsetDateTime; @@ -18,13 +21,18 @@ /** * Details about ongoing updates and availability of updates on the device. */ -@Fluent -public final class UpdateSummaryInner extends ArmBaseModel { +@Immutable +public final class UpdateSummaryInner extends ProxyResource { /* * The device update information summary. */ private UpdateSummaryProperties innerProperties; + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + /* * The type of the resource. */ @@ -43,7 +51,7 @@ public final class UpdateSummaryInner extends ArmBaseModel { /** * Creates an instance of UpdateSummaryInner class. */ - public UpdateSummaryInner() { + private UpdateSummaryInner() { } /** @@ -55,6 +63,15 @@ private UpdateSummaryProperties innerProperties() { return this.innerProperties; } + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + /** * Get the type property: The type of the resource. * @@ -94,20 +111,6 @@ public String deviceVersionNumber() { return this.innerProperties() == null ? null : this.innerProperties().deviceVersionNumber(); } - /** - * Set the deviceVersionNumber property: The current version of the device in format: 1.2.17312.13.",. - * - * @param deviceVersionNumber the deviceVersionNumber value to set. - * @return the UpdateSummaryInner object itself. - */ - public UpdateSummaryInner withDeviceVersionNumber(String deviceVersionNumber) { - if (this.innerProperties() == null) { - this.innerProperties = new UpdateSummaryProperties(); - } - this.innerProperties().withDeviceVersionNumber(deviceVersionNumber); - return this; - } - /** * Get the friendlyDeviceVersionName property: The current version of the device in text format. * @@ -117,20 +120,6 @@ public String friendlyDeviceVersionName() { return this.innerProperties() == null ? null : this.innerProperties().friendlyDeviceVersionName(); } - /** - * Set the friendlyDeviceVersionName property: The current version of the device in text format. - * - * @param friendlyDeviceVersionName the friendlyDeviceVersionName value to set. - * @return the UpdateSummaryInner object itself. - */ - public UpdateSummaryInner withFriendlyDeviceVersionName(String friendlyDeviceVersionName) { - if (this.innerProperties() == null) { - this.innerProperties = new UpdateSummaryProperties(); - } - this.innerProperties().withFriendlyDeviceVersionName(friendlyDeviceVersionName); - return this; - } - /** * Get the deviceLastScannedDateTime property: The last time when a scan was done on the device. * @@ -140,20 +129,6 @@ public OffsetDateTime deviceLastScannedDateTime() { return this.innerProperties() == null ? null : this.innerProperties().deviceLastScannedDateTime(); } - /** - * Set the deviceLastScannedDateTime property: The last time when a scan was done on the device. - * - * @param deviceLastScannedDateTime the deviceLastScannedDateTime value to set. - * @return the UpdateSummaryInner object itself. - */ - public UpdateSummaryInner withDeviceLastScannedDateTime(OffsetDateTime deviceLastScannedDateTime) { - if (this.innerProperties() == null) { - this.innerProperties = new UpdateSummaryProperties(); - } - this.innerProperties().withDeviceLastScannedDateTime(deviceLastScannedDateTime); - return this; - } - /** * Get the lastCompletedScanJobDateTime property: The time when the last scan job was completed * (success/cancelled/failed) on the appliance. @@ -165,18 +140,12 @@ public OffsetDateTime lastCompletedScanJobDateTime() { } /** - * Set the lastCompletedScanJobDateTime property: The time when the last scan job was completed - * (success/cancelled/failed) on the appliance. + * Get the lastSuccessfulScanJobTime property: Time when the last scan job is successfully completed. * - * @param lastCompletedScanJobDateTime the lastCompletedScanJobDateTime value to set. - * @return the UpdateSummaryInner object itself. + * @return the lastSuccessfulScanJobTime value. */ - public UpdateSummaryInner withLastCompletedScanJobDateTime(OffsetDateTime lastCompletedScanJobDateTime) { - if (this.innerProperties() == null) { - this.innerProperties = new UpdateSummaryProperties(); - } - this.innerProperties().withLastCompletedScanJobDateTime(lastCompletedScanJobDateTime); - return this; + public OffsetDateTime lastSuccessfulScanJobTime() { + return this.innerProperties() == null ? null : this.innerProperties().lastSuccessfulScanJobTime(); } /** @@ -189,6 +158,35 @@ public OffsetDateTime lastCompletedDownloadJobDateTime() { return this.innerProperties() == null ? null : this.innerProperties().lastCompletedDownloadJobDateTime(); } + /** + * Get the lastCompletedDownloadJobId property: JobId of the last ran download job.(Can be + * success/cancelled/failed). + * + * @return the lastCompletedDownloadJobId value. + */ + public String lastCompletedDownloadJobId() { + return this.innerProperties() == null ? null : this.innerProperties().lastCompletedDownloadJobId(); + } + + /** + * Get the lastDownloadJobStatus property: JobStatus of the last ran download job. + * + * @return the lastDownloadJobStatus value. + */ + public JobStatus lastDownloadJobStatus() { + return this.innerProperties() == null ? null : this.innerProperties().lastDownloadJobStatus(); + } + + /** + * Get the lastSuccessfulInstallJobDateTime property: The time when the Last Install job was completed successfully + * on the appliance. + * + * @return the lastSuccessfulInstallJobDateTime value. + */ + public OffsetDateTime lastSuccessfulInstallJobDateTime() { + return this.innerProperties() == null ? null : this.innerProperties().lastSuccessfulInstallJobDateTime(); + } + /** * Get the lastCompletedInstallJobDateTime property: The time when the last Install job was completed * (success/cancelled/failed) on the appliance. @@ -199,6 +197,24 @@ public OffsetDateTime lastCompletedInstallJobDateTime() { return this.innerProperties() == null ? null : this.innerProperties().lastCompletedInstallJobDateTime(); } + /** + * Get the lastCompletedInstallJobId property: JobId of the last ran install job.(Can be success/cancelled/failed). + * + * @return the lastCompletedInstallJobId value. + */ + public String lastCompletedInstallJobId() { + return this.innerProperties() == null ? null : this.innerProperties().lastCompletedInstallJobId(); + } + + /** + * Get the lastInstallJobStatus property: JobStatus of the last ran install job. + * + * @return the lastInstallJobStatus value. + */ + public JobStatus lastInstallJobStatus() { + return this.innerProperties() == null ? null : this.innerProperties().lastInstallJobStatus(); + } + /** * Get the totalNumberOfUpdatesAvailable property: The number of updates available for the current device version as * per the last device scan. @@ -293,6 +309,15 @@ public List updateTitles() { return this.innerProperties() == null ? null : this.innerProperties().updateTitles(); } + /** + * Get the updates property: The list of updates available for install. + * + * @return the updates value. + */ + public List updates() { + return this.innerProperties() == null ? null : this.innerProperties().updates(); + } + /** * Get the totalUpdateSizeInBytes property: The total size of updates available for download in bytes. * @@ -303,15 +328,12 @@ public Double totalUpdateSizeInBytes() { } /** - * Validates the instance. + * Get the totalTimeInMinutes property: The total time in Minutes. * - * @throws IllegalArgumentException thrown if the instance is not valid. + * @return the totalTimeInMinutes value. */ - @Override - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } + public Integer totalTimeInMinutes() { + return this.innerProperties() == null ? null : this.innerProperties().totalTimeInMinutes(); } /** @@ -348,6 +370,8 @@ public static UpdateSummaryInner fromJson(JsonReader jsonReader) throws IOExcept deserializedUpdateSummaryInner.type = reader.getString(); } else if ("properties".equals(fieldName)) { deserializedUpdateSummaryInner.innerProperties = UpdateSummaryProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedUpdateSummaryInner.systemData = SystemData.fromJson(reader); } else { reader.skipChildren(); } diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/UpdateSummaryProperties.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/UpdateSummaryProperties.java index 5f248e49aae6..5ba3f177341f 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/UpdateSummaryProperties.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/UpdateSummaryProperties.java @@ -1,16 +1,18 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.fluent.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.core.util.CoreUtils; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; import com.azure.resourcemanager.databoxedge.models.InstallRebootBehavior; +import com.azure.resourcemanager.databoxedge.models.JobStatus; +import com.azure.resourcemanager.databoxedge.models.UpdateDetails; import com.azure.resourcemanager.databoxedge.models.UpdateOperation; import java.io.IOException; import java.time.OffsetDateTime; @@ -20,7 +22,7 @@ /** * The device update information summary. */ -@Fluent +@Immutable public final class UpdateSummaryProperties implements JsonSerializable { /* * The current version of the device in format: 1.2.17312.13.", @@ -42,16 +44,46 @@ public final class UpdateSummaryProperties implements JsonSerializable updateTitles; + /* + * The list of updates available for install. + */ + private List updates; + /* * The total size of updates available for download in bytes. */ private Double totalUpdateSizeInBytes; + /* + * The total time in Minutes + */ + private Integer totalTimeInMinutes; + /** * Creates an instance of UpdateSummaryProperties class. */ - public UpdateSummaryProperties() { + private UpdateSummaryProperties() { } /** @@ -122,17 +164,6 @@ public String deviceVersionNumber() { return this.deviceVersionNumber; } - /** - * Set the deviceVersionNumber property: The current version of the device in format: 1.2.17312.13.",. - * - * @param deviceVersionNumber the deviceVersionNumber value to set. - * @return the UpdateSummaryProperties object itself. - */ - public UpdateSummaryProperties withDeviceVersionNumber(String deviceVersionNumber) { - this.deviceVersionNumber = deviceVersionNumber; - return this; - } - /** * Get the friendlyDeviceVersionName property: The current version of the device in text format. * @@ -142,17 +173,6 @@ public String friendlyDeviceVersionName() { return this.friendlyDeviceVersionName; } - /** - * Set the friendlyDeviceVersionName property: The current version of the device in text format. - * - * @param friendlyDeviceVersionName the friendlyDeviceVersionName value to set. - * @return the UpdateSummaryProperties object itself. - */ - public UpdateSummaryProperties withFriendlyDeviceVersionName(String friendlyDeviceVersionName) { - this.friendlyDeviceVersionName = friendlyDeviceVersionName; - return this; - } - /** * Get the deviceLastScannedDateTime property: The last time when a scan was done on the device. * @@ -162,17 +182,6 @@ public OffsetDateTime deviceLastScannedDateTime() { return this.deviceLastScannedDateTime; } - /** - * Set the deviceLastScannedDateTime property: The last time when a scan was done on the device. - * - * @param deviceLastScannedDateTime the deviceLastScannedDateTime value to set. - * @return the UpdateSummaryProperties object itself. - */ - public UpdateSummaryProperties withDeviceLastScannedDateTime(OffsetDateTime deviceLastScannedDateTime) { - this.deviceLastScannedDateTime = deviceLastScannedDateTime; - return this; - } - /** * Get the lastCompletedScanJobDateTime property: The time when the last scan job was completed * (success/cancelled/failed) on the appliance. @@ -184,15 +193,12 @@ public OffsetDateTime lastCompletedScanJobDateTime() { } /** - * Set the lastCompletedScanJobDateTime property: The time when the last scan job was completed - * (success/cancelled/failed) on the appliance. + * Get the lastSuccessfulScanJobTime property: Time when the last scan job is successfully completed. * - * @param lastCompletedScanJobDateTime the lastCompletedScanJobDateTime value to set. - * @return the UpdateSummaryProperties object itself. + * @return the lastSuccessfulScanJobTime value. */ - public UpdateSummaryProperties withLastCompletedScanJobDateTime(OffsetDateTime lastCompletedScanJobDateTime) { - this.lastCompletedScanJobDateTime = lastCompletedScanJobDateTime; - return this; + public OffsetDateTime lastSuccessfulScanJobTime() { + return this.lastSuccessfulScanJobTime; } /** @@ -205,6 +211,35 @@ public OffsetDateTime lastCompletedDownloadJobDateTime() { return this.lastCompletedDownloadJobDateTime; } + /** + * Get the lastCompletedDownloadJobId property: JobId of the last ran download job.(Can be + * success/cancelled/failed). + * + * @return the lastCompletedDownloadJobId value. + */ + public String lastCompletedDownloadJobId() { + return this.lastCompletedDownloadJobId; + } + + /** + * Get the lastDownloadJobStatus property: JobStatus of the last ran download job. + * + * @return the lastDownloadJobStatus value. + */ + public JobStatus lastDownloadJobStatus() { + return this.lastDownloadJobStatus; + } + + /** + * Get the lastSuccessfulInstallJobDateTime property: The time when the Last Install job was completed successfully + * on the appliance. + * + * @return the lastSuccessfulInstallJobDateTime value. + */ + public OffsetDateTime lastSuccessfulInstallJobDateTime() { + return this.lastSuccessfulInstallJobDateTime; + } + /** * Get the lastCompletedInstallJobDateTime property: The time when the last Install job was completed * (success/cancelled/failed) on the appliance. @@ -215,6 +250,24 @@ public OffsetDateTime lastCompletedInstallJobDateTime() { return this.lastCompletedInstallJobDateTime; } + /** + * Get the lastCompletedInstallJobId property: JobId of the last ran install job.(Can be success/cancelled/failed). + * + * @return the lastCompletedInstallJobId value. + */ + public String lastCompletedInstallJobId() { + return this.lastCompletedInstallJobId; + } + + /** + * Get the lastInstallJobStatus property: JobStatus of the last ran install job. + * + * @return the lastInstallJobStatus value. + */ + public JobStatus lastInstallJobStatus() { + return this.lastInstallJobStatus; + } + /** * Get the totalNumberOfUpdatesAvailable property: The number of updates available for the current device version as * per the last device scan. @@ -309,6 +362,15 @@ public List updateTitles() { return this.updateTitles; } + /** + * Get the updates property: The list of updates available for install. + * + * @return the updates value. + */ + public List updates() { + return this.updates; + } + /** * Get the totalUpdateSizeInBytes property: The total size of updates available for download in bytes. * @@ -319,11 +381,12 @@ public Double totalUpdateSizeInBytes() { } /** - * Validates the instance. + * Get the totalTimeInMinutes property: The total time in Minutes. * - * @throws IllegalArgumentException thrown if the instance is not valid. + * @return the totalTimeInMinutes value. */ - public void validate() { + public Integer totalTimeInMinutes() { + return this.totalTimeInMinutes; } /** @@ -342,6 +405,14 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { this.lastCompletedScanJobDateTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.lastCompletedScanJobDateTime)); + jsonWriter.writeStringField("lastSuccessfulScanJobTime", + this.lastSuccessfulScanJobTime == null + ? null + : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.lastSuccessfulScanJobTime)); + jsonWriter.writeStringField("lastSuccessfulInstallJobDateTime", + this.lastSuccessfulInstallJobDateTime == null + ? null + : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.lastSuccessfulInstallJobDateTime)); return jsonWriter.writeEndObject(); } @@ -370,12 +441,27 @@ public static UpdateSummaryProperties fromJson(JsonReader jsonReader) throws IOE } else if ("lastCompletedScanJobDateTime".equals(fieldName)) { deserializedUpdateSummaryProperties.lastCompletedScanJobDateTime = reader .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("lastSuccessfulScanJobTime".equals(fieldName)) { + deserializedUpdateSummaryProperties.lastSuccessfulScanJobTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); } else if ("lastCompletedDownloadJobDateTime".equals(fieldName)) { deserializedUpdateSummaryProperties.lastCompletedDownloadJobDateTime = reader .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("lastCompletedDownloadJobId".equals(fieldName)) { + deserializedUpdateSummaryProperties.lastCompletedDownloadJobId = reader.getString(); + } else if ("lastDownloadJobStatus".equals(fieldName)) { + deserializedUpdateSummaryProperties.lastDownloadJobStatus + = JobStatus.fromString(reader.getString()); + } else if ("lastSuccessfulInstallJobDateTime".equals(fieldName)) { + deserializedUpdateSummaryProperties.lastSuccessfulInstallJobDateTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); } else if ("lastCompletedInstallJobDateTime".equals(fieldName)) { deserializedUpdateSummaryProperties.lastCompletedInstallJobDateTime = reader .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("lastCompletedInstallJobId".equals(fieldName)) { + deserializedUpdateSummaryProperties.lastCompletedInstallJobId = reader.getString(); + } else if ("lastInstallJobStatus".equals(fieldName)) { + deserializedUpdateSummaryProperties.lastInstallJobStatus = JobStatus.fromString(reader.getString()); } else if ("totalNumberOfUpdatesAvailable".equals(fieldName)) { deserializedUpdateSummaryProperties.totalNumberOfUpdatesAvailable = reader.getNullable(JsonReader::getInt); @@ -404,9 +490,14 @@ public static UpdateSummaryProperties fromJson(JsonReader jsonReader) throws IOE } else if ("updateTitles".equals(fieldName)) { List updateTitles = reader.readArray(reader1 -> reader1.getString()); deserializedUpdateSummaryProperties.updateTitles = updateTitles; + } else if ("updates".equals(fieldName)) { + List updates = reader.readArray(reader1 -> UpdateDetails.fromJson(reader1)); + deserializedUpdateSummaryProperties.updates = updates; } else if ("totalUpdateSizeInBytes".equals(fieldName)) { deserializedUpdateSummaryProperties.totalUpdateSizeInBytes = reader.getNullable(JsonReader::getDouble); + } else if ("totalTimeInMinutes".equals(fieldName)) { + deserializedUpdateSummaryProperties.totalTimeInMinutes = reader.getNullable(JsonReader::getInt); } else { reader.skipChildren(); } diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/UploadCertificateResponseInner.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/UploadCertificateResponseInner.java index 7c4b4ff74163..bc9a8ced03ea 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/UploadCertificateResponseInner.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/UploadCertificateResponseInner.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.fluent.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -15,7 +15,7 @@ /** * The upload registration certificate response. */ -@Fluent +@Immutable public final class UploadCertificateResponseInner implements JsonSerializable { /* * Specifies authentication type. @@ -60,7 +60,7 @@ public final class UploadCertificateResponseInner implements JsonSerializable shareAccessRights() { return this.innerProperties() == null ? null : this.innerProperties().shareAccessRights(); } - /** - * Set the shareAccessRights property: List of shares that the user has rights on. This field should not be - * specified during user creation. - * - * @param shareAccessRights the shareAccessRights value to set. - * @return the UserInner object itself. - */ - public UserInner withShareAccessRights(List shareAccessRights) { - if (this.innerProperties() == null) { - this.innerProperties = new UserProperties(); - } - this.innerProperties().withShareAccessRights(shareAccessRights); - return this; - } - /** * Get the userType property: Type of the user. * @@ -157,23 +156,6 @@ public UserInner withUserType(UserType userType) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - if (innerProperties() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Missing required property innerProperties in model UserInner")); - } else { - innerProperties().validate(); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(UserInner.class); - /** * {@inheritDoc} */ @@ -208,6 +190,8 @@ public static UserInner fromJson(JsonReader jsonReader) throws IOException { deserializedUserInner.type = reader.getString(); } else if ("properties".equals(fieldName)) { deserializedUserInner.innerProperties = UserProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedUserInner.systemData = SystemData.fromJson(reader); } else { reader.skipChildren(); } diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/UserProperties.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/UserProperties.java index a585f6c1d99b..8b1b680efbc0 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/UserProperties.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/UserProperties.java @@ -1,11 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -72,18 +71,6 @@ public List shareAccessRights() { return this.shareAccessRights; } - /** - * Set the shareAccessRights property: List of shares that the user has rights on. This field should not be - * specified during user creation. - * - * @param shareAccessRights the shareAccessRights value to set. - * @return the UserProperties object itself. - */ - public UserProperties withShareAccessRights(List shareAccessRights) { - this.shareAccessRights = shareAccessRights; - return this; - } - /** * Get the userType property: Type of the user. * @@ -104,26 +91,6 @@ public UserProperties withUserType(UserType userType) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (encryptedPassword() != null) { - encryptedPassword().validate(); - } - if (shareAccessRights() != null) { - shareAccessRights().forEach(e -> e.validate()); - } - if (userType() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Missing required property userType in model UserProperties")); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(UserProperties.class); - /** * {@inheritDoc} */ @@ -132,8 +99,6 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); jsonWriter.writeStringField("userType", this.userType == null ? null : this.userType.toString()); jsonWriter.writeJsonField("encryptedPassword", this.encryptedPassword); - jsonWriter.writeArrayField("shareAccessRights", this.shareAccessRights, - (writer, element) -> writer.writeJson(element)); return jsonWriter.writeEndObject(); } diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/package-info.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/package-info.java index 11dfebefc2fd..5f616286d498 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/package-info.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/package-info.java @@ -1,9 +1,9 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. /** - * Package containing the inner data models for DataBoxEdgeManagementClient. - * null. + * Package containing the inner data models for DataBoxEdge. + * // (missing-service-description) Add service description. */ package com.azure.resourcemanager.databoxedge.fluent.models; diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/package-info.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/package-info.java index c9c9536de21c..0cd8d89778a8 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/package-info.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/package-info.java @@ -1,9 +1,9 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. /** - * Package containing the service clients for DataBoxEdgeManagementClient. - * null. + * Package containing the service clients for DataBoxEdge. + * // (missing-service-description) Add service description. */ package com.azure.resourcemanager.databoxedge.fluent; diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/AddonImpl.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/AddonImpl.java new file mode 100644 index 000000000000..01aa0db99016 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/AddonImpl.java @@ -0,0 +1,138 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.databoxedge.implementation; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.databoxedge.fluent.models.AddonInner; +import com.azure.resourcemanager.databoxedge.models.Addon; +import com.azure.resourcemanager.databoxedge.models.AddonProperties; +import com.azure.resourcemanager.databoxedge.models.AddonType; + +public final class AddonImpl implements Addon, Addon.Definition, Addon.Update { + private AddonInner innerObject; + + private final com.azure.resourcemanager.databoxedge.DataBoxEdgeManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public AddonProperties properties() { + return this.innerModel().properties(); + } + + public AddonType kind() { + return this.innerModel().kind(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public AddonInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.databoxedge.DataBoxEdgeManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String deviceName; + + private String addonName; + + public AddonImpl withExistingDataBoxEdgeDevice(String resourceGroupName, String deviceName) { + this.resourceGroupName = resourceGroupName; + this.deviceName = deviceName; + return this; + } + + public Addon create() { + this.innerObject = serviceManager.serviceClient() + .getAddons() + .createOrUpdate(resourceGroupName, deviceName, addonName, this.innerModel(), Context.NONE); + return this; + } + + public Addon create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getAddons() + .createOrUpdate(resourceGroupName, deviceName, addonName, this.innerModel(), context); + return this; + } + + AddonImpl(String name, com.azure.resourcemanager.databoxedge.DataBoxEdgeManager serviceManager) { + this.innerObject = new AddonInner(); + this.serviceManager = serviceManager; + this.addonName = name; + } + + public AddonImpl update() { + return this; + } + + public Addon apply() { + this.innerObject = serviceManager.serviceClient() + .getAddons() + .createOrUpdate(resourceGroupName, deviceName, addonName, this.innerModel(), Context.NONE); + return this; + } + + public Addon apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getAddons() + .createOrUpdate(resourceGroupName, deviceName, addonName, this.innerModel(), context); + return this; + } + + AddonImpl(AddonInner innerObject, com.azure.resourcemanager.databoxedge.DataBoxEdgeManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.deviceName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "dataBoxEdgeDevices"); + this.addonName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "addons"); + } + + public Addon refresh() { + this.innerObject = serviceManager.serviceClient() + .getAddons() + .getWithResponse(resourceGroupName, deviceName, addonName, Context.NONE) + .getValue(); + return this; + } + + public Addon refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getAddons() + .getWithResponse(resourceGroupName, deviceName, addonName, context) + .getValue(); + return this; + } + + public AddonImpl withKind(AddonType kind) { + this.innerModel().withKind(kind); + return this; + } + + public AddonImpl withProperties(AddonProperties properties) { + this.innerModel().withProperties(properties); + return this; + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/AddonsClientImpl.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/AddonsClientImpl.java new file mode 100644 index 000000000000..e47a93b8b775 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/AddonsClientImpl.java @@ -0,0 +1,748 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.databoxedge.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.BinaryData; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.databoxedge.fluent.AddonsClient; +import com.azure.resourcemanager.databoxedge.fluent.models.AddonInner; +import com.azure.resourcemanager.databoxedge.implementation.models.AddonList; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in AddonsClient. + */ +public final class AddonsClientImpl implements AddonsClient { + /** + * The proxy service used to perform REST calls. + */ + private final AddonsService service; + + /** + * The service client containing this operation class. + */ + private final DataBoxEdgeManagementClientImpl client; + + /** + * Initializes an instance of AddonsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + AddonsClientImpl(DataBoxEdgeManagementClientImpl client) { + this.service = RestProxy.create(AddonsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for DataBoxEdgeManagementClientAddons to be used by the proxy service to + * perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "DataBoxEdgeManagementClientAddons") + public interface AddonsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/addons/{addonName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("deviceName") String deviceName, + @PathParam("addonName") String addonName, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/addons/{addonName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("deviceName") String deviceName, + @PathParam("addonName") String addonName, @HeaderParam("Accept") String accept, Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/addons/{addonName}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("deviceName") String deviceName, + @PathParam("addonName") String addonName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") AddonInner addon, Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/addons/{addonName}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response createOrUpdateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("deviceName") String deviceName, + @PathParam("addonName") String addonName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") AddonInner addon, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/addons/{addonName}") + @ExpectedResponses({ 200, 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("deviceName") String deviceName, + @PathParam("addonName") String addonName, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/addons/{addonName}") + @ExpectedResponses({ 200, 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response deleteSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("deviceName") String deviceName, + @PathParam("addonName") String addonName, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/addons") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByRole(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("deviceName") String deviceName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/addons") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listByRoleSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("deviceName") String deviceName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByRoleNext(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listByRoleNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); + } + + /** + * Gets a specific addon by name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @param addonName The addon name. + * @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 specific addon by name along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String deviceName, + String addonName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, deviceName, addonName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a specific addon by name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @param addonName The addon name. + * @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 specific addon by name on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String deviceName, String addonName) { + return getWithResponseAsync(resourceGroupName, deviceName, addonName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets a specific addon by name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @param addonName The addon name. + * @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 a specific addon by name along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String deviceName, String addonName, + Context context) { + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, deviceName, addonName, accept, context); + } + + /** + * Gets a specific addon by name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @param addonName The addon name. + * @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 specific addon by name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AddonInner get(String resourceGroupName, String deviceName, String addonName) { + return getWithResponse(resourceGroupName, deviceName, addonName, Context.NONE).getValue(); + } + + /** + * Create or update a addon. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @param addonName The addon name. + * @param addon The addon properties. + * @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 role Addon along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, + String deviceName, String addonName, AddonInner addon) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, deviceName, addonName, contentType, accept, addon, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create or update a addon. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @param addonName The addon name. + * @param addon The addon properties. + * @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 role Addon along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response createOrUpdateWithResponse(String resourceGroupName, String deviceName, + String addonName, AddonInner addon) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, deviceName, addonName, contentType, accept, addon, + Context.NONE); + } + + /** + * Create or update a addon. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @param addonName The addon name. + * @param addon The addon properties. + * @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 role Addon along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response createOrUpdateWithResponse(String resourceGroupName, String deviceName, + String addonName, AddonInner addon, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, deviceName, addonName, contentType, accept, addon, + context); + } + + /** + * Create or update a addon. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @param addonName The addon name. + * @param addon The addon properties. + * @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 role Addon. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, AddonInner> beginCreateOrUpdateAsync(String resourceGroupName, + String deviceName, String addonName, AddonInner addon) { + Mono>> mono + = createOrUpdateWithResponseAsync(resourceGroupName, deviceName, addonName, addon); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), AddonInner.class, + AddonInner.class, this.client.getContext()); + } + + /** + * Create or update a addon. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @param addonName The addon name. + * @param addon The addon properties. + * @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 SyncPoller} for polling of role Addon. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, AddonInner> beginCreateOrUpdate(String resourceGroupName, + String deviceName, String addonName, AddonInner addon) { + Response response = createOrUpdateWithResponse(resourceGroupName, deviceName, addonName, addon); + return this.client.getLroResult(response, AddonInner.class, AddonInner.class, + Context.NONE); + } + + /** + * Create or update a addon. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @param addonName The addon name. + * @param addon The addon properties. + * @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 SyncPoller} for polling of role Addon. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, AddonInner> beginCreateOrUpdate(String resourceGroupName, + String deviceName, String addonName, AddonInner addon, Context context) { + Response response + = createOrUpdateWithResponse(resourceGroupName, deviceName, addonName, addon, context); + return this.client.getLroResult(response, AddonInner.class, AddonInner.class, context); + } + + /** + * Create or update a addon. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @param addonName The addon name. + * @param addon The addon properties. + * @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 role Addon on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String resourceGroupName, String deviceName, String addonName, + AddonInner addon) { + return beginCreateOrUpdateAsync(resourceGroupName, deviceName, addonName, addon).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update a addon. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @param addonName The addon name. + * @param addon The addon properties. + * @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 role Addon. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AddonInner createOrUpdate(String resourceGroupName, String deviceName, String addonName, AddonInner addon) { + return beginCreateOrUpdate(resourceGroupName, deviceName, addonName, addon).getFinalResult(); + } + + /** + * Create or update a addon. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @param addonName The addon name. + * @param addon The addon properties. + * @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 role Addon. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AddonInner createOrUpdate(String resourceGroupName, String deviceName, String addonName, AddonInner addon, + Context context) { + return beginCreateOrUpdate(resourceGroupName, deviceName, addonName, addon, context).getFinalResult(); + } + + /** + * Deletes the addon on the device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @param addonName The addon name. + * @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>> deleteWithResponseAsync(String resourceGroupName, String deviceName, + String addonName) { + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, deviceName, addonName, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes the addon on the device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @param addonName The addon name. + * @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 body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response deleteWithResponse(String resourceGroupName, String deviceName, String addonName) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, deviceName, addonName, Context.NONE); + } + + /** + * Deletes the addon on the device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @param addonName The addon name. + * @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 body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response deleteWithResponse(String resourceGroupName, String deviceName, String addonName, + Context context) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, deviceName, addonName, context); + } + + /** + * Deletes the addon on the device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @param addonName The addon name. + * @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 long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String deviceName, + String addonName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, deviceName, addonName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Deletes the addon on the device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @param addonName The addon name. + * @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 SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String deviceName, + String addonName) { + Response response = deleteWithResponse(resourceGroupName, deviceName, addonName); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); + } + + /** + * Deletes the addon on the device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @param addonName The addon name. + * @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 SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String deviceName, String addonName, + Context context) { + Response response = deleteWithResponse(resourceGroupName, deviceName, addonName, context); + return this.client.getLroResult(response, Void.class, Void.class, context); + } + + /** + * Deletes the addon on the device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @param addonName The addon name. + * @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 deleteAsync(String resourceGroupName, String deviceName, String addonName) { + return beginDeleteAsync(resourceGroupName, deviceName, addonName).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the addon on the device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @param addonName The addon name. + * @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 delete(String resourceGroupName, String deviceName, String addonName) { + beginDelete(resourceGroupName, deviceName, addonName).getFinalResult(); + } + + /** + * Deletes the addon on the device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @param addonName The addon name. + * @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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String deviceName, String addonName, Context context) { + beginDelete(resourceGroupName, deviceName, addonName, context).getFinalResult(); + } + + /** + * Lists all the addons configured in the role. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @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 collection of all the Role addon on the Azure Stack Edge device along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByRoleSinglePageAsync(String resourceGroupName, String deviceName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByRole(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, deviceName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists all the addons configured in the role. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @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 collection of all the Role addon on the Azure Stack Edge device as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByRoleAsync(String resourceGroupName, String deviceName) { + return new PagedFlux<>(() -> listByRoleSinglePageAsync(resourceGroupName, deviceName), + nextLink -> listByRoleNextSinglePageAsync(nextLink)); + } + + /** + * Lists all the addons configured in the role. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @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 collection of all the Role addon on the Azure Stack Edge device along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByRoleSinglePage(String resourceGroupName, String deviceName) { + final String accept = "application/json"; + Response res = service.listByRoleSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, deviceName, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Lists all the addons configured in the role. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @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 collection of all the Role addon on the Azure Stack Edge device along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByRoleSinglePage(String resourceGroupName, String deviceName, + Context context) { + final String accept = "application/json"; + Response res = service.listByRoleSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, deviceName, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Lists all the addons configured in the role. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @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 collection of all the Role addon on the Azure Stack Edge device as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByRole(String resourceGroupName, String deviceName) { + return new PagedIterable<>(() -> listByRoleSinglePage(resourceGroupName, deviceName), + nextLink -> listByRoleNextSinglePage(nextLink)); + } + + /** + * Lists all the addons configured in the role. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @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 collection of all the Role addon on the Azure Stack Edge device as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByRole(String resourceGroupName, String deviceName, Context context) { + return new PagedIterable<>(() -> listByRoleSinglePage(resourceGroupName, deviceName, context), + nextLink -> listByRoleNextSinglePage(nextLink, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @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 collection of all the Role addon on the Azure Stack Edge device along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByRoleNextSinglePageAsync(String nextLink) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByRoleNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @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 collection of all the Role addon on the Azure Stack Edge device along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByRoleNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res = service.listByRoleNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @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 collection of all the Role addon on the Azure Stack Edge device along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByRoleNextSinglePage(String nextLink, Context context) { + final String accept = "application/json"; + Response res = service.listByRoleNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/AddonsImpl.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/AddonsImpl.java new file mode 100644 index 000000000000..8cc116a57ba8 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/AddonsImpl.java @@ -0,0 +1,156 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.databoxedge.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.databoxedge.fluent.AddonsClient; +import com.azure.resourcemanager.databoxedge.fluent.models.AddonInner; +import com.azure.resourcemanager.databoxedge.models.Addon; +import com.azure.resourcemanager.databoxedge.models.Addons; + +public final class AddonsImpl implements Addons { + private static final ClientLogger LOGGER = new ClientLogger(AddonsImpl.class); + + private final AddonsClient innerClient; + + private final com.azure.resourcemanager.databoxedge.DataBoxEdgeManager serviceManager; + + public AddonsImpl(AddonsClient innerClient, + com.azure.resourcemanager.databoxedge.DataBoxEdgeManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse(String resourceGroupName, String deviceName, String addonName, + Context context) { + Response inner + = this.serviceClient().getWithResponse(resourceGroupName, deviceName, addonName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new AddonImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public Addon get(String resourceGroupName, String deviceName, String addonName) { + AddonInner inner = this.serviceClient().get(resourceGroupName, deviceName, addonName); + if (inner != null) { + return new AddonImpl(inner, this.manager()); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String deviceName, String addonName) { + this.serviceClient().delete(resourceGroupName, deviceName, addonName); + } + + public void delete(String resourceGroupName, String deviceName, String addonName, Context context) { + this.serviceClient().delete(resourceGroupName, deviceName, addonName, context); + } + + public PagedIterable listByRole(String resourceGroupName, String deviceName) { + PagedIterable inner = this.serviceClient().listByRole(resourceGroupName, deviceName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new AddonImpl(inner1, this.manager())); + } + + public PagedIterable listByRole(String resourceGroupName, String deviceName, Context context) { + PagedIterable inner = this.serviceClient().listByRole(resourceGroupName, deviceName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new AddonImpl(inner1, this.manager())); + } + + public Addon getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String deviceName = ResourceManagerUtils.getValueFromIdByName(id, "dataBoxEdgeDevices"); + if (deviceName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'dataBoxEdgeDevices'.", id))); + } + String addonName = ResourceManagerUtils.getValueFromIdByName(id, "addons"); + if (addonName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'addons'.", id))); + } + return this.getWithResponse(resourceGroupName, deviceName, addonName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String deviceName = ResourceManagerUtils.getValueFromIdByName(id, "dataBoxEdgeDevices"); + if (deviceName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'dataBoxEdgeDevices'.", id))); + } + String addonName = ResourceManagerUtils.getValueFromIdByName(id, "addons"); + if (addonName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'addons'.", id))); + } + return this.getWithResponse(resourceGroupName, deviceName, addonName, context); + } + + public void deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String deviceName = ResourceManagerUtils.getValueFromIdByName(id, "dataBoxEdgeDevices"); + if (deviceName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'dataBoxEdgeDevices'.", id))); + } + String addonName = ResourceManagerUtils.getValueFromIdByName(id, "addons"); + if (addonName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'addons'.", id))); + } + this.delete(resourceGroupName, deviceName, addonName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String deviceName = ResourceManagerUtils.getValueFromIdByName(id, "dataBoxEdgeDevices"); + if (deviceName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'dataBoxEdgeDevices'.", id))); + } + String addonName = ResourceManagerUtils.getValueFromIdByName(id, "addons"); + if (addonName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'addons'.", id))); + } + this.delete(resourceGroupName, deviceName, addonName, context); + } + + private AddonsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.databoxedge.DataBoxEdgeManager manager() { + return this.serviceManager; + } + + public AddonImpl define(String name) { + return new AddonImpl(name, this.manager()); + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/AlertImpl.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/AlertImpl.java index a2a300d70750..0868ebec7ed4 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/AlertImpl.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/AlertImpl.java @@ -1,9 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.implementation; +import com.azure.core.management.SystemData; import com.azure.resourcemanager.databoxedge.fluent.models.AlertInner; import com.azure.resourcemanager.databoxedge.models.Alert; import com.azure.resourcemanager.databoxedge.models.AlertErrorDetails; @@ -34,6 +35,10 @@ public String type() { return this.innerModel().type(); } + public SystemData systemData() { + return this.innerModel().systemData(); + } + public String title() { return this.innerModel().title(); } diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/AlertsClientImpl.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/AlertsClientImpl.java index 2662c1c58018..065259747bf1 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/AlertsClientImpl.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/AlertsClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.implementation; @@ -27,7 +27,7 @@ import com.azure.core.util.FluxUtil; import com.azure.resourcemanager.databoxedge.fluent.AlertsClient; import com.azure.resourcemanager.databoxedge.fluent.models.AlertInner; -import com.azure.resourcemanager.databoxedge.models.AlertList; +import com.azure.resourcemanager.databoxedge.implementation.models.AlertList; import reactor.core.publisher.Mono; /** @@ -58,25 +58,43 @@ public final class AlertsClientImpl implements AlertsClient { * The interface defining all the services for DataBoxEdgeManagementClientAlerts to be used by the proxy service to * perform REST calls. */ - @Host("{$host}") - @ServiceInterface(name = "DataBoxEdgeManagemen") + @Host("{endpoint}") + @ServiceInterface(name = "DataBoxEdgeManagementClientAlerts") public interface AlertsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/alerts/{name}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("deviceName") String deviceName, + @PathParam("name") String name, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/alerts/{name}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("deviceName") String deviceName, + @PathParam("name") String name, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/alerts") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByDataBoxEdgeDevice(@HostParam("$host") String endpoint, - @PathParam("deviceName") String deviceName, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, + Mono> listByDataBoxEdgeDevice(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("deviceName") String deviceName, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/alerts/{name}") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/alerts") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("$host") String endpoint, @PathParam("deviceName") String deviceName, - @PathParam("name") String name, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, + Response listByDataBoxEdgeDeviceSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("deviceName") String deviceName, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @@ -84,281 +102,228 @@ Mono> get(@HostParam("$host") String endpoint, @PathParam(" @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByDataBoxEdgeDeviceNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listByDataBoxEdgeDeviceNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** - * Gets all the alerts for a Data Box Edge/Data Box Gateway device. + * Gets an alert by name. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param resourceGroupName The resource group name. + * @param name The alert name. * @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 all the alerts for a Data Box Edge/Data Box Gateway device along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * @return an alert by name along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByDataBoxEdgeDeviceSinglePageAsync(String deviceName, - String resourceGroupName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (deviceName == null) { - return Mono.error(new IllegalArgumentException("Parameter deviceName 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.")); - } + private Mono> getWithResponseAsync(String resourceGroupName, String deviceName, String name) { final String accept = "application/json"; return FluxUtil - .withContext(context -> service.listByDataBoxEdgeDevice(this.client.getEndpoint(), deviceName, - this.client.getSubscriptionId(), resourceGroupName, this.client.getApiVersion(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), - res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, deviceName, name, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Gets all the alerts for a Data Box Edge/Data Box Gateway device. + * Gets an alert by name. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param resourceGroupName The resource group name. - * @param context The context to associate with this operation. + * @param name The alert name. * @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 all the alerts for a Data Box Edge/Data Box Gateway device along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * @return an alert by name on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByDataBoxEdgeDeviceSinglePageAsync(String deviceName, - String resourceGroupName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (deviceName == null) { - return Mono.error(new IllegalArgumentException("Parameter deviceName 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.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByDataBoxEdgeDevice(this.client.getEndpoint(), deviceName, this.client.getSubscriptionId(), - resourceGroupName, this.client.getApiVersion(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + private Mono getAsync(String resourceGroupName, String deviceName, String name) { + return getWithResponseAsync(resourceGroupName, deviceName, name) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Gets all the alerts for a Data Box Edge/Data Box Gateway device. + * Gets an alert by name. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param resourceGroupName The resource group name. + * @param name The alert name. + * @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 all the alerts for a Data Box Edge/Data Box Gateway device as paginated response with {@link PagedFlux}. + * @return an alert by name along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByDataBoxEdgeDeviceAsync(String deviceName, String resourceGroupName) { - return new PagedFlux<>(() -> listByDataBoxEdgeDeviceSinglePageAsync(deviceName, resourceGroupName), - nextLink -> listByDataBoxEdgeDeviceNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String deviceName, String name, + Context context) { + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, deviceName, name, accept, context); } /** - * Gets all the alerts for a Data Box Edge/Data Box Gateway device. + * Gets an alert by name. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param resourceGroupName The resource group name. - * @param context The context to associate with this operation. + * @param name The alert name. * @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 all the alerts for a Data Box Edge/Data Box Gateway device as paginated response with {@link PagedFlux}. + * @return an alert by name. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByDataBoxEdgeDeviceAsync(String deviceName, String resourceGroupName, - Context context) { - return new PagedFlux<>(() -> listByDataBoxEdgeDeviceSinglePageAsync(deviceName, resourceGroupName, context), - nextLink -> listByDataBoxEdgeDeviceNextSinglePageAsync(nextLink, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + public AlertInner get(String resourceGroupName, String deviceName, String name) { + return getWithResponse(resourceGroupName, deviceName, name, Context.NONE).getValue(); } /** * Gets all the alerts for a Data Box Edge/Data Box Gateway device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param resourceGroupName The resource group name. * @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 all the alerts for a Data Box Edge/Data Box Gateway device as paginated response with - * {@link PagedIterable}. + * @return all the alerts for a Data Box Edge/Data Box Gateway device along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByDataBoxEdgeDevice(String deviceName, String resourceGroupName) { - return new PagedIterable<>(listByDataBoxEdgeDeviceAsync(deviceName, resourceGroupName)); + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByDataBoxEdgeDeviceSinglePageAsync(String resourceGroupName, + String deviceName) { + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByDataBoxEdgeDevice(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, deviceName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Gets all the alerts for a Data Box Edge/Data Box Gateway device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param resourceGroupName The resource group name. - * @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 all the alerts for a Data Box Edge/Data Box Gateway device as paginated response with - * {@link PagedIterable}. + * @return all the alerts for a Data Box Edge/Data Box Gateway device as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByDataBoxEdgeDevice(String deviceName, String resourceGroupName, - Context context) { - return new PagedIterable<>(listByDataBoxEdgeDeviceAsync(deviceName, resourceGroupName, context)); + private PagedFlux listByDataBoxEdgeDeviceAsync(String resourceGroupName, String deviceName) { + return new PagedFlux<>(() -> listByDataBoxEdgeDeviceSinglePageAsync(resourceGroupName, deviceName), + nextLink -> listByDataBoxEdgeDeviceNextSinglePageAsync(nextLink)); } /** - * Gets an alert by name. + * Gets all the alerts for a Data Box Edge/Data Box Gateway device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param name The alert name. - * @param resourceGroupName The resource group name. * @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 an alert by name along with {@link Response} on successful completion of {@link Mono}. + * @return all the alerts for a Data Box Edge/Data Box Gateway device along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String deviceName, String name, String resourceGroupName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (deviceName == null) { - return Mono.error(new IllegalArgumentException("Parameter deviceName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name 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.")); - } + private PagedResponse listByDataBoxEdgeDeviceSinglePage(String resourceGroupName, String deviceName) { final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), deviceName, name, - this.client.getSubscriptionId(), resourceGroupName, this.client.getApiVersion(), accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + Response res + = service.listByDataBoxEdgeDeviceSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, deviceName, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** - * Gets an alert by name. + * Gets all the alerts for a Data Box Edge/Data Box Gateway device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param name The alert name. - * @param resourceGroupName The resource group name. * @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 an alert by name along with {@link Response} on successful completion of {@link Mono}. + * @return all the alerts for a Data Box Edge/Data Box Gateway device along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String deviceName, String name, String resourceGroupName, + private PagedResponse listByDataBoxEdgeDeviceSinglePage(String resourceGroupName, String deviceName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (deviceName == null) { - return Mono.error(new IllegalArgumentException("Parameter deviceName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name 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.")); - } final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), deviceName, name, this.client.getSubscriptionId(), - resourceGroupName, this.client.getApiVersion(), accept, context); + Response res + = service.listByDataBoxEdgeDeviceSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, deviceName, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** - * Gets an alert by name. + * Gets all the alerts for a Data Box Edge/Data Box Gateway device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param name The alert name. - * @param resourceGroupName The resource group name. * @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 an alert by name on successful completion of {@link Mono}. + * @return all the alerts for a Data Box Edge/Data Box Gateway device as paginated response with + * {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String deviceName, String name, String resourceGroupName) { - return getWithResponseAsync(deviceName, name, resourceGroupName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByDataBoxEdgeDevice(String resourceGroupName, String deviceName) { + return new PagedIterable<>(() -> listByDataBoxEdgeDeviceSinglePage(resourceGroupName, deviceName), + nextLink -> listByDataBoxEdgeDeviceNextSinglePage(nextLink)); } /** - * Gets an alert by name. + * Gets all the alerts for a Data Box Edge/Data Box Gateway device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param name The alert name. - * @param resourceGroupName The resource group name. * @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 an alert by name along with {@link Response}. + * @return all the alerts for a Data Box Edge/Data Box Gateway device as paginated response with + * {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String deviceName, String name, String resourceGroupName, + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByDataBoxEdgeDevice(String resourceGroupName, String deviceName, Context context) { - return getWithResponseAsync(deviceName, name, resourceGroupName, context).block(); + return new PagedIterable<>(() -> listByDataBoxEdgeDeviceSinglePage(resourceGroupName, deviceName, context), + nextLink -> listByDataBoxEdgeDeviceNextSinglePage(nextLink, context)); } /** - * Gets an alert by name. + * Get the next page of items. * - * @param deviceName The device name. - * @param name The alert name. - * @param resourceGroupName The resource group name. + * @param nextLink The URL to get the next list of items. * @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 an alert by name. + * @return all the alerts for a Data Box Edge/Data Box Gateway device along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public AlertInner get(String deviceName, String name, String resourceGroupName) { - return getWithResponse(deviceName, name, resourceGroupName, Context.NONE).getValue(); + private Mono> listByDataBoxEdgeDeviceNextSinglePageAsync(String nextLink) { + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByDataBoxEdgeDeviceNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -368,24 +333,15 @@ public AlertInner get(String deviceName, String name, 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 collection of alerts along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return all the alerts for a Data Box Edge/Data Box Gateway device along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByDataBoxEdgeDeviceNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } + private PagedResponse listByDataBoxEdgeDeviceNextSinglePage(String nextLink) { final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listByDataBoxEdgeDeviceNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), - res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + Response res + = service.listByDataBoxEdgeDeviceNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -396,22 +352,14 @@ private Mono> listByDataBoxEdgeDeviceNextSinglePageAsy * @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 collection of alerts along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return all the alerts for a Data Box Edge/Data Box Gateway device along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByDataBoxEdgeDeviceNextSinglePageAsync(String nextLink, - Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } + private PagedResponse listByDataBoxEdgeDeviceNextSinglePage(String nextLink, Context context) { final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listByDataBoxEdgeDeviceNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + Response res + = service.listByDataBoxEdgeDeviceNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } } diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/AlertsImpl.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/AlertsImpl.java index 7cac7f127490..7381a7763500 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/AlertsImpl.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/AlertsImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.implementation; @@ -27,19 +27,8 @@ public AlertsImpl(AlertsClient innerClient, this.serviceManager = serviceManager; } - public PagedIterable listByDataBoxEdgeDevice(String deviceName, String resourceGroupName) { - PagedIterable inner = this.serviceClient().listByDataBoxEdgeDevice(deviceName, resourceGroupName); - return ResourceManagerUtils.mapPage(inner, inner1 -> new AlertImpl(inner1, this.manager())); - } - - public PagedIterable listByDataBoxEdgeDevice(String deviceName, String resourceGroupName, Context context) { - PagedIterable inner - = this.serviceClient().listByDataBoxEdgeDevice(deviceName, resourceGroupName, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new AlertImpl(inner1, this.manager())); - } - - public Response getWithResponse(String deviceName, String name, String resourceGroupName, Context context) { - Response inner = this.serviceClient().getWithResponse(deviceName, name, resourceGroupName, context); + public Response getWithResponse(String resourceGroupName, String deviceName, String name, Context context) { + Response inner = this.serviceClient().getWithResponse(resourceGroupName, deviceName, name, context); if (inner != null) { return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), new AlertImpl(inner.getValue(), this.manager())); @@ -48,8 +37,8 @@ public Response getWithResponse(String deviceName, String name, String re } } - public Alert get(String deviceName, String name, String resourceGroupName) { - AlertInner inner = this.serviceClient().get(deviceName, name, resourceGroupName); + public Alert get(String resourceGroupName, String deviceName, String name) { + AlertInner inner = this.serviceClient().get(resourceGroupName, deviceName, name); if (inner != null) { return new AlertImpl(inner, this.manager()); } else { @@ -57,6 +46,17 @@ public Alert get(String deviceName, String name, String resourceGroupName) { } } + public PagedIterable listByDataBoxEdgeDevice(String resourceGroupName, String deviceName) { + PagedIterable inner = this.serviceClient().listByDataBoxEdgeDevice(resourceGroupName, deviceName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new AlertImpl(inner1, this.manager())); + } + + public PagedIterable listByDataBoxEdgeDevice(String resourceGroupName, String deviceName, Context context) { + PagedIterable inner + = this.serviceClient().listByDataBoxEdgeDevice(resourceGroupName, deviceName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new AlertImpl(inner1, this.manager())); + } + private AlertsClient serviceClient() { return this.innerClient; } diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/AvailableSkusClientImpl.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/AvailableSkusClientImpl.java new file mode 100644 index 000000000000..7db68308ae4a --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/AvailableSkusClientImpl.java @@ -0,0 +1,132 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.databoxedge.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.databoxedge.fluent.AvailableSkusClient; +import com.azure.resourcemanager.databoxedge.fluent.models.DataBoxEdgeSkuListInner; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in AvailableSkusClient. + */ +public final class AvailableSkusClientImpl implements AvailableSkusClient { + /** + * The proxy service used to perform REST calls. + */ + private final AvailableSkusService service; + + /** + * The service client containing this operation class. + */ + private final DataBoxEdgeManagementClientImpl client; + + /** + * Initializes an instance of AvailableSkusClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + AvailableSkusClientImpl(DataBoxEdgeManagementClientImpl client) { + this.service + = RestProxy.create(AvailableSkusService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for DataBoxEdgeManagementClientAvailableSkus to be used by the proxy + * service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "DataBoxEdgeManagementClientAvailableSkus") + public interface AvailableSkusService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.DataBoxEdge/availableSkus") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.DataBoxEdge/availableSkus") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * List all the available Skus and information related to them. + * + * @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 SKU Information objects along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listWithResponseAsync() { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List all the available Skus and information related to them. + * + * @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 SKU Information objects on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listAsync() { + return listWithResponseAsync().flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * List all the available Skus and information related to them. + * + * @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 list of SKU Information objects along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listWithResponse(Context context) { + final String accept = "application/json"; + return service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + accept, context); + } + + /** + * List all the available Skus and information related to them. + * + * @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 SKU Information objects. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DataBoxEdgeSkuListInner list() { + return listWithResponse(Context.NONE).getValue(); + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/AvailableSkusImpl.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/AvailableSkusImpl.java new file mode 100644 index 000000000000..2083f5ece12c --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/AvailableSkusImpl.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.databoxedge.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.databoxedge.fluent.AvailableSkusClient; +import com.azure.resourcemanager.databoxedge.fluent.models.DataBoxEdgeSkuListInner; +import com.azure.resourcemanager.databoxedge.models.AvailableSkus; +import com.azure.resourcemanager.databoxedge.models.DataBoxEdgeSkuList; + +public final class AvailableSkusImpl implements AvailableSkus { + private static final ClientLogger LOGGER = new ClientLogger(AvailableSkusImpl.class); + + private final AvailableSkusClient innerClient; + + private final com.azure.resourcemanager.databoxedge.DataBoxEdgeManager serviceManager; + + public AvailableSkusImpl(AvailableSkusClient innerClient, + com.azure.resourcemanager.databoxedge.DataBoxEdgeManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response listWithResponse(Context context) { + Response inner = this.serviceClient().listWithResponse(context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new DataBoxEdgeSkuListImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public DataBoxEdgeSkuList list() { + DataBoxEdgeSkuListInner inner = this.serviceClient().list(); + if (inner != null) { + return new DataBoxEdgeSkuListImpl(inner, this.manager()); + } else { + return null; + } + } + + private AvailableSkusClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.databoxedge.DataBoxEdgeManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/BandwidthScheduleImpl.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/BandwidthScheduleImpl.java index 5dc7229ac9d1..eaa4ab0d417e 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/BandwidthScheduleImpl.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/BandwidthScheduleImpl.java @@ -1,9 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.implementation; +import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.databoxedge.fluent.models.BandwidthScheduleInner; import com.azure.resourcemanager.databoxedge.models.BandwidthSchedule; @@ -29,6 +30,10 @@ public String type() { return this.innerModel().type(); } + public SystemData systemData() { + return this.innerModel().systemData(); + } + public String start() { return this.innerModel().start(); } @@ -62,29 +67,29 @@ private com.azure.resourcemanager.databoxedge.DataBoxEdgeManager manager() { return this.serviceManager; } + private String resourceGroupName; + private String deviceName; private String name; - private String resourceGroupName; - - public BandwidthScheduleImpl withExistingDataBoxEdgeDevice(String deviceName, String resourceGroupName) { - this.deviceName = deviceName; + public BandwidthScheduleImpl withExistingDataBoxEdgeDevice(String resourceGroupName, String deviceName) { this.resourceGroupName = resourceGroupName; + this.deviceName = deviceName; return this; } public BandwidthSchedule create() { this.innerObject = serviceManager.serviceClient() .getBandwidthSchedules() - .createOrUpdate(deviceName, name, resourceGroupName, this.innerModel(), Context.NONE); + .createOrUpdate(resourceGroupName, deviceName, name, this.innerModel(), Context.NONE); return this; } public BandwidthSchedule create(Context context) { this.innerObject = serviceManager.serviceClient() .getBandwidthSchedules() - .createOrUpdate(deviceName, name, resourceGroupName, this.innerModel(), context); + .createOrUpdate(resourceGroupName, deviceName, name, this.innerModel(), context); return this; } @@ -101,14 +106,14 @@ public BandwidthScheduleImpl update() { public BandwidthSchedule apply() { this.innerObject = serviceManager.serviceClient() .getBandwidthSchedules() - .createOrUpdate(deviceName, name, resourceGroupName, this.innerModel(), Context.NONE); + .createOrUpdate(resourceGroupName, deviceName, name, this.innerModel(), Context.NONE); return this; } public BandwidthSchedule apply(Context context) { this.innerObject = serviceManager.serviceClient() .getBandwidthSchedules() - .createOrUpdate(deviceName, name, resourceGroupName, this.innerModel(), context); + .createOrUpdate(resourceGroupName, deviceName, name, this.innerModel(), context); return this; } @@ -116,15 +121,15 @@ public BandwidthSchedule apply(Context context) { com.azure.resourcemanager.databoxedge.DataBoxEdgeManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); this.deviceName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "dataBoxEdgeDevices"); this.name = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "bandwidthSchedules"); - this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); } public BandwidthSchedule refresh() { this.innerObject = serviceManager.serviceClient() .getBandwidthSchedules() - .getWithResponse(deviceName, name, resourceGroupName, Context.NONE) + .getWithResponse(resourceGroupName, deviceName, name, Context.NONE) .getValue(); return this; } @@ -132,7 +137,7 @@ public BandwidthSchedule refresh() { public BandwidthSchedule refresh(Context context) { this.innerObject = serviceManager.serviceClient() .getBandwidthSchedules() - .getWithResponse(deviceName, name, resourceGroupName, context) + .getWithResponse(resourceGroupName, deviceName, name, context) .getValue(); return this; } diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/BandwidthSchedulesClientImpl.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/BandwidthSchedulesClientImpl.java index 15a7c45af71f..3883ca81dfb2 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/BandwidthSchedulesClientImpl.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/BandwidthSchedulesClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.implementation; @@ -27,13 +27,14 @@ import com.azure.core.http.rest.RestProxy; import com.azure.core.management.exception.ManagementException; import com.azure.core.management.polling.PollResult; +import com.azure.core.util.BinaryData; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; import com.azure.core.util.polling.PollerFlux; import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.databoxedge.fluent.BandwidthSchedulesClient; import com.azure.resourcemanager.databoxedge.fluent.models.BandwidthScheduleInner; -import com.azure.resourcemanager.databoxedge.models.BandwidthSchedulesList; +import com.azure.resourcemanager.databoxedge.implementation.models.BandwidthSchedulesList; import java.nio.ByteBuffer; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; @@ -67,47 +68,81 @@ public final class BandwidthSchedulesClientImpl implements BandwidthSchedulesCli * The interface defining all the services for DataBoxEdgeManagementClientBandwidthSchedules to be used by the proxy * service to perform REST calls. */ - @Host("{$host}") - @ServiceInterface(name = "DataBoxEdgeManagemen") + @Host("{endpoint}") + @ServiceInterface(name = "DataBoxEdgeManagementClientBandwidthSchedules") public interface BandwidthSchedulesService { @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/bandwidthSchedules") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/bandwidthSchedules/{name}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByDataBoxEdgeDevice(@HostParam("$host") String endpoint, - @PathParam("deviceName") String deviceName, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("deviceName") String deviceName, + @PathParam("name") String name, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/bandwidthSchedules/{name}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("$host") String endpoint, - @PathParam("deviceName") String deviceName, @PathParam("name") String name, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); + Response getSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("deviceName") String deviceName, + @PathParam("name") String name, @HeaderParam("Accept") String accept, Context context); - @Headers({ "Content-Type: application/json" }) @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/bandwidthSchedules/{name}") @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdate(@HostParam("$host") String endpoint, - @PathParam("deviceName") String deviceName, @PathParam("name") String name, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") BandwidthScheduleInner parameters, @HeaderParam("Accept") String accept, + Mono>> createOrUpdate(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("deviceName") String deviceName, + @PathParam("name") String name, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BandwidthScheduleInner parameters, Context context); - @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/bandwidthSchedules/{name}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response createOrUpdateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("deviceName") String deviceName, + @PathParam("name") String name, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BandwidthScheduleInner parameters, + Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/bandwidthSchedules/{name}") + @ExpectedResponses({ 200, 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("deviceName") String deviceName, + @PathParam("name") String name, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/bandwidthSchedules/{name}") @ExpectedResponses({ 200, 202, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete(@HostParam("$host") String endpoint, - @PathParam("deviceName") String deviceName, @PathParam("name") String name, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, + Response deleteSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("deviceName") String deviceName, + @PathParam("name") String name, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/bandwidthSchedules") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByDataBoxEdgeDevice(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("deviceName") String deviceName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/bandwidthSchedules") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listByDataBoxEdgeDeviceSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("deviceName") String deviceName, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @@ -115,164 +150,24 @@ Mono>> delete(@HostParam("$host") String endpoint, @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByDataBoxEdgeDeviceNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); - } - /** - * Gets all the bandwidth schedules for a Data Box Edge/Data Box Gateway device. - * - * @param deviceName The device name. - * @param resourceGroupName The resource group name. - * @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 all the bandwidth schedules for a Data Box Edge/Data Box Gateway device along with {@link PagedResponse} - * on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByDataBoxEdgeDeviceSinglePageAsync(String deviceName, - String resourceGroupName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (deviceName == null) { - return Mono.error(new IllegalArgumentException("Parameter deviceName 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.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listByDataBoxEdgeDevice(this.client.getEndpoint(), deviceName, - this.client.getSubscriptionId(), resourceGroupName, this.client.getApiVersion(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets all the bandwidth schedules for a Data Box Edge/Data Box Gateway device. - * - * @param deviceName The device name. - * @param resourceGroupName The resource group name. - * @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 all the bandwidth schedules for a Data Box Edge/Data Box Gateway device along with {@link PagedResponse} - * on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByDataBoxEdgeDeviceSinglePageAsync(String deviceName, - String resourceGroupName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (deviceName == null) { - return Mono.error(new IllegalArgumentException("Parameter deviceName 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.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByDataBoxEdgeDevice(this.client.getEndpoint(), deviceName, this.client.getSubscriptionId(), - resourceGroupName, this.client.getApiVersion(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * Gets all the bandwidth schedules for a Data Box Edge/Data Box Gateway device. - * - * @param deviceName The device name. - * @param resourceGroupName The resource group name. - * @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 all the bandwidth schedules for a Data Box Edge/Data Box Gateway device as paginated response with - * {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByDataBoxEdgeDeviceAsync(String deviceName, - String resourceGroupName) { - return new PagedFlux<>(() -> listByDataBoxEdgeDeviceSinglePageAsync(deviceName, resourceGroupName), - nextLink -> listByDataBoxEdgeDeviceNextSinglePageAsync(nextLink)); - } - - /** - * Gets all the bandwidth schedules for a Data Box Edge/Data Box Gateway device. - * - * @param deviceName The device name. - * @param resourceGroupName The resource group name. - * @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 all the bandwidth schedules for a Data Box Edge/Data Box Gateway device as paginated response with - * {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByDataBoxEdgeDeviceAsync(String deviceName, String resourceGroupName, - Context context) { - return new PagedFlux<>(() -> listByDataBoxEdgeDeviceSinglePageAsync(deviceName, resourceGroupName, context), - nextLink -> listByDataBoxEdgeDeviceNextSinglePageAsync(nextLink, context)); - } - - /** - * Gets all the bandwidth schedules for a Data Box Edge/Data Box Gateway device. - * - * @param deviceName The device name. - * @param resourceGroupName The resource group name. - * @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 all the bandwidth schedules for a Data Box Edge/Data Box Gateway device as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByDataBoxEdgeDevice(String deviceName, String resourceGroupName) { - return new PagedIterable<>(listByDataBoxEdgeDeviceAsync(deviceName, resourceGroupName)); - } - - /** - * Gets all the bandwidth schedules for a Data Box Edge/Data Box Gateway device. - * - * @param deviceName The device name. - * @param resourceGroupName The resource group name. - * @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 all the bandwidth schedules for a Data Box Edge/Data Box Gateway device as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByDataBoxEdgeDevice(String deviceName, String resourceGroupName, - Context context) { - return new PagedIterable<>(listByDataBoxEdgeDeviceAsync(deviceName, resourceGroupName, context)); + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listByDataBoxEdgeDeviceNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); } /** * Gets the properties of the specified bandwidth schedule. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. * @param name The bandwidth schedule name. - * @param resourceGroupName The resource group name. * @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. @@ -280,96 +175,38 @@ public PagedIterable listByDataBoxEdgeDevice(String devi * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String deviceName, String name, - String resourceGroupName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (deviceName == null) { - return Mono.error(new IllegalArgumentException("Parameter deviceName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name 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.")); - } + private Mono> getWithResponseAsync(String resourceGroupName, String deviceName, + String name) { final String accept = "application/json"; return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), deviceName, name, - this.client.getSubscriptionId(), resourceGroupName, this.client.getApiVersion(), accept, context)) + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, deviceName, name, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Gets the properties of the specified bandwidth schedule. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. * @param name The bandwidth schedule name. - * @param resourceGroupName The resource group name. - * @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 properties of the specified bandwidth schedule along with {@link Response} on successful completion - * of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String deviceName, String name, - String resourceGroupName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (deviceName == null) { - return Mono.error(new IllegalArgumentException("Parameter deviceName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name 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.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), deviceName, name, this.client.getSubscriptionId(), - resourceGroupName, this.client.getApiVersion(), accept, context); - } - - /** - * Gets the properties of the specified bandwidth schedule. - * - * @param deviceName The device name. - * @param name The bandwidth schedule name. - * @param resourceGroupName The resource group name. * @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 properties of the specified bandwidth schedule on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String deviceName, String name, String resourceGroupName) { - return getWithResponseAsync(deviceName, name, resourceGroupName) + private Mono getAsync(String resourceGroupName, String deviceName, String name) { + return getWithResponseAsync(resourceGroupName, deviceName, name) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * Gets the properties of the specified bandwidth schedule. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. * @param name The bandwidth schedule name. - * @param resourceGroupName The resource group name. * @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. @@ -377,33 +214,35 @@ private Mono getAsync(String deviceName, String name, St * @return the properties of the specified bandwidth schedule along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String deviceName, String name, String resourceGroupName, + public Response getWithResponse(String resourceGroupName, String deviceName, String name, Context context) { - return getWithResponseAsync(deviceName, name, resourceGroupName, context).block(); + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, deviceName, name, accept, context); } /** * Gets the properties of the specified bandwidth schedule. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. * @param name The bandwidth schedule name. - * @param resourceGroupName The resource group name. * @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 properties of the specified bandwidth schedule. */ @ServiceMethod(returns = ReturnType.SINGLE) - public BandwidthScheduleInner get(String deviceName, String name, String resourceGroupName) { - return getWithResponse(deviceName, name, resourceGroupName, Context.NONE).getValue(); + public BandwidthScheduleInner get(String resourceGroupName, String deviceName, String name) { + return getWithResponse(resourceGroupName, deviceName, name, Context.NONE).getValue(); } /** * Creates or updates a bandwidth schedule. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param name The bandwidth schedule name which needs to be added/updated. - * @param resourceGroupName The resource group name. + * @param name The bandwidth schedule name. * @param parameters The bandwidth schedule to be added or updated. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -411,35 +250,13 @@ public BandwidthScheduleInner get(String deviceName, String name, String resourc * @return the bandwidth schedule details along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync(String deviceName, String name, - String resourceGroupName, BandwidthScheduleInner parameters) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (deviceName == null) { - return Mono.error(new IllegalArgumentException("Parameter deviceName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name 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 (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } + private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, + String deviceName, String name, BandwidthScheduleInner parameters) { + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), deviceName, name, - this.client.getSubscriptionId(), resourceGroupName, this.client.getApiVersion(), parameters, accept, + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, deviceName, name, contentType, accept, parameters, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -447,78 +264,55 @@ private Mono>> createOrUpdateWithResponseAsync(String /** * Creates or updates a bandwidth schedule. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param name The bandwidth schedule name which needs to be added/updated. - * @param resourceGroupName The resource group name. + * @param name The bandwidth schedule name. * @param parameters The bandwidth schedule to be added or updated. - * @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 bandwidth schedule details along with {@link Response} on successful completion of {@link Mono}. + * @return the bandwidth schedule details along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync(String deviceName, String name, - String resourceGroupName, BandwidthScheduleInner parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (deviceName == null) { - return Mono.error(new IllegalArgumentException("Parameter deviceName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name 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 (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } + private Response createOrUpdateWithResponse(String resourceGroupName, String deviceName, String name, + BandwidthScheduleInner parameters) { + final String contentType = "application/json"; final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.createOrUpdate(this.client.getEndpoint(), deviceName, name, this.client.getSubscriptionId(), - resourceGroupName, this.client.getApiVersion(), parameters, accept, context); + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, deviceName, name, contentType, accept, parameters, + Context.NONE); } /** * Creates or updates a bandwidth schedule. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param name The bandwidth schedule name which needs to be added/updated. - * @param resourceGroupName The resource group name. + * @param name The bandwidth schedule name. * @param parameters The bandwidth schedule to be added or updated. + * @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 PollerFlux} for polling of the bandwidth schedule details. + * @return the bandwidth schedule details along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, BandwidthScheduleInner> beginCreateOrUpdateAsync( - String deviceName, String name, String resourceGroupName, BandwidthScheduleInner parameters) { - Mono>> mono - = createOrUpdateWithResponseAsync(deviceName, name, resourceGroupName, parameters); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), BandwidthScheduleInner.class, BandwidthScheduleInner.class, - this.client.getContext()); + @ServiceMethod(returns = ReturnType.SINGLE) + private Response createOrUpdateWithResponse(String resourceGroupName, String deviceName, String name, + BandwidthScheduleInner parameters, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, deviceName, name, contentType, accept, parameters, + context); } /** * Creates or updates a bandwidth schedule. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param name The bandwidth schedule name which needs to be added/updated. - * @param resourceGroupName The resource group name. + * @param name The bandwidth schedule name. * @param parameters The bandwidth schedule to be added or updated. - * @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. @@ -526,20 +320,20 @@ private PollerFlux, BandwidthScheduleInner> b */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, BandwidthScheduleInner> beginCreateOrUpdateAsync( - String deviceName, String name, String resourceGroupName, BandwidthScheduleInner parameters, Context context) { - context = this.client.mergeContext(context); + String resourceGroupName, String deviceName, String name, BandwidthScheduleInner parameters) { Mono>> mono - = createOrUpdateWithResponseAsync(deviceName, name, resourceGroupName, parameters, context); + = createOrUpdateWithResponseAsync(resourceGroupName, deviceName, name, parameters); return this.client.getLroResult(mono, - this.client.getHttpPipeline(), BandwidthScheduleInner.class, BandwidthScheduleInner.class, context); + this.client.getHttpPipeline(), BandwidthScheduleInner.class, BandwidthScheduleInner.class, + this.client.getContext()); } /** * Creates or updates a bandwidth schedule. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param name The bandwidth schedule name which needs to be added/updated. - * @param resourceGroupName The resource group name. + * @param name The bandwidth schedule name. * @param parameters The bandwidth schedule to be added or updated. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -547,17 +341,19 @@ private PollerFlux, BandwidthScheduleInner> b * @return the {@link SyncPoller} for polling of the bandwidth schedule details. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, BandwidthScheduleInner> beginCreateOrUpdate(String deviceName, - String name, String resourceGroupName, BandwidthScheduleInner parameters) { - return this.beginCreateOrUpdateAsync(deviceName, name, resourceGroupName, parameters).getSyncPoller(); + public SyncPoller, BandwidthScheduleInner> beginCreateOrUpdate( + String resourceGroupName, String deviceName, String name, BandwidthScheduleInner parameters) { + Response response = createOrUpdateWithResponse(resourceGroupName, deviceName, name, parameters); + return this.client.getLroResult(response, + BandwidthScheduleInner.class, BandwidthScheduleInner.class, Context.NONE); } /** * Creates or updates a bandwidth schedule. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param name The bandwidth schedule name which needs to be added/updated. - * @param resourceGroupName The resource group name. + * @param name The bandwidth schedule name. * @param parameters The bandwidth schedule to be added or updated. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -566,17 +362,20 @@ public SyncPoller, BandwidthScheduleInner> be * @return the {@link SyncPoller} for polling of the bandwidth schedule details. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, BandwidthScheduleInner> beginCreateOrUpdate(String deviceName, - String name, String resourceGroupName, BandwidthScheduleInner parameters, Context context) { - return this.beginCreateOrUpdateAsync(deviceName, name, resourceGroupName, parameters, context).getSyncPoller(); + public SyncPoller, BandwidthScheduleInner> beginCreateOrUpdate( + String resourceGroupName, String deviceName, String name, BandwidthScheduleInner parameters, Context context) { + Response response + = createOrUpdateWithResponse(resourceGroupName, deviceName, name, parameters, context); + return this.client.getLroResult(response, + BandwidthScheduleInner.class, BandwidthScheduleInner.class, context); } /** * Creates or updates a bandwidth schedule. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param name The bandwidth schedule name which needs to be added/updated. - * @param resourceGroupName The resource group name. + * @param name The bandwidth schedule name. * @param parameters The bandwidth schedule to be added or updated. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -584,38 +383,18 @@ public SyncPoller, BandwidthScheduleInner> be * @return the bandwidth schedule details on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String deviceName, String name, String resourceGroupName, + private Mono createOrUpdateAsync(String resourceGroupName, String deviceName, String name, BandwidthScheduleInner parameters) { - return beginCreateOrUpdateAsync(deviceName, name, resourceGroupName, parameters).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Creates or updates a bandwidth schedule. - * - * @param deviceName The device name. - * @param name The bandwidth schedule name which needs to be added/updated. - * @param resourceGroupName The resource group name. - * @param parameters The bandwidth schedule to be added or updated. - * @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 bandwidth schedule details on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String deviceName, String name, String resourceGroupName, - BandwidthScheduleInner parameters, Context context) { - return beginCreateOrUpdateAsync(deviceName, name, resourceGroupName, parameters, context).last() + return beginCreateOrUpdateAsync(resourceGroupName, deviceName, name, parameters).last() .flatMap(this.client::getLroFinalResultOrError); } /** * Creates or updates a bandwidth schedule. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param name The bandwidth schedule name which needs to be added/updated. - * @param resourceGroupName The resource group name. + * @param name The bandwidth schedule name. * @param parameters The bandwidth schedule to be added or updated. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -623,17 +402,17 @@ private Mono createOrUpdateAsync(String deviceName, Stri * @return the bandwidth schedule details. */ @ServiceMethod(returns = ReturnType.SINGLE) - public BandwidthScheduleInner createOrUpdate(String deviceName, String name, String resourceGroupName, + public BandwidthScheduleInner createOrUpdate(String resourceGroupName, String deviceName, String name, BandwidthScheduleInner parameters) { - return createOrUpdateAsync(deviceName, name, resourceGroupName, parameters).block(); + return beginCreateOrUpdate(resourceGroupName, deviceName, name, parameters).getFinalResult(); } /** * Creates or updates a bandwidth schedule. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param name The bandwidth schedule name which needs to be added/updated. - * @param resourceGroupName The resource group name. + * @param name The bandwidth schedule name. * @param parameters The bandwidth schedule to be added or updated. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -642,151 +421,109 @@ public BandwidthScheduleInner createOrUpdate(String deviceName, String name, Str * @return the bandwidth schedule details. */ @ServiceMethod(returns = ReturnType.SINGLE) - public BandwidthScheduleInner createOrUpdate(String deviceName, String name, String resourceGroupName, + public BandwidthScheduleInner createOrUpdate(String resourceGroupName, String deviceName, String name, BandwidthScheduleInner parameters, Context context) { - return createOrUpdateAsync(deviceName, name, resourceGroupName, parameters, context).block(); + return beginCreateOrUpdate(resourceGroupName, deviceName, name, parameters, context).getFinalResult(); } /** * Deletes the specified bandwidth schedule. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. * @param name The bandwidth schedule name. - * @param resourceGroupName The resource group name. * @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>> deleteWithResponseAsync(String deviceName, String name, - String resourceGroupName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (deviceName == null) { - return Mono.error(new IllegalArgumentException("Parameter deviceName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name 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.")); - } - final String accept = "application/json"; + private Mono>> deleteWithResponseAsync(String resourceGroupName, String deviceName, + String name) { return FluxUtil - .withContext(context -> service.delete(this.client.getEndpoint(), deviceName, name, - this.client.getSubscriptionId(), resourceGroupName, this.client.getApiVersion(), accept, context)) + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, deviceName, name, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Deletes the specified bandwidth schedule. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. * @param name The bandwidth schedule name. - * @param resourceGroupName The resource group name. - * @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}. + * @return the response body along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync(String deviceName, String name, - String resourceGroupName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (deviceName == null) { - return Mono.error(new IllegalArgumentException("Parameter deviceName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name 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.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), deviceName, name, this.client.getSubscriptionId(), - resourceGroupName, this.client.getApiVersion(), accept, context); + private Response deleteWithResponse(String resourceGroupName, String deviceName, String name) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, deviceName, name, Context.NONE); } /** * Deletes the specified bandwidth schedule. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. * @param name The bandwidth schedule name. - * @param resourceGroupName The resource group name. + * @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 PollerFlux} for polling of long-running operation. + * @return the response body along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync(String deviceName, String name, - String resourceGroupName) { - Mono>> mono = deleteWithResponseAsync(deviceName, name, resourceGroupName); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - this.client.getContext()); + @ServiceMethod(returns = ReturnType.SINGLE) + private Response deleteWithResponse(String resourceGroupName, String deviceName, String name, + Context context) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, deviceName, name, context); } /** * Deletes the specified bandwidth schedule. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. * @param name The bandwidth schedule name. - * @param resourceGroupName The resource group name. - * @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 PollerFlux} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync(String deviceName, String name, - String resourceGroupName, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = deleteWithResponseAsync(deviceName, name, resourceGroupName, context); + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String deviceName, + String name) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, deviceName, name); return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - context); + this.client.getContext()); } /** * Deletes the specified bandwidth schedule. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. * @param name The bandwidth schedule name. - * @param resourceGroupName The resource group name. * @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 SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete(String deviceName, String name, String resourceGroupName) { - return this.beginDeleteAsync(deviceName, name, resourceGroupName).getSyncPoller(); + public SyncPoller, Void> beginDelete(String resourceGroupName, String deviceName, String name) { + Response response = deleteWithResponse(resourceGroupName, deviceName, name); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); } /** * Deletes the specified bandwidth schedule. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. * @param name The bandwidth schedule name. - * @param resourceGroupName The resource group name. * @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. @@ -794,75 +531,179 @@ public SyncPoller, Void> beginDelete(String deviceName, String * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete(String deviceName, String name, String resourceGroupName, + public SyncPoller, Void> beginDelete(String resourceGroupName, String deviceName, String name, Context context) { - return this.beginDeleteAsync(deviceName, name, resourceGroupName, context).getSyncPoller(); + Response response = deleteWithResponse(resourceGroupName, deviceName, name, context); + return this.client.getLroResult(response, Void.class, Void.class, context); } /** * Deletes the specified bandwidth schedule. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. * @param name The bandwidth schedule name. - * @param resourceGroupName The resource group name. * @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 deleteAsync(String deviceName, String name, String resourceGroupName) { - return beginDeleteAsync(deviceName, name, resourceGroupName).last() + private Mono deleteAsync(String resourceGroupName, String deviceName, String name) { + return beginDeleteAsync(resourceGroupName, deviceName, name).last() .flatMap(this.client::getLroFinalResultOrError); } /** * Deletes the specified bandwidth schedule. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. * @param name The bandwidth schedule name. - * @param resourceGroupName The resource group name. - * @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 A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String deviceName, String name, String resourceGroupName, Context context) { - return beginDeleteAsync(deviceName, name, resourceGroupName, context).last() - .flatMap(this.client::getLroFinalResultOrError); + public void delete(String resourceGroupName, String deviceName, String name) { + beginDelete(resourceGroupName, deviceName, name).getFinalResult(); } /** * Deletes the specified bandwidth schedule. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. * @param name The bandwidth schedule name. - * @param resourceGroupName The resource group name. + * @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. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String deviceName, String name, String resourceGroupName) { - deleteAsync(deviceName, name, resourceGroupName).block(); + public void delete(String resourceGroupName, String deviceName, String name, Context context) { + beginDelete(resourceGroupName, deviceName, name, context).getFinalResult(); } /** - * Deletes the specified bandwidth schedule. + * Gets all the bandwidth schedules for a Data Box Edge/Data Box Gateway device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @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 all the bandwidth schedules for a Data Box Edge/Data Box Gateway device along with {@link PagedResponse} + * on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByDataBoxEdgeDeviceSinglePageAsync(String resourceGroupName, + String deviceName) { + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByDataBoxEdgeDevice(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, deviceName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets all the bandwidth schedules for a Data Box Edge/Data Box Gateway device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @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 all the bandwidth schedules for a Data Box Edge/Data Box Gateway device as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByDataBoxEdgeDeviceAsync(String resourceGroupName, + String deviceName) { + return new PagedFlux<>(() -> listByDataBoxEdgeDeviceSinglePageAsync(resourceGroupName, deviceName), + nextLink -> listByDataBoxEdgeDeviceNextSinglePageAsync(nextLink)); + } + + /** + * Gets all the bandwidth schedules for a Data Box Edge/Data Box Gateway device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @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 all the bandwidth schedules for a Data Box Edge/Data Box Gateway device along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByDataBoxEdgeDeviceSinglePage(String resourceGroupName, + String deviceName) { + final String accept = "application/json"; + Response res + = service.listByDataBoxEdgeDeviceSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, deviceName, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Gets all the bandwidth schedules for a Data Box Edge/Data Box Gateway device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param name The bandwidth schedule name. - * @param resourceGroupName The resource group name. * @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 all the bandwidth schedules for a Data Box Edge/Data Box Gateway device along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String deviceName, String name, String resourceGroupName, Context context) { - deleteAsync(deviceName, name, resourceGroupName, context).block(); + private PagedResponse listByDataBoxEdgeDeviceSinglePage(String resourceGroupName, + String deviceName, Context context) { + final String accept = "application/json"; + Response res + = service.listByDataBoxEdgeDeviceSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, deviceName, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Gets all the bandwidth schedules for a Data Box Edge/Data Box Gateway device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @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 all the bandwidth schedules for a Data Box Edge/Data Box Gateway device as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByDataBoxEdgeDevice(String resourceGroupName, String deviceName) { + return new PagedIterable<>(() -> listByDataBoxEdgeDeviceSinglePage(resourceGroupName, deviceName), + nextLink -> listByDataBoxEdgeDeviceNextSinglePage(nextLink)); + } + + /** + * Gets all the bandwidth schedules for a Data Box Edge/Data Box Gateway device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @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 all the bandwidth schedules for a Data Box Edge/Data Box Gateway device as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByDataBoxEdgeDevice(String resourceGroupName, String deviceName, + Context context) { + return new PagedIterable<>(() -> listByDataBoxEdgeDeviceSinglePage(resourceGroupName, deviceName, context), + nextLink -> listByDataBoxEdgeDeviceNextSinglePage(nextLink, context)); } /** @@ -872,18 +713,11 @@ public void delete(String deviceName, String name, String resourceGroupName, Con * @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 collection of bandwidth schedules along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return all the bandwidth schedules for a Data Box Edge/Data Box Gateway device along with {@link PagedResponse} + * on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByDataBoxEdgeDeviceNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil .withContext( @@ -893,6 +727,24 @@ private Mono> listByDataBoxEdgeDeviceNextS .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @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 all the bandwidth schedules for a Data Box Edge/Data Box Gateway device along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByDataBoxEdgeDeviceNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listByDataBoxEdgeDeviceNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + /** * Get the next page of items. * @@ -901,23 +753,15 @@ private Mono> listByDataBoxEdgeDeviceNextS * @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 collection of bandwidth schedules along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return all the bandwidth schedules for a Data Box Edge/Data Box Gateway device along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByDataBoxEdgeDeviceNextSinglePageAsync(String nextLink, + private PagedResponse listByDataBoxEdgeDeviceNextSinglePage(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listByDataBoxEdgeDeviceNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + Response res + = service.listByDataBoxEdgeDeviceNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } } diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/BandwidthSchedulesImpl.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/BandwidthSchedulesImpl.java index d4197784c017..5fd2391bd8d9 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/BandwidthSchedulesImpl.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/BandwidthSchedulesImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.implementation; @@ -27,23 +27,10 @@ public BandwidthSchedulesImpl(BandwidthSchedulesClient innerClient, this.serviceManager = serviceManager; } - public PagedIterable listByDataBoxEdgeDevice(String deviceName, String resourceGroupName) { - PagedIterable inner - = this.serviceClient().listByDataBoxEdgeDevice(deviceName, resourceGroupName); - return ResourceManagerUtils.mapPage(inner, inner1 -> new BandwidthScheduleImpl(inner1, this.manager())); - } - - public PagedIterable listByDataBoxEdgeDevice(String deviceName, String resourceGroupName, - Context context) { - PagedIterable inner - = this.serviceClient().listByDataBoxEdgeDevice(deviceName, resourceGroupName, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new BandwidthScheduleImpl(inner1, this.manager())); - } - - public Response getWithResponse(String deviceName, String name, String resourceGroupName, + public Response getWithResponse(String resourceGroupName, String deviceName, String name, Context context) { Response inner - = this.serviceClient().getWithResponse(deviceName, name, resourceGroupName, context); + = this.serviceClient().getWithResponse(resourceGroupName, deviceName, name, context); if (inner != null) { return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), new BandwidthScheduleImpl(inner.getValue(), this.manager())); @@ -52,8 +39,8 @@ public Response getWithResponse(String deviceName, String nam } } - public BandwidthSchedule get(String deviceName, String name, String resourceGroupName) { - BandwidthScheduleInner inner = this.serviceClient().get(deviceName, name, resourceGroupName); + public BandwidthSchedule get(String resourceGroupName, String deviceName, String name) { + BandwidthScheduleInner inner = this.serviceClient().get(resourceGroupName, deviceName, name); if (inner != null) { return new BandwidthScheduleImpl(inner, this.manager()); } else { @@ -61,15 +48,33 @@ public BandwidthSchedule get(String deviceName, String name, String resourceGrou } } - public void delete(String deviceName, String name, String resourceGroupName) { - this.serviceClient().delete(deviceName, name, resourceGroupName); + public void delete(String resourceGroupName, String deviceName, String name) { + this.serviceClient().delete(resourceGroupName, deviceName, name); } - public void delete(String deviceName, String name, String resourceGroupName, Context context) { - this.serviceClient().delete(deviceName, name, resourceGroupName, context); + public void delete(String resourceGroupName, String deviceName, String name, Context context) { + this.serviceClient().delete(resourceGroupName, deviceName, name, context); + } + + public PagedIterable listByDataBoxEdgeDevice(String resourceGroupName, String deviceName) { + PagedIterable inner + = this.serviceClient().listByDataBoxEdgeDevice(resourceGroupName, deviceName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new BandwidthScheduleImpl(inner1, this.manager())); + } + + public PagedIterable listByDataBoxEdgeDevice(String resourceGroupName, String deviceName, + Context context) { + PagedIterable inner + = this.serviceClient().listByDataBoxEdgeDevice(resourceGroupName, deviceName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new BandwidthScheduleImpl(inner1, this.manager())); } public BandwidthSchedule getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } String deviceName = ResourceManagerUtils.getValueFromIdByName(id, "dataBoxEdgeDevices"); if (deviceName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( @@ -80,15 +85,15 @@ public BandwidthSchedule getById(String id) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'bandwidthSchedules'.", id))); } + return this.getWithResponse(resourceGroupName, deviceName, name, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - return this.getWithResponse(deviceName, name, resourceGroupName, Context.NONE).getValue(); - } - - public Response getByIdWithResponse(String id, Context context) { String deviceName = ResourceManagerUtils.getValueFromIdByName(id, "dataBoxEdgeDevices"); if (deviceName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( @@ -99,15 +104,15 @@ public Response getByIdWithResponse(String id, Context contex throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'bandwidthSchedules'.", id))); } + return this.getWithResponse(resourceGroupName, deviceName, name, context); + } + + public void deleteById(String id) { String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - return this.getWithResponse(deviceName, name, resourceGroupName, context); - } - - public void deleteById(String id) { String deviceName = ResourceManagerUtils.getValueFromIdByName(id, "dataBoxEdgeDevices"); if (deviceName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( @@ -118,15 +123,15 @@ public void deleteById(String id) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'bandwidthSchedules'.", id))); } + this.delete(resourceGroupName, deviceName, name, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - this.delete(deviceName, name, resourceGroupName, Context.NONE); - } - - public void deleteByIdWithResponse(String id, Context context) { String deviceName = ResourceManagerUtils.getValueFromIdByName(id, "dataBoxEdgeDevices"); if (deviceName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( @@ -137,12 +142,7 @@ public void deleteByIdWithResponse(String id, Context context) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'bandwidthSchedules'.", id))); } - String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - this.delete(deviceName, name, resourceGroupName, context); + this.delete(resourceGroupName, deviceName, name, context); } private BandwidthSchedulesClient serviceClient() { diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/ContainerImpl.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/ContainerImpl.java index b8db3909abfa..8ba069ca5ef1 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/ContainerImpl.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/ContainerImpl.java @@ -1,9 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.implementation; +import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.databoxedge.fluent.models.ContainerInner; import com.azure.resourcemanager.databoxedge.models.AzureContainerDataFormat; @@ -29,6 +30,10 @@ public String type() { return this.innerModel().type(); } + public SystemData systemData() { + return this.innerModel().systemData(); + } + public ContainerStatus containerStatus() { return this.innerModel().containerStatus(); } @@ -57,26 +62,26 @@ private com.azure.resourcemanager.databoxedge.DataBoxEdgeManager manager() { return this.serviceManager; } + private String resourceGroupName; + private String deviceName; private String storageAccountName; private String containerName; - private String resourceGroupName; - - public ContainerImpl withExistingStorageAccount(String deviceName, String storageAccountName, - String resourceGroupName) { + public ContainerImpl withExistingStorageAccount(String resourceGroupName, String deviceName, + String storageAccountName) { + this.resourceGroupName = resourceGroupName; this.deviceName = deviceName; this.storageAccountName = storageAccountName; - this.resourceGroupName = resourceGroupName; return this; } public Container create() { this.innerObject = serviceManager.serviceClient() .getContainers() - .createOrUpdate(deviceName, storageAccountName, containerName, resourceGroupName, this.innerModel(), + .createOrUpdate(resourceGroupName, deviceName, storageAccountName, containerName, this.innerModel(), Context.NONE); return this; } @@ -84,7 +89,7 @@ public Container create() { public Container create(Context context) { this.innerObject = serviceManager.serviceClient() .getContainers() - .createOrUpdate(deviceName, storageAccountName, containerName, resourceGroupName, this.innerModel(), + .createOrUpdate(resourceGroupName, deviceName, storageAccountName, containerName, this.innerModel(), context); return this; } @@ -102,7 +107,7 @@ public ContainerImpl update() { public Container apply() { this.innerObject = serviceManager.serviceClient() .getContainers() - .createOrUpdate(deviceName, storageAccountName, containerName, resourceGroupName, this.innerModel(), + .createOrUpdate(resourceGroupName, deviceName, storageAccountName, containerName, this.innerModel(), Context.NONE); return this; } @@ -110,7 +115,7 @@ public Container apply() { public Container apply(Context context) { this.innerObject = serviceManager.serviceClient() .getContainers() - .createOrUpdate(deviceName, storageAccountName, containerName, resourceGroupName, this.innerModel(), + .createOrUpdate(resourceGroupName, deviceName, storageAccountName, containerName, this.innerModel(), context); return this; } @@ -118,16 +123,16 @@ public Container apply(Context context) { ContainerImpl(ContainerInner innerObject, com.azure.resourcemanager.databoxedge.DataBoxEdgeManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); this.deviceName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "dataBoxEdgeDevices"); this.storageAccountName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "storageAccounts"); this.containerName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "containers"); - this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); } public Container refresh() { this.innerObject = serviceManager.serviceClient() .getContainers() - .getWithResponse(deviceName, storageAccountName, containerName, resourceGroupName, Context.NONE) + .getWithResponse(resourceGroupName, deviceName, storageAccountName, containerName, Context.NONE) .getValue(); return this; } @@ -135,7 +140,7 @@ public Container refresh() { public Container refresh(Context context) { this.innerObject = serviceManager.serviceClient() .getContainers() - .getWithResponse(deviceName, storageAccountName, containerName, resourceGroupName, context) + .getWithResponse(resourceGroupName, deviceName, storageAccountName, containerName, context) .getValue(); return this; } diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/ContainersClientImpl.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/ContainersClientImpl.java index ba3e4b9d74ab..88c71882d440 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/ContainersClientImpl.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/ContainersClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.implementation; @@ -28,13 +28,14 @@ import com.azure.core.http.rest.RestProxy; import com.azure.core.management.exception.ManagementException; import com.azure.core.management.polling.PollResult; +import com.azure.core.util.BinaryData; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; import com.azure.core.util.polling.PollerFlux; import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.databoxedge.fluent.ContainersClient; import com.azure.resourcemanager.databoxedge.fluent.models.ContainerInner; -import com.azure.resourcemanager.databoxedge.models.ContainerList; +import com.azure.resourcemanager.databoxedge.implementation.models.ContainerList; import java.nio.ByteBuffer; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; @@ -68,351 +69,177 @@ public final class ContainersClientImpl implements ContainersClient { * The interface defining all the services for DataBoxEdgeManagementClientContainers to be used by the proxy service * to perform REST calls. */ - @Host("{$host}") - @ServiceInterface(name = "DataBoxEdgeManagemen") + @Host("{endpoint}") + @ServiceInterface(name = "DataBoxEdgeManagementClientContainers") public interface ContainersService { @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccounts/{storageAccountName}/containers") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccounts/{storageAccountName}/containers/{containerName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByStorageAccount(@HostParam("$host") String endpoint, - @PathParam("deviceName") String deviceName, @PathParam("storageAccountName") String storageAccountName, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("deviceName") String deviceName, + @PathParam("storageAccountName") String storageAccountName, + @PathParam("containerName") String containerName, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccounts/{storageAccountName}/containers/{containerName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("$host") String endpoint, - @PathParam("deviceName") String deviceName, @PathParam("storageAccountName") String storageAccountName, - @PathParam("containerName") String containerName, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); + Response getSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("deviceName") String deviceName, + @PathParam("storageAccountName") String storageAccountName, + @PathParam("containerName") String containerName, @HeaderParam("Accept") String accept, Context context); - @Headers({ "Content-Type: application/json" }) @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccounts/{storageAccountName}/containers/{containerName}") @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdate(@HostParam("$host") String endpoint, - @PathParam("deviceName") String deviceName, @PathParam("storageAccountName") String storageAccountName, - @PathParam("containerName") String containerName, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") ContainerInner container, @HeaderParam("Accept") String accept, + Mono>> createOrUpdate(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("deviceName") String deviceName, + @PathParam("storageAccountName") String storageAccountName, + @PathParam("containerName") String containerName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") ContainerInner container, Context context); - @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccounts/{storageAccountName}/containers/{containerName}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response createOrUpdateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("deviceName") String deviceName, + @PathParam("storageAccountName") String storageAccountName, + @PathParam("containerName") String containerName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") ContainerInner container, + Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccounts/{storageAccountName}/containers/{containerName}") @ExpectedResponses({ 202, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete(@HostParam("$host") String endpoint, - @PathParam("deviceName") String deviceName, @PathParam("storageAccountName") String storageAccountName, - @PathParam("containerName") String containerName, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); + Mono>> delete(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("deviceName") String deviceName, + @PathParam("storageAccountName") String storageAccountName, + @PathParam("containerName") String containerName, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccounts/{storageAccountName}/containers/{containerName}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response deleteSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("deviceName") String deviceName, + @PathParam("storageAccountName") String storageAccountName, + @PathParam("containerName") String containerName, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccounts/{storageAccountName}/containers") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByStorageAccount(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("deviceName") String deviceName, + @PathParam("storageAccountName") String storageAccountName, @HeaderParam("Accept") String accept, + Context context); @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccounts/{storageAccountName}/containers") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listByStorageAccountSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("deviceName") String deviceName, + @PathParam("storageAccountName") String storageAccountName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccounts/{storageAccountName}/containers/{containerName}/refresh") @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> refresh(@HostParam("$host") String endpoint, - @PathParam("deviceName") String deviceName, @PathParam("storageAccountName") String storageAccountName, - @PathParam("containerName") String containerName, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); + Mono>> refresh(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("deviceName") String deviceName, + @PathParam("storageAccountName") String storageAccountName, + @PathParam("containerName") String containerName, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccounts/{storageAccountName}/containers/{containerName}/refresh") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response refreshSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("deviceName") String deviceName, + @PathParam("storageAccountName") String storageAccountName, + @PathParam("containerName") String containerName, Context context); @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByStorageAccountNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); - } - /** - * Lists all the containers of a storage Account in a Data Box Edge/Data Box Gateway device. - * - * @param deviceName The device name. - * @param storageAccountName The storage Account name. - * @param resourceGroupName The resource group name. - * @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 collection of all the containers on the Data Box Edge/Gateway device along with {@link PagedResponse} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByStorageAccountSinglePageAsync(String deviceName, - String storageAccountName, String resourceGroupName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (deviceName == null) { - return Mono.error(new IllegalArgumentException("Parameter deviceName is required and cannot be null.")); - } - if (storageAccountName == null) { - return Mono - .error(new IllegalArgumentException("Parameter storageAccountName 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.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listByStorageAccount(this.client.getEndpoint(), deviceName, storageAccountName, - this.client.getSubscriptionId(), resourceGroupName, this.client.getApiVersion(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), - res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Lists all the containers of a storage Account in a Data Box Edge/Data Box Gateway device. - * - * @param deviceName The device name. - * @param storageAccountName The storage Account name. - * @param resourceGroupName The resource group name. - * @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 collection of all the containers on the Data Box Edge/Gateway device along with {@link PagedResponse} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByStorageAccountSinglePageAsync(String deviceName, - String storageAccountName, String resourceGroupName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (deviceName == null) { - return Mono.error(new IllegalArgumentException("Parameter deviceName is required and cannot be null.")); - } - if (storageAccountName == null) { - return Mono - .error(new IllegalArgumentException("Parameter storageAccountName 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.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByStorageAccount(this.client.getEndpoint(), deviceName, storageAccountName, - this.client.getSubscriptionId(), resourceGroupName, this.client.getApiVersion(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * Lists all the containers of a storage Account in a Data Box Edge/Data Box Gateway device. - * - * @param deviceName The device name. - * @param storageAccountName The storage Account name. - * @param resourceGroupName The resource group name. - * @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 collection of all the containers on the Data Box Edge/Gateway device as paginated response with - * {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByStorageAccountAsync(String deviceName, String storageAccountName, - String resourceGroupName) { - return new PagedFlux<>( - () -> listByStorageAccountSinglePageAsync(deviceName, storageAccountName, resourceGroupName), - nextLink -> listByStorageAccountNextSinglePageAsync(nextLink)); - } - - /** - * Lists all the containers of a storage Account in a Data Box Edge/Data Box Gateway device. - * - * @param deviceName The device name. - * @param storageAccountName The storage Account name. - * @param resourceGroupName The resource group name. - * @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 collection of all the containers on the Data Box Edge/Gateway device as paginated response with - * {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByStorageAccountAsync(String deviceName, String storageAccountName, - String resourceGroupName, Context context) { - return new PagedFlux<>( - () -> listByStorageAccountSinglePageAsync(deviceName, storageAccountName, resourceGroupName, context), - nextLink -> listByStorageAccountNextSinglePageAsync(nextLink, context)); - } - - /** - * Lists all the containers of a storage Account in a Data Box Edge/Data Box Gateway device. - * - * @param deviceName The device name. - * @param storageAccountName The storage Account name. - * @param resourceGroupName The resource group name. - * @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 collection of all the containers on the Data Box Edge/Gateway device as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByStorageAccount(String deviceName, String storageAccountName, - String resourceGroupName) { - return new PagedIterable<>(listByStorageAccountAsync(deviceName, storageAccountName, resourceGroupName)); - } - - /** - * Lists all the containers of a storage Account in a Data Box Edge/Data Box Gateway device. - * - * @param deviceName The device name. - * @param storageAccountName The storage Account name. - * @param resourceGroupName The resource group name. - * @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 collection of all the containers on the Data Box Edge/Gateway device as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByStorageAccount(String deviceName, String storageAccountName, - String resourceGroupName, Context context) { - return new PagedIterable<>( - listByStorageAccountAsync(deviceName, storageAccountName, resourceGroupName, context)); + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listByStorageAccountNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); } /** * Gets a container by name. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param storageAccountName The Storage Account Name. + * @param storageAccountName The storage account name. * @param containerName The container Name. - * @param resourceGroupName The resource group name. * @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 container by name along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String deviceName, String storageAccountName, - String containerName, String resourceGroupName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (deviceName == null) { - return Mono.error(new IllegalArgumentException("Parameter deviceName is required and cannot be null.")); - } - if (storageAccountName == null) { - return Mono - .error(new IllegalArgumentException("Parameter storageAccountName is required and cannot be null.")); - } - if (containerName == null) { - return Mono.error(new IllegalArgumentException("Parameter containerName 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.")); - } + private Mono> getWithResponseAsync(String resourceGroupName, String deviceName, + String storageAccountName, String containerName) { final String accept = "application/json"; return FluxUtil - .withContext( - context -> service.get(this.client.getEndpoint(), deviceName, storageAccountName, containerName, - this.client.getSubscriptionId(), resourceGroupName, this.client.getApiVersion(), accept, context)) + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, deviceName, storageAccountName, containerName, + accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Gets a container by name. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param storageAccountName The Storage Account Name. + * @param storageAccountName The storage account name. * @param containerName The container Name. - * @param resourceGroupName The resource group name. - * @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 a container by name along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String deviceName, String storageAccountName, - String containerName, String resourceGroupName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (deviceName == null) { - return Mono.error(new IllegalArgumentException("Parameter deviceName is required and cannot be null.")); - } - if (storageAccountName == null) { - return Mono - .error(new IllegalArgumentException("Parameter storageAccountName is required and cannot be null.")); - } - if (containerName == null) { - return Mono.error(new IllegalArgumentException("Parameter containerName 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.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), deviceName, storageAccountName, containerName, - this.client.getSubscriptionId(), resourceGroupName, this.client.getApiVersion(), accept, context); - } - - /** - * Gets a container by name. - * - * @param deviceName The device name. - * @param storageAccountName The Storage Account Name. - * @param containerName The container Name. - * @param resourceGroupName The resource group name. * @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 container by name on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String deviceName, String storageAccountName, String containerName, - String resourceGroupName) { - return getWithResponseAsync(deviceName, storageAccountName, containerName, resourceGroupName) + private Mono getAsync(String resourceGroupName, String deviceName, String storageAccountName, + String containerName) { + return getWithResponseAsync(resourceGroupName, deviceName, storageAccountName, containerName) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * Gets a container by name. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param storageAccountName The Storage Account Name. + * @param storageAccountName The storage account name. * @param containerName The container Name. - * @param resourceGroupName The resource group name. * @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. @@ -420,37 +247,39 @@ private Mono getAsync(String deviceName, String storageAccountNa * @return a container by name along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String deviceName, String storageAccountName, String containerName, - String resourceGroupName, Context context) { - return getWithResponseAsync(deviceName, storageAccountName, containerName, resourceGroupName, context).block(); + public Response getWithResponse(String resourceGroupName, String deviceName, + String storageAccountName, String containerName, Context context) { + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, deviceName, storageAccountName, containerName, accept, context); } /** * Gets a container by name. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param storageAccountName The Storage Account Name. + * @param storageAccountName The storage account name. * @param containerName The container Name. - * @param resourceGroupName The resource group name. * @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 container by name. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ContainerInner get(String deviceName, String storageAccountName, String containerName, - String resourceGroupName) { - return getWithResponse(deviceName, storageAccountName, containerName, resourceGroupName, Context.NONE) + public ContainerInner get(String resourceGroupName, String deviceName, String storageAccountName, + String containerName) { + return getWithResponse(resourceGroupName, deviceName, storageAccountName, containerName, Context.NONE) .getValue(); } /** * Creates a new container or updates an existing container on the device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param storageAccountName The Storage Account Name. - * @param containerName The container name. - * @param resourceGroupName The resource group name. + * @param storageAccountName The storage account name. + * @param containerName The container Name. * @param container The container properties. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -459,150 +288,93 @@ public ContainerInner get(String deviceName, String storageAccountName, String c * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync(String deviceName, - String storageAccountName, String containerName, String resourceGroupName, ContainerInner container) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (deviceName == null) { - return Mono.error(new IllegalArgumentException("Parameter deviceName is required and cannot be null.")); - } - if (storageAccountName == null) { - return Mono - .error(new IllegalArgumentException("Parameter storageAccountName is required and cannot be null.")); - } - if (containerName == null) { - return Mono.error(new IllegalArgumentException("Parameter containerName 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 (container == null) { - return Mono.error(new IllegalArgumentException("Parameter container is required and cannot be null.")); - } else { - container.validate(); - } + private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, + String deviceName, String storageAccountName, String containerName, ContainerInner container) { + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), deviceName, storageAccountName, - containerName, this.client.getSubscriptionId(), resourceGroupName, this.client.getApiVersion(), - container, accept, context)) + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, deviceName, storageAccountName, containerName, + contentType, accept, container, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Creates a new container or updates an existing container on the device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param storageAccountName The Storage Account Name. - * @param containerName The container name. - * @param resourceGroupName The resource group name. + * @param storageAccountName The storage account name. + * @param containerName The container Name. * @param container The container properties. - * @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 represents a container on the Data Box Edge/Gateway device along with {@link Response} on successful - * completion of {@link Mono}. + * @return represents a container on the Data Box Edge/Gateway device along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync(String deviceName, - String storageAccountName, String containerName, String resourceGroupName, ContainerInner container, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (deviceName == null) { - return Mono.error(new IllegalArgumentException("Parameter deviceName is required and cannot be null.")); - } - if (storageAccountName == null) { - return Mono - .error(new IllegalArgumentException("Parameter storageAccountName is required and cannot be null.")); - } - if (containerName == null) { - return Mono.error(new IllegalArgumentException("Parameter containerName 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 (container == null) { - return Mono.error(new IllegalArgumentException("Parameter container is required and cannot be null.")); - } else { - container.validate(); - } + private Response createOrUpdateWithResponse(String resourceGroupName, String deviceName, + String storageAccountName, String containerName, ContainerInner container) { + final String contentType = "application/json"; final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.createOrUpdate(this.client.getEndpoint(), deviceName, storageAccountName, containerName, - this.client.getSubscriptionId(), resourceGroupName, this.client.getApiVersion(), container, accept, - context); + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, deviceName, storageAccountName, containerName, + contentType, accept, container, Context.NONE); } /** * Creates a new container or updates an existing container on the device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param storageAccountName The Storage Account Name. - * @param containerName The container name. - * @param resourceGroupName The resource group name. + * @param storageAccountName The storage account name. + * @param containerName The container Name. * @param container The container properties. + * @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 PollerFlux} for polling of represents a container on the Data Box Edge/Gateway device. + * @return represents a container on the Data Box Edge/Gateway device along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, ContainerInner> beginCreateOrUpdateAsync(String deviceName, - String storageAccountName, String containerName, String resourceGroupName, ContainerInner container) { - Mono>> mono = createOrUpdateWithResponseAsync(deviceName, storageAccountName, - containerName, resourceGroupName, container); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), - ContainerInner.class, ContainerInner.class, this.client.getContext()); + @ServiceMethod(returns = ReturnType.SINGLE) + private Response createOrUpdateWithResponse(String resourceGroupName, String deviceName, + String storageAccountName, String containerName, ContainerInner container, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, deviceName, storageAccountName, containerName, + contentType, accept, container, context); } /** * Creates a new container or updates an existing container on the device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param storageAccountName The Storage Account Name. - * @param containerName The container name. - * @param resourceGroupName The resource group name. + * @param storageAccountName The storage account name. + * @param containerName The container Name. * @param container The container properties. - * @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 PollerFlux} for polling of represents a container on the Data Box Edge/Gateway device. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, ContainerInner> beginCreateOrUpdateAsync(String deviceName, - String storageAccountName, String containerName, String resourceGroupName, ContainerInner container, - Context context) { - context = this.client.mergeContext(context); - Mono>> mono = createOrUpdateWithResponseAsync(deviceName, storageAccountName, - containerName, resourceGroupName, container, context); + private PollerFlux, ContainerInner> beginCreateOrUpdateAsync(String resourceGroupName, + String deviceName, String storageAccountName, String containerName, ContainerInner container) { + Mono>> mono = createOrUpdateWithResponseAsync(resourceGroupName, deviceName, + storageAccountName, containerName, container); return this.client.getLroResult(mono, this.client.getHttpPipeline(), - ContainerInner.class, ContainerInner.class, context); + ContainerInner.class, ContainerInner.class, this.client.getContext()); } /** * Creates a new container or updates an existing container on the device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param storageAccountName The Storage Account Name. - * @param containerName The container name. - * @param resourceGroupName The resource group name. + * @param storageAccountName The storage account name. + * @param containerName The container Name. * @param container The container properties. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -610,20 +382,21 @@ private PollerFlux, ContainerInner> beginCreateOrUpda * @return the {@link SyncPoller} for polling of represents a container on the Data Box Edge/Gateway device. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, ContainerInner> beginCreateOrUpdate(String deviceName, - String storageAccountName, String containerName, String resourceGroupName, ContainerInner container) { - return this - .beginCreateOrUpdateAsync(deviceName, storageAccountName, containerName, resourceGroupName, container) - .getSyncPoller(); + public SyncPoller, ContainerInner> beginCreateOrUpdate(String resourceGroupName, + String deviceName, String storageAccountName, String containerName, ContainerInner container) { + Response response + = createOrUpdateWithResponse(resourceGroupName, deviceName, storageAccountName, containerName, container); + return this.client.getLroResult(response, ContainerInner.class, + ContainerInner.class, Context.NONE); } /** * Creates a new container or updates an existing container on the device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param storageAccountName The Storage Account Name. - * @param containerName The container name. - * @param resourceGroupName The resource group name. + * @param storageAccountName The storage account name. + * @param containerName The container Name. * @param container The container properties. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -632,22 +405,21 @@ public SyncPoller, ContainerInner> beginCreateOrUpdat * @return the {@link SyncPoller} for polling of represents a container on the Data Box Edge/Gateway device. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, ContainerInner> beginCreateOrUpdate(String deviceName, - String storageAccountName, String containerName, String resourceGroupName, ContainerInner container, - Context context) { - return this - .beginCreateOrUpdateAsync(deviceName, storageAccountName, containerName, resourceGroupName, container, - context) - .getSyncPoller(); + public SyncPoller, ContainerInner> beginCreateOrUpdate(String resourceGroupName, + String deviceName, String storageAccountName, String containerName, ContainerInner container, Context context) { + Response response = createOrUpdateWithResponse(resourceGroupName, deviceName, storageAccountName, + containerName, container, context); + return this.client.getLroResult(response, ContainerInner.class, + ContainerInner.class, context); } /** * Creates a new container or updates an existing container on the device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param storageAccountName The Storage Account Name. - * @param containerName The container name. - * @param resourceGroupName The resource group name. + * @param storageAccountName The storage account name. + * @param containerName The container Name. * @param container The container properties. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -655,9 +427,9 @@ public SyncPoller, ContainerInner> beginCreateOrUpdat * @return represents a container on the Data Box Edge/Gateway device on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String deviceName, String storageAccountName, String containerName, - String resourceGroupName, ContainerInner container) { - return beginCreateOrUpdateAsync(deviceName, storageAccountName, containerName, resourceGroupName, container) + private Mono createOrUpdateAsync(String resourceGroupName, String deviceName, + String storageAccountName, String containerName, ContainerInner container) { + return beginCreateOrUpdateAsync(resourceGroupName, deviceName, storageAccountName, containerName, container) .last() .flatMap(this.client::getLroFinalResultOrError); } @@ -665,170 +437,121 @@ private Mono createOrUpdateAsync(String deviceName, String stora /** * Creates a new container or updates an existing container on the device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param storageAccountName The Storage Account Name. - * @param containerName The container name. - * @param resourceGroupName The resource group name. + * @param storageAccountName The storage account name. + * @param containerName The container Name. * @param container The container properties. - * @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 represents a container on the Data Box Edge/Gateway device on successful completion of {@link Mono}. + * @return represents a container on the Data Box Edge/Gateway device. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String deviceName, String storageAccountName, String containerName, - String resourceGroupName, ContainerInner container, Context context) { - return beginCreateOrUpdateAsync(deviceName, storageAccountName, containerName, resourceGroupName, container, - context).last().flatMap(this.client::getLroFinalResultOrError); + public ContainerInner createOrUpdate(String resourceGroupName, String deviceName, String storageAccountName, + String containerName, ContainerInner container) { + return beginCreateOrUpdate(resourceGroupName, deviceName, storageAccountName, containerName, container) + .getFinalResult(); } /** * Creates a new container or updates an existing container on the device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param storageAccountName The Storage Account Name. - * @param containerName The container name. - * @param resourceGroupName The resource group name. + * @param storageAccountName The storage account name. + * @param containerName The container Name. * @param container The container properties. + * @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 represents a container on the Data Box Edge/Gateway device. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ContainerInner createOrUpdate(String deviceName, String storageAccountName, String containerName, - String resourceGroupName, ContainerInner container) { - return createOrUpdateAsync(deviceName, storageAccountName, containerName, resourceGroupName, container).block(); + public ContainerInner createOrUpdate(String resourceGroupName, String deviceName, String storageAccountName, + String containerName, ContainerInner container, Context context) { + return beginCreateOrUpdate(resourceGroupName, deviceName, storageAccountName, containerName, container, context) + .getFinalResult(); } /** - * Creates a new container or updates an existing container on the device. + * Deletes the container on the Data Box Edge/Data Box Gateway device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param storageAccountName The Storage Account Name. - * @param containerName The container name. - * @param resourceGroupName The resource group name. - * @param container The container properties. - * @param context The context to associate with this operation. + * @param storageAccountName The storage account name. + * @param containerName The container Name. * @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 represents a container on the Data Box Edge/Gateway device. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ContainerInner createOrUpdate(String deviceName, String storageAccountName, String containerName, - String resourceGroupName, ContainerInner container, Context context) { - return createOrUpdateAsync(deviceName, storageAccountName, containerName, resourceGroupName, container, context) - .block(); + private Mono>> deleteWithResponseAsync(String resourceGroupName, String deviceName, + String storageAccountName, String containerName) { + return FluxUtil.withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, deviceName, storageAccountName, containerName, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Deletes the container on the Data Box Edge/Data Box Gateway device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param storageAccountName The Storage Account Name. - * @param containerName The container name. - * @param resourceGroupName The resource group name. + * @param storageAccountName The storage account name. + * @param containerName The container Name. * @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}. + * @return the response body along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync(String deviceName, String storageAccountName, - String containerName, String resourceGroupName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (deviceName == null) { - return Mono.error(new IllegalArgumentException("Parameter deviceName is required and cannot be null.")); - } - if (storageAccountName == null) { - return Mono - .error(new IllegalArgumentException("Parameter storageAccountName is required and cannot be null.")); - } - if (containerName == null) { - return Mono.error(new IllegalArgumentException("Parameter containerName 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.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.delete(this.client.getEndpoint(), deviceName, storageAccountName, containerName, - this.client.getSubscriptionId(), resourceGroupName, this.client.getApiVersion(), accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + private Response deleteWithResponse(String resourceGroupName, String deviceName, + String storageAccountName, String containerName) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, deviceName, storageAccountName, containerName, + Context.NONE); } /** * Deletes the container on the Data Box Edge/Data Box Gateway device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param storageAccountName The Storage Account Name. - * @param containerName The container name. - * @param resourceGroupName The resource group name. + * @param storageAccountName The storage account name. + * @param containerName The container Name. * @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}. + * @return the response body along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync(String deviceName, String storageAccountName, - String containerName, String resourceGroupName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (deviceName == null) { - return Mono.error(new IllegalArgumentException("Parameter deviceName is required and cannot be null.")); - } - if (storageAccountName == null) { - return Mono - .error(new IllegalArgumentException("Parameter storageAccountName is required and cannot be null.")); - } - if (containerName == null) { - return Mono.error(new IllegalArgumentException("Parameter containerName 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.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), deviceName, storageAccountName, containerName, - this.client.getSubscriptionId(), resourceGroupName, this.client.getApiVersion(), accept, context); + private Response deleteWithResponse(String resourceGroupName, String deviceName, + String storageAccountName, String containerName, Context context) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, deviceName, storageAccountName, containerName, context); } /** * Deletes the container on the Data Box Edge/Data Box Gateway device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param storageAccountName The Storage Account Name. - * @param containerName The container name. - * @param resourceGroupName The resource group name. + * @param storageAccountName The storage account name. + * @param containerName The container Name. * @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 long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync(String deviceName, String storageAccountName, - String containerName, String resourceGroupName) { + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String deviceName, + String storageAccountName, String containerName) { Mono>> mono - = deleteWithResponseAsync(deviceName, storageAccountName, containerName, resourceGroupName); + = deleteWithResponseAsync(resourceGroupName, deviceName, storageAccountName, containerName); return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); } @@ -836,379 +559,400 @@ private PollerFlux, Void> beginDeleteAsync(String deviceName, S /** * Deletes the container on the Data Box Edge/Data Box Gateway device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param storageAccountName The Storage Account Name. - * @param containerName The container name. - * @param resourceGroupName The resource group name. - * @param context The context to associate with this operation. + * @param storageAccountName The storage account name. + * @param containerName The container Name. * @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 long-running operation. + * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync(String deviceName, String storageAccountName, - String containerName, String resourceGroupName, Context context) { - context = this.client.mergeContext(context); - Mono>> mono - = deleteWithResponseAsync(deviceName, storageAccountName, containerName, resourceGroupName, context); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - context); + public SyncPoller, Void> beginDelete(String resourceGroupName, String deviceName, + String storageAccountName, String containerName) { + Response response + = deleteWithResponse(resourceGroupName, deviceName, storageAccountName, containerName); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); } /** * Deletes the container on the Data Box Edge/Data Box Gateway device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param storageAccountName The Storage Account Name. - * @param containerName The container name. - * @param resourceGroupName The resource group name. + * @param storageAccountName The storage account name. + * @param containerName The container Name. + * @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 SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete(String deviceName, String storageAccountName, - String containerName, String resourceGroupName) { - return this.beginDeleteAsync(deviceName, storageAccountName, containerName, resourceGroupName).getSyncPoller(); + public SyncPoller, Void> beginDelete(String resourceGroupName, String deviceName, + String storageAccountName, String containerName, Context context) { + Response response + = deleteWithResponse(resourceGroupName, deviceName, storageAccountName, containerName, context); + return this.client.getLroResult(response, Void.class, Void.class, context); } /** * Deletes the container on the Data Box Edge/Data Box Gateway device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param storageAccountName The Storage Account Name. - * @param containerName The container name. - * @param resourceGroupName The resource group name. - * @param context The context to associate with this operation. + * @param storageAccountName The storage account name. + * @param containerName The container Name. * @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 SyncPoller} for polling of long-running operation. + * @return A {@link Mono} that completes when a successful response is received. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete(String deviceName, String storageAccountName, - String containerName, String resourceGroupName, Context context) { - return this.beginDeleteAsync(deviceName, storageAccountName, containerName, resourceGroupName, context) - .getSyncPoller(); + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String deviceName, String storageAccountName, + String containerName) { + return beginDeleteAsync(resourceGroupName, deviceName, storageAccountName, containerName).last() + .flatMap(this.client::getLroFinalResultOrError); } /** * Deletes the container on the Data Box Edge/Data Box Gateway device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param storageAccountName The Storage Account Name. - * @param containerName The container name. - * @param resourceGroupName The resource group name. + * @param storageAccountName The storage account name. + * @param containerName The container Name. * @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 deleteAsync(String deviceName, String storageAccountName, String containerName, - String resourceGroupName) { - return beginDeleteAsync(deviceName, storageAccountName, containerName, resourceGroupName).last() - .flatMap(this.client::getLroFinalResultOrError); + public void delete(String resourceGroupName, String deviceName, String storageAccountName, String containerName) { + beginDelete(resourceGroupName, deviceName, storageAccountName, containerName).getFinalResult(); } /** * Deletes the container on the Data Box Edge/Data Box Gateway device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param storageAccountName The Storage Account Name. - * @param containerName The container name. - * @param resourceGroupName The resource group name. + * @param storageAccountName The storage account name. + * @param containerName The container Name. * @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 A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String deviceName, String storageAccountName, String containerName, - String resourceGroupName, Context context) { - return beginDeleteAsync(deviceName, storageAccountName, containerName, resourceGroupName, context).last() - .flatMap(this.client::getLroFinalResultOrError); + public void delete(String resourceGroupName, String deviceName, String storageAccountName, String containerName, + Context context) { + beginDelete(resourceGroupName, deviceName, storageAccountName, containerName, context).getFinalResult(); } /** - * Deletes the container on the Data Box Edge/Data Box Gateway device. + * Lists all the containers of a storage Account in a Data Box Edge/Data Box Gateway device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param storageAccountName The Storage Account Name. - * @param containerName The container name. - * @param resourceGroupName The resource group name. + * @param storageAccountName The storage account name. * @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 collection of all the containers on the Data Box Edge/Gateway device along with {@link PagedResponse} on + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String deviceName, String storageAccountName, String containerName, String resourceGroupName) { - deleteAsync(deviceName, storageAccountName, containerName, resourceGroupName).block(); + private Mono> listByStorageAccountSinglePageAsync(String resourceGroupName, + String deviceName, String storageAccountName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByStorageAccount(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, deviceName, storageAccountName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Deletes the container on the Data Box Edge/Data Box Gateway device. + * Lists all the containers of a storage Account in a Data Box Edge/Data Box Gateway device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param storageAccountName The Storage Account Name. - * @param containerName The container name. - * @param resourceGroupName The resource group name. - * @param context The context to associate with this operation. + * @param storageAccountName The storage account name. * @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 collection of all the containers on the Data Box Edge/Gateway device as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByStorageAccountAsync(String resourceGroupName, String deviceName, + String storageAccountName) { + return new PagedFlux<>( + () -> listByStorageAccountSinglePageAsync(resourceGroupName, deviceName, storageAccountName), + nextLink -> listByStorageAccountNextSinglePageAsync(nextLink)); + } + + /** + * Lists all the containers of a storage Account in a Data Box Edge/Data Box Gateway device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @param storageAccountName The storage account name. + * @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 collection of all the containers on the Data Box Edge/Gateway device along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String deviceName, String storageAccountName, String containerName, String resourceGroupName, - Context context) { - deleteAsync(deviceName, storageAccountName, containerName, resourceGroupName, context).block(); + private PagedResponse listByStorageAccountSinglePage(String resourceGroupName, String deviceName, + String storageAccountName) { + final String accept = "application/json"; + Response res = service.listByStorageAccountSync(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, deviceName, + storageAccountName, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** - * Refreshes the container metadata with the data from the cloud. + * Lists all the containers of a storage Account in a Data Box Edge/Data Box Gateway device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param storageAccountName The Storage Account Name. - * @param containerName The container name. - * @param resourceGroupName The resource group name. + * @param storageAccountName The storage account name. + * @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}. + * @return collection of all the containers on the Data Box Edge/Gateway device along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> refreshWithResponseAsync(String deviceName, String storageAccountName, - String containerName, String resourceGroupName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (deviceName == null) { - return Mono.error(new IllegalArgumentException("Parameter deviceName is required and cannot be null.")); - } - if (storageAccountName == null) { - return Mono - .error(new IllegalArgumentException("Parameter storageAccountName is required and cannot be null.")); - } - if (containerName == null) { - return Mono.error(new IllegalArgumentException("Parameter containerName 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.")); - } + private PagedResponse listByStorageAccountSinglePage(String resourceGroupName, String deviceName, + String storageAccountName, Context context) { final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.refresh(this.client.getEndpoint(), deviceName, storageAccountName, containerName, - this.client.getSubscriptionId(), resourceGroupName, this.client.getApiVersion(), accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + Response res + = service.listByStorageAccountSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, deviceName, storageAccountName, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** - * Refreshes the container metadata with the data from the cloud. + * Lists all the containers of a storage Account in a Data Box Edge/Data Box Gateway device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param storageAccountName The Storage Account Name. - * @param containerName The container name. - * @param resourceGroupName The resource group name. + * @param storageAccountName The storage account name. + * @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 collection of all the containers on the Data Box Edge/Gateway device as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByStorageAccount(String resourceGroupName, String deviceName, + String storageAccountName) { + return new PagedIterable<>( + () -> listByStorageAccountSinglePage(resourceGroupName, deviceName, storageAccountName), + nextLink -> listByStorageAccountNextSinglePage(nextLink)); + } + + /** + * Lists all the containers of a storage Account in a Data Box Edge/Data Box Gateway device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @param storageAccountName The storage account name. * @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 collection of all the containers on the Data Box Edge/Gateway device as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByStorageAccount(String resourceGroupName, String deviceName, + String storageAccountName, Context context) { + return new PagedIterable<>( + () -> listByStorageAccountSinglePage(resourceGroupName, deviceName, storageAccountName, context), + nextLink -> listByStorageAccountNextSinglePage(nextLink, context)); + } + + /** + * Refreshes the container metadata with the data from the cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @param storageAccountName The storage account name. + * @param containerName The container Name. + * @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>> refreshWithResponseAsync(String deviceName, String storageAccountName, - String containerName, String resourceGroupName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (deviceName == null) { - return Mono.error(new IllegalArgumentException("Parameter deviceName is required and cannot be null.")); - } - if (storageAccountName == null) { - return Mono - .error(new IllegalArgumentException("Parameter storageAccountName is required and cannot be null.")); - } - if (containerName == null) { - return Mono.error(new IllegalArgumentException("Parameter containerName 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.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.refresh(this.client.getEndpoint(), deviceName, storageAccountName, containerName, - this.client.getSubscriptionId(), resourceGroupName, this.client.getApiVersion(), accept, context); + private Mono>> refreshWithResponseAsync(String resourceGroupName, String deviceName, + String storageAccountName, String containerName) { + return FluxUtil.withContext(context -> service.refresh(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, deviceName, storageAccountName, containerName, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Refreshes the container metadata with the data from the cloud. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param storageAccountName The Storage Account Name. - * @param containerName The container name. - * @param resourceGroupName The resource group name. + * @param storageAccountName The storage account name. + * @param containerName The container Name. * @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 long-running operation. + * @return the response body along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginRefreshAsync(String deviceName, String storageAccountName, - String containerName, String resourceGroupName) { - Mono>> mono - = refreshWithResponseAsync(deviceName, storageAccountName, containerName, resourceGroupName); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - this.client.getContext()); + @ServiceMethod(returns = ReturnType.SINGLE) + private Response refreshWithResponse(String resourceGroupName, String deviceName, + String storageAccountName, String containerName) { + return service.refreshSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, deviceName, storageAccountName, containerName, + Context.NONE); } /** * Refreshes the container metadata with the data from the cloud. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param storageAccountName The Storage Account Name. - * @param containerName The container name. - * @param resourceGroupName The resource group name. + * @param storageAccountName The storage account name. + * @param containerName The container Name. * @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 PollerFlux} for polling of long-running operation. + * @return the response body along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginRefreshAsync(String deviceName, String storageAccountName, - String containerName, String resourceGroupName, Context context) { - context = this.client.mergeContext(context); - Mono>> mono - = refreshWithResponseAsync(deviceName, storageAccountName, containerName, resourceGroupName, context); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - context); + @ServiceMethod(returns = ReturnType.SINGLE) + private Response refreshWithResponse(String resourceGroupName, String deviceName, + String storageAccountName, String containerName, Context context) { + return service.refreshSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, deviceName, storageAccountName, containerName, context); } /** * Refreshes the container metadata with the data from the cloud. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param storageAccountName The Storage Account Name. - * @param containerName The container name. - * @param resourceGroupName The resource group name. + * @param storageAccountName The storage account name. + * @param containerName The container Name. * @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 SyncPoller} for polling of long-running operation. + * @return the {@link PollerFlux} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginRefresh(String deviceName, String storageAccountName, - String containerName, String resourceGroupName) { - return this.beginRefreshAsync(deviceName, storageAccountName, containerName, resourceGroupName).getSyncPoller(); + private PollerFlux, Void> beginRefreshAsync(String resourceGroupName, String deviceName, + String storageAccountName, String containerName) { + Mono>> mono + = refreshWithResponseAsync(resourceGroupName, deviceName, storageAccountName, containerName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); } /** * Refreshes the container metadata with the data from the cloud. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param storageAccountName The Storage Account Name. - * @param containerName The container name. - * @param resourceGroupName The resource group name. - * @param context The context to associate with this operation. + * @param storageAccountName The storage account name. + * @param containerName The container Name. * @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 SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginRefresh(String deviceName, String storageAccountName, - String containerName, String resourceGroupName, Context context) { - return this.beginRefreshAsync(deviceName, storageAccountName, containerName, resourceGroupName, context) - .getSyncPoller(); + public SyncPoller, Void> beginRefresh(String resourceGroupName, String deviceName, + String storageAccountName, String containerName) { + Response response + = refreshWithResponse(resourceGroupName, deviceName, storageAccountName, containerName); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); } /** * Refreshes the container metadata with the data from the cloud. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param storageAccountName The Storage Account Name. - * @param containerName The container name. - * @param resourceGroupName The resource group name. + * @param storageAccountName The storage account name. + * @param containerName The container Name. + * @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 A {@link Mono} that completes when a successful response is received. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono refreshAsync(String deviceName, String storageAccountName, String containerName, - String resourceGroupName) { - return beginRefreshAsync(deviceName, storageAccountName, containerName, resourceGroupName).last() - .flatMap(this.client::getLroFinalResultOrError); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginRefresh(String resourceGroupName, String deviceName, + String storageAccountName, String containerName, Context context) { + Response response + = refreshWithResponse(resourceGroupName, deviceName, storageAccountName, containerName, context); + return this.client.getLroResult(response, Void.class, Void.class, context); } /** * Refreshes the container metadata with the data from the cloud. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param storageAccountName The Storage Account Name. - * @param containerName The container name. - * @param resourceGroupName The resource group name. - * @param context The context to associate with this operation. + * @param storageAccountName The storage account name. + * @param containerName The container Name. * @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 refreshAsync(String deviceName, String storageAccountName, String containerName, - String resourceGroupName, Context context) { - return beginRefreshAsync(deviceName, storageAccountName, containerName, resourceGroupName, context).last() + private Mono refreshAsync(String resourceGroupName, String deviceName, String storageAccountName, + String containerName) { + return beginRefreshAsync(resourceGroupName, deviceName, storageAccountName, containerName).last() .flatMap(this.client::getLroFinalResultOrError); } /** * Refreshes the container metadata with the data from the cloud. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param storageAccountName The Storage Account Name. - * @param containerName The container name. - * @param resourceGroupName The resource group name. + * @param storageAccountName The storage account name. + * @param containerName The container Name. * @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 refresh(String deviceName, String storageAccountName, String containerName, String resourceGroupName) { - refreshAsync(deviceName, storageAccountName, containerName, resourceGroupName).block(); + public void refresh(String resourceGroupName, String deviceName, String storageAccountName, String containerName) { + beginRefresh(resourceGroupName, deviceName, storageAccountName, containerName).getFinalResult(); } /** * Refreshes the container metadata with the data from the cloud. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param storageAccountName The Storage Account Name. - * @param containerName The container name. - * @param resourceGroupName The resource group name. + * @param storageAccountName The storage account name. + * @param containerName The container Name. * @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. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void refresh(String deviceName, String storageAccountName, String containerName, String resourceGroupName, + public void refresh(String resourceGroupName, String deviceName, String storageAccountName, String containerName, Context context) { - refreshAsync(deviceName, storageAccountName, containerName, resourceGroupName, context).block(); + beginRefresh(resourceGroupName, deviceName, storageAccountName, containerName, context).getFinalResult(); } /** @@ -1223,13 +967,6 @@ public void refresh(String deviceName, String storageAccountName, String contain */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByStorageAccountNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil .withContext( @@ -1239,6 +976,24 @@ private Mono> listByStorageAccountNextSinglePageAs .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @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 collection of all the containers on the Data Box Edge/Gateway device along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByStorageAccountNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listByStorageAccountNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + /** * Get the next page of items. * @@ -1247,23 +1002,14 @@ private Mono> listByStorageAccountNextSinglePageAs * @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 collection of all the containers on the Data Box Edge/Gateway device along with {@link PagedResponse} on - * successful completion of {@link Mono}. + * @return collection of all the containers on the Data Box Edge/Gateway device along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByStorageAccountNextSinglePageAsync(String nextLink, - Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } + private PagedResponse listByStorageAccountNextSinglePage(String nextLink, Context context) { final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listByStorageAccountNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + Response res + = service.listByStorageAccountNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } } diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/ContainersImpl.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/ContainersImpl.java index 62912801e0b6..20fb375cd8d0 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/ContainersImpl.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/ContainersImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.implementation; @@ -27,24 +27,10 @@ public ContainersImpl(ContainersClient innerClient, this.serviceManager = serviceManager; } - public PagedIterable listByStorageAccount(String deviceName, String storageAccountName, - String resourceGroupName) { - PagedIterable inner - = this.serviceClient().listByStorageAccount(deviceName, storageAccountName, resourceGroupName); - return ResourceManagerUtils.mapPage(inner, inner1 -> new ContainerImpl(inner1, this.manager())); - } - - public PagedIterable listByStorageAccount(String deviceName, String storageAccountName, - String resourceGroupName, Context context) { - PagedIterable inner - = this.serviceClient().listByStorageAccount(deviceName, storageAccountName, resourceGroupName, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new ContainerImpl(inner1, this.manager())); - } - - public Response getWithResponse(String deviceName, String storageAccountName, String containerName, - String resourceGroupName, Context context) { + public Response getWithResponse(String resourceGroupName, String deviceName, String storageAccountName, + String containerName, Context context) { Response inner = this.serviceClient() - .getWithResponse(deviceName, storageAccountName, containerName, resourceGroupName, context); + .getWithResponse(resourceGroupName, deviceName, storageAccountName, containerName, context); if (inner != null) { return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), new ContainerImpl(inner.getValue(), this.manager())); @@ -53,9 +39,9 @@ public Response getWithResponse(String deviceName, String storageAcco } } - public Container get(String deviceName, String storageAccountName, String containerName, String resourceGroupName) { + public Container get(String resourceGroupName, String deviceName, String storageAccountName, String containerName) { ContainerInner inner - = this.serviceClient().get(deviceName, storageAccountName, containerName, resourceGroupName); + = this.serviceClient().get(resourceGroupName, deviceName, storageAccountName, containerName); if (inner != null) { return new ContainerImpl(inner, this.manager()); } else { @@ -63,25 +49,44 @@ public Container get(String deviceName, String storageAccountName, String contai } } - public void delete(String deviceName, String storageAccountName, String containerName, String resourceGroupName) { - this.serviceClient().delete(deviceName, storageAccountName, containerName, resourceGroupName); + public void delete(String resourceGroupName, String deviceName, String storageAccountName, String containerName) { + this.serviceClient().delete(resourceGroupName, deviceName, storageAccountName, containerName); } - public void delete(String deviceName, String storageAccountName, String containerName, String resourceGroupName, + public void delete(String resourceGroupName, String deviceName, String storageAccountName, String containerName, Context context) { - this.serviceClient().delete(deviceName, storageAccountName, containerName, resourceGroupName, context); + this.serviceClient().delete(resourceGroupName, deviceName, storageAccountName, containerName, context); } - public void refresh(String deviceName, String storageAccountName, String containerName, String resourceGroupName) { - this.serviceClient().refresh(deviceName, storageAccountName, containerName, resourceGroupName); + public PagedIterable listByStorageAccount(String resourceGroupName, String deviceName, + String storageAccountName) { + PagedIterable inner + = this.serviceClient().listByStorageAccount(resourceGroupName, deviceName, storageAccountName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ContainerImpl(inner1, this.manager())); } - public void refresh(String deviceName, String storageAccountName, String containerName, String resourceGroupName, + public PagedIterable listByStorageAccount(String resourceGroupName, String deviceName, + String storageAccountName, Context context) { + PagedIterable inner + = this.serviceClient().listByStorageAccount(resourceGroupName, deviceName, storageAccountName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ContainerImpl(inner1, this.manager())); + } + + public void refresh(String resourceGroupName, String deviceName, String storageAccountName, String containerName) { + this.serviceClient().refresh(resourceGroupName, deviceName, storageAccountName, containerName); + } + + public void refresh(String resourceGroupName, String deviceName, String storageAccountName, String containerName, Context context) { - this.serviceClient().refresh(deviceName, storageAccountName, containerName, resourceGroupName, context); + this.serviceClient().refresh(resourceGroupName, deviceName, storageAccountName, containerName, context); } public Container getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } String deviceName = ResourceManagerUtils.getValueFromIdByName(id, "dataBoxEdgeDevices"); if (deviceName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( @@ -97,16 +102,16 @@ public Container getById(String id) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'containers'.", id))); } + return this.getWithResponse(resourceGroupName, deviceName, storageAccountName, containerName, Context.NONE) + .getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - return this.getWithResponse(deviceName, storageAccountName, containerName, resourceGroupName, Context.NONE) - .getValue(); - } - - public Response getByIdWithResponse(String id, Context context) { String deviceName = ResourceManagerUtils.getValueFromIdByName(id, "dataBoxEdgeDevices"); if (deviceName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( @@ -122,15 +127,15 @@ public Response getByIdWithResponse(String id, Context context) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'containers'.", id))); } + return this.getWithResponse(resourceGroupName, deviceName, storageAccountName, containerName, context); + } + + public void deleteById(String id) { String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - return this.getWithResponse(deviceName, storageAccountName, containerName, resourceGroupName, context); - } - - public void deleteById(String id) { String deviceName = ResourceManagerUtils.getValueFromIdByName(id, "dataBoxEdgeDevices"); if (deviceName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( @@ -146,15 +151,15 @@ public void deleteById(String id) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'containers'.", id))); } + this.delete(resourceGroupName, deviceName, storageAccountName, containerName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - this.delete(deviceName, storageAccountName, containerName, resourceGroupName, Context.NONE); - } - - public void deleteByIdWithResponse(String id, Context context) { String deviceName = ResourceManagerUtils.getValueFromIdByName(id, "dataBoxEdgeDevices"); if (deviceName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( @@ -170,12 +175,7 @@ public void deleteByIdWithResponse(String id, Context context) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'containers'.", id))); } - String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - this.delete(deviceName, storageAccountName, containerName, resourceGroupName, context); + this.delete(resourceGroupName, deviceName, storageAccountName, containerName, context); } private ContainersClient serviceClient() { diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/DCAccessCodeImpl.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/DCAccessCodeImpl.java new file mode 100644 index 000000000000..198bbbf596c7 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/DCAccessCodeImpl.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.databoxedge.implementation; + +import com.azure.resourcemanager.databoxedge.fluent.models.DCAccessCodeInner; +import com.azure.resourcemanager.databoxedge.models.DCAccessCode; + +public final class DCAccessCodeImpl implements DCAccessCode { + private DCAccessCodeInner innerObject; + + private final com.azure.resourcemanager.databoxedge.DataBoxEdgeManager serviceManager; + + DCAccessCodeImpl(DCAccessCodeInner innerObject, + com.azure.resourcemanager.databoxedge.DataBoxEdgeManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String authCode() { + return this.innerModel().authCode(); + } + + public DCAccessCodeInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.databoxedge.DataBoxEdgeManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/DataBoxEdgeDeviceExtendedInfoImpl.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/DataBoxEdgeDeviceExtendedInfoImpl.java index 955c0b4ddbd8..cbbf1c8c8e11 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/DataBoxEdgeDeviceExtendedInfoImpl.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/DataBoxEdgeDeviceExtendedInfoImpl.java @@ -1,11 +1,17 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.implementation; +import com.azure.core.management.SystemData; import com.azure.resourcemanager.databoxedge.fluent.models.DataBoxEdgeDeviceExtendedInfoInner; +import com.azure.resourcemanager.databoxedge.models.ClusterWitnessType; import com.azure.resourcemanager.databoxedge.models.DataBoxEdgeDeviceExtendedInfo; +import com.azure.resourcemanager.databoxedge.models.KeyVaultSyncStatus; +import com.azure.resourcemanager.databoxedge.models.Secret; +import java.util.Collections; +import java.util.Map; public final class DataBoxEdgeDeviceExtendedInfoImpl implements DataBoxEdgeDeviceExtendedInfo { private DataBoxEdgeDeviceExtendedInfoInner innerObject; @@ -30,6 +36,10 @@ public String type() { return this.innerModel().type(); } + public SystemData systemData() { + return this.innerModel().systemData(); + } + public String encryptionKeyThumbprint() { return this.innerModel().encryptionKeyThumbprint(); } @@ -42,6 +52,59 @@ public String resourceKey() { return this.innerModel().resourceKey(); } + public String clientSecretStoreId() { + return this.innerModel().clientSecretStoreId(); + } + + public String clientSecretStoreUrl() { + return this.innerModel().clientSecretStoreUrl(); + } + + public String channelIntegrityKeyName() { + return this.innerModel().channelIntegrityKeyName(); + } + + public String channelIntegrityKeyVersion() { + return this.innerModel().channelIntegrityKeyVersion(); + } + + public KeyVaultSyncStatus keyVaultSyncStatus() { + return this.innerModel().keyVaultSyncStatus(); + } + + public Map deviceSecrets() { + Map inner = this.innerModel().deviceSecrets(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public ClusterWitnessType clusterWitnessType() { + return this.innerModel().clusterWitnessType(); + } + + public String fileShareWitnessLocation() { + return this.innerModel().fileShareWitnessLocation(); + } + + public String fileShareWitnessUsername() { + return this.innerModel().fileShareWitnessUsername(); + } + + public String cloudWitnessStorageAccountName() { + return this.innerModel().cloudWitnessStorageAccountName(); + } + + public String cloudWitnessContainerName() { + return this.innerModel().cloudWitnessContainerName(); + } + + public String cloudWitnessStorageEndpoint() { + return this.innerModel().cloudWitnessStorageEndpoint(); + } + public DataBoxEdgeDeviceExtendedInfoInner innerModel() { return this.innerObject; } diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/DataBoxEdgeDeviceImpl.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/DataBoxEdgeDeviceImpl.java index b0871be9c16c..7eebf16acec3 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/DataBoxEdgeDeviceImpl.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/DataBoxEdgeDeviceImpl.java @@ -1,19 +1,29 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.implementation; import com.azure.core.http.rest.Response; import com.azure.core.management.Region; +import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.databoxedge.fluent.models.DataBoxEdgeDeviceInner; import com.azure.resourcemanager.databoxedge.models.DataBoxEdgeDevice; import com.azure.resourcemanager.databoxedge.models.DataBoxEdgeDeviceExtendedInfo; +import com.azure.resourcemanager.databoxedge.models.DataBoxEdgeDeviceExtendedInfoPatch; +import com.azure.resourcemanager.databoxedge.models.DataBoxEdgeDeviceKind; import com.azure.resourcemanager.databoxedge.models.DataBoxEdgeDevicePatch; import com.azure.resourcemanager.databoxedge.models.DataBoxEdgeDeviceStatus; +import com.azure.resourcemanager.databoxedge.models.DataResidency; import com.azure.resourcemanager.databoxedge.models.DeviceType; +import com.azure.resourcemanager.databoxedge.models.EdgeProfile; +import com.azure.resourcemanager.databoxedge.models.EdgeProfilePatch; +import com.azure.resourcemanager.databoxedge.models.GenerateCertResponse; +import com.azure.resourcemanager.databoxedge.models.ResourceIdentity; +import com.azure.resourcemanager.databoxedge.models.ResourceMoveDetails; import com.azure.resourcemanager.databoxedge.models.RoleTypes; +import com.azure.resourcemanager.databoxedge.models.SecuritySettings; import com.azure.resourcemanager.databoxedge.models.Sku; import com.azure.resourcemanager.databoxedge.models.UploadCertificateRequest; import com.azure.resourcemanager.databoxedge.models.UploadCertificateResponse; @@ -60,6 +70,22 @@ public String etag() { return this.innerModel().etag(); } + public ResourceIdentity identity() { + return this.innerModel().identity(); + } + + public DataBoxEdgeDeviceKind kind() { + return this.innerModel().kind(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public SystemData systemDataPropertiesSystemData() { + return this.innerModel().systemDataPropertiesSystemData(); + } + public DataBoxEdgeDeviceStatus dataBoxEdgeDeviceStatus() { return this.innerModel().dataBoxEdgeDeviceStatus(); } @@ -121,6 +147,22 @@ public Integer nodeCount() { return this.innerModel().nodeCount(); } + public ResourceMoveDetails resourceMoveDetails() { + return this.innerModel().resourceMoveDetails(); + } + + public EdgeProfile edgeProfile() { + return this.innerModel().edgeProfile(); + } + + public DataResidency dataResidency() { + return this.innerModel().dataResidency(); + } + + public String kubernetesWorkloadProfile() { + return this.innerModel().kubernetesWorkloadProfile(); + } + public Region region() { return Region.fromName(this.regionName()); } @@ -141,10 +183,10 @@ private com.azure.resourcemanager.databoxedge.DataBoxEdgeManager manager() { return this.serviceManager; } - private String deviceName; - private String resourceGroupName; + private String deviceName; + private DataBoxEdgeDevicePatch updateParameters; public DataBoxEdgeDeviceImpl withExistingResourceGroup(String resourceGroupName) { @@ -155,14 +197,16 @@ public DataBoxEdgeDeviceImpl withExistingResourceGroup(String resourceGroupName) public DataBoxEdgeDevice create() { this.innerObject = serviceManager.serviceClient() .getDevices() - .createOrUpdate(deviceName, resourceGroupName, this.innerModel(), Context.NONE); + .createOrUpdateWithResponse(resourceGroupName, deviceName, this.innerModel(), Context.NONE) + .getValue(); return this; } public DataBoxEdgeDevice create(Context context) { this.innerObject = serviceManager.serviceClient() .getDevices() - .createOrUpdate(deviceName, resourceGroupName, this.innerModel(), context); + .createOrUpdateWithResponse(resourceGroupName, deviceName, this.innerModel(), context) + .getValue(); return this; } @@ -180,7 +224,7 @@ public DataBoxEdgeDeviceImpl update() { public DataBoxEdgeDevice apply() { this.innerObject = serviceManager.serviceClient() .getDevices() - .updateWithResponse(deviceName, resourceGroupName, updateParameters, Context.NONE) + .updateWithResponse(resourceGroupName, deviceName, updateParameters, Context.NONE) .getValue(); return this; } @@ -188,7 +232,7 @@ public DataBoxEdgeDevice apply() { public DataBoxEdgeDevice apply(Context context) { this.innerObject = serviceManager.serviceClient() .getDevices() - .updateWithResponse(deviceName, resourceGroupName, updateParameters, context) + .updateWithResponse(resourceGroupName, deviceName, updateParameters, context) .getValue(); return this; } @@ -197,8 +241,8 @@ public DataBoxEdgeDevice apply(Context context) { com.azure.resourcemanager.databoxedge.DataBoxEdgeManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; - this.deviceName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "dataBoxEdgeDevices"); this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.deviceName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "dataBoxEdgeDevices"); } public DataBoxEdgeDevice refresh() { @@ -218,45 +262,72 @@ public DataBoxEdgeDevice refresh(Context context) { } public void downloadUpdates() { - serviceManager.devices().downloadUpdates(deviceName, resourceGroupName); + serviceManager.devices().downloadUpdates(resourceGroupName, deviceName); } public void downloadUpdates(Context context) { - serviceManager.devices().downloadUpdates(deviceName, resourceGroupName, context); + serviceManager.devices().downloadUpdates(resourceGroupName, deviceName, context); + } + + public Response generateCertificateWithResponse(Context context) { + return serviceManager.devices().generateCertificateWithResponse(resourceGroupName, deviceName, context); + } + + public GenerateCertResponse generateCertificate() { + return serviceManager.devices().generateCertificate(resourceGroupName, deviceName); } public Response getExtendedInformationWithResponse(Context context) { - return serviceManager.devices().getExtendedInformationWithResponse(deviceName, resourceGroupName, context); + return serviceManager.devices().getExtendedInformationWithResponse(resourceGroupName, deviceName, context); } public DataBoxEdgeDeviceExtendedInfo getExtendedInformation() { - return serviceManager.devices().getExtendedInformation(deviceName, resourceGroupName); + return serviceManager.devices().getExtendedInformation(resourceGroupName, deviceName); } public void installUpdates() { - serviceManager.devices().installUpdates(deviceName, resourceGroupName); + serviceManager.devices().installUpdates(resourceGroupName, deviceName); } public void installUpdates(Context context) { - serviceManager.devices().installUpdates(deviceName, resourceGroupName, context); + serviceManager.devices().installUpdates(resourceGroupName, deviceName, context); } public void scanForUpdates() { - serviceManager.devices().scanForUpdates(deviceName, resourceGroupName); + serviceManager.devices().scanForUpdates(resourceGroupName, deviceName); } public void scanForUpdates(Context context) { - serviceManager.devices().scanForUpdates(deviceName, resourceGroupName, context); + serviceManager.devices().scanForUpdates(resourceGroupName, deviceName, context); + } + + public void createOrUpdateSecuritySettings(SecuritySettings securitySettings) { + serviceManager.devices().createOrUpdateSecuritySettings(resourceGroupName, deviceName, securitySettings); + } + + public void createOrUpdateSecuritySettings(SecuritySettings securitySettings, Context context) { + serviceManager.devices() + .createOrUpdateSecuritySettings(resourceGroupName, deviceName, securitySettings, context); + } + + public Response + updateExtendedInformationWithResponse(DataBoxEdgeDeviceExtendedInfoPatch parameters, Context context) { + return serviceManager.devices() + .updateExtendedInformationWithResponse(resourceGroupName, deviceName, parameters, context); + } + + public DataBoxEdgeDeviceExtendedInfo updateExtendedInformation(DataBoxEdgeDeviceExtendedInfoPatch parameters) { + return serviceManager.devices().updateExtendedInformation(resourceGroupName, deviceName, parameters); } public Response uploadCertificateWithResponse(UploadCertificateRequest parameters, Context context) { return serviceManager.devices() - .uploadCertificateWithResponse(deviceName, resourceGroupName, parameters, context); + .uploadCertificateWithResponse(resourceGroupName, deviceName, parameters, context); } public UploadCertificateResponse uploadCertificate(UploadCertificateRequest parameters) { - return serviceManager.devices().uploadCertificate(deviceName, resourceGroupName, parameters); + return serviceManager.devices().uploadCertificate(resourceGroupName, deviceName, parameters); } public DataBoxEdgeDeviceImpl withRegion(Region location) { @@ -289,27 +360,27 @@ public DataBoxEdgeDeviceImpl withEtag(String etag) { return this; } - public DataBoxEdgeDeviceImpl withDataBoxEdgeDeviceStatus(DataBoxEdgeDeviceStatus dataBoxEdgeDeviceStatus) { - this.innerModel().withDataBoxEdgeDeviceStatus(dataBoxEdgeDeviceStatus); - return this; - } - - public DataBoxEdgeDeviceImpl withDescription(String description) { - this.innerModel().withDescription(description); - return this; + public DataBoxEdgeDeviceImpl withIdentity(ResourceIdentity identity) { + if (isInCreateMode()) { + this.innerModel().withIdentity(identity); + return this; + } else { + this.updateParameters.withIdentity(identity); + return this; + } } - public DataBoxEdgeDeviceImpl withModelDescription(String modelDescription) { - this.innerModel().withModelDescription(modelDescription); + public DataBoxEdgeDeviceImpl withDataResidency(DataResidency dataResidency) { + this.innerModel().withDataResidency(dataResidency); return this; } - public DataBoxEdgeDeviceImpl withFriendlyName(String friendlyName) { - this.innerModel().withFriendlyName(friendlyName); + public DataBoxEdgeDeviceImpl withEdgeProfile(EdgeProfilePatch edgeProfile) { + this.updateParameters.withEdgeProfile(edgeProfile); return this; } private boolean isInCreateMode() { - return this.innerModel().id() == null; + return this.innerModel() == null || this.innerModel().id() == null; } } diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/DataBoxEdgeManagementClientBuilder.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/DataBoxEdgeManagementClientBuilder.java index 1c553d7d040a..b6ae36a26206 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/DataBoxEdgeManagementClientBuilder.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/DataBoxEdgeManagementClientBuilder.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.implementation; @@ -20,34 +20,34 @@ @ServiceClientBuilder(serviceClients = { DataBoxEdgeManagementClientImpl.class }) public final class DataBoxEdgeManagementClientBuilder { /* - * The subscription ID. + * Service host */ - private String subscriptionId; + private String endpoint; /** - * Sets The subscription ID. + * Sets Service host. * - * @param subscriptionId the subscriptionId value. + * @param endpoint the endpoint value. * @return the DataBoxEdgeManagementClientBuilder. */ - public DataBoxEdgeManagementClientBuilder subscriptionId(String subscriptionId) { - this.subscriptionId = subscriptionId; + public DataBoxEdgeManagementClientBuilder endpoint(String endpoint) { + this.endpoint = endpoint; return this; } /* - * server parameter + * The ID of the target subscription. The value must be an UUID. */ - private String endpoint; + private String subscriptionId; /** - * Sets server parameter. + * Sets The ID of the target subscription. The value must be an UUID. * - * @param endpoint the endpoint value. + * @param subscriptionId the subscriptionId value. * @return the DataBoxEdgeManagementClientBuilder. */ - public DataBoxEdgeManagementClientBuilder endpoint(String endpoint) { - this.endpoint = endpoint; + public DataBoxEdgeManagementClientBuilder subscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; return this; } @@ -132,7 +132,7 @@ public DataBoxEdgeManagementClientImpl buildClient() { ? serializerAdapter : SerializerFactory.createDefaultManagementSerializerAdapter(); DataBoxEdgeManagementClientImpl client = new DataBoxEdgeManagementClientImpl(localPipeline, - localSerializerAdapter, localDefaultPollInterval, localEnvironment, this.subscriptionId, localEndpoint); + localSerializerAdapter, localDefaultPollInterval, localEnvironment, localEndpoint, this.subscriptionId); return client; } } diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/DataBoxEdgeManagementClientImpl.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/DataBoxEdgeManagementClientImpl.java index 36cdc1040e95..6f679a829a1d 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/DataBoxEdgeManagementClientImpl.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/DataBoxEdgeManagementClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.implementation; @@ -15,29 +15,38 @@ import com.azure.core.management.exception.ManagementException; import com.azure.core.management.polling.PollResult; import com.azure.core.management.polling.PollerFactory; +import com.azure.core.management.polling.SyncPollerFactory; +import com.azure.core.util.BinaryData; 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; import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; import com.azure.core.util.serializer.SerializerAdapter; import com.azure.core.util.serializer.SerializerEncoding; +import com.azure.resourcemanager.databoxedge.fluent.AddonsClient; import com.azure.resourcemanager.databoxedge.fluent.AlertsClient; +import com.azure.resourcemanager.databoxedge.fluent.AvailableSkusClient; import com.azure.resourcemanager.databoxedge.fluent.BandwidthSchedulesClient; import com.azure.resourcemanager.databoxedge.fluent.ContainersClient; import com.azure.resourcemanager.databoxedge.fluent.DataBoxEdgeManagementClient; +import com.azure.resourcemanager.databoxedge.fluent.DeviceCapacityChecksClient; +import com.azure.resourcemanager.databoxedge.fluent.DeviceCapacityInfoesClient; import com.azure.resourcemanager.databoxedge.fluent.DevicesClient; +import com.azure.resourcemanager.databoxedge.fluent.DiagnosticSettingsClient; import com.azure.resourcemanager.databoxedge.fluent.JobsClient; +import com.azure.resourcemanager.databoxedge.fluent.MonitoringConfigsClient; import com.azure.resourcemanager.databoxedge.fluent.NodesClient; import com.azure.resourcemanager.databoxedge.fluent.OperationsClient; import com.azure.resourcemanager.databoxedge.fluent.OperationsStatusClient; import com.azure.resourcemanager.databoxedge.fluent.OrdersClient; import com.azure.resourcemanager.databoxedge.fluent.RolesClient; import com.azure.resourcemanager.databoxedge.fluent.SharesClient; -import com.azure.resourcemanager.databoxedge.fluent.SkusClient; import com.azure.resourcemanager.databoxedge.fluent.StorageAccountCredentialsClient; import com.azure.resourcemanager.databoxedge.fluent.StorageAccountsClient; +import com.azure.resourcemanager.databoxedge.fluent.SupportPackagesClient; import com.azure.resourcemanager.databoxedge.fluent.TriggersClient; import com.azure.resourcemanager.databoxedge.fluent.UsersClient; import java.io.IOException; @@ -55,26 +64,12 @@ @ServiceClient(builder = DataBoxEdgeManagementClientBuilder.class) public final class DataBoxEdgeManagementClientImpl implements DataBoxEdgeManagementClient { /** - * The subscription ID. - */ - private final String subscriptionId; - - /** - * Gets The subscription ID. - * - * @return the subscriptionId value. - */ - public String getSubscriptionId() { - return this.subscriptionId; - } - - /** - * server parameter. + * Service host. */ private final String endpoint; /** - * Gets server parameter. + * Gets Service host. * * @return the endpoint value. */ @@ -83,12 +78,12 @@ public String getEndpoint() { } /** - * Api Version. + * Version parameter. */ private final String apiVersion; /** - * Gets Api Version. + * Gets Version parameter. * * @return the apiVersion value. */ @@ -96,6 +91,20 @@ public String getApiVersion() { return this.apiVersion; } + /** + * The ID of the target subscription. The value must be an UUID. + */ + private final String subscriptionId; + + /** + * Gets The ID of the target subscription. The value must be an UUID. + * + * @return the subscriptionId value. + */ + public String getSubscriptionId() { + return this.subscriptionId; + } + /** * The HTTP pipeline to send requests through. */ @@ -195,31 +204,31 @@ public BandwidthSchedulesClient getBandwidthSchedules() { } /** - * The JobsClient object to access its operations. + * The DiagnosticSettingsClient object to access its operations. */ - private final JobsClient jobs; + private final DiagnosticSettingsClient diagnosticSettings; /** - * Gets the JobsClient object to access its operations. + * Gets the DiagnosticSettingsClient object to access its operations. * - * @return the JobsClient object. + * @return the DiagnosticSettingsClient object. */ - public JobsClient getJobs() { - return this.jobs; + public DiagnosticSettingsClient getDiagnosticSettings() { + return this.diagnosticSettings; } /** - * The NodesClient object to access its operations. + * The JobsClient object to access its operations. */ - private final NodesClient nodes; + private final JobsClient jobs; /** - * Gets the NodesClient object to access its operations. + * Gets the JobsClient object to access its operations. * - * @return the NodesClient object. + * @return the JobsClient object. */ - public NodesClient getNodes() { - return this.nodes; + public JobsClient getJobs() { + return this.jobs; } /** @@ -264,6 +273,20 @@ public RolesClient getRoles() { return this.roles; } + /** + * The AddonsClient object to access its operations. + */ + private final AddonsClient addons; + + /** + * Gets the AddonsClient object to access its operations. + * + * @return the AddonsClient object. + */ + public AddonsClient getAddons() { + return this.addons; + } + /** * The SharesClient object to access its operations. */ @@ -349,17 +372,87 @@ public UsersClient getUsers() { } /** - * The SkusClient object to access its operations. + * The DeviceCapacityChecksClient object to access its operations. + */ + private final DeviceCapacityChecksClient deviceCapacityChecks; + + /** + * Gets the DeviceCapacityChecksClient object to access its operations. + * + * @return the DeviceCapacityChecksClient object. + */ + public DeviceCapacityChecksClient getDeviceCapacityChecks() { + return this.deviceCapacityChecks; + } + + /** + * The NodesClient object to access its operations. + */ + private final NodesClient nodes; + + /** + * Gets the NodesClient object to access its operations. + * + * @return the NodesClient object. + */ + public NodesClient getNodes() { + return this.nodes; + } + + /** + * The SupportPackagesClient object to access its operations. + */ + private final SupportPackagesClient supportPackages; + + /** + * Gets the SupportPackagesClient object to access its operations. + * + * @return the SupportPackagesClient object. + */ + public SupportPackagesClient getSupportPackages() { + return this.supportPackages; + } + + /** + * The DeviceCapacityInfoesClient object to access its operations. + */ + private final DeviceCapacityInfoesClient deviceCapacityInfoes; + + /** + * Gets the DeviceCapacityInfoesClient object to access its operations. + * + * @return the DeviceCapacityInfoesClient object. + */ + public DeviceCapacityInfoesClient getDeviceCapacityInfoes() { + return this.deviceCapacityInfoes; + } + + /** + * The MonitoringConfigsClient object to access its operations. + */ + private final MonitoringConfigsClient monitoringConfigs; + + /** + * Gets the MonitoringConfigsClient object to access its operations. + * + * @return the MonitoringConfigsClient object. + */ + public MonitoringConfigsClient getMonitoringConfigs() { + return this.monitoringConfigs; + } + + /** + * The AvailableSkusClient object to access its operations. */ - private final SkusClient skus; + private final AvailableSkusClient availableSkus; /** - * Gets the SkusClient object to access its operations. + * Gets the AvailableSkusClient object to access its operations. * - * @return the SkusClient object. + * @return the AvailableSkusClient object. */ - public SkusClient getSkus() { - return this.skus; + public AvailableSkusClient getAvailableSkus() { + return this.availableSkus; } /** @@ -369,33 +462,39 @@ public SkusClient getSkus() { * @param serializerAdapter The serializer to serialize an object into a string. * @param defaultPollInterval The default poll interval for long-running operation. * @param environment The Azure environment. - * @param subscriptionId The subscription ID. - * @param endpoint server parameter. + * @param endpoint Service host. + * @param subscriptionId The ID of the target subscription. The value must be an UUID. */ DataBoxEdgeManagementClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, - Duration defaultPollInterval, AzureEnvironment environment, String subscriptionId, String endpoint) { + Duration defaultPollInterval, AzureEnvironment environment, String endpoint, String subscriptionId) { this.httpPipeline = httpPipeline; this.serializerAdapter = serializerAdapter; this.defaultPollInterval = defaultPollInterval; - this.subscriptionId = subscriptionId; this.endpoint = endpoint; - this.apiVersion = "2019-08-01"; + this.subscriptionId = subscriptionId; + this.apiVersion = "2023-12-01"; this.operations = new OperationsClientImpl(this); this.devices = new DevicesClientImpl(this); this.alerts = new AlertsClientImpl(this); this.bandwidthSchedules = new BandwidthSchedulesClientImpl(this); + this.diagnosticSettings = new DiagnosticSettingsClientImpl(this); this.jobs = new JobsClientImpl(this); - this.nodes = new NodesClientImpl(this); this.operationsStatus = new OperationsStatusClientImpl(this); this.orders = new OrdersClientImpl(this); this.roles = new RolesClientImpl(this); + this.addons = new AddonsClientImpl(this); this.shares = new SharesClientImpl(this); this.storageAccountCredentials = new StorageAccountCredentialsClientImpl(this); this.storageAccounts = new StorageAccountsClientImpl(this); this.containers = new ContainersClientImpl(this); this.triggers = new TriggersClientImpl(this); this.users = new UsersClientImpl(this); - this.skus = new SkusClientImpl(this); + this.deviceCapacityChecks = new DeviceCapacityChecksClientImpl(this); + this.nodes = new NodesClientImpl(this); + this.supportPackages = new SupportPackagesClientImpl(this); + this.deviceCapacityInfoes = new DeviceCapacityInfoesClientImpl(this); + this.monitoringConfigs = new MonitoringConfigsClientImpl(this); + this.availableSkus = new AvailableSkusClientImpl(this); } /** @@ -435,6 +534,23 @@ public PollerFlux, U> getLroResult(Mono type of poll result. + * @param type of final result. + * @return SyncPoller for poll result and final result. + */ + public SyncPoller, U> getLroResult(Response activationResponse, + Type pollResultType, Type finalResultType, Context context) { + return SyncPollerFactory.create(serializerAdapter, httpPipeline, pollResultType, finalResultType, + defaultPollInterval, () -> activationResponse, context); + } + /** * Gets the final result, or an error, based on last async poll response. * diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/DataBoxEdgeSkuListImpl.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/DataBoxEdgeSkuListImpl.java new file mode 100644 index 000000000000..52954971713e --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/DataBoxEdgeSkuListImpl.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.databoxedge.implementation; + +import com.azure.resourcemanager.databoxedge.fluent.models.DataBoxEdgeSkuListInner; +import com.azure.resourcemanager.databoxedge.models.DataBoxEdgeSku; +import com.azure.resourcemanager.databoxedge.models.DataBoxEdgeSkuList; +import java.util.Collections; +import java.util.List; + +public final class DataBoxEdgeSkuListImpl implements DataBoxEdgeSkuList { + private DataBoxEdgeSkuListInner innerObject; + + private final com.azure.resourcemanager.databoxedge.DataBoxEdgeManager serviceManager; + + DataBoxEdgeSkuListImpl(DataBoxEdgeSkuListInner innerObject, + com.azure.resourcemanager.databoxedge.DataBoxEdgeManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public List value() { + List inner = this.innerModel().value(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public String nextLink() { + return this.innerModel().nextLink(); + } + + public DataBoxEdgeSkuListInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.databoxedge.DataBoxEdgeManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/DeviceCapacityChecksClientImpl.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/DeviceCapacityChecksClientImpl.java new file mode 100644 index 000000000000..14057c8999e2 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/DeviceCapacityChecksClientImpl.java @@ -0,0 +1,331 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.databoxedge.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.BinaryData; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.databoxedge.fluent.DeviceCapacityChecksClient; +import com.azure.resourcemanager.databoxedge.models.DeviceCapacityRequestInfo; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in DeviceCapacityChecksClient. + */ +public final class DeviceCapacityChecksClientImpl implements DeviceCapacityChecksClient { + /** + * The proxy service used to perform REST calls. + */ + private final DeviceCapacityChecksService service; + + /** + * The service client containing this operation class. + */ + private final DataBoxEdgeManagementClientImpl client; + + /** + * Initializes an instance of DeviceCapacityChecksClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + DeviceCapacityChecksClientImpl(DataBoxEdgeManagementClientImpl client) { + this.service = RestProxy.create(DeviceCapacityChecksService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for DataBoxEdgeManagementClientDeviceCapacityChecks to be used by the + * proxy service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "DataBoxEdgeManagementClientDeviceCapacityChecks") + public interface DeviceCapacityChecksService { + @Headers({ "Accept: application/json;q=0.9" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/deviceCapacityCheck") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> checkResourceCreationFeasibility(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("deviceName") String deviceName, + @QueryParam("capacityName") String capacityName, @HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") DeviceCapacityRequestInfo deviceCapacityRequestInfo, Context context); + + @Headers({ "Accept: application/json;q=0.9" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/deviceCapacityCheck") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response checkResourceCreationFeasibilitySync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("deviceName") String deviceName, + @QueryParam("capacityName") String capacityName, @HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") DeviceCapacityRequestInfo deviceCapacityRequestInfo, Context context); + } + + /** + * Posts the device capacity request info to check feasibility. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @param deviceCapacityRequestInfo The device capacity request info. + * @param capacityName The capacity name. + * @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>> checkResourceCreationFeasibilityWithResponseAsync(String resourceGroupName, + String deviceName, DeviceCapacityRequestInfo deviceCapacityRequestInfo, String capacityName) { + final String contentType = "application/json"; + return FluxUtil + .withContext(context -> service.checkResourceCreationFeasibility(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, deviceName, + capacityName, contentType, deviceCapacityRequestInfo, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Posts the device capacity request info to check feasibility. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @param deviceCapacityRequestInfo The device capacity request info. + * @param capacityName The capacity name. + * @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 body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response checkResourceCreationFeasibilityWithResponse(String resourceGroupName, + String deviceName, DeviceCapacityRequestInfo deviceCapacityRequestInfo, String capacityName) { + final String contentType = "application/json"; + return service.checkResourceCreationFeasibilitySync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, deviceName, capacityName, contentType, + deviceCapacityRequestInfo, Context.NONE); + } + + /** + * Posts the device capacity request info to check feasibility. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @param deviceCapacityRequestInfo The device capacity request info. + * @param capacityName The capacity name. + * @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 body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response checkResourceCreationFeasibilityWithResponse(String resourceGroupName, + String deviceName, DeviceCapacityRequestInfo deviceCapacityRequestInfo, String capacityName, Context context) { + final String contentType = "application/json"; + return service.checkResourceCreationFeasibilitySync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, deviceName, capacityName, contentType, + deviceCapacityRequestInfo, context); + } + + /** + * Posts the device capacity request info to check feasibility. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @param deviceCapacityRequestInfo The device capacity request info. + * @param capacityName The capacity name. + * @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 long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginCheckResourceCreationFeasibilityAsync(String resourceGroupName, + String deviceName, DeviceCapacityRequestInfo deviceCapacityRequestInfo, String capacityName) { + Mono>> mono = checkResourceCreationFeasibilityWithResponseAsync(resourceGroupName, + deviceName, deviceCapacityRequestInfo, capacityName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Posts the device capacity request info to check feasibility. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @param deviceCapacityRequestInfo The device capacity request info. + * @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 long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginCheckResourceCreationFeasibilityAsync(String resourceGroupName, + String deviceName, DeviceCapacityRequestInfo deviceCapacityRequestInfo) { + final String capacityName = null; + Mono>> mono = checkResourceCreationFeasibilityWithResponseAsync(resourceGroupName, + deviceName, deviceCapacityRequestInfo, capacityName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Posts the device capacity request info to check feasibility. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @param deviceCapacityRequestInfo The device capacity request info. + * @param capacityName The capacity name. + * @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 SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginCheckResourceCreationFeasibility(String resourceGroupName, + String deviceName, DeviceCapacityRequestInfo deviceCapacityRequestInfo, String capacityName) { + Response response = checkResourceCreationFeasibilityWithResponse(resourceGroupName, deviceName, + deviceCapacityRequestInfo, capacityName); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); + } + + /** + * Posts the device capacity request info to check feasibility. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @param deviceCapacityRequestInfo The device capacity request info. + * @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 SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginCheckResourceCreationFeasibility(String resourceGroupName, + String deviceName, DeviceCapacityRequestInfo deviceCapacityRequestInfo) { + final String capacityName = null; + Response response = checkResourceCreationFeasibilityWithResponse(resourceGroupName, deviceName, + deviceCapacityRequestInfo, capacityName); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); + } + + /** + * Posts the device capacity request info to check feasibility. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @param deviceCapacityRequestInfo The device capacity request info. + * @param capacityName The capacity name. + * @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 SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginCheckResourceCreationFeasibility(String resourceGroupName, + String deviceName, DeviceCapacityRequestInfo deviceCapacityRequestInfo, String capacityName, Context context) { + Response response = checkResourceCreationFeasibilityWithResponse(resourceGroupName, deviceName, + deviceCapacityRequestInfo, capacityName, context); + return this.client.getLroResult(response, Void.class, Void.class, context); + } + + /** + * Posts the device capacity request info to check feasibility. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @param deviceCapacityRequestInfo The device capacity request info. + * @param capacityName The capacity name. + * @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 checkResourceCreationFeasibilityAsync(String resourceGroupName, String deviceName, + DeviceCapacityRequestInfo deviceCapacityRequestInfo, String capacityName) { + return beginCheckResourceCreationFeasibilityAsync(resourceGroupName, deviceName, deviceCapacityRequestInfo, + capacityName).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Posts the device capacity request info to check feasibility. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @param deviceCapacityRequestInfo The device capacity request info. + * @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 checkResourceCreationFeasibilityAsync(String resourceGroupName, String deviceName, + DeviceCapacityRequestInfo deviceCapacityRequestInfo) { + final String capacityName = null; + return beginCheckResourceCreationFeasibilityAsync(resourceGroupName, deviceName, deviceCapacityRequestInfo, + capacityName).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Posts the device capacity request info to check feasibility. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @param deviceCapacityRequestInfo The device capacity request info. + * @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 checkResourceCreationFeasibility(String resourceGroupName, String deviceName, + DeviceCapacityRequestInfo deviceCapacityRequestInfo) { + final String capacityName = null; + beginCheckResourceCreationFeasibility(resourceGroupName, deviceName, deviceCapacityRequestInfo, capacityName) + .getFinalResult(); + } + + /** + * Posts the device capacity request info to check feasibility. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @param deviceCapacityRequestInfo The device capacity request info. + * @param capacityName The capacity name. + * @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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void checkResourceCreationFeasibility(String resourceGroupName, String deviceName, + DeviceCapacityRequestInfo deviceCapacityRequestInfo, String capacityName, Context context) { + beginCheckResourceCreationFeasibility(resourceGroupName, deviceName, deviceCapacityRequestInfo, capacityName, + context).getFinalResult(); + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/DeviceCapacityChecksImpl.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/DeviceCapacityChecksImpl.java new file mode 100644 index 000000000000..d4245de0865f --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/DeviceCapacityChecksImpl.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.databoxedge.implementation; + +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.databoxedge.fluent.DeviceCapacityChecksClient; +import com.azure.resourcemanager.databoxedge.models.DeviceCapacityChecks; +import com.azure.resourcemanager.databoxedge.models.DeviceCapacityRequestInfo; + +public final class DeviceCapacityChecksImpl implements DeviceCapacityChecks { + private static final ClientLogger LOGGER = new ClientLogger(DeviceCapacityChecksImpl.class); + + private final DeviceCapacityChecksClient innerClient; + + private final com.azure.resourcemanager.databoxedge.DataBoxEdgeManager serviceManager; + + public DeviceCapacityChecksImpl(DeviceCapacityChecksClient innerClient, + com.azure.resourcemanager.databoxedge.DataBoxEdgeManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public void checkResourceCreationFeasibility(String resourceGroupName, String deviceName, + DeviceCapacityRequestInfo deviceCapacityRequestInfo) { + this.serviceClient().checkResourceCreationFeasibility(resourceGroupName, deviceName, deviceCapacityRequestInfo); + } + + public void checkResourceCreationFeasibility(String resourceGroupName, String deviceName, + DeviceCapacityRequestInfo deviceCapacityRequestInfo, String capacityName, Context context) { + this.serviceClient() + .checkResourceCreationFeasibility(resourceGroupName, deviceName, deviceCapacityRequestInfo, capacityName, + context); + } + + private DeviceCapacityChecksClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.databoxedge.DataBoxEdgeManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/DeviceCapacityInfoImpl.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/DeviceCapacityInfoImpl.java new file mode 100644 index 000000000000..fd07b469c58f --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/DeviceCapacityInfoImpl.java @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.databoxedge.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.databoxedge.fluent.models.DeviceCapacityInfoInner; +import com.azure.resourcemanager.databoxedge.models.ClusterCapacityViewData; +import com.azure.resourcemanager.databoxedge.models.ClusterStorageViewData; +import com.azure.resourcemanager.databoxedge.models.DeviceCapacityInfo; +import com.azure.resourcemanager.databoxedge.models.HostCapacity; +import java.time.OffsetDateTime; +import java.util.Collections; +import java.util.Map; + +public final class DeviceCapacityInfoImpl implements DeviceCapacityInfo { + private DeviceCapacityInfoInner innerObject; + + private final com.azure.resourcemanager.databoxedge.DataBoxEdgeManager serviceManager; + + DeviceCapacityInfoImpl(DeviceCapacityInfoInner innerObject, + com.azure.resourcemanager.databoxedge.DataBoxEdgeManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public OffsetDateTime timeStamp() { + return this.innerModel().timeStamp(); + } + + public ClusterStorageViewData clusterStorageCapacityInfo() { + return this.innerModel().clusterStorageCapacityInfo(); + } + + public ClusterCapacityViewData clusterComputeCapacityInfo() { + return this.innerModel().clusterComputeCapacityInfo(); + } + + public Map nodeCapacityInfos() { + Map inner = this.innerModel().nodeCapacityInfos(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public DeviceCapacityInfoInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.databoxedge.DataBoxEdgeManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/DeviceCapacityInfoesClientImpl.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/DeviceCapacityInfoesClientImpl.java new file mode 100644 index 000000000000..3d87d50251a9 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/DeviceCapacityInfoesClientImpl.java @@ -0,0 +1,150 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.databoxedge.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.databoxedge.fluent.DeviceCapacityInfoesClient; +import com.azure.resourcemanager.databoxedge.fluent.models.DeviceCapacityInfoInner; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in DeviceCapacityInfoesClient. + */ +public final class DeviceCapacityInfoesClientImpl implements DeviceCapacityInfoesClient { + /** + * The proxy service used to perform REST calls. + */ + private final DeviceCapacityInfoesService service; + + /** + * The service client containing this operation class. + */ + private final DataBoxEdgeManagementClientImpl client; + + /** + * Initializes an instance of DeviceCapacityInfoesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + DeviceCapacityInfoesClientImpl(DataBoxEdgeManagementClientImpl client) { + this.service = RestProxy.create(DeviceCapacityInfoesService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for DataBoxEdgeManagementClientDeviceCapacityInfoes to be used by the + * proxy service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "DataBoxEdgeManagementClientDeviceCapacityInfoes") + public interface DeviceCapacityInfoesService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/deviceCapacityInfo/default") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getDeviceCapacityInfo(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("deviceName") String deviceName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/deviceCapacityInfo/default") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getDeviceCapacityInfoSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("deviceName") String deviceName, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Gets the properties of the specified device capacity info. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @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 properties of the specified device capacity info along with {@link Response} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getDeviceCapacityInfoWithResponseAsync(String resourceGroupName, + String deviceName) { + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.getDeviceCapacityInfo(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, deviceName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the properties of the specified device capacity info. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @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 properties of the specified device capacity info on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getDeviceCapacityInfoAsync(String resourceGroupName, String deviceName) { + return getDeviceCapacityInfoWithResponseAsync(resourceGroupName, deviceName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets the properties of the specified device capacity info. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @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 properties of the specified device capacity info along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getDeviceCapacityInfoWithResponse(String resourceGroupName, + String deviceName, Context context) { + final String accept = "application/json"; + return service.getDeviceCapacityInfoSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, deviceName, accept, context); + } + + /** + * Gets the properties of the specified device capacity info. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @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 properties of the specified device capacity info. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DeviceCapacityInfoInner getDeviceCapacityInfo(String resourceGroupName, String deviceName) { + return getDeviceCapacityInfoWithResponse(resourceGroupName, deviceName, Context.NONE).getValue(); + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/DeviceCapacityInfoesImpl.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/DeviceCapacityInfoesImpl.java new file mode 100644 index 000000000000..f1d17280db2a --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/DeviceCapacityInfoesImpl.java @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.databoxedge.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.databoxedge.fluent.DeviceCapacityInfoesClient; +import com.azure.resourcemanager.databoxedge.fluent.models.DeviceCapacityInfoInner; +import com.azure.resourcemanager.databoxedge.models.DeviceCapacityInfo; +import com.azure.resourcemanager.databoxedge.models.DeviceCapacityInfoes; + +public final class DeviceCapacityInfoesImpl implements DeviceCapacityInfoes { + private static final ClientLogger LOGGER = new ClientLogger(DeviceCapacityInfoesImpl.class); + + private final DeviceCapacityInfoesClient innerClient; + + private final com.azure.resourcemanager.databoxedge.DataBoxEdgeManager serviceManager; + + public DeviceCapacityInfoesImpl(DeviceCapacityInfoesClient innerClient, + com.azure.resourcemanager.databoxedge.DataBoxEdgeManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getDeviceCapacityInfoWithResponse(String resourceGroupName, String deviceName, + Context context) { + Response inner + = this.serviceClient().getDeviceCapacityInfoWithResponse(resourceGroupName, deviceName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new DeviceCapacityInfoImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public DeviceCapacityInfo getDeviceCapacityInfo(String resourceGroupName, String deviceName) { + DeviceCapacityInfoInner inner = this.serviceClient().getDeviceCapacityInfo(resourceGroupName, deviceName); + if (inner != null) { + return new DeviceCapacityInfoImpl(inner, this.manager()); + } else { + return null; + } + } + + private DeviceCapacityInfoesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.databoxedge.DataBoxEdgeManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/DevicesClientImpl.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/DevicesClientImpl.java index e1429c0e2c28..cf99863548f8 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/DevicesClientImpl.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/DevicesClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.implementation; @@ -29,6 +29,7 @@ import com.azure.core.http.rest.RestProxy; import com.azure.core.management.exception.ManagementException; import com.azure.core.management.polling.PollResult; +import com.azure.core.util.BinaryData; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; import com.azure.core.util.polling.PollerFlux; @@ -36,10 +37,12 @@ import com.azure.resourcemanager.databoxedge.fluent.DevicesClient; import com.azure.resourcemanager.databoxedge.fluent.models.DataBoxEdgeDeviceExtendedInfoInner; import com.azure.resourcemanager.databoxedge.fluent.models.DataBoxEdgeDeviceInner; +import com.azure.resourcemanager.databoxedge.fluent.models.GenerateCertResponseInner; import com.azure.resourcemanager.databoxedge.fluent.models.NetworkSettingsInner; import com.azure.resourcemanager.databoxedge.fluent.models.UpdateSummaryInner; import com.azure.resourcemanager.databoxedge.fluent.models.UploadCertificateResponseInner; -import com.azure.resourcemanager.databoxedge.models.DataBoxEdgeDeviceList; +import com.azure.resourcemanager.databoxedge.implementation.models.DataBoxEdgeDeviceList; +import com.azure.resourcemanager.databoxedge.models.DataBoxEdgeDeviceExtendedInfoPatch; import com.azure.resourcemanager.databoxedge.models.DataBoxEdgeDevicePatch; import com.azure.resourcemanager.databoxedge.models.SecuritySettings; import com.azure.resourcemanager.databoxedge.models.UploadCertificateRequest; @@ -75,503 +78,410 @@ public final class DevicesClientImpl implements DevicesClient { * The interface defining all the services for DataBoxEdgeManagementClientDevices to be used by the proxy service to * perform REST calls. */ - @Host("{$host}") - @ServiceInterface(name = "DataBoxEdgeManagemen") + @Host("{endpoint}") + @ServiceInterface(name = "DataBoxEdgeManagementClientDevices") public interface DevicesService { @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/networkSettings/default") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, - @QueryParam("$expand") String expand, @HeaderParam("Accept") String accept, Context context); + Mono> getNetworkSettings(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("deviceName") String deviceName, + @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/networkSettings/default") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroup(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, - @QueryParam("$expand") String expand, @HeaderParam("Accept") String accept, Context context); + Response getNetworkSettingsSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("deviceName") String deviceName, + @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getByResourceGroup(@HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("subscriptionId") String subscriptionId, @PathParam("deviceName") String deviceName, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + Mono> getByResourceGroup(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("deviceName") String deviceName, + @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdate(@HostParam("$host") String endpoint, - @PathParam("deviceName") String deviceName, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") DataBoxEdgeDeviceInner dataBoxEdgeDevice, + Response getByResourceGroupSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("deviceName") String deviceName, @HeaderParam("Accept") String accept, Context context); - @Headers({ "Content-Type: application/json" }) - @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}") - @ExpectedResponses({ 200, 202, 204 }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete(@HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("subscriptionId") String subscriptionId, @PathParam("deviceName") String deviceName, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + Mono> createOrUpdate(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("deviceName") String deviceName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") DataBoxEdgeDeviceInner dataBoxEdgeDevice, Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response createOrUpdateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("deviceName") String deviceName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") DataBoxEdgeDeviceInner dataBoxEdgeDevice, Context context); + + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> update(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("deviceName") String deviceName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") DataBoxEdgeDevicePatch parameters, Context context); - @Headers({ "Content-Type: application/json" }) @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> update(@HostParam("$host") String endpoint, - @PathParam("deviceName") String deviceName, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") DataBoxEdgeDevicePatch parameters, @HeaderParam("Accept") String accept, + Response updateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("deviceName") String deviceName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") DataBoxEdgeDevicePatch parameters, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}") + @ExpectedResponses({ 200, 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("deviceName") String deviceName, Context context); - @Headers({ "Content-Type: application/json" }) - @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/downloadUpdates") - @ExpectedResponses({ 200, 202 }) + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}") + @ExpectedResponses({ 200, 202, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> downloadUpdates(@HostParam("$host") String endpoint, - @PathParam("deviceName") String deviceName, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); + Response deleteSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("deviceName") String deviceName, + Context context); @Headers({ "Content-Type: application/json" }) - @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/getExtendedInformation") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getExtendedInformation(@HostParam("$host") String endpoint, - @PathParam("deviceName") String deviceName, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, + Mono> listByResourceGroup(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("$expand") String expand, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/installUpdates") - @ExpectedResponses({ 200, 202 }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> installUpdates(@HostParam("$host") String endpoint, - @PathParam("deviceName") String deviceName, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, + Response listByResourceGroupSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("$expand") String expand, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/networkSettings/default") + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getNetworkSettings(@HostParam("$host") String endpoint, - @PathParam("deviceName") String deviceName, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @QueryParam("$expand") String expand, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/scanForUpdates") + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @QueryParam("$expand") String expand, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/downloadUpdates") @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> scanForUpdates(@HostParam("$host") String endpoint, - @PathParam("deviceName") String deviceName, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); + Mono>> downloadUpdates(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("deviceName") String deviceName, + Context context); - @Headers({ "Content-Type: application/json" }) - @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/securitySettings/default/update") - @ExpectedResponses({ 202, 204 }) + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/downloadUpdates") + @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdateSecuritySettings(@HostParam("$host") String endpoint, - @PathParam("deviceName") String deviceName, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") SecuritySettings securitySettings, @HeaderParam("Accept") String accept, + Response downloadUpdatesSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("deviceName") String deviceName, Context context); @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/updateSummary/default") + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/generateCertificate") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getUpdateSummary(@HostParam("$host") String endpoint, - @PathParam("deviceName") String deviceName, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, + Mono> generateCertificate(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("deviceName") String deviceName, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/uploadCertificate") + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/generateCertificate") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> uploadCertificate(@HostParam("$host") String endpoint, - @PathParam("deviceName") String deviceName, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") UploadCertificateRequest parameters, @HeaderParam("Accept") String accept, - Context context); + Response generateCertificateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("deviceName") String deviceName, + @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/getExtendedInformation") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listBySubscriptionNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + Mono> getExtendedInformation( + @HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("deviceName") String deviceName, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/getExtendedInformation") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroupNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + Response getExtendedInformationSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("deviceName") String deviceName, @HeaderParam("Accept") String accept, Context context); - } - /** - * Gets all the Data Box Edge/Data Box Gateway devices in a subscription. - * - * @param expand Specify $expand=details to populate additional fields related to the resource or Specify - * $skipToken=<token> to populate the next page in the 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 all the Data Box Edge/Data Box Gateway devices in a subscription along with {@link PagedResponse} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String expand) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() 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.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), - this.client.getApiVersion(), expand, accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/installUpdates") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> installUpdates(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("deviceName") String deviceName, + Context context); - /** - * Gets all the Data Box Edge/Data Box Gateway devices in a subscription. - * - * @param expand Specify $expand=details to populate additional fields related to the resource or Specify - * $skipToken=<token> to populate the next page in the list. - * @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 all the Data Box Edge/Data Box Gateway devices in a subscription along with {@link PagedResponse} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String expand, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() 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.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), this.client.getSubscriptionId(), this.client.getApiVersion(), expand, - accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/installUpdates") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response installUpdatesSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("deviceName") String deviceName, + Context context); - /** - * Gets all the Data Box Edge/Data Box Gateway devices in a subscription. - * - * @param expand Specify $expand=details to populate additional fields related to the resource or Specify - * $skipToken=<token> to populate the next page in the 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 all the Data Box Edge/Data Box Gateway devices in a subscription as paginated response with - * {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String expand) { - return new PagedFlux<>(() -> listSinglePageAsync(expand), - nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); - } + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/scanForUpdates") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> scanForUpdates(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("deviceName") String deviceName, + Context context); - /** - * Gets all the Data Box Edge/Data Box Gateway devices in a subscription. - * - * @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 all the Data Box Edge/Data Box Gateway devices in a subscription as paginated response with - * {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync() { - final String expand = null; - return new PagedFlux<>(() -> listSinglePageAsync(expand), - nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); - } + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/scanForUpdates") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response scanForUpdatesSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("deviceName") String deviceName, + Context context); - /** - * Gets all the Data Box Edge/Data Box Gateway devices in a subscription. - * - * @param expand Specify $expand=details to populate additional fields related to the resource or Specify - * $skipToken=<token> to populate the next page in the list. - * @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 all the Data Box Edge/Data Box Gateway devices in a subscription as paginated response with - * {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String expand, Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(expand, context), - nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); - } + @Headers({ "Accept: application/json;q=0.9" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/update") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdateSecuritySettings(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("deviceName") String deviceName, + @HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") SecuritySettings securitySettings, Context context); + + @Headers({ "Accept: application/json;q=0.9" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/update") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response createOrUpdateSecuritySettingsSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("deviceName") String deviceName, + @HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") SecuritySettings securitySettings, Context context); - /** - * Gets all the Data Box Edge/Data Box Gateway devices in a subscription. - * - * @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 all the Data Box Edge/Data Box Gateway devices in a subscription as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - final String expand = null; - return new PagedIterable<>(listAsync(expand)); - } + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/updateExtendedInformation") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> updateExtendedInformation( + @HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("deviceName") String deviceName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") DataBoxEdgeDeviceExtendedInfoPatch parameters, Context context); - /** - * Gets all the Data Box Edge/Data Box Gateway devices in a subscription. - * - * @param expand Specify $expand=details to populate additional fields related to the resource or Specify - * $skipToken=<token> to populate the next page in the list. - * @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 all the Data Box Edge/Data Box Gateway devices in a subscription as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String expand, Context context) { - return new PagedIterable<>(listAsync(expand, context)); - } + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/updateExtendedInformation") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response updateExtendedInformationSync( + @HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("deviceName") String deviceName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") DataBoxEdgeDeviceExtendedInfoPatch parameters, Context context); - /** - * Gets all the Data Box Edge/Data Box Gateway devices in a resource group. - * - * @param resourceGroupName The resource group name. - * @param expand Specify $expand=details to populate additional fields related to the resource or Specify - * $skipToken=<token> to populate the next page in the 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 all the Data Box Edge/Data Box Gateway devices in a resource group along with {@link PagedResponse} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, - String expand) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() 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.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listByResourceGroup(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, this.client.getApiVersion(), expand, accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/uploadCertificate") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> uploadCertificate(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("deviceName") String deviceName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") UploadCertificateRequest parameters, Context context); - /** - * Gets all the Data Box Edge/Data Box Gateway devices in a resource group. - * - * @param resourceGroupName The resource group name. - * @param expand Specify $expand=details to populate additional fields related to the resource or Specify - * $skipToken=<token> to populate the next page in the list. - * @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 all the Data Box Edge/Data Box Gateway devices in a resource group along with {@link PagedResponse} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, - String expand, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() 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.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByResourceGroup(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - this.client.getApiVersion(), expand, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/uploadCertificate") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response uploadCertificateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("deviceName") String deviceName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") UploadCertificateRequest parameters, Context context); - /** - * Gets all the Data Box Edge/Data Box Gateway devices in a resource group. - * - * @param resourceGroupName The resource group name. - * @param expand Specify $expand=details to populate additional fields related to the resource or Specify - * $skipToken=<token> to populate the next page in the 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 all the Data Box Edge/Data Box Gateway devices in a resource group as paginated response with - * {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync(String resourceGroupName, String expand) { - return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, expand), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); - } + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/updateSummary/default") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getUpdateSummary(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("deviceName") String deviceName, + @HeaderParam("Accept") String accept, Context context); - /** - * Gets all the Data Box Edge/Data Box Gateway devices in a resource group. - * - * @param resourceGroupName The resource group name. - * @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 all the Data Box Edge/Data Box Gateway devices in a resource group as paginated response with - * {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync(String resourceGroupName) { - final String expand = null; - return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, expand), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/updateSummary/default") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getUpdateSummarySync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("deviceName") String deviceName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listByResourceGroupNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listBySubscriptionNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); } /** - * Gets all the Data Box Edge/Data Box Gateway devices in a resource group. + * Gets the network settings of the specified Data Box Edge/Data Box Gateway device. * - * @param resourceGroupName The resource group name. - * @param expand Specify $expand=details to populate additional fields related to the resource or Specify - * $skipToken=<token> to populate the next page in the list. - * @param context The context to associate with this operation. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. * @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 all the Data Box Edge/Data Box Gateway devices in a resource group as paginated response with - * {@link PagedFlux}. + * @return the network settings of the specified Data Box Edge/Data Box Gateway device along with {@link Response} + * on successful completion of {@link Mono}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync(String resourceGroupName, String expand, - Context context) { - return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, expand, context), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getNetworkSettingsWithResponseAsync(String resourceGroupName, + String deviceName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getNetworkSettings(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, deviceName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Gets all the Data Box Edge/Data Box Gateway devices in a resource group. + * Gets the network settings of the specified Data Box Edge/Data Box Gateway device. * - * @param resourceGroupName The resource group name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. * @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 all the Data Box Edge/Data Box Gateway devices in a resource group as paginated response with - * {@link PagedIterable}. + * @return the network settings of the specified Data Box Edge/Data Box Gateway device on successful completion of + * {@link Mono}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName) { - final String expand = null; - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, expand)); + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getNetworkSettingsAsync(String resourceGroupName, String deviceName) { + return getNetworkSettingsWithResponseAsync(resourceGroupName, deviceName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Gets all the Data Box Edge/Data Box Gateway devices in a resource group. + * Gets the network settings of the specified Data Box Edge/Data Box Gateway device. * - * @param resourceGroupName The resource group name. - * @param expand Specify $expand=details to populate additional fields related to the resource or Specify - * $skipToken=<token> to populate the next page in the list. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. * @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 all the Data Box Edge/Data Box Gateway devices in a resource group as paginated response with - * {@link PagedIterable}. + * @return the network settings of the specified Data Box Edge/Data Box Gateway device along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName, String expand, + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getNetworkSettingsWithResponse(String resourceGroupName, String deviceName, Context context) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, expand, context)); + final String accept = "application/json"; + return service.getNetworkSettingsSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, deviceName, accept, context); } /** - * Gets the properties of the Data Box Edge/Data Box Gateway device. + * Gets the network settings of the specified Data Box Edge/Data Box Gateway device. * - * @param resourceGroupName The resource group name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. * @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 properties of the Data Box Edge/Data Box Gateway device along with {@link Response} on successful - * completion of {@link Mono}. + * @return the network settings of the specified Data Box Edge/Data Box Gateway device. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, - String deviceName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName 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 (deviceName == null) { - return Mono.error(new IllegalArgumentException("Parameter deviceName is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), resourceGroupName, - this.client.getSubscriptionId(), deviceName, this.client.getApiVersion(), accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + public NetworkSettingsInner getNetworkSettings(String resourceGroupName, String deviceName) { + return getNetworkSettingsWithResponse(resourceGroupName, deviceName, Context.NONE).getValue(); } /** * Gets the properties of the Data Box Edge/Data Box Gateway device. * - * @param resourceGroupName The resource group name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @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. @@ -580,32 +490,18 @@ private Mono> getByResourceGroupWithResponseAsy */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, - String deviceName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName 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 (deviceName == null) { - return Mono.error(new IllegalArgumentException("Parameter deviceName is required and cannot be null.")); - } + String deviceName) { final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.getByResourceGroup(this.client.getEndpoint(), resourceGroupName, this.client.getSubscriptionId(), - deviceName, this.client.getApiVersion(), accept, context); + return FluxUtil + .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, deviceName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Gets the properties of the Data Box Edge/Data Box Gateway device. * - * @param resourceGroupName The resource group name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -621,7 +517,7 @@ private Mono getByResourceGroupAsync(String resourceGrou /** * Gets the properties of the Data Box Edge/Data Box Gateway device. * - * @param resourceGroupName The resource group name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -632,13 +528,15 @@ private Mono getByResourceGroupAsync(String resourceGrou @ServiceMethod(returns = ReturnType.SINGLE) public Response getByResourceGroupWithResponse(String resourceGroupName, String deviceName, Context context) { - return getByResourceGroupWithResponseAsync(resourceGroupName, deviceName, context).block(); + final String accept = "application/json"; + return service.getByResourceGroupSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, deviceName, accept, context); } /** * Gets the properties of the Data Box Edge/Data Box Gateway device. * - * @param resourceGroupName The resource group name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -653,8 +551,8 @@ public DataBoxEdgeDeviceInner getByResourceGroup(String resourceGroupName, Strin /** * Creates or updates a Data Box Edge/Data Box Gateway resource. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param resourceGroupName The resource group name. * @param dataBoxEdgeDevice The resource object. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -662,302 +560,206 @@ public DataBoxEdgeDeviceInner getByResourceGroup(String resourceGroupName, Strin * @return the Data Box Edge/Gateway device along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync(String deviceName, - String resourceGroupName, DataBoxEdgeDeviceInner dataBoxEdgeDevice) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (deviceName == null) { - return Mono.error(new IllegalArgumentException("Parameter deviceName 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 (dataBoxEdgeDevice == null) { - return Mono - .error(new IllegalArgumentException("Parameter dataBoxEdgeDevice is required and cannot be null.")); - } else { - dataBoxEdgeDevice.validate(); - } + private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, + String deviceName, DataBoxEdgeDeviceInner dataBoxEdgeDevice) { + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), deviceName, - this.client.getSubscriptionId(), resourceGroupName, this.client.getApiVersion(), dataBoxEdgeDevice, - accept, context)) + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, deviceName, contentType, accept, dataBoxEdgeDevice, + context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Creates or updates a Data Box Edge/Data Box Gateway resource. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param resourceGroupName The resource group name. * @param dataBoxEdgeDevice The resource object. - * @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 Data Box Edge/Gateway device along with {@link Response} on successful completion of {@link Mono}. + * @return the Data Box Edge/Gateway device on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync(String deviceName, - String resourceGroupName, DataBoxEdgeDeviceInner dataBoxEdgeDevice, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (deviceName == null) { - return Mono.error(new IllegalArgumentException("Parameter deviceName 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 (dataBoxEdgeDevice == null) { - return Mono - .error(new IllegalArgumentException("Parameter dataBoxEdgeDevice is required and cannot be null.")); - } else { - dataBoxEdgeDevice.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.createOrUpdate(this.client.getEndpoint(), deviceName, this.client.getSubscriptionId(), - resourceGroupName, this.client.getApiVersion(), dataBoxEdgeDevice, accept, context); - } - - /** - * Creates or updates a Data Box Edge/Data Box Gateway resource. - * - * @param deviceName The device name. - * @param resourceGroupName The resource group name. - * @param dataBoxEdgeDevice The resource object. - * @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 the Data Box Edge/Gateway device. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, DataBoxEdgeDeviceInner> beginCreateOrUpdateAsync( - String deviceName, String resourceGroupName, DataBoxEdgeDeviceInner dataBoxEdgeDevice) { - Mono>> mono - = createOrUpdateWithResponseAsync(deviceName, resourceGroupName, dataBoxEdgeDevice); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), DataBoxEdgeDeviceInner.class, DataBoxEdgeDeviceInner.class, - this.client.getContext()); + private Mono createOrUpdateAsync(String resourceGroupName, String deviceName, + DataBoxEdgeDeviceInner dataBoxEdgeDevice) { + return createOrUpdateWithResponseAsync(resourceGroupName, deviceName, dataBoxEdgeDevice) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * Creates or updates a Data Box Edge/Data Box Gateway resource. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param resourceGroupName The resource group name. * @param dataBoxEdgeDevice The resource object. * @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 PollerFlux} for polling of the Data Box Edge/Gateway device. + * @return the Data Box Edge/Gateway device along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, DataBoxEdgeDeviceInner> beginCreateOrUpdateAsync( - String deviceName, String resourceGroupName, DataBoxEdgeDeviceInner dataBoxEdgeDevice, Context context) { - context = this.client.mergeContext(context); - Mono>> mono - = createOrUpdateWithResponseAsync(deviceName, resourceGroupName, dataBoxEdgeDevice, context); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), DataBoxEdgeDeviceInner.class, DataBoxEdgeDeviceInner.class, context); + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse(String resourceGroupName, String deviceName, + DataBoxEdgeDeviceInner dataBoxEdgeDevice, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, deviceName, contentType, accept, dataBoxEdgeDevice, + context); } /** * Creates or updates a Data Box Edge/Data Box Gateway resource. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param resourceGroupName The resource group name. * @param dataBoxEdgeDevice The resource object. * @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 SyncPoller} for polling of the Data Box Edge/Gateway device. + * @return the Data Box Edge/Gateway device. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, DataBoxEdgeDeviceInner> beginCreateOrUpdate(String deviceName, - String resourceGroupName, DataBoxEdgeDeviceInner dataBoxEdgeDevice) { - return this.beginCreateOrUpdateAsync(deviceName, resourceGroupName, dataBoxEdgeDevice).getSyncPoller(); + @ServiceMethod(returns = ReturnType.SINGLE) + public DataBoxEdgeDeviceInner createOrUpdate(String resourceGroupName, String deviceName, + DataBoxEdgeDeviceInner dataBoxEdgeDevice) { + return createOrUpdateWithResponse(resourceGroupName, deviceName, dataBoxEdgeDevice, Context.NONE).getValue(); } /** - * Creates or updates a Data Box Edge/Data Box Gateway resource. + * Modifies a Data Box Edge/Data Box Gateway resource. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param resourceGroupName The resource group name. - * @param dataBoxEdgeDevice The resource object. - * @param context The context to associate with this operation. + * @param parameters The resource parameters. * @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 SyncPoller} for polling of the Data Box Edge/Gateway device. + * @return the Data Box Edge/Gateway device along with {@link Response} on successful completion of {@link Mono}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, DataBoxEdgeDeviceInner> beginCreateOrUpdate(String deviceName, - String resourceGroupName, DataBoxEdgeDeviceInner dataBoxEdgeDevice, Context context) { - return this.beginCreateOrUpdateAsync(deviceName, resourceGroupName, dataBoxEdgeDevice, context).getSyncPoller(); + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync(String resourceGroupName, String deviceName, + DataBoxEdgeDevicePatch parameters) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, deviceName, contentType, accept, parameters, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Creates or updates a Data Box Edge/Data Box Gateway resource. + * Modifies a Data Box Edge/Data Box Gateway resource. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param resourceGroupName The resource group name. - * @param dataBoxEdgeDevice The resource object. + * @param parameters The resource parameters. * @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 Data Box Edge/Gateway device on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String deviceName, String resourceGroupName, - DataBoxEdgeDeviceInner dataBoxEdgeDevice) { - return beginCreateOrUpdateAsync(deviceName, resourceGroupName, dataBoxEdgeDevice).last() - .flatMap(this.client::getLroFinalResultOrError); + private Mono updateAsync(String resourceGroupName, String deviceName, + DataBoxEdgeDevicePatch parameters) { + return updateWithResponseAsync(resourceGroupName, deviceName, parameters) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Creates or updates a Data Box Edge/Data Box Gateway resource. + * Modifies a Data Box Edge/Data Box Gateway resource. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param resourceGroupName The resource group name. - * @param dataBoxEdgeDevice The resource object. + * @param parameters The resource parameters. * @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 Data Box Edge/Gateway device on successful completion of {@link Mono}. + * @return the Data Box Edge/Gateway device along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String deviceName, String resourceGroupName, - DataBoxEdgeDeviceInner dataBoxEdgeDevice, Context context) { - return beginCreateOrUpdateAsync(deviceName, resourceGroupName, dataBoxEdgeDevice, context).last() - .flatMap(this.client::getLroFinalResultOrError); + public Response updateWithResponse(String resourceGroupName, String deviceName, + DataBoxEdgeDevicePatch parameters, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.updateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, deviceName, contentType, accept, parameters, context); } /** - * Creates or updates a Data Box Edge/Data Box Gateway resource. + * Modifies a Data Box Edge/Data Box Gateway resource. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param resourceGroupName The resource group name. - * @param dataBoxEdgeDevice The resource object. + * @param parameters The resource parameters. * @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 Data Box Edge/Gateway device. */ @ServiceMethod(returns = ReturnType.SINGLE) - public DataBoxEdgeDeviceInner createOrUpdate(String deviceName, String resourceGroupName, - DataBoxEdgeDeviceInner dataBoxEdgeDevice) { - return createOrUpdateAsync(deviceName, resourceGroupName, dataBoxEdgeDevice).block(); + public DataBoxEdgeDeviceInner update(String resourceGroupName, String deviceName, + DataBoxEdgeDevicePatch parameters) { + return updateWithResponse(resourceGroupName, deviceName, parameters, Context.NONE).getValue(); } /** - * Creates or updates a Data Box Edge/Data Box Gateway resource. + * Deletes the Data Box Edge/Data Box Gateway device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param resourceGroupName The resource group name. - * @param dataBoxEdgeDevice The resource object. - * @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 Data Box Edge/Gateway device. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public DataBoxEdgeDeviceInner createOrUpdate(String deviceName, String resourceGroupName, - DataBoxEdgeDeviceInner dataBoxEdgeDevice, Context context) { - return createOrUpdateAsync(deviceName, resourceGroupName, dataBoxEdgeDevice, context).block(); + private Mono>> deleteWithResponseAsync(String resourceGroupName, String deviceName) { + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, deviceName, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Deletes the Data Box Edge/Data Box Gateway device. * - * @param resourceGroupName The resource group name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. * @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}. + * @return the response body along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync(String resourceGroupName, String deviceName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName 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 (deviceName == null) { - return Mono.error(new IllegalArgumentException("Parameter deviceName is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.delete(this.client.getEndpoint(), resourceGroupName, - this.client.getSubscriptionId(), deviceName, this.client.getApiVersion(), accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + private Response deleteWithResponse(String resourceGroupName, String deviceName) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, deviceName, Context.NONE); } /** * Deletes the Data Box Edge/Data Box Gateway device. * - * @param resourceGroupName The resource group name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. * @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}. + * @return the response body along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync(String resourceGroupName, String deviceName, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName 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 (deviceName == null) { - return Mono.error(new IllegalArgumentException("Parameter deviceName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), resourceGroupName, this.client.getSubscriptionId(), deviceName, - this.client.getApiVersion(), accept, context); + private Response deleteWithResponse(String resourceGroupName, String deviceName, Context context) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, deviceName, context); } /** * Deletes the Data Box Edge/Data Box Gateway device. * - * @param resourceGroupName The resource group name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -974,380 +776,438 @@ private PollerFlux, Void> beginDeleteAsync(String resourceGroup /** * Deletes the Data Box Edge/Data Box Gateway device. * - * @param resourceGroupName The resource group name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @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 SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String deviceName) { + Response response = deleteWithResponse(resourceGroupName, deviceName); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); + } + + /** + * Deletes the Data Box Edge/Data Box Gateway device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. * @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 PollerFlux} for polling of long-running operation. + * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String deviceName, + public SyncPoller, Void> beginDelete(String resourceGroupName, String deviceName, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = deleteWithResponseAsync(resourceGroupName, deviceName, context); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - context); + Response response = deleteWithResponse(resourceGroupName, deviceName, context); + return this.client.getLroResult(response, Void.class, Void.class, context); + } + + /** + * Deletes the Data Box Edge/Data Box Gateway device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @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 deleteAsync(String resourceGroupName, String deviceName) { + return beginDeleteAsync(resourceGroupName, deviceName).last().flatMap(this.client::getLroFinalResultOrError); } /** * Deletes the Data Box Edge/Data Box Gateway device. * - * @param resourceGroupName The resource group name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. * @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 SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete(String resourceGroupName, String deviceName) { - return this.beginDeleteAsync(resourceGroupName, deviceName).getSyncPoller(); + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String deviceName) { + beginDelete(resourceGroupName, deviceName).getFinalResult(); + } + + /** + * Deletes the Data Box Edge/Data Box Gateway device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String deviceName, Context context) { + beginDelete(resourceGroupName, deviceName, context).getFinalResult(); + } + + /** + * Gets all the Data Box Edge/Data Box Gateway devices in a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param expand Specify $expand=details to populate additional fields related to the resource or Specify + * $skipToken=<token> to populate the next page in the 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 all the Data Box Edge/Data Box Gateway devices in a resource group along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, + String expand) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, expand, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets all the Data Box Edge/Data Box Gateway devices in a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param expand Specify $expand=details to populate additional fields related to the resource or Specify + * $skipToken=<token> to populate the next page in the 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 all the Data Box Edge/Data Box Gateway devices in a resource group as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, String expand) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, expand), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * Gets all the Data Box Edge/Data Box Gateway devices in a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 all the Data Box Edge/Data Box Gateway devices in a resource group as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + final String expand = null; + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, expand), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * Gets all the Data Box Edge/Data Box Gateway devices in a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param expand Specify $expand=details to populate additional fields related to the resource or Specify + * $skipToken=<token> to populate the next page in the 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 all the Data Box Edge/Data Box Gateway devices in a resource group along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByResourceGroupSinglePage(String resourceGroupName, + String expand) { + final String accept = "application/json"; + Response res + = service.listByResourceGroupSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, expand, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** - * Deletes the Data Box Edge/Data Box Gateway device. + * Gets all the Data Box Edge/Data Box Gateway devices in a resource group. * - * @param resourceGroupName The resource group name. - * @param deviceName The device name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param expand Specify $expand=details to populate additional fields related to the resource or Specify + * $skipToken=<token> to populate the next page in the list. * @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 SyncPoller} for polling of long-running operation. + * @return all the Data Box Edge/Data Box Gateway devices in a resource group along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete(String resourceGroupName, String deviceName, + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByResourceGroupSinglePage(String resourceGroupName, String expand, Context context) { - return this.beginDeleteAsync(resourceGroupName, deviceName, context).getSyncPoller(); + final String accept = "application/json"; + Response res = service.listByResourceGroupSync(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, expand, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** - * Deletes the Data Box Edge/Data Box Gateway device. + * Gets all the Data Box Edge/Data Box Gateway devices in a resource group. * - * @param resourceGroupName The resource group name. - * @param deviceName The device name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @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. + * @return all the Data Box Edge/Data Box Gateway devices in a resource group as paginated response with + * {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String deviceName) { - return beginDeleteAsync(resourceGroupName, deviceName).last().flatMap(this.client::getLroFinalResultOrError); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + final String expand = null; + return new PagedIterable<>(() -> listByResourceGroupSinglePage(resourceGroupName, expand), + nextLink -> listByResourceGroupNextSinglePage(nextLink)); } /** - * Deletes the Data Box Edge/Data Box Gateway device. + * Gets all the Data Box Edge/Data Box Gateway devices in a resource group. * - * @param resourceGroupName The resource group name. - * @param deviceName The device name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param expand Specify $expand=details to populate additional fields related to the resource or Specify + * $skipToken=<token> to populate the next page in the list. * @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 A {@link Mono} that completes when a successful response is received. + * @return all the Data Box Edge/Data Box Gateway devices in a resource group as paginated response with + * {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String deviceName, Context context) { - return beginDeleteAsync(resourceGroupName, deviceName, context).last() - .flatMap(this.client::getLroFinalResultOrError); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, String expand, + Context context) { + return new PagedIterable<>(() -> listByResourceGroupSinglePage(resourceGroupName, expand, context), + nextLink -> listByResourceGroupNextSinglePage(nextLink, context)); } /** - * Deletes the Data Box Edge/Data Box Gateway device. + * Gets all the Data Box Edge/Data Box Gateway devices in a subscription. * - * @param resourceGroupName The resource group name. - * @param deviceName The device name. + * @param expand Specify $expand=details to populate additional fields related to the resource or Specify + * $skipToken=<token> to populate the next page in the 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 all the Data Box Edge/Data Box Gateway devices in a subscription along with {@link PagedResponse} on + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String deviceName) { - deleteAsync(resourceGroupName, deviceName).block(); + private Mono> listSinglePageAsync(String expand) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), expand, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Deletes the Data Box Edge/Data Box Gateway device. + * Gets all the Data Box Edge/Data Box Gateway devices in a subscription. * - * @param resourceGroupName The resource group name. - * @param deviceName The device name. - * @param context The context to associate with this operation. + * @param expand Specify $expand=details to populate additional fields related to the resource or Specify + * $skipToken=<token> to populate the next page in the 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 all the Data Box Edge/Data Box Gateway devices in a subscription as paginated response with + * {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String deviceName, Context context) { - deleteAsync(resourceGroupName, deviceName, context).block(); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String expand) { + return new PagedFlux<>(() -> listSinglePageAsync(expand), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); } /** - * Modifies a Data Box Edge/Data Box Gateway resource. + * Gets all the Data Box Edge/Data Box Gateway devices in a subscription. * - * @param deviceName The device name. - * @param resourceGroupName The resource group name. - * @param parameters The resource parameters. - * @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 Data Box Edge/Gateway device along with {@link Response} on successful completion of {@link Mono}. + * @return all the Data Box Edge/Data Box Gateway devices in a subscription as paginated response with + * {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync(String deviceName, String resourceGroupName, - DataBoxEdgeDevicePatch parameters) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (deviceName == null) { - return Mono.error(new IllegalArgumentException("Parameter deviceName 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 (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.update(this.client.getEndpoint(), deviceName, this.client.getSubscriptionId(), - resourceGroupName, this.client.getApiVersion(), parameters, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + final String expand = null; + return new PagedFlux<>(() -> listSinglePageAsync(expand), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); } /** - * Modifies a Data Box Edge/Data Box Gateway resource. + * Gets all the Data Box Edge/Data Box Gateway devices in a subscription. * - * @param deviceName The device name. - * @param resourceGroupName The resource group name. - * @param parameters The resource parameters. - * @param context The context to associate with this operation. + * @param expand Specify $expand=details to populate additional fields related to the resource or Specify + * $skipToken=<token> to populate the next page in the 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 the Data Box Edge/Gateway device along with {@link Response} on successful completion of {@link Mono}. + * @return all the Data Box Edge/Data Box Gateway devices in a subscription along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync(String deviceName, String resourceGroupName, - DataBoxEdgeDevicePatch parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (deviceName == null) { - return Mono.error(new IllegalArgumentException("Parameter deviceName 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 (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } + private PagedResponse listSinglePage(String expand) { final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.update(this.client.getEndpoint(), deviceName, this.client.getSubscriptionId(), resourceGroupName, - this.client.getApiVersion(), parameters, accept, context); + Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), expand, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** - * Modifies a Data Box Edge/Data Box Gateway resource. + * Gets all the Data Box Edge/Data Box Gateway devices in a subscription. * - * @param deviceName The device name. - * @param resourceGroupName The resource group name. - * @param parameters The resource parameters. + * @param expand Specify $expand=details to populate additional fields related to the resource or Specify + * $skipToken=<token> to populate the next page in the list. + * @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 Data Box Edge/Gateway device on successful completion of {@link Mono}. + * @return all the Data Box Edge/Data Box Gateway devices in a subscription along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync(String deviceName, String resourceGroupName, - DataBoxEdgeDevicePatch parameters) { - return updateWithResponseAsync(deviceName, resourceGroupName, parameters) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + private PagedResponse listSinglePage(String expand, Context context) { + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), expand, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** - * Modifies a Data Box Edge/Data Box Gateway resource. + * Gets all the Data Box Edge/Data Box Gateway devices in a subscription. * - * @param deviceName The device name. - * @param resourceGroupName The resource group name. - * @param parameters The resource parameters. - * @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 Data Box Edge/Gateway device along with {@link Response}. + * @return all the Data Box Edge/Data Box Gateway devices in a subscription as paginated response with + * {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateWithResponse(String deviceName, String resourceGroupName, - DataBoxEdgeDevicePatch parameters, Context context) { - return updateWithResponseAsync(deviceName, resourceGroupName, parameters, context).block(); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + final String expand = null; + return new PagedIterable<>(() -> listSinglePage(expand), + nextLink -> listBySubscriptionNextSinglePage(nextLink)); } /** - * Modifies a Data Box Edge/Data Box Gateway resource. + * Gets all the Data Box Edge/Data Box Gateway devices in a subscription. * - * @param deviceName The device name. - * @param resourceGroupName The resource group name. - * @param parameters The resource parameters. + * @param expand Specify $expand=details to populate additional fields related to the resource or Specify + * $skipToken=<token> to populate the next page in the list. + * @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 Data Box Edge/Gateway device. + * @return all the Data Box Edge/Data Box Gateway devices in a subscription as paginated response with + * {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public DataBoxEdgeDeviceInner update(String deviceName, String resourceGroupName, - DataBoxEdgeDevicePatch parameters) { - return updateWithResponse(deviceName, resourceGroupName, parameters, Context.NONE).getValue(); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String expand, Context context) { + return new PagedIterable<>(() -> listSinglePage(expand, context), + nextLink -> listBySubscriptionNextSinglePage(nextLink, context)); } /** * Downloads the updates on a Data Box Edge/Data Box Gateway device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param resourceGroupName The resource group name. * @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>> downloadUpdatesWithResponseAsync(String deviceName, - String resourceGroupName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (deviceName == null) { - return Mono.error(new IllegalArgumentException("Parameter deviceName 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.")); - } - final String accept = "application/json"; + private Mono>> downloadUpdatesWithResponseAsync(String resourceGroupName, + String deviceName) { return FluxUtil - .withContext(context -> service.downloadUpdates(this.client.getEndpoint(), deviceName, - this.client.getSubscriptionId(), resourceGroupName, this.client.getApiVersion(), accept, context)) + .withContext(context -> service.downloadUpdates(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, deviceName, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Downloads the updates on a Data Box Edge/Data Box Gateway device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param resourceGroupName The resource group name. - * @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}. + * @return the response body along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> downloadUpdatesWithResponseAsync(String deviceName, - String resourceGroupName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (deviceName == null) { - return Mono.error(new IllegalArgumentException("Parameter deviceName 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.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.downloadUpdates(this.client.getEndpoint(), deviceName, this.client.getSubscriptionId(), - resourceGroupName, this.client.getApiVersion(), accept, context); + private Response downloadUpdatesWithResponse(String resourceGroupName, String deviceName) { + return service.downloadUpdatesSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, deviceName, Context.NONE); } /** * Downloads the updates on a Data Box Edge/Data Box Gateway device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param resourceGroupName The resource group name. + * @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 PollerFlux} for polling of long-running operation. + * @return the response body along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDownloadUpdatesAsync(String deviceName, String resourceGroupName) { - Mono>> mono = downloadUpdatesWithResponseAsync(deviceName, resourceGroupName); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - this.client.getContext()); + @ServiceMethod(returns = ReturnType.SINGLE) + private Response downloadUpdatesWithResponse(String resourceGroupName, String deviceName, + Context context) { + return service.downloadUpdatesSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, deviceName, context); } /** * Downloads the updates on a Data Box Edge/Data Box Gateway device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param resourceGroupName The resource group name. - * @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 PollerFlux} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDownloadUpdatesAsync(String deviceName, String resourceGroupName, - Context context) { - context = this.client.mergeContext(context); - Mono>> mono - = downloadUpdatesWithResponseAsync(deviceName, resourceGroupName, context); + private PollerFlux, Void> beginDownloadUpdatesAsync(String resourceGroupName, String deviceName) { + Mono>> mono = downloadUpdatesWithResponseAsync(resourceGroupName, deviceName); return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - context); + this.client.getContext()); } /** * Downloads the updates on a Data Box Edge/Data Box Gateway device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param resourceGroupName The resource group name. * @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 SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDownloadUpdates(String deviceName, String resourceGroupName) { - return this.beginDownloadUpdatesAsync(deviceName, resourceGroupName).getSyncPoller(); + public SyncPoller, Void> beginDownloadUpdates(String resourceGroupName, String deviceName) { + Response response = downloadUpdatesWithResponse(resourceGroupName, deviceName); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); } /** * Downloads the updates on a Data Box Edge/Data Box Gateway device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param resourceGroupName The resource group name. * @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. @@ -1355,645 +1215,443 @@ public SyncPoller, Void> beginDownloadUpdates(String deviceName * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDownloadUpdates(String deviceName, String resourceGroupName, + public SyncPoller, Void> beginDownloadUpdates(String resourceGroupName, String deviceName, Context context) { - return this.beginDownloadUpdatesAsync(deviceName, resourceGroupName, context).getSyncPoller(); - } - - /** - * Downloads the updates on a Data Box Edge/Data Box Gateway device. - * - * @param deviceName The device name. - * @param resourceGroupName The resource group name. - * @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 downloadUpdatesAsync(String deviceName, String resourceGroupName) { - return beginDownloadUpdatesAsync(deviceName, resourceGroupName).last() - .flatMap(this.client::getLroFinalResultOrError); + Response response = downloadUpdatesWithResponse(resourceGroupName, deviceName, context); + return this.client.getLroResult(response, Void.class, Void.class, context); } /** * Downloads the updates on a Data Box Edge/Data Box Gateway device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param resourceGroupName The resource group name. - * @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 A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono downloadUpdatesAsync(String deviceName, String resourceGroupName, Context context) { - return beginDownloadUpdatesAsync(deviceName, resourceGroupName, context).last() + private Mono downloadUpdatesAsync(String resourceGroupName, String deviceName) { + return beginDownloadUpdatesAsync(resourceGroupName, deviceName).last() .flatMap(this.client::getLroFinalResultOrError); } /** * Downloads the updates on a Data Box Edge/Data Box Gateway device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param resourceGroupName The resource group name. * @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 downloadUpdates(String deviceName, String resourceGroupName) { - downloadUpdatesAsync(deviceName, resourceGroupName).block(); + public void downloadUpdates(String resourceGroupName, String deviceName) { + beginDownloadUpdates(resourceGroupName, deviceName).getFinalResult(); } /** * Downloads the updates on a Data Box Edge/Data Box Gateway device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param resourceGroupName The resource group name. * @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. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void downloadUpdates(String deviceName, String resourceGroupName, Context context) { - downloadUpdatesAsync(deviceName, resourceGroupName, context).block(); + public void downloadUpdates(String resourceGroupName, String deviceName, Context context) { + beginDownloadUpdates(resourceGroupName, deviceName, context).getFinalResult(); } /** - * Gets additional information for the specified Data Box Edge/Data Box Gateway device. + * Generates certificate for activation key. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param resourceGroupName The resource group name. * @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 additional information for the specified Data Box Edge/Data Box Gateway device along with - * {@link Response} on successful completion of {@link Mono}. + * @return used in activation key generation flow along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> - getExtendedInformationWithResponseAsync(String deviceName, String resourceGroupName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (deviceName == null) { - return Mono.error(new IllegalArgumentException("Parameter deviceName 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.")); - } + private Mono> generateCertificateWithResponseAsync(String resourceGroupName, + String deviceName) { final String accept = "application/json"; return FluxUtil - .withContext(context -> service.getExtendedInformation(this.client.getEndpoint(), deviceName, - this.client.getSubscriptionId(), resourceGroupName, this.client.getApiVersion(), accept, context)) + .withContext(context -> service.generateCertificate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, deviceName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Gets additional information for the specified Data Box Edge/Data Box Gateway device. - * - * @param deviceName The device name. - * @param resourceGroupName The resource group name. - * @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 additional information for the specified Data Box Edge/Data Box Gateway device along with - * {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> - getExtendedInformationWithResponseAsync(String deviceName, String resourceGroupName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (deviceName == null) { - return Mono.error(new IllegalArgumentException("Parameter deviceName 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.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.getExtendedInformation(this.client.getEndpoint(), deviceName, this.client.getSubscriptionId(), - resourceGroupName, this.client.getApiVersion(), accept, context); - } - - /** - * Gets additional information for the specified Data Box Edge/Data Box Gateway device. + * Generates certificate for activation key. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param resourceGroupName The resource group name. * @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 additional information for the specified Data Box Edge/Data Box Gateway device on successful completion - * of {@link Mono}. + * @return used in activation key generation flow on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getExtendedInformationAsync(String deviceName, - String resourceGroupName) { - return getExtendedInformationWithResponseAsync(deviceName, resourceGroupName) + private Mono generateCertificateAsync(String resourceGroupName, String deviceName) { + return generateCertificateWithResponseAsync(resourceGroupName, deviceName) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Gets additional information for the specified Data Box Edge/Data Box Gateway device. + * Generates certificate for activation key. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param resourceGroupName The resource group name. * @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 additional information for the specified Data Box Edge/Data Box Gateway device along with - * {@link Response}. + * @return used in activation key generation flow along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getExtendedInformationWithResponse(String deviceName, - String resourceGroupName, Context context) { - return getExtendedInformationWithResponseAsync(deviceName, resourceGroupName, context).block(); + public Response generateCertificateWithResponse(String resourceGroupName, + String deviceName, Context context) { + final String accept = "application/json"; + return service.generateCertificateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, deviceName, accept, context); } /** - * Gets additional information for the specified Data Box Edge/Data Box Gateway device. + * Generates certificate for activation key. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param resourceGroupName The resource group name. * @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 additional information for the specified Data Box Edge/Data Box Gateway device. + * @return used in activation key generation flow. */ @ServiceMethod(returns = ReturnType.SINGLE) - public DataBoxEdgeDeviceExtendedInfoInner getExtendedInformation(String deviceName, String resourceGroupName) { - return getExtendedInformationWithResponse(deviceName, resourceGroupName, Context.NONE).getValue(); + public GenerateCertResponseInner generateCertificate(String resourceGroupName, String deviceName) { + return generateCertificateWithResponse(resourceGroupName, deviceName, Context.NONE).getValue(); } /** - * Installs the updates on the Data Box Edge/Data Box Gateway device. + * Gets additional information for the specified Azure Stack Edge/Data Box Gateway device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param resourceGroupName The resource group name. * @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}. + * @return additional information for the specified Azure Stack Edge/Data Box Gateway device along with + * {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> installUpdatesWithResponseAsync(String deviceName, - String resourceGroupName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (deviceName == null) { - return Mono.error(new IllegalArgumentException("Parameter deviceName 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.")); - } + private Mono> + getExtendedInformationWithResponseAsync(String resourceGroupName, String deviceName) { final String accept = "application/json"; return FluxUtil - .withContext(context -> service.installUpdates(this.client.getEndpoint(), deviceName, - this.client.getSubscriptionId(), resourceGroupName, this.client.getApiVersion(), accept, context)) + .withContext( + context -> service.getExtendedInformation(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, deviceName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Installs the updates on the Data Box Edge/Data Box Gateway device. + * Gets additional information for the specified Azure Stack Edge/Data Box Gateway device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param resourceGroupName The resource group name. - * @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}. + * @return additional information for the specified Azure Stack Edge/Data Box Gateway device on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> installUpdatesWithResponseAsync(String deviceName, - String resourceGroupName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (deviceName == null) { - return Mono.error(new IllegalArgumentException("Parameter deviceName 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.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.installUpdates(this.client.getEndpoint(), deviceName, this.client.getSubscriptionId(), - resourceGroupName, this.client.getApiVersion(), accept, context); - } - - /** - * Installs the updates on the Data Box Edge/Data Box Gateway device. - * - * @param deviceName The device name. - * @param resourceGroupName The resource group name. - * @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 long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginInstallUpdatesAsync(String deviceName, String resourceGroupName) { - Mono>> mono = installUpdatesWithResponseAsync(deviceName, resourceGroupName); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - this.client.getContext()); + private Mono getExtendedInformationAsync(String resourceGroupName, + String deviceName) { + return getExtendedInformationWithResponseAsync(resourceGroupName, deviceName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Installs the updates on the Data Box Edge/Data Box Gateway device. + * Gets additional information for the specified Azure Stack Edge/Data Box Gateway device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param resourceGroupName The resource group name. * @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 PollerFlux} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginInstallUpdatesAsync(String deviceName, String resourceGroupName, - Context context) { - context = this.client.mergeContext(context); - Mono>> mono = installUpdatesWithResponseAsync(deviceName, resourceGroupName, context); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - context); - } - - /** - * Installs the updates on the Data Box Edge/Data Box Gateway device. - * - * @param deviceName The device name. - * @param resourceGroupName The resource group name. - * @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 SyncPoller} for polling of long-running operation. + * @return additional information for the specified Azure Stack Edge/Data Box Gateway device along with + * {@link Response}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginInstallUpdates(String deviceName, String resourceGroupName) { - return this.beginInstallUpdatesAsync(deviceName, resourceGroupName).getSyncPoller(); + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getExtendedInformationWithResponse(String resourceGroupName, + String deviceName, Context context) { + final String accept = "application/json"; + return service.getExtendedInformationSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, deviceName, accept, context); } /** - * Installs the updates on the Data Box Edge/Data Box Gateway device. + * Gets additional information for the specified Azure Stack Edge/Data Box Gateway device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param resourceGroupName The resource group name. - * @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 SyncPoller} for polling of long-running operation. + * @return additional information for the specified Azure Stack Edge/Data Box Gateway device. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginInstallUpdates(String deviceName, String resourceGroupName, - Context context) { - return this.beginInstallUpdatesAsync(deviceName, resourceGroupName, context).getSyncPoller(); + @ServiceMethod(returns = ReturnType.SINGLE) + public DataBoxEdgeDeviceExtendedInfoInner getExtendedInformation(String resourceGroupName, String deviceName) { + return getExtendedInformationWithResponse(resourceGroupName, deviceName, Context.NONE).getValue(); } /** * Installs the updates on the Data Box Edge/Data Box Gateway device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param resourceGroupName The resource group name. * @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. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono installUpdatesAsync(String deviceName, String resourceGroupName) { - return beginInstallUpdatesAsync(deviceName, resourceGroupName).last() - .flatMap(this.client::getLroFinalResultOrError); + private Mono>> installUpdatesWithResponseAsync(String resourceGroupName, + String deviceName) { + return FluxUtil + .withContext(context -> service.installUpdates(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, deviceName, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Installs the updates on the Data Box Edge/Data Box Gateway device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param resourceGroupName The resource group name. - * @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 A {@link Mono} that completes when a successful response is received. + * @return the response body along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono installUpdatesAsync(String deviceName, String resourceGroupName, Context context) { - return beginInstallUpdatesAsync(deviceName, resourceGroupName, context).last() - .flatMap(this.client::getLroFinalResultOrError); + private Response installUpdatesWithResponse(String resourceGroupName, String deviceName) { + return service.installUpdatesSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, deviceName, Context.NONE); } /** * Installs the updates on the Data Box Edge/Data Box Gateway device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param resourceGroupName The resource group name. + * @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 body along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void installUpdates(String deviceName, String resourceGroupName) { - installUpdatesAsync(deviceName, resourceGroupName).block(); + private Response installUpdatesWithResponse(String resourceGroupName, String deviceName, + Context context) { + return service.installUpdatesSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, deviceName, context); } /** * Installs the updates on the Data Box Edge/Data Box Gateway device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param resourceGroupName The resource group name. - * @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 PollerFlux} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void installUpdates(String deviceName, String resourceGroupName, Context context) { - installUpdatesAsync(deviceName, resourceGroupName, context).block(); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginInstallUpdatesAsync(String resourceGroupName, String deviceName) { + Mono>> mono = installUpdatesWithResponseAsync(resourceGroupName, deviceName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); } /** - * Gets the network settings of the specified Data Box Edge/Data Box Gateway device. + * Installs the updates on the Data Box Edge/Data Box Gateway device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param resourceGroupName The resource group name. * @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 network settings of the specified Data Box Edge/Data Box Gateway device along with {@link Response} - * on successful completion of {@link Mono}. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getNetworkSettingsWithResponseAsync(String deviceName, - String resourceGroupName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (deviceName == null) { - return Mono.error(new IllegalArgumentException("Parameter deviceName 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.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.getNetworkSettings(this.client.getEndpoint(), deviceName, - this.client.getSubscriptionId(), resourceGroupName, this.client.getApiVersion(), accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginInstallUpdates(String resourceGroupName, String deviceName) { + Response response = installUpdatesWithResponse(resourceGroupName, deviceName); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); } /** - * Gets the network settings of the specified Data Box Edge/Data Box Gateway device. + * Installs the updates on the Data Box Edge/Data Box Gateway device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param resourceGroupName The resource group name. * @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 network settings of the specified Data Box Edge/Data Box Gateway device along with {@link Response} - * on successful completion of {@link Mono}. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getNetworkSettingsWithResponseAsync(String deviceName, - String resourceGroupName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (deviceName == null) { - return Mono.error(new IllegalArgumentException("Parameter deviceName 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.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.getNetworkSettings(this.client.getEndpoint(), deviceName, this.client.getSubscriptionId(), - resourceGroupName, this.client.getApiVersion(), accept, context); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginInstallUpdates(String resourceGroupName, String deviceName, + Context context) { + Response response = installUpdatesWithResponse(resourceGroupName, deviceName, context); + return this.client.getLroResult(response, Void.class, Void.class, context); } /** - * Gets the network settings of the specified Data Box Edge/Data Box Gateway device. + * Installs the updates on the Data Box Edge/Data Box Gateway device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param resourceGroupName The resource group name. * @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 network settings of the specified Data Box Edge/Data Box Gateway device on successful completion of - * {@link Mono}. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getNetworkSettingsAsync(String deviceName, String resourceGroupName) { - return getNetworkSettingsWithResponseAsync(deviceName, resourceGroupName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + private Mono installUpdatesAsync(String resourceGroupName, String deviceName) { + return beginInstallUpdatesAsync(resourceGroupName, deviceName).last() + .flatMap(this.client::getLroFinalResultOrError); } /** - * Gets the network settings of the specified Data Box Edge/Data Box Gateway device. + * Installs the updates on the Data Box Edge/Data Box Gateway device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param resourceGroupName The resource group name. - * @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 network settings of the specified Data Box Edge/Data Box Gateway device along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getNetworkSettingsWithResponse(String deviceName, String resourceGroupName, - Context context) { - return getNetworkSettingsWithResponseAsync(deviceName, resourceGroupName, context).block(); + public void installUpdates(String resourceGroupName, String deviceName) { + beginInstallUpdates(resourceGroupName, deviceName).getFinalResult(); } /** - * Gets the network settings of the specified Data Box Edge/Data Box Gateway device. + * Installs the updates on the Data Box Edge/Data Box Gateway device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param resourceGroupName The resource group name. + * @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 network settings of the specified Data Box Edge/Data Box Gateway device. */ @ServiceMethod(returns = ReturnType.SINGLE) - public NetworkSettingsInner getNetworkSettings(String deviceName, String resourceGroupName) { - return getNetworkSettingsWithResponse(deviceName, resourceGroupName, Context.NONE).getValue(); + public void installUpdates(String resourceGroupName, String deviceName, Context context) { + beginInstallUpdates(resourceGroupName, deviceName, context).getFinalResult(); } /** * Scans for updates on a Data Box Edge/Data Box Gateway device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param resourceGroupName The resource group name. * @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>> scanForUpdatesWithResponseAsync(String deviceName, - String resourceGroupName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (deviceName == null) { - return Mono.error(new IllegalArgumentException("Parameter deviceName 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.")); - } - final String accept = "application/json"; + private Mono>> scanForUpdatesWithResponseAsync(String resourceGroupName, + String deviceName) { return FluxUtil - .withContext(context -> service.scanForUpdates(this.client.getEndpoint(), deviceName, - this.client.getSubscriptionId(), resourceGroupName, this.client.getApiVersion(), accept, context)) + .withContext(context -> service.scanForUpdates(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, deviceName, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Scans for updates on a Data Box Edge/Data Box Gateway device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param resourceGroupName The resource group name. - * @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}. + * @return the response body along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> scanForUpdatesWithResponseAsync(String deviceName, - String resourceGroupName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (deviceName == null) { - return Mono.error(new IllegalArgumentException("Parameter deviceName 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.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.scanForUpdates(this.client.getEndpoint(), deviceName, this.client.getSubscriptionId(), - resourceGroupName, this.client.getApiVersion(), accept, context); + private Response scanForUpdatesWithResponse(String resourceGroupName, String deviceName) { + return service.scanForUpdatesSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, deviceName, Context.NONE); } /** * Scans for updates on a Data Box Edge/Data Box Gateway device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param resourceGroupName The resource group name. + * @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 PollerFlux} for polling of long-running operation. + * @return the response body along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginScanForUpdatesAsync(String deviceName, String resourceGroupName) { - Mono>> mono = scanForUpdatesWithResponseAsync(deviceName, resourceGroupName); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - this.client.getContext()); + @ServiceMethod(returns = ReturnType.SINGLE) + private Response scanForUpdatesWithResponse(String resourceGroupName, String deviceName, + Context context) { + return service.scanForUpdatesSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, deviceName, context); } /** * Scans for updates on a Data Box Edge/Data Box Gateway device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param resourceGroupName The resource group name. - * @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 PollerFlux} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginScanForUpdatesAsync(String deviceName, String resourceGroupName, - Context context) { - context = this.client.mergeContext(context); - Mono>> mono = scanForUpdatesWithResponseAsync(deviceName, resourceGroupName, context); + private PollerFlux, Void> beginScanForUpdatesAsync(String resourceGroupName, String deviceName) { + Mono>> mono = scanForUpdatesWithResponseAsync(resourceGroupName, deviceName); return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - context); + this.client.getContext()); } /** * Scans for updates on a Data Box Edge/Data Box Gateway device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param resourceGroupName The resource group name. * @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 SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginScanForUpdates(String deviceName, String resourceGroupName) { - return this.beginScanForUpdatesAsync(deviceName, resourceGroupName).getSyncPoller(); + public SyncPoller, Void> beginScanForUpdates(String resourceGroupName, String deviceName) { + Response response = scanForUpdatesWithResponse(resourceGroupName, deviceName); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); } /** * Scans for updates on a Data Box Edge/Data Box Gateway device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param resourceGroupName The resource group name. * @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. @@ -2001,78 +1659,62 @@ public SyncPoller, Void> beginScanForUpdates(String deviceName, * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginScanForUpdates(String deviceName, String resourceGroupName, + public SyncPoller, Void> beginScanForUpdates(String resourceGroupName, String deviceName, Context context) { - return this.beginScanForUpdatesAsync(deviceName, resourceGroupName, context).getSyncPoller(); - } - - /** - * Scans for updates on a Data Box Edge/Data Box Gateway device. - * - * @param deviceName The device name. - * @param resourceGroupName The resource group name. - * @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 scanForUpdatesAsync(String deviceName, String resourceGroupName) { - return beginScanForUpdatesAsync(deviceName, resourceGroupName).last() - .flatMap(this.client::getLroFinalResultOrError); + Response response = scanForUpdatesWithResponse(resourceGroupName, deviceName, context); + return this.client.getLroResult(response, Void.class, Void.class, context); } /** * Scans for updates on a Data Box Edge/Data Box Gateway device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param resourceGroupName The resource group name. - * @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 A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono scanForUpdatesAsync(String deviceName, String resourceGroupName, Context context) { - return beginScanForUpdatesAsync(deviceName, resourceGroupName, context).last() + private Mono scanForUpdatesAsync(String resourceGroupName, String deviceName) { + return beginScanForUpdatesAsync(resourceGroupName, deviceName).last() .flatMap(this.client::getLroFinalResultOrError); } /** * Scans for updates on a Data Box Edge/Data Box Gateway device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param resourceGroupName The resource group name. * @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 scanForUpdates(String deviceName, String resourceGroupName) { - scanForUpdatesAsync(deviceName, resourceGroupName).block(); + public void scanForUpdates(String resourceGroupName, String deviceName) { + beginScanForUpdates(resourceGroupName, deviceName).getFinalResult(); } /** * Scans for updates on a Data Box Edge/Data Box Gateway device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param resourceGroupName The resource group name. * @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. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void scanForUpdates(String deviceName, String resourceGroupName, Context context) { - scanForUpdatesAsync(deviceName, resourceGroupName, context).block(); + public void scanForUpdates(String resourceGroupName, String deviceName, Context context) { + beginScanForUpdates(resourceGroupName, deviceName, context).getFinalResult(); } /** * Updates the security settings on a Data Box Edge/Data Box Gateway device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param resourceGroupName The resource group name. * @param securitySettings The security settings. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -2080,127 +1722,81 @@ public void scanForUpdates(String deviceName, String resourceGroupName, Context * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateSecuritySettingsWithResponseAsync(String deviceName, - String resourceGroupName, SecuritySettings securitySettings) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (deviceName == null) { - return Mono.error(new IllegalArgumentException("Parameter deviceName 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 (securitySettings == null) { - return Mono - .error(new IllegalArgumentException("Parameter securitySettings is required and cannot be null.")); - } else { - securitySettings.validate(); - } - final String accept = "application/json"; + private Mono>> createOrUpdateSecuritySettingsWithResponseAsync(String resourceGroupName, + String deviceName, SecuritySettings securitySettings) { + final String contentType = "application/json"; return FluxUtil - .withContext(context -> service.createOrUpdateSecuritySettings(this.client.getEndpoint(), deviceName, - this.client.getSubscriptionId(), resourceGroupName, this.client.getApiVersion(), securitySettings, - accept, context)) + .withContext(context -> service.createOrUpdateSecuritySettings(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, deviceName, + contentType, securitySettings, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Updates the security settings on a Data Box Edge/Data Box Gateway device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param resourceGroupName The resource group name. * @param securitySettings The security settings. - * @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}. + * @return the response body along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateSecuritySettingsWithResponseAsync(String deviceName, - String resourceGroupName, SecuritySettings securitySettings, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (deviceName == null) { - return Mono.error(new IllegalArgumentException("Parameter deviceName 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 (securitySettings == null) { - return Mono - .error(new IllegalArgumentException("Parameter securitySettings is required and cannot be null.")); - } else { - securitySettings.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.createOrUpdateSecuritySettings(this.client.getEndpoint(), deviceName, - this.client.getSubscriptionId(), resourceGroupName, this.client.getApiVersion(), securitySettings, accept, - context); + private Response createOrUpdateSecuritySettingsWithResponse(String resourceGroupName, String deviceName, + SecuritySettings securitySettings) { + final String contentType = "application/json"; + return service.createOrUpdateSecuritySettingsSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, deviceName, contentType, securitySettings, + Context.NONE); } /** * Updates the security settings on a Data Box Edge/Data Box Gateway device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param resourceGroupName The resource group name. * @param securitySettings The security settings. + * @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 PollerFlux} for polling of long-running operation. + * @return the response body along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginCreateOrUpdateSecuritySettingsAsync(String deviceName, - String resourceGroupName, SecuritySettings securitySettings) { - Mono>> mono - = createOrUpdateSecuritySettingsWithResponseAsync(deviceName, resourceGroupName, securitySettings); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - this.client.getContext()); + @ServiceMethod(returns = ReturnType.SINGLE) + private Response createOrUpdateSecuritySettingsWithResponse(String resourceGroupName, String deviceName, + SecuritySettings securitySettings, Context context) { + final String contentType = "application/json"; + return service.createOrUpdateSecuritySettingsSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, deviceName, contentType, securitySettings, context); } /** * Updates the security settings on a Data Box Edge/Data Box Gateway device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param resourceGroupName The resource group name. * @param securitySettings The security settings. - * @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 PollerFlux} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginCreateOrUpdateSecuritySettingsAsync(String deviceName, - String resourceGroupName, SecuritySettings securitySettings, Context context) { - context = this.client.mergeContext(context); + private PollerFlux, Void> beginCreateOrUpdateSecuritySettingsAsync(String resourceGroupName, + String deviceName, SecuritySettings securitySettings) { Mono>> mono - = createOrUpdateSecuritySettingsWithResponseAsync(deviceName, resourceGroupName, securitySettings, context); + = createOrUpdateSecuritySettingsWithResponseAsync(resourceGroupName, deviceName, securitySettings); return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - context); + this.client.getContext()); } /** * Updates the security settings on a Data Box Edge/Data Box Gateway device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param resourceGroupName The resource group name. * @param securitySettings The security settings. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -2208,17 +1804,18 @@ private PollerFlux, Void> beginCreateOrUpdateSecuritySettingsAs * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginCreateOrUpdateSecuritySettings(String deviceName, - String resourceGroupName, SecuritySettings securitySettings) { - return this.beginCreateOrUpdateSecuritySettingsAsync(deviceName, resourceGroupName, securitySettings) - .getSyncPoller(); + public SyncPoller, Void> beginCreateOrUpdateSecuritySettings(String resourceGroupName, + String deviceName, SecuritySettings securitySettings) { + Response response + = createOrUpdateSecuritySettingsWithResponse(resourceGroupName, deviceName, securitySettings); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); } /** * Updates the security settings on a Data Box Edge/Data Box Gateway device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param resourceGroupName The resource group name. * @param securitySettings The security settings. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -2227,17 +1824,18 @@ public SyncPoller, Void> beginCreateOrUpdateSecuritySettings(St * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginCreateOrUpdateSecuritySettings(String deviceName, - String resourceGroupName, SecuritySettings securitySettings, Context context) { - return this.beginCreateOrUpdateSecuritySettingsAsync(deviceName, resourceGroupName, securitySettings, context) - .getSyncPoller(); + public SyncPoller, Void> beginCreateOrUpdateSecuritySettings(String resourceGroupName, + String deviceName, SecuritySettings securitySettings, Context context) { + Response response + = createOrUpdateSecuritySettingsWithResponse(resourceGroupName, deviceName, securitySettings, context); + return this.client.getLroResult(response, Void.class, Void.class, context); } /** * Updates the security settings on a Data Box Edge/Data Box Gateway device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param resourceGroupName The resource group name. * @param securitySettings The security settings. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -2245,327 +1843,283 @@ public SyncPoller, Void> beginCreateOrUpdateSecuritySettings(St * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateSecuritySettingsAsync(String deviceName, String resourceGroupName, + private Mono createOrUpdateSecuritySettingsAsync(String resourceGroupName, String deviceName, SecuritySettings securitySettings) { - return beginCreateOrUpdateSecuritySettingsAsync(deviceName, resourceGroupName, securitySettings).last() + return beginCreateOrUpdateSecuritySettingsAsync(resourceGroupName, deviceName, securitySettings).last() .flatMap(this.client::getLroFinalResultOrError); } /** * Updates the security settings on a Data Box Edge/Data Box Gateway device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param resourceGroupName The resource group name. * @param securitySettings The security settings. - * @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 A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateSecuritySettingsAsync(String deviceName, String resourceGroupName, - SecuritySettings securitySettings, Context context) { - return beginCreateOrUpdateSecuritySettingsAsync(deviceName, resourceGroupName, securitySettings, context).last() - .flatMap(this.client::getLroFinalResultOrError); + public void createOrUpdateSecuritySettings(String resourceGroupName, String deviceName, + SecuritySettings securitySettings) { + beginCreateOrUpdateSecuritySettings(resourceGroupName, deviceName, securitySettings).getFinalResult(); } /** * Updates the security settings on a Data Box Edge/Data Box Gateway device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param resourceGroupName The resource group name. * @param securitySettings The security settings. + * @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. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void createOrUpdateSecuritySettings(String deviceName, String resourceGroupName, - SecuritySettings securitySettings) { - createOrUpdateSecuritySettingsAsync(deviceName, resourceGroupName, securitySettings).block(); + public void createOrUpdateSecuritySettings(String resourceGroupName, String deviceName, + SecuritySettings securitySettings, Context context) { + beginCreateOrUpdateSecuritySettings(resourceGroupName, deviceName, securitySettings, context).getFinalResult(); } /** - * Updates the security settings on a Data Box Edge/Data Box Gateway device. + * Gets additional information for the specified Data Box Edge/Data Box Gateway device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param resourceGroupName The resource group name. - * @param securitySettings The security settings. - * @param context The context to associate with this operation. + * @param parameters The patch object. * @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 additional information for the specified Data Box Edge/Data Box Gateway device along with + * {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void createOrUpdateSecuritySettings(String deviceName, String resourceGroupName, - SecuritySettings securitySettings, Context context) { - createOrUpdateSecuritySettingsAsync(deviceName, resourceGroupName, securitySettings, context).block(); + private Mono> updateExtendedInformationWithResponseAsync( + String resourceGroupName, String deviceName, DataBoxEdgeDeviceExtendedInfoPatch parameters) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.updateExtendedInformation(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, deviceName, + contentType, accept, parameters, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Gets information about the availability of updates based on the last scan of the device. It also gets information - * about any ongoing download or install jobs on the device. + * Gets additional information for the specified Data Box Edge/Data Box Gateway device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param resourceGroupName The resource group name. + * @param parameters The patch object. * @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 availability of updates based on the last scan of the device along with - * {@link Response} on successful completion of {@link Mono}. + * @return additional information for the specified Data Box Edge/Data Box Gateway device on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getUpdateSummaryWithResponseAsync(String deviceName, - String resourceGroupName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (deviceName == null) { - return Mono.error(new IllegalArgumentException("Parameter deviceName 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.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.getUpdateSummary(this.client.getEndpoint(), deviceName, - this.client.getSubscriptionId(), resourceGroupName, this.client.getApiVersion(), accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + private Mono updateExtendedInformationAsync(String resourceGroupName, + String deviceName, DataBoxEdgeDeviceExtendedInfoPatch parameters) { + return updateExtendedInformationWithResponseAsync(resourceGroupName, deviceName, parameters) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Gets information about the availability of updates based on the last scan of the device. It also gets information - * about any ongoing download or install jobs on the device. + * Gets additional information for the specified Data Box Edge/Data Box Gateway device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param resourceGroupName The resource group name. + * @param parameters The patch object. * @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 availability of updates based on the last scan of the device along with - * {@link Response} on successful completion of {@link Mono}. + * @return additional information for the specified Data Box Edge/Data Box Gateway device along with + * {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getUpdateSummaryWithResponseAsync(String deviceName, - String resourceGroupName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (deviceName == null) { - return Mono.error(new IllegalArgumentException("Parameter deviceName 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.")); - } + public Response updateExtendedInformationWithResponse(String resourceGroupName, + String deviceName, DataBoxEdgeDeviceExtendedInfoPatch parameters, Context context) { + final String contentType = "application/json"; final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.getUpdateSummary(this.client.getEndpoint(), deviceName, this.client.getSubscriptionId(), - resourceGroupName, this.client.getApiVersion(), accept, context); + return service.updateExtendedInformationSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, deviceName, contentType, accept, parameters, context); } /** - * Gets information about the availability of updates based on the last scan of the device. It also gets information - * about any ongoing download or install jobs on the device. + * Gets additional information for the specified Data Box Edge/Data Box Gateway device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param resourceGroupName The resource group name. + * @param parameters The patch object. * @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 availability of updates based on the last scan of the device on successful - * completion of {@link Mono}. + * @return additional information for the specified Data Box Edge/Data Box Gateway device. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getUpdateSummaryAsync(String deviceName, String resourceGroupName) { - return getUpdateSummaryWithResponseAsync(deviceName, resourceGroupName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + public DataBoxEdgeDeviceExtendedInfoInner updateExtendedInformation(String resourceGroupName, String deviceName, + DataBoxEdgeDeviceExtendedInfoPatch parameters) { + return updateExtendedInformationWithResponse(resourceGroupName, deviceName, parameters, Context.NONE) + .getValue(); } /** - * Gets information about the availability of updates based on the last scan of the device. It also gets information - * about any ongoing download or install jobs on the device. + * Uploads registration certificate for the device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param resourceGroupName The resource group name. - * @param context The context to associate with this operation. + * @param parameters The upload certificate 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 information about the availability of updates based on the last scan of the device along with - * {@link Response}. + * @return the upload registration certificate response along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getUpdateSummaryWithResponse(String deviceName, String resourceGroupName, - Context context) { - return getUpdateSummaryWithResponseAsync(deviceName, resourceGroupName, context).block(); + private Mono> uploadCertificateWithResponseAsync(String resourceGroupName, + String deviceName, UploadCertificateRequest parameters) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.uploadCertificate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, deviceName, contentType, accept, parameters, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Gets information about the availability of updates based on the last scan of the device. It also gets information - * about any ongoing download or install jobs on the device. + * Uploads registration certificate for the device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param resourceGroupName The resource group name. + * @param parameters The upload certificate 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 information about the availability of updates based on the last scan of the device. + * @return the upload registration certificate response on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public UpdateSummaryInner getUpdateSummary(String deviceName, String resourceGroupName) { - return getUpdateSummaryWithResponse(deviceName, resourceGroupName, Context.NONE).getValue(); + private Mono uploadCertificateAsync(String resourceGroupName, String deviceName, + UploadCertificateRequest parameters) { + return uploadCertificateWithResponseAsync(resourceGroupName, deviceName, parameters) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * Uploads registration certificate for the device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param resourceGroupName The resource group name. * @param parameters The upload certificate 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 upload registration certificate response along with {@link Response} on successful completion of - * {@link Mono}. + * @return the upload registration certificate response along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> uploadCertificateWithResponseAsync(String deviceName, - String resourceGroupName, UploadCertificateRequest parameters) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (deviceName == null) { - return Mono.error(new IllegalArgumentException("Parameter deviceName 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 (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } + public Response uploadCertificateWithResponse(String resourceGroupName, + String deviceName, UploadCertificateRequest parameters, Context context) { + final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.uploadCertificate(this.client.getEndpoint(), deviceName, - this.client.getSubscriptionId(), resourceGroupName, this.client.getApiVersion(), parameters, accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + return service.uploadCertificateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, deviceName, contentType, accept, parameters, context); } /** * Uploads registration certificate for the device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param resourceGroupName The resource group name. * @param parameters The upload certificate 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 upload registration certificate response along with {@link Response} on successful completion of - * {@link Mono}. + * @return the upload registration certificate response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public UploadCertificateResponseInner uploadCertificate(String resourceGroupName, String deviceName, + UploadCertificateRequest parameters) { + return uploadCertificateWithResponse(resourceGroupName, deviceName, parameters, Context.NONE).getValue(); + } + + /** + * Gets information about the availability of updates based on the last scan of the device. It also gets information + * about any ongoing download or install jobs on the device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @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 availability of updates based on the last scan of the device along with + * {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> uploadCertificateWithResponseAsync(String deviceName, - String resourceGroupName, UploadCertificateRequest parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (deviceName == null) { - return Mono.error(new IllegalArgumentException("Parameter deviceName 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 (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } + private Mono> getUpdateSummaryWithResponseAsync(String resourceGroupName, + String deviceName) { final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.uploadCertificate(this.client.getEndpoint(), deviceName, this.client.getSubscriptionId(), - resourceGroupName, this.client.getApiVersion(), parameters, accept, context); + return FluxUtil + .withContext(context -> service.getUpdateSummary(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, deviceName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Uploads registration certificate for the device. + * Gets information about the availability of updates based on the last scan of the device. It also gets information + * about any ongoing download or install jobs on the device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param resourceGroupName The resource group name. - * @param parameters The upload certificate 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 upload registration certificate response on successful completion of {@link Mono}. + * @return information about the availability of updates based on the last scan of the device on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono uploadCertificateAsync(String deviceName, String resourceGroupName, - UploadCertificateRequest parameters) { - return uploadCertificateWithResponseAsync(deviceName, resourceGroupName, parameters) + private Mono getUpdateSummaryAsync(String resourceGroupName, String deviceName) { + return getUpdateSummaryWithResponseAsync(resourceGroupName, deviceName) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Uploads registration certificate for the device. + * Gets information about the availability of updates based on the last scan of the device. It also gets information + * about any ongoing download or install jobs on the device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param resourceGroupName The resource group name. - * @param parameters The upload certificate 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 upload registration certificate response along with {@link Response}. + * @return information about the availability of updates based on the last scan of the device along with + * {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response uploadCertificateWithResponse(String deviceName, - String resourceGroupName, UploadCertificateRequest parameters, Context context) { - return uploadCertificateWithResponseAsync(deviceName, resourceGroupName, parameters, context).block(); + public Response getUpdateSummaryWithResponse(String resourceGroupName, String deviceName, + Context context) { + final String accept = "application/json"; + return service.getUpdateSummarySync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, deviceName, accept, context); } /** - * Uploads registration certificate for the device. + * Gets information about the availability of updates based on the last scan of the device. It also gets information + * about any ongoing download or install jobs on the device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param resourceGroupName The resource group name. - * @param parameters The upload certificate 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 upload registration certificate response. + * @return information about the availability of updates based on the last scan of the device. */ @ServiceMethod(returns = ReturnType.SINGLE) - public UploadCertificateResponseInner uploadCertificate(String deviceName, String resourceGroupName, - UploadCertificateRequest parameters) { - return uploadCertificateWithResponse(deviceName, resourceGroupName, parameters, Context.NONE).getValue(); + public UpdateSummaryInner getUpdateSummary(String resourceGroupName, String deviceName) { + return getUpdateSummaryWithResponse(resourceGroupName, deviceName, Context.NONE).getValue(); } /** @@ -2575,27 +2129,38 @@ public UploadCertificateResponseInner uploadCertificate(String deviceName, Strin * @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 collection of Data Box Edge/Gateway devices along with {@link PagedResponse} on successful completion - * of {@link Mono}. + * @return all the Data Box Edge/Data Box Gateway devices in a resource group along with {@link PagedResponse} on + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { final String accept = "application/json"; return FluxUtil .withContext( - context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @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 all the Data Box Edge/Data Box Gateway devices in a resource group along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByResourceGroupNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listByResourceGroupNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + /** * Get the next page of items. * @@ -2604,24 +2169,15 @@ private Mono> listBySubscriptionNextSingle * @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 collection of Data Box Edge/Gateway devices along with {@link PagedResponse} on successful completion - * of {@link Mono}. + * @return all the Data Box Edge/Data Box Gateway devices in a resource group along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listBySubscriptionNextSinglePageAsync(String nextLink, - Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } + private PagedResponse listByResourceGroupNextSinglePage(String nextLink, Context context) { final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + Response res + = service.listByResourceGroupNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -2631,27 +2187,38 @@ private Mono> listBySubscriptionNextSingle * @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 collection of Data Box Edge/Gateway devices along with {@link PagedResponse} on successful completion - * of {@link Mono}. + * @return all the Data Box Edge/Data Box Gateway devices in a subscription along with {@link PagedResponse} on + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { final String accept = "application/json"; return FluxUtil .withContext( - context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @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 all the Data Box Edge/Data Box Gateway devices in a subscription along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listBySubscriptionNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listBySubscriptionNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + /** * Get the next page of items. * @@ -2660,23 +2227,14 @@ private Mono> listByResourceGroupNextSingl * @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 collection of Data Box Edge/Gateway devices along with {@link PagedResponse} on successful completion - * of {@link Mono}. + * @return all the Data Box Edge/Data Box Gateway devices in a subscription along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, - Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } + private PagedResponse listBySubscriptionNextSinglePage(String nextLink, Context context) { final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + Response res + = service.listBySubscriptionNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } } diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/DevicesImpl.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/DevicesImpl.java index 71df2b1354ea..a58e4cd10126 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/DevicesImpl.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/DevicesImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.implementation; @@ -12,12 +12,15 @@ import com.azure.resourcemanager.databoxedge.fluent.DevicesClient; import com.azure.resourcemanager.databoxedge.fluent.models.DataBoxEdgeDeviceExtendedInfoInner; import com.azure.resourcemanager.databoxedge.fluent.models.DataBoxEdgeDeviceInner; +import com.azure.resourcemanager.databoxedge.fluent.models.GenerateCertResponseInner; import com.azure.resourcemanager.databoxedge.fluent.models.NetworkSettingsInner; import com.azure.resourcemanager.databoxedge.fluent.models.UpdateSummaryInner; import com.azure.resourcemanager.databoxedge.fluent.models.UploadCertificateResponseInner; import com.azure.resourcemanager.databoxedge.models.DataBoxEdgeDevice; import com.azure.resourcemanager.databoxedge.models.DataBoxEdgeDeviceExtendedInfo; +import com.azure.resourcemanager.databoxedge.models.DataBoxEdgeDeviceExtendedInfoPatch; import com.azure.resourcemanager.databoxedge.models.Devices; +import com.azure.resourcemanager.databoxedge.models.GenerateCertResponse; import com.azure.resourcemanager.databoxedge.models.NetworkSettings; import com.azure.resourcemanager.databoxedge.models.SecuritySettings; import com.azure.resourcemanager.databoxedge.models.UpdateSummary; @@ -37,26 +40,25 @@ public DevicesImpl(DevicesClient innerClient, this.serviceManager = serviceManager; } - public PagedIterable list() { - PagedIterable inner = this.serviceClient().list(); - return ResourceManagerUtils.mapPage(inner, inner1 -> new DataBoxEdgeDeviceImpl(inner1, this.manager())); - } - - public PagedIterable list(String expand, Context context) { - PagedIterable inner = this.serviceClient().list(expand, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new DataBoxEdgeDeviceImpl(inner1, this.manager())); - } - - public PagedIterable listByResourceGroup(String resourceGroupName) { - PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); - return ResourceManagerUtils.mapPage(inner, inner1 -> new DataBoxEdgeDeviceImpl(inner1, this.manager())); + public Response getNetworkSettingsWithResponse(String resourceGroupName, String deviceName, + Context context) { + Response inner + = this.serviceClient().getNetworkSettingsWithResponse(resourceGroupName, deviceName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new NetworkSettingsImpl(inner.getValue(), this.manager())); + } else { + return null; + } } - public PagedIterable listByResourceGroup(String resourceGroupName, String expand, - Context context) { - PagedIterable inner - = this.serviceClient().listByResourceGroup(resourceGroupName, expand, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new DataBoxEdgeDeviceImpl(inner1, this.manager())); + public NetworkSettings getNetworkSettings(String resourceGroupName, String deviceName) { + NetworkSettingsInner inner = this.serviceClient().getNetworkSettings(resourceGroupName, deviceName); + if (inner != null) { + return new NetworkSettingsImpl(inner, this.manager()); + } else { + return null; + } } public Response getByResourceGroupWithResponse(String resourceGroupName, String deviceName, @@ -88,108 +90,132 @@ public void delete(String resourceGroupName, String deviceName, Context context) this.serviceClient().delete(resourceGroupName, deviceName, context); } - public void downloadUpdates(String deviceName, String resourceGroupName) { - this.serviceClient().downloadUpdates(deviceName, resourceGroupName); + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new DataBoxEdgeDeviceImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, String expand, + Context context) { + PagedIterable inner + = this.serviceClient().listByResourceGroup(resourceGroupName, expand, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new DataBoxEdgeDeviceImpl(inner1, this.manager())); } - public void downloadUpdates(String deviceName, String resourceGroupName, Context context) { - this.serviceClient().downloadUpdates(deviceName, resourceGroupName, context); + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new DataBoxEdgeDeviceImpl(inner1, this.manager())); } - public Response getExtendedInformationWithResponse(String deviceName, - String resourceGroupName, Context context) { - Response inner - = this.serviceClient().getExtendedInformationWithResponse(deviceName, resourceGroupName, context); + public PagedIterable list(String expand, Context context) { + PagedIterable inner = this.serviceClient().list(expand, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new DataBoxEdgeDeviceImpl(inner1, this.manager())); + } + + public void downloadUpdates(String resourceGroupName, String deviceName) { + this.serviceClient().downloadUpdates(resourceGroupName, deviceName); + } + + public void downloadUpdates(String resourceGroupName, String deviceName, Context context) { + this.serviceClient().downloadUpdates(resourceGroupName, deviceName, context); + } + + public Response generateCertificateWithResponse(String resourceGroupName, String deviceName, + Context context) { + Response inner + = this.serviceClient().generateCertificateWithResponse(resourceGroupName, deviceName, context); if (inner != null) { return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new DataBoxEdgeDeviceExtendedInfoImpl(inner.getValue(), this.manager())); + new GenerateCertResponseImpl(inner.getValue(), this.manager())); } else { return null; } } - public DataBoxEdgeDeviceExtendedInfo getExtendedInformation(String deviceName, String resourceGroupName) { - DataBoxEdgeDeviceExtendedInfoInner inner - = this.serviceClient().getExtendedInformation(deviceName, resourceGroupName); + public GenerateCertResponse generateCertificate(String resourceGroupName, String deviceName) { + GenerateCertResponseInner inner = this.serviceClient().generateCertificate(resourceGroupName, deviceName); if (inner != null) { - return new DataBoxEdgeDeviceExtendedInfoImpl(inner, this.manager()); + return new GenerateCertResponseImpl(inner, this.manager()); } else { return null; } } - public void installUpdates(String deviceName, String resourceGroupName) { - this.serviceClient().installUpdates(deviceName, resourceGroupName); - } - - public void installUpdates(String deviceName, String resourceGroupName, Context context) { - this.serviceClient().installUpdates(deviceName, resourceGroupName, context); - } - - public Response getNetworkSettingsWithResponse(String deviceName, String resourceGroupName, - Context context) { - Response inner - = this.serviceClient().getNetworkSettingsWithResponse(deviceName, resourceGroupName, context); + public Response getExtendedInformationWithResponse(String resourceGroupName, + String deviceName, Context context) { + Response inner + = this.serviceClient().getExtendedInformationWithResponse(resourceGroupName, deviceName, context); if (inner != null) { return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new NetworkSettingsImpl(inner.getValue(), this.manager())); + new DataBoxEdgeDeviceExtendedInfoImpl(inner.getValue(), this.manager())); } else { return null; } } - public NetworkSettings getNetworkSettings(String deviceName, String resourceGroupName) { - NetworkSettingsInner inner = this.serviceClient().getNetworkSettings(deviceName, resourceGroupName); + public DataBoxEdgeDeviceExtendedInfo getExtendedInformation(String resourceGroupName, String deviceName) { + DataBoxEdgeDeviceExtendedInfoInner inner + = this.serviceClient().getExtendedInformation(resourceGroupName, deviceName); if (inner != null) { - return new NetworkSettingsImpl(inner, this.manager()); + return new DataBoxEdgeDeviceExtendedInfoImpl(inner, this.manager()); } else { return null; } } - public void scanForUpdates(String deviceName, String resourceGroupName) { - this.serviceClient().scanForUpdates(deviceName, resourceGroupName); + public void installUpdates(String resourceGroupName, String deviceName) { + this.serviceClient().installUpdates(resourceGroupName, deviceName); + } + + public void installUpdates(String resourceGroupName, String deviceName, Context context) { + this.serviceClient().installUpdates(resourceGroupName, deviceName, context); + } + + public void scanForUpdates(String resourceGroupName, String deviceName) { + this.serviceClient().scanForUpdates(resourceGroupName, deviceName); } - public void scanForUpdates(String deviceName, String resourceGroupName, Context context) { - this.serviceClient().scanForUpdates(deviceName, resourceGroupName, context); + public void scanForUpdates(String resourceGroupName, String deviceName, Context context) { + this.serviceClient().scanForUpdates(resourceGroupName, deviceName, context); } - public void createOrUpdateSecuritySettings(String deviceName, String resourceGroupName, + public void createOrUpdateSecuritySettings(String resourceGroupName, String deviceName, SecuritySettings securitySettings) { - this.serviceClient().createOrUpdateSecuritySettings(deviceName, resourceGroupName, securitySettings); + this.serviceClient().createOrUpdateSecuritySettings(resourceGroupName, deviceName, securitySettings); } - public void createOrUpdateSecuritySettings(String deviceName, String resourceGroupName, + public void createOrUpdateSecuritySettings(String resourceGroupName, String deviceName, SecuritySettings securitySettings, Context context) { - this.serviceClient().createOrUpdateSecuritySettings(deviceName, resourceGroupName, securitySettings, context); + this.serviceClient().createOrUpdateSecuritySettings(resourceGroupName, deviceName, securitySettings, context); } - public Response getUpdateSummaryWithResponse(String deviceName, String resourceGroupName, - Context context) { - Response inner - = this.serviceClient().getUpdateSummaryWithResponse(deviceName, resourceGroupName, context); + public Response updateExtendedInformationWithResponse(String resourceGroupName, + String deviceName, DataBoxEdgeDeviceExtendedInfoPatch parameters, Context context) { + Response inner = this.serviceClient() + .updateExtendedInformationWithResponse(resourceGroupName, deviceName, parameters, context); if (inner != null) { return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new UpdateSummaryImpl(inner.getValue(), this.manager())); + new DataBoxEdgeDeviceExtendedInfoImpl(inner.getValue(), this.manager())); } else { return null; } } - public UpdateSummary getUpdateSummary(String deviceName, String resourceGroupName) { - UpdateSummaryInner inner = this.serviceClient().getUpdateSummary(deviceName, resourceGroupName); + public DataBoxEdgeDeviceExtendedInfo updateExtendedInformation(String resourceGroupName, String deviceName, + DataBoxEdgeDeviceExtendedInfoPatch parameters) { + DataBoxEdgeDeviceExtendedInfoInner inner + = this.serviceClient().updateExtendedInformation(resourceGroupName, deviceName, parameters); if (inner != null) { - return new UpdateSummaryImpl(inner, this.manager()); + return new DataBoxEdgeDeviceExtendedInfoImpl(inner, this.manager()); } else { return null; } } - public Response uploadCertificateWithResponse(String deviceName, - String resourceGroupName, UploadCertificateRequest parameters, Context context) { + public Response uploadCertificateWithResponse(String resourceGroupName, + String deviceName, UploadCertificateRequest parameters, Context context) { Response inner - = this.serviceClient().uploadCertificateWithResponse(deviceName, resourceGroupName, parameters, context); + = this.serviceClient().uploadCertificateWithResponse(resourceGroupName, deviceName, parameters, context); if (inner != null) { return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), new UploadCertificateResponseImpl(inner.getValue(), this.manager())); @@ -198,10 +224,10 @@ public Response uploadCertificateWithResponse(String } } - public UploadCertificateResponse uploadCertificate(String deviceName, String resourceGroupName, + public UploadCertificateResponse uploadCertificate(String resourceGroupName, String deviceName, UploadCertificateRequest parameters) { UploadCertificateResponseInner inner - = this.serviceClient().uploadCertificate(deviceName, resourceGroupName, parameters); + = this.serviceClient().uploadCertificate(resourceGroupName, deviceName, parameters); if (inner != null) { return new UploadCertificateResponseImpl(inner, this.manager()); } else { @@ -209,6 +235,27 @@ public UploadCertificateResponse uploadCertificate(String deviceName, String res } } + public Response getUpdateSummaryWithResponse(String resourceGroupName, String deviceName, + Context context) { + Response inner + = this.serviceClient().getUpdateSummaryWithResponse(resourceGroupName, deviceName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new UpdateSummaryImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public UpdateSummary getUpdateSummary(String resourceGroupName, String deviceName) { + UpdateSummaryInner inner = this.serviceClient().getUpdateSummary(resourceGroupName, deviceName); + if (inner != null) { + return new UpdateSummaryImpl(inner, this.manager()); + } else { + return null; + } + } + public DataBoxEdgeDevice getById(String id) { String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/DiagnosticProactiveLogCollectionSettingsImpl.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/DiagnosticProactiveLogCollectionSettingsImpl.java new file mode 100644 index 000000000000..5df21198285b --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/DiagnosticProactiveLogCollectionSettingsImpl.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.databoxedge.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.databoxedge.fluent.models.DiagnosticProactiveLogCollectionSettingsInner; +import com.azure.resourcemanager.databoxedge.models.DiagnosticProactiveLogCollectionSettings; +import com.azure.resourcemanager.databoxedge.models.ProactiveDiagnosticsConsent; + +public final class DiagnosticProactiveLogCollectionSettingsImpl implements DiagnosticProactiveLogCollectionSettings { + private DiagnosticProactiveLogCollectionSettingsInner innerObject; + + private final com.azure.resourcemanager.databoxedge.DataBoxEdgeManager serviceManager; + + DiagnosticProactiveLogCollectionSettingsImpl(DiagnosticProactiveLogCollectionSettingsInner innerObject, + com.azure.resourcemanager.databoxedge.DataBoxEdgeManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public ProactiveDiagnosticsConsent userConsent() { + return this.innerModel().userConsent(); + } + + public DiagnosticProactiveLogCollectionSettingsInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.databoxedge.DataBoxEdgeManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/DiagnosticRemoteSupportSettingsImpl.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/DiagnosticRemoteSupportSettingsImpl.java new file mode 100644 index 000000000000..83a1cdfe2be2 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/DiagnosticRemoteSupportSettingsImpl.java @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.databoxedge.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.databoxedge.fluent.models.DiagnosticRemoteSupportSettingsInner; +import com.azure.resourcemanager.databoxedge.models.DiagnosticRemoteSupportSettings; +import com.azure.resourcemanager.databoxedge.models.RemoteSupportSettings; +import java.util.Collections; +import java.util.List; + +public final class DiagnosticRemoteSupportSettingsImpl implements DiagnosticRemoteSupportSettings { + private DiagnosticRemoteSupportSettingsInner innerObject; + + private final com.azure.resourcemanager.databoxedge.DataBoxEdgeManager serviceManager; + + DiagnosticRemoteSupportSettingsImpl(DiagnosticRemoteSupportSettingsInner innerObject, + com.azure.resourcemanager.databoxedge.DataBoxEdgeManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public List remoteSupportSettingsList() { + List inner = this.innerModel().remoteSupportSettingsList(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public DiagnosticRemoteSupportSettingsInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.databoxedge.DataBoxEdgeManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/DiagnosticSettingsClientImpl.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/DiagnosticSettingsClientImpl.java new file mode 100644 index 000000000000..a12fb4dca2c1 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/DiagnosticSettingsClientImpl.java @@ -0,0 +1,695 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.databoxedge.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.BinaryData; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.databoxedge.fluent.DiagnosticSettingsClient; +import com.azure.resourcemanager.databoxedge.fluent.models.DiagnosticProactiveLogCollectionSettingsInner; +import com.azure.resourcemanager.databoxedge.fluent.models.DiagnosticRemoteSupportSettingsInner; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in DiagnosticSettingsClient. + */ +public final class DiagnosticSettingsClientImpl implements DiagnosticSettingsClient { + /** + * The proxy service used to perform REST calls. + */ + private final DiagnosticSettingsService service; + + /** + * The service client containing this operation class. + */ + private final DataBoxEdgeManagementClientImpl client; + + /** + * Initializes an instance of DiagnosticSettingsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + DiagnosticSettingsClientImpl(DataBoxEdgeManagementClientImpl client) { + this.service = RestProxy.create(DiagnosticSettingsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for DataBoxEdgeManagementClientDiagnosticSettings to be used by the proxy + * service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "DataBoxEdgeManagementClientDiagnosticSettings") + public interface DiagnosticSettingsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/diagnosticProactiveLogCollectionSettings/default") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getDiagnosticProactiveLogCollectionSettings( + @HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("deviceName") String deviceName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/diagnosticProactiveLogCollectionSettings/default") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getDiagnosticProactiveLogCollectionSettingsSync( + @HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("deviceName") String deviceName, + @HeaderParam("Accept") String accept, Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/diagnosticProactiveLogCollectionSettings/default") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> updateDiagnosticProactiveLogCollectionSettings( + @HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("deviceName") String deviceName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") DiagnosticProactiveLogCollectionSettingsInner proactiveLogCollectionSettings, + Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/diagnosticProactiveLogCollectionSettings/default") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response updateDiagnosticProactiveLogCollectionSettingsSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("deviceName") String deviceName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") DiagnosticProactiveLogCollectionSettingsInner proactiveLogCollectionSettings, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/diagnosticRemoteSupportSettings/default") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getDiagnosticRemoteSupportSettings( + @HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("deviceName") String deviceName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/diagnosticRemoteSupportSettings/default") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getDiagnosticRemoteSupportSettingsSync( + @HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("deviceName") String deviceName, + @HeaderParam("Accept") String accept, Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/diagnosticRemoteSupportSettings/default") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> updateDiagnosticRemoteSupportSettings(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("deviceName") String deviceName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") DiagnosticRemoteSupportSettingsInner diagnosticRemoteSupportSettings, + Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/diagnosticRemoteSupportSettings/default") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response updateDiagnosticRemoteSupportSettingsSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("deviceName") String deviceName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") DiagnosticRemoteSupportSettingsInner diagnosticRemoteSupportSettings, + Context context); + } + + /** + * Gets the proactive log collection settings of the specified Data Box Edge/Data Box Gateway device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @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 proactive log collection settings of the specified Data Box Edge/Data Box Gateway device along with + * {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + getDiagnosticProactiveLogCollectionSettingsWithResponseAsync(String resourceGroupName, String deviceName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getDiagnosticProactiveLogCollectionSettings(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, deviceName, accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the proactive log collection settings of the specified Data Box Edge/Data Box Gateway device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @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 proactive log collection settings of the specified Data Box Edge/Data Box Gateway device on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono + getDiagnosticProactiveLogCollectionSettingsAsync(String resourceGroupName, String deviceName) { + return getDiagnosticProactiveLogCollectionSettingsWithResponseAsync(resourceGroupName, deviceName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets the proactive log collection settings of the specified Data Box Edge/Data Box Gateway device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @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 proactive log collection settings of the specified Data Box Edge/Data Box Gateway device along with + * {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response + getDiagnosticProactiveLogCollectionSettingsWithResponse(String resourceGroupName, String deviceName, + Context context) { + final String accept = "application/json"; + return service.getDiagnosticProactiveLogCollectionSettingsSync(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, deviceName, accept, + context); + } + + /** + * Gets the proactive log collection settings of the specified Data Box Edge/Data Box Gateway device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @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 proactive log collection settings of the specified Data Box Edge/Data Box Gateway device. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DiagnosticProactiveLogCollectionSettingsInner + getDiagnosticProactiveLogCollectionSettings(String resourceGroupName, String deviceName) { + return getDiagnosticProactiveLogCollectionSettingsWithResponse(resourceGroupName, deviceName, Context.NONE) + .getValue(); + } + + /** + * Updates the proactive log collection settings on a Data Box Edge/Data Box Gateway device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @param proactiveLogCollectionSettings The proactive log collection settings. + * @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 diagnostic proactive log collection settings of a device along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateDiagnosticProactiveLogCollectionSettingsWithResponseAsync( + String resourceGroupName, String deviceName, + DiagnosticProactiveLogCollectionSettingsInner proactiveLogCollectionSettings) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.updateDiagnosticProactiveLogCollectionSettings(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, deviceName, + contentType, accept, proactiveLogCollectionSettings, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Updates the proactive log collection settings on a Data Box Edge/Data Box Gateway device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @param proactiveLogCollectionSettings The proactive log collection settings. + * @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 diagnostic proactive log collection settings of a device along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response updateDiagnosticProactiveLogCollectionSettingsWithResponse(String resourceGroupName, + String deviceName, DiagnosticProactiveLogCollectionSettingsInner proactiveLogCollectionSettings) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.updateDiagnosticProactiveLogCollectionSettingsSync(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, deviceName, contentType, + accept, proactiveLogCollectionSettings, Context.NONE); + } + + /** + * Updates the proactive log collection settings on a Data Box Edge/Data Box Gateway device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @param proactiveLogCollectionSettings The proactive log collection settings. + * @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 diagnostic proactive log collection settings of a device along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response updateDiagnosticProactiveLogCollectionSettingsWithResponse(String resourceGroupName, + String deviceName, DiagnosticProactiveLogCollectionSettingsInner proactiveLogCollectionSettings, + Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.updateDiagnosticProactiveLogCollectionSettingsSync(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, deviceName, contentType, + accept, proactiveLogCollectionSettings, context); + } + + /** + * Updates the proactive log collection settings on a Data Box Edge/Data Box Gateway device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @param proactiveLogCollectionSettings The proactive log collection settings. + * @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 the diagnostic proactive log collection settings of a device. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private + PollerFlux, DiagnosticProactiveLogCollectionSettingsInner> + beginUpdateDiagnosticProactiveLogCollectionSettingsAsync(String resourceGroupName, String deviceName, + DiagnosticProactiveLogCollectionSettingsInner proactiveLogCollectionSettings) { + Mono>> mono = updateDiagnosticProactiveLogCollectionSettingsWithResponseAsync( + resourceGroupName, deviceName, proactiveLogCollectionSettings); + return this.client + .getLroResult( + mono, this.client.getHttpPipeline(), DiagnosticProactiveLogCollectionSettingsInner.class, + DiagnosticProactiveLogCollectionSettingsInner.class, this.client.getContext()); + } + + /** + * Updates the proactive log collection settings on a Data Box Edge/Data Box Gateway device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @param proactiveLogCollectionSettings The proactive log collection settings. + * @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 SyncPoller} for polling of the diagnostic proactive log collection settings of a device. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public + SyncPoller, DiagnosticProactiveLogCollectionSettingsInner> + beginUpdateDiagnosticProactiveLogCollectionSettings(String resourceGroupName, String deviceName, + DiagnosticProactiveLogCollectionSettingsInner proactiveLogCollectionSettings) { + Response response = updateDiagnosticProactiveLogCollectionSettingsWithResponse(resourceGroupName, + deviceName, proactiveLogCollectionSettings); + return this.client + .getLroResult( + response, DiagnosticProactiveLogCollectionSettingsInner.class, + DiagnosticProactiveLogCollectionSettingsInner.class, Context.NONE); + } + + /** + * Updates the proactive log collection settings on a Data Box Edge/Data Box Gateway device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @param proactiveLogCollectionSettings The proactive log collection settings. + * @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 SyncPoller} for polling of the diagnostic proactive log collection settings of a device. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public + SyncPoller, DiagnosticProactiveLogCollectionSettingsInner> + beginUpdateDiagnosticProactiveLogCollectionSettings(String resourceGroupName, String deviceName, + DiagnosticProactiveLogCollectionSettingsInner proactiveLogCollectionSettings, Context context) { + Response response = updateDiagnosticProactiveLogCollectionSettingsWithResponse(resourceGroupName, + deviceName, proactiveLogCollectionSettings, context); + return this.client + .getLroResult( + response, DiagnosticProactiveLogCollectionSettingsInner.class, + DiagnosticProactiveLogCollectionSettingsInner.class, context); + } + + /** + * Updates the proactive log collection settings on a Data Box Edge/Data Box Gateway device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @param proactiveLogCollectionSettings The proactive log collection settings. + * @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 diagnostic proactive log collection settings of a device on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateDiagnosticProactiveLogCollectionSettingsAsync( + String resourceGroupName, String deviceName, + DiagnosticProactiveLogCollectionSettingsInner proactiveLogCollectionSettings) { + return beginUpdateDiagnosticProactiveLogCollectionSettingsAsync(resourceGroupName, deviceName, + proactiveLogCollectionSettings).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates the proactive log collection settings on a Data Box Edge/Data Box Gateway device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @param proactiveLogCollectionSettings The proactive log collection settings. + * @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 diagnostic proactive log collection settings of a device. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DiagnosticProactiveLogCollectionSettingsInner updateDiagnosticProactiveLogCollectionSettings( + String resourceGroupName, String deviceName, + DiagnosticProactiveLogCollectionSettingsInner proactiveLogCollectionSettings) { + return beginUpdateDiagnosticProactiveLogCollectionSettings(resourceGroupName, deviceName, + proactiveLogCollectionSettings).getFinalResult(); + } + + /** + * Updates the proactive log collection settings on a Data Box Edge/Data Box Gateway device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @param proactiveLogCollectionSettings The proactive log collection settings. + * @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 diagnostic proactive log collection settings of a device. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DiagnosticProactiveLogCollectionSettingsInner updateDiagnosticProactiveLogCollectionSettings( + String resourceGroupName, String deviceName, + DiagnosticProactiveLogCollectionSettingsInner proactiveLogCollectionSettings, Context context) { + return beginUpdateDiagnosticProactiveLogCollectionSettings(resourceGroupName, deviceName, + proactiveLogCollectionSettings, context).getFinalResult(); + } + + /** + * Gets the diagnostic remote support settings of the specified Data Box Edge/Data Box Gateway device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @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 diagnostic remote support settings of the specified Data Box Edge/Data Box Gateway device along with + * {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + getDiagnosticRemoteSupportSettingsWithResponseAsync(String resourceGroupName, String deviceName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getDiagnosticRemoteSupportSettings(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, deviceName, accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the diagnostic remote support settings of the specified Data Box Edge/Data Box Gateway device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @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 diagnostic remote support settings of the specified Data Box Edge/Data Box Gateway device on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getDiagnosticRemoteSupportSettingsAsync(String resourceGroupName, + String deviceName) { + return getDiagnosticRemoteSupportSettingsWithResponseAsync(resourceGroupName, deviceName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets the diagnostic remote support settings of the specified Data Box Edge/Data Box Gateway device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @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 diagnostic remote support settings of the specified Data Box Edge/Data Box Gateway device along with + * {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response + getDiagnosticRemoteSupportSettingsWithResponse(String resourceGroupName, String deviceName, Context context) { + final String accept = "application/json"; + return service.getDiagnosticRemoteSupportSettingsSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, deviceName, accept, context); + } + + /** + * Gets the diagnostic remote support settings of the specified Data Box Edge/Data Box Gateway device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @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 diagnostic remote support settings of the specified Data Box Edge/Data Box Gateway device. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DiagnosticRemoteSupportSettingsInner getDiagnosticRemoteSupportSettings(String resourceGroupName, + String deviceName) { + return getDiagnosticRemoteSupportSettingsWithResponse(resourceGroupName, deviceName, Context.NONE).getValue(); + } + + /** + * Updates the diagnostic remote support settings on a Data Box Edge/Data Box Gateway device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @param diagnosticRemoteSupportSettings The diagnostic remote support settings. + * @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 remote support settings of a device along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateDiagnosticRemoteSupportSettingsWithResponseAsync( + String resourceGroupName, String deviceName, + DiagnosticRemoteSupportSettingsInner diagnosticRemoteSupportSettings) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.updateDiagnosticRemoteSupportSettings(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, deviceName, + contentType, accept, diagnosticRemoteSupportSettings, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Updates the diagnostic remote support settings on a Data Box Edge/Data Box Gateway device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @param diagnosticRemoteSupportSettings The diagnostic remote support settings. + * @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 remote support settings of a device along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response updateDiagnosticRemoteSupportSettingsWithResponse(String resourceGroupName, + String deviceName, DiagnosticRemoteSupportSettingsInner diagnosticRemoteSupportSettings) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.updateDiagnosticRemoteSupportSettingsSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, deviceName, contentType, accept, + diagnosticRemoteSupportSettings, Context.NONE); + } + + /** + * Updates the diagnostic remote support settings on a Data Box Edge/Data Box Gateway device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @param diagnosticRemoteSupportSettings The diagnostic remote support settings. + * @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 remote support settings of a device along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response updateDiagnosticRemoteSupportSettingsWithResponse(String resourceGroupName, + String deviceName, DiagnosticRemoteSupportSettingsInner diagnosticRemoteSupportSettings, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.updateDiagnosticRemoteSupportSettingsSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, deviceName, contentType, accept, + diagnosticRemoteSupportSettings, context); + } + + /** + * Updates the diagnostic remote support settings on a Data Box Edge/Data Box Gateway device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @param diagnosticRemoteSupportSettings The diagnostic remote support settings. + * @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 the remote support settings of a device. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, DiagnosticRemoteSupportSettingsInner> + beginUpdateDiagnosticRemoteSupportSettingsAsync(String resourceGroupName, String deviceName, + DiagnosticRemoteSupportSettingsInner diagnosticRemoteSupportSettings) { + Mono>> mono = updateDiagnosticRemoteSupportSettingsWithResponseAsync( + resourceGroupName, deviceName, diagnosticRemoteSupportSettings); + return this.client.getLroResult( + mono, this.client.getHttpPipeline(), DiagnosticRemoteSupportSettingsInner.class, + DiagnosticRemoteSupportSettingsInner.class, this.client.getContext()); + } + + /** + * Updates the diagnostic remote support settings on a Data Box Edge/Data Box Gateway device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @param diagnosticRemoteSupportSettings The diagnostic remote support settings. + * @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 SyncPoller} for polling of the remote support settings of a device. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, DiagnosticRemoteSupportSettingsInner> + beginUpdateDiagnosticRemoteSupportSettings(String resourceGroupName, String deviceName, + DiagnosticRemoteSupportSettingsInner diagnosticRemoteSupportSettings) { + Response response = updateDiagnosticRemoteSupportSettingsWithResponse(resourceGroupName, deviceName, + diagnosticRemoteSupportSettings); + return this.client.getLroResult( + response, DiagnosticRemoteSupportSettingsInner.class, DiagnosticRemoteSupportSettingsInner.class, + Context.NONE); + } + + /** + * Updates the diagnostic remote support settings on a Data Box Edge/Data Box Gateway device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @param diagnosticRemoteSupportSettings The diagnostic remote support settings. + * @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 SyncPoller} for polling of the remote support settings of a device. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, DiagnosticRemoteSupportSettingsInner> + beginUpdateDiagnosticRemoteSupportSettings(String resourceGroupName, String deviceName, + DiagnosticRemoteSupportSettingsInner diagnosticRemoteSupportSettings, Context context) { + Response response = updateDiagnosticRemoteSupportSettingsWithResponse(resourceGroupName, deviceName, + diagnosticRemoteSupportSettings, context); + return this.client.getLroResult( + response, DiagnosticRemoteSupportSettingsInner.class, DiagnosticRemoteSupportSettingsInner.class, context); + } + + /** + * Updates the diagnostic remote support settings on a Data Box Edge/Data Box Gateway device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @param diagnosticRemoteSupportSettings The diagnostic remote support settings. + * @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 remote support settings of a device on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateDiagnosticRemoteSupportSettingsAsync( + String resourceGroupName, String deviceName, + DiagnosticRemoteSupportSettingsInner diagnosticRemoteSupportSettings) { + return beginUpdateDiagnosticRemoteSupportSettingsAsync(resourceGroupName, deviceName, + diagnosticRemoteSupportSettings).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates the diagnostic remote support settings on a Data Box Edge/Data Box Gateway device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @param diagnosticRemoteSupportSettings The diagnostic remote support settings. + * @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 remote support settings of a device. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DiagnosticRemoteSupportSettingsInner updateDiagnosticRemoteSupportSettings(String resourceGroupName, + String deviceName, DiagnosticRemoteSupportSettingsInner diagnosticRemoteSupportSettings) { + return beginUpdateDiagnosticRemoteSupportSettings(resourceGroupName, deviceName, + diagnosticRemoteSupportSettings).getFinalResult(); + } + + /** + * Updates the diagnostic remote support settings on a Data Box Edge/Data Box Gateway device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @param diagnosticRemoteSupportSettings The diagnostic remote support settings. + * @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 remote support settings of a device. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DiagnosticRemoteSupportSettingsInner updateDiagnosticRemoteSupportSettings(String resourceGroupName, + String deviceName, DiagnosticRemoteSupportSettingsInner diagnosticRemoteSupportSettings, Context context) { + return beginUpdateDiagnosticRemoteSupportSettings(resourceGroupName, deviceName, + diagnosticRemoteSupportSettings, context).getFinalResult(); + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/DiagnosticSettingsImpl.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/DiagnosticSettingsImpl.java new file mode 100644 index 000000000000..e96697478240 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/DiagnosticSettingsImpl.java @@ -0,0 +1,133 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.databoxedge.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.databoxedge.fluent.DiagnosticSettingsClient; +import com.azure.resourcemanager.databoxedge.fluent.models.DiagnosticProactiveLogCollectionSettingsInner; +import com.azure.resourcemanager.databoxedge.fluent.models.DiagnosticRemoteSupportSettingsInner; +import com.azure.resourcemanager.databoxedge.models.DiagnosticProactiveLogCollectionSettings; +import com.azure.resourcemanager.databoxedge.models.DiagnosticRemoteSupportSettings; +import com.azure.resourcemanager.databoxedge.models.DiagnosticSettings; + +public final class DiagnosticSettingsImpl implements DiagnosticSettings { + private static final ClientLogger LOGGER = new ClientLogger(DiagnosticSettingsImpl.class); + + private final DiagnosticSettingsClient innerClient; + + private final com.azure.resourcemanager.databoxedge.DataBoxEdgeManager serviceManager; + + public DiagnosticSettingsImpl(DiagnosticSettingsClient innerClient, + com.azure.resourcemanager.databoxedge.DataBoxEdgeManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getDiagnosticProactiveLogCollectionSettingsWithResponse( + String resourceGroupName, String deviceName, Context context) { + Response inner = this.serviceClient() + .getDiagnosticProactiveLogCollectionSettingsWithResponse(resourceGroupName, deviceName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new DiagnosticProactiveLogCollectionSettingsImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public DiagnosticProactiveLogCollectionSettings + getDiagnosticProactiveLogCollectionSettings(String resourceGroupName, String deviceName) { + DiagnosticProactiveLogCollectionSettingsInner inner + = this.serviceClient().getDiagnosticProactiveLogCollectionSettings(resourceGroupName, deviceName); + if (inner != null) { + return new DiagnosticProactiveLogCollectionSettingsImpl(inner, this.manager()); + } else { + return null; + } + } + + public DiagnosticProactiveLogCollectionSettings updateDiagnosticProactiveLogCollectionSettings( + String resourceGroupName, String deviceName, + DiagnosticProactiveLogCollectionSettingsInner proactiveLogCollectionSettings) { + DiagnosticProactiveLogCollectionSettingsInner inner = this.serviceClient() + .updateDiagnosticProactiveLogCollectionSettings(resourceGroupName, deviceName, + proactiveLogCollectionSettings); + if (inner != null) { + return new DiagnosticProactiveLogCollectionSettingsImpl(inner, this.manager()); + } else { + return null; + } + } + + public DiagnosticProactiveLogCollectionSettings updateDiagnosticProactiveLogCollectionSettings( + String resourceGroupName, String deviceName, + DiagnosticProactiveLogCollectionSettingsInner proactiveLogCollectionSettings, Context context) { + DiagnosticProactiveLogCollectionSettingsInner inner = this.serviceClient() + .updateDiagnosticProactiveLogCollectionSettings(resourceGroupName, deviceName, + proactiveLogCollectionSettings, context); + if (inner != null) { + return new DiagnosticProactiveLogCollectionSettingsImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response + getDiagnosticRemoteSupportSettingsWithResponse(String resourceGroupName, String deviceName, Context context) { + Response inner = this.serviceClient() + .getDiagnosticRemoteSupportSettingsWithResponse(resourceGroupName, deviceName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new DiagnosticRemoteSupportSettingsImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public DiagnosticRemoteSupportSettings getDiagnosticRemoteSupportSettings(String resourceGroupName, + String deviceName) { + DiagnosticRemoteSupportSettingsInner inner + = this.serviceClient().getDiagnosticRemoteSupportSettings(resourceGroupName, deviceName); + if (inner != null) { + return new DiagnosticRemoteSupportSettingsImpl(inner, this.manager()); + } else { + return null; + } + } + + public DiagnosticRemoteSupportSettings updateDiagnosticRemoteSupportSettings(String resourceGroupName, + String deviceName, DiagnosticRemoteSupportSettingsInner diagnosticRemoteSupportSettings) { + DiagnosticRemoteSupportSettingsInner inner = this.serviceClient() + .updateDiagnosticRemoteSupportSettings(resourceGroupName, deviceName, diagnosticRemoteSupportSettings); + if (inner != null) { + return new DiagnosticRemoteSupportSettingsImpl(inner, this.manager()); + } else { + return null; + } + } + + public DiagnosticRemoteSupportSettings updateDiagnosticRemoteSupportSettings(String resourceGroupName, + String deviceName, DiagnosticRemoteSupportSettingsInner diagnosticRemoteSupportSettings, Context context) { + DiagnosticRemoteSupportSettingsInner inner = this.serviceClient() + .updateDiagnosticRemoteSupportSettings(resourceGroupName, deviceName, diagnosticRemoteSupportSettings, + context); + if (inner != null) { + return new DiagnosticRemoteSupportSettingsImpl(inner, this.manager()); + } else { + return null; + } + } + + private DiagnosticSettingsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.databoxedge.DataBoxEdgeManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/GenerateCertResponseImpl.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/GenerateCertResponseImpl.java new file mode 100644 index 000000000000..6691f6f47efb --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/GenerateCertResponseImpl.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.databoxedge.implementation; + +import com.azure.resourcemanager.databoxedge.fluent.models.GenerateCertResponseInner; +import com.azure.resourcemanager.databoxedge.models.GenerateCertResponse; + +public final class GenerateCertResponseImpl implements GenerateCertResponse { + private GenerateCertResponseInner innerObject; + + private final com.azure.resourcemanager.databoxedge.DataBoxEdgeManager serviceManager; + + GenerateCertResponseImpl(GenerateCertResponseInner innerObject, + com.azure.resourcemanager.databoxedge.DataBoxEdgeManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String publicKey() { + return this.innerModel().publicKey(); + } + + public String privateKey() { + return this.innerModel().privateKey(); + } + + public String expiryTimeInUTC() { + return this.innerModel().expiryTimeInUTC(); + } + + public GenerateCertResponseInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.databoxedge.DataBoxEdgeManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/JobImpl.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/JobImpl.java index 587161a763f3..7c629cd88e0e 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/JobImpl.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/JobImpl.java @@ -1,9 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.implementation; +import com.azure.core.management.SystemData; import com.azure.resourcemanager.databoxedge.fluent.models.JobInner; import com.azure.resourcemanager.databoxedge.models.Job; import com.azure.resourcemanager.databoxedge.models.JobErrorDetails; @@ -56,6 +57,10 @@ public JobErrorDetails error() { return this.innerModel().error(); } + public SystemData systemData() { + return this.innerModel().systemData(); + } + public JobType jobType() { return this.innerModel().jobType(); } diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/JobsClientImpl.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/JobsClientImpl.java index 08b196d44a7a..887868e74fd0 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/JobsClientImpl.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/JobsClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.implementation; @@ -53,25 +53,34 @@ public final class JobsClientImpl implements JobsClient { * The interface defining all the services for DataBoxEdgeManagementClientJobs to be used by the proxy service to * perform REST calls. */ - @Host("{$host}") - @ServiceInterface(name = "DataBoxEdgeManagemen") + @Host("{endpoint}") + @ServiceInterface(name = "DataBoxEdgeManagementClientJobs") public interface JobsService { @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/jobs/{name}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("$host") String endpoint, @PathParam("deviceName") String deviceName, - @PathParam("name") String name, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("deviceName") String deviceName, + @PathParam("name") String name, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/jobs/{name}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("deviceName") String deviceName, + @PathParam("name") String name, @HeaderParam("Accept") String accept, Context context); } /** * Gets the details of a specified job on a Data Box Edge/Data Box Gateway device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. * @param name The job name. - * @param resourceGroupName The resource group name. * @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. @@ -79,78 +88,20 @@ Mono> get(@HostParam("$host") String endpoint, @PathParam("de * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String deviceName, String name, String resourceGroupName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (deviceName == null) { - return Mono.error(new IllegalArgumentException("Parameter deviceName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name 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.")); - } + private Mono> getWithResponseAsync(String resourceGroupName, String deviceName, String name) { final String accept = "application/json"; return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), deviceName, name, - this.client.getSubscriptionId(), resourceGroupName, this.client.getApiVersion(), accept, context)) + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, deviceName, name, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Gets the details of a specified job on a Data Box Edge/Data Box Gateway device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. * @param name The job name. - * @param resourceGroupName The resource group name. - * @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 details of a specified job on a Data Box Edge/Data Box Gateway device along with {@link Response} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String deviceName, String name, String resourceGroupName, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (deviceName == null) { - return Mono.error(new IllegalArgumentException("Parameter deviceName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name 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.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), deviceName, name, this.client.getSubscriptionId(), - resourceGroupName, this.client.getApiVersion(), accept, context); - } - - /** - * Gets the details of a specified job on a Data Box Edge/Data Box Gateway device. - * - * @param deviceName The device name. - * @param name The job name. - * @param resourceGroupName The resource group name. * @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. @@ -158,17 +109,17 @@ private Mono> getWithResponseAsync(String deviceName, String * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String deviceName, String name, String resourceGroupName) { - return getWithResponseAsync(deviceName, name, resourceGroupName) + private Mono getAsync(String resourceGroupName, String deviceName, String name) { + return getWithResponseAsync(resourceGroupName, deviceName, name) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * Gets the details of a specified job on a Data Box Edge/Data Box Gateway device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. * @param name The job name. - * @param resourceGroupName The resource group name. * @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. @@ -176,24 +127,26 @@ private Mono getAsync(String deviceName, String name, String resourceG * @return the details of a specified job on a Data Box Edge/Data Box Gateway device along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String deviceName, String name, String resourceGroupName, + public Response getWithResponse(String resourceGroupName, String deviceName, String name, Context context) { - return getWithResponseAsync(deviceName, name, resourceGroupName, context).block(); + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, deviceName, name, accept, context); } /** * Gets the details of a specified job on a Data Box Edge/Data Box Gateway device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. * @param name The job name. - * @param resourceGroupName The resource group name. * @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 details of a specified job on a Data Box Edge/Data Box Gateway device. */ @ServiceMethod(returns = ReturnType.SINGLE) - public JobInner get(String deviceName, String name, String resourceGroupName) { - return getWithResponse(deviceName, name, resourceGroupName, Context.NONE).getValue(); + public JobInner get(String resourceGroupName, String deviceName, String name) { + return getWithResponse(resourceGroupName, deviceName, name, Context.NONE).getValue(); } } diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/JobsImpl.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/JobsImpl.java index 4847cb47aae3..82f584d10f62 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/JobsImpl.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/JobsImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.implementation; @@ -25,8 +25,8 @@ public JobsImpl(JobsClient innerClient, com.azure.resourcemanager.databoxedge.Da this.serviceManager = serviceManager; } - public Response getWithResponse(String deviceName, String name, String resourceGroupName, Context context) { - Response inner = this.serviceClient().getWithResponse(deviceName, name, resourceGroupName, context); + public Response getWithResponse(String resourceGroupName, String deviceName, String name, Context context) { + Response inner = this.serviceClient().getWithResponse(resourceGroupName, deviceName, name, context); if (inner != null) { return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), new JobImpl(inner.getValue(), this.manager())); @@ -35,8 +35,8 @@ public Response getWithResponse(String deviceName, String name, String reso } } - public Job get(String deviceName, String name, String resourceGroupName) { - JobInner inner = this.serviceClient().get(deviceName, name, resourceGroupName); + public Job get(String resourceGroupName, String deviceName, String name) { + JobInner inner = this.serviceClient().get(resourceGroupName, deviceName, name); if (inner != null) { return new JobImpl(inner, this.manager()); } else { diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/MonitoringConfigsClientImpl.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/MonitoringConfigsClientImpl.java new file mode 100644 index 000000000000..89f7c05a4cfb --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/MonitoringConfigsClientImpl.java @@ -0,0 +1,737 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.databoxedge.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.BinaryData; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.databoxedge.fluent.MonitoringConfigsClient; +import com.azure.resourcemanager.databoxedge.fluent.models.MonitoringMetricConfigurationInner; +import com.azure.resourcemanager.databoxedge.implementation.models.MonitoringMetricConfigurationList; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in MonitoringConfigsClient. + */ +public final class MonitoringConfigsClientImpl implements MonitoringConfigsClient { + /** + * The proxy service used to perform REST calls. + */ + private final MonitoringConfigsService service; + + /** + * The service client containing this operation class. + */ + private final DataBoxEdgeManagementClientImpl client; + + /** + * Initializes an instance of MonitoringConfigsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + MonitoringConfigsClientImpl(DataBoxEdgeManagementClientImpl client) { + this.service + = RestProxy.create(MonitoringConfigsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for DataBoxEdgeManagementClientMonitoringConfigs to be used by the proxy + * service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "DataBoxEdgeManagementClientMonitoringConfigs") + public interface MonitoringConfigsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/monitoringConfig/default") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("deviceName") String deviceName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/monitoringConfig/default") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("deviceName") String deviceName, + @HeaderParam("Accept") String accept, Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/monitoringConfig/default") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("deviceName") String deviceName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") MonitoringMetricConfigurationInner monitoringMetricConfiguration, + Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/monitoringConfig/default") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response createOrUpdateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("deviceName") String deviceName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") MonitoringMetricConfigurationInner monitoringMetricConfiguration, + Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/monitoringConfig/default") + @ExpectedResponses({ 200, 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("deviceName") String deviceName, + Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/monitoringConfig/default") + @ExpectedResponses({ 200, 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response deleteSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("deviceName") String deviceName, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/monitoringConfig") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("deviceName") String deviceName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/monitoringConfig") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("deviceName") String deviceName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Gets a metric configuration of a role. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @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 metric configuration of a role along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, + String deviceName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, deviceName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a metric configuration of a role. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @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 metric configuration of a role on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String deviceName) { + return getWithResponseAsync(resourceGroupName, deviceName).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets a metric configuration of a role. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @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 a metric configuration of a role along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String deviceName, + Context context) { + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, deviceName, accept, context); + } + + /** + * Gets a metric configuration of a role. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @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 metric configuration of a role. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public MonitoringMetricConfigurationInner get(String resourceGroupName, String deviceName) { + return getWithResponse(resourceGroupName, deviceName, Context.NONE).getValue(); + } + + /** + * Creates a new metric configuration or updates an existing one for a role. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @param monitoringMetricConfiguration The metric configuration. + * @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 metric setting details for the role along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, + String deviceName, MonitoringMetricConfigurationInner monitoringMetricConfiguration) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, deviceName, contentType, accept, + monitoringMetricConfiguration, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates a new metric configuration or updates an existing one for a role. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @param monitoringMetricConfiguration The metric configuration. + * @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 metric setting details for the role along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response createOrUpdateWithResponse(String resourceGroupName, String deviceName, + MonitoringMetricConfigurationInner monitoringMetricConfiguration) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, deviceName, contentType, accept, + monitoringMetricConfiguration, Context.NONE); + } + + /** + * Creates a new metric configuration or updates an existing one for a role. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @param monitoringMetricConfiguration The metric configuration. + * @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 metric setting details for the role along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response createOrUpdateWithResponse(String resourceGroupName, String deviceName, + MonitoringMetricConfigurationInner monitoringMetricConfiguration, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, deviceName, contentType, accept, + monitoringMetricConfiguration, context); + } + + /** + * Creates a new metric configuration or updates an existing one for a role. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @param monitoringMetricConfiguration The metric configuration. + * @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 the metric setting details for the role. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, MonitoringMetricConfigurationInner> + beginCreateOrUpdateAsync(String resourceGroupName, String deviceName, + MonitoringMetricConfigurationInner monitoringMetricConfiguration) { + Mono>> mono + = createOrUpdateWithResponseAsync(resourceGroupName, deviceName, monitoringMetricConfiguration); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), MonitoringMetricConfigurationInner.class, + MonitoringMetricConfigurationInner.class, this.client.getContext()); + } + + /** + * Creates a new metric configuration or updates an existing one for a role. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @param monitoringMetricConfiguration The metric configuration. + * @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 SyncPoller} for polling of the metric setting details for the role. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, MonitoringMetricConfigurationInner> + beginCreateOrUpdate(String resourceGroupName, String deviceName, + MonitoringMetricConfigurationInner monitoringMetricConfiguration) { + Response response + = createOrUpdateWithResponse(resourceGroupName, deviceName, monitoringMetricConfiguration); + return this.client.getLroResult( + response, MonitoringMetricConfigurationInner.class, MonitoringMetricConfigurationInner.class, Context.NONE); + } + + /** + * Creates a new metric configuration or updates an existing one for a role. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @param monitoringMetricConfiguration The metric configuration. + * @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 SyncPoller} for polling of the metric setting details for the role. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, MonitoringMetricConfigurationInner> + beginCreateOrUpdate(String resourceGroupName, String deviceName, + MonitoringMetricConfigurationInner monitoringMetricConfiguration, Context context) { + Response response + = createOrUpdateWithResponse(resourceGroupName, deviceName, monitoringMetricConfiguration, context); + return this.client.getLroResult( + response, MonitoringMetricConfigurationInner.class, MonitoringMetricConfigurationInner.class, context); + } + + /** + * Creates a new metric configuration or updates an existing one for a role. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @param monitoringMetricConfiguration The metric configuration. + * @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 metric setting details for the role on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String resourceGroupName, String deviceName, + MonitoringMetricConfigurationInner monitoringMetricConfiguration) { + return beginCreateOrUpdateAsync(resourceGroupName, deviceName, monitoringMetricConfiguration).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates a new metric configuration or updates an existing one for a role. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @param monitoringMetricConfiguration The metric configuration. + * @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 metric setting details for the role. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public MonitoringMetricConfigurationInner createOrUpdate(String resourceGroupName, String deviceName, + MonitoringMetricConfigurationInner monitoringMetricConfiguration) { + return beginCreateOrUpdate(resourceGroupName, deviceName, monitoringMetricConfiguration).getFinalResult(); + } + + /** + * Creates a new metric configuration or updates an existing one for a role. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @param monitoringMetricConfiguration The metric configuration. + * @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 metric setting details for the role. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public MonitoringMetricConfigurationInner createOrUpdate(String resourceGroupName, String deviceName, + MonitoringMetricConfigurationInner monitoringMetricConfiguration, Context context) { + return beginCreateOrUpdate(resourceGroupName, deviceName, monitoringMetricConfiguration, context) + .getFinalResult(); + } + + /** + * deletes a new metric configuration for a role. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @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>> deleteWithResponseAsync(String resourceGroupName, String deviceName) { + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, deviceName, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * deletes a new metric configuration for a role. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @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 body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response deleteWithResponse(String resourceGroupName, String deviceName) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, deviceName, Context.NONE); + } + + /** + * deletes a new metric configuration for a role. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @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 body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response deleteWithResponse(String resourceGroupName, String deviceName, Context context) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, deviceName, context); + } + + /** + * deletes a new metric configuration for a role. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @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 long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String deviceName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, deviceName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * deletes a new metric configuration for a role. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @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 SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String deviceName) { + Response response = deleteWithResponse(resourceGroupName, deviceName); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); + } + + /** + * deletes a new metric configuration for a role. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @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 SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String deviceName, + Context context) { + Response response = deleteWithResponse(resourceGroupName, deviceName, context); + return this.client.getLroResult(response, Void.class, Void.class, context); + } + + /** + * deletes a new metric configuration for a role. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @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 deleteAsync(String resourceGroupName, String deviceName) { + return beginDeleteAsync(resourceGroupName, deviceName).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * deletes a new metric configuration for a role. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @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 delete(String resourceGroupName, String deviceName) { + beginDelete(resourceGroupName, deviceName).getFinalResult(); + } + + /** + * deletes a new metric configuration for a role. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String deviceName, Context context) { + beginDelete(resourceGroupName, deviceName, context).getFinalResult(); + } + + /** + * Lists metric configurations in a role. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @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 collection of metric configurations along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, + String deviceName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, deviceName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists metric configurations in a role. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @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 collection of metric configurations as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String deviceName) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, deviceName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists metric configurations in a role. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @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 collection of metric configurations along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, + String deviceName) { + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, deviceName, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Lists metric configurations in a role. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @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 collection of metric configurations along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, + String deviceName, Context context) { + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, deviceName, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Lists metric configurations in a role. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @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 collection of metric configurations as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String deviceName) { + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, deviceName), + nextLink -> listNextSinglePage(nextLink)); + } + + /** + * Lists metric configurations in a role. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @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 collection of metric configurations as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String deviceName, + Context context) { + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, deviceName, context), + nextLink -> listNextSinglePage(nextLink, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @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 collection of metric configurations along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @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 collection of metric configurations along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @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 collection of metric configurations along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink, Context context) { + final String accept = "application/json"; + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/MonitoringConfigsImpl.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/MonitoringConfigsImpl.java new file mode 100644 index 000000000000..340bf2481b44 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/MonitoringConfigsImpl.java @@ -0,0 +1,103 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.databoxedge.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.databoxedge.fluent.MonitoringConfigsClient; +import com.azure.resourcemanager.databoxedge.fluent.models.MonitoringMetricConfigurationInner; +import com.azure.resourcemanager.databoxedge.models.MonitoringConfigs; +import com.azure.resourcemanager.databoxedge.models.MonitoringMetricConfiguration; + +public final class MonitoringConfigsImpl implements MonitoringConfigs { + private static final ClientLogger LOGGER = new ClientLogger(MonitoringConfigsImpl.class); + + private final MonitoringConfigsClient innerClient; + + private final com.azure.resourcemanager.databoxedge.DataBoxEdgeManager serviceManager; + + public MonitoringConfigsImpl(MonitoringConfigsClient innerClient, + com.azure.resourcemanager.databoxedge.DataBoxEdgeManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse(String resourceGroupName, String deviceName, + Context context) { + Response inner + = this.serviceClient().getWithResponse(resourceGroupName, deviceName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new MonitoringMetricConfigurationImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public MonitoringMetricConfiguration get(String resourceGroupName, String deviceName) { + MonitoringMetricConfigurationInner inner = this.serviceClient().get(resourceGroupName, deviceName); + if (inner != null) { + return new MonitoringMetricConfigurationImpl(inner, this.manager()); + } else { + return null; + } + } + + public MonitoringMetricConfiguration createOrUpdate(String resourceGroupName, String deviceName, + MonitoringMetricConfigurationInner monitoringMetricConfiguration) { + MonitoringMetricConfigurationInner inner + = this.serviceClient().createOrUpdate(resourceGroupName, deviceName, monitoringMetricConfiguration); + if (inner != null) { + return new MonitoringMetricConfigurationImpl(inner, this.manager()); + } else { + return null; + } + } + + public MonitoringMetricConfiguration createOrUpdate(String resourceGroupName, String deviceName, + MonitoringMetricConfigurationInner monitoringMetricConfiguration, Context context) { + MonitoringMetricConfigurationInner inner = this.serviceClient() + .createOrUpdate(resourceGroupName, deviceName, monitoringMetricConfiguration, context); + if (inner != null) { + return new MonitoringMetricConfigurationImpl(inner, this.manager()); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String deviceName) { + this.serviceClient().delete(resourceGroupName, deviceName); + } + + public void delete(String resourceGroupName, String deviceName, Context context) { + this.serviceClient().delete(resourceGroupName, deviceName, context); + } + + public PagedIterable list(String resourceGroupName, String deviceName) { + PagedIterable inner + = this.serviceClient().list(resourceGroupName, deviceName); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new MonitoringMetricConfigurationImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String deviceName, + Context context) { + PagedIterable inner + = this.serviceClient().list(resourceGroupName, deviceName, context); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new MonitoringMetricConfigurationImpl(inner1, this.manager())); + } + + private MonitoringConfigsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.databoxedge.DataBoxEdgeManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/MonitoringMetricConfigurationImpl.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/MonitoringMetricConfigurationImpl.java new file mode 100644 index 000000000000..0109fa4d6adc --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/MonitoringMetricConfigurationImpl.java @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.databoxedge.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.databoxedge.fluent.models.MonitoringMetricConfigurationInner; +import com.azure.resourcemanager.databoxedge.models.MetricConfiguration; +import com.azure.resourcemanager.databoxedge.models.MonitoringMetricConfiguration; +import java.util.Collections; +import java.util.List; + +public final class MonitoringMetricConfigurationImpl implements MonitoringMetricConfiguration { + private MonitoringMetricConfigurationInner innerObject; + + private final com.azure.resourcemanager.databoxedge.DataBoxEdgeManager serviceManager; + + MonitoringMetricConfigurationImpl(MonitoringMetricConfigurationInner innerObject, + com.azure.resourcemanager.databoxedge.DataBoxEdgeManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public List metricConfigurations() { + List inner = this.innerModel().metricConfigurations(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public MonitoringMetricConfigurationInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.databoxedge.DataBoxEdgeManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/NetworkSettingsImpl.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/NetworkSettingsImpl.java index 641d16e3f4d6..a49a329d9d4d 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/NetworkSettingsImpl.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/NetworkSettingsImpl.java @@ -1,9 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.implementation; +import com.azure.core.management.SystemData; import com.azure.resourcemanager.databoxedge.fluent.models.NetworkSettingsInner; import com.azure.resourcemanager.databoxedge.models.NetworkAdapter; import com.azure.resourcemanager.databoxedge.models.NetworkSettings; @@ -33,6 +34,10 @@ public String type() { return this.innerModel().type(); } + public SystemData systemData() { + return this.innerModel().systemData(); + } + public List networkAdapters() { List inner = this.innerModel().networkAdapters(); if (inner != null) { diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/NodeImpl.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/NodeImpl.java index 2a358ee53ac7..a62e59b9a81f 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/NodeImpl.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/NodeImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.implementation; diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/NodesClientImpl.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/NodesClientImpl.java index 55cc67ef0181..12be9de44066 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/NodesClientImpl.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/NodesClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.implementation; @@ -27,7 +27,7 @@ import com.azure.core.util.FluxUtil; import com.azure.resourcemanager.databoxedge.fluent.NodesClient; import com.azure.resourcemanager.databoxedge.fluent.models.NodeInner; -import com.azure.resourcemanager.databoxedge.models.NodeList; +import com.azure.resourcemanager.databoxedge.implementation.models.NodeList; import reactor.core.publisher.Mono; /** @@ -58,24 +58,49 @@ public final class NodesClientImpl implements NodesClient { * The interface defining all the services for DataBoxEdgeManagementClientNodes to be used by the proxy service to * perform REST calls. */ - @Host("{$host}") - @ServiceInterface(name = "DataBoxEdgeManagemen") + @Host("{endpoint}") + @ServiceInterface(name = "DataBoxEdgeManagementClientNodes") public interface NodesService { @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/nodes") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByDataBoxEdgeDevice(@HostParam("$host") String endpoint, - @PathParam("deviceName") String deviceName, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, + Mono> listByDataBoxEdgeDevice(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("deviceName") String deviceName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/nodes") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listByDataBoxEdgeDeviceSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("deviceName") String deviceName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByDataBoxEdgeDeviceNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listByDataBoxEdgeDeviceNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** * Gets all the nodes currently configured under this Data Box Edge device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param resourceGroupName The resource group name. * @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. @@ -83,110 +108,82 @@ Mono> listByDataBoxEdgeDevice(@HostParam("$host") String endp * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByDataBoxEdgeDeviceSinglePageAsync(String deviceName, - String resourceGroupName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (deviceName == null) { - return Mono.error(new IllegalArgumentException("Parameter deviceName 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.")); - } + private Mono> listByDataBoxEdgeDeviceSinglePageAsync(String resourceGroupName, + String deviceName) { final String accept = "application/json"; return FluxUtil - .withContext(context -> service.listByDataBoxEdgeDevice(this.client.getEndpoint(), deviceName, - this.client.getSubscriptionId(), resourceGroupName, this.client.getApiVersion(), accept, context)) + .withContext( + context -> service.listByDataBoxEdgeDevice(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, deviceName, accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), - res.getHeaders(), res.getValue().value(), null, null)) + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Gets all the nodes currently configured under this Data Box Edge device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param resourceGroupName The resource group name. - * @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 all the nodes currently configured under this Data Box Edge device along with {@link PagedResponse} on - * successful completion of {@link Mono}. + * @return all the nodes currently configured under this Data Box Edge device as paginated response with + * {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByDataBoxEdgeDeviceSinglePageAsync(String deviceName, - String resourceGroupName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (deviceName == null) { - return Mono.error(new IllegalArgumentException("Parameter deviceName 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.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByDataBoxEdgeDevice(this.client.getEndpoint(), deviceName, this.client.getSubscriptionId(), - resourceGroupName, this.client.getApiVersion(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), null, null)); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByDataBoxEdgeDeviceAsync(String resourceGroupName, String deviceName) { + return new PagedFlux<>(() -> listByDataBoxEdgeDeviceSinglePageAsync(resourceGroupName, deviceName), + nextLink -> listByDataBoxEdgeDeviceNextSinglePageAsync(nextLink)); } /** * Gets all the nodes currently configured under this Data Box Edge device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param resourceGroupName The resource group name. * @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 all the nodes currently configured under this Data Box Edge device as paginated response with - * {@link PagedFlux}. + * @return all the nodes currently configured under this Data Box Edge device along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByDataBoxEdgeDeviceAsync(String deviceName, String resourceGroupName) { - return new PagedFlux<>(() -> listByDataBoxEdgeDeviceSinglePageAsync(deviceName, resourceGroupName)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByDataBoxEdgeDeviceSinglePage(String resourceGroupName, String deviceName) { + final String accept = "application/json"; + Response res + = service.listByDataBoxEdgeDeviceSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, deviceName, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** * Gets all the nodes currently configured under this Data Box Edge device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param resourceGroupName The resource group name. * @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 all the nodes currently configured under this Data Box Edge device as paginated response with - * {@link PagedFlux}. + * @return all the nodes currently configured under this Data Box Edge device along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByDataBoxEdgeDeviceAsync(String deviceName, String resourceGroupName, + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByDataBoxEdgeDeviceSinglePage(String resourceGroupName, String deviceName, Context context) { - return new PagedFlux<>(() -> listByDataBoxEdgeDeviceSinglePageAsync(deviceName, resourceGroupName, context)); + final String accept = "application/json"; + Response res + = service.listByDataBoxEdgeDeviceSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, deviceName, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** * Gets all the nodes currently configured under this Data Box Edge device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param resourceGroupName The resource group name. * @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. @@ -194,15 +191,16 @@ private PagedFlux listByDataBoxEdgeDeviceAsync(String deviceName, Str * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByDataBoxEdgeDevice(String deviceName, String resourceGroupName) { - return new PagedIterable<>(listByDataBoxEdgeDeviceAsync(deviceName, resourceGroupName)); + public PagedIterable listByDataBoxEdgeDevice(String resourceGroupName, String deviceName) { + return new PagedIterable<>(() -> listByDataBoxEdgeDeviceSinglePage(resourceGroupName, deviceName), + nextLink -> listByDataBoxEdgeDeviceNextSinglePage(nextLink)); } /** * Gets all the nodes currently configured under this Data Box Edge device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param resourceGroupName The resource group name. * @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. @@ -211,8 +209,67 @@ public PagedIterable listByDataBoxEdgeDevice(String deviceName, Strin * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByDataBoxEdgeDevice(String deviceName, String resourceGroupName, + public PagedIterable listByDataBoxEdgeDevice(String resourceGroupName, String deviceName, Context context) { - return new PagedIterable<>(listByDataBoxEdgeDeviceAsync(deviceName, resourceGroupName, context)); + return new PagedIterable<>(() -> listByDataBoxEdgeDeviceSinglePage(resourceGroupName, deviceName, context), + nextLink -> listByDataBoxEdgeDeviceNextSinglePage(nextLink, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @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 all the nodes currently configured under this Data Box Edge device along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByDataBoxEdgeDeviceNextSinglePageAsync(String nextLink) { + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByDataBoxEdgeDeviceNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @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 all the nodes currently configured under this Data Box Edge device along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByDataBoxEdgeDeviceNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listByDataBoxEdgeDeviceNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @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 all the nodes currently configured under this Data Box Edge device along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByDataBoxEdgeDeviceNextSinglePage(String nextLink, Context context) { + final String accept = "application/json"; + Response res + = service.listByDataBoxEdgeDeviceNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } } diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/NodesImpl.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/NodesImpl.java index 831c02d10412..12ac59e967c8 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/NodesImpl.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/NodesImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.implementation; @@ -24,14 +24,14 @@ public NodesImpl(NodesClient innerClient, com.azure.resourcemanager.databoxedge. this.serviceManager = serviceManager; } - public PagedIterable listByDataBoxEdgeDevice(String deviceName, String resourceGroupName) { - PagedIterable inner = this.serviceClient().listByDataBoxEdgeDevice(deviceName, resourceGroupName); + public PagedIterable listByDataBoxEdgeDevice(String resourceGroupName, String deviceName) { + PagedIterable inner = this.serviceClient().listByDataBoxEdgeDevice(resourceGroupName, deviceName); return ResourceManagerUtils.mapPage(inner, inner1 -> new NodeImpl(inner1, this.manager())); } - public PagedIterable listByDataBoxEdgeDevice(String deviceName, String resourceGroupName, Context context) { + public PagedIterable listByDataBoxEdgeDevice(String resourceGroupName, String deviceName, Context context) { PagedIterable inner - = this.serviceClient().listByDataBoxEdgeDevice(deviceName, resourceGroupName, context); + = this.serviceClient().listByDataBoxEdgeDevice(resourceGroupName, deviceName, context); return ResourceManagerUtils.mapPage(inner, inner1 -> new NodeImpl(inner1, this.manager())); } diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/OperationImpl.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/OperationImpl.java index 55d451dd95a3..9d59a8156f9c 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/OperationImpl.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/OperationImpl.java @@ -1,13 +1,14 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.implementation; import com.azure.resourcemanager.databoxedge.fluent.models.OperationInner; +import com.azure.resourcemanager.databoxedge.models.ActionType; import com.azure.resourcemanager.databoxedge.models.Operation; import com.azure.resourcemanager.databoxedge.models.OperationDisplay; -import com.azure.resourcemanager.databoxedge.models.ServiceSpecification; +import com.azure.resourcemanager.databoxedge.models.Origin; public final class OperationImpl implements Operation { private OperationInner innerObject; @@ -23,16 +24,20 @@ public String name() { return this.innerModel().name(); } + public Boolean isDataAction() { + return this.innerModel().isDataAction(); + } + public OperationDisplay display() { return this.innerModel().display(); } - public String origin() { + public Origin origin() { return this.innerModel().origin(); } - public ServiceSpecification serviceSpecification() { - return this.innerModel().serviceSpecification(); + public ActionType actionType() { + return this.innerModel().actionType(); } public OperationInner innerModel() { diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/OperationsClientImpl.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/OperationsClientImpl.java index fa9784161791..49ed959f7cfa 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/OperationsClientImpl.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/OperationsClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.implementation; @@ -27,7 +27,7 @@ import com.azure.core.util.FluxUtil; import com.azure.resourcemanager.databoxedge.fluent.OperationsClient; import com.azure.resourcemanager.databoxedge.fluent.models.OperationInner; -import com.azure.resourcemanager.databoxedge.models.OperationsList; +import com.azure.resourcemanager.databoxedge.implementation.models.OperationListResult; import reactor.core.publisher.Mono; /** @@ -59,38 +59,48 @@ public final class OperationsClientImpl implements OperationsClient { * The interface defining all the services for DataBoxEdgeManagementClientOperations to be used by the proxy service * to perform REST calls. */ - @Host("{$host}") - @ServiceInterface(name = "DataBoxEdgeManagemen") + @Host("{endpoint}") + @ServiceInterface(name = "DataBoxEdgeManagementClientOperations") public interface OperationsService { @Headers({ "Content-Type: application/json" }) @Get("/providers/Microsoft.DataBoxEdge/operations") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, + Mono> list(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Get("/providers/Microsoft.DataBoxEdge/operations") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); + Response listNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** - * List all the supported operations. + * List the operations for the provider. * * @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 list of operations used for the discovery of available provider operations along with - * {@link PagedResponse} on successful completion of {@link Mono}. + * @return a list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse} on + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync() { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil .withContext( @@ -101,83 +111,78 @@ private Mono> listSinglePageAsync() { } /** - * List all the supported operations. + * List the operations for the provider. * - * @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 list of operations used for the discovery of available provider operations along with - * {@link PagedResponse} on successful completion of {@link Mono}. + * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with + * {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); } /** - * List all the supported operations. + * List the operations for the provider. * * @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 list of operations used for the discovery of available provider operations as paginated response with - * {@link PagedFlux}. + * @return a list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync() { - return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage() { + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** - * List all the supported operations. + * List the operations for the provider. * * @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 list of operations used for the discovery of available provider operations as paginated response with - * {@link PagedFlux}. + * @return a list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(context), - nextLink -> listNextSinglePageAsync(nextLink, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(Context context) { + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** - * List all the supported operations. + * List the operations for the provider. * * @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 list of operations used for the discovery of available provider operations as paginated response with + * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list() { - return new PagedIterable<>(listAsync()); + return new PagedIterable<>(() -> listSinglePage(), nextLink -> listNextSinglePage(nextLink)); } /** - * List all the supported operations. + * List the operations for the provider. * * @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 list of operations used for the discovery of available provider operations as paginated response with + * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(Context context) { - return new PagedIterable<>(listAsync(context)); + return new PagedIterable<>(() -> listSinglePage(context), nextLink -> listNextSinglePage(nextLink, context)); } /** @@ -187,18 +192,11 @@ public PagedIterable list(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 the list of operations used for the discovery of available provider operations along with - * {@link PagedResponse} on successful completion of {@link Mono}. + * @return a list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse} on + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), @@ -206,6 +204,24 @@ private Mono> listNextSinglePageAsync(String nextL .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @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 list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + /** * Get the next page of items. * @@ -214,22 +230,13 @@ private Mono> listNextSinglePageAsync(String nextL * @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 list of operations used for the discovery of available provider operations along with - * {@link PagedResponse} on successful completion of {@link Mono}. + * @return a list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } + private PagedResponse listNextSinglePage(String nextLink, Context context) { final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } } diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/OperationsImpl.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/OperationsImpl.java index 0851da915e7c..28696d22e45c 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/OperationsImpl.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/OperationsImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.implementation; diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/OperationsStatusClientImpl.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/OperationsStatusClientImpl.java index 62ec7ce185cc..fa68adf338d9 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/OperationsStatusClientImpl.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/OperationsStatusClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.implementation; @@ -54,25 +54,34 @@ public final class OperationsStatusClientImpl implements OperationsStatusClient * The interface defining all the services for DataBoxEdgeManagementClientOperationsStatus to be used by the proxy * service to perform REST calls. */ - @Host("{$host}") - @ServiceInterface(name = "DataBoxEdgeManagemen") + @Host("{endpoint}") + @ServiceInterface(name = "DataBoxEdgeManagementClientOperationsStatus") public interface OperationsStatusService { @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/operationsStatus/{name}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("$host") String endpoint, @PathParam("deviceName") String deviceName, - @PathParam("name") String name, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("deviceName") String deviceName, + @PathParam("name") String name, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/operationsStatus/{name}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("deviceName") String deviceName, + @PathParam("name") String name, @HeaderParam("Accept") String accept, Context context); } /** * Gets the details of a specified job on a Data Box Edge/Data Box Gateway device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. * @param name The job name. - * @param resourceGroupName The resource group name. * @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. @@ -80,78 +89,20 @@ Mono> get(@HostParam("$host") String endpoint, @PathParam("de * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String deviceName, String name, String resourceGroupName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (deviceName == null) { - return Mono.error(new IllegalArgumentException("Parameter deviceName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name 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.")); - } + private Mono> getWithResponseAsync(String resourceGroupName, String deviceName, String name) { final String accept = "application/json"; return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), deviceName, name, - this.client.getSubscriptionId(), resourceGroupName, this.client.getApiVersion(), accept, context)) + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, deviceName, name, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Gets the details of a specified job on a Data Box Edge/Data Box Gateway device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. * @param name The job name. - * @param resourceGroupName The resource group name. - * @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 details of a specified job on a Data Box Edge/Data Box Gateway device along with {@link Response} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String deviceName, String name, String resourceGroupName, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (deviceName == null) { - return Mono.error(new IllegalArgumentException("Parameter deviceName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name 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.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), deviceName, name, this.client.getSubscriptionId(), - resourceGroupName, this.client.getApiVersion(), accept, context); - } - - /** - * Gets the details of a specified job on a Data Box Edge/Data Box Gateway device. - * - * @param deviceName The device name. - * @param name The job name. - * @param resourceGroupName The resource group name. * @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. @@ -159,17 +110,17 @@ private Mono> getWithResponseAsync(String deviceName, String * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String deviceName, String name, String resourceGroupName) { - return getWithResponseAsync(deviceName, name, resourceGroupName) + private Mono getAsync(String resourceGroupName, String deviceName, String name) { + return getWithResponseAsync(resourceGroupName, deviceName, name) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * Gets the details of a specified job on a Data Box Edge/Data Box Gateway device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. * @param name The job name. - * @param resourceGroupName The resource group name. * @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. @@ -177,24 +128,26 @@ private Mono getAsync(String deviceName, String name, String resourceG * @return the details of a specified job on a Data Box Edge/Data Box Gateway device along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String deviceName, String name, String resourceGroupName, + public Response getWithResponse(String resourceGroupName, String deviceName, String name, Context context) { - return getWithResponseAsync(deviceName, name, resourceGroupName, context).block(); + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, deviceName, name, accept, context); } /** * Gets the details of a specified job on a Data Box Edge/Data Box Gateway device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. * @param name The job name. - * @param resourceGroupName The resource group name. * @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 details of a specified job on a Data Box Edge/Data Box Gateway device. */ @ServiceMethod(returns = ReturnType.SINGLE) - public JobInner get(String deviceName, String name, String resourceGroupName) { - return getWithResponse(deviceName, name, resourceGroupName, Context.NONE).getValue(); + public JobInner get(String resourceGroupName, String deviceName, String name) { + return getWithResponse(resourceGroupName, deviceName, name, Context.NONE).getValue(); } } diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/OperationsStatusImpl.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/OperationsStatusImpl.java index 20130a983e08..eaa356b8be0c 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/OperationsStatusImpl.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/OperationsStatusImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.implementation; @@ -26,8 +26,8 @@ public OperationsStatusImpl(OperationsStatusClient innerClient, this.serviceManager = serviceManager; } - public Response getWithResponse(String deviceName, String name, String resourceGroupName, Context context) { - Response inner = this.serviceClient().getWithResponse(deviceName, name, resourceGroupName, context); + public Response getWithResponse(String resourceGroupName, String deviceName, String name, Context context) { + Response inner = this.serviceClient().getWithResponse(resourceGroupName, deviceName, name, context); if (inner != null) { return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), new JobImpl(inner.getValue(), this.manager())); @@ -36,8 +36,8 @@ public Response getWithResponse(String deviceName, String name, String reso } } - public Job get(String deviceName, String name, String resourceGroupName) { - JobInner inner = this.serviceClient().get(deviceName, name, resourceGroupName); + public Job get(String resourceGroupName, String deviceName, String name) { + JobInner inner = this.serviceClient().get(resourceGroupName, deviceName, name); if (inner != null) { return new JobImpl(inner, this.manager()); } else { diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/OrderImpl.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/OrderImpl.java index fc67d033c293..6bce72fb3683 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/OrderImpl.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/OrderImpl.java @@ -1,14 +1,16 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.implementation; +import com.azure.core.management.SystemData; import com.azure.resourcemanager.databoxedge.fluent.models.OrderInner; import com.azure.resourcemanager.databoxedge.models.Address; import com.azure.resourcemanager.databoxedge.models.ContactDetails; import com.azure.resourcemanager.databoxedge.models.Order; import com.azure.resourcemanager.databoxedge.models.OrderStatus; +import com.azure.resourcemanager.databoxedge.models.ShipmentType; import com.azure.resourcemanager.databoxedge.models.TrackingInfo; import java.util.Collections; import java.util.List; @@ -35,6 +37,18 @@ public String type() { return this.innerModel().type(); } + public String kind() { + return this.innerModel().kind(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public String orderId() { + return this.innerModel().orderId(); + } + public ContactDetails contactInformation() { return this.innerModel().contactInformation(); } @@ -78,6 +92,10 @@ public List returnTrackingInfo() { } } + public ShipmentType shipmentType() { + return this.innerModel().shipmentType(); + } + public OrderInner innerModel() { return this.innerObject; } diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/OrdersClientImpl.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/OrdersClientImpl.java index 06b74822c268..ee5de01becfd 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/OrdersClientImpl.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/OrdersClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.implementation; @@ -13,6 +13,7 @@ import com.azure.core.annotation.Host; import com.azure.core.annotation.HostParam; import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; import com.azure.core.annotation.Put; import com.azure.core.annotation.QueryParam; import com.azure.core.annotation.ReturnType; @@ -27,13 +28,15 @@ import com.azure.core.http.rest.RestProxy; import com.azure.core.management.exception.ManagementException; import com.azure.core.management.polling.PollResult; +import com.azure.core.util.BinaryData; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; import com.azure.core.util.polling.PollerFlux; import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.databoxedge.fluent.OrdersClient; +import com.azure.resourcemanager.databoxedge.fluent.models.DCAccessCodeInner; import com.azure.resourcemanager.databoxedge.fluent.models.OrderInner; -import com.azure.resourcemanager.databoxedge.models.OrderList; +import com.azure.resourcemanager.databoxedge.implementation.models.OrderList; import java.nio.ByteBuffer; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; @@ -66,43 +69,97 @@ public final class OrdersClientImpl implements OrdersClient { * The interface defining all the services for DataBoxEdgeManagementClientOrders to be used by the proxy service to * perform REST calls. */ - @Host("{$host}") - @ServiceInterface(name = "DataBoxEdgeManagemen") + @Host("{endpoint}") + @ServiceInterface(name = "DataBoxEdgeManagementClientOrders") public interface OrdersService { @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/orders") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/orders/default") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByDataBoxEdgeDevice(@HostParam("$host") String endpoint, - @PathParam("deviceName") String deviceName, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("deviceName") String deviceName, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/orders/default") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("$host") String endpoint, @PathParam("deviceName") String deviceName, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, + Response getSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("deviceName") String deviceName, @HeaderParam("Accept") String accept, Context context); - @Headers({ "Content-Type: application/json" }) @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/orders/default") @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdate(@HostParam("$host") String endpoint, - @PathParam("deviceName") String deviceName, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") OrderInner order, @HeaderParam("Accept") String accept, Context context); + Mono>> createOrUpdate(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("deviceName") String deviceName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") OrderInner order, Context context); - @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/orders/default") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response createOrUpdateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("deviceName") String deviceName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") OrderInner order, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/orders/default") + @ExpectedResponses({ 200, 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("deviceName") String deviceName, + Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/orders/default") @ExpectedResponses({ 200, 202, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete(@HostParam("$host") String endpoint, - @PathParam("deviceName") String deviceName, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, + Response deleteSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("deviceName") String deviceName, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/orders") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByDataBoxEdgeDevice(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("deviceName") String deviceName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/orders") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listByDataBoxEdgeDeviceSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("deviceName") String deviceName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/orders/default/listDCAccessCode") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listDCAccessCode(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("deviceName") String deviceName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/orders/default/listDCAccessCode") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listDCAccessCodeSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("deviceName") String deviceName, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @@ -110,689 +167,584 @@ Mono>> delete(@HostParam("$host") String endpoint, @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByDataBoxEdgeDeviceNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listByDataBoxEdgeDeviceNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** - * Lists all the orders related to a Data Box Edge/Data Box Gateway device. + * Gets a specific order by name. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param resourceGroupName The resource group name. * @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 order entities along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return a specific order by name along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByDataBoxEdgeDeviceSinglePageAsync(String deviceName, - String resourceGroupName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (deviceName == null) { - return Mono.error(new IllegalArgumentException("Parameter deviceName 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.")); - } + private Mono> getWithResponseAsync(String resourceGroupName, String deviceName) { final String accept = "application/json"; return FluxUtil - .withContext(context -> service.listByDataBoxEdgeDevice(this.client.getEndpoint(), deviceName, - this.client.getSubscriptionId(), resourceGroupName, this.client.getApiVersion(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), - res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, deviceName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Lists all the orders related to a Data Box Edge/Data Box Gateway device. + * Gets a specific order by name. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param resourceGroupName The resource group name. - * @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 list of order entities along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return a specific order by name on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByDataBoxEdgeDeviceSinglePageAsync(String deviceName, - String resourceGroupName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (deviceName == null) { - return Mono.error(new IllegalArgumentException("Parameter deviceName 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.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByDataBoxEdgeDevice(this.client.getEndpoint(), deviceName, this.client.getSubscriptionId(), - resourceGroupName, this.client.getApiVersion(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + private Mono getAsync(String resourceGroupName, String deviceName) { + return getWithResponseAsync(resourceGroupName, deviceName).flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Lists all the orders related to a Data Box Edge/Data Box Gateway device. + * Gets a specific order by name. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param resourceGroupName The resource group name. + * @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 list of order entities as paginated response with {@link PagedFlux}. + * @return a specific order by name along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByDataBoxEdgeDeviceAsync(String deviceName, String resourceGroupName) { - return new PagedFlux<>(() -> listByDataBoxEdgeDeviceSinglePageAsync(deviceName, resourceGroupName), - nextLink -> listByDataBoxEdgeDeviceNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String deviceName, Context context) { + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, deviceName, accept, context); } /** - * Lists all the orders related to a Data Box Edge/Data Box Gateway device. + * Gets a specific order by name. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param resourceGroupName The resource group name. - * @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 list of order entities as paginated response with {@link PagedFlux}. + * @return a specific order by name. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByDataBoxEdgeDeviceAsync(String deviceName, String resourceGroupName, - Context context) { - return new PagedFlux<>(() -> listByDataBoxEdgeDeviceSinglePageAsync(deviceName, resourceGroupName, context), - nextLink -> listByDataBoxEdgeDeviceNextSinglePageAsync(nextLink, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + public OrderInner get(String resourceGroupName, String deviceName) { + return getWithResponse(resourceGroupName, deviceName, Context.NONE).getValue(); } /** - * Lists all the orders related to a Data Box Edge/Data Box Gateway device. + * Creates or updates an order. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param resourceGroupName The resource group name. + * @param order The order to be created or updated. * @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 order entities as paginated response with {@link PagedIterable}. + * @return the order details along with {@link Response} on successful completion of {@link Mono}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByDataBoxEdgeDevice(String deviceName, String resourceGroupName) { - return new PagedIterable<>(listByDataBoxEdgeDeviceAsync(deviceName, resourceGroupName)); + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, + String deviceName, OrderInner order) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, deviceName, contentType, accept, order, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Lists all the orders related to a Data Box Edge/Data Box Gateway device. + * Creates or updates an order. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param resourceGroupName The resource group name. - * @param context The context to associate with this operation. + * @param order The order to be created or updated. * @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 order entities as paginated response with {@link PagedIterable}. + * @return the order details along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByDataBoxEdgeDevice(String deviceName, String resourceGroupName, - Context context) { - return new PagedIterable<>(listByDataBoxEdgeDeviceAsync(deviceName, resourceGroupName, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + private Response createOrUpdateWithResponse(String resourceGroupName, String deviceName, + OrderInner order) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, deviceName, contentType, accept, order, Context.NONE); } /** - * Gets a specific order by name. + * Creates or updates an order. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param resourceGroupName The resource group name. + * @param order The order to be created or updated. + * @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 a specific order by name along with {@link Response} on successful completion of {@link Mono}. + * @return the order details along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String deviceName, String resourceGroupName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (deviceName == null) { - return Mono.error(new IllegalArgumentException("Parameter deviceName 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.")); - } + private Response createOrUpdateWithResponse(String resourceGroupName, String deviceName, + OrderInner order, Context context) { + final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), deviceName, this.client.getSubscriptionId(), - resourceGroupName, this.client.getApiVersion(), accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, deviceName, contentType, accept, order, context); } /** - * Gets a specific order by name. + * Creates or updates an order. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param resourceGroupName The resource group name. - * @param context The context to associate with this operation. + * @param order The order to be created or updated. * @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 specific order by name along with {@link Response} on successful completion of {@link Mono}. + * @return the {@link PollerFlux} for polling of the order details. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String deviceName, String resourceGroupName, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (deviceName == null) { - return Mono.error(new IllegalArgumentException("Parameter deviceName 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.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), deviceName, this.client.getSubscriptionId(), resourceGroupName, - this.client.getApiVersion(), accept, context); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, OrderInner> beginCreateOrUpdateAsync(String resourceGroupName, + String deviceName, OrderInner order) { + Mono>> mono = createOrUpdateWithResponseAsync(resourceGroupName, deviceName, order); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), OrderInner.class, + OrderInner.class, this.client.getContext()); } /** - * Gets a specific order by name. + * Creates or updates an order. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param resourceGroupName The resource group name. + * @param order The order to be created or updated. * @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 specific order by name on successful completion of {@link Mono}. + * @return the {@link SyncPoller} for polling of the order details. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String deviceName, String resourceGroupName) { - return getWithResponseAsync(deviceName, resourceGroupName).flatMap(res -> Mono.justOrEmpty(res.getValue())); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, OrderInner> beginCreateOrUpdate(String resourceGroupName, + String deviceName, OrderInner order) { + Response response = createOrUpdateWithResponse(resourceGroupName, deviceName, order); + return this.client.getLroResult(response, OrderInner.class, OrderInner.class, + Context.NONE); } /** - * Gets a specific order by name. + * Creates or updates an order. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param resourceGroupName The resource group name. + * @param order The order to be created or updated. * @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 a specific order by name along with {@link Response}. + * @return the {@link SyncPoller} for polling of the order details. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String deviceName, String resourceGroupName, Context context) { - return getWithResponseAsync(deviceName, resourceGroupName, context).block(); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, OrderInner> beginCreateOrUpdate(String resourceGroupName, + String deviceName, OrderInner order, Context context) { + Response response = createOrUpdateWithResponse(resourceGroupName, deviceName, order, context); + return this.client.getLroResult(response, OrderInner.class, OrderInner.class, context); } /** - * Gets a specific order by name. + * Creates or updates an order. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param resourceGroupName The resource group name. + * @param order The order to be created or updated. * @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 specific order by name. + * @return the order details on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public OrderInner get(String deviceName, String resourceGroupName) { - return getWithResponse(deviceName, resourceGroupName, Context.NONE).getValue(); + private Mono createOrUpdateAsync(String resourceGroupName, String deviceName, OrderInner order) { + return beginCreateOrUpdateAsync(resourceGroupName, deviceName, order).last() + .flatMap(this.client::getLroFinalResultOrError); } /** * Creates or updates an order. * - * @param deviceName The order details of a device. - * @param resourceGroupName The resource group name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. * @param order The order to be created or updated. * @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 order details along with {@link Response} on successful completion of {@link Mono}. + * @return the order details. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync(String deviceName, - String resourceGroupName, OrderInner order) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (deviceName == null) { - return Mono.error(new IllegalArgumentException("Parameter deviceName 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 (order == null) { - return Mono.error(new IllegalArgumentException("Parameter order is required and cannot be null.")); - } else { - order.validate(); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.createOrUpdate(this.client.getEndpoint(), deviceName, - this.client.getSubscriptionId(), resourceGroupName, this.client.getApiVersion(), order, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + public OrderInner createOrUpdate(String resourceGroupName, String deviceName, OrderInner order) { + return beginCreateOrUpdate(resourceGroupName, deviceName, order).getFinalResult(); } /** * Creates or updates an order. * - * @param deviceName The order details of a device. - * @param resourceGroupName The resource group name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. * @param order The order to be created or updated. * @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 order details along with {@link Response} on successful completion of {@link Mono}. + * @return the order details. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync(String deviceName, - String resourceGroupName, OrderInner order, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (deviceName == null) { - return Mono.error(new IllegalArgumentException("Parameter deviceName 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 (order == null) { - return Mono.error(new IllegalArgumentException("Parameter order is required and cannot be null.")); - } else { - order.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.createOrUpdate(this.client.getEndpoint(), deviceName, this.client.getSubscriptionId(), - resourceGroupName, this.client.getApiVersion(), order, accept, context); + public OrderInner createOrUpdate(String resourceGroupName, String deviceName, OrderInner order, Context context) { + return beginCreateOrUpdate(resourceGroupName, deviceName, order, context).getFinalResult(); } /** - * Creates or updates an order. + * Deletes the order related to the device. * - * @param deviceName The order details of a device. - * @param resourceGroupName The resource group name. - * @param order The order to be created or updated. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. * @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 the order details. + * @return the {@link Response} on successful completion of {@link Mono}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, OrderInner> beginCreateOrUpdateAsync(String deviceName, - String resourceGroupName, OrderInner order) { - Mono>> mono = createOrUpdateWithResponseAsync(deviceName, resourceGroupName, order); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), OrderInner.class, - OrderInner.class, this.client.getContext()); + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String deviceName) { + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, deviceName, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Creates or updates an order. + * Deletes the order related to the device. * - * @param deviceName The order details of a device. - * @param resourceGroupName The resource group name. - * @param order The order to be created or updated. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @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 body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response deleteWithResponse(String resourceGroupName, String deviceName) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, deviceName, Context.NONE); + } + + /** + * Deletes the order related to the device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. * @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 PollerFlux} for polling of the order details. + * @return the response body along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, OrderInner> beginCreateOrUpdateAsync(String deviceName, - String resourceGroupName, OrderInner order, Context context) { - context = this.client.mergeContext(context); - Mono>> mono - = createOrUpdateWithResponseAsync(deviceName, resourceGroupName, order, context); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), OrderInner.class, - OrderInner.class, context); + @ServiceMethod(returns = ReturnType.SINGLE) + private Response deleteWithResponse(String resourceGroupName, String deviceName, Context context) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, deviceName, context); } /** - * Creates or updates an order. + * Deletes the order related to the device. * - * @param deviceName The order details of a device. - * @param resourceGroupName The resource group name. - * @param order The order to be created or updated. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. * @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 SyncPoller} for polling of the order details. + * @return the {@link PollerFlux} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, OrderInner> beginCreateOrUpdate(String deviceName, - String resourceGroupName, OrderInner order) { - return this.beginCreateOrUpdateAsync(deviceName, resourceGroupName, order).getSyncPoller(); + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String deviceName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, deviceName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); } /** - * Creates or updates an order. + * Deletes the order related to the device. * - * @param deviceName The order details of a device. - * @param resourceGroupName The resource group name. - * @param order The order to be created or updated. - * @param context The context to associate with this operation. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. * @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 SyncPoller} for polling of the order details. + * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, OrderInner> beginCreateOrUpdate(String deviceName, - String resourceGroupName, OrderInner order, Context context) { - return this.beginCreateOrUpdateAsync(deviceName, resourceGroupName, order, context).getSyncPoller(); + public SyncPoller, Void> beginDelete(String resourceGroupName, String deviceName) { + Response response = deleteWithResponse(resourceGroupName, deviceName); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); } /** - * Creates or updates an order. + * Deletes the order related to the device. * - * @param deviceName The order details of a device. - * @param resourceGroupName The resource group name. - * @param order The order to be created or updated. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @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 order details on successful completion of {@link Mono}. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String deviceName, String resourceGroupName, OrderInner order) { - return beginCreateOrUpdateAsync(deviceName, resourceGroupName, order).last() - .flatMap(this.client::getLroFinalResultOrError); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String deviceName, + Context context) { + Response response = deleteWithResponse(resourceGroupName, deviceName, context); + return this.client.getLroResult(response, Void.class, Void.class, context); } /** - * Creates or updates an order. + * Deletes the order related to the device. * - * @param deviceName The order details of a device. - * @param resourceGroupName The resource group name. - * @param order The order to be created or updated. - * @param context The context to associate with this operation. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. * @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 order details on successful completion of {@link Mono}. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String deviceName, String resourceGroupName, OrderInner order, - Context context) { - return beginCreateOrUpdateAsync(deviceName, resourceGroupName, order, context).last() - .flatMap(this.client::getLroFinalResultOrError); + private Mono deleteAsync(String resourceGroupName, String deviceName) { + return beginDeleteAsync(resourceGroupName, deviceName).last().flatMap(this.client::getLroFinalResultOrError); } /** - * Creates or updates an order. + * Deletes the order related to the device. * - * @param deviceName The order details of a device. - * @param resourceGroupName The resource group name. - * @param order The order to be created or updated. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. * @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 order details. */ @ServiceMethod(returns = ReturnType.SINGLE) - public OrderInner createOrUpdate(String deviceName, String resourceGroupName, OrderInner order) { - return createOrUpdateAsync(deviceName, resourceGroupName, order).block(); + public void delete(String resourceGroupName, String deviceName) { + beginDelete(resourceGroupName, deviceName).getFinalResult(); } /** - * Creates or updates an order. + * Deletes the order related to the device. * - * @param deviceName The order details of a device. - * @param resourceGroupName The resource group name. - * @param order The order to be created or updated. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. * @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 order details. */ @ServiceMethod(returns = ReturnType.SINGLE) - public OrderInner createOrUpdate(String deviceName, String resourceGroupName, OrderInner order, Context context) { - return createOrUpdateAsync(deviceName, resourceGroupName, order, context).block(); + public void delete(String resourceGroupName, String deviceName, Context context) { + beginDelete(resourceGroupName, deviceName, context).getFinalResult(); } /** - * Deletes the order related to the device. + * Lists all the orders related to a Data Box Edge/Data Box Gateway device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param resourceGroupName The resource group name. * @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}. + * @return list of order entities along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync(String deviceName, String resourceGroupName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (deviceName == null) { - return Mono.error(new IllegalArgumentException("Parameter deviceName 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.")); - } + private Mono> listByDataBoxEdgeDeviceSinglePageAsync(String resourceGroupName, + String deviceName) { final String accept = "application/json"; return FluxUtil - .withContext(context -> service.delete(this.client.getEndpoint(), deviceName, - this.client.getSubscriptionId(), resourceGroupName, this.client.getApiVersion(), accept, context)) + .withContext( + context -> service.listByDataBoxEdgeDevice(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, deviceName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Deletes the order related to the device. + * Lists all the orders related to a Data Box Edge/Data Box Gateway device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param resourceGroupName The resource group name. - * @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}. + * @return list of order entities as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync(String deviceName, String resourceGroupName, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (deviceName == null) { - return Mono.error(new IllegalArgumentException("Parameter deviceName 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.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), deviceName, this.client.getSubscriptionId(), resourceGroupName, - this.client.getApiVersion(), accept, context); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByDataBoxEdgeDeviceAsync(String resourceGroupName, String deviceName) { + return new PagedFlux<>(() -> listByDataBoxEdgeDeviceSinglePageAsync(resourceGroupName, deviceName), + nextLink -> listByDataBoxEdgeDeviceNextSinglePageAsync(nextLink)); } /** - * Deletes the order related to the device. + * Lists all the orders related to a Data Box Edge/Data Box Gateway device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param resourceGroupName The resource group name. * @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 long-running operation. + * @return list of order entities along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync(String deviceName, String resourceGroupName) { - Mono>> mono = deleteWithResponseAsync(deviceName, resourceGroupName); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - this.client.getContext()); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByDataBoxEdgeDeviceSinglePage(String resourceGroupName, String deviceName) { + final String accept = "application/json"; + Response res + = service.listByDataBoxEdgeDeviceSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, deviceName, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** - * Deletes the order related to the device. + * Lists all the orders related to a Data Box Edge/Data Box Gateway device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param resourceGroupName The resource group name. * @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 PollerFlux} for polling of long-running operation. + * @return list of order entities along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync(String deviceName, String resourceGroupName, + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByDataBoxEdgeDeviceSinglePage(String resourceGroupName, String deviceName, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = deleteWithResponseAsync(deviceName, resourceGroupName, context); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - context); + final String accept = "application/json"; + Response res + = service.listByDataBoxEdgeDeviceSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, deviceName, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** - * Deletes the order related to the device. + * Lists all the orders related to a Data Box Edge/Data Box Gateway device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param resourceGroupName The resource group name. * @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 SyncPoller} for polling of long-running operation. + * @return list of order entities as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete(String deviceName, String resourceGroupName) { - return this.beginDeleteAsync(deviceName, resourceGroupName).getSyncPoller(); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByDataBoxEdgeDevice(String resourceGroupName, String deviceName) { + return new PagedIterable<>(() -> listByDataBoxEdgeDeviceSinglePage(resourceGroupName, deviceName), + nextLink -> listByDataBoxEdgeDeviceNextSinglePage(nextLink)); } /** - * Deletes the order related to the device. + * Lists all the orders related to a Data Box Edge/Data Box Gateway device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param resourceGroupName The resource group name. * @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 SyncPoller} for polling of long-running operation. + * @return list of order entities as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete(String deviceName, String resourceGroupName, + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByDataBoxEdgeDevice(String resourceGroupName, String deviceName, Context context) { - return this.beginDeleteAsync(deviceName, resourceGroupName, context).getSyncPoller(); + return new PagedIterable<>(() -> listByDataBoxEdgeDeviceSinglePage(resourceGroupName, deviceName, context), + nextLink -> listByDataBoxEdgeDeviceNextSinglePage(nextLink, context)); } /** - * Deletes the order related to the device. + * Gets the DCAccess Code. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param resourceGroupName The resource group name. * @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. + * @return the DCAccess Code along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String deviceName, String resourceGroupName) { - return beginDeleteAsync(deviceName, resourceGroupName).last().flatMap(this.client::getLroFinalResultOrError); + private Mono> listDCAccessCodeWithResponseAsync(String resourceGroupName, + String deviceName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listDCAccessCode(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, deviceName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Deletes the order related to the device. + * Gets the DCAccess Code. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param resourceGroupName The resource group name. - * @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 A {@link Mono} that completes when a successful response is received. + * @return the DCAccess Code on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String deviceName, String resourceGroupName, Context context) { - return beginDeleteAsync(deviceName, resourceGroupName, context).last() - .flatMap(this.client::getLroFinalResultOrError); + private Mono listDCAccessCodeAsync(String resourceGroupName, String deviceName) { + return listDCAccessCodeWithResponseAsync(resourceGroupName, deviceName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Deletes the order related to the device. + * Gets the DCAccess Code. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param resourceGroupName The resource group name. + * @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 DCAccess Code along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String deviceName, String resourceGroupName) { - deleteAsync(deviceName, resourceGroupName).block(); + public Response listDCAccessCodeWithResponse(String resourceGroupName, String deviceName, + Context context) { + final String accept = "application/json"; + return service.listDCAccessCodeSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, deviceName, accept, context); } /** - * Deletes the order related to the device. + * Gets the DCAccess Code. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param resourceGroupName The resource group name. - * @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 DCAccess Code. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String deviceName, String resourceGroupName, Context context) { - deleteAsync(deviceName, resourceGroupName, context).block(); + public DCAccessCodeInner listDCAccessCode(String resourceGroupName, String deviceName) { + return listDCAccessCodeWithResponse(resourceGroupName, deviceName, Context.NONE).getValue(); } /** @@ -806,13 +758,6 @@ public void delete(String deviceName, String resourceGroupName, Context context) */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByDataBoxEdgeDeviceNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil .withContext( @@ -822,6 +767,24 @@ private Mono> listByDataBoxEdgeDeviceNextSinglePageAsy .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @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 order entities along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByDataBoxEdgeDeviceNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listByDataBoxEdgeDeviceNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + /** * Get the next page of items. * @@ -830,22 +793,14 @@ private Mono> listByDataBoxEdgeDeviceNextSinglePageAsy * @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 order entities along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return list of order entities along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByDataBoxEdgeDeviceNextSinglePageAsync(String nextLink, - Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } + private PagedResponse listByDataBoxEdgeDeviceNextSinglePage(String nextLink, Context context) { final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listByDataBoxEdgeDeviceNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + Response res + = service.listByDataBoxEdgeDeviceNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } } diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/OrdersImpl.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/OrdersImpl.java index bd6cf0143ecc..b9de6e057e1d 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/OrdersImpl.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/OrdersImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.implementation; @@ -10,7 +10,9 @@ import com.azure.core.util.Context; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.databoxedge.fluent.OrdersClient; +import com.azure.resourcemanager.databoxedge.fluent.models.DCAccessCodeInner; import com.azure.resourcemanager.databoxedge.fluent.models.OrderInner; +import com.azure.resourcemanager.databoxedge.models.DCAccessCode; import com.azure.resourcemanager.databoxedge.models.Order; import com.azure.resourcemanager.databoxedge.models.Orders; @@ -27,19 +29,8 @@ public OrdersImpl(OrdersClient innerClient, this.serviceManager = serviceManager; } - public PagedIterable listByDataBoxEdgeDevice(String deviceName, String resourceGroupName) { - PagedIterable inner = this.serviceClient().listByDataBoxEdgeDevice(deviceName, resourceGroupName); - return ResourceManagerUtils.mapPage(inner, inner1 -> new OrderImpl(inner1, this.manager())); - } - - public PagedIterable listByDataBoxEdgeDevice(String deviceName, String resourceGroupName, Context context) { - PagedIterable inner - = this.serviceClient().listByDataBoxEdgeDevice(deviceName, resourceGroupName, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new OrderImpl(inner1, this.manager())); - } - - public Response getWithResponse(String deviceName, String resourceGroupName, Context context) { - Response inner = this.serviceClient().getWithResponse(deviceName, resourceGroupName, context); + public Response getWithResponse(String resourceGroupName, String deviceName, Context context) { + Response inner = this.serviceClient().getWithResponse(resourceGroupName, deviceName, context); if (inner != null) { return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), new OrderImpl(inner.getValue(), this.manager())); @@ -48,8 +39,8 @@ public Response getWithResponse(String deviceName, String resourceGroupNa } } - public Order get(String deviceName, String resourceGroupName) { - OrderInner inner = this.serviceClient().get(deviceName, resourceGroupName); + public Order get(String resourceGroupName, String deviceName) { + OrderInner inner = this.serviceClient().get(resourceGroupName, deviceName); if (inner != null) { return new OrderImpl(inner, this.manager()); } else { @@ -57,8 +48,8 @@ public Order get(String deviceName, String resourceGroupName) { } } - public Order createOrUpdate(String deviceName, String resourceGroupName, OrderInner order) { - OrderInner inner = this.serviceClient().createOrUpdate(deviceName, resourceGroupName, order); + public Order createOrUpdate(String resourceGroupName, String deviceName, OrderInner order) { + OrderInner inner = this.serviceClient().createOrUpdate(resourceGroupName, deviceName, order); if (inner != null) { return new OrderImpl(inner, this.manager()); } else { @@ -66,8 +57,8 @@ public Order createOrUpdate(String deviceName, String resourceGroupName, OrderIn } } - public Order createOrUpdate(String deviceName, String resourceGroupName, OrderInner order, Context context) { - OrderInner inner = this.serviceClient().createOrUpdate(deviceName, resourceGroupName, order, context); + public Order createOrUpdate(String resourceGroupName, String deviceName, OrderInner order, Context context) { + OrderInner inner = this.serviceClient().createOrUpdate(resourceGroupName, deviceName, order, context); if (inner != null) { return new OrderImpl(inner, this.manager()); } else { @@ -75,12 +66,44 @@ public Order createOrUpdate(String deviceName, String resourceGroupName, OrderIn } } - public void deleteByResourceGroup(String deviceName, String resourceGroupName) { - this.serviceClient().delete(deviceName, resourceGroupName); + public void deleteByResourceGroup(String resourceGroupName, String deviceName) { + this.serviceClient().delete(resourceGroupName, deviceName); } - public void delete(String deviceName, String resourceGroupName, Context context) { - this.serviceClient().delete(deviceName, resourceGroupName, context); + public void delete(String resourceGroupName, String deviceName, Context context) { + this.serviceClient().delete(resourceGroupName, deviceName, context); + } + + public PagedIterable listByDataBoxEdgeDevice(String resourceGroupName, String deviceName) { + PagedIterable inner = this.serviceClient().listByDataBoxEdgeDevice(resourceGroupName, deviceName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new OrderImpl(inner1, this.manager())); + } + + public PagedIterable listByDataBoxEdgeDevice(String resourceGroupName, String deviceName, Context context) { + PagedIterable inner + = this.serviceClient().listByDataBoxEdgeDevice(resourceGroupName, deviceName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new OrderImpl(inner1, this.manager())); + } + + public Response listDCAccessCodeWithResponse(String resourceGroupName, String deviceName, + Context context) { + Response inner + = this.serviceClient().listDCAccessCodeWithResponse(resourceGroupName, deviceName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new DCAccessCodeImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public DCAccessCode listDCAccessCode(String resourceGroupName, String deviceName) { + DCAccessCodeInner inner = this.serviceClient().listDCAccessCode(resourceGroupName, deviceName); + if (inner != null) { + return new DCAccessCodeImpl(inner, this.manager()); + } else { + return null; + } } private OrdersClient serviceClient() { diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/ResourceManagerUtils.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/ResourceManagerUtils.java index b0451b9db26d..a30bc504bc02 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/ResourceManagerUtils.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/ResourceManagerUtils.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.implementation; diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/RoleImpl.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/RoleImpl.java index 9d49a0295a06..b9d902334bca 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/RoleImpl.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/RoleImpl.java @@ -1,23 +1,21 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.implementation; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; import com.azure.resourcemanager.databoxedge.fluent.models.RoleInner; import com.azure.resourcemanager.databoxedge.models.Role; +import com.azure.resourcemanager.databoxedge.models.RoleProperties; import com.azure.resourcemanager.databoxedge.models.RoleTypes; -public final class RoleImpl implements Role { +public final class RoleImpl implements Role, Role.Definition, Role.Update { private RoleInner innerObject; private final com.azure.resourcemanager.databoxedge.DataBoxEdgeManager serviceManager; - RoleImpl(RoleInner innerObject, com.azure.resourcemanager.databoxedge.DataBoxEdgeManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - public String id() { return this.innerModel().id(); } @@ -30,10 +28,22 @@ public String type() { return this.innerModel().type(); } + public RoleProperties properties() { + return this.innerModel().properties(); + } + public RoleTypes kind() { return this.innerModel().kind(); } + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + public RoleInner innerModel() { return this.innerObject; } @@ -41,4 +51,88 @@ public RoleInner innerModel() { private com.azure.resourcemanager.databoxedge.DataBoxEdgeManager manager() { return this.serviceManager; } + + private String resourceGroupName; + + private String deviceName; + + private String name; + + public RoleImpl withExistingDataBoxEdgeDevice(String resourceGroupName, String deviceName) { + this.resourceGroupName = resourceGroupName; + this.deviceName = deviceName; + return this; + } + + public Role create() { + this.innerObject = serviceManager.serviceClient() + .getRoles() + .createOrUpdate(resourceGroupName, deviceName, name, this.innerModel(), Context.NONE); + return this; + } + + public Role create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getRoles() + .createOrUpdate(resourceGroupName, deviceName, name, this.innerModel(), context); + return this; + } + + RoleImpl(String name, com.azure.resourcemanager.databoxedge.DataBoxEdgeManager serviceManager) { + this.innerObject = new RoleInner(); + this.serviceManager = serviceManager; + this.name = name; + } + + public RoleImpl update() { + return this; + } + + public Role apply() { + this.innerObject = serviceManager.serviceClient() + .getRoles() + .createOrUpdate(resourceGroupName, deviceName, name, this.innerModel(), Context.NONE); + return this; + } + + public Role apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getRoles() + .createOrUpdate(resourceGroupName, deviceName, name, this.innerModel(), context); + return this; + } + + RoleImpl(RoleInner innerObject, com.azure.resourcemanager.databoxedge.DataBoxEdgeManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.deviceName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "dataBoxEdgeDevices"); + this.name = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "roles"); + } + + public Role refresh() { + this.innerObject = serviceManager.serviceClient() + .getRoles() + .getWithResponse(resourceGroupName, deviceName, name, Context.NONE) + .getValue(); + return this; + } + + public Role refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getRoles() + .getWithResponse(resourceGroupName, deviceName, name, context) + .getValue(); + return this; + } + + public RoleImpl withKind(RoleTypes kind) { + this.innerModel().withKind(kind); + return this; + } + + public RoleImpl withProperties(RoleProperties properties) { + this.innerModel().withProperties(properties); + return this; + } } diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/RolesClientImpl.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/RolesClientImpl.java index e1340f2fda2b..f6e12ea3d0f6 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/RolesClientImpl.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/RolesClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.implementation; @@ -27,13 +27,14 @@ import com.azure.core.http.rest.RestProxy; import com.azure.core.management.exception.ManagementException; import com.azure.core.management.polling.PollResult; +import com.azure.core.util.BinaryData; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; import com.azure.core.util.polling.PollerFlux; import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.databoxedge.fluent.RolesClient; import com.azure.resourcemanager.databoxedge.fluent.models.RoleInner; -import com.azure.resourcemanager.databoxedge.models.RoleList; +import com.azure.resourcemanager.databoxedge.implementation.models.RoleList; import java.nio.ByteBuffer; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; @@ -66,45 +67,79 @@ public final class RolesClientImpl implements RolesClient { * The interface defining all the services for DataBoxEdgeManagementClientRoles to be used by the proxy service to * perform REST calls. */ - @Host("{$host}") - @ServiceInterface(name = "DataBoxEdgeManagemen") + @Host("{endpoint}") + @ServiceInterface(name = "DataBoxEdgeManagementClientRoles") public interface RolesService { @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/roles") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/roles/{name}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByDataBoxEdgeDevice(@HostParam("$host") String endpoint, - @PathParam("deviceName") String deviceName, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("deviceName") String deviceName, + @PathParam("name") String name, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/roles/{name}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("$host") String endpoint, @PathParam("deviceName") String deviceName, - @PathParam("name") String name, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); + Response getSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("deviceName") String deviceName, + @PathParam("name") String name, @HeaderParam("Accept") String accept, Context context); - @Headers({ "Content-Type: application/json" }) @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/roles/{name}") @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdate(@HostParam("$host") String endpoint, - @PathParam("deviceName") String deviceName, @PathParam("name") String name, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") RoleInner role, @HeaderParam("Accept") String accept, Context context); + Mono>> createOrUpdate(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("deviceName") String deviceName, + @PathParam("name") String name, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") RoleInner role, Context context); - @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/roles/{name}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response createOrUpdateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("deviceName") String deviceName, + @PathParam("name") String name, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") RoleInner role, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/roles/{name}") + @ExpectedResponses({ 200, 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("deviceName") String deviceName, + @PathParam("name") String name, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/roles/{name}") @ExpectedResponses({ 200, 202, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete(@HostParam("$host") String endpoint, - @PathParam("deviceName") String deviceName, @PathParam("name") String name, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, + Response deleteSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("deviceName") String deviceName, + @PathParam("name") String name, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/roles") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByDataBoxEdgeDevice(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("deviceName") String deviceName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/roles") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listByDataBoxEdgeDeviceSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("deviceName") String deviceName, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @@ -112,253 +147,61 @@ Mono>> delete(@HostParam("$host") String endpoint, @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByDataBoxEdgeDeviceNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); - } - - /** - * Lists all the roles configured in a Data Box Edge/Data Box Gateway device. - * - * @param deviceName The device name. - * @param resourceGroupName The resource group name. - * @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 collection of all the roles on the Data Box Edge device along with {@link PagedResponse} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByDataBoxEdgeDeviceSinglePageAsync(String deviceName, - String resourceGroupName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (deviceName == null) { - return Mono.error(new IllegalArgumentException("Parameter deviceName 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.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listByDataBoxEdgeDevice(this.client.getEndpoint(), deviceName, - this.client.getSubscriptionId(), resourceGroupName, this.client.getApiVersion(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), - res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Lists all the roles configured in a Data Box Edge/Data Box Gateway device. - * - * @param deviceName The device name. - * @param resourceGroupName The resource group name. - * @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 collection of all the roles on the Data Box Edge device along with {@link PagedResponse} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByDataBoxEdgeDeviceSinglePageAsync(String deviceName, - String resourceGroupName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (deviceName == null) { - return Mono.error(new IllegalArgumentException("Parameter deviceName 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.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByDataBoxEdgeDevice(this.client.getEndpoint(), deviceName, this.client.getSubscriptionId(), - resourceGroupName, this.client.getApiVersion(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * Lists all the roles configured in a Data Box Edge/Data Box Gateway device. - * - * @param deviceName The device name. - * @param resourceGroupName The resource group name. - * @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 collection of all the roles on the Data Box Edge device as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByDataBoxEdgeDeviceAsync(String deviceName, String resourceGroupName) { - return new PagedFlux<>(() -> listByDataBoxEdgeDeviceSinglePageAsync(deviceName, resourceGroupName), - nextLink -> listByDataBoxEdgeDeviceNextSinglePageAsync(nextLink)); - } - - /** - * Lists all the roles configured in a Data Box Edge/Data Box Gateway device. - * - * @param deviceName The device name. - * @param resourceGroupName The resource group name. - * @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 collection of all the roles on the Data Box Edge device as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByDataBoxEdgeDeviceAsync(String deviceName, String resourceGroupName, - Context context) { - return new PagedFlux<>(() -> listByDataBoxEdgeDeviceSinglePageAsync(deviceName, resourceGroupName, context), - nextLink -> listByDataBoxEdgeDeviceNextSinglePageAsync(nextLink, context)); - } - /** - * Lists all the roles configured in a Data Box Edge/Data Box Gateway device. - * - * @param deviceName The device name. - * @param resourceGroupName The resource group name. - * @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 collection of all the roles on the Data Box Edge device as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByDataBoxEdgeDevice(String deviceName, String resourceGroupName) { - return new PagedIterable<>(listByDataBoxEdgeDeviceAsync(deviceName, resourceGroupName)); - } - - /** - * Lists all the roles configured in a Data Box Edge/Data Box Gateway device. - * - * @param deviceName The device name. - * @param resourceGroupName The resource group name. - * @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 collection of all the roles on the Data Box Edge device as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByDataBoxEdgeDevice(String deviceName, String resourceGroupName, - Context context) { - return new PagedIterable<>(listByDataBoxEdgeDeviceAsync(deviceName, resourceGroupName, context)); + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listByDataBoxEdgeDeviceNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); } /** * Gets a specific role by name. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. * @param name The role name. - * @param resourceGroupName The resource group name. * @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 specific role by name along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String deviceName, String name, String resourceGroupName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (deviceName == null) { - return Mono.error(new IllegalArgumentException("Parameter deviceName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name 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.")); - } + private Mono> getWithResponseAsync(String resourceGroupName, String deviceName, String name) { final String accept = "application/json"; return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), deviceName, name, - this.client.getSubscriptionId(), resourceGroupName, this.client.getApiVersion(), accept, context)) + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, deviceName, name, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Gets a specific role by name. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. * @param name The role name. - * @param resourceGroupName The resource group name. - * @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 a specific role by name along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String deviceName, String name, String resourceGroupName, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (deviceName == null) { - return Mono.error(new IllegalArgumentException("Parameter deviceName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name 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.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), deviceName, name, this.client.getSubscriptionId(), - resourceGroupName, this.client.getApiVersion(), accept, context); - } - - /** - * Gets a specific role by name. - * - * @param deviceName The device name. - * @param name The role name. - * @param resourceGroupName The resource group name. * @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 specific role by name on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String deviceName, String name, String resourceGroupName) { - return getWithResponseAsync(deviceName, name, resourceGroupName) + private Mono getAsync(String resourceGroupName, String deviceName, String name) { + return getWithResponseAsync(resourceGroupName, deviceName, name) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * Gets a specific role by name. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. * @param name The role name. - * @param resourceGroupName The resource group name. * @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. @@ -366,33 +209,35 @@ private Mono getAsync(String deviceName, String name, String resource * @return a specific role by name along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String deviceName, String name, String resourceGroupName, + public Response getWithResponse(String resourceGroupName, String deviceName, String name, Context context) { - return getWithResponseAsync(deviceName, name, resourceGroupName, context).block(); + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, deviceName, name, accept, context); } /** * Gets a specific role by name. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. * @param name The role name. - * @param resourceGroupName The resource group name. * @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 specific role by name. */ @ServiceMethod(returns = ReturnType.SINGLE) - public RoleInner get(String deviceName, String name, String resourceGroupName) { - return getWithResponse(deviceName, name, resourceGroupName, Context.NONE).getValue(); + public RoleInner get(String resourceGroupName, String deviceName, String name) { + return getWithResponse(resourceGroupName, deviceName, name, Context.NONE).getValue(); } /** * Create or update a role. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. * @param name The role name. - * @param resourceGroupName The resource group name. * @param role The role properties. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -400,133 +245,88 @@ public RoleInner get(String deviceName, String name, String resourceGroupName) { * @return compute role along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync(String deviceName, String name, - String resourceGroupName, RoleInner role) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (deviceName == null) { - return Mono.error(new IllegalArgumentException("Parameter deviceName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name 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 (role == null) { - return Mono.error(new IllegalArgumentException("Parameter role is required and cannot be null.")); - } else { - role.validate(); - } + private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, + String deviceName, String name, RoleInner role) { + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), deviceName, name, - this.client.getSubscriptionId(), resourceGroupName, this.client.getApiVersion(), role, accept, context)) + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, deviceName, name, contentType, accept, role, + context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Create or update a role. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. * @param name The role name. - * @param resourceGroupName The resource group name. * @param role The role properties. - * @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 compute role along with {@link Response} on successful completion of {@link Mono}. + * @return compute role along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync(String deviceName, String name, - String resourceGroupName, RoleInner role, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (deviceName == null) { - return Mono.error(new IllegalArgumentException("Parameter deviceName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name 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 (role == null) { - return Mono.error(new IllegalArgumentException("Parameter role is required and cannot be null.")); - } else { - role.validate(); - } + private Response createOrUpdateWithResponse(String resourceGroupName, String deviceName, String name, + RoleInner role) { + final String contentType = "application/json"; final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.createOrUpdate(this.client.getEndpoint(), deviceName, name, this.client.getSubscriptionId(), - resourceGroupName, this.client.getApiVersion(), role, accept, context); + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, deviceName, name, contentType, accept, role, + Context.NONE); } /** * Create or update a role. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. * @param name The role name. - * @param resourceGroupName The resource group name. * @param role The role properties. + * @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 PollerFlux} for polling of compute role. + * @return compute role along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, RoleInner> beginCreateOrUpdateAsync(String deviceName, String name, - String resourceGroupName, RoleInner role) { - Mono>> mono - = createOrUpdateWithResponseAsync(deviceName, name, resourceGroupName, role); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), RoleInner.class, - RoleInner.class, this.client.getContext()); + @ServiceMethod(returns = ReturnType.SINGLE) + private Response createOrUpdateWithResponse(String resourceGroupName, String deviceName, String name, + RoleInner role, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, deviceName, name, contentType, accept, role, context); } /** * Create or update a role. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. * @param name The role name. - * @param resourceGroupName The resource group name. * @param role The role properties. - * @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 PollerFlux} for polling of compute role. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, RoleInner> beginCreateOrUpdateAsync(String deviceName, String name, - String resourceGroupName, RoleInner role, Context context) { - context = this.client.mergeContext(context); + private PollerFlux, RoleInner> beginCreateOrUpdateAsync(String resourceGroupName, + String deviceName, String name, RoleInner role) { Mono>> mono - = createOrUpdateWithResponseAsync(deviceName, name, resourceGroupName, role, context); + = createOrUpdateWithResponseAsync(resourceGroupName, deviceName, name, role); return this.client.getLroResult(mono, this.client.getHttpPipeline(), RoleInner.class, - RoleInner.class, context); + RoleInner.class, this.client.getContext()); } /** * Create or update a role. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. * @param name The role name. - * @param resourceGroupName The resource group name. * @param role The role properties. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -534,17 +334,18 @@ private PollerFlux, RoleInner> beginCreateOrUpdateAsync(St * @return the {@link SyncPoller} for polling of compute role. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, RoleInner> beginCreateOrUpdate(String deviceName, String name, - String resourceGroupName, RoleInner role) { - return this.beginCreateOrUpdateAsync(deviceName, name, resourceGroupName, role).getSyncPoller(); + public SyncPoller, RoleInner> beginCreateOrUpdate(String resourceGroupName, String deviceName, + String name, RoleInner role) { + Response response = createOrUpdateWithResponse(resourceGroupName, deviceName, name, role); + return this.client.getLroResult(response, RoleInner.class, RoleInner.class, Context.NONE); } /** * Create or update a role. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. * @param name The role name. - * @param resourceGroupName The resource group name. * @param role The role properties. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -553,17 +354,18 @@ public SyncPoller, RoleInner> beginCreateOrUpdate(String d * @return the {@link SyncPoller} for polling of compute role. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, RoleInner> beginCreateOrUpdate(String deviceName, String name, - String resourceGroupName, RoleInner role, Context context) { - return this.beginCreateOrUpdateAsync(deviceName, name, resourceGroupName, role, context).getSyncPoller(); + public SyncPoller, RoleInner> beginCreateOrUpdate(String resourceGroupName, String deviceName, + String name, RoleInner role, Context context) { + Response response = createOrUpdateWithResponse(resourceGroupName, deviceName, name, role, context); + return this.client.getLroResult(response, RoleInner.class, RoleInner.class, context); } /** * Create or update a role. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. * @param name The role name. - * @param resourceGroupName The resource group name. * @param role The role properties. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -571,161 +373,119 @@ public SyncPoller, RoleInner> beginCreateOrUpdate(String d * @return compute role on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String deviceName, String name, String resourceGroupName, + private Mono createOrUpdateAsync(String resourceGroupName, String deviceName, String name, RoleInner role) { - return beginCreateOrUpdateAsync(deviceName, name, resourceGroupName, role).last() + return beginCreateOrUpdateAsync(resourceGroupName, deviceName, name, role).last() .flatMap(this.client::getLroFinalResultOrError); } /** * Create or update a role. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. * @param name The role name. - * @param resourceGroupName The resource group name. * @param role The role properties. - * @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 compute role on successful completion of {@link Mono}. + * @return compute role. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String deviceName, String name, String resourceGroupName, - RoleInner role, Context context) { - return beginCreateOrUpdateAsync(deviceName, name, resourceGroupName, role, context).last() - .flatMap(this.client::getLroFinalResultOrError); + public RoleInner createOrUpdate(String resourceGroupName, String deviceName, String name, RoleInner role) { + return beginCreateOrUpdate(resourceGroupName, deviceName, name, role).getFinalResult(); } /** * Create or update a role. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. * @param name The role name. - * @param resourceGroupName The resource group name. * @param role The role properties. + * @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 compute role. */ @ServiceMethod(returns = ReturnType.SINGLE) - public RoleInner createOrUpdate(String deviceName, String name, String resourceGroupName, RoleInner role) { - return createOrUpdateAsync(deviceName, name, resourceGroupName, role).block(); + public RoleInner createOrUpdate(String resourceGroupName, String deviceName, String name, RoleInner role, + Context context) { + return beginCreateOrUpdate(resourceGroupName, deviceName, name, role, context).getFinalResult(); } /** - * Create or update a role. + * Deletes the role on the device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. * @param name The role name. - * @param resourceGroupName The resource group name. - * @param role The role properties. - * @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 compute role. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public RoleInner createOrUpdate(String deviceName, String name, String resourceGroupName, RoleInner role, - Context context) { - return createOrUpdateAsync(deviceName, name, resourceGroupName, role, context).block(); + private Mono>> deleteWithResponseAsync(String resourceGroupName, String deviceName, + String name) { + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, deviceName, name, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Deletes the role on the device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. * @param name The role name. - * @param resourceGroupName The resource group name. * @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}. + * @return the response body along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync(String deviceName, String name, - String resourceGroupName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (deviceName == null) { - return Mono.error(new IllegalArgumentException("Parameter deviceName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name 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.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.delete(this.client.getEndpoint(), deviceName, name, - this.client.getSubscriptionId(), resourceGroupName, this.client.getApiVersion(), accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + private Response deleteWithResponse(String resourceGroupName, String deviceName, String name) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, deviceName, name, Context.NONE); } /** * Deletes the role on the device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. * @param name The role name. - * @param resourceGroupName The resource group name. * @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}. + * @return the response body along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync(String deviceName, String name, - String resourceGroupName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (deviceName == null) { - return Mono.error(new IllegalArgumentException("Parameter deviceName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name 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.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), deviceName, name, this.client.getSubscriptionId(), - resourceGroupName, this.client.getApiVersion(), accept, context); + private Response deleteWithResponse(String resourceGroupName, String deviceName, String name, + Context context) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, deviceName, name, context); } /** * Deletes the role on the device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. * @param name The role name. - * @param resourceGroupName The resource group name. * @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 long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync(String deviceName, String name, - String resourceGroupName) { - Mono>> mono = deleteWithResponseAsync(deviceName, name, resourceGroupName); + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String deviceName, + String name) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, deviceName, name); return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); } @@ -733,122 +493,201 @@ private PollerFlux, Void> beginDeleteAsync(String deviceName, S /** * Deletes the role on the device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. * @param name The role name. - * @param resourceGroupName The resource group name. - * @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 PollerFlux} for polling of long-running operation. + * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync(String deviceName, String name, - String resourceGroupName, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = deleteWithResponseAsync(deviceName, name, resourceGroupName, context); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - context); + public SyncPoller, Void> beginDelete(String resourceGroupName, String deviceName, String name) { + Response response = deleteWithResponse(resourceGroupName, deviceName, name); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); } /** * Deletes the role on the device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. * @param name The role name. - * @param resourceGroupName The resource group name. + * @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 SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete(String deviceName, String name, String resourceGroupName) { - return this.beginDeleteAsync(deviceName, name, resourceGroupName).getSyncPoller(); + public SyncPoller, Void> beginDelete(String resourceGroupName, String deviceName, String name, + Context context) { + Response response = deleteWithResponse(resourceGroupName, deviceName, name, context); + return this.client.getLroResult(response, Void.class, Void.class, context); } /** * Deletes the role on the device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. * @param name The role name. - * @param resourceGroupName The resource group name. - * @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 SyncPoller} for polling of long-running operation. + * @return A {@link Mono} that completes when a successful response is received. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete(String deviceName, String name, String resourceGroupName, - Context context) { - return this.beginDeleteAsync(deviceName, name, resourceGroupName, context).getSyncPoller(); + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String deviceName, String name) { + return beginDeleteAsync(resourceGroupName, deviceName, name).last() + .flatMap(this.client::getLroFinalResultOrError); } /** * Deletes the role on the device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. * @param name The role name. - * @param resourceGroupName The resource group name. * @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 deleteAsync(String deviceName, String name, String resourceGroupName) { - return beginDeleteAsync(deviceName, name, resourceGroupName).last() - .flatMap(this.client::getLroFinalResultOrError); + public void delete(String resourceGroupName, String deviceName, String name) { + beginDelete(resourceGroupName, deviceName, name).getFinalResult(); } /** * Deletes the role on the device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. * @param name The role name. - * @param resourceGroupName The resource group name. * @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 A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String deviceName, String name, String resourceGroupName, Context context) { - return beginDeleteAsync(deviceName, name, resourceGroupName, context).last() - .flatMap(this.client::getLroFinalResultOrError); + public void delete(String resourceGroupName, String deviceName, String name, Context context) { + beginDelete(resourceGroupName, deviceName, name, context).getFinalResult(); } /** - * Deletes the role on the device. + * Lists all the roles configured in a Data Box Edge/Data Box Gateway device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param name The role name. - * @param resourceGroupName The resource group name. * @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 collection of all the roles on the Data Box Edge device along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String deviceName, String name, String resourceGroupName) { - deleteAsync(deviceName, name, resourceGroupName).block(); + private Mono> listByDataBoxEdgeDeviceSinglePageAsync(String resourceGroupName, + String deviceName) { + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByDataBoxEdgeDevice(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, deviceName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Deletes the role on the device. + * Lists all the roles configured in a Data Box Edge/Data Box Gateway device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @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 collection of all the roles on the Data Box Edge device as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByDataBoxEdgeDeviceAsync(String resourceGroupName, String deviceName) { + return new PagedFlux<>(() -> listByDataBoxEdgeDeviceSinglePageAsync(resourceGroupName, deviceName), + nextLink -> listByDataBoxEdgeDeviceNextSinglePageAsync(nextLink)); + } + + /** + * Lists all the roles configured in a Data Box Edge/Data Box Gateway device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @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 collection of all the roles on the Data Box Edge device along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByDataBoxEdgeDeviceSinglePage(String resourceGroupName, String deviceName) { + final String accept = "application/json"; + Response res + = service.listByDataBoxEdgeDeviceSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, deviceName, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Lists all the roles configured in a Data Box Edge/Data Box Gateway device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param name The role name. - * @param resourceGroupName The resource group name. * @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 collection of all the roles on the Data Box Edge device along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String deviceName, String name, String resourceGroupName, Context context) { - deleteAsync(deviceName, name, resourceGroupName, context).block(); + private PagedResponse listByDataBoxEdgeDeviceSinglePage(String resourceGroupName, String deviceName, + Context context) { + final String accept = "application/json"; + Response res + = service.listByDataBoxEdgeDeviceSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, deviceName, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Lists all the roles configured in a Data Box Edge/Data Box Gateway device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @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 collection of all the roles on the Data Box Edge device as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByDataBoxEdgeDevice(String resourceGroupName, String deviceName) { + return new PagedIterable<>(() -> listByDataBoxEdgeDeviceSinglePage(resourceGroupName, deviceName), + nextLink -> listByDataBoxEdgeDeviceNextSinglePage(nextLink)); + } + + /** + * Lists all the roles configured in a Data Box Edge/Data Box Gateway device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @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 collection of all the roles on the Data Box Edge device as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByDataBoxEdgeDevice(String resourceGroupName, String deviceName, + Context context) { + return new PagedIterable<>(() -> listByDataBoxEdgeDeviceSinglePage(resourceGroupName, deviceName, context), + nextLink -> listByDataBoxEdgeDeviceNextSinglePage(nextLink, context)); } /** @@ -863,13 +702,6 @@ public void delete(String deviceName, String name, String resourceGroupName, Con */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByDataBoxEdgeDeviceNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil .withContext( @@ -879,6 +711,24 @@ private Mono> listByDataBoxEdgeDeviceNextSinglePageAsyn .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @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 collection of all the roles on the Data Box Edge device along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByDataBoxEdgeDeviceNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listByDataBoxEdgeDeviceNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + /** * Get the next page of items. * @@ -887,23 +737,14 @@ private Mono> listByDataBoxEdgeDeviceNextSinglePageAsyn * @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 collection of all the roles on the Data Box Edge device along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * @return collection of all the roles on the Data Box Edge device along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByDataBoxEdgeDeviceNextSinglePageAsync(String nextLink, - Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } + private PagedResponse listByDataBoxEdgeDeviceNextSinglePage(String nextLink, Context context) { final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listByDataBoxEdgeDeviceNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + Response res + = service.listByDataBoxEdgeDeviceNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } } diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/RolesImpl.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/RolesImpl.java index aa4f47e090ec..831f6f5e3e17 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/RolesImpl.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/RolesImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.implementation; @@ -26,19 +26,8 @@ public RolesImpl(RolesClient innerClient, com.azure.resourcemanager.databoxedge. this.serviceManager = serviceManager; } - public PagedIterable listByDataBoxEdgeDevice(String deviceName, String resourceGroupName) { - PagedIterable inner = this.serviceClient().listByDataBoxEdgeDevice(deviceName, resourceGroupName); - return ResourceManagerUtils.mapPage(inner, inner1 -> new RoleImpl(inner1, this.manager())); - } - - public PagedIterable listByDataBoxEdgeDevice(String deviceName, String resourceGroupName, Context context) { - PagedIterable inner - = this.serviceClient().listByDataBoxEdgeDevice(deviceName, resourceGroupName, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new RoleImpl(inner1, this.manager())); - } - - public Response getWithResponse(String deviceName, String name, String resourceGroupName, Context context) { - Response inner = this.serviceClient().getWithResponse(deviceName, name, resourceGroupName, context); + public Response getWithResponse(String resourceGroupName, String deviceName, String name, Context context) { + Response inner = this.serviceClient().getWithResponse(resourceGroupName, deviceName, name, context); if (inner != null) { return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), new RoleImpl(inner.getValue(), this.manager())); @@ -47,8 +36,8 @@ public Response getWithResponse(String deviceName, String name, String res } } - public Role get(String deviceName, String name, String resourceGroupName) { - RoleInner inner = this.serviceClient().get(deviceName, name, resourceGroupName); + public Role get(String resourceGroupName, String deviceName, String name) { + RoleInner inner = this.serviceClient().get(resourceGroupName, deviceName, name); if (inner != null) { return new RoleImpl(inner, this.manager()); } else { @@ -56,31 +45,99 @@ public Role get(String deviceName, String name, String resourceGroupName) { } } - public Role createOrUpdate(String deviceName, String name, String resourceGroupName, RoleInner role) { - RoleInner inner = this.serviceClient().createOrUpdate(deviceName, name, resourceGroupName, role); - if (inner != null) { - return new RoleImpl(inner, this.manager()); - } else { - return null; + public void delete(String resourceGroupName, String deviceName, String name) { + this.serviceClient().delete(resourceGroupName, deviceName, name); + } + + public void delete(String resourceGroupName, String deviceName, String name, Context context) { + this.serviceClient().delete(resourceGroupName, deviceName, name, context); + } + + public PagedIterable listByDataBoxEdgeDevice(String resourceGroupName, String deviceName) { + PagedIterable inner = this.serviceClient().listByDataBoxEdgeDevice(resourceGroupName, deviceName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new RoleImpl(inner1, this.manager())); + } + + public PagedIterable listByDataBoxEdgeDevice(String resourceGroupName, String deviceName, Context context) { + PagedIterable inner + = this.serviceClient().listByDataBoxEdgeDevice(resourceGroupName, deviceName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new RoleImpl(inner1, this.manager())); + } + + public Role getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String deviceName = ResourceManagerUtils.getValueFromIdByName(id, "dataBoxEdgeDevices"); + if (deviceName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'dataBoxEdgeDevices'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "roles"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'roles'.", id))); } + return this.getWithResponse(resourceGroupName, deviceName, name, Context.NONE).getValue(); } - public Role createOrUpdate(String deviceName, String name, String resourceGroupName, RoleInner role, - Context context) { - RoleInner inner = this.serviceClient().createOrUpdate(deviceName, name, resourceGroupName, role, context); - if (inner != null) { - return new RoleImpl(inner, this.manager()); - } else { - return null; + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String deviceName = ResourceManagerUtils.getValueFromIdByName(id, "dataBoxEdgeDevices"); + if (deviceName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'dataBoxEdgeDevices'.", id))); } + String name = ResourceManagerUtils.getValueFromIdByName(id, "roles"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'roles'.", id))); + } + return this.getWithResponse(resourceGroupName, deviceName, name, context); } - public void delete(String deviceName, String name, String resourceGroupName) { - this.serviceClient().delete(deviceName, name, resourceGroupName); + public void deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String deviceName = ResourceManagerUtils.getValueFromIdByName(id, "dataBoxEdgeDevices"); + if (deviceName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'dataBoxEdgeDevices'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "roles"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'roles'.", id))); + } + this.delete(resourceGroupName, deviceName, name, Context.NONE); } - public void delete(String deviceName, String name, String resourceGroupName, Context context) { - this.serviceClient().delete(deviceName, name, resourceGroupName, context); + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String deviceName = ResourceManagerUtils.getValueFromIdByName(id, "dataBoxEdgeDevices"); + if (deviceName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'dataBoxEdgeDevices'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "roles"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'roles'.", id))); + } + this.delete(resourceGroupName, deviceName, name, context); } private RolesClient serviceClient() { @@ -90,4 +147,8 @@ private RolesClient serviceClient() { private com.azure.resourcemanager.databoxedge.DataBoxEdgeManager manager() { return this.serviceManager; } + + public RoleImpl define(String name) { + return new RoleImpl(name, this.manager()); + } } diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/ShareImpl.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/ShareImpl.java index 109aadf38a59..c022f1c9c090 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/ShareImpl.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/ShareImpl.java @@ -1,9 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.implementation; +import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.databoxedge.fluent.models.ShareInner; import com.azure.resourcemanager.databoxedge.models.AzureContainerInfo; @@ -36,6 +37,10 @@ public String type() { return this.innerModel().type(); } + public SystemData systemData() { + return this.innerModel().systemData(); + } + public String description() { return this.innerModel().description(); } @@ -103,29 +108,29 @@ private com.azure.resourcemanager.databoxedge.DataBoxEdgeManager manager() { return this.serviceManager; } + private String resourceGroupName; + private String deviceName; private String name; - private String resourceGroupName; - - public ShareImpl withExistingDataBoxEdgeDevice(String deviceName, String resourceGroupName) { - this.deviceName = deviceName; + public ShareImpl withExistingDataBoxEdgeDevice(String resourceGroupName, String deviceName) { this.resourceGroupName = resourceGroupName; + this.deviceName = deviceName; return this; } public Share create() { this.innerObject = serviceManager.serviceClient() .getShares() - .createOrUpdate(deviceName, name, resourceGroupName, this.innerModel(), Context.NONE); + .createOrUpdate(resourceGroupName, deviceName, name, this.innerModel(), Context.NONE); return this; } public Share create(Context context) { this.innerObject = serviceManager.serviceClient() .getShares() - .createOrUpdate(deviceName, name, resourceGroupName, this.innerModel(), context); + .createOrUpdate(resourceGroupName, deviceName, name, this.innerModel(), context); return this; } @@ -142,29 +147,29 @@ public ShareImpl update() { public Share apply() { this.innerObject = serviceManager.serviceClient() .getShares() - .createOrUpdate(deviceName, name, resourceGroupName, this.innerModel(), Context.NONE); + .createOrUpdate(resourceGroupName, deviceName, name, this.innerModel(), Context.NONE); return this; } public Share apply(Context context) { this.innerObject = serviceManager.serviceClient() .getShares() - .createOrUpdate(deviceName, name, resourceGroupName, this.innerModel(), context); + .createOrUpdate(resourceGroupName, deviceName, name, this.innerModel(), context); return this; } ShareImpl(ShareInner innerObject, com.azure.resourcemanager.databoxedge.DataBoxEdgeManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); this.deviceName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "dataBoxEdgeDevices"); this.name = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "shares"); - this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); } public Share refresh() { this.innerObject = serviceManager.serviceClient() .getShares() - .getWithResponse(deviceName, name, resourceGroupName, Context.NONE) + .getWithResponse(resourceGroupName, deviceName, name, Context.NONE) .getValue(); return this; } @@ -172,7 +177,7 @@ public Share refresh() { public Share refresh(Context context) { this.innerObject = serviceManager.serviceClient() .getShares() - .getWithResponse(deviceName, name, resourceGroupName, context) + .getWithResponse(resourceGroupName, deviceName, name, context) .getValue(); return this; } diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/SharesClientImpl.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/SharesClientImpl.java index 7f64929554e6..8c8407515472 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/SharesClientImpl.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/SharesClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.implementation; @@ -28,13 +28,14 @@ import com.azure.core.http.rest.RestProxy; import com.azure.core.management.exception.ManagementException; import com.azure.core.management.polling.PollResult; +import com.azure.core.util.BinaryData; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; import com.azure.core.util.polling.PollerFlux; import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.databoxedge.fluent.SharesClient; import com.azure.resourcemanager.databoxedge.fluent.models.ShareInner; -import com.azure.resourcemanager.databoxedge.models.ShareList; +import com.azure.resourcemanager.databoxedge.implementation.models.ShareList; import java.nio.ByteBuffer; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; @@ -67,313 +68,159 @@ public final class SharesClientImpl implements SharesClient { * The interface defining all the services for DataBoxEdgeManagementClientShares to be used by the proxy service to * perform REST calls. */ - @Host("{$host}") - @ServiceInterface(name = "DataBoxEdgeManagemen") + @Host("{endpoint}") + @ServiceInterface(name = "DataBoxEdgeManagementClientShares") public interface SharesService { @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/shares") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/shares/{name}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByDataBoxEdgeDevice(@HostParam("$host") String endpoint, - @PathParam("deviceName") String deviceName, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("deviceName") String deviceName, + @PathParam("name") String name, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/shares/{name}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("$host") String endpoint, @PathParam("deviceName") String deviceName, - @PathParam("name") String name, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); + Response getSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("deviceName") String deviceName, + @PathParam("name") String name, @HeaderParam("Accept") String accept, Context context); - @Headers({ "Content-Type: application/json" }) @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/shares/{name}") @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdate(@HostParam("$host") String endpoint, - @PathParam("deviceName") String deviceName, @PathParam("name") String name, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") ShareInner share, @HeaderParam("Accept") String accept, Context context); + Mono>> createOrUpdate(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("deviceName") String deviceName, + @PathParam("name") String name, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") ShareInner share, Context context); - @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/shares/{name}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response createOrUpdateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("deviceName") String deviceName, + @PathParam("name") String name, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") ShareInner share, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/shares/{name}") @ExpectedResponses({ 200, 202, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete(@HostParam("$host") String endpoint, - @PathParam("deviceName") String deviceName, @PathParam("name") String name, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, + Mono>> delete(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("deviceName") String deviceName, + @PathParam("name") String name, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/shares/{name}") + @ExpectedResponses({ 200, 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response deleteSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("deviceName") String deviceName, + @PathParam("name") String name, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/shares") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByDataBoxEdgeDevice(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("deviceName") String deviceName, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/shares") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listByDataBoxEdgeDeviceSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("deviceName") String deviceName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/shares/{name}/refresh") @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> refresh(@HostParam("$host") String endpoint, - @PathParam("deviceName") String deviceName, @PathParam("name") String name, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); + Mono>> refresh(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("deviceName") String deviceName, + @PathParam("name") String name, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/shares/{name}/refresh") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response refreshSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("deviceName") String deviceName, + @PathParam("name") String name, Context context); @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByDataBoxEdgeDeviceNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); - } - - /** - * Lists all the shares in a Data Box Edge/Data Box Gateway device. - * - * @param deviceName The device name. - * @param resourceGroupName The resource group name. - * @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 collection of all the shares on the Data Box Edge/Gateway device along with {@link PagedResponse} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByDataBoxEdgeDeviceSinglePageAsync(String deviceName, - String resourceGroupName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (deviceName == null) { - return Mono.error(new IllegalArgumentException("Parameter deviceName 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.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listByDataBoxEdgeDevice(this.client.getEndpoint(), deviceName, - this.client.getSubscriptionId(), resourceGroupName, this.client.getApiVersion(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), - res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Lists all the shares in a Data Box Edge/Data Box Gateway device. - * - * @param deviceName The device name. - * @param resourceGroupName The resource group name. - * @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 collection of all the shares on the Data Box Edge/Gateway device along with {@link PagedResponse} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByDataBoxEdgeDeviceSinglePageAsync(String deviceName, - String resourceGroupName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (deviceName == null) { - return Mono.error(new IllegalArgumentException("Parameter deviceName 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.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByDataBoxEdgeDevice(this.client.getEndpoint(), deviceName, this.client.getSubscriptionId(), - resourceGroupName, this.client.getApiVersion(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * Lists all the shares in a Data Box Edge/Data Box Gateway device. - * - * @param deviceName The device name. - * @param resourceGroupName The resource group name. - * @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 collection of all the shares on the Data Box Edge/Gateway device as paginated response with - * {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByDataBoxEdgeDeviceAsync(String deviceName, String resourceGroupName) { - return new PagedFlux<>(() -> listByDataBoxEdgeDeviceSinglePageAsync(deviceName, resourceGroupName), - nextLink -> listByDataBoxEdgeDeviceNextSinglePageAsync(nextLink)); - } - /** - * Lists all the shares in a Data Box Edge/Data Box Gateway device. - * - * @param deviceName The device name. - * @param resourceGroupName The resource group name. - * @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 collection of all the shares on the Data Box Edge/Gateway device as paginated response with - * {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByDataBoxEdgeDeviceAsync(String deviceName, String resourceGroupName, - Context context) { - return new PagedFlux<>(() -> listByDataBoxEdgeDeviceSinglePageAsync(deviceName, resourceGroupName, context), - nextLink -> listByDataBoxEdgeDeviceNextSinglePageAsync(nextLink, context)); - } - - /** - * Lists all the shares in a Data Box Edge/Data Box Gateway device. - * - * @param deviceName The device name. - * @param resourceGroupName The resource group name. - * @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 collection of all the shares on the Data Box Edge/Gateway device as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByDataBoxEdgeDevice(String deviceName, String resourceGroupName) { - return new PagedIterable<>(listByDataBoxEdgeDeviceAsync(deviceName, resourceGroupName)); - } - - /** - * Lists all the shares in a Data Box Edge/Data Box Gateway device. - * - * @param deviceName The device name. - * @param resourceGroupName The resource group name. - * @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 collection of all the shares on the Data Box Edge/Gateway device as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByDataBoxEdgeDevice(String deviceName, String resourceGroupName, - Context context) { - return new PagedIterable<>(listByDataBoxEdgeDeviceAsync(deviceName, resourceGroupName, context)); + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listByDataBoxEdgeDeviceNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); } /** * Gets a share by name. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. * @param name The share name. - * @param resourceGroupName The resource group name. * @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 share by name along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String deviceName, String name, String resourceGroupName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (deviceName == null) { - return Mono.error(new IllegalArgumentException("Parameter deviceName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name 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.")); - } + private Mono> getWithResponseAsync(String resourceGroupName, String deviceName, String name) { final String accept = "application/json"; return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), deviceName, name, - this.client.getSubscriptionId(), resourceGroupName, this.client.getApiVersion(), accept, context)) + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, deviceName, name, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Gets a share by name. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. * @param name The share name. - * @param resourceGroupName The resource group name. - * @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 a share by name along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String deviceName, String name, String resourceGroupName, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (deviceName == null) { - return Mono.error(new IllegalArgumentException("Parameter deviceName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name 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.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), deviceName, name, this.client.getSubscriptionId(), - resourceGroupName, this.client.getApiVersion(), accept, context); - } - - /** - * Gets a share by name. - * - * @param deviceName The device name. - * @param name The share name. - * @param resourceGroupName The resource group name. * @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 share by name on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String deviceName, String name, String resourceGroupName) { - return getWithResponseAsync(deviceName, name, resourceGroupName) + private Mono getAsync(String resourceGroupName, String deviceName, String name) { + return getWithResponseAsync(resourceGroupName, deviceName, name) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * Gets a share by name. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. * @param name The share name. - * @param resourceGroupName The resource group name. * @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. @@ -381,33 +228,35 @@ private Mono getAsync(String deviceName, String name, String resourc * @return a share by name along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String deviceName, String name, String resourceGroupName, + public Response getWithResponse(String resourceGroupName, String deviceName, String name, Context context) { - return getWithResponseAsync(deviceName, name, resourceGroupName, context).block(); + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, deviceName, name, accept, context); } /** * Gets a share by name. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. * @param name The share name. - * @param resourceGroupName The resource group name. * @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 share by name. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ShareInner get(String deviceName, String name, String resourceGroupName) { - return getWithResponse(deviceName, name, resourceGroupName, Context.NONE).getValue(); + public ShareInner get(String resourceGroupName, String deviceName, String name) { + return getWithResponse(resourceGroupName, deviceName, name, Context.NONE).getValue(); } /** * Creates a new share or updates an existing share on the device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. * @param name The share name. - * @param resourceGroupName The resource group name. * @param share The share properties. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -416,133 +265,88 @@ public ShareInner get(String deviceName, String name, String resourceGroupName) * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync(String deviceName, String name, - String resourceGroupName, ShareInner share) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (deviceName == null) { - return Mono.error(new IllegalArgumentException("Parameter deviceName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name 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 (share == null) { - return Mono.error(new IllegalArgumentException("Parameter share is required and cannot be null.")); - } else { - share.validate(); - } + private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, + String deviceName, String name, ShareInner share) { + final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil.withContext(context -> service.createOrUpdate(this.client.getEndpoint(), deviceName, name, - this.client.getSubscriptionId(), resourceGroupName, this.client.getApiVersion(), share, accept, context)) + return FluxUtil + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, deviceName, name, contentType, accept, share, + context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Creates a new share or updates an existing share on the device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. * @param name The share name. - * @param resourceGroupName The resource group name. * @param share The share properties. - * @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 represents a share on the Data Box Edge/Gateway device along with {@link Response} on successful - * completion of {@link Mono}. + * @return represents a share on the Data Box Edge/Gateway device along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync(String deviceName, String name, - String resourceGroupName, ShareInner share, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (deviceName == null) { - return Mono.error(new IllegalArgumentException("Parameter deviceName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name 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 (share == null) { - return Mono.error(new IllegalArgumentException("Parameter share is required and cannot be null.")); - } else { - share.validate(); - } + private Response createOrUpdateWithResponse(String resourceGroupName, String deviceName, String name, + ShareInner share) { + final String contentType = "application/json"; final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.createOrUpdate(this.client.getEndpoint(), deviceName, name, this.client.getSubscriptionId(), - resourceGroupName, this.client.getApiVersion(), share, accept, context); + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, deviceName, name, contentType, accept, share, + Context.NONE); } /** * Creates a new share or updates an existing share on the device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. * @param name The share name. - * @param resourceGroupName The resource group name. * @param share The share properties. + * @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 PollerFlux} for polling of represents a share on the Data Box Edge/Gateway device. + * @return represents a share on the Data Box Edge/Gateway device along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, ShareInner> beginCreateOrUpdateAsync(String deviceName, String name, - String resourceGroupName, ShareInner share) { - Mono>> mono - = createOrUpdateWithResponseAsync(deviceName, name, resourceGroupName, share); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), ShareInner.class, - ShareInner.class, this.client.getContext()); + @ServiceMethod(returns = ReturnType.SINGLE) + private Response createOrUpdateWithResponse(String resourceGroupName, String deviceName, String name, + ShareInner share, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, deviceName, name, contentType, accept, share, context); } /** * Creates a new share or updates an existing share on the device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. * @param name The share name. - * @param resourceGroupName The resource group name. * @param share The share properties. - * @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 PollerFlux} for polling of represents a share on the Data Box Edge/Gateway device. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, ShareInner> beginCreateOrUpdateAsync(String deviceName, String name, - String resourceGroupName, ShareInner share, Context context) { - context = this.client.mergeContext(context); + private PollerFlux, ShareInner> beginCreateOrUpdateAsync(String resourceGroupName, + String deviceName, String name, ShareInner share) { Mono>> mono - = createOrUpdateWithResponseAsync(deviceName, name, resourceGroupName, share, context); + = createOrUpdateWithResponseAsync(resourceGroupName, deviceName, name, share); return this.client.getLroResult(mono, this.client.getHttpPipeline(), ShareInner.class, - ShareInner.class, context); + ShareInner.class, this.client.getContext()); } /** * Creates a new share or updates an existing share on the device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. * @param name The share name. - * @param resourceGroupName The resource group name. * @param share The share properties. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -550,17 +354,19 @@ private PollerFlux, ShareInner> beginCreateOrUpdateAsync( * @return the {@link SyncPoller} for polling of represents a share on the Data Box Edge/Gateway device. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, ShareInner> beginCreateOrUpdate(String deviceName, String name, - String resourceGroupName, ShareInner share) { - return this.beginCreateOrUpdateAsync(deviceName, name, resourceGroupName, share).getSyncPoller(); + public SyncPoller, ShareInner> beginCreateOrUpdate(String resourceGroupName, + String deviceName, String name, ShareInner share) { + Response response = createOrUpdateWithResponse(resourceGroupName, deviceName, name, share); + return this.client.getLroResult(response, ShareInner.class, ShareInner.class, + Context.NONE); } /** * Creates a new share or updates an existing share on the device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. * @param name The share name. - * @param resourceGroupName The resource group name. * @param share The share properties. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -569,17 +375,18 @@ public SyncPoller, ShareInner> beginCreateOrUpdate(String * @return the {@link SyncPoller} for polling of represents a share on the Data Box Edge/Gateway device. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, ShareInner> beginCreateOrUpdate(String deviceName, String name, - String resourceGroupName, ShareInner share, Context context) { - return this.beginCreateOrUpdateAsync(deviceName, name, resourceGroupName, share, context).getSyncPoller(); + public SyncPoller, ShareInner> beginCreateOrUpdate(String resourceGroupName, + String deviceName, String name, ShareInner share, Context context) { + Response response = createOrUpdateWithResponse(resourceGroupName, deviceName, name, share, context); + return this.client.getLroResult(response, ShareInner.class, ShareInner.class, context); } /** * Creates a new share or updates an existing share on the device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. * @param name The share name. - * @param resourceGroupName The resource group name. * @param share The share properties. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -587,161 +394,119 @@ public SyncPoller, ShareInner> beginCreateOrUpdate(String * @return represents a share on the Data Box Edge/Gateway device on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String deviceName, String name, String resourceGroupName, + private Mono createOrUpdateAsync(String resourceGroupName, String deviceName, String name, ShareInner share) { - return beginCreateOrUpdateAsync(deviceName, name, resourceGroupName, share).last() + return beginCreateOrUpdateAsync(resourceGroupName, deviceName, name, share).last() .flatMap(this.client::getLroFinalResultOrError); } /** * Creates a new share or updates an existing share on the device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. * @param name The share name. - * @param resourceGroupName The resource group name. * @param share The share properties. - * @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 represents a share on the Data Box Edge/Gateway device on successful completion of {@link Mono}. + * @return represents a share on the Data Box Edge/Gateway device. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String deviceName, String name, String resourceGroupName, - ShareInner share, Context context) { - return beginCreateOrUpdateAsync(deviceName, name, resourceGroupName, share, context).last() - .flatMap(this.client::getLroFinalResultOrError); + public ShareInner createOrUpdate(String resourceGroupName, String deviceName, String name, ShareInner share) { + return beginCreateOrUpdate(resourceGroupName, deviceName, name, share).getFinalResult(); } /** * Creates a new share or updates an existing share on the device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. * @param name The share name. - * @param resourceGroupName The resource group name. * @param share The share properties. + * @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 represents a share on the Data Box Edge/Gateway device. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ShareInner createOrUpdate(String deviceName, String name, String resourceGroupName, ShareInner share) { - return createOrUpdateAsync(deviceName, name, resourceGroupName, share).block(); + public ShareInner createOrUpdate(String resourceGroupName, String deviceName, String name, ShareInner share, + Context context) { + return beginCreateOrUpdate(resourceGroupName, deviceName, name, share, context).getFinalResult(); } /** - * Creates a new share or updates an existing share on the device. + * Deletes the share on the Data Box Edge/Data Box Gateway device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. * @param name The share name. - * @param resourceGroupName The resource group name. - * @param share The share properties. - * @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 represents a share on the Data Box Edge/Gateway device. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ShareInner createOrUpdate(String deviceName, String name, String resourceGroupName, ShareInner share, - Context context) { - return createOrUpdateAsync(deviceName, name, resourceGroupName, share, context).block(); + private Mono>> deleteWithResponseAsync(String resourceGroupName, String deviceName, + String name) { + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, deviceName, name, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Deletes the share on the Data Box Edge/Data Box Gateway device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. * @param name The share name. - * @param resourceGroupName The resource group name. * @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}. + * @return the response body along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync(String deviceName, String name, - String resourceGroupName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (deviceName == null) { - return Mono.error(new IllegalArgumentException("Parameter deviceName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name 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.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.delete(this.client.getEndpoint(), deviceName, name, - this.client.getSubscriptionId(), resourceGroupName, this.client.getApiVersion(), accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + private Response deleteWithResponse(String resourceGroupName, String deviceName, String name) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, deviceName, name, Context.NONE); } /** * Deletes the share on the Data Box Edge/Data Box Gateway device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. * @param name The share name. - * @param resourceGroupName The resource group name. * @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}. + * @return the response body along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync(String deviceName, String name, - String resourceGroupName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (deviceName == null) { - return Mono.error(new IllegalArgumentException("Parameter deviceName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name 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.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), deviceName, name, this.client.getSubscriptionId(), - resourceGroupName, this.client.getApiVersion(), accept, context); + private Response deleteWithResponse(String resourceGroupName, String deviceName, String name, + Context context) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, deviceName, name, context); } /** * Deletes the share on the Data Box Edge/Data Box Gateway device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. * @param name The share name. - * @param resourceGroupName The resource group name. * @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 long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync(String deviceName, String name, - String resourceGroupName) { - Mono>> mono = deleteWithResponseAsync(deviceName, name, resourceGroupName); + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String deviceName, + String name) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, deviceName, name); return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); } @@ -749,340 +514,363 @@ private PollerFlux, Void> beginDeleteAsync(String deviceName, S /** * Deletes the share on the Data Box Edge/Data Box Gateway device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. * @param name The share name. - * @param resourceGroupName The resource group name. - * @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 PollerFlux} for polling of long-running operation. + * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync(String deviceName, String name, - String resourceGroupName, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = deleteWithResponseAsync(deviceName, name, resourceGroupName, context); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - context); + public SyncPoller, Void> beginDelete(String resourceGroupName, String deviceName, String name) { + Response response = deleteWithResponse(resourceGroupName, deviceName, name); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); } /** * Deletes the share on the Data Box Edge/Data Box Gateway device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. * @param name The share name. - * @param resourceGroupName The resource group name. + * @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 SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete(String deviceName, String name, String resourceGroupName) { - return this.beginDeleteAsync(deviceName, name, resourceGroupName).getSyncPoller(); + public SyncPoller, Void> beginDelete(String resourceGroupName, String deviceName, String name, + Context context) { + Response response = deleteWithResponse(resourceGroupName, deviceName, name, context); + return this.client.getLroResult(response, Void.class, Void.class, context); } /** * Deletes the share on the Data Box Edge/Data Box Gateway device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. * @param name The share name. - * @param resourceGroupName The resource group name. - * @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 SyncPoller} for polling of long-running operation. + * @return A {@link Mono} that completes when a successful response is received. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete(String deviceName, String name, String resourceGroupName, - Context context) { - return this.beginDeleteAsync(deviceName, name, resourceGroupName, context).getSyncPoller(); + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String deviceName, String name) { + return beginDeleteAsync(resourceGroupName, deviceName, name).last() + .flatMap(this.client::getLroFinalResultOrError); } /** * Deletes the share on the Data Box Edge/Data Box Gateway device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. * @param name The share name. - * @param resourceGroupName The resource group name. * @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 deleteAsync(String deviceName, String name, String resourceGroupName) { - return beginDeleteAsync(deviceName, name, resourceGroupName).last() - .flatMap(this.client::getLroFinalResultOrError); + public void delete(String resourceGroupName, String deviceName, String name) { + beginDelete(resourceGroupName, deviceName, name).getFinalResult(); } /** * Deletes the share on the Data Box Edge/Data Box Gateway device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. * @param name The share name. - * @param resourceGroupName The resource group name. * @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 A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String deviceName, String name, String resourceGroupName, Context context) { - return beginDeleteAsync(deviceName, name, resourceGroupName, context).last() - .flatMap(this.client::getLroFinalResultOrError); + public void delete(String resourceGroupName, String deviceName, String name, Context context) { + beginDelete(resourceGroupName, deviceName, name, context).getFinalResult(); } /** - * Deletes the share on the Data Box Edge/Data Box Gateway device. + * Lists all the shares in a Data Box Edge/Data Box Gateway device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param name The share name. - * @param resourceGroupName The resource group name. * @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 collection of all the shares on the Data Box Edge/Gateway device along with {@link PagedResponse} on + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String deviceName, String name, String resourceGroupName) { - deleteAsync(deviceName, name, resourceGroupName).block(); + private Mono> listByDataBoxEdgeDeviceSinglePageAsync(String resourceGroupName, + String deviceName) { + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByDataBoxEdgeDevice(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, deviceName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Deletes the share on the Data Box Edge/Data Box Gateway device. + * Lists all the shares in a Data Box Edge/Data Box Gateway device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param name The share name. - * @param resourceGroupName The resource group name. - * @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 collection of all the shares on the Data Box Edge/Gateway device as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByDataBoxEdgeDeviceAsync(String resourceGroupName, String deviceName) { + return new PagedFlux<>(() -> listByDataBoxEdgeDeviceSinglePageAsync(resourceGroupName, deviceName), + nextLink -> listByDataBoxEdgeDeviceNextSinglePageAsync(nextLink)); + } + + /** + * Lists all the shares in a Data Box Edge/Data Box Gateway device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @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 collection of all the shares on the Data Box Edge/Gateway device along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String deviceName, String name, String resourceGroupName, Context context) { - deleteAsync(deviceName, name, resourceGroupName, context).block(); + private PagedResponse listByDataBoxEdgeDeviceSinglePage(String resourceGroupName, String deviceName) { + final String accept = "application/json"; + Response res + = service.listByDataBoxEdgeDeviceSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, deviceName, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** - * Refreshes the share metadata with the data from the cloud. + * Lists all the shares in a Data Box Edge/Data Box Gateway device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param name The share name. - * @param resourceGroupName The resource group name. + * @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}. + * @return collection of all the shares on the Data Box Edge/Gateway device along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> refreshWithResponseAsync(String deviceName, String name, - String resourceGroupName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (deviceName == null) { - return Mono.error(new IllegalArgumentException("Parameter deviceName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name 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.")); - } + private PagedResponse listByDataBoxEdgeDeviceSinglePage(String resourceGroupName, String deviceName, + Context context) { final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.refresh(this.client.getEndpoint(), deviceName, name, - this.client.getSubscriptionId(), resourceGroupName, this.client.getApiVersion(), accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + Response res + = service.listByDataBoxEdgeDeviceSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, deviceName, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Lists all the shares in a Data Box Edge/Data Box Gateway device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @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 collection of all the shares on the Data Box Edge/Gateway device as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByDataBoxEdgeDevice(String resourceGroupName, String deviceName) { + return new PagedIterable<>(() -> listByDataBoxEdgeDeviceSinglePage(resourceGroupName, deviceName), + nextLink -> listByDataBoxEdgeDeviceNextSinglePage(nextLink)); + } + + /** + * Lists all the shares in a Data Box Edge/Data Box Gateway device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @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 collection of all the shares on the Data Box Edge/Gateway device as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByDataBoxEdgeDevice(String resourceGroupName, String deviceName, + Context context) { + return new PagedIterable<>(() -> listByDataBoxEdgeDeviceSinglePage(resourceGroupName, deviceName, context), + nextLink -> listByDataBoxEdgeDeviceNextSinglePage(nextLink, context)); } /** * Refreshes the share metadata with the data from the cloud. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. * @param name The share name. - * @param resourceGroupName The resource group name. - * @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>> refreshWithResponseAsync(String deviceName, String name, - String resourceGroupName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (deviceName == null) { - return Mono.error(new IllegalArgumentException("Parameter deviceName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name 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.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.refresh(this.client.getEndpoint(), deviceName, name, this.client.getSubscriptionId(), - resourceGroupName, this.client.getApiVersion(), accept, context); + private Mono>> refreshWithResponseAsync(String resourceGroupName, String deviceName, + String name) { + return FluxUtil + .withContext(context -> service.refresh(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, deviceName, name, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Refreshes the share metadata with the data from the cloud. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. * @param name The share name. - * @param resourceGroupName The resource group name. * @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 long-running operation. + * @return the response body along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginRefreshAsync(String deviceName, String name, - String resourceGroupName) { - Mono>> mono = refreshWithResponseAsync(deviceName, name, resourceGroupName); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - this.client.getContext()); + @ServiceMethod(returns = ReturnType.SINGLE) + private Response refreshWithResponse(String resourceGroupName, String deviceName, String name) { + return service.refreshSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, deviceName, name, Context.NONE); } /** * Refreshes the share metadata with the data from the cloud. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. * @param name The share name. - * @param resourceGroupName The resource group name. * @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 PollerFlux} for polling of long-running operation. + * @return the response body along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginRefreshAsync(String deviceName, String name, - String resourceGroupName, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = refreshWithResponseAsync(deviceName, name, resourceGroupName, context); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - context); + @ServiceMethod(returns = ReturnType.SINGLE) + private Response refreshWithResponse(String resourceGroupName, String deviceName, String name, + Context context) { + return service.refreshSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, deviceName, name, context); } /** * Refreshes the share metadata with the data from the cloud. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. * @param name The share name. - * @param resourceGroupName The resource group name. * @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 SyncPoller} for polling of long-running operation. + * @return the {@link PollerFlux} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginRefresh(String deviceName, String name, String resourceGroupName) { - return this.beginRefreshAsync(deviceName, name, resourceGroupName).getSyncPoller(); + private PollerFlux, Void> beginRefreshAsync(String resourceGroupName, String deviceName, + String name) { + Mono>> mono = refreshWithResponseAsync(resourceGroupName, deviceName, name); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); } /** * Refreshes the share metadata with the data from the cloud. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. * @param name The share name. - * @param resourceGroupName The resource group name. - * @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 SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginRefresh(String deviceName, String name, String resourceGroupName, - Context context) { - return this.beginRefreshAsync(deviceName, name, resourceGroupName, context).getSyncPoller(); + public SyncPoller, Void> beginRefresh(String resourceGroupName, String deviceName, String name) { + Response response = refreshWithResponse(resourceGroupName, deviceName, name); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); } /** * Refreshes the share metadata with the data from the cloud. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. * @param name The share name. - * @param resourceGroupName The resource group name. + * @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 A {@link Mono} that completes when a successful response is received. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono refreshAsync(String deviceName, String name, String resourceGroupName) { - return beginRefreshAsync(deviceName, name, resourceGroupName).last() - .flatMap(this.client::getLroFinalResultOrError); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginRefresh(String resourceGroupName, String deviceName, String name, + Context context) { + Response response = refreshWithResponse(resourceGroupName, deviceName, name, context); + return this.client.getLroResult(response, Void.class, Void.class, context); } /** * Refreshes the share metadata with the data from the cloud. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. * @param name The share name. - * @param resourceGroupName The resource group name. - * @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 A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono refreshAsync(String deviceName, String name, String resourceGroupName, Context context) { - return beginRefreshAsync(deviceName, name, resourceGroupName, context).last() + private Mono refreshAsync(String resourceGroupName, String deviceName, String name) { + return beginRefreshAsync(resourceGroupName, deviceName, name).last() .flatMap(this.client::getLroFinalResultOrError); } /** * Refreshes the share metadata with the data from the cloud. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. * @param name The share name. - * @param resourceGroupName The resource group name. * @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 refresh(String deviceName, String name, String resourceGroupName) { - refreshAsync(deviceName, name, resourceGroupName).block(); + public void refresh(String resourceGroupName, String deviceName, String name) { + beginRefresh(resourceGroupName, deviceName, name).getFinalResult(); } /** * Refreshes the share metadata with the data from the cloud. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. * @param name The share name. - * @param resourceGroupName The resource group name. * @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. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void refresh(String deviceName, String name, String resourceGroupName, Context context) { - refreshAsync(deviceName, name, resourceGroupName, context).block(); + public void refresh(String resourceGroupName, String deviceName, String name, Context context) { + beginRefresh(resourceGroupName, deviceName, name, context).getFinalResult(); } /** @@ -1097,13 +885,6 @@ public void refresh(String deviceName, String name, String resourceGroupName, Co */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByDataBoxEdgeDeviceNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil .withContext( @@ -1113,6 +894,24 @@ private Mono> listByDataBoxEdgeDeviceNextSinglePageAsy .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @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 collection of all the shares on the Data Box Edge/Gateway device along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByDataBoxEdgeDeviceNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listByDataBoxEdgeDeviceNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + /** * Get the next page of items. * @@ -1121,23 +920,14 @@ private Mono> listByDataBoxEdgeDeviceNextSinglePageAsy * @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 collection of all the shares on the Data Box Edge/Gateway device along with {@link PagedResponse} on - * successful completion of {@link Mono}. + * @return collection of all the shares on the Data Box Edge/Gateway device along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByDataBoxEdgeDeviceNextSinglePageAsync(String nextLink, - Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } + private PagedResponse listByDataBoxEdgeDeviceNextSinglePage(String nextLink, Context context) { final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listByDataBoxEdgeDeviceNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + Response res + = service.listByDataBoxEdgeDeviceNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } } diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/SharesImpl.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/SharesImpl.java index 4671dac9ffcf..f6da542a06ef 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/SharesImpl.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/SharesImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.implementation; @@ -27,19 +27,8 @@ public SharesImpl(SharesClient innerClient, this.serviceManager = serviceManager; } - public PagedIterable listByDataBoxEdgeDevice(String deviceName, String resourceGroupName) { - PagedIterable inner = this.serviceClient().listByDataBoxEdgeDevice(deviceName, resourceGroupName); - return ResourceManagerUtils.mapPage(inner, inner1 -> new ShareImpl(inner1, this.manager())); - } - - public PagedIterable listByDataBoxEdgeDevice(String deviceName, String resourceGroupName, Context context) { - PagedIterable inner - = this.serviceClient().listByDataBoxEdgeDevice(deviceName, resourceGroupName, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new ShareImpl(inner1, this.manager())); - } - - public Response getWithResponse(String deviceName, String name, String resourceGroupName, Context context) { - Response inner = this.serviceClient().getWithResponse(deviceName, name, resourceGroupName, context); + public Response getWithResponse(String resourceGroupName, String deviceName, String name, Context context) { + Response inner = this.serviceClient().getWithResponse(resourceGroupName, deviceName, name, context); if (inner != null) { return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), new ShareImpl(inner.getValue(), this.manager())); @@ -48,8 +37,8 @@ public Response getWithResponse(String deviceName, String name, String re } } - public Share get(String deviceName, String name, String resourceGroupName) { - ShareInner inner = this.serviceClient().get(deviceName, name, resourceGroupName); + public Share get(String resourceGroupName, String deviceName, String name) { + ShareInner inner = this.serviceClient().get(resourceGroupName, deviceName, name); if (inner != null) { return new ShareImpl(inner, this.manager()); } else { @@ -57,23 +46,39 @@ public Share get(String deviceName, String name, String resourceGroupName) { } } - public void delete(String deviceName, String name, String resourceGroupName) { - this.serviceClient().delete(deviceName, name, resourceGroupName); + public void delete(String resourceGroupName, String deviceName, String name) { + this.serviceClient().delete(resourceGroupName, deviceName, name); } - public void delete(String deviceName, String name, String resourceGroupName, Context context) { - this.serviceClient().delete(deviceName, name, resourceGroupName, context); + public void delete(String resourceGroupName, String deviceName, String name, Context context) { + this.serviceClient().delete(resourceGroupName, deviceName, name, context); } - public void refresh(String deviceName, String name, String resourceGroupName) { - this.serviceClient().refresh(deviceName, name, resourceGroupName); + public PagedIterable listByDataBoxEdgeDevice(String resourceGroupName, String deviceName) { + PagedIterable inner = this.serviceClient().listByDataBoxEdgeDevice(resourceGroupName, deviceName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ShareImpl(inner1, this.manager())); } - public void refresh(String deviceName, String name, String resourceGroupName, Context context) { - this.serviceClient().refresh(deviceName, name, resourceGroupName, context); + public PagedIterable listByDataBoxEdgeDevice(String resourceGroupName, String deviceName, Context context) { + PagedIterable inner + = this.serviceClient().listByDataBoxEdgeDevice(resourceGroupName, deviceName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ShareImpl(inner1, this.manager())); + } + + public void refresh(String resourceGroupName, String deviceName, String name) { + this.serviceClient().refresh(resourceGroupName, deviceName, name); + } + + public void refresh(String resourceGroupName, String deviceName, String name, Context context) { + this.serviceClient().refresh(resourceGroupName, deviceName, name, context); } public Share getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } String deviceName = ResourceManagerUtils.getValueFromIdByName(id, "dataBoxEdgeDevices"); if (deviceName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( @@ -84,15 +89,15 @@ public Share getById(String id) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'shares'.", id))); } + return this.getWithResponse(resourceGroupName, deviceName, name, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - return this.getWithResponse(deviceName, name, resourceGroupName, Context.NONE).getValue(); - } - - public Response getByIdWithResponse(String id, Context context) { String deviceName = ResourceManagerUtils.getValueFromIdByName(id, "dataBoxEdgeDevices"); if (deviceName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( @@ -103,15 +108,15 @@ public Response getByIdWithResponse(String id, Context context) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'shares'.", id))); } + return this.getWithResponse(resourceGroupName, deviceName, name, context); + } + + public void deleteById(String id) { String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - return this.getWithResponse(deviceName, name, resourceGroupName, context); - } - - public void deleteById(String id) { String deviceName = ResourceManagerUtils.getValueFromIdByName(id, "dataBoxEdgeDevices"); if (deviceName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( @@ -122,15 +127,15 @@ public void deleteById(String id) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'shares'.", id))); } + this.delete(resourceGroupName, deviceName, name, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - this.delete(deviceName, name, resourceGroupName, Context.NONE); - } - - public void deleteByIdWithResponse(String id, Context context) { String deviceName = ResourceManagerUtils.getValueFromIdByName(id, "dataBoxEdgeDevices"); if (deviceName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( @@ -141,12 +146,7 @@ public void deleteByIdWithResponse(String id, Context context) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'shares'.", id))); } - String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - this.delete(deviceName, name, resourceGroupName, context); + this.delete(resourceGroupName, deviceName, name, context); } private SharesClient serviceClient() { diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/StorageAccountCredentialImpl.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/StorageAccountCredentialImpl.java index 5c26e4861536..290c70e49eb9 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/StorageAccountCredentialImpl.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/StorageAccountCredentialImpl.java @@ -1,14 +1,15 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.implementation; +import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.databoxedge.fluent.models.StorageAccountCredentialInner; import com.azure.resourcemanager.databoxedge.models.AccountType; import com.azure.resourcemanager.databoxedge.models.AsymmetricEncryptedSecret; -import com.azure.resourcemanager.databoxedge.models.SslStatus; +import com.azure.resourcemanager.databoxedge.models.SSLStatus; import com.azure.resourcemanager.databoxedge.models.StorageAccountCredential; public final class StorageAccountCredentialImpl @@ -29,12 +30,16 @@ public String type() { return this.innerModel().type(); } + public SystemData systemData() { + return this.innerModel().systemData(); + } + public String alias() { return this.innerModel().alias(); } - public String username() { - return this.innerModel().username(); + public String userName() { + return this.innerModel().userName(); } public AsymmetricEncryptedSecret accountKey() { @@ -45,7 +50,7 @@ public String connectionString() { return this.innerModel().connectionString(); } - public SslStatus sslStatus() { + public SSLStatus sslStatus() { return this.innerModel().sslStatus(); } @@ -73,29 +78,29 @@ private com.azure.resourcemanager.databoxedge.DataBoxEdgeManager manager() { return this.serviceManager; } + private String resourceGroupName; + private String deviceName; private String name; - private String resourceGroupName; - - public StorageAccountCredentialImpl withExistingDataBoxEdgeDevice(String deviceName, String resourceGroupName) { - this.deviceName = deviceName; + public StorageAccountCredentialImpl withExistingDataBoxEdgeDevice(String resourceGroupName, String deviceName) { this.resourceGroupName = resourceGroupName; + this.deviceName = deviceName; return this; } public StorageAccountCredential create() { this.innerObject = serviceManager.serviceClient() .getStorageAccountCredentials() - .createOrUpdate(deviceName, name, resourceGroupName, this.innerModel(), Context.NONE); + .createOrUpdate(resourceGroupName, deviceName, name, this.innerModel(), Context.NONE); return this; } public StorageAccountCredential create(Context context) { this.innerObject = serviceManager.serviceClient() .getStorageAccountCredentials() - .createOrUpdate(deviceName, name, resourceGroupName, this.innerModel(), context); + .createOrUpdate(resourceGroupName, deviceName, name, this.innerModel(), context); return this; } @@ -112,14 +117,14 @@ public StorageAccountCredentialImpl update() { public StorageAccountCredential apply() { this.innerObject = serviceManager.serviceClient() .getStorageAccountCredentials() - .createOrUpdate(deviceName, name, resourceGroupName, this.innerModel(), Context.NONE); + .createOrUpdate(resourceGroupName, deviceName, name, this.innerModel(), Context.NONE); return this; } public StorageAccountCredential apply(Context context) { this.innerObject = serviceManager.serviceClient() .getStorageAccountCredentials() - .createOrUpdate(deviceName, name, resourceGroupName, this.innerModel(), context); + .createOrUpdate(resourceGroupName, deviceName, name, this.innerModel(), context); return this; } @@ -127,15 +132,15 @@ public StorageAccountCredential apply(Context context) { com.azure.resourcemanager.databoxedge.DataBoxEdgeManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); this.deviceName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "dataBoxEdgeDevices"); this.name = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "storageAccountCredentials"); - this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); } public StorageAccountCredential refresh() { this.innerObject = serviceManager.serviceClient() .getStorageAccountCredentials() - .getWithResponse(deviceName, name, resourceGroupName, Context.NONE) + .getWithResponse(resourceGroupName, deviceName, name, Context.NONE) .getValue(); return this; } @@ -143,7 +148,7 @@ public StorageAccountCredential refresh() { public StorageAccountCredential refresh(Context context) { this.innerObject = serviceManager.serviceClient() .getStorageAccountCredentials() - .getWithResponse(deviceName, name, resourceGroupName, context) + .getWithResponse(resourceGroupName, deviceName, name, context) .getValue(); return this; } @@ -153,7 +158,7 @@ public StorageAccountCredentialImpl withAlias(String alias) { return this; } - public StorageAccountCredentialImpl withSslStatus(SslStatus sslStatus) { + public StorageAccountCredentialImpl withSslStatus(SSLStatus sslStatus) { this.innerModel().withSslStatus(sslStatus); return this; } @@ -163,8 +168,8 @@ public StorageAccountCredentialImpl withAccountType(AccountType accountType) { return this; } - public StorageAccountCredentialImpl withUsername(String username) { - this.innerModel().withUsername(username); + public StorageAccountCredentialImpl withUserName(String userName) { + this.innerModel().withUserName(userName); return this; } diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/StorageAccountCredentialsClientImpl.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/StorageAccountCredentialsClientImpl.java index f7e798ea5e88..97f144712d6e 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/StorageAccountCredentialsClientImpl.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/StorageAccountCredentialsClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.implementation; @@ -27,13 +27,14 @@ import com.azure.core.http.rest.RestProxy; import com.azure.core.management.exception.ManagementException; import com.azure.core.management.polling.PollResult; +import com.azure.core.util.BinaryData; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; import com.azure.core.util.polling.PollerFlux; import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.databoxedge.fluent.StorageAccountCredentialsClient; import com.azure.resourcemanager.databoxedge.fluent.models.StorageAccountCredentialInner; -import com.azure.resourcemanager.databoxedge.models.StorageAccountCredentialList; +import com.azure.resourcemanager.databoxedge.implementation.models.StorageAccountCredentialList; import java.nio.ByteBuffer; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; @@ -67,47 +68,81 @@ public final class StorageAccountCredentialsClientImpl implements StorageAccount * The interface defining all the services for DataBoxEdgeManagementClientStorageAccountCredentials to be used by * the proxy service to perform REST calls. */ - @Host("{$host}") - @ServiceInterface(name = "DataBoxEdgeManagemen") + @Host("{endpoint}") + @ServiceInterface(name = "DataBoxEdgeManagementClientStorageAccountCredentials") public interface StorageAccountCredentialsService { @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccountCredentials") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccountCredentials/{name}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByDataBoxEdgeDevice(@HostParam("$host") String endpoint, - @PathParam("deviceName") String deviceName, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("deviceName") String deviceName, + @PathParam("name") String name, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccountCredentials/{name}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("$host") String endpoint, - @PathParam("deviceName") String deviceName, @PathParam("name") String name, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); + Response getSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("deviceName") String deviceName, + @PathParam("name") String name, @HeaderParam("Accept") String accept, Context context); - @Headers({ "Content-Type: application/json" }) @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccountCredentials/{name}") @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdate(@HostParam("$host") String endpoint, - @PathParam("deviceName") String deviceName, @PathParam("name") String name, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") StorageAccountCredentialInner storageAccountCredential, - @HeaderParam("Accept") String accept, Context context); + Mono>> createOrUpdate(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("deviceName") String deviceName, + @PathParam("name") String name, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, + @BodyParam("application/json") StorageAccountCredentialInner storageAccountCredential, Context context); - @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccountCredentials/{name}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response createOrUpdateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("deviceName") String deviceName, + @PathParam("name") String name, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, + @BodyParam("application/json") StorageAccountCredentialInner storageAccountCredential, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccountCredentials/{name}") + @ExpectedResponses({ 200, 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("deviceName") String deviceName, + @PathParam("name") String name, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccountCredentials/{name}") @ExpectedResponses({ 200, 202, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete(@HostParam("$host") String endpoint, - @PathParam("deviceName") String deviceName, @PathParam("name") String name, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, + Response deleteSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("deviceName") String deviceName, + @PathParam("name") String name, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccountCredentials") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByDataBoxEdgeDevice(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("deviceName") String deviceName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccountCredentials") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listByDataBoxEdgeDeviceSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("deviceName") String deviceName, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @@ -115,165 +150,24 @@ Mono>> delete(@HostParam("$host") String endpoint, @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByDataBoxEdgeDeviceNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); - } - /** - * Gets all the storage account credentials in a Data Box Edge/Data Box Gateway device. - * - * @param deviceName The device name. - * @param resourceGroupName The resource group name. - * @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 all the storage account credentials in a Data Box Edge/Data Box Gateway device along with - * {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByDataBoxEdgeDeviceSinglePageAsync(String deviceName, - String resourceGroupName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (deviceName == null) { - return Mono.error(new IllegalArgumentException("Parameter deviceName 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.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listByDataBoxEdgeDevice(this.client.getEndpoint(), deviceName, - this.client.getSubscriptionId(), resourceGroupName, this.client.getApiVersion(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets all the storage account credentials in a Data Box Edge/Data Box Gateway device. - * - * @param deviceName The device name. - * @param resourceGroupName The resource group name. - * @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 all the storage account credentials in a Data Box Edge/Data Box Gateway device along with - * {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByDataBoxEdgeDeviceSinglePageAsync(String deviceName, - String resourceGroupName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (deviceName == null) { - return Mono.error(new IllegalArgumentException("Parameter deviceName 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.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByDataBoxEdgeDevice(this.client.getEndpoint(), deviceName, this.client.getSubscriptionId(), - resourceGroupName, this.client.getApiVersion(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * Gets all the storage account credentials in a Data Box Edge/Data Box Gateway device. - * - * @param deviceName The device name. - * @param resourceGroupName The resource group name. - * @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 all the storage account credentials in a Data Box Edge/Data Box Gateway device as paginated response with - * {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByDataBoxEdgeDeviceAsync(String deviceName, - String resourceGroupName) { - return new PagedFlux<>(() -> listByDataBoxEdgeDeviceSinglePageAsync(deviceName, resourceGroupName), - nextLink -> listByDataBoxEdgeDeviceNextSinglePageAsync(nextLink)); - } - - /** - * Gets all the storage account credentials in a Data Box Edge/Data Box Gateway device. - * - * @param deviceName The device name. - * @param resourceGroupName The resource group name. - * @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 all the storage account credentials in a Data Box Edge/Data Box Gateway device as paginated response with - * {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByDataBoxEdgeDeviceAsync(String deviceName, - String resourceGroupName, Context context) { - return new PagedFlux<>(() -> listByDataBoxEdgeDeviceSinglePageAsync(deviceName, resourceGroupName, context), - nextLink -> listByDataBoxEdgeDeviceNextSinglePageAsync(nextLink, context)); - } - - /** - * Gets all the storage account credentials in a Data Box Edge/Data Box Gateway device. - * - * @param deviceName The device name. - * @param resourceGroupName The resource group name. - * @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 all the storage account credentials in a Data Box Edge/Data Box Gateway device as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByDataBoxEdgeDevice(String deviceName, - String resourceGroupName) { - return new PagedIterable<>(listByDataBoxEdgeDeviceAsync(deviceName, resourceGroupName)); - } - - /** - * Gets all the storage account credentials in a Data Box Edge/Data Box Gateway device. - * - * @param deviceName The device name. - * @param resourceGroupName The resource group name. - * @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 all the storage account credentials in a Data Box Edge/Data Box Gateway device as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByDataBoxEdgeDevice(String deviceName, - String resourceGroupName, Context context) { - return new PagedIterable<>(listByDataBoxEdgeDeviceAsync(deviceName, resourceGroupName, context)); + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listByDataBoxEdgeDeviceNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); } /** * Gets the properties of the specified storage account credential. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. * @param name The storage account credential name. - * @param resourceGroupName The resource group name. * @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. @@ -281,96 +175,38 @@ public PagedIterable listByDataBoxEdgeDevice(Stri * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String deviceName, String name, - String resourceGroupName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (deviceName == null) { - return Mono.error(new IllegalArgumentException("Parameter deviceName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name 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.")); - } + private Mono> getWithResponseAsync(String resourceGroupName, + String deviceName, String name) { final String accept = "application/json"; return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), deviceName, name, - this.client.getSubscriptionId(), resourceGroupName, this.client.getApiVersion(), accept, context)) + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, deviceName, name, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Gets the properties of the specified storage account credential. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. * @param name The storage account credential name. - * @param resourceGroupName The resource group name. - * @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 properties of the specified storage account credential along with {@link Response} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String deviceName, String name, - String resourceGroupName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (deviceName == null) { - return Mono.error(new IllegalArgumentException("Parameter deviceName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name 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.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), deviceName, name, this.client.getSubscriptionId(), - resourceGroupName, this.client.getApiVersion(), accept, context); - } - - /** - * Gets the properties of the specified storage account credential. - * - * @param deviceName The device name. - * @param name The storage account credential name. - * @param resourceGroupName The resource group name. * @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 properties of the specified storage account credential on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String deviceName, String name, String resourceGroupName) { - return getWithResponseAsync(deviceName, name, resourceGroupName) + private Mono getAsync(String resourceGroupName, String deviceName, String name) { + return getWithResponseAsync(resourceGroupName, deviceName, name) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * Gets the properties of the specified storage account credential. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. * @param name The storage account credential name. - * @param resourceGroupName The resource group name. * @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. @@ -378,33 +214,35 @@ private Mono getAsync(String deviceName, String n * @return the properties of the specified storage account credential along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String deviceName, String name, - String resourceGroupName, Context context) { - return getWithResponseAsync(deviceName, name, resourceGroupName, context).block(); + public Response getWithResponse(String resourceGroupName, String deviceName, + String name, Context context) { + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, deviceName, name, accept, context); } /** * Gets the properties of the specified storage account credential. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. * @param name The storage account credential name. - * @param resourceGroupName The resource group name. * @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 properties of the specified storage account credential. */ @ServiceMethod(returns = ReturnType.SINGLE) - public StorageAccountCredentialInner get(String deviceName, String name, String resourceGroupName) { - return getWithResponse(deviceName, name, resourceGroupName, Context.NONE).getValue(); + public StorageAccountCredentialInner get(String resourceGroupName, String deviceName, String name) { + return getWithResponse(resourceGroupName, deviceName, name, Context.NONE).getValue(); } /** * Creates or updates the storage account credential. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. * @param name The storage account credential name. - * @param resourceGroupName The resource group name. * @param storageAccountCredential The storage account credential. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -412,117 +250,69 @@ public StorageAccountCredentialInner get(String deviceName, String name, String * @return the storage account credential along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync(String deviceName, String name, - String resourceGroupName, StorageAccountCredentialInner storageAccountCredential) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (deviceName == null) { - return Mono.error(new IllegalArgumentException("Parameter deviceName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name 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 (storageAccountCredential == null) { - return Mono.error( - new IllegalArgumentException("Parameter storageAccountCredential is required and cannot be null.")); - } else { - storageAccountCredential.validate(); - } + private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, + String deviceName, String name, StorageAccountCredentialInner storageAccountCredential) { + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), deviceName, name, - this.client.getSubscriptionId(), resourceGroupName, this.client.getApiVersion(), - storageAccountCredential, accept, context)) + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, deviceName, name, contentType, accept, + storageAccountCredential, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Creates or updates the storage account credential. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. * @param name The storage account credential name. - * @param resourceGroupName The resource group name. * @param storageAccountCredential The storage account credential. - * @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 storage account credential along with {@link Response} on successful completion of {@link Mono}. + * @return the storage account credential along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync(String deviceName, String name, - String resourceGroupName, StorageAccountCredentialInner storageAccountCredential, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (deviceName == null) { - return Mono.error(new IllegalArgumentException("Parameter deviceName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name 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 (storageAccountCredential == null) { - return Mono.error( - new IllegalArgumentException("Parameter storageAccountCredential is required and cannot be null.")); - } else { - storageAccountCredential.validate(); - } + private Response createOrUpdateWithResponse(String resourceGroupName, String deviceName, String name, + StorageAccountCredentialInner storageAccountCredential) { + final String contentType = "application/json"; final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.createOrUpdate(this.client.getEndpoint(), deviceName, name, this.client.getSubscriptionId(), - resourceGroupName, this.client.getApiVersion(), storageAccountCredential, accept, context); + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, deviceName, name, contentType, accept, + storageAccountCredential, Context.NONE); } /** * Creates or updates the storage account credential. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. * @param name The storage account credential name. - * @param resourceGroupName The resource group name. * @param storageAccountCredential The storage account credential. + * @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 PollerFlux} for polling of the storage account credential. + * @return the storage account credential along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, StorageAccountCredentialInner> - beginCreateOrUpdateAsync(String deviceName, String name, String resourceGroupName, - StorageAccountCredentialInner storageAccountCredential) { - Mono>> mono - = createOrUpdateWithResponseAsync(deviceName, name, resourceGroupName, storageAccountCredential); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), StorageAccountCredentialInner.class, StorageAccountCredentialInner.class, - this.client.getContext()); + @ServiceMethod(returns = ReturnType.SINGLE) + private Response createOrUpdateWithResponse(String resourceGroupName, String deviceName, String name, + StorageAccountCredentialInner storageAccountCredential, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, deviceName, name, contentType, accept, + storageAccountCredential, context); } /** * Creates or updates the storage account credential. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. * @param name The storage account credential name. - * @param resourceGroupName The resource group name. * @param storageAccountCredential The storage account credential. - * @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. @@ -530,22 +320,21 @@ private Mono>> createOrUpdateWithResponseAsync(String */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, StorageAccountCredentialInner> - beginCreateOrUpdateAsync(String deviceName, String name, String resourceGroupName, - StorageAccountCredentialInner storageAccountCredential, Context context) { - context = this.client.mergeContext(context); + beginCreateOrUpdateAsync(String resourceGroupName, String deviceName, String name, + StorageAccountCredentialInner storageAccountCredential) { Mono>> mono - = createOrUpdateWithResponseAsync(deviceName, name, resourceGroupName, storageAccountCredential, context); + = createOrUpdateWithResponseAsync(resourceGroupName, deviceName, name, storageAccountCredential); return this.client.getLroResult(mono, this.client.getHttpPipeline(), StorageAccountCredentialInner.class, StorageAccountCredentialInner.class, - context); + this.client.getContext()); } /** * Creates or updates the storage account credential. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. * @param name The storage account credential name. - * @param resourceGroupName The resource group name. * @param storageAccountCredential The storage account credential. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -554,18 +343,20 @@ private Mono>> createOrUpdateWithResponseAsync(String */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, StorageAccountCredentialInner> beginCreateOrUpdate( - String deviceName, String name, String resourceGroupName, + String resourceGroupName, String deviceName, String name, StorageAccountCredentialInner storageAccountCredential) { - return this.beginCreateOrUpdateAsync(deviceName, name, resourceGroupName, storageAccountCredential) - .getSyncPoller(); + Response response + = createOrUpdateWithResponse(resourceGroupName, deviceName, name, storageAccountCredential); + return this.client.getLroResult(response, + StorageAccountCredentialInner.class, StorageAccountCredentialInner.class, Context.NONE); } /** * Creates or updates the storage account credential. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. * @param name The storage account credential name. - * @param resourceGroupName The resource group name. * @param storageAccountCredential The storage account credential. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -575,57 +366,39 @@ public SyncPoller, StorageAccountCrede */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, StorageAccountCredentialInner> beginCreateOrUpdate( - String deviceName, String name, String resourceGroupName, + String resourceGroupName, String deviceName, String name, StorageAccountCredentialInner storageAccountCredential, Context context) { - return this.beginCreateOrUpdateAsync(deviceName, name, resourceGroupName, storageAccountCredential, context) - .getSyncPoller(); - } - - /** - * Creates or updates the storage account credential. - * - * @param deviceName The device name. - * @param name The storage account credential name. - * @param resourceGroupName The resource group name. - * @param storageAccountCredential The storage account credential. - * @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 storage account credential on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String deviceName, String name, - String resourceGroupName, StorageAccountCredentialInner storageAccountCredential) { - return beginCreateOrUpdateAsync(deviceName, name, resourceGroupName, storageAccountCredential).last() - .flatMap(this.client::getLroFinalResultOrError); + Response response + = createOrUpdateWithResponse(resourceGroupName, deviceName, name, storageAccountCredential, context); + return this.client.getLroResult(response, + StorageAccountCredentialInner.class, StorageAccountCredentialInner.class, context); } /** * Creates or updates the storage account credential. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. * @param name The storage account credential name. - * @param resourceGroupName The resource group name. * @param storageAccountCredential The storage account credential. - * @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 storage account credential on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String deviceName, String name, - String resourceGroupName, StorageAccountCredentialInner storageAccountCredential, Context context) { - return beginCreateOrUpdateAsync(deviceName, name, resourceGroupName, storageAccountCredential, context).last() + private Mono createOrUpdateAsync(String resourceGroupName, String deviceName, + String name, StorageAccountCredentialInner storageAccountCredential) { + return beginCreateOrUpdateAsync(resourceGroupName, deviceName, name, storageAccountCredential).last() .flatMap(this.client::getLroFinalResultOrError); } /** * Creates or updates the storage account credential. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. * @param name The storage account credential name. - * @param resourceGroupName The resource group name. * @param storageAccountCredential The storage account credential. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -633,17 +406,17 @@ private Mono createOrUpdateAsync(String deviceNam * @return the storage account credential. */ @ServiceMethod(returns = ReturnType.SINGLE) - public StorageAccountCredentialInner createOrUpdate(String deviceName, String name, String resourceGroupName, + public StorageAccountCredentialInner createOrUpdate(String resourceGroupName, String deviceName, String name, StorageAccountCredentialInner storageAccountCredential) { - return createOrUpdateAsync(deviceName, name, resourceGroupName, storageAccountCredential).block(); + return beginCreateOrUpdate(resourceGroupName, deviceName, name, storageAccountCredential).getFinalResult(); } /** * Creates or updates the storage account credential. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. * @param name The storage account credential name. - * @param resourceGroupName The resource group name. * @param storageAccountCredential The storage account credential. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -652,151 +425,110 @@ public StorageAccountCredentialInner createOrUpdate(String deviceName, String na * @return the storage account credential. */ @ServiceMethod(returns = ReturnType.SINGLE) - public StorageAccountCredentialInner createOrUpdate(String deviceName, String name, String resourceGroupName, + public StorageAccountCredentialInner createOrUpdate(String resourceGroupName, String deviceName, String name, StorageAccountCredentialInner storageAccountCredential, Context context) { - return createOrUpdateAsync(deviceName, name, resourceGroupName, storageAccountCredential, context).block(); + return beginCreateOrUpdate(resourceGroupName, deviceName, name, storageAccountCredential, context) + .getFinalResult(); } /** * Deletes the storage account credential. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. * @param name The storage account credential name. - * @param resourceGroupName The resource group name. * @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>> deleteWithResponseAsync(String deviceName, String name, - String resourceGroupName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (deviceName == null) { - return Mono.error(new IllegalArgumentException("Parameter deviceName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name 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.")); - } - final String accept = "application/json"; + private Mono>> deleteWithResponseAsync(String resourceGroupName, String deviceName, + String name) { return FluxUtil - .withContext(context -> service.delete(this.client.getEndpoint(), deviceName, name, - this.client.getSubscriptionId(), resourceGroupName, this.client.getApiVersion(), accept, context)) + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, deviceName, name, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Deletes the storage account credential. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. * @param name The storage account credential name. - * @param resourceGroupName The resource group name. - * @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}. + * @return the response body along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync(String deviceName, String name, - String resourceGroupName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (deviceName == null) { - return Mono.error(new IllegalArgumentException("Parameter deviceName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name 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.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), deviceName, name, this.client.getSubscriptionId(), - resourceGroupName, this.client.getApiVersion(), accept, context); + private Response deleteWithResponse(String resourceGroupName, String deviceName, String name) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, deviceName, name, Context.NONE); } /** * Deletes the storage account credential. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. * @param name The storage account credential name. - * @param resourceGroupName The resource group name. + * @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 PollerFlux} for polling of long-running operation. + * @return the response body along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync(String deviceName, String name, - String resourceGroupName) { - Mono>> mono = deleteWithResponseAsync(deviceName, name, resourceGroupName); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - this.client.getContext()); + @ServiceMethod(returns = ReturnType.SINGLE) + private Response deleteWithResponse(String resourceGroupName, String deviceName, String name, + Context context) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, deviceName, name, context); } /** * Deletes the storage account credential. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. * @param name The storage account credential name. - * @param resourceGroupName The resource group name. - * @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 PollerFlux} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync(String deviceName, String name, - String resourceGroupName, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = deleteWithResponseAsync(deviceName, name, resourceGroupName, context); + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String deviceName, + String name) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, deviceName, name); return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - context); + this.client.getContext()); } /** * Deletes the storage account credential. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. * @param name The storage account credential name. - * @param resourceGroupName The resource group name. * @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 SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete(String deviceName, String name, String resourceGroupName) { - return this.beginDeleteAsync(deviceName, name, resourceGroupName).getSyncPoller(); + public SyncPoller, Void> beginDelete(String resourceGroupName, String deviceName, String name) { + Response response = deleteWithResponse(resourceGroupName, deviceName, name); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); } /** * Deletes the storage account credential. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. * @param name The storage account credential name. - * @param resourceGroupName The resource group name. * @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. @@ -804,75 +536,182 @@ public SyncPoller, Void> beginDelete(String deviceName, String * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete(String deviceName, String name, String resourceGroupName, + public SyncPoller, Void> beginDelete(String resourceGroupName, String deviceName, String name, Context context) { - return this.beginDeleteAsync(deviceName, name, resourceGroupName, context).getSyncPoller(); + Response response = deleteWithResponse(resourceGroupName, deviceName, name, context); + return this.client.getLroResult(response, Void.class, Void.class, context); } /** * Deletes the storage account credential. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. * @param name The storage account credential name. - * @param resourceGroupName The resource group name. * @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 deleteAsync(String deviceName, String name, String resourceGroupName) { - return beginDeleteAsync(deviceName, name, resourceGroupName).last() + private Mono deleteAsync(String resourceGroupName, String deviceName, String name) { + return beginDeleteAsync(resourceGroupName, deviceName, name).last() .flatMap(this.client::getLroFinalResultOrError); } /** * Deletes the storage account credential. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. * @param name The storage account credential name. - * @param resourceGroupName The resource group name. - * @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 A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String deviceName, String name, String resourceGroupName, Context context) { - return beginDeleteAsync(deviceName, name, resourceGroupName, context).last() - .flatMap(this.client::getLroFinalResultOrError); + public void delete(String resourceGroupName, String deviceName, String name) { + beginDelete(resourceGroupName, deviceName, name).getFinalResult(); } /** * Deletes the storage account credential. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. * @param name The storage account credential name. - * @param resourceGroupName The resource group name. + * @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. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String deviceName, String name, String resourceGroupName) { - deleteAsync(deviceName, name, resourceGroupName).block(); + public void delete(String resourceGroupName, String deviceName, String name, Context context) { + beginDelete(resourceGroupName, deviceName, name, context).getFinalResult(); } /** - * Deletes the storage account credential. + * Gets all the storage account credentials in a Data Box Edge/Data Box Gateway device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @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 all the storage account credentials in a Data Box Edge/Data Box Gateway device along with + * {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByDataBoxEdgeDeviceSinglePageAsync(String resourceGroupName, String deviceName) { + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByDataBoxEdgeDevice(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, deviceName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets all the storage account credentials in a Data Box Edge/Data Box Gateway device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @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 all the storage account credentials in a Data Box Edge/Data Box Gateway device as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByDataBoxEdgeDeviceAsync(String resourceGroupName, + String deviceName) { + return new PagedFlux<>(() -> listByDataBoxEdgeDeviceSinglePageAsync(resourceGroupName, deviceName), + nextLink -> listByDataBoxEdgeDeviceNextSinglePageAsync(nextLink)); + } + + /** + * Gets all the storage account credentials in a Data Box Edge/Data Box Gateway device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @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 all the storage account credentials in a Data Box Edge/Data Box Gateway device along with + * {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByDataBoxEdgeDeviceSinglePage(String resourceGroupName, + String deviceName) { + final String accept = "application/json"; + Response res + = service.listByDataBoxEdgeDeviceSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, deviceName, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Gets all the storage account credentials in a Data Box Edge/Data Box Gateway device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param name The storage account credential name. - * @param resourceGroupName The resource group name. * @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 all the storage account credentials in a Data Box Edge/Data Box Gateway device along with + * {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String deviceName, String name, String resourceGroupName, Context context) { - deleteAsync(deviceName, name, resourceGroupName, context).block(); + private PagedResponse listByDataBoxEdgeDeviceSinglePage(String resourceGroupName, + String deviceName, Context context) { + final String accept = "application/json"; + Response res + = service.listByDataBoxEdgeDeviceSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, deviceName, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Gets all the storage account credentials in a Data Box Edge/Data Box Gateway device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @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 all the storage account credentials in a Data Box Edge/Data Box Gateway device as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByDataBoxEdgeDevice(String resourceGroupName, + String deviceName) { + return new PagedIterable<>(() -> listByDataBoxEdgeDeviceSinglePage(resourceGroupName, deviceName), + nextLink -> listByDataBoxEdgeDeviceNextSinglePage(nextLink)); + } + + /** + * Gets all the storage account credentials in a Data Box Edge/Data Box Gateway device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @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 all the storage account credentials in a Data Box Edge/Data Box Gateway device as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByDataBoxEdgeDevice(String resourceGroupName, + String deviceName, Context context) { + return new PagedIterable<>(() -> listByDataBoxEdgeDeviceSinglePage(resourceGroupName, deviceName, context), + nextLink -> listByDataBoxEdgeDeviceNextSinglePage(nextLink, context)); } /** @@ -882,19 +721,12 @@ public void delete(String deviceName, String name, String resourceGroupName, Con * @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 collection of storage account credentials along with {@link PagedResponse} on successful completion - * of {@link Mono}. + * @return all the storage account credentials in a Data Box Edge/Data Box Gateway device along with + * {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByDataBoxEdgeDeviceNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil .withContext( @@ -904,6 +736,25 @@ public void delete(String deviceName, String name, String resourceGroupName, Con .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @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 all the storage account credentials in a Data Box Edge/Data Box Gateway device along with + * {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByDataBoxEdgeDeviceNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listByDataBoxEdgeDeviceNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + /** * Get the next page of items. * @@ -912,23 +763,16 @@ public void delete(String deviceName, String name, String resourceGroupName, Con * @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 collection of storage account credentials along with {@link PagedResponse} on successful completion - * of {@link Mono}. + * @return all the storage account credentials in a Data Box Edge/Data Box Gateway device along with + * {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> - listByDataBoxEdgeDeviceNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } + private PagedResponse listByDataBoxEdgeDeviceNextSinglePage(String nextLink, + Context context) { final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listByDataBoxEdgeDeviceNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + Response res + = service.listByDataBoxEdgeDeviceNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } } diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/StorageAccountCredentialsImpl.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/StorageAccountCredentialsImpl.java index e65a623cc5d9..336aff423dfd 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/StorageAccountCredentialsImpl.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/StorageAccountCredentialsImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.implementation; @@ -27,24 +27,10 @@ public StorageAccountCredentialsImpl(StorageAccountCredentialsClient innerClient this.serviceManager = serviceManager; } - public PagedIterable listByDataBoxEdgeDevice(String deviceName, - String resourceGroupName) { - PagedIterable inner - = this.serviceClient().listByDataBoxEdgeDevice(deviceName, resourceGroupName); - return ResourceManagerUtils.mapPage(inner, inner1 -> new StorageAccountCredentialImpl(inner1, this.manager())); - } - - public PagedIterable listByDataBoxEdgeDevice(String deviceName, String resourceGroupName, - Context context) { - PagedIterable inner - = this.serviceClient().listByDataBoxEdgeDevice(deviceName, resourceGroupName, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new StorageAccountCredentialImpl(inner1, this.manager())); - } - - public Response getWithResponse(String deviceName, String name, String resourceGroupName, + public Response getWithResponse(String resourceGroupName, String deviceName, String name, Context context) { Response inner - = this.serviceClient().getWithResponse(deviceName, name, resourceGroupName, context); + = this.serviceClient().getWithResponse(resourceGroupName, deviceName, name, context); if (inner != null) { return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), new StorageAccountCredentialImpl(inner.getValue(), this.manager())); @@ -53,8 +39,8 @@ public Response getWithResponse(String deviceName, Str } } - public StorageAccountCredential get(String deviceName, String name, String resourceGroupName) { - StorageAccountCredentialInner inner = this.serviceClient().get(deviceName, name, resourceGroupName); + public StorageAccountCredential get(String resourceGroupName, String deviceName, String name) { + StorageAccountCredentialInner inner = this.serviceClient().get(resourceGroupName, deviceName, name); if (inner != null) { return new StorageAccountCredentialImpl(inner, this.manager()); } else { @@ -62,15 +48,34 @@ public StorageAccountCredential get(String deviceName, String name, String resou } } - public void delete(String deviceName, String name, String resourceGroupName) { - this.serviceClient().delete(deviceName, name, resourceGroupName); + public void delete(String resourceGroupName, String deviceName, String name) { + this.serviceClient().delete(resourceGroupName, deviceName, name); } - public void delete(String deviceName, String name, String resourceGroupName, Context context) { - this.serviceClient().delete(deviceName, name, resourceGroupName, context); + public void delete(String resourceGroupName, String deviceName, String name, Context context) { + this.serviceClient().delete(resourceGroupName, deviceName, name, context); + } + + public PagedIterable listByDataBoxEdgeDevice(String resourceGroupName, + String deviceName) { + PagedIterable inner + = this.serviceClient().listByDataBoxEdgeDevice(resourceGroupName, deviceName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new StorageAccountCredentialImpl(inner1, this.manager())); + } + + public PagedIterable listByDataBoxEdgeDevice(String resourceGroupName, String deviceName, + Context context) { + PagedIterable inner + = this.serviceClient().listByDataBoxEdgeDevice(resourceGroupName, deviceName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new StorageAccountCredentialImpl(inner1, this.manager())); } public StorageAccountCredential getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } String deviceName = ResourceManagerUtils.getValueFromIdByName(id, "dataBoxEdgeDevices"); if (deviceName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( @@ -81,15 +86,15 @@ public StorageAccountCredential getById(String id) { throw LOGGER.logExceptionAsError(new IllegalArgumentException(String .format("The resource ID '%s' is not valid. Missing path segment 'storageAccountCredentials'.", id))); } + return this.getWithResponse(resourceGroupName, deviceName, name, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - return this.getWithResponse(deviceName, name, resourceGroupName, Context.NONE).getValue(); - } - - public Response getByIdWithResponse(String id, Context context) { String deviceName = ResourceManagerUtils.getValueFromIdByName(id, "dataBoxEdgeDevices"); if (deviceName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( @@ -100,15 +105,15 @@ public Response getByIdWithResponse(String id, Context throw LOGGER.logExceptionAsError(new IllegalArgumentException(String .format("The resource ID '%s' is not valid. Missing path segment 'storageAccountCredentials'.", id))); } + return this.getWithResponse(resourceGroupName, deviceName, name, context); + } + + public void deleteById(String id) { String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - return this.getWithResponse(deviceName, name, resourceGroupName, context); - } - - public void deleteById(String id) { String deviceName = ResourceManagerUtils.getValueFromIdByName(id, "dataBoxEdgeDevices"); if (deviceName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( @@ -119,15 +124,15 @@ public void deleteById(String id) { throw LOGGER.logExceptionAsError(new IllegalArgumentException(String .format("The resource ID '%s' is not valid. Missing path segment 'storageAccountCredentials'.", id))); } + this.delete(resourceGroupName, deviceName, name, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - this.delete(deviceName, name, resourceGroupName, Context.NONE); - } - - public void deleteByIdWithResponse(String id, Context context) { String deviceName = ResourceManagerUtils.getValueFromIdByName(id, "dataBoxEdgeDevices"); if (deviceName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( @@ -138,12 +143,7 @@ public void deleteByIdWithResponse(String id, Context context) { throw LOGGER.logExceptionAsError(new IllegalArgumentException(String .format("The resource ID '%s' is not valid. Missing path segment 'storageAccountCredentials'.", id))); } - String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - this.delete(deviceName, name, resourceGroupName, context); + this.delete(resourceGroupName, deviceName, name, context); } private StorageAccountCredentialsClient serviceClient() { diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/StorageAccountImpl.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/StorageAccountImpl.java index 335c077264ef..1ad0db49eb2c 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/StorageAccountImpl.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/StorageAccountImpl.java @@ -1,9 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.implementation; +import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.databoxedge.fluent.models.StorageAccountInner; import com.azure.resourcemanager.databoxedge.models.DataPolicy; @@ -27,6 +28,10 @@ public String type() { return this.innerModel().type(); } + public SystemData systemData() { + return this.innerModel().systemData(); + } + public String description() { return this.innerModel().description(); } @@ -63,29 +68,29 @@ private com.azure.resourcemanager.databoxedge.DataBoxEdgeManager manager() { return this.serviceManager; } + private String resourceGroupName; + private String deviceName; private String storageAccountName; - private String resourceGroupName; - - public StorageAccountImpl withExistingDataBoxEdgeDevice(String deviceName, String resourceGroupName) { - this.deviceName = deviceName; + public StorageAccountImpl withExistingDataBoxEdgeDevice(String resourceGroupName, String deviceName) { this.resourceGroupName = resourceGroupName; + this.deviceName = deviceName; return this; } public StorageAccount create() { this.innerObject = serviceManager.serviceClient() .getStorageAccounts() - .createOrUpdate(deviceName, storageAccountName, resourceGroupName, this.innerModel(), Context.NONE); + .createOrUpdate(resourceGroupName, deviceName, storageAccountName, this.innerModel(), Context.NONE); return this; } public StorageAccount create(Context context) { this.innerObject = serviceManager.serviceClient() .getStorageAccounts() - .createOrUpdate(deviceName, storageAccountName, resourceGroupName, this.innerModel(), context); + .createOrUpdate(resourceGroupName, deviceName, storageAccountName, this.innerModel(), context); return this; } @@ -102,14 +107,14 @@ public StorageAccountImpl update() { public StorageAccount apply() { this.innerObject = serviceManager.serviceClient() .getStorageAccounts() - .createOrUpdate(deviceName, storageAccountName, resourceGroupName, this.innerModel(), Context.NONE); + .createOrUpdate(resourceGroupName, deviceName, storageAccountName, this.innerModel(), Context.NONE); return this; } public StorageAccount apply(Context context) { this.innerObject = serviceManager.serviceClient() .getStorageAccounts() - .createOrUpdate(deviceName, storageAccountName, resourceGroupName, this.innerModel(), context); + .createOrUpdate(resourceGroupName, deviceName, storageAccountName, this.innerModel(), context); return this; } @@ -117,15 +122,15 @@ public StorageAccount apply(Context context) { com.azure.resourcemanager.databoxedge.DataBoxEdgeManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); this.deviceName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "dataBoxEdgeDevices"); this.storageAccountName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "storageAccounts"); - this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); } public StorageAccount refresh() { this.innerObject = serviceManager.serviceClient() .getStorageAccounts() - .getWithResponse(deviceName, storageAccountName, resourceGroupName, Context.NONE) + .getWithResponse(resourceGroupName, deviceName, storageAccountName, Context.NONE) .getValue(); return this; } @@ -133,11 +138,16 @@ public StorageAccount refresh() { public StorageAccount refresh(Context context) { this.innerObject = serviceManager.serviceClient() .getStorageAccounts() - .getWithResponse(deviceName, storageAccountName, resourceGroupName, context) + .getWithResponse(resourceGroupName, deviceName, storageAccountName, context) .getValue(); return this; } + public StorageAccountImpl withDataPolicy(DataPolicy dataPolicy) { + this.innerModel().withDataPolicy(dataPolicy); + return this; + } + public StorageAccountImpl withDescription(String description) { this.innerModel().withDescription(description); return this; @@ -148,11 +158,6 @@ public StorageAccountImpl withStorageAccountStatus(StorageAccountStatus storageA return this; } - public StorageAccountImpl withDataPolicy(DataPolicy dataPolicy) { - this.innerModel().withDataPolicy(dataPolicy); - return this; - } - public StorageAccountImpl withStorageAccountCredentialId(String storageAccountCredentialId) { this.innerModel().withStorageAccountCredentialId(storageAccountCredentialId); return this; diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/StorageAccountsClientImpl.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/StorageAccountsClientImpl.java index 669f1e241d11..28558b2af142 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/StorageAccountsClientImpl.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/StorageAccountsClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.implementation; @@ -27,13 +27,14 @@ import com.azure.core.http.rest.RestProxy; import com.azure.core.management.exception.ManagementException; import com.azure.core.management.polling.PollResult; +import com.azure.core.util.BinaryData; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; import com.azure.core.util.polling.PollerFlux; import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.databoxedge.fluent.StorageAccountsClient; import com.azure.resourcemanager.databoxedge.fluent.models.StorageAccountInner; -import com.azure.resourcemanager.databoxedge.models.StorageAccountList; +import com.azure.resourcemanager.databoxedge.implementation.models.StorageAccountList; import java.nio.ByteBuffer; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; @@ -67,47 +68,83 @@ public final class StorageAccountsClientImpl implements StorageAccountsClient { * The interface defining all the services for DataBoxEdgeManagementClientStorageAccounts to be used by the proxy * service to perform REST calls. */ - @Host("{$host}") - @ServiceInterface(name = "DataBoxEdgeManagemen") + @Host("{endpoint}") + @ServiceInterface(name = "DataBoxEdgeManagementClientStorageAccounts") public interface StorageAccountsService { @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccounts") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccounts/{storageAccountName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByDataBoxEdgeDevice(@HostParam("$host") String endpoint, - @PathParam("deviceName") String deviceName, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("deviceName") String deviceName, + @PathParam("storageAccountName") String storageAccountName, @HeaderParam("Accept") String accept, + Context context); @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccounts/{storageAccountName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("$host") String endpoint, - @PathParam("deviceName") String deviceName, @PathParam("storageAccountName") String storageAccountName, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); + Response getSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("deviceName") String deviceName, + @PathParam("storageAccountName") String storageAccountName, @HeaderParam("Accept") String accept, + Context context); - @Headers({ "Content-Type: application/json" }) @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccounts/{storageAccountName}") @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdate(@HostParam("$host") String endpoint, - @PathParam("deviceName") String deviceName, @PathParam("storageAccountName") String storageAccountName, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") StorageAccountInner storageAccount, @HeaderParam("Accept") String accept, + Mono>> createOrUpdate(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("deviceName") String deviceName, + @PathParam("storageAccountName") String storageAccountName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") StorageAccountInner storageAccount, Context context); - @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccounts/{storageAccountName}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response createOrUpdateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("deviceName") String deviceName, + @PathParam("storageAccountName") String storageAccountName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") StorageAccountInner storageAccount, + Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccounts/{storageAccountName}") @ExpectedResponses({ 202, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete(@HostParam("$host") String endpoint, - @PathParam("deviceName") String deviceName, @PathParam("storageAccountName") String storageAccountName, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, + Mono>> delete(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("deviceName") String deviceName, + @PathParam("storageAccountName") String storageAccountName, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccounts/{storageAccountName}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response deleteSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("deviceName") String deviceName, + @PathParam("storageAccountName") String storageAccountName, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccounts") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByDataBoxEdgeDevice(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("deviceName") String deviceName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccounts") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listByDataBoxEdgeDeviceSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("deviceName") String deviceName, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @@ -115,260 +152,62 @@ Mono>> delete(@HostParam("$host") String endpoint, @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByDataBoxEdgeDeviceNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); - } - - /** - * Lists all the storage accounts in a Data Box Edge/Data Box Gateway device. - * - * @param deviceName The device name. - * @param resourceGroupName The resource group name. - * @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 collection of all the Storage Accounts on the Data Box Edge/Gateway device along with - * {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByDataBoxEdgeDeviceSinglePageAsync(String deviceName, - String resourceGroupName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (deviceName == null) { - return Mono.error(new IllegalArgumentException("Parameter deviceName 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.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listByDataBoxEdgeDevice(this.client.getEndpoint(), deviceName, - this.client.getSubscriptionId(), resourceGroupName, this.client.getApiVersion(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Lists all the storage accounts in a Data Box Edge/Data Box Gateway device. - * - * @param deviceName The device name. - * @param resourceGroupName The resource group name. - * @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 collection of all the Storage Accounts on the Data Box Edge/Gateway device along with - * {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByDataBoxEdgeDeviceSinglePageAsync(String deviceName, - String resourceGroupName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (deviceName == null) { - return Mono.error(new IllegalArgumentException("Parameter deviceName 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.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByDataBoxEdgeDevice(this.client.getEndpoint(), deviceName, this.client.getSubscriptionId(), - resourceGroupName, this.client.getApiVersion(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * Lists all the storage accounts in a Data Box Edge/Data Box Gateway device. - * - * @param deviceName The device name. - * @param resourceGroupName The resource group name. - * @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 collection of all the Storage Accounts on the Data Box Edge/Gateway device as paginated response with - * {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByDataBoxEdgeDeviceAsync(String deviceName, String resourceGroupName) { - return new PagedFlux<>(() -> listByDataBoxEdgeDeviceSinglePageAsync(deviceName, resourceGroupName), - nextLink -> listByDataBoxEdgeDeviceNextSinglePageAsync(nextLink)); - } - - /** - * Lists all the storage accounts in a Data Box Edge/Data Box Gateway device. - * - * @param deviceName The device name. - * @param resourceGroupName The resource group name. - * @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 collection of all the Storage Accounts on the Data Box Edge/Gateway device as paginated response with - * {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByDataBoxEdgeDeviceAsync(String deviceName, String resourceGroupName, - Context context) { - return new PagedFlux<>(() -> listByDataBoxEdgeDeviceSinglePageAsync(deviceName, resourceGroupName, context), - nextLink -> listByDataBoxEdgeDeviceNextSinglePageAsync(nextLink, context)); - } - - /** - * Lists all the storage accounts in a Data Box Edge/Data Box Gateway device. - * - * @param deviceName The device name. - * @param resourceGroupName The resource group name. - * @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 collection of all the Storage Accounts on the Data Box Edge/Gateway device as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByDataBoxEdgeDevice(String deviceName, String resourceGroupName) { - return new PagedIterable<>(listByDataBoxEdgeDeviceAsync(deviceName, resourceGroupName)); - } - /** - * Lists all the storage accounts in a Data Box Edge/Data Box Gateway device. - * - * @param deviceName The device name. - * @param resourceGroupName The resource group name. - * @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 collection of all the Storage Accounts on the Data Box Edge/Gateway device as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByDataBoxEdgeDevice(String deviceName, String resourceGroupName, - Context context) { - return new PagedIterable<>(listByDataBoxEdgeDeviceAsync(deviceName, resourceGroupName, context)); + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listByDataBoxEdgeDeviceNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); } /** * Gets a StorageAccount by name. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. * @param storageAccountName The storage account name. - * @param resourceGroupName The resource group name. * @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 StorageAccount by name along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String deviceName, String storageAccountName, - String resourceGroupName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (deviceName == null) { - return Mono.error(new IllegalArgumentException("Parameter deviceName is required and cannot be null.")); - } - if (storageAccountName == null) { - return Mono - .error(new IllegalArgumentException("Parameter storageAccountName 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.")); - } + private Mono> getWithResponseAsync(String resourceGroupName, String deviceName, + String storageAccountName) { final String accept = "application/json"; return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), deviceName, storageAccountName, - this.client.getSubscriptionId(), resourceGroupName, this.client.getApiVersion(), accept, context)) + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, deviceName, storageAccountName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Gets a StorageAccount by name. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. * @param storageAccountName The storage account name. - * @param resourceGroupName The resource group name. - * @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 a StorageAccount by name along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String deviceName, String storageAccountName, - String resourceGroupName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (deviceName == null) { - return Mono.error(new IllegalArgumentException("Parameter deviceName is required and cannot be null.")); - } - if (storageAccountName == null) { - return Mono - .error(new IllegalArgumentException("Parameter storageAccountName 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.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), deviceName, storageAccountName, this.client.getSubscriptionId(), - resourceGroupName, this.client.getApiVersion(), accept, context); - } - - /** - * Gets a StorageAccount by name. - * - * @param deviceName The device name. - * @param storageAccountName The storage account name. - * @param resourceGroupName The resource group name. * @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 StorageAccount by name on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String deviceName, String storageAccountName, String resourceGroupName) { - return getWithResponseAsync(deviceName, storageAccountName, resourceGroupName) + private Mono getAsync(String resourceGroupName, String deviceName, String storageAccountName) { + return getWithResponseAsync(resourceGroupName, deviceName, storageAccountName) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * Gets a StorageAccount by name. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. * @param storageAccountName The storage account name. - * @param resourceGroupName The resource group name. * @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. @@ -376,33 +215,35 @@ private Mono getAsync(String deviceName, String storageAcco * @return a StorageAccount by name along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String deviceName, String storageAccountName, - String resourceGroupName, Context context) { - return getWithResponseAsync(deviceName, storageAccountName, resourceGroupName, context).block(); + public Response getWithResponse(String resourceGroupName, String deviceName, + String storageAccountName, Context context) { + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, deviceName, storageAccountName, accept, context); } /** * Gets a StorageAccount by name. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. * @param storageAccountName The storage account name. - * @param resourceGroupName The resource group name. * @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 StorageAccount by name. */ @ServiceMethod(returns = ReturnType.SINGLE) - public StorageAccountInner get(String deviceName, String storageAccountName, String resourceGroupName) { - return getWithResponse(deviceName, storageAccountName, resourceGroupName, Context.NONE).getValue(); + public StorageAccountInner get(String resourceGroupName, String deviceName, String storageAccountName) { + return getWithResponse(resourceGroupName, deviceName, storageAccountName, Context.NONE).getValue(); } /** * Creates a new StorageAccount or updates an existing StorageAccount on the device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param storageAccountName The StorageAccount name. - * @param resourceGroupName The resource group name. + * @param storageAccountName The storage account name. * @param storageAccount The StorageAccount properties. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -411,138 +252,89 @@ public StorageAccountInner get(String deviceName, String storageAccountName, Str * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync(String deviceName, - String storageAccountName, String resourceGroupName, StorageAccountInner storageAccount) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (deviceName == null) { - return Mono.error(new IllegalArgumentException("Parameter deviceName is required and cannot be null.")); - } - if (storageAccountName == null) { - return Mono - .error(new IllegalArgumentException("Parameter storageAccountName 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 (storageAccount == null) { - return Mono.error(new IllegalArgumentException("Parameter storageAccount is required and cannot be null.")); - } else { - storageAccount.validate(); - } + private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, + String deviceName, String storageAccountName, StorageAccountInner storageAccount) { + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), deviceName, storageAccountName, - this.client.getSubscriptionId(), resourceGroupName, this.client.getApiVersion(), storageAccount, accept, - context)) + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, deviceName, storageAccountName, contentType, accept, + storageAccount, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Creates a new StorageAccount or updates an existing StorageAccount on the device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param storageAccountName The StorageAccount name. - * @param resourceGroupName The resource group name. + * @param storageAccountName The storage account name. * @param storageAccount The StorageAccount properties. - * @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 represents a Storage Account on the Data Box Edge/Gateway device along with {@link Response} on - * successful completion of {@link Mono}. + * @return represents a Storage Account on the Data Box Edge/Gateway device along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync(String deviceName, - String storageAccountName, String resourceGroupName, StorageAccountInner storageAccount, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (deviceName == null) { - return Mono.error(new IllegalArgumentException("Parameter deviceName is required and cannot be null.")); - } - if (storageAccountName == null) { - return Mono - .error(new IllegalArgumentException("Parameter storageAccountName 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 (storageAccount == null) { - return Mono.error(new IllegalArgumentException("Parameter storageAccount is required and cannot be null.")); - } else { - storageAccount.validate(); - } + private Response createOrUpdateWithResponse(String resourceGroupName, String deviceName, + String storageAccountName, StorageAccountInner storageAccount) { + final String contentType = "application/json"; final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.createOrUpdate(this.client.getEndpoint(), deviceName, storageAccountName, - this.client.getSubscriptionId(), resourceGroupName, this.client.getApiVersion(), storageAccount, accept, - context); + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, deviceName, storageAccountName, contentType, accept, + storageAccount, Context.NONE); } /** * Creates a new StorageAccount or updates an existing StorageAccount on the device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param storageAccountName The StorageAccount name. - * @param resourceGroupName The resource group name. + * @param storageAccountName The storage account name. * @param storageAccount The StorageAccount properties. + * @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 PollerFlux} for polling of represents a Storage Account on the Data Box Edge/Gateway device. + * @return represents a Storage Account on the Data Box Edge/Gateway device along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, StorageAccountInner> beginCreateOrUpdateAsync(String deviceName, - String storageAccountName, String resourceGroupName, StorageAccountInner storageAccount) { - Mono>> mono - = createOrUpdateWithResponseAsync(deviceName, storageAccountName, resourceGroupName, storageAccount); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), - StorageAccountInner.class, StorageAccountInner.class, this.client.getContext()); + @ServiceMethod(returns = ReturnType.SINGLE) + private Response createOrUpdateWithResponse(String resourceGroupName, String deviceName, + String storageAccountName, StorageAccountInner storageAccount, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, deviceName, storageAccountName, contentType, accept, + storageAccount, context); } /** * Creates a new StorageAccount or updates an existing StorageAccount on the device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param storageAccountName The StorageAccount name. - * @param resourceGroupName The resource group name. + * @param storageAccountName The storage account name. * @param storageAccount The StorageAccount properties. - * @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 PollerFlux} for polling of represents a Storage Account on the Data Box Edge/Gateway device. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, StorageAccountInner> beginCreateOrUpdateAsync(String deviceName, - String storageAccountName, String resourceGroupName, StorageAccountInner storageAccount, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = createOrUpdateWithResponseAsync(deviceName, storageAccountName, - resourceGroupName, storageAccount, context); + private PollerFlux, StorageAccountInner> beginCreateOrUpdateAsync( + String resourceGroupName, String deviceName, String storageAccountName, StorageAccountInner storageAccount) { + Mono>> mono + = createOrUpdateWithResponseAsync(resourceGroupName, deviceName, storageAccountName, storageAccount); return this.client.getLroResult(mono, this.client.getHttpPipeline(), - StorageAccountInner.class, StorageAccountInner.class, context); + StorageAccountInner.class, StorageAccountInner.class, this.client.getContext()); } /** * Creates a new StorageAccount or updates an existing StorageAccount on the device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param storageAccountName The StorageAccount name. - * @param resourceGroupName The resource group name. + * @param storageAccountName The storage account name. * @param storageAccount The StorageAccount properties. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -550,18 +342,20 @@ private PollerFlux, StorageAccountInner> beginCr * @return the {@link SyncPoller} for polling of represents a Storage Account on the Data Box Edge/Gateway device. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, StorageAccountInner> beginCreateOrUpdate(String deviceName, - String storageAccountName, String resourceGroupName, StorageAccountInner storageAccount) { - return this.beginCreateOrUpdateAsync(deviceName, storageAccountName, resourceGroupName, storageAccount) - .getSyncPoller(); + public SyncPoller, StorageAccountInner> beginCreateOrUpdate( + String resourceGroupName, String deviceName, String storageAccountName, StorageAccountInner storageAccount) { + Response response + = createOrUpdateWithResponse(resourceGroupName, deviceName, storageAccountName, storageAccount); + return this.client.getLroResult(response, StorageAccountInner.class, + StorageAccountInner.class, Context.NONE); } /** * Creates a new StorageAccount or updates an existing StorageAccount on the device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param storageAccountName The StorageAccount name. - * @param resourceGroupName The resource group name. + * @param storageAccountName The storage account name. * @param storageAccount The StorageAccount properties. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -570,18 +364,21 @@ public SyncPoller, StorageAccountInner> beginCre * @return the {@link SyncPoller} for polling of represents a Storage Account on the Data Box Edge/Gateway device. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, StorageAccountInner> beginCreateOrUpdate(String deviceName, - String storageAccountName, String resourceGroupName, StorageAccountInner storageAccount, Context context) { - return this.beginCreateOrUpdateAsync(deviceName, storageAccountName, resourceGroupName, storageAccount, context) - .getSyncPoller(); + public SyncPoller, StorageAccountInner> beginCreateOrUpdate( + String resourceGroupName, String deviceName, String storageAccountName, StorageAccountInner storageAccount, + Context context) { + Response response + = createOrUpdateWithResponse(resourceGroupName, deviceName, storageAccountName, storageAccount, context); + return this.client.getLroResult(response, StorageAccountInner.class, + StorageAccountInner.class, context); } /** * Creates a new StorageAccount or updates an existing StorageAccount on the device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param storageAccountName The StorageAccount name. - * @param resourceGroupName The resource group name. + * @param storageAccountName The storage account name. * @param storageAccount The StorageAccount properties. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -590,167 +387,123 @@ public SyncPoller, StorageAccountInner> beginCre * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String deviceName, String storageAccountName, - String resourceGroupName, StorageAccountInner storageAccount) { - return beginCreateOrUpdateAsync(deviceName, storageAccountName, resourceGroupName, storageAccount).last() + private Mono createOrUpdateAsync(String resourceGroupName, String deviceName, + String storageAccountName, StorageAccountInner storageAccount) { + return beginCreateOrUpdateAsync(resourceGroupName, deviceName, storageAccountName, storageAccount).last() .flatMap(this.client::getLroFinalResultOrError); } /** * Creates a new StorageAccount or updates an existing StorageAccount on the device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param storageAccountName The StorageAccount name. - * @param resourceGroupName The resource group name. + * @param storageAccountName The storage account name. * @param storageAccount The StorageAccount properties. - * @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 represents a Storage Account on the Data Box Edge/Gateway device on successful completion of - * {@link Mono}. + * @return represents a Storage Account on the Data Box Edge/Gateway device. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String deviceName, String storageAccountName, - String resourceGroupName, StorageAccountInner storageAccount, Context context) { - return beginCreateOrUpdateAsync(deviceName, storageAccountName, resourceGroupName, storageAccount, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); + public StorageAccountInner createOrUpdate(String resourceGroupName, String deviceName, String storageAccountName, + StorageAccountInner storageAccount) { + return beginCreateOrUpdate(resourceGroupName, deviceName, storageAccountName, storageAccount).getFinalResult(); } /** * Creates a new StorageAccount or updates an existing StorageAccount on the device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param storageAccountName The StorageAccount name. - * @param resourceGroupName The resource group name. + * @param storageAccountName The storage account name. * @param storageAccount The StorageAccount properties. + * @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 represents a Storage Account on the Data Box Edge/Gateway device. */ @ServiceMethod(returns = ReturnType.SINGLE) - public StorageAccountInner createOrUpdate(String deviceName, String storageAccountName, String resourceGroupName, - StorageAccountInner storageAccount) { - return createOrUpdateAsync(deviceName, storageAccountName, resourceGroupName, storageAccount).block(); + public StorageAccountInner createOrUpdate(String resourceGroupName, String deviceName, String storageAccountName, + StorageAccountInner storageAccount, Context context) { + return beginCreateOrUpdate(resourceGroupName, deviceName, storageAccountName, storageAccount, context) + .getFinalResult(); } /** - * Creates a new StorageAccount or updates an existing StorageAccount on the device. + * Deletes the StorageAccount on the Data Box Edge/Data Box Gateway device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param storageAccountName The StorageAccount name. - * @param resourceGroupName The resource group name. - * @param storageAccount The StorageAccount properties. - * @param context The context to associate with this operation. + * @param storageAccountName The storage account name. * @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 represents a Storage Account on the Data Box Edge/Gateway device. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public StorageAccountInner createOrUpdate(String deviceName, String storageAccountName, String resourceGroupName, - StorageAccountInner storageAccount, Context context) { - return createOrUpdateAsync(deviceName, storageAccountName, resourceGroupName, storageAccount, context).block(); + private Mono>> deleteWithResponseAsync(String resourceGroupName, String deviceName, + String storageAccountName) { + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, deviceName, storageAccountName, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Deletes the StorageAccount on the Data Box Edge/Data Box Gateway device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param storageAccountName The StorageAccount name. - * @param resourceGroupName The resource group name. + * @param storageAccountName The storage account name. * @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}. + * @return the response body along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync(String deviceName, String storageAccountName, - String resourceGroupName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (deviceName == null) { - return Mono.error(new IllegalArgumentException("Parameter deviceName is required and cannot be null.")); - } - if (storageAccountName == null) { - return Mono - .error(new IllegalArgumentException("Parameter storageAccountName 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.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.delete(this.client.getEndpoint(), deviceName, storageAccountName, - this.client.getSubscriptionId(), resourceGroupName, this.client.getApiVersion(), accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + private Response deleteWithResponse(String resourceGroupName, String deviceName, + String storageAccountName) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, deviceName, storageAccountName, Context.NONE); } /** * Deletes the StorageAccount on the Data Box Edge/Data Box Gateway device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param storageAccountName The StorageAccount name. - * @param resourceGroupName The resource group name. + * @param storageAccountName The storage account name. * @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}. + * @return the response body along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync(String deviceName, String storageAccountName, - String resourceGroupName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (deviceName == null) { - return Mono.error(new IllegalArgumentException("Parameter deviceName is required and cannot be null.")); - } - if (storageAccountName == null) { - return Mono - .error(new IllegalArgumentException("Parameter storageAccountName 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.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), deviceName, storageAccountName, - this.client.getSubscriptionId(), resourceGroupName, this.client.getApiVersion(), accept, context); + private Response deleteWithResponse(String resourceGroupName, String deviceName, + String storageAccountName, Context context) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, deviceName, storageAccountName, context); } /** * Deletes the StorageAccount on the Data Box Edge/Data Box Gateway device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param storageAccountName The StorageAccount name. - * @param resourceGroupName The resource group name. + * @param storageAccountName The storage account name. * @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 long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync(String deviceName, String storageAccountName, - String resourceGroupName) { + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String deviceName, + String storageAccountName) { Mono>> mono - = deleteWithResponseAsync(deviceName, storageAccountName, resourceGroupName); + = deleteWithResponseAsync(resourceGroupName, deviceName, storageAccountName); return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); } @@ -758,125 +511,208 @@ private PollerFlux, Void> beginDeleteAsync(String deviceName, S /** * Deletes the StorageAccount on the Data Box Edge/Data Box Gateway device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param storageAccountName The StorageAccount name. - * @param resourceGroupName The resource group name. - * @param context The context to associate with this operation. + * @param storageAccountName The storage account name. * @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 long-running operation. + * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync(String deviceName, String storageAccountName, - String resourceGroupName, Context context) { - context = this.client.mergeContext(context); - Mono>> mono - = deleteWithResponseAsync(deviceName, storageAccountName, resourceGroupName, context); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - context); + public SyncPoller, Void> beginDelete(String resourceGroupName, String deviceName, + String storageAccountName) { + Response response = deleteWithResponse(resourceGroupName, deviceName, storageAccountName); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); } /** * Deletes the StorageAccount on the Data Box Edge/Data Box Gateway device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param storageAccountName The StorageAccount name. - * @param resourceGroupName The resource group name. + * @param storageAccountName The storage account name. + * @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 SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete(String deviceName, String storageAccountName, - String resourceGroupName) { - return this.beginDeleteAsync(deviceName, storageAccountName, resourceGroupName).getSyncPoller(); + public SyncPoller, Void> beginDelete(String resourceGroupName, String deviceName, + String storageAccountName, Context context) { + Response response = deleteWithResponse(resourceGroupName, deviceName, storageAccountName, context); + return this.client.getLroResult(response, Void.class, Void.class, context); } /** * Deletes the StorageAccount on the Data Box Edge/Data Box Gateway device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param storageAccountName The StorageAccount name. - * @param resourceGroupName The resource group name. - * @param context The context to associate with this operation. + * @param storageAccountName The storage account name. * @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 SyncPoller} for polling of long-running operation. + * @return A {@link Mono} that completes when a successful response is received. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete(String deviceName, String storageAccountName, - String resourceGroupName, Context context) { - return this.beginDeleteAsync(deviceName, storageAccountName, resourceGroupName, context).getSyncPoller(); + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String deviceName, String storageAccountName) { + return beginDeleteAsync(resourceGroupName, deviceName, storageAccountName).last() + .flatMap(this.client::getLroFinalResultOrError); } /** * Deletes the StorageAccount on the Data Box Edge/Data Box Gateway device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param storageAccountName The StorageAccount name. - * @param resourceGroupName The resource group name. + * @param storageAccountName The storage account name. * @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 deleteAsync(String deviceName, String storageAccountName, String resourceGroupName) { - return beginDeleteAsync(deviceName, storageAccountName, resourceGroupName).last() - .flatMap(this.client::getLroFinalResultOrError); + public void delete(String resourceGroupName, String deviceName, String storageAccountName) { + beginDelete(resourceGroupName, deviceName, storageAccountName).getFinalResult(); } /** * Deletes the StorageAccount on the Data Box Edge/Data Box Gateway device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param storageAccountName The StorageAccount name. - * @param resourceGroupName The resource group name. + * @param storageAccountName The storage account name. * @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 A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String deviceName, String storageAccountName, String resourceGroupName, - Context context) { - return beginDeleteAsync(deviceName, storageAccountName, resourceGroupName, context).last() - .flatMap(this.client::getLroFinalResultOrError); + public void delete(String resourceGroupName, String deviceName, String storageAccountName, Context context) { + beginDelete(resourceGroupName, deviceName, storageAccountName, context).getFinalResult(); } /** - * Deletes the StorageAccount on the Data Box Edge/Data Box Gateway device. + * Lists all the StorageAccounts in a Data Box Edge/Data Box Gateway device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @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 collection of all the Storage Accounts on the Data Box Edge/Gateway device along with + * {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByDataBoxEdgeDeviceSinglePageAsync(String resourceGroupName, + String deviceName) { + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByDataBoxEdgeDevice(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, deviceName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists all the StorageAccounts in a Data Box Edge/Data Box Gateway device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @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 collection of all the Storage Accounts on the Data Box Edge/Gateway device as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByDataBoxEdgeDeviceAsync(String resourceGroupName, String deviceName) { + return new PagedFlux<>(() -> listByDataBoxEdgeDeviceSinglePageAsync(resourceGroupName, deviceName), + nextLink -> listByDataBoxEdgeDeviceNextSinglePageAsync(nextLink)); + } + + /** + * Lists all the StorageAccounts in a Data Box Edge/Data Box Gateway device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param storageAccountName The StorageAccount name. - * @param resourceGroupName The resource group name. * @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 collection of all the Storage Accounts on the Data Box Edge/Gateway device along with + * {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String deviceName, String storageAccountName, String resourceGroupName) { - deleteAsync(deviceName, storageAccountName, resourceGroupName).block(); + private PagedResponse listByDataBoxEdgeDeviceSinglePage(String resourceGroupName, + String deviceName) { + final String accept = "application/json"; + Response res + = service.listByDataBoxEdgeDeviceSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, deviceName, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** - * Deletes the StorageAccount on the Data Box Edge/Data Box Gateway device. + * Lists all the StorageAccounts in a Data Box Edge/Data Box Gateway device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param storageAccountName The StorageAccount name. - * @param resourceGroupName The resource group name. * @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 collection of all the Storage Accounts on the Data Box Edge/Gateway device along with + * {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String deviceName, String storageAccountName, String resourceGroupName, Context context) { - deleteAsync(deviceName, storageAccountName, resourceGroupName, context).block(); + private PagedResponse listByDataBoxEdgeDeviceSinglePage(String resourceGroupName, + String deviceName, Context context) { + final String accept = "application/json"; + Response res + = service.listByDataBoxEdgeDeviceSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, deviceName, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Lists all the StorageAccounts in a Data Box Edge/Data Box Gateway device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @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 collection of all the Storage Accounts on the Data Box Edge/Gateway device as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByDataBoxEdgeDevice(String resourceGroupName, String deviceName) { + return new PagedIterable<>(() -> listByDataBoxEdgeDeviceSinglePage(resourceGroupName, deviceName), + nextLink -> listByDataBoxEdgeDeviceNextSinglePage(nextLink)); + } + + /** + * Lists all the StorageAccounts in a Data Box Edge/Data Box Gateway device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @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 collection of all the Storage Accounts on the Data Box Edge/Gateway device as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByDataBoxEdgeDevice(String resourceGroupName, String deviceName, + Context context) { + return new PagedIterable<>(() -> listByDataBoxEdgeDeviceSinglePage(resourceGroupName, deviceName, context), + nextLink -> listByDataBoxEdgeDeviceNextSinglePage(nextLink, context)); } /** @@ -891,13 +727,6 @@ public void delete(String deviceName, String storageAccountName, String resource */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByDataBoxEdgeDeviceNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil .withContext( @@ -907,6 +736,25 @@ private Mono> listByDataBoxEdgeDeviceNextSing .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @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 collection of all the Storage Accounts on the Data Box Edge/Gateway device along with + * {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByDataBoxEdgeDeviceNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listByDataBoxEdgeDeviceNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + /** * Get the next page of items. * @@ -916,22 +764,14 @@ private Mono> listByDataBoxEdgeDeviceNextSing * @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 collection of all the Storage Accounts on the Data Box Edge/Gateway device along with - * {@link PagedResponse} on successful completion of {@link Mono}. + * {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByDataBoxEdgeDeviceNextSinglePageAsync(String nextLink, - Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } + private PagedResponse listByDataBoxEdgeDeviceNextSinglePage(String nextLink, Context context) { final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listByDataBoxEdgeDeviceNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + Response res + = service.listByDataBoxEdgeDeviceNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } } diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/StorageAccountsImpl.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/StorageAccountsImpl.java index 3136cf96bb6c..c42e329c8000 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/StorageAccountsImpl.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/StorageAccountsImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.implementation; @@ -27,23 +27,10 @@ public StorageAccountsImpl(StorageAccountsClient innerClient, this.serviceManager = serviceManager; } - public PagedIterable listByDataBoxEdgeDevice(String deviceName, String resourceGroupName) { - PagedIterable inner - = this.serviceClient().listByDataBoxEdgeDevice(deviceName, resourceGroupName); - return ResourceManagerUtils.mapPage(inner, inner1 -> new StorageAccountImpl(inner1, this.manager())); - } - - public PagedIterable listByDataBoxEdgeDevice(String deviceName, String resourceGroupName, - Context context) { - PagedIterable inner - = this.serviceClient().listByDataBoxEdgeDevice(deviceName, resourceGroupName, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new StorageAccountImpl(inner1, this.manager())); - } - - public Response getWithResponse(String deviceName, String storageAccountName, - String resourceGroupName, Context context) { + public Response getWithResponse(String resourceGroupName, String deviceName, + String storageAccountName, Context context) { Response inner - = this.serviceClient().getWithResponse(deviceName, storageAccountName, resourceGroupName, context); + = this.serviceClient().getWithResponse(resourceGroupName, deviceName, storageAccountName, context); if (inner != null) { return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), new StorageAccountImpl(inner.getValue(), this.manager())); @@ -52,8 +39,8 @@ public Response getWithResponse(String deviceName, String storag } } - public StorageAccount get(String deviceName, String storageAccountName, String resourceGroupName) { - StorageAccountInner inner = this.serviceClient().get(deviceName, storageAccountName, resourceGroupName); + public StorageAccount get(String resourceGroupName, String deviceName, String storageAccountName) { + StorageAccountInner inner = this.serviceClient().get(resourceGroupName, deviceName, storageAccountName); if (inner != null) { return new StorageAccountImpl(inner, this.manager()); } else { @@ -61,15 +48,33 @@ public StorageAccount get(String deviceName, String storageAccountName, String r } } - public void delete(String deviceName, String storageAccountName, String resourceGroupName) { - this.serviceClient().delete(deviceName, storageAccountName, resourceGroupName); + public void delete(String resourceGroupName, String deviceName, String storageAccountName) { + this.serviceClient().delete(resourceGroupName, deviceName, storageAccountName); } - public void delete(String deviceName, String storageAccountName, String resourceGroupName, Context context) { - this.serviceClient().delete(deviceName, storageAccountName, resourceGroupName, context); + public void delete(String resourceGroupName, String deviceName, String storageAccountName, Context context) { + this.serviceClient().delete(resourceGroupName, deviceName, storageAccountName, context); + } + + public PagedIterable listByDataBoxEdgeDevice(String resourceGroupName, String deviceName) { + PagedIterable inner + = this.serviceClient().listByDataBoxEdgeDevice(resourceGroupName, deviceName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new StorageAccountImpl(inner1, this.manager())); + } + + public PagedIterable listByDataBoxEdgeDevice(String resourceGroupName, String deviceName, + Context context) { + PagedIterable inner + = this.serviceClient().listByDataBoxEdgeDevice(resourceGroupName, deviceName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new StorageAccountImpl(inner1, this.manager())); } public StorageAccount getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } String deviceName = ResourceManagerUtils.getValueFromIdByName(id, "dataBoxEdgeDevices"); if (deviceName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( @@ -80,15 +85,15 @@ public StorageAccount getById(String id) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'storageAccounts'.", id))); } + return this.getWithResponse(resourceGroupName, deviceName, storageAccountName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - return this.getWithResponse(deviceName, storageAccountName, resourceGroupName, Context.NONE).getValue(); - } - - public Response getByIdWithResponse(String id, Context context) { String deviceName = ResourceManagerUtils.getValueFromIdByName(id, "dataBoxEdgeDevices"); if (deviceName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( @@ -99,15 +104,15 @@ public Response getByIdWithResponse(String id, Context context) throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'storageAccounts'.", id))); } + return this.getWithResponse(resourceGroupName, deviceName, storageAccountName, context); + } + + public void deleteById(String id) { String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - return this.getWithResponse(deviceName, storageAccountName, resourceGroupName, context); - } - - public void deleteById(String id) { String deviceName = ResourceManagerUtils.getValueFromIdByName(id, "dataBoxEdgeDevices"); if (deviceName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( @@ -118,15 +123,15 @@ public void deleteById(String id) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'storageAccounts'.", id))); } + this.delete(resourceGroupName, deviceName, storageAccountName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - this.delete(deviceName, storageAccountName, resourceGroupName, Context.NONE); - } - - public void deleteByIdWithResponse(String id, Context context) { String deviceName = ResourceManagerUtils.getValueFromIdByName(id, "dataBoxEdgeDevices"); if (deviceName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( @@ -137,12 +142,7 @@ public void deleteByIdWithResponse(String id, Context context) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'storageAccounts'.", id))); } - String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - this.delete(deviceName, storageAccountName, resourceGroupName, context); + this.delete(resourceGroupName, deviceName, storageAccountName, context); } private StorageAccountsClient serviceClient() { diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/SupportPackagesClientImpl.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/SupportPackagesClientImpl.java new file mode 100644 index 000000000000..56e4f154b24a --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/SupportPackagesClientImpl.java @@ -0,0 +1,261 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.databoxedge.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.BinaryData; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.databoxedge.fluent.SupportPackagesClient; +import com.azure.resourcemanager.databoxedge.models.TriggerSupportPackageRequest; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in SupportPackagesClient. + */ +public final class SupportPackagesClientImpl implements SupportPackagesClient { + /** + * The proxy service used to perform REST calls. + */ + private final SupportPackagesService service; + + /** + * The service client containing this operation class. + */ + private final DataBoxEdgeManagementClientImpl client; + + /** + * Initializes an instance of SupportPackagesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + SupportPackagesClientImpl(DataBoxEdgeManagementClientImpl client) { + this.service + = RestProxy.create(SupportPackagesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for DataBoxEdgeManagementClientSupportPackages to be used by the proxy + * service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "DataBoxEdgeManagementClientSupportPackages") + public interface SupportPackagesService { + @Headers({ "Accept: application/json;q=0.9" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/triggerSupportPackage") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> triggerSupportPackage(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("deviceName") String deviceName, + @HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") TriggerSupportPackageRequest triggerSupportPackageRequest, Context context); + + @Headers({ "Accept: application/json;q=0.9" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/triggerSupportPackage") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response triggerSupportPackageSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("deviceName") String deviceName, + @HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") TriggerSupportPackageRequest triggerSupportPackageRequest, Context context); + } + + /** + * Triggers support package on the device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @param triggerSupportPackageRequest The trigger support package request object. + * @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>> triggerSupportPackageWithResponseAsync(String resourceGroupName, + String deviceName, TriggerSupportPackageRequest triggerSupportPackageRequest) { + final String contentType = "application/json"; + return FluxUtil + .withContext(context -> service.triggerSupportPackage(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, deviceName, + contentType, triggerSupportPackageRequest, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Triggers support package on the device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @param triggerSupportPackageRequest The trigger support package request object. + * @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 body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response triggerSupportPackageWithResponse(String resourceGroupName, String deviceName, + TriggerSupportPackageRequest triggerSupportPackageRequest) { + final String contentType = "application/json"; + return service.triggerSupportPackageSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, deviceName, contentType, triggerSupportPackageRequest, + Context.NONE); + } + + /** + * Triggers support package on the device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @param triggerSupportPackageRequest The trigger support package request object. + * @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 body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response triggerSupportPackageWithResponse(String resourceGroupName, String deviceName, + TriggerSupportPackageRequest triggerSupportPackageRequest, Context context) { + final String contentType = "application/json"; + return service.triggerSupportPackageSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, deviceName, contentType, triggerSupportPackageRequest, + context); + } + + /** + * Triggers support package on the device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @param triggerSupportPackageRequest The trigger support package request object. + * @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 long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginTriggerSupportPackageAsync(String resourceGroupName, + String deviceName, TriggerSupportPackageRequest triggerSupportPackageRequest) { + Mono>> mono + = triggerSupportPackageWithResponseAsync(resourceGroupName, deviceName, triggerSupportPackageRequest); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Triggers support package on the device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @param triggerSupportPackageRequest The trigger support package request object. + * @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 SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginTriggerSupportPackage(String resourceGroupName, String deviceName, + TriggerSupportPackageRequest triggerSupportPackageRequest) { + Response response + = triggerSupportPackageWithResponse(resourceGroupName, deviceName, triggerSupportPackageRequest); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); + } + + /** + * Triggers support package on the device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @param triggerSupportPackageRequest The trigger support package request object. + * @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 SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginTriggerSupportPackage(String resourceGroupName, String deviceName, + TriggerSupportPackageRequest triggerSupportPackageRequest, Context context) { + Response response + = triggerSupportPackageWithResponse(resourceGroupName, deviceName, triggerSupportPackageRequest, context); + return this.client.getLroResult(response, Void.class, Void.class, context); + } + + /** + * Triggers support package on the device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @param triggerSupportPackageRequest The trigger support package request object. + * @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 triggerSupportPackageAsync(String resourceGroupName, String deviceName, + TriggerSupportPackageRequest triggerSupportPackageRequest) { + return beginTriggerSupportPackageAsync(resourceGroupName, deviceName, triggerSupportPackageRequest).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Triggers support package on the device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @param triggerSupportPackageRequest The trigger support package request object. + * @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 triggerSupportPackage(String resourceGroupName, String deviceName, + TriggerSupportPackageRequest triggerSupportPackageRequest) { + beginTriggerSupportPackage(resourceGroupName, deviceName, triggerSupportPackageRequest).getFinalResult(); + } + + /** + * Triggers support package on the device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @param triggerSupportPackageRequest The trigger support package request object. + * @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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void triggerSupportPackage(String resourceGroupName, String deviceName, + TriggerSupportPackageRequest triggerSupportPackageRequest, Context context) { + beginTriggerSupportPackage(resourceGroupName, deviceName, triggerSupportPackageRequest, context) + .getFinalResult(); + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/SupportPackagesImpl.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/SupportPackagesImpl.java new file mode 100644 index 000000000000..09e47b6ae1cc --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/SupportPackagesImpl.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.databoxedge.implementation; + +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.databoxedge.fluent.SupportPackagesClient; +import com.azure.resourcemanager.databoxedge.models.SupportPackages; +import com.azure.resourcemanager.databoxedge.models.TriggerSupportPackageRequest; + +public final class SupportPackagesImpl implements SupportPackages { + private static final ClientLogger LOGGER = new ClientLogger(SupportPackagesImpl.class); + + private final SupportPackagesClient innerClient; + + private final com.azure.resourcemanager.databoxedge.DataBoxEdgeManager serviceManager; + + public SupportPackagesImpl(SupportPackagesClient innerClient, + com.azure.resourcemanager.databoxedge.DataBoxEdgeManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public void triggerSupportPackage(String resourceGroupName, String deviceName, + TriggerSupportPackageRequest triggerSupportPackageRequest) { + this.serviceClient().triggerSupportPackage(resourceGroupName, deviceName, triggerSupportPackageRequest); + } + + public void triggerSupportPackage(String resourceGroupName, String deviceName, + TriggerSupportPackageRequest triggerSupportPackageRequest, Context context) { + this.serviceClient() + .triggerSupportPackage(resourceGroupName, deviceName, triggerSupportPackageRequest, context); + } + + private SupportPackagesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.databoxedge.DataBoxEdgeManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/TriggerImpl.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/TriggerImpl.java index 47f67de9502f..b6b08fa6c326 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/TriggerImpl.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/TriggerImpl.java @@ -1,23 +1,21 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.implementation; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; import com.azure.resourcemanager.databoxedge.fluent.models.TriggerInner; import com.azure.resourcemanager.databoxedge.models.Trigger; import com.azure.resourcemanager.databoxedge.models.TriggerEventType; +import com.azure.resourcemanager.databoxedge.models.TriggerProperties; -public final class TriggerImpl implements Trigger { +public final class TriggerImpl implements Trigger, Trigger.Definition, Trigger.Update { private TriggerInner innerObject; private final com.azure.resourcemanager.databoxedge.DataBoxEdgeManager serviceManager; - TriggerImpl(TriggerInner innerObject, com.azure.resourcemanager.databoxedge.DataBoxEdgeManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - public String id() { return this.innerModel().id(); } @@ -30,10 +28,22 @@ public String type() { return this.innerModel().type(); } + public TriggerProperties properties() { + return this.innerModel().properties(); + } + public TriggerEventType kind() { return this.innerModel().kind(); } + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + public TriggerInner innerModel() { return this.innerObject; } @@ -41,4 +51,88 @@ public TriggerInner innerModel() { private com.azure.resourcemanager.databoxedge.DataBoxEdgeManager manager() { return this.serviceManager; } + + private String resourceGroupName; + + private String deviceName; + + private String name; + + public TriggerImpl withExistingDataBoxEdgeDevice(String resourceGroupName, String deviceName) { + this.resourceGroupName = resourceGroupName; + this.deviceName = deviceName; + return this; + } + + public Trigger create() { + this.innerObject = serviceManager.serviceClient() + .getTriggers() + .createOrUpdate(resourceGroupName, deviceName, name, this.innerModel(), Context.NONE); + return this; + } + + public Trigger create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getTriggers() + .createOrUpdate(resourceGroupName, deviceName, name, this.innerModel(), context); + return this; + } + + TriggerImpl(String name, com.azure.resourcemanager.databoxedge.DataBoxEdgeManager serviceManager) { + this.innerObject = new TriggerInner(); + this.serviceManager = serviceManager; + this.name = name; + } + + public TriggerImpl update() { + return this; + } + + public Trigger apply() { + this.innerObject = serviceManager.serviceClient() + .getTriggers() + .createOrUpdate(resourceGroupName, deviceName, name, this.innerModel(), Context.NONE); + return this; + } + + public Trigger apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getTriggers() + .createOrUpdate(resourceGroupName, deviceName, name, this.innerModel(), context); + return this; + } + + TriggerImpl(TriggerInner innerObject, com.azure.resourcemanager.databoxedge.DataBoxEdgeManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.deviceName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "dataBoxEdgeDevices"); + this.name = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "triggers"); + } + + public Trigger refresh() { + this.innerObject = serviceManager.serviceClient() + .getTriggers() + .getWithResponse(resourceGroupName, deviceName, name, Context.NONE) + .getValue(); + return this; + } + + public Trigger refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getTriggers() + .getWithResponse(resourceGroupName, deviceName, name, context) + .getValue(); + return this; + } + + public TriggerImpl withKind(TriggerEventType kind) { + this.innerModel().withKind(kind); + return this; + } + + public TriggerImpl withProperties(TriggerProperties properties) { + this.innerModel().withProperties(properties); + return this; + } } diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/TriggersClientImpl.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/TriggersClientImpl.java index 533db25e9cd1..a9f437f49fa3 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/TriggersClientImpl.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/TriggersClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.implementation; @@ -27,13 +27,14 @@ import com.azure.core.http.rest.RestProxy; import com.azure.core.management.exception.ManagementException; import com.azure.core.management.polling.PollResult; +import com.azure.core.util.BinaryData; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; import com.azure.core.util.polling.PollerFlux; import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.databoxedge.fluent.TriggersClient; import com.azure.resourcemanager.databoxedge.fluent.models.TriggerInner; -import com.azure.resourcemanager.databoxedge.models.TriggerList; +import com.azure.resourcemanager.databoxedge.implementation.models.TriggerList; import java.nio.ByteBuffer; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; @@ -66,325 +67,142 @@ public final class TriggersClientImpl implements TriggersClient { * The interface defining all the services for DataBoxEdgeManagementClientTriggers to be used by the proxy service * to perform REST calls. */ - @Host("{$host}") - @ServiceInterface(name = "DataBoxEdgeManagemen") + @Host("{endpoint}") + @ServiceInterface(name = "DataBoxEdgeManagementClientTriggers") public interface TriggersService { @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/triggers") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/triggers/{name}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByDataBoxEdgeDevice(@HostParam("$host") String endpoint, - @PathParam("deviceName") String deviceName, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, - @QueryParam("$filter") String filter, @HeaderParam("Accept") String accept, Context context); + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("deviceName") String deviceName, + @PathParam("name") String name, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/triggers/{name}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("$host") String endpoint, - @PathParam("deviceName") String deviceName, @PathParam("name") String name, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); + Response getSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("deviceName") String deviceName, + @PathParam("name") String name, @HeaderParam("Accept") String accept, Context context); - @Headers({ "Content-Type: application/json" }) @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/triggers/{name}") @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdate(@HostParam("$host") String endpoint, - @PathParam("deviceName") String deviceName, @PathParam("name") String name, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") TriggerInner trigger, @HeaderParam("Accept") String accept, Context context); + Mono>> createOrUpdate(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("deviceName") String deviceName, + @PathParam("name") String name, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") TriggerInner trigger, Context context); - @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/triggers/{name}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response createOrUpdateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("deviceName") String deviceName, + @PathParam("name") String name, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") TriggerInner trigger, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/triggers/{name}") @ExpectedResponses({ 200, 202, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete(@HostParam("$host") String endpoint, - @PathParam("deviceName") String deviceName, @PathParam("name") String name, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); + Mono>> delete(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("deviceName") String deviceName, + @PathParam("name") String name, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/triggers/{name}") + @ExpectedResponses({ 200, 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response deleteSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("deviceName") String deviceName, + @PathParam("name") String name, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/triggers") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByDataBoxEdgeDevice(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("deviceName") String deviceName, + @QueryParam("$filter") String filter, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/triggers") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listByDataBoxEdgeDeviceSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("deviceName") String deviceName, + @QueryParam("$filter") String filter, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByDataBoxEdgeDeviceNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); - } - - /** - * Lists all the triggers configured in the device. - * - * @param deviceName The device name. - * @param resourceGroupName The resource group name. - * @param filter Specify $filter='CustomContextTag eq <tag>' to filter on custom context tag property. - * @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 collection of all trigger on the data box edge device along with {@link PagedResponse} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByDataBoxEdgeDeviceSinglePageAsync(String deviceName, - String resourceGroupName, String filter) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (deviceName == null) { - return Mono.error(new IllegalArgumentException("Parameter deviceName 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.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.listByDataBoxEdgeDevice(this.client.getEndpoint(), deviceName, - this.client.getSubscriptionId(), resourceGroupName, this.client.getApiVersion(), filter, accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), - res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Lists all the triggers configured in the device. - * - * @param deviceName The device name. - * @param resourceGroupName The resource group name. - * @param filter Specify $filter='CustomContextTag eq <tag>' to filter on custom context tag property. - * @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 collection of all trigger on the data box edge device along with {@link PagedResponse} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByDataBoxEdgeDeviceSinglePageAsync(String deviceName, - String resourceGroupName, String filter, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (deviceName == null) { - return Mono.error(new IllegalArgumentException("Parameter deviceName 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.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByDataBoxEdgeDevice(this.client.getEndpoint(), deviceName, this.client.getSubscriptionId(), - resourceGroupName, this.client.getApiVersion(), filter, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - /** - * Lists all the triggers configured in the device. - * - * @param deviceName The device name. - * @param resourceGroupName The resource group name. - * @param filter Specify $filter='CustomContextTag eq <tag>' to filter on custom context tag property. - * @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 collection of all trigger on the data box edge device as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByDataBoxEdgeDeviceAsync(String deviceName, String resourceGroupName, - String filter) { - return new PagedFlux<>(() -> listByDataBoxEdgeDeviceSinglePageAsync(deviceName, resourceGroupName, filter), - nextLink -> listByDataBoxEdgeDeviceNextSinglePageAsync(nextLink)); - } - - /** - * Lists all the triggers configured in the device. - * - * @param deviceName The device name. - * @param resourceGroupName The resource group name. - * @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 collection of all trigger on the data box edge device as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByDataBoxEdgeDeviceAsync(String deviceName, String resourceGroupName) { - final String filter = null; - return new PagedFlux<>(() -> listByDataBoxEdgeDeviceSinglePageAsync(deviceName, resourceGroupName, filter), - nextLink -> listByDataBoxEdgeDeviceNextSinglePageAsync(nextLink)); - } - - /** - * Lists all the triggers configured in the device. - * - * @param deviceName The device name. - * @param resourceGroupName The resource group name. - * @param filter Specify $filter='CustomContextTag eq <tag>' to filter on custom context tag property. - * @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 collection of all trigger on the data box edge device as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByDataBoxEdgeDeviceAsync(String deviceName, String resourceGroupName, - String filter, Context context) { - return new PagedFlux<>( - () -> listByDataBoxEdgeDeviceSinglePageAsync(deviceName, resourceGroupName, filter, context), - nextLink -> listByDataBoxEdgeDeviceNextSinglePageAsync(nextLink, context)); - } - - /** - * Lists all the triggers configured in the device. - * - * @param deviceName The device name. - * @param resourceGroupName The resource group name. - * @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 collection of all trigger on the data box edge device as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByDataBoxEdgeDevice(String deviceName, String resourceGroupName) { - final String filter = null; - return new PagedIterable<>(listByDataBoxEdgeDeviceAsync(deviceName, resourceGroupName, filter)); - } - - /** - * Lists all the triggers configured in the device. - * - * @param deviceName The device name. - * @param resourceGroupName The resource group name. - * @param filter Specify $filter='CustomContextTag eq <tag>' to filter on custom context tag property. - * @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 collection of all trigger on the data box edge device as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByDataBoxEdgeDevice(String deviceName, String resourceGroupName, - String filter, Context context) { - return new PagedIterable<>(listByDataBoxEdgeDeviceAsync(deviceName, resourceGroupName, filter, context)); + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listByDataBoxEdgeDeviceNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); } /** * Get a specific trigger by name. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. * @param name The trigger name. - * @param resourceGroupName The resource group name. * @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 specific trigger by name along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String deviceName, String name, - String resourceGroupName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (deviceName == null) { - return Mono.error(new IllegalArgumentException("Parameter deviceName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name 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.")); - } + private Mono> getWithResponseAsync(String resourceGroupName, String deviceName, + String name) { final String accept = "application/json"; return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), deviceName, name, - this.client.getSubscriptionId(), resourceGroupName, this.client.getApiVersion(), accept, context)) + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, deviceName, name, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Get a specific trigger by name. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. * @param name The trigger name. - * @param resourceGroupName The resource group name. - * @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 a specific trigger by name along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String deviceName, String name, String resourceGroupName, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (deviceName == null) { - return Mono.error(new IllegalArgumentException("Parameter deviceName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name 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.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), deviceName, name, this.client.getSubscriptionId(), - resourceGroupName, this.client.getApiVersion(), accept, context); - } - - /** - * Get a specific trigger by name. - * - * @param deviceName The device name. - * @param name The trigger name. - * @param resourceGroupName The resource group name. * @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 specific trigger by name on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String deviceName, String name, String resourceGroupName) { - return getWithResponseAsync(deviceName, name, resourceGroupName) + private Mono getAsync(String resourceGroupName, String deviceName, String name) { + return getWithResponseAsync(resourceGroupName, deviceName, name) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * Get a specific trigger by name. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. * @param name The trigger name. - * @param resourceGroupName The resource group name. * @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. @@ -392,33 +210,35 @@ private Mono getAsync(String deviceName, String name, String resou * @return a specific trigger by name along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String deviceName, String name, String resourceGroupName, + public Response getWithResponse(String resourceGroupName, String deviceName, String name, Context context) { - return getWithResponseAsync(deviceName, name, resourceGroupName, context).block(); + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, deviceName, name, accept, context); } /** * Get a specific trigger by name. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. * @param name The trigger name. - * @param resourceGroupName The resource group name. * @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 specific trigger by name. */ @ServiceMethod(returns = ReturnType.SINGLE) - public TriggerInner get(String deviceName, String name, String resourceGroupName) { - return getWithResponse(deviceName, name, resourceGroupName, Context.NONE).getValue(); + public TriggerInner get(String resourceGroupName, String deviceName, String name) { + return getWithResponse(resourceGroupName, deviceName, name, Context.NONE).getValue(); } /** * Creates or updates a trigger. * - * @param deviceName Creates or updates a trigger. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. * @param name The trigger name. - * @param resourceGroupName The resource group name. * @param trigger The trigger. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -426,132 +246,89 @@ public TriggerInner get(String deviceName, String name, String resourceGroupName * @return trigger details along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync(String deviceName, String name, - String resourceGroupName, TriggerInner trigger) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (deviceName == null) { - return Mono.error(new IllegalArgumentException("Parameter deviceName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name 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 (trigger == null) { - return Mono.error(new IllegalArgumentException("Parameter trigger is required and cannot be null.")); - } else { - trigger.validate(); - } + private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, + String deviceName, String name, TriggerInner trigger) { + final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil.withContext(context -> service.createOrUpdate(this.client.getEndpoint(), deviceName, name, - this.client.getSubscriptionId(), resourceGroupName, this.client.getApiVersion(), trigger, accept, context)) + return FluxUtil + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, deviceName, name, contentType, accept, trigger, + context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Creates or updates a trigger. * - * @param deviceName Creates or updates a trigger. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. * @param name The trigger name. - * @param resourceGroupName The resource group name. * @param trigger The trigger. - * @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 trigger details along with {@link Response} on successful completion of {@link Mono}. + * @return trigger details along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync(String deviceName, String name, - String resourceGroupName, TriggerInner trigger, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (deviceName == null) { - return Mono.error(new IllegalArgumentException("Parameter deviceName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name 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 (trigger == null) { - return Mono.error(new IllegalArgumentException("Parameter trigger is required and cannot be null.")); - } else { - trigger.validate(); - } + private Response createOrUpdateWithResponse(String resourceGroupName, String deviceName, String name, + TriggerInner trigger) { + final String contentType = "application/json"; final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.createOrUpdate(this.client.getEndpoint(), deviceName, name, this.client.getSubscriptionId(), - resourceGroupName, this.client.getApiVersion(), trigger, accept, context); + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, deviceName, name, contentType, accept, trigger, + Context.NONE); } /** * Creates or updates a trigger. * - * @param deviceName Creates or updates a trigger. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. * @param name The trigger name. - * @param resourceGroupName The resource group name. * @param trigger The trigger. + * @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 PollerFlux} for polling of trigger details. + * @return trigger details along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, TriggerInner> beginCreateOrUpdateAsync(String deviceName, String name, - String resourceGroupName, TriggerInner trigger) { - Mono>> mono - = createOrUpdateWithResponseAsync(deviceName, name, resourceGroupName, trigger); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), - TriggerInner.class, TriggerInner.class, this.client.getContext()); + @ServiceMethod(returns = ReturnType.SINGLE) + private Response createOrUpdateWithResponse(String resourceGroupName, String deviceName, String name, + TriggerInner trigger, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, deviceName, name, contentType, accept, trigger, + context); } /** * Creates or updates a trigger. * - * @param deviceName Creates or updates a trigger. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. * @param name The trigger name. - * @param resourceGroupName The resource group name. * @param trigger The trigger. - * @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 PollerFlux} for polling of trigger details. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, TriggerInner> beginCreateOrUpdateAsync(String deviceName, String name, - String resourceGroupName, TriggerInner trigger, Context context) { - context = this.client.mergeContext(context); + private PollerFlux, TriggerInner> beginCreateOrUpdateAsync(String resourceGroupName, + String deviceName, String name, TriggerInner trigger) { Mono>> mono - = createOrUpdateWithResponseAsync(deviceName, name, resourceGroupName, trigger, context); + = createOrUpdateWithResponseAsync(resourceGroupName, deviceName, name, trigger); return this.client.getLroResult(mono, this.client.getHttpPipeline(), - TriggerInner.class, TriggerInner.class, context); + TriggerInner.class, TriggerInner.class, this.client.getContext()); } /** * Creates or updates a trigger. * - * @param deviceName Creates or updates a trigger. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. * @param name The trigger name. - * @param resourceGroupName The resource group name. * @param trigger The trigger. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -559,17 +336,19 @@ private PollerFlux, TriggerInner> beginCreateOrUpdateAs * @return the {@link SyncPoller} for polling of trigger details. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, TriggerInner> beginCreateOrUpdate(String deviceName, String name, - String resourceGroupName, TriggerInner trigger) { - return this.beginCreateOrUpdateAsync(deviceName, name, resourceGroupName, trigger).getSyncPoller(); + public SyncPoller, TriggerInner> beginCreateOrUpdate(String resourceGroupName, + String deviceName, String name, TriggerInner trigger) { + Response response = createOrUpdateWithResponse(resourceGroupName, deviceName, name, trigger); + return this.client.getLroResult(response, TriggerInner.class, TriggerInner.class, + Context.NONE); } /** * Creates or updates a trigger. * - * @param deviceName Creates or updates a trigger. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. * @param name The trigger name. - * @param resourceGroupName The resource group name. * @param trigger The trigger. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -578,17 +357,20 @@ public SyncPoller, TriggerInner> beginCreateOrUpdate(St * @return the {@link SyncPoller} for polling of trigger details. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, TriggerInner> beginCreateOrUpdate(String deviceName, String name, - String resourceGroupName, TriggerInner trigger, Context context) { - return this.beginCreateOrUpdateAsync(deviceName, name, resourceGroupName, trigger, context).getSyncPoller(); + public SyncPoller, TriggerInner> beginCreateOrUpdate(String resourceGroupName, + String deviceName, String name, TriggerInner trigger, Context context) { + Response response + = createOrUpdateWithResponse(resourceGroupName, deviceName, name, trigger, context); + return this.client.getLroResult(response, TriggerInner.class, TriggerInner.class, + context); } /** * Creates or updates a trigger. * - * @param deviceName Creates or updates a trigger. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. * @param name The trigger name. - * @param resourceGroupName The resource group name. * @param trigger The trigger. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -596,38 +378,18 @@ public SyncPoller, TriggerInner> beginCreateOrUpdate(St * @return trigger details on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String deviceName, String name, String resourceGroupName, + private Mono createOrUpdateAsync(String resourceGroupName, String deviceName, String name, TriggerInner trigger) { - return beginCreateOrUpdateAsync(deviceName, name, resourceGroupName, trigger).last() + return beginCreateOrUpdateAsync(resourceGroupName, deviceName, name, trigger).last() .flatMap(this.client::getLroFinalResultOrError); } /** * Creates or updates a trigger. * - * @param deviceName Creates or updates a trigger. - * @param name The trigger name. - * @param resourceGroupName The resource group name. - * @param trigger The trigger. - * @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 trigger details on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String deviceName, String name, String resourceGroupName, - TriggerInner trigger, Context context) { - return beginCreateOrUpdateAsync(deviceName, name, resourceGroupName, trigger, context).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Creates or updates a trigger. - * - * @param deviceName Creates or updates a trigger. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. * @param name The trigger name. - * @param resourceGroupName The resource group name. * @param trigger The trigger. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -635,16 +397,16 @@ private Mono createOrUpdateAsync(String deviceName, String name, S * @return trigger details. */ @ServiceMethod(returns = ReturnType.SINGLE) - public TriggerInner createOrUpdate(String deviceName, String name, String resourceGroupName, TriggerInner trigger) { - return createOrUpdateAsync(deviceName, name, resourceGroupName, trigger).block(); + public TriggerInner createOrUpdate(String resourceGroupName, String deviceName, String name, TriggerInner trigger) { + return beginCreateOrUpdate(resourceGroupName, deviceName, name, trigger).getFinalResult(); } /** * Creates or updates a trigger. * - * @param deviceName Creates or updates a trigger. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. * @param name The trigger name. - * @param resourceGroupName The resource group name. * @param trigger The trigger. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -653,151 +415,109 @@ public TriggerInner createOrUpdate(String deviceName, String name, String resour * @return trigger details. */ @ServiceMethod(returns = ReturnType.SINGLE) - public TriggerInner createOrUpdate(String deviceName, String name, String resourceGroupName, TriggerInner trigger, + public TriggerInner createOrUpdate(String resourceGroupName, String deviceName, String name, TriggerInner trigger, Context context) { - return createOrUpdateAsync(deviceName, name, resourceGroupName, trigger, context).block(); + return beginCreateOrUpdate(resourceGroupName, deviceName, name, trigger, context).getFinalResult(); } /** * Deletes the trigger on the gateway device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. * @param name The trigger name. - * @param resourceGroupName The resource group name. * @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>> deleteWithResponseAsync(String deviceName, String name, - String resourceGroupName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (deviceName == null) { - return Mono.error(new IllegalArgumentException("Parameter deviceName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name 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.")); - } - final String accept = "application/json"; + private Mono>> deleteWithResponseAsync(String resourceGroupName, String deviceName, + String name) { return FluxUtil - .withContext(context -> service.delete(this.client.getEndpoint(), deviceName, name, - this.client.getSubscriptionId(), resourceGroupName, this.client.getApiVersion(), accept, context)) + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, deviceName, name, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Deletes the trigger on the gateway device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. * @param name The trigger name. - * @param resourceGroupName The resource group name. - * @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}. + * @return the response body along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync(String deviceName, String name, - String resourceGroupName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (deviceName == null) { - return Mono.error(new IllegalArgumentException("Parameter deviceName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name 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.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), deviceName, name, this.client.getSubscriptionId(), - resourceGroupName, this.client.getApiVersion(), accept, context); + private Response deleteWithResponse(String resourceGroupName, String deviceName, String name) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, deviceName, name, Context.NONE); } /** * Deletes the trigger on the gateway device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. * @param name The trigger name. - * @param resourceGroupName The resource group name. + * @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 PollerFlux} for polling of long-running operation. + * @return the response body along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync(String deviceName, String name, - String resourceGroupName) { - Mono>> mono = deleteWithResponseAsync(deviceName, name, resourceGroupName); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - this.client.getContext()); + @ServiceMethod(returns = ReturnType.SINGLE) + private Response deleteWithResponse(String resourceGroupName, String deviceName, String name, + Context context) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, deviceName, name, context); } /** * Deletes the trigger on the gateway device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. * @param name The trigger name. - * @param resourceGroupName The resource group name. - * @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 PollerFlux} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync(String deviceName, String name, - String resourceGroupName, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = deleteWithResponseAsync(deviceName, name, resourceGroupName, context); + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String deviceName, + String name) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, deviceName, name); return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - context); + this.client.getContext()); } /** * Deletes the trigger on the gateway device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. * @param name The trigger name. - * @param resourceGroupName The resource group name. * @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 SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete(String deviceName, String name, String resourceGroupName) { - return this.beginDeleteAsync(deviceName, name, resourceGroupName).getSyncPoller(); + public SyncPoller, Void> beginDelete(String resourceGroupName, String deviceName, String name) { + Response response = deleteWithResponse(resourceGroupName, deviceName, name); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); } /** * Deletes the trigger on the gateway device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. * @param name The trigger name. - * @param resourceGroupName The resource group name. * @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. @@ -805,75 +525,200 @@ public SyncPoller, Void> beginDelete(String deviceName, String * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete(String deviceName, String name, String resourceGroupName, + public SyncPoller, Void> beginDelete(String resourceGroupName, String deviceName, String name, Context context) { - return this.beginDeleteAsync(deviceName, name, resourceGroupName, context).getSyncPoller(); + Response response = deleteWithResponse(resourceGroupName, deviceName, name, context); + return this.client.getLroResult(response, Void.class, Void.class, context); } /** * Deletes the trigger on the gateway device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. * @param name The trigger name. - * @param resourceGroupName The resource group name. * @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 deleteAsync(String deviceName, String name, String resourceGroupName) { - return beginDeleteAsync(deviceName, name, resourceGroupName).last() + private Mono deleteAsync(String resourceGroupName, String deviceName, String name) { + return beginDeleteAsync(resourceGroupName, deviceName, name).last() .flatMap(this.client::getLroFinalResultOrError); } /** * Deletes the trigger on the gateway device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. * @param name The trigger name. - * @param resourceGroupName The resource group name. - * @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 A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String deviceName, String name, String resourceGroupName, Context context) { - return beginDeleteAsync(deviceName, name, resourceGroupName, context).last() - .flatMap(this.client::getLroFinalResultOrError); + public void delete(String resourceGroupName, String deviceName, String name) { + beginDelete(resourceGroupName, deviceName, name).getFinalResult(); } /** * Deletes the trigger on the gateway device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. * @param name The trigger name. - * @param resourceGroupName The resource group name. + * @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. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String deviceName, String name, String resourceGroupName) { - deleteAsync(deviceName, name, resourceGroupName).block(); + public void delete(String resourceGroupName, String deviceName, String name, Context context) { + beginDelete(resourceGroupName, deviceName, name, context).getFinalResult(); } /** - * Deletes the trigger on the gateway device. + * Lists all the triggers configured in the device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param name The trigger name. - * @param resourceGroupName The resource group name. + * @param filter Specify $filter='CustomContextTag eq <tag>' to filter on custom context tag property. + * @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 collection of all trigger on the data box edge device along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByDataBoxEdgeDeviceSinglePageAsync(String resourceGroupName, + String deviceName, String filter) { + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByDataBoxEdgeDevice(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, deviceName, filter, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists all the triggers configured in the device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @param filter Specify $filter='CustomContextTag eq <tag>' to filter on custom context tag property. + * @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 collection of all trigger on the data box edge device as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByDataBoxEdgeDeviceAsync(String resourceGroupName, String deviceName, + String filter) { + return new PagedFlux<>(() -> listByDataBoxEdgeDeviceSinglePageAsync(resourceGroupName, deviceName, filter), + nextLink -> listByDataBoxEdgeDeviceNextSinglePageAsync(nextLink)); + } + + /** + * Lists all the triggers configured in the device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @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 collection of all trigger on the data box edge device as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByDataBoxEdgeDeviceAsync(String resourceGroupName, String deviceName) { + final String filter = null; + return new PagedFlux<>(() -> listByDataBoxEdgeDeviceSinglePageAsync(resourceGroupName, deviceName, filter), + nextLink -> listByDataBoxEdgeDeviceNextSinglePageAsync(nextLink)); + } + + /** + * Lists all the triggers configured in the device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @param filter Specify $filter='CustomContextTag eq <tag>' to filter on custom context tag property. + * @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 collection of all trigger on the data box edge device along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByDataBoxEdgeDeviceSinglePage(String resourceGroupName, String deviceName, + String filter) { + final String accept = "application/json"; + Response res + = service.listByDataBoxEdgeDeviceSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, deviceName, filter, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Lists all the triggers configured in the device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @param filter Specify $filter='CustomContextTag eq <tag>' to filter on custom context tag property. * @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 collection of all trigger on the data box edge device along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String deviceName, String name, String resourceGroupName, Context context) { - deleteAsync(deviceName, name, resourceGroupName, context).block(); + private PagedResponse listByDataBoxEdgeDeviceSinglePage(String resourceGroupName, String deviceName, + String filter, Context context) { + final String accept = "application/json"; + Response res + = service.listByDataBoxEdgeDeviceSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, deviceName, filter, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Lists all the triggers configured in the device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @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 collection of all trigger on the data box edge device as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByDataBoxEdgeDevice(String resourceGroupName, String deviceName) { + final String filter = null; + return new PagedIterable<>(() -> listByDataBoxEdgeDeviceSinglePage(resourceGroupName, deviceName, filter), + nextLink -> listByDataBoxEdgeDeviceNextSinglePage(nextLink)); + } + + /** + * Lists all the triggers configured in the device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @param filter Specify $filter='CustomContextTag eq <tag>' to filter on custom context tag property. + * @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 collection of all trigger on the data box edge device as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByDataBoxEdgeDevice(String resourceGroupName, String deviceName, + String filter, Context context) { + return new PagedIterable<>( + () -> listByDataBoxEdgeDeviceSinglePage(resourceGroupName, deviceName, filter, context), + nextLink -> listByDataBoxEdgeDeviceNextSinglePage(nextLink, context)); } /** @@ -888,13 +733,6 @@ public void delete(String deviceName, String name, String resourceGroupName, Con */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByDataBoxEdgeDeviceNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil .withContext( @@ -904,6 +742,24 @@ private Mono> listByDataBoxEdgeDeviceNextSinglePageA .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @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 collection of all trigger on the data box edge device along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByDataBoxEdgeDeviceNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listByDataBoxEdgeDeviceNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + /** * Get the next page of items. * @@ -912,23 +768,14 @@ private Mono> listByDataBoxEdgeDeviceNextSinglePageA * @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 collection of all trigger on the data box edge device along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * @return collection of all trigger on the data box edge device along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByDataBoxEdgeDeviceNextSinglePageAsync(String nextLink, - Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } + private PagedResponse listByDataBoxEdgeDeviceNextSinglePage(String nextLink, Context context) { final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listByDataBoxEdgeDeviceNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + Response res + = service.listByDataBoxEdgeDeviceNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } } diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/TriggersImpl.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/TriggersImpl.java index 7d80b50c6f9d..7201ec014587 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/TriggersImpl.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/TriggersImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.implementation; @@ -27,22 +27,10 @@ public TriggersImpl(TriggersClient innerClient, this.serviceManager = serviceManager; } - public PagedIterable listByDataBoxEdgeDevice(String deviceName, String resourceGroupName) { - PagedIterable inner = this.serviceClient().listByDataBoxEdgeDevice(deviceName, resourceGroupName); - return ResourceManagerUtils.mapPage(inner, inner1 -> new TriggerImpl(inner1, this.manager())); - } - - public PagedIterable listByDataBoxEdgeDevice(String deviceName, String resourceGroupName, String filter, - Context context) { - PagedIterable inner - = this.serviceClient().listByDataBoxEdgeDevice(deviceName, resourceGroupName, filter, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new TriggerImpl(inner1, this.manager())); - } - - public Response getWithResponse(String deviceName, String name, String resourceGroupName, + public Response getWithResponse(String resourceGroupName, String deviceName, String name, Context context) { Response inner - = this.serviceClient().getWithResponse(deviceName, name, resourceGroupName, context); + = this.serviceClient().getWithResponse(resourceGroupName, deviceName, name, context); if (inner != null) { return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), new TriggerImpl(inner.getValue(), this.manager())); @@ -51,8 +39,8 @@ public Response getWithResponse(String deviceName, String name, String } } - public Trigger get(String deviceName, String name, String resourceGroupName) { - TriggerInner inner = this.serviceClient().get(deviceName, name, resourceGroupName); + public Trigger get(String resourceGroupName, String deviceName, String name) { + TriggerInner inner = this.serviceClient().get(resourceGroupName, deviceName, name); if (inner != null) { return new TriggerImpl(inner, this.manager()); } else { @@ -60,31 +48,100 @@ public Trigger get(String deviceName, String name, String resourceGroupName) { } } - public Trigger createOrUpdate(String deviceName, String name, String resourceGroupName, TriggerInner trigger) { - TriggerInner inner = this.serviceClient().createOrUpdate(deviceName, name, resourceGroupName, trigger); - if (inner != null) { - return new TriggerImpl(inner, this.manager()); - } else { - return null; - } + public void delete(String resourceGroupName, String deviceName, String name) { + this.serviceClient().delete(resourceGroupName, deviceName, name); + } + + public void delete(String resourceGroupName, String deviceName, String name, Context context) { + this.serviceClient().delete(resourceGroupName, deviceName, name, context); + } + + public PagedIterable listByDataBoxEdgeDevice(String resourceGroupName, String deviceName) { + PagedIterable inner = this.serviceClient().listByDataBoxEdgeDevice(resourceGroupName, deviceName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new TriggerImpl(inner1, this.manager())); } - public Trigger createOrUpdate(String deviceName, String name, String resourceGroupName, TriggerInner trigger, + public PagedIterable listByDataBoxEdgeDevice(String resourceGroupName, String deviceName, String filter, Context context) { - TriggerInner inner = this.serviceClient().createOrUpdate(deviceName, name, resourceGroupName, trigger, context); - if (inner != null) { - return new TriggerImpl(inner, this.manager()); - } else { - return null; + PagedIterable inner + = this.serviceClient().listByDataBoxEdgeDevice(resourceGroupName, deviceName, filter, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new TriggerImpl(inner1, this.manager())); + } + + public Trigger getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String deviceName = ResourceManagerUtils.getValueFromIdByName(id, "dataBoxEdgeDevices"); + if (deviceName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'dataBoxEdgeDevices'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "triggers"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'triggers'.", id))); + } + return this.getWithResponse(resourceGroupName, deviceName, name, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } + String deviceName = ResourceManagerUtils.getValueFromIdByName(id, "dataBoxEdgeDevices"); + if (deviceName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'dataBoxEdgeDevices'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "triggers"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'triggers'.", id))); + } + return this.getWithResponse(resourceGroupName, deviceName, name, context); } - public void delete(String deviceName, String name, String resourceGroupName) { - this.serviceClient().delete(deviceName, name, resourceGroupName); + public void deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String deviceName = ResourceManagerUtils.getValueFromIdByName(id, "dataBoxEdgeDevices"); + if (deviceName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'dataBoxEdgeDevices'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "triggers"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'triggers'.", id))); + } + this.delete(resourceGroupName, deviceName, name, Context.NONE); } - public void delete(String deviceName, String name, String resourceGroupName, Context context) { - this.serviceClient().delete(deviceName, name, resourceGroupName, context); + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String deviceName = ResourceManagerUtils.getValueFromIdByName(id, "dataBoxEdgeDevices"); + if (deviceName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'dataBoxEdgeDevices'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "triggers"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'triggers'.", id))); + } + this.delete(resourceGroupName, deviceName, name, context); } private TriggersClient serviceClient() { @@ -94,4 +151,8 @@ private TriggersClient serviceClient() { private com.azure.resourcemanager.databoxedge.DataBoxEdgeManager manager() { return this.serviceManager; } + + public TriggerImpl define(String name) { + return new TriggerImpl(name, this.manager()); + } } diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/UpdateSummaryImpl.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/UpdateSummaryImpl.java index 39f984e9e80a..6556ffc3d0ba 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/UpdateSummaryImpl.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/UpdateSummaryImpl.java @@ -1,11 +1,14 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.implementation; +import com.azure.core.management.SystemData; import com.azure.resourcemanager.databoxedge.fluent.models.UpdateSummaryInner; import com.azure.resourcemanager.databoxedge.models.InstallRebootBehavior; +import com.azure.resourcemanager.databoxedge.models.JobStatus; +import com.azure.resourcemanager.databoxedge.models.UpdateDetails; import com.azure.resourcemanager.databoxedge.models.UpdateOperation; import com.azure.resourcemanager.databoxedge.models.UpdateSummary; import java.time.OffsetDateTime; @@ -35,6 +38,10 @@ public String type() { return this.innerModel().type(); } + public SystemData systemData() { + return this.innerModel().systemData(); + } + public String deviceVersionNumber() { return this.innerModel().deviceVersionNumber(); } @@ -51,14 +58,38 @@ public OffsetDateTime lastCompletedScanJobDateTime() { return this.innerModel().lastCompletedScanJobDateTime(); } + public OffsetDateTime lastSuccessfulScanJobTime() { + return this.innerModel().lastSuccessfulScanJobTime(); + } + public OffsetDateTime lastCompletedDownloadJobDateTime() { return this.innerModel().lastCompletedDownloadJobDateTime(); } + public String lastCompletedDownloadJobId() { + return this.innerModel().lastCompletedDownloadJobId(); + } + + public JobStatus lastDownloadJobStatus() { + return this.innerModel().lastDownloadJobStatus(); + } + + public OffsetDateTime lastSuccessfulInstallJobDateTime() { + return this.innerModel().lastSuccessfulInstallJobDateTime(); + } + public OffsetDateTime lastCompletedInstallJobDateTime() { return this.innerModel().lastCompletedInstallJobDateTime(); } + public String lastCompletedInstallJobId() { + return this.innerModel().lastCompletedInstallJobId(); + } + + public JobStatus lastInstallJobStatus() { + return this.innerModel().lastInstallJobStatus(); + } + public Integer totalNumberOfUpdatesAvailable() { return this.innerModel().totalNumberOfUpdatesAvailable(); } @@ -104,10 +135,23 @@ public List updateTitles() { } } + public List updates() { + List inner = this.innerModel().updates(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + public Double totalUpdateSizeInBytes() { return this.innerModel().totalUpdateSizeInBytes(); } + public Integer totalTimeInMinutes() { + return this.innerModel().totalTimeInMinutes(); + } + public UpdateSummaryInner innerModel() { return this.innerObject; } diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/UploadCertificateResponseImpl.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/UploadCertificateResponseImpl.java index 0868f78bb4dc..105841731353 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/UploadCertificateResponseImpl.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/UploadCertificateResponseImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.implementation; diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/UserImpl.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/UserImpl.java index 6014378b163a..aa024bca316a 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/UserImpl.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/UserImpl.java @@ -1,9 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.implementation; +import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.databoxedge.fluent.models.UserInner; import com.azure.resourcemanager.databoxedge.models.AsymmetricEncryptedSecret; @@ -30,6 +31,10 @@ public String type() { return this.innerModel().type(); } + public SystemData systemData() { + return this.innerModel().systemData(); + } + public AsymmetricEncryptedSecret encryptedPassword() { return this.innerModel().encryptedPassword(); } @@ -59,29 +64,29 @@ private com.azure.resourcemanager.databoxedge.DataBoxEdgeManager manager() { return this.serviceManager; } + private String resourceGroupName; + private String deviceName; private String name; - private String resourceGroupName; - - public UserImpl withExistingDataBoxEdgeDevice(String deviceName, String resourceGroupName) { - this.deviceName = deviceName; + public UserImpl withExistingDataBoxEdgeDevice(String resourceGroupName, String deviceName) { this.resourceGroupName = resourceGroupName; + this.deviceName = deviceName; return this; } public User create() { this.innerObject = serviceManager.serviceClient() .getUsers() - .createOrUpdate(deviceName, name, resourceGroupName, this.innerModel(), Context.NONE); + .createOrUpdate(resourceGroupName, deviceName, name, this.innerModel(), Context.NONE); return this; } public User create(Context context) { this.innerObject = serviceManager.serviceClient() .getUsers() - .createOrUpdate(deviceName, name, resourceGroupName, this.innerModel(), context); + .createOrUpdate(resourceGroupName, deviceName, name, this.innerModel(), context); return this; } @@ -98,29 +103,29 @@ public UserImpl update() { public User apply() { this.innerObject = serviceManager.serviceClient() .getUsers() - .createOrUpdate(deviceName, name, resourceGroupName, this.innerModel(), Context.NONE); + .createOrUpdate(resourceGroupName, deviceName, name, this.innerModel(), Context.NONE); return this; } public User apply(Context context) { this.innerObject = serviceManager.serviceClient() .getUsers() - .createOrUpdate(deviceName, name, resourceGroupName, this.innerModel(), context); + .createOrUpdate(resourceGroupName, deviceName, name, this.innerModel(), context); return this; } UserImpl(UserInner innerObject, com.azure.resourcemanager.databoxedge.DataBoxEdgeManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); this.deviceName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "dataBoxEdgeDevices"); this.name = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "users"); - this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); } public User refresh() { this.innerObject = serviceManager.serviceClient() .getUsers() - .getWithResponse(deviceName, name, resourceGroupName, Context.NONE) + .getWithResponse(resourceGroupName, deviceName, name, Context.NONE) .getValue(); return this; } @@ -128,7 +133,7 @@ public User refresh() { public User refresh(Context context) { this.innerObject = serviceManager.serviceClient() .getUsers() - .getWithResponse(deviceName, name, resourceGroupName, context) + .getWithResponse(resourceGroupName, deviceName, name, context) .getValue(); return this; } @@ -142,9 +147,4 @@ public UserImpl withEncryptedPassword(AsymmetricEncryptedSecret encryptedPasswor this.innerModel().withEncryptedPassword(encryptedPassword); return this; } - - public UserImpl withShareAccessRights(List shareAccessRights) { - this.innerModel().withShareAccessRights(shareAccessRights); - return this; - } } diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/UsersClientImpl.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/UsersClientImpl.java index 138411d1b23d..d50f6e944163 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/UsersClientImpl.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/UsersClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.implementation; @@ -27,13 +27,14 @@ import com.azure.core.http.rest.RestProxy; import com.azure.core.management.exception.ManagementException; import com.azure.core.management.polling.PollResult; +import com.azure.core.util.BinaryData; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; import com.azure.core.util.polling.PollerFlux; import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.databoxedge.fluent.UsersClient; import com.azure.resourcemanager.databoxedge.fluent.models.UserInner; -import com.azure.resourcemanager.databoxedge.models.UserList; +import com.azure.resourcemanager.databoxedge.implementation.models.UserList; import java.nio.ByteBuffer; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; @@ -66,234 +67,104 @@ public final class UsersClientImpl implements UsersClient { * The interface defining all the services for DataBoxEdgeManagementClientUsers to be used by the proxy service to * perform REST calls. */ - @Host("{$host}") - @ServiceInterface(name = "DataBoxEdgeManagemen") + @Host("{endpoint}") + @ServiceInterface(name = "DataBoxEdgeManagementClientUsers") public interface UsersService { @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/users") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/users/{name}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByDataBoxEdgeDevice(@HostParam("$host") String endpoint, - @PathParam("deviceName") String deviceName, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, - @QueryParam("$filter") String filter, @HeaderParam("Accept") String accept, Context context); + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("deviceName") String deviceName, + @PathParam("name") String name, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/users/{name}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("$host") String endpoint, @PathParam("deviceName") String deviceName, - @PathParam("name") String name, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); + Response getSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("deviceName") String deviceName, + @PathParam("name") String name, @HeaderParam("Accept") String accept, Context context); - @Headers({ "Content-Type: application/json" }) @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/users/{name}") @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdate(@HostParam("$host") String endpoint, - @PathParam("deviceName") String deviceName, @PathParam("name") String name, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") UserInner user, @HeaderParam("Accept") String accept, Context context); + Mono>> createOrUpdate(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("deviceName") String deviceName, + @PathParam("name") String name, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") UserInner user, Context context); - @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/users/{name}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response createOrUpdateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("deviceName") String deviceName, + @PathParam("name") String name, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") UserInner user, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/users/{name}") @ExpectedResponses({ 200, 202, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete(@HostParam("$host") String endpoint, - @PathParam("deviceName") String deviceName, @PathParam("name") String name, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); + Mono>> delete(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("deviceName") String deviceName, + @PathParam("name") String name, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/users/{name}") + @ExpectedResponses({ 200, 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response deleteSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("deviceName") String deviceName, + @PathParam("name") String name, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/users") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByDataBoxEdgeDevice(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("deviceName") String deviceName, + @QueryParam("$filter") String filter, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/users") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listByDataBoxEdgeDeviceSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("deviceName") String deviceName, + @QueryParam("$filter") String filter, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByDataBoxEdgeDeviceNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); - } - - /** - * Gets all the users registered on a Data Box Edge/Data Box Gateway device. - * - * @param deviceName The device name. - * @param resourceGroupName The resource group name. - * @param filter Specify $filter='UserType eq <type>' to filter on user type property. - * @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 all the users registered on a Data Box Edge/Data Box Gateway device along with {@link PagedResponse} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByDataBoxEdgeDeviceSinglePageAsync(String deviceName, - String resourceGroupName, String filter) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (deviceName == null) { - return Mono.error(new IllegalArgumentException("Parameter deviceName 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.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.listByDataBoxEdgeDevice(this.client.getEndpoint(), deviceName, - this.client.getSubscriptionId(), resourceGroupName, this.client.getApiVersion(), filter, accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), - res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets all the users registered on a Data Box Edge/Data Box Gateway device. - * - * @param deviceName The device name. - * @param resourceGroupName The resource group name. - * @param filter Specify $filter='UserType eq <type>' to filter on user type property. - * @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 all the users registered on a Data Box Edge/Data Box Gateway device along with {@link PagedResponse} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByDataBoxEdgeDeviceSinglePageAsync(String deviceName, - String resourceGroupName, String filter, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (deviceName == null) { - return Mono.error(new IllegalArgumentException("Parameter deviceName 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.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByDataBoxEdgeDevice(this.client.getEndpoint(), deviceName, this.client.getSubscriptionId(), - resourceGroupName, this.client.getApiVersion(), filter, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * Gets all the users registered on a Data Box Edge/Data Box Gateway device. - * - * @param deviceName The device name. - * @param resourceGroupName The resource group name. - * @param filter Specify $filter='UserType eq <type>' to filter on user type property. - * @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 all the users registered on a Data Box Edge/Data Box Gateway device as paginated response with - * {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByDataBoxEdgeDeviceAsync(String deviceName, String resourceGroupName, - String filter) { - return new PagedFlux<>(() -> listByDataBoxEdgeDeviceSinglePageAsync(deviceName, resourceGroupName, filter), - nextLink -> listByDataBoxEdgeDeviceNextSinglePageAsync(nextLink)); - } - - /** - * Gets all the users registered on a Data Box Edge/Data Box Gateway device. - * - * @param deviceName The device name. - * @param resourceGroupName The resource group name. - * @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 all the users registered on a Data Box Edge/Data Box Gateway device as paginated response with - * {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByDataBoxEdgeDeviceAsync(String deviceName, String resourceGroupName) { - final String filter = null; - return new PagedFlux<>(() -> listByDataBoxEdgeDeviceSinglePageAsync(deviceName, resourceGroupName, filter), - nextLink -> listByDataBoxEdgeDeviceNextSinglePageAsync(nextLink)); - } - - /** - * Gets all the users registered on a Data Box Edge/Data Box Gateway device. - * - * @param deviceName The device name. - * @param resourceGroupName The resource group name. - * @param filter Specify $filter='UserType eq <type>' to filter on user type property. - * @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 all the users registered on a Data Box Edge/Data Box Gateway device as paginated response with - * {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByDataBoxEdgeDeviceAsync(String deviceName, String resourceGroupName, - String filter, Context context) { - return new PagedFlux<>( - () -> listByDataBoxEdgeDeviceSinglePageAsync(deviceName, resourceGroupName, filter, context), - nextLink -> listByDataBoxEdgeDeviceNextSinglePageAsync(nextLink, context)); - } - - /** - * Gets all the users registered on a Data Box Edge/Data Box Gateway device. - * - * @param deviceName The device name. - * @param resourceGroupName The resource group name. - * @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 all the users registered on a Data Box Edge/Data Box Gateway device as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByDataBoxEdgeDevice(String deviceName, String resourceGroupName) { - final String filter = null; - return new PagedIterable<>(listByDataBoxEdgeDeviceAsync(deviceName, resourceGroupName, filter)); - } - /** - * Gets all the users registered on a Data Box Edge/Data Box Gateway device. - * - * @param deviceName The device name. - * @param resourceGroupName The resource group name. - * @param filter Specify $filter='UserType eq <type>' to filter on user type property. - * @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 all the users registered on a Data Box Edge/Data Box Gateway device as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByDataBoxEdgeDevice(String deviceName, String resourceGroupName, String filter, - Context context) { - return new PagedIterable<>(listByDataBoxEdgeDeviceAsync(deviceName, resourceGroupName, filter, context)); + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listByDataBoxEdgeDeviceNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); } /** * Gets the properties of the specified user. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. * @param name The user name. - * @param resourceGroupName The resource group name. * @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. @@ -301,95 +172,37 @@ public PagedIterable listByDataBoxEdgeDevice(String deviceName, Strin * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String deviceName, String name, String resourceGroupName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (deviceName == null) { - return Mono.error(new IllegalArgumentException("Parameter deviceName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name 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.")); - } + private Mono> getWithResponseAsync(String resourceGroupName, String deviceName, String name) { final String accept = "application/json"; return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), deviceName, name, - this.client.getSubscriptionId(), resourceGroupName, this.client.getApiVersion(), accept, context)) + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, deviceName, name, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Gets the properties of the specified user. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. * @param name The user name. - * @param resourceGroupName The resource group name. - * @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 properties of the specified user along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String deviceName, String name, String resourceGroupName, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (deviceName == null) { - return Mono.error(new IllegalArgumentException("Parameter deviceName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name 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.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), deviceName, name, this.client.getSubscriptionId(), - resourceGroupName, this.client.getApiVersion(), accept, context); - } - - /** - * Gets the properties of the specified user. - * - * @param deviceName The device name. - * @param name The user name. - * @param resourceGroupName The resource group name. * @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 properties of the specified user on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String deviceName, String name, String resourceGroupName) { - return getWithResponseAsync(deviceName, name, resourceGroupName) + private Mono getAsync(String resourceGroupName, String deviceName, String name) { + return getWithResponseAsync(resourceGroupName, deviceName, name) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * Gets the properties of the specified user. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. * @param name The user name. - * @param resourceGroupName The resource group name. * @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. @@ -397,33 +210,35 @@ private Mono getAsync(String deviceName, String name, String resource * @return the properties of the specified user along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String deviceName, String name, String resourceGroupName, + public Response getWithResponse(String resourceGroupName, String deviceName, String name, Context context) { - return getWithResponseAsync(deviceName, name, resourceGroupName, context).block(); + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, deviceName, name, accept, context); } /** * Gets the properties of the specified user. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. * @param name The user name. - * @param resourceGroupName The resource group name. * @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 properties of the specified user. */ @ServiceMethod(returns = ReturnType.SINGLE) - public UserInner get(String deviceName, String name, String resourceGroupName) { - return getWithResponse(deviceName, name, resourceGroupName, Context.NONE).getValue(); + public UserInner get(String resourceGroupName, String deviceName, String name) { + return getWithResponse(resourceGroupName, deviceName, name, Context.NONE).getValue(); } /** * Creates a new user or updates an existing user's information on a Data Box Edge/Data Box Gateway device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. * @param name The user name. - * @param resourceGroupName The resource group name. * @param user The user details. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -432,114 +247,70 @@ public UserInner get(String deviceName, String name, String resourceGroupName) { * {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync(String deviceName, String name, - String resourceGroupName, UserInner user) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (deviceName == null) { - return Mono.error(new IllegalArgumentException("Parameter deviceName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name 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 (user == null) { - return Mono.error(new IllegalArgumentException("Parameter user is required and cannot be null.")); - } else { - user.validate(); - } + private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, + String deviceName, String name, UserInner user) { + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), deviceName, name, - this.client.getSubscriptionId(), resourceGroupName, this.client.getApiVersion(), user, accept, context)) + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, deviceName, name, contentType, accept, user, + context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Creates a new user or updates an existing user's information on a Data Box Edge/Data Box Gateway device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. * @param name The user name. - * @param resourceGroupName The resource group name. * @param user The user details. - * @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 represents a user who has access to one or more shares on the Data Box Edge/Gateway device along with - * {@link Response} on successful completion of {@link Mono}. + * {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync(String deviceName, String name, - String resourceGroupName, UserInner user, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (deviceName == null) { - return Mono.error(new IllegalArgumentException("Parameter deviceName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name 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 (user == null) { - return Mono.error(new IllegalArgumentException("Parameter user is required and cannot be null.")); - } else { - user.validate(); - } + private Response createOrUpdateWithResponse(String resourceGroupName, String deviceName, String name, + UserInner user) { + final String contentType = "application/json"; final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.createOrUpdate(this.client.getEndpoint(), deviceName, name, this.client.getSubscriptionId(), - resourceGroupName, this.client.getApiVersion(), user, accept, context); + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, deviceName, name, contentType, accept, user, + Context.NONE); } /** * Creates a new user or updates an existing user's information on a Data Box Edge/Data Box Gateway device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. * @param name The user name. - * @param resourceGroupName The resource group name. * @param user The user details. + * @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 PollerFlux} for polling of represents a user who has access to one or more shares on the Data - * Box Edge/Gateway device. + * @return represents a user who has access to one or more shares on the Data Box Edge/Gateway device along with + * {@link Response}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, UserInner> beginCreateOrUpdateAsync(String deviceName, String name, - String resourceGroupName, UserInner user) { - Mono>> mono - = createOrUpdateWithResponseAsync(deviceName, name, resourceGroupName, user); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), UserInner.class, - UserInner.class, this.client.getContext()); + @ServiceMethod(returns = ReturnType.SINGLE) + private Response createOrUpdateWithResponse(String resourceGroupName, String deviceName, String name, + UserInner user, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, deviceName, name, contentType, accept, user, context); } /** * Creates a new user or updates an existing user's information on a Data Box Edge/Data Box Gateway device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. * @param name The user name. - * @param resourceGroupName The resource group name. * @param user The user details. - * @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. @@ -547,21 +318,20 @@ private PollerFlux, UserInner> beginCreateOrUpdateAsync(St * Box Edge/Gateway device. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, UserInner> beginCreateOrUpdateAsync(String deviceName, String name, - String resourceGroupName, UserInner user, Context context) { - context = this.client.mergeContext(context); + private PollerFlux, UserInner> beginCreateOrUpdateAsync(String resourceGroupName, + String deviceName, String name, UserInner user) { Mono>> mono - = createOrUpdateWithResponseAsync(deviceName, name, resourceGroupName, user, context); + = createOrUpdateWithResponseAsync(resourceGroupName, deviceName, name, user); return this.client.getLroResult(mono, this.client.getHttpPipeline(), UserInner.class, - UserInner.class, context); + UserInner.class, this.client.getContext()); } /** * Creates a new user or updates an existing user's information on a Data Box Edge/Data Box Gateway device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. * @param name The user name. - * @param resourceGroupName The resource group name. * @param user The user details. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -570,17 +340,18 @@ private PollerFlux, UserInner> beginCreateOrUpdateAsync(St * Box Edge/Gateway device. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, UserInner> beginCreateOrUpdate(String deviceName, String name, - String resourceGroupName, UserInner user) { - return this.beginCreateOrUpdateAsync(deviceName, name, resourceGroupName, user).getSyncPoller(); + public SyncPoller, UserInner> beginCreateOrUpdate(String resourceGroupName, String deviceName, + String name, UserInner user) { + Response response = createOrUpdateWithResponse(resourceGroupName, deviceName, name, user); + return this.client.getLroResult(response, UserInner.class, UserInner.class, Context.NONE); } /** * Creates a new user or updates an existing user's information on a Data Box Edge/Data Box Gateway device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. * @param name The user name. - * @param resourceGroupName The resource group name. * @param user The user details. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -590,17 +361,18 @@ public SyncPoller, UserInner> beginCreateOrUpdate(String d * Box Edge/Gateway device. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, UserInner> beginCreateOrUpdate(String deviceName, String name, - String resourceGroupName, UserInner user, Context context) { - return this.beginCreateOrUpdateAsync(deviceName, name, resourceGroupName, user, context).getSyncPoller(); + public SyncPoller, UserInner> beginCreateOrUpdate(String resourceGroupName, String deviceName, + String name, UserInner user, Context context) { + Response response = createOrUpdateWithResponse(resourceGroupName, deviceName, name, user, context); + return this.client.getLroResult(response, UserInner.class, UserInner.class, context); } /** * Creates a new user or updates an existing user's information on a Data Box Edge/Data Box Gateway device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. * @param name The user name. - * @param resourceGroupName The resource group name. * @param user The user details. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -609,162 +381,119 @@ public SyncPoller, UserInner> beginCreateOrUpdate(String d * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String deviceName, String name, String resourceGroupName, + private Mono createOrUpdateAsync(String resourceGroupName, String deviceName, String name, UserInner user) { - return beginCreateOrUpdateAsync(deviceName, name, resourceGroupName, user).last() + return beginCreateOrUpdateAsync(resourceGroupName, deviceName, name, user).last() .flatMap(this.client::getLroFinalResultOrError); } /** * Creates a new user or updates an existing user's information on a Data Box Edge/Data Box Gateway device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. * @param name The user name. - * @param resourceGroupName The resource group name. * @param user The user details. - * @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 represents a user who has access to one or more shares on the Data Box Edge/Gateway device on successful - * completion of {@link Mono}. + * @return represents a user who has access to one or more shares on the Data Box Edge/Gateway device. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String deviceName, String name, String resourceGroupName, - UserInner user, Context context) { - return beginCreateOrUpdateAsync(deviceName, name, resourceGroupName, user, context).last() - .flatMap(this.client::getLroFinalResultOrError); + public UserInner createOrUpdate(String resourceGroupName, String deviceName, String name, UserInner user) { + return beginCreateOrUpdate(resourceGroupName, deviceName, name, user).getFinalResult(); } /** * Creates a new user or updates an existing user's information on a Data Box Edge/Data Box Gateway device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. * @param name The user name. - * @param resourceGroupName The resource group name. * @param user The user details. + * @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 represents a user who has access to one or more shares on the Data Box Edge/Gateway device. */ @ServiceMethod(returns = ReturnType.SINGLE) - public UserInner createOrUpdate(String deviceName, String name, String resourceGroupName, UserInner user) { - return createOrUpdateAsync(deviceName, name, resourceGroupName, user).block(); + public UserInner createOrUpdate(String resourceGroupName, String deviceName, String name, UserInner user, + Context context) { + return beginCreateOrUpdate(resourceGroupName, deviceName, name, user, context).getFinalResult(); } /** - * Creates a new user or updates an existing user's information on a Data Box Edge/Data Box Gateway device. + * Deletes the user on a databox edge/gateway device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. * @param name The user name. - * @param resourceGroupName The resource group name. - * @param user The user details. - * @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 represents a user who has access to one or more shares on the Data Box Edge/Gateway device. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public UserInner createOrUpdate(String deviceName, String name, String resourceGroupName, UserInner user, - Context context) { - return createOrUpdateAsync(deviceName, name, resourceGroupName, user, context).block(); + private Mono>> deleteWithResponseAsync(String resourceGroupName, String deviceName, + String name) { + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, deviceName, name, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Deletes the user on a databox edge/gateway device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. * @param name The user name. - * @param resourceGroupName The resource group name. * @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}. + * @return the response body along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync(String deviceName, String name, - String resourceGroupName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (deviceName == null) { - return Mono.error(new IllegalArgumentException("Parameter deviceName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name 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.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.delete(this.client.getEndpoint(), deviceName, name, - this.client.getSubscriptionId(), resourceGroupName, this.client.getApiVersion(), accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + private Response deleteWithResponse(String resourceGroupName, String deviceName, String name) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, deviceName, name, Context.NONE); } /** * Deletes the user on a databox edge/gateway device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. * @param name The user name. - * @param resourceGroupName The resource group name. * @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}. + * @return the response body along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync(String deviceName, String name, - String resourceGroupName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (deviceName == null) { - return Mono.error(new IllegalArgumentException("Parameter deviceName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name 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.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), deviceName, name, this.client.getSubscriptionId(), - resourceGroupName, this.client.getApiVersion(), accept, context); + private Response deleteWithResponse(String resourceGroupName, String deviceName, String name, + Context context) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, deviceName, name, context); } /** * Deletes the user on a databox edge/gateway device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. * @param name The user name. - * @param resourceGroupName The resource group name. * @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 long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync(String deviceName, String name, - String resourceGroupName) { - Mono>> mono = deleteWithResponseAsync(deviceName, name, resourceGroupName); + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String deviceName, + String name) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, deviceName, name); return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); } @@ -772,122 +501,231 @@ private PollerFlux, Void> beginDeleteAsync(String deviceName, S /** * Deletes the user on a databox edge/gateway device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. * @param name The user name. - * @param resourceGroupName The resource group name. - * @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 PollerFlux} for polling of long-running operation. + * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync(String deviceName, String name, - String resourceGroupName, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = deleteWithResponseAsync(deviceName, name, resourceGroupName, context); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - context); + public SyncPoller, Void> beginDelete(String resourceGroupName, String deviceName, String name) { + Response response = deleteWithResponse(resourceGroupName, deviceName, name); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); } /** * Deletes the user on a databox edge/gateway device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. * @param name The user name. - * @param resourceGroupName The resource group name. + * @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 SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete(String deviceName, String name, String resourceGroupName) { - return this.beginDeleteAsync(deviceName, name, resourceGroupName).getSyncPoller(); + public SyncPoller, Void> beginDelete(String resourceGroupName, String deviceName, String name, + Context context) { + Response response = deleteWithResponse(resourceGroupName, deviceName, name, context); + return this.client.getLroResult(response, Void.class, Void.class, context); } /** * Deletes the user on a databox edge/gateway device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. * @param name The user name. - * @param resourceGroupName The resource group name. - * @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 SyncPoller} for polling of long-running operation. + * @return A {@link Mono} that completes when a successful response is received. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete(String deviceName, String name, String resourceGroupName, - Context context) { - return this.beginDeleteAsync(deviceName, name, resourceGroupName, context).getSyncPoller(); + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String deviceName, String name) { + return beginDeleteAsync(resourceGroupName, deviceName, name).last() + .flatMap(this.client::getLroFinalResultOrError); } /** * Deletes the user on a databox edge/gateway device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. * @param name The user name. - * @param resourceGroupName The resource group name. * @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 deleteAsync(String deviceName, String name, String resourceGroupName) { - return beginDeleteAsync(deviceName, name, resourceGroupName).last() - .flatMap(this.client::getLroFinalResultOrError); + public void delete(String resourceGroupName, String deviceName, String name) { + beginDelete(resourceGroupName, deviceName, name).getFinalResult(); } /** * Deletes the user on a databox edge/gateway device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. * @param name The user name. - * @param resourceGroupName The resource group name. * @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 A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String deviceName, String name, String resourceGroupName, Context context) { - return beginDeleteAsync(deviceName, name, resourceGroupName, context).last() - .flatMap(this.client::getLroFinalResultOrError); + public void delete(String resourceGroupName, String deviceName, String name, Context context) { + beginDelete(resourceGroupName, deviceName, name, context).getFinalResult(); } /** - * Deletes the user on a databox edge/gateway device. + * Gets all the users registered on a Data Box Edge/Data Box Gateway device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param name The user name. - * @param resourceGroupName The resource group name. + * @param filter Specify $filter='Type eq <type>' to filter on user type property. * @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 all the users registered on a Data Box Edge/Data Box Gateway device along with {@link PagedResponse} on + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String deviceName, String name, String resourceGroupName) { - deleteAsync(deviceName, name, resourceGroupName).block(); + private Mono> listByDataBoxEdgeDeviceSinglePageAsync(String resourceGroupName, + String deviceName, String filter) { + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByDataBoxEdgeDevice(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, deviceName, filter, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Deletes the user on a databox edge/gateway device. + * Gets all the users registered on a Data Box Edge/Data Box Gateway device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param name The user name. - * @param resourceGroupName The resource group name. + * @param filter Specify $filter='Type eq <type>' to filter on user type property. + * @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 all the users registered on a Data Box Edge/Data Box Gateway device as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByDataBoxEdgeDeviceAsync(String resourceGroupName, String deviceName, + String filter) { + return new PagedFlux<>(() -> listByDataBoxEdgeDeviceSinglePageAsync(resourceGroupName, deviceName, filter), + nextLink -> listByDataBoxEdgeDeviceNextSinglePageAsync(nextLink)); + } + + /** + * Gets all the users registered on a Data Box Edge/Data Box Gateway device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @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 all the users registered on a Data Box Edge/Data Box Gateway device as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByDataBoxEdgeDeviceAsync(String resourceGroupName, String deviceName) { + final String filter = null; + return new PagedFlux<>(() -> listByDataBoxEdgeDeviceSinglePageAsync(resourceGroupName, deviceName, filter), + nextLink -> listByDataBoxEdgeDeviceNextSinglePageAsync(nextLink)); + } + + /** + * Gets all the users registered on a Data Box Edge/Data Box Gateway device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @param filter Specify $filter='Type eq <type>' to filter on user type property. + * @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 all the users registered on a Data Box Edge/Data Box Gateway device along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByDataBoxEdgeDeviceSinglePage(String resourceGroupName, String deviceName, + String filter) { + final String accept = "application/json"; + Response res + = service.listByDataBoxEdgeDeviceSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, deviceName, filter, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Gets all the users registered on a Data Box Edge/Data Box Gateway device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @param filter Specify $filter='Type eq <type>' to filter on user type property. * @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 all the users registered on a Data Box Edge/Data Box Gateway device along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String deviceName, String name, String resourceGroupName, Context context) { - deleteAsync(deviceName, name, resourceGroupName, context).block(); + private PagedResponse listByDataBoxEdgeDeviceSinglePage(String resourceGroupName, String deviceName, + String filter, Context context) { + final String accept = "application/json"; + Response res + = service.listByDataBoxEdgeDeviceSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, deviceName, filter, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Gets all the users registered on a Data Box Edge/Data Box Gateway device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @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 all the users registered on a Data Box Edge/Data Box Gateway device as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByDataBoxEdgeDevice(String resourceGroupName, String deviceName) { + final String filter = null; + return new PagedIterable<>(() -> listByDataBoxEdgeDeviceSinglePage(resourceGroupName, deviceName, filter), + nextLink -> listByDataBoxEdgeDeviceNextSinglePage(nextLink)); + } + + /** + * Gets all the users registered on a Data Box Edge/Data Box Gateway device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @param filter Specify $filter='Type eq <type>' to filter on user type property. + * @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 all the users registered on a Data Box Edge/Data Box Gateway device as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByDataBoxEdgeDevice(String resourceGroupName, String deviceName, String filter, + Context context) { + return new PagedIterable<>( + () -> listByDataBoxEdgeDeviceSinglePage(resourceGroupName, deviceName, filter, context), + nextLink -> listByDataBoxEdgeDeviceNextSinglePage(nextLink, context)); } /** @@ -897,17 +735,11 @@ public void delete(String deviceName, String name, String resourceGroupName, Con * @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 collection of users along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return all the users registered on a Data Box Edge/Data Box Gateway device along with {@link PagedResponse} on + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByDataBoxEdgeDeviceNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil .withContext( @@ -917,6 +749,24 @@ private Mono> listByDataBoxEdgeDeviceNextSinglePageAsyn .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @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 all the users registered on a Data Box Edge/Data Box Gateway device along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByDataBoxEdgeDeviceNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listByDataBoxEdgeDeviceNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + /** * Get the next page of items. * @@ -925,22 +775,14 @@ private Mono> listByDataBoxEdgeDeviceNextSinglePageAsyn * @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 collection of users along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return all the users registered on a Data Box Edge/Data Box Gateway device along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByDataBoxEdgeDeviceNextSinglePageAsync(String nextLink, - Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } + private PagedResponse listByDataBoxEdgeDeviceNextSinglePage(String nextLink, Context context) { final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listByDataBoxEdgeDeviceNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + Response res + = service.listByDataBoxEdgeDeviceNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } } diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/UsersImpl.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/UsersImpl.java index c159efab9a46..760dacf28ac3 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/UsersImpl.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/UsersImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.implementation; @@ -26,20 +26,8 @@ public UsersImpl(UsersClient innerClient, com.azure.resourcemanager.databoxedge. this.serviceManager = serviceManager; } - public PagedIterable listByDataBoxEdgeDevice(String deviceName, String resourceGroupName) { - PagedIterable inner = this.serviceClient().listByDataBoxEdgeDevice(deviceName, resourceGroupName); - return ResourceManagerUtils.mapPage(inner, inner1 -> new UserImpl(inner1, this.manager())); - } - - public PagedIterable listByDataBoxEdgeDevice(String deviceName, String resourceGroupName, String filter, - Context context) { - PagedIterable inner - = this.serviceClient().listByDataBoxEdgeDevice(deviceName, resourceGroupName, filter, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new UserImpl(inner1, this.manager())); - } - - public Response getWithResponse(String deviceName, String name, String resourceGroupName, Context context) { - Response inner = this.serviceClient().getWithResponse(deviceName, name, resourceGroupName, context); + public Response getWithResponse(String resourceGroupName, String deviceName, String name, Context context) { + Response inner = this.serviceClient().getWithResponse(resourceGroupName, deviceName, name, context); if (inner != null) { return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), new UserImpl(inner.getValue(), this.manager())); @@ -48,8 +36,8 @@ public Response getWithResponse(String deviceName, String name, String res } } - public User get(String deviceName, String name, String resourceGroupName) { - UserInner inner = this.serviceClient().get(deviceName, name, resourceGroupName); + public User get(String resourceGroupName, String deviceName, String name) { + UserInner inner = this.serviceClient().get(resourceGroupName, deviceName, name); if (inner != null) { return new UserImpl(inner, this.manager()); } else { @@ -57,15 +45,32 @@ public User get(String deviceName, String name, String resourceGroupName) { } } - public void delete(String deviceName, String name, String resourceGroupName) { - this.serviceClient().delete(deviceName, name, resourceGroupName); + public void delete(String resourceGroupName, String deviceName, String name) { + this.serviceClient().delete(resourceGroupName, deviceName, name); + } + + public void delete(String resourceGroupName, String deviceName, String name, Context context) { + this.serviceClient().delete(resourceGroupName, deviceName, name, context); + } + + public PagedIterable listByDataBoxEdgeDevice(String resourceGroupName, String deviceName) { + PagedIterable inner = this.serviceClient().listByDataBoxEdgeDevice(resourceGroupName, deviceName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new UserImpl(inner1, this.manager())); } - public void delete(String deviceName, String name, String resourceGroupName, Context context) { - this.serviceClient().delete(deviceName, name, resourceGroupName, context); + public PagedIterable listByDataBoxEdgeDevice(String resourceGroupName, String deviceName, String filter, + Context context) { + PagedIterable inner + = this.serviceClient().listByDataBoxEdgeDevice(resourceGroupName, deviceName, filter, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new UserImpl(inner1, this.manager())); } public User getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } String deviceName = ResourceManagerUtils.getValueFromIdByName(id, "dataBoxEdgeDevices"); if (deviceName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( @@ -76,15 +81,15 @@ public User getById(String id) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'users'.", id))); } + return this.getWithResponse(resourceGroupName, deviceName, name, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - return this.getWithResponse(deviceName, name, resourceGroupName, Context.NONE).getValue(); - } - - public Response getByIdWithResponse(String id, Context context) { String deviceName = ResourceManagerUtils.getValueFromIdByName(id, "dataBoxEdgeDevices"); if (deviceName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( @@ -95,15 +100,15 @@ public Response getByIdWithResponse(String id, Context context) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'users'.", id))); } + return this.getWithResponse(resourceGroupName, deviceName, name, context); + } + + public void deleteById(String id) { String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - return this.getWithResponse(deviceName, name, resourceGroupName, context); - } - - public void deleteById(String id) { String deviceName = ResourceManagerUtils.getValueFromIdByName(id, "dataBoxEdgeDevices"); if (deviceName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( @@ -114,15 +119,15 @@ public void deleteById(String id) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'users'.", id))); } + this.delete(resourceGroupName, deviceName, name, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - this.delete(deviceName, name, resourceGroupName, Context.NONE); - } - - public void deleteByIdWithResponse(String id, Context context) { String deviceName = ResourceManagerUtils.getValueFromIdByName(id, "dataBoxEdgeDevices"); if (deviceName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( @@ -133,12 +138,7 @@ public void deleteByIdWithResponse(String id, Context context) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'users'.", id))); } - String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - this.delete(deviceName, name, resourceGroupName, context); + this.delete(resourceGroupName, deviceName, name, context); } private UsersClient serviceClient() { diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/models/AddonList.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/models/AddonList.java new file mode 100644 index 000000000000..5f9e92fb128b --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/models/AddonList.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.databoxedge.implementation.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.databoxedge.fluent.models.AddonInner; +import java.io.IOException; +import java.util.List; + +/** + * Collection of all the Role addon on the Azure Stack Edge device. + */ +@Immutable +public final class AddonList implements JsonSerializable { + /* + * The Addon items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of AddonList class. + */ + private AddonList() { + } + + /** + * Get the value property: The Addon items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AddonList from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AddonList if the JsonReader was pointing to an instance of it, or null if it was pointing + * to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the AddonList. + */ + public static AddonList fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AddonList deserializedAddonList = new AddonList(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> AddonInner.fromJson(reader1)); + deserializedAddonList.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedAddonList.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAddonList; + }); + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/models/AlertList.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/models/AlertList.java new file mode 100644 index 000000000000..84ebe957504d --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/models/AlertList.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.databoxedge.implementation.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.databoxedge.fluent.models.AlertInner; +import java.io.IOException; +import java.util.List; + +/** + * Collection of alerts. + */ +@Immutable +public final class AlertList implements JsonSerializable { + /* + * The Alert items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of AlertList class. + */ + private AlertList() { + } + + /** + * Get the value property: The Alert items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AlertList from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AlertList if the JsonReader was pointing to an instance of it, or null if it was pointing + * to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the AlertList. + */ + public static AlertList fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AlertList deserializedAlertList = new AlertList(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> AlertInner.fromJson(reader1)); + deserializedAlertList.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedAlertList.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAlertList; + }); + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/models/BandwidthSchedulesList.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/models/BandwidthSchedulesList.java new file mode 100644 index 000000000000..9d0977a6b829 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/models/BandwidthSchedulesList.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.databoxedge.implementation.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.databoxedge.fluent.models.BandwidthScheduleInner; +import java.io.IOException; +import java.util.List; + +/** + * The collection of bandwidth schedules. + */ +@Immutable +public final class BandwidthSchedulesList implements JsonSerializable { + /* + * The BandwidthSchedule items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of BandwidthSchedulesList class. + */ + private BandwidthSchedulesList() { + } + + /** + * Get the value property: The BandwidthSchedule items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of BandwidthSchedulesList from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of BandwidthSchedulesList if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the BandwidthSchedulesList. + */ + public static BandwidthSchedulesList fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + BandwidthSchedulesList deserializedBandwidthSchedulesList = new BandwidthSchedulesList(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> BandwidthScheduleInner.fromJson(reader1)); + deserializedBandwidthSchedulesList.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedBandwidthSchedulesList.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedBandwidthSchedulesList; + }); + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/models/ContainerList.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/models/ContainerList.java new file mode 100644 index 000000000000..b1ad12e2741a --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/models/ContainerList.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.databoxedge.implementation.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.databoxedge.fluent.models.ContainerInner; +import java.io.IOException; +import java.util.List; + +/** + * Collection of all the containers on the Data Box Edge/Gateway device. + */ +@Immutable +public final class ContainerList implements JsonSerializable { + /* + * The Container items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of ContainerList class. + */ + private ContainerList() { + } + + /** + * Get the value property: The Container items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ContainerList from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ContainerList if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ContainerList. + */ + public static ContainerList fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ContainerList deserializedContainerList = new ContainerList(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> ContainerInner.fromJson(reader1)); + deserializedContainerList.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedContainerList.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedContainerList; + }); + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/models/DataBoxEdgeDeviceList.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/models/DataBoxEdgeDeviceList.java new file mode 100644 index 000000000000..4eec9888f658 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/models/DataBoxEdgeDeviceList.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.databoxedge.implementation.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.databoxedge.fluent.models.DataBoxEdgeDeviceInner; +import java.io.IOException; +import java.util.List; + +/** + * The collection of Data Box Edge/Gateway devices. + */ +@Immutable +public final class DataBoxEdgeDeviceList implements JsonSerializable { + /* + * The DataBoxEdgeDevice items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of DataBoxEdgeDeviceList class. + */ + private DataBoxEdgeDeviceList() { + } + + /** + * Get the value property: The DataBoxEdgeDevice items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DataBoxEdgeDeviceList from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DataBoxEdgeDeviceList if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the DataBoxEdgeDeviceList. + */ + public static DataBoxEdgeDeviceList fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DataBoxEdgeDeviceList deserializedDataBoxEdgeDeviceList = new DataBoxEdgeDeviceList(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> DataBoxEdgeDeviceInner.fromJson(reader1)); + deserializedDataBoxEdgeDeviceList.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedDataBoxEdgeDeviceList.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedDataBoxEdgeDeviceList; + }); + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/models/MonitoringMetricConfigurationList.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/models/MonitoringMetricConfigurationList.java new file mode 100644 index 000000000000..1cfab7bccd36 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/models/MonitoringMetricConfigurationList.java @@ -0,0 +1,97 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.databoxedge.implementation.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.databoxedge.fluent.models.MonitoringMetricConfigurationInner; +import java.io.IOException; +import java.util.List; + +/** + * Collection of metric configurations. + */ +@Immutable +public final class MonitoringMetricConfigurationList implements JsonSerializable { + /* + * The MonitoringMetricConfiguration items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of MonitoringMetricConfigurationList class. + */ + private MonitoringMetricConfigurationList() { + } + + /** + * Get the value property: The MonitoringMetricConfiguration items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MonitoringMetricConfigurationList from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MonitoringMetricConfigurationList if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the MonitoringMetricConfigurationList. + */ + public static MonitoringMetricConfigurationList fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MonitoringMetricConfigurationList deserializedMonitoringMetricConfigurationList + = new MonitoringMetricConfigurationList(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> MonitoringMetricConfigurationInner.fromJson(reader1)); + deserializedMonitoringMetricConfigurationList.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedMonitoringMetricConfigurationList.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedMonitoringMetricConfigurationList; + }); + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/models/NodeList.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/models/NodeList.java new file mode 100644 index 000000000000..87420b60fd51 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/models/NodeList.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.databoxedge.implementation.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.databoxedge.fluent.models.NodeInner; +import java.io.IOException; +import java.util.List; + +/** + * Collection of Nodes. + */ +@Immutable +public final class NodeList implements JsonSerializable { + /* + * The Node items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of NodeList class. + */ + private NodeList() { + } + + /** + * Get the value property: The Node items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NodeList from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NodeList if the JsonReader was pointing to an instance of it, or null if it was pointing + * to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the NodeList. + */ + public static NodeList fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NodeList deserializedNodeList = new NodeList(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> NodeInner.fromJson(reader1)); + deserializedNodeList.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedNodeList.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedNodeList; + }); + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/models/OperationListResult.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/models/OperationListResult.java new file mode 100644 index 000000000000..661fc49ea9b9 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/models/OperationListResult.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.databoxedge.implementation.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.databoxedge.fluent.models.OperationInner; +import java.io.IOException; +import java.util.List; + +/** + * A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to get the next set of + * results. + */ +@Immutable +public final class OperationListResult implements JsonSerializable { + /* + * The Operation items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of OperationListResult class. + */ + private OperationListResult() { + } + + /** + * Get the value property: The Operation items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OperationListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OperationListResult if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the OperationListResult. + */ + public static OperationListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OperationListResult deserializedOperationListResult = new OperationListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> OperationInner.fromJson(reader1)); + deserializedOperationListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedOperationListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedOperationListResult; + }); + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/models/OrderList.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/models/OrderList.java new file mode 100644 index 000000000000..c04d76739dd6 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/models/OrderList.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.databoxedge.implementation.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.databoxedge.fluent.models.OrderInner; +import java.io.IOException; +import java.util.List; + +/** + * List of order entities. + */ +@Immutable +public final class OrderList implements JsonSerializable { + /* + * The Order items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of OrderList class. + */ + private OrderList() { + } + + /** + * Get the value property: The Order items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OrderList from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OrderList if the JsonReader was pointing to an instance of it, or null if it was pointing + * to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the OrderList. + */ + public static OrderList fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OrderList deserializedOrderList = new OrderList(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> OrderInner.fromJson(reader1)); + deserializedOrderList.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedOrderList.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedOrderList; + }); + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/models/RoleList.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/models/RoleList.java new file mode 100644 index 000000000000..3169dcf68ef1 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/models/RoleList.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.databoxedge.implementation.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.databoxedge.fluent.models.RoleInner; +import java.io.IOException; +import java.util.List; + +/** + * Collection of all the roles on the Data Box Edge device. + */ +@Immutable +public final class RoleList implements JsonSerializable { + /* + * The Role items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of RoleList class. + */ + private RoleList() { + } + + /** + * Get the value property: The Role items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RoleList from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RoleList if the JsonReader was pointing to an instance of it, or null if it was pointing + * to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the RoleList. + */ + public static RoleList fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RoleList deserializedRoleList = new RoleList(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> RoleInner.fromJson(reader1)); + deserializedRoleList.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedRoleList.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedRoleList; + }); + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/models/ShareList.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/models/ShareList.java new file mode 100644 index 000000000000..085ce81c904c --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/models/ShareList.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.databoxedge.implementation.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.databoxedge.fluent.models.ShareInner; +import java.io.IOException; +import java.util.List; + +/** + * Collection of all the shares on the Data Box Edge/Gateway device. + */ +@Immutable +public final class ShareList implements JsonSerializable { + /* + * The Share items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of ShareList class. + */ + private ShareList() { + } + + /** + * Get the value property: The Share items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ShareList from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ShareList if the JsonReader was pointing to an instance of it, or null if it was pointing + * to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ShareList. + */ + public static ShareList fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ShareList deserializedShareList = new ShareList(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> ShareInner.fromJson(reader1)); + deserializedShareList.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedShareList.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedShareList; + }); + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/models/StorageAccountCredentialList.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/models/StorageAccountCredentialList.java new file mode 100644 index 000000000000..955cb651d28f --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/models/StorageAccountCredentialList.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.databoxedge.implementation.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.databoxedge.fluent.models.StorageAccountCredentialInner; +import java.io.IOException; +import java.util.List; + +/** + * The collection of storage account credentials. + */ +@Immutable +public final class StorageAccountCredentialList implements JsonSerializable { + /* + * The StorageAccountCredential items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of StorageAccountCredentialList class. + */ + private StorageAccountCredentialList() { + } + + /** + * Get the value property: The StorageAccountCredential items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of StorageAccountCredentialList from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of StorageAccountCredentialList if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the StorageAccountCredentialList. + */ + public static StorageAccountCredentialList fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + StorageAccountCredentialList deserializedStorageAccountCredentialList = new StorageAccountCredentialList(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> StorageAccountCredentialInner.fromJson(reader1)); + deserializedStorageAccountCredentialList.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedStorageAccountCredentialList.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedStorageAccountCredentialList; + }); + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/models/StorageAccountList.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/models/StorageAccountList.java new file mode 100644 index 000000000000..83d902cea258 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/models/StorageAccountList.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.databoxedge.implementation.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.databoxedge.fluent.models.StorageAccountInner; +import java.io.IOException; +import java.util.List; + +/** + * Collection of all the Storage Accounts on the Data Box Edge/Gateway device. + */ +@Immutable +public final class StorageAccountList implements JsonSerializable { + /* + * The StorageAccount items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of StorageAccountList class. + */ + private StorageAccountList() { + } + + /** + * Get the value property: The StorageAccount items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of StorageAccountList from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of StorageAccountList if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the StorageAccountList. + */ + public static StorageAccountList fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + StorageAccountList deserializedStorageAccountList = new StorageAccountList(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> StorageAccountInner.fromJson(reader1)); + deserializedStorageAccountList.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedStorageAccountList.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedStorageAccountList; + }); + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/models/TriggerList.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/models/TriggerList.java new file mode 100644 index 000000000000..1dcf07eaff4a --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/models/TriggerList.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.databoxedge.implementation.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.databoxedge.fluent.models.TriggerInner; +import java.io.IOException; +import java.util.List; + +/** + * Collection of all trigger on the data box edge device. + */ +@Immutable +public final class TriggerList implements JsonSerializable { + /* + * The Trigger items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of TriggerList class. + */ + private TriggerList() { + } + + /** + * Get the value property: The Trigger items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TriggerList from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TriggerList if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the TriggerList. + */ + public static TriggerList fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TriggerList deserializedTriggerList = new TriggerList(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> TriggerInner.fromJson(reader1)); + deserializedTriggerList.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedTriggerList.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedTriggerList; + }); + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/models/UserList.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/models/UserList.java new file mode 100644 index 000000000000..c0e85e51919f --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/models/UserList.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.databoxedge.implementation.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.databoxedge.fluent.models.UserInner; +import java.io.IOException; +import java.util.List; + +/** + * Collection of users. + */ +@Immutable +public final class UserList implements JsonSerializable { + /* + * The User items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of UserList class. + */ + private UserList() { + } + + /** + * Get the value property: The User items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of UserList from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of UserList if the JsonReader was pointing to an instance of it, or null if it was pointing + * to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the UserList. + */ + public static UserList fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + UserList deserializedUserList = new UserList(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> UserInner.fromJson(reader1)); + deserializedUserList.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedUserList.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedUserList; + }); + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/package-info.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/package-info.java index aa814bbaf91e..8cbcd188f40c 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/package-info.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/package-info.java @@ -1,9 +1,9 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. /** - * Package containing the implementations for DataBoxEdgeManagementClient. - * null. + * Package containing the implementations for DataBoxEdge. + * // (missing-service-description) Add service description. */ package com.azure.resourcemanager.databoxedge.implementation; diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/AccessLevel.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/AccessLevel.java new file mode 100644 index 000000000000..8a665b1ee5d3 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/AccessLevel.java @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.databoxedge.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Access level allowed for this remote application type. + */ +public final class AccessLevel extends ExpandableStringEnum { + /** + * None. + */ + public static final AccessLevel NONE = fromString("None"); + + /** + * ReadOnly. + */ + public static final AccessLevel READ_ONLY = fromString("ReadOnly"); + + /** + * ReadWrite. + */ + public static final AccessLevel READ_WRITE = fromString("ReadWrite"); + + /** + * FullAccess. + */ + public static final AccessLevel FULL_ACCESS = fromString("FullAccess"); + + /** + * Creates a new instance of AccessLevel value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public AccessLevel() { + } + + /** + * Creates or finds a AccessLevel from its string representation. + * + * @param name a name to look for. + * @return the corresponding AccessLevel. + */ + public static AccessLevel fromString(String name) { + return fromString(name, AccessLevel.class); + } + + /** + * Gets known AccessLevel values. + * + * @return known AccessLevel values. + */ + public static Collection values() { + return values(AccessLevel.class); + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/AccountType.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/AccountType.java index aa86cc7e4f45..0fa262dc97d7 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/AccountType.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/AccountType.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.models; @@ -12,12 +12,12 @@ */ public final class AccountType extends ExpandableStringEnum { /** - * Static value GeneralPurposeStorage for AccountType. + * GeneralPurposeStorage. */ public static final AccountType GENERAL_PURPOSE_STORAGE = fromString("GeneralPurposeStorage"); /** - * Static value BlobStorage for AccountType. + * BlobStorage. */ public static final AccountType BLOB_STORAGE = fromString("BlobStorage"); diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/ActionType.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/ActionType.java new file mode 100644 index 000000000000..48481e5b5c55 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/ActionType.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.databoxedge.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Extensible enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. + */ +public final class ActionType extends ExpandableStringEnum { + /** + * Actions are for internal-only APIs. + */ + public static final ActionType INTERNAL = fromString("Internal"); + + /** + * Creates a new instance of ActionType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ActionType() { + } + + /** + * Creates or finds a ActionType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ActionType. + */ + public static ActionType fromString(String name) { + return fromString(name, ActionType.class); + } + + /** + * Gets known ActionType values. + * + * @return known ActionType values. + */ + public static Collection values() { + return values(ActionType.class); + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/Addon.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/Addon.java new file mode 100644 index 000000000000..8fcbb13e345b --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/Addon.java @@ -0,0 +1,222 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.databoxedge.models; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.databoxedge.fluent.models.AddonInner; + +/** + * An immutable client-side representation of Addon. + */ +public interface Addon { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + AddonProperties properties(); + + /** + * Gets the kind property: Addon type. + * + * @return the kind value. + */ + AddonType kind(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.databoxedge.fluent.models.AddonInner object. + * + * @return the inner object. + */ + AddonInner innerModel(); + + /** + * The entirety of the Addon definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithKind, + DefinitionStages.WithCreate { + } + + /** + * The Addon definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the Addon definition. + */ + interface Blank extends WithParentResource { + } + + /** + * The stage of the Addon definition allowing to specify parent resource. + */ + interface WithParentResource { + /** + * Specifies resourceGroupName, deviceName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @return the next definition stage. + */ + WithKind withExistingDataBoxEdgeDevice(String resourceGroupName, String deviceName); + } + + /** + * The stage of the Addon definition allowing to specify kind. + */ + interface WithKind { + /** + * Specifies the kind property: Addon type.. + * + * @param kind Addon type. + * @return the next definition stage. + */ + WithCreate withKind(AddonType kind); + } + + /** + * The stage of the Addon definition which contains all the minimum required properties for the resource to be + * created, but also allows for any other optional properties to be specified. + */ + interface WithCreate extends DefinitionStages.WithProperties { + /** + * Executes the create request. + * + * @return the created resource. + */ + Addon create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + Addon create(Context context); + } + + /** + * The stage of the Addon definition allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: The resource-specific properties for this resource.. + * + * @param properties The resource-specific properties for this resource. + * @return the next definition stage. + */ + WithCreate withProperties(AddonProperties properties); + } + } + + /** + * Begins update for the Addon resource. + * + * @return the stage of resource update. + */ + Addon.Update update(); + + /** + * The template for Addon update. + */ + interface Update extends UpdateStages.WithProperties, UpdateStages.WithKind { + /** + * Executes the update request. + * + * @return the updated resource. + */ + Addon apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + Addon apply(Context context); + } + + /** + * The Addon update stages. + */ + interface UpdateStages { + /** + * The stage of the Addon update allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: The resource-specific properties for this resource.. + * + * @param properties The resource-specific properties for this resource. + * @return the next definition stage. + */ + Update withProperties(AddonProperties properties); + } + + /** + * The stage of the Addon update allowing to specify kind. + */ + interface WithKind { + /** + * Specifies the kind property: Addon type.. + * + * @param kind Addon type. + * @return the next definition stage. + */ + Update withKind(AddonType kind); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + Addon refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + Addon refresh(Context context); +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/AddonProperties.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/AddonProperties.java new file mode 100644 index 000000000000..f75d466acc48 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/AddonProperties.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.databoxedge.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The AddonProperties model. + */ +@Immutable +public final class AddonProperties implements JsonSerializable { + /** + * Creates an instance of AddonProperties class. + */ + public AddonProperties() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AddonProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AddonProperties if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the AddonProperties. + */ + public static AddonProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AddonProperties deserializedAddonProperties = new AddonProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + reader.skipChildren(); + } + + return deserializedAddonProperties; + }); + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/AddonType.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/AddonType.java new file mode 100644 index 000000000000..58bd1644102d --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/AddonType.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.databoxedge.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Addon type. + */ +public final class AddonType extends ExpandableStringEnum { + /** + * IotEdge. + */ + public static final AddonType IOT_EDGE = fromString("IotEdge"); + + /** + * ArcForKubernetes. + */ + public static final AddonType ARC_FOR_KUBERNETES = fromString("ArcForKubernetes"); + + /** + * Creates a new instance of AddonType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public AddonType() { + } + + /** + * Creates or finds a AddonType from its string representation. + * + * @param name a name to look for. + * @return the corresponding AddonType. + */ + public static AddonType fromString(String name) { + return fromString(name, AddonType.class); + } + + /** + * Gets known AddonType values. + * + * @return known AddonType values. + */ + public static Collection values() { + return values(AddonType.class); + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/Addons.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/Addons.java new file mode 100644 index 000000000000..944a6619c225 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/Addons.java @@ -0,0 +1,145 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.databoxedge.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of Addons. + */ +public interface Addons { + /** + * Gets a specific addon by name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @param addonName The addon name. + * @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 a specific addon by name along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String deviceName, String addonName, Context context); + + /** + * Gets a specific addon by name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @param addonName The addon name. + * @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 a specific addon by name. + */ + Addon get(String resourceGroupName, String deviceName, String addonName); + + /** + * Deletes the addon on the device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @param addonName The addon name. + * @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 delete(String resourceGroupName, String deviceName, String addonName); + + /** + * Deletes the addon on the device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @param addonName The addon name. + * @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. + */ + void delete(String resourceGroupName, String deviceName, String addonName, Context context); + + /** + * Lists all the addons configured in the role. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @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 collection of all the Role addon on the Azure Stack Edge device as paginated response with + * {@link PagedIterable}. + */ + PagedIterable listByRole(String resourceGroupName, String deviceName); + + /** + * Lists all the addons configured in the role. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @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 collection of all the Role addon on the Azure Stack Edge device as paginated response with + * {@link PagedIterable}. + */ + PagedIterable listByRole(String resourceGroupName, String deviceName, Context context); + + /** + * Gets a specific addon by name. + * + * @param id the resource ID. + * @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 a specific addon by name along with {@link Response}. + */ + Addon getById(String id); + + /** + * Gets a specific addon by name. + * + * @param id the resource ID. + * @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 a specific addon by name along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes the addon on the device. + * + * @param id the resource ID. + * @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 deleteById(String id); + + /** + * Deletes the addon on the device. + * + * @param id the resource ID. + * @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. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new Addon resource. + * + * @param name resource name. + * @return the first stage of the new Addon definition. + */ + Addon.DefinitionStages.Blank define(String name); +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/Address.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/Address.java index 577e6309638e..12146eaca331 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/Address.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/Address.java @@ -1,11 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -198,48 +197,19 @@ public Address withCountry(String country) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (addressLine1() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Missing required property addressLine1 in model Address")); - } - if (postalCode() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Missing required property postalCode in model Address")); - } - if (city() == null) { - throw LOGGER.atError().log(new IllegalArgumentException("Missing required property city in model Address")); - } - if (state() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Missing required property state in model Address")); - } - if (country() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Missing required property country in model Address")); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(Address.class); - /** * {@inheritDoc} */ @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); + jsonWriter.writeStringField("country", this.country); jsonWriter.writeStringField("addressLine1", this.addressLine1); + jsonWriter.writeStringField("addressLine2", this.addressLine2); + jsonWriter.writeStringField("addressLine3", this.addressLine3); jsonWriter.writeStringField("postalCode", this.postalCode); jsonWriter.writeStringField("city", this.city); jsonWriter.writeStringField("state", this.state); - jsonWriter.writeStringField("country", this.country); - jsonWriter.writeStringField("addressLine2", this.addressLine2); - jsonWriter.writeStringField("addressLine3", this.addressLine3); return jsonWriter.writeEndObject(); } @@ -259,20 +229,20 @@ public static Address fromJson(JsonReader jsonReader) throws IOException { String fieldName = reader.getFieldName(); reader.nextToken(); - if ("addressLine1".equals(fieldName)) { + if ("country".equals(fieldName)) { + deserializedAddress.country = reader.getString(); + } else if ("addressLine1".equals(fieldName)) { deserializedAddress.addressLine1 = reader.getString(); + } else if ("addressLine2".equals(fieldName)) { + deserializedAddress.addressLine2 = reader.getString(); + } else if ("addressLine3".equals(fieldName)) { + deserializedAddress.addressLine3 = reader.getString(); } else if ("postalCode".equals(fieldName)) { deserializedAddress.postalCode = reader.getString(); } else if ("city".equals(fieldName)) { deserializedAddress.city = reader.getString(); } else if ("state".equals(fieldName)) { deserializedAddress.state = reader.getString(); - } else if ("country".equals(fieldName)) { - deserializedAddress.country = reader.getString(); - } else if ("addressLine2".equals(fieldName)) { - deserializedAddress.addressLine2 = reader.getString(); - } else if ("addressLine3".equals(fieldName)) { - deserializedAddress.addressLine3 = reader.getString(); } else { reader.skipChildren(); } diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/Alert.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/Alert.java index a63e87522b7c..11e132d0ac57 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/Alert.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/Alert.java @@ -1,9 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.models; +import com.azure.core.management.SystemData; import com.azure.resourcemanager.databoxedge.fluent.models.AlertInner; import java.time.OffsetDateTime; import java.util.Map; @@ -33,6 +34,13 @@ public interface Alert { */ String type(); + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + /** * Gets the title property: Alert title. * diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/AlertErrorDetails.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/AlertErrorDetails.java index dd01c93c810f..7982b2e474e5 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/AlertErrorDetails.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/AlertErrorDetails.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.models; @@ -34,7 +34,7 @@ public final class AlertErrorDetails implements JsonSerializable { /** - * Static value Informational for AlertSeverity. + * Informational. */ public static final AlertSeverity INFORMATIONAL = fromString("Informational"); /** - * Static value Warning for AlertSeverity. + * Warning. */ public static final AlertSeverity WARNING = fromString("Warning"); /** - * Static value Critical for AlertSeverity. + * Critical. */ public static final AlertSeverity CRITICAL = fromString("Critical"); diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/Alerts.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/Alerts.java index 639ada040175..5ee00a29476f 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/Alerts.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/Alerts.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.models; @@ -13,56 +13,56 @@ */ public interface Alerts { /** - * Gets all the alerts for a Data Box Edge/Data Box Gateway device. + * Gets an alert by name. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param resourceGroupName The resource group name. + * @param name The alert name. + * @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 all the alerts for a Data Box Edge/Data Box Gateway device as paginated response with - * {@link PagedIterable}. + * @return an alert by name along with {@link Response}. */ - PagedIterable listByDataBoxEdgeDevice(String deviceName, String resourceGroupName); + Response getWithResponse(String resourceGroupName, String deviceName, String name, Context context); /** - * Gets all the alerts for a Data Box Edge/Data Box Gateway device. + * Gets an alert by name. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param resourceGroupName The resource group name. - * @param context The context to associate with this operation. + * @param name The alert name. * @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 all the alerts for a Data Box Edge/Data Box Gateway device as paginated response with - * {@link PagedIterable}. + * @return an alert by name. */ - PagedIterable listByDataBoxEdgeDevice(String deviceName, String resourceGroupName, Context context); + Alert get(String resourceGroupName, String deviceName, String name); /** - * Gets an alert by name. + * Gets all the alerts for a Data Box Edge/Data Box Gateway device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param name The alert name. - * @param resourceGroupName The resource group name. - * @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 an alert by name along with {@link Response}. + * @return all the alerts for a Data Box Edge/Data Box Gateway device as paginated response with + * {@link PagedIterable}. */ - Response getWithResponse(String deviceName, String name, String resourceGroupName, Context context); + PagedIterable listByDataBoxEdgeDevice(String resourceGroupName, String deviceName); /** - * Gets an alert by name. + * Gets all the alerts for a Data Box Edge/Data Box Gateway device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param name The alert name. - * @param resourceGroupName The resource group name. + * @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 an alert by name. + * @return all the alerts for a Data Box Edge/Data Box Gateway device as paginated response with + * {@link PagedIterable}. */ - Alert get(String deviceName, String name, String resourceGroupName); + PagedIterable listByDataBoxEdgeDevice(String resourceGroupName, String deviceName, Context context); } diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/ArmBaseModel.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/ArmBaseModel.java index 35b58c1eacef..519cc8bb66e3 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/ArmBaseModel.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/ArmBaseModel.java @@ -1,12 +1,12 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.models; import com.azure.core.annotation.Immutable; -import com.azure.core.management.ProxyResource; import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; import java.io.IOException; @@ -15,64 +15,86 @@ * Represents the base class for all object models. */ @Immutable -public class ArmBaseModel extends ProxyResource { +public class ARMBaseModel implements JsonSerializable { /* - * The type of the resource. + * The path ID that uniquely identifies the object. */ - private String type; + private String id; /* - * The name of the resource. + * The object name. */ private String name; /* - * Fully qualified resource Id for the resource. + * The hierarchical type of the object. */ - private String id; + private String type; /** - * Creates an instance of ArmBaseModel class. + * Creates an instance of ARMBaseModel class. */ - public ArmBaseModel() { + public ARMBaseModel() { } /** - * Get the type property: The type of the resource. + * Get the id property: The path ID that uniquely identifies the object. * - * @return the type value. + * @return the id value. */ - @Override - public String type() { - return this.type; + public String id() { + return this.id; } /** - * Get the name property: The name of the resource. + * Set the id property: The path ID that uniquely identifies the object. + * + * @param id the id value to set. + * @return the ARMBaseModel object itself. + */ + ARMBaseModel withId(String id) { + this.id = id; + return this; + } + + /** + * Get the name property: The object name. * * @return the name value. */ - @Override public String name() { return this.name; } /** - * Get the id property: Fully qualified resource Id for the resource. + * Set the name property: The object name. * - * @return the id value. + * @param name the name value to set. + * @return the ARMBaseModel object itself. */ - @Override - public String id() { - return this.id; + ARMBaseModel withName(String name) { + this.name = name; + return this; + } + + /** + * Get the type property: The hierarchical type of the object. + * + * @return the type value. + */ + public String type() { + return this.type; } /** - * Validates the instance. + * Set the type property: The hierarchical type of the object. * - * @throws IllegalArgumentException thrown if the instance is not valid. + * @param type the type value to set. + * @return the ARMBaseModel object itself. */ - public void validate() { + ARMBaseModel withType(String type) { + this.type = type; + return this; } /** @@ -85,33 +107,32 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { } /** - * Reads an instance of ArmBaseModel from the JsonReader. + * Reads an instance of ARMBaseModel from the JsonReader. * * @param jsonReader The JsonReader being read. - * @return An instance of ArmBaseModel if the JsonReader was pointing to an instance of it, or null if it was + * @return An instance of ARMBaseModel if the JsonReader was pointing to an instance of it, or null if it was * pointing to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the ArmBaseModel. + * @throws IOException If an error occurs while reading the ARMBaseModel. */ - public static ArmBaseModel fromJson(JsonReader jsonReader) throws IOException { + public static ARMBaseModel fromJson(JsonReader jsonReader) throws IOException { return jsonReader.readObject(reader -> { - ArmBaseModel deserializedArmBaseModel = new ArmBaseModel(); + ARMBaseModel deserializedARMBaseModel = new ARMBaseModel(); while (reader.nextToken() != JsonToken.END_OBJECT) { String fieldName = reader.getFieldName(); reader.nextToken(); if ("id".equals(fieldName)) { - deserializedArmBaseModel.id = reader.getString(); + deserializedARMBaseModel.id = reader.getString(); } else if ("name".equals(fieldName)) { - deserializedArmBaseModel.name = reader.getString(); + deserializedARMBaseModel.name = reader.getString(); } else if ("type".equals(fieldName)) { - deserializedArmBaseModel.type = reader.getString(); + deserializedARMBaseModel.type = reader.getString(); } else { reader.skipChildren(); } } - return deserializedArmBaseModel; + return deserializedARMBaseModel; }); } } diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/AsymmetricEncryptedSecret.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/AsymmetricEncryptedSecret.java index 046cecb99f2c..784167e5bb36 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/AsymmetricEncryptedSecret.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/AsymmetricEncryptedSecret.java @@ -1,11 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -100,26 +99,6 @@ public AsymmetricEncryptedSecret withEncryptionAlgorithm(EncryptionAlgorithm enc return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() == null) { - throw LOGGER.atError() - .log( - new IllegalArgumentException("Missing required property value in model AsymmetricEncryptedSecret")); - } - if (encryptionAlgorithm() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property encryptionAlgorithm in model AsymmetricEncryptedSecret")); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(AsymmetricEncryptedSecret.class); - /** * {@inheritDoc} */ diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/AuthenticationType.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/AuthenticationType.java index 6d7437710f81..b89ca0a52a68 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/AuthenticationType.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/AuthenticationType.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.models; @@ -12,12 +12,12 @@ */ public final class AuthenticationType extends ExpandableStringEnum { /** - * Static value Invalid for AuthenticationType. + * Invalid. */ public static final AuthenticationType INVALID = fromString("Invalid"); /** - * Static value AzureActiveDirectory for AuthenticationType. + * AzureActiveDirectory. */ public static final AuthenticationType AZURE_ACTIVE_DIRECTORY = fromString("AzureActiveDirectory"); diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/AvailableSkus.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/AvailableSkus.java new file mode 100644 index 000000000000..36bf640f8bdd --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/AvailableSkus.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.databoxedge.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of AvailableSkus. + */ +public interface AvailableSkus { + /** + * List all the available Skus and information related to them. + * + * @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 list of SKU Information objects along with {@link Response}. + */ + Response listWithResponse(Context context); + + /** + * List all the available Skus and information related to them. + * + * @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 SKU Information objects. + */ + DataBoxEdgeSkuList list(); +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/AzureContainerDataFormat.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/AzureContainerDataFormat.java index 7304f8a9c532..6d3b68c18001 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/AzureContainerDataFormat.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/AzureContainerDataFormat.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.models; @@ -12,17 +12,17 @@ */ public final class AzureContainerDataFormat extends ExpandableStringEnum { /** - * Static value BlockBlob for AzureContainerDataFormat. + * BlockBlob. */ public static final AzureContainerDataFormat BLOCK_BLOB = fromString("BlockBlob"); /** - * Static value PageBlob for AzureContainerDataFormat. + * PageBlob. */ public static final AzureContainerDataFormat PAGE_BLOB = fromString("PageBlob"); /** - * Static value AzureFile for AzureContainerDataFormat. + * AzureFile. */ public static final AzureContainerDataFormat AZURE_FILE = fromString("AzureFile"); diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/AzureContainerInfo.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/AzureContainerInfo.java index 8a45cd7d781d..2c3f425fb219 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/AzureContainerInfo.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/AzureContainerInfo.java @@ -1,11 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -101,30 +100,6 @@ public AzureContainerInfo withDataFormat(AzureContainerDataFormat dataFormat) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (storageAccountCredentialId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property storageAccountCredentialId in model AzureContainerInfo")); - } - if (containerName() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property containerName in model AzureContainerInfo")); - } - if (dataFormat() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Missing required property dataFormat in model AzureContainerInfo")); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(AzureContainerInfo.class); - /** * {@inheritDoc} */ diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/BandwidthSchedule.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/BandwidthSchedule.java index f13fe6c1bc2d..ed9dc1f5d67a 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/BandwidthSchedule.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/BandwidthSchedule.java @@ -1,9 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.models; +import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.databoxedge.fluent.models.BandwidthScheduleInner; import java.util.List; @@ -33,6 +34,13 @@ public interface BandwidthSchedule { */ String type(); + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + /** * Gets the start property: The start time of the schedule in UTC. * @@ -98,13 +106,13 @@ interface Blank extends WithParentResource { */ interface WithParentResource { /** - * Specifies deviceName, resourceGroupName. + * Specifies resourceGroupName, deviceName. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param resourceGroupName The resource group name. * @return the next definition stage. */ - WithStart withExistingDataBoxEdgeDevice(String deviceName, String resourceGroupName); + WithStart withExistingDataBoxEdgeDevice(String resourceGroupName, String deviceName); } /** diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/BandwidthSchedules.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/BandwidthSchedules.java index 12aab3749586..dfebfcf8cb52 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/BandwidthSchedules.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/BandwidthSchedules.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.models; @@ -13,85 +13,85 @@ */ public interface BandwidthSchedules { /** - * Gets all the bandwidth schedules for a Data Box Edge/Data Box Gateway device. + * Gets the properties of the specified bandwidth schedule. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param resourceGroupName The resource group name. + * @param name The bandwidth schedule name. + * @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 all the bandwidth schedules for a Data Box Edge/Data Box Gateway device as paginated response with - * {@link PagedIterable}. + * @return the properties of the specified bandwidth schedule along with {@link Response}. */ - PagedIterable listByDataBoxEdgeDevice(String deviceName, String resourceGroupName); + Response getWithResponse(String resourceGroupName, String deviceName, String name, + Context context); /** - * Gets all the bandwidth schedules for a Data Box Edge/Data Box Gateway device. + * Gets the properties of the specified bandwidth schedule. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param resourceGroupName The resource group name. - * @param context The context to associate with this operation. + * @param name The bandwidth schedule name. * @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 all the bandwidth schedules for a Data Box Edge/Data Box Gateway device as paginated response with - * {@link PagedIterable}. + * @return the properties of the specified bandwidth schedule. */ - PagedIterable listByDataBoxEdgeDevice(String deviceName, String resourceGroupName, - Context context); + BandwidthSchedule get(String resourceGroupName, String deviceName, String name); /** - * Gets the properties of the specified bandwidth schedule. + * Deletes the specified bandwidth schedule. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. * @param name The bandwidth schedule name. - * @param resourceGroupName The resource group name. - * @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 properties of the specified bandwidth schedule along with {@link Response}. */ - Response getWithResponse(String deviceName, String name, String resourceGroupName, - Context context); + void delete(String resourceGroupName, String deviceName, String name); /** - * Gets the properties of the specified bandwidth schedule. + * Deletes the specified bandwidth schedule. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. * @param name The bandwidth schedule name. - * @param resourceGroupName The resource group name. + * @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 properties of the specified bandwidth schedule. */ - BandwidthSchedule get(String deviceName, String name, String resourceGroupName); + void delete(String resourceGroupName, String deviceName, String name, Context context); /** - * Deletes the specified bandwidth schedule. + * Gets all the bandwidth schedules for a Data Box Edge/Data Box Gateway device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param name The bandwidth schedule name. - * @param resourceGroupName The resource group name. * @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 all the bandwidth schedules for a Data Box Edge/Data Box Gateway device as paginated response with + * {@link PagedIterable}. */ - void delete(String deviceName, String name, String resourceGroupName); + PagedIterable listByDataBoxEdgeDevice(String resourceGroupName, String deviceName); /** - * Deletes the specified bandwidth schedule. + * Gets all the bandwidth schedules for a Data Box Edge/Data Box Gateway device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param name The bandwidth schedule name. - * @param resourceGroupName The resource group name. * @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 all the bandwidth schedules for a Data Box Edge/Data Box Gateway device as paginated response with + * {@link PagedIterable}. */ - void delete(String deviceName, String name, String resourceGroupName, Context context); + PagedIterable listByDataBoxEdgeDevice(String resourceGroupName, String deviceName, + Context context); /** * Gets the properties of the specified bandwidth schedule. diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/ClientAccessRight.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/ClientAccessRight.java index 287efce8615f..54be75729593 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/ClientAccessRight.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/ClientAccessRight.java @@ -1,11 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -73,25 +72,6 @@ public ClientAccessRight withAccessPermission(ClientPermissionType accessPermiss return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (client() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Missing required property client in model ClientAccessRight")); - } - if (accessPermission() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property accessPermission in model ClientAccessRight")); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(ClientAccessRight.class); - /** * {@inheritDoc} */ diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/ClientPermissionType.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/ClientPermissionType.java index 372f8fb071ac..7aafc5241d92 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/ClientPermissionType.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/ClientPermissionType.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.models; @@ -12,17 +12,17 @@ */ public final class ClientPermissionType extends ExpandableStringEnum { /** - * Static value NoAccess for ClientPermissionType. + * NoAccess. */ public static final ClientPermissionType NO_ACCESS = fromString("NoAccess"); /** - * Static value ReadOnly for ClientPermissionType. + * ReadOnly. */ public static final ClientPermissionType READ_ONLY = fromString("ReadOnly"); /** - * Static value ReadWrite for ClientPermissionType. + * ReadWrite. */ public static final ClientPermissionType READ_WRITE = fromString("ReadWrite"); diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/ClusterCapacityViewData.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/ClusterCapacityViewData.java new file mode 100644 index 000000000000..328766617ab9 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/ClusterCapacityViewData.java @@ -0,0 +1,150 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.databoxedge.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; + +/** + * Cluster Compute Data. + */ +@Immutable +public final class ClusterCapacityViewData implements JsonSerializable { + /* + * The FQDN of the cluster. + */ + private String fqdn; + + /* + * The cluster's GPU capacity. + */ + private ClusterGpuCapacity gpuCapacity; + + /* + * The cluster's memory capacity. + */ + private ClusterMemoryCapacity memoryCapacity; + + /* + * The last time at which the ClusterCapacityViewData was set. + */ + private OffsetDateTime lastRefreshedTime; + + /* + * The total # of vCPUs provisioned by non-HPN VM per appliance. + */ + private Long totalProvisionedNonHpnCores; + + /** + * Creates an instance of ClusterCapacityViewData class. + */ + private ClusterCapacityViewData() { + } + + /** + * Get the fqdn property: The FQDN of the cluster. + * + * @return the fqdn value. + */ + public String fqdn() { + return this.fqdn; + } + + /** + * Get the gpuCapacity property: The cluster's GPU capacity. + * + * @return the gpuCapacity value. + */ + public ClusterGpuCapacity gpuCapacity() { + return this.gpuCapacity; + } + + /** + * Get the memoryCapacity property: The cluster's memory capacity. + * + * @return the memoryCapacity value. + */ + public ClusterMemoryCapacity memoryCapacity() { + return this.memoryCapacity; + } + + /** + * Get the lastRefreshedTime property: The last time at which the ClusterCapacityViewData was set. + * + * @return the lastRefreshedTime value. + */ + public OffsetDateTime lastRefreshedTime() { + return this.lastRefreshedTime; + } + + /** + * Get the totalProvisionedNonHpnCores property: The total # of vCPUs provisioned by non-HPN VM per appliance. + * + * @return the totalProvisionedNonHpnCores value. + */ + public Long totalProvisionedNonHpnCores() { + return this.totalProvisionedNonHpnCores; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("fqdn", this.fqdn); + jsonWriter.writeJsonField("gpuCapacity", this.gpuCapacity); + jsonWriter.writeJsonField("memoryCapacity", this.memoryCapacity); + jsonWriter.writeStringField("lastRefreshedTime", + this.lastRefreshedTime == null + ? null + : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.lastRefreshedTime)); + jsonWriter.writeNumberField("totalProvisionedNonHpnCores", this.totalProvisionedNonHpnCores); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ClusterCapacityViewData from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ClusterCapacityViewData if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the ClusterCapacityViewData. + */ + public static ClusterCapacityViewData fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ClusterCapacityViewData deserializedClusterCapacityViewData = new ClusterCapacityViewData(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("fqdn".equals(fieldName)) { + deserializedClusterCapacityViewData.fqdn = reader.getString(); + } else if ("gpuCapacity".equals(fieldName)) { + deserializedClusterCapacityViewData.gpuCapacity = ClusterGpuCapacity.fromJson(reader); + } else if ("memoryCapacity".equals(fieldName)) { + deserializedClusterCapacityViewData.memoryCapacity = ClusterMemoryCapacity.fromJson(reader); + } else if ("lastRefreshedTime".equals(fieldName)) { + deserializedClusterCapacityViewData.lastRefreshedTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("totalProvisionedNonHpnCores".equals(fieldName)) { + deserializedClusterCapacityViewData.totalProvisionedNonHpnCores + = reader.getNullable(JsonReader::getLong); + } else { + reader.skipChildren(); + } + } + + return deserializedClusterCapacityViewData; + }); + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/ClusterGpuCapacity.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/ClusterGpuCapacity.java new file mode 100644 index 000000000000..f1555f320600 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/ClusterGpuCapacity.java @@ -0,0 +1,143 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.databoxedge.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Cluster GPU Data. + */ +@Immutable +public final class ClusterGpuCapacity implements JsonSerializable { + /* + * The cluster GPU Type. + */ + private String gpuType; + + /* + * The used GPU units count in the cluster. + */ + private Integer gpuUsedUnitsCount; + + /* + * The free GPU units count in the cluster. + */ + private Integer gpuFreeUnitsCount; + + /* + * The GPU units count reserved for failover in the cluster. + */ + private Integer gpuReservedForFailoverUnitsCount; + + /* + * The total GPU units count in the cluster. + */ + private Integer gpuTotalUnitsCount; + + /** + * Creates an instance of ClusterGpuCapacity class. + */ + private ClusterGpuCapacity() { + } + + /** + * Get the gpuType property: The cluster GPU Type. + * + * @return the gpuType value. + */ + public String gpuType() { + return this.gpuType; + } + + /** + * Get the gpuUsedUnitsCount property: The used GPU units count in the cluster. + * + * @return the gpuUsedUnitsCount value. + */ + public Integer gpuUsedUnitsCount() { + return this.gpuUsedUnitsCount; + } + + /** + * Get the gpuFreeUnitsCount property: The free GPU units count in the cluster. + * + * @return the gpuFreeUnitsCount value. + */ + public Integer gpuFreeUnitsCount() { + return this.gpuFreeUnitsCount; + } + + /** + * Get the gpuReservedForFailoverUnitsCount property: The GPU units count reserved for failover in the cluster. + * + * @return the gpuReservedForFailoverUnitsCount value. + */ + public Integer gpuReservedForFailoverUnitsCount() { + return this.gpuReservedForFailoverUnitsCount; + } + + /** + * Get the gpuTotalUnitsCount property: The total GPU units count in the cluster. + * + * @return the gpuTotalUnitsCount value. + */ + public Integer gpuTotalUnitsCount() { + return this.gpuTotalUnitsCount; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("gpuType", this.gpuType); + jsonWriter.writeNumberField("gpuUsedUnitsCount", this.gpuUsedUnitsCount); + jsonWriter.writeNumberField("gpuFreeUnitsCount", this.gpuFreeUnitsCount); + jsonWriter.writeNumberField("gpuReservedForFailoverUnitsCount", this.gpuReservedForFailoverUnitsCount); + jsonWriter.writeNumberField("gpuTotalUnitsCount", this.gpuTotalUnitsCount); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ClusterGpuCapacity from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ClusterGpuCapacity if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the ClusterGpuCapacity. + */ + public static ClusterGpuCapacity fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ClusterGpuCapacity deserializedClusterGpuCapacity = new ClusterGpuCapacity(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("gpuType".equals(fieldName)) { + deserializedClusterGpuCapacity.gpuType = reader.getString(); + } else if ("gpuUsedUnitsCount".equals(fieldName)) { + deserializedClusterGpuCapacity.gpuUsedUnitsCount = reader.getNullable(JsonReader::getInt); + } else if ("gpuFreeUnitsCount".equals(fieldName)) { + deserializedClusterGpuCapacity.gpuFreeUnitsCount = reader.getNullable(JsonReader::getInt); + } else if ("gpuReservedForFailoverUnitsCount".equals(fieldName)) { + deserializedClusterGpuCapacity.gpuReservedForFailoverUnitsCount + = reader.getNullable(JsonReader::getInt); + } else if ("gpuTotalUnitsCount".equals(fieldName)) { + deserializedClusterGpuCapacity.gpuTotalUnitsCount = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedClusterGpuCapacity; + }); + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/ClusterMemoryCapacity.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/ClusterMemoryCapacity.java new file mode 100644 index 000000000000..c154ab6ef6c6 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/ClusterMemoryCapacity.java @@ -0,0 +1,216 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.databoxedge.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * NodeCapacityInfo defines the required information to determine the placement of a VM. + */ +@Immutable +public final class ClusterMemoryCapacity implements JsonSerializable { + /* + * The free memory in the cluster in MB. + */ + private Double clusterFreeMemoryMb; + + /* + * The used memory in the cluster in MB. + */ + private Double clusterUsedMemoryMb; + + /* + * The failover memory in the cluster in MB. + */ + private Double clusterFailoverMemoryMb; + + /* + * The fragmentation memory in the cluster in MB. + */ + private Double clusterFragmentationMemoryMb; + + /* + * The memory reserved for Hyper-V in the cluster in MB. + */ + private Double clusterHypervReserveMemoryMb; + + /* + * The memory of the Infra VM in the cluster in MB. + */ + private Double clusterInfraVmMemoryMb; + + /* + * The total memory in the cluster in MB. + */ + private Double clusterTotalMemoryMb; + + /* + * The non-failover memory in the cluster in MB. + */ + private Double clusterNonFailoverVmMb; + + /* + * The memory used by VMs in the cluster in MB. + */ + private Double clusterMemoryUsedByVmsMb; + + /** + * Creates an instance of ClusterMemoryCapacity class. + */ + private ClusterMemoryCapacity() { + } + + /** + * Get the clusterFreeMemoryMb property: The free memory in the cluster in MB. + * + * @return the clusterFreeMemoryMb value. + */ + public Double clusterFreeMemoryMb() { + return this.clusterFreeMemoryMb; + } + + /** + * Get the clusterUsedMemoryMb property: The used memory in the cluster in MB. + * + * @return the clusterUsedMemoryMb value. + */ + public Double clusterUsedMemoryMb() { + return this.clusterUsedMemoryMb; + } + + /** + * Get the clusterFailoverMemoryMb property: The failover memory in the cluster in MB. + * + * @return the clusterFailoverMemoryMb value. + */ + public Double clusterFailoverMemoryMb() { + return this.clusterFailoverMemoryMb; + } + + /** + * Get the clusterFragmentationMemoryMb property: The fragmentation memory in the cluster in MB. + * + * @return the clusterFragmentationMemoryMb value. + */ + public Double clusterFragmentationMemoryMb() { + return this.clusterFragmentationMemoryMb; + } + + /** + * Get the clusterHypervReserveMemoryMb property: The memory reserved for Hyper-V in the cluster in MB. + * + * @return the clusterHypervReserveMemoryMb value. + */ + public Double clusterHypervReserveMemoryMb() { + return this.clusterHypervReserveMemoryMb; + } + + /** + * Get the clusterInfraVmMemoryMb property: The memory of the Infra VM in the cluster in MB. + * + * @return the clusterInfraVmMemoryMb value. + */ + public Double clusterInfraVmMemoryMb() { + return this.clusterInfraVmMemoryMb; + } + + /** + * Get the clusterTotalMemoryMb property: The total memory in the cluster in MB. + * + * @return the clusterTotalMemoryMb value. + */ + public Double clusterTotalMemoryMb() { + return this.clusterTotalMemoryMb; + } + + /** + * Get the clusterNonFailoverVmMb property: The non-failover memory in the cluster in MB. + * + * @return the clusterNonFailoverVmMb value. + */ + public Double clusterNonFailoverVmMb() { + return this.clusterNonFailoverVmMb; + } + + /** + * Get the clusterMemoryUsedByVmsMb property: The memory used by VMs in the cluster in MB. + * + * @return the clusterMemoryUsedByVmsMb value. + */ + public Double clusterMemoryUsedByVmsMb() { + return this.clusterMemoryUsedByVmsMb; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("clusterFreeMemoryMb", this.clusterFreeMemoryMb); + jsonWriter.writeNumberField("clusterUsedMemoryMb", this.clusterUsedMemoryMb); + jsonWriter.writeNumberField("clusterFailoverMemoryMb", this.clusterFailoverMemoryMb); + jsonWriter.writeNumberField("clusterFragmentationMemoryMb", this.clusterFragmentationMemoryMb); + jsonWriter.writeNumberField("clusterHypervReserveMemoryMb", this.clusterHypervReserveMemoryMb); + jsonWriter.writeNumberField("clusterInfraVmMemoryMb", this.clusterInfraVmMemoryMb); + jsonWriter.writeNumberField("clusterTotalMemoryMb", this.clusterTotalMemoryMb); + jsonWriter.writeNumberField("clusterNonFailoverVmMb", this.clusterNonFailoverVmMb); + jsonWriter.writeNumberField("clusterMemoryUsedByVmsMb", this.clusterMemoryUsedByVmsMb); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ClusterMemoryCapacity from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ClusterMemoryCapacity if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the ClusterMemoryCapacity. + */ + public static ClusterMemoryCapacity fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ClusterMemoryCapacity deserializedClusterMemoryCapacity = new ClusterMemoryCapacity(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("clusterFreeMemoryMb".equals(fieldName)) { + deserializedClusterMemoryCapacity.clusterFreeMemoryMb = reader.getNullable(JsonReader::getDouble); + } else if ("clusterUsedMemoryMb".equals(fieldName)) { + deserializedClusterMemoryCapacity.clusterUsedMemoryMb = reader.getNullable(JsonReader::getDouble); + } else if ("clusterFailoverMemoryMb".equals(fieldName)) { + deserializedClusterMemoryCapacity.clusterFailoverMemoryMb + = reader.getNullable(JsonReader::getDouble); + } else if ("clusterFragmentationMemoryMb".equals(fieldName)) { + deserializedClusterMemoryCapacity.clusterFragmentationMemoryMb + = reader.getNullable(JsonReader::getDouble); + } else if ("clusterHypervReserveMemoryMb".equals(fieldName)) { + deserializedClusterMemoryCapacity.clusterHypervReserveMemoryMb + = reader.getNullable(JsonReader::getDouble); + } else if ("clusterInfraVmMemoryMb".equals(fieldName)) { + deserializedClusterMemoryCapacity.clusterInfraVmMemoryMb + = reader.getNullable(JsonReader::getDouble); + } else if ("clusterTotalMemoryMb".equals(fieldName)) { + deserializedClusterMemoryCapacity.clusterTotalMemoryMb = reader.getNullable(JsonReader::getDouble); + } else if ("clusterNonFailoverVmMb".equals(fieldName)) { + deserializedClusterMemoryCapacity.clusterNonFailoverVmMb + = reader.getNullable(JsonReader::getDouble); + } else if ("clusterMemoryUsedByVmsMb".equals(fieldName)) { + deserializedClusterMemoryCapacity.clusterMemoryUsedByVmsMb + = reader.getNullable(JsonReader::getDouble); + } else { + reader.skipChildren(); + } + } + + return deserializedClusterMemoryCapacity; + }); + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/ClusterStorageViewData.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/ClusterStorageViewData.java new file mode 100644 index 000000000000..6debe45fd6a9 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/ClusterStorageViewData.java @@ -0,0 +1,92 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.databoxedge.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Cluster Storage Data. + */ +@Immutable +public final class ClusterStorageViewData implements JsonSerializable { + /* + * Total storage on the cluster in MB. + */ + private Double clusterTotalStorageMb; + + /* + * The available or free storage on the cluster in MB. + */ + private Double clusterFreeStorageMb; + + /** + * Creates an instance of ClusterStorageViewData class. + */ + private ClusterStorageViewData() { + } + + /** + * Get the clusterTotalStorageMb property: Total storage on the cluster in MB. + * + * @return the clusterTotalStorageMb value. + */ + public Double clusterTotalStorageMb() { + return this.clusterTotalStorageMb; + } + + /** + * Get the clusterFreeStorageMb property: The available or free storage on the cluster in MB. + * + * @return the clusterFreeStorageMb value. + */ + public Double clusterFreeStorageMb() { + return this.clusterFreeStorageMb; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("clusterTotalStorageMb", this.clusterTotalStorageMb); + jsonWriter.writeNumberField("clusterFreeStorageMb", this.clusterFreeStorageMb); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ClusterStorageViewData from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ClusterStorageViewData if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the ClusterStorageViewData. + */ + public static ClusterStorageViewData fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ClusterStorageViewData deserializedClusterStorageViewData = new ClusterStorageViewData(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("clusterTotalStorageMb".equals(fieldName)) { + deserializedClusterStorageViewData.clusterTotalStorageMb + = reader.getNullable(JsonReader::getDouble); + } else if ("clusterFreeStorageMb".equals(fieldName)) { + deserializedClusterStorageViewData.clusterFreeStorageMb = reader.getNullable(JsonReader::getDouble); + } else { + reader.skipChildren(); + } + } + + return deserializedClusterStorageViewData; + }); + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/ClusterWitnessType.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/ClusterWitnessType.java new file mode 100644 index 000000000000..0690fdb3885d --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/ClusterWitnessType.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.databoxedge.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Cluster Witness Type. + */ +public final class ClusterWitnessType extends ExpandableStringEnum { + /** + * None. + */ + public static final ClusterWitnessType NONE = fromString("None"); + + /** + * Cloud. + */ + public static final ClusterWitnessType CLOUD = fromString("Cloud"); + + /** + * FileShare. + */ + public static final ClusterWitnessType FILE_SHARE = fromString("FileShare"); + + /** + * Creates a new instance of ClusterWitnessType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ClusterWitnessType() { + } + + /** + * Creates or finds a ClusterWitnessType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ClusterWitnessType. + */ + public static ClusterWitnessType fromString(String name) { + return fromString(name, ClusterWitnessType.class); + } + + /** + * Gets known ClusterWitnessType values. + * + * @return known ClusterWitnessType values. + */ + public static Collection values() { + return values(ClusterWitnessType.class); + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/ContactDetails.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/ContactDetails.java index 5cf1f9642600..3ba74521058c 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/ContactDetails.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/ContactDetails.java @@ -1,11 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -124,32 +123,6 @@ public ContactDetails withEmailList(List emailList) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (contactPerson() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Missing required property contactPerson in model ContactDetails")); - } - if (companyName() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Missing required property companyName in model ContactDetails")); - } - if (phone() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Missing required property phone in model ContactDetails")); - } - if (emailList() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Missing required property emailList in model ContactDetails")); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(ContactDetails.class); - /** * {@inheritDoc} */ diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/Container.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/Container.java index 60e7d8701960..2693bd8a53df 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/Container.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/Container.java @@ -1,9 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.models; +import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.databoxedge.fluent.models.ContainerInner; import java.time.OffsetDateTime; @@ -33,6 +34,13 @@ public interface Container { */ String type(); + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + /** * Gets the containerStatus property: Current status of the container. * @@ -97,15 +105,15 @@ interface Blank extends WithParentResource { */ interface WithParentResource { /** - * Specifies deviceName, storageAccountName, resourceGroupName. + * Specifies resourceGroupName, deviceName, storageAccountName. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param storageAccountName The Storage Account Name. - * @param resourceGroupName The resource group name. + * @param storageAccountName The storage account name. * @return the next definition stage. */ - WithDataFormat withExistingStorageAccount(String deviceName, String storageAccountName, - String resourceGroupName); + WithDataFormat withExistingStorageAccount(String resourceGroupName, String deviceName, + String storageAccountName); } /** diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/ContainerStatus.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/ContainerStatus.java index c172f6e53881..017584ee3a60 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/ContainerStatus.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/ContainerStatus.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.models; @@ -12,27 +12,27 @@ */ public final class ContainerStatus extends ExpandableStringEnum { /** - * Static value OK for ContainerStatus. + * OK. */ public static final ContainerStatus OK = fromString("OK"); /** - * Static value Offline for ContainerStatus. + * Offline. */ public static final ContainerStatus OFFLINE = fromString("Offline"); /** - * Static value Unknown for ContainerStatus. + * Unknown. */ public static final ContainerStatus UNKNOWN = fromString("Unknown"); /** - * Static value Updating for ContainerStatus. + * Updating. */ public static final ContainerStatus UPDATING = fromString("Updating"); /** - * Static value NeedsAttention for ContainerStatus. + * NeedsAttention. */ public static final ContainerStatus NEEDS_ATTENTION = fromString("NeedsAttention"); diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/Containers.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/Containers.java index f4df06103bb9..313c1be370af 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/Containers.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/Containers.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.models; @@ -13,120 +13,120 @@ */ public interface Containers { /** - * Lists all the containers of a storage Account in a Data Box Edge/Data Box Gateway device. + * Gets a container by name. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param storageAccountName The storage Account name. - * @param resourceGroupName The resource group name. + * @param storageAccountName The storage account name. + * @param containerName The container Name. + * @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 collection of all the containers on the Data Box Edge/Gateway device as paginated response with - * {@link PagedIterable}. + * @return a container by name along with {@link Response}. */ - PagedIterable listByStorageAccount(String deviceName, String storageAccountName, - String resourceGroupName); + Response getWithResponse(String resourceGroupName, String deviceName, String storageAccountName, + String containerName, Context context); /** - * Lists all the containers of a storage Account in a Data Box Edge/Data Box Gateway device. + * Gets a container by name. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param storageAccountName The storage Account name. - * @param resourceGroupName The resource group name. - * @param context The context to associate with this operation. + * @param storageAccountName The storage account name. + * @param containerName The container Name. * @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 collection of all the containers on the Data Box Edge/Gateway device as paginated response with - * {@link PagedIterable}. + * @return a container by name. */ - PagedIterable listByStorageAccount(String deviceName, String storageAccountName, - String resourceGroupName, Context context); + Container get(String resourceGroupName, String deviceName, String storageAccountName, String containerName); /** - * Gets a container by name. + * Deletes the container on the Data Box Edge/Data Box Gateway device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param storageAccountName The Storage Account Name. + * @param storageAccountName The storage account name. * @param containerName The container Name. - * @param resourceGroupName The resource group name. - * @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 a container by name along with {@link Response}. */ - Response getWithResponse(String deviceName, String storageAccountName, String containerName, - String resourceGroupName, Context context); + void delete(String resourceGroupName, String deviceName, String storageAccountName, String containerName); /** - * Gets a container by name. + * Deletes the container on the Data Box Edge/Data Box Gateway device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param storageAccountName The Storage Account Name. + * @param storageAccountName The storage account name. * @param containerName The container Name. - * @param resourceGroupName The resource group name. + * @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 a container by name. */ - Container get(String deviceName, String storageAccountName, String containerName, String resourceGroupName); + void delete(String resourceGroupName, String deviceName, String storageAccountName, String containerName, + Context context); /** - * Deletes the container on the Data Box Edge/Data Box Gateway device. + * Lists all the containers of a storage Account in a Data Box Edge/Data Box Gateway device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param storageAccountName The Storage Account Name. - * @param containerName The container name. - * @param resourceGroupName The resource group name. + * @param storageAccountName The storage account name. * @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 collection of all the containers on the Data Box Edge/Gateway device as paginated response with + * {@link PagedIterable}. */ - void delete(String deviceName, String storageAccountName, String containerName, String resourceGroupName); + PagedIterable listByStorageAccount(String resourceGroupName, String deviceName, + String storageAccountName); /** - * Deletes the container on the Data Box Edge/Data Box Gateway device. + * Lists all the containers of a storage Account in a Data Box Edge/Data Box Gateway device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param storageAccountName The Storage Account Name. - * @param containerName The container name. - * @param resourceGroupName The resource group name. + * @param storageAccountName The storage account name. * @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 collection of all the containers on the Data Box Edge/Gateway device as paginated response with + * {@link PagedIterable}. */ - void delete(String deviceName, String storageAccountName, String containerName, String resourceGroupName, - Context context); + PagedIterable listByStorageAccount(String resourceGroupName, String deviceName, + String storageAccountName, Context context); /** * Refreshes the container metadata with the data from the cloud. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param storageAccountName The Storage Account Name. - * @param containerName The container name. - * @param resourceGroupName The resource group name. + * @param storageAccountName The storage account name. + * @param containerName The container Name. * @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 refresh(String deviceName, String storageAccountName, String containerName, String resourceGroupName); + void refresh(String resourceGroupName, String deviceName, String storageAccountName, String containerName); /** * Refreshes the container metadata with the data from the cloud. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param storageAccountName The Storage Account Name. - * @param containerName The container name. - * @param resourceGroupName The resource group name. + * @param storageAccountName The storage account name. + * @param containerName The container Name. * @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. */ - void refresh(String deviceName, String storageAccountName, String containerName, String resourceGroupName, + void refresh(String resourceGroupName, String deviceName, String storageAccountName, String containerName, Context context); /** diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/DCAccessCode.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/DCAccessCode.java new file mode 100644 index 000000000000..40386a44a601 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/DCAccessCode.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.databoxedge.models; + +import com.azure.resourcemanager.databoxedge.fluent.models.DCAccessCodeInner; + +/** + * An immutable client-side representation of DCAccessCode. + */ +public interface DCAccessCode { + /** + * Gets the authCode property: DCAccess Code for the Self Managed shipment. + * + * @return the authCode value. + */ + String authCode(); + + /** + * Gets the inner com.azure.resourcemanager.databoxedge.fluent.models.DCAccessCodeInner object. + * + * @return the inner object. + */ + DCAccessCodeInner innerModel(); +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/DataBoxEdgeDevice.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/DataBoxEdgeDevice.java index e160d1fb4ff4..c03390fc509a 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/DataBoxEdgeDevice.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/DataBoxEdgeDevice.java @@ -1,11 +1,12 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.models; import com.azure.core.http.rest.Response; import com.azure.core.management.Region; +import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.databoxedge.fluent.models.DataBoxEdgeDeviceInner; import java.util.List; @@ -37,17 +38,14 @@ public interface DataBoxEdgeDevice { String type(); /** - * Gets the location property: The location of the device. This is a supported and registered Azure geographical - * region (for example, West US, East US, or Southeast Asia). The geographical region of a device cannot be changed - * once it is created, but if an identical geographical region is specified on update, the request will succeed. + * Gets the location property: The geo-location where the resource lives. * * @return the location value. */ String location(); /** - * Gets the tags property: The list of tags that describe the device. These tags can be used to view and group this - * device (across resource groups). + * Gets the tags property: Resource tags. * * @return the tags value. */ @@ -67,6 +65,34 @@ public interface DataBoxEdgeDevice { */ String etag(); + /** + * Gets the identity property: Msi identity of the resource. + * + * @return the identity value. + */ + ResourceIdentity identity(); + + /** + * Gets the kind property: The kind of the device. + * + * @return the kind value. + */ + DataBoxEdgeDeviceKind kind(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the systemDataPropertiesSystemData property: DataBoxEdge Device Properties. + * + * @return the systemDataPropertiesSystemData value. + */ + SystemData systemDataPropertiesSystemData(); + /** * Gets the dataBoxEdgeDeviceStatus property: The status of the Data Box Edge/Gateway device. * @@ -165,6 +191,34 @@ public interface DataBoxEdgeDevice { */ Integer nodeCount(); + /** + * Gets the resourceMoveDetails property: The details of the move operation on this resource. + * + * @return the resourceMoveDetails value. + */ + ResourceMoveDetails resourceMoveDetails(); + + /** + * Gets the edgeProfile property: The details of Edge Profile for this resource. + * + * @return the edgeProfile value. + */ + EdgeProfile edgeProfile(); + + /** + * Gets the dataResidency property: The details of data-residency related properties for this resource. + * + * @return the dataResidency value. + */ + DataResidency dataResidency(); + + /** + * Gets the kubernetesWorkloadProfile property: Kubernetes Workload Profile. + * + * @return the kubernetesWorkloadProfile value. + */ + String kubernetesWorkloadProfile(); + /** * Gets the region of the resource. * @@ -217,10 +271,7 @@ interface WithLocation { /** * Specifies the region for the resource. * - * @param location The location of the device. This is a supported and registered Azure geographical region - * (for example, West US, East US, or Southeast Asia). The geographical region of a device cannot be changed - * once it is created, but if an identical geographical region is specified on update, the request will - * succeed. + * @param location The geo-location where the resource lives. * @return the next definition stage. */ WithResourceGroup withRegion(Region location); @@ -228,10 +279,7 @@ interface WithLocation { /** * Specifies the region for the resource. * - * @param location The location of the device. This is a supported and registered Azure geographical region - * (for example, West US, East US, or Southeast Asia). The geographical region of a device cannot be changed - * once it is created, but if an identical geographical region is specified on update, the request will - * succeed. + * @param location The geo-location where the resource lives. * @return the next definition stage. */ WithResourceGroup withRegion(String location); @@ -244,7 +292,7 @@ interface WithResourceGroup { /** * Specifies resourceGroupName. * - * @param resourceGroupName The resource group name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @return the next definition stage. */ WithCreate withExistingResourceGroup(String resourceGroupName); @@ -255,8 +303,7 @@ interface WithResourceGroup { * resource to be created, but also allows for any other optional properties to be specified. */ interface WithCreate extends DefinitionStages.WithTags, DefinitionStages.WithSku, DefinitionStages.WithEtag, - DefinitionStages.WithDataBoxEdgeDeviceStatus, DefinitionStages.WithDescription, - DefinitionStages.WithModelDescription, DefinitionStages.WithFriendlyName { + DefinitionStages.WithIdentity, DefinitionStages.WithDataResidency { /** * Executes the create request. * @@ -278,11 +325,9 @@ interface WithCreate extends DefinitionStages.WithTags, DefinitionStages.WithSku */ interface WithTags { /** - * Specifies the tags property: The list of tags that describe the device. These tags can be used to view - * and group this device (across resource groups).. + * Specifies the tags property: Resource tags.. * - * @param tags The list of tags that describe the device. These tags can be used to view and group this - * device (across resource groups). + * @param tags Resource tags. * @return the next definition stage. */ WithCreate withTags(Map tags); @@ -315,55 +360,29 @@ interface WithEtag { } /** - * The stage of the DataBoxEdgeDevice definition allowing to specify dataBoxEdgeDeviceStatus. + * The stage of the DataBoxEdgeDevice definition allowing to specify identity. */ - interface WithDataBoxEdgeDeviceStatus { + interface WithIdentity { /** - * Specifies the dataBoxEdgeDeviceStatus property: The status of the Data Box Edge/Gateway device.. + * Specifies the identity property: Msi identity of the resource. * - * @param dataBoxEdgeDeviceStatus The status of the Data Box Edge/Gateway device. + * @param identity Msi identity of the resource. * @return the next definition stage. */ - WithCreate withDataBoxEdgeDeviceStatus(DataBoxEdgeDeviceStatus dataBoxEdgeDeviceStatus); + WithCreate withIdentity(ResourceIdentity identity); } /** - * The stage of the DataBoxEdgeDevice definition allowing to specify description. + * The stage of the DataBoxEdgeDevice definition allowing to specify dataResidency. */ - interface WithDescription { + interface WithDataResidency { /** - * Specifies the description property: The Description of the Data Box Edge/Gateway device.. + * Specifies the dataResidency property: The details of data-residency related properties for this resource. * - * @param description The Description of the Data Box Edge/Gateway device. + * @param dataResidency The details of data-residency related properties for this resource. * @return the next definition stage. */ - WithCreate withDescription(String description); - } - - /** - * The stage of the DataBoxEdgeDevice definition allowing to specify modelDescription. - */ - interface WithModelDescription { - /** - * Specifies the modelDescription property: The description of the Data Box Edge/Gateway device model.. - * - * @param modelDescription The description of the Data Box Edge/Gateway device model. - * @return the next definition stage. - */ - WithCreate withModelDescription(String modelDescription); - } - - /** - * The stage of the DataBoxEdgeDevice definition allowing to specify friendlyName. - */ - interface WithFriendlyName { - /** - * Specifies the friendlyName property: The Data Box Edge/Gateway device name.. - * - * @param friendlyName The Data Box Edge/Gateway device name. - * @return the next definition stage. - */ - WithCreate withFriendlyName(String friendlyName); + WithCreate withDataResidency(DataResidency dataResidency); } } @@ -377,7 +396,7 @@ interface WithFriendlyName { /** * The template for DataBoxEdgeDevice update. */ - interface Update extends UpdateStages.WithTags { + interface Update extends UpdateStages.WithTags, UpdateStages.WithIdentity, UpdateStages.WithEdgeProfile { /** * Executes the update request. * @@ -410,6 +429,32 @@ interface WithTags { */ Update withTags(Map tags); } + + /** + * The stage of the DataBoxEdgeDevice update 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. + */ + Update withIdentity(ResourceIdentity identity); + } + + /** + * The stage of the DataBoxEdgeDevice update allowing to specify edgeProfile. + */ + interface WithEdgeProfile { + /** + * Specifies the edgeProfile property: Edge Profile property of the Data Box Edge/Gateway device. + * + * @param edgeProfile Edge Profile property of the Data Box Edge/Gateway device. + * @return the next definition stage. + */ + Update withEdgeProfile(EdgeProfilePatch edgeProfile); + } } /** @@ -446,23 +491,43 @@ interface WithTags { void downloadUpdates(Context context); /** - * Gets additional information for the specified Data Box Edge/Data Box Gateway device. + * Generates certificate for activation key. * * @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 additional information for the specified Data Box Edge/Data Box Gateway device along with + * @return used in activation key generation flow along with {@link Response}. + */ + Response generateCertificateWithResponse(Context context); + + /** + * Generates certificate for activation key. + * + * @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 used in activation key generation flow. + */ + GenerateCertResponse generateCertificate(); + + /** + * Gets additional information for the specified Azure Stack Edge/Data Box Gateway device. + * + * @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 additional information for the specified Azure Stack Edge/Data Box Gateway device along with * {@link Response}. */ Response getExtendedInformationWithResponse(Context context); /** - * Gets additional information for the specified Data Box Edge/Data Box Gateway device. + * Gets additional information for the specified Azure Stack Edge/Data Box Gateway device. * * @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 additional information for the specified Data Box Edge/Data Box Gateway device. + * @return additional information for the specified Azure Stack Edge/Data Box Gateway device. */ DataBoxEdgeDeviceExtendedInfo getExtendedInformation(); @@ -502,6 +567,52 @@ interface WithTags { */ void scanForUpdates(Context context); + /** + * Updates the security settings on a Data Box Edge/Data Box Gateway device. + * + * @param securitySettings The security settings. + * @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 createOrUpdateSecuritySettings(SecuritySettings securitySettings); + + /** + * Updates the security settings on a Data Box Edge/Data Box Gateway device. + * + * @param securitySettings The security settings. + * @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. + */ + void createOrUpdateSecuritySettings(SecuritySettings securitySettings, Context context); + + /** + * Gets additional information for the specified Data Box Edge/Data Box Gateway device. + * + * @param parameters The patch object. + * @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 additional information for the specified Data Box Edge/Data Box Gateway device along with + * {@link Response}. + */ + Response + updateExtendedInformationWithResponse(DataBoxEdgeDeviceExtendedInfoPatch parameters, Context context); + + /** + * Gets additional information for the specified Data Box Edge/Data Box Gateway device. + * + * @param parameters The patch object. + * @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 additional information for the specified Data Box Edge/Data Box Gateway device. + */ + DataBoxEdgeDeviceExtendedInfo updateExtendedInformation(DataBoxEdgeDeviceExtendedInfoPatch parameters); + /** * Uploads registration certificate for the device. * diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/DataBoxEdgeDeviceExtendedInfo.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/DataBoxEdgeDeviceExtendedInfo.java index 473282f94af4..56e8c845da2a 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/DataBoxEdgeDeviceExtendedInfo.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/DataBoxEdgeDeviceExtendedInfo.java @@ -1,36 +1,45 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.models; +import com.azure.core.management.SystemData; import com.azure.resourcemanager.databoxedge.fluent.models.DataBoxEdgeDeviceExtendedInfoInner; +import java.util.Map; /** * An immutable client-side representation of DataBoxEdgeDeviceExtendedInfo. */ public interface DataBoxEdgeDeviceExtendedInfo { /** - * Gets the id property: Fully qualified resource Id for the resource. + * Gets the id property: The path ID that uniquely identifies the object. * * @return the id value. */ String id(); /** - * Gets the name property: The name of the resource. + * Gets the name property: The object name. * * @return the name value. */ String name(); /** - * Gets the type property: The type of the resource. + * Gets the type property: The hierarchical type of the object. * * @return the type value. */ String type(); + /** + * Gets the systemData property: Metadata pertaining to creation and last modification of DataBoxEdgeDevice. + * + * @return the systemData value. + */ + SystemData systemData(); + /** * Gets the encryptionKeyThumbprint property: The digital signature of encrypted certificate. * @@ -53,6 +62,91 @@ public interface DataBoxEdgeDeviceExtendedInfo { */ String resourceKey(); + /** + * Gets the clientSecretStoreId property: The Key Vault ARM Id for client secrets. + * + * @return the clientSecretStoreId value. + */ + String clientSecretStoreId(); + + /** + * Gets the clientSecretStoreUrl property: The url to access the Client Key Vault. + * + * @return the clientSecretStoreUrl value. + */ + String clientSecretStoreUrl(); + + /** + * Gets the channelIntegrityKeyName property: The name of Channel Integrity Key stored in the Client Key Vault. + * + * @return the channelIntegrityKeyName value. + */ + String channelIntegrityKeyName(); + + /** + * Gets the channelIntegrityKeyVersion property: The version of Channel Integrity Key stored in the Client Key + * Vault. + * + * @return the channelIntegrityKeyVersion value. + */ + String channelIntegrityKeyVersion(); + + /** + * Gets the keyVaultSyncStatus property: Key vault sync status. + * + * @return the keyVaultSyncStatus value. + */ + KeyVaultSyncStatus keyVaultSyncStatus(); + + /** + * Gets the deviceSecrets property: Device secrets, will be returned only with ODataFilter $expand=deviceSecrets. + * + * @return the deviceSecrets value. + */ + Map deviceSecrets(); + + /** + * Gets the clusterWitnessType property: Cluster Witness Type. + * + * @return the clusterWitnessType value. + */ + ClusterWitnessType clusterWitnessType(); + + /** + * Gets the fileShareWitnessLocation property: The witness location of file share. + * + * @return the fileShareWitnessLocation value. + */ + String fileShareWitnessLocation(); + + /** + * Gets the fileShareWitnessUsername property: The username of file share. + * + * @return the fileShareWitnessUsername value. + */ + String fileShareWitnessUsername(); + + /** + * Gets the cloudWitnessStorageAccountName property: The Cloud Witness Storage account name. + * + * @return the cloudWitnessStorageAccountName value. + */ + String cloudWitnessStorageAccountName(); + + /** + * Gets the cloudWitnessContainerName property: The Container for cloud witness in the storage account. + * + * @return the cloudWitnessContainerName value. + */ + String cloudWitnessContainerName(); + + /** + * Gets the cloudWitnessStorageEndpoint property: The Azure service endpoint of the cloud witness storage account. + * + * @return the cloudWitnessStorageEndpoint value. + */ + String cloudWitnessStorageEndpoint(); + /** * Gets the inner com.azure.resourcemanager.databoxedge.fluent.models.DataBoxEdgeDeviceExtendedInfoInner object. * diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/DataBoxEdgeDeviceExtendedInfoPatch.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/DataBoxEdgeDeviceExtendedInfoPatch.java new file mode 100644 index 000000000000..a5138fa9f9bb --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/DataBoxEdgeDeviceExtendedInfoPatch.java @@ -0,0 +1,202 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.databoxedge.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The Data Box Edge/Gateway device extended info patch. + */ +@Fluent +public final class DataBoxEdgeDeviceExtendedInfoPatch implements JsonSerializable { + /* + * The Key Vault ARM Id for client secrets + */ + private String clientSecretStoreId; + + /* + * The url to access the Client Key Vault + */ + private String clientSecretStoreUrl; + + /* + * The name for Channel Integrity Key stored in the Client Key Vault + */ + private String channelIntegrityKeyName; + + /* + * The version of Channel Integrity Key stored in the Client Key Vault + */ + private String channelIntegrityKeyVersion; + + /* + * For changing or to initiate the resync to key-vault set the status to KeyVaultSyncPending, rest of the status + * will not be applicable. + */ + private KeyVaultSyncStatus syncStatus; + + /** + * Creates an instance of DataBoxEdgeDeviceExtendedInfoPatch class. + */ + public DataBoxEdgeDeviceExtendedInfoPatch() { + } + + /** + * Get the clientSecretStoreId property: The Key Vault ARM Id for client secrets. + * + * @return the clientSecretStoreId value. + */ + public String clientSecretStoreId() { + return this.clientSecretStoreId; + } + + /** + * Set the clientSecretStoreId property: The Key Vault ARM Id for client secrets. + * + * @param clientSecretStoreId the clientSecretStoreId value to set. + * @return the DataBoxEdgeDeviceExtendedInfoPatch object itself. + */ + public DataBoxEdgeDeviceExtendedInfoPatch withClientSecretStoreId(String clientSecretStoreId) { + this.clientSecretStoreId = clientSecretStoreId; + return this; + } + + /** + * Get the clientSecretStoreUrl property: The url to access the Client Key Vault. + * + * @return the clientSecretStoreUrl value. + */ + public String clientSecretStoreUrl() { + return this.clientSecretStoreUrl; + } + + /** + * Set the clientSecretStoreUrl property: The url to access the Client Key Vault. + * + * @param clientSecretStoreUrl the clientSecretStoreUrl value to set. + * @return the DataBoxEdgeDeviceExtendedInfoPatch object itself. + */ + public DataBoxEdgeDeviceExtendedInfoPatch withClientSecretStoreUrl(String clientSecretStoreUrl) { + this.clientSecretStoreUrl = clientSecretStoreUrl; + return this; + } + + /** + * Get the channelIntegrityKeyName property: The name for Channel Integrity Key stored in the Client Key Vault. + * + * @return the channelIntegrityKeyName value. + */ + public String channelIntegrityKeyName() { + return this.channelIntegrityKeyName; + } + + /** + * Set the channelIntegrityKeyName property: The name for Channel Integrity Key stored in the Client Key Vault. + * + * @param channelIntegrityKeyName the channelIntegrityKeyName value to set. + * @return the DataBoxEdgeDeviceExtendedInfoPatch object itself. + */ + public DataBoxEdgeDeviceExtendedInfoPatch withChannelIntegrityKeyName(String channelIntegrityKeyName) { + this.channelIntegrityKeyName = channelIntegrityKeyName; + return this; + } + + /** + * Get the channelIntegrityKeyVersion property: The version of Channel Integrity Key stored in the Client Key Vault. + * + * @return the channelIntegrityKeyVersion value. + */ + public String channelIntegrityKeyVersion() { + return this.channelIntegrityKeyVersion; + } + + /** + * Set the channelIntegrityKeyVersion property: The version of Channel Integrity Key stored in the Client Key Vault. + * + * @param channelIntegrityKeyVersion the channelIntegrityKeyVersion value to set. + * @return the DataBoxEdgeDeviceExtendedInfoPatch object itself. + */ + public DataBoxEdgeDeviceExtendedInfoPatch withChannelIntegrityKeyVersion(String channelIntegrityKeyVersion) { + this.channelIntegrityKeyVersion = channelIntegrityKeyVersion; + return this; + } + + /** + * Get the syncStatus property: For changing or to initiate the resync to key-vault set the status to + * KeyVaultSyncPending, rest of the status will not be applicable. + * + * @return the syncStatus value. + */ + public KeyVaultSyncStatus syncStatus() { + return this.syncStatus; + } + + /** + * Set the syncStatus property: For changing or to initiate the resync to key-vault set the status to + * KeyVaultSyncPending, rest of the status will not be applicable. + * + * @param syncStatus the syncStatus value to set. + * @return the DataBoxEdgeDeviceExtendedInfoPatch object itself. + */ + public DataBoxEdgeDeviceExtendedInfoPatch withSyncStatus(KeyVaultSyncStatus syncStatus) { + this.syncStatus = syncStatus; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("clientSecretStoreId", this.clientSecretStoreId); + jsonWriter.writeStringField("clientSecretStoreUrl", this.clientSecretStoreUrl); + jsonWriter.writeStringField("channelIntegrityKeyName", this.channelIntegrityKeyName); + jsonWriter.writeStringField("channelIntegrityKeyVersion", this.channelIntegrityKeyVersion); + jsonWriter.writeStringField("syncStatus", this.syncStatus == null ? null : this.syncStatus.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DataBoxEdgeDeviceExtendedInfoPatch from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DataBoxEdgeDeviceExtendedInfoPatch if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the DataBoxEdgeDeviceExtendedInfoPatch. + */ + public static DataBoxEdgeDeviceExtendedInfoPatch fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DataBoxEdgeDeviceExtendedInfoPatch deserializedDataBoxEdgeDeviceExtendedInfoPatch + = new DataBoxEdgeDeviceExtendedInfoPatch(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("clientSecretStoreId".equals(fieldName)) { + deserializedDataBoxEdgeDeviceExtendedInfoPatch.clientSecretStoreId = reader.getString(); + } else if ("clientSecretStoreUrl".equals(fieldName)) { + deserializedDataBoxEdgeDeviceExtendedInfoPatch.clientSecretStoreUrl = reader.getString(); + } else if ("channelIntegrityKeyName".equals(fieldName)) { + deserializedDataBoxEdgeDeviceExtendedInfoPatch.channelIntegrityKeyName = reader.getString(); + } else if ("channelIntegrityKeyVersion".equals(fieldName)) { + deserializedDataBoxEdgeDeviceExtendedInfoPatch.channelIntegrityKeyVersion = reader.getString(); + } else if ("syncStatus".equals(fieldName)) { + deserializedDataBoxEdgeDeviceExtendedInfoPatch.syncStatus + = KeyVaultSyncStatus.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedDataBoxEdgeDeviceExtendedInfoPatch; + }); + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/DataBoxEdgeDeviceKind.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/DataBoxEdgeDeviceKind.java new file mode 100644 index 000000000000..ef786b82c0db --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/DataBoxEdgeDeviceKind.java @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.databoxedge.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The kind of the device. + */ +public final class DataBoxEdgeDeviceKind extends ExpandableStringEnum { + /** + * AzureDataBoxGateway. + */ + public static final DataBoxEdgeDeviceKind AZURE_DATA_BOX_GATEWAY = fromString("AzureDataBoxGateway"); + + /** + * AzureStackEdge. + */ + public static final DataBoxEdgeDeviceKind AZURE_STACK_EDGE = fromString("AzureStackEdge"); + + /** + * AzureStackHub. + */ + public static final DataBoxEdgeDeviceKind AZURE_STACK_HUB = fromString("AzureStackHub"); + + /** + * AzureModularDataCentre. + */ + public static final DataBoxEdgeDeviceKind AZURE_MODULAR_DATA_CENTRE = fromString("AzureModularDataCentre"); + + /** + * Creates a new instance of DataBoxEdgeDeviceKind value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public DataBoxEdgeDeviceKind() { + } + + /** + * Creates or finds a DataBoxEdgeDeviceKind from its string representation. + * + * @param name a name to look for. + * @return the corresponding DataBoxEdgeDeviceKind. + */ + public static DataBoxEdgeDeviceKind fromString(String name) { + return fromString(name, DataBoxEdgeDeviceKind.class); + } + + /** + * Gets known DataBoxEdgeDeviceKind values. + * + * @return known DataBoxEdgeDeviceKind values. + */ + public static Collection values() { + return values(DataBoxEdgeDeviceKind.class); + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/DataBoxEdgeDevicePatch.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/DataBoxEdgeDevicePatch.java index 1f7fc2546b21..90ba2ebfd15f 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/DataBoxEdgeDevicePatch.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/DataBoxEdgeDevicePatch.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.models; @@ -9,6 +9,7 @@ import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; +import com.azure.resourcemanager.databoxedge.fluent.models.DataBoxEdgeDevicePropertiesPatch; import java.io.IOException; import java.util.Map; @@ -22,6 +23,16 @@ public final class DataBoxEdgeDevicePatch implements JsonSerializable tags; + /* + * Msi identity of the resource + */ + private ResourceIdentity identity; + + /* + * The properties associated with the Data Box Edge/Gateway resource + */ + private DataBoxEdgeDevicePropertiesPatch innerProperties; + /** * Creates an instance of DataBoxEdgeDevicePatch class. */ @@ -49,11 +60,55 @@ public DataBoxEdgeDevicePatch withTags(Map tags) { } /** - * Validates the instance. + * 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 DataBoxEdgeDevicePatch object itself. + */ + public DataBoxEdgeDevicePatch withIdentity(ResourceIdentity identity) { + this.identity = identity; + return this; + } + + /** + * Get the innerProperties property: The properties associated with the Data Box Edge/Gateway resource. + * + * @return the innerProperties value. + */ + private DataBoxEdgeDevicePropertiesPatch innerProperties() { + return this.innerProperties; + } + + /** + * Get the edgeProfile property: Edge Profile property of the Data Box Edge/Gateway device. * - * @throws IllegalArgumentException thrown if the instance is not valid. + * @return the edgeProfile value. */ - public void validate() { + public EdgeProfilePatch edgeProfile() { + return this.innerProperties() == null ? null : this.innerProperties().edgeProfile(); + } + + /** + * Set the edgeProfile property: Edge Profile property of the Data Box Edge/Gateway device. + * + * @param edgeProfile the edgeProfile value to set. + * @return the DataBoxEdgeDevicePatch object itself. + */ + public DataBoxEdgeDevicePatch withEdgeProfile(EdgeProfilePatch edgeProfile) { + if (this.innerProperties() == null) { + this.innerProperties = new DataBoxEdgeDevicePropertiesPatch(); + } + this.innerProperties().withEdgeProfile(edgeProfile); + return this; } /** @@ -63,6 +118,8 @@ public void validate() { public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("identity", this.identity); + jsonWriter.writeJsonField("properties", this.innerProperties); return jsonWriter.writeEndObject(); } @@ -84,6 +141,11 @@ public static DataBoxEdgeDevicePatch fromJson(JsonReader jsonReader) throws IOEx if ("tags".equals(fieldName)) { Map tags = reader.readMap(reader1 -> reader1.getString()); deserializedDataBoxEdgeDevicePatch.tags = tags; + } else if ("identity".equals(fieldName)) { + deserializedDataBoxEdgeDevicePatch.identity = ResourceIdentity.fromJson(reader); + } else if ("properties".equals(fieldName)) { + deserializedDataBoxEdgeDevicePatch.innerProperties + = DataBoxEdgeDevicePropertiesPatch.fromJson(reader); } else { reader.skipChildren(); } diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/DataBoxEdgeDeviceStatus.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/DataBoxEdgeDeviceStatus.java index 4f47b82a6986..03c745e3f2e3 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/DataBoxEdgeDeviceStatus.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/DataBoxEdgeDeviceStatus.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.models; @@ -12,37 +12,37 @@ */ public final class DataBoxEdgeDeviceStatus extends ExpandableStringEnum { /** - * Static value ReadyToSetup for DataBoxEdgeDeviceStatus. + * ReadyToSetup. */ public static final DataBoxEdgeDeviceStatus READY_TO_SETUP = fromString("ReadyToSetup"); /** - * Static value Online for DataBoxEdgeDeviceStatus. + * Online. */ public static final DataBoxEdgeDeviceStatus ONLINE = fromString("Online"); /** - * Static value Offline for DataBoxEdgeDeviceStatus. + * Offline. */ public static final DataBoxEdgeDeviceStatus OFFLINE = fromString("Offline"); /** - * Static value NeedsAttention for DataBoxEdgeDeviceStatus. + * NeedsAttention. */ public static final DataBoxEdgeDeviceStatus NEEDS_ATTENTION = fromString("NeedsAttention"); /** - * Static value Disconnected for DataBoxEdgeDeviceStatus. + * Disconnected. */ public static final DataBoxEdgeDeviceStatus DISCONNECTED = fromString("Disconnected"); /** - * Static value PartiallyDisconnected for DataBoxEdgeDeviceStatus. + * PartiallyDisconnected. */ public static final DataBoxEdgeDeviceStatus PARTIALLY_DISCONNECTED = fromString("PartiallyDisconnected"); /** - * Static value Maintenance for DataBoxEdgeDeviceStatus. + * Maintenance. */ public static final DataBoxEdgeDeviceStatus MAINTENANCE = fromString("Maintenance"); diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/DataBoxEdgeSku.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/DataBoxEdgeSku.java new file mode 100644 index 000000000000..67e4e3f31d30 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/DataBoxEdgeSku.java @@ -0,0 +1,305 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.databoxedge.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * The Sku information. + */ +@Immutable +public final class DataBoxEdgeSku implements JsonSerializable { + /* + * The type of the resource. + */ + private String resourceType; + + /* + * The Sku name. + */ + private SkuName name; + + /* + * The Sku kind. + */ + private String kind; + + /* + * The Sku tier. + */ + private SkuTier tier; + + /* + * The Sku kind. + */ + private String size; + + /* + * The Sku family. + */ + private String family; + + /* + * Availability of the Sku for the region. + */ + private List locations; + + /* + * The API versions in which Sku is available. + */ + private List apiVersions; + + /* + * Availability of the Sku for the location/zone/site. + */ + private List locationInfo; + + /* + * The pricing info of the Sku. + */ + private List costs; + + /* + * Sku can be signed up by customer or not. + */ + private SkuSignupOption signupOption; + + /* + * Availability of the Sku as preview/stable. + */ + private SkuVersion version; + + /* + * Links to the next set of results + */ + private SkuAvailability availability; + + /* + * List of Shipment Types supported by this SKU + */ + private List shipmentTypes; + + /* + * The capability info of the SKU. + */ + private List capabilities; + + /** + * Creates an instance of DataBoxEdgeSku class. + */ + private DataBoxEdgeSku() { + } + + /** + * Get the resourceType property: The type of the resource. + * + * @return the resourceType value. + */ + public String resourceType() { + return this.resourceType; + } + + /** + * Get the name property: The Sku name. + * + * @return the name value. + */ + public SkuName name() { + return this.name; + } + + /** + * Get the kind property: The Sku kind. + * + * @return the kind value. + */ + public String kind() { + return this.kind; + } + + /** + * Get the tier property: The Sku tier. + * + * @return the tier value. + */ + public SkuTier tier() { + return this.tier; + } + + /** + * Get the size property: The Sku kind. + * + * @return the size value. + */ + public String size() { + return this.size; + } + + /** + * Get the family property: The Sku family. + * + * @return the family value. + */ + public String family() { + return this.family; + } + + /** + * Get the locations property: Availability of the Sku for the region. + * + * @return the locations value. + */ + public List locations() { + return this.locations; + } + + /** + * Get the apiVersions property: The API versions in which Sku is available. + * + * @return the apiVersions value. + */ + public List apiVersions() { + return this.apiVersions; + } + + /** + * Get the locationInfo property: Availability of the Sku for the location/zone/site. + * + * @return the locationInfo value. + */ + public List locationInfo() { + return this.locationInfo; + } + + /** + * Get the costs property: The pricing info of the Sku. + * + * @return the costs value. + */ + public List costs() { + return this.costs; + } + + /** + * Get the signupOption property: Sku can be signed up by customer or not. + * + * @return the signupOption value. + */ + public SkuSignupOption signupOption() { + return this.signupOption; + } + + /** + * Get the version property: Availability of the Sku as preview/stable. + * + * @return the version value. + */ + public SkuVersion version() { + return this.version; + } + + /** + * Get the availability property: Links to the next set of results. + * + * @return the availability value. + */ + public SkuAvailability availability() { + return this.availability; + } + + /** + * Get the shipmentTypes property: List of Shipment Types supported by this SKU. + * + * @return the shipmentTypes value. + */ + public List shipmentTypes() { + return this.shipmentTypes; + } + + /** + * Get the capabilities property: The capability info of the SKU. + * + * @return the capabilities value. + */ + public List capabilities() { + return this.capabilities; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DataBoxEdgeSku from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DataBoxEdgeSku if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the DataBoxEdgeSku. + */ + public static DataBoxEdgeSku fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DataBoxEdgeSku deserializedDataBoxEdgeSku = new DataBoxEdgeSku(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("resourceType".equals(fieldName)) { + deserializedDataBoxEdgeSku.resourceType = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedDataBoxEdgeSku.name = SkuName.fromString(reader.getString()); + } else if ("kind".equals(fieldName)) { + deserializedDataBoxEdgeSku.kind = reader.getString(); + } else if ("tier".equals(fieldName)) { + deserializedDataBoxEdgeSku.tier = SkuTier.fromString(reader.getString()); + } else if ("size".equals(fieldName)) { + deserializedDataBoxEdgeSku.size = reader.getString(); + } else if ("family".equals(fieldName)) { + deserializedDataBoxEdgeSku.family = reader.getString(); + } else if ("locations".equals(fieldName)) { + List locations = reader.readArray(reader1 -> reader1.getString()); + deserializedDataBoxEdgeSku.locations = locations; + } else if ("apiVersions".equals(fieldName)) { + List apiVersions = reader.readArray(reader1 -> reader1.getString()); + deserializedDataBoxEdgeSku.apiVersions = apiVersions; + } else if ("locationInfo".equals(fieldName)) { + List locationInfo = reader.readArray(reader1 -> SkuLocationInfo.fromJson(reader1)); + deserializedDataBoxEdgeSku.locationInfo = locationInfo; + } else if ("costs".equals(fieldName)) { + List costs = reader.readArray(reader1 -> SkuCost.fromJson(reader1)); + deserializedDataBoxEdgeSku.costs = costs; + } else if ("signupOption".equals(fieldName)) { + deserializedDataBoxEdgeSku.signupOption = SkuSignupOption.fromString(reader.getString()); + } else if ("version".equals(fieldName)) { + deserializedDataBoxEdgeSku.version = SkuVersion.fromString(reader.getString()); + } else if ("availability".equals(fieldName)) { + deserializedDataBoxEdgeSku.availability = SkuAvailability.fromString(reader.getString()); + } else if ("shipmentTypes".equals(fieldName)) { + List shipmentTypes + = reader.readArray(reader1 -> ShipmentType.fromString(reader1.getString())); + deserializedDataBoxEdgeSku.shipmentTypes = shipmentTypes; + } else if ("capabilities".equals(fieldName)) { + List capabilities = reader.readArray(reader1 -> SkuCapability.fromJson(reader1)); + deserializedDataBoxEdgeSku.capabilities = capabilities; + } else { + reader.skipChildren(); + } + } + + return deserializedDataBoxEdgeSku; + }); + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/DataBoxEdgeSkuList.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/DataBoxEdgeSkuList.java new file mode 100644 index 000000000000..06d6fe9cdea4 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/DataBoxEdgeSkuList.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.databoxedge.models; + +import com.azure.resourcemanager.databoxedge.fluent.models.DataBoxEdgeSkuListInner; +import java.util.List; + +/** + * An immutable client-side representation of DataBoxEdgeSkuList. + */ +public interface DataBoxEdgeSkuList { + /** + * Gets the value property: The DataBoxEdgeSku items on this page. + * + * @return the value value. + */ + List value(); + + /** + * Gets the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + String nextLink(); + + /** + * Gets the inner com.azure.resourcemanager.databoxedge.fluent.models.DataBoxEdgeSkuListInner object. + * + * @return the inner object. + */ + DataBoxEdgeSkuListInner innerModel(); +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/DataPolicy.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/DataPolicy.java index 10ca5dba7a0f..be8938aeb951 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/DataPolicy.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/DataPolicy.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.models; @@ -12,12 +12,12 @@ */ public final class DataPolicy extends ExpandableStringEnum { /** - * Static value Cloud for DataPolicy. + * Cloud. */ public static final DataPolicy CLOUD = fromString("Cloud"); /** - * Static value Local for DataPolicy. + * Local. */ public static final DataPolicy LOCAL = fromString("Local"); diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/DataResidency.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/DataResidency.java new file mode 100644 index 000000000000..6d7c389c80b7 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/DataResidency.java @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.databoxedge.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Wraps data-residency related information for edge-resource and this should be used with ARM layer. + */ +@Fluent +public final class DataResidency implements JsonSerializable { + /* + * DataResidencyType enum + */ + private DataResidencyType type; + + /** + * Creates an instance of DataResidency class. + */ + public DataResidency() { + } + + /** + * Get the type property: DataResidencyType enum. + * + * @return the type value. + */ + public DataResidencyType type() { + return this.type; + } + + /** + * Set the type property: DataResidencyType enum. + * + * @param type the type value to set. + * @return the DataResidency object itself. + */ + public DataResidency withType(DataResidencyType type) { + this.type = type; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DataResidency from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DataResidency if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the DataResidency. + */ + public static DataResidency fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DataResidency deserializedDataResidency = new DataResidency(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("type".equals(fieldName)) { + deserializedDataResidency.type = DataResidencyType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedDataResidency; + }); + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/DataResidencyType.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/DataResidencyType.java new file mode 100644 index 000000000000..c0ec42ad5b0c --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/DataResidencyType.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.databoxedge.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * DataResidencyType enum. + */ +public final class DataResidencyType extends ExpandableStringEnum { + /** + * GeoZoneReplication. + */ + public static final DataResidencyType GEO_ZONE_REPLICATION = fromString("GeoZoneReplication"); + + /** + * ZoneReplication. + */ + public static final DataResidencyType ZONE_REPLICATION = fromString("ZoneReplication"); + + /** + * Creates a new instance of DataResidencyType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public DataResidencyType() { + } + + /** + * Creates or finds a DataResidencyType from its string representation. + * + * @param name a name to look for. + * @return the corresponding DataResidencyType. + */ + public static DataResidencyType fromString(String name) { + return fromString(name, DataResidencyType.class); + } + + /** + * Gets known DataResidencyType values. + * + * @return known DataResidencyType values. + */ + public static Collection values() { + return values(DataResidencyType.class); + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/DayOfWeek.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/DayOfWeek.java index da3ac75de3e0..a6dca54ddd90 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/DayOfWeek.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/DayOfWeek.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.models; @@ -12,37 +12,37 @@ */ public final class DayOfWeek extends ExpandableStringEnum { /** - * Static value Sunday for DayOfWeek. + * Sunday. */ public static final DayOfWeek SUNDAY = fromString("Sunday"); /** - * Static value Monday for DayOfWeek. + * Monday. */ public static final DayOfWeek MONDAY = fromString("Monday"); /** - * Static value Tuesday for DayOfWeek. + * Tuesday. */ public static final DayOfWeek TUESDAY = fromString("Tuesday"); /** - * Static value Wednesday for DayOfWeek. + * Wednesday. */ public static final DayOfWeek WEDNESDAY = fromString("Wednesday"); /** - * Static value Thursday for DayOfWeek. + * Thursday. */ public static final DayOfWeek THURSDAY = fromString("Thursday"); /** - * Static value Friday for DayOfWeek. + * Friday. */ public static final DayOfWeek FRIDAY = fromString("Friday"); /** - * Static value Saturday for DayOfWeek. + * Saturday. */ public static final DayOfWeek SATURDAY = fromString("Saturday"); diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/DeviceCapacityChecks.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/DeviceCapacityChecks.java new file mode 100644 index 000000000000..6f85ad78e704 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/DeviceCapacityChecks.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.databoxedge.models; + +import com.azure.core.util.Context; + +/** + * Resource collection API of DeviceCapacityChecks. + */ +public interface DeviceCapacityChecks { + /** + * Posts the device capacity request info to check feasibility. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @param deviceCapacityRequestInfo The device capacity request info. + * @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 checkResourceCreationFeasibility(String resourceGroupName, String deviceName, + DeviceCapacityRequestInfo deviceCapacityRequestInfo); + + /** + * Posts the device capacity request info to check feasibility. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @param deviceCapacityRequestInfo The device capacity request info. + * @param capacityName The capacity name. + * @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. + */ + void checkResourceCreationFeasibility(String resourceGroupName, String deviceName, + DeviceCapacityRequestInfo deviceCapacityRequestInfo, String capacityName, Context context); +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/DeviceCapacityInfo.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/DeviceCapacityInfo.java new file mode 100644 index 000000000000..935bc7e7434e --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/DeviceCapacityInfo.java @@ -0,0 +1,78 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.databoxedge.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.databoxedge.fluent.models.DeviceCapacityInfoInner; +import java.time.OffsetDateTime; +import java.util.Map; + +/** + * An immutable client-side representation of DeviceCapacityInfo. + */ +public interface DeviceCapacityInfo { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the timeStamp property: Timestamp of request in UTC. + * + * @return the timeStamp value. + */ + OffsetDateTime timeStamp(); + + /** + * Gets the clusterStorageCapacityInfo property: Cluster capacity data for storage resources (CSV). + * + * @return the clusterStorageCapacityInfo value. + */ + ClusterStorageViewData clusterStorageCapacityInfo(); + + /** + * Gets the clusterComputeCapacityInfo property: Cluster capacity data for compute resources (Memory and GPU). + * + * @return the clusterComputeCapacityInfo value. + */ + ClusterCapacityViewData clusterComputeCapacityInfo(); + + /** + * Gets the nodeCapacityInfos property: The dictionary of individual node names and node capacities in the cluster. + * + * @return the nodeCapacityInfos value. + */ + Map nodeCapacityInfos(); + + /** + * Gets the inner com.azure.resourcemanager.databoxedge.fluent.models.DeviceCapacityInfoInner object. + * + * @return the inner object. + */ + DeviceCapacityInfoInner innerModel(); +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/DeviceCapacityInfoes.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/DeviceCapacityInfoes.java new file mode 100644 index 000000000000..6d02736824ef --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/DeviceCapacityInfoes.java @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.databoxedge.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of DeviceCapacityInfoes. + */ +public interface DeviceCapacityInfoes { + /** + * Gets the properties of the specified device capacity info. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @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 properties of the specified device capacity info along with {@link Response}. + */ + Response getDeviceCapacityInfoWithResponse(String resourceGroupName, String deviceName, + Context context); + + /** + * Gets the properties of the specified device capacity info. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @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 properties of the specified device capacity info. + */ + DeviceCapacityInfo getDeviceCapacityInfo(String resourceGroupName, String deviceName); +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/DeviceCapacityRequestInfo.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/DeviceCapacityRequestInfo.java new file mode 100644 index 000000000000..14c21e795781 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/DeviceCapacityRequestInfo.java @@ -0,0 +1,128 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.databoxedge.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.databoxedge.fluent.models.DeviceCapacityRequestInfoProperties; +import java.io.IOException; +import java.util.List; + +/** + * Object for Capturing DeviceCapacityRequestInfo. + */ +@Fluent +public final class DeviceCapacityRequestInfo implements JsonSerializable { + /* + * The properties of the Device Capacity Request. + */ + private DeviceCapacityRequestInfoProperties innerProperties = new DeviceCapacityRequestInfoProperties(); + + /** + * Creates an instance of DeviceCapacityRequestInfo class. + */ + public DeviceCapacityRequestInfo() { + } + + /** + * Get the innerProperties property: The properties of the Device Capacity Request. + * + * @return the innerProperties value. + */ + private DeviceCapacityRequestInfoProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the vmPlacementQuery property: Array containing the sizes of the VMs for checking if its feasible to create + * them on the appliance. + * + * @return the vmPlacementQuery value. + */ + public List> vmPlacementQuery() { + return this.innerProperties() == null ? null : this.innerProperties().vmPlacementQuery(); + } + + /** + * Set the vmPlacementQuery property: Array containing the sizes of the VMs for checking if its feasible to create + * them on the appliance. + * + * @param vmPlacementQuery the vmPlacementQuery value to set. + * @return the DeviceCapacityRequestInfo object itself. + */ + public DeviceCapacityRequestInfo withVmPlacementQuery(List> vmPlacementQuery) { + if (this.innerProperties() == null) { + this.innerProperties = new DeviceCapacityRequestInfoProperties(); + } + this.innerProperties().withVmPlacementQuery(vmPlacementQuery); + return this; + } + + /** + * Get the vmPlacementResults property: Array of the VMs of the sizes in VmSizes can be provisioned on the + * appliance. + * + * @return the vmPlacementResults value. + */ + public List vmPlacementResults() { + return this.innerProperties() == null ? null : this.innerProperties().vmPlacementResults(); + } + + /** + * Set the vmPlacementResults property: Array of the VMs of the sizes in VmSizes can be provisioned on the + * appliance. + * + * @param vmPlacementResults the vmPlacementResults value to set. + * @return the DeviceCapacityRequestInfo object itself. + */ + public DeviceCapacityRequestInfo withVmPlacementResults(List vmPlacementResults) { + if (this.innerProperties() == null) { + this.innerProperties = new DeviceCapacityRequestInfoProperties(); + } + this.innerProperties().withVmPlacementResults(vmPlacementResults); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DeviceCapacityRequestInfo from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DeviceCapacityRequestInfo if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the DeviceCapacityRequestInfo. + */ + public static DeviceCapacityRequestInfo fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DeviceCapacityRequestInfo deserializedDeviceCapacityRequestInfo = new DeviceCapacityRequestInfo(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("properties".equals(fieldName)) { + deserializedDeviceCapacityRequestInfo.innerProperties + = DeviceCapacityRequestInfoProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedDeviceCapacityRequestInfo; + }); + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/DeviceType.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/DeviceType.java index fb5b46d36786..754ef54f64ce 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/DeviceType.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/DeviceType.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.models; @@ -12,7 +12,7 @@ */ public final class DeviceType extends ExpandableStringEnum { /** - * Static value DataBoxEdgeDevice for DeviceType. + * DataBoxEdgeDevice. */ public static final DeviceType DATA_BOX_EDGE_DEVICE = fromString("DataBoxEdgeDevice"); diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/Devices.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/Devices.java index 0afba3925380..162055b615fe 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/Devices.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/Devices.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.models; @@ -13,60 +13,35 @@ */ public interface Devices { /** - * Gets all the Data Box Edge/Data Box Gateway devices in a subscription. - * - * @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 all the Data Box Edge/Data Box Gateway devices in a subscription as paginated response with - * {@link PagedIterable}. - */ - PagedIterable list(); - - /** - * Gets all the Data Box Edge/Data Box Gateway devices in a subscription. + * Gets the network settings of the specified Data Box Edge/Data Box Gateway device. * - * @param expand Specify $expand=details to populate additional fields related to the resource or Specify - * $skipToken=<token> to populate the next page in the list. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. * @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 all the Data Box Edge/Data Box Gateway devices in a subscription as paginated response with - * {@link PagedIterable}. - */ - PagedIterable list(String expand, Context context); - - /** - * Gets all the Data Box Edge/Data Box Gateway devices in a resource group. - * - * @param resourceGroupName The resource group name. - * @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 all the Data Box Edge/Data Box Gateway devices in a resource group as paginated response with - * {@link PagedIterable}. + * @return the network settings of the specified Data Box Edge/Data Box Gateway device along with {@link Response}. */ - PagedIterable listByResourceGroup(String resourceGroupName); + Response getNetworkSettingsWithResponse(String resourceGroupName, String deviceName, + Context context); /** - * Gets all the Data Box Edge/Data Box Gateway devices in a resource group. + * Gets the network settings of the specified Data Box Edge/Data Box Gateway device. * - * @param resourceGroupName The resource group name. - * @param expand Specify $expand=details to populate additional fields related to the resource or Specify - * $skipToken=<token> to populate the next page in the list. - * @param context The context to associate with this operation. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. * @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 all the Data Box Edge/Data Box Gateway devices in a resource group as paginated response with - * {@link PagedIterable}. + * @return the network settings of the specified Data Box Edge/Data Box Gateway device. */ - PagedIterable listByResourceGroup(String resourceGroupName, String expand, Context context); + NetworkSettings getNetworkSettings(String resourceGroupName, String deviceName); /** * Gets the properties of the Data Box Edge/Data Box Gateway device. * - * @param resourceGroupName The resource group name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -80,7 +55,7 @@ Response getByResourceGroupWithResponse(String resourceGroupN /** * Gets the properties of the Data Box Edge/Data Box Gateway device. * - * @param resourceGroupName The resource group name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -92,7 +67,7 @@ Response getByResourceGroupWithResponse(String resourceGroupN /** * Deletes the Data Box Edge/Data Box Gateway device. * - * @param resourceGroupName The resource group name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -103,7 +78,7 @@ Response getByResourceGroupWithResponse(String resourceGroupN /** * Deletes the Data Box Edge/Data Box Gateway device. * - * @param resourceGroupName The resource group name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -112,187 +87,240 @@ Response getByResourceGroupWithResponse(String resourceGroupN */ void delete(String resourceGroupName, String deviceName, Context context); + /** + * Gets all the Data Box Edge/Data Box Gateway devices in a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 all the Data Box Edge/Data Box Gateway devices in a resource group as paginated response with + * {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Gets all the Data Box Edge/Data Box Gateway devices in a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param expand Specify $expand=details to populate additional fields related to the resource or Specify + * $skipToken=<token> to populate the next page in the list. + * @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 all the Data Box Edge/Data Box Gateway devices in a resource group as paginated response with + * {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, String expand, Context context); + + /** + * Gets all the Data Box Edge/Data Box Gateway devices in a subscription. + * + * @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 all the Data Box Edge/Data Box Gateway devices in a subscription as paginated response with + * {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * Gets all the Data Box Edge/Data Box Gateway devices in a subscription. + * + * @param expand Specify $expand=details to populate additional fields related to the resource or Specify + * $skipToken=<token> to populate the next page in the list. + * @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 all the Data Box Edge/Data Box Gateway devices in a subscription as paginated response with + * {@link PagedIterable}. + */ + PagedIterable list(String expand, Context context); + /** * Downloads the updates on a Data Box Edge/Data Box Gateway device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param resourceGroupName The resource group name. * @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 downloadUpdates(String deviceName, String resourceGroupName); + void downloadUpdates(String resourceGroupName, String deviceName); /** * Downloads the updates on a Data Box Edge/Data Box Gateway device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param resourceGroupName The resource group name. * @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. */ - void downloadUpdates(String deviceName, String resourceGroupName, Context context); + void downloadUpdates(String resourceGroupName, String deviceName, Context context); /** - * Gets additional information for the specified Data Box Edge/Data Box Gateway device. + * Generates certificate for activation key. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param resourceGroupName The resource group name. * @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 additional information for the specified Data Box Edge/Data Box Gateway device along with - * {@link Response}. + * @return used in activation key generation flow along with {@link Response}. */ - Response getExtendedInformationWithResponse(String deviceName, - String resourceGroupName, Context context); + Response generateCertificateWithResponse(String resourceGroupName, String deviceName, + Context context); /** - * Gets additional information for the specified Data Box Edge/Data Box Gateway device. + * Generates certificate for activation key. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param resourceGroupName The resource group name. * @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 additional information for the specified Data Box Edge/Data Box Gateway device. + * @return used in activation key generation flow. */ - DataBoxEdgeDeviceExtendedInfo getExtendedInformation(String deviceName, String resourceGroupName); + GenerateCertResponse generateCertificate(String resourceGroupName, String deviceName); /** - * Installs the updates on the Data Box Edge/Data Box Gateway device. + * Gets additional information for the specified Azure Stack Edge/Data Box Gateway device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param resourceGroupName The resource group name. + * @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 additional information for the specified Azure Stack Edge/Data Box Gateway device along with + * {@link Response}. */ - void installUpdates(String deviceName, String resourceGroupName); + Response getExtendedInformationWithResponse(String resourceGroupName, + String deviceName, Context context); /** - * Installs the updates on the Data Box Edge/Data Box Gateway device. + * Gets additional information for the specified Azure Stack Edge/Data Box Gateway device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param resourceGroupName The resource group name. - * @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 additional information for the specified Azure Stack Edge/Data Box Gateway device. */ - void installUpdates(String deviceName, String resourceGroupName, Context context); + DataBoxEdgeDeviceExtendedInfo getExtendedInformation(String resourceGroupName, String deviceName); /** - * Gets the network settings of the specified Data Box Edge/Data Box Gateway device. + * Installs the updates on the Data Box Edge/Data Box Gateway device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param resourceGroupName The resource group name. - * @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 network settings of the specified Data Box Edge/Data Box Gateway device along with {@link Response}. */ - Response getNetworkSettingsWithResponse(String deviceName, String resourceGroupName, - Context context); + void installUpdates(String resourceGroupName, String deviceName); /** - * Gets the network settings of the specified Data Box Edge/Data Box Gateway device. + * Installs the updates on the Data Box Edge/Data Box Gateway device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param resourceGroupName The resource group name. + * @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 network settings of the specified Data Box Edge/Data Box Gateway device. */ - NetworkSettings getNetworkSettings(String deviceName, String resourceGroupName); + void installUpdates(String resourceGroupName, String deviceName, Context context); /** * Scans for updates on a Data Box Edge/Data Box Gateway device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param resourceGroupName The resource group name. * @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 scanForUpdates(String deviceName, String resourceGroupName); + void scanForUpdates(String resourceGroupName, String deviceName); /** * Scans for updates on a Data Box Edge/Data Box Gateway device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param resourceGroupName The resource group name. * @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. */ - void scanForUpdates(String deviceName, String resourceGroupName, Context context); + void scanForUpdates(String resourceGroupName, String deviceName, Context context); /** * Updates the security settings on a Data Box Edge/Data Box Gateway device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param resourceGroupName The resource group name. * @param securitySettings The security settings. * @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 createOrUpdateSecuritySettings(String deviceName, String resourceGroupName, SecuritySettings securitySettings); + void createOrUpdateSecuritySettings(String resourceGroupName, String deviceName, SecuritySettings securitySettings); /** * Updates the security settings on a Data Box Edge/Data Box Gateway device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param resourceGroupName The resource group name. * @param securitySettings The security settings. * @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. */ - void createOrUpdateSecuritySettings(String deviceName, String resourceGroupName, SecuritySettings securitySettings, + void createOrUpdateSecuritySettings(String resourceGroupName, String deviceName, SecuritySettings securitySettings, Context context); /** - * Gets information about the availability of updates based on the last scan of the device. It also gets information - * about any ongoing download or install jobs on the device. + * Gets additional information for the specified Data Box Edge/Data Box Gateway device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param resourceGroupName The resource group name. + * @param parameters The patch object. * @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 availability of updates based on the last scan of the device along with + * @return additional information for the specified Data Box Edge/Data Box Gateway device along with * {@link Response}. */ - Response getUpdateSummaryWithResponse(String deviceName, String resourceGroupName, Context context); + Response updateExtendedInformationWithResponse(String resourceGroupName, + String deviceName, DataBoxEdgeDeviceExtendedInfoPatch parameters, Context context); /** - * Gets information about the availability of updates based on the last scan of the device. It also gets information - * about any ongoing download or install jobs on the device. + * Gets additional information for the specified Data Box Edge/Data Box Gateway device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param resourceGroupName The resource group name. + * @param parameters The patch object. * @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 availability of updates based on the last scan of the device. + * @return additional information for the specified Data Box Edge/Data Box Gateway device. */ - UpdateSummary getUpdateSummary(String deviceName, String resourceGroupName); + DataBoxEdgeDeviceExtendedInfo updateExtendedInformation(String resourceGroupName, String deviceName, + DataBoxEdgeDeviceExtendedInfoPatch parameters); /** * Uploads registration certificate for the device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param resourceGroupName The resource group name. * @param parameters The upload certificate request. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -300,23 +328,51 @@ void createOrUpdateSecuritySettings(String deviceName, String resourceGroupName, * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the upload registration certificate response along with {@link Response}. */ - Response uploadCertificateWithResponse(String deviceName, String resourceGroupName, + Response uploadCertificateWithResponse(String resourceGroupName, String deviceName, UploadCertificateRequest parameters, Context context); /** * Uploads registration certificate for the device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param resourceGroupName The resource group name. * @param parameters The upload certificate 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 the upload registration certificate response. */ - UploadCertificateResponse uploadCertificate(String deviceName, String resourceGroupName, + UploadCertificateResponse uploadCertificate(String resourceGroupName, String deviceName, UploadCertificateRequest parameters); + /** + * Gets information about the availability of updates based on the last scan of the device. It also gets information + * about any ongoing download or install jobs on the device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @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 availability of updates based on the last scan of the device along with + * {@link Response}. + */ + Response getUpdateSummaryWithResponse(String resourceGroupName, String deviceName, Context context); + + /** + * Gets information about the availability of updates based on the last scan of the device. It also gets information + * about any ongoing download or install jobs on the device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @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 availability of updates based on the last scan of the device. + */ + UpdateSummary getUpdateSummary(String resourceGroupName, String deviceName); + /** * Gets the properties of the Data Box Edge/Data Box Gateway device. * diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/DiagnosticProactiveLogCollectionSettings.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/DiagnosticProactiveLogCollectionSettings.java new file mode 100644 index 000000000000..6c3bca16fe1a --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/DiagnosticProactiveLogCollectionSettings.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.databoxedge.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.databoxedge.fluent.models.DiagnosticProactiveLogCollectionSettingsInner; + +/** + * An immutable client-side representation of DiagnosticProactiveLogCollectionSettings. + */ +public interface DiagnosticProactiveLogCollectionSettings { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the userConsent property: Proactive diagnostic collection consent flag. + * + * @return the userConsent value. + */ + ProactiveDiagnosticsConsent userConsent(); + + /** + * Gets the inner com.azure.resourcemanager.databoxedge.fluent.models.DiagnosticProactiveLogCollectionSettingsInner + * object. + * + * @return the inner object. + */ + DiagnosticProactiveLogCollectionSettingsInner innerModel(); +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/DiagnosticRemoteSupportSettings.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/DiagnosticRemoteSupportSettings.java new file mode 100644 index 000000000000..cbb6d2938e08 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/DiagnosticRemoteSupportSettings.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.databoxedge.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.databoxedge.fluent.models.DiagnosticRemoteSupportSettingsInner; +import java.util.List; + +/** + * An immutable client-side representation of DiagnosticRemoteSupportSettings. + */ +public interface DiagnosticRemoteSupportSettings { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the remoteSupportSettingsList property: Remote support settings list according to the RemoteApplicationType. + * + * @return the remoteSupportSettingsList value. + */ + List remoteSupportSettingsList(); + + /** + * Gets the inner com.azure.resourcemanager.databoxedge.fluent.models.DiagnosticRemoteSupportSettingsInner object. + * + * @return the inner object. + */ + DiagnosticRemoteSupportSettingsInner innerModel(); +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/DiagnosticSettings.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/DiagnosticSettings.java new file mode 100644 index 000000000000..a061e1ac35cc --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/DiagnosticSettings.java @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.databoxedge.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.databoxedge.fluent.models.DiagnosticProactiveLogCollectionSettingsInner; +import com.azure.resourcemanager.databoxedge.fluent.models.DiagnosticRemoteSupportSettingsInner; + +/** + * Resource collection API of DiagnosticSettings. + */ +public interface DiagnosticSettings { + /** + * Gets the proactive log collection settings of the specified Data Box Edge/Data Box Gateway device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @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 proactive log collection settings of the specified Data Box Edge/Data Box Gateway device along with + * {@link Response}. + */ + Response getDiagnosticProactiveLogCollectionSettingsWithResponse( + String resourceGroupName, String deviceName, Context context); + + /** + * Gets the proactive log collection settings of the specified Data Box Edge/Data Box Gateway device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @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 proactive log collection settings of the specified Data Box Edge/Data Box Gateway device. + */ + DiagnosticProactiveLogCollectionSettings getDiagnosticProactiveLogCollectionSettings(String resourceGroupName, + String deviceName); + + /** + * Updates the proactive log collection settings on a Data Box Edge/Data Box Gateway device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @param proactiveLogCollectionSettings The proactive log collection settings. + * @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 diagnostic proactive log collection settings of a device. + */ + DiagnosticProactiveLogCollectionSettings updateDiagnosticProactiveLogCollectionSettings(String resourceGroupName, + String deviceName, DiagnosticProactiveLogCollectionSettingsInner proactiveLogCollectionSettings); + + /** + * Updates the proactive log collection settings on a Data Box Edge/Data Box Gateway device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @param proactiveLogCollectionSettings The proactive log collection settings. + * @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 diagnostic proactive log collection settings of a device. + */ + DiagnosticProactiveLogCollectionSettings updateDiagnosticProactiveLogCollectionSettings(String resourceGroupName, + String deviceName, DiagnosticProactiveLogCollectionSettingsInner proactiveLogCollectionSettings, + Context context); + + /** + * Gets the diagnostic remote support settings of the specified Data Box Edge/Data Box Gateway device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @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 diagnostic remote support settings of the specified Data Box Edge/Data Box Gateway device along with + * {@link Response}. + */ + Response getDiagnosticRemoteSupportSettingsWithResponse(String resourceGroupName, + String deviceName, Context context); + + /** + * Gets the diagnostic remote support settings of the specified Data Box Edge/Data Box Gateway device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @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 diagnostic remote support settings of the specified Data Box Edge/Data Box Gateway device. + */ + DiagnosticRemoteSupportSettings getDiagnosticRemoteSupportSettings(String resourceGroupName, String deviceName); + + /** + * Updates the diagnostic remote support settings on a Data Box Edge/Data Box Gateway device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @param diagnosticRemoteSupportSettings The diagnostic remote support settings. + * @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 remote support settings of a device. + */ + DiagnosticRemoteSupportSettings updateDiagnosticRemoteSupportSettings(String resourceGroupName, String deviceName, + DiagnosticRemoteSupportSettingsInner diagnosticRemoteSupportSettings); + + /** + * Updates the diagnostic remote support settings on a Data Box Edge/Data Box Gateway device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @param diagnosticRemoteSupportSettings The diagnostic remote support settings. + * @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 remote support settings of a device. + */ + DiagnosticRemoteSupportSettings updateDiagnosticRemoteSupportSettings(String resourceGroupName, String deviceName, + DiagnosticRemoteSupportSettingsInner diagnosticRemoteSupportSettings, Context context); +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/DownloadPhase.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/DownloadPhase.java index 536318e93c4e..a358cebf7761 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/DownloadPhase.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/DownloadPhase.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.models; @@ -12,22 +12,22 @@ */ public final class DownloadPhase extends ExpandableStringEnum { /** - * Static value Unknown for DownloadPhase. + * Unknown. */ public static final DownloadPhase UNKNOWN = fromString("Unknown"); /** - * Static value Initializing for DownloadPhase. + * Initializing. */ public static final DownloadPhase INITIALIZING = fromString("Initializing"); /** - * Static value Downloading for DownloadPhase. + * Downloading. */ public static final DownloadPhase DOWNLOADING = fromString("Downloading"); /** - * Static value Verifying for DownloadPhase. + * Verifying. */ public static final DownloadPhase VERIFYING = fromString("Verifying"); diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/EdgeProfile.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/EdgeProfile.java new file mode 100644 index 000000000000..a212660a2295 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/EdgeProfile.java @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.databoxedge.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Details about Edge Profile for the resource. + */ +@Immutable +public final class EdgeProfile implements JsonSerializable { + /* + * Edge Profile Subscription + */ + private EdgeProfileSubscription subscription; + + /** + * Creates an instance of EdgeProfile class. + */ + private EdgeProfile() { + } + + /** + * Get the subscription property: Edge Profile Subscription. + * + * @return the subscription value. + */ + public EdgeProfileSubscription subscription() { + return this.subscription; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("subscription", this.subscription); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of EdgeProfile from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EdgeProfile if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the EdgeProfile. + */ + public static EdgeProfile fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + EdgeProfile deserializedEdgeProfile = new EdgeProfile(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("subscription".equals(fieldName)) { + deserializedEdgeProfile.subscription = EdgeProfileSubscription.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedEdgeProfile; + }); + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/EdgeProfilePatch.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/EdgeProfilePatch.java new file mode 100644 index 000000000000..487c51c8fa35 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/EdgeProfilePatch.java @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.databoxedge.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The Data Box Edge/Gateway Edge Profile patch. + */ +@Fluent +public final class EdgeProfilePatch implements JsonSerializable { + /* + * The Data Box Edge/Gateway Edge Profile Subscription patch + */ + private EdgeProfileSubscriptionPatch subscription; + + /** + * Creates an instance of EdgeProfilePatch class. + */ + public EdgeProfilePatch() { + } + + /** + * Get the subscription property: The Data Box Edge/Gateway Edge Profile Subscription patch. + * + * @return the subscription value. + */ + public EdgeProfileSubscriptionPatch subscription() { + return this.subscription; + } + + /** + * Set the subscription property: The Data Box Edge/Gateway Edge Profile Subscription patch. + * + * @param subscription the subscription value to set. + * @return the EdgeProfilePatch object itself. + */ + public EdgeProfilePatch withSubscription(EdgeProfileSubscriptionPatch subscription) { + this.subscription = subscription; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("subscription", this.subscription); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of EdgeProfilePatch from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EdgeProfilePatch if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the EdgeProfilePatch. + */ + public static EdgeProfilePatch fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + EdgeProfilePatch deserializedEdgeProfilePatch = new EdgeProfilePatch(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("subscription".equals(fieldName)) { + deserializedEdgeProfilePatch.subscription = EdgeProfileSubscriptionPatch.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedEdgeProfilePatch; + }); + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/EdgeProfileSubscription.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/EdgeProfileSubscription.java new file mode 100644 index 000000000000..c6a2a688f876 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/EdgeProfileSubscription.java @@ -0,0 +1,206 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.databoxedge.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.databoxedge.fluent.models.SubscriptionProperties; +import java.io.IOException; +import java.util.List; + +/** + * Subscription details for the Edge Profile. + */ +@Immutable +public final class EdgeProfileSubscription implements JsonSerializable { + /* + * Edge Subscription Registration ID + */ + private String registrationId; + + /* + * ARM ID of the subscription + */ + private String id; + + /* + * The state property. + */ + private SubscriptionState state; + + /* + * The registrationDate property. + */ + private String registrationDate; + + /* + * The subscriptionId property. + */ + private String subscriptionId; + + /* + * The properties property. + */ + private SubscriptionProperties innerProperties; + + /** + * Creates an instance of EdgeProfileSubscription class. + */ + private EdgeProfileSubscription() { + } + + /** + * Get the registrationId property: Edge Subscription Registration ID. + * + * @return the registrationId value. + */ + public String registrationId() { + return this.registrationId; + } + + /** + * Get the id property: ARM ID of the subscription. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Get the state property: The state property. + * + * @return the state value. + */ + public SubscriptionState state() { + return this.state; + } + + /** + * Get the registrationDate property: The registrationDate property. + * + * @return the registrationDate value. + */ + public String registrationDate() { + return this.registrationDate; + } + + /** + * Get the subscriptionId property: The subscriptionId property. + * + * @return the subscriptionId value. + */ + public String subscriptionId() { + return this.subscriptionId; + } + + /** + * Get the innerProperties property: The properties property. + * + * @return the innerProperties value. + */ + private SubscriptionProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the tenantId property: The tenantId property. + * + * @return the tenantId value. + */ + public String tenantId() { + return this.innerProperties() == null ? null : this.innerProperties().tenantId(); + } + + /** + * Get the locationPlacementId property: The locationPlacementId property. + * + * @return the locationPlacementId value. + */ + public String locationPlacementId() { + return this.innerProperties() == null ? null : this.innerProperties().locationPlacementId(); + } + + /** + * Get the quotaId property: The quotaId property. + * + * @return the quotaId value. + */ + public String quotaId() { + return this.innerProperties() == null ? null : this.innerProperties().quotaId(); + } + + /** + * Get the serializedDetails property: The serializedDetails property. + * + * @return the serializedDetails value. + */ + public String serializedDetails() { + return this.innerProperties() == null ? null : this.innerProperties().serializedDetails(); + } + + /** + * Get the registeredFeatures property: The registeredFeatures property. + * + * @return the registeredFeatures value. + */ + public List registeredFeatures() { + return this.innerProperties() == null ? null : this.innerProperties().registeredFeatures(); + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("registrationId", this.registrationId); + jsonWriter.writeStringField("id", this.id); + jsonWriter.writeStringField("state", this.state == null ? null : this.state.toString()); + jsonWriter.writeStringField("registrationDate", this.registrationDate); + jsonWriter.writeStringField("subscriptionId", this.subscriptionId); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of EdgeProfileSubscription from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EdgeProfileSubscription if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the EdgeProfileSubscription. + */ + public static EdgeProfileSubscription fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + EdgeProfileSubscription deserializedEdgeProfileSubscription = new EdgeProfileSubscription(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("registrationId".equals(fieldName)) { + deserializedEdgeProfileSubscription.registrationId = reader.getString(); + } else if ("id".equals(fieldName)) { + deserializedEdgeProfileSubscription.id = reader.getString(); + } else if ("state".equals(fieldName)) { + deserializedEdgeProfileSubscription.state = SubscriptionState.fromString(reader.getString()); + } else if ("registrationDate".equals(fieldName)) { + deserializedEdgeProfileSubscription.registrationDate = reader.getString(); + } else if ("subscriptionId".equals(fieldName)) { + deserializedEdgeProfileSubscription.subscriptionId = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedEdgeProfileSubscription.innerProperties = SubscriptionProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedEdgeProfileSubscription; + }); + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/EdgeProfileSubscriptionPatch.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/EdgeProfileSubscriptionPatch.java new file mode 100644 index 000000000000..1e7b214d2543 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/EdgeProfileSubscriptionPatch.java @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.databoxedge.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The Data Box Edge/Gateway Edge Profile Subscription patch. + */ +@Fluent +public final class EdgeProfileSubscriptionPatch implements JsonSerializable { + /* + * The path ID that uniquely identifies the subscription of the edge profile. + */ + private String id; + + /** + * Creates an instance of EdgeProfileSubscriptionPatch class. + */ + public EdgeProfileSubscriptionPatch() { + } + + /** + * Get the id property: The path ID that uniquely identifies the subscription of the edge profile. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: The path ID that uniquely identifies the subscription of the edge profile. + * + * @param id the id value to set. + * @return the EdgeProfileSubscriptionPatch object itself. + */ + public EdgeProfileSubscriptionPatch withId(String id) { + this.id = id; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", this.id); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of EdgeProfileSubscriptionPatch from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EdgeProfileSubscriptionPatch if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the EdgeProfileSubscriptionPatch. + */ + public static EdgeProfileSubscriptionPatch fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + EdgeProfileSubscriptionPatch deserializedEdgeProfileSubscriptionPatch = new EdgeProfileSubscriptionPatch(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedEdgeProfileSubscriptionPatch.id = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedEdgeProfileSubscriptionPatch; + }); + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/EncryptionAlgorithm.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/EncryptionAlgorithm.java index b5c58077e9a0..5b195593c3af 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/EncryptionAlgorithm.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/EncryptionAlgorithm.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.models; @@ -12,17 +12,17 @@ */ public final class EncryptionAlgorithm extends ExpandableStringEnum { /** - * Static value None for EncryptionAlgorithm. + * None. */ public static final EncryptionAlgorithm NONE = fromString("None"); /** - * Static value AES256 for EncryptionAlgorithm. + * AES256. */ public static final EncryptionAlgorithm AES256 = fromString("AES256"); /** - * Static value RSAES_PKCS1_v_1_5 for EncryptionAlgorithm. + * RSAES_PKCS1_v_1_5. */ public static final EncryptionAlgorithm RSAES_PKCS1_V_1_5 = fromString("RSAES_PKCS1_v_1_5"); diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/GenerateCertResponse.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/GenerateCertResponse.java new file mode 100644 index 000000000000..5e4790c52062 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/GenerateCertResponse.java @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.databoxedge.models; + +import com.azure.resourcemanager.databoxedge.fluent.models.GenerateCertResponseInner; + +/** + * An immutable client-side representation of GenerateCertResponse. + */ +public interface GenerateCertResponse { + /** + * Gets the publicKey property: Gets or sets base64 encoded certificate raw data, + * this is the public part needed to be uploaded to cert vault. + * + * @return the publicKey value. + */ + String publicKey(); + + /** + * Gets the privateKey property: Gets or sets base64 encoded private part of the certificate, + * needed to form the activation key. + * + * @return the privateKey value. + */ + String privateKey(); + + /** + * Gets the expiryTimeInUTC property: Gets or sets expiry time in UTC. + * + * @return the expiryTimeInUTC value. + */ + String expiryTimeInUTC(); + + /** + * Gets the inner com.azure.resourcemanager.databoxedge.fluent.models.GenerateCertResponseInner object. + * + * @return the inner object. + */ + GenerateCertResponseInner innerModel(); +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/HostCapacity.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/HostCapacity.java new file mode 100644 index 000000000000..920ac86305db --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/HostCapacity.java @@ -0,0 +1,165 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.databoxedge.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; +import java.util.Map; + +/** + * Host Capacity Data. + */ +@Immutable +public final class HostCapacity implements JsonSerializable { + /* + * The name of the host. + */ + private String hostName; + + /* + * The available memory on the host accounting for VM placement size and any host VM reservations. + */ + private Long effectiveAvailableMemoryMbOnHost; + + /* + * The available amount of GPUs on the host to use after accounting for GPUS used by reservations on the host. + */ + private Integer availableGpuCount; + + /* + * The VM used memory per VmId. + */ + private Map vmUsedMemory; + + /* + * The GPU type of the VM. + */ + private String gpuType; + + /* + * The numa nodes information for Hpn VMs. + */ + private List numaNodesData; + + /** + * Creates an instance of HostCapacity class. + */ + private HostCapacity() { + } + + /** + * Get the hostName property: The name of the host. + * + * @return the hostName value. + */ + public String hostName() { + return this.hostName; + } + + /** + * Get the effectiveAvailableMemoryMbOnHost property: The available memory on the host accounting for VM placement + * size and any host VM reservations. + * + * @return the effectiveAvailableMemoryMbOnHost value. + */ + public Long effectiveAvailableMemoryMbOnHost() { + return this.effectiveAvailableMemoryMbOnHost; + } + + /** + * Get the availableGpuCount property: The available amount of GPUs on the host to use after accounting for GPUS + * used by reservations on the host. + * + * @return the availableGpuCount value. + */ + public Integer availableGpuCount() { + return this.availableGpuCount; + } + + /** + * Get the vmUsedMemory property: The VM used memory per VmId. + * + * @return the vmUsedMemory value. + */ + public Map vmUsedMemory() { + return this.vmUsedMemory; + } + + /** + * Get the gpuType property: The GPU type of the VM. + * + * @return the gpuType value. + */ + public String gpuType() { + return this.gpuType; + } + + /** + * Get the numaNodesData property: The numa nodes information for Hpn VMs. + * + * @return the numaNodesData value. + */ + public List numaNodesData() { + return this.numaNodesData; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("hostName", this.hostName); + jsonWriter.writeNumberField("effectiveAvailableMemoryMbOnHost", this.effectiveAvailableMemoryMbOnHost); + jsonWriter.writeNumberField("availableGpuCount", this.availableGpuCount); + jsonWriter.writeMapField("vmUsedMemory", this.vmUsedMemory, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("gpuType", this.gpuType); + jsonWriter.writeArrayField("numaNodesData", this.numaNodesData, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of HostCapacity from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of HostCapacity if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the HostCapacity. + */ + public static HostCapacity fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + HostCapacity deserializedHostCapacity = new HostCapacity(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("hostName".equals(fieldName)) { + deserializedHostCapacity.hostName = reader.getString(); + } else if ("effectiveAvailableMemoryMbOnHost".equals(fieldName)) { + deserializedHostCapacity.effectiveAvailableMemoryMbOnHost = reader.getNullable(JsonReader::getLong); + } else if ("availableGpuCount".equals(fieldName)) { + deserializedHostCapacity.availableGpuCount = reader.getNullable(JsonReader::getInt); + } else if ("vmUsedMemory".equals(fieldName)) { + Map vmUsedMemory = reader.readMap(reader1 -> VmMemory.fromJson(reader1)); + deserializedHostCapacity.vmUsedMemory = vmUsedMemory; + } else if ("gpuType".equals(fieldName)) { + deserializedHostCapacity.gpuType = reader.getString(); + } else if ("numaNodesData".equals(fieldName)) { + List numaNodesData = reader.readArray(reader1 -> NumaNodeData.fromJson(reader1)); + deserializedHostCapacity.numaNodesData = numaNodesData; + } else { + reader.skipChildren(); + } + } + + return deserializedHostCapacity; + }); + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/InstallRebootBehavior.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/InstallRebootBehavior.java index 5d43d5ab49c6..2b56f12781a1 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/InstallRebootBehavior.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/InstallRebootBehavior.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.models; @@ -12,17 +12,17 @@ */ public final class InstallRebootBehavior extends ExpandableStringEnum { /** - * Static value NeverReboots for InstallRebootBehavior. + * NeverReboots. */ public static final InstallRebootBehavior NEVER_REBOOTS = fromString("NeverReboots"); /** - * Static value RequiresReboot for InstallRebootBehavior. + * RequiresReboot. */ public static final InstallRebootBehavior REQUIRES_REBOOT = fromString("RequiresReboot"); /** - * Static value RequestReboot for InstallRebootBehavior. + * RequestReboot. */ public static final InstallRebootBehavior REQUEST_REBOOT = fromString("RequestReboot"); diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/InstallationImpact.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/InstallationImpact.java new file mode 100644 index 000000000000..ece53aaa119e --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/InstallationImpact.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.databoxedge.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Impact of Installing an updateType. + */ +public final class InstallationImpact extends ExpandableStringEnum { + /** + * None. + */ + public static final InstallationImpact NONE = fromString("None"); + + /** + * DeviceRebooted. + */ + public static final InstallationImpact DEVICE_REBOOTED = fromString("DeviceRebooted"); + + /** + * KubernetesWorkloadsDown. + */ + public static final InstallationImpact KUBERNETES_WORKLOADS_DOWN = fromString("KubernetesWorkloadsDown"); + + /** + * Creates a new instance of InstallationImpact value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public InstallationImpact() { + } + + /** + * Creates or finds a InstallationImpact from its string representation. + * + * @param name a name to look for. + * @return the corresponding InstallationImpact. + */ + public static InstallationImpact fromString(String name) { + return fromString(name, InstallationImpact.class); + } + + /** + * Gets known InstallationImpact values. + * + * @return known InstallationImpact values. + */ + public static Collection values() { + return values(InstallationImpact.class); + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/Ipv4Config.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/Ipv4Config.java index 62d19b5c69be..19e4256318ae 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/Ipv4Config.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/Ipv4Config.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.models; @@ -34,7 +34,7 @@ public final class Ipv4Config implements JsonSerializable { /** * Creates an instance of Ipv4Config class. */ - public Ipv4Config() { + private Ipv4Config() { } /** @@ -64,14 +64,6 @@ public String gateway() { return this.gateway; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/Ipv6Config.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/Ipv6Config.java index e85dee77348e..8b06cab220d2 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/Ipv6Config.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/Ipv6Config.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.models; @@ -34,7 +34,7 @@ public final class Ipv6Config implements JsonSerializable { /** * Creates an instance of Ipv6Config class. */ - public Ipv6Config() { + private Ipv6Config() { } /** @@ -64,14 +64,6 @@ public String gateway() { return this.gateway; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/Job.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/Job.java index 6d039ae8f28f..1ca124757c9e 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/Job.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/Job.java @@ -1,9 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.models; +import com.azure.core.management.SystemData; import com.azure.resourcemanager.databoxedge.fluent.models.JobInner; import java.time.OffsetDateTime; @@ -12,21 +13,21 @@ */ public interface Job { /** - * Gets the id property: The path ID that uniquely identifies the object. + * Gets the id property: Fully qualified resource Id for the resource. * * @return the id value. */ String id(); /** - * Gets the name property: The name of the object. + * Gets the name property: The name of the resource. * * @return the name value. */ String name(); /** - * Gets the type property: The hierarchical type of the object. + * Gets the type property: The type of the resource. * * @return the type value. */ @@ -67,6 +68,13 @@ public interface Job { */ JobErrorDetails error(); + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + /** * Gets the jobType property: The type of the job. * diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/JobErrorDetails.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/JobErrorDetails.java index a3a70c158926..ddda662f42c5 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/JobErrorDetails.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/JobErrorDetails.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.models; @@ -35,7 +35,7 @@ public final class JobErrorDetails implements JsonSerializable /** * Creates an instance of JobErrorDetails class. */ - public JobErrorDetails() { + private JobErrorDetails() { } /** @@ -65,17 +65,6 @@ public String message() { return this.message; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (errorDetails() != null) { - errorDetails().forEach(e -> e.validate()); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/JobErrorItem.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/JobErrorItem.java index 38265fb26b8c..826caa4735f7 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/JobErrorItem.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/JobErrorItem.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.models; @@ -35,7 +35,7 @@ public final class JobErrorItem implements JsonSerializable { /** * Creates an instance of JobErrorItem class. */ - public JobErrorItem() { + private JobErrorItem() { } /** @@ -65,14 +65,6 @@ public String message() { return this.message; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/JobStatus.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/JobStatus.java index 33c37b87b204..92179b68fcfa 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/JobStatus.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/JobStatus.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.models; @@ -12,37 +12,37 @@ */ public final class JobStatus extends ExpandableStringEnum { /** - * Static value Invalid for JobStatus. + * Invalid. */ public static final JobStatus INVALID = fromString("Invalid"); /** - * Static value Running for JobStatus. + * Running. */ public static final JobStatus RUNNING = fromString("Running"); /** - * Static value Succeeded for JobStatus. + * Succeeded. */ public static final JobStatus SUCCEEDED = fromString("Succeeded"); /** - * Static value Failed for JobStatus. + * Failed. */ public static final JobStatus FAILED = fromString("Failed"); /** - * Static value Canceled for JobStatus. + * Canceled. */ public static final JobStatus CANCELED = fromString("Canceled"); /** - * Static value Paused for JobStatus. + * Paused. */ public static final JobStatus PAUSED = fromString("Paused"); /** - * Static value Scheduled for JobStatus. + * Scheduled. */ public static final JobStatus SCHEDULED = fromString("Scheduled"); diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/JobType.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/JobType.java index 8db496051d67..4a1a0921b0ef 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/JobType.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/JobType.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.models; @@ -12,35 +12,50 @@ */ public final class JobType extends ExpandableStringEnum { /** - * Static value Invalid for JobType. + * Invalid. */ public static final JobType INVALID = fromString("Invalid"); /** - * Static value ScanForUpdates for JobType. + * ScanForUpdates. */ public static final JobType SCAN_FOR_UPDATES = fromString("ScanForUpdates"); /** - * Static value DownloadUpdates for JobType. + * DownloadUpdates. */ public static final JobType DOWNLOAD_UPDATES = fromString("DownloadUpdates"); /** - * Static value InstallUpdates for JobType. + * InstallUpdates. */ public static final JobType INSTALL_UPDATES = fromString("InstallUpdates"); /** - * Static value RefreshShare for JobType. + * RefreshShare. */ public static final JobType REFRESH_SHARE = fromString("RefreshShare"); /** - * Static value RefreshContainer for JobType. + * RefreshContainer. */ public static final JobType REFRESH_CONTAINER = fromString("RefreshContainer"); + /** + * Backup. + */ + public static final JobType BACKUP = fromString("Backup"); + + /** + * Restore. + */ + public static final JobType RESTORE = fromString("Restore"); + + /** + * TriggerSupportPackage. + */ + public static final JobType TRIGGER_SUPPORT_PACKAGE = fromString("TriggerSupportPackage"); + /** * Creates a new instance of JobType value. * diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/Jobs.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/Jobs.java index 44f01a61b79e..2fa7efa13207 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/Jobs.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/Jobs.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.models; @@ -14,27 +14,27 @@ public interface Jobs { /** * Gets the details of a specified job on a Data Box Edge/Data Box Gateway device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. * @param name The job name. - * @param resourceGroupName The resource group name. * @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 details of a specified job on a Data Box Edge/Data Box Gateway device along with {@link Response}. */ - Response getWithResponse(String deviceName, String name, String resourceGroupName, Context context); + Response getWithResponse(String resourceGroupName, String deviceName, String name, Context context); /** * Gets the details of a specified job on a Data Box Edge/Data Box Gateway device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. * @param name The job name. - * @param resourceGroupName The resource group name. * @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 details of a specified job on a Data Box Edge/Data Box Gateway device. */ - Job get(String deviceName, String name, String resourceGroupName); + Job get(String resourceGroupName, String deviceName, String name); } diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/KeyVaultSyncStatus.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/KeyVaultSyncStatus.java new file mode 100644 index 000000000000..7819a2b103cd --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/KeyVaultSyncStatus.java @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.databoxedge.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * For changing or to initiate the resync to key-vault set the status to KeyVaultSyncPending, rest of the status will + * not be applicable. + */ +public final class KeyVaultSyncStatus extends ExpandableStringEnum { + /** + * KeyVaultSynced. + */ + public static final KeyVaultSyncStatus KEY_VAULT_SYNCED = fromString("KeyVaultSynced"); + + /** + * KeyVaultSyncFailed. + */ + public static final KeyVaultSyncStatus KEY_VAULT_SYNC_FAILED = fromString("KeyVaultSyncFailed"); + + /** + * KeyVaultNotConfigured. + */ + public static final KeyVaultSyncStatus KEY_VAULT_NOT_CONFIGURED = fromString("KeyVaultNotConfigured"); + + /** + * KeyVaultSyncPending. + */ + public static final KeyVaultSyncStatus KEY_VAULT_SYNC_PENDING = fromString("KeyVaultSyncPending"); + + /** + * KeyVaultSyncing. + */ + public static final KeyVaultSyncStatus KEY_VAULT_SYNCING = fromString("KeyVaultSyncing"); + + /** + * KeyVaultNotSynced. + */ + public static final KeyVaultSyncStatus KEY_VAULT_NOT_SYNCED = fromString("KeyVaultNotSynced"); + + /** + * Creates a new instance of KeyVaultSyncStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public KeyVaultSyncStatus() { + } + + /** + * Creates or finds a KeyVaultSyncStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding KeyVaultSyncStatus. + */ + public static KeyVaultSyncStatus fromString(String name) { + return fromString(name, KeyVaultSyncStatus.class); + } + + /** + * Gets known KeyVaultSyncStatus values. + * + * @return known KeyVaultSyncStatus values. + */ + public static Collection values() { + return values(KeyVaultSyncStatus.class); + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/MetricConfiguration.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/MetricConfiguration.java new file mode 100644 index 000000000000..435e6b4d778a --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/MetricConfiguration.java @@ -0,0 +1,175 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.databoxedge.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Metric configuration. + */ +@Fluent +public final class MetricConfiguration implements JsonSerializable { + /* + * The Resource ID on which the metrics should be pushed. + */ + private String resourceId; + + /* + * The MDM account to which the counters should be pushed. + */ + private String mdmAccount; + + /* + * The MDM namespace to which the counters should be pushed. This is required if MDMAccount is specified + */ + private String metricNameSpace; + + /* + * Host name for the IoT hub associated to the device. + */ + private List counterSets; + + /** + * Creates an instance of MetricConfiguration class. + */ + public MetricConfiguration() { + } + + /** + * Get the resourceId property: The Resource ID on which the metrics should be pushed. + * + * @return the resourceId value. + */ + public String resourceId() { + return this.resourceId; + } + + /** + * Set the resourceId property: The Resource ID on which the metrics should be pushed. + * + * @param resourceId the resourceId value to set. + * @return the MetricConfiguration object itself. + */ + public MetricConfiguration withResourceId(String resourceId) { + this.resourceId = resourceId; + return this; + } + + /** + * Get the mdmAccount property: The MDM account to which the counters should be pushed. + * + * @return the mdmAccount value. + */ + public String mdmAccount() { + return this.mdmAccount; + } + + /** + * Set the mdmAccount property: The MDM account to which the counters should be pushed. + * + * @param mdmAccount the mdmAccount value to set. + * @return the MetricConfiguration object itself. + */ + public MetricConfiguration withMdmAccount(String mdmAccount) { + this.mdmAccount = mdmAccount; + return this; + } + + /** + * Get the metricNameSpace property: The MDM namespace to which the counters should be pushed. This is required if + * MDMAccount is specified. + * + * @return the metricNameSpace value. + */ + public String metricNameSpace() { + return this.metricNameSpace; + } + + /** + * Set the metricNameSpace property: The MDM namespace to which the counters should be pushed. This is required if + * MDMAccount is specified. + * + * @param metricNameSpace the metricNameSpace value to set. + * @return the MetricConfiguration object itself. + */ + public MetricConfiguration withMetricNameSpace(String metricNameSpace) { + this.metricNameSpace = metricNameSpace; + return this; + } + + /** + * Get the counterSets property: Host name for the IoT hub associated to the device. + * + * @return the counterSets value. + */ + public List counterSets() { + return this.counterSets; + } + + /** + * Set the counterSets property: Host name for the IoT hub associated to the device. + * + * @param counterSets the counterSets value to set. + * @return the MetricConfiguration object itself. + */ + public MetricConfiguration withCounterSets(List counterSets) { + this.counterSets = counterSets; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("resourceId", this.resourceId); + jsonWriter.writeArrayField("counterSets", this.counterSets, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("mdmAccount", this.mdmAccount); + jsonWriter.writeStringField("metricNameSpace", this.metricNameSpace); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MetricConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MetricConfiguration if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the MetricConfiguration. + */ + public static MetricConfiguration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MetricConfiguration deserializedMetricConfiguration = new MetricConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("resourceId".equals(fieldName)) { + deserializedMetricConfiguration.resourceId = reader.getString(); + } else if ("counterSets".equals(fieldName)) { + List counterSets + = reader.readArray(reader1 -> MetricCounterSet.fromJson(reader1)); + deserializedMetricConfiguration.counterSets = counterSets; + } else if ("mdmAccount".equals(fieldName)) { + deserializedMetricConfiguration.mdmAccount = reader.getString(); + } else if ("metricNameSpace".equals(fieldName)) { + deserializedMetricConfiguration.metricNameSpace = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedMetricConfiguration; + }); + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/MetricCounter.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/MetricCounter.java new file mode 100644 index 000000000000..f52597c98d36 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/MetricCounter.java @@ -0,0 +1,177 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.databoxedge.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * The metric counter. + */ +@Fluent +public final class MetricCounter implements JsonSerializable { + /* + * The counter name. + */ + private String name; + + /* + * The instance from which counter should be collected. + */ + private String instance; + + /* + * The dimension filter. + */ + private List dimensionFilter; + + /* + * The additional dimensions to be added to metric. + */ + private List additionalDimensions; + + /** + * Creates an instance of MetricCounter class. + */ + public MetricCounter() { + } + + /** + * Get the name property: The counter name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The counter name. + * + * @param name the name value to set. + * @return the MetricCounter object itself. + */ + public MetricCounter withName(String name) { + this.name = name; + return this; + } + + /** + * Get the instance property: The instance from which counter should be collected. + * + * @return the instance value. + */ + public String instance() { + return this.instance; + } + + /** + * Set the instance property: The instance from which counter should be collected. + * + * @param instance the instance value to set. + * @return the MetricCounter object itself. + */ + public MetricCounter withInstance(String instance) { + this.instance = instance; + return this; + } + + /** + * Get the dimensionFilter property: The dimension filter. + * + * @return the dimensionFilter value. + */ + public List dimensionFilter() { + return this.dimensionFilter; + } + + /** + * Set the dimensionFilter property: The dimension filter. + * + * @param dimensionFilter the dimensionFilter value to set. + * @return the MetricCounter object itself. + */ + public MetricCounter withDimensionFilter(List dimensionFilter) { + this.dimensionFilter = dimensionFilter; + return this; + } + + /** + * Get the additionalDimensions property: The additional dimensions to be added to metric. + * + * @return the additionalDimensions value. + */ + public List additionalDimensions() { + return this.additionalDimensions; + } + + /** + * Set the additionalDimensions property: The additional dimensions to be added to metric. + * + * @param additionalDimensions the additionalDimensions value to set. + * @return the MetricCounter object itself. + */ + public MetricCounter withAdditionalDimensions(List additionalDimensions) { + this.additionalDimensions = additionalDimensions; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("instance", this.instance); + jsonWriter.writeArrayField("dimensionFilter", this.dimensionFilter, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("additionalDimensions", this.additionalDimensions, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MetricCounter from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MetricCounter if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the MetricCounter. + */ + public static MetricCounter fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MetricCounter deserializedMetricCounter = new MetricCounter(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedMetricCounter.name = reader.getString(); + } else if ("instance".equals(fieldName)) { + deserializedMetricCounter.instance = reader.getString(); + } else if ("dimensionFilter".equals(fieldName)) { + List dimensionFilter + = reader.readArray(reader1 -> MetricDimension.fromJson(reader1)); + deserializedMetricCounter.dimensionFilter = dimensionFilter; + } else if ("additionalDimensions".equals(fieldName)) { + List additionalDimensions + = reader.readArray(reader1 -> MetricDimension.fromJson(reader1)); + deserializedMetricCounter.additionalDimensions = additionalDimensions; + } else { + reader.skipChildren(); + } + } + + return deserializedMetricCounter; + }); + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/MetricCounterSet.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/MetricCounterSet.java new file mode 100644 index 000000000000..bccbd1601dc7 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/MetricCounterSet.java @@ -0,0 +1,88 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.databoxedge.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * The metric counter set. + */ +@Fluent +public final class MetricCounterSet implements JsonSerializable { + /* + * The counters that should be collected in this set. + */ + private List counters; + + /** + * Creates an instance of MetricCounterSet class. + */ + public MetricCounterSet() { + } + + /** + * Get the counters property: The counters that should be collected in this set. + * + * @return the counters value. + */ + public List counters() { + return this.counters; + } + + /** + * Set the counters property: The counters that should be collected in this set. + * + * @param counters the counters value to set. + * @return the MetricCounterSet object itself. + */ + public MetricCounterSet withCounters(List counters) { + this.counters = counters; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("counters", this.counters, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MetricCounterSet from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MetricCounterSet if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the MetricCounterSet. + */ + public static MetricCounterSet fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MetricCounterSet deserializedMetricCounterSet = new MetricCounterSet(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("counters".equals(fieldName)) { + List counters = reader.readArray(reader1 -> MetricCounter.fromJson(reader1)); + deserializedMetricCounterSet.counters = counters; + } else { + reader.skipChildren(); + } + } + + return deserializedMetricCounterSet; + }); + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/MetricDimension.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/MetricDimension.java new file mode 100644 index 000000000000..1954caeb3bc0 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/MetricDimension.java @@ -0,0 +1,114 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.databoxedge.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The metric dimension. + */ +@Fluent +public final class MetricDimension implements JsonSerializable { + /* + * The dimension type. + */ + private String sourceType; + + /* + * The dimension value. + */ + private String sourceName; + + /** + * Creates an instance of MetricDimension class. + */ + public MetricDimension() { + } + + /** + * Get the sourceType property: The dimension type. + * + * @return the sourceType value. + */ + public String sourceType() { + return this.sourceType; + } + + /** + * Set the sourceType property: The dimension type. + * + * @param sourceType the sourceType value to set. + * @return the MetricDimension object itself. + */ + public MetricDimension withSourceType(String sourceType) { + this.sourceType = sourceType; + return this; + } + + /** + * Get the sourceName property: The dimension value. + * + * @return the sourceName value. + */ + public String sourceName() { + return this.sourceName; + } + + /** + * Set the sourceName property: The dimension value. + * + * @param sourceName the sourceName value to set. + * @return the MetricDimension object itself. + */ + public MetricDimension withSourceName(String sourceName) { + this.sourceName = sourceName; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("sourceType", this.sourceType); + jsonWriter.writeStringField("sourceName", this.sourceName); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MetricDimension from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MetricDimension if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the MetricDimension. + */ + public static MetricDimension fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MetricDimension deserializedMetricDimension = new MetricDimension(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("sourceType".equals(fieldName)) { + deserializedMetricDimension.sourceType = reader.getString(); + } else if ("sourceName".equals(fieldName)) { + deserializedMetricDimension.sourceName = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedMetricDimension; + }); + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/MonitoringConfigs.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/MonitoringConfigs.java new file mode 100644 index 000000000000..170c26ddf6b4 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/MonitoringConfigs.java @@ -0,0 +1,118 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.databoxedge.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.databoxedge.fluent.models.MonitoringMetricConfigurationInner; + +/** + * Resource collection API of MonitoringConfigs. + */ +public interface MonitoringConfigs { + /** + * Gets a metric configuration of a role. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @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 a metric configuration of a role along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String deviceName, + Context context); + + /** + * Gets a metric configuration of a role. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @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 a metric configuration of a role. + */ + MonitoringMetricConfiguration get(String resourceGroupName, String deviceName); + + /** + * Creates a new metric configuration or updates an existing one for a role. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @param monitoringMetricConfiguration The metric configuration. + * @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 metric setting details for the role. + */ + MonitoringMetricConfiguration createOrUpdate(String resourceGroupName, String deviceName, + MonitoringMetricConfigurationInner monitoringMetricConfiguration); + + /** + * Creates a new metric configuration or updates an existing one for a role. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @param monitoringMetricConfiguration The metric configuration. + * @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 metric setting details for the role. + */ + MonitoringMetricConfiguration createOrUpdate(String resourceGroupName, String deviceName, + MonitoringMetricConfigurationInner monitoringMetricConfiguration, Context context); + + /** + * deletes a new metric configuration for a role. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @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 deleteByResourceGroup(String resourceGroupName, String deviceName); + + /** + * deletes a new metric configuration for a role. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @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. + */ + void delete(String resourceGroupName, String deviceName, Context context); + + /** + * Lists metric configurations in a role. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @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 collection of metric configurations as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String deviceName); + + /** + * Lists metric configurations in a role. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @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 collection of metric configurations as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String deviceName, Context context); +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/MonitoringMetricConfiguration.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/MonitoringMetricConfiguration.java new file mode 100644 index 000000000000..cacf6c18182a --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/MonitoringMetricConfiguration.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.databoxedge.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.databoxedge.fluent.models.MonitoringMetricConfigurationInner; +import java.util.List; + +/** + * An immutable client-side representation of MonitoringMetricConfiguration. + */ +public interface MonitoringMetricConfiguration { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the metricConfigurations property: The metrics configuration details. + * + * @return the metricConfigurations value. + */ + List metricConfigurations(); + + /** + * Gets the inner com.azure.resourcemanager.databoxedge.fluent.models.MonitoringMetricConfigurationInner object. + * + * @return the inner object. + */ + MonitoringMetricConfigurationInner innerModel(); +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/MonitoringStatus.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/MonitoringStatus.java index 9bfc2c1bfeb9..ef4ee24db771 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/MonitoringStatus.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/MonitoringStatus.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.models; @@ -12,12 +12,12 @@ */ public final class MonitoringStatus extends ExpandableStringEnum { /** - * Static value Enabled for MonitoringStatus. + * Enabled. */ public static final MonitoringStatus ENABLED = fromString("Enabled"); /** - * Static value Disabled for MonitoringStatus. + * Disabled. */ public static final MonitoringStatus DISABLED = fromString("Disabled"); diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/MountPointMap.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/MountPointMap.java index aa7e6b2b41df..be77c67bc50d 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/MountPointMap.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/MountPointMap.java @@ -1,11 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.models; -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -15,7 +14,7 @@ /** * The share mount point. */ -@Fluent +@Immutable public final class MountPointMap implements JsonSerializable { /* * ID of the share mounted to the role VM. @@ -32,6 +31,11 @@ public final class MountPointMap implements JsonSerializable { */ private String mountPoint; + /* + * Mounting type. + */ + private MountType mountType; + /* * Role type. */ @@ -40,7 +44,7 @@ public final class MountPointMap implements JsonSerializable { /** * Creates an instance of MountPointMap class. */ - public MountPointMap() { + private MountPointMap() { } /** @@ -52,17 +56,6 @@ public String shareId() { return this.shareId; } - /** - * Set the shareId property: ID of the share mounted to the role VM. - * - * @param shareId the shareId value to set. - * @return the MountPointMap object itself. - */ - public MountPointMap withShareId(String shareId) { - this.shareId = shareId; - return this; - } - /** * Get the roleId property: ID of the role to which share is mounted. * @@ -82,28 +75,23 @@ public String mountPoint() { } /** - * Get the roleType property: Role type. + * Get the mountType property: Mounting type. * - * @return the roleType value. + * @return the mountType value. */ - public RoleTypes roleType() { - return this.roleType; + public MountType mountType() { + return this.mountType; } /** - * Validates the instance. + * Get the roleType property: Role type. * - * @throws IllegalArgumentException thrown if the instance is not valid. + * @return the roleType value. */ - public void validate() { - if (shareId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Missing required property shareId in model MountPointMap")); - } + public RoleTypes roleType() { + return this.roleType; } - private static final ClientLogger LOGGER = new ClientLogger(MountPointMap.class); - /** * {@inheritDoc} */ @@ -136,6 +124,8 @@ public static MountPointMap fromJson(JsonReader jsonReader) throws IOException { deserializedMountPointMap.roleId = reader.getString(); } else if ("mountPoint".equals(fieldName)) { deserializedMountPointMap.mountPoint = reader.getString(); + } else if ("mountType".equals(fieldName)) { + deserializedMountPointMap.mountType = MountType.fromString(reader.getString()); } else if ("roleType".equals(fieldName)) { deserializedMountPointMap.roleType = RoleTypes.fromString(reader.getString()); } else { diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/MountType.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/MountType.java new file mode 100644 index 000000000000..a285afb81d96 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/MountType.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.databoxedge.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Mounting type. + */ +public final class MountType extends ExpandableStringEnum { + /** + * Volume. + */ + public static final MountType VOLUME = fromString("Volume"); + + /** + * HostPath. + */ + public static final MountType HOST_PATH = fromString("HostPath"); + + /** + * Creates a new instance of MountType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public MountType() { + } + + /** + * Creates or finds a MountType from its string representation. + * + * @param name a name to look for. + * @return the corresponding MountType. + */ + public static MountType fromString(String name) { + return fromString(name, MountType.class); + } + + /** + * Gets known MountType values. + * + * @return known MountType values. + */ + public static Collection values() { + return values(MountType.class); + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/MsiIdentityType.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/MsiIdentityType.java new file mode 100644 index 000000000000..805c9b7882bb --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/MsiIdentityType.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.databoxedge.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Identity type. + */ +public final class MsiIdentityType extends ExpandableStringEnum { + /** + * None. + */ + public static final MsiIdentityType NONE = fromString("None"); + + /** + * SystemAssigned. + */ + public static final MsiIdentityType SYSTEM_ASSIGNED = fromString("SystemAssigned"); + + /** + * UserAssigned. + */ + public static final MsiIdentityType USER_ASSIGNED = fromString("UserAssigned"); + + /** + * Creates a new instance of MsiIdentityType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public MsiIdentityType() { + } + + /** + * Creates or finds a MsiIdentityType from its string representation. + * + * @param name a name to look for. + * @return the corresponding MsiIdentityType. + */ + public static MsiIdentityType fromString(String name) { + return fromString(name, MsiIdentityType.class); + } + + /** + * Gets known MsiIdentityType values. + * + * @return known MsiIdentityType values. + */ + public static Collection values() { + return values(MsiIdentityType.class); + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/NetworkAdapter.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/NetworkAdapter.java index eb22e4bc4e56..c995686fcc1f 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/NetworkAdapter.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/NetworkAdapter.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -15,7 +15,7 @@ /** * Represents the networkAdapter on a device. */ -@Fluent +@Immutable public final class NetworkAdapter implements JsonSerializable { /* * Instance ID of network adapter. @@ -95,7 +95,7 @@ public final class NetworkAdapter implements JsonSerializable { /** * Creates an instance of NetworkAdapter class. */ - public NetworkAdapter() { + private NetworkAdapter() { } /** @@ -188,17 +188,6 @@ public NetworkAdapterRdmaStatus rdmaStatus() { return this.rdmaStatus; } - /** - * Set the rdmaStatus property: Value indicating whether this adapter is RDMA capable. - * - * @param rdmaStatus the rdmaStatus value to set. - * @return the NetworkAdapter object itself. - */ - public NetworkAdapter withRdmaStatus(NetworkAdapterRdmaStatus rdmaStatus) { - this.rdmaStatus = rdmaStatus; - return this; - } - /** * Get the dhcpStatus property: Value indicating whether this adapter has DHCP enabled. * @@ -208,17 +197,6 @@ public NetworkAdapterDhcpStatus dhcpStatus() { return this.dhcpStatus; } - /** - * Set the dhcpStatus property: Value indicating whether this adapter has DHCP enabled. - * - * @param dhcpStatus the dhcpStatus value to set. - * @return the NetworkAdapter object itself. - */ - public NetworkAdapter withDhcpStatus(NetworkAdapterDhcpStatus dhcpStatus) { - this.dhcpStatus = dhcpStatus; - return this; - } - /** * Get the ipv4Configuration property: The IPv4 configuration of the network adapter. * @@ -255,23 +233,6 @@ public List dnsServers() { return this.dnsServers; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (adapterPosition() != null) { - adapterPosition().validate(); - } - if (ipv4Configuration() != null) { - ipv4Configuration().validate(); - } - if (ipv6Configuration() != null) { - ipv6Configuration().validate(); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/NetworkAdapterDhcpStatus.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/NetworkAdapterDhcpStatus.java index dbe1e64b0d4d..71c24aba0a4a 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/NetworkAdapterDhcpStatus.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/NetworkAdapterDhcpStatus.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.models; @@ -12,12 +12,12 @@ */ public final class NetworkAdapterDhcpStatus extends ExpandableStringEnum { /** - * Static value Disabled for NetworkAdapterDhcpStatus. + * Disabled. */ public static final NetworkAdapterDhcpStatus DISABLED = fromString("Disabled"); /** - * Static value Enabled for NetworkAdapterDhcpStatus. + * Enabled. */ public static final NetworkAdapterDhcpStatus ENABLED = fromString("Enabled"); diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/NetworkAdapterPosition.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/NetworkAdapterPosition.java index a9b6d3b927c3..9043c1153722 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/NetworkAdapterPosition.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/NetworkAdapterPosition.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.models; @@ -29,7 +29,7 @@ public final class NetworkAdapterPosition implements JsonSerializable { /** - * Static value Incapable for NetworkAdapterRdmaStatus. + * Incapable. */ public static final NetworkAdapterRdmaStatus INCAPABLE = fromString("Incapable"); /** - * Static value Capable for NetworkAdapterRdmaStatus. + * Capable. */ public static final NetworkAdapterRdmaStatus CAPABLE = fromString("Capable"); diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/NetworkAdapterStatus.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/NetworkAdapterStatus.java index da87f7a584e6..fbc523ec482a 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/NetworkAdapterStatus.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/NetworkAdapterStatus.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.models; @@ -12,12 +12,12 @@ */ public final class NetworkAdapterStatus extends ExpandableStringEnum { /** - * Static value Inactive for NetworkAdapterStatus. + * Inactive. */ public static final NetworkAdapterStatus INACTIVE = fromString("Inactive"); /** - * Static value Active for NetworkAdapterStatus. + * Active. */ public static final NetworkAdapterStatus ACTIVE = fromString("Active"); diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/NetworkGroup.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/NetworkGroup.java index 0db9350fa621..1965d93b641c 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/NetworkGroup.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/NetworkGroup.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.models; @@ -12,17 +12,17 @@ */ public final class NetworkGroup extends ExpandableStringEnum { /** - * Static value None for NetworkGroup. + * None. */ public static final NetworkGroup NONE = fromString("None"); /** - * Static value NonRDMA for NetworkGroup. + * NonRDMA. */ public static final NetworkGroup NON_RDMA = fromString("NonRDMA"); /** - * Static value RDMA for NetworkGroup. + * RDMA. */ public static final NetworkGroup RDMA = fromString("RDMA"); diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/NetworkSettings.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/NetworkSettings.java index df7758fa9cb1..6fe438b9a800 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/NetworkSettings.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/NetworkSettings.java @@ -1,9 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.models; +import com.azure.core.management.SystemData; import com.azure.resourcemanager.databoxedge.fluent.models.NetworkSettingsInner; import java.util.List; @@ -32,6 +33,13 @@ public interface NetworkSettings { */ String type(); + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + /** * Gets the networkAdapters property: The network adapter list on the device. * diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/Node.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/Node.java index fa5505a8ef09..8b2079b6b912 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/Node.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/Node.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.models; @@ -11,21 +11,21 @@ */ public interface Node { /** - * Gets the id property: Fully qualified resource Id for the resource. + * Gets the id property: The path ID that uniquely identifies the object. * * @return the id value. */ String id(); /** - * Gets the name property: The name of the resource. + * Gets the name property: The object name. * * @return the name value. */ String name(); /** - * Gets the type property: The type of the resource. + * Gets the type property: The hierarchical type of the object. * * @return the type value. */ diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/NodeStatus.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/NodeStatus.java index 40cd519a3fe1..3f8fe7565a9e 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/NodeStatus.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/NodeStatus.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.models; @@ -12,27 +12,27 @@ */ public final class NodeStatus extends ExpandableStringEnum { /** - * Static value Unknown for NodeStatus. + * Unknown. */ public static final NodeStatus UNKNOWN = fromString("Unknown"); /** - * Static value Up for NodeStatus. + * Up. */ public static final NodeStatus UP = fromString("Up"); /** - * Static value Down for NodeStatus. + * Down. */ public static final NodeStatus DOWN = fromString("Down"); /** - * Static value Rebooting for NodeStatus. + * Rebooting. */ public static final NodeStatus REBOOTING = fromString("Rebooting"); /** - * Static value ShuttingDown for NodeStatus. + * ShuttingDown. */ public static final NodeStatus SHUTTING_DOWN = fromString("ShuttingDown"); diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/Nodes.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/Nodes.java index 29c2807fec06..2635c4c7a194 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/Nodes.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/Nodes.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.models; @@ -14,21 +14,21 @@ public interface Nodes { /** * Gets all the nodes currently configured under this Data Box Edge device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param resourceGroupName The resource group name. * @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 all the nodes currently configured under this Data Box Edge device as paginated response with * {@link PagedIterable}. */ - PagedIterable listByDataBoxEdgeDevice(String deviceName, String resourceGroupName); + PagedIterable listByDataBoxEdgeDevice(String resourceGroupName, String deviceName); /** * Gets all the nodes currently configured under this Data Box Edge device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param resourceGroupName The resource group name. * @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. @@ -36,5 +36,5 @@ public interface Nodes { * @return all the nodes currently configured under this Data Box Edge device as paginated response with * {@link PagedIterable}. */ - PagedIterable listByDataBoxEdgeDevice(String deviceName, String resourceGroupName, Context context); + PagedIterable listByDataBoxEdgeDevice(String resourceGroupName, String deviceName, Context context); } diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/NumaNodeData.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/NumaNodeData.java new file mode 100644 index 000000000000..214ff917c6a1 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/NumaNodeData.java @@ -0,0 +1,183 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.databoxedge.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * NUMA node data. + */ +@Immutable +public final class NumaNodeData implements JsonSerializable { + /* + * The NUMA node index. + */ + private Integer numaNodeIndex; + + /* + * The total memory on the NUMA node. + */ + private Long totalMemoryInMb; + + /* + * The logical cores per core count. + */ + private Integer logicalCoreCountPerCore; + + /* + * The effective available memory on the NUMA node in MB. + */ + private Long effectiveAvailableMemoryInMb; + + /* + * The free VCPU indices for the Hpn VMs. + */ + private List freeVCpuIndexesForHpn; + + /* + * The VCPU indices for Hpn VMs + */ + private List vCpuIndexesForHpn; + + /* + * The VCPU indices for the root. + */ + private List vCpuIndexesForRoot; + + /** + * Creates an instance of NumaNodeData class. + */ + private NumaNodeData() { + } + + /** + * Get the numaNodeIndex property: The NUMA node index. + * + * @return the numaNodeIndex value. + */ + public Integer numaNodeIndex() { + return this.numaNodeIndex; + } + + /** + * Get the totalMemoryInMb property: The total memory on the NUMA node. + * + * @return the totalMemoryInMb value. + */ + public Long totalMemoryInMb() { + return this.totalMemoryInMb; + } + + /** + * Get the logicalCoreCountPerCore property: The logical cores per core count. + * + * @return the logicalCoreCountPerCore value. + */ + public Integer logicalCoreCountPerCore() { + return this.logicalCoreCountPerCore; + } + + /** + * Get the effectiveAvailableMemoryInMb property: The effective available memory on the NUMA node in MB. + * + * @return the effectiveAvailableMemoryInMb value. + */ + public Long effectiveAvailableMemoryInMb() { + return this.effectiveAvailableMemoryInMb; + } + + /** + * Get the freeVCpuIndexesForHpn property: The free VCPU indices for the Hpn VMs. + * + * @return the freeVCpuIndexesForHpn value. + */ + public List freeVCpuIndexesForHpn() { + return this.freeVCpuIndexesForHpn; + } + + /** + * Get the vCpuIndexesForHpn property: The VCPU indices for Hpn VMs. + * + * @return the vCpuIndexesForHpn value. + */ + public List vCpuIndexesForHpn() { + return this.vCpuIndexesForHpn; + } + + /** + * Get the vCpuIndexesForRoot property: The VCPU indices for the root. + * + * @return the vCpuIndexesForRoot value. + */ + public List vCpuIndexesForRoot() { + return this.vCpuIndexesForRoot; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("numaNodeIndex", this.numaNodeIndex); + jsonWriter.writeNumberField("totalMemoryInMb", this.totalMemoryInMb); + jsonWriter.writeNumberField("logicalCoreCountPerCore", this.logicalCoreCountPerCore); + jsonWriter.writeNumberField("effectiveAvailableMemoryInMb", this.effectiveAvailableMemoryInMb); + jsonWriter.writeArrayField("freeVCpuIndexesForHpn", this.freeVCpuIndexesForHpn, + (writer, element) -> writer.writeInt(element)); + jsonWriter.writeArrayField("vCpuIndexesForHpn", this.vCpuIndexesForHpn, + (writer, element) -> writer.writeInt(element)); + jsonWriter.writeArrayField("vCpuIndexesForRoot", this.vCpuIndexesForRoot, + (writer, element) -> writer.writeInt(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NumaNodeData from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NumaNodeData if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the NumaNodeData. + */ + public static NumaNodeData fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NumaNodeData deserializedNumaNodeData = new NumaNodeData(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("numaNodeIndex".equals(fieldName)) { + deserializedNumaNodeData.numaNodeIndex = reader.getNullable(JsonReader::getInt); + } else if ("totalMemoryInMb".equals(fieldName)) { + deserializedNumaNodeData.totalMemoryInMb = reader.getNullable(JsonReader::getLong); + } else if ("logicalCoreCountPerCore".equals(fieldName)) { + deserializedNumaNodeData.logicalCoreCountPerCore = reader.getNullable(JsonReader::getInt); + } else if ("effectiveAvailableMemoryInMb".equals(fieldName)) { + deserializedNumaNodeData.effectiveAvailableMemoryInMb = reader.getNullable(JsonReader::getLong); + } else if ("freeVCpuIndexesForHpn".equals(fieldName)) { + List freeVCpuIndexesForHpn = reader.readArray(reader1 -> reader1.getInt()); + deserializedNumaNodeData.freeVCpuIndexesForHpn = freeVCpuIndexesForHpn; + } else if ("vCpuIndexesForHpn".equals(fieldName)) { + List vCpuIndexesForHpn = reader.readArray(reader1 -> reader1.getInt()); + deserializedNumaNodeData.vCpuIndexesForHpn = vCpuIndexesForHpn; + } else if ("vCpuIndexesForRoot".equals(fieldName)) { + List vCpuIndexesForRoot = reader.readArray(reader1 -> reader1.getInt()); + deserializedNumaNodeData.vCpuIndexesForRoot = vCpuIndexesForRoot; + } else { + reader.skipChildren(); + } + } + + return deserializedNumaNodeData; + }); + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/Operation.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/Operation.java index bae735f7f30e..3682535fa377 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/Operation.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/Operation.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.models; @@ -11,32 +11,43 @@ */ public interface Operation { /** - * Gets the name property: Name of the operation. + * Gets the name property: The name of the operation, as per Resource-Based Access Control (RBAC). Examples: + * "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action". * * @return the name value. */ String name(); /** - * Gets the display property: Properties displayed for the operation. + * Gets the isDataAction property: Whether the operation applies to data-plane. This is "true" for data-plane + * operations and "false" for Azure Resource Manager/control-plane operations. + * + * @return the isDataAction value. + */ + Boolean isDataAction(); + + /** + * Gets the display property: Localized display information for this particular operation. * * @return the display value. */ OperationDisplay display(); /** - * Gets the origin property: Origin of the operation. + * Gets the origin property: The intended executor of the operation; as in Resource Based Access Control (RBAC) and + * audit logs UX. Default value is "user,system". * * @return the origin value. */ - String origin(); + Origin origin(); /** - * Gets the serviceSpecification property: Service specification. + * Gets the actionType property: Extensible enum. Indicates the action type. "Internal" refers to actions that are + * for internal only APIs. * - * @return the serviceSpecification value. + * @return the actionType value. */ - ServiceSpecification serviceSpecification(); + ActionType actionType(); /** * Gets the inner com.azure.resourcemanager.databoxedge.fluent.models.OperationInner object. diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/OperationDisplay.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/OperationDisplay.java index 5c47f73094e9..726b68fe9cde 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/OperationDisplay.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/OperationDisplay.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -12,38 +12,42 @@ import java.io.IOException; /** - * Operation display properties. + * Localized display information for and operation. */ -@Fluent +@Immutable public final class OperationDisplay implements JsonSerializable { /* - * Provider name. + * The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring Insights" or + * "Microsoft Compute". */ private String provider; /* - * The type of resource in which the operation is performed. + * The localized friendly name of the resource type related to this operation. E.g. "Virtual Machines" or + * "Job Schedule Collections". */ private String resource; /* - * Operation to be performed on the resource. + * The concise, localized friendly name for the operation; suitable for dropdowns. E.g. + * "Create or Update Virtual Machine", "Restart Virtual Machine". */ private String operation; /* - * Description of the operation to be performed. + * The short, localized friendly description of the operation; suitable for tool tips and detailed views. */ private String description; /** * Creates an instance of OperationDisplay class. */ - public OperationDisplay() { + private OperationDisplay() { } /** - * Get the provider property: Provider name. + * Get the provider property: The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring + * Insights" or "Microsoft Compute". * * @return the provider value. */ @@ -52,18 +56,8 @@ public String provider() { } /** - * Set the provider property: Provider name. - * - * @param provider the provider value to set. - * @return the OperationDisplay object itself. - */ - public OperationDisplay withProvider(String provider) { - this.provider = provider; - return this; - } - - /** - * Get the resource property: The type of resource in which the operation is performed. + * Get the resource property: The localized friendly name of the resource type related to this operation. E.g. + * "Virtual Machines" or "Job Schedule Collections". * * @return the resource value. */ @@ -72,18 +66,8 @@ public String resource() { } /** - * Set the resource property: The type of resource in which the operation is performed. - * - * @param resource the resource value to set. - * @return the OperationDisplay object itself. - */ - public OperationDisplay withResource(String resource) { - this.resource = resource; - return this; - } - - /** - * Get the operation property: Operation to be performed on the resource. + * Get the operation property: The concise, localized friendly name for the operation; suitable for dropdowns. E.g. + * "Create or Update Virtual Machine", "Restart Virtual Machine". * * @return the operation value. */ @@ -92,18 +76,8 @@ public String operation() { } /** - * Set the operation property: Operation to be performed on the resource. - * - * @param operation the operation value to set. - * @return the OperationDisplay object itself. - */ - public OperationDisplay withOperation(String operation) { - this.operation = operation; - return this; - } - - /** - * Get the description property: Description of the operation to be performed. + * Get the description property: The short, localized friendly description of the operation; suitable for tool tips + * and detailed views. * * @return the description value. */ @@ -111,35 +85,12 @@ public String description() { return this.description; } - /** - * Set the description property: Description of the operation to be performed. - * - * @param description the description value to set. - * @return the OperationDisplay object itself. - */ - public OperationDisplay withDescription(String description) { - this.description = description; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); - jsonWriter.writeStringField("provider", this.provider); - jsonWriter.writeStringField("resource", this.resource); - jsonWriter.writeStringField("operation", this.operation); - jsonWriter.writeStringField("description", this.description); return jsonWriter.writeEndObject(); } diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/Operations.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/Operations.java index b06af3f566d9..46a94d242b84 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/Operations.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/Operations.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.models; @@ -12,23 +12,23 @@ */ public interface Operations { /** - * List all the supported operations. + * List the operations for the provider. * * @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 list of operations used for the discovery of available provider operations as paginated response with + * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with * {@link PagedIterable}. */ PagedIterable list(); /** - * List all the supported operations. + * List the operations for the provider. * * @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 list of operations used for the discovery of available provider operations as paginated response with + * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with * {@link PagedIterable}. */ PagedIterable list(Context context); diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/OperationsStatus.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/OperationsStatus.java index b6418265ac70..b039ccfbce66 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/OperationsStatus.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/OperationsStatus.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.models; @@ -14,27 +14,27 @@ public interface OperationsStatus { /** * Gets the details of a specified job on a Data Box Edge/Data Box Gateway device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. * @param name The job name. - * @param resourceGroupName The resource group name. * @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 details of a specified job on a Data Box Edge/Data Box Gateway device along with {@link Response}. */ - Response getWithResponse(String deviceName, String name, String resourceGroupName, Context context); + Response getWithResponse(String resourceGroupName, String deviceName, String name, Context context); /** * Gets the details of a specified job on a Data Box Edge/Data Box Gateway device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. * @param name The job name. - * @param resourceGroupName The resource group name. * @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 details of a specified job on a Data Box Edge/Data Box Gateway device. */ - Job get(String deviceName, String name, String resourceGroupName); + Job get(String resourceGroupName, String deviceName, String name); } diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/Order.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/Order.java index 63631f281de7..6748c8122d6b 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/Order.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/Order.java @@ -1,9 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.models; +import com.azure.core.management.SystemData; import com.azure.resourcemanager.databoxedge.fluent.models.OrderInner; import java.util.List; @@ -32,6 +33,27 @@ public interface Order { */ String type(); + /** + * Gets the kind property: It specify the order api version. + * + * @return the kind value. + */ + String kind(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the orderId property: It specify the order resource id. + * + * @return the orderId value. + */ + String orderId(); + /** * Gets the contactInformation property: The contact details. * @@ -83,6 +105,13 @@ public interface Order { */ List returnTrackingInfo(); + /** + * Gets the shipmentType property: ShipmentType of the order. + * + * @return the shipmentType value. + */ + ShipmentType shipmentType(); + /** * Gets the inner com.azure.resourcemanager.databoxedge.fluent.models.OrderInner object. * diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/OrderState.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/OrderState.java index 282ec49a55c1..019238d8fafe 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/OrderState.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/OrderState.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.models; @@ -12,75 +12,90 @@ */ public final class OrderState extends ExpandableStringEnum { /** - * Static value Untracked for OrderState. + * Untracked. */ public static final OrderState UNTRACKED = fromString("Untracked"); /** - * Static value AwaitingFulfilment for OrderState. + * AwaitingFulfillment. */ - public static final OrderState AWAITING_FULFILMENT = fromString("AwaitingFulfilment"); + public static final OrderState AWAITING_FULFILLMENT = fromString("AwaitingFulfillment"); /** - * Static value AwaitingPreparation for OrderState. + * AwaitingPreparation. */ public static final OrderState AWAITING_PREPARATION = fromString("AwaitingPreparation"); /** - * Static value AwaitingShipment for OrderState. + * AwaitingShipment. */ public static final OrderState AWAITING_SHIPMENT = fromString("AwaitingShipment"); /** - * Static value Shipped for OrderState. + * Shipped. */ public static final OrderState SHIPPED = fromString("Shipped"); /** - * Static value Arriving for OrderState. + * Arriving. */ public static final OrderState ARRIVING = fromString("Arriving"); /** - * Static value Delivered for OrderState. + * Delivered. */ public static final OrderState DELIVERED = fromString("Delivered"); /** - * Static value ReplacementRequested for OrderState. + * ReplacementRequested. */ public static final OrderState REPLACEMENT_REQUESTED = fromString("ReplacementRequested"); /** - * Static value LostDevice for OrderState. + * LostDevice. */ public static final OrderState LOST_DEVICE = fromString("LostDevice"); /** - * Static value Declined for OrderState. + * Declined. */ public static final OrderState DECLINED = fromString("Declined"); /** - * Static value ReturnInitiated for OrderState. + * ReturnInitiated. */ public static final OrderState RETURN_INITIATED = fromString("ReturnInitiated"); /** - * Static value AwaitingReturnShipment for OrderState. + * AwaitingReturnShipment. */ public static final OrderState AWAITING_RETURN_SHIPMENT = fromString("AwaitingReturnShipment"); /** - * Static value ShippedBack for OrderState. + * ShippedBack. */ public static final OrderState SHIPPED_BACK = fromString("ShippedBack"); /** - * Static value CollectedAtMicrosoft for OrderState. + * CollectedAtMicrosoft. */ public static final OrderState COLLECTED_AT_MICROSOFT = fromString("CollectedAtMicrosoft"); + /** + * AwaitingPickup. + */ + public static final OrderState AWAITING_PICKUP = fromString("AwaitingPickup"); + + /** + * PickupCompleted. + */ + public static final OrderState PICKUP_COMPLETED = fromString("PickupCompleted"); + + /** + * AwaitingDrop. + */ + public static final OrderState AWAITING_DROP = fromString("AwaitingDrop"); + /** * Creates a new instance of OrderState value. * diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/OrderStatus.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/OrderStatus.java index 5bcc31c346c0..2b993290381b 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/OrderStatus.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/OrderStatus.java @@ -1,12 +1,11 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.core.util.CoreUtils; -import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -18,7 +17,7 @@ /** * Represents a single status change. */ -@Fluent +@Immutable public final class OrderStatus implements JsonSerializable { /* * Status of the order as per the allowed status types. @@ -35,6 +34,11 @@ public final class OrderStatus implements JsonSerializable { */ private String comments; + /* + * Tracking information related to the state in the ordering flow + */ + private TrackingInfo trackingInformation; + /* * Dictionary to hold generic information which is not stored * by the already existing properties @@ -44,7 +48,7 @@ public final class OrderStatus implements JsonSerializable { /** * Creates an instance of OrderStatus class. */ - public OrderStatus() { + private OrderStatus() { } /** @@ -56,17 +60,6 @@ public OrderState status() { return this.status; } - /** - * Set the status property: Status of the order as per the allowed status types. - * - * @param status the status value to set. - * @return the OrderStatus object itself. - */ - public OrderStatus withStatus(OrderState status) { - this.status = status; - return this; - } - /** * Get the updateDateTime property: Time of status update. * @@ -86,14 +79,12 @@ public String comments() { } /** - * Set the comments property: Comments related to this status change. + * Get the trackingInformation property: Tracking information related to the state in the ordering flow. * - * @param comments the comments value to set. - * @return the OrderStatus object itself. + * @return the trackingInformation value. */ - public OrderStatus withComments(String comments) { - this.comments = comments; - return this; + public TrackingInfo trackingInformation() { + return this.trackingInformation; } /** @@ -106,20 +97,6 @@ public Map additionalOrderDetails() { return this.additionalOrderDetails; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (status() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Missing required property status in model OrderStatus")); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(OrderStatus.class); - /** * {@inheritDoc} */ @@ -154,6 +131,8 @@ public static OrderStatus fromJson(JsonReader jsonReader) throws IOException { .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); } else if ("comments".equals(fieldName)) { deserializedOrderStatus.comments = reader.getString(); + } else if ("trackingInformation".equals(fieldName)) { + deserializedOrderStatus.trackingInformation = TrackingInfo.fromJson(reader); } else if ("additionalOrderDetails".equals(fieldName)) { Map additionalOrderDetails = reader.readMap(reader1 -> reader1.getString()); deserializedOrderStatus.additionalOrderDetails = additionalOrderDetails; diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/Orders.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/Orders.java index ceb5601a6b14..4cc6ca4a0091 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/Orders.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/Orders.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.models; @@ -14,102 +14,127 @@ */ public interface Orders { /** - * Lists all the orders related to a Data Box Edge/Data Box Gateway device. + * Gets a specific order by name. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param resourceGroupName The resource group name. + * @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 list of order entities as paginated response with {@link PagedIterable}. + * @return a specific order by name along with {@link Response}. */ - PagedIterable listByDataBoxEdgeDevice(String deviceName, String resourceGroupName); + Response getWithResponse(String resourceGroupName, String deviceName, Context context); /** - * Lists all the orders related to a Data Box Edge/Data Box Gateway device. + * Gets a specific order by name. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param resourceGroupName The resource group name. - * @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 list of order entities as paginated response with {@link PagedIterable}. + * @return a specific order by name. */ - PagedIterable listByDataBoxEdgeDevice(String deviceName, String resourceGroupName, Context context); + Order get(String resourceGroupName, String deviceName); /** - * Gets a specific order by name. + * Creates or updates an order. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param resourceGroupName The resource group name. - * @param context The context to associate with this operation. + * @param order The order to be created or updated. * @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 a specific order by name along with {@link Response}. + * @return the order details. */ - Response getWithResponse(String deviceName, String resourceGroupName, Context context); + Order createOrUpdate(String resourceGroupName, String deviceName, OrderInner order); /** - * Gets a specific order by name. + * Creates or updates an order. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param resourceGroupName The resource group name. + * @param order The order to be created or updated. + * @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 a specific order by name. + * @return the order details. */ - Order get(String deviceName, String resourceGroupName); + Order createOrUpdate(String resourceGroupName, String deviceName, OrderInner order, Context context); /** - * Creates or updates an order. + * Deletes the order related to the device. * - * @param deviceName The order details of a device. - * @param resourceGroupName The resource group name. - * @param order The order to be created or updated. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. * @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 order details. */ - Order createOrUpdate(String deviceName, String resourceGroupName, OrderInner order); + void deleteByResourceGroup(String resourceGroupName, String deviceName); /** - * Creates or updates an order. + * Deletes the order related to the device. * - * @param deviceName The order details of a device. - * @param resourceGroupName The resource group name. - * @param order The order to be created or updated. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. * @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 order details. */ - Order createOrUpdate(String deviceName, String resourceGroupName, OrderInner order, Context context); + void delete(String resourceGroupName, String deviceName, Context context); /** - * Deletes the order related to the device. + * Lists all the orders related to a Data Box Edge/Data Box Gateway device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param resourceGroupName The resource group name. * @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 order entities as paginated response with {@link PagedIterable}. */ - void deleteByResourceGroup(String deviceName, String resourceGroupName); + PagedIterable listByDataBoxEdgeDevice(String resourceGroupName, String deviceName); /** - * Deletes the order related to the device. + * Lists all the orders related to a Data Box Edge/Data Box Gateway device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param resourceGroupName The resource group name. * @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 list of order entities as paginated response with {@link PagedIterable}. + */ + PagedIterable listByDataBoxEdgeDevice(String resourceGroupName, String deviceName, Context context); + + /** + * Gets the DCAccess Code. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @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 DCAccess Code along with {@link Response}. + */ + Response listDCAccessCodeWithResponse(String resourceGroupName, String deviceName, Context context); + + /** + * Gets the DCAccess Code. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @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 DCAccess Code. */ - void delete(String deviceName, String resourceGroupName, Context context); + DCAccessCode listDCAccessCode(String resourceGroupName, String deviceName); } diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/Origin.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/Origin.java new file mode 100644 index 000000000000..213bd97dbbab --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/Origin.java @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.databoxedge.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value + * is "user,system". + */ +public final class Origin extends ExpandableStringEnum { + /** + * Indicates the operation is initiated by a user. + */ + public static final Origin USER = fromString("user"); + + /** + * Indicates the operation is initiated by a system. + */ + public static final Origin SYSTEM = fromString("system"); + + /** + * Indicates the operation is initiated by a user or system. + */ + public static final Origin USER_SYSTEM = fromString("user,system"); + + /** + * Creates a new instance of Origin value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public Origin() { + } + + /** + * Creates or finds a Origin from its string representation. + * + * @param name a name to look for. + * @return the corresponding Origin. + */ + public static Origin fromString(String name) { + return fromString(name, Origin.class); + } + + /** + * Gets known Origin values. + * + * @return known Origin values. + */ + public static Collection values() { + return values(Origin.class); + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/ProactiveDiagnosticsConsent.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/ProactiveDiagnosticsConsent.java new file mode 100644 index 000000000000..d83ff690dadf --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/ProactiveDiagnosticsConsent.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.databoxedge.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Proactive diagnostic collection consent flag. + */ +public final class ProactiveDiagnosticsConsent extends ExpandableStringEnum { + /** + * Enabled. + */ + public static final ProactiveDiagnosticsConsent ENABLED = fromString("Enabled"); + + /** + * Disabled. + */ + public static final ProactiveDiagnosticsConsent DISABLED = fromString("Disabled"); + + /** + * Creates a new instance of ProactiveDiagnosticsConsent value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ProactiveDiagnosticsConsent() { + } + + /** + * Creates or finds a ProactiveDiagnosticsConsent from its string representation. + * + * @param name a name to look for. + * @return the corresponding ProactiveDiagnosticsConsent. + */ + public static ProactiveDiagnosticsConsent fromString(String name) { + return fromString(name, ProactiveDiagnosticsConsent.class); + } + + /** + * Gets known ProactiveDiagnosticsConsent values. + * + * @return known ProactiveDiagnosticsConsent values. + */ + public static Collection values() { + return values(ProactiveDiagnosticsConsent.class); + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/RefreshDetails.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/RefreshDetails.java index 4c966a746345..5fd617e5df03 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/RefreshDetails.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/RefreshDetails.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.models; @@ -29,7 +29,7 @@ public final class RefreshDetails implements JsonSerializable { * Indicates the completed time for the last refresh job on this particular share or container, if any.This could be * a failed job or a successful job. */ - private OffsetDateTime lastCompletedRefreshJobTimeInUtc; + private OffsetDateTime lastCompletedRefreshJobTimeInUTC; /* * Indicates the relative path of the error xml for the last refresh job on this particular share or container, if @@ -72,24 +72,24 @@ public RefreshDetails withInProgressRefreshJobId(String inProgressRefreshJobId) } /** - * Get the lastCompletedRefreshJobTimeInUtc property: Indicates the completed time for the last refresh job on this + * Get the lastCompletedRefreshJobTimeInUTC property: Indicates the completed time for the last refresh job on this * particular share or container, if any.This could be a failed job or a successful job. * - * @return the lastCompletedRefreshJobTimeInUtc value. + * @return the lastCompletedRefreshJobTimeInUTC value. */ - public OffsetDateTime lastCompletedRefreshJobTimeInUtc() { - return this.lastCompletedRefreshJobTimeInUtc; + public OffsetDateTime lastCompletedRefreshJobTimeInUTC() { + return this.lastCompletedRefreshJobTimeInUTC; } /** - * Set the lastCompletedRefreshJobTimeInUtc property: Indicates the completed time for the last refresh job on this + * Set the lastCompletedRefreshJobTimeInUTC property: Indicates the completed time for the last refresh job on this * particular share or container, if any.This could be a failed job or a successful job. * - * @param lastCompletedRefreshJobTimeInUtc the lastCompletedRefreshJobTimeInUtc value to set. + * @param lastCompletedRefreshJobTimeInUTC the lastCompletedRefreshJobTimeInUTC value to set. * @return the RefreshDetails object itself. */ - public RefreshDetails withLastCompletedRefreshJobTimeInUtc(OffsetDateTime lastCompletedRefreshJobTimeInUtc) { - this.lastCompletedRefreshJobTimeInUtc = lastCompletedRefreshJobTimeInUtc; + public RefreshDetails withLastCompletedRefreshJobTimeInUTC(OffsetDateTime lastCompletedRefreshJobTimeInUTC) { + this.lastCompletedRefreshJobTimeInUTC = lastCompletedRefreshJobTimeInUTC; return this; } @@ -137,14 +137,6 @@ public RefreshDetails withLastJob(String lastJob) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ @@ -153,9 +145,9 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); jsonWriter.writeStringField("inProgressRefreshJobId", this.inProgressRefreshJobId); jsonWriter.writeStringField("lastCompletedRefreshJobTimeInUTC", - this.lastCompletedRefreshJobTimeInUtc == null + this.lastCompletedRefreshJobTimeInUTC == null ? null - : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.lastCompletedRefreshJobTimeInUtc)); + : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.lastCompletedRefreshJobTimeInUTC)); jsonWriter.writeStringField("errorManifestFile", this.errorManifestFile); jsonWriter.writeStringField("lastJob", this.lastJob); return jsonWriter.writeEndObject(); @@ -179,7 +171,7 @@ public static RefreshDetails fromJson(JsonReader jsonReader) throws IOException if ("inProgressRefreshJobId".equals(fieldName)) { deserializedRefreshDetails.inProgressRefreshJobId = reader.getString(); } else if ("lastCompletedRefreshJobTimeInUTC".equals(fieldName)) { - deserializedRefreshDetails.lastCompletedRefreshJobTimeInUtc = reader + deserializedRefreshDetails.lastCompletedRefreshJobTimeInUTC = reader .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); } else if ("errorManifestFile".equals(fieldName)) { deserializedRefreshDetails.errorManifestFile = reader.getString(); diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/RemoteApplicationType.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/RemoteApplicationType.java new file mode 100644 index 000000000000..b3cc2e5c7d72 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/RemoteApplicationType.java @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.databoxedge.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Remote application type. + */ +public final class RemoteApplicationType extends ExpandableStringEnum { + /** + * Powershell. + */ + public static final RemoteApplicationType POWERSHELL = fromString("Powershell"); + + /** + * WAC. + */ + public static final RemoteApplicationType WAC = fromString("WAC"); + + /** + * LocalUI. + */ + public static final RemoteApplicationType LOCAL_UI = fromString("LocalUI"); + + /** + * AllApplications. + */ + public static final RemoteApplicationType ALL_APPLICATIONS = fromString("AllApplications"); + + /** + * Creates a new instance of RemoteApplicationType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public RemoteApplicationType() { + } + + /** + * Creates or finds a RemoteApplicationType from its string representation. + * + * @param name a name to look for. + * @return the corresponding RemoteApplicationType. + */ + public static RemoteApplicationType fromString(String name) { + return fromString(name, RemoteApplicationType.class); + } + + /** + * Gets known RemoteApplicationType values. + * + * @return known RemoteApplicationType values. + */ + public static Collection values() { + return values(RemoteApplicationType.class); + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/RemoteSupportSettings.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/RemoteSupportSettings.java new file mode 100644 index 000000000000..02021458a5a9 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/RemoteSupportSettings.java @@ -0,0 +1,150 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.databoxedge.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; + +/** + * RemoteApplicationType for which remote support settings is being modified. + */ +@Fluent +public final class RemoteSupportSettings implements JsonSerializable { + /* + * Remote application type + */ + private RemoteApplicationType remoteApplicationType; + + /* + * Access level allowed for this remote application type + */ + private AccessLevel accessLevel; + + /* + * Expiration time stamp + */ + private OffsetDateTime expirationTimeStampInUTC; + + /** + * Creates an instance of RemoteSupportSettings class. + */ + public RemoteSupportSettings() { + } + + /** + * Get the remoteApplicationType property: Remote application type. + * + * @return the remoteApplicationType value. + */ + public RemoteApplicationType remoteApplicationType() { + return this.remoteApplicationType; + } + + /** + * Set the remoteApplicationType property: Remote application type. + * + * @param remoteApplicationType the remoteApplicationType value to set. + * @return the RemoteSupportSettings object itself. + */ + public RemoteSupportSettings withRemoteApplicationType(RemoteApplicationType remoteApplicationType) { + this.remoteApplicationType = remoteApplicationType; + return this; + } + + /** + * Get the accessLevel property: Access level allowed for this remote application type. + * + * @return the accessLevel value. + */ + public AccessLevel accessLevel() { + return this.accessLevel; + } + + /** + * Set the accessLevel property: Access level allowed for this remote application type. + * + * @param accessLevel the accessLevel value to set. + * @return the RemoteSupportSettings object itself. + */ + public RemoteSupportSettings withAccessLevel(AccessLevel accessLevel) { + this.accessLevel = accessLevel; + return this; + } + + /** + * Get the expirationTimeStampInUTC property: Expiration time stamp. + * + * @return the expirationTimeStampInUTC value. + */ + public OffsetDateTime expirationTimeStampInUTC() { + return this.expirationTimeStampInUTC; + } + + /** + * Set the expirationTimeStampInUTC property: Expiration time stamp. + * + * @param expirationTimeStampInUTC the expirationTimeStampInUTC value to set. + * @return the RemoteSupportSettings object itself. + */ + public RemoteSupportSettings withExpirationTimeStampInUTC(OffsetDateTime expirationTimeStampInUTC) { + this.expirationTimeStampInUTC = expirationTimeStampInUTC; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("remoteApplicationType", + this.remoteApplicationType == null ? null : this.remoteApplicationType.toString()); + jsonWriter.writeStringField("accessLevel", this.accessLevel == null ? null : this.accessLevel.toString()); + jsonWriter.writeStringField("expirationTimeStampInUTC", + this.expirationTimeStampInUTC == null + ? null + : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.expirationTimeStampInUTC)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RemoteSupportSettings from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RemoteSupportSettings if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the RemoteSupportSettings. + */ + public static RemoteSupportSettings fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RemoteSupportSettings deserializedRemoteSupportSettings = new RemoteSupportSettings(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("remoteApplicationType".equals(fieldName)) { + deserializedRemoteSupportSettings.remoteApplicationType + = RemoteApplicationType.fromString(reader.getString()); + } else if ("accessLevel".equals(fieldName)) { + deserializedRemoteSupportSettings.accessLevel = AccessLevel.fromString(reader.getString()); + } else if ("expirationTimeStampInUTC".equals(fieldName)) { + deserializedRemoteSupportSettings.expirationTimeStampInUTC = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else { + reader.skipChildren(); + } + } + + return deserializedRemoteSupportSettings; + }); + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/ResourceIdentity.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/ResourceIdentity.java new file mode 100644 index 000000000000..a4b792b829ec --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/ResourceIdentity.java @@ -0,0 +1,117 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.databoxedge.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Msi identity details of the resource. + */ +@Fluent +public final class ResourceIdentity implements JsonSerializable { + /* + * Identity type + */ + private MsiIdentityType type; + + /* + * Service Principal Id backing the Msi + */ + private String principalId; + + /* + * Home Tenant Id + */ + private String tenantId; + + /** + * Creates an instance of ResourceIdentity class. + */ + public ResourceIdentity() { + } + + /** + * Get the type property: Identity type. + * + * @return the type value. + */ + public MsiIdentityType type() { + return this.type; + } + + /** + * Set the type property: Identity type. + * + * @param type the type value to set. + * @return the ResourceIdentity object itself. + */ + public ResourceIdentity withType(MsiIdentityType type) { + this.type = type; + return this; + } + + /** + * Get the principalId property: Service Principal Id backing the Msi. + * + * @return the principalId value. + */ + public String principalId() { + return this.principalId; + } + + /** + * Get the tenantId property: Home Tenant Id. + * + * @return the tenantId value. + */ + public String tenantId() { + return this.tenantId; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ResourceIdentity from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ResourceIdentity if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the ResourceIdentity. + */ + public static ResourceIdentity fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ResourceIdentity deserializedResourceIdentity = new ResourceIdentity(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("type".equals(fieldName)) { + deserializedResourceIdentity.type = MsiIdentityType.fromString(reader.getString()); + } else if ("principalId".equals(fieldName)) { + deserializedResourceIdentity.principalId = reader.getString(); + } else if ("tenantId".equals(fieldName)) { + deserializedResourceIdentity.tenantId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedResourceIdentity; + }); + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/ResourceMoveDetails.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/ResourceMoveDetails.java new file mode 100644 index 000000000000..c27308834b6c --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/ResourceMoveDetails.java @@ -0,0 +1,100 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.databoxedge.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; + +/** + * Fields for tracking resource move. + */ +@Immutable +public final class ResourceMoveDetails implements JsonSerializable { + /* + * Denotes whether move operation is in progress + */ + private ResourceMoveStatus operationInProgress; + + /* + * Denotes the timeout of the operation to finish + */ + private OffsetDateTime operationInProgressLockTimeoutInUTC; + + /** + * Creates an instance of ResourceMoveDetails class. + */ + private ResourceMoveDetails() { + } + + /** + * Get the operationInProgress property: Denotes whether move operation is in progress. + * + * @return the operationInProgress value. + */ + public ResourceMoveStatus operationInProgress() { + return this.operationInProgress; + } + + /** + * Get the operationInProgressLockTimeoutInUTC property: Denotes the timeout of the operation to finish. + * + * @return the operationInProgressLockTimeoutInUTC value. + */ + public OffsetDateTime operationInProgressLockTimeoutInUTC() { + return this.operationInProgressLockTimeoutInUTC; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("operationInProgress", + this.operationInProgress == null ? null : this.operationInProgress.toString()); + jsonWriter.writeStringField("operationInProgressLockTimeoutInUTC", + this.operationInProgressLockTimeoutInUTC == null + ? null + : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.operationInProgressLockTimeoutInUTC)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ResourceMoveDetails from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ResourceMoveDetails if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the ResourceMoveDetails. + */ + public static ResourceMoveDetails fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ResourceMoveDetails deserializedResourceMoveDetails = new ResourceMoveDetails(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("operationInProgress".equals(fieldName)) { + deserializedResourceMoveDetails.operationInProgress + = ResourceMoveStatus.fromString(reader.getString()); + } else if ("operationInProgressLockTimeoutInUTC".equals(fieldName)) { + deserializedResourceMoveDetails.operationInProgressLockTimeoutInUTC = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else { + reader.skipChildren(); + } + } + + return deserializedResourceMoveDetails; + }); + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/ResourceMoveStatus.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/ResourceMoveStatus.java new file mode 100644 index 000000000000..d5797ad15511 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/ResourceMoveStatus.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.databoxedge.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Denotes whether move operation is in progress. + */ +public final class ResourceMoveStatus extends ExpandableStringEnum { + /** + * None. + */ + public static final ResourceMoveStatus NONE = fromString("None"); + + /** + * ResourceMoveInProgress. + */ + public static final ResourceMoveStatus RESOURCE_MOVE_IN_PROGRESS = fromString("ResourceMoveInProgress"); + + /** + * ResourceMoveFailed. + */ + public static final ResourceMoveStatus RESOURCE_MOVE_FAILED = fromString("ResourceMoveFailed"); + + /** + * Creates a new instance of ResourceMoveStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ResourceMoveStatus() { + } + + /** + * Creates or finds a ResourceMoveStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding ResourceMoveStatus. + */ + public static ResourceMoveStatus fromString(String name) { + return fromString(name, ResourceMoveStatus.class); + } + + /** + * Gets known ResourceMoveStatus values. + * + * @return known ResourceMoveStatus values. + */ + public static Collection values() { + return values(ResourceMoveStatus.class); + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/Role.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/Role.java index d82688622299..9a11754e8cc3 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/Role.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/Role.java @@ -1,9 +1,11 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.models; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; import com.azure.resourcemanager.databoxedge.fluent.models.RoleInner; /** @@ -31,6 +33,13 @@ public interface Role { */ String type(); + /** + * Gets the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + RoleProperties properties(); + /** * Gets the kind property: Role type. * @@ -38,10 +47,176 @@ public interface Role { */ RoleTypes kind(); + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + /** * Gets the inner com.azure.resourcemanager.databoxedge.fluent.models.RoleInner object. * * @return the inner object. */ RoleInner innerModel(); + + /** + * The entirety of the Role definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithKind, + DefinitionStages.WithCreate { + } + + /** + * The Role definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the Role definition. + */ + interface Blank extends WithParentResource { + } + + /** + * The stage of the Role definition allowing to specify parent resource. + */ + interface WithParentResource { + /** + * Specifies resourceGroupName, deviceName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @return the next definition stage. + */ + WithKind withExistingDataBoxEdgeDevice(String resourceGroupName, String deviceName); + } + + /** + * The stage of the Role definition allowing to specify kind. + */ + interface WithKind { + /** + * Specifies the kind property: Role type.. + * + * @param kind Role type. + * @return the next definition stage. + */ + WithCreate withKind(RoleTypes kind); + } + + /** + * The stage of the Role definition which contains all the minimum required properties for the resource to be + * created, but also allows for any other optional properties to be specified. + */ + interface WithCreate extends DefinitionStages.WithProperties { + /** + * Executes the create request. + * + * @return the created resource. + */ + Role create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + Role create(Context context); + } + + /** + * The stage of the Role definition allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: The resource-specific properties for this resource.. + * + * @param properties The resource-specific properties for this resource. + * @return the next definition stage. + */ + WithCreate withProperties(RoleProperties properties); + } + } + + /** + * Begins update for the Role resource. + * + * @return the stage of resource update. + */ + Role.Update update(); + + /** + * The template for Role update. + */ + interface Update extends UpdateStages.WithProperties, UpdateStages.WithKind { + /** + * Executes the update request. + * + * @return the updated resource. + */ + Role apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + Role apply(Context context); + } + + /** + * The Role update stages. + */ + interface UpdateStages { + /** + * The stage of the Role update allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: The resource-specific properties for this resource.. + * + * @param properties The resource-specific properties for this resource. + * @return the next definition stage. + */ + Update withProperties(RoleProperties properties); + } + + /** + * The stage of the Role update allowing to specify kind. + */ + interface WithKind { + /** + * Specifies the kind property: Role type.. + * + * @param kind Role type. + * @return the next definition stage. + */ + Update withKind(RoleTypes kind); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + Role refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + Role refresh(Context context); } diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/RoleProperties.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/RoleProperties.java new file mode 100644 index 000000000000..2cec24396353 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/RoleProperties.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.databoxedge.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The RoleProperties model. + */ +@Immutable +public final class RoleProperties implements JsonSerializable { + /** + * Creates an instance of RoleProperties class. + */ + public RoleProperties() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RoleProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RoleProperties if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the RoleProperties. + */ + public static RoleProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RoleProperties deserializedRoleProperties = new RoleProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + reader.skipChildren(); + } + + return deserializedRoleProperties; + }); + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/RoleTypes.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/RoleTypes.java index 21ed5b20ecc3..4b18b40c9667 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/RoleTypes.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/RoleTypes.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.models; @@ -12,25 +12,40 @@ */ public final class RoleTypes extends ExpandableStringEnum { /** - * Static value IOT for RoleTypes. + * IOT. */ public static final RoleTypes IOT = fromString("IOT"); /** - * Static value ASA for RoleTypes. + * ASA. */ public static final RoleTypes ASA = fromString("ASA"); /** - * Static value Functions for RoleTypes. + * Functions. */ public static final RoleTypes FUNCTIONS = fromString("Functions"); /** - * Static value Cognitive for RoleTypes. + * Cognitive. */ public static final RoleTypes COGNITIVE = fromString("Cognitive"); + /** + * MEC. + */ + public static final RoleTypes MEC = fromString("MEC"); + + /** + * CloudEdgeManagement. + */ + public static final RoleTypes CLOUD_EDGE_MANAGEMENT = fromString("CloudEdgeManagement"); + + /** + * Kubernetes. + */ + public static final RoleTypes KUBERNETES = fromString("Kubernetes"); + /** * Creates a new instance of RoleTypes value. * diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/Roles.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/Roles.java index e59725e6b078..2d18dcbd7651 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/Roles.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/Roles.java @@ -1,121 +1,143 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.models; import com.azure.core.http.rest.PagedIterable; import com.azure.core.http.rest.Response; import com.azure.core.util.Context; -import com.azure.resourcemanager.databoxedge.fluent.models.RoleInner; /** * Resource collection API of Roles. */ public interface Roles { /** - * Lists all the roles configured in a Data Box Edge/Data Box Gateway device. + * Gets a specific role by name. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param resourceGroupName The resource group name. + * @param name The role name. + * @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 collection of all the roles on the Data Box Edge device as paginated response with {@link PagedIterable}. + * @return a specific role by name along with {@link Response}. */ - PagedIterable listByDataBoxEdgeDevice(String deviceName, String resourceGroupName); + Response getWithResponse(String resourceGroupName, String deviceName, String name, Context context); /** - * Lists all the roles configured in a Data Box Edge/Data Box Gateway device. + * Gets a specific role by name. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param resourceGroupName The resource group name. - * @param context The context to associate with this operation. + * @param name The role name. * @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 collection of all the roles on the Data Box Edge device as paginated response with {@link PagedIterable}. + * @return a specific role by name. */ - PagedIterable listByDataBoxEdgeDevice(String deviceName, String resourceGroupName, Context context); + Role get(String resourceGroupName, String deviceName, String name); /** - * Gets a specific role by name. + * Deletes the role on the device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. * @param name The role name. - * @param resourceGroupName The resource group name. - * @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 a specific role by name along with {@link Response}. */ - Response getWithResponse(String deviceName, String name, String resourceGroupName, Context context); + void delete(String resourceGroupName, String deviceName, String name); /** - * Gets a specific role by name. + * Deletes the role on the device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. * @param name The role name. - * @param resourceGroupName The resource group name. + * @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 a specific role by name. */ - Role get(String deviceName, String name, String resourceGroupName); + void delete(String resourceGroupName, String deviceName, String name, Context context); /** - * Create or update a role. + * Lists all the roles configured in a Data Box Edge/Data Box Gateway device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param name The role name. - * @param resourceGroupName The resource group name. - * @param role The role properties. * @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 compute role. + * @return collection of all the roles on the Data Box Edge device as paginated response with {@link PagedIterable}. */ - Role createOrUpdate(String deviceName, String name, String resourceGroupName, RoleInner role); + PagedIterable listByDataBoxEdgeDevice(String resourceGroupName, String deviceName); /** - * Create or update a role. + * Lists all the roles configured in a Data Box Edge/Data Box Gateway device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param name The role name. - * @param resourceGroupName The resource group name. - * @param role The role properties. * @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 compute role. + * @return collection of all the roles on the Data Box Edge device as paginated response with {@link PagedIterable}. */ - Role createOrUpdate(String deviceName, String name, String resourceGroupName, RoleInner role, Context context); + PagedIterable listByDataBoxEdgeDevice(String resourceGroupName, String deviceName, Context context); + + /** + * Gets a specific role by name. + * + * @param id the resource ID. + * @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 a specific role by name along with {@link Response}. + */ + Role getById(String id); + + /** + * Gets a specific role by name. + * + * @param id the resource ID. + * @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 a specific role by name along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); /** * Deletes the role on the device. * - * @param deviceName The device name. - * @param name The role name. - * @param resourceGroupName The resource group name. + * @param id the resource ID. * @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 delete(String deviceName, String name, String resourceGroupName); + void deleteById(String id); /** * Deletes the role on the device. * - * @param deviceName The device name. - * @param name The role name. - * @param resourceGroupName The resource group name. + * @param id the resource ID. * @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. */ - void delete(String deviceName, String name, String resourceGroupName, Context context); + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new Role resource. + * + * @param name resource name. + * @return the first stage of the new Role definition. + */ + Role.DefinitionStages.Blank define(String name); } diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/Secret.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/Secret.java new file mode 100644 index 000000000000..92399b8ea621 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/Secret.java @@ -0,0 +1,92 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.databoxedge.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Holds device secret either as a KeyVault reference or as an encrypted value. + */ +@Immutable +public final class Secret implements JsonSerializable { + /* + * Encrypted (using device public key) secret value. + */ + private AsymmetricEncryptedSecret encryptedSecret; + + /* + * Id of the Key-Vault where secret is stored (ex: secrets/AuthClientSecret/82ef4346187a4033a10d629cde07d740). + */ + private String keyVaultId; + + /** + * Creates an instance of Secret class. + */ + private Secret() { + } + + /** + * Get the encryptedSecret property: Encrypted (using device public key) secret value. + * + * @return the encryptedSecret value. + */ + public AsymmetricEncryptedSecret encryptedSecret() { + return this.encryptedSecret; + } + + /** + * Get the keyVaultId property: Id of the Key-Vault where secret is stored (ex: + * secrets/AuthClientSecret/82ef4346187a4033a10d629cde07d740). + * + * @return the keyVaultId value. + */ + public String keyVaultId() { + return this.keyVaultId; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("encryptedSecret", this.encryptedSecret); + jsonWriter.writeStringField("keyVaultId", this.keyVaultId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Secret from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Secret if the JsonReader was pointing to an instance of it, or null if it was pointing to + * JSON null. + * @throws IOException If an error occurs while reading the Secret. + */ + public static Secret fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Secret deserializedSecret = new Secret(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("encryptedSecret".equals(fieldName)) { + deserializedSecret.encryptedSecret = AsymmetricEncryptedSecret.fromJson(reader); + } else if ("keyVaultId".equals(fieldName)) { + deserializedSecret.keyVaultId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedSecret; + }); + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/SecuritySettings.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/SecuritySettings.java index b865d9f13b62..5751e1c9eb0b 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/SecuritySettings.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/SecuritySettings.java @@ -1,11 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; @@ -16,24 +15,24 @@ * The security settings of a device. */ @Fluent -public final class SecuritySettings extends ArmBaseModel { +public final class SecuritySettings extends ARMBaseModel { /* * Properties of the security settings. */ private SecuritySettingsProperties innerProperties = new SecuritySettingsProperties(); /* - * The type of the resource. + * The hierarchical type of the object. */ private String type; /* - * The name of the resource. + * The object name. */ private String name; /* - * Fully qualified resource Id for the resource. + * The path ID that uniquely identifies the object. */ private String id; @@ -53,7 +52,7 @@ private SecuritySettingsProperties innerProperties() { } /** - * Get the type property: The type of the resource. + * Get the type property: The hierarchical type of the object. * * @return the type value. */ @@ -63,7 +62,7 @@ public String type() { } /** - * Get the name property: The name of the resource. + * Get the name property: The object name. * * @return the name value. */ @@ -73,7 +72,7 @@ public String name() { } /** - * Get the id property: Fully qualified resource Id for the resource. + * Get the id property: The path ID that uniquely identifies the object. * * @return the id value. */ @@ -109,24 +108,6 @@ public SecuritySettings withDeviceAdminPassword(AsymmetricEncryptedSecret device return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - if (innerProperties() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property innerProperties in model SecuritySettings")); - } else { - innerProperties().validate(); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(SecuritySettings.class); - /** * {@inheritDoc} */ diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/Share.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/Share.java index 643129088998..ed8d88df090b 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/Share.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/Share.java @@ -1,9 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.models; +import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.databoxedge.fluent.models.ShareInner; import java.util.List; @@ -33,6 +34,13 @@ public interface Share { */ String type(); + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + /** * Gets the description property: Description for the share. * @@ -142,13 +150,13 @@ interface Blank extends WithParentResource { */ interface WithParentResource { /** - * Specifies deviceName, resourceGroupName. + * Specifies resourceGroupName, deviceName. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param resourceGroupName The resource group name. * @return the next definition stage. */ - WithShareStatus withExistingDataBoxEdgeDevice(String deviceName, String resourceGroupName); + WithShareStatus withExistingDataBoxEdgeDevice(String resourceGroupName, String deviceName); } /** diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/ShareAccessProtocol.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/ShareAccessProtocol.java index 3277be39db8e..77553c6784ed 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/ShareAccessProtocol.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/ShareAccessProtocol.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.models; @@ -12,12 +12,12 @@ */ public final class ShareAccessProtocol extends ExpandableStringEnum { /** - * Static value SMB for ShareAccessProtocol. + * SMB. */ public static final ShareAccessProtocol SMB = fromString("SMB"); /** - * Static value NFS for ShareAccessProtocol. + * NFS. */ public static final ShareAccessProtocol NFS = fromString("NFS"); diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/ShareAccessRight.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/ShareAccessRight.java index f08cfb2a1b5c..4bf92c813a7f 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/ShareAccessRight.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/ShareAccessRight.java @@ -1,11 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.models; -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -15,7 +14,7 @@ /** * Specifies the mapping between this particular user and the type of access he has on shares on this device. */ -@Fluent +@Immutable public final class ShareAccessRight implements JsonSerializable { /* * The share ID. @@ -30,7 +29,7 @@ public final class ShareAccessRight implements JsonSerializable { /** - * Static value Change for ShareAccessType. + * Change. */ public static final ShareAccessType CHANGE = fromString("Change"); /** - * Static value Read for ShareAccessType. + * Read. */ public static final ShareAccessType READ = fromString("Read"); /** - * Static value Custom for ShareAccessType. + * Custom. */ public static final ShareAccessType CUSTOM = fromString("Custom"); diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/ShareStatus.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/ShareStatus.java index e41a74096428..be2cb0930885 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/ShareStatus.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/ShareStatus.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.models; @@ -12,27 +12,27 @@ */ public final class ShareStatus extends ExpandableStringEnum { /** - * Static value Offline for ShareStatus. + * Offline. */ public static final ShareStatus OFFLINE = fromString("Offline"); /** - * Static value Unknown for ShareStatus. + * Unknown. */ public static final ShareStatus UNKNOWN = fromString("Unknown"); /** - * Static value OK for ShareStatus. + * OK. */ public static final ShareStatus OK = fromString("OK"); /** - * Static value Updating for ShareStatus. + * Updating. */ public static final ShareStatus UPDATING = fromString("Updating"); /** - * Static value NeedsAttention for ShareStatus. + * NeedsAttention. */ public static final ShareStatus NEEDS_ATTENTION = fromString("NeedsAttention"); diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/Shares.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/Shares.java index 92dfbd726e17..a62454fc2c3c 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/Shares.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/Shares.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.models; @@ -13,108 +13,108 @@ */ public interface Shares { /** - * Lists all the shares in a Data Box Edge/Data Box Gateway device. + * Gets a share by name. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param resourceGroupName The resource group name. + * @param name The share name. + * @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 collection of all the shares on the Data Box Edge/Gateway device as paginated response with - * {@link PagedIterable}. + * @return a share by name along with {@link Response}. */ - PagedIterable listByDataBoxEdgeDevice(String deviceName, String resourceGroupName); + Response getWithResponse(String resourceGroupName, String deviceName, String name, Context context); /** - * Lists all the shares in a Data Box Edge/Data Box Gateway device. + * Gets a share by name. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param resourceGroupName The resource group name. - * @param context The context to associate with this operation. + * @param name The share name. * @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 collection of all the shares on the Data Box Edge/Gateway device as paginated response with - * {@link PagedIterable}. + * @return a share by name. */ - PagedIterable listByDataBoxEdgeDevice(String deviceName, String resourceGroupName, Context context); + Share get(String resourceGroupName, String deviceName, String name); /** - * Gets a share by name. + * Deletes the share on the Data Box Edge/Data Box Gateway device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. * @param name The share name. - * @param resourceGroupName The resource group name. - * @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 a share by name along with {@link Response}. */ - Response getWithResponse(String deviceName, String name, String resourceGroupName, Context context); + void delete(String resourceGroupName, String deviceName, String name); /** - * Gets a share by name. + * Deletes the share on the Data Box Edge/Data Box Gateway device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. * @param name The share name. - * @param resourceGroupName The resource group name. + * @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 a share by name. */ - Share get(String deviceName, String name, String resourceGroupName); + void delete(String resourceGroupName, String deviceName, String name, Context context); /** - * Deletes the share on the Data Box Edge/Data Box Gateway device. + * Lists all the shares in a Data Box Edge/Data Box Gateway device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param name The share name. - * @param resourceGroupName The resource group name. * @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 collection of all the shares on the Data Box Edge/Gateway device as paginated response with + * {@link PagedIterable}. */ - void delete(String deviceName, String name, String resourceGroupName); + PagedIterable listByDataBoxEdgeDevice(String resourceGroupName, String deviceName); /** - * Deletes the share on the Data Box Edge/Data Box Gateway device. + * Lists all the shares in a Data Box Edge/Data Box Gateway device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param name The share name. - * @param resourceGroupName The resource group name. * @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 collection of all the shares on the Data Box Edge/Gateway device as paginated response with + * {@link PagedIterable}. */ - void delete(String deviceName, String name, String resourceGroupName, Context context); + PagedIterable listByDataBoxEdgeDevice(String resourceGroupName, String deviceName, Context context); /** * Refreshes the share metadata with the data from the cloud. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. * @param name The share name. - * @param resourceGroupName The resource group name. * @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 refresh(String deviceName, String name, String resourceGroupName); + void refresh(String resourceGroupName, String deviceName, String name); /** * Refreshes the share metadata with the data from the cloud. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. * @param name The share name. - * @param resourceGroupName The resource group name. * @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. */ - void refresh(String deviceName, String name, String resourceGroupName, Context context); + void refresh(String resourceGroupName, String deviceName, String name, Context context); /** * Gets a share by name. diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/ShipmentType.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/ShipmentType.java new file mode 100644 index 000000000000..0693fd30b9f9 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/ShipmentType.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.databoxedge.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Defines values for ShipmentType. + */ +public final class ShipmentType extends ExpandableStringEnum { + /** + * NotApplicable. + */ + public static final ShipmentType NOT_APPLICABLE = fromString("NotApplicable"); + + /** + * ShippedToCustomer. + */ + public static final ShipmentType SHIPPED_TO_CUSTOMER = fromString("ShippedToCustomer"); + + /** + * SelfPickup. + */ + public static final ShipmentType SELF_PICKUP = fromString("SelfPickup"); + + /** + * Creates a new instance of ShipmentType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ShipmentType() { + } + + /** + * Creates or finds a ShipmentType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ShipmentType. + */ + public static ShipmentType fromString(String name) { + return fromString(name, ShipmentType.class); + } + + /** + * Gets known ShipmentType values. + * + * @return known ShipmentType values. + */ + public static Collection values() { + return values(ShipmentType.class); + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/Sku.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/Sku.java index 7cafede1e250..55a35917a984 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/Sku.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/Sku.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.models; @@ -72,14 +72,6 @@ public Sku withTier(SkuTier tier) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/SkuAvailability.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/SkuAvailability.java new file mode 100644 index 000000000000..e2854e613320 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/SkuAvailability.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.databoxedge.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Links to the next set of results. + */ +public final class SkuAvailability extends ExpandableStringEnum { + /** + * Available. + */ + public static final SkuAvailability AVAILABLE = fromString("Available"); + + /** + * Unavailable. + */ + public static final SkuAvailability UNAVAILABLE = fromString("Unavailable"); + + /** + * Creates a new instance of SkuAvailability value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public SkuAvailability() { + } + + /** + * Creates or finds a SkuAvailability from its string representation. + * + * @param name a name to look for. + * @return the corresponding SkuAvailability. + */ + public static SkuAvailability fromString(String name) { + return fromString(name, SkuAvailability.class); + } + + /** + * Gets known SkuAvailability values. + * + * @return known SkuAvailability values. + */ + public static Collection values() { + return values(SkuAvailability.class); + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/SkuCapability.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/SkuCapability.java new file mode 100644 index 000000000000..363912bebce8 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/SkuCapability.java @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.databoxedge.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The metadata to describe the capability. + */ +@Immutable +public final class SkuCapability implements JsonSerializable { + /* + * An invariant to describe the feature. + */ + private String name; + + /* + * An invariant if the feature is measured by quantity. + */ + private String value; + + /** + * Creates an instance of SkuCapability class. + */ + private SkuCapability() { + } + + /** + * Get the name property: An invariant to describe the feature. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the value property: An invariant if the feature is measured by quantity. + * + * @return the value value. + */ + public String value() { + return this.value; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SkuCapability from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SkuCapability if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the SkuCapability. + */ + public static SkuCapability fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SkuCapability deserializedSkuCapability = new SkuCapability(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedSkuCapability.name = reader.getString(); + } else if ("value".equals(fieldName)) { + deserializedSkuCapability.value = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedSkuCapability; + }); + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/SkuCost.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/SkuCost.java index 1adf3474565a..fb5901a4191e 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/SkuCost.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/SkuCost.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.models; @@ -27,14 +27,14 @@ public final class SkuCost implements JsonSerializable { private Long quantity; /* - * Restriction of the SKU for the location/zone + * The extended unit. */ private String extendedUnit; /** * Creates an instance of SkuCost class. */ - public SkuCost() { + private SkuCost() { } /** @@ -56,7 +56,7 @@ public Long quantity() { } /** - * Get the extendedUnit property: Restriction of the SKU for the location/zone. + * Get the extendedUnit property: The extended unit. * * @return the extendedUnit value. */ @@ -64,14 +64,6 @@ public String extendedUnit() { return this.extendedUnit; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/SkuLocationInfo.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/SkuLocationInfo.java index c4e8008502ec..a47df4112197 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/SkuLocationInfo.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/SkuLocationInfo.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.models; @@ -35,7 +35,7 @@ public final class SkuLocationInfo implements JsonSerializable /** * Creates an instance of SkuLocationInfo class. */ - public SkuLocationInfo() { + private SkuLocationInfo() { } /** @@ -65,14 +65,6 @@ public List sites() { return this.sites; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/SkuName.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/SkuName.java index 8bdf0944d6d9..4deebdd636ab 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/SkuName.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/SkuName.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.models; @@ -12,50 +12,150 @@ */ public final class SkuName extends ExpandableStringEnum { /** - * Static value Gateway for SkuName. + * Gateway. */ public static final SkuName GATEWAY = fromString("Gateway"); /** - * Static value Edge for SkuName. + * Edge. */ public static final SkuName EDGE = fromString("Edge"); /** - * Static value TEA_1Node for SkuName. + * TEA_1Node. */ public static final SkuName TEA_1NODE = fromString("TEA_1Node"); /** - * Static value TEA_1Node_UPS for SkuName. + * TEA_1Node_UPS. */ public static final SkuName TEA_1NODE_UPS = fromString("TEA_1Node_UPS"); /** - * Static value TEA_1Node_Heater for SkuName. + * TEA_1Node_Heater. */ public static final SkuName TEA_1NODE_HEATER = fromString("TEA_1Node_Heater"); /** - * Static value TEA_1Node_UPS_Heater for SkuName. + * TEA_1Node_UPS_Heater. */ public static final SkuName TEA_1NODE_UPS_HEATER = fromString("TEA_1Node_UPS_Heater"); /** - * Static value TEA_4Node_Heater for SkuName. + * TEA_4Node_Heater. */ public static final SkuName TEA_4NODE_HEATER = fromString("TEA_4Node_Heater"); /** - * Static value TEA_4Node_UPS_Heater for SkuName. + * TEA_4Node_UPS_Heater. */ public static final SkuName TEA_4NODE_UPS_HEATER = fromString("TEA_4Node_UPS_Heater"); /** - * Static value TMA for SkuName. + * TMA. */ public static final SkuName TMA = fromString("TMA"); + /** + * TDC. + */ + public static final SkuName TDC = fromString("TDC"); + + /** + * TCA_Small. + */ + public static final SkuName TCA_SMALL = fromString("TCA_Small"); + + /** + * GPU. + */ + public static final SkuName GPU = fromString("GPU"); + + /** + * TCA_Large. + */ + public static final SkuName TCA_LARGE = fromString("TCA_Large"); + + /** + * EdgeP_Base. + */ + public static final SkuName EDGE_P_BASE = fromString("EdgeP_Base"); + + /** + * EdgeP_High. + */ + public static final SkuName EDGE_P_HIGH = fromString("EdgeP_High"); + + /** + * EdgePR_Base. + */ + public static final SkuName EDGE_PR_BASE = fromString("EdgePR_Base"); + + /** + * EdgePR_Base_UPS. + */ + public static final SkuName EDGE_PR_BASE_UPS = fromString("EdgePR_Base_UPS"); + + /** + * EP2_64_1VPU_W. + */ + public static final SkuName EP2_64_1VPU_W = fromString("EP2_64_1VPU_W"); + + /** + * EP2_128_1T4_Mx1_W. + */ + public static final SkuName EP2_128_1T4_MX1_W = fromString("EP2_128_1T4_Mx1_W"); + + /** + * EP2_256_2T4_W. + */ + public static final SkuName EP2_256_2T4_W = fromString("EP2_256_2T4_W"); + + /** + * EdgeMR_Mini. + */ + public static final SkuName EDGE_MR_MINI = fromString("EdgeMR_Mini"); + + /** + * RCA_Small. + */ + public static final SkuName RCA_SMALL = fromString("RCA_Small"); + + /** + * RCA_Large. + */ + public static final SkuName RCA_LARGE = fromString("RCA_Large"); + + /** + * RDC. + */ + public static final SkuName RDC = fromString("RDC"); + + /** + * Management. + */ + public static final SkuName MANAGEMENT = fromString("Management"); + + /** + * EP2_64_Mx1_W. + */ + public static final SkuName EP2_64_MX1_W = fromString("EP2_64_Mx1_W"); + + /** + * EP2_128_GPU1_Mx1_W. + */ + public static final SkuName EP2_128_GPU1_MX1_W = fromString("EP2_128_GPU1_Mx1_W"); + + /** + * EP2_256_GPU2_Mx1. + */ + public static final SkuName EP2_256_GPU2_MX1 = fromString("EP2_256_GPU2_Mx1"); + + /** + * EdgeMR_TCP. + */ + public static final SkuName EDGE_MR_TCP = fromString("EdgeMR_TCP"); + /** * Creates a new instance of SkuName value. * diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/SkuSignupOption.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/SkuSignupOption.java new file mode 100644 index 000000000000..b9b98df37012 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/SkuSignupOption.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.databoxedge.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Sku can be signed up by customer or not. + */ +public final class SkuSignupOption extends ExpandableStringEnum { + /** + * None. + */ + public static final SkuSignupOption NONE = fromString("None"); + + /** + * Available. + */ + public static final SkuSignupOption AVAILABLE = fromString("Available"); + + /** + * Creates a new instance of SkuSignupOption value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public SkuSignupOption() { + } + + /** + * Creates or finds a SkuSignupOption from its string representation. + * + * @param name a name to look for. + * @return the corresponding SkuSignupOption. + */ + public static SkuSignupOption fromString(String name) { + return fromString(name, SkuSignupOption.class); + } + + /** + * Gets known SkuSignupOption values. + * + * @return known SkuSignupOption values. + */ + public static Collection values() { + return values(SkuSignupOption.class); + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/SkuTier.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/SkuTier.java index 191b4928b1d7..66e467bf906f 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/SkuTier.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/SkuTier.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.models; @@ -12,7 +12,7 @@ */ public final class SkuTier extends ExpandableStringEnum { /** - * Static value Standard for SkuTier. + * Standard. */ public static final SkuTier STANDARD = fromString("Standard"); diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/SkuVersion.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/SkuVersion.java new file mode 100644 index 000000000000..8c8affd8f812 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/SkuVersion.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.databoxedge.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Availability of the Sku as preview/stable. + */ +public final class SkuVersion extends ExpandableStringEnum { + /** + * Stable. + */ + public static final SkuVersion STABLE = fromString("Stable"); + + /** + * Preview. + */ + public static final SkuVersion PREVIEW = fromString("Preview"); + + /** + * Creates a new instance of SkuVersion value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public SkuVersion() { + } + + /** + * Creates or finds a SkuVersion from its string representation. + * + * @param name a name to look for. + * @return the corresponding SkuVersion. + */ + public static SkuVersion fromString(String name) { + return fromString(name, SkuVersion.class); + } + + /** + * Gets known SkuVersion values. + * + * @return known SkuVersion values. + */ + public static Collection values() { + return values(SkuVersion.class); + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/SslStatus.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/SslStatus.java index c6dcb8b672ec..bd76405e5818 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/SslStatus.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/SslStatus.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.models; @@ -10,42 +10,42 @@ /** * Signifies whether SSL needs to be enabled or not. */ -public final class SslStatus extends ExpandableStringEnum { +public final class SSLStatus extends ExpandableStringEnum { /** - * Static value Enabled for SslStatus. + * Enabled. */ - public static final SslStatus ENABLED = fromString("Enabled"); + public static final SSLStatus ENABLED = fromString("Enabled"); /** - * Static value Disabled for SslStatus. + * Disabled. */ - public static final SslStatus DISABLED = fromString("Disabled"); + public static final SSLStatus DISABLED = fromString("Disabled"); /** - * Creates a new instance of SslStatus value. + * Creates a new instance of SSLStatus value. * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated - public SslStatus() { + public SSLStatus() { } /** - * Creates or finds a SslStatus from its string representation. + * Creates or finds a SSLStatus from its string representation. * * @param name a name to look for. - * @return the corresponding SslStatus. + * @return the corresponding SSLStatus. */ - public static SslStatus fromString(String name) { - return fromString(name, SslStatus.class); + public static SSLStatus fromString(String name) { + return fromString(name, SSLStatus.class); } /** - * Gets known SslStatus values. + * Gets known SSLStatus values. * - * @return known SslStatus values. + * @return known SSLStatus values. */ - public static Collection values() { - return values(SslStatus.class); + public static Collection values() { + return values(SSLStatus.class); } } diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/StorageAccount.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/StorageAccount.java index d67ceabddeb6..1fb7caae2238 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/StorageAccount.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/StorageAccount.java @@ -1,9 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.models; +import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.databoxedge.fluent.models.StorageAccountInner; @@ -32,6 +33,13 @@ public interface StorageAccount { */ String type(); + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + /** * Gets the description property: Description for the storage Account. * @@ -92,8 +100,8 @@ public interface StorageAccount { /** * The entirety of the StorageAccount definition. */ - interface Definition - extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithParentResource, + DefinitionStages.WithDataPolicy, DefinitionStages.WithCreate { } /** @@ -111,13 +119,26 @@ interface Blank extends WithParentResource { */ interface WithParentResource { /** - * Specifies deviceName, resourceGroupName. + * Specifies resourceGroupName, deviceName. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param resourceGroupName The resource group name. * @return the next definition stage. */ - WithCreate withExistingDataBoxEdgeDevice(String deviceName, String resourceGroupName); + WithDataPolicy withExistingDataBoxEdgeDevice(String resourceGroupName, String deviceName); + } + + /** + * The stage of the StorageAccount definition allowing to specify dataPolicy. + */ + interface WithDataPolicy { + /** + * Specifies the dataPolicy property: Data policy of the storage Account.. + * + * @param dataPolicy Data policy of the storage Account. + * @return the next definition stage. + */ + WithCreate withDataPolicy(DataPolicy dataPolicy); } /** @@ -125,7 +146,7 @@ interface WithParentResource { * resource to be created, but also allows for any other optional properties to be specified. */ interface WithCreate extends DefinitionStages.WithDescription, DefinitionStages.WithStorageAccountStatus, - DefinitionStages.WithDataPolicy, DefinitionStages.WithStorageAccountCredentialId { + DefinitionStages.WithStorageAccountCredentialId { /** * Executes the create request. * @@ -168,19 +189,6 @@ interface WithStorageAccountStatus { WithCreate withStorageAccountStatus(StorageAccountStatus storageAccountStatus); } - /** - * The stage of the StorageAccount definition allowing to specify dataPolicy. - */ - interface WithDataPolicy { - /** - * Specifies the dataPolicy property: Data policy of the storage Account.. - * - * @param dataPolicy Data policy of the storage Account. - * @return the next definition stage. - */ - WithCreate withDataPolicy(DataPolicy dataPolicy); - } - /** * The stage of the StorageAccount definition allowing to specify storageAccountCredentialId. */ diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/StorageAccountCredential.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/StorageAccountCredential.java index e27969c50bc0..fc2bef921047 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/StorageAccountCredential.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/StorageAccountCredential.java @@ -1,9 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.models; +import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.databoxedge.fluent.models.StorageAccountCredentialInner; @@ -32,6 +33,13 @@ public interface StorageAccountCredential { */ String type(); + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + /** * Gets the alias property: Alias for the storage account. * @@ -40,11 +48,11 @@ public interface StorageAccountCredential { String alias(); /** - * Gets the username property: Username for the storage account. + * Gets the userName property: Username for the storage account. * - * @return the username value. + * @return the userName value. */ - String username(); + String userName(); /** * Gets the accountKey property: Encrypted storage key. @@ -66,7 +74,7 @@ public interface StorageAccountCredential { * * @return the sslStatus value. */ - SslStatus sslStatus(); + SSLStatus sslStatus(); /** * Gets the blobDomainName property: Blob end point for private clouds. @@ -126,13 +134,13 @@ interface Blank extends WithParentResource { */ interface WithParentResource { /** - * Specifies deviceName, resourceGroupName. + * Specifies resourceGroupName, deviceName. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param resourceGroupName The resource group name. * @return the next definition stage. */ - WithAlias withExistingDataBoxEdgeDevice(String deviceName, String resourceGroupName); + WithAlias withExistingDataBoxEdgeDevice(String resourceGroupName, String deviceName); } /** @@ -158,7 +166,7 @@ interface WithSslStatus { * @param sslStatus Signifies whether SSL needs to be enabled or not. * @return the next definition stage. */ - WithAccountType withSslStatus(SslStatus sslStatus); + WithAccountType withSslStatus(SSLStatus sslStatus); } /** @@ -178,7 +186,7 @@ interface WithAccountType { * The stage of the StorageAccountCredential definition which contains all the minimum required properties for * the resource to be created, but also allows for any other optional properties to be specified. */ - interface WithCreate extends DefinitionStages.WithUsername, DefinitionStages.WithAccountKey, + interface WithCreate extends DefinitionStages.WithUserName, DefinitionStages.WithAccountKey, DefinitionStages.WithConnectionString, DefinitionStages.WithBlobDomainName, DefinitionStages.WithStorageAccountId { /** @@ -198,16 +206,16 @@ interface WithCreate extends DefinitionStages.WithUsername, DefinitionStages.Wit } /** - * The stage of the StorageAccountCredential definition allowing to specify username. + * The stage of the StorageAccountCredential definition allowing to specify userName. */ - interface WithUsername { + interface WithUserName { /** - * Specifies the username property: Username for the storage account.. + * Specifies the userName property: Username for the storage account.. * - * @param username Username for the storage account. + * @param userName Username for the storage account. * @return the next definition stage. */ - WithCreate withUsername(String username); + WithCreate withUserName(String userName); } /** @@ -275,7 +283,7 @@ interface WithStorageAccountId { /** * The template for StorageAccountCredential update. */ - interface Update extends UpdateStages.WithAlias, UpdateStages.WithUsername, UpdateStages.WithAccountKey, + interface Update extends UpdateStages.WithAlias, UpdateStages.WithUserName, UpdateStages.WithAccountKey, UpdateStages.WithConnectionString, UpdateStages.WithSslStatus, UpdateStages.WithBlobDomainName, UpdateStages.WithAccountType, UpdateStages.WithStorageAccountId { /** @@ -312,16 +320,16 @@ interface WithAlias { } /** - * The stage of the StorageAccountCredential update allowing to specify username. + * The stage of the StorageAccountCredential update allowing to specify userName. */ - interface WithUsername { + interface WithUserName { /** - * Specifies the username property: Username for the storage account.. + * Specifies the userName property: Username for the storage account.. * - * @param username Username for the storage account. + * @param userName Username for the storage account. * @return the next definition stage. */ - Update withUsername(String username); + Update withUserName(String userName); } /** @@ -362,7 +370,7 @@ interface WithSslStatus { * @param sslStatus Signifies whether SSL needs to be enabled or not. * @return the next definition stage. */ - Update withSslStatus(SslStatus sslStatus); + Update withSslStatus(SSLStatus sslStatus); } /** diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/StorageAccountCredentials.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/StorageAccountCredentials.java index b39eb3078cf3..6b7fe395f35d 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/StorageAccountCredentials.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/StorageAccountCredentials.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.models; @@ -13,85 +13,85 @@ */ public interface StorageAccountCredentials { /** - * Gets all the storage account credentials in a Data Box Edge/Data Box Gateway device. + * Gets the properties of the specified storage account credential. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param resourceGroupName The resource group name. + * @param name The storage account credential name. + * @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 all the storage account credentials in a Data Box Edge/Data Box Gateway device as paginated response with - * {@link PagedIterable}. + * @return the properties of the specified storage account credential along with {@link Response}. */ - PagedIterable listByDataBoxEdgeDevice(String deviceName, String resourceGroupName); + Response getWithResponse(String resourceGroupName, String deviceName, String name, + Context context); /** - * Gets all the storage account credentials in a Data Box Edge/Data Box Gateway device. + * Gets the properties of the specified storage account credential. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param resourceGroupName The resource group name. - * @param context The context to associate with this operation. + * @param name The storage account credential name. * @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 all the storage account credentials in a Data Box Edge/Data Box Gateway device as paginated response with - * {@link PagedIterable}. + * @return the properties of the specified storage account credential. */ - PagedIterable listByDataBoxEdgeDevice(String deviceName, String resourceGroupName, - Context context); + StorageAccountCredential get(String resourceGroupName, String deviceName, String name); /** - * Gets the properties of the specified storage account credential. + * Deletes the storage account credential. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. * @param name The storage account credential name. - * @param resourceGroupName The resource group name. - * @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 properties of the specified storage account credential along with {@link Response}. */ - Response getWithResponse(String deviceName, String name, String resourceGroupName, - Context context); + void delete(String resourceGroupName, String deviceName, String name); /** - * Gets the properties of the specified storage account credential. + * Deletes the storage account credential. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. * @param name The storage account credential name. - * @param resourceGroupName The resource group name. + * @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 properties of the specified storage account credential. */ - StorageAccountCredential get(String deviceName, String name, String resourceGroupName); + void delete(String resourceGroupName, String deviceName, String name, Context context); /** - * Deletes the storage account credential. + * Gets all the storage account credentials in a Data Box Edge/Data Box Gateway device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param name The storage account credential name. - * @param resourceGroupName The resource group name. * @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 all the storage account credentials in a Data Box Edge/Data Box Gateway device as paginated response with + * {@link PagedIterable}. */ - void delete(String deviceName, String name, String resourceGroupName); + PagedIterable listByDataBoxEdgeDevice(String resourceGroupName, String deviceName); /** - * Deletes the storage account credential. + * Gets all the storage account credentials in a Data Box Edge/Data Box Gateway device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param name The storage account credential name. - * @param resourceGroupName The resource group name. * @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 all the storage account credentials in a Data Box Edge/Data Box Gateway device as paginated response with + * {@link PagedIterable}. */ - void delete(String deviceName, String name, String resourceGroupName, Context context); + PagedIterable listByDataBoxEdgeDevice(String resourceGroupName, String deviceName, + Context context); /** * Gets the properties of the specified storage account credential. diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/StorageAccountStatus.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/StorageAccountStatus.java index d999e0554478..38fc10f7d82b 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/StorageAccountStatus.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/StorageAccountStatus.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.models; @@ -12,27 +12,27 @@ */ public final class StorageAccountStatus extends ExpandableStringEnum { /** - * Static value OK for StorageAccountStatus. + * OK. */ public static final StorageAccountStatus OK = fromString("OK"); /** - * Static value Offline for StorageAccountStatus. + * Offline. */ public static final StorageAccountStatus OFFLINE = fromString("Offline"); /** - * Static value Unknown for StorageAccountStatus. + * Unknown. */ public static final StorageAccountStatus UNKNOWN = fromString("Unknown"); /** - * Static value Updating for StorageAccountStatus. + * Updating. */ public static final StorageAccountStatus UPDATING = fromString("Updating"); /** - * Static value NeedsAttention for StorageAccountStatus. + * NeedsAttention. */ public static final StorageAccountStatus NEEDS_ATTENTION = fromString("NeedsAttention"); diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/StorageAccounts.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/StorageAccounts.java index 175b7f91de99..35784c0373f0 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/StorageAccounts.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/StorageAccounts.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.models; @@ -13,84 +13,84 @@ */ public interface StorageAccounts { /** - * Lists all the storage accounts in a Data Box Edge/Data Box Gateway device. + * Gets a StorageAccount by name. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param resourceGroupName The resource group name. + * @param storageAccountName The storage account name. + * @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 collection of all the Storage Accounts on the Data Box Edge/Gateway device as paginated response with - * {@link PagedIterable}. + * @return a StorageAccount by name along with {@link Response}. */ - PagedIterable listByDataBoxEdgeDevice(String deviceName, String resourceGroupName); + Response getWithResponse(String resourceGroupName, String deviceName, String storageAccountName, + Context context); /** - * Lists all the storage accounts in a Data Box Edge/Data Box Gateway device. + * Gets a StorageAccount by name. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param resourceGroupName The resource group name. - * @param context The context to associate with this operation. + * @param storageAccountName The storage account name. * @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 collection of all the Storage Accounts on the Data Box Edge/Gateway device as paginated response with - * {@link PagedIterable}. + * @return a StorageAccount by name. */ - PagedIterable listByDataBoxEdgeDevice(String deviceName, String resourceGroupName, Context context); + StorageAccount get(String resourceGroupName, String deviceName, String storageAccountName); /** - * Gets a StorageAccount by name. + * Deletes the StorageAccount on the Data Box Edge/Data Box Gateway device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. * @param storageAccountName The storage account name. - * @param resourceGroupName The resource group name. - * @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 a StorageAccount by name along with {@link Response}. */ - Response getWithResponse(String deviceName, String storageAccountName, String resourceGroupName, - Context context); + void delete(String resourceGroupName, String deviceName, String storageAccountName); /** - * Gets a StorageAccount by name. + * Deletes the StorageAccount on the Data Box Edge/Data Box Gateway device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. * @param storageAccountName The storage account name. - * @param resourceGroupName The resource group name. + * @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 a StorageAccount by name. */ - StorageAccount get(String deviceName, String storageAccountName, String resourceGroupName); + void delete(String resourceGroupName, String deviceName, String storageAccountName, Context context); /** - * Deletes the StorageAccount on the Data Box Edge/Data Box Gateway device. + * Lists all the StorageAccounts in a Data Box Edge/Data Box Gateway device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param storageAccountName The StorageAccount name. - * @param resourceGroupName The resource group name. * @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 collection of all the Storage Accounts on the Data Box Edge/Gateway device as paginated response with + * {@link PagedIterable}. */ - void delete(String deviceName, String storageAccountName, String resourceGroupName); + PagedIterable listByDataBoxEdgeDevice(String resourceGroupName, String deviceName); /** - * Deletes the StorageAccount on the Data Box Edge/Data Box Gateway device. + * Lists all the StorageAccounts in a Data Box Edge/Data Box Gateway device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param storageAccountName The StorageAccount name. - * @param resourceGroupName The resource group name. * @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 collection of all the Storage Accounts on the Data Box Edge/Gateway device as paginated response with + * {@link PagedIterable}. */ - void delete(String deviceName, String storageAccountName, String resourceGroupName, Context context); + PagedIterable listByDataBoxEdgeDevice(String resourceGroupName, String deviceName, Context context); /** * Gets a StorageAccount by name. diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/SubscriptionRegisteredFeatures.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/SubscriptionRegisteredFeatures.java new file mode 100644 index 000000000000..f885cf4a7cc7 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/SubscriptionRegisteredFeatures.java @@ -0,0 +1,92 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.databoxedge.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The SubscriptionRegisteredFeatures model. + */ +@Immutable +public final class SubscriptionRegisteredFeatures implements JsonSerializable { + /* + * The name property. + */ + private String name; + + /* + * The state property. + */ + private String state; + + /** + * Creates an instance of SubscriptionRegisteredFeatures class. + */ + private SubscriptionRegisteredFeatures() { + } + + /** + * Get the name property: The name property. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the state property: The state property. + * + * @return the state value. + */ + public String state() { + return this.state; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("state", this.state); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SubscriptionRegisteredFeatures from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SubscriptionRegisteredFeatures if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the SubscriptionRegisteredFeatures. + */ + public static SubscriptionRegisteredFeatures fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SubscriptionRegisteredFeatures deserializedSubscriptionRegisteredFeatures + = new SubscriptionRegisteredFeatures(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedSubscriptionRegisteredFeatures.name = reader.getString(); + } else if ("state".equals(fieldName)) { + deserializedSubscriptionRegisteredFeatures.state = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedSubscriptionRegisteredFeatures; + }); + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/SubscriptionState.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/SubscriptionState.java new file mode 100644 index 000000000000..cf5e9b8d4363 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/SubscriptionState.java @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.databoxedge.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Defines values for SubscriptionState. + */ +public final class SubscriptionState extends ExpandableStringEnum { + /** + * Registered. + */ + public static final SubscriptionState REGISTERED = fromString("Registered"); + + /** + * Warned. + */ + public static final SubscriptionState WARNED = fromString("Warned"); + + /** + * Suspended. + */ + public static final SubscriptionState SUSPENDED = fromString("Suspended"); + + /** + * Deleted. + */ + public static final SubscriptionState DELETED = fromString("Deleted"); + + /** + * Unregistered. + */ + public static final SubscriptionState UNREGISTERED = fromString("Unregistered"); + + /** + * Creates a new instance of SubscriptionState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public SubscriptionState() { + } + + /** + * Creates or finds a SubscriptionState from its string representation. + * + * @param name a name to look for. + * @return the corresponding SubscriptionState. + */ + public static SubscriptionState fromString(String name) { + return fromString(name, SubscriptionState.class); + } + + /** + * Gets known SubscriptionState values. + * + * @return known SubscriptionState values. + */ + public static Collection values() { + return values(SubscriptionState.class); + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/SupportPackages.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/SupportPackages.java new file mode 100644 index 000000000000..3acc8d7b0d4d --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/SupportPackages.java @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.databoxedge.models; + +import com.azure.core.util.Context; + +/** + * Resource collection API of SupportPackages. + */ +public interface SupportPackages { + /** + * Triggers support package on the device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @param triggerSupportPackageRequest The trigger support package request object. + * @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 triggerSupportPackage(String resourceGroupName, String deviceName, + TriggerSupportPackageRequest triggerSupportPackageRequest); + + /** + * Triggers support package on the device. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @param triggerSupportPackageRequest The trigger support package request object. + * @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. + */ + void triggerSupportPackage(String resourceGroupName, String deviceName, + TriggerSupportPackageRequest triggerSupportPackageRequest, Context context); +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/TrackingInfo.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/TrackingInfo.java index 3d142bfa9773..06c9beace07c 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/TrackingInfo.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/TrackingInfo.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -14,7 +14,7 @@ /** * Tracking courier information. */ -@Fluent +@Immutable public final class TrackingInfo implements JsonSerializable { /* * Serial number of the device being tracked. @@ -39,7 +39,7 @@ public final class TrackingInfo implements JsonSerializable { /** * Creates an instance of TrackingInfo class. */ - public TrackingInfo() { + private TrackingInfo() { } /** @@ -51,17 +51,6 @@ public String serialNumber() { return this.serialNumber; } - /** - * Set the serialNumber property: Serial number of the device being tracked. - * - * @param serialNumber the serialNumber value to set. - * @return the TrackingInfo object itself. - */ - public TrackingInfo withSerialNumber(String serialNumber) { - this.serialNumber = serialNumber; - return this; - } - /** * Get the carrierName property: Name of the carrier used in the delivery. * @@ -71,17 +60,6 @@ public String carrierName() { return this.carrierName; } - /** - * Set the carrierName property: Name of the carrier used in the delivery. - * - * @param carrierName the carrierName value to set. - * @return the TrackingInfo object itself. - */ - public TrackingInfo withCarrierName(String carrierName) { - this.carrierName = carrierName; - return this; - } - /** * Get the trackingId property: Tracking ID of the shipment. * @@ -91,17 +69,6 @@ public String trackingId() { return this.trackingId; } - /** - * Set the trackingId property: Tracking ID of the shipment. - * - * @param trackingId the trackingId value to set. - * @return the TrackingInfo object itself. - */ - public TrackingInfo withTrackingId(String trackingId) { - this.trackingId = trackingId; - return this; - } - /** * Get the trackingUrl property: Tracking URL of the shipment. * @@ -111,25 +78,6 @@ public String trackingUrl() { return this.trackingUrl; } - /** - * Set the trackingUrl property: Tracking URL of the shipment. - * - * @param trackingUrl the trackingUrl value to set. - * @return the TrackingInfo object itself. - */ - public TrackingInfo withTrackingUrl(String trackingUrl) { - this.trackingUrl = trackingUrl; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/Trigger.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/Trigger.java index 37f637205437..503550bdd6f3 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/Trigger.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/Trigger.java @@ -1,9 +1,11 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.models; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; import com.azure.resourcemanager.databoxedge.fluent.models.TriggerInner; /** @@ -31,6 +33,13 @@ public interface Trigger { */ String type(); + /** + * Gets the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + TriggerProperties properties(); + /** * Gets the kind property: Trigger Kind. * @@ -38,10 +47,176 @@ public interface Trigger { */ TriggerEventType kind(); + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + /** * Gets the inner com.azure.resourcemanager.databoxedge.fluent.models.TriggerInner object. * * @return the inner object. */ TriggerInner innerModel(); + + /** + * The entirety of the Trigger definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithKind, + DefinitionStages.WithCreate { + } + + /** + * The Trigger definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the Trigger definition. + */ + interface Blank extends WithParentResource { + } + + /** + * The stage of the Trigger definition allowing to specify parent resource. + */ + interface WithParentResource { + /** + * Specifies resourceGroupName, deviceName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @return the next definition stage. + */ + WithKind withExistingDataBoxEdgeDevice(String resourceGroupName, String deviceName); + } + + /** + * The stage of the Trigger definition allowing to specify kind. + */ + interface WithKind { + /** + * Specifies the kind property: Trigger Kind.. + * + * @param kind Trigger Kind. + * @return the next definition stage. + */ + WithCreate withKind(TriggerEventType kind); + } + + /** + * The stage of the Trigger definition which contains all the minimum required properties for the resource to be + * created, but also allows for any other optional properties to be specified. + */ + interface WithCreate extends DefinitionStages.WithProperties { + /** + * Executes the create request. + * + * @return the created resource. + */ + Trigger create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + Trigger create(Context context); + } + + /** + * The stage of the Trigger definition allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: The resource-specific properties for this resource.. + * + * @param properties The resource-specific properties for this resource. + * @return the next definition stage. + */ + WithCreate withProperties(TriggerProperties properties); + } + } + + /** + * Begins update for the Trigger resource. + * + * @return the stage of resource update. + */ + Trigger.Update update(); + + /** + * The template for Trigger update. + */ + interface Update extends UpdateStages.WithProperties, UpdateStages.WithKind { + /** + * Executes the update request. + * + * @return the updated resource. + */ + Trigger apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + Trigger apply(Context context); + } + + /** + * The Trigger update stages. + */ + interface UpdateStages { + /** + * The stage of the Trigger update allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: The resource-specific properties for this resource.. + * + * @param properties The resource-specific properties for this resource. + * @return the next definition stage. + */ + Update withProperties(TriggerProperties properties); + } + + /** + * The stage of the Trigger update allowing to specify kind. + */ + interface WithKind { + /** + * Specifies the kind property: Trigger Kind.. + * + * @param kind Trigger Kind. + * @return the next definition stage. + */ + Update withKind(TriggerEventType kind); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + Trigger refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + Trigger refresh(Context context); } diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/TriggerEventType.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/TriggerEventType.java index 92b84a87d755..6fafbb75cb83 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/TriggerEventType.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/TriggerEventType.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.models; @@ -12,12 +12,12 @@ */ public final class TriggerEventType extends ExpandableStringEnum { /** - * Static value FileEvent for TriggerEventType. + * FileEvent. */ public static final TriggerEventType FILE_EVENT = fromString("FileEvent"); /** - * Static value PeriodicTimerEvent for TriggerEventType. + * PeriodicTimerEvent. */ public static final TriggerEventType PERIODIC_TIMER_EVENT = fromString("PeriodicTimerEvent"); diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/TriggerProperties.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/TriggerProperties.java new file mode 100644 index 000000000000..527bf753c750 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/TriggerProperties.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.databoxedge.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The TriggerProperties model. + */ +@Immutable +public final class TriggerProperties implements JsonSerializable { + /** + * Creates an instance of TriggerProperties class. + */ + public TriggerProperties() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TriggerProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TriggerProperties if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the TriggerProperties. + */ + public static TriggerProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TriggerProperties deserializedTriggerProperties = new TriggerProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + reader.skipChildren(); + } + + return deserializedTriggerProperties; + }); + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/TriggerSupportPackageRequest.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/TriggerSupportPackageRequest.java new file mode 100644 index 000000000000..6fbfda3f0731 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/TriggerSupportPackageRequest.java @@ -0,0 +1,201 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.databoxedge.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.databoxedge.fluent.models.SupportPackageRequestProperties; +import java.io.IOException; +import java.time.OffsetDateTime; + +/** + * The request object for trigger support package. + */ +@Fluent +public final class TriggerSupportPackageRequest extends ARMBaseModel { + /* + * The TriggerSupportPackageRequest properties. + */ + private SupportPackageRequestProperties innerProperties = new SupportPackageRequestProperties(); + + /* + * The hierarchical type of the object. + */ + private String type; + + /* + * The object name. + */ + private String name; + + /* + * The path ID that uniquely identifies the object. + */ + private String id; + + /** + * Creates an instance of TriggerSupportPackageRequest class. + */ + public TriggerSupportPackageRequest() { + } + + /** + * Get the innerProperties property: The TriggerSupportPackageRequest properties. + * + * @return the innerProperties value. + */ + private SupportPackageRequestProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the type property: The hierarchical type of the object. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The object name. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: The path ID that uniquely identifies the object. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Get the minimumTimeStamp property: MinimumTimeStamp from where logs need to be collected. + * + * @return the minimumTimeStamp value. + */ + public OffsetDateTime minimumTimeStamp() { + return this.innerProperties() == null ? null : this.innerProperties().minimumTimeStamp(); + } + + /** + * Set the minimumTimeStamp property: MinimumTimeStamp from where logs need to be collected. + * + * @param minimumTimeStamp the minimumTimeStamp value to set. + * @return the TriggerSupportPackageRequest object itself. + */ + public TriggerSupportPackageRequest withMinimumTimeStamp(OffsetDateTime minimumTimeStamp) { + if (this.innerProperties() == null) { + this.innerProperties = new SupportPackageRequestProperties(); + } + this.innerProperties().withMinimumTimeStamp(minimumTimeStamp); + return this; + } + + /** + * Get the maximumTimeStamp property: Start of the timespan of the log collection. + * + * @return the maximumTimeStamp value. + */ + public OffsetDateTime maximumTimeStamp() { + return this.innerProperties() == null ? null : this.innerProperties().maximumTimeStamp(); + } + + /** + * Set the maximumTimeStamp property: Start of the timespan of the log collection. + * + * @param maximumTimeStamp the maximumTimeStamp value to set. + * @return the TriggerSupportPackageRequest object itself. + */ + public TriggerSupportPackageRequest withMaximumTimeStamp(OffsetDateTime maximumTimeStamp) { + if (this.innerProperties() == null) { + this.innerProperties = new SupportPackageRequestProperties(); + } + this.innerProperties().withMaximumTimeStamp(maximumTimeStamp); + return this; + } + + /** + * Get the include property: Type of files, which need to be included in the logs + * This will contain the type of logs (Default/DefaultWithDumps/None/All/DefaultWithArchived) + * or a comma separated list of log types that are required. + * + * @return the include value. + */ + public String include() { + return this.innerProperties() == null ? null : this.innerProperties().include(); + } + + /** + * Set the include property: Type of files, which need to be included in the logs + * This will contain the type of logs (Default/DefaultWithDumps/None/All/DefaultWithArchived) + * or a comma separated list of log types that are required. + * + * @param include the include value to set. + * @return the TriggerSupportPackageRequest object itself. + */ + public TriggerSupportPackageRequest withInclude(String include) { + if (this.innerProperties() == null) { + this.innerProperties = new SupportPackageRequestProperties(); + } + this.innerProperties().withInclude(include); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TriggerSupportPackageRequest from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TriggerSupportPackageRequest if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the TriggerSupportPackageRequest. + */ + public static TriggerSupportPackageRequest fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TriggerSupportPackageRequest deserializedTriggerSupportPackageRequest = new TriggerSupportPackageRequest(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedTriggerSupportPackageRequest.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedTriggerSupportPackageRequest.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedTriggerSupportPackageRequest.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedTriggerSupportPackageRequest.innerProperties + = SupportPackageRequestProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedTriggerSupportPackageRequest; + }); + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/Triggers.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/Triggers.java index d73a20709332..72392b5ff992 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/Triggers.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/Triggers.java @@ -1,124 +1,145 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.models; import com.azure.core.http.rest.PagedIterable; import com.azure.core.http.rest.Response; import com.azure.core.util.Context; -import com.azure.resourcemanager.databoxedge.fluent.models.TriggerInner; /** * Resource collection API of Triggers. */ public interface Triggers { /** - * Lists all the triggers configured in the device. + * Get a specific trigger by name. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param resourceGroupName The resource group name. + * @param name The trigger name. + * @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 collection of all trigger on the data box edge device as paginated response with {@link PagedIterable}. + * @return a specific trigger by name along with {@link Response}. */ - PagedIterable listByDataBoxEdgeDevice(String deviceName, String resourceGroupName); + Response getWithResponse(String resourceGroupName, String deviceName, String name, Context context); /** - * Lists all the triggers configured in the device. + * Get a specific trigger by name. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param resourceGroupName The resource group name. - * @param filter Specify $filter='CustomContextTag eq <tag>' to filter on custom context tag property. - * @param context The context to associate with this operation. + * @param name The trigger name. * @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 collection of all trigger on the data box edge device as paginated response with {@link PagedIterable}. + * @return a specific trigger by name. */ - PagedIterable listByDataBoxEdgeDevice(String deviceName, String resourceGroupName, String filter, - Context context); + Trigger get(String resourceGroupName, String deviceName, String name); /** - * Get a specific trigger by name. + * Deletes the trigger on the gateway device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. * @param name The trigger name. - * @param resourceGroupName The resource group name. - * @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 a specific trigger by name along with {@link Response}. */ - Response getWithResponse(String deviceName, String name, String resourceGroupName, Context context); + void delete(String resourceGroupName, String deviceName, String name); /** - * Get a specific trigger by name. + * Deletes the trigger on the gateway device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. * @param name The trigger name. - * @param resourceGroupName The resource group name. + * @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 a specific trigger by name. */ - Trigger get(String deviceName, String name, String resourceGroupName); + void delete(String resourceGroupName, String deviceName, String name, Context context); /** - * Creates or updates a trigger. + * Lists all the triggers configured in the device. * - * @param deviceName Creates or updates a trigger. - * @param name The trigger name. - * @param resourceGroupName The resource group name. - * @param trigger The trigger. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. * @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 trigger details. + * @return collection of all trigger on the data box edge device as paginated response with {@link PagedIterable}. */ - Trigger createOrUpdate(String deviceName, String name, String resourceGroupName, TriggerInner trigger); + PagedIterable listByDataBoxEdgeDevice(String resourceGroupName, String deviceName); /** - * Creates or updates a trigger. + * Lists all the triggers configured in the device. * - * @param deviceName Creates or updates a trigger. - * @param name The trigger name. - * @param resourceGroupName The resource group name. - * @param trigger The trigger. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deviceName The device name. + * @param filter Specify $filter='CustomContextTag eq <tag>' to filter on custom context tag property. * @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 trigger details. + * @return collection of all trigger on the data box edge device as paginated response with {@link PagedIterable}. */ - Trigger createOrUpdate(String deviceName, String name, String resourceGroupName, TriggerInner trigger, + PagedIterable listByDataBoxEdgeDevice(String resourceGroupName, String deviceName, String filter, Context context); + /** + * Get a specific trigger by name. + * + * @param id the resource ID. + * @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 a specific trigger by name along with {@link Response}. + */ + Trigger getById(String id); + + /** + * Get a specific trigger by name. + * + * @param id the resource ID. + * @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 a specific trigger by name along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + /** * Deletes the trigger on the gateway device. * - * @param deviceName The device name. - * @param name The trigger name. - * @param resourceGroupName The resource group name. + * @param id the resource ID. * @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 delete(String deviceName, String name, String resourceGroupName); + void deleteById(String id); /** * Deletes the trigger on the gateway device. * - * @param deviceName The device name. - * @param name The trigger name. - * @param resourceGroupName The resource group name. + * @param id the resource ID. * @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. */ - void delete(String deviceName, String name, String resourceGroupName, Context context); + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new Trigger resource. + * + * @param name resource name. + * @return the first stage of the new Trigger definition. + */ + Trigger.DefinitionStages.Blank define(String name); } diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/UpdateDetails.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/UpdateDetails.java new file mode 100644 index 000000000000..c1ce1392733b --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/UpdateDetails.java @@ -0,0 +1,213 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.databoxedge.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Update Specific attributes. + */ +@Immutable +public final class UpdateDetails implements JsonSerializable { + /* + * Title of the Update + */ + private String updateTitle; + + /* + * Size of the update(In Bytes) + */ + private Double updateSize; + + /* + * Type of the Update + */ + private UpdateType updateType; + + /* + * Target Version number + */ + private String targetVersion; + + /* + * Friendly Version Number + */ + private String friendlyVersionNumber; + + /* + * Estimated Install Time for the update + */ + private Integer estimatedInstallTimeInMins; + + /* + * Indicates if updates are available and at least one of the updates needs a reboot. + */ + private InstallRebootBehavior rebootBehavior; + + /* + * Impact of Installing an updateType + */ + private InstallationImpact installationImpact; + + /* + * Status of the update. + */ + private UpdateStatus status; + + /** + * Creates an instance of UpdateDetails class. + */ + private UpdateDetails() { + } + + /** + * Get the updateTitle property: Title of the Update. + * + * @return the updateTitle value. + */ + public String updateTitle() { + return this.updateTitle; + } + + /** + * Get the updateSize property: Size of the update(In Bytes). + * + * @return the updateSize value. + */ + public Double updateSize() { + return this.updateSize; + } + + /** + * Get the updateType property: Type of the Update. + * + * @return the updateType value. + */ + public UpdateType updateType() { + return this.updateType; + } + + /** + * Get the targetVersion property: Target Version number. + * + * @return the targetVersion value. + */ + public String targetVersion() { + return this.targetVersion; + } + + /** + * Get the friendlyVersionNumber property: Friendly Version Number. + * + * @return the friendlyVersionNumber value. + */ + public String friendlyVersionNumber() { + return this.friendlyVersionNumber; + } + + /** + * Get the estimatedInstallTimeInMins property: Estimated Install Time for the update. + * + * @return the estimatedInstallTimeInMins value. + */ + public Integer estimatedInstallTimeInMins() { + return this.estimatedInstallTimeInMins; + } + + /** + * Get the rebootBehavior property: Indicates if updates are available and at least one of the updates needs a + * reboot. + * + * @return the rebootBehavior value. + */ + public InstallRebootBehavior rebootBehavior() { + return this.rebootBehavior; + } + + /** + * Get the installationImpact property: Impact of Installing an updateType. + * + * @return the installationImpact value. + */ + public InstallationImpact installationImpact() { + return this.installationImpact; + } + + /** + * Get the status property: Status of the update. + * + * @return the status value. + */ + public UpdateStatus status() { + return this.status; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("updateTitle", this.updateTitle); + jsonWriter.writeNumberField("updateSize", this.updateSize); + jsonWriter.writeStringField("updateType", this.updateType == null ? null : this.updateType.toString()); + jsonWriter.writeStringField("targetVersion", this.targetVersion); + jsonWriter.writeStringField("friendlyVersionNumber", this.friendlyVersionNumber); + jsonWriter.writeNumberField("estimatedInstallTimeInMins", this.estimatedInstallTimeInMins); + jsonWriter.writeStringField("rebootBehavior", + this.rebootBehavior == null ? null : this.rebootBehavior.toString()); + jsonWriter.writeStringField("installationImpact", + this.installationImpact == null ? null : this.installationImpact.toString()); + jsonWriter.writeStringField("status", this.status == null ? null : this.status.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of UpdateDetails from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of UpdateDetails if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the UpdateDetails. + */ + public static UpdateDetails fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + UpdateDetails deserializedUpdateDetails = new UpdateDetails(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("updateTitle".equals(fieldName)) { + deserializedUpdateDetails.updateTitle = reader.getString(); + } else if ("updateSize".equals(fieldName)) { + deserializedUpdateDetails.updateSize = reader.getNullable(JsonReader::getDouble); + } else if ("updateType".equals(fieldName)) { + deserializedUpdateDetails.updateType = UpdateType.fromString(reader.getString()); + } else if ("targetVersion".equals(fieldName)) { + deserializedUpdateDetails.targetVersion = reader.getString(); + } else if ("friendlyVersionNumber".equals(fieldName)) { + deserializedUpdateDetails.friendlyVersionNumber = reader.getString(); + } else if ("estimatedInstallTimeInMins".equals(fieldName)) { + deserializedUpdateDetails.estimatedInstallTimeInMins = reader.getNullable(JsonReader::getInt); + } else if ("rebootBehavior".equals(fieldName)) { + deserializedUpdateDetails.rebootBehavior = InstallRebootBehavior.fromString(reader.getString()); + } else if ("installationImpact".equals(fieldName)) { + deserializedUpdateDetails.installationImpact = InstallationImpact.fromString(reader.getString()); + } else if ("status".equals(fieldName)) { + deserializedUpdateDetails.status = UpdateStatus.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedUpdateDetails; + }); + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/UpdateDownloadProgress.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/UpdateDownloadProgress.java index e36e728bb566..201b81da7b06 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/UpdateDownloadProgress.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/UpdateDownloadProgress.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.models; @@ -49,7 +49,7 @@ public final class UpdateDownloadProgress implements JsonSerializable { /** - * Static value None for UpdateOperation. + * None. */ public static final UpdateOperation NONE = fromString("None"); /** - * Static value Scan for UpdateOperation. + * Scan. */ public static final UpdateOperation SCAN = fromString("Scan"); /** - * Static value Download for UpdateOperation. + * Download. */ public static final UpdateOperation DOWNLOAD = fromString("Download"); /** - * Static value Install for UpdateOperation. + * Install. */ public static final UpdateOperation INSTALL = fromString("Install"); diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/UpdateOperationStage.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/UpdateOperationStage.java index 13654973fbed..b68e608fbc7a 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/UpdateOperationStage.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/UpdateOperationStage.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.models; @@ -12,87 +12,87 @@ */ public final class UpdateOperationStage extends ExpandableStringEnum { /** - * Static value Unknown for UpdateOperationStage. + * Unknown. */ public static final UpdateOperationStage UNKNOWN = fromString("Unknown"); /** - * Static value Initial for UpdateOperationStage. + * Initial. */ public static final UpdateOperationStage INITIAL = fromString("Initial"); /** - * Static value ScanStarted for UpdateOperationStage. + * ScanStarted. */ public static final UpdateOperationStage SCAN_STARTED = fromString("ScanStarted"); /** - * Static value ScanComplete for UpdateOperationStage. + * ScanComplete. */ public static final UpdateOperationStage SCAN_COMPLETE = fromString("ScanComplete"); /** - * Static value ScanFailed for UpdateOperationStage. + * ScanFailed. */ public static final UpdateOperationStage SCAN_FAILED = fromString("ScanFailed"); /** - * Static value DownloadStarted for UpdateOperationStage. + * DownloadStarted. */ public static final UpdateOperationStage DOWNLOAD_STARTED = fromString("DownloadStarted"); /** - * Static value DownloadComplete for UpdateOperationStage. + * DownloadComplete. */ public static final UpdateOperationStage DOWNLOAD_COMPLETE = fromString("DownloadComplete"); /** - * Static value DownloadFailed for UpdateOperationStage. + * DownloadFailed. */ public static final UpdateOperationStage DOWNLOAD_FAILED = fromString("DownloadFailed"); /** - * Static value InstallStarted for UpdateOperationStage. + * InstallStarted. */ public static final UpdateOperationStage INSTALL_STARTED = fromString("InstallStarted"); /** - * Static value InstallComplete for UpdateOperationStage. + * InstallComplete. */ public static final UpdateOperationStage INSTALL_COMPLETE = fromString("InstallComplete"); /** - * Static value InstallFailed for UpdateOperationStage. + * InstallFailed. */ public static final UpdateOperationStage INSTALL_FAILED = fromString("InstallFailed"); /** - * Static value RebootInitiated for UpdateOperationStage. + * RebootInitiated. */ public static final UpdateOperationStage REBOOT_INITIATED = fromString("RebootInitiated"); /** - * Static value Success for UpdateOperationStage. + * Success. */ public static final UpdateOperationStage SUCCESS = fromString("Success"); /** - * Static value Failure for UpdateOperationStage. + * Failure. */ public static final UpdateOperationStage FAILURE = fromString("Failure"); /** - * Static value RescanStarted for UpdateOperationStage. + * RescanStarted. */ public static final UpdateOperationStage RESCAN_STARTED = fromString("RescanStarted"); /** - * Static value RescanComplete for UpdateOperationStage. + * RescanComplete. */ public static final UpdateOperationStage RESCAN_COMPLETE = fromString("RescanComplete"); /** - * Static value RescanFailed for UpdateOperationStage. + * RescanFailed. */ public static final UpdateOperationStage RESCAN_FAILED = fromString("RescanFailed"); diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/UpdateStatus.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/UpdateStatus.java new file mode 100644 index 000000000000..97804f89e035 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/UpdateStatus.java @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.databoxedge.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Status of the update. + */ +public final class UpdateStatus extends ExpandableStringEnum { + /** + * DownloadPending. + */ + public static final UpdateStatus DOWNLOAD_PENDING = fromString("DownloadPending"); + + /** + * DownloadStarted. + */ + public static final UpdateStatus DOWNLOAD_STARTED = fromString("DownloadStarted"); + + /** + * DownloadCompleted. + */ + public static final UpdateStatus DOWNLOAD_COMPLETED = fromString("DownloadCompleted"); + + /** + * InstallStarted. + */ + public static final UpdateStatus INSTALL_STARTED = fromString("InstallStarted"); + + /** + * InstallCompleted. + */ + public static final UpdateStatus INSTALL_COMPLETED = fromString("InstallCompleted"); + + /** + * Creates a new instance of UpdateStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public UpdateStatus() { + } + + /** + * Creates or finds a UpdateStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding UpdateStatus. + */ + public static UpdateStatus fromString(String name) { + return fromString(name, UpdateStatus.class); + } + + /** + * Gets known UpdateStatus values. + * + * @return known UpdateStatus values. + */ + public static Collection values() { + return values(UpdateStatus.class); + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/UpdateSummary.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/UpdateSummary.java index 960090b08736..967cbef89bbb 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/UpdateSummary.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/UpdateSummary.java @@ -1,9 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.models; +import com.azure.core.management.SystemData; import com.azure.resourcemanager.databoxedge.fluent.models.UpdateSummaryInner; import java.time.OffsetDateTime; import java.util.List; @@ -33,6 +34,13 @@ public interface UpdateSummary { */ String type(); + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + /** * Gets the deviceVersionNumber property: The current version of the device in format: 1.2.17312.13.",. * @@ -62,6 +70,13 @@ public interface UpdateSummary { */ OffsetDateTime lastCompletedScanJobDateTime(); + /** + * Gets the lastSuccessfulScanJobTime property: Time when the last scan job is successfully completed. + * + * @return the lastSuccessfulScanJobTime value. + */ + OffsetDateTime lastSuccessfulScanJobTime(); + /** * Gets the lastCompletedDownloadJobDateTime property: The time when the last Download job was completed * (success/cancelled/failed) on the appliance. @@ -70,6 +85,29 @@ public interface UpdateSummary { */ OffsetDateTime lastCompletedDownloadJobDateTime(); + /** + * Gets the lastCompletedDownloadJobId property: JobId of the last ran download job.(Can be + * success/cancelled/failed). + * + * @return the lastCompletedDownloadJobId value. + */ + String lastCompletedDownloadJobId(); + + /** + * Gets the lastDownloadJobStatus property: JobStatus of the last ran download job. + * + * @return the lastDownloadJobStatus value. + */ + JobStatus lastDownloadJobStatus(); + + /** + * Gets the lastSuccessfulInstallJobDateTime property: The time when the Last Install job was completed successfully + * on the appliance. + * + * @return the lastSuccessfulInstallJobDateTime value. + */ + OffsetDateTime lastSuccessfulInstallJobDateTime(); + /** * Gets the lastCompletedInstallJobDateTime property: The time when the last Install job was completed * (success/cancelled/failed) on the appliance. @@ -78,6 +116,20 @@ public interface UpdateSummary { */ OffsetDateTime lastCompletedInstallJobDateTime(); + /** + * Gets the lastCompletedInstallJobId property: JobId of the last ran install job.(Can be success/cancelled/failed). + * + * @return the lastCompletedInstallJobId value. + */ + String lastCompletedInstallJobId(); + + /** + * Gets the lastInstallJobStatus property: JobStatus of the last ran install job. + * + * @return the lastInstallJobStatus value. + */ + JobStatus lastInstallJobStatus(); + /** * Gets the totalNumberOfUpdatesAvailable property: The number of updates available for the current device version * as per the last device scan. @@ -152,6 +204,13 @@ public interface UpdateSummary { */ List updateTitles(); + /** + * Gets the updates property: The list of updates available for install. + * + * @return the updates value. + */ + List updates(); + /** * Gets the totalUpdateSizeInBytes property: The total size of updates available for download in bytes. * @@ -159,6 +218,13 @@ public interface UpdateSummary { */ Double totalUpdateSizeInBytes(); + /** + * Gets the totalTimeInMinutes property: The total time in Minutes. + * + * @return the totalTimeInMinutes value. + */ + Integer totalTimeInMinutes(); + /** * Gets the inner com.azure.resourcemanager.databoxedge.fluent.models.UpdateSummaryInner object. * diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/UpdateType.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/UpdateType.java new file mode 100644 index 000000000000..f5fd0fbc3dc6 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/UpdateType.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.databoxedge.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Type of the Update. + */ +public final class UpdateType extends ExpandableStringEnum { + /** + * Software. + */ + public static final UpdateType SOFTWARE = fromString("Software"); + + /** + * Kubernetes. + */ + public static final UpdateType KUBERNETES = fromString("Kubernetes"); + + /** + * Firmware. + */ + public static final UpdateType FIRMWARE = fromString("Firmware"); + + /** + * Creates a new instance of UpdateType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public UpdateType() { + } + + /** + * Creates or finds a UpdateType from its string representation. + * + * @param name a name to look for. + * @return the corresponding UpdateType. + */ + public static UpdateType fromString(String name) { + return fromString(name, UpdateType.class); + } + + /** + * Gets known UpdateType values. + * + * @return known UpdateType values. + */ + public static Collection values() { + return values(UpdateType.class); + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/UploadCertificateRequest.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/UploadCertificateRequest.java index 524d09aaece3..dd39a0fb0787 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/UploadCertificateRequest.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/UploadCertificateRequest.java @@ -1,11 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -84,23 +83,6 @@ public UploadCertificateRequest withCertificate(String certificate) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property innerProperties in model UploadCertificateRequest")); - } else { - innerProperties().validate(); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(UploadCertificateRequest.class); - /** * {@inheritDoc} */ diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/UploadCertificateResponse.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/UploadCertificateResponse.java index a8b325e71676..e76f08e209f9 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/UploadCertificateResponse.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/UploadCertificateResponse.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.models; diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/User.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/User.java index fb4e3288af63..e4cad9b4ec4b 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/User.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/User.java @@ -1,9 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.models; +import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.databoxedge.fluent.models.UserInner; import java.util.List; @@ -33,6 +34,13 @@ public interface User { */ String type(); + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + /** * Gets the encryptedPassword property: The password details. * @@ -91,13 +99,13 @@ interface Blank extends WithParentResource { */ interface WithParentResource { /** - * Specifies deviceName, resourceGroupName. + * Specifies resourceGroupName, deviceName. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param resourceGroupName The resource group name. * @return the next definition stage. */ - WithUserType withExistingDataBoxEdgeDevice(String deviceName, String resourceGroupName); + WithUserType withExistingDataBoxEdgeDevice(String resourceGroupName, String deviceName); } /** @@ -117,7 +125,7 @@ interface WithUserType { * The stage of the User definition which contains all the minimum required properties for the resource to be * created, but also allows for any other optional properties to be specified. */ - interface WithCreate extends DefinitionStages.WithEncryptedPassword, DefinitionStages.WithShareAccessRights { + interface WithCreate extends DefinitionStages.WithEncryptedPassword { /** * Executes the create request. * @@ -146,21 +154,6 @@ interface WithEncryptedPassword { */ WithCreate withEncryptedPassword(AsymmetricEncryptedSecret encryptedPassword); } - - /** - * The stage of the User definition allowing to specify shareAccessRights. - */ - interface WithShareAccessRights { - /** - * Specifies the shareAccessRights property: List of shares that the user has rights on. This field should - * not be specified during user creation.. - * - * @param shareAccessRights List of shares that the user has rights on. This field should not be specified - * during user creation. - * @return the next definition stage. - */ - WithCreate withShareAccessRights(List shareAccessRights); - } } /** @@ -173,8 +166,7 @@ interface WithShareAccessRights { /** * The template for User update. */ - interface Update - extends UpdateStages.WithEncryptedPassword, UpdateStages.WithShareAccessRights, UpdateStages.WithUserType { + interface Update extends UpdateStages.WithEncryptedPassword, UpdateStages.WithUserType { /** * Executes the update request. * @@ -208,21 +200,6 @@ interface WithEncryptedPassword { Update withEncryptedPassword(AsymmetricEncryptedSecret encryptedPassword); } - /** - * The stage of the User update allowing to specify shareAccessRights. - */ - interface WithShareAccessRights { - /** - * Specifies the shareAccessRights property: List of shares that the user has rights on. This field should - * not be specified during user creation.. - * - * @param shareAccessRights List of shares that the user has rights on. This field should not be specified - * during user creation. - * @return the next definition stage. - */ - Update withShareAccessRights(List shareAccessRights); - } - /** * The stage of the User update allowing to specify userType. */ diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/UserAccessRight.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/UserAccessRight.java index 981fc1007cc0..3ffb77f6a2f5 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/UserAccessRight.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/UserAccessRight.java @@ -1,11 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -73,24 +72,6 @@ public UserAccessRight withAccessType(ShareAccessType accessType) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (userId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Missing required property userId in model UserAccessRight")); - } - if (accessType() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Missing required property accessType in model UserAccessRight")); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(UserAccessRight.class); - /** * {@inheritDoc} */ diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/UserType.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/UserType.java index 9b290206c853..9159445ad9a6 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/UserType.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/UserType.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.models; @@ -12,17 +12,17 @@ */ public final class UserType extends ExpandableStringEnum { /** - * Static value Share for UserType. + * Share. */ public static final UserType SHARE = fromString("Share"); /** - * Static value LocalManagement for UserType. + * LocalManagement. */ public static final UserType LOCAL_MANAGEMENT = fromString("LocalManagement"); /** - * Static value ARM for UserType. + * ARM. */ public static final UserType ARM = fromString("ARM"); diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/Users.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/Users.java index d6449864edf5..257f9c488ae6 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/Users.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/Users.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.models; @@ -13,85 +13,85 @@ */ public interface Users { /** - * Gets all the users registered on a Data Box Edge/Data Box Gateway device. + * Gets the properties of the specified user. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param resourceGroupName The resource group name. + * @param name The user name. + * @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 all the users registered on a Data Box Edge/Data Box Gateway device as paginated response with - * {@link PagedIterable}. + * @return the properties of the specified user along with {@link Response}. */ - PagedIterable listByDataBoxEdgeDevice(String deviceName, String resourceGroupName); + Response getWithResponse(String resourceGroupName, String deviceName, String name, Context context); /** - * Gets all the users registered on a Data Box Edge/Data Box Gateway device. + * Gets the properties of the specified user. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param resourceGroupName The resource group name. - * @param filter Specify $filter='UserType eq <type>' to filter on user type property. - * @param context The context to associate with this operation. + * @param name The user name. * @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 all the users registered on a Data Box Edge/Data Box Gateway device as paginated response with - * {@link PagedIterable}. + * @return the properties of the specified user. */ - PagedIterable listByDataBoxEdgeDevice(String deviceName, String resourceGroupName, String filter, - Context context); + User get(String resourceGroupName, String deviceName, String name); /** - * Gets the properties of the specified user. + * Deletes the user on a databox edge/gateway device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. * @param name The user name. - * @param resourceGroupName The resource group name. - * @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 properties of the specified user along with {@link Response}. */ - Response getWithResponse(String deviceName, String name, String resourceGroupName, Context context); + void delete(String resourceGroupName, String deviceName, String name); /** - * Gets the properties of the specified user. + * Deletes the user on a databox edge/gateway device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. * @param name The user name. - * @param resourceGroupName The resource group name. + * @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 properties of the specified user. */ - User get(String deviceName, String name, String resourceGroupName); + void delete(String resourceGroupName, String deviceName, String name, Context context); /** - * Deletes the user on a databox edge/gateway device. + * Gets all the users registered on a Data Box Edge/Data Box Gateway device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param name The user name. - * @param resourceGroupName The resource group name. * @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 all the users registered on a Data Box Edge/Data Box Gateway device as paginated response with + * {@link PagedIterable}. */ - void delete(String deviceName, String name, String resourceGroupName); + PagedIterable listByDataBoxEdgeDevice(String resourceGroupName, String deviceName); /** - * Deletes the user on a databox edge/gateway device. + * Gets all the users registered on a Data Box Edge/Data Box Gateway device. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deviceName The device name. - * @param name The user name. - * @param resourceGroupName The resource group name. + * @param filter Specify $filter='Type eq <type>' to filter on user type property. * @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 all the users registered on a Data Box Edge/Data Box Gateway device as paginated response with + * {@link PagedIterable}. */ - void delete(String deviceName, String name, String resourceGroupName, Context context); + PagedIterable listByDataBoxEdgeDevice(String resourceGroupName, String deviceName, String filter, + Context context); /** * Gets the properties of the specified user. diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/VmMemory.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/VmMemory.java new file mode 100644 index 000000000000..6c3546f69de0 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/VmMemory.java @@ -0,0 +1,94 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.databoxedge.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * VmMemory Data. + */ +@Immutable +public final class VmMemory implements JsonSerializable { + /* + * The total amount of RAM in the virtual machine, as seen by the guest operating system. For a virtual machine with + * dynamic memory enabled, this represents the initial memory available at startup. + */ + private Long startupMemoryMB; + + /* + * The current memory used by the virtual machine. + */ + private Long currentMemoryUsageMB; + + /** + * Creates an instance of VmMemory class. + */ + private VmMemory() { + } + + /** + * Get the startupMemoryMB property: The total amount of RAM in the virtual machine, as seen by the guest operating + * system. For a virtual machine with dynamic memory enabled, this represents the initial memory available at + * startup. + * + * @return the startupMemoryMB value. + */ + public Long startupMemoryMB() { + return this.startupMemoryMB; + } + + /** + * Get the currentMemoryUsageMB property: The current memory used by the virtual machine. + * + * @return the currentMemoryUsageMB value. + */ + public Long currentMemoryUsageMB() { + return this.currentMemoryUsageMB; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("startupMemoryMB", this.startupMemoryMB); + jsonWriter.writeNumberField("currentMemoryUsageMB", this.currentMemoryUsageMB); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VmMemory from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VmMemory if the JsonReader was pointing to an instance of it, or null if it was pointing + * to JSON null. + * @throws IOException If an error occurs while reading the VmMemory. + */ + public static VmMemory fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VmMemory deserializedVmMemory = new VmMemory(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("startupMemoryMB".equals(fieldName)) { + deserializedVmMemory.startupMemoryMB = reader.getNullable(JsonReader::getLong); + } else if ("currentMemoryUsageMB".equals(fieldName)) { + deserializedVmMemory.currentMemoryUsageMB = reader.getNullable(JsonReader::getLong); + } else { + reader.skipChildren(); + } + } + + return deserializedVmMemory; + }); + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/VmPlacementRequestResult.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/VmPlacementRequestResult.java new file mode 100644 index 000000000000..215e35d5d93f --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/VmPlacementRequestResult.java @@ -0,0 +1,171 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.databoxedge.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * List of VM sizes being checked for creation on appliance along with corresponding result. + */ +@Fluent +public final class VmPlacementRequestResult implements JsonSerializable { + /* + * List of VM sizes being checked. + */ + private List vmSize; + + /* + * Boolean value indicating if the VM(s) in VmSize can be created. + */ + private Boolean isFeasible; + + /* + * MessageCode indicating reason for success or failure. + */ + private String messageCode; + + /* + * Localized message to be displayed to the user to explain the check result. + */ + private String message; + + /** + * Creates an instance of VmPlacementRequestResult class. + */ + public VmPlacementRequestResult() { + } + + /** + * Get the vmSize property: List of VM sizes being checked. + * + * @return the vmSize value. + */ + public List vmSize() { + return this.vmSize; + } + + /** + * Set the vmSize property: List of VM sizes being checked. + * + * @param vmSize the vmSize value to set. + * @return the VmPlacementRequestResult object itself. + */ + public VmPlacementRequestResult withVmSize(List vmSize) { + this.vmSize = vmSize; + return this; + } + + /** + * Get the isFeasible property: Boolean value indicating if the VM(s) in VmSize can be created. + * + * @return the isFeasible value. + */ + public Boolean isFeasible() { + return this.isFeasible; + } + + /** + * Set the isFeasible property: Boolean value indicating if the VM(s) in VmSize can be created. + * + * @param isFeasible the isFeasible value to set. + * @return the VmPlacementRequestResult object itself. + */ + public VmPlacementRequestResult withIsFeasible(Boolean isFeasible) { + this.isFeasible = isFeasible; + return this; + } + + /** + * Get the messageCode property: MessageCode indicating reason for success or failure. + * + * @return the messageCode value. + */ + public String messageCode() { + return this.messageCode; + } + + /** + * Set the messageCode property: MessageCode indicating reason for success or failure. + * + * @param messageCode the messageCode value to set. + * @return the VmPlacementRequestResult object itself. + */ + public VmPlacementRequestResult withMessageCode(String messageCode) { + this.messageCode = messageCode; + return this; + } + + /** + * Get the message property: Localized message to be displayed to the user to explain the check result. + * + * @return the message value. + */ + public String message() { + return this.message; + } + + /** + * Set the message property: Localized message to be displayed to the user to explain the check result. + * + * @param message the message value to set. + * @return the VmPlacementRequestResult object itself. + */ + public VmPlacementRequestResult withMessage(String message) { + this.message = message; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("vmSize", this.vmSize, (writer, element) -> writer.writeString(element)); + jsonWriter.writeBooleanField("isFeasible", this.isFeasible); + jsonWriter.writeStringField("messageCode", this.messageCode); + jsonWriter.writeStringField("message", this.message); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VmPlacementRequestResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VmPlacementRequestResult if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the VmPlacementRequestResult. + */ + public static VmPlacementRequestResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VmPlacementRequestResult deserializedVmPlacementRequestResult = new VmPlacementRequestResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("vmSize".equals(fieldName)) { + List vmSize = reader.readArray(reader1 -> reader1.getString()); + deserializedVmPlacementRequestResult.vmSize = vmSize; + } else if ("isFeasible".equals(fieldName)) { + deserializedVmPlacementRequestResult.isFeasible = reader.getNullable(JsonReader::getBoolean); + } else if ("messageCode".equals(fieldName)) { + deserializedVmPlacementRequestResult.messageCode = reader.getString(); + } else if ("message".equals(fieldName)) { + deserializedVmPlacementRequestResult.message = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedVmPlacementRequestResult; + }); + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/package-info.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/package-info.java index 912ee3ec8ce3..c27c081a1909 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/package-info.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/package-info.java @@ -1,9 +1,9 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. /** - * Package containing the data models for DataBoxEdgeManagementClient. - * null. + * Package containing the data models for DataBoxEdge. + * // (missing-service-description) Add service description. */ package com.azure.resourcemanager.databoxedge.models; diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/package-info.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/package-info.java index e55884bb73ef..74b6570a6a47 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/package-info.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/package-info.java @@ -1,9 +1,9 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. /** - * Package containing the classes for DataBoxEdgeManagementClient. - * null. + * Package containing the classes for DataBoxEdge. + * // (missing-service-description) Add service description. */ package com.azure.resourcemanager.databoxedge; diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/module-info.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/module-info.java index 7531525b8078..63bae80b18ea 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/module-info.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/module-info.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. module com.azure.resourcemanager.databoxedge { requires transitive com.azure.core.management; @@ -12,4 +12,5 @@ opens com.azure.resourcemanager.databoxedge.fluent.models to com.azure.core; opens com.azure.resourcemanager.databoxedge.models to com.azure.core; + opens com.azure.resourcemanager.databoxedge.implementation.models to com.azure.core; } diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/resources/META-INF/azure-resourcemanager-databoxedge_apiview_properties.json b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/resources/META-INF/azure-resourcemanager-databoxedge_apiview_properties.json new file mode 100644 index 000000000000..2df25dcd9e21 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/resources/META-INF/azure-resourcemanager-databoxedge_apiview_properties.json @@ -0,0 +1,347 @@ +{ + "flavor": "azure", + "CrossLanguageDefinitionId": { + "com.azure.resourcemanager.databoxedge.fluent.AddonsClient": "Microsoft.DataBoxEdge.Addons", + "com.azure.resourcemanager.databoxedge.fluent.AddonsClient.beginCreateOrUpdate": "Microsoft.DataBoxEdge.Addons.createOrUpdate", + "com.azure.resourcemanager.databoxedge.fluent.AddonsClient.beginDelete": "Microsoft.DataBoxEdge.Addons.delete", + "com.azure.resourcemanager.databoxedge.fluent.AddonsClient.createOrUpdate": "Microsoft.DataBoxEdge.Addons.createOrUpdate", + "com.azure.resourcemanager.databoxedge.fluent.AddonsClient.delete": "Microsoft.DataBoxEdge.Addons.delete", + "com.azure.resourcemanager.databoxedge.fluent.AddonsClient.get": "Microsoft.DataBoxEdge.Addons.get", + "com.azure.resourcemanager.databoxedge.fluent.AddonsClient.getWithResponse": "Microsoft.DataBoxEdge.Addons.get", + "com.azure.resourcemanager.databoxedge.fluent.AddonsClient.listByRole": "Microsoft.DataBoxEdge.Addons.listByRole", + "com.azure.resourcemanager.databoxedge.fluent.AlertsClient": "Microsoft.DataBoxEdge.Alerts", + "com.azure.resourcemanager.databoxedge.fluent.AlertsClient.get": "Microsoft.DataBoxEdge.Alerts.get", + "com.azure.resourcemanager.databoxedge.fluent.AlertsClient.getWithResponse": "Microsoft.DataBoxEdge.Alerts.get", + "com.azure.resourcemanager.databoxedge.fluent.AlertsClient.listByDataBoxEdgeDevice": "Microsoft.DataBoxEdge.Alerts.listByDataBoxEdgeDevice", + "com.azure.resourcemanager.databoxedge.fluent.AvailableSkusClient": "Microsoft.DataBoxEdge", + "com.azure.resourcemanager.databoxedge.fluent.AvailableSkusClient.list": "Microsoft.DataBoxEdge.AvailableSkusOperationGroup.list", + "com.azure.resourcemanager.databoxedge.fluent.AvailableSkusClient.listWithResponse": "Microsoft.DataBoxEdge.AvailableSkusOperationGroup.list", + "com.azure.resourcemanager.databoxedge.fluent.BandwidthSchedulesClient": "Microsoft.DataBoxEdge.BandwidthSchedules", + "com.azure.resourcemanager.databoxedge.fluent.BandwidthSchedulesClient.beginCreateOrUpdate": "Microsoft.DataBoxEdge.BandwidthSchedules.createOrUpdate", + "com.azure.resourcemanager.databoxedge.fluent.BandwidthSchedulesClient.beginDelete": "Microsoft.DataBoxEdge.BandwidthSchedules.delete", + "com.azure.resourcemanager.databoxedge.fluent.BandwidthSchedulesClient.createOrUpdate": "Microsoft.DataBoxEdge.BandwidthSchedules.createOrUpdate", + "com.azure.resourcemanager.databoxedge.fluent.BandwidthSchedulesClient.delete": "Microsoft.DataBoxEdge.BandwidthSchedules.delete", + "com.azure.resourcemanager.databoxedge.fluent.BandwidthSchedulesClient.get": "Microsoft.DataBoxEdge.BandwidthSchedules.get", + "com.azure.resourcemanager.databoxedge.fluent.BandwidthSchedulesClient.getWithResponse": "Microsoft.DataBoxEdge.BandwidthSchedules.get", + "com.azure.resourcemanager.databoxedge.fluent.BandwidthSchedulesClient.listByDataBoxEdgeDevice": "Microsoft.DataBoxEdge.BandwidthSchedules.listByDataBoxEdgeDevice", + "com.azure.resourcemanager.databoxedge.fluent.ContainersClient": "Microsoft.DataBoxEdge.Containers", + "com.azure.resourcemanager.databoxedge.fluent.ContainersClient.beginCreateOrUpdate": "Microsoft.DataBoxEdge.Containers.createOrUpdate", + "com.azure.resourcemanager.databoxedge.fluent.ContainersClient.beginDelete": "Microsoft.DataBoxEdge.Containers.delete", + "com.azure.resourcemanager.databoxedge.fluent.ContainersClient.beginRefresh": "Microsoft.DataBoxEdge.Containers.refresh", + "com.azure.resourcemanager.databoxedge.fluent.ContainersClient.createOrUpdate": "Microsoft.DataBoxEdge.Containers.createOrUpdate", + "com.azure.resourcemanager.databoxedge.fluent.ContainersClient.delete": "Microsoft.DataBoxEdge.Containers.delete", + "com.azure.resourcemanager.databoxedge.fluent.ContainersClient.get": "Microsoft.DataBoxEdge.Containers.get", + "com.azure.resourcemanager.databoxedge.fluent.ContainersClient.getWithResponse": "Microsoft.DataBoxEdge.Containers.get", + "com.azure.resourcemanager.databoxedge.fluent.ContainersClient.listByStorageAccount": "Microsoft.DataBoxEdge.Containers.listByStorageAccount", + "com.azure.resourcemanager.databoxedge.fluent.ContainersClient.refresh": "Microsoft.DataBoxEdge.Containers.refresh", + "com.azure.resourcemanager.databoxedge.fluent.DataBoxEdgeManagementClient": "Microsoft.DataBoxEdge", + "com.azure.resourcemanager.databoxedge.fluent.DeviceCapacityChecksClient": "Microsoft.DataBoxEdge", + "com.azure.resourcemanager.databoxedge.fluent.DeviceCapacityChecksClient.beginCheckResourceCreationFeasibility": "Microsoft.DataBoxEdge.DataBoxEdgeDevices.checkResourceCreationFeasibility", + "com.azure.resourcemanager.databoxedge.fluent.DeviceCapacityChecksClient.checkResourceCreationFeasibility": "Microsoft.DataBoxEdge.DataBoxEdgeDevices.checkResourceCreationFeasibility", + "com.azure.resourcemanager.databoxedge.fluent.DeviceCapacityInfoesClient": "Microsoft.DataBoxEdge", + "com.azure.resourcemanager.databoxedge.fluent.DeviceCapacityInfoesClient.getDeviceCapacityInfo": "Microsoft.DataBoxEdge.DeviceCapacityInfos.getDeviceCapacityInfo", + "com.azure.resourcemanager.databoxedge.fluent.DeviceCapacityInfoesClient.getDeviceCapacityInfoWithResponse": "Microsoft.DataBoxEdge.DeviceCapacityInfos.getDeviceCapacityInfo", + "com.azure.resourcemanager.databoxedge.fluent.DevicesClient": "Microsoft.DataBoxEdge.Devices", + "com.azure.resourcemanager.databoxedge.fluent.DevicesClient.beginCreateOrUpdateSecuritySettings": "Microsoft.DataBoxEdge.DataBoxEdgeDevices.createOrUpdateSecuritySettings", + "com.azure.resourcemanager.databoxedge.fluent.DevicesClient.beginDelete": "Microsoft.DataBoxEdge.DataBoxEdgeDevices.delete", + "com.azure.resourcemanager.databoxedge.fluent.DevicesClient.beginDownloadUpdates": "Microsoft.DataBoxEdge.DataBoxEdgeDevices.downloadUpdates", + "com.azure.resourcemanager.databoxedge.fluent.DevicesClient.beginInstallUpdates": "Microsoft.DataBoxEdge.DataBoxEdgeDevices.installUpdates", + "com.azure.resourcemanager.databoxedge.fluent.DevicesClient.beginScanForUpdates": "Microsoft.DataBoxEdge.DataBoxEdgeDevices.scanForUpdates", + "com.azure.resourcemanager.databoxedge.fluent.DevicesClient.createOrUpdate": "Microsoft.DataBoxEdge.DataBoxEdgeDevices.createOrUpdate", + "com.azure.resourcemanager.databoxedge.fluent.DevicesClient.createOrUpdateSecuritySettings": "Microsoft.DataBoxEdge.DataBoxEdgeDevices.createOrUpdateSecuritySettings", + "com.azure.resourcemanager.databoxedge.fluent.DevicesClient.createOrUpdateWithResponse": "Microsoft.DataBoxEdge.DataBoxEdgeDevices.createOrUpdate", + "com.azure.resourcemanager.databoxedge.fluent.DevicesClient.delete": "Microsoft.DataBoxEdge.DataBoxEdgeDevices.delete", + "com.azure.resourcemanager.databoxedge.fluent.DevicesClient.downloadUpdates": "Microsoft.DataBoxEdge.DataBoxEdgeDevices.downloadUpdates", + "com.azure.resourcemanager.databoxedge.fluent.DevicesClient.generateCertificate": "Microsoft.DataBoxEdge.DataBoxEdgeDevices.generateCertificate", + "com.azure.resourcemanager.databoxedge.fluent.DevicesClient.generateCertificateWithResponse": "Microsoft.DataBoxEdge.DataBoxEdgeDevices.generateCertificate", + "com.azure.resourcemanager.databoxedge.fluent.DevicesClient.getByResourceGroup": "Microsoft.DataBoxEdge.DataBoxEdgeDevices.get", + "com.azure.resourcemanager.databoxedge.fluent.DevicesClient.getByResourceGroupWithResponse": "Microsoft.DataBoxEdge.DataBoxEdgeDevices.get", + "com.azure.resourcemanager.databoxedge.fluent.DevicesClient.getExtendedInformation": "Microsoft.DataBoxEdge.DataBoxEdgeDevices.getExtendedInformation", + "com.azure.resourcemanager.databoxedge.fluent.DevicesClient.getExtendedInformationWithResponse": "Microsoft.DataBoxEdge.DataBoxEdgeDevices.getExtendedInformation", + "com.azure.resourcemanager.databoxedge.fluent.DevicesClient.getNetworkSettings": "Microsoft.DataBoxEdge.Devices.getNetworkSettings", + "com.azure.resourcemanager.databoxedge.fluent.DevicesClient.getNetworkSettingsWithResponse": "Microsoft.DataBoxEdge.Devices.getNetworkSettings", + "com.azure.resourcemanager.databoxedge.fluent.DevicesClient.getUpdateSummary": "Microsoft.DataBoxEdge.UpdateSummaries.getUpdateSummary", + "com.azure.resourcemanager.databoxedge.fluent.DevicesClient.getUpdateSummaryWithResponse": "Microsoft.DataBoxEdge.UpdateSummaries.getUpdateSummary", + "com.azure.resourcemanager.databoxedge.fluent.DevicesClient.installUpdates": "Microsoft.DataBoxEdge.DataBoxEdgeDevices.installUpdates", + "com.azure.resourcemanager.databoxedge.fluent.DevicesClient.list": "Microsoft.DataBoxEdge.DataBoxEdgeDevices.listBySubscription", + "com.azure.resourcemanager.databoxedge.fluent.DevicesClient.listByResourceGroup": "Microsoft.DataBoxEdge.DataBoxEdgeDevices.listByResourceGroup", + "com.azure.resourcemanager.databoxedge.fluent.DevicesClient.scanForUpdates": "Microsoft.DataBoxEdge.DataBoxEdgeDevices.scanForUpdates", + "com.azure.resourcemanager.databoxedge.fluent.DevicesClient.update": "Microsoft.DataBoxEdge.DataBoxEdgeDevices.update", + "com.azure.resourcemanager.databoxedge.fluent.DevicesClient.updateExtendedInformation": "Microsoft.DataBoxEdge.DataBoxEdgeDevices.updateExtendedInformation", + "com.azure.resourcemanager.databoxedge.fluent.DevicesClient.updateExtendedInformationWithResponse": "Microsoft.DataBoxEdge.DataBoxEdgeDevices.updateExtendedInformation", + "com.azure.resourcemanager.databoxedge.fluent.DevicesClient.updateWithResponse": "Microsoft.DataBoxEdge.DataBoxEdgeDevices.update", + "com.azure.resourcemanager.databoxedge.fluent.DevicesClient.uploadCertificate": "Microsoft.DataBoxEdge.DataBoxEdgeDevices.uploadCertificate", + "com.azure.resourcemanager.databoxedge.fluent.DevicesClient.uploadCertificateWithResponse": "Microsoft.DataBoxEdge.DataBoxEdgeDevices.uploadCertificate", + "com.azure.resourcemanager.databoxedge.fluent.DiagnosticSettingsClient": "Microsoft.DataBoxEdge.DiagnosticSettings", + "com.azure.resourcemanager.databoxedge.fluent.DiagnosticSettingsClient.beginUpdateDiagnosticProactiveLogCollectionSettings": "Microsoft.DataBoxEdge.DiagnosticSettings.updateDiagnosticProactiveLogCollectionSettings", + "com.azure.resourcemanager.databoxedge.fluent.DiagnosticSettingsClient.beginUpdateDiagnosticRemoteSupportSettings": "Microsoft.DataBoxEdge.DiagnosticRemoteSupportSettingsOperationGroup.updateDiagnosticRemoteSupportSettings", + "com.azure.resourcemanager.databoxedge.fluent.DiagnosticSettingsClient.getDiagnosticProactiveLogCollectionSettings": "Microsoft.DataBoxEdge.DiagnosticSettings.getDiagnosticProactiveLogCollectionSettings", + "com.azure.resourcemanager.databoxedge.fluent.DiagnosticSettingsClient.getDiagnosticProactiveLogCollectionSettingsWithResponse": "Microsoft.DataBoxEdge.DiagnosticSettings.getDiagnosticProactiveLogCollectionSettings", + "com.azure.resourcemanager.databoxedge.fluent.DiagnosticSettingsClient.getDiagnosticRemoteSupportSettings": "Microsoft.DataBoxEdge.DiagnosticRemoteSupportSettingsOperationGroup.getDiagnosticRemoteSupportSettings", + "com.azure.resourcemanager.databoxedge.fluent.DiagnosticSettingsClient.getDiagnosticRemoteSupportSettingsWithResponse": "Microsoft.DataBoxEdge.DiagnosticRemoteSupportSettingsOperationGroup.getDiagnosticRemoteSupportSettings", + "com.azure.resourcemanager.databoxedge.fluent.DiagnosticSettingsClient.updateDiagnosticProactiveLogCollectionSettings": "Microsoft.DataBoxEdge.DiagnosticSettings.updateDiagnosticProactiveLogCollectionSettings", + "com.azure.resourcemanager.databoxedge.fluent.DiagnosticSettingsClient.updateDiagnosticRemoteSupportSettings": "Microsoft.DataBoxEdge.DiagnosticRemoteSupportSettingsOperationGroup.updateDiagnosticRemoteSupportSettings", + "com.azure.resourcemanager.databoxedge.fluent.JobsClient": "Microsoft.DataBoxEdge.Jobs", + "com.azure.resourcemanager.databoxedge.fluent.JobsClient.get": "Microsoft.DataBoxEdge.Jobs.get", + "com.azure.resourcemanager.databoxedge.fluent.JobsClient.getWithResponse": "Microsoft.DataBoxEdge.Jobs.get", + "com.azure.resourcemanager.databoxedge.fluent.MonitoringConfigsClient": "Microsoft.DataBoxEdge", + "com.azure.resourcemanager.databoxedge.fluent.MonitoringConfigsClient.beginCreateOrUpdate": "Microsoft.DataBoxEdge.MonitoringMetricConfigurations.createOrUpdate", + "com.azure.resourcemanager.databoxedge.fluent.MonitoringConfigsClient.beginDelete": "Microsoft.DataBoxEdge.MonitoringMetricConfigurations.delete", + "com.azure.resourcemanager.databoxedge.fluent.MonitoringConfigsClient.createOrUpdate": "Microsoft.DataBoxEdge.MonitoringMetricConfigurations.createOrUpdate", + "com.azure.resourcemanager.databoxedge.fluent.MonitoringConfigsClient.delete": "Microsoft.DataBoxEdge.MonitoringMetricConfigurations.delete", + "com.azure.resourcemanager.databoxedge.fluent.MonitoringConfigsClient.get": "Microsoft.DataBoxEdge.MonitoringMetricConfigurations.get", + "com.azure.resourcemanager.databoxedge.fluent.MonitoringConfigsClient.getWithResponse": "Microsoft.DataBoxEdge.MonitoringMetricConfigurations.get", + "com.azure.resourcemanager.databoxedge.fluent.MonitoringConfigsClient.list": "Microsoft.DataBoxEdge.MonitoringMetricConfigurations.list", + "com.azure.resourcemanager.databoxedge.fluent.NodesClient": "Microsoft.DataBoxEdge", + "com.azure.resourcemanager.databoxedge.fluent.NodesClient.listByDataBoxEdgeDevice": "Microsoft.DataBoxEdge.DataBoxEdgeDevices.listByDataBoxEdgeDevice", + "com.azure.resourcemanager.databoxedge.fluent.OperationsClient": "Microsoft.DataBoxEdge.Operations", + "com.azure.resourcemanager.databoxedge.fluent.OperationsClient.list": "Azure.ResourceManager.Operations.list", + "com.azure.resourcemanager.databoxedge.fluent.OperationsStatusClient": "Microsoft.DataBoxEdge.OperationsStatus", + "com.azure.resourcemanager.databoxedge.fluent.OperationsStatusClient.get": "Microsoft.DataBoxEdge.OperationsStatus.get", + "com.azure.resourcemanager.databoxedge.fluent.OperationsStatusClient.getWithResponse": "Microsoft.DataBoxEdge.OperationsStatus.get", + "com.azure.resourcemanager.databoxedge.fluent.OrdersClient": "Microsoft.DataBoxEdge.Orders", + "com.azure.resourcemanager.databoxedge.fluent.OrdersClient.beginCreateOrUpdate": "Microsoft.DataBoxEdge.Orders.createOrUpdate", + "com.azure.resourcemanager.databoxedge.fluent.OrdersClient.beginDelete": "Microsoft.DataBoxEdge.Orders.delete", + "com.azure.resourcemanager.databoxedge.fluent.OrdersClient.createOrUpdate": "Microsoft.DataBoxEdge.Orders.createOrUpdate", + "com.azure.resourcemanager.databoxedge.fluent.OrdersClient.delete": "Microsoft.DataBoxEdge.Orders.delete", + "com.azure.resourcemanager.databoxedge.fluent.OrdersClient.get": "Microsoft.DataBoxEdge.Orders.get", + "com.azure.resourcemanager.databoxedge.fluent.OrdersClient.getWithResponse": "Microsoft.DataBoxEdge.Orders.get", + "com.azure.resourcemanager.databoxedge.fluent.OrdersClient.listByDataBoxEdgeDevice": "Microsoft.DataBoxEdge.Orders.listByDataBoxEdgeDevice", + "com.azure.resourcemanager.databoxedge.fluent.OrdersClient.listDCAccessCode": "Microsoft.DataBoxEdge.Orders.listDCAccessCode", + "com.azure.resourcemanager.databoxedge.fluent.OrdersClient.listDCAccessCodeWithResponse": "Microsoft.DataBoxEdge.Orders.listDCAccessCode", + "com.azure.resourcemanager.databoxedge.fluent.RolesClient": "Microsoft.DataBoxEdge.Roles", + "com.azure.resourcemanager.databoxedge.fluent.RolesClient.beginCreateOrUpdate": "Microsoft.DataBoxEdge.Roles.createOrUpdate", + "com.azure.resourcemanager.databoxedge.fluent.RolesClient.beginDelete": "Microsoft.DataBoxEdge.Roles.delete", + "com.azure.resourcemanager.databoxedge.fluent.RolesClient.createOrUpdate": "Microsoft.DataBoxEdge.Roles.createOrUpdate", + "com.azure.resourcemanager.databoxedge.fluent.RolesClient.delete": "Microsoft.DataBoxEdge.Roles.delete", + "com.azure.resourcemanager.databoxedge.fluent.RolesClient.get": "Microsoft.DataBoxEdge.Roles.get", + "com.azure.resourcemanager.databoxedge.fluent.RolesClient.getWithResponse": "Microsoft.DataBoxEdge.Roles.get", + "com.azure.resourcemanager.databoxedge.fluent.RolesClient.listByDataBoxEdgeDevice": "Microsoft.DataBoxEdge.Roles.listByDataBoxEdgeDevice", + "com.azure.resourcemanager.databoxedge.fluent.SharesClient": "Microsoft.DataBoxEdge.Shares", + "com.azure.resourcemanager.databoxedge.fluent.SharesClient.beginCreateOrUpdate": "Microsoft.DataBoxEdge.Shares.createOrUpdate", + "com.azure.resourcemanager.databoxedge.fluent.SharesClient.beginDelete": "Microsoft.DataBoxEdge.Shares.delete", + "com.azure.resourcemanager.databoxedge.fluent.SharesClient.beginRefresh": "Microsoft.DataBoxEdge.Shares.refresh", + "com.azure.resourcemanager.databoxedge.fluent.SharesClient.createOrUpdate": "Microsoft.DataBoxEdge.Shares.createOrUpdate", + "com.azure.resourcemanager.databoxedge.fluent.SharesClient.delete": "Microsoft.DataBoxEdge.Shares.delete", + "com.azure.resourcemanager.databoxedge.fluent.SharesClient.get": "Microsoft.DataBoxEdge.Shares.get", + "com.azure.resourcemanager.databoxedge.fluent.SharesClient.getWithResponse": "Microsoft.DataBoxEdge.Shares.get", + "com.azure.resourcemanager.databoxedge.fluent.SharesClient.listByDataBoxEdgeDevice": "Microsoft.DataBoxEdge.Shares.listByDataBoxEdgeDevice", + "com.azure.resourcemanager.databoxedge.fluent.SharesClient.refresh": "Microsoft.DataBoxEdge.Shares.refresh", + "com.azure.resourcemanager.databoxedge.fluent.StorageAccountCredentialsClient": "Microsoft.DataBoxEdge.StorageAccountCredentials", + "com.azure.resourcemanager.databoxedge.fluent.StorageAccountCredentialsClient.beginCreateOrUpdate": "Microsoft.DataBoxEdge.StorageAccountCredentials.createOrUpdate", + "com.azure.resourcemanager.databoxedge.fluent.StorageAccountCredentialsClient.beginDelete": "Microsoft.DataBoxEdge.StorageAccountCredentials.delete", + "com.azure.resourcemanager.databoxedge.fluent.StorageAccountCredentialsClient.createOrUpdate": "Microsoft.DataBoxEdge.StorageAccountCredentials.createOrUpdate", + "com.azure.resourcemanager.databoxedge.fluent.StorageAccountCredentialsClient.delete": "Microsoft.DataBoxEdge.StorageAccountCredentials.delete", + "com.azure.resourcemanager.databoxedge.fluent.StorageAccountCredentialsClient.get": "Microsoft.DataBoxEdge.StorageAccountCredentials.get", + "com.azure.resourcemanager.databoxedge.fluent.StorageAccountCredentialsClient.getWithResponse": "Microsoft.DataBoxEdge.StorageAccountCredentials.get", + "com.azure.resourcemanager.databoxedge.fluent.StorageAccountCredentialsClient.listByDataBoxEdgeDevice": "Microsoft.DataBoxEdge.StorageAccountCredentials.listByDataBoxEdgeDevice", + "com.azure.resourcemanager.databoxedge.fluent.StorageAccountsClient": "Microsoft.DataBoxEdge.StorageAccounts", + "com.azure.resourcemanager.databoxedge.fluent.StorageAccountsClient.beginCreateOrUpdate": "Microsoft.DataBoxEdge.StorageAccounts.createOrUpdate", + "com.azure.resourcemanager.databoxedge.fluent.StorageAccountsClient.beginDelete": "Microsoft.DataBoxEdge.StorageAccounts.delete", + "com.azure.resourcemanager.databoxedge.fluent.StorageAccountsClient.createOrUpdate": "Microsoft.DataBoxEdge.StorageAccounts.createOrUpdate", + "com.azure.resourcemanager.databoxedge.fluent.StorageAccountsClient.delete": "Microsoft.DataBoxEdge.StorageAccounts.delete", + "com.azure.resourcemanager.databoxedge.fluent.StorageAccountsClient.get": "Microsoft.DataBoxEdge.StorageAccounts.get", + "com.azure.resourcemanager.databoxedge.fluent.StorageAccountsClient.getWithResponse": "Microsoft.DataBoxEdge.StorageAccounts.get", + "com.azure.resourcemanager.databoxedge.fluent.StorageAccountsClient.listByDataBoxEdgeDevice": "Microsoft.DataBoxEdge.StorageAccounts.listByDataBoxEdgeDevice", + "com.azure.resourcemanager.databoxedge.fluent.SupportPackagesClient": "Microsoft.DataBoxEdge", + "com.azure.resourcemanager.databoxedge.fluent.SupportPackagesClient.beginTriggerSupportPackage": "Microsoft.DataBoxEdge.DataBoxEdgeDevices.triggerSupportPackage", + "com.azure.resourcemanager.databoxedge.fluent.SupportPackagesClient.triggerSupportPackage": "Microsoft.DataBoxEdge.DataBoxEdgeDevices.triggerSupportPackage", + "com.azure.resourcemanager.databoxedge.fluent.TriggersClient": "Microsoft.DataBoxEdge.Triggers", + "com.azure.resourcemanager.databoxedge.fluent.TriggersClient.beginCreateOrUpdate": "Microsoft.DataBoxEdge.Triggers.createOrUpdate", + "com.azure.resourcemanager.databoxedge.fluent.TriggersClient.beginDelete": "Microsoft.DataBoxEdge.Triggers.delete", + "com.azure.resourcemanager.databoxedge.fluent.TriggersClient.createOrUpdate": "Microsoft.DataBoxEdge.Triggers.createOrUpdate", + "com.azure.resourcemanager.databoxedge.fluent.TriggersClient.delete": "Microsoft.DataBoxEdge.Triggers.delete", + "com.azure.resourcemanager.databoxedge.fluent.TriggersClient.get": "Microsoft.DataBoxEdge.Triggers.get", + "com.azure.resourcemanager.databoxedge.fluent.TriggersClient.getWithResponse": "Microsoft.DataBoxEdge.Triggers.get", + "com.azure.resourcemanager.databoxedge.fluent.TriggersClient.listByDataBoxEdgeDevice": "Microsoft.DataBoxEdge.Triggers.listByDataBoxEdgeDevice", + "com.azure.resourcemanager.databoxedge.fluent.UsersClient": "Microsoft.DataBoxEdge.Users", + "com.azure.resourcemanager.databoxedge.fluent.UsersClient.beginCreateOrUpdate": "Microsoft.DataBoxEdge.Users.createOrUpdate", + "com.azure.resourcemanager.databoxedge.fluent.UsersClient.beginDelete": "Microsoft.DataBoxEdge.Users.delete", + "com.azure.resourcemanager.databoxedge.fluent.UsersClient.createOrUpdate": "Microsoft.DataBoxEdge.Users.createOrUpdate", + "com.azure.resourcemanager.databoxedge.fluent.UsersClient.delete": "Microsoft.DataBoxEdge.Users.delete", + "com.azure.resourcemanager.databoxedge.fluent.UsersClient.get": "Microsoft.DataBoxEdge.Users.get", + "com.azure.resourcemanager.databoxedge.fluent.UsersClient.getWithResponse": "Microsoft.DataBoxEdge.Users.get", + "com.azure.resourcemanager.databoxedge.fluent.UsersClient.listByDataBoxEdgeDevice": "Microsoft.DataBoxEdge.Users.listByDataBoxEdgeDevice", + "com.azure.resourcemanager.databoxedge.fluent.models.AddonInner": "Microsoft.DataBoxEdge.Addon", + "com.azure.resourcemanager.databoxedge.fluent.models.AlertInner": "Microsoft.DataBoxEdge.Alert", + "com.azure.resourcemanager.databoxedge.fluent.models.AlertProperties": "Microsoft.DataBoxEdge.AlertProperties", + "com.azure.resourcemanager.databoxedge.fluent.models.BandwidthScheduleInner": "Microsoft.DataBoxEdge.BandwidthSchedule", + "com.azure.resourcemanager.databoxedge.fluent.models.BandwidthScheduleProperties": "Microsoft.DataBoxEdge.BandwidthScheduleProperties", + "com.azure.resourcemanager.databoxedge.fluent.models.ContainerInner": "Microsoft.DataBoxEdge.Container", + "com.azure.resourcemanager.databoxedge.fluent.models.ContainerProperties": "Microsoft.DataBoxEdge.ContainerProperties", + "com.azure.resourcemanager.databoxedge.fluent.models.DCAccessCodeInner": "Microsoft.DataBoxEdge.DCAccessCode", + "com.azure.resourcemanager.databoxedge.fluent.models.DCAccessCodeProperties": "Microsoft.DataBoxEdge.DCAccessCodeProperties", + "com.azure.resourcemanager.databoxedge.fluent.models.DataBoxEdgeDeviceExtendedInfoInner": "Microsoft.DataBoxEdge.DataBoxEdgeDeviceExtendedInfo", + "com.azure.resourcemanager.databoxedge.fluent.models.DataBoxEdgeDeviceExtendedInfoProperties": "Microsoft.DataBoxEdge.DataBoxEdgeDeviceExtendedInfoProperties", + "com.azure.resourcemanager.databoxedge.fluent.models.DataBoxEdgeDeviceInner": "Microsoft.DataBoxEdge.DataBoxEdgeDevice", + "com.azure.resourcemanager.databoxedge.fluent.models.DataBoxEdgeDeviceProperties": "Microsoft.DataBoxEdge.DataBoxEdgeDeviceProperties", + "com.azure.resourcemanager.databoxedge.fluent.models.DataBoxEdgeDevicePropertiesPatch": "Microsoft.DataBoxEdge.DataBoxEdgeDevicePropertiesPatch", + "com.azure.resourcemanager.databoxedge.fluent.models.DataBoxEdgeSkuListInner": "Microsoft.DataBoxEdge.DataBoxEdgeSkuList", + "com.azure.resourcemanager.databoxedge.fluent.models.DeviceCapacityInfoInner": "Microsoft.DataBoxEdge.DeviceCapacityInfo", + "com.azure.resourcemanager.databoxedge.fluent.models.DeviceCapacityInfoProperties": "Microsoft.DataBoxEdge.DeviceCapacityInfoProperties", + "com.azure.resourcemanager.databoxedge.fluent.models.DeviceCapacityRequestInfoProperties": "Microsoft.DataBoxEdge.DeviceCapacityRequestInfoProperties", + "com.azure.resourcemanager.databoxedge.fluent.models.DiagnosticProactiveLogCollectionSettingsInner": "Microsoft.DataBoxEdge.DiagnosticProactiveLogCollectionSettings", + "com.azure.resourcemanager.databoxedge.fluent.models.DiagnosticRemoteSupportSettingsInner": "Microsoft.DataBoxEdge.DiagnosticRemoteSupportSettings", + "com.azure.resourcemanager.databoxedge.fluent.models.DiagnosticRemoteSupportSettingsProperties": "Microsoft.DataBoxEdge.DiagnosticRemoteSupportSettingsProperties", + "com.azure.resourcemanager.databoxedge.fluent.models.GenerateCertResponseInner": "Microsoft.DataBoxEdge.GenerateCertResponse", + "com.azure.resourcemanager.databoxedge.fluent.models.JobInner": "Microsoft.DataBoxEdge.Job", + "com.azure.resourcemanager.databoxedge.fluent.models.JobProperties": "Microsoft.DataBoxEdge.JobProperties", + "com.azure.resourcemanager.databoxedge.fluent.models.MonitoringMetricConfigurationInner": "Microsoft.DataBoxEdge.MonitoringMetricConfiguration", + "com.azure.resourcemanager.databoxedge.fluent.models.MonitoringMetricConfigurationProperties": "Microsoft.DataBoxEdge.MonitoringMetricConfigurationProperties", + "com.azure.resourcemanager.databoxedge.fluent.models.NetworkSettingsInner": "Microsoft.DataBoxEdge.NetworkSettings", + "com.azure.resourcemanager.databoxedge.fluent.models.NetworkSettingsProperties": "Microsoft.DataBoxEdge.NetworkSettingsProperties", + "com.azure.resourcemanager.databoxedge.fluent.models.NodeInner": "Microsoft.DataBoxEdge.Node", + "com.azure.resourcemanager.databoxedge.fluent.models.NodeProperties": "Microsoft.DataBoxEdge.NodeProperties", + "com.azure.resourcemanager.databoxedge.fluent.models.OperationInner": "Azure.ResourceManager.CommonTypes.Operation", + "com.azure.resourcemanager.databoxedge.fluent.models.OrderInner": "Microsoft.DataBoxEdge.Order", + "com.azure.resourcemanager.databoxedge.fluent.models.OrderProperties": "Microsoft.DataBoxEdge.OrderProperties", + "com.azure.resourcemanager.databoxedge.fluent.models.ProactiveLogCollectionSettingsProperties": "Microsoft.DataBoxEdge.ProactiveLogCollectionSettingsProperties", + "com.azure.resourcemanager.databoxedge.fluent.models.RawCertificateData": "Microsoft.DataBoxEdge.RawCertificateData", + "com.azure.resourcemanager.databoxedge.fluent.models.RoleInner": "Microsoft.DataBoxEdge.Role", + "com.azure.resourcemanager.databoxedge.fluent.models.SecuritySettingsProperties": "Microsoft.DataBoxEdge.SecuritySettingsProperties", + "com.azure.resourcemanager.databoxedge.fluent.models.ShareInner": "Microsoft.DataBoxEdge.Share", + "com.azure.resourcemanager.databoxedge.fluent.models.ShareProperties": "Microsoft.DataBoxEdge.ShareProperties", + "com.azure.resourcemanager.databoxedge.fluent.models.StorageAccountCredentialInner": "Microsoft.DataBoxEdge.StorageAccountCredential", + "com.azure.resourcemanager.databoxedge.fluent.models.StorageAccountCredentialProperties": "Microsoft.DataBoxEdge.StorageAccountCredentialProperties", + "com.azure.resourcemanager.databoxedge.fluent.models.StorageAccountInner": "Microsoft.DataBoxEdge.StorageAccount", + "com.azure.resourcemanager.databoxedge.fluent.models.StorageAccountProperties": "Microsoft.DataBoxEdge.StorageAccountProperties", + "com.azure.resourcemanager.databoxedge.fluent.models.SubscriptionProperties": "Microsoft.DataBoxEdge.SubscriptionProperties", + "com.azure.resourcemanager.databoxedge.fluent.models.SupportPackageRequestProperties": "Microsoft.DataBoxEdge.SupportPackageRequestProperties", + "com.azure.resourcemanager.databoxedge.fluent.models.TriggerInner": "Microsoft.DataBoxEdge.Trigger", + "com.azure.resourcemanager.databoxedge.fluent.models.UpdateSummaryInner": "Microsoft.DataBoxEdge.UpdateSummary", + "com.azure.resourcemanager.databoxedge.fluent.models.UpdateSummaryProperties": "Microsoft.DataBoxEdge.UpdateSummaryProperties", + "com.azure.resourcemanager.databoxedge.fluent.models.UploadCertificateResponseInner": "Microsoft.DataBoxEdge.UploadCertificateResponse", + "com.azure.resourcemanager.databoxedge.fluent.models.UserInner": "Microsoft.DataBoxEdge.User", + "com.azure.resourcemanager.databoxedge.fluent.models.UserProperties": "Microsoft.DataBoxEdge.UserProperties", + "com.azure.resourcemanager.databoxedge.implementation.DataBoxEdgeManagementClientBuilder": "Microsoft.DataBoxEdge", + "com.azure.resourcemanager.databoxedge.implementation.models.AddonList": "Microsoft.DataBoxEdge.AddonList", + "com.azure.resourcemanager.databoxedge.implementation.models.AlertList": "Microsoft.DataBoxEdge.AlertList", + "com.azure.resourcemanager.databoxedge.implementation.models.BandwidthSchedulesList": "Microsoft.DataBoxEdge.BandwidthSchedulesList", + "com.azure.resourcemanager.databoxedge.implementation.models.ContainerList": "Microsoft.DataBoxEdge.ContainerList", + "com.azure.resourcemanager.databoxedge.implementation.models.DataBoxEdgeDeviceList": "Microsoft.DataBoxEdge.DataBoxEdgeDeviceList", + "com.azure.resourcemanager.databoxedge.implementation.models.MonitoringMetricConfigurationList": "Microsoft.DataBoxEdge.MonitoringMetricConfigurationList", + "com.azure.resourcemanager.databoxedge.implementation.models.NodeList": "Microsoft.DataBoxEdge.NodeList", + "com.azure.resourcemanager.databoxedge.implementation.models.OperationListResult": "Azure.ResourceManager.CommonTypes.OperationListResult", + "com.azure.resourcemanager.databoxedge.implementation.models.OrderList": "Microsoft.DataBoxEdge.OrderList", + "com.azure.resourcemanager.databoxedge.implementation.models.RoleList": "Microsoft.DataBoxEdge.RoleList", + "com.azure.resourcemanager.databoxedge.implementation.models.ShareList": "Microsoft.DataBoxEdge.ShareList", + "com.azure.resourcemanager.databoxedge.implementation.models.StorageAccountCredentialList": "Microsoft.DataBoxEdge.StorageAccountCredentialList", + "com.azure.resourcemanager.databoxedge.implementation.models.StorageAccountList": "Microsoft.DataBoxEdge.StorageAccountList", + "com.azure.resourcemanager.databoxedge.implementation.models.TriggerList": "Microsoft.DataBoxEdge.TriggerList", + "com.azure.resourcemanager.databoxedge.implementation.models.UserList": "Microsoft.DataBoxEdge.UserList", + "com.azure.resourcemanager.databoxedge.models.ARMBaseModel": "Microsoft.DataBoxEdge.ARMBaseModel", + "com.azure.resourcemanager.databoxedge.models.AccessLevel": "Microsoft.DataBoxEdge.AccessLevel", + "com.azure.resourcemanager.databoxedge.models.AccountType": "Microsoft.DataBoxEdge.AccountType", + "com.azure.resourcemanager.databoxedge.models.ActionType": "Azure.ResourceManager.CommonTypes.ActionType", + "com.azure.resourcemanager.databoxedge.models.AddonProperties": "Microsoft.DataBoxEdge.Addon.properties.anonymous", + "com.azure.resourcemanager.databoxedge.models.AddonType": "Microsoft.DataBoxEdge.AddonType", + "com.azure.resourcemanager.databoxedge.models.Address": "Microsoft.DataBoxEdge.Address", + "com.azure.resourcemanager.databoxedge.models.AlertErrorDetails": "Microsoft.DataBoxEdge.AlertErrorDetails", + "com.azure.resourcemanager.databoxedge.models.AlertSeverity": "Microsoft.DataBoxEdge.AlertSeverity", + "com.azure.resourcemanager.databoxedge.models.AsymmetricEncryptedSecret": "Microsoft.DataBoxEdge.AsymmetricEncryptedSecret", + "com.azure.resourcemanager.databoxedge.models.AuthenticationType": "Microsoft.DataBoxEdge.AuthenticationType", + "com.azure.resourcemanager.databoxedge.models.AzureContainerDataFormat": "Microsoft.DataBoxEdge.AzureContainerDataFormat", + "com.azure.resourcemanager.databoxedge.models.AzureContainerInfo": "Microsoft.DataBoxEdge.AzureContainerInfo", + "com.azure.resourcemanager.databoxedge.models.ClientAccessRight": "Microsoft.DataBoxEdge.ClientAccessRight", + "com.azure.resourcemanager.databoxedge.models.ClientPermissionType": "Microsoft.DataBoxEdge.ClientPermissionType", + "com.azure.resourcemanager.databoxedge.models.ClusterCapacityViewData": "Microsoft.DataBoxEdge.ClusterCapacityViewData", + "com.azure.resourcemanager.databoxedge.models.ClusterGpuCapacity": "Microsoft.DataBoxEdge.ClusterGpuCapacity", + "com.azure.resourcemanager.databoxedge.models.ClusterMemoryCapacity": "Microsoft.DataBoxEdge.ClusterMemoryCapacity", + "com.azure.resourcemanager.databoxedge.models.ClusterStorageViewData": "Microsoft.DataBoxEdge.ClusterStorageViewData", + "com.azure.resourcemanager.databoxedge.models.ClusterWitnessType": "Microsoft.DataBoxEdge.ClusterWitnessType", + "com.azure.resourcemanager.databoxedge.models.ContactDetails": "Microsoft.DataBoxEdge.ContactDetails", + "com.azure.resourcemanager.databoxedge.models.ContainerStatus": "Microsoft.DataBoxEdge.ContainerStatus", + "com.azure.resourcemanager.databoxedge.models.DataBoxEdgeDeviceExtendedInfoPatch": "Microsoft.DataBoxEdge.DataBoxEdgeDeviceExtendedInfoPatch", + "com.azure.resourcemanager.databoxedge.models.DataBoxEdgeDeviceKind": "Microsoft.DataBoxEdge.DataBoxEdgeDeviceKind", + "com.azure.resourcemanager.databoxedge.models.DataBoxEdgeDevicePatch": "Microsoft.DataBoxEdge.DataBoxEdgeDevicePatch", + "com.azure.resourcemanager.databoxedge.models.DataBoxEdgeDeviceStatus": "Microsoft.DataBoxEdge.DataBoxEdgeDeviceStatus", + "com.azure.resourcemanager.databoxedge.models.DataBoxEdgeSku": "Microsoft.DataBoxEdge.DataBoxEdgeSku", + "com.azure.resourcemanager.databoxedge.models.DataPolicy": "Microsoft.DataBoxEdge.DataPolicy", + "com.azure.resourcemanager.databoxedge.models.DataResidency": "Microsoft.DataBoxEdge.DataResidency", + "com.azure.resourcemanager.databoxedge.models.DataResidencyType": "Microsoft.DataBoxEdge.DataResidencyType", + "com.azure.resourcemanager.databoxedge.models.DayOfWeek": "Microsoft.DataBoxEdge.DayOfWeek", + "com.azure.resourcemanager.databoxedge.models.DeviceCapacityRequestInfo": "Microsoft.DataBoxEdge.DeviceCapacityRequestInfo", + "com.azure.resourcemanager.databoxedge.models.DeviceType": "Microsoft.DataBoxEdge.DeviceType", + "com.azure.resourcemanager.databoxedge.models.DownloadPhase": "Microsoft.DataBoxEdge.DownloadPhase", + "com.azure.resourcemanager.databoxedge.models.EdgeProfile": "Microsoft.DataBoxEdge.EdgeProfile", + "com.azure.resourcemanager.databoxedge.models.EdgeProfilePatch": "Microsoft.DataBoxEdge.EdgeProfilePatch", + "com.azure.resourcemanager.databoxedge.models.EdgeProfileSubscription": "Microsoft.DataBoxEdge.EdgeProfileSubscription", + "com.azure.resourcemanager.databoxedge.models.EdgeProfileSubscriptionPatch": "Microsoft.DataBoxEdge.EdgeProfileSubscriptionPatch", + "com.azure.resourcemanager.databoxedge.models.EncryptionAlgorithm": "Microsoft.DataBoxEdge.EncryptionAlgorithm", + "com.azure.resourcemanager.databoxedge.models.HostCapacity": "Microsoft.DataBoxEdge.HostCapacity", + "com.azure.resourcemanager.databoxedge.models.InstallRebootBehavior": "Microsoft.DataBoxEdge.InstallRebootBehavior", + "com.azure.resourcemanager.databoxedge.models.InstallationImpact": "Microsoft.DataBoxEdge.InstallationImpact", + "com.azure.resourcemanager.databoxedge.models.Ipv4Config": "Microsoft.DataBoxEdge.Ipv4Config", + "com.azure.resourcemanager.databoxedge.models.Ipv6Config": "Microsoft.DataBoxEdge.Ipv6Config", + "com.azure.resourcemanager.databoxedge.models.JobErrorDetails": "Microsoft.DataBoxEdge.JobErrorDetails", + "com.azure.resourcemanager.databoxedge.models.JobErrorItem": "Microsoft.DataBoxEdge.JobErrorItem", + "com.azure.resourcemanager.databoxedge.models.JobStatus": "Microsoft.DataBoxEdge.JobStatus", + "com.azure.resourcemanager.databoxedge.models.JobType": "Microsoft.DataBoxEdge.JobType", + "com.azure.resourcemanager.databoxedge.models.KeyVaultSyncStatus": "Microsoft.DataBoxEdge.KeyVaultSyncStatus", + "com.azure.resourcemanager.databoxedge.models.MetricConfiguration": "Microsoft.DataBoxEdge.MetricConfiguration", + "com.azure.resourcemanager.databoxedge.models.MetricCounter": "Microsoft.DataBoxEdge.MetricCounter", + "com.azure.resourcemanager.databoxedge.models.MetricCounterSet": "Microsoft.DataBoxEdge.MetricCounterSet", + "com.azure.resourcemanager.databoxedge.models.MetricDimension": "Microsoft.DataBoxEdge.MetricDimension", + "com.azure.resourcemanager.databoxedge.models.MonitoringStatus": "Microsoft.DataBoxEdge.MonitoringStatus", + "com.azure.resourcemanager.databoxedge.models.MountPointMap": "Microsoft.DataBoxEdge.MountPointMap", + "com.azure.resourcemanager.databoxedge.models.MountType": "Microsoft.DataBoxEdge.MountType", + "com.azure.resourcemanager.databoxedge.models.MsiIdentityType": "Microsoft.DataBoxEdge.MsiIdentityType", + "com.azure.resourcemanager.databoxedge.models.NetworkAdapter": "Microsoft.DataBoxEdge.NetworkAdapter", + "com.azure.resourcemanager.databoxedge.models.NetworkAdapterDhcpStatus": "Microsoft.DataBoxEdge.NetworkAdapterDhcpStatus", + "com.azure.resourcemanager.databoxedge.models.NetworkAdapterPosition": "Microsoft.DataBoxEdge.NetworkAdapterPosition", + "com.azure.resourcemanager.databoxedge.models.NetworkAdapterRdmaStatus": "Microsoft.DataBoxEdge.NetworkAdapterRdmaStatus", + "com.azure.resourcemanager.databoxedge.models.NetworkAdapterStatus": "Microsoft.DataBoxEdge.NetworkAdapterStatus", + "com.azure.resourcemanager.databoxedge.models.NetworkGroup": "Microsoft.DataBoxEdge.NetworkGroup", + "com.azure.resourcemanager.databoxedge.models.NodeStatus": "Microsoft.DataBoxEdge.NodeStatus", + "com.azure.resourcemanager.databoxedge.models.NumaNodeData": "Microsoft.DataBoxEdge.NumaNodeData", + "com.azure.resourcemanager.databoxedge.models.OperationDisplay": "Azure.ResourceManager.CommonTypes.OperationDisplay", + "com.azure.resourcemanager.databoxedge.models.OrderState": "Microsoft.DataBoxEdge.OrderState", + "com.azure.resourcemanager.databoxedge.models.OrderStatus": "Microsoft.DataBoxEdge.OrderStatus", + "com.azure.resourcemanager.databoxedge.models.Origin": "Azure.ResourceManager.CommonTypes.Origin", + "com.azure.resourcemanager.databoxedge.models.ProactiveDiagnosticsConsent": "Microsoft.DataBoxEdge.ProactiveDiagnosticsConsent", + "com.azure.resourcemanager.databoxedge.models.RefreshDetails": "Microsoft.DataBoxEdge.RefreshDetails", + "com.azure.resourcemanager.databoxedge.models.RemoteApplicationType": "Microsoft.DataBoxEdge.RemoteApplicationType", + "com.azure.resourcemanager.databoxedge.models.RemoteSupportSettings": "Microsoft.DataBoxEdge.RemoteSupportSettings", + "com.azure.resourcemanager.databoxedge.models.ResourceIdentity": "Microsoft.DataBoxEdge.ResourceIdentity", + "com.azure.resourcemanager.databoxedge.models.ResourceMoveDetails": "Microsoft.DataBoxEdge.ResourceMoveDetails", + "com.azure.resourcemanager.databoxedge.models.ResourceMoveStatus": "Microsoft.DataBoxEdge.ResourceMoveStatus", + "com.azure.resourcemanager.databoxedge.models.RoleProperties": "Microsoft.DataBoxEdge.Role.properties.anonymous", + "com.azure.resourcemanager.databoxedge.models.RoleTypes": "Microsoft.DataBoxEdge.RoleTypes", + "com.azure.resourcemanager.databoxedge.models.SSLStatus": "Microsoft.DataBoxEdge.SSLStatus", + "com.azure.resourcemanager.databoxedge.models.Secret": "Microsoft.DataBoxEdge.Secret", + "com.azure.resourcemanager.databoxedge.models.SecuritySettings": "Microsoft.DataBoxEdge.SecuritySettings", + "com.azure.resourcemanager.databoxedge.models.ShareAccessProtocol": "Microsoft.DataBoxEdge.ShareAccessProtocol", + "com.azure.resourcemanager.databoxedge.models.ShareAccessRight": "Microsoft.DataBoxEdge.ShareAccessRight", + "com.azure.resourcemanager.databoxedge.models.ShareAccessType": "Microsoft.DataBoxEdge.ShareAccessType", + "com.azure.resourcemanager.databoxedge.models.ShareStatus": "Microsoft.DataBoxEdge.ShareStatus", + "com.azure.resourcemanager.databoxedge.models.ShipmentType": "Microsoft.DataBoxEdge.ShipmentType", + "com.azure.resourcemanager.databoxedge.models.Sku": "Microsoft.DataBoxEdge.Sku", + "com.azure.resourcemanager.databoxedge.models.SkuAvailability": "Microsoft.DataBoxEdge.SkuAvailability", + "com.azure.resourcemanager.databoxedge.models.SkuCapability": "Microsoft.DataBoxEdge.SkuCapability", + "com.azure.resourcemanager.databoxedge.models.SkuCost": "Microsoft.DataBoxEdge.SkuCost", + "com.azure.resourcemanager.databoxedge.models.SkuLocationInfo": "Microsoft.DataBoxEdge.SkuLocationInfo", + "com.azure.resourcemanager.databoxedge.models.SkuName": "Microsoft.DataBoxEdge.SkuName", + "com.azure.resourcemanager.databoxedge.models.SkuSignupOption": "Microsoft.DataBoxEdge.SkuSignupOption", + "com.azure.resourcemanager.databoxedge.models.SkuTier": "Microsoft.DataBoxEdge.SkuTier", + "com.azure.resourcemanager.databoxedge.models.SkuVersion": "Microsoft.DataBoxEdge.SkuVersion", + "com.azure.resourcemanager.databoxedge.models.StorageAccountStatus": "Microsoft.DataBoxEdge.StorageAccountStatus", + "com.azure.resourcemanager.databoxedge.models.SubscriptionRegisteredFeatures": "Microsoft.DataBoxEdge.SubscriptionRegisteredFeatures", + "com.azure.resourcemanager.databoxedge.models.SubscriptionState": "Microsoft.DataBoxEdge.SubscriptionState", + "com.azure.resourcemanager.databoxedge.models.TrackingInfo": "Microsoft.DataBoxEdge.TrackingInfo", + "com.azure.resourcemanager.databoxedge.models.TriggerEventType": "Microsoft.DataBoxEdge.TriggerEventType", + "com.azure.resourcemanager.databoxedge.models.TriggerProperties": "Microsoft.DataBoxEdge.Trigger.properties.anonymous", + "com.azure.resourcemanager.databoxedge.models.TriggerSupportPackageRequest": "Microsoft.DataBoxEdge.TriggerSupportPackageRequest", + "com.azure.resourcemanager.databoxedge.models.UpdateDetails": "Microsoft.DataBoxEdge.UpdateDetails", + "com.azure.resourcemanager.databoxedge.models.UpdateDownloadProgress": "Microsoft.DataBoxEdge.UpdateDownloadProgress", + "com.azure.resourcemanager.databoxedge.models.UpdateInstallProgress": "Microsoft.DataBoxEdge.UpdateInstallProgress", + "com.azure.resourcemanager.databoxedge.models.UpdateOperation": "Microsoft.DataBoxEdge.UpdateOperation", + "com.azure.resourcemanager.databoxedge.models.UpdateOperationStage": "Microsoft.DataBoxEdge.UpdateOperationStage", + "com.azure.resourcemanager.databoxedge.models.UpdateStatus": "Microsoft.DataBoxEdge.UpdateStatus", + "com.azure.resourcemanager.databoxedge.models.UpdateType": "Microsoft.DataBoxEdge.UpdateType", + "com.azure.resourcemanager.databoxedge.models.UploadCertificateRequest": "Microsoft.DataBoxEdge.UploadCertificateRequest", + "com.azure.resourcemanager.databoxedge.models.UserAccessRight": "Microsoft.DataBoxEdge.UserAccessRight", + "com.azure.resourcemanager.databoxedge.models.UserType": "Microsoft.DataBoxEdge.UserType", + "com.azure.resourcemanager.databoxedge.models.VmMemory": "Microsoft.DataBoxEdge.VmMemory", + "com.azure.resourcemanager.databoxedge.models.VmPlacementRequestResult": "Microsoft.DataBoxEdge.VmPlacementRequestResult" + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/resources/META-INF/azure-resourcemanager-databoxedge_metadata.json b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/resources/META-INF/azure-resourcemanager-databoxedge_metadata.json new file mode 100644 index 000000000000..1aaeaa9f2cad --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/resources/META-INF/azure-resourcemanager-databoxedge_metadata.json @@ -0,0 +1 @@ +{"flavor":"azure","apiVersion":"2023-12-01","crossLanguageDefinitions":{"com.azure.resourcemanager.databoxedge.fluent.AddonsClient":"Microsoft.DataBoxEdge.Addons","com.azure.resourcemanager.databoxedge.fluent.AddonsClient.beginCreateOrUpdate":"Microsoft.DataBoxEdge.Addons.createOrUpdate","com.azure.resourcemanager.databoxedge.fluent.AddonsClient.beginDelete":"Microsoft.DataBoxEdge.Addons.delete","com.azure.resourcemanager.databoxedge.fluent.AddonsClient.createOrUpdate":"Microsoft.DataBoxEdge.Addons.createOrUpdate","com.azure.resourcemanager.databoxedge.fluent.AddonsClient.delete":"Microsoft.DataBoxEdge.Addons.delete","com.azure.resourcemanager.databoxedge.fluent.AddonsClient.get":"Microsoft.DataBoxEdge.Addons.get","com.azure.resourcemanager.databoxedge.fluent.AddonsClient.getWithResponse":"Microsoft.DataBoxEdge.Addons.get","com.azure.resourcemanager.databoxedge.fluent.AddonsClient.listByRole":"Microsoft.DataBoxEdge.Addons.listByRole","com.azure.resourcemanager.databoxedge.fluent.AlertsClient":"Microsoft.DataBoxEdge.Alerts","com.azure.resourcemanager.databoxedge.fluent.AlertsClient.get":"Microsoft.DataBoxEdge.Alerts.get","com.azure.resourcemanager.databoxedge.fluent.AlertsClient.getWithResponse":"Microsoft.DataBoxEdge.Alerts.get","com.azure.resourcemanager.databoxedge.fluent.AlertsClient.listByDataBoxEdgeDevice":"Microsoft.DataBoxEdge.Alerts.listByDataBoxEdgeDevice","com.azure.resourcemanager.databoxedge.fluent.AvailableSkusClient":"Microsoft.DataBoxEdge","com.azure.resourcemanager.databoxedge.fluent.AvailableSkusClient.list":"Microsoft.DataBoxEdge.AvailableSkusOperationGroup.list","com.azure.resourcemanager.databoxedge.fluent.AvailableSkusClient.listWithResponse":"Microsoft.DataBoxEdge.AvailableSkusOperationGroup.list","com.azure.resourcemanager.databoxedge.fluent.BandwidthSchedulesClient":"Microsoft.DataBoxEdge.BandwidthSchedules","com.azure.resourcemanager.databoxedge.fluent.BandwidthSchedulesClient.beginCreateOrUpdate":"Microsoft.DataBoxEdge.BandwidthSchedules.createOrUpdate","com.azure.resourcemanager.databoxedge.fluent.BandwidthSchedulesClient.beginDelete":"Microsoft.DataBoxEdge.BandwidthSchedules.delete","com.azure.resourcemanager.databoxedge.fluent.BandwidthSchedulesClient.createOrUpdate":"Microsoft.DataBoxEdge.BandwidthSchedules.createOrUpdate","com.azure.resourcemanager.databoxedge.fluent.BandwidthSchedulesClient.delete":"Microsoft.DataBoxEdge.BandwidthSchedules.delete","com.azure.resourcemanager.databoxedge.fluent.BandwidthSchedulesClient.get":"Microsoft.DataBoxEdge.BandwidthSchedules.get","com.azure.resourcemanager.databoxedge.fluent.BandwidthSchedulesClient.getWithResponse":"Microsoft.DataBoxEdge.BandwidthSchedules.get","com.azure.resourcemanager.databoxedge.fluent.BandwidthSchedulesClient.listByDataBoxEdgeDevice":"Microsoft.DataBoxEdge.BandwidthSchedules.listByDataBoxEdgeDevice","com.azure.resourcemanager.databoxedge.fluent.ContainersClient":"Microsoft.DataBoxEdge.Containers","com.azure.resourcemanager.databoxedge.fluent.ContainersClient.beginCreateOrUpdate":"Microsoft.DataBoxEdge.Containers.createOrUpdate","com.azure.resourcemanager.databoxedge.fluent.ContainersClient.beginDelete":"Microsoft.DataBoxEdge.Containers.delete","com.azure.resourcemanager.databoxedge.fluent.ContainersClient.beginRefresh":"Microsoft.DataBoxEdge.Containers.refresh","com.azure.resourcemanager.databoxedge.fluent.ContainersClient.createOrUpdate":"Microsoft.DataBoxEdge.Containers.createOrUpdate","com.azure.resourcemanager.databoxedge.fluent.ContainersClient.delete":"Microsoft.DataBoxEdge.Containers.delete","com.azure.resourcemanager.databoxedge.fluent.ContainersClient.get":"Microsoft.DataBoxEdge.Containers.get","com.azure.resourcemanager.databoxedge.fluent.ContainersClient.getWithResponse":"Microsoft.DataBoxEdge.Containers.get","com.azure.resourcemanager.databoxedge.fluent.ContainersClient.listByStorageAccount":"Microsoft.DataBoxEdge.Containers.listByStorageAccount","com.azure.resourcemanager.databoxedge.fluent.ContainersClient.refresh":"Microsoft.DataBoxEdge.Containers.refresh","com.azure.resourcemanager.databoxedge.fluent.DataBoxEdgeManagementClient":"Microsoft.DataBoxEdge","com.azure.resourcemanager.databoxedge.fluent.DeviceCapacityChecksClient":"Microsoft.DataBoxEdge","com.azure.resourcemanager.databoxedge.fluent.DeviceCapacityChecksClient.beginCheckResourceCreationFeasibility":"Microsoft.DataBoxEdge.DataBoxEdgeDevices.checkResourceCreationFeasibility","com.azure.resourcemanager.databoxedge.fluent.DeviceCapacityChecksClient.checkResourceCreationFeasibility":"Microsoft.DataBoxEdge.DataBoxEdgeDevices.checkResourceCreationFeasibility","com.azure.resourcemanager.databoxedge.fluent.DeviceCapacityInfoesClient":"Microsoft.DataBoxEdge","com.azure.resourcemanager.databoxedge.fluent.DeviceCapacityInfoesClient.getDeviceCapacityInfo":"Microsoft.DataBoxEdge.DeviceCapacityInfos.getDeviceCapacityInfo","com.azure.resourcemanager.databoxedge.fluent.DeviceCapacityInfoesClient.getDeviceCapacityInfoWithResponse":"Microsoft.DataBoxEdge.DeviceCapacityInfos.getDeviceCapacityInfo","com.azure.resourcemanager.databoxedge.fluent.DevicesClient":"Microsoft.DataBoxEdge.Devices","com.azure.resourcemanager.databoxedge.fluent.DevicesClient.beginCreateOrUpdateSecuritySettings":"Microsoft.DataBoxEdge.DataBoxEdgeDevices.createOrUpdateSecuritySettings","com.azure.resourcemanager.databoxedge.fluent.DevicesClient.beginDelete":"Microsoft.DataBoxEdge.DataBoxEdgeDevices.delete","com.azure.resourcemanager.databoxedge.fluent.DevicesClient.beginDownloadUpdates":"Microsoft.DataBoxEdge.DataBoxEdgeDevices.downloadUpdates","com.azure.resourcemanager.databoxedge.fluent.DevicesClient.beginInstallUpdates":"Microsoft.DataBoxEdge.DataBoxEdgeDevices.installUpdates","com.azure.resourcemanager.databoxedge.fluent.DevicesClient.beginScanForUpdates":"Microsoft.DataBoxEdge.DataBoxEdgeDevices.scanForUpdates","com.azure.resourcemanager.databoxedge.fluent.DevicesClient.createOrUpdate":"Microsoft.DataBoxEdge.DataBoxEdgeDevices.createOrUpdate","com.azure.resourcemanager.databoxedge.fluent.DevicesClient.createOrUpdateSecuritySettings":"Microsoft.DataBoxEdge.DataBoxEdgeDevices.createOrUpdateSecuritySettings","com.azure.resourcemanager.databoxedge.fluent.DevicesClient.createOrUpdateWithResponse":"Microsoft.DataBoxEdge.DataBoxEdgeDevices.createOrUpdate","com.azure.resourcemanager.databoxedge.fluent.DevicesClient.delete":"Microsoft.DataBoxEdge.DataBoxEdgeDevices.delete","com.azure.resourcemanager.databoxedge.fluent.DevicesClient.downloadUpdates":"Microsoft.DataBoxEdge.DataBoxEdgeDevices.downloadUpdates","com.azure.resourcemanager.databoxedge.fluent.DevicesClient.generateCertificate":"Microsoft.DataBoxEdge.DataBoxEdgeDevices.generateCertificate","com.azure.resourcemanager.databoxedge.fluent.DevicesClient.generateCertificateWithResponse":"Microsoft.DataBoxEdge.DataBoxEdgeDevices.generateCertificate","com.azure.resourcemanager.databoxedge.fluent.DevicesClient.getByResourceGroup":"Microsoft.DataBoxEdge.DataBoxEdgeDevices.get","com.azure.resourcemanager.databoxedge.fluent.DevicesClient.getByResourceGroupWithResponse":"Microsoft.DataBoxEdge.DataBoxEdgeDevices.get","com.azure.resourcemanager.databoxedge.fluent.DevicesClient.getExtendedInformation":"Microsoft.DataBoxEdge.DataBoxEdgeDevices.getExtendedInformation","com.azure.resourcemanager.databoxedge.fluent.DevicesClient.getExtendedInformationWithResponse":"Microsoft.DataBoxEdge.DataBoxEdgeDevices.getExtendedInformation","com.azure.resourcemanager.databoxedge.fluent.DevicesClient.getNetworkSettings":"Microsoft.DataBoxEdge.Devices.getNetworkSettings","com.azure.resourcemanager.databoxedge.fluent.DevicesClient.getNetworkSettingsWithResponse":"Microsoft.DataBoxEdge.Devices.getNetworkSettings","com.azure.resourcemanager.databoxedge.fluent.DevicesClient.getUpdateSummary":"Microsoft.DataBoxEdge.UpdateSummaries.getUpdateSummary","com.azure.resourcemanager.databoxedge.fluent.DevicesClient.getUpdateSummaryWithResponse":"Microsoft.DataBoxEdge.UpdateSummaries.getUpdateSummary","com.azure.resourcemanager.databoxedge.fluent.DevicesClient.installUpdates":"Microsoft.DataBoxEdge.DataBoxEdgeDevices.installUpdates","com.azure.resourcemanager.databoxedge.fluent.DevicesClient.list":"Microsoft.DataBoxEdge.DataBoxEdgeDevices.listBySubscription","com.azure.resourcemanager.databoxedge.fluent.DevicesClient.listByResourceGroup":"Microsoft.DataBoxEdge.DataBoxEdgeDevices.listByResourceGroup","com.azure.resourcemanager.databoxedge.fluent.DevicesClient.scanForUpdates":"Microsoft.DataBoxEdge.DataBoxEdgeDevices.scanForUpdates","com.azure.resourcemanager.databoxedge.fluent.DevicesClient.update":"Microsoft.DataBoxEdge.DataBoxEdgeDevices.update","com.azure.resourcemanager.databoxedge.fluent.DevicesClient.updateExtendedInformation":"Microsoft.DataBoxEdge.DataBoxEdgeDevices.updateExtendedInformation","com.azure.resourcemanager.databoxedge.fluent.DevicesClient.updateExtendedInformationWithResponse":"Microsoft.DataBoxEdge.DataBoxEdgeDevices.updateExtendedInformation","com.azure.resourcemanager.databoxedge.fluent.DevicesClient.updateWithResponse":"Microsoft.DataBoxEdge.DataBoxEdgeDevices.update","com.azure.resourcemanager.databoxedge.fluent.DevicesClient.uploadCertificate":"Microsoft.DataBoxEdge.DataBoxEdgeDevices.uploadCertificate","com.azure.resourcemanager.databoxedge.fluent.DevicesClient.uploadCertificateWithResponse":"Microsoft.DataBoxEdge.DataBoxEdgeDevices.uploadCertificate","com.azure.resourcemanager.databoxedge.fluent.DiagnosticSettingsClient":"Microsoft.DataBoxEdge.DiagnosticSettings","com.azure.resourcemanager.databoxedge.fluent.DiagnosticSettingsClient.beginUpdateDiagnosticProactiveLogCollectionSettings":"Microsoft.DataBoxEdge.DiagnosticSettings.updateDiagnosticProactiveLogCollectionSettings","com.azure.resourcemanager.databoxedge.fluent.DiagnosticSettingsClient.beginUpdateDiagnosticRemoteSupportSettings":"Microsoft.DataBoxEdge.DiagnosticRemoteSupportSettingsOperationGroup.updateDiagnosticRemoteSupportSettings","com.azure.resourcemanager.databoxedge.fluent.DiagnosticSettingsClient.getDiagnosticProactiveLogCollectionSettings":"Microsoft.DataBoxEdge.DiagnosticSettings.getDiagnosticProactiveLogCollectionSettings","com.azure.resourcemanager.databoxedge.fluent.DiagnosticSettingsClient.getDiagnosticProactiveLogCollectionSettingsWithResponse":"Microsoft.DataBoxEdge.DiagnosticSettings.getDiagnosticProactiveLogCollectionSettings","com.azure.resourcemanager.databoxedge.fluent.DiagnosticSettingsClient.getDiagnosticRemoteSupportSettings":"Microsoft.DataBoxEdge.DiagnosticRemoteSupportSettingsOperationGroup.getDiagnosticRemoteSupportSettings","com.azure.resourcemanager.databoxedge.fluent.DiagnosticSettingsClient.getDiagnosticRemoteSupportSettingsWithResponse":"Microsoft.DataBoxEdge.DiagnosticRemoteSupportSettingsOperationGroup.getDiagnosticRemoteSupportSettings","com.azure.resourcemanager.databoxedge.fluent.DiagnosticSettingsClient.updateDiagnosticProactiveLogCollectionSettings":"Microsoft.DataBoxEdge.DiagnosticSettings.updateDiagnosticProactiveLogCollectionSettings","com.azure.resourcemanager.databoxedge.fluent.DiagnosticSettingsClient.updateDiagnosticRemoteSupportSettings":"Microsoft.DataBoxEdge.DiagnosticRemoteSupportSettingsOperationGroup.updateDiagnosticRemoteSupportSettings","com.azure.resourcemanager.databoxedge.fluent.JobsClient":"Microsoft.DataBoxEdge.Jobs","com.azure.resourcemanager.databoxedge.fluent.JobsClient.get":"Microsoft.DataBoxEdge.Jobs.get","com.azure.resourcemanager.databoxedge.fluent.JobsClient.getWithResponse":"Microsoft.DataBoxEdge.Jobs.get","com.azure.resourcemanager.databoxedge.fluent.MonitoringConfigsClient":"Microsoft.DataBoxEdge","com.azure.resourcemanager.databoxedge.fluent.MonitoringConfigsClient.beginCreateOrUpdate":"Microsoft.DataBoxEdge.MonitoringMetricConfigurations.createOrUpdate","com.azure.resourcemanager.databoxedge.fluent.MonitoringConfigsClient.beginDelete":"Microsoft.DataBoxEdge.MonitoringMetricConfigurations.delete","com.azure.resourcemanager.databoxedge.fluent.MonitoringConfigsClient.createOrUpdate":"Microsoft.DataBoxEdge.MonitoringMetricConfigurations.createOrUpdate","com.azure.resourcemanager.databoxedge.fluent.MonitoringConfigsClient.delete":"Microsoft.DataBoxEdge.MonitoringMetricConfigurations.delete","com.azure.resourcemanager.databoxedge.fluent.MonitoringConfigsClient.get":"Microsoft.DataBoxEdge.MonitoringMetricConfigurations.get","com.azure.resourcemanager.databoxedge.fluent.MonitoringConfigsClient.getWithResponse":"Microsoft.DataBoxEdge.MonitoringMetricConfigurations.get","com.azure.resourcemanager.databoxedge.fluent.MonitoringConfigsClient.list":"Microsoft.DataBoxEdge.MonitoringMetricConfigurations.list","com.azure.resourcemanager.databoxedge.fluent.NodesClient":"Microsoft.DataBoxEdge","com.azure.resourcemanager.databoxedge.fluent.NodesClient.listByDataBoxEdgeDevice":"Microsoft.DataBoxEdge.DataBoxEdgeDevices.listByDataBoxEdgeDevice","com.azure.resourcemanager.databoxedge.fluent.OperationsClient":"Microsoft.DataBoxEdge.Operations","com.azure.resourcemanager.databoxedge.fluent.OperationsClient.list":"Azure.ResourceManager.Operations.list","com.azure.resourcemanager.databoxedge.fluent.OperationsStatusClient":"Microsoft.DataBoxEdge.OperationsStatus","com.azure.resourcemanager.databoxedge.fluent.OperationsStatusClient.get":"Microsoft.DataBoxEdge.OperationsStatus.get","com.azure.resourcemanager.databoxedge.fluent.OperationsStatusClient.getWithResponse":"Microsoft.DataBoxEdge.OperationsStatus.get","com.azure.resourcemanager.databoxedge.fluent.OrdersClient":"Microsoft.DataBoxEdge.Orders","com.azure.resourcemanager.databoxedge.fluent.OrdersClient.beginCreateOrUpdate":"Microsoft.DataBoxEdge.Orders.createOrUpdate","com.azure.resourcemanager.databoxedge.fluent.OrdersClient.beginDelete":"Microsoft.DataBoxEdge.Orders.delete","com.azure.resourcemanager.databoxedge.fluent.OrdersClient.createOrUpdate":"Microsoft.DataBoxEdge.Orders.createOrUpdate","com.azure.resourcemanager.databoxedge.fluent.OrdersClient.delete":"Microsoft.DataBoxEdge.Orders.delete","com.azure.resourcemanager.databoxedge.fluent.OrdersClient.get":"Microsoft.DataBoxEdge.Orders.get","com.azure.resourcemanager.databoxedge.fluent.OrdersClient.getWithResponse":"Microsoft.DataBoxEdge.Orders.get","com.azure.resourcemanager.databoxedge.fluent.OrdersClient.listByDataBoxEdgeDevice":"Microsoft.DataBoxEdge.Orders.listByDataBoxEdgeDevice","com.azure.resourcemanager.databoxedge.fluent.OrdersClient.listDCAccessCode":"Microsoft.DataBoxEdge.Orders.listDCAccessCode","com.azure.resourcemanager.databoxedge.fluent.OrdersClient.listDCAccessCodeWithResponse":"Microsoft.DataBoxEdge.Orders.listDCAccessCode","com.azure.resourcemanager.databoxedge.fluent.RolesClient":"Microsoft.DataBoxEdge.Roles","com.azure.resourcemanager.databoxedge.fluent.RolesClient.beginCreateOrUpdate":"Microsoft.DataBoxEdge.Roles.createOrUpdate","com.azure.resourcemanager.databoxedge.fluent.RolesClient.beginDelete":"Microsoft.DataBoxEdge.Roles.delete","com.azure.resourcemanager.databoxedge.fluent.RolesClient.createOrUpdate":"Microsoft.DataBoxEdge.Roles.createOrUpdate","com.azure.resourcemanager.databoxedge.fluent.RolesClient.delete":"Microsoft.DataBoxEdge.Roles.delete","com.azure.resourcemanager.databoxedge.fluent.RolesClient.get":"Microsoft.DataBoxEdge.Roles.get","com.azure.resourcemanager.databoxedge.fluent.RolesClient.getWithResponse":"Microsoft.DataBoxEdge.Roles.get","com.azure.resourcemanager.databoxedge.fluent.RolesClient.listByDataBoxEdgeDevice":"Microsoft.DataBoxEdge.Roles.listByDataBoxEdgeDevice","com.azure.resourcemanager.databoxedge.fluent.SharesClient":"Microsoft.DataBoxEdge.Shares","com.azure.resourcemanager.databoxedge.fluent.SharesClient.beginCreateOrUpdate":"Microsoft.DataBoxEdge.Shares.createOrUpdate","com.azure.resourcemanager.databoxedge.fluent.SharesClient.beginDelete":"Microsoft.DataBoxEdge.Shares.delete","com.azure.resourcemanager.databoxedge.fluent.SharesClient.beginRefresh":"Microsoft.DataBoxEdge.Shares.refresh","com.azure.resourcemanager.databoxedge.fluent.SharesClient.createOrUpdate":"Microsoft.DataBoxEdge.Shares.createOrUpdate","com.azure.resourcemanager.databoxedge.fluent.SharesClient.delete":"Microsoft.DataBoxEdge.Shares.delete","com.azure.resourcemanager.databoxedge.fluent.SharesClient.get":"Microsoft.DataBoxEdge.Shares.get","com.azure.resourcemanager.databoxedge.fluent.SharesClient.getWithResponse":"Microsoft.DataBoxEdge.Shares.get","com.azure.resourcemanager.databoxedge.fluent.SharesClient.listByDataBoxEdgeDevice":"Microsoft.DataBoxEdge.Shares.listByDataBoxEdgeDevice","com.azure.resourcemanager.databoxedge.fluent.SharesClient.refresh":"Microsoft.DataBoxEdge.Shares.refresh","com.azure.resourcemanager.databoxedge.fluent.StorageAccountCredentialsClient":"Microsoft.DataBoxEdge.StorageAccountCredentials","com.azure.resourcemanager.databoxedge.fluent.StorageAccountCredentialsClient.beginCreateOrUpdate":"Microsoft.DataBoxEdge.StorageAccountCredentials.createOrUpdate","com.azure.resourcemanager.databoxedge.fluent.StorageAccountCredentialsClient.beginDelete":"Microsoft.DataBoxEdge.StorageAccountCredentials.delete","com.azure.resourcemanager.databoxedge.fluent.StorageAccountCredentialsClient.createOrUpdate":"Microsoft.DataBoxEdge.StorageAccountCredentials.createOrUpdate","com.azure.resourcemanager.databoxedge.fluent.StorageAccountCredentialsClient.delete":"Microsoft.DataBoxEdge.StorageAccountCredentials.delete","com.azure.resourcemanager.databoxedge.fluent.StorageAccountCredentialsClient.get":"Microsoft.DataBoxEdge.StorageAccountCredentials.get","com.azure.resourcemanager.databoxedge.fluent.StorageAccountCredentialsClient.getWithResponse":"Microsoft.DataBoxEdge.StorageAccountCredentials.get","com.azure.resourcemanager.databoxedge.fluent.StorageAccountCredentialsClient.listByDataBoxEdgeDevice":"Microsoft.DataBoxEdge.StorageAccountCredentials.listByDataBoxEdgeDevice","com.azure.resourcemanager.databoxedge.fluent.StorageAccountsClient":"Microsoft.DataBoxEdge.StorageAccounts","com.azure.resourcemanager.databoxedge.fluent.StorageAccountsClient.beginCreateOrUpdate":"Microsoft.DataBoxEdge.StorageAccounts.createOrUpdate","com.azure.resourcemanager.databoxedge.fluent.StorageAccountsClient.beginDelete":"Microsoft.DataBoxEdge.StorageAccounts.delete","com.azure.resourcemanager.databoxedge.fluent.StorageAccountsClient.createOrUpdate":"Microsoft.DataBoxEdge.StorageAccounts.createOrUpdate","com.azure.resourcemanager.databoxedge.fluent.StorageAccountsClient.delete":"Microsoft.DataBoxEdge.StorageAccounts.delete","com.azure.resourcemanager.databoxedge.fluent.StorageAccountsClient.get":"Microsoft.DataBoxEdge.StorageAccounts.get","com.azure.resourcemanager.databoxedge.fluent.StorageAccountsClient.getWithResponse":"Microsoft.DataBoxEdge.StorageAccounts.get","com.azure.resourcemanager.databoxedge.fluent.StorageAccountsClient.listByDataBoxEdgeDevice":"Microsoft.DataBoxEdge.StorageAccounts.listByDataBoxEdgeDevice","com.azure.resourcemanager.databoxedge.fluent.SupportPackagesClient":"Microsoft.DataBoxEdge","com.azure.resourcemanager.databoxedge.fluent.SupportPackagesClient.beginTriggerSupportPackage":"Microsoft.DataBoxEdge.DataBoxEdgeDevices.triggerSupportPackage","com.azure.resourcemanager.databoxedge.fluent.SupportPackagesClient.triggerSupportPackage":"Microsoft.DataBoxEdge.DataBoxEdgeDevices.triggerSupportPackage","com.azure.resourcemanager.databoxedge.fluent.TriggersClient":"Microsoft.DataBoxEdge.Triggers","com.azure.resourcemanager.databoxedge.fluent.TriggersClient.beginCreateOrUpdate":"Microsoft.DataBoxEdge.Triggers.createOrUpdate","com.azure.resourcemanager.databoxedge.fluent.TriggersClient.beginDelete":"Microsoft.DataBoxEdge.Triggers.delete","com.azure.resourcemanager.databoxedge.fluent.TriggersClient.createOrUpdate":"Microsoft.DataBoxEdge.Triggers.createOrUpdate","com.azure.resourcemanager.databoxedge.fluent.TriggersClient.delete":"Microsoft.DataBoxEdge.Triggers.delete","com.azure.resourcemanager.databoxedge.fluent.TriggersClient.get":"Microsoft.DataBoxEdge.Triggers.get","com.azure.resourcemanager.databoxedge.fluent.TriggersClient.getWithResponse":"Microsoft.DataBoxEdge.Triggers.get","com.azure.resourcemanager.databoxedge.fluent.TriggersClient.listByDataBoxEdgeDevice":"Microsoft.DataBoxEdge.Triggers.listByDataBoxEdgeDevice","com.azure.resourcemanager.databoxedge.fluent.UsersClient":"Microsoft.DataBoxEdge.Users","com.azure.resourcemanager.databoxedge.fluent.UsersClient.beginCreateOrUpdate":"Microsoft.DataBoxEdge.Users.createOrUpdate","com.azure.resourcemanager.databoxedge.fluent.UsersClient.beginDelete":"Microsoft.DataBoxEdge.Users.delete","com.azure.resourcemanager.databoxedge.fluent.UsersClient.createOrUpdate":"Microsoft.DataBoxEdge.Users.createOrUpdate","com.azure.resourcemanager.databoxedge.fluent.UsersClient.delete":"Microsoft.DataBoxEdge.Users.delete","com.azure.resourcemanager.databoxedge.fluent.UsersClient.get":"Microsoft.DataBoxEdge.Users.get","com.azure.resourcemanager.databoxedge.fluent.UsersClient.getWithResponse":"Microsoft.DataBoxEdge.Users.get","com.azure.resourcemanager.databoxedge.fluent.UsersClient.listByDataBoxEdgeDevice":"Microsoft.DataBoxEdge.Users.listByDataBoxEdgeDevice","com.azure.resourcemanager.databoxedge.fluent.models.AddonInner":"Microsoft.DataBoxEdge.Addon","com.azure.resourcemanager.databoxedge.fluent.models.AlertInner":"Microsoft.DataBoxEdge.Alert","com.azure.resourcemanager.databoxedge.fluent.models.AlertProperties":"Microsoft.DataBoxEdge.AlertProperties","com.azure.resourcemanager.databoxedge.fluent.models.BandwidthScheduleInner":"Microsoft.DataBoxEdge.BandwidthSchedule","com.azure.resourcemanager.databoxedge.fluent.models.BandwidthScheduleProperties":"Microsoft.DataBoxEdge.BandwidthScheduleProperties","com.azure.resourcemanager.databoxedge.fluent.models.ContainerInner":"Microsoft.DataBoxEdge.Container","com.azure.resourcemanager.databoxedge.fluent.models.ContainerProperties":"Microsoft.DataBoxEdge.ContainerProperties","com.azure.resourcemanager.databoxedge.fluent.models.DCAccessCodeInner":"Microsoft.DataBoxEdge.DCAccessCode","com.azure.resourcemanager.databoxedge.fluent.models.DCAccessCodeProperties":"Microsoft.DataBoxEdge.DCAccessCodeProperties","com.azure.resourcemanager.databoxedge.fluent.models.DataBoxEdgeDeviceExtendedInfoInner":"Microsoft.DataBoxEdge.DataBoxEdgeDeviceExtendedInfo","com.azure.resourcemanager.databoxedge.fluent.models.DataBoxEdgeDeviceExtendedInfoProperties":"Microsoft.DataBoxEdge.DataBoxEdgeDeviceExtendedInfoProperties","com.azure.resourcemanager.databoxedge.fluent.models.DataBoxEdgeDeviceInner":"Microsoft.DataBoxEdge.DataBoxEdgeDevice","com.azure.resourcemanager.databoxedge.fluent.models.DataBoxEdgeDeviceProperties":"Microsoft.DataBoxEdge.DataBoxEdgeDeviceProperties","com.azure.resourcemanager.databoxedge.fluent.models.DataBoxEdgeDevicePropertiesPatch":"Microsoft.DataBoxEdge.DataBoxEdgeDevicePropertiesPatch","com.azure.resourcemanager.databoxedge.fluent.models.DataBoxEdgeSkuListInner":"Microsoft.DataBoxEdge.DataBoxEdgeSkuList","com.azure.resourcemanager.databoxedge.fluent.models.DeviceCapacityInfoInner":"Microsoft.DataBoxEdge.DeviceCapacityInfo","com.azure.resourcemanager.databoxedge.fluent.models.DeviceCapacityInfoProperties":"Microsoft.DataBoxEdge.DeviceCapacityInfoProperties","com.azure.resourcemanager.databoxedge.fluent.models.DeviceCapacityRequestInfoProperties":"Microsoft.DataBoxEdge.DeviceCapacityRequestInfoProperties","com.azure.resourcemanager.databoxedge.fluent.models.DiagnosticProactiveLogCollectionSettingsInner":"Microsoft.DataBoxEdge.DiagnosticProactiveLogCollectionSettings","com.azure.resourcemanager.databoxedge.fluent.models.DiagnosticRemoteSupportSettingsInner":"Microsoft.DataBoxEdge.DiagnosticRemoteSupportSettings","com.azure.resourcemanager.databoxedge.fluent.models.DiagnosticRemoteSupportSettingsProperties":"Microsoft.DataBoxEdge.DiagnosticRemoteSupportSettingsProperties","com.azure.resourcemanager.databoxedge.fluent.models.GenerateCertResponseInner":"Microsoft.DataBoxEdge.GenerateCertResponse","com.azure.resourcemanager.databoxedge.fluent.models.JobInner":"Microsoft.DataBoxEdge.Job","com.azure.resourcemanager.databoxedge.fluent.models.JobProperties":"Microsoft.DataBoxEdge.JobProperties","com.azure.resourcemanager.databoxedge.fluent.models.MonitoringMetricConfigurationInner":"Microsoft.DataBoxEdge.MonitoringMetricConfiguration","com.azure.resourcemanager.databoxedge.fluent.models.MonitoringMetricConfigurationProperties":"Microsoft.DataBoxEdge.MonitoringMetricConfigurationProperties","com.azure.resourcemanager.databoxedge.fluent.models.NetworkSettingsInner":"Microsoft.DataBoxEdge.NetworkSettings","com.azure.resourcemanager.databoxedge.fluent.models.NetworkSettingsProperties":"Microsoft.DataBoxEdge.NetworkSettingsProperties","com.azure.resourcemanager.databoxedge.fluent.models.NodeInner":"Microsoft.DataBoxEdge.Node","com.azure.resourcemanager.databoxedge.fluent.models.NodeProperties":"Microsoft.DataBoxEdge.NodeProperties","com.azure.resourcemanager.databoxedge.fluent.models.OperationInner":"Azure.ResourceManager.CommonTypes.Operation","com.azure.resourcemanager.databoxedge.fluent.models.OrderInner":"Microsoft.DataBoxEdge.Order","com.azure.resourcemanager.databoxedge.fluent.models.OrderProperties":"Microsoft.DataBoxEdge.OrderProperties","com.azure.resourcemanager.databoxedge.fluent.models.ProactiveLogCollectionSettingsProperties":"Microsoft.DataBoxEdge.ProactiveLogCollectionSettingsProperties","com.azure.resourcemanager.databoxedge.fluent.models.RawCertificateData":"Microsoft.DataBoxEdge.RawCertificateData","com.azure.resourcemanager.databoxedge.fluent.models.RoleInner":"Microsoft.DataBoxEdge.Role","com.azure.resourcemanager.databoxedge.fluent.models.SecuritySettingsProperties":"Microsoft.DataBoxEdge.SecuritySettingsProperties","com.azure.resourcemanager.databoxedge.fluent.models.ShareInner":"Microsoft.DataBoxEdge.Share","com.azure.resourcemanager.databoxedge.fluent.models.ShareProperties":"Microsoft.DataBoxEdge.ShareProperties","com.azure.resourcemanager.databoxedge.fluent.models.StorageAccountCredentialInner":"Microsoft.DataBoxEdge.StorageAccountCredential","com.azure.resourcemanager.databoxedge.fluent.models.StorageAccountCredentialProperties":"Microsoft.DataBoxEdge.StorageAccountCredentialProperties","com.azure.resourcemanager.databoxedge.fluent.models.StorageAccountInner":"Microsoft.DataBoxEdge.StorageAccount","com.azure.resourcemanager.databoxedge.fluent.models.StorageAccountProperties":"Microsoft.DataBoxEdge.StorageAccountProperties","com.azure.resourcemanager.databoxedge.fluent.models.SubscriptionProperties":"Microsoft.DataBoxEdge.SubscriptionProperties","com.azure.resourcemanager.databoxedge.fluent.models.SupportPackageRequestProperties":"Microsoft.DataBoxEdge.SupportPackageRequestProperties","com.azure.resourcemanager.databoxedge.fluent.models.TriggerInner":"Microsoft.DataBoxEdge.Trigger","com.azure.resourcemanager.databoxedge.fluent.models.UpdateSummaryInner":"Microsoft.DataBoxEdge.UpdateSummary","com.azure.resourcemanager.databoxedge.fluent.models.UpdateSummaryProperties":"Microsoft.DataBoxEdge.UpdateSummaryProperties","com.azure.resourcemanager.databoxedge.fluent.models.UploadCertificateResponseInner":"Microsoft.DataBoxEdge.UploadCertificateResponse","com.azure.resourcemanager.databoxedge.fluent.models.UserInner":"Microsoft.DataBoxEdge.User","com.azure.resourcemanager.databoxedge.fluent.models.UserProperties":"Microsoft.DataBoxEdge.UserProperties","com.azure.resourcemanager.databoxedge.implementation.DataBoxEdgeManagementClientBuilder":"Microsoft.DataBoxEdge","com.azure.resourcemanager.databoxedge.implementation.models.AddonList":"Microsoft.DataBoxEdge.AddonList","com.azure.resourcemanager.databoxedge.implementation.models.AlertList":"Microsoft.DataBoxEdge.AlertList","com.azure.resourcemanager.databoxedge.implementation.models.BandwidthSchedulesList":"Microsoft.DataBoxEdge.BandwidthSchedulesList","com.azure.resourcemanager.databoxedge.implementation.models.ContainerList":"Microsoft.DataBoxEdge.ContainerList","com.azure.resourcemanager.databoxedge.implementation.models.DataBoxEdgeDeviceList":"Microsoft.DataBoxEdge.DataBoxEdgeDeviceList","com.azure.resourcemanager.databoxedge.implementation.models.MonitoringMetricConfigurationList":"Microsoft.DataBoxEdge.MonitoringMetricConfigurationList","com.azure.resourcemanager.databoxedge.implementation.models.NodeList":"Microsoft.DataBoxEdge.NodeList","com.azure.resourcemanager.databoxedge.implementation.models.OperationListResult":"Azure.ResourceManager.CommonTypes.OperationListResult","com.azure.resourcemanager.databoxedge.implementation.models.OrderList":"Microsoft.DataBoxEdge.OrderList","com.azure.resourcemanager.databoxedge.implementation.models.RoleList":"Microsoft.DataBoxEdge.RoleList","com.azure.resourcemanager.databoxedge.implementation.models.ShareList":"Microsoft.DataBoxEdge.ShareList","com.azure.resourcemanager.databoxedge.implementation.models.StorageAccountCredentialList":"Microsoft.DataBoxEdge.StorageAccountCredentialList","com.azure.resourcemanager.databoxedge.implementation.models.StorageAccountList":"Microsoft.DataBoxEdge.StorageAccountList","com.azure.resourcemanager.databoxedge.implementation.models.TriggerList":"Microsoft.DataBoxEdge.TriggerList","com.azure.resourcemanager.databoxedge.implementation.models.UserList":"Microsoft.DataBoxEdge.UserList","com.azure.resourcemanager.databoxedge.models.ARMBaseModel":"Microsoft.DataBoxEdge.ARMBaseModel","com.azure.resourcemanager.databoxedge.models.AccessLevel":"Microsoft.DataBoxEdge.AccessLevel","com.azure.resourcemanager.databoxedge.models.AccountType":"Microsoft.DataBoxEdge.AccountType","com.azure.resourcemanager.databoxedge.models.ActionType":"Azure.ResourceManager.CommonTypes.ActionType","com.azure.resourcemanager.databoxedge.models.AddonProperties":"Microsoft.DataBoxEdge.Addon.properties.anonymous","com.azure.resourcemanager.databoxedge.models.AddonType":"Microsoft.DataBoxEdge.AddonType","com.azure.resourcemanager.databoxedge.models.Address":"Microsoft.DataBoxEdge.Address","com.azure.resourcemanager.databoxedge.models.AlertErrorDetails":"Microsoft.DataBoxEdge.AlertErrorDetails","com.azure.resourcemanager.databoxedge.models.AlertSeverity":"Microsoft.DataBoxEdge.AlertSeverity","com.azure.resourcemanager.databoxedge.models.AsymmetricEncryptedSecret":"Microsoft.DataBoxEdge.AsymmetricEncryptedSecret","com.azure.resourcemanager.databoxedge.models.AuthenticationType":"Microsoft.DataBoxEdge.AuthenticationType","com.azure.resourcemanager.databoxedge.models.AzureContainerDataFormat":"Microsoft.DataBoxEdge.AzureContainerDataFormat","com.azure.resourcemanager.databoxedge.models.AzureContainerInfo":"Microsoft.DataBoxEdge.AzureContainerInfo","com.azure.resourcemanager.databoxedge.models.ClientAccessRight":"Microsoft.DataBoxEdge.ClientAccessRight","com.azure.resourcemanager.databoxedge.models.ClientPermissionType":"Microsoft.DataBoxEdge.ClientPermissionType","com.azure.resourcemanager.databoxedge.models.ClusterCapacityViewData":"Microsoft.DataBoxEdge.ClusterCapacityViewData","com.azure.resourcemanager.databoxedge.models.ClusterGpuCapacity":"Microsoft.DataBoxEdge.ClusterGpuCapacity","com.azure.resourcemanager.databoxedge.models.ClusterMemoryCapacity":"Microsoft.DataBoxEdge.ClusterMemoryCapacity","com.azure.resourcemanager.databoxedge.models.ClusterStorageViewData":"Microsoft.DataBoxEdge.ClusterStorageViewData","com.azure.resourcemanager.databoxedge.models.ClusterWitnessType":"Microsoft.DataBoxEdge.ClusterWitnessType","com.azure.resourcemanager.databoxedge.models.ContactDetails":"Microsoft.DataBoxEdge.ContactDetails","com.azure.resourcemanager.databoxedge.models.ContainerStatus":"Microsoft.DataBoxEdge.ContainerStatus","com.azure.resourcemanager.databoxedge.models.DataBoxEdgeDeviceExtendedInfoPatch":"Microsoft.DataBoxEdge.DataBoxEdgeDeviceExtendedInfoPatch","com.azure.resourcemanager.databoxedge.models.DataBoxEdgeDeviceKind":"Microsoft.DataBoxEdge.DataBoxEdgeDeviceKind","com.azure.resourcemanager.databoxedge.models.DataBoxEdgeDevicePatch":"Microsoft.DataBoxEdge.DataBoxEdgeDevicePatch","com.azure.resourcemanager.databoxedge.models.DataBoxEdgeDeviceStatus":"Microsoft.DataBoxEdge.DataBoxEdgeDeviceStatus","com.azure.resourcemanager.databoxedge.models.DataBoxEdgeSku":"Microsoft.DataBoxEdge.DataBoxEdgeSku","com.azure.resourcemanager.databoxedge.models.DataPolicy":"Microsoft.DataBoxEdge.DataPolicy","com.azure.resourcemanager.databoxedge.models.DataResidency":"Microsoft.DataBoxEdge.DataResidency","com.azure.resourcemanager.databoxedge.models.DataResidencyType":"Microsoft.DataBoxEdge.DataResidencyType","com.azure.resourcemanager.databoxedge.models.DayOfWeek":"Microsoft.DataBoxEdge.DayOfWeek","com.azure.resourcemanager.databoxedge.models.DeviceCapacityRequestInfo":"Microsoft.DataBoxEdge.DeviceCapacityRequestInfo","com.azure.resourcemanager.databoxedge.models.DeviceType":"Microsoft.DataBoxEdge.DeviceType","com.azure.resourcemanager.databoxedge.models.DownloadPhase":"Microsoft.DataBoxEdge.DownloadPhase","com.azure.resourcemanager.databoxedge.models.EdgeProfile":"Microsoft.DataBoxEdge.EdgeProfile","com.azure.resourcemanager.databoxedge.models.EdgeProfilePatch":"Microsoft.DataBoxEdge.EdgeProfilePatch","com.azure.resourcemanager.databoxedge.models.EdgeProfileSubscription":"Microsoft.DataBoxEdge.EdgeProfileSubscription","com.azure.resourcemanager.databoxedge.models.EdgeProfileSubscriptionPatch":"Microsoft.DataBoxEdge.EdgeProfileSubscriptionPatch","com.azure.resourcemanager.databoxedge.models.EncryptionAlgorithm":"Microsoft.DataBoxEdge.EncryptionAlgorithm","com.azure.resourcemanager.databoxedge.models.HostCapacity":"Microsoft.DataBoxEdge.HostCapacity","com.azure.resourcemanager.databoxedge.models.InstallRebootBehavior":"Microsoft.DataBoxEdge.InstallRebootBehavior","com.azure.resourcemanager.databoxedge.models.InstallationImpact":"Microsoft.DataBoxEdge.InstallationImpact","com.azure.resourcemanager.databoxedge.models.Ipv4Config":"Microsoft.DataBoxEdge.Ipv4Config","com.azure.resourcemanager.databoxedge.models.Ipv6Config":"Microsoft.DataBoxEdge.Ipv6Config","com.azure.resourcemanager.databoxedge.models.JobErrorDetails":"Microsoft.DataBoxEdge.JobErrorDetails","com.azure.resourcemanager.databoxedge.models.JobErrorItem":"Microsoft.DataBoxEdge.JobErrorItem","com.azure.resourcemanager.databoxedge.models.JobStatus":"Microsoft.DataBoxEdge.JobStatus","com.azure.resourcemanager.databoxedge.models.JobType":"Microsoft.DataBoxEdge.JobType","com.azure.resourcemanager.databoxedge.models.KeyVaultSyncStatus":"Microsoft.DataBoxEdge.KeyVaultSyncStatus","com.azure.resourcemanager.databoxedge.models.MetricConfiguration":"Microsoft.DataBoxEdge.MetricConfiguration","com.azure.resourcemanager.databoxedge.models.MetricCounter":"Microsoft.DataBoxEdge.MetricCounter","com.azure.resourcemanager.databoxedge.models.MetricCounterSet":"Microsoft.DataBoxEdge.MetricCounterSet","com.azure.resourcemanager.databoxedge.models.MetricDimension":"Microsoft.DataBoxEdge.MetricDimension","com.azure.resourcemanager.databoxedge.models.MonitoringStatus":"Microsoft.DataBoxEdge.MonitoringStatus","com.azure.resourcemanager.databoxedge.models.MountPointMap":"Microsoft.DataBoxEdge.MountPointMap","com.azure.resourcemanager.databoxedge.models.MountType":"Microsoft.DataBoxEdge.MountType","com.azure.resourcemanager.databoxedge.models.MsiIdentityType":"Microsoft.DataBoxEdge.MsiIdentityType","com.azure.resourcemanager.databoxedge.models.NetworkAdapter":"Microsoft.DataBoxEdge.NetworkAdapter","com.azure.resourcemanager.databoxedge.models.NetworkAdapterDhcpStatus":"Microsoft.DataBoxEdge.NetworkAdapterDhcpStatus","com.azure.resourcemanager.databoxedge.models.NetworkAdapterPosition":"Microsoft.DataBoxEdge.NetworkAdapterPosition","com.azure.resourcemanager.databoxedge.models.NetworkAdapterRdmaStatus":"Microsoft.DataBoxEdge.NetworkAdapterRdmaStatus","com.azure.resourcemanager.databoxedge.models.NetworkAdapterStatus":"Microsoft.DataBoxEdge.NetworkAdapterStatus","com.azure.resourcemanager.databoxedge.models.NetworkGroup":"Microsoft.DataBoxEdge.NetworkGroup","com.azure.resourcemanager.databoxedge.models.NodeStatus":"Microsoft.DataBoxEdge.NodeStatus","com.azure.resourcemanager.databoxedge.models.NumaNodeData":"Microsoft.DataBoxEdge.NumaNodeData","com.azure.resourcemanager.databoxedge.models.OperationDisplay":"Azure.ResourceManager.CommonTypes.OperationDisplay","com.azure.resourcemanager.databoxedge.models.OrderState":"Microsoft.DataBoxEdge.OrderState","com.azure.resourcemanager.databoxedge.models.OrderStatus":"Microsoft.DataBoxEdge.OrderStatus","com.azure.resourcemanager.databoxedge.models.Origin":"Azure.ResourceManager.CommonTypes.Origin","com.azure.resourcemanager.databoxedge.models.ProactiveDiagnosticsConsent":"Microsoft.DataBoxEdge.ProactiveDiagnosticsConsent","com.azure.resourcemanager.databoxedge.models.RefreshDetails":"Microsoft.DataBoxEdge.RefreshDetails","com.azure.resourcemanager.databoxedge.models.RemoteApplicationType":"Microsoft.DataBoxEdge.RemoteApplicationType","com.azure.resourcemanager.databoxedge.models.RemoteSupportSettings":"Microsoft.DataBoxEdge.RemoteSupportSettings","com.azure.resourcemanager.databoxedge.models.ResourceIdentity":"Microsoft.DataBoxEdge.ResourceIdentity","com.azure.resourcemanager.databoxedge.models.ResourceMoveDetails":"Microsoft.DataBoxEdge.ResourceMoveDetails","com.azure.resourcemanager.databoxedge.models.ResourceMoveStatus":"Microsoft.DataBoxEdge.ResourceMoveStatus","com.azure.resourcemanager.databoxedge.models.RoleProperties":"Microsoft.DataBoxEdge.Role.properties.anonymous","com.azure.resourcemanager.databoxedge.models.RoleTypes":"Microsoft.DataBoxEdge.RoleTypes","com.azure.resourcemanager.databoxedge.models.SSLStatus":"Microsoft.DataBoxEdge.SSLStatus","com.azure.resourcemanager.databoxedge.models.Secret":"Microsoft.DataBoxEdge.Secret","com.azure.resourcemanager.databoxedge.models.SecuritySettings":"Microsoft.DataBoxEdge.SecuritySettings","com.azure.resourcemanager.databoxedge.models.ShareAccessProtocol":"Microsoft.DataBoxEdge.ShareAccessProtocol","com.azure.resourcemanager.databoxedge.models.ShareAccessRight":"Microsoft.DataBoxEdge.ShareAccessRight","com.azure.resourcemanager.databoxedge.models.ShareAccessType":"Microsoft.DataBoxEdge.ShareAccessType","com.azure.resourcemanager.databoxedge.models.ShareStatus":"Microsoft.DataBoxEdge.ShareStatus","com.azure.resourcemanager.databoxedge.models.ShipmentType":"Microsoft.DataBoxEdge.ShipmentType","com.azure.resourcemanager.databoxedge.models.Sku":"Microsoft.DataBoxEdge.Sku","com.azure.resourcemanager.databoxedge.models.SkuAvailability":"Microsoft.DataBoxEdge.SkuAvailability","com.azure.resourcemanager.databoxedge.models.SkuCapability":"Microsoft.DataBoxEdge.SkuCapability","com.azure.resourcemanager.databoxedge.models.SkuCost":"Microsoft.DataBoxEdge.SkuCost","com.azure.resourcemanager.databoxedge.models.SkuLocationInfo":"Microsoft.DataBoxEdge.SkuLocationInfo","com.azure.resourcemanager.databoxedge.models.SkuName":"Microsoft.DataBoxEdge.SkuName","com.azure.resourcemanager.databoxedge.models.SkuSignupOption":"Microsoft.DataBoxEdge.SkuSignupOption","com.azure.resourcemanager.databoxedge.models.SkuTier":"Microsoft.DataBoxEdge.SkuTier","com.azure.resourcemanager.databoxedge.models.SkuVersion":"Microsoft.DataBoxEdge.SkuVersion","com.azure.resourcemanager.databoxedge.models.StorageAccountStatus":"Microsoft.DataBoxEdge.StorageAccountStatus","com.azure.resourcemanager.databoxedge.models.SubscriptionRegisteredFeatures":"Microsoft.DataBoxEdge.SubscriptionRegisteredFeatures","com.azure.resourcemanager.databoxedge.models.SubscriptionState":"Microsoft.DataBoxEdge.SubscriptionState","com.azure.resourcemanager.databoxedge.models.TrackingInfo":"Microsoft.DataBoxEdge.TrackingInfo","com.azure.resourcemanager.databoxedge.models.TriggerEventType":"Microsoft.DataBoxEdge.TriggerEventType","com.azure.resourcemanager.databoxedge.models.TriggerProperties":"Microsoft.DataBoxEdge.Trigger.properties.anonymous","com.azure.resourcemanager.databoxedge.models.TriggerSupportPackageRequest":"Microsoft.DataBoxEdge.TriggerSupportPackageRequest","com.azure.resourcemanager.databoxedge.models.UpdateDetails":"Microsoft.DataBoxEdge.UpdateDetails","com.azure.resourcemanager.databoxedge.models.UpdateDownloadProgress":"Microsoft.DataBoxEdge.UpdateDownloadProgress","com.azure.resourcemanager.databoxedge.models.UpdateInstallProgress":"Microsoft.DataBoxEdge.UpdateInstallProgress","com.azure.resourcemanager.databoxedge.models.UpdateOperation":"Microsoft.DataBoxEdge.UpdateOperation","com.azure.resourcemanager.databoxedge.models.UpdateOperationStage":"Microsoft.DataBoxEdge.UpdateOperationStage","com.azure.resourcemanager.databoxedge.models.UpdateStatus":"Microsoft.DataBoxEdge.UpdateStatus","com.azure.resourcemanager.databoxedge.models.UpdateType":"Microsoft.DataBoxEdge.UpdateType","com.azure.resourcemanager.databoxedge.models.UploadCertificateRequest":"Microsoft.DataBoxEdge.UploadCertificateRequest","com.azure.resourcemanager.databoxedge.models.UserAccessRight":"Microsoft.DataBoxEdge.UserAccessRight","com.azure.resourcemanager.databoxedge.models.UserType":"Microsoft.DataBoxEdge.UserType","com.azure.resourcemanager.databoxedge.models.VmMemory":"Microsoft.DataBoxEdge.VmMemory","com.azure.resourcemanager.databoxedge.models.VmPlacementRequestResult":"Microsoft.DataBoxEdge.VmPlacementRequestResult"},"generatedFiles":["src/main/java/com/azure/resourcemanager/databoxedge/DataBoxEdgeManager.java","src/main/java/com/azure/resourcemanager/databoxedge/fluent/AddonsClient.java","src/main/java/com/azure/resourcemanager/databoxedge/fluent/AlertsClient.java","src/main/java/com/azure/resourcemanager/databoxedge/fluent/AvailableSkusClient.java","src/main/java/com/azure/resourcemanager/databoxedge/fluent/BandwidthSchedulesClient.java","src/main/java/com/azure/resourcemanager/databoxedge/fluent/ContainersClient.java","src/main/java/com/azure/resourcemanager/databoxedge/fluent/DataBoxEdgeManagementClient.java","src/main/java/com/azure/resourcemanager/databoxedge/fluent/DeviceCapacityChecksClient.java","src/main/java/com/azure/resourcemanager/databoxedge/fluent/DeviceCapacityInfoesClient.java","src/main/java/com/azure/resourcemanager/databoxedge/fluent/DevicesClient.java","src/main/java/com/azure/resourcemanager/databoxedge/fluent/DiagnosticSettingsClient.java","src/main/java/com/azure/resourcemanager/databoxedge/fluent/JobsClient.java","src/main/java/com/azure/resourcemanager/databoxedge/fluent/MonitoringConfigsClient.java","src/main/java/com/azure/resourcemanager/databoxedge/fluent/NodesClient.java","src/main/java/com/azure/resourcemanager/databoxedge/fluent/OperationsClient.java","src/main/java/com/azure/resourcemanager/databoxedge/fluent/OperationsStatusClient.java","src/main/java/com/azure/resourcemanager/databoxedge/fluent/OrdersClient.java","src/main/java/com/azure/resourcemanager/databoxedge/fluent/RolesClient.java","src/main/java/com/azure/resourcemanager/databoxedge/fluent/SharesClient.java","src/main/java/com/azure/resourcemanager/databoxedge/fluent/StorageAccountCredentialsClient.java","src/main/java/com/azure/resourcemanager/databoxedge/fluent/StorageAccountsClient.java","src/main/java/com/azure/resourcemanager/databoxedge/fluent/SupportPackagesClient.java","src/main/java/com/azure/resourcemanager/databoxedge/fluent/TriggersClient.java","src/main/java/com/azure/resourcemanager/databoxedge/fluent/UsersClient.java","src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/AddonInner.java","src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/AlertInner.java","src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/AlertProperties.java","src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/BandwidthScheduleInner.java","src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/BandwidthScheduleProperties.java","src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/ContainerInner.java","src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/ContainerProperties.java","src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/DCAccessCodeInner.java","src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/DCAccessCodeProperties.java","src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/DataBoxEdgeDeviceExtendedInfoInner.java","src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/DataBoxEdgeDeviceExtendedInfoProperties.java","src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/DataBoxEdgeDeviceInner.java","src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/DataBoxEdgeDeviceProperties.java","src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/DataBoxEdgeDevicePropertiesPatch.java","src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/DataBoxEdgeSkuListInner.java","src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/DeviceCapacityInfoInner.java","src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/DeviceCapacityInfoProperties.java","src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/DeviceCapacityRequestInfoProperties.java","src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/DiagnosticProactiveLogCollectionSettingsInner.java","src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/DiagnosticRemoteSupportSettingsInner.java","src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/DiagnosticRemoteSupportSettingsProperties.java","src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/GenerateCertResponseInner.java","src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/JobInner.java","src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/JobProperties.java","src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/MonitoringMetricConfigurationInner.java","src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/MonitoringMetricConfigurationProperties.java","src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/NetworkSettingsInner.java","src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/NetworkSettingsProperties.java","src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/NodeInner.java","src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/NodeProperties.java","src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/OperationInner.java","src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/OrderInner.java","src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/OrderProperties.java","src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/ProactiveLogCollectionSettingsProperties.java","src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/RawCertificateData.java","src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/RoleInner.java","src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/SecuritySettingsProperties.java","src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/ShareInner.java","src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/ShareProperties.java","src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/StorageAccountCredentialInner.java","src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/StorageAccountCredentialProperties.java","src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/StorageAccountInner.java","src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/StorageAccountProperties.java","src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/SubscriptionProperties.java","src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/SupportPackageRequestProperties.java","src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/TriggerInner.java","src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/UpdateSummaryInner.java","src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/UpdateSummaryProperties.java","src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/UploadCertificateResponseInner.java","src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/UserInner.java","src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/UserProperties.java","src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/package-info.java","src/main/java/com/azure/resourcemanager/databoxedge/fluent/package-info.java","src/main/java/com/azure/resourcemanager/databoxedge/implementation/AddonImpl.java","src/main/java/com/azure/resourcemanager/databoxedge/implementation/AddonsClientImpl.java","src/main/java/com/azure/resourcemanager/databoxedge/implementation/AddonsImpl.java","src/main/java/com/azure/resourcemanager/databoxedge/implementation/AlertImpl.java","src/main/java/com/azure/resourcemanager/databoxedge/implementation/AlertsClientImpl.java","src/main/java/com/azure/resourcemanager/databoxedge/implementation/AlertsImpl.java","src/main/java/com/azure/resourcemanager/databoxedge/implementation/AvailableSkusClientImpl.java","src/main/java/com/azure/resourcemanager/databoxedge/implementation/AvailableSkusImpl.java","src/main/java/com/azure/resourcemanager/databoxedge/implementation/BandwidthScheduleImpl.java","src/main/java/com/azure/resourcemanager/databoxedge/implementation/BandwidthSchedulesClientImpl.java","src/main/java/com/azure/resourcemanager/databoxedge/implementation/BandwidthSchedulesImpl.java","src/main/java/com/azure/resourcemanager/databoxedge/implementation/ContainerImpl.java","src/main/java/com/azure/resourcemanager/databoxedge/implementation/ContainersClientImpl.java","src/main/java/com/azure/resourcemanager/databoxedge/implementation/ContainersImpl.java","src/main/java/com/azure/resourcemanager/databoxedge/implementation/DCAccessCodeImpl.java","src/main/java/com/azure/resourcemanager/databoxedge/implementation/DataBoxEdgeDeviceExtendedInfoImpl.java","src/main/java/com/azure/resourcemanager/databoxedge/implementation/DataBoxEdgeDeviceImpl.java","src/main/java/com/azure/resourcemanager/databoxedge/implementation/DataBoxEdgeManagementClientBuilder.java","src/main/java/com/azure/resourcemanager/databoxedge/implementation/DataBoxEdgeManagementClientImpl.java","src/main/java/com/azure/resourcemanager/databoxedge/implementation/DataBoxEdgeSkuListImpl.java","src/main/java/com/azure/resourcemanager/databoxedge/implementation/DeviceCapacityChecksClientImpl.java","src/main/java/com/azure/resourcemanager/databoxedge/implementation/DeviceCapacityChecksImpl.java","src/main/java/com/azure/resourcemanager/databoxedge/implementation/DeviceCapacityInfoImpl.java","src/main/java/com/azure/resourcemanager/databoxedge/implementation/DeviceCapacityInfoesClientImpl.java","src/main/java/com/azure/resourcemanager/databoxedge/implementation/DeviceCapacityInfoesImpl.java","src/main/java/com/azure/resourcemanager/databoxedge/implementation/DevicesClientImpl.java","src/main/java/com/azure/resourcemanager/databoxedge/implementation/DevicesImpl.java","src/main/java/com/azure/resourcemanager/databoxedge/implementation/DiagnosticProactiveLogCollectionSettingsImpl.java","src/main/java/com/azure/resourcemanager/databoxedge/implementation/DiagnosticRemoteSupportSettingsImpl.java","src/main/java/com/azure/resourcemanager/databoxedge/implementation/DiagnosticSettingsClientImpl.java","src/main/java/com/azure/resourcemanager/databoxedge/implementation/DiagnosticSettingsImpl.java","src/main/java/com/azure/resourcemanager/databoxedge/implementation/GenerateCertResponseImpl.java","src/main/java/com/azure/resourcemanager/databoxedge/implementation/JobImpl.java","src/main/java/com/azure/resourcemanager/databoxedge/implementation/JobsClientImpl.java","src/main/java/com/azure/resourcemanager/databoxedge/implementation/JobsImpl.java","src/main/java/com/azure/resourcemanager/databoxedge/implementation/MonitoringConfigsClientImpl.java","src/main/java/com/azure/resourcemanager/databoxedge/implementation/MonitoringConfigsImpl.java","src/main/java/com/azure/resourcemanager/databoxedge/implementation/MonitoringMetricConfigurationImpl.java","src/main/java/com/azure/resourcemanager/databoxedge/implementation/NetworkSettingsImpl.java","src/main/java/com/azure/resourcemanager/databoxedge/implementation/NodeImpl.java","src/main/java/com/azure/resourcemanager/databoxedge/implementation/NodesClientImpl.java","src/main/java/com/azure/resourcemanager/databoxedge/implementation/NodesImpl.java","src/main/java/com/azure/resourcemanager/databoxedge/implementation/OperationImpl.java","src/main/java/com/azure/resourcemanager/databoxedge/implementation/OperationsClientImpl.java","src/main/java/com/azure/resourcemanager/databoxedge/implementation/OperationsImpl.java","src/main/java/com/azure/resourcemanager/databoxedge/implementation/OperationsStatusClientImpl.java","src/main/java/com/azure/resourcemanager/databoxedge/implementation/OperationsStatusImpl.java","src/main/java/com/azure/resourcemanager/databoxedge/implementation/OrderImpl.java","src/main/java/com/azure/resourcemanager/databoxedge/implementation/OrdersClientImpl.java","src/main/java/com/azure/resourcemanager/databoxedge/implementation/OrdersImpl.java","src/main/java/com/azure/resourcemanager/databoxedge/implementation/ResourceManagerUtils.java","src/main/java/com/azure/resourcemanager/databoxedge/implementation/RoleImpl.java","src/main/java/com/azure/resourcemanager/databoxedge/implementation/RolesClientImpl.java","src/main/java/com/azure/resourcemanager/databoxedge/implementation/RolesImpl.java","src/main/java/com/azure/resourcemanager/databoxedge/implementation/ShareImpl.java","src/main/java/com/azure/resourcemanager/databoxedge/implementation/SharesClientImpl.java","src/main/java/com/azure/resourcemanager/databoxedge/implementation/SharesImpl.java","src/main/java/com/azure/resourcemanager/databoxedge/implementation/StorageAccountCredentialImpl.java","src/main/java/com/azure/resourcemanager/databoxedge/implementation/StorageAccountCredentialsClientImpl.java","src/main/java/com/azure/resourcemanager/databoxedge/implementation/StorageAccountCredentialsImpl.java","src/main/java/com/azure/resourcemanager/databoxedge/implementation/StorageAccountImpl.java","src/main/java/com/azure/resourcemanager/databoxedge/implementation/StorageAccountsClientImpl.java","src/main/java/com/azure/resourcemanager/databoxedge/implementation/StorageAccountsImpl.java","src/main/java/com/azure/resourcemanager/databoxedge/implementation/SupportPackagesClientImpl.java","src/main/java/com/azure/resourcemanager/databoxedge/implementation/SupportPackagesImpl.java","src/main/java/com/azure/resourcemanager/databoxedge/implementation/TriggerImpl.java","src/main/java/com/azure/resourcemanager/databoxedge/implementation/TriggersClientImpl.java","src/main/java/com/azure/resourcemanager/databoxedge/implementation/TriggersImpl.java","src/main/java/com/azure/resourcemanager/databoxedge/implementation/UpdateSummaryImpl.java","src/main/java/com/azure/resourcemanager/databoxedge/implementation/UploadCertificateResponseImpl.java","src/main/java/com/azure/resourcemanager/databoxedge/implementation/UserImpl.java","src/main/java/com/azure/resourcemanager/databoxedge/implementation/UsersClientImpl.java","src/main/java/com/azure/resourcemanager/databoxedge/implementation/UsersImpl.java","src/main/java/com/azure/resourcemanager/databoxedge/implementation/models/AddonList.java","src/main/java/com/azure/resourcemanager/databoxedge/implementation/models/AlertList.java","src/main/java/com/azure/resourcemanager/databoxedge/implementation/models/BandwidthSchedulesList.java","src/main/java/com/azure/resourcemanager/databoxedge/implementation/models/ContainerList.java","src/main/java/com/azure/resourcemanager/databoxedge/implementation/models/DataBoxEdgeDeviceList.java","src/main/java/com/azure/resourcemanager/databoxedge/implementation/models/MonitoringMetricConfigurationList.java","src/main/java/com/azure/resourcemanager/databoxedge/implementation/models/NodeList.java","src/main/java/com/azure/resourcemanager/databoxedge/implementation/models/OperationListResult.java","src/main/java/com/azure/resourcemanager/databoxedge/implementation/models/OrderList.java","src/main/java/com/azure/resourcemanager/databoxedge/implementation/models/RoleList.java","src/main/java/com/azure/resourcemanager/databoxedge/implementation/models/ShareList.java","src/main/java/com/azure/resourcemanager/databoxedge/implementation/models/StorageAccountCredentialList.java","src/main/java/com/azure/resourcemanager/databoxedge/implementation/models/StorageAccountList.java","src/main/java/com/azure/resourcemanager/databoxedge/implementation/models/TriggerList.java","src/main/java/com/azure/resourcemanager/databoxedge/implementation/models/UserList.java","src/main/java/com/azure/resourcemanager/databoxedge/implementation/package-info.java","src/main/java/com/azure/resourcemanager/databoxedge/models/ARMBaseModel.java","src/main/java/com/azure/resourcemanager/databoxedge/models/AccessLevel.java","src/main/java/com/azure/resourcemanager/databoxedge/models/AccountType.java","src/main/java/com/azure/resourcemanager/databoxedge/models/ActionType.java","src/main/java/com/azure/resourcemanager/databoxedge/models/Addon.java","src/main/java/com/azure/resourcemanager/databoxedge/models/AddonProperties.java","src/main/java/com/azure/resourcemanager/databoxedge/models/AddonType.java","src/main/java/com/azure/resourcemanager/databoxedge/models/Addons.java","src/main/java/com/azure/resourcemanager/databoxedge/models/Address.java","src/main/java/com/azure/resourcemanager/databoxedge/models/Alert.java","src/main/java/com/azure/resourcemanager/databoxedge/models/AlertErrorDetails.java","src/main/java/com/azure/resourcemanager/databoxedge/models/AlertSeverity.java","src/main/java/com/azure/resourcemanager/databoxedge/models/Alerts.java","src/main/java/com/azure/resourcemanager/databoxedge/models/AsymmetricEncryptedSecret.java","src/main/java/com/azure/resourcemanager/databoxedge/models/AuthenticationType.java","src/main/java/com/azure/resourcemanager/databoxedge/models/AvailableSkus.java","src/main/java/com/azure/resourcemanager/databoxedge/models/AzureContainerDataFormat.java","src/main/java/com/azure/resourcemanager/databoxedge/models/AzureContainerInfo.java","src/main/java/com/azure/resourcemanager/databoxedge/models/BandwidthSchedule.java","src/main/java/com/azure/resourcemanager/databoxedge/models/BandwidthSchedules.java","src/main/java/com/azure/resourcemanager/databoxedge/models/ClientAccessRight.java","src/main/java/com/azure/resourcemanager/databoxedge/models/ClientPermissionType.java","src/main/java/com/azure/resourcemanager/databoxedge/models/ClusterCapacityViewData.java","src/main/java/com/azure/resourcemanager/databoxedge/models/ClusterGpuCapacity.java","src/main/java/com/azure/resourcemanager/databoxedge/models/ClusterMemoryCapacity.java","src/main/java/com/azure/resourcemanager/databoxedge/models/ClusterStorageViewData.java","src/main/java/com/azure/resourcemanager/databoxedge/models/ClusterWitnessType.java","src/main/java/com/azure/resourcemanager/databoxedge/models/ContactDetails.java","src/main/java/com/azure/resourcemanager/databoxedge/models/Container.java","src/main/java/com/azure/resourcemanager/databoxedge/models/ContainerStatus.java","src/main/java/com/azure/resourcemanager/databoxedge/models/Containers.java","src/main/java/com/azure/resourcemanager/databoxedge/models/DCAccessCode.java","src/main/java/com/azure/resourcemanager/databoxedge/models/DataBoxEdgeDevice.java","src/main/java/com/azure/resourcemanager/databoxedge/models/DataBoxEdgeDeviceExtendedInfo.java","src/main/java/com/azure/resourcemanager/databoxedge/models/DataBoxEdgeDeviceExtendedInfoPatch.java","src/main/java/com/azure/resourcemanager/databoxedge/models/DataBoxEdgeDeviceKind.java","src/main/java/com/azure/resourcemanager/databoxedge/models/DataBoxEdgeDevicePatch.java","src/main/java/com/azure/resourcemanager/databoxedge/models/DataBoxEdgeDeviceStatus.java","src/main/java/com/azure/resourcemanager/databoxedge/models/DataBoxEdgeSku.java","src/main/java/com/azure/resourcemanager/databoxedge/models/DataBoxEdgeSkuList.java","src/main/java/com/azure/resourcemanager/databoxedge/models/DataPolicy.java","src/main/java/com/azure/resourcemanager/databoxedge/models/DataResidency.java","src/main/java/com/azure/resourcemanager/databoxedge/models/DataResidencyType.java","src/main/java/com/azure/resourcemanager/databoxedge/models/DayOfWeek.java","src/main/java/com/azure/resourcemanager/databoxedge/models/DeviceCapacityChecks.java","src/main/java/com/azure/resourcemanager/databoxedge/models/DeviceCapacityInfo.java","src/main/java/com/azure/resourcemanager/databoxedge/models/DeviceCapacityInfoes.java","src/main/java/com/azure/resourcemanager/databoxedge/models/DeviceCapacityRequestInfo.java","src/main/java/com/azure/resourcemanager/databoxedge/models/DeviceType.java","src/main/java/com/azure/resourcemanager/databoxedge/models/Devices.java","src/main/java/com/azure/resourcemanager/databoxedge/models/DiagnosticProactiveLogCollectionSettings.java","src/main/java/com/azure/resourcemanager/databoxedge/models/DiagnosticRemoteSupportSettings.java","src/main/java/com/azure/resourcemanager/databoxedge/models/DiagnosticSettings.java","src/main/java/com/azure/resourcemanager/databoxedge/models/DownloadPhase.java","src/main/java/com/azure/resourcemanager/databoxedge/models/EdgeProfile.java","src/main/java/com/azure/resourcemanager/databoxedge/models/EdgeProfilePatch.java","src/main/java/com/azure/resourcemanager/databoxedge/models/EdgeProfileSubscription.java","src/main/java/com/azure/resourcemanager/databoxedge/models/EdgeProfileSubscriptionPatch.java","src/main/java/com/azure/resourcemanager/databoxedge/models/EncryptionAlgorithm.java","src/main/java/com/azure/resourcemanager/databoxedge/models/GenerateCertResponse.java","src/main/java/com/azure/resourcemanager/databoxedge/models/HostCapacity.java","src/main/java/com/azure/resourcemanager/databoxedge/models/InstallRebootBehavior.java","src/main/java/com/azure/resourcemanager/databoxedge/models/InstallationImpact.java","src/main/java/com/azure/resourcemanager/databoxedge/models/Ipv4Config.java","src/main/java/com/azure/resourcemanager/databoxedge/models/Ipv6Config.java","src/main/java/com/azure/resourcemanager/databoxedge/models/Job.java","src/main/java/com/azure/resourcemanager/databoxedge/models/JobErrorDetails.java","src/main/java/com/azure/resourcemanager/databoxedge/models/JobErrorItem.java","src/main/java/com/azure/resourcemanager/databoxedge/models/JobStatus.java","src/main/java/com/azure/resourcemanager/databoxedge/models/JobType.java","src/main/java/com/azure/resourcemanager/databoxedge/models/Jobs.java","src/main/java/com/azure/resourcemanager/databoxedge/models/KeyVaultSyncStatus.java","src/main/java/com/azure/resourcemanager/databoxedge/models/MetricConfiguration.java","src/main/java/com/azure/resourcemanager/databoxedge/models/MetricCounter.java","src/main/java/com/azure/resourcemanager/databoxedge/models/MetricCounterSet.java","src/main/java/com/azure/resourcemanager/databoxedge/models/MetricDimension.java","src/main/java/com/azure/resourcemanager/databoxedge/models/MonitoringConfigs.java","src/main/java/com/azure/resourcemanager/databoxedge/models/MonitoringMetricConfiguration.java","src/main/java/com/azure/resourcemanager/databoxedge/models/MonitoringStatus.java","src/main/java/com/azure/resourcemanager/databoxedge/models/MountPointMap.java","src/main/java/com/azure/resourcemanager/databoxedge/models/MountType.java","src/main/java/com/azure/resourcemanager/databoxedge/models/MsiIdentityType.java","src/main/java/com/azure/resourcemanager/databoxedge/models/NetworkAdapter.java","src/main/java/com/azure/resourcemanager/databoxedge/models/NetworkAdapterDhcpStatus.java","src/main/java/com/azure/resourcemanager/databoxedge/models/NetworkAdapterPosition.java","src/main/java/com/azure/resourcemanager/databoxedge/models/NetworkAdapterRdmaStatus.java","src/main/java/com/azure/resourcemanager/databoxedge/models/NetworkAdapterStatus.java","src/main/java/com/azure/resourcemanager/databoxedge/models/NetworkGroup.java","src/main/java/com/azure/resourcemanager/databoxedge/models/NetworkSettings.java","src/main/java/com/azure/resourcemanager/databoxedge/models/Node.java","src/main/java/com/azure/resourcemanager/databoxedge/models/NodeStatus.java","src/main/java/com/azure/resourcemanager/databoxedge/models/Nodes.java","src/main/java/com/azure/resourcemanager/databoxedge/models/NumaNodeData.java","src/main/java/com/azure/resourcemanager/databoxedge/models/Operation.java","src/main/java/com/azure/resourcemanager/databoxedge/models/OperationDisplay.java","src/main/java/com/azure/resourcemanager/databoxedge/models/Operations.java","src/main/java/com/azure/resourcemanager/databoxedge/models/OperationsStatus.java","src/main/java/com/azure/resourcemanager/databoxedge/models/Order.java","src/main/java/com/azure/resourcemanager/databoxedge/models/OrderState.java","src/main/java/com/azure/resourcemanager/databoxedge/models/OrderStatus.java","src/main/java/com/azure/resourcemanager/databoxedge/models/Orders.java","src/main/java/com/azure/resourcemanager/databoxedge/models/Origin.java","src/main/java/com/azure/resourcemanager/databoxedge/models/ProactiveDiagnosticsConsent.java","src/main/java/com/azure/resourcemanager/databoxedge/models/RefreshDetails.java","src/main/java/com/azure/resourcemanager/databoxedge/models/RemoteApplicationType.java","src/main/java/com/azure/resourcemanager/databoxedge/models/RemoteSupportSettings.java","src/main/java/com/azure/resourcemanager/databoxedge/models/ResourceIdentity.java","src/main/java/com/azure/resourcemanager/databoxedge/models/ResourceMoveDetails.java","src/main/java/com/azure/resourcemanager/databoxedge/models/ResourceMoveStatus.java","src/main/java/com/azure/resourcemanager/databoxedge/models/Role.java","src/main/java/com/azure/resourcemanager/databoxedge/models/RoleProperties.java","src/main/java/com/azure/resourcemanager/databoxedge/models/RoleTypes.java","src/main/java/com/azure/resourcemanager/databoxedge/models/Roles.java","src/main/java/com/azure/resourcemanager/databoxedge/models/SSLStatus.java","src/main/java/com/azure/resourcemanager/databoxedge/models/Secret.java","src/main/java/com/azure/resourcemanager/databoxedge/models/SecuritySettings.java","src/main/java/com/azure/resourcemanager/databoxedge/models/Share.java","src/main/java/com/azure/resourcemanager/databoxedge/models/ShareAccessProtocol.java","src/main/java/com/azure/resourcemanager/databoxedge/models/ShareAccessRight.java","src/main/java/com/azure/resourcemanager/databoxedge/models/ShareAccessType.java","src/main/java/com/azure/resourcemanager/databoxedge/models/ShareStatus.java","src/main/java/com/azure/resourcemanager/databoxedge/models/Shares.java","src/main/java/com/azure/resourcemanager/databoxedge/models/ShipmentType.java","src/main/java/com/azure/resourcemanager/databoxedge/models/Sku.java","src/main/java/com/azure/resourcemanager/databoxedge/models/SkuAvailability.java","src/main/java/com/azure/resourcemanager/databoxedge/models/SkuCapability.java","src/main/java/com/azure/resourcemanager/databoxedge/models/SkuCost.java","src/main/java/com/azure/resourcemanager/databoxedge/models/SkuLocationInfo.java","src/main/java/com/azure/resourcemanager/databoxedge/models/SkuName.java","src/main/java/com/azure/resourcemanager/databoxedge/models/SkuSignupOption.java","src/main/java/com/azure/resourcemanager/databoxedge/models/SkuTier.java","src/main/java/com/azure/resourcemanager/databoxedge/models/SkuVersion.java","src/main/java/com/azure/resourcemanager/databoxedge/models/StorageAccount.java","src/main/java/com/azure/resourcemanager/databoxedge/models/StorageAccountCredential.java","src/main/java/com/azure/resourcemanager/databoxedge/models/StorageAccountCredentials.java","src/main/java/com/azure/resourcemanager/databoxedge/models/StorageAccountStatus.java","src/main/java/com/azure/resourcemanager/databoxedge/models/StorageAccounts.java","src/main/java/com/azure/resourcemanager/databoxedge/models/SubscriptionRegisteredFeatures.java","src/main/java/com/azure/resourcemanager/databoxedge/models/SubscriptionState.java","src/main/java/com/azure/resourcemanager/databoxedge/models/SupportPackages.java","src/main/java/com/azure/resourcemanager/databoxedge/models/TrackingInfo.java","src/main/java/com/azure/resourcemanager/databoxedge/models/Trigger.java","src/main/java/com/azure/resourcemanager/databoxedge/models/TriggerEventType.java","src/main/java/com/azure/resourcemanager/databoxedge/models/TriggerProperties.java","src/main/java/com/azure/resourcemanager/databoxedge/models/TriggerSupportPackageRequest.java","src/main/java/com/azure/resourcemanager/databoxedge/models/Triggers.java","src/main/java/com/azure/resourcemanager/databoxedge/models/UpdateDetails.java","src/main/java/com/azure/resourcemanager/databoxedge/models/UpdateDownloadProgress.java","src/main/java/com/azure/resourcemanager/databoxedge/models/UpdateInstallProgress.java","src/main/java/com/azure/resourcemanager/databoxedge/models/UpdateOperation.java","src/main/java/com/azure/resourcemanager/databoxedge/models/UpdateOperationStage.java","src/main/java/com/azure/resourcemanager/databoxedge/models/UpdateStatus.java","src/main/java/com/azure/resourcemanager/databoxedge/models/UpdateSummary.java","src/main/java/com/azure/resourcemanager/databoxedge/models/UpdateType.java","src/main/java/com/azure/resourcemanager/databoxedge/models/UploadCertificateRequest.java","src/main/java/com/azure/resourcemanager/databoxedge/models/UploadCertificateResponse.java","src/main/java/com/azure/resourcemanager/databoxedge/models/User.java","src/main/java/com/azure/resourcemanager/databoxedge/models/UserAccessRight.java","src/main/java/com/azure/resourcemanager/databoxedge/models/UserType.java","src/main/java/com/azure/resourcemanager/databoxedge/models/Users.java","src/main/java/com/azure/resourcemanager/databoxedge/models/VmMemory.java","src/main/java/com/azure/resourcemanager/databoxedge/models/VmPlacementRequestResult.java","src/main/java/com/azure/resourcemanager/databoxedge/models/package-info.java","src/main/java/com/azure/resourcemanager/databoxedge/package-info.java","src/main/java/module-info.java"]} \ No newline at end of file diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-databoxedge/proxy-config.json b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-databoxedge/proxy-config.json index 93577bada815..4f2c4c6ff5f0 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-databoxedge/proxy-config.json +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-databoxedge/proxy-config.json @@ -1 +1 @@ -[["com.azure.resourcemanager.databoxedge.implementation.AlertsClientImpl$AlertsService"],["com.azure.resourcemanager.databoxedge.implementation.BandwidthSchedulesClientImpl$BandwidthSchedulesService"],["com.azure.resourcemanager.databoxedge.implementation.ContainersClientImpl$ContainersService"],["com.azure.resourcemanager.databoxedge.implementation.DevicesClientImpl$DevicesService"],["com.azure.resourcemanager.databoxedge.implementation.JobsClientImpl$JobsService"],["com.azure.resourcemanager.databoxedge.implementation.NodesClientImpl$NodesService"],["com.azure.resourcemanager.databoxedge.implementation.OperationsClientImpl$OperationsService"],["com.azure.resourcemanager.databoxedge.implementation.OperationsStatusClientImpl$OperationsStatusService"],["com.azure.resourcemanager.databoxedge.implementation.OrdersClientImpl$OrdersService"],["com.azure.resourcemanager.databoxedge.implementation.RolesClientImpl$RolesService"],["com.azure.resourcemanager.databoxedge.implementation.SharesClientImpl$SharesService"],["com.azure.resourcemanager.databoxedge.implementation.SkusClientImpl$SkusService"],["com.azure.resourcemanager.databoxedge.implementation.StorageAccountCredentialsClientImpl$StorageAccountCredentialsService"],["com.azure.resourcemanager.databoxedge.implementation.StorageAccountsClientImpl$StorageAccountsService"],["com.azure.resourcemanager.databoxedge.implementation.TriggersClientImpl$TriggersService"],["com.azure.resourcemanager.databoxedge.implementation.UsersClientImpl$UsersService"]] \ No newline at end of file +[["com.azure.resourcemanager.databoxedge.implementation.AddonsClientImpl$AddonsService"],["com.azure.resourcemanager.databoxedge.implementation.AlertsClientImpl$AlertsService"],["com.azure.resourcemanager.databoxedge.implementation.AvailableSkusClientImpl$AvailableSkusService"],["com.azure.resourcemanager.databoxedge.implementation.BandwidthSchedulesClientImpl$BandwidthSchedulesService"],["com.azure.resourcemanager.databoxedge.implementation.ContainersClientImpl$ContainersService"],["com.azure.resourcemanager.databoxedge.implementation.DeviceCapacityChecksClientImpl$DeviceCapacityChecksService"],["com.azure.resourcemanager.databoxedge.implementation.DeviceCapacityInfoesClientImpl$DeviceCapacityInfoesService"],["com.azure.resourcemanager.databoxedge.implementation.DevicesClientImpl$DevicesService"],["com.azure.resourcemanager.databoxedge.implementation.DiagnosticSettingsClientImpl$DiagnosticSettingsService"],["com.azure.resourcemanager.databoxedge.implementation.JobsClientImpl$JobsService"],["com.azure.resourcemanager.databoxedge.implementation.MonitoringConfigsClientImpl$MonitoringConfigsService"],["com.azure.resourcemanager.databoxedge.implementation.NodesClientImpl$NodesService"],["com.azure.resourcemanager.databoxedge.implementation.OperationsClientImpl$OperationsService"],["com.azure.resourcemanager.databoxedge.implementation.OperationsStatusClientImpl$OperationsStatusService"],["com.azure.resourcemanager.databoxedge.implementation.OrdersClientImpl$OrdersService"],["com.azure.resourcemanager.databoxedge.implementation.RolesClientImpl$RolesService"],["com.azure.resourcemanager.databoxedge.implementation.SharesClientImpl$SharesService"],["com.azure.resourcemanager.databoxedge.implementation.StorageAccountCredentialsClientImpl$StorageAccountCredentialsService"],["com.azure.resourcemanager.databoxedge.implementation.StorageAccountsClientImpl$StorageAccountsService"],["com.azure.resourcemanager.databoxedge.implementation.SupportPackagesClientImpl$SupportPackagesService"],["com.azure.resourcemanager.databoxedge.implementation.TriggersClientImpl$TriggersService"],["com.azure.resourcemanager.databoxedge.implementation.UsersClientImpl$UsersService"]] \ No newline at end of file diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/resources/azure-resourcemanager-databoxedge.properties b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/resources/azure-resourcemanager-databoxedge.properties new file mode 100644 index 000000000000..defbd48204e4 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/resources/azure-resourcemanager-databoxedge.properties @@ -0,0 +1 @@ +version=${project.version} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/AddonsCreateOrUpdateSamples.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/AddonsCreateOrUpdateSamples.java new file mode 100644 index 000000000000..0c206da018aa --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/AddonsCreateOrUpdateSamples.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.databoxedge.generated; + +import com.azure.resourcemanager.databoxedge.models.AddonProperties; +import com.azure.resourcemanager.databoxedge.models.AddonType; + +/** + * Samples for Addons CreateOrUpdate. + */ +public final class AddonsCreateOrUpdateSamples { + /* + * x-ms-original-file: 2023-12-01/PutAddons.json + */ + /** + * Sample code: PutAddOns. + * + * @param manager Entry point to DataBoxEdgeManager. + */ + public static void putAddOns(com.azure.resourcemanager.databoxedge.DataBoxEdgeManager manager) { + manager.addons() + .define("arcName") + .withExistingDataBoxEdgeDevice("GroupForEdgeAutomation", "testedgedevice") + .withKind(AddonType.ARC_FOR_KUBERNETES) + .withProperties(new AddonProperties()) + .create(); + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/AddonsDeleteSamples.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/AddonsDeleteSamples.java new file mode 100644 index 000000000000..44208e573da9 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/AddonsDeleteSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.databoxedge.generated; + +/** + * Samples for Addons Delete. + */ +public final class AddonsDeleteSamples { + /* + * x-ms-original-file: 2023-12-01/DeleteAddons.json + */ + /** + * Sample code: DeleteAddOns. + * + * @param manager Entry point to DataBoxEdgeManager. + */ + public static void deleteAddOns(com.azure.resourcemanager.databoxedge.DataBoxEdgeManager manager) { + manager.addons() + .delete("GroupForEdgeAutomation", "testedgedevice", "arcName", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/AddonsGetSamples.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/AddonsGetSamples.java new file mode 100644 index 000000000000..090da27071d6 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/AddonsGetSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.databoxedge.generated; + +/** + * Samples for Addons Get. + */ +public final class AddonsGetSamples { + /* + * x-ms-original-file: 2023-12-01/GetAddons.json + */ + /** + * Sample code: GetAddOns. + * + * @param manager Entry point to DataBoxEdgeManager. + */ + public static void getAddOns(com.azure.resourcemanager.databoxedge.DataBoxEdgeManager manager) { + manager.addons() + .getWithResponse("GroupForEdgeAutomation", "testedgedevice", "arcName", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/AddonsListByRoleSamples.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/AddonsListByRoleSamples.java new file mode 100644 index 000000000000..e203521b611c --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/AddonsListByRoleSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.databoxedge.generated; + +/** + * Samples for Addons ListByRole. + */ +public final class AddonsListByRoleSamples { + /* + * x-ms-original-file: 2023-12-01/RoleListAddOns.json + */ + /** + * Sample code: RoleListAddOns. + * + * @param manager Entry point to DataBoxEdgeManager. + */ + public static void roleListAddOns(com.azure.resourcemanager.databoxedge.DataBoxEdgeManager manager) { + manager.addons().listByRole("GroupForEdgeAutomation", "testedgedevice", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/AlertsGetSamples.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/AlertsGetSamples.java index f15433a3491f..241c98e9dce1 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/AlertsGetSamples.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/AlertsGetSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.generated; @@ -9,8 +9,7 @@ */ public final class AlertsGetSamples { /* - * x-ms-original-file: - * specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2019-08-01/examples/AlertGet.json + * x-ms-original-file: 2023-12-01/AlertGet.json */ /** * Sample code: AlertGet. @@ -19,7 +18,7 @@ public final class AlertsGetSamples { */ public static void alertGet(com.azure.resourcemanager.databoxedge.DataBoxEdgeManager manager) { manager.alerts() - .getWithResponse("testedgedevice", "159a00c7-8543-4343-9435-263ac87df3bb", "GroupForEdgeAutomation", + .getWithResponse("GroupForEdgeAutomation", "testedgedevice", "159a00c7-8543-4343-9435-263ac87df3bb", com.azure.core.util.Context.NONE); } } diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/AlertsListByDataBoxEdgeDeviceSamples.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/AlertsListByDataBoxEdgeDeviceSamples.java index a3b2a3542a1f..63265e13f8ab 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/AlertsListByDataBoxEdgeDeviceSamples.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/AlertsListByDataBoxEdgeDeviceSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.generated; @@ -9,9 +9,7 @@ */ public final class AlertsListByDataBoxEdgeDeviceSamples { /* - * x-ms-original-file: - * specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2019-08-01/examples/AlertGetAllInDevice. - * json + * x-ms-original-file: 2023-12-01/AlertGetAllInDevice.json */ /** * Sample code: AlertGetAllInDevice. @@ -20,6 +18,6 @@ public final class AlertsListByDataBoxEdgeDeviceSamples { */ public static void alertGetAllInDevice(com.azure.resourcemanager.databoxedge.DataBoxEdgeManager manager) { manager.alerts() - .listByDataBoxEdgeDevice("testedgedevice", "GroupForEdgeAutomation", com.azure.core.util.Context.NONE); + .listByDataBoxEdgeDevice("GroupForEdgeAutomation", "testedgedevice", com.azure.core.util.Context.NONE); } } diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/AvailableSkusListSamples.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/AvailableSkusListSamples.java new file mode 100644 index 000000000000..3fd5c66c4a44 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/AvailableSkusListSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.databoxedge.generated; + +/** + * Samples for AvailableSkus List. + */ +public final class AvailableSkusListSamples { + /* + * x-ms-original-file: 2023-12-01/AvailableSkusList.json + */ + /** + * Sample code: AvailableSkus. + * + * @param manager Entry point to DataBoxEdgeManager. + */ + public static void availableSkus(com.azure.resourcemanager.databoxedge.DataBoxEdgeManager manager) { + manager.availableSkus().listWithResponse(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/BandwidthSchedulesCreateOrUpdateSamples.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/BandwidthSchedulesCreateOrUpdateSamples.java index c71256ddf186..1f46057d01dd 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/BandwidthSchedulesCreateOrUpdateSamples.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/BandwidthSchedulesCreateOrUpdateSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.generated; @@ -12,9 +12,7 @@ */ public final class BandwidthSchedulesCreateOrUpdateSamples { /* - * x-ms-original-file: - * specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2019-08-01/examples/BandwidthSchedulePut. - * json + * x-ms-original-file: 2023-12-01/BandwidthSchedulePut.json */ /** * Sample code: BandwidthSchedulePut. @@ -24,7 +22,7 @@ public final class BandwidthSchedulesCreateOrUpdateSamples { public static void bandwidthSchedulePut(com.azure.resourcemanager.databoxedge.DataBoxEdgeManager manager) { manager.bandwidthSchedules() .define("bandwidth-1") - .withExistingDataBoxEdgeDevice("testedgedevice", "GroupForEdgeAutomation") + .withExistingDataBoxEdgeDevice("GroupForEdgeAutomation", "testedgedevice") .withStart("0:0:0") .withStop("13:59:0") .withRateInMbps(100) diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/BandwidthSchedulesDeleteSamples.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/BandwidthSchedulesDeleteSamples.java index 88f49dfa5af1..6867bf6536f2 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/BandwidthSchedulesDeleteSamples.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/BandwidthSchedulesDeleteSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.generated; @@ -9,8 +9,7 @@ */ public final class BandwidthSchedulesDeleteSamples { /* - * x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2019-08-01/examples/ - * BandwidthScheduleDelete.json + * x-ms-original-file: 2023-12-01/BandwidthScheduleDelete.json */ /** * Sample code: BandwidthScheduleDelete. @@ -19,6 +18,6 @@ public final class BandwidthSchedulesDeleteSamples { */ public static void bandwidthScheduleDelete(com.azure.resourcemanager.databoxedge.DataBoxEdgeManager manager) { manager.bandwidthSchedules() - .delete("testedgedevice", "bandwidth-1", "GroupForEdgeAutomation", com.azure.core.util.Context.NONE); + .delete("GroupForEdgeAutomation", "testedgedevice", "bandwidth-1", com.azure.core.util.Context.NONE); } } diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/BandwidthSchedulesGetSamples.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/BandwidthSchedulesGetSamples.java index cd02908e88d1..7647712e04a5 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/BandwidthSchedulesGetSamples.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/BandwidthSchedulesGetSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.generated; @@ -9,9 +9,7 @@ */ public final class BandwidthSchedulesGetSamples { /* - * x-ms-original-file: - * specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2019-08-01/examples/BandwidthScheduleGet. - * json + * x-ms-original-file: 2023-12-01/BandwidthScheduleGet.json */ /** * Sample code: BandwidthScheduleGet. @@ -20,7 +18,7 @@ public final class BandwidthSchedulesGetSamples { */ public static void bandwidthScheduleGet(com.azure.resourcemanager.databoxedge.DataBoxEdgeManager manager) { manager.bandwidthSchedules() - .getWithResponse("testedgedevice", "bandwidth-1", "GroupForEdgeAutomation", + .getWithResponse("GroupForEdgeAutomation", "testedgedevice", "bandwidth-1", com.azure.core.util.Context.NONE); } } diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/BandwidthSchedulesListByDataBoxEdgeDeviceSamples.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/BandwidthSchedulesListByDataBoxEdgeDeviceSamples.java index 263c368a8336..600a82f9d6f4 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/BandwidthSchedulesListByDataBoxEdgeDeviceSamples.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/BandwidthSchedulesListByDataBoxEdgeDeviceSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.generated; @@ -9,8 +9,7 @@ */ public final class BandwidthSchedulesListByDataBoxEdgeDeviceSamples { /* - * x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2019-08-01/examples/ - * BandwidthScheduleGetAllInDevice.json + * x-ms-original-file: 2023-12-01/BandwidthScheduleGetAllInDevice.json */ /** * Sample code: BandwidthScheduleGetAllInDevice. @@ -20,6 +19,6 @@ public final class BandwidthSchedulesListByDataBoxEdgeDeviceSamples { public static void bandwidthScheduleGetAllInDevice(com.azure.resourcemanager.databoxedge.DataBoxEdgeManager manager) { manager.bandwidthSchedules() - .listByDataBoxEdgeDevice("testedgedevice", "GroupForEdgeAutomation", com.azure.core.util.Context.NONE); + .listByDataBoxEdgeDevice("GroupForEdgeAutomation", "testedgedevice", com.azure.core.util.Context.NONE); } } diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/ContainersCreateOrUpdateSamples.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/ContainersCreateOrUpdateSamples.java index b85af493ddc1..d232e691b63f 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/ContainersCreateOrUpdateSamples.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/ContainersCreateOrUpdateSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.generated; @@ -11,8 +11,7 @@ */ public final class ContainersCreateOrUpdateSamples { /* - * x-ms-original-file: - * specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2019-08-01/examples/ContainerPut.json + * x-ms-original-file: 2023-12-01/ContainerPut.json */ /** * Sample code: ContainerPut. @@ -22,7 +21,7 @@ public final class ContainersCreateOrUpdateSamples { public static void containerPut(com.azure.resourcemanager.databoxedge.DataBoxEdgeManager manager) { manager.containers() .define("blobcontainer1") - .withExistingStorageAccount("testedgedevice", "storageaccount1", "GroupForEdgeAutomation") + .withExistingStorageAccount("GroupForEdgeAutomation", "testedgedevice", "storageaccount1") .withDataFormat(AzureContainerDataFormat.BLOCK_BLOB) .create(); } diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/ContainersDeleteSamples.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/ContainersDeleteSamples.java index 29ad4ddc2627..4b4d675fffd8 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/ContainersDeleteSamples.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/ContainersDeleteSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.generated; @@ -9,8 +9,7 @@ */ public final class ContainersDeleteSamples { /* - * x-ms-original-file: - * specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2019-08-01/examples/ContainerDelete.json + * x-ms-original-file: 2023-12-01/ContainerDelete.json */ /** * Sample code: ContainerDelete. @@ -19,7 +18,7 @@ public final class ContainersDeleteSamples { */ public static void containerDelete(com.azure.resourcemanager.databoxedge.DataBoxEdgeManager manager) { manager.containers() - .delete("testedgedevice", "storageaccount1", "blobcontainer1", "GroupForEdgeAutomation", + .delete("GroupForEdgeAutomation", "testedgedevice", "storageaccount1", "blobcontainer1", com.azure.core.util.Context.NONE); } } diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/ContainersGetSamples.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/ContainersGetSamples.java index 9619dc19dd5a..3395808d6eab 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/ContainersGetSamples.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/ContainersGetSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.generated; @@ -9,8 +9,7 @@ */ public final class ContainersGetSamples { /* - * x-ms-original-file: - * specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2019-08-01/examples/ContainerGet.json + * x-ms-original-file: 2023-12-01/ContainerGet.json */ /** * Sample code: ContainerGet. @@ -19,7 +18,7 @@ public final class ContainersGetSamples { */ public static void containerGet(com.azure.resourcemanager.databoxedge.DataBoxEdgeManager manager) { manager.containers() - .getWithResponse("testedgedevice", "storageaccount1", "blobcontainer1", "GroupForEdgeAutomation", + .getWithResponse("GroupForEdgeAutomation", "testedgedevice", "storageaccount1", "blobcontainer1", com.azure.core.util.Context.NONE); } } diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/ContainersListByStorageAccountSamples.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/ContainersListByStorageAccountSamples.java index 4ce7ad58c466..159bd3d661e8 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/ContainersListByStorageAccountSamples.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/ContainersListByStorageAccountSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.generated; @@ -9,8 +9,7 @@ */ public final class ContainersListByStorageAccountSamples { /* - * x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2019-08-01/examples/ - * ContainerListAllInDevice.json + * x-ms-original-file: 2023-12-01/ContainerListAllInDevice.json */ /** * Sample code: ContainerListAllInDevice. @@ -19,7 +18,7 @@ public final class ContainersListByStorageAccountSamples { */ public static void containerListAllInDevice(com.azure.resourcemanager.databoxedge.DataBoxEdgeManager manager) { manager.containers() - .listByStorageAccount("testedgedevice", "storageaccount1", "GroupForEdgeAutomation", + .listByStorageAccount("GroupForEdgeAutomation", "testedgedevice", "storageaccount1", com.azure.core.util.Context.NONE); } } diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/ContainersRefreshSamples.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/ContainersRefreshSamples.java index b72231dbb320..a02abab30657 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/ContainersRefreshSamples.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/ContainersRefreshSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.generated; @@ -9,8 +9,7 @@ */ public final class ContainersRefreshSamples { /* - * x-ms-original-file: - * specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2019-08-01/examples/ContainerRefresh.json + * x-ms-original-file: 2023-12-01/ContainerRefresh.json */ /** * Sample code: ContainerRefresh. @@ -19,7 +18,7 @@ public final class ContainersRefreshSamples { */ public static void containerRefresh(com.azure.resourcemanager.databoxedge.DataBoxEdgeManager manager) { manager.containers() - .refresh("testedgedevice", "storageaccount1", "blobcontainer1", "GroupForEdgeAutomation", + .refresh("GroupForEdgeAutomation", "testedgedevice", "storageaccount1", "blobcontainer1", com.azure.core.util.Context.NONE); } } diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/DeviceCapacityCheckCheckResourceCreationFeasibilitySamples.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/DeviceCapacityCheckCheckResourceCreationFeasibilitySamples.java new file mode 100644 index 000000000000..4a6098898124 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/DeviceCapacityCheckCheckResourceCreationFeasibilitySamples.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.databoxedge.generated; + +import com.azure.resourcemanager.databoxedge.models.DeviceCapacityRequestInfo; +import java.util.Arrays; + +/** + * Samples for DeviceCapacityCheck CheckResourceCreationFeasibility. + */ +public final class DeviceCapacityCheckCheckResourceCreationFeasibilitySamples { + /* + * x-ms-original-file: 2023-12-01/DeviceCapacityRequestPost.json + */ + /** + * Sample code: DeviceCapacityRequestPost. + * + * @param manager Entry point to DataBoxEdgeManager. + */ + public static void deviceCapacityRequestPost(com.azure.resourcemanager.databoxedge.DataBoxEdgeManager manager) { + manager.deviceCapacityChecks() + .checkResourceCreationFeasibility("GroupForEdgeAutomation", "testedgedevice", + new DeviceCapacityRequestInfo().withVmPlacementQuery(Arrays.asList(Arrays.asList("Standard_D2_v2"))), + null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/DeviceCapacityInfoGetDeviceCapacityInfoSamples.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/DeviceCapacityInfoGetDeviceCapacityInfoSamples.java new file mode 100644 index 000000000000..233f6e394bf0 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/DeviceCapacityInfoGetDeviceCapacityInfoSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.databoxedge.generated; + +/** + * Samples for DeviceCapacityInfo GetDeviceCapacityInfo. + */ +public final class DeviceCapacityInfoGetDeviceCapacityInfoSamples { + /* + * x-ms-original-file: 2023-12-01/DeviceCapacityGet.json + */ + /** + * Sample code: DeviceCapacityGet. + * + * @param manager Entry point to DataBoxEdgeManager. + */ + public static void deviceCapacityGet(com.azure.resourcemanager.databoxedge.DataBoxEdgeManager manager) { + manager.deviceCapacityInfoes() + .getDeviceCapacityInfoWithResponse("GroupForEdgeAutomation", "testedgedevice", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/DevicesCreateOrUpdateSamples.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/DevicesCreateOrUpdateSamples.java index 883c94f72067..1ac1493c36b5 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/DevicesCreateOrUpdateSamples.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/DevicesCreateOrUpdateSamples.java @@ -1,9 +1,11 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.generated; +import com.azure.resourcemanager.databoxedge.models.DataResidency; +import com.azure.resourcemanager.databoxedge.models.DataResidencyType; import com.azure.resourcemanager.databoxedge.models.Sku; import com.azure.resourcemanager.databoxedge.models.SkuName; import com.azure.resourcemanager.databoxedge.models.SkuTier; @@ -15,9 +17,27 @@ */ public final class DevicesCreateOrUpdateSamples { /* - * x-ms-original-file: - * specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2019-08-01/examples/DataBoxEdgeDevicePut. - * json + * x-ms-original-file: 2023-12-01/DataBoxEdgeDevicePutWithDataResidency.json + */ + /** + * Sample code: DataBoxEdgeDevicePutWithDataResidency. + * + * @param manager Entry point to DataBoxEdgeManager. + */ + public static void + dataBoxEdgeDevicePutWithDataResidency(com.azure.resourcemanager.databoxedge.DataBoxEdgeManager manager) { + manager.devices() + .define("testedgedevice") + .withRegion("WUS") + .withExistingResourceGroup("GroupForEdgeAutomation") + .withTags(mapOf()) + .withSku(new Sku().withName(SkuName.EDGE).withTier(SkuTier.STANDARD)) + .withDataResidency(new DataResidency().withType(DataResidencyType.ZONE_REPLICATION)) + .create(); + } + + /* + * x-ms-original-file: 2023-12-01/DataBoxEdgeDevicePut.json */ /** * Sample code: DataBoxEdgeDevicePut. @@ -27,7 +47,7 @@ public final class DevicesCreateOrUpdateSamples { public static void dataBoxEdgeDevicePut(com.azure.resourcemanager.databoxedge.DataBoxEdgeManager manager) { manager.devices() .define("testedgedevice") - .withRegion("eastus") + .withRegion("WUS") .withExistingResourceGroup("GroupForEdgeAutomation") .withTags(mapOf()) .withSku(new Sku().withName(SkuName.EDGE).withTier(SkuTier.STANDARD)) diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/DevicesCreateOrUpdateSecuritySettingsSamples.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/DevicesCreateOrUpdateSecuritySettingsSamples.java index dbfbbdc85d91..3deae9cef90e 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/DevicesCreateOrUpdateSecuritySettingsSamples.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/DevicesCreateOrUpdateSecuritySettingsSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.generated; @@ -13,8 +13,7 @@ */ public final class DevicesCreateOrUpdateSecuritySettingsSamples { /* - * x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2019-08-01/examples/ - * SecuritySettingsUpdatePost.json + * x-ms-original-file: 2023-12-01/SecuritySettingsUpdatePost.json */ /** * Sample code: CreateOrUpdateSecuritySettings. @@ -24,10 +23,11 @@ public final class DevicesCreateOrUpdateSecuritySettingsSamples { public static void createOrUpdateSecuritySettings(com.azure.resourcemanager.databoxedge.DataBoxEdgeManager manager) { manager.devices() - .createOrUpdateSecuritySettings("testedgedevice", "AzureVM", - new SecuritySettings().withDeviceAdminPassword(new AsymmetricEncryptedSecret().withValue("") - .withEncryptionCertThumbprint("7DCBDFC44ED968D232C9A998FC105B5C70E84BE0") - .withEncryptionAlgorithm(EncryptionAlgorithm.AES256)), + .createOrUpdateSecuritySettings("AzureVM", "testedgedevice", + new SecuritySettings() + .withDeviceAdminPassword(new AsymmetricEncryptedSecret().withValue("") + .withEncryptionCertThumbprint("") + .withEncryptionAlgorithm(EncryptionAlgorithm.AES256)), com.azure.core.util.Context.NONE); } } diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/DevicesDeleteSamples.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/DevicesDeleteSamples.java index 512af5e99012..6a7a4f271803 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/DevicesDeleteSamples.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/DevicesDeleteSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.generated; @@ -9,8 +9,7 @@ */ public final class DevicesDeleteSamples { /* - * x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2019-08-01/examples/ - * DataBoxEdgeDeviceDelete.json + * x-ms-original-file: 2023-12-01/DataBoxEdgeDeviceDelete.json */ /** * Sample code: DataBoxEdgeDeviceDelete. diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/DevicesDownloadUpdatesSamples.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/DevicesDownloadUpdatesSamples.java index 9c512ac9d97d..3aa31081d949 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/DevicesDownloadUpdatesSamples.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/DevicesDownloadUpdatesSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.generated; @@ -9,9 +9,7 @@ */ public final class DevicesDownloadUpdatesSamples { /* - * x-ms-original-file: - * specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2019-08-01/examples/DownloadUpdatesPost. - * json + * x-ms-original-file: 2023-12-01/DownloadUpdatesPost.json */ /** * Sample code: DownloadUpdatesPost. @@ -19,6 +17,6 @@ public final class DevicesDownloadUpdatesSamples { * @param manager Entry point to DataBoxEdgeManager. */ public static void downloadUpdatesPost(com.azure.resourcemanager.databoxedge.DataBoxEdgeManager manager) { - manager.devices().downloadUpdates("testedgedevice", "GroupForEdgeAutomation", com.azure.core.util.Context.NONE); + manager.devices().downloadUpdates("GroupForEdgeAutomation", "testedgedevice", com.azure.core.util.Context.NONE); } } diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/DevicesGenerateCertificateSamples.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/DevicesGenerateCertificateSamples.java new file mode 100644 index 000000000000..52998774f775 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/DevicesGenerateCertificateSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.databoxedge.generated; + +/** + * Samples for Devices GenerateCertificate. + */ +public final class DevicesGenerateCertificateSamples { + /* + * x-ms-original-file: 2023-12-01/GenerateCertificate.json + */ + /** + * Sample code: GenerateCertificate. + * + * @param manager Entry point to DataBoxEdgeManager. + */ + public static void generateCertificate(com.azure.resourcemanager.databoxedge.DataBoxEdgeManager manager) { + manager.devices() + .generateCertificateWithResponse("GroupForEdgeAutomation", "testedgedevice", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/DevicesGetByResourceGroupSamples.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/DevicesGetByResourceGroupSamples.java index 8751ae33b8fd..7e825aaa4cbd 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/DevicesGetByResourceGroupSamples.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/DevicesGetByResourceGroupSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.generated; @@ -9,8 +9,7 @@ */ public final class DevicesGetByResourceGroupSamples { /* - * x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2019-08-01/examples/ - * DataBoxEdgeDeviceGetByName.json + * x-ms-original-file: 2023-12-01/DataBoxEdgeDeviceGetByName.json */ /** * Sample code: DataBoxEdgeDeviceGetByName. @@ -22,4 +21,19 @@ public static void dataBoxEdgeDeviceGetByName(com.azure.resourcemanager.databoxe .getByResourceGroupWithResponse("GroupForEdgeAutomation", "testedgedevice", com.azure.core.util.Context.NONE); } + + /* + * x-ms-original-file: 2023-12-01/DataBoxEdgeDeviceGetByNameWithDataResidency.json + */ + /** + * Sample code: DataBoxEdgeDeviceGetByNameWithDataResidency. + * + * @param manager Entry point to DataBoxEdgeManager. + */ + public static void + dataBoxEdgeDeviceGetByNameWithDataResidency(com.azure.resourcemanager.databoxedge.DataBoxEdgeManager manager) { + manager.devices() + .getByResourceGroupWithResponse("GroupForEdgeAutomation", "testedgedevice", + com.azure.core.util.Context.NONE); + } } diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/DevicesGetExtendedInformationSamples.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/DevicesGetExtendedInformationSamples.java index 23a6688acd09..df85cdd80dd5 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/DevicesGetExtendedInformationSamples.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/DevicesGetExtendedInformationSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.generated; @@ -9,8 +9,7 @@ */ public final class DevicesGetExtendedInformationSamples { /* - * x-ms-original-file: - * specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2019-08-01/examples/ExtendedInfoPost.json + * x-ms-original-file: 2023-12-01/ExtendedInfoPost.json */ /** * Sample code: ExtendedInfoPost. @@ -19,7 +18,7 @@ public final class DevicesGetExtendedInformationSamples { */ public static void extendedInfoPost(com.azure.resourcemanager.databoxedge.DataBoxEdgeManager manager) { manager.devices() - .getExtendedInformationWithResponse("testedgedevice", "GroupForEdgeAutomation", + .getExtendedInformationWithResponse("GroupForEdgeAutomation", "testedgedevice", com.azure.core.util.Context.NONE); } } diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/DevicesGetNetworkSettingsSamples.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/DevicesGetNetworkSettingsSamples.java index 492ff0e83473..c2ab961ee503 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/DevicesGetNetworkSettingsSamples.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/DevicesGetNetworkSettingsSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.generated; @@ -9,9 +9,7 @@ */ public final class DevicesGetNetworkSettingsSamples { /* - * x-ms-original-file: - * specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2019-08-01/examples/NetworkSettingsGet. - * json + * x-ms-original-file: 2023-12-01/NetworkSettingsGet.json */ /** * Sample code: NetworkSettingsGet. @@ -20,7 +18,7 @@ public final class DevicesGetNetworkSettingsSamples { */ public static void networkSettingsGet(com.azure.resourcemanager.databoxedge.DataBoxEdgeManager manager) { manager.devices() - .getNetworkSettingsWithResponse("testedgedevice", "GroupForEdgeAutomation", + .getNetworkSettingsWithResponse("GroupForEdgeAutomation", "testedgedevice", com.azure.core.util.Context.NONE); } } diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/DevicesGetUpdateSummarySamples.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/DevicesGetUpdateSummarySamples.java index 2b0d9a9ee267..e82f7e7816cb 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/DevicesGetUpdateSummarySamples.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/DevicesGetUpdateSummarySamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.generated; @@ -9,8 +9,7 @@ */ public final class DevicesGetUpdateSummarySamples { /* - * x-ms-original-file: - * specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2019-08-01/examples/UpdateSummaryGet.json + * x-ms-original-file: 2023-12-01/UpdateSummaryGet.json */ /** * Sample code: UpdateSummaryGet. @@ -19,6 +18,6 @@ public final class DevicesGetUpdateSummarySamples { */ public static void updateSummaryGet(com.azure.resourcemanager.databoxedge.DataBoxEdgeManager manager) { manager.devices() - .getUpdateSummaryWithResponse("testedgedevice", "GroupForEdgeAutomation", com.azure.core.util.Context.NONE); + .getUpdateSummaryWithResponse("GroupForEdgeAutomation", "testedgedevice", com.azure.core.util.Context.NONE); } } diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/DevicesInstallUpdatesSamples.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/DevicesInstallUpdatesSamples.java index 6c2f97a871b3..d29e47056839 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/DevicesInstallUpdatesSamples.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/DevicesInstallUpdatesSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.generated; @@ -9,9 +9,7 @@ */ public final class DevicesInstallUpdatesSamples { /* - * x-ms-original-file: - * specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2019-08-01/examples/InstallUpdatesPost. - * json + * x-ms-original-file: 2023-12-01/InstallUpdatesPost.json */ /** * Sample code: InstallUpdatesPost. @@ -19,6 +17,6 @@ public final class DevicesInstallUpdatesSamples { * @param manager Entry point to DataBoxEdgeManager. */ public static void installUpdatesPost(com.azure.resourcemanager.databoxedge.DataBoxEdgeManager manager) { - manager.devices().installUpdates("testedgedevice", "GroupForEdgeAutomation", com.azure.core.util.Context.NONE); + manager.devices().installUpdates("GroupForEdgeAutomation", "testedgedevice", com.azure.core.util.Context.NONE); } } diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/DevicesListByResourceGroupSamples.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/DevicesListByResourceGroupSamples.java index 4d8bc3c36fac..4c26b9c53d8e 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/DevicesListByResourceGroupSamples.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/DevicesListByResourceGroupSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.generated; @@ -9,8 +9,7 @@ */ public final class DevicesListByResourceGroupSamples { /* - * x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2019-08-01/examples/ - * DataBoxEdgeDeviceGetByResourceGroup.json + * x-ms-original-file: 2023-12-01/DataBoxEdgeDeviceGetByResourceGroup.json */ /** * Sample code: DataBoxEdgeDeviceGetByResourceGroup. diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/DevicesListSamples.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/DevicesListSamples.java index cd7b56a412dc..b022ddd31de8 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/DevicesListSamples.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/DevicesListSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.generated; @@ -9,8 +9,7 @@ */ public final class DevicesListSamples { /* - * x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2019-08-01/examples/ - * DataBoxEdgeDeviceGetBySubscription.json + * x-ms-original-file: 2023-12-01/DataBoxEdgeDeviceGetBySubscription.json */ /** * Sample code: DataBoxEdgeDeviceGetBySubscription. diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/DevicesScanForUpdatesSamples.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/DevicesScanForUpdatesSamples.java index d911fa610799..58bf330d0996 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/DevicesScanForUpdatesSamples.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/DevicesScanForUpdatesSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.generated; @@ -9,9 +9,7 @@ */ public final class DevicesScanForUpdatesSamples { /* - * x-ms-original-file: - * specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2019-08-01/examples/ScanForUpdatesPost. - * json + * x-ms-original-file: 2023-12-01/ScanForUpdatesPost.json */ /** * Sample code: ScanForUpdatesPost. @@ -19,6 +17,6 @@ public final class DevicesScanForUpdatesSamples { * @param manager Entry point to DataBoxEdgeManager. */ public static void scanForUpdatesPost(com.azure.resourcemanager.databoxedge.DataBoxEdgeManager manager) { - manager.devices().scanForUpdates("testedgedevice", "GroupForEdgeAutomation", com.azure.core.util.Context.NONE); + manager.devices().scanForUpdates("GroupForEdgeAutomation", "testedgedevice", com.azure.core.util.Context.NONE); } } diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/DevicesUpdateExtendedInformationSamples.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/DevicesUpdateExtendedInformationSamples.java new file mode 100644 index 000000000000..48f248bd19d5 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/DevicesUpdateExtendedInformationSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.databoxedge.generated; + +import com.azure.resourcemanager.databoxedge.models.DataBoxEdgeDeviceExtendedInfoPatch; + +/** + * Samples for Devices UpdateExtendedInformation. + */ +public final class DevicesUpdateExtendedInformationSamples { + /* + * x-ms-original-file: 2023-12-01/GetUpdateExtendedInfo.json + */ + /** + * Sample code: GetUpdateExtendedInfo. + * + * @param manager Entry point to DataBoxEdgeManager. + */ + public static void getUpdateExtendedInfo(com.azure.resourcemanager.databoxedge.DataBoxEdgeManager manager) { + manager.devices() + .updateExtendedInformationWithResponse("GroupForEdgeAutomation", "testedgedevice", + new DataBoxEdgeDeviceExtendedInfoPatch(), com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/DevicesUpdateSamples.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/DevicesUpdateSamples.java index b4b56f239303..df41e0e24c07 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/DevicesUpdateSamples.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/DevicesUpdateSamples.java @@ -1,20 +1,19 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.generated; import com.azure.resourcemanager.databoxedge.models.DataBoxEdgeDevice; -import java.util.HashMap; -import java.util.Map; +import com.azure.resourcemanager.databoxedge.models.EdgeProfilePatch; +import com.azure.resourcemanager.databoxedge.models.EdgeProfileSubscriptionPatch; /** * Samples for Devices Update. */ public final class DevicesUpdateSamples { /* - * x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2019-08-01/examples/ - * DataBoxEdgeDevicePatch.json + * x-ms-original-file: 2023-12-01/DataBoxEdgeDevicePatch.json */ /** * Sample code: DataBoxEdgeDevicePatch. @@ -26,18 +25,9 @@ public static void dataBoxEdgeDevicePatch(com.azure.resourcemanager.databoxedge. .getByResourceGroupWithResponse("GroupForEdgeAutomation", "testedgedevice", com.azure.core.util.Context.NONE) .getValue(); - resource.update().withTags(mapOf("Key1", "fakeTokenPlaceholder", "Key2", "fakeTokenPlaceholder")).apply(); - } - - // Use "Map.of" if available - @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; + resource.update() + .withEdgeProfile(new EdgeProfilePatch().withSubscription(new EdgeProfileSubscriptionPatch().withId( + "/subscriptions/0d44739e-0563-474f-97e7-24a0cdb23b29/resourceGroups/rapvs-rg/providers/Microsoft.AzureStack/linkedSubscriptions/ca014ddc-5cf2-45f8-b390-e901e4a0ae87"))) + .apply(); } } diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/DevicesUploadCertificateSamples.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/DevicesUploadCertificateSamples.java index f9e195a373d7..d9f02d0d2d37 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/DevicesUploadCertificateSamples.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/DevicesUploadCertificateSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.generated; @@ -11,9 +11,7 @@ */ public final class DevicesUploadCertificateSamples { /* - * x-ms-original-file: - * specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2019-08-01/examples/UploadCertificatePost - * .json + * x-ms-original-file: 2023-12-01/UploadCertificatePost.json */ /** * Sample code: UploadCertificatePost. @@ -22,7 +20,7 @@ public final class DevicesUploadCertificateSamples { */ public static void uploadCertificatePost(com.azure.resourcemanager.databoxedge.DataBoxEdgeManager manager) { manager.devices() - .uploadCertificateWithResponse("testedgedevice", "GroupForEdgeAutomation", + .uploadCertificateWithResponse("GroupForEdgeAutomation", "testedgedevice", new UploadCertificateRequest().withCertificate( "MIIC9DCCAdygAwIBAgIQWJae7GNjiI9Mcv/gJyrOPTANBgkqhkiG9w0BAQUFADASMRAwDgYDVQQDDAdXaW5kb3dzMB4XDTE4MTEyNzAwMTA0NVoXDTIxMTEyODAwMTA0NVowEjEQMA4GA1UEAwwHV2luZG93czCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAKxkRExqxf0qH1avnyORptIbRC2yQwqe3EIbJ2FPKr5jtAppGeX/dGKrFSnX+7/0HFr77aJHafdpEAtOiLyJ4zCAVs0obZCCIq4qJdmjYUTU0UXH/w/YzXfQA0d9Zh9AN+NJBX9xj05NzgsT24fkgsK2v6mWJQXT7YcWAsl5sEYPnx1e+MrupNyVSL/RUJmrS+etJSysHtFeWRhsUhVAs1DD5ExJvBLU3WH0IsojEvpXcjrutB5/MDQNrd/StGI6WovoSSPH7FyT9tgERx+q+Yg3YUGzfaIPCctlrRGehcdtzdNoKd0rsX62yCq0U6POoSfwe22NJu41oAUMd7e6R8cCAwEAAaNGMEQwEwYDVR0lBAwwCgYIKwYBBQUHAwIwHQYDVR0OBBYEFDd0VxnS3LnMIfwc7xW4b4IZWG5GMA4GA1UdDwEB/wQEAwIFIDANBgkqhkiG9w0BAQUFAAOCAQEAPQRby2u9celvtvL/DLEb5Vt3/tPStRQC5MyTD62L5RT/q8E6EMCXVZNkXF5WlWucLJi/18tY+9PNgP9xWLJh7kpSWlWdi9KPtwMqKDlEH8L2TnQdjimt9XuiCrTnoFy/1X2BGLY/rCaUJNSd15QCkz2xeW+Z+YSk2GwAc/A/4YfNpqSIMfNuPrT76o02VdD9WmJUA3fS/HY0sU9qgQRS/3F5/0EPS+HYQ0SvXCK9tggcCd4O050ytNBMJC9qMOJ7yE0iOrFfOJSCfDAuPhn/rHFh79Kn1moF+/CE+nc0/2RPiLC8r54/rt5dYyyxJDfXg0a3VrrX39W69WZGW5OXiw=="), com.azure.core.util.Context.NONE); diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/DiagnosticSettingsGetDiagnosticProactiveLogCollectionSettingsSamples.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/DiagnosticSettingsGetDiagnosticProactiveLogCollectionSettingsSamples.java new file mode 100644 index 000000000000..e0aae974eeda --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/DiagnosticSettingsGetDiagnosticProactiveLogCollectionSettingsSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.databoxedge.generated; + +/** + * Samples for DiagnosticSettings GetDiagnosticProactiveLogCollectionSettings. + */ +public final class DiagnosticSettingsGetDiagnosticProactiveLogCollectionSettingsSamples { + /* + * x-ms-original-file: 2023-12-01/GetDiagnosticProactiveLogCollectionSettings.json + */ + /** + * Sample code: GetDiagnosticProactiveLogCollectionSettings. + * + * @param manager Entry point to DataBoxEdgeManager. + */ + public static void + getDiagnosticProactiveLogCollectionSettings(com.azure.resourcemanager.databoxedge.DataBoxEdgeManager manager) { + manager.diagnosticSettings() + .getDiagnosticProactiveLogCollectionSettingsWithResponse("GroupForEdgeAutomation", "testedgedevice", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/DiagnosticSettingsGetDiagnosticRemoteSupportSettingsSamples.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/DiagnosticSettingsGetDiagnosticRemoteSupportSettingsSamples.java new file mode 100644 index 000000000000..e3ca76c73dd1 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/DiagnosticSettingsGetDiagnosticRemoteSupportSettingsSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.databoxedge.generated; + +/** + * Samples for DiagnosticSettings GetDiagnosticRemoteSupportSettings. + */ +public final class DiagnosticSettingsGetDiagnosticRemoteSupportSettingsSamples { + /* + * x-ms-original-file: 2023-12-01/GetDiagnosticRemoteSupportSettings.json + */ + /** + * Sample code: GetDiagnosticRemoteSupportSettings. + * + * @param manager Entry point to DataBoxEdgeManager. + */ + public static void + getDiagnosticRemoteSupportSettings(com.azure.resourcemanager.databoxedge.DataBoxEdgeManager manager) { + manager.diagnosticSettings() + .getDiagnosticRemoteSupportSettingsWithResponse("GroupForEdgeAutomation", "testedgedevice", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/DiagnosticSettingsUpdateDiagnosticProactiveLogCollectionSettingsSamples.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/DiagnosticSettingsUpdateDiagnosticProactiveLogCollectionSettingsSamples.java new file mode 100644 index 000000000000..4ac26da5671b --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/DiagnosticSettingsUpdateDiagnosticProactiveLogCollectionSettingsSamples.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.databoxedge.generated; + +import com.azure.resourcemanager.databoxedge.fluent.models.DiagnosticProactiveLogCollectionSettingsInner; +import com.azure.resourcemanager.databoxedge.models.ProactiveDiagnosticsConsent; + +/** + * Samples for DiagnosticSettings UpdateDiagnosticProactiveLogCollectionSettings. + */ +public final class DiagnosticSettingsUpdateDiagnosticProactiveLogCollectionSettingsSamples { + /* + * x-ms-original-file: 2023-12-01/UpdateDiagnosticProactiveLogCollectionSettings.json + */ + /** + * Sample code: UpdateDiagnosticProactiveLogCollectionSettings. + * + * @param manager Entry point to DataBoxEdgeManager. + */ + public static void updateDiagnosticProactiveLogCollectionSettings( + com.azure.resourcemanager.databoxedge.DataBoxEdgeManager manager) { + manager.diagnosticSettings() + .updateDiagnosticProactiveLogCollectionSettings("GroupForEdgeAutomation", "testedgedevice", + new DiagnosticProactiveLogCollectionSettingsInner() + .withUserConsent(ProactiveDiagnosticsConsent.ENABLED), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/DiagnosticSettingsUpdateDiagnosticRemoteSupportSettingsSamples.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/DiagnosticSettingsUpdateDiagnosticRemoteSupportSettingsSamples.java new file mode 100644 index 000000000000..3e1451680788 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/DiagnosticSettingsUpdateDiagnosticRemoteSupportSettingsSamples.java @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.databoxedge.generated; + +import com.azure.resourcemanager.databoxedge.fluent.models.DiagnosticRemoteSupportSettingsInner; +import com.azure.resourcemanager.databoxedge.models.AccessLevel; +import com.azure.resourcemanager.databoxedge.models.RemoteApplicationType; +import com.azure.resourcemanager.databoxedge.models.RemoteSupportSettings; +import java.time.OffsetDateTime; +import java.util.Arrays; + +/** + * Samples for DiagnosticSettings UpdateDiagnosticRemoteSupportSettings. + */ +public final class DiagnosticSettingsUpdateDiagnosticRemoteSupportSettingsSamples { + /* + * x-ms-original-file: 2023-12-01/UpdateDiagnosticRemoteSupportSettings.json + */ + /** + * Sample code: UpdateDiagnosticRemoteSupportSettings. + * + * @param manager Entry point to DataBoxEdgeManager. + */ + public static void + updateDiagnosticRemoteSupportSettings(com.azure.resourcemanager.databoxedge.DataBoxEdgeManager manager) { + manager.diagnosticSettings() + .updateDiagnosticRemoteSupportSettings("GroupForEdgeAutomation", "testedgedevice", + new DiagnosticRemoteSupportSettingsInner().withRemoteSupportSettingsList(Arrays + .asList(new RemoteSupportSettings().withRemoteApplicationType(RemoteApplicationType.POWERSHELL) + .withAccessLevel(AccessLevel.READ_WRITE) + .withExpirationTimeStampInUTC(OffsetDateTime.parse("2021-07-07T00:00:00+00:00")))), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/JobsGetSamples.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/JobsGetSamples.java index 2028dae4d8c6..810b53f08c74 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/JobsGetSamples.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/JobsGetSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.generated; @@ -9,8 +9,7 @@ */ public final class JobsGetSamples { /* - * x-ms-original-file: - * specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2019-08-01/examples/JobsGet.json + * x-ms-original-file: 2023-12-01/JobsGet.json */ /** * Sample code: JobsGet. @@ -19,7 +18,7 @@ public final class JobsGetSamples { */ public static void jobsGet(com.azure.resourcemanager.databoxedge.DataBoxEdgeManager manager) { manager.jobs() - .getWithResponse("testedgedevice", "159a00c7-8543-4343-9435-263ac87df3bb", "GroupForEdgeAutomation", + .getWithResponse("GroupForEdgeAutomation", "testedgedevice", "159a00c7-8543-4343-9435-263ac87df3bb", com.azure.core.util.Context.NONE); } } diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/MonitoringConfigCreateOrUpdateSamples.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/MonitoringConfigCreateOrUpdateSamples.java new file mode 100644 index 000000000000..2055db8b0fca --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/MonitoringConfigCreateOrUpdateSamples.java @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.databoxedge.generated; + +import com.azure.resourcemanager.databoxedge.fluent.models.MonitoringMetricConfigurationInner; +import com.azure.resourcemanager.databoxedge.models.MetricConfiguration; +import com.azure.resourcemanager.databoxedge.models.MetricCounter; +import com.azure.resourcemanager.databoxedge.models.MetricCounterSet; +import java.util.Arrays; + +/** + * Samples for MonitoringConfig CreateOrUpdate. + */ +public final class MonitoringConfigCreateOrUpdateSamples { + /* + * x-ms-original-file: 2023-12-01/PutMonitoringConfig.json + */ + /** + * Sample code: PutMonitoringConfig. + * + * @param manager Entry point to DataBoxEdgeManager. + */ + public static void putMonitoringConfig(com.azure.resourcemanager.databoxedge.DataBoxEdgeManager manager) { + manager.monitoringConfigs() + .createOrUpdate("GroupForEdgeAutomation", "testedgedevice", new MonitoringMetricConfigurationInner() + .withMetricConfigurations(Arrays.asList(new MetricConfiguration().withResourceId("test") + .withMdmAccount("test") + .withMetricNameSpace("test") + .withCounterSets(Arrays.asList( + new MetricCounterSet().withCounters(Arrays.asList(new MetricCounter().withName("test"))))))), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/MonitoringConfigDeleteSamples.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/MonitoringConfigDeleteSamples.java new file mode 100644 index 000000000000..fe064a7b8420 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/MonitoringConfigDeleteSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.databoxedge.generated; + +/** + * Samples for MonitoringConfig Delete. + */ +public final class MonitoringConfigDeleteSamples { + /* + * x-ms-original-file: 2023-12-01/DeleteMonitoringConfig.json + */ + /** + * Sample code: DeleteMonitoringConfig. + * + * @param manager Entry point to DataBoxEdgeManager. + */ + public static void deleteMonitoringConfig(com.azure.resourcemanager.databoxedge.DataBoxEdgeManager manager) { + manager.monitoringConfigs() + .delete("GroupForEdgeAutomation", "testedgedevice", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/MonitoringConfigGetSamples.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/MonitoringConfigGetSamples.java new file mode 100644 index 000000000000..acc645df03cb --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/MonitoringConfigGetSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.databoxedge.generated; + +/** + * Samples for MonitoringConfig Get. + */ +public final class MonitoringConfigGetSamples { + /* + * x-ms-original-file: 2023-12-01/GetMonitoringConfig.json + */ + /** + * Sample code: GetMonitoringConfig. + * + * @param manager Entry point to DataBoxEdgeManager. + */ + public static void getMonitoringConfig(com.azure.resourcemanager.databoxedge.DataBoxEdgeManager manager) { + manager.monitoringConfigs() + .getWithResponse("GroupForEdgeAutomation", "testedgedevice", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/MonitoringConfigListSamples.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/MonitoringConfigListSamples.java new file mode 100644 index 000000000000..498dc0a518f9 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/MonitoringConfigListSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.databoxedge.generated; + +/** + * Samples for MonitoringConfig List. + */ +public final class MonitoringConfigListSamples { + /* + * x-ms-original-file: 2023-12-01/ListMonitoringConfig.json + */ + /** + * Sample code: ListMonitoringConfig. + * + * @param manager Entry point to DataBoxEdgeManager. + */ + public static void listMonitoringConfig(com.azure.resourcemanager.databoxedge.DataBoxEdgeManager manager) { + manager.monitoringConfigs().list("GroupForEdgeAutomation", "testedgedevice", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/NodesListByDataBoxEdgeDeviceSamples.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/NodesListByDataBoxEdgeDeviceSamples.java index 37613a00e120..be2afc526e51 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/NodesListByDataBoxEdgeDeviceSamples.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/NodesListByDataBoxEdgeDeviceSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.generated; @@ -9,9 +9,7 @@ */ public final class NodesListByDataBoxEdgeDeviceSamples { /* - * x-ms-original-file: - * specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2019-08-01/examples/NodeGetAllInDevice. - * json + * x-ms-original-file: 2023-12-01/NodeGetAllInDevice.json */ /** * Sample code: NodesGetAllInDevice. @@ -20,6 +18,6 @@ public final class NodesListByDataBoxEdgeDeviceSamples { */ public static void nodesGetAllInDevice(com.azure.resourcemanager.databoxedge.DataBoxEdgeManager manager) { manager.nodes() - .listByDataBoxEdgeDevice("testedgedevice", "GroupForEdgeAutomation", com.azure.core.util.Context.NONE); + .listByDataBoxEdgeDevice("GroupForEdgeAutomation", "testedgedevice", com.azure.core.util.Context.NONE); } } diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/OperationsListSamples.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/OperationsListSamples.java index 6ab48ca7a27a..685c84370cd0 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/OperationsListSamples.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/OperationsListSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.generated; @@ -9,8 +9,7 @@ */ public final class OperationsListSamples { /* - * x-ms-original-file: - * specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2019-08-01/examples/OperationsGet.json + * x-ms-original-file: 2023-12-01/OperationsGet.json */ /** * Sample code: OperationsGet. diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/OperationsStatusGetSamples.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/OperationsStatusGetSamples.java index bbe94b0af31a..629fadc8c9be 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/OperationsStatusGetSamples.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/OperationsStatusGetSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.generated; @@ -9,9 +9,7 @@ */ public final class OperationsStatusGetSamples { /* - * x-ms-original-file: - * specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2019-08-01/examples/OperationsStatusGet. - * json + * x-ms-original-file: 2023-12-01/OperationsStatusGet.json */ /** * Sample code: OperationsStatusGet. @@ -20,7 +18,7 @@ public final class OperationsStatusGetSamples { */ public static void operationsStatusGet(com.azure.resourcemanager.databoxedge.DataBoxEdgeManager manager) { manager.operationsStatus() - .getWithResponse("testedgedevice", "159a00c7-8543-4343-9435-263ac87df3bb", "GroupForEdgeAutomation", + .getWithResponse("GroupForEdgeAutomation", "testedgedevice", "159a00c7-8543-4343-9435-263ac87df3bb", com.azure.core.util.Context.NONE); } } diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/OrdersCreateOrUpdateSamples.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/OrdersCreateOrUpdateSamples.java index 17b6e624dcb0..068d20acbd74 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/OrdersCreateOrUpdateSamples.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/OrdersCreateOrUpdateSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.generated; @@ -14,8 +14,7 @@ */ public final class OrdersCreateOrUpdateSamples { /* - * x-ms-original-file: - * specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2019-08-01/examples/OrderPut.json + * x-ms-original-file: 2023-12-01/OrderPut.json */ /** * Sample code: OrderPut. @@ -24,7 +23,7 @@ public final class OrdersCreateOrUpdateSamples { */ public static void orderPut(com.azure.resourcemanager.databoxedge.DataBoxEdgeManager manager) { manager.orders() - .createOrUpdate("testedgedevice", "GroupForEdgeAutomation", + .createOrUpdate("GroupForEdgeAutomation", "testedgedevice", new OrderInner() .withContactInformation(new ContactDetails().withContactPerson("John Mcclane") .withCompanyName("Microsoft") diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/OrdersDeleteSamples.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/OrdersDeleteSamples.java index b065262d6218..0975047104f2 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/OrdersDeleteSamples.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/OrdersDeleteSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.generated; @@ -9,8 +9,7 @@ */ public final class OrdersDeleteSamples { /* - * x-ms-original-file: - * specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2019-08-01/examples/OrderDelete.json + * x-ms-original-file: 2023-12-01/OrderDelete.json */ /** * Sample code: OrderDelete. @@ -18,6 +17,6 @@ public final class OrdersDeleteSamples { * @param manager Entry point to DataBoxEdgeManager. */ public static void orderDelete(com.azure.resourcemanager.databoxedge.DataBoxEdgeManager manager) { - manager.orders().delete("testedgedevice", "GroupForEdgeAutomation", com.azure.core.util.Context.NONE); + manager.orders().delete("GroupForEdgeAutomation", "testedgedevice", com.azure.core.util.Context.NONE); } } diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/OrdersGetSamples.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/OrdersGetSamples.java index 647c5d288038..26aabe5604cd 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/OrdersGetSamples.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/OrdersGetSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.generated; @@ -9,8 +9,7 @@ */ public final class OrdersGetSamples { /* - * x-ms-original-file: - * specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2019-08-01/examples/OrderGet.json + * x-ms-original-file: 2023-12-01/OrderGet.json */ /** * Sample code: OrderGet. @@ -18,6 +17,6 @@ public final class OrdersGetSamples { * @param manager Entry point to DataBoxEdgeManager. */ public static void orderGet(com.azure.resourcemanager.databoxedge.DataBoxEdgeManager manager) { - manager.orders().getWithResponse("testedgedevice", "GroupForEdgeAutomation", com.azure.core.util.Context.NONE); + manager.orders().getWithResponse("GroupForEdgeAutomation", "testedgedevice", com.azure.core.util.Context.NONE); } } diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/OrdersListByDataBoxEdgeDeviceSamples.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/OrdersListByDataBoxEdgeDeviceSamples.java index 48d666fd5af7..07493ecd6304 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/OrdersListByDataBoxEdgeDeviceSamples.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/OrdersListByDataBoxEdgeDeviceSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.generated; @@ -9,9 +9,7 @@ */ public final class OrdersListByDataBoxEdgeDeviceSamples { /* - * x-ms-original-file: - * specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2019-08-01/examples/OrderGetAllInDevice. - * json + * x-ms-original-file: 2023-12-01/OrderGetAllInDevice.json */ /** * Sample code: OrderGetAllInDevice. @@ -20,6 +18,6 @@ public final class OrdersListByDataBoxEdgeDeviceSamples { */ public static void orderGetAllInDevice(com.azure.resourcemanager.databoxedge.DataBoxEdgeManager manager) { manager.orders() - .listByDataBoxEdgeDevice("testedgedevice", "GroupForEdgeAutomation", com.azure.core.util.Context.NONE); + .listByDataBoxEdgeDevice("GroupForEdgeAutomation", "testedgedevice", com.azure.core.util.Context.NONE); } } diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/OrdersListDCAccessCodeSamples.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/OrdersListDCAccessCodeSamples.java new file mode 100644 index 000000000000..c11ec2176e04 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/OrdersListDCAccessCodeSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.databoxedge.generated; + +/** + * Samples for Orders ListDCAccessCode. + */ +public final class OrdersListDCAccessCodeSamples { + /* + * x-ms-original-file: 2023-12-01/GetDCAccessCode.json + */ + /** + * Sample code: GetDCAccessCode. + * + * @param manager Entry point to DataBoxEdgeManager. + */ + public static void getDCAccessCode(com.azure.resourcemanager.databoxedge.DataBoxEdgeManager manager) { + manager.orders() + .listDCAccessCodeWithResponse("GroupForEdgeAutomation", "testedgedevice", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/RolesCreateOrUpdateSamples.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/RolesCreateOrUpdateSamples.java index e863e3d3d80f..32962eb1c773 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/RolesCreateOrUpdateSamples.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/RolesCreateOrUpdateSamples.java @@ -1,26 +1,18 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.generated; -import com.azure.resourcemanager.databoxedge.models.AsymmetricEncryptedSecret; -import com.azure.resourcemanager.databoxedge.models.Authentication; -import com.azure.resourcemanager.databoxedge.models.EncryptionAlgorithm; -import com.azure.resourcemanager.databoxedge.models.IoTDeviceInfo; -import com.azure.resourcemanager.databoxedge.models.IoTRole; -import com.azure.resourcemanager.databoxedge.models.PlatformType; -import com.azure.resourcemanager.databoxedge.models.RoleStatus; -import com.azure.resourcemanager.databoxedge.models.SymmetricKey; -import java.util.Arrays; +import com.azure.resourcemanager.databoxedge.models.RoleProperties; +import com.azure.resourcemanager.databoxedge.models.RoleTypes; /** * Samples for Roles CreateOrUpdate. */ public final class RolesCreateOrUpdateSamples { /* - * x-ms-original-file: - * specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2019-08-01/examples/RolePut.json + * x-ms-original-file: 2023-12-01/RolePut.json */ /** * Sample code: RolePut. @@ -29,23 +21,10 @@ public final class RolesCreateOrUpdateSamples { */ public static void rolePut(com.azure.resourcemanager.databoxedge.DataBoxEdgeManager manager) { manager.roles() - .createOrUpdate("testedgedevice", "IoTRole1", "GroupForEdgeAutomation", new IoTRole() - .withHostPlatform(PlatformType.LINUX) - .withIoTDeviceDetails(new IoTDeviceInfo().withDeviceId("iotdevice") - .withIoTHostHub("iothub.azure-devices.net") - .withAuthentication(new Authentication().withSymmetricKey( - new SymmetricKey().withConnectionString(new AsymmetricEncryptedSecret().withValue( - "Encrypted<>") - .withEncryptionCertThumbprint("348586569999244") - .withEncryptionAlgorithm(EncryptionAlgorithm.AES256))))) - .withIoTEdgeDeviceDetails(new IoTDeviceInfo().withDeviceId("iotEdge") - .withIoTHostHub("iothub.azure-devices.net") - .withAuthentication(new Authentication().withSymmetricKey( - new SymmetricKey().withConnectionString(new AsymmetricEncryptedSecret().withValue( - "Encrypted<>") - .withEncryptionCertThumbprint("1245475856069999244") - .withEncryptionAlgorithm(EncryptionAlgorithm.AES256))))) - .withShareMappings(Arrays.asList()) - .withRoleStatus(RoleStatus.ENABLED), com.azure.core.util.Context.NONE); + .define("IoTRole1") + .withExistingDataBoxEdgeDevice("GroupForEdgeAutomation", "testedgedevice") + .withKind(RoleTypes.IOT) + .withProperties(new RoleProperties()) + .create(); } } diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/RolesDeleteSamples.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/RolesDeleteSamples.java index b5875c3aa575..e3a2bafcfb7c 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/RolesDeleteSamples.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/RolesDeleteSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.generated; @@ -9,8 +9,7 @@ */ public final class RolesDeleteSamples { /* - * x-ms-original-file: - * specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2019-08-01/examples/RoleDelete.json + * x-ms-original-file: 2023-12-01/RoleDelete.json */ /** * Sample code: RoleDelete. @@ -19,6 +18,6 @@ public final class RolesDeleteSamples { */ public static void roleDelete(com.azure.resourcemanager.databoxedge.DataBoxEdgeManager manager) { manager.roles() - .delete("testedgedevice", "IoTRole1", "GroupForEdgeAutomation", com.azure.core.util.Context.NONE); + .delete("GroupForEdgeAutomation", "testedgedevice", "IoTRole1", com.azure.core.util.Context.NONE); } } diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/RolesGetSamples.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/RolesGetSamples.java index 262333e16d76..6be772e0109a 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/RolesGetSamples.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/RolesGetSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.generated; @@ -9,8 +9,7 @@ */ public final class RolesGetSamples { /* - * x-ms-original-file: - * specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2019-08-01/examples/RoleGet.json + * x-ms-original-file: 2023-12-01/RoleGet.json */ /** * Sample code: RoleGet. @@ -19,6 +18,6 @@ public final class RolesGetSamples { */ public static void roleGet(com.azure.resourcemanager.databoxedge.DataBoxEdgeManager manager) { manager.roles() - .getWithResponse("testedgedevice", "IoTRole1", "GroupForEdgeAutomation", com.azure.core.util.Context.NONE); + .getWithResponse("GroupForEdgeAutomation", "testedgedevice", "IoTRole1", com.azure.core.util.Context.NONE); } } diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/RolesListByDataBoxEdgeDeviceSamples.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/RolesListByDataBoxEdgeDeviceSamples.java index 16e3ccfa91e5..ef0be4fb2d3d 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/RolesListByDataBoxEdgeDeviceSamples.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/RolesListByDataBoxEdgeDeviceSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.generated; @@ -9,9 +9,7 @@ */ public final class RolesListByDataBoxEdgeDeviceSamples { /* - * x-ms-original-file: - * specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2019-08-01/examples/RoleGetAllInDevice. - * json + * x-ms-original-file: 2023-12-01/RoleGetAllInDevice.json */ /** * Sample code: RoleGetAllInDevice. @@ -20,6 +18,6 @@ public final class RolesListByDataBoxEdgeDeviceSamples { */ public static void roleGetAllInDevice(com.azure.resourcemanager.databoxedge.DataBoxEdgeManager manager) { manager.roles() - .listByDataBoxEdgeDevice("testedgedevice", "GroupForEdgeAutomation", com.azure.core.util.Context.NONE); + .listByDataBoxEdgeDevice("GroupForEdgeAutomation", "testedgedevice", com.azure.core.util.Context.NONE); } } diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/SharesCreateOrUpdateSamples.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/SharesCreateOrUpdateSamples.java index 83d7e5f0febb..1948b97ba4c4 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/SharesCreateOrUpdateSamples.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/SharesCreateOrUpdateSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.generated; @@ -19,8 +19,7 @@ */ public final class SharesCreateOrUpdateSamples { /* - * x-ms-original-file: - * specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2019-08-01/examples/SharePut.json + * x-ms-original-file: 2023-12-01/SharePut.json */ /** * Sample code: SharePut. @@ -30,7 +29,7 @@ public final class SharesCreateOrUpdateSamples { public static void sharePut(com.azure.resourcemanager.databoxedge.DataBoxEdgeManager manager) { manager.shares() .define("smbshare") - .withExistingDataBoxEdgeDevice("testedgedevice", "GroupForEdgeAutomation") + .withExistingDataBoxEdgeDevice("GroupForEdgeAutomation", "testedgedevice") .withShareStatus(ShareStatus.fromString("Online")) .withMonitoringStatus(MonitoringStatus.ENABLED) .withAccessProtocol(ShareAccessProtocol.SMB) diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/SharesDeleteSamples.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/SharesDeleteSamples.java index 8da8f3f6d01b..54e51935b492 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/SharesDeleteSamples.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/SharesDeleteSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.generated; @@ -9,8 +9,7 @@ */ public final class SharesDeleteSamples { /* - * x-ms-original-file: - * specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2019-08-01/examples/ShareDelete.json + * x-ms-original-file: 2023-12-01/ShareDelete.json */ /** * Sample code: ShareDelete. @@ -19,6 +18,6 @@ public final class SharesDeleteSamples { */ public static void shareDelete(com.azure.resourcemanager.databoxedge.DataBoxEdgeManager manager) { manager.shares() - .delete("testedgedevice", "smbshare", "GroupForEdgeAutomation", com.azure.core.util.Context.NONE); + .delete("GroupForEdgeAutomation", "testedgedevice", "smbshare", com.azure.core.util.Context.NONE); } } diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/SharesGetSamples.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/SharesGetSamples.java index 47db3646e4ac..c377a30a7e2c 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/SharesGetSamples.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/SharesGetSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.generated; @@ -9,8 +9,7 @@ */ public final class SharesGetSamples { /* - * x-ms-original-file: - * specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2019-08-01/examples/ShareGet.json + * x-ms-original-file: 2023-12-01/ShareGet.json */ /** * Sample code: ShareGet. @@ -19,6 +18,6 @@ public final class SharesGetSamples { */ public static void shareGet(com.azure.resourcemanager.databoxedge.DataBoxEdgeManager manager) { manager.shares() - .getWithResponse("testedgedevice", "smbshare", "GroupForEdgeAutomation", com.azure.core.util.Context.NONE); + .getWithResponse("GroupForEdgeAutomation", "testedgedevice", "smbshare", com.azure.core.util.Context.NONE); } } diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/SharesListByDataBoxEdgeDeviceSamples.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/SharesListByDataBoxEdgeDeviceSamples.java index 74fe4b25785f..80f8f5313140 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/SharesListByDataBoxEdgeDeviceSamples.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/SharesListByDataBoxEdgeDeviceSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.generated; @@ -9,9 +9,7 @@ */ public final class SharesListByDataBoxEdgeDeviceSamples { /* - * x-ms-original-file: - * specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2019-08-01/examples/ShareGetAllInDevice. - * json + * x-ms-original-file: 2023-12-01/ShareGetAllInDevice.json */ /** * Sample code: ShareGetAllInDevice. @@ -20,6 +18,6 @@ public final class SharesListByDataBoxEdgeDeviceSamples { */ public static void shareGetAllInDevice(com.azure.resourcemanager.databoxedge.DataBoxEdgeManager manager) { manager.shares() - .listByDataBoxEdgeDevice("testedgedevice", "GroupForEdgeAutomation", com.azure.core.util.Context.NONE); + .listByDataBoxEdgeDevice("GroupForEdgeAutomation", "testedgedevice", com.azure.core.util.Context.NONE); } } diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/SharesRefreshSamples.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/SharesRefreshSamples.java index 4ebea4d65120..a5b604a3090b 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/SharesRefreshSamples.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/SharesRefreshSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.generated; @@ -9,8 +9,7 @@ */ public final class SharesRefreshSamples { /* - * x-ms-original-file: - * specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2019-08-01/examples/ShareRefreshPost.json + * x-ms-original-file: 2023-12-01/ShareRefreshPost.json */ /** * Sample code: ShareRefreshPost. @@ -19,6 +18,6 @@ public final class SharesRefreshSamples { */ public static void shareRefreshPost(com.azure.resourcemanager.databoxedge.DataBoxEdgeManager manager) { manager.shares() - .refresh("testedgedevice", "smbshare", "GroupForEdgeAutomation", com.azure.core.util.Context.NONE); + .refresh("GroupForEdgeAutomation", "testedgedevice", "smbshare", com.azure.core.util.Context.NONE); } } diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/SkusListSamples.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/SkusListSamples.java deleted file mode 100644 index c72d38239eea..000000000000 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/SkusListSamples.java +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.databoxedge.generated; - -/** - * Samples for Skus List. - */ -public final class SkusListSamples { - /* - * x-ms-original-file: - * specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2019-08-01/examples/ListSkus.json - */ - /** - * Sample code: ListSkus. - * - * @param manager Entry point to DataBoxEdgeManager. - */ - public static void listSkus(com.azure.resourcemanager.databoxedge.DataBoxEdgeManager manager) { - manager.skus().list(null, com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/StorageAccountCredentialsCreateOrUpdateSamples.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/StorageAccountCredentialsCreateOrUpdateSamples.java index a097527016f1..8967d21109bc 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/StorageAccountCredentialsCreateOrUpdateSamples.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/StorageAccountCredentialsCreateOrUpdateSamples.java @@ -1,21 +1,20 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.generated; import com.azure.resourcemanager.databoxedge.models.AccountType; import com.azure.resourcemanager.databoxedge.models.AsymmetricEncryptedSecret; import com.azure.resourcemanager.databoxedge.models.EncryptionAlgorithm; -import com.azure.resourcemanager.databoxedge.models.SslStatus; +import com.azure.resourcemanager.databoxedge.models.SSLStatus; /** * Samples for StorageAccountCredentials CreateOrUpdate. */ public final class StorageAccountCredentialsCreateOrUpdateSamples { /* - * x-ms-original-file: - * specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2019-08-01/examples/SACPut.json + * x-ms-original-file: 2023-12-01/SACPut.json */ /** * Sample code: SACPut. @@ -25,11 +24,11 @@ public final class StorageAccountCredentialsCreateOrUpdateSamples { public static void sACPut(com.azure.resourcemanager.databoxedge.DataBoxEdgeManager manager) { manager.storageAccountCredentials() .define("sac1") - .withExistingDataBoxEdgeDevice("testedgedevice", "GroupForEdgeAutomation") + .withExistingDataBoxEdgeDevice("GroupForEdgeAutomation", "testedgedevice") .withAlias("sac1") - .withSslStatus(SslStatus.DISABLED) + .withSslStatus(SSLStatus.DISABLED) .withAccountType(AccountType.BLOB_STORAGE) - .withUsername("cisbvt") + .withUserName("cisbvt") .withAccountKey(new AsymmetricEncryptedSecret().withValue( "lAeZEYi6rNP1/EyNaVUYmTSZEYyaIaWmwUsGwek0+xiZj54GM9Ue9/UA2ed/ClC03wuSit2XzM/cLRU5eYiFBwks23rGwiQOr3sruEL2a74EjPD050xYjA6M1I2hu/w2yjVHhn5j+DbXS4Xzi+rHHNZK3DgfDO3PkbECjPck+PbpSBjy9+6Mrjcld5DIZhUAeMlMHrFlg+WKRKB14o/og56u5/xX6WKlrMLEQ+y6E18dUwvWs2elTNoVO8PBE8SM/CfooX4AMNvaNdSObNBPdP+F6Lzc556nFNWXrBLRt0vC7s9qTiVRO4x/qCNaK/B4y7IqXMllwQFf4Np9UQ2ECA==") .withEncryptionCertThumbprint("2A9D8D6BE51574B5461230AEF02F162C5F01AD31") diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/StorageAccountCredentialsDeleteSamples.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/StorageAccountCredentialsDeleteSamples.java index a84788a0ff46..4fd54291aa77 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/StorageAccountCredentialsDeleteSamples.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/StorageAccountCredentialsDeleteSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.generated; @@ -9,8 +9,7 @@ */ public final class StorageAccountCredentialsDeleteSamples { /* - * x-ms-original-file: - * specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2019-08-01/examples/SACDelete.json + * x-ms-original-file: 2023-12-01/SACDelete.json */ /** * Sample code: SACDelete. @@ -19,6 +18,6 @@ public final class StorageAccountCredentialsDeleteSamples { */ public static void sACDelete(com.azure.resourcemanager.databoxedge.DataBoxEdgeManager manager) { manager.storageAccountCredentials() - .delete("testedgedevice", "sac1", "GroupForEdgeAutomation", com.azure.core.util.Context.NONE); + .delete("GroupForEdgeAutomation", "testedgedevice", "sac1", com.azure.core.util.Context.NONE); } } diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/StorageAccountCredentialsGetSamples.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/StorageAccountCredentialsGetSamples.java index ec85aed435e5..bf2d592622db 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/StorageAccountCredentialsGetSamples.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/StorageAccountCredentialsGetSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.generated; @@ -9,8 +9,7 @@ */ public final class StorageAccountCredentialsGetSamples { /* - * x-ms-original-file: - * specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2019-08-01/examples/SACGet.json + * x-ms-original-file: 2023-12-01/SACGet.json */ /** * Sample code: SACGet. @@ -19,6 +18,6 @@ public final class StorageAccountCredentialsGetSamples { */ public static void sACGet(com.azure.resourcemanager.databoxedge.DataBoxEdgeManager manager) { manager.storageAccountCredentials() - .getWithResponse("testedgedevice", "sac1", "GroupForEdgeAutomation", com.azure.core.util.Context.NONE); + .getWithResponse("GroupForEdgeAutomation", "testedgedevice", "sac1", com.azure.core.util.Context.NONE); } } diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/StorageAccountCredentialsListByDataBoxEdgeDeviceSamples.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/StorageAccountCredentialsListByDataBoxEdgeDeviceSamples.java index ee4eae5c77c0..4c72693b0ace 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/StorageAccountCredentialsListByDataBoxEdgeDeviceSamples.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/StorageAccountCredentialsListByDataBoxEdgeDeviceSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.generated; @@ -9,9 +9,7 @@ */ public final class StorageAccountCredentialsListByDataBoxEdgeDeviceSamples { /* - * x-ms-original-file: - * specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2019-08-01/examples/SACGetAllInDevice. - * json + * x-ms-original-file: 2023-12-01/SACGetAllInDevice.json */ /** * Sample code: SACGetAllInDevice. @@ -20,6 +18,6 @@ public final class StorageAccountCredentialsListByDataBoxEdgeDeviceSamples { */ public static void sACGetAllInDevice(com.azure.resourcemanager.databoxedge.DataBoxEdgeManager manager) { manager.storageAccountCredentials() - .listByDataBoxEdgeDevice("testedgedevice", "GroupForEdgeAutomation", com.azure.core.util.Context.NONE); + .listByDataBoxEdgeDevice("GroupForEdgeAutomation", "testedgedevice", com.azure.core.util.Context.NONE); } } diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/StorageAccountsCreateOrUpdateSamples.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/StorageAccountsCreateOrUpdateSamples.java index 3f62e1813220..0a0702765e73 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/StorageAccountsCreateOrUpdateSamples.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/StorageAccountsCreateOrUpdateSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.generated; @@ -12,9 +12,7 @@ */ public final class StorageAccountsCreateOrUpdateSamples { /* - * x-ms-original-file: - * specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2019-08-01/examples/StorageAccountPut. - * json + * x-ms-original-file: 2023-12-01/StorageAccountPut.json */ /** * Sample code: StorageAccountPut. @@ -24,10 +22,10 @@ public final class StorageAccountsCreateOrUpdateSamples { public static void storageAccountPut(com.azure.resourcemanager.databoxedge.DataBoxEdgeManager manager) { manager.storageAccounts() .define("blobstorageaccount1") - .withExistingDataBoxEdgeDevice("testedgedevice", "GroupForEdgeAutomation") + .withExistingDataBoxEdgeDevice("GroupForEdgeAutomation", "testedgedevice") + .withDataPolicy(DataPolicy.CLOUD) .withDescription("It's an awesome storage account") .withStorageAccountStatus(StorageAccountStatus.OK) - .withDataPolicy(DataPolicy.CLOUD) .withStorageAccountCredentialId( "/subscriptions/4385cf00-2d3a-425a-832f-f4285b1c9dce/resourceGroups/GroupForDataBoxEdgeAutomation/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/testedgedevice/storageAccountCredentials/cisbvt") .create(); diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/StorageAccountsDeleteSamples.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/StorageAccountsDeleteSamples.java index d29678e6dbde..534d13468721 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/StorageAccountsDeleteSamples.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/StorageAccountsDeleteSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.generated; @@ -9,9 +9,7 @@ */ public final class StorageAccountsDeleteSamples { /* - * x-ms-original-file: - * specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2019-08-01/examples/StorageAccountDelete. - * json + * x-ms-original-file: 2023-12-01/StorageAccountDelete.json */ /** * Sample code: StorageAccountDelete. @@ -20,6 +18,6 @@ public final class StorageAccountsDeleteSamples { */ public static void storageAccountDelete(com.azure.resourcemanager.databoxedge.DataBoxEdgeManager manager) { manager.storageAccounts() - .delete("testedgedevice", "storageaccount1", "GroupForEdgeAutomation", com.azure.core.util.Context.NONE); + .delete("GroupForEdgeAutomation", "testedgedevice", "storageaccount1", com.azure.core.util.Context.NONE); } } diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/StorageAccountsGetSamples.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/StorageAccountsGetSamples.java index 1c9690b8fe4d..1011236115cc 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/StorageAccountsGetSamples.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/StorageAccountsGetSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.generated; @@ -9,9 +9,7 @@ */ public final class StorageAccountsGetSamples { /* - * x-ms-original-file: - * specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2019-08-01/examples/StorageAccountGet. - * json + * x-ms-original-file: 2023-12-01/StorageAccountGet.json */ /** * Sample code: StorageAccountGet. @@ -20,7 +18,7 @@ public final class StorageAccountsGetSamples { */ public static void storageAccountGet(com.azure.resourcemanager.databoxedge.DataBoxEdgeManager manager) { manager.storageAccounts() - .getWithResponse("testedgedevice", "blobstorageaccount1", "GroupForEdgeAutomation", + .getWithResponse("GroupForEdgeAutomation", "testedgedevice", "blobstorageaccount1", com.azure.core.util.Context.NONE); } } diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/StorageAccountsListByDataBoxEdgeDeviceSamples.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/StorageAccountsListByDataBoxEdgeDeviceSamples.java index 98645b61c729..dbde9216c899 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/StorageAccountsListByDataBoxEdgeDeviceSamples.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/StorageAccountsListByDataBoxEdgeDeviceSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.generated; @@ -9,8 +9,7 @@ */ public final class StorageAccountsListByDataBoxEdgeDeviceSamples { /* - * x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2019-08-01/examples/ - * StorageAccountGetAllInDevice.json + * x-ms-original-file: 2023-12-01/StorageAccountGetAllInDevice.json */ /** * Sample code: StorageAccountGetAllInDevice. @@ -19,6 +18,6 @@ public final class StorageAccountsListByDataBoxEdgeDeviceSamples { */ public static void storageAccountGetAllInDevice(com.azure.resourcemanager.databoxedge.DataBoxEdgeManager manager) { manager.storageAccounts() - .listByDataBoxEdgeDevice("testedgedevice", "GroupForEdgeAutomation", com.azure.core.util.Context.NONE); + .listByDataBoxEdgeDevice("GroupForEdgeAutomation", "testedgedevice", com.azure.core.util.Context.NONE); } } diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/SupportPackagesTriggerSupportPackageSamples.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/SupportPackagesTriggerSupportPackageSamples.java new file mode 100644 index 000000000000..57759be65678 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/SupportPackagesTriggerSupportPackageSamples.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.databoxedge.generated; + +import com.azure.resourcemanager.databoxedge.models.TriggerSupportPackageRequest; +import java.time.OffsetDateTime; + +/** + * Samples for SupportPackages TriggerSupportPackage. + */ +public final class SupportPackagesTriggerSupportPackageSamples { + /* + * x-ms-original-file: 2023-12-01/TriggerSupportPackage.json + */ + /** + * Sample code: TriggerSupportPackage. + * + * @param manager Entry point to DataBoxEdgeManager. + */ + public static void triggerSupportPackage(com.azure.resourcemanager.databoxedge.DataBoxEdgeManager manager) { + manager.supportPackages() + .triggerSupportPackage("GroupForEdgeAutomation", "testedgedevice", + new TriggerSupportPackageRequest() + .withMinimumTimeStamp(OffsetDateTime.parse("2018-12-18T02:18:51.4270267Z")) + .withMaximumTimeStamp(OffsetDateTime.parse("2018-12-18T02:19:51.4270267Z")) + .withInclude("DefaultWithDumps"), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/TriggersCreateOrUpdateSamples.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/TriggersCreateOrUpdateSamples.java index 4b23516abc54..35e2698ce1ae 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/TriggersCreateOrUpdateSamples.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/TriggersCreateOrUpdateSamples.java @@ -1,20 +1,18 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.generated; -import com.azure.resourcemanager.databoxedge.models.FileEventTrigger; -import com.azure.resourcemanager.databoxedge.models.FileSourceInfo; -import com.azure.resourcemanager.databoxedge.models.RoleSinkInfo; +import com.azure.resourcemanager.databoxedge.models.TriggerEventType; +import com.azure.resourcemanager.databoxedge.models.TriggerProperties; /** * Samples for Triggers CreateOrUpdate. */ public final class TriggersCreateOrUpdateSamples { /* - * x-ms-original-file: - * specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2019-08-01/examples/TriggerPut.json + * x-ms-original-file: 2023-12-01/TriggerPut.json */ /** * Sample code: TriggerPut. @@ -23,11 +21,10 @@ public final class TriggersCreateOrUpdateSamples { */ public static void triggerPut(com.azure.resourcemanager.databoxedge.DataBoxEdgeManager manager) { manager.triggers() - .createOrUpdate("testedgedevice", "trigger1", "GroupForEdgeAutomation", new FileEventTrigger() - .withSourceInfo(new FileSourceInfo().withShareId( - "/subscriptions/4385cf00-2d3a-425a-832f-f4285b1c9dce/resourceGroups/GroupForEdgeAutomation/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/testedgedevice/shares/share1")) - .withSinkInfo(new RoleSinkInfo().withRoleId( - "/subscriptions/4385cf00-2d3a-425a-832f-f4285b1c9dce/resourceGroups/GroupForEdgeAutomation/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/testedgedevice/roles/role1")) - .withCustomContextTag("CustomContextTags-1235346475"), com.azure.core.util.Context.NONE); + .define("trigger1") + .withExistingDataBoxEdgeDevice("GroupForEdgeAutomation", "testedgedevice") + .withKind(TriggerEventType.FILE_EVENT) + .withProperties(new TriggerProperties()) + .create(); } } diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/TriggersDeleteSamples.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/TriggersDeleteSamples.java index 569b16027037..5f324daa24bc 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/TriggersDeleteSamples.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/TriggersDeleteSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.generated; @@ -9,8 +9,7 @@ */ public final class TriggersDeleteSamples { /* - * x-ms-original-file: - * specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2019-08-01/examples/TriggerDelete.json + * x-ms-original-file: 2023-12-01/TriggerDelete.json */ /** * Sample code: TriggerDelete. @@ -19,6 +18,6 @@ public final class TriggersDeleteSamples { */ public static void triggerDelete(com.azure.resourcemanager.databoxedge.DataBoxEdgeManager manager) { manager.triggers() - .delete("testedgedevice", "trigger1", "GroupForEdgeAutomation", com.azure.core.util.Context.NONE); + .delete("GroupForEdgeAutomation", "testedgedevice", "trigger1", com.azure.core.util.Context.NONE); } } diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/TriggersGetSamples.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/TriggersGetSamples.java index 1f0ffc157e49..b5a68a1a62b8 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/TriggersGetSamples.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/TriggersGetSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.generated; @@ -9,8 +9,7 @@ */ public final class TriggersGetSamples { /* - * x-ms-original-file: - * specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2019-08-01/examples/TriggerGet.json + * x-ms-original-file: 2023-12-01/TriggerGet.json */ /** * Sample code: TriggerGet. @@ -19,6 +18,6 @@ public final class TriggersGetSamples { */ public static void triggerGet(com.azure.resourcemanager.databoxedge.DataBoxEdgeManager manager) { manager.triggers() - .getWithResponse("testedgedevice", "trigger1", "GroupForEdgeAutomation", com.azure.core.util.Context.NONE); + .getWithResponse("GroupForEdgeAutomation", "testedgedevice", "trigger1", com.azure.core.util.Context.NONE); } } diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/TriggersListByDataBoxEdgeDeviceSamples.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/TriggersListByDataBoxEdgeDeviceSamples.java index f5f98c32b240..c2571eaeb85d 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/TriggersListByDataBoxEdgeDeviceSamples.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/TriggersListByDataBoxEdgeDeviceSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.generated; @@ -9,9 +9,7 @@ */ public final class TriggersListByDataBoxEdgeDeviceSamples { /* - * x-ms-original-file: - * specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2019-08-01/examples/TriggerGetAllInDevice - * .json + * x-ms-original-file: 2023-12-01/TriggerGetAllInDevice.json */ /** * Sample code: TriggerGetAllInDevice. @@ -20,7 +18,7 @@ public final class TriggersListByDataBoxEdgeDeviceSamples { */ public static void triggerGetAllInDevice(com.azure.resourcemanager.databoxedge.DataBoxEdgeManager manager) { manager.triggers() - .listByDataBoxEdgeDevice("testedgedevice", "GroupForEdgeAutomation", null, + .listByDataBoxEdgeDevice("GroupForEdgeAutomation", "testedgedevice", null, com.azure.core.util.Context.NONE); } } diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/UsersCreateOrUpdateSamples.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/UsersCreateOrUpdateSamples.java index 4bd9a24c5208..6108cffb983b 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/UsersCreateOrUpdateSamples.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/UsersCreateOrUpdateSamples.java @@ -1,21 +1,19 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.generated; import com.azure.resourcemanager.databoxedge.models.AsymmetricEncryptedSecret; import com.azure.resourcemanager.databoxedge.models.EncryptionAlgorithm; import com.azure.resourcemanager.databoxedge.models.UserType; -import java.util.Arrays; /** * Samples for Users CreateOrUpdate. */ public final class UsersCreateOrUpdateSamples { /* - * x-ms-original-file: - * specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2019-08-01/examples/UserPut.json + * x-ms-original-file: 2023-12-01/UserPut.json */ /** * Sample code: UserPut. @@ -25,12 +23,11 @@ public final class UsersCreateOrUpdateSamples { public static void userPut(com.azure.resourcemanager.databoxedge.DataBoxEdgeManager manager) { manager.users() .define("user1") - .withExistingDataBoxEdgeDevice("testedgedevice", "GroupForEdgeAutomation") + .withExistingDataBoxEdgeDevice("GroupForEdgeAutomation", "testedgedevice") .withUserType(UserType.SHARE) .withEncryptedPassword(new AsymmetricEncryptedSecret().withValue("") .withEncryptionCertThumbprint("blah") .withEncryptionAlgorithm(EncryptionAlgorithm.NONE)) - .withShareAccessRights(Arrays.asList()) .create(); } } diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/UsersDeleteSamples.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/UsersDeleteSamples.java index 2453f82140ec..c1b95726d5a6 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/UsersDeleteSamples.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/UsersDeleteSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.generated; @@ -9,8 +9,7 @@ */ public final class UsersDeleteSamples { /* - * x-ms-original-file: - * specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2019-08-01/examples/UserDelete.json + * x-ms-original-file: 2023-12-01/UserDelete.json */ /** * Sample code: UserDelete. @@ -18,6 +17,6 @@ public final class UsersDeleteSamples { * @param manager Entry point to DataBoxEdgeManager. */ public static void userDelete(com.azure.resourcemanager.databoxedge.DataBoxEdgeManager manager) { - manager.users().delete("testedgedevice", "user1", "GroupForEdgeAutomation", com.azure.core.util.Context.NONE); + manager.users().delete("GroupForEdgeAutomation", "testedgedevice", "user1", com.azure.core.util.Context.NONE); } } diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/UsersGetSamples.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/UsersGetSamples.java index c0af415b02b1..b109b6101604 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/UsersGetSamples.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/UsersGetSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.generated; @@ -9,8 +9,7 @@ */ public final class UsersGetSamples { /* - * x-ms-original-file: - * specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2019-08-01/examples/UserGet.json + * x-ms-original-file: 2023-12-01/UserGet.json */ /** * Sample code: UserGet. @@ -19,6 +18,6 @@ public final class UsersGetSamples { */ public static void userGet(com.azure.resourcemanager.databoxedge.DataBoxEdgeManager manager) { manager.users() - .getWithResponse("testedgedevice", "user1", "GroupForEdgeAutomation", com.azure.core.util.Context.NONE); + .getWithResponse("GroupForEdgeAutomation", "testedgedevice", "user1", com.azure.core.util.Context.NONE); } } diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/UsersListByDataBoxEdgeDeviceSamples.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/UsersListByDataBoxEdgeDeviceSamples.java index 988fdea88423..99402053e5d9 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/UsersListByDataBoxEdgeDeviceSamples.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/samples/java/com/azure/resourcemanager/databoxedge/generated/UsersListByDataBoxEdgeDeviceSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.generated; @@ -9,9 +9,7 @@ */ public final class UsersListByDataBoxEdgeDeviceSamples { /* - * x-ms-original-file: - * specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2019-08-01/examples/UserGetAllInDevice. - * json + * x-ms-original-file: 2023-12-01/UserGetAllInDevice.json */ /** * Sample code: UserGetAllInDevice. @@ -20,7 +18,7 @@ public final class UsersListByDataBoxEdgeDeviceSamples { */ public static void userGetAllInDevice(com.azure.resourcemanager.databoxedge.DataBoxEdgeManager manager) { manager.users() - .listByDataBoxEdgeDevice("testedgedevice", "GroupForEdgeAutomation", null, + .listByDataBoxEdgeDevice("GroupForEdgeAutomation", "testedgedevice", null, com.azure.core.util.Context.NONE); } } diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/AddonInnerTests.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/AddonInnerTests.java new file mode 100644 index 000000000000..3a002645a578 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/AddonInnerTests.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.databoxedge.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.databoxedge.fluent.models.AddonInner; +import com.azure.resourcemanager.databoxedge.models.AddonProperties; +import com.azure.resourcemanager.databoxedge.models.AddonType; +import org.junit.jupiter.api.Assertions; + +public final class AddonInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + AddonInner model = BinaryData + .fromString( + "{\"properties\":{},\"kind\":\"IotEdge\",\"id\":\"wzsyyceuzs\",\"name\":\"i\",\"type\":\"judpfrxt\"}") + .toObject(AddonInner.class); + Assertions.assertEquals(AddonType.IOT_EDGE, model.kind()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + AddonInner model = new AddonInner().withProperties(new AddonProperties()).withKind(AddonType.IOT_EDGE); + model = BinaryData.fromObject(model).toObject(AddonInner.class); + Assertions.assertEquals(AddonType.IOT_EDGE, model.kind()); + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/AddonListTests.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/AddonListTests.java new file mode 100644 index 000000000000..d63f15b9bf8e --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/AddonListTests.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.databoxedge.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.databoxedge.implementation.models.AddonList; +import com.azure.resourcemanager.databoxedge.models.AddonType; +import org.junit.jupiter.api.Assertions; + +public final class AddonListTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + AddonList model = BinaryData.fromString( + "{\"value\":[{\"properties\":{},\"kind\":\"ArcForKubernetes\",\"id\":\"aytdwkqbrq\",\"name\":\"bpaxhexiilivpdt\",\"type\":\"irqtdqoa\"},{\"properties\":{},\"kind\":\"IotEdge\",\"id\":\"zfgs\",\"name\":\"uyfxrxxleptramxj\",\"type\":\"zwl\"},{\"properties\":{},\"kind\":\"ArcForKubernetes\",\"id\":\"uqlcvydy\",\"name\":\"atdooaojkniod\",\"type\":\"oo\"},{\"properties\":{},\"kind\":\"ArcForKubernetes\",\"id\":\"ujhemmsbvdkcrodt\",\"name\":\"infwjlfltkacjve\",\"type\":\"kdlfoa\"}],\"nextLink\":\"gkfpaga\"}") + .toObject(AddonList.class); + Assertions.assertEquals(AddonType.ARC_FOR_KUBERNETES, model.value().get(0).kind()); + Assertions.assertEquals("gkfpaga", model.nextLink()); + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/AddonPropertiesTests.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/AddonPropertiesTests.java new file mode 100644 index 000000000000..66feeabfc6eb --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/AddonPropertiesTests.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.databoxedge.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.databoxedge.models.AddonProperties; + +public final class AddonPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + AddonProperties model = BinaryData.fromString("{}").toObject(AddonProperties.class); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + AddonProperties model = new AddonProperties(); + model = BinaryData.fromObject(model).toObject(AddonProperties.class); + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/AddonsCreateOrUpdateMockTests.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/AddonsCreateOrUpdateMockTests.java new file mode 100644 index 000000000000..cd7c8e97d842 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/AddonsCreateOrUpdateMockTests.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.databoxedge.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.databoxedge.DataBoxEdgeManager; +import com.azure.resourcemanager.databoxedge.models.Addon; +import com.azure.resourcemanager.databoxedge.models.AddonProperties; +import com.azure.resourcemanager.databoxedge.models.AddonType; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class AddonsCreateOrUpdateMockTests { + @Test + public void testCreateOrUpdate() throws Exception { + String responseStr + = "{\"properties\":{},\"kind\":\"ArcForKubernetes\",\"id\":\"hdrwjjkh\",\"name\":\"yomacluzvxnqm\",\"type\":\"rpqpd\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + DataBoxEdgeManager manager = DataBoxEdgeManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + Addon response = manager.addons() + .define("lzgaufcshhvnew") + .withExistingDataBoxEdgeDevice("smgomguaml", "dlrgms") + .withKind(AddonType.IOT_EDGE) + .withProperties(new AddonProperties()) + .create(); + + Assertions.assertEquals(AddonType.ARC_FOR_KUBERNETES, response.kind()); + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/AddonsDeleteMockTests.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/AddonsDeleteMockTests.java new file mode 100644 index 000000000000..261379fed8a1 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/AddonsDeleteMockTests.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.databoxedge.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.databoxedge.DataBoxEdgeManager; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class AddonsDeleteMockTests { + @Test + public void testDelete() throws Exception { + String responseStr = "{}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + DataBoxEdgeManager manager = DataBoxEdgeManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + manager.addons().delete("aswlp", "ugmrmf", "lrxw", com.azure.core.util.Context.NONE); + + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/AddonsGetWithResponseMockTests.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/AddonsGetWithResponseMockTests.java new file mode 100644 index 000000000000..f0f7db46842c --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/AddonsGetWithResponseMockTests.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.databoxedge.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.databoxedge.DataBoxEdgeManager; +import com.azure.resourcemanager.databoxedge.models.Addon; +import com.azure.resourcemanager.databoxedge.models.AddonType; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class AddonsGetWithResponseMockTests { + @Test + public void testGetWithResponse() throws Exception { + String responseStr + = "{\"properties\":{},\"kind\":\"ArcForKubernetes\",\"id\":\"hnp\",\"name\":\"myqwcab\",\"type\":\"nuilee\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + DataBoxEdgeManager manager = DataBoxEdgeManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + Addon response = manager.addons() + .getWithResponse("ihfqlggwfiwzc", "mjpb", "ephmgtvljvrcmyfq", com.azure.core.util.Context.NONE) + .getValue(); + + Assertions.assertEquals(AddonType.ARC_FOR_KUBERNETES, response.kind()); + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/AddonsListByRoleMockTests.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/AddonsListByRoleMockTests.java new file mode 100644 index 000000000000..66ebb272d0cf --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/AddonsListByRoleMockTests.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.databoxedge.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.databoxedge.DataBoxEdgeManager; +import com.azure.resourcemanager.databoxedge.models.Addon; +import com.azure.resourcemanager.databoxedge.models.AddonType; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class AddonsListByRoleMockTests { + @Test + public void testListByRole() throws Exception { + String responseStr + = "{\"value\":[{\"properties\":{},\"kind\":\"ArcForKubernetes\",\"id\":\"eds\",\"name\":\"jwuive\",\"type\":\"wcgyeewxeiqb\"}]}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + DataBoxEdgeManager manager = DataBoxEdgeManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + PagedIterable response + = manager.addons().listByRole("oauk", "fkvcisi", com.azure.core.util.Context.NONE); + + Assertions.assertEquals(AddonType.ARC_FOR_KUBERNETES, response.iterator().next().kind()); + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/ArmBaseModelTests.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/ArmBaseModelTests.java index b3432b9df817..9055e9aa8742 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/ArmBaseModelTests.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/ArmBaseModelTests.java @@ -1,23 +1,22 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.generated; import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.databoxedge.models.ArmBaseModel; +import com.azure.resourcemanager.databoxedge.models.ARMBaseModel; -public final class ArmBaseModelTests { +public final class ARMBaseModelTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - ArmBaseModel model - = BinaryData.fromString("{\"id\":\"npwlbjnpg\",\"name\":\"cftadeh\",\"type\":\"nltyfsoppusuesnz\"}") - .toObject(ArmBaseModel.class); + ARMBaseModel model = BinaryData.fromString("{\"id\":\"ah\",\"name\":\"jyzhpvgq\",\"type\":\"j\"}") + .toObject(ARMBaseModel.class); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - ArmBaseModel model = new ArmBaseModel(); - model = BinaryData.fromObject(model).toObject(ArmBaseModel.class); + ARMBaseModel model = new ARMBaseModel(); + model = BinaryData.fromObject(model).toObject(ARMBaseModel.class); } } diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/AsymmetricEncryptedSecretTests.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/AsymmetricEncryptedSecretTests.java index a06cfd4a95ca..d27fb5c5f2f4 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/AsymmetricEncryptedSecretTests.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/AsymmetricEncryptedSecretTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.generated; @@ -12,22 +12,23 @@ public final class AsymmetricEncryptedSecretTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - AsymmetricEncryptedSecret model = BinaryData.fromString( - "{\"value\":\"yhtozfikdowwqu\",\"encryptionCertThumbprint\":\"xzxcl\",\"encryptionAlgorithm\":\"RSAES_PKCS1_v_1_5\"}") + AsymmetricEncryptedSecret model = BinaryData + .fromString( + "{\"value\":\"nxipeil\",\"encryptionCertThumbprint\":\"zuaejxd\",\"encryptionAlgorithm\":\"AES256\"}") .toObject(AsymmetricEncryptedSecret.class); - Assertions.assertEquals("yhtozfikdowwqu", model.value()); - Assertions.assertEquals("xzxcl", model.encryptionCertThumbprint()); - Assertions.assertEquals(EncryptionAlgorithm.RSAES_PKCS1_V_1_5, model.encryptionAlgorithm()); + Assertions.assertEquals("nxipeil", model.value()); + Assertions.assertEquals("zuaejxd", model.encryptionCertThumbprint()); + Assertions.assertEquals(EncryptionAlgorithm.AES256, model.encryptionAlgorithm()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - AsymmetricEncryptedSecret model = new AsymmetricEncryptedSecret().withValue("yhtozfikdowwqu") - .withEncryptionCertThumbprint("xzxcl") - .withEncryptionAlgorithm(EncryptionAlgorithm.RSAES_PKCS1_V_1_5); + AsymmetricEncryptedSecret model = new AsymmetricEncryptedSecret().withValue("nxipeil") + .withEncryptionCertThumbprint("zuaejxd") + .withEncryptionAlgorithm(EncryptionAlgorithm.AES256); model = BinaryData.fromObject(model).toObject(AsymmetricEncryptedSecret.class); - Assertions.assertEquals("yhtozfikdowwqu", model.value()); - Assertions.assertEquals("xzxcl", model.encryptionCertThumbprint()); - Assertions.assertEquals(EncryptionAlgorithm.RSAES_PKCS1_V_1_5, model.encryptionAlgorithm()); + Assertions.assertEquals("nxipeil", model.value()); + Assertions.assertEquals("zuaejxd", model.encryptionCertThumbprint()); + Assertions.assertEquals(EncryptionAlgorithm.AES256, model.encryptionAlgorithm()); } } diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/AvailableSkusListWithResponseMockTests.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/AvailableSkusListWithResponseMockTests.java new file mode 100644 index 000000000000..a9bfd9cf1531 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/AvailableSkusListWithResponseMockTests.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.databoxedge.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.databoxedge.DataBoxEdgeManager; +import com.azure.resourcemanager.databoxedge.models.DataBoxEdgeSkuList; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class AvailableSkusListWithResponseMockTests { + @Test + public void testListWithResponse() throws Exception { + String responseStr + = "{\"value\":[{\"resourceType\":\"tgrqgdgkkile\",\"name\":\"TMA\",\"kind\":\"smk\",\"tier\":\"Standard\",\"size\":\"bbaedorvvm\",\"family\":\"loyg\",\"locations\":[\"wumgx\",\"gdhpabgdexjddv\",\"saq\"],\"apiVersions\":[\"mmwllc\"],\"locationInfo\":[{\"location\":\"sxap\",\"zones\":[\"hexcgjokj\"],\"sites\":[\"hv\",\"qjbek\",\"eeksnbksdqhjvyk\"]},{\"location\":\"eslk\",\"zones\":[\"stcpoqmavnwqjw\",\"o\"],\"sites\":[\"ejjjkxybwfdb\",\"jbzten\"]},{\"location\":\"kzykjtjk\",\"zones\":[\"fwushcdpkupn\",\"rmgjfbpkuwx\"],\"sites\":[\"ojfizfav\",\"jzwfb\",\"yay\",\"mmfz\"]}],\"costs\":[{\"meterId\":\"xrzxmdewsrsxkrp\",\"quantity\":5718306376150481311,\"extendedUnit\":\"ejwwviyoyps\"},{\"meterId\":\"brnnhjxsqw\",\"quantity\":6937576417289541897,\"extendedUnit\":\"iwetpoz\"},{\"meterId\":\"yqiq\",\"quantity\":7296407932612490220,\"extendedUnit\":\"etzlexbsfledynoj\"}],\"signupOption\":\"Available\",\"version\":\"Stable\",\"availability\":\"Available\",\"shipmentTypes\":[\"SelfPickup\",\"SelfPickup\",\"NotApplicable\"],\"capabilities\":[{\"name\":\"sycljsel\",\"value\":\"pbafvafhlbylc\"},{\"name\":\"evxrhyz\",\"value\":\"wrso\"},{\"name\":\"ltdb\",\"value\":\"irrhv\"}]},{\"resourceType\":\"nracw\",\"name\":\"TEA_4Node_Heater\",\"kind\":\"g\",\"tier\":\"Standard\",\"size\":\"wouhdawsi\",\"family\":\"bjb\",\"locations\":[\"ybvitvqkjyaznumt\",\"gmuwdchozfnkf\"],\"apiVersions\":[\"v\"],\"locationInfo\":[{\"location\":\"kizvoa\",\"zones\":[\"a\",\"lnuwiguy\"],\"sites\":[\"kwph\",\"xzcwxhmpejt\",\"ke\",\"aonwivkcqhrxh\"]},{\"location\":\"nlccrm\",\"zones\":[\"upijubyqjfkakfq\",\"rke\"],\"sites\":[\"ldudxjascowv\"]},{\"location\":\"jkpdxphlkksnm\",\"zones\":[\"yfijdkzuqnws\",\"thuqolyahluq\",\"qulsutrjbhxykfhy\"],\"sites\":[\"vqqugdrftbcv\",\"xreuquowtlj\",\"fwhreagkhyxv\",\"qtvbczsu\"]}],\"costs\":[{\"meterId\":\"glmep\",\"quantity\":1931367211750393447,\"extendedUnit\":\"ykgsangpszng\"},{\"meterId\":\"p\",\"quantity\":4814735082100975654,\"extendedUnit\":\"ecjujcng\"},{\"meterId\":\"dyedmzrgjfo\",\"quantity\":3257862909969904224,\"extendedUnit\":\"oitpkpztrgdgx\"}],\"signupOption\":\"Available\",\"version\":\"Preview\",\"availability\":\"Available\",\"shipmentTypes\":[\"SelfPickup\",\"SelfPickup\"],\"capabilities\":[{\"name\":\"itweialwvskbuh\",\"value\":\"caqt\"},{\"name\":\"tco\",\"value\":\"ujpdsxzak\"}]}],\"nextLink\":\"jkmvbi\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + DataBoxEdgeManager manager = DataBoxEdgeManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + DataBoxEdgeSkuList response + = manager.availableSkus().listWithResponse(com.azure.core.util.Context.NONE).getValue(); + + Assertions.assertEquals("jkmvbi", response.nextLink()); + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/BandwidthScheduleInnerTests.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/BandwidthScheduleInnerTests.java index 01bdcbf002d4..81928eba256f 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/BandwidthScheduleInnerTests.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/BandwidthScheduleInnerTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.generated; @@ -14,24 +14,24 @@ public final class BandwidthScheduleInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { BandwidthScheduleInner model = BinaryData.fromString( - "{\"properties\":{\"start\":\"ywqsmbsurexim\",\"stop\":\"ryocfsfksymdd\",\"rateInMbps\":830050857,\"days\":[\"Thursday\"]},\"id\":\"i\",\"name\":\"uxh\",\"type\":\"yudxorrqnbp\"}") + "{\"properties\":{\"start\":\"hjpglkf\",\"stop\":\"ohdneuel\",\"rateInMbps\":1976701075,\"days\":[\"Thursday\"]},\"id\":\"yhtozfikdowwqu\",\"name\":\"v\",\"type\":\"zx\"}") .toObject(BandwidthScheduleInner.class); - Assertions.assertEquals("ywqsmbsurexim", model.start()); - Assertions.assertEquals("ryocfsfksymdd", model.stop()); - Assertions.assertEquals(830050857, model.rateInMbps()); + Assertions.assertEquals("hjpglkf", model.start()); + Assertions.assertEquals("ohdneuel", model.stop()); + Assertions.assertEquals(1976701075, model.rateInMbps()); Assertions.assertEquals(DayOfWeek.THURSDAY, model.days().get(0)); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - BandwidthScheduleInner model = new BandwidthScheduleInner().withStart("ywqsmbsurexim") - .withStop("ryocfsfksymdd") - .withRateInMbps(830050857) + BandwidthScheduleInner model = new BandwidthScheduleInner().withStart("hjpglkf") + .withStop("ohdneuel") + .withRateInMbps(1976701075) .withDays(Arrays.asList(DayOfWeek.THURSDAY)); model = BinaryData.fromObject(model).toObject(BandwidthScheduleInner.class); - Assertions.assertEquals("ywqsmbsurexim", model.start()); - Assertions.assertEquals("ryocfsfksymdd", model.stop()); - Assertions.assertEquals(830050857, model.rateInMbps()); + Assertions.assertEquals("hjpglkf", model.start()); + Assertions.assertEquals("ohdneuel", model.stop()); + Assertions.assertEquals(1976701075, model.rateInMbps()); Assertions.assertEquals(DayOfWeek.THURSDAY, model.days().get(0)); } } diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/BandwidthSchedulePropertiesTests.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/BandwidthSchedulePropertiesTests.java index d59187d2e87f..071bbe576de4 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/BandwidthSchedulePropertiesTests.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/BandwidthSchedulePropertiesTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.generated; @@ -13,25 +13,25 @@ public final class BandwidthSchedulePropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - BandwidthScheduleProperties model = BinaryData - .fromString("{\"start\":\"czvyifq\",\"stop\":\"vkd\",\"rateInMbps\":1867018963,\"days\":[\"Sunday\"]}") + BandwidthScheduleProperties model = BinaryData.fromString( + "{\"start\":\"lvithhqzonosgg\",\"stop\":\"hcohfwdsjnk\",\"rateInMbps\":1077119628,\"days\":[\"Saturday\",\"Saturday\",\"Wednesday\"]}") .toObject(BandwidthScheduleProperties.class); - Assertions.assertEquals("czvyifq", model.start()); - Assertions.assertEquals("vkd", model.stop()); - Assertions.assertEquals(1867018963, model.rateInMbps()); - Assertions.assertEquals(DayOfWeek.SUNDAY, model.days().get(0)); + Assertions.assertEquals("lvithhqzonosgg", model.start()); + Assertions.assertEquals("hcohfwdsjnk", model.stop()); + Assertions.assertEquals(1077119628, model.rateInMbps()); + Assertions.assertEquals(DayOfWeek.SATURDAY, model.days().get(0)); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - BandwidthScheduleProperties model = new BandwidthScheduleProperties().withStart("czvyifq") - .withStop("vkd") - .withRateInMbps(1867018963) - .withDays(Arrays.asList(DayOfWeek.SUNDAY)); + BandwidthScheduleProperties model = new BandwidthScheduleProperties().withStart("lvithhqzonosgg") + .withStop("hcohfwdsjnk") + .withRateInMbps(1077119628) + .withDays(Arrays.asList(DayOfWeek.SATURDAY, DayOfWeek.SATURDAY, DayOfWeek.WEDNESDAY)); model = BinaryData.fromObject(model).toObject(BandwidthScheduleProperties.class); - Assertions.assertEquals("czvyifq", model.start()); - Assertions.assertEquals("vkd", model.stop()); - Assertions.assertEquals(1867018963, model.rateInMbps()); - Assertions.assertEquals(DayOfWeek.SUNDAY, model.days().get(0)); + Assertions.assertEquals("lvithhqzonosgg", model.start()); + Assertions.assertEquals("hcohfwdsjnk", model.stop()); + Assertions.assertEquals(1077119628, model.rateInMbps()); + Assertions.assertEquals(DayOfWeek.SATURDAY, model.days().get(0)); } } diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/BandwidthSchedulesCreateOrUpdateMockTests.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/BandwidthSchedulesCreateOrUpdateMockTests.java index 49e4f582ec22..f61d9cbd22f3 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/BandwidthSchedulesCreateOrUpdateMockTests.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/BandwidthSchedulesCreateOrUpdateMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.databoxedge.DataBoxEdgeManager; import com.azure.resourcemanager.databoxedge.models.BandwidthSchedule; @@ -23,27 +23,27 @@ public final class BandwidthSchedulesCreateOrUpdateMockTests { @Test public void testCreateOrUpdate() throws Exception { String responseStr - = "{\"properties\":{\"start\":\"vvbalx\",\"stop\":\"l\",\"rateInMbps\":677641870,\"days\":[\"Friday\",\"Monday\"]},\"id\":\"db\",\"name\":\"evwrdnhfuk\",\"type\":\"vsjcswsmystuluqy\"}"; + = "{\"properties\":{\"start\":\"fbsfarfsiow\",\"stop\":\"kjxnqpvwgfstmhq\",\"rateInMbps\":1391395953,\"days\":[\"Friday\",\"Friday\"]},\"id\":\"ksaoafcluqvox\",\"name\":\"ycjimryvwgcwwpbm\",\"type\":\"gwe\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); DataBoxEdgeManager manager = DataBoxEdgeManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); BandwidthSchedule response = manager.bandwidthSchedules() - .define("ayakkudzpx") - .withExistingDataBoxEdgeDevice("uwhcjyxccybv", "wjplma") - .withStart("stcyohpfkyrkdbd") - .withStop("iogsjkmnwq") - .withRateInMbps(1931292786) - .withDays(Arrays.asList(DayOfWeek.FRIDAY, DayOfWeek.TUESDAY, DayOfWeek.THURSDAY, DayOfWeek.FRIDAY)) + .define("qnbldxe") + .withExistingDataBoxEdgeDevice("ehqepvufhbzehe", "hoqhnl") + .withStart("clgsc") + .withStop("orim") + .withRateInMbps(1496521360) + .withDays(Arrays.asList(DayOfWeek.THURSDAY)) .create(); - Assertions.assertEquals("vvbalx", response.start()); - Assertions.assertEquals("l", response.stop()); - Assertions.assertEquals(677641870, response.rateInMbps()); + Assertions.assertEquals("fbsfarfsiow", response.start()); + Assertions.assertEquals("kjxnqpvwgfstmhq", response.stop()); + Assertions.assertEquals(1391395953, response.rateInMbps()); Assertions.assertEquals(DayOfWeek.FRIDAY, response.days().get(0)); } } diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/BandwidthSchedulesDeleteMockTests.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/BandwidthSchedulesDeleteMockTests.java index d3088d15f737..f2cad180424e 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/BandwidthSchedulesDeleteMockTests.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/BandwidthSchedulesDeleteMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.databoxedge.DataBoxEdgeManager; import java.nio.charset.StandardCharsets; @@ -25,10 +25,9 @@ public void testDelete() throws Exception { DataBoxEdgeManager manager = DataBoxEdgeManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - manager.bandwidthSchedules() - .delete("ordilmywwtkgkxny", "dabg", "vudtjuewbcihx", com.azure.core.util.Context.NONE); + manager.bandwidthSchedules().delete("hmwffplfmuv", "pckc", "rrvwey", com.azure.core.util.Context.NONE); } } diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/BandwidthSchedulesGetWithResponseMockTests.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/BandwidthSchedulesGetWithResponseMockTests.java index dd815ba48221..3b367dc329d5 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/BandwidthSchedulesGetWithResponseMockTests.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/BandwidthSchedulesGetWithResponseMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.databoxedge.DataBoxEdgeManager; import com.azure.resourcemanager.databoxedge.models.BandwidthSchedule; @@ -22,22 +22,22 @@ public final class BandwidthSchedulesGetWithResponseMockTests { @Test public void testGetWithResponse() throws Exception { String responseStr - = "{\"properties\":{\"start\":\"vscx\",\"stop\":\"dmligovibrxk\",\"rateInMbps\":1905790619,\"days\":[\"Monday\",\"Friday\",\"Tuesday\",\"Friday\"]},\"id\":\"ruocbgo\",\"name\":\"rb\",\"type\":\"eoybfhjxakvvjgs\"}"; + = "{\"properties\":{\"start\":\"tfgxqbawpcb\",\"stop\":\"nzqcy\",\"rateInMbps\":1128204552,\"days\":[\"Sunday\",\"Wednesday\",\"Tuesday\"]},\"id\":\"yuicdhzbdy\",\"name\":\"wwgbdv\",\"type\":\"bid\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); DataBoxEdgeManager manager = DataBoxEdgeManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); BandwidthSchedule response = manager.bandwidthSchedules() - .getWithResponse("azivjlfrqttbajl", "atnwxyiopi", "kqqfk", com.azure.core.util.Context.NONE) + .getWithResponse("op", "hbzxli", "hrdd", com.azure.core.util.Context.NONE) .getValue(); - Assertions.assertEquals("vscx", response.start()); - Assertions.assertEquals("dmligovibrxk", response.stop()); - Assertions.assertEquals(1905790619, response.rateInMbps()); - Assertions.assertEquals(DayOfWeek.MONDAY, response.days().get(0)); + Assertions.assertEquals("tfgxqbawpcb", response.start()); + Assertions.assertEquals("nzqcy", response.stop()); + Assertions.assertEquals(1128204552, response.rateInMbps()); + Assertions.assertEquals(DayOfWeek.SUNDAY, response.days().get(0)); } } diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/BandwidthSchedulesListByDataBoxEdgeDeviceMockTests.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/BandwidthSchedulesListByDataBoxEdgeDeviceMockTests.java index 1c6b81558a3e..92559cdcad14 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/BandwidthSchedulesListByDataBoxEdgeDeviceMockTests.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/BandwidthSchedulesListByDataBoxEdgeDeviceMockTests.java @@ -1,14 +1,14 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.databoxedge.DataBoxEdgeManager; import com.azure.resourcemanager.databoxedge.models.BandwidthSchedule; @@ -23,21 +23,21 @@ public final class BandwidthSchedulesListByDataBoxEdgeDeviceMockTests { @Test public void testListByDataBoxEdgeDevice() throws Exception { String responseStr - = "{\"value\":[{\"properties\":{\"start\":\"ttsttktlahbqact\",\"stop\":\"tgzukxitmmqt\",\"rateInMbps\":451636472,\"days\":[\"Friday\",\"Monday\",\"Sunday\"]},\"id\":\"rnxrxcpj\",\"name\":\"isavok\",\"type\":\"dzf\"}]}"; + = "{\"value\":[{\"properties\":{\"start\":\"oshbragapyy\",\"stop\":\"mfsvbpav\",\"rateInMbps\":1375116423,\"days\":[\"Friday\",\"Sunday\"]},\"id\":\"dbwnu\",\"name\":\"gahxkumasjcaa\",\"type\":\"fdmmcpug\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); DataBoxEdgeManager manager = DataBoxEdgeManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); PagedIterable response = manager.bandwidthSchedules() - .listByDataBoxEdgeDevice("youpfgfbkj", "bdyhgkfminsgowz", com.azure.core.util.Context.NONE); + .listByDataBoxEdgeDevice("xoy", "ukphaimmoiroq", com.azure.core.util.Context.NONE); - Assertions.assertEquals("ttsttktlahbqact", response.iterator().next().start()); - Assertions.assertEquals("tgzukxitmmqt", response.iterator().next().stop()); - Assertions.assertEquals(451636472, response.iterator().next().rateInMbps()); + Assertions.assertEquals("oshbragapyy", response.iterator().next().start()); + Assertions.assertEquals("mfsvbpav", response.iterator().next().stop()); + Assertions.assertEquals(1375116423, response.iterator().next().rateInMbps()); Assertions.assertEquals(DayOfWeek.FRIDAY, response.iterator().next().days().get(0)); } } diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/BandwidthSchedulesListTests.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/BandwidthSchedulesListTests.java index bbdd068421d1..d7372b820f6f 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/BandwidthSchedulesListTests.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/BandwidthSchedulesListTests.java @@ -1,23 +1,24 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.generated; import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.databoxedge.models.BandwidthSchedulesList; +import com.azure.resourcemanager.databoxedge.implementation.models.BandwidthSchedulesList; +import com.azure.resourcemanager.databoxedge.models.DayOfWeek; +import org.junit.jupiter.api.Assertions; public final class BandwidthSchedulesListTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { BandwidthSchedulesList model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"start\":\"eupfhyhltrpm\",\"stop\":\"pjmcmatuokthfuiu\",\"rateInMbps\":1958511129,\"days\":[\"Tuesday\",\"Thursday\",\"Thursday\",\"Sunday\"]},\"id\":\"kvxod\",\"name\":\"uozmyzydagfua\",\"type\":\"bezy\"}],\"nextLink\":\"okktwhrdxw\"}") + "{\"value\":[{\"properties\":{\"start\":\"swacffgdkzz\",\"stop\":\"wkfvhqcrailvp\",\"rateInMbps\":1397416306,\"days\":[\"Tuesday\",\"Sunday\"]},\"id\":\"lrwdmhdlxyj\",\"name\":\"xsaga\",\"type\":\"cnihgwqapnedgfbc\"},{\"properties\":{\"start\":\"kcvqvpke\",\"stop\":\"dcvd\",\"rateInMbps\":1258366887,\"days\":[\"Wednesday\"]},\"id\":\"dsotbobzd\",\"name\":\"pcjwv\",\"type\":\"hdldwmgxcxrsl\"}],\"nextLink\":\"utwu\"}") .toObject(BandwidthSchedulesList.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - BandwidthSchedulesList model = new BandwidthSchedulesList(); - model = BinaryData.fromObject(model).toObject(BandwidthSchedulesList.class); + Assertions.assertEquals("swacffgdkzz", model.value().get(0).start()); + Assertions.assertEquals("wkfvhqcrailvp", model.value().get(0).stop()); + Assertions.assertEquals(1397416306, model.value().get(0).rateInMbps()); + Assertions.assertEquals(DayOfWeek.TUESDAY, model.value().get(0).days().get(0)); + Assertions.assertEquals("utwu", model.nextLink()); } } diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/ClientAccessRightTests.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/ClientAccessRightTests.java index a8b5fd549603..32d6012562f3 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/ClientAccessRightTests.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/ClientAccessRightTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.generated; @@ -12,18 +12,18 @@ public final class ClientAccessRightTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - ClientAccessRight model = BinaryData.fromString("{\"client\":\"q\",\"accessPermission\":\"NoAccess\"}") + ClientAccessRight model = BinaryData.fromString("{\"client\":\"pofncck\",\"accessPermission\":\"ReadWrite\"}") .toObject(ClientAccessRight.class); - Assertions.assertEquals("q", model.client()); - Assertions.assertEquals(ClientPermissionType.NO_ACCESS, model.accessPermission()); + Assertions.assertEquals("pofncck", model.client()); + Assertions.assertEquals(ClientPermissionType.READ_WRITE, model.accessPermission()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { ClientAccessRight model - = new ClientAccessRight().withClient("q").withAccessPermission(ClientPermissionType.NO_ACCESS); + = new ClientAccessRight().withClient("pofncck").withAccessPermission(ClientPermissionType.READ_WRITE); model = BinaryData.fromObject(model).toObject(ClientAccessRight.class); - Assertions.assertEquals("q", model.client()); - Assertions.assertEquals(ClientPermissionType.NO_ACCESS, model.accessPermission()); + Assertions.assertEquals("pofncck", model.client()); + Assertions.assertEquals(ClientPermissionType.READ_WRITE, model.accessPermission()); } } diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/ClusterCapacityViewDataTests.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/ClusterCapacityViewDataTests.java new file mode 100644 index 000000000000..8c3a305c1538 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/ClusterCapacityViewDataTests.java @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.databoxedge.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.databoxedge.models.ClusterCapacityViewData; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; + +public final class ClusterCapacityViewDataTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ClusterCapacityViewData model = BinaryData.fromString( + "{\"fqdn\":\"fzg\",\"gpuCapacity\":{\"gpuType\":\"dftuljltduce\",\"gpuUsedUnitsCount\":1779259768,\"gpuFreeUnitsCount\":654358924,\"gpuReservedForFailoverUnitsCount\":128848719,\"gpuTotalUnitsCount\":61901401},\"memoryCapacity\":{\"clusterFreeMemoryMb\":17.088446706382086,\"clusterUsedMemoryMb\":26.958211811248578,\"clusterFailoverMemoryMb\":95.99427661348027,\"clusterFragmentationMemoryMb\":49.13286281669323,\"clusterHypervReserveMemoryMb\":86.40250544808026,\"clusterInfraVmMemoryMb\":49.64402478184626,\"clusterTotalMemoryMb\":4.613474543765273,\"clusterNonFailoverVmMb\":99.08143470377058,\"clusterMemoryUsedByVmsMb\":22.521714326596264},\"lastRefreshedTime\":\"2021-06-26T08:15:06Z\",\"totalProvisionedNonHpnCores\":1480619686506097788}") + .toObject(ClusterCapacityViewData.class); + Assertions.assertEquals("fzg", model.fqdn()); + Assertions.assertEquals("dftuljltduce", model.gpuCapacity().gpuType()); + Assertions.assertEquals(1779259768, model.gpuCapacity().gpuUsedUnitsCount()); + Assertions.assertEquals(654358924, model.gpuCapacity().gpuFreeUnitsCount()); + Assertions.assertEquals(128848719, model.gpuCapacity().gpuReservedForFailoverUnitsCount()); + Assertions.assertEquals(61901401, model.gpuCapacity().gpuTotalUnitsCount()); + Assertions.assertEquals(17.088446706382086D, model.memoryCapacity().clusterFreeMemoryMb()); + Assertions.assertEquals(26.958211811248578D, model.memoryCapacity().clusterUsedMemoryMb()); + Assertions.assertEquals(95.99427661348027D, model.memoryCapacity().clusterFailoverMemoryMb()); + Assertions.assertEquals(49.13286281669323D, model.memoryCapacity().clusterFragmentationMemoryMb()); + Assertions.assertEquals(86.40250544808026D, model.memoryCapacity().clusterHypervReserveMemoryMb()); + Assertions.assertEquals(49.64402478184626D, model.memoryCapacity().clusterInfraVmMemoryMb()); + Assertions.assertEquals(4.613474543765273D, model.memoryCapacity().clusterTotalMemoryMb()); + Assertions.assertEquals(99.08143470377058D, model.memoryCapacity().clusterNonFailoverVmMb()); + Assertions.assertEquals(22.521714326596264D, model.memoryCapacity().clusterMemoryUsedByVmsMb()); + Assertions.assertEquals(OffsetDateTime.parse("2021-06-26T08:15:06Z"), model.lastRefreshedTime()); + Assertions.assertEquals(1480619686506097788L, model.totalProvisionedNonHpnCores()); + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/ClusterGpuCapacityTests.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/ClusterGpuCapacityTests.java new file mode 100644 index 000000000000..fc3903610bd9 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/ClusterGpuCapacityTests.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.databoxedge.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.databoxedge.models.ClusterGpuCapacity; +import org.junit.jupiter.api.Assertions; + +public final class ClusterGpuCapacityTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ClusterGpuCapacity model = BinaryData.fromString( + "{\"gpuType\":\"yxgtczh\",\"gpuUsedUnitsCount\":1722960093,\"gpuFreeUnitsCount\":1160079835,\"gpuReservedForFailoverUnitsCount\":1835924775,\"gpuTotalUnitsCount\":36372091}") + .toObject(ClusterGpuCapacity.class); + Assertions.assertEquals("yxgtczh", model.gpuType()); + Assertions.assertEquals(1722960093, model.gpuUsedUnitsCount()); + Assertions.assertEquals(1160079835, model.gpuFreeUnitsCount()); + Assertions.assertEquals(1835924775, model.gpuReservedForFailoverUnitsCount()); + Assertions.assertEquals(36372091, model.gpuTotalUnitsCount()); + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/ClusterMemoryCapacityTests.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/ClusterMemoryCapacityTests.java new file mode 100644 index 000000000000..4b5cd631faa5 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/ClusterMemoryCapacityTests.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.databoxedge.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.databoxedge.models.ClusterMemoryCapacity; +import org.junit.jupiter.api.Assertions; + +public final class ClusterMemoryCapacityTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ClusterMemoryCapacity model = BinaryData.fromString( + "{\"clusterFreeMemoryMb\":57.062896632209224,\"clusterUsedMemoryMb\":60.72724740263716,\"clusterFailoverMemoryMb\":47.19244293398387,\"clusterFragmentationMemoryMb\":69.97191958388443,\"clusterHypervReserveMemoryMb\":56.197621976688374,\"clusterInfraVmMemoryMb\":74.24471083845161,\"clusterTotalMemoryMb\":28.865796638385177,\"clusterNonFailoverVmMb\":2.468936693555146,\"clusterMemoryUsedByVmsMb\":19.9056243251302}") + .toObject(ClusterMemoryCapacity.class); + Assertions.assertEquals(57.062896632209224D, model.clusterFreeMemoryMb()); + Assertions.assertEquals(60.72724740263716D, model.clusterUsedMemoryMb()); + Assertions.assertEquals(47.19244293398387D, model.clusterFailoverMemoryMb()); + Assertions.assertEquals(69.97191958388443D, model.clusterFragmentationMemoryMb()); + Assertions.assertEquals(56.197621976688374D, model.clusterHypervReserveMemoryMb()); + Assertions.assertEquals(74.24471083845161D, model.clusterInfraVmMemoryMb()); + Assertions.assertEquals(28.865796638385177D, model.clusterTotalMemoryMb()); + Assertions.assertEquals(2.468936693555146D, model.clusterNonFailoverVmMb()); + Assertions.assertEquals(19.9056243251302D, model.clusterMemoryUsedByVmsMb()); + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/ClusterStorageViewDataTests.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/ClusterStorageViewDataTests.java new file mode 100644 index 000000000000..f614ed623656 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/ClusterStorageViewDataTests.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.databoxedge.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.databoxedge.models.ClusterStorageViewData; +import org.junit.jupiter.api.Assertions; + +public final class ClusterStorageViewDataTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ClusterStorageViewData model = BinaryData + .fromString("{\"clusterTotalStorageMb\":0.046019210800951615,\"clusterFreeStorageMb\":43.280069551195545}") + .toObject(ClusterStorageViewData.class); + Assertions.assertEquals(0.046019210800951615D, model.clusterTotalStorageMb()); + Assertions.assertEquals(43.280069551195545D, model.clusterFreeStorageMb()); + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/ContactDetailsTests.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/ContactDetailsTests.java index 48dbede99cd0..605b7c357877 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/ContactDetailsTests.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/ContactDetailsTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.generated; @@ -13,24 +13,24 @@ public final class ContactDetailsTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ContactDetails model = BinaryData.fromString( - "{\"contactPerson\":\"lfmmdnbbglzpswi\",\"companyName\":\"d\",\"phone\":\"cwyhzdxssa\",\"emailList\":[\"zmnvdfznudaod\",\"xzb\",\"cblylpstdbhhxsr\"]}") + "{\"contactPerson\":\"gsyocogj\",\"companyName\":\"tdtbnnhadooc\",\"phone\":\"kvci\",\"emailList\":[\"nvpamq\",\"x\",\"queziky\"]}") .toObject(ContactDetails.class); - Assertions.assertEquals("lfmmdnbbglzpswi", model.contactPerson()); - Assertions.assertEquals("d", model.companyName()); - Assertions.assertEquals("cwyhzdxssa", model.phone()); - Assertions.assertEquals("zmnvdfznudaod", model.emailList().get(0)); + Assertions.assertEquals("gsyocogj", model.contactPerson()); + Assertions.assertEquals("tdtbnnhadooc", model.companyName()); + Assertions.assertEquals("kvci", model.phone()); + Assertions.assertEquals("nvpamq", model.emailList().get(0)); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - ContactDetails model = new ContactDetails().withContactPerson("lfmmdnbbglzpswi") - .withCompanyName("d") - .withPhone("cwyhzdxssa") - .withEmailList(Arrays.asList("zmnvdfznudaod", "xzb", "cblylpstdbhhxsr")); + ContactDetails model = new ContactDetails().withContactPerson("gsyocogj") + .withCompanyName("tdtbnnhadooc") + .withPhone("kvci") + .withEmailList(Arrays.asList("nvpamq", "x", "queziky")); model = BinaryData.fromObject(model).toObject(ContactDetails.class); - Assertions.assertEquals("lfmmdnbbglzpswi", model.contactPerson()); - Assertions.assertEquals("d", model.companyName()); - Assertions.assertEquals("cwyhzdxssa", model.phone()); - Assertions.assertEquals("zmnvdfznudaod", model.emailList().get(0)); + Assertions.assertEquals("gsyocogj", model.contactPerson()); + Assertions.assertEquals("tdtbnnhadooc", model.companyName()); + Assertions.assertEquals("kvci", model.phone()); + Assertions.assertEquals("nvpamq", model.emailList().get(0)); } } diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/ContainerInnerTests.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/ContainerInnerTests.java index f974bd9867fc..da14a8954969 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/ContainerInnerTests.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/ContainerInnerTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.generated; @@ -13,15 +13,15 @@ public final class ContainerInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ContainerInner model = BinaryData.fromString( - "{\"properties\":{\"containerStatus\":\"Offline\",\"dataFormat\":\"PageBlob\",\"refreshDetails\":{\"inProgressRefreshJobId\":\"rwlqu\",\"lastCompletedRefreshJobTimeInUTC\":\"2021-04-01T07:49:28Z\",\"errorManifestFile\":\"qkacewii\",\"lastJob\":\"pubjibw\"},\"createdDateTime\":\"2021-02-08T13:33:20Z\"},\"id\":\"tohqkvpuvksgp\",\"name\":\"saknynfsyn\",\"type\":\"jphuopxodlqi\"}") + "{\"properties\":{\"containerStatus\":\"Updating\",\"dataFormat\":\"BlockBlob\",\"refreshDetails\":{\"inProgressRefreshJobId\":\"whkszzcmrvexztvb\",\"lastCompletedRefreshJobTimeInUTC\":\"2021-01-01T05:45:24Z\",\"errorManifestFile\":\"frao\",\"lastJob\":\"koowtl\"},\"createdDateTime\":\"2021-11-23T22:05:35Z\"},\"id\":\"xawqaldsyuuxim\",\"name\":\"rqf\",\"type\":\"bw\"}") .toObject(ContainerInner.class); - Assertions.assertEquals(AzureContainerDataFormat.PAGE_BLOB, model.dataFormat()); + Assertions.assertEquals(AzureContainerDataFormat.BLOCK_BLOB, model.dataFormat()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - ContainerInner model = new ContainerInner().withDataFormat(AzureContainerDataFormat.PAGE_BLOB); + ContainerInner model = new ContainerInner().withDataFormat(AzureContainerDataFormat.BLOCK_BLOB); model = BinaryData.fromObject(model).toObject(ContainerInner.class); - Assertions.assertEquals(AzureContainerDataFormat.PAGE_BLOB, model.dataFormat()); + Assertions.assertEquals(AzureContainerDataFormat.BLOCK_BLOB, model.dataFormat()); } } diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/ContainerListTests.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/ContainerListTests.java index 358c5d876ee7..f3f3771838e4 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/ContainerListTests.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/ContainerListTests.java @@ -1,23 +1,21 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.generated; import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.databoxedge.models.ContainerList; +import com.azure.resourcemanager.databoxedge.implementation.models.ContainerList; +import com.azure.resourcemanager.databoxedge.models.AzureContainerDataFormat; +import org.junit.jupiter.api.Assertions; public final class ContainerListTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ContainerList model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"containerStatus\":\"Offline\",\"dataFormat\":\"PageBlob\",\"refreshDetails\":{\"inProgressRefreshJobId\":\"iwbwoenwashrtdtk\",\"lastCompletedRefreshJobTimeInUTC\":\"2021-03-26T12:56:23Z\",\"errorManifestFile\":\"wbpokulpiujwaasi\",\"lastJob\":\"i\"},\"createdDateTime\":\"2021-09-26T03:40:24Z\"},\"id\":\"yuq\",\"name\":\"rpqlp\",\"type\":\"wcciuqgbdbu\"},{\"properties\":{\"containerStatus\":\"Updating\",\"dataFormat\":\"AzureFile\",\"refreshDetails\":{\"inProgressRefreshJobId\":\"tkuwhhmhykojo\",\"lastCompletedRefreshJobTimeInUTC\":\"2021-10-11T05:43:38Z\",\"errorManifestFile\":\"nd\",\"lastJob\":\"ichkoymkcdyhb\"},\"createdDateTime\":\"2021-01-04T13:26:20Z\"},\"id\":\"pwdreqnovvqf\",\"name\":\"vljxywsu\",\"type\":\"syrsndsytgadgvra\"}],\"nextLink\":\"en\"}") + "{\"value\":[{\"properties\":{\"containerStatus\":\"Offline\",\"dataFormat\":\"AzureFile\",\"refreshDetails\":{\"inProgressRefreshJobId\":\"dlhewp\",\"lastCompletedRefreshJobTimeInUTC\":\"2021-03-10T22:25:44Z\",\"errorManifestFile\":\"ttwvogvbbe\",\"lastJob\":\"cngqqmoakufgmjz\"},\"createdDateTime\":\"2021-09-27T05:33:50Z\"},\"id\":\"grtwae\",\"name\":\"u\",\"type\":\"zkopb\"},{\"properties\":{\"containerStatus\":\"Unknown\",\"dataFormat\":\"PageBlob\",\"refreshDetails\":{\"inProgressRefreshJobId\":\"woyuhhziuief\",\"lastCompletedRefreshJobTimeInUTC\":\"2021-07-08T23:31:43Z\",\"errorManifestFile\":\"dmsmlm\",\"lastJob\":\"hoftr\"},\"createdDateTime\":\"2021-11-16T17:43:34Z\"},\"id\":\"u\",\"name\":\"ah\",\"type\":\"icslfaoq\"},{\"properties\":{\"containerStatus\":\"OK\",\"dataFormat\":\"BlockBlob\",\"refreshDetails\":{\"inProgressRefreshJobId\":\"halns\",\"lastCompletedRefreshJobTimeInUTC\":\"2021-10-08T04:07:45Z\",\"errorManifestFile\":\"sp\",\"lastJob\":\"aivwitqscywu\"},\"createdDateTime\":\"2021-10-03T06:29:22Z\"},\"id\":\"luhczbw\",\"name\":\"mhairsbrgzdwmsw\",\"type\":\"ypqwdxggiccc\"}],\"nextLink\":\"qhuexm\"}") .toObject(ContainerList.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ContainerList model = new ContainerList(); - model = BinaryData.fromObject(model).toObject(ContainerList.class); + Assertions.assertEquals(AzureContainerDataFormat.AZURE_FILE, model.value().get(0).dataFormat()); + Assertions.assertEquals("qhuexm", model.nextLink()); } } diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/ContainerPropertiesTests.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/ContainerPropertiesTests.java index 152474a8cdb4..4c1b5cf0a2f4 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/ContainerPropertiesTests.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/ContainerPropertiesTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.generated; @@ -13,15 +13,15 @@ public final class ContainerPropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ContainerProperties model = BinaryData.fromString( - "{\"containerStatus\":\"Updating\",\"dataFormat\":\"AzureFile\",\"refreshDetails\":{\"inProgressRefreshJobId\":\"ihleos\",\"lastCompletedRefreshJobTimeInUTC\":\"2021-11-21T17:53:40Z\",\"errorManifestFile\":\"rmslyzrpzbchckqq\",\"lastJob\":\"ioxiysuiizyn\"},\"createdDateTime\":\"2021-11-05T22:15:28Z\"}") + "{\"containerStatus\":\"Offline\",\"dataFormat\":\"PageBlob\",\"refreshDetails\":{\"inProgressRefreshJobId\":\"kutwpf\",\"lastCompletedRefreshJobTimeInUTC\":\"2021-10-22T08:31:17Z\",\"errorManifestFile\":\"m\",\"lastJob\":\"skdsnfdsdoakg\"},\"createdDateTime\":\"2021-11-05T14:44:19Z\"}") .toObject(ContainerProperties.class); - Assertions.assertEquals(AzureContainerDataFormat.AZURE_FILE, model.dataFormat()); + Assertions.assertEquals(AzureContainerDataFormat.PAGE_BLOB, model.dataFormat()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - ContainerProperties model = new ContainerProperties().withDataFormat(AzureContainerDataFormat.AZURE_FILE); + ContainerProperties model = new ContainerProperties().withDataFormat(AzureContainerDataFormat.PAGE_BLOB); model = BinaryData.fromObject(model).toObject(ContainerProperties.class); - Assertions.assertEquals(AzureContainerDataFormat.AZURE_FILE, model.dataFormat()); + Assertions.assertEquals(AzureContainerDataFormat.PAGE_BLOB, model.dataFormat()); } } diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/ContainersCreateOrUpdateMockTests.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/ContainersCreateOrUpdateMockTests.java index 1cb1bb6f90db..0297f02574e0 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/ContainersCreateOrUpdateMockTests.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/ContainersCreateOrUpdateMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.databoxedge.DataBoxEdgeManager; import com.azure.resourcemanager.databoxedge.models.AzureContainerDataFormat; @@ -22,21 +22,21 @@ public final class ContainersCreateOrUpdateMockTests { @Test public void testCreateOrUpdate() throws Exception { String responseStr - = "{\"properties\":{\"containerStatus\":\"NeedsAttention\",\"dataFormat\":\"AzureFile\",\"refreshDetails\":{\"inProgressRefreshJobId\":\"eexavo\",\"lastCompletedRefreshJobTimeInUTC\":\"2021-01-11T06:40:13Z\",\"errorManifestFile\":\"lecdmdqbw\",\"lastJob\":\"pqtgsfjac\"},\"createdDateTime\":\"2021-12-08T10:07:16Z\"},\"id\":\"hhxud\",\"name\":\"xvodhtnsir\",\"type\":\"dhzmmesckdlp\"}"; + = "{\"properties\":{\"containerStatus\":\"Unknown\",\"dataFormat\":\"PageBlob\",\"refreshDetails\":{\"inProgressRefreshJobId\":\"tuovmaonurj\",\"lastCompletedRefreshJobTimeInUTC\":\"2021-09-10T23:43:46Z\",\"errorManifestFile\":\"hihpvecmsl\",\"lastJob\":\"bl\"},\"createdDateTime\":\"2021-05-31T14:15:41Z\"},\"id\":\"tbsjuscvsf\",\"name\":\"igctmgxuupbezq\",\"type\":\"cydrtceukdqkk\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); DataBoxEdgeManager manager = DataBoxEdgeManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); Container response = manager.containers() - .define("ktp") - .withExistingStorageAccount("svxeizzgwklnsr", "ffeycx", "ymerteeammxq") + .define("fhzbkr") + .withExistingStorageAccount("ecvo", "ygzyvneezaifght", "oqqtl") .withDataFormat(AzureContainerDataFormat.BLOCK_BLOB) .create(); - Assertions.assertEquals(AzureContainerDataFormat.AZURE_FILE, response.dataFormat()); + Assertions.assertEquals(AzureContainerDataFormat.PAGE_BLOB, response.dataFormat()); } } diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/ContainersGetWithResponseMockTests.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/ContainersGetWithResponseMockTests.java index 5398a7e69012..2cc98bb58966 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/ContainersGetWithResponseMockTests.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/ContainersGetWithResponseMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.databoxedge.DataBoxEdgeManager; import com.azure.resourcemanager.databoxedge.models.AzureContainerDataFormat; @@ -22,19 +22,19 @@ public final class ContainersGetWithResponseMockTests { @Test public void testGetWithResponse() throws Exception { String responseStr - = "{\"properties\":{\"containerStatus\":\"OK\",\"dataFormat\":\"PageBlob\",\"refreshDetails\":{\"inProgressRefreshJobId\":\"sidxasicdd\",\"lastCompletedRefreshJobTimeInUTC\":\"2021-03-22T17:01:19Z\",\"errorManifestFile\":\"skgfmocwahpq\",\"lastJob\":\"tjeaahhvjhh\"},\"createdDateTime\":\"2021-11-24T03:40:22Z\"},\"id\":\"zybbj\",\"name\":\"idjks\",\"type\":\"xkyxvxevblbj\"}"; + = "{\"properties\":{\"containerStatus\":\"Updating\",\"dataFormat\":\"AzureFile\",\"refreshDetails\":{\"inProgressRefreshJobId\":\"erctatoyin\",\"lastCompletedRefreshJobTimeInUTC\":\"2021-05-21T11:47:32Z\",\"errorManifestFile\":\"rlcyrduc\",\"lastJob\":\"go\"},\"createdDateTime\":\"2021-11-27T20:49:29Z\"},\"id\":\"srucvcrrpcjtt\",\"name\":\"st\",\"type\":\"jeaq\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); DataBoxEdgeManager manager = DataBoxEdgeManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); Container response = manager.containers() - .getWithResponse("lwigdivbkbx", "omfaj", "wasqvdaeyyg", "xakjsqzhzb", com.azure.core.util.Context.NONE) + .getWithResponse("qipir", "iwrqofulopmjnl", "x", "hcbjpibk", com.azure.core.util.Context.NONE) .getValue(); - Assertions.assertEquals(AzureContainerDataFormat.PAGE_BLOB, response.dataFormat()); + Assertions.assertEquals(AzureContainerDataFormat.AZURE_FILE, response.dataFormat()); } } diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/ContainersListByStorageAccountMockTests.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/ContainersListByStorageAccountMockTests.java index a6870e5d8cce..e9d3c3c1f67e 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/ContainersListByStorageAccountMockTests.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/ContainersListByStorageAccountMockTests.java @@ -1,14 +1,14 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.databoxedge.DataBoxEdgeManager; import com.azure.resourcemanager.databoxedge.models.AzureContainerDataFormat; @@ -23,17 +23,18 @@ public final class ContainersListByStorageAccountMockTests { @Test public void testListByStorageAccount() throws Exception { String responseStr - = "{\"value\":[{\"properties\":{\"containerStatus\":\"Unknown\",\"dataFormat\":\"BlockBlob\",\"refreshDetails\":{\"inProgressRefreshJobId\":\"pmyyefrpmpdnqq\",\"lastCompletedRefreshJobTimeInUTC\":\"2021-04-07T23:14:44Z\",\"errorManifestFile\":\"ao\",\"lastJob\":\"mmbnpqfrtql\"},\"createdDateTime\":\"2021-08-01T20:31:37Z\"},\"id\":\"egnitg\",\"name\":\"kxlzyqdrfeg\",\"type\":\"ealzxwhcansymoyq\"}]}"; + = "{\"value\":[{\"properties\":{\"containerStatus\":\"Offline\",\"dataFormat\":\"BlockBlob\",\"refreshDetails\":{\"inProgressRefreshJobId\":\"ivensrpmeyyvpk\",\"lastCompletedRefreshJobTimeInUTC\":\"2021-07-28T16:53:22Z\",\"errorManifestFile\":\"bijpzgsksrfh\",\"lastJob\":\"olmk\"},\"createdDateTime\":\"2021-04-18T05:57:01Z\"},\"id\":\"wcdommpvfqaw\",\"name\":\"fgbrtt\",\"type\":\"iac\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); DataBoxEdgeManager manager = DataBoxEdgeManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); PagedIterable response = manager.containers() - .listByStorageAccount("oyzunbixxr", "ikvcpwp", "clrcivtsox", com.azure.core.util.Context.NONE); + .listByStorageAccount("rmvvfkoxmlghktui", "vrmazlpdwwexymzv", "azipbhpwvqsg", + com.azure.core.util.Context.NONE); Assertions.assertEquals(AzureContainerDataFormat.BLOCK_BLOB, response.iterator().next().dataFormat()); } diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/ContainersRefreshMockTests.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/ContainersRefreshMockTests.java index 82c959bbb8b6..f5bedf0273f8 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/ContainersRefreshMockTests.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/ContainersRefreshMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.databoxedge.DataBoxEdgeManager; import java.nio.charset.StandardCharsets; @@ -25,9 +25,10 @@ public void testRefresh() throws Exception { DataBoxEdgeManager manager = DataBoxEdgeManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - manager.containers().refresh("dnlj", "age", "aulx", "nsmjbnkppxynen", com.azure.core.util.Context.NONE); + manager.containers() + .refresh("kiexhajlfnthiq", "yuttdiygbpvnwswm", "xkyctwwgzwx", "l", com.azure.core.util.Context.NONE); } } diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/DataBoxEdgeDeviceInnerTests.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/DataBoxEdgeDeviceInnerTests.java index 5a3a9fbd87e7..9c0cff505a31 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/DataBoxEdgeDeviceInnerTests.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/DataBoxEdgeDeviceInnerTests.java @@ -1,12 +1,15 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.generated; import com.azure.core.util.BinaryData; import com.azure.resourcemanager.databoxedge.fluent.models.DataBoxEdgeDeviceInner; -import com.azure.resourcemanager.databoxedge.models.DataBoxEdgeDeviceStatus; +import com.azure.resourcemanager.databoxedge.models.DataResidency; +import com.azure.resourcemanager.databoxedge.models.DataResidencyType; +import com.azure.resourcemanager.databoxedge.models.MsiIdentityType; +import com.azure.resourcemanager.databoxedge.models.ResourceIdentity; import com.azure.resourcemanager.databoxedge.models.Sku; import com.azure.resourcemanager.databoxedge.models.SkuName; import com.azure.resourcemanager.databoxedge.models.SkuTier; @@ -18,39 +21,34 @@ public final class DataBoxEdgeDeviceInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { DataBoxEdgeDeviceInner model = BinaryData.fromString( - "{\"location\":\"ghmewuam\",\"tags\":{\"t\":\"rzayv\",\"ln\":\"gvdfgiotkftutq\",\"qmi\":\"xlefgugnxkrx\",\"abhjybi\":\"tthzrvqd\"},\"sku\":{\"name\":\"Edge\",\"tier\":\"Standard\"},\"etag\":\"owskanyktz\",\"properties\":{\"dataBoxEdgeDeviceStatus\":\"NeedsAttention\",\"serialNumber\":\"wgqyw\",\"description\":\"drvyn\",\"modelDescription\":\"gpphrcgyn\",\"deviceType\":\"DataBoxEdgeDevice\",\"friendlyName\":\"ecfvmm\",\"culture\":\"ofsx\",\"deviceModel\":\"evgbmqjq\",\"deviceSoftwareVersion\":\"c\",\"deviceLocalCapacity\":2539087817926802481,\"timeZone\":\"kwlzuvccfwnfn\",\"deviceHcsVersion\":\"cfionl\",\"configuredRoleTypes\":[\"Functions\"],\"nodeCount\":1013324715},\"id\":\"gtzxdpn\",\"name\":\"bqqwxrj\",\"type\":\"eallnwsubisnj\"}") + "{\"properties\":{\"dataBoxEdgeDeviceStatus\":\"Online\",\"serialNumber\":\"s\",\"description\":\"y\",\"modelDescription\":\"kbfkg\",\"deviceType\":\"DataBoxEdgeDevice\",\"friendlyName\":\"exxppofmxaxcfjp\",\"culture\":\"dtocj\",\"deviceModel\":\"hvpmoue\",\"deviceSoftwareVersion\":\"dzxibqeojnxqbzvd\",\"deviceLocalCapacity\":808595757398499551,\"timeZone\":\"deicbtwnpzao\",\"deviceHcsVersion\":\"uhrhcffcyddgl\",\"configuredRoleTypes\":[\"CloudEdgeManagement\"],\"nodeCount\":1041112743,\"resourceMoveDetails\":{\"operationInProgress\":\"ResourceMoveFailed\",\"operationInProgressLockTimeoutInUTC\":\"2021-11-24T17:43:24Z\"},\"edgeProfile\":{\"subscription\":{\"registrationId\":\"mqc\",\"id\":\"q\",\"state\":\"Registered\",\"registrationDate\":\"ixuigdtopbobj\",\"subscriptionId\":\"hm\",\"properties\":{\"tenantId\":\"a\",\"locationPlacementId\":\"uhrzayvvt\",\"quotaId\":\"vdfgiotk\",\"serializedDetails\":\"utqxlngx\",\"registeredFeatures\":[{},{},{},{}]}}},\"dataResidency\":{\"type\":\"ZoneReplication\"},\"kubernetesWorkloadProfile\":\"xkrxdqmi\"},\"sku\":{\"name\":\"EdgePR_Base\",\"tier\":\"Standard\"},\"etag\":\"qdrabhjybigehoqf\",\"identity\":{\"type\":\"UserAssigned\",\"principalId\":\"anyktzlcuiywg\",\"tenantId\":\"wgndrvynhzgpp\"},\"kind\":\"AzureStackHub\",\"location\":\"yncocpecfvmmcoo\",\"tags\":{\"y\":\"lzevgbmqjqab\",\"wnfnbacf\":\"mivkwlzuvcc\",\"bqqwxrj\":\"onlebxetqgtzxdpn\",\"mpmngnzscxaqwoo\":\"eallnwsubisnj\"},\"id\":\"hcbonqvpkvlr\",\"name\":\"njeaseipheofloke\",\"type\":\"y\"}") .toObject(DataBoxEdgeDeviceInner.class); - Assertions.assertEquals("ghmewuam", model.location()); - Assertions.assertEquals("rzayv", model.tags().get("t")); - Assertions.assertEquals(SkuName.EDGE, model.sku().name()); + Assertions.assertEquals("yncocpecfvmmcoo", model.location()); + Assertions.assertEquals("lzevgbmqjqab", model.tags().get("y")); + Assertions.assertEquals(SkuName.EDGE_PR_BASE, model.sku().name()); Assertions.assertEquals(SkuTier.STANDARD, model.sku().tier()); - Assertions.assertEquals("owskanyktz", model.etag()); - Assertions.assertEquals(DataBoxEdgeDeviceStatus.NEEDS_ATTENTION, model.dataBoxEdgeDeviceStatus()); - Assertions.assertEquals("drvyn", model.description()); - Assertions.assertEquals("gpphrcgyn", model.modelDescription()); - Assertions.assertEquals("ecfvmm", model.friendlyName()); + Assertions.assertEquals("qdrabhjybigehoqf", model.etag()); + Assertions.assertEquals(MsiIdentityType.USER_ASSIGNED, model.identity().type()); + Assertions.assertEquals(DataResidencyType.ZONE_REPLICATION, model.dataResidency().type()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - DataBoxEdgeDeviceInner model = new DataBoxEdgeDeviceInner().withLocation("ghmewuam") - .withTags(mapOf("t", "rzayv", "ln", "gvdfgiotkftutq", "qmi", "xlefgugnxkrx", "abhjybi", "tthzrvqd")) - .withSku(new Sku().withName(SkuName.EDGE).withTier(SkuTier.STANDARD)) - .withEtag("owskanyktz") - .withDataBoxEdgeDeviceStatus(DataBoxEdgeDeviceStatus.NEEDS_ATTENTION) - .withDescription("drvyn") - .withModelDescription("gpphrcgyn") - .withFriendlyName("ecfvmm"); + DataBoxEdgeDeviceInner model = new DataBoxEdgeDeviceInner().withLocation("yncocpecfvmmcoo") + .withTags(mapOf("y", "lzevgbmqjqab", "wnfnbacf", "mivkwlzuvcc", "bqqwxrj", "onlebxetqgtzxdpn", + "mpmngnzscxaqwoo", "eallnwsubisnj")) + .withSku(new Sku().withName(SkuName.EDGE_PR_BASE).withTier(SkuTier.STANDARD)) + .withEtag("qdrabhjybigehoqf") + .withIdentity(new ResourceIdentity().withType(MsiIdentityType.USER_ASSIGNED)) + .withDataResidency(new DataResidency().withType(DataResidencyType.ZONE_REPLICATION)); model = BinaryData.fromObject(model).toObject(DataBoxEdgeDeviceInner.class); - Assertions.assertEquals("ghmewuam", model.location()); - Assertions.assertEquals("rzayv", model.tags().get("t")); - Assertions.assertEquals(SkuName.EDGE, model.sku().name()); + Assertions.assertEquals("yncocpecfvmmcoo", model.location()); + Assertions.assertEquals("lzevgbmqjqab", model.tags().get("y")); + Assertions.assertEquals(SkuName.EDGE_PR_BASE, model.sku().name()); Assertions.assertEquals(SkuTier.STANDARD, model.sku().tier()); - Assertions.assertEquals("owskanyktz", model.etag()); - Assertions.assertEquals(DataBoxEdgeDeviceStatus.NEEDS_ATTENTION, model.dataBoxEdgeDeviceStatus()); - Assertions.assertEquals("drvyn", model.description()); - Assertions.assertEquals("gpphrcgyn", model.modelDescription()); - Assertions.assertEquals("ecfvmm", model.friendlyName()); + Assertions.assertEquals("qdrabhjybigehoqf", model.etag()); + Assertions.assertEquals(MsiIdentityType.USER_ASSIGNED, model.identity().type()); + Assertions.assertEquals(DataResidencyType.ZONE_REPLICATION, model.dataResidency().type()); } // Use "Map.of" if available diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/DataBoxEdgeDeviceListTests.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/DataBoxEdgeDeviceListTests.java index 99ab19770445..08945167a750 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/DataBoxEdgeDeviceListTests.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/DataBoxEdgeDeviceListTests.java @@ -1,23 +1,30 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.generated; import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.databoxedge.models.DataBoxEdgeDeviceList; +import com.azure.resourcemanager.databoxedge.implementation.models.DataBoxEdgeDeviceList; +import com.azure.resourcemanager.databoxedge.models.DataResidencyType; +import com.azure.resourcemanager.databoxedge.models.MsiIdentityType; +import com.azure.resourcemanager.databoxedge.models.SkuName; +import com.azure.resourcemanager.databoxedge.models.SkuTier; +import org.junit.jupiter.api.Assertions; public final class DataBoxEdgeDeviceListTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { DataBoxEdgeDeviceList model = BinaryData.fromString( - "{\"value\":[{\"location\":\"mrldhu\",\"tags\":{\"ablgphuticndvk\":\"zdatqxhocdg\"},\"sku\":{\"name\":\"TEA_4Node_Heater\",\"tier\":\"Standard\"},\"etag\":\"tyhxhurokft\",\"properties\":{\"dataBoxEdgeDeviceStatus\":\"ReadyToSetup\",\"serialNumber\":\"iwpwcuk\",\"description\":\"kgiawxklryplwck\",\"modelDescription\":\"syyp\",\"deviceType\":\"DataBoxEdgeDevice\",\"friendlyName\":\"sgcbac\",\"culture\":\"ejk\",\"deviceModel\":\"ynqgoulzndlikwyq\",\"deviceSoftwareVersion\":\"fgibmadgakeq\",\"deviceLocalCapacity\":4098961683533013138,\"timeZone\":\"zqqedq\",\"deviceHcsVersion\":\"bciqfouflm\",\"configuredRoleTypes\":[\"IOT\",\"Functions\"],\"nodeCount\":1095106401},\"id\":\"dmgloug\",\"name\":\"b\",\"type\":\"wtmutduq\"},{\"location\":\"ta\",\"tags\":{\"rtumkdosvq\":\"wgcu\",\"mbmbexppbh\":\"hbmdgbbjfdd\",\"rolfpfp\":\"q\"},\"sku\":{\"name\":\"TEA_1Node_UPS\",\"tier\":\"Standard\"},\"etag\":\"xigjyjgzjaoyfhr\",\"properties\":{\"dataBoxEdgeDeviceStatus\":\"ReadyToSetup\",\"serialNumber\":\"erkujys\",\"description\":\"eju\",\"modelDescription\":\"qawrlyxwj\",\"deviceType\":\"DataBoxEdgeDevice\",\"friendlyName\":\"bnwbxgjvtbvpyssz\",\"culture\":\"rujqg\",\"deviceModel\":\"muouqfp\",\"deviceSoftwareVersion\":\"zw\",\"deviceLocalCapacity\":41329089410242621,\"timeZone\":\"tnwu\",\"deviceHcsVersion\":\"gazxuf\",\"configuredRoleTypes\":[\"ASA\",\"IOT\"],\"nodeCount\":1585023957},\"id\":\"i\",\"name\":\"rfidfvzwdz\",\"type\":\"htymw\"},{\"location\":\"sdkf\",\"tags\":{\"km\":\"xmnteiwaop\",\"mzidnsezcxtb\":\"jcmmxdcufufsrp\",\"dwzjeiach\":\"sgfyccsnew\"},\"sku\":{\"name\":\"TEA_4Node_UPS_Heater\",\"tier\":\"Standard\"},\"etag\":\"ro\",\"properties\":{\"dataBoxEdgeDeviceStatus\":\"ReadyToSetup\",\"serialNumber\":\"eeh\",\"description\":\"vypyqrimzinpv\",\"modelDescription\":\"jdkirsoodqx\",\"deviceType\":\"DataBoxEdgeDevice\",\"friendlyName\":\"nohjt\",\"culture\":\"whdsoifiyip\",\"deviceModel\":\"sqwpgrjb\",\"deviceSoftwareVersion\":\"orcjxvsnby\",\"deviceLocalCapacity\":4373874045327283865,\"timeZone\":\"mocpc\",\"deviceHcsVersion\":\"hurzafblj\",\"configuredRoleTypes\":[\"Cognitive\",\"Functions\",\"IOT\"],\"nodeCount\":71717444},\"id\":\"jmkljavbqidtqajz\",\"name\":\"ulpkudjkrl\",\"type\":\"hbzhfepg\"},{\"location\":\"gqexzlocxs\",\"tags\":{\"j\":\"ierhhbcsglummaj\",\"jionpimexgstxgc\":\"odxobnbdxkqpxok\"},\"sku\":{\"name\":\"TEA_1Node_Heater\",\"tier\":\"Standard\"},\"etag\":\"jrmvdjwzrlo\",\"properties\":{\"dataBoxEdgeDeviceStatus\":\"Online\",\"serialNumber\":\"hijco\",\"description\":\"ctbzaq\",\"modelDescription\":\"sycbkbfk\",\"deviceType\":\"DataBoxEdgeDevice\",\"friendlyName\":\"kexxppof\",\"culture\":\"axcfjpgddtocjjx\",\"deviceModel\":\"pmouexhdz\",\"deviceSoftwareVersion\":\"bqe\",\"deviceLocalCapacity\":1003274251432206835,\"timeZone\":\"bzv\",\"deviceHcsVersion\":\"ntwndeicbtwnpzao\",\"configuredRoleTypes\":[\"Cognitive\",\"Functions\",\"Cognitive\",\"Functions\"],\"nodeCount\":1387185134},\"id\":\"cyddglmjthjqk\",\"name\":\"pyeicxm\",\"type\":\"ciwqvhk\"}],\"nextLink\":\"xuigdtopbobj\"}") + "{\"value\":[{\"properties\":{\"dataBoxEdgeDeviceStatus\":\"Offline\",\"serialNumber\":\"w\",\"description\":\"eun\",\"modelDescription\":\"qhgyxzkonocukok\",\"deviceType\":\"DataBoxEdgeDevice\",\"friendlyName\":\"uconuqszfkbey\",\"culture\":\"wrmjmwvvjektc\",\"deviceModel\":\"enhwlrs\",\"deviceSoftwareVersion\":\"rzpwvlqdqgbiq\",\"deviceLocalCapacity\":3771640037814416953,\"timeZone\":\"aetcktvfcivfs\",\"deviceHcsVersion\":\"ymuctqhjfbebrj\",\"configuredRoleTypes\":[\"MEC\",\"Cognitive\",\"Kubernetes\"],\"nodeCount\":1120772764,\"resourceMoveDetails\":{\"operationInProgress\":\"ResourceMoveFailed\",\"operationInProgressLockTimeoutInUTC\":\"2021-04-15T13:49:51Z\"},\"edgeProfile\":{\"subscription\":{\"registrationId\":\"birphxepcyva\",\"id\":\"nljky\",\"state\":\"Unregistered\",\"registrationDate\":\"uujqgidokgjljyo\",\"subscriptionId\":\"vcltbgsncgh\",\"properties\":{}}},\"dataResidency\":{\"type\":\"GeoZoneReplication\"},\"kubernetesWorkloadProfile\":\"hbijhtxfvgxb\"},\"sku\":{\"name\":\"TDC\",\"tier\":\"Standard\"},\"etag\":\"mpvecxgodebfqk\",\"identity\":{\"type\":\"None\",\"principalId\":\"ukgri\",\"tenantId\":\"lzlfbxzpuz\"},\"kind\":\"AzureModularDataCentre\",\"location\":\"pnq\",\"tags\":{\"qqkpikadrg\":\"mgkbrpyydhibn\",\"jggmebfsiarbu\":\"tqagnbuynh\",\"ttdbhrbnl\":\"rcvpnazzmhjrunmp\"},\"id\":\"nkxmyskpbhenbtk\",\"name\":\"xywnytnrsynlqidy\",\"type\":\"yxczfclh\"},{\"properties\":{\"dataBoxEdgeDeviceStatus\":\"NeedsAttention\",\"serialNumber\":\"b\",\"description\":\"lwrq\",\"modelDescription\":\"ktsthsucocmny\",\"deviceType\":\"DataBoxEdgeDevice\",\"friendlyName\":\"t\",\"culture\":\"wwrq\",\"deviceModel\":\"edckzywbiexzfey\",\"deviceSoftwareVersion\":\"axibxujw\",\"deviceLocalCapacity\":6825122128576329936,\"timeZone\":\"lmuzy\",\"deviceHcsVersion\":\"aepdkzjanc\",\"configuredRoleTypes\":[\"MEC\",\"Functions\",\"Cognitive\"],\"nodeCount\":1879785159,\"resourceMoveDetails\":{\"operationInProgress\":\"ResourceMoveInProgress\",\"operationInProgressLockTimeoutInUTC\":\"2021-02-11T12:02:57Z\"},\"edgeProfile\":{\"subscription\":{\"registrationId\":\"swzts\",\"id\":\"pgn\",\"state\":\"Warned\",\"registrationDate\":\"hpzxbzpfzab\",\"subscriptionId\":\"cuh\",\"properties\":{}}},\"dataResidency\":{\"type\":\"GeoZoneReplication\"},\"kubernetesWorkloadProfile\":\"qik\"},\"sku\":{\"name\":\"Gateway\",\"tier\":\"Standard\"},\"etag\":\"wzbhvgyugu\",\"identity\":{\"type\":\"None\",\"principalId\":\"fssxqukkfplg\",\"tenantId\":\"sxnkjzkdeslpvlo\"},\"kind\":\"AzureDataBoxGateway\",\"location\":\"ighxpk\",\"tags\":{\"upedeojnabckhs\":\"baiuebbaumny\"},\"id\":\"txp\",\"name\":\"ie\",\"type\":\"tfhvpesapskrdqmh\"},{\"properties\":{\"dataBoxEdgeDeviceStatus\":\"Maintenance\",\"serialNumber\":\"dwkyzxuu\",\"description\":\"ncwscwsvlxoto\",\"modelDescription\":\"wrupqsxvnmicykvc\",\"deviceType\":\"DataBoxEdgeDevice\",\"friendlyName\":\"ilovnot\",\"culture\":\"jfcn\",\"deviceModel\":\"k\",\"deviceSoftwareVersion\":\"x\",\"deviceLocalCapacity\":3857673152007757003,\"timeZone\":\"kphywpnvjto\",\"deviceHcsVersion\":\"ermclfplphoxuscr\",\"configuredRoleTypes\":[\"CloudEdgeManagement\",\"MEC\"],\"nodeCount\":1582480909,\"resourceMoveDetails\":{\"operationInProgress\":\"None\",\"operationInProgressLockTimeoutInUTC\":\"2021-01-26T13:24:27Z\"},\"edgeProfile\":{\"subscription\":{\"registrationId\":\"gxywpmue\",\"id\":\"jzwf\",\"state\":\"Deleted\",\"registrationDate\":\"jidsuyonobglaoc\",\"subscriptionId\":\"tcc\",\"properties\":{}}},\"dataResidency\":{\"type\":\"GeoZoneReplication\"},\"kubernetesWorkloadProfile\":\"ytlmoyrxvwfud\"},\"sku\":{\"name\":\"TEA_4Node_Heater\",\"tier\":\"Standard\"},\"etag\":\"dzhlrq\",\"identity\":{\"type\":\"UserAssigned\",\"principalId\":\"frlh\",\"tenantId\":\"sbkyvpycanuzbp\"},\"kind\":\"AzureStackEdge\",\"location\":\"kuwbcrnwb\",\"tags\":{\"rts\":\"hseyvju\",\"mx\":\"hspkdeemao\"},\"id\":\"gkvtmelmqkrhah\",\"name\":\"ljuahaquhcdh\",\"type\":\"duala\"},{\"properties\":{\"dataBoxEdgeDeviceStatus\":\"NeedsAttention\",\"serialNumber\":\"adm\",\"description\":\"rcrgvx\",\"modelDescription\":\"gomz\",\"deviceType\":\"DataBoxEdgeDevice\",\"friendlyName\":\"sgwbnbbeld\",\"culture\":\"k\",\"deviceModel\":\"ali\",\"deviceSoftwareVersion\":\"rqhakauha\",\"deviceLocalCapacity\":3428999521390307360,\"timeZone\":\"xosow\",\"deviceHcsVersion\":\"cugicjoox\",\"configuredRoleTypes\":[\"CloudEdgeManagement\",\"Kubernetes\",\"CloudEdgeManagement\"],\"nodeCount\":741000017,\"resourceMoveDetails\":{\"operationInProgress\":\"None\",\"operationInProgressLockTimeoutInUTC\":\"2021-11-10T03:45:07Z\"},\"edgeProfile\":{\"subscription\":{\"registrationId\":\"meue\",\"id\":\"vyhzceuojgjrwj\",\"state\":\"Registered\",\"registrationDate\":\"twm\",\"subscriptionId\":\"ytdxwit\",\"properties\":{}}},\"dataResidency\":{\"type\":\"ZoneReplication\"},\"kubernetesWorkloadProfile\":\"gqwgxhniskxfbkp\"},\"sku\":{\"name\":\"RCA_Large\",\"tier\":\"Standard\"},\"etag\":\"dnhjdauwhvylw\",\"identity\":{\"type\":\"SystemAssigned\",\"principalId\":\"xujznbmpowu\",\"tenantId\":\"rzqlveu\"},\"kind\":\"AzureDataBoxGateway\",\"location\":\"j\",\"tags\":{\"tjrip\":\"fxobbcsws\",\"xzvlvqhjkbegib\":\"rbpbewtghfgblcg\",\"wrtz\":\"nmxiebwwaloayqc\",\"ngmtsavjcb\":\"uzgwyzmhtx\"},\"id\":\"wxqpsrknftguvri\",\"name\":\"hprwmdyv\",\"type\":\"qtayri\"}],\"nextLink\":\"ro\"}") .toObject(DataBoxEdgeDeviceList.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DataBoxEdgeDeviceList model = new DataBoxEdgeDeviceList(); - model = BinaryData.fromObject(model).toObject(DataBoxEdgeDeviceList.class); + Assertions.assertEquals("pnq", model.value().get(0).location()); + Assertions.assertEquals("mgkbrpyydhibn", model.value().get(0).tags().get("qqkpikadrg")); + Assertions.assertEquals(SkuName.TDC, model.value().get(0).sku().name()); + Assertions.assertEquals(SkuTier.STANDARD, model.value().get(0).sku().tier()); + Assertions.assertEquals("mpvecxgodebfqk", model.value().get(0).etag()); + Assertions.assertEquals(MsiIdentityType.NONE, model.value().get(0).identity().type()); + Assertions.assertEquals(DataResidencyType.GEO_ZONE_REPLICATION, model.value().get(0).dataResidency().type()); + Assertions.assertEquals("ro", model.nextLink()); } } diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/DataBoxEdgeDevicePatchTests.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/DataBoxEdgeDevicePatchTests.java index b9b34eef5b04..c8dc6e4d7bb4 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/DataBoxEdgeDevicePatchTests.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/DataBoxEdgeDevicePatchTests.java @@ -1,11 +1,15 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.generated; import com.azure.core.util.BinaryData; import com.azure.resourcemanager.databoxedge.models.DataBoxEdgeDevicePatch; +import com.azure.resourcemanager.databoxedge.models.EdgeProfilePatch; +import com.azure.resourcemanager.databoxedge.models.EdgeProfileSubscriptionPatch; +import com.azure.resourcemanager.databoxedge.models.MsiIdentityType; +import com.azure.resourcemanager.databoxedge.models.ResourceIdentity; import java.util.HashMap; import java.util.Map; import org.junit.jupiter.api.Assertions; @@ -13,16 +17,24 @@ public final class DataBoxEdgeDevicePatchTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - DataBoxEdgeDevicePatch model = BinaryData.fromString("{\"tags\":{\"hctbqvudwxdn\":\"jbavorxzdm\"}}") + DataBoxEdgeDevicePatch model = BinaryData.fromString( + "{\"tags\":{\"cbkhajdeyeamdph\":\"ttgzfbis\",\"lpbuxwgipwhonowk\":\"g\"},\"identity\":{\"type\":\"None\",\"principalId\":\"nkixzbinj\",\"tenantId\":\"uttmrywnuzoqft\"},\"properties\":{\"edgeProfile\":{\"subscription\":{\"id\":\"n\"}}}}") .toObject(DataBoxEdgeDevicePatch.class); - Assertions.assertEquals("jbavorxzdm", model.tags().get("hctbqvudwxdn")); + Assertions.assertEquals("ttgzfbis", model.tags().get("cbkhajdeyeamdph")); + Assertions.assertEquals(MsiIdentityType.NONE, model.identity().type()); + Assertions.assertEquals("n", model.edgeProfile().subscription().id()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - DataBoxEdgeDevicePatch model = new DataBoxEdgeDevicePatch().withTags(mapOf("hctbqvudwxdn", "jbavorxzdm")); + DataBoxEdgeDevicePatch model = new DataBoxEdgeDevicePatch() + .withTags(mapOf("cbkhajdeyeamdph", "ttgzfbis", "lpbuxwgipwhonowk", "g")) + .withIdentity(new ResourceIdentity().withType(MsiIdentityType.NONE)) + .withEdgeProfile(new EdgeProfilePatch().withSubscription(new EdgeProfileSubscriptionPatch().withId("n"))); model = BinaryData.fromObject(model).toObject(DataBoxEdgeDevicePatch.class); - Assertions.assertEquals("jbavorxzdm", model.tags().get("hctbqvudwxdn")); + Assertions.assertEquals("ttgzfbis", model.tags().get("cbkhajdeyeamdph")); + Assertions.assertEquals(MsiIdentityType.NONE, model.identity().type()); + Assertions.assertEquals("n", model.edgeProfile().subscription().id()); } // Use "Map.of" if available diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/DataBoxEdgeDevicePropertiesPatchTests.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/DataBoxEdgeDevicePropertiesPatchTests.java new file mode 100644 index 000000000000..7a8c0919181e --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/DataBoxEdgeDevicePropertiesPatchTests.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.databoxedge.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.databoxedge.fluent.models.DataBoxEdgeDevicePropertiesPatch; +import com.azure.resourcemanager.databoxedge.models.EdgeProfilePatch; +import com.azure.resourcemanager.databoxedge.models.EdgeProfileSubscriptionPatch; +import org.junit.jupiter.api.Assertions; + +public final class DataBoxEdgeDevicePropertiesPatchTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + DataBoxEdgeDevicePropertiesPatch model + = BinaryData.fromString("{\"edgeProfile\":{\"subscription\":{\"id\":\"yx\"}}}") + .toObject(DataBoxEdgeDevicePropertiesPatch.class); + Assertions.assertEquals("yx", model.edgeProfile().subscription().id()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + DataBoxEdgeDevicePropertiesPatch model = new DataBoxEdgeDevicePropertiesPatch() + .withEdgeProfile(new EdgeProfilePatch().withSubscription(new EdgeProfileSubscriptionPatch().withId("yx"))); + model = BinaryData.fromObject(model).toObject(DataBoxEdgeDevicePropertiesPatch.class); + Assertions.assertEquals("yx", model.edgeProfile().subscription().id()); + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/DataBoxEdgeDevicePropertiesTests.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/DataBoxEdgeDevicePropertiesTests.java index 95fb22fc5272..3072028c8af7 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/DataBoxEdgeDevicePropertiesTests.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/DataBoxEdgeDevicePropertiesTests.java @@ -1,37 +1,29 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.generated; import com.azure.core.util.BinaryData; import com.azure.resourcemanager.databoxedge.fluent.models.DataBoxEdgeDeviceProperties; -import com.azure.resourcemanager.databoxedge.models.DataBoxEdgeDeviceStatus; +import com.azure.resourcemanager.databoxedge.models.DataResidency; +import com.azure.resourcemanager.databoxedge.models.DataResidencyType; import org.junit.jupiter.api.Assertions; public final class DataBoxEdgeDevicePropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { DataBoxEdgeDeviceProperties model = BinaryData.fromString( - "{\"dataBoxEdgeDeviceStatus\":\"Maintenance\",\"serialNumber\":\"scxaq\",\"description\":\"ochcbonqvpkvl\",\"modelDescription\":\"njeaseipheofloke\",\"deviceType\":\"DataBoxEdgeDevice\",\"friendlyName\":\"nj\",\"culture\":\"lwtgrhpdj\",\"deviceModel\":\"umasxazjpq\",\"deviceSoftwareVersion\":\"gual\",\"deviceLocalCapacity\":2249320099988236526,\"timeZone\":\"e\",\"deviceHcsVersion\":\"zzvdudgwds\",\"configuredRoleTypes\":[\"ASA\",\"Functions\",\"IOT\",\"IOT\"],\"nodeCount\":1771103105}") + "{\"dataBoxEdgeDeviceStatus\":\"PartiallyDisconnected\",\"serialNumber\":\"dlwtgrhpdj\",\"description\":\"umasxazjpq\",\"modelDescription\":\"gual\",\"deviceType\":\"DataBoxEdgeDevice\",\"friendlyName\":\"hejjz\",\"culture\":\"dudgwdslfhot\",\"deviceModel\":\"cynpwlbjnp\",\"deviceSoftwareVersion\":\"cftadeh\",\"deviceLocalCapacity\":7028050140215699790,\"timeZone\":\"fsoppusuesnzw\",\"deviceHcsVersion\":\"jbavorxzdm\",\"configuredRoleTypes\":[\"Functions\",\"IOT\",\"Kubernetes\"],\"nodeCount\":1529084406,\"resourceMoveDetails\":{\"operationInProgress\":\"None\",\"operationInProgressLockTimeoutInUTC\":\"2021-10-27T15:38:07Z\"},\"edgeProfile\":{\"subscription\":{\"registrationId\":\"owgujjugwdkcglhs\",\"id\":\"zj\",\"state\":\"Warned\",\"registrationDate\":\"dtjixhb\",\"subscriptionId\":\"ofqweykhmenevfye\",\"properties\":{\"tenantId\":\"hybcibv\",\"locationPlacementId\":\"dcsi\",\"quotaId\":\"nnaamdectehfiqsc\",\"serializedDetails\":\"ypvhezrkg\",\"registeredFeatures\":[{\"name\":\"refovgmkqsleyyvx\",\"state\":\"jpkcattpng\"}]}}},\"dataResidency\":{\"type\":\"GeoZoneReplication\"},\"kubernetesWorkloadProfile\":\"zsqpjhvmdajvny\"}") .toObject(DataBoxEdgeDeviceProperties.class); - Assertions.assertEquals(DataBoxEdgeDeviceStatus.MAINTENANCE, model.dataBoxEdgeDeviceStatus()); - Assertions.assertEquals("ochcbonqvpkvl", model.description()); - Assertions.assertEquals("njeaseipheofloke", model.modelDescription()); - Assertions.assertEquals("nj", model.friendlyName()); + Assertions.assertEquals(DataResidencyType.GEO_ZONE_REPLICATION, model.dataResidency().type()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - DataBoxEdgeDeviceProperties model - = new DataBoxEdgeDeviceProperties().withDataBoxEdgeDeviceStatus(DataBoxEdgeDeviceStatus.MAINTENANCE) - .withDescription("ochcbonqvpkvl") - .withModelDescription("njeaseipheofloke") - .withFriendlyName("nj"); + DataBoxEdgeDeviceProperties model = new DataBoxEdgeDeviceProperties() + .withDataResidency(new DataResidency().withType(DataResidencyType.GEO_ZONE_REPLICATION)); model = BinaryData.fromObject(model).toObject(DataBoxEdgeDeviceProperties.class); - Assertions.assertEquals(DataBoxEdgeDeviceStatus.MAINTENANCE, model.dataBoxEdgeDeviceStatus()); - Assertions.assertEquals("ochcbonqvpkvl", model.description()); - Assertions.assertEquals("njeaseipheofloke", model.modelDescription()); - Assertions.assertEquals("nj", model.friendlyName()); + Assertions.assertEquals(DataResidencyType.GEO_ZONE_REPLICATION, model.dataResidency().type()); } } diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/DataBoxEdgeSkuListInnerTests.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/DataBoxEdgeSkuListInnerTests.java new file mode 100644 index 000000000000..b709718a6bdc --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/DataBoxEdgeSkuListInnerTests.java @@ -0,0 +1,19 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.databoxedge.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.databoxedge.fluent.models.DataBoxEdgeSkuListInner; +import org.junit.jupiter.api.Assertions; + +public final class DataBoxEdgeSkuListInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + DataBoxEdgeSkuListInner model = BinaryData.fromString( + "{\"value\":[{\"resourceType\":\"l\",\"name\":\"TMA\",\"kind\":\"pchwa\",\"tier\":\"Standard\",\"size\":\"usnfepgfewet\",\"family\":\"yxgncxykxhdjhli\",\"locations\":[\"cxfhbcporxv\"],\"apiVersions\":[\"zhqizxf\"],\"locationInfo\":[{\"location\":\"qscjavftjuh\",\"zones\":[\"zkmtgguwpijrajci\",\"m\",\"ghfcfiwrxgkneuvy\"],\"sites\":[\"qodfvp\",\"shoxgsgb\",\"fgzdjtxvz\"]},{\"location\":\"bqvgaqv\",\"zones\":[\"fcq\"],\"sites\":[\"dvetnws\"]},{\"location\":\"utnw\",\"zones\":[\"ycvuzhyrmewipmv\",\"k\",\"xukuqgsj\",\"xundxgk\"],\"sites\":[\"zhhzjhfjmhvvmu\",\"gpmuneqsxvmhfbuz\",\"yihsasbhudypohyu\",\"ms\"]},{\"location\":\"nsqyrpfoobrltt\",\"zones\":[\"jnygq\",\"nfwqzdzgtilaxhn\",\"hqlyvijo\",\"wivkxo\"],\"sites\":[\"nbixxrti\"]}],\"costs\":[{\"meterId\":\"wpgclrcivt\",\"quantity\":3934566350387136818,\"extendedUnit\":\"kenx\"},{\"meterId\":\"yyefrpmpdnqqs\",\"quantity\":9156957823967073009,\"extendedUnit\":\"qvmmbn\"}],\"signupOption\":\"None\",\"version\":\"Stable\",\"availability\":\"Unavailable\",\"shipmentTypes\":[\"ShippedToCustomer\",\"SelfPickup\",\"NotApplicable\"],\"capabilities\":[{\"name\":\"gvkxlzyqdrfe\",\"value\":\"ealzxwhcansymoyq\"},{\"name\":\"wigdi\",\"value\":\"kbxgom\"}]},{\"resourceType\":\"juwasqvdaeyyguxa\",\"name\":\"EP2_64_Mx1_W\",\"kind\":\"zhzbezkgimsi\",\"tier\":\"Standard\",\"size\":\"icddyvvjskgfmocw\",\"family\":\"pqg\",\"locations\":[\"eaahhvjhhn\",\"kzyb\",\"jjidjk\"],\"apiVersions\":[\"kyxvxevblbjedn\",\"jlageu\",\"ulxunsmjbnkpp\"],\"locationInfo\":[{\"location\":\"nlsvxeiz\",\"zones\":[\"klnsrmffey\",\"xcktpiymerteeamm\",\"qiekkkzddrt\"],\"sites\":[\"ojbmxv\"]},{\"location\":\"refdee\",\"zones\":[\"cuijpxt\",\"s\",\"wprtu\"],\"sites\":[\"awddjibab\",\"vit\",\"tvtzeexavoxtfg\",\"ecdmdqbwpy\"]},{\"location\":\"tgsfja\",\"zones\":[\"lhhxudbxvodhtnsi\",\"ud\",\"z\"],\"sites\":[\"sckdlp\"]}],\"costs\":[{\"meterId\":\"cxfailcfxwmdboxd\",\"quantity\":5413751597691708104,\"extendedUnit\":\"ufqobrjlnac\"},{\"meterId\":\"ckknhxkizvy\",\"quantity\":5633654443710491466,\"extendedUnit\":\"uljraae\"},{\"meterId\":\"nok\",\"quantity\":5311010172525220473,\"extendedUnit\":\"jqnv\"},{\"meterId\":\"oylaxxul\",\"quantity\":5101303402831257640,\"extendedUnit\":\"osfjbjsv\"}],\"signupOption\":\"Available\",\"version\":\"Stable\",\"availability\":\"Unavailable\",\"shipmentTypes\":[\"SelfPickup\"],\"capabilities\":[{\"name\":\"c\",\"value\":\"gc\"}]},{\"resourceType\":\"nfnw\",\"name\":\"Edge\",\"kind\":\"vpdvjdhttzae\",\"tier\":\"Standard\",\"size\":\"ihchrphkmcrjdqn\",\"family\":\"fzpbgtgkyl\",\"locations\":[\"hrjeuutlw\",\"ez\",\"zhokvbwnhh\"],\"apiVersions\":[\"gehgppi\",\"ifhpf\"],\"locationInfo\":[{\"location\":\"vgcxtx\",\"zones\":[\"heafidlt\",\"gsresmkssj\"],\"sites\":[\"ftxfkf\",\"egprhptil\"]},{\"location\":\"cbiqtgdqoh\",\"zones\":[\"sldrizetpwbral\",\"libph\",\"qzmiza\",\"a\"],\"sites\":[\"kjpdnjzhajo\",\"lhjlmuoyxprimr\",\"opteecj\"]},{\"location\":\"islstv\",\"zones\":[\"lwxdzaum\"],\"sites\":[\"ohguuf\",\"zboyjathwt\"]},{\"location\":\"lbaemwmdxmeb\",\"zones\":[\"cjpahl\",\"veabfqxnmwmqtib\",\"yijddtvqcttad\"],\"sites\":[\"eukmr\",\"ieekpndzaa\"]}],\"costs\":[{\"meterId\":\"qmeqwigpibudqwyx\",\"quantity\":694643983828538696,\"extendedUnit\":\"pmzznrtffya\"},{\"meterId\":\"tmhheioqa\",\"quantity\":730726349973993242,\"extendedUnit\":\"ufuqyrx\"},{\"meterId\":\"lcgqlsismj\",\"quantity\":4740563378540635719,\"extendedUnit\":\"gamquhiosrsjui\"},{\"meterId\":\"cdisyir\",\"quantity\":8835177010558566527,\"extendedUnit\":\"zexrxzbujrt\"}],\"signupOption\":\"None\",\"version\":\"Preview\",\"availability\":\"Available\",\"shipmentTypes\":[\"SelfPickup\"],\"capabilities\":[{\"name\":\"nzonzl\",\"value\":\"i\"},{\"name\":\"wncvjtszcofiz\",\"value\":\"tdhgbjkvrelj\"},{\"name\":\"murvzm\",\"value\":\"vuanashcxlp\"}]},{\"resourceType\":\"erbdk\",\"name\":\"RDC\",\"kind\":\"di\",\"tier\":\"Standard\",\"size\":\"db\",\"family\":\"xjmonf\",\"locations\":[\"w\",\"cypuuwwlt\",\"uqj\"],\"apiVersions\":[\"e\",\"keifzzhmkdasv\",\"lyhb\",\"cu\"],\"locationInfo\":[{\"location\":\"gsrboldforobw\",\"zones\":[\"izbfhfovvacq\",\"btuodxeszabbel\"],\"sites\":[\"muaslzkw\",\"rwoycqucwyh\",\"hnomdrkywuh\",\"svfuurutlwexxwl\"]},{\"location\":\"niexzsrzpgepq\",\"zones\":[\"bwwpgdakchzy\"],\"sites\":[\"xqnrkcxk\",\"ibn\",\"mysu\",\"swqrntvlwijp\"]},{\"location\":\"texoqqpwc\",\"zones\":[\"fmhruncuwm\",\"spkcdqzh\"],\"sites\":[\"d\",\"unqndyfpchrqb\"]}],\"costs\":[{\"meterId\":\"cgegydcwbo\",\"quantity\":3719627764168677785,\"extendedUnit\":\"qqoli\"}],\"signupOption\":\"Available\",\"version\":\"Preview\",\"availability\":\"Available\",\"shipmentTypes\":[\"ShippedToCustomer\",\"SelfPickup\"],\"capabilities\":[{\"name\":\"oq\",\"value\":\"uojrngiflr\"},{\"name\":\"asccbiui\",\"value\":\"dlyjdf\"},{\"name\":\"mkyoqufdvruzsl\",\"value\":\"j\"}]}],\"nextLink\":\"ctfnmdxotng\"}") + .toObject(DataBoxEdgeSkuListInner.class); + Assertions.assertEquals("ctfnmdxotng", model.nextLink()); + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/DataBoxEdgeSkuTests.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/DataBoxEdgeSkuTests.java new file mode 100644 index 000000000000..6d12d4be2a98 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/DataBoxEdgeSkuTests.java @@ -0,0 +1,17 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.databoxedge.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.databoxedge.models.DataBoxEdgeSku; + +public final class DataBoxEdgeSkuTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + DataBoxEdgeSku model = BinaryData.fromString( + "{\"resourceType\":\"gugey\",\"name\":\"EdgeMR_Mini\",\"kind\":\"rkyui\",\"tier\":\"Standard\",\"size\":\"nmfpp\",\"family\":\"jee\",\"locations\":[\"yhsgz\",\"czbgomfgbeg\",\"qgleohibetnluank\"],\"apiVersions\":[\"xeeebtijvacvbmqz\",\"qqxlajr\",\"wxacevehj\",\"uyxoaf\"],\"locationInfo\":[{\"location\":\"lt\",\"zones\":[\"yl\"],\"sites\":[\"fgvxirpghriypoqe\",\"hlqhykprlpy\",\"nuciqdsmexiit\",\"fuxtyasiibmiybnn\"]},{\"location\":\"tgnljhnmgixhcmav\",\"zones\":[\"oudorhcgyyp\",\"otwypundmb\"],\"sites\":[\"gcmjkavl\",\"or\",\"mftpmdtz\",\"jltfvnzcyjtotpv\"]}],\"costs\":[{\"meterId\":\"bdb\",\"quantity\":3940441182690359236,\"extendedUnit\":\"ihed\"},{\"meterId\":\"qwthmky\",\"quantity\":6255565742115400149,\"extendedUnit\":\"ihsgq\"},{\"meterId\":\"dhohsdtmcdzsuf\",\"quantity\":7117215511818462498,\"extendedUnit\":\"bzlmcm\"}],\"signupOption\":\"Available\",\"version\":\"Preview\",\"availability\":\"Unavailable\",\"shipmentTypes\":[\"ShippedToCustomer\",\"ShippedToCustomer\",\"NotApplicable\",\"NotApplicable\"],\"capabilities\":[{\"name\":\"skonqzinkf\",\"value\":\"gbzbowxeqo\"}]}") + .toObject(DataBoxEdgeSku.class); + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/DataResidencyTests.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/DataResidencyTests.java new file mode 100644 index 000000000000..cb05f5cc092f --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/DataResidencyTests.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.databoxedge.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.databoxedge.models.DataResidency; +import com.azure.resourcemanager.databoxedge.models.DataResidencyType; +import org.junit.jupiter.api.Assertions; + +public final class DataResidencyTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + DataResidency model = BinaryData.fromString("{\"type\":\"GeoZoneReplication\"}").toObject(DataResidency.class); + Assertions.assertEquals(DataResidencyType.GEO_ZONE_REPLICATION, model.type()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + DataResidency model = new DataResidency().withType(DataResidencyType.GEO_ZONE_REPLICATION); + model = BinaryData.fromObject(model).toObject(DataResidency.class); + Assertions.assertEquals(DataResidencyType.GEO_ZONE_REPLICATION, model.type()); + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/DeviceCapacityInfoInnerTests.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/DeviceCapacityInfoInnerTests.java new file mode 100644 index 000000000000..8eb9c263135a --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/DeviceCapacityInfoInnerTests.java @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.databoxedge.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.databoxedge.fluent.models.DeviceCapacityInfoInner; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; + +public final class DeviceCapacityInfoInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + DeviceCapacityInfoInner model = BinaryData.fromString( + "{\"properties\":{\"timeStamp\":\"2021-11-27T21:02:17Z\",\"clusterStorageCapacityInfo\":{\"clusterTotalStorageMb\":89.34209584899135,\"clusterFreeStorageMb\":12.210910986805724},\"clusterComputeCapacityInfo\":{\"fqdn\":\"rvqqaatj\",\"gpuCapacity\":{\"gpuType\":\"vgoup\",\"gpuUsedUnitsCount\":1624473251,\"gpuFreeUnitsCount\":781426249,\"gpuReservedForFailoverUnitsCount\":121941130,\"gpuTotalUnitsCount\":366208637},\"memoryCapacity\":{\"clusterFreeMemoryMb\":29.085261501197678,\"clusterUsedMemoryMb\":60.87162878665412,\"clusterFailoverMemoryMb\":34.54433088697856,\"clusterFragmentationMemoryMb\":25.223623232433802,\"clusterHypervReserveMemoryMb\":94.3298441589831,\"clusterInfraVmMemoryMb\":93.13111838664105,\"clusterTotalMemoryMb\":59.87106682567109,\"clusterNonFailoverVmMb\":82.47209279338217,\"clusterMemoryUsedByVmsMb\":62.14330743366697},\"lastRefreshedTime\":\"2021-04-03T14:41:24Z\",\"totalProvisionedNonHpnCores\":593391508400046676},\"nodeCapacityInfos\":{\"tsgumhj\":{\"hostName\":\"xvvy\",\"effectiveAvailableMemoryMbOnHost\":446367325585574216,\"availableGpuCount\":2121939227,\"vmUsedMemory\":{\"uvwzfbnh\":{\"startupMemoryMB\":659192510788744677,\"currentMemoryUsageMB\":754056912237486709},\"ngitvgbmhrixkwm\":{\"startupMemoryMB\":3789735815889216025,\"currentMemoryUsageMB\":108821458018204147},\"grhbpn\":{\"startupMemoryMB\":6850014408973535187,\"currentMemoryUsageMB\":2442018790284134331}},\"gpuType\":\"xexccbdreaxhcexd\",\"numaNodesData\":[{\"numaNodeIndex\":1241067704,\"totalMemoryInMb\":4457997011490580036,\"logicalCoreCountPerCore\":1584778168,\"effectiveAvailableMemoryInMb\":7920652979146329739,\"freeVCpuIndexesForHpn\":[1376056830,205565987],\"vCpuIndexesForHpn\":[441495179,1624043548,3385554,175357143],\"vCpuIndexesForRoot\":[146536566]},{\"numaNodeIndex\":1220802910,\"totalMemoryInMb\":6720131909300742836,\"logicalCoreCountPerCore\":1432039149,\"effectiveAvailableMemoryInMb\":53764048985760155,\"freeVCpuIndexesForHpn\":[1542323889,312657559],\"vCpuIndexesForHpn\":[101961110,1846844477,213302833,768184156],\"vCpuIndexesForRoot\":[666805077]},{\"numaNodeIndex\":1176849986,\"totalMemoryInMb\":3679866876785700659,\"logicalCoreCountPerCore\":539949394,\"effectiveAvailableMemoryInMb\":5835759219159413438,\"freeVCpuIndexesForHpn\":[402574636,367987412,2130942717,115360224],\"vCpuIndexesForHpn\":[1031668557,26130374],\"vCpuIndexesForRoot\":[1968525947,1897122560,1616110653,339219254]}]},\"ihyeozphvw\":{\"hostName\":\"ikkx\",\"effectiveAvailableMemoryMbOnHost\":1166139203085958586,\"availableGpuCount\":528411335,\"vmUsedMemory\":{\"felfktg\":{\"startupMemoryMB\":3771772000949709201,\"currentMemoryUsageMB\":783231880648747545},\"xeznoi\":{\"startupMemoryMB\":4113846236467073097,\"currentMemoryUsageMB\":3279748412571600137}},\"gpuType\":\"rnjwmw\",\"numaNodesData\":[{\"numaNodeIndex\":650056423,\"totalMemoryInMb\":7370979287660011871,\"logicalCoreCountPerCore\":552544194,\"effectiveAvailableMemoryInMb\":12239624100997197,\"freeVCpuIndexesForHpn\":[424496113,959686247,1304843814,1162521892],\"vCpuIndexesForHpn\":[1620323863,1479780432,1430478832],\"vCpuIndexesForRoot\":[1620389391,1895390850,288495023]},{\"numaNodeIndex\":1224578213,\"totalMemoryInMb\":5751621871906983666,\"logicalCoreCountPerCore\":159219307,\"effectiveAvailableMemoryInMb\":2168581473521013439,\"freeVCpuIndexesForHpn\":[190576653,403586815],\"vCpuIndexesForHpn\":[1784311457,1899473333],\"vCpuIndexesForRoot\":[1886433502,1870026194,1615411821,382713114]},{\"numaNodeIndex\":1149694160,\"totalMemoryInMb\":4613907741169030057,\"logicalCoreCountPerCore\":1629176755,\"effectiveAvailableMemoryInMb\":2438040067593069072,\"freeVCpuIndexesForHpn\":[360748020,34950484,206948970,1101477177],\"vCpuIndexesForHpn\":[1662544736,1659920378],\"vCpuIndexesForRoot\":[1782265251,648427507]},{\"numaNodeIndex\":1501575035,\"totalMemoryInMb\":6158670602245383291,\"logicalCoreCountPerCore\":848458323,\"effectiveAvailableMemoryInMb\":3086933290402300840,\"freeVCpuIndexesForHpn\":[882438810,658417740],\"vCpuIndexesForHpn\":[1381182102,147103484],\"vCpuIndexesForRoot\":[1028485886,610682904,997938264]}]},\"bfpncurdo\":{\"hostName\":\"y\",\"effectiveAvailableMemoryMbOnHost\":364088888984952408,\"availableGpuCount\":367245568,\"vmUsedMemory\":{\"cwxqu\":{\"startupMemoryMB\":8692265151582287969,\"currentMemoryUsageMB\":5440469387098013843}},\"gpuType\":\"vzhfstotxhoj\",\"numaNodesData\":[{\"numaNodeIndex\":1872993536,\"totalMemoryInMb\":686052529791158175,\"logicalCoreCountPerCore\":912797424,\"effectiveAvailableMemoryInMb\":3948715464774709243,\"freeVCpuIndexesForHpn\":[1882216522],\"vCpuIndexesForHpn\":[269819417,12838706],\"vCpuIndexesForRoot\":[1015582593]},{\"numaNodeIndex\":1461211866,\"totalMemoryInMb\":880079432937074833,\"logicalCoreCountPerCore\":1926666832,\"effectiveAvailableMemoryInMb\":634490199641305059,\"freeVCpuIndexesForHpn\":[1214974585],\"vCpuIndexesForHpn\":[287041746,189493826,1202424668,647346434],\"vCpuIndexesForRoot\":[429689436,1368964811,90585391,209065244]}]},\"czhonnxkr\":{\"hostName\":\"iithtywu\",\"effectiveAvailableMemoryMbOnHost\":7718798958168735300,\"availableGpuCount\":40609312,\"vmUsedMemory\":{\"wjchrdg\":{\"startupMemoryMB\":3527058341546339239,\"currentMemoryUsageMB\":6534046956232130142},\"ctondz\":{\"startupMemoryMB\":3937799018867892667,\"currentMemoryUsageMB\":7107037042754238104}},\"gpuType\":\"uu\",\"numaNodesData\":[{\"numaNodeIndex\":1077343695,\"totalMemoryInMb\":1441267877176887045,\"logicalCoreCountPerCore\":407564287,\"effectiveAvailableMemoryInMb\":2673024793432025368,\"freeVCpuIndexesForHpn\":[1346692611],\"vCpuIndexesForHpn\":[10157721,1304318948],\"vCpuIndexesForRoot\":[800109726,1079630013,405729519]},{\"numaNodeIndex\":1568035160,\"totalMemoryInMb\":3636581995811123220,\"logicalCoreCountPerCore\":757625911,\"effectiveAvailableMemoryInMb\":8788016992255989866,\"freeVCpuIndexesForHpn\":[2032405708,2020364194,1701752170],\"vCpuIndexesForHpn\":[1651925529,1355731077,880287317,1901745406],\"vCpuIndexesForRoot\":[573321643,584179057,1105957042,2032190732]},{\"numaNodeIndex\":266606002,\"totalMemoryInMb\":1010490358854257374,\"logicalCoreCountPerCore\":285792006,\"effectiveAvailableMemoryInMb\":3158942446322112835,\"freeVCpuIndexesForHpn\":[329518875,1047026822],\"vCpuIndexesForHpn\":[1333681706,249986530],\"vCpuIndexesForRoot\":[957353101]},{\"numaNodeIndex\":2015224761,\"totalMemoryInMb\":611637503072689170,\"logicalCoreCountPerCore\":1624157938,\"effectiveAvailableMemoryInMb\":1499717509379744462,\"freeVCpuIndexesForHpn\":[1489812778,351015732,1206467391,1553856312],\"vCpuIndexesForHpn\":[26724739,441985867,105161174],\"vCpuIndexesForRoot\":[1977365948,1159690624,286111828]}]}}},\"id\":\"nyhmossxkkgthr\",\"name\":\"gh\",\"type\":\"jbdhqxvc\"}") + .toObject(DeviceCapacityInfoInner.class); + Assertions.assertEquals(OffsetDateTime.parse("2021-11-27T21:02:17Z"), model.timeStamp()); + Assertions.assertEquals(89.34209584899135D, model.clusterStorageCapacityInfo().clusterTotalStorageMb()); + Assertions.assertEquals(12.210910986805724D, model.clusterStorageCapacityInfo().clusterFreeStorageMb()); + Assertions.assertEquals("rvqqaatj", model.clusterComputeCapacityInfo().fqdn()); + Assertions.assertEquals("vgoup", model.clusterComputeCapacityInfo().gpuCapacity().gpuType()); + Assertions.assertEquals(1624473251, model.clusterComputeCapacityInfo().gpuCapacity().gpuUsedUnitsCount()); + Assertions.assertEquals(781426249, model.clusterComputeCapacityInfo().gpuCapacity().gpuFreeUnitsCount()); + Assertions.assertEquals(121941130, + model.clusterComputeCapacityInfo().gpuCapacity().gpuReservedForFailoverUnitsCount()); + Assertions.assertEquals(366208637, model.clusterComputeCapacityInfo().gpuCapacity().gpuTotalUnitsCount()); + Assertions.assertEquals(29.085261501197678D, + model.clusterComputeCapacityInfo().memoryCapacity().clusterFreeMemoryMb()); + Assertions.assertEquals(60.87162878665412D, + model.clusterComputeCapacityInfo().memoryCapacity().clusterUsedMemoryMb()); + Assertions.assertEquals(34.54433088697856D, + model.clusterComputeCapacityInfo().memoryCapacity().clusterFailoverMemoryMb()); + Assertions.assertEquals(25.223623232433802D, + model.clusterComputeCapacityInfo().memoryCapacity().clusterFragmentationMemoryMb()); + Assertions.assertEquals(94.3298441589831D, + model.clusterComputeCapacityInfo().memoryCapacity().clusterHypervReserveMemoryMb()); + Assertions.assertEquals(93.13111838664105D, + model.clusterComputeCapacityInfo().memoryCapacity().clusterInfraVmMemoryMb()); + Assertions.assertEquals(59.87106682567109D, + model.clusterComputeCapacityInfo().memoryCapacity().clusterTotalMemoryMb()); + Assertions.assertEquals(82.47209279338217D, + model.clusterComputeCapacityInfo().memoryCapacity().clusterNonFailoverVmMb()); + Assertions.assertEquals(62.14330743366697D, + model.clusterComputeCapacityInfo().memoryCapacity().clusterMemoryUsedByVmsMb()); + Assertions.assertEquals(OffsetDateTime.parse("2021-04-03T14:41:24Z"), + model.clusterComputeCapacityInfo().lastRefreshedTime()); + Assertions.assertEquals(593391508400046676L, model.clusterComputeCapacityInfo().totalProvisionedNonHpnCores()); + Assertions.assertEquals("xvvy", model.nodeCapacityInfos().get("tsgumhj").hostName()); + Assertions.assertEquals(446367325585574216L, + model.nodeCapacityInfos().get("tsgumhj").effectiveAvailableMemoryMbOnHost()); + Assertions.assertEquals(2121939227, model.nodeCapacityInfos().get("tsgumhj").availableGpuCount()); + Assertions.assertEquals(659192510788744677L, + model.nodeCapacityInfos().get("tsgumhj").vmUsedMemory().get("uvwzfbnh").startupMemoryMB()); + Assertions.assertEquals(754056912237486709L, + model.nodeCapacityInfos().get("tsgumhj").vmUsedMemory().get("uvwzfbnh").currentMemoryUsageMB()); + Assertions.assertEquals("xexccbdreaxhcexd", model.nodeCapacityInfos().get("tsgumhj").gpuType()); + Assertions.assertEquals(1241067704, + model.nodeCapacityInfos().get("tsgumhj").numaNodesData().get(0).numaNodeIndex()); + Assertions.assertEquals(4457997011490580036L, + model.nodeCapacityInfos().get("tsgumhj").numaNodesData().get(0).totalMemoryInMb()); + Assertions.assertEquals(1584778168, + model.nodeCapacityInfos().get("tsgumhj").numaNodesData().get(0).logicalCoreCountPerCore()); + Assertions.assertEquals(7920652979146329739L, + model.nodeCapacityInfos().get("tsgumhj").numaNodesData().get(0).effectiveAvailableMemoryInMb()); + Assertions.assertEquals(1376056830, + model.nodeCapacityInfos().get("tsgumhj").numaNodesData().get(0).freeVCpuIndexesForHpn().get(0)); + Assertions.assertEquals(441495179, + model.nodeCapacityInfos().get("tsgumhj").numaNodesData().get(0).vCpuIndexesForHpn().get(0)); + Assertions.assertEquals(146536566, + model.nodeCapacityInfos().get("tsgumhj").numaNodesData().get(0).vCpuIndexesForRoot().get(0)); + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/DeviceCapacityInfoPropertiesTests.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/DeviceCapacityInfoPropertiesTests.java new file mode 100644 index 000000000000..7278c678400f --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/DeviceCapacityInfoPropertiesTests.java @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.databoxedge.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.databoxedge.fluent.models.DeviceCapacityInfoProperties; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; + +public final class DeviceCapacityInfoPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + DeviceCapacityInfoProperties model = BinaryData.fromString( + "{\"timeStamp\":\"2021-03-11T05:53:58Z\",\"clusterStorageCapacityInfo\":{\"clusterTotalStorageMb\":60.93130034028027,\"clusterFreeStorageMb\":81.1170037569868},\"clusterComputeCapacityInfo\":{\"fqdn\":\"rnsvbuswd\",\"gpuCapacity\":{\"gpuType\":\"ybycnunvj\",\"gpuUsedUnitsCount\":1037847235,\"gpuFreeUnitsCount\":76797312,\"gpuReservedForFailoverUnitsCount\":1356782520,\"gpuTotalUnitsCount\":1955812770},\"memoryCapacity\":{\"clusterFreeMemoryMb\":54.75726063061687,\"clusterUsedMemoryMb\":85.2762415485035,\"clusterFailoverMemoryMb\":70.08729564174045,\"clusterFragmentationMemoryMb\":41.72716116241939,\"clusterHypervReserveMemoryMb\":0.34203436944628685,\"clusterInfraVmMemoryMb\":83.62443031079499,\"clusterTotalMemoryMb\":22.206407353508297,\"clusterNonFailoverVmMb\":62.92939542242835,\"clusterMemoryUsedByVmsMb\":8.254263158693165},\"lastRefreshedTime\":\"2021-08-26T08:06:53Z\",\"totalProvisionedNonHpnCores\":1364801760742969084},\"nodeCapacityInfos\":{\"xacpqjli\":{\"hostName\":\"tqmieox\",\"effectiveAvailableMemoryMbOnHost\":3407001905687200416,\"availableGpuCount\":108943004,\"vmUsedMemory\":{\"hhavgrvkffovjz\":{\"startupMemoryMB\":7942093859872352561,\"currentMemoryUsageMB\":2866985325528678483},\"jmfxumvf\":{\"startupMemoryMB\":5645922877678061686,\"currentMemoryUsageMB\":2314195344847215175}},\"gpuType\":\"uyovw\",\"numaNodesData\":[{\"numaNodeIndex\":1190343905,\"totalMemoryInMb\":7758201822450371098,\"logicalCoreCountPerCore\":1537243599,\"effectiveAvailableMemoryInMb\":1741934125627183360,\"freeVCpuIndexesForHpn\":[638105494,215949715],\"vCpuIndexesForHpn\":[619889018,1345497000,1954824970,1913424270],\"vCpuIndexesForRoot\":[718356396,1916825220]},{\"numaNodeIndex\":921177918,\"totalMemoryInMb\":3233631838729398934,\"logicalCoreCountPerCore\":931895437,\"effectiveAvailableMemoryInMb\":1865039483213614039,\"freeVCpuIndexesForHpn\":[850066644,602738724,1950660083,967647166],\"vCpuIndexesForHpn\":[1061424491],\"vCpuIndexesForRoot\":[1871477437,2085086631,2046676539]},{\"numaNodeIndex\":224040944,\"totalMemoryInMb\":4495541268478193562,\"logicalCoreCountPerCore\":593893972,\"effectiveAvailableMemoryInMb\":2974540016936368802,\"freeVCpuIndexesForHpn\":[1232312052,1164354320,2030576652],\"vCpuIndexesForHpn\":[800665018,1126923901,326840480],\"vCpuIndexesForRoot\":[689928385,1012441055]},{\"numaNodeIndex\":1018101586,\"totalMemoryInMb\":8990215421896908005,\"logicalCoreCountPerCore\":37194957,\"effectiveAvailableMemoryInMb\":9098240830909229625,\"freeVCpuIndexesForHpn\":[612228452,849605054,1311357803],\"vCpuIndexesForHpn\":[1678964850,828485961,420468172,1383298252],\"vCpuIndexesForRoot\":[1250409644]}]},\"n\":{\"hostName\":\"yuspskas\",\"effectiveAvailableMemoryMbOnHost\":9102213549851519142,\"availableGpuCount\":363338546,\"vmUsedMemory\":{\"vpa\":{\"startupMemoryMB\":316998115610761831,\"currentMemoryUsageMB\":9073448829959810089}},\"gpuType\":\"sreuzvxurisjnh\",\"numaNodesData\":[{\"numaNodeIndex\":1315745127,\"totalMemoryInMb\":4175162265983348993,\"logicalCoreCountPerCore\":351855115,\"effectiveAvailableMemoryInMb\":605829579091214596,\"freeVCpuIndexesForHpn\":[912922053,366790894,403382899],\"vCpuIndexesForHpn\":[1638829900,1928242324,771050161,1632941249],\"vCpuIndexesForRoot\":[1760346913]},{\"numaNodeIndex\":1785094261,\"totalMemoryInMb\":1854714147924765277,\"logicalCoreCountPerCore\":210626246,\"effectiveAvailableMemoryInMb\":2888604604095787464,\"freeVCpuIndexesForHpn\":[610822697],\"vCpuIndexesForHpn\":[521171059,89548348],\"vCpuIndexesForRoot\":[172969394,938622806,1665134354,1944953074]}]},\"vdsrhnjiv\":{\"hostName\":\"ypsxjvfoim\",\"effectiveAvailableMemoryMbOnHost\":8042667527966501304,\"availableGpuCount\":32469053,\"vmUsedMemory\":{\"fceacvlhvygd\":{\"startupMemoryMB\":3319429564024362130,\"currentMemoryUsageMB\":5029301967777206897}},\"gpuType\":\"t\",\"numaNodesData\":[{\"numaNodeIndex\":381355743,\"totalMemoryInMb\":4593360504928501229,\"logicalCoreCountPerCore\":951831262,\"effectiveAvailableMemoryInMb\":3378863236270841082,\"freeVCpuIndexesForHpn\":[1632414232,1263082708,1225451286],\"vCpuIndexesForHpn\":[974683865,625125018],\"vCpuIndexesForRoot\":[589391699,227185061]},{\"numaNodeIndex\":1877991674,\"totalMemoryInMb\":2955435170295088676,\"logicalCoreCountPerCore\":452306510,\"effectiveAvailableMemoryInMb\":4889988731710114347,\"freeVCpuIndexesForHpn\":[1941100702],\"vCpuIndexesForHpn\":[98859103,2099945195,995408685],\"vCpuIndexesForRoot\":[1152356837,550390162]},{\"numaNodeIndex\":1484203808,\"totalMemoryInMb\":8103244431627938636,\"logicalCoreCountPerCore\":1222828891,\"effectiveAvailableMemoryInMb\":1689633603053171301,\"freeVCpuIndexesForHpn\":[654040507,703238637,274681299],\"vCpuIndexesForHpn\":[172604162,741141390,725495584,1006090143],\"vCpuIndexesForRoot\":[732496831,2140259102]}]}}}") + .toObject(DeviceCapacityInfoProperties.class); + Assertions.assertEquals(OffsetDateTime.parse("2021-03-11T05:53:58Z"), model.timeStamp()); + Assertions.assertEquals(60.93130034028027D, model.clusterStorageCapacityInfo().clusterTotalStorageMb()); + Assertions.assertEquals(81.1170037569868D, model.clusterStorageCapacityInfo().clusterFreeStorageMb()); + Assertions.assertEquals("rnsvbuswd", model.clusterComputeCapacityInfo().fqdn()); + Assertions.assertEquals("ybycnunvj", model.clusterComputeCapacityInfo().gpuCapacity().gpuType()); + Assertions.assertEquals(1037847235, model.clusterComputeCapacityInfo().gpuCapacity().gpuUsedUnitsCount()); + Assertions.assertEquals(76797312, model.clusterComputeCapacityInfo().gpuCapacity().gpuFreeUnitsCount()); + Assertions.assertEquals(1356782520, + model.clusterComputeCapacityInfo().gpuCapacity().gpuReservedForFailoverUnitsCount()); + Assertions.assertEquals(1955812770, model.clusterComputeCapacityInfo().gpuCapacity().gpuTotalUnitsCount()); + Assertions.assertEquals(54.75726063061687D, + model.clusterComputeCapacityInfo().memoryCapacity().clusterFreeMemoryMb()); + Assertions.assertEquals(85.2762415485035D, + model.clusterComputeCapacityInfo().memoryCapacity().clusterUsedMemoryMb()); + Assertions.assertEquals(70.08729564174045D, + model.clusterComputeCapacityInfo().memoryCapacity().clusterFailoverMemoryMb()); + Assertions.assertEquals(41.72716116241939D, + model.clusterComputeCapacityInfo().memoryCapacity().clusterFragmentationMemoryMb()); + Assertions.assertEquals(0.34203436944628685D, + model.clusterComputeCapacityInfo().memoryCapacity().clusterHypervReserveMemoryMb()); + Assertions.assertEquals(83.62443031079499D, + model.clusterComputeCapacityInfo().memoryCapacity().clusterInfraVmMemoryMb()); + Assertions.assertEquals(22.206407353508297D, + model.clusterComputeCapacityInfo().memoryCapacity().clusterTotalMemoryMb()); + Assertions.assertEquals(62.92939542242835D, + model.clusterComputeCapacityInfo().memoryCapacity().clusterNonFailoverVmMb()); + Assertions.assertEquals(8.254263158693165D, + model.clusterComputeCapacityInfo().memoryCapacity().clusterMemoryUsedByVmsMb()); + Assertions.assertEquals(OffsetDateTime.parse("2021-08-26T08:06:53Z"), + model.clusterComputeCapacityInfo().lastRefreshedTime()); + Assertions.assertEquals(1364801760742969084L, model.clusterComputeCapacityInfo().totalProvisionedNonHpnCores()); + Assertions.assertEquals("tqmieox", model.nodeCapacityInfos().get("xacpqjli").hostName()); + Assertions.assertEquals(3407001905687200416L, + model.nodeCapacityInfos().get("xacpqjli").effectiveAvailableMemoryMbOnHost()); + Assertions.assertEquals(108943004, model.nodeCapacityInfos().get("xacpqjli").availableGpuCount()); + Assertions.assertEquals(7942093859872352561L, + model.nodeCapacityInfos().get("xacpqjli").vmUsedMemory().get("hhavgrvkffovjz").startupMemoryMB()); + Assertions.assertEquals(2866985325528678483L, + model.nodeCapacityInfos().get("xacpqjli").vmUsedMemory().get("hhavgrvkffovjz").currentMemoryUsageMB()); + Assertions.assertEquals("uyovw", model.nodeCapacityInfos().get("xacpqjli").gpuType()); + Assertions.assertEquals(1190343905, + model.nodeCapacityInfos().get("xacpqjli").numaNodesData().get(0).numaNodeIndex()); + Assertions.assertEquals(7758201822450371098L, + model.nodeCapacityInfos().get("xacpqjli").numaNodesData().get(0).totalMemoryInMb()); + Assertions.assertEquals(1537243599, + model.nodeCapacityInfos().get("xacpqjli").numaNodesData().get(0).logicalCoreCountPerCore()); + Assertions.assertEquals(1741934125627183360L, + model.nodeCapacityInfos().get("xacpqjli").numaNodesData().get(0).effectiveAvailableMemoryInMb()); + Assertions.assertEquals(638105494, + model.nodeCapacityInfos().get("xacpqjli").numaNodesData().get(0).freeVCpuIndexesForHpn().get(0)); + Assertions.assertEquals(619889018, + model.nodeCapacityInfos().get("xacpqjli").numaNodesData().get(0).vCpuIndexesForHpn().get(0)); + Assertions.assertEquals(718356396, + model.nodeCapacityInfos().get("xacpqjli").numaNodesData().get(0).vCpuIndexesForRoot().get(0)); + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/DeviceCapacityInfoesGetDeviceCapacityInfoWithResponseMockTests.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/DeviceCapacityInfoesGetDeviceCapacityInfoWithResponseMockTests.java new file mode 100644 index 000000000000..a2c8c3a756cd --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/DeviceCapacityInfoesGetDeviceCapacityInfoWithResponseMockTests.java @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.databoxedge.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.databoxedge.DataBoxEdgeManager; +import com.azure.resourcemanager.databoxedge.models.DeviceCapacityInfo; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class DeviceCapacityInfoesGetDeviceCapacityInfoWithResponseMockTests { + @Test + public void testGetDeviceCapacityInfoWithResponse() throws Exception { + String responseStr + = "{\"properties\":{\"timeStamp\":\"2021-07-11T09:53:45Z\",\"clusterStorageCapacityInfo\":{\"clusterTotalStorageMb\":12.347370894334986,\"clusterFreeStorageMb\":16.639704594397298},\"clusterComputeCapacityInfo\":{\"fqdn\":\"flnwy\",\"gpuCapacity\":{\"gpuType\":\"xrerlniylylyf\",\"gpuUsedUnitsCount\":1823905170,\"gpuFreeUnitsCount\":856698353,\"gpuReservedForFailoverUnitsCount\":940843916,\"gpuTotalUnitsCount\":1491604791},\"memoryCapacity\":{\"clusterFreeMemoryMb\":7.448081638131965,\"clusterUsedMemoryMb\":96.25715728259036,\"clusterFailoverMemoryMb\":77.93376879045461,\"clusterFragmentationMemoryMb\":90.98900884918515,\"clusterHypervReserveMemoryMb\":24.077750313814228,\"clusterInfraVmMemoryMb\":55.77038235319657,\"clusterTotalMemoryMb\":74.1770468361796,\"clusterNonFailoverVmMb\":38.243065707057745,\"clusterMemoryUsedByVmsMb\":67.50522618380931},\"lastRefreshedTime\":\"2021-10-31T20:37:14Z\",\"totalProvisionedNonHpnCores\":5822463104061015574},\"nodeCapacityInfos\":{\"avsczuejdtxp\":{\"hostName\":\"afeddwwnlza\",\"effectiveAvailableMemoryMbOnHost\":2372646677215374842,\"availableGpuCount\":1657667707,\"vmUsedMemory\":{\"gookrtalvnb\":{},\"gpbemeluclvdjju\":{},\"yrdnqod\":{},\"ahhxhqfaqnvzoqg\":{}},\"gpuType\":\"pem\",\"numaNodesData\":[{},{},{}]},\"hychocokuleh\":{\"hostName\":\"ghwzhomewjjstli\",\"effectiveAvailableMemoryMbOnHost\":1800612963256769496,\"availableGpuCount\":2067829444,\"vmUsedMemory\":{\"ia\":{},\"cz\":{},\"vodrrslblxydkxr\":{}},\"gpuType\":\"vbxiwkgfbqlj\",\"numaNodesData\":[{},{},{},{}]}}},\"id\":\"qlrqffaweyurk\",\"name\":\"hy\",\"type\":\"dxravj\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + DataBoxEdgeManager manager = DataBoxEdgeManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + DeviceCapacityInfo response = manager.deviceCapacityInfoes() + .getDeviceCapacityInfoWithResponse("sjsz", "bscm", com.azure.core.util.Context.NONE) + .getValue(); + + Assertions.assertEquals(OffsetDateTime.parse("2021-07-11T09:53:45Z"), response.timeStamp()); + Assertions.assertEquals(12.347370894334986D, response.clusterStorageCapacityInfo().clusterTotalStorageMb()); + Assertions.assertEquals(16.639704594397298D, response.clusterStorageCapacityInfo().clusterFreeStorageMb()); + Assertions.assertEquals("flnwy", response.clusterComputeCapacityInfo().fqdn()); + Assertions.assertEquals("xrerlniylylyf", response.clusterComputeCapacityInfo().gpuCapacity().gpuType()); + Assertions.assertEquals(1823905170, response.clusterComputeCapacityInfo().gpuCapacity().gpuUsedUnitsCount()); + Assertions.assertEquals(856698353, response.clusterComputeCapacityInfo().gpuCapacity().gpuFreeUnitsCount()); + Assertions.assertEquals(940843916, + response.clusterComputeCapacityInfo().gpuCapacity().gpuReservedForFailoverUnitsCount()); + Assertions.assertEquals(1491604791, response.clusterComputeCapacityInfo().gpuCapacity().gpuTotalUnitsCount()); + Assertions.assertEquals(7.448081638131965D, + response.clusterComputeCapacityInfo().memoryCapacity().clusterFreeMemoryMb()); + Assertions.assertEquals(96.25715728259036D, + response.clusterComputeCapacityInfo().memoryCapacity().clusterUsedMemoryMb()); + Assertions.assertEquals(77.93376879045461D, + response.clusterComputeCapacityInfo().memoryCapacity().clusterFailoverMemoryMb()); + Assertions.assertEquals(90.98900884918515D, + response.clusterComputeCapacityInfo().memoryCapacity().clusterFragmentationMemoryMb()); + Assertions.assertEquals(24.077750313814228D, + response.clusterComputeCapacityInfo().memoryCapacity().clusterHypervReserveMemoryMb()); + Assertions.assertEquals(55.77038235319657D, + response.clusterComputeCapacityInfo().memoryCapacity().clusterInfraVmMemoryMb()); + Assertions.assertEquals(74.1770468361796D, + response.clusterComputeCapacityInfo().memoryCapacity().clusterTotalMemoryMb()); + Assertions.assertEquals(38.243065707057745D, + response.clusterComputeCapacityInfo().memoryCapacity().clusterNonFailoverVmMb()); + Assertions.assertEquals(67.50522618380931D, + response.clusterComputeCapacityInfo().memoryCapacity().clusterMemoryUsedByVmsMb()); + Assertions.assertEquals(OffsetDateTime.parse("2021-10-31T20:37:14Z"), + response.clusterComputeCapacityInfo().lastRefreshedTime()); + Assertions.assertEquals(5822463104061015574L, + response.clusterComputeCapacityInfo().totalProvisionedNonHpnCores()); + Assertions.assertEquals("afeddwwnlza", response.nodeCapacityInfos().get("avsczuejdtxp").hostName()); + Assertions.assertEquals(2372646677215374842L, + response.nodeCapacityInfos().get("avsczuejdtxp").effectiveAvailableMemoryMbOnHost()); + Assertions.assertEquals(1657667707, response.nodeCapacityInfos().get("avsczuejdtxp").availableGpuCount()); + Assertions.assertEquals("pem", response.nodeCapacityInfos().get("avsczuejdtxp").gpuType()); + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/DevicesCreateOrUpdateMockTests.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/DevicesCreateOrUpdateMockTests.java deleted file mode 100644 index 1f8c3d91d610..000000000000 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/DevicesCreateOrUpdateMockTests.java +++ /dev/null @@ -1,74 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.databoxedge.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.databoxedge.DataBoxEdgeManager; -import com.azure.resourcemanager.databoxedge.models.DataBoxEdgeDevice; -import com.azure.resourcemanager.databoxedge.models.DataBoxEdgeDeviceStatus; -import com.azure.resourcemanager.databoxedge.models.Sku; -import com.azure.resourcemanager.databoxedge.models.SkuName; -import com.azure.resourcemanager.databoxedge.models.SkuTier; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class DevicesCreateOrUpdateMockTests { - @Test - public void testCreateOrUpdate() throws Exception { - String responseStr - = "{\"location\":\"pjuohminyfl\",\"tags\":{\"vwpklvxwmygdxp\":\"wmd\"},\"sku\":{\"name\":\"TEA_1Node_UPS_Heater\",\"tier\":\"Standard\"},\"etag\":\"zepn\",\"properties\":{\"dataBoxEdgeDeviceStatus\":\"Maintenance\",\"serialNumber\":\"xgibbda\",\"description\":\"onfo\",\"modelDescription\":\"uors\",\"deviceType\":\"DataBoxEdgeDevice\",\"friendlyName\":\"wbqpl\",\"culture\":\"vnuuepzl\",\"deviceModel\":\"hw\",\"deviceSoftwareVersion\":\"oldweyuqdu\",\"deviceLocalCapacity\":5989129131388506545,\"timeZone\":\"rwrbi\",\"deviceHcsVersion\":\"ktalywjhhgdnhxms\",\"configuredRoleTypes\":[\"IOT\",\"Cognitive\",\"Functions\"],\"nodeCount\":486711131},\"id\":\"xggdufi\",\"name\":\"ndieuzaofj\",\"type\":\"hvcyyysfg\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - DataBoxEdgeManager manager = DataBoxEdgeManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - DataBoxEdgeDevice response = manager.devices() - .define("lkxt") - .withRegion("fwsrtawcoezbrhu") - .withExistingResourceGroup("qjfsmlmbtxhw") - .withTags(mapOf("goo", "hud")) - .withSku(new Sku().withName(SkuName.GATEWAY).withTier(SkuTier.STANDARD)) - .withEtag("bvleorfmluiqtqzf") - .withDataBoxEdgeDeviceStatus(DataBoxEdgeDeviceStatus.OFFLINE) - .withDescription("yjkqabqgzslesjcb") - .withModelDescription("rnntiewdjcv") - .withFriendlyName("rbe") - .create(); - - Assertions.assertEquals("pjuohminyfl", response.location()); - Assertions.assertEquals("wmd", response.tags().get("vwpklvxwmygdxp")); - Assertions.assertEquals(SkuName.TEA_1NODE_UPS_HEATER, response.sku().name()); - Assertions.assertEquals(SkuTier.STANDARD, response.sku().tier()); - Assertions.assertEquals("zepn", response.etag()); - Assertions.assertEquals(DataBoxEdgeDeviceStatus.MAINTENANCE, response.dataBoxEdgeDeviceStatus()); - Assertions.assertEquals("onfo", response.description()); - Assertions.assertEquals("uors", response.modelDescription()); - Assertions.assertEquals("wbqpl", response.friendlyName()); - } - - // Use "Map.of" if available - @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/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/DevicesCreateOrUpdateWithResponseMockTests.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/DevicesCreateOrUpdateWithResponseMockTests.java new file mode 100644 index 000000000000..3f543dde4727 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/DevicesCreateOrUpdateWithResponseMockTests.java @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.databoxedge.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.databoxedge.DataBoxEdgeManager; +import com.azure.resourcemanager.databoxedge.models.DataBoxEdgeDevice; +import com.azure.resourcemanager.databoxedge.models.DataResidency; +import com.azure.resourcemanager.databoxedge.models.DataResidencyType; +import com.azure.resourcemanager.databoxedge.models.MsiIdentityType; +import com.azure.resourcemanager.databoxedge.models.ResourceIdentity; +import com.azure.resourcemanager.databoxedge.models.Sku; +import com.azure.resourcemanager.databoxedge.models.SkuName; +import com.azure.resourcemanager.databoxedge.models.SkuTier; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class DevicesCreateOrUpdateWithResponseMockTests { + @Test + public void testCreateOrUpdateWithResponse() throws Exception { + String responseStr + = "{\"properties\":{\"dataBoxEdgeDeviceStatus\":\"PartiallyDisconnected\",\"serialNumber\":\"vwkpqh\",\"description\":\"enuygbq\",\"modelDescription\":\"qekewvnqvcd\",\"deviceType\":\"DataBoxEdgeDevice\",\"friendlyName\":\"ucmfdj\",\"culture\":\"laxpunj\",\"deviceModel\":\"kczvvita\",\"deviceSoftwareVersion\":\"xmfcsserxhtv\",\"deviceLocalCapacity\":3510960824067329346,\"timeZone\":\"wntsjgqrsxy\",\"deviceHcsVersion\":\"uuuybnchrsziz\",\"configuredRoleTypes\":[\"CloudEdgeManagement\",\"Cognitive\",\"Cognitive\"],\"nodeCount\":394924929,\"resourceMoveDetails\":{\"operationInProgress\":\"ResourceMoveInProgress\",\"operationInProgressLockTimeoutInUTC\":\"2021-09-02T15:29:49Z\"},\"edgeProfile\":{\"subscription\":{\"registrationId\":\"gagflnlgmtrwah\",\"id\":\"mu\",\"state\":\"Deleted\",\"registrationDate\":\"yrplrohkpigqfus\",\"subscriptionId\":\"kzmkwklsnoxaxmqe\",\"properties\":{\"tenantId\":\"h\",\"locationPlacementId\":\"nhg\",\"quotaId\":\"dyynfsvkhgb\",\"serializedDetails\":\"ta\",\"registeredFeatures\":[{}]}}},\"dataResidency\":{\"type\":\"GeoZoneReplication\"},\"kubernetesWorkloadProfile\":\"ukhpyrneizjcp\"},\"sku\":{\"name\":\"EP2_256_2T4_W\",\"tier\":\"Standard\"},\"etag\":\"gbrouxddbh\",\"identity\":{\"type\":\"SystemAssigned\",\"principalId\":\"azjzo\",\"tenantId\":\"jxhpdulontacn\"},\"kind\":\"AzureDataBoxGateway\",\"location\":\"ehtuevrhr\",\"tags\":{\"reur\":\"oogwxhnsduugwb\",\"fuarenlvhht\":\"q\"},\"id\":\"lnvnafvvkyfedev\",\"name\":\"bo\",\"type\":\"lcqxypokk\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + DataBoxEdgeManager manager = DataBoxEdgeManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + DataBoxEdgeDevice response = manager.devices() + .define("jvidttge") + .withRegion("wkffdjkt") + .withExistingResourceGroup("cq") + .withTags(mapOf("lglxnfui", "idfv", "qogsfikayian", "tkbu")) + .withSku(new Sku().withName(SkuName.EDGE_PR_BASE).withTier(SkuTier.STANDARD)) + .withEtag("txejwabm") + .withIdentity(new ResourceIdentity().withType(MsiIdentityType.NONE)) + .withDataResidency(new DataResidency().withType(DataResidencyType.GEO_ZONE_REPLICATION)) + .create(); + + Assertions.assertEquals("ehtuevrhr", response.location()); + Assertions.assertEquals("oogwxhnsduugwb", response.tags().get("reur")); + Assertions.assertEquals(SkuName.EP2_256_2T4_W, response.sku().name()); + Assertions.assertEquals(SkuTier.STANDARD, response.sku().tier()); + Assertions.assertEquals("gbrouxddbh", response.etag()); + Assertions.assertEquals(MsiIdentityType.SYSTEM_ASSIGNED, response.identity().type()); + Assertions.assertEquals(DataResidencyType.GEO_ZONE_REPLICATION, response.dataResidency().type()); + } + + // Use "Map.of" if available + @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/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/DevicesDeleteMockTests.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/DevicesDeleteMockTests.java index d23e2edb1cea..1e1733002e51 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/DevicesDeleteMockTests.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/DevicesDeleteMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.databoxedge.DataBoxEdgeManager; import java.nio.charset.StandardCharsets; @@ -25,9 +25,9 @@ public void testDelete() throws Exception { DataBoxEdgeManager manager = DataBoxEdgeManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - manager.devices().delete("rgnepttwqmsniffc", "mqnrojlpijnkr", com.azure.core.util.Context.NONE); + manager.devices().delete("hflzokxco", "pelnjetag", com.azure.core.util.Context.NONE); } } diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/DevicesDownloadUpdatesMockTests.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/DevicesDownloadUpdatesMockTests.java index 3870ac837e5e..0571eedf46fa 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/DevicesDownloadUpdatesMockTests.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/DevicesDownloadUpdatesMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.databoxedge.DataBoxEdgeManager; import java.nio.charset.StandardCharsets; @@ -25,9 +25,9 @@ public void testDownloadUpdates() throws Exception { DataBoxEdgeManager manager = DataBoxEdgeManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - manager.devices().downloadUpdates("frddhcrati", "zronasxift", com.azure.core.util.Context.NONE); + manager.devices().downloadUpdates("kzsz", "wiwtglxxhl", com.azure.core.util.Context.NONE); } } diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/DevicesGetByResourceGroupWithResponseMockTests.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/DevicesGetByResourceGroupWithResponseMockTests.java index 637f7f18fc0a..31ae2307a615 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/DevicesGetByResourceGroupWithResponseMockTests.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/DevicesGetByResourceGroupWithResponseMockTests.java @@ -1,17 +1,18 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.databoxedge.DataBoxEdgeManager; import com.azure.resourcemanager.databoxedge.models.DataBoxEdgeDevice; -import com.azure.resourcemanager.databoxedge.models.DataBoxEdgeDeviceStatus; +import com.azure.resourcemanager.databoxedge.models.DataResidencyType; +import com.azure.resourcemanager.databoxedge.models.MsiIdentityType; import com.azure.resourcemanager.databoxedge.models.SkuName; import com.azure.resourcemanager.databoxedge.models.SkuTier; import java.nio.charset.StandardCharsets; @@ -24,27 +25,25 @@ public final class DevicesGetByResourceGroupWithResponseMockTests { @Test public void testGetByResourceGroupWithResponse() throws Exception { String responseStr - = "{\"location\":\"ixqtn\",\"tags\":{\"fffiak\":\"ezl\",\"tmmjihyeozph\":\"jpqqmted\"},\"sku\":{\"name\":\"TEA_1Node\",\"tier\":\"Standard\"},\"etag\":\"c\",\"properties\":{\"dataBoxEdgeDeviceStatus\":\"NeedsAttention\",\"serialNumber\":\"vipmdscwxqupevzh\",\"description\":\"totxhojujb\",\"modelDescription\":\"elmcuvhixbjxyfw\",\"deviceType\":\"DataBoxEdgeDevice\",\"friendlyName\":\"coolsttpkiwkkb\",\"culture\":\"jrywvtylbfpnc\",\"deviceModel\":\"doiwi\",\"deviceSoftwareVersion\":\"htywubxcbihwq\",\"deviceLocalCapacity\":6769661922262324698,\"timeZone\":\"twjchrdg\",\"deviceHcsVersion\":\"hxumwctondzj\",\"configuredRoleTypes\":[\"Functions\",\"ASA\"],\"nodeCount\":559773870},\"id\":\"wggytsbwtovvt\",\"name\":\"seinqfiuf\",\"type\":\"qknp\"}"; + = "{\"properties\":{\"dataBoxEdgeDeviceStatus\":\"ReadyToSetup\",\"serialNumber\":\"wl\",\"description\":\"jwetnpsihcla\",\"modelDescription\":\"va\",\"deviceType\":\"DataBoxEdgeDevice\",\"friendlyName\":\"rsqqwztcm\",\"culture\":\"kchcxwa\",\"deviceModel\":\"ewzjkjexfd\",\"deviceSoftwareVersion\":\"vhpsylkkshkbffmb\",\"deviceLocalCapacity\":8008865385735270235,\"timeZone\":\"gywwpgjxs\",\"deviceHcsVersion\":\"tf\",\"configuredRoleTypes\":[\"Functions\",\"Kubernetes\",\"Cognitive\",\"Cognitive\"],\"nodeCount\":226222516,\"resourceMoveDetails\":{\"operationInProgress\":\"ResourceMoveFailed\",\"operationInProgressLockTimeoutInUTC\":\"2021-07-31T03:17:47Z\"},\"edgeProfile\":{\"subscription\":{\"registrationId\":\"dewemxswv\",\"id\":\"unzzjgehk\",\"state\":\"Deleted\",\"registrationDate\":\"rtixokff\",\"subscriptionId\":\"inljqepqwhixmo\",\"properties\":{\"tenantId\":\"shiy\",\"locationPlacementId\":\"velfcldu\",\"quotaId\":\"birdsvuwcobiegs\",\"serializedDetails\":\"ninwjizc\",\"registeredFeatures\":[{},{}]}}},\"dataResidency\":{\"type\":\"ZoneReplication\"},\"kubernetesWorkloadProfile\":\"h\"},\"sku\":{\"name\":\"TCA_Small\",\"tier\":\"Standard\"},\"etag\":\"muluxlx\",\"identity\":{\"type\":\"None\",\"principalId\":\"rsbycucrwn\",\"tenantId\":\"ikzebr\"},\"kind\":\"AzureStackHub\",\"location\":\"swziq\",\"tags\":{\"vhczznvfby\":\"hokzrusw\"},\"id\":\"jsxjwwix\",\"name\":\"vumwmxqh\",\"type\":\"dvnoamldsehaohdj\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); DataBoxEdgeManager manager = DataBoxEdgeManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); DataBoxEdgeDevice response = manager.devices() - .getByResourceGroupWithResponse("rkpyouaibrebqaay", "j", com.azure.core.util.Context.NONE) + .getByResourceGroupWithResponse("crpfbcunez", "cez", com.azure.core.util.Context.NONE) .getValue(); - Assertions.assertEquals("ixqtn", response.location()); - Assertions.assertEquals("ezl", response.tags().get("fffiak")); - Assertions.assertEquals(SkuName.TEA_1NODE, response.sku().name()); + Assertions.assertEquals("swziq", response.location()); + Assertions.assertEquals("hokzrusw", response.tags().get("vhczznvfby")); + Assertions.assertEquals(SkuName.TCA_SMALL, response.sku().name()); Assertions.assertEquals(SkuTier.STANDARD, response.sku().tier()); - Assertions.assertEquals("c", response.etag()); - Assertions.assertEquals(DataBoxEdgeDeviceStatus.NEEDS_ATTENTION, response.dataBoxEdgeDeviceStatus()); - Assertions.assertEquals("totxhojujb", response.description()); - Assertions.assertEquals("elmcuvhixbjxyfw", response.modelDescription()); - Assertions.assertEquals("coolsttpkiwkkb", response.friendlyName()); + Assertions.assertEquals("muluxlx", response.etag()); + Assertions.assertEquals(MsiIdentityType.NONE, response.identity().type()); + Assertions.assertEquals(DataResidencyType.ZONE_REPLICATION, response.dataResidency().type()); } } diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/DevicesGetNetworkSettingsWithResponseMockTests.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/DevicesGetNetworkSettingsWithResponseMockTests.java index 8b0cfa95d0e5..adcf62ba59db 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/DevicesGetNetworkSettingsWithResponseMockTests.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/DevicesGetNetworkSettingsWithResponseMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.databoxedge.DataBoxEdgeManager; import com.azure.resourcemanager.databoxedge.models.NetworkSettings; @@ -20,17 +20,17 @@ public final class DevicesGetNetworkSettingsWithResponseMockTests { @Test public void testGetNetworkSettingsWithResponse() throws Exception { String responseStr - = "{\"properties\":{\"networkAdapters\":[{\"adapterId\":\"dsofbshrns\",\"adapterPosition\":{\"networkGroup\":\"NonRDMA\",\"port\":674116789},\"index\":106815843,\"nodeId\":\"ybycnunvj\",\"networkAdapterName\":\"tkfa\",\"label\":\"opqgikyzirtxdyux\",\"macAddress\":\"jntpsewgioilqu\",\"linkSpeed\":6255358176857067581,\"status\":\"Inactive\",\"rdmaStatus\":\"Capable\",\"dhcpStatus\":\"Enabled\",\"ipv4Configuration\":{\"ipAddress\":\"orgguf\",\"subnet\":\"aomtbghhavgrvkff\",\"gateway\":\"jzhpjbibgjmfx\"},\"ipv6Configuration\":{\"ipAddress\":\"fcluyov\",\"prefixLength\":592416055,\"gateway\":\"kfezzxscyhwz\"},\"ipv6LinkLocalAddress\":\"irujbz\",\"dnsServers\":[\"vzzbtdcq\",\"pniyujviyl\",\"dshf\"]},{\"adapterId\":\"n\",\"adapterPosition\":{\"networkGroup\":\"None\",\"port\":1591431592},\"index\":934099618,\"nodeId\":\"sgaojfmwncot\",\"networkAdapterName\":\"fhir\",\"label\":\"ymoxoftpipiwyczu\",\"macAddress\":\"a\",\"linkSpeed\":5299678736839094769,\"status\":\"Active\",\"rdmaStatus\":\"Incapable\",\"dhcpStatus\":\"Disabled\",\"ipv4Configuration\":{\"ipAddress\":\"skasdvlmfwdgzxu\",\"subnet\":\"cvpa\",\"gateway\":\"sreuzvxurisjnh\"},\"ipv6Configuration\":{\"ipAddress\":\"xifqjzgxm\",\"prefixLength\":983459975,\"gateway\":\"lw\"},\"ipv6LinkLocalAddress\":\"esutrgjupauutpw\",\"dnsServers\":[\"ih\",\"jqgwzp\",\"fqntcyp\",\"xjvfoimwksl\"]}]},\"id\":\"rcizjxvyd\",\"name\":\"ceacvlhvygdy\",\"type\":\"t\"}"; + = "{\"properties\":{\"networkAdapters\":[{\"adapterId\":\"iuubwefqsf\",\"adapterPosition\":{\"networkGroup\":\"RDMA\",\"port\":928069987},\"index\":1895381601,\"nodeId\":\"q\",\"networkAdapterName\":\"x\",\"label\":\"mfxapjwogqqno\",\"macAddress\":\"udcdabtqwpwyawb\",\"linkSpeed\":5559566767637280772,\"status\":\"Active\",\"rdmaStatus\":\"Incapable\",\"dhcpStatus\":\"Enabled\",\"ipv4Configuration\":{\"ipAddress\":\"exaoguya\",\"subnet\":\"ids\",\"gateway\":\"ultxijjumfq\"},\"ipv6Configuration\":{\"ipAddress\":\"lnqnmcjn\",\"prefixLength\":878214115,\"gateway\":\"qxtbjwgnyf\"},\"ipv6LinkLocalAddress\":\"fzsvtuikzh\",\"dnsServers\":[\"glcfhmlrqryxyn\",\"nzrdpsovwxz\",\"ptgoeiybbabp\",\"hv\"]},{\"adapterId\":\"lkvn\",\"adapterPosition\":{\"networkGroup\":\"None\",\"port\":744398036},\"index\":943098254,\"nodeId\":\"kyrioovzid\",\"networkAdapterName\":\"waabzmifrygzn\",\"label\":\"axri\",\"macAddress\":\"zob\",\"linkSpeed\":3393588735058009506,\"status\":\"Inactive\",\"rdmaStatus\":\"Capable\",\"dhcpStatus\":\"Enabled\",\"ipv4Configuration\":{\"ipAddress\":\"ieixynllxe\",\"subnet\":\"crojp\",\"gateway\":\"lhc\"},\"ipv6Configuration\":{\"ipAddress\":\"u\",\"prefixLength\":1033844337,\"gateway\":\"wfmvigorqjbt\"},\"ipv6LinkLocalAddress\":\"h\",\"dnsServers\":[\"lkafhonqjuje\"]},{\"adapterId\":\"kpzvcpopmxelnwc\",\"adapterPosition\":{\"networkGroup\":\"NonRDMA\",\"port\":1889348640},\"index\":1429091024,\"nodeId\":\"mlfmkqs\",\"networkAdapterName\":\"zuawxtzxpuamwa\",\"label\":\"xrvxcushsphai\",\"macAddress\":\"xyasflvgsgzw\",\"linkSpeed\":3593976183974666652,\"status\":\"Active\",\"rdmaStatus\":\"Capable\",\"dhcpStatus\":\"Enabled\",\"ipv4Configuration\":{\"ipAddress\":\"blmljh\",\"subnet\":\"ymzotqyryuzcbmq\",\"gateway\":\"xmvwfg\"},\"ipv6Configuration\":{\"ipAddress\":\"xo\",\"prefixLength\":1408862324,\"gateway\":\"e\"},\"ipv6LinkLocalAddress\":\"lzqnhcvs\",\"dnsServers\":[\"nzoibgsxgnx\",\"yqo\",\"mpqoxw\",\"o\"]},{\"adapterId\":\"bxiqxeiiqbimht\",\"adapterPosition\":{\"networkGroup\":\"None\",\"port\":152537554},\"index\":1724974013,\"nodeId\":\"qpofvwbc\",\"networkAdapterName\":\"embnkbw\",\"label\":\"vxkdivqihebwtswb\",\"macAddress\":\"wfmdurage\",\"linkSpeed\":8212495412619748670,\"status\":\"Active\",\"rdmaStatus\":\"Incapable\",\"dhcpStatus\":\"Disabled\",\"ipv4Configuration\":{\"ipAddress\":\"jubggbqigkxkb\",\"subnet\":\"zgakgacyrcmj\",\"gateway\":\"spofapvuhry\"},\"ipv6Configuration\":{\"ipAddress\":\"ofrzgb\",\"prefixLength\":726767515,\"gateway\":\"mstk\"},\"ipv6LinkLocalAddress\":\"l\",\"dnsServers\":[\"c\",\"iiznktwfan\"]}]},\"id\":\"v\",\"name\":\"dibmikostbzbkiwb\",\"type\":\"qnyophzfyls\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); DataBoxEdgeManager manager = DataBoxEdgeManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); NetworkSettings response = manager.devices() - .getNetworkSettingsWithResponse("thrrgh", "jbdhqxvc", com.azure.core.util.Context.NONE) + .getNetworkSettingsWithResponse("jh", "hzvechndbnwieho", com.azure.core.util.Context.NONE) .getValue(); } diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/DevicesGetUpdateSummaryWithResponseMockTests.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/DevicesGetUpdateSummaryWithResponseMockTests.java index d383a7514685..09cd6b541c37 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/DevicesGetUpdateSummaryWithResponseMockTests.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/DevicesGetUpdateSummaryWithResponseMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.databoxedge.DataBoxEdgeManager; import com.azure.resourcemanager.databoxedge.models.UpdateSummary; @@ -21,22 +21,25 @@ public final class DevicesGetUpdateSummaryWithResponseMockTests { @Test public void testGetUpdateSummaryWithResponse() throws Exception { String responseStr - = "{\"properties\":{\"deviceVersionNumber\":\"x\",\"friendlyDeviceVersionName\":\"uwrykqgaifmvikl\",\"deviceLastScannedDateTime\":\"2021-05-22T16:01:58Z\",\"lastCompletedScanJobDateTime\":\"2021-05-16T18:34:19Z\",\"lastCompletedDownloadJobDateTime\":\"2021-08-31T10:25:05Z\",\"lastCompletedInstallJobDateTime\":\"2021-09-28T11:16:32Z\",\"totalNumberOfUpdatesAvailable\":1630038130,\"totalNumberOfUpdatesPendingDownload\":732496831,\"totalNumberOfUpdatesPendingInstall\":246152016,\"rebootBehavior\":\"RequestReboot\",\"ongoingUpdateOperation\":\"Scan\",\"inProgressDownloadJobId\":\"jivolvtnov\",\"inProgressInstallJobId\":\"zgemjdftuljlt\",\"inProgressDownloadJobStartedDateTime\":\"2021-04-12T02:20:30Z\",\"inProgressInstallJobStartedDateTime\":\"2021-06-28T04:10:30Z\",\"updateTitles\":[\"mczuo\",\"ejwcwwqiok\",\"ssxmojms\",\"p\"],\"totalUpdateSizeInBytes\":99.08143470377058},\"id\":\"vk\",\"name\":\"cfzq\",\"type\":\"jyxgtczh\"}"; + = "{\"properties\":{\"deviceVersionNumber\":\"yefchnm\",\"friendlyDeviceVersionName\":\"hmnxhkxjqi\",\"deviceLastScannedDateTime\":\"2021-01-17T11:13:52Z\",\"lastCompletedScanJobDateTime\":\"2021-08-31T12:50:30Z\",\"lastSuccessfulScanJobTime\":\"2021-07-08T10:33:14Z\",\"lastCompletedDownloadJobDateTime\":\"2021-10-24T02:08:25Z\",\"lastCompletedDownloadJobId\":\"i\",\"lastDownloadJobStatus\":\"Paused\",\"lastSuccessfulInstallJobDateTime\":\"2021-06-11T14:56:28Z\",\"lastCompletedInstallJobDateTime\":\"2021-08-23T22:39:46Z\",\"lastCompletedInstallJobId\":\"wmozqvbub\",\"lastInstallJobStatus\":\"Running\",\"totalNumberOfUpdatesAvailable\":584332320,\"totalNumberOfUpdatesPendingDownload\":990161809,\"totalNumberOfUpdatesPendingInstall\":1991354905,\"rebootBehavior\":\"NeverReboots\",\"ongoingUpdateOperation\":\"Scan\",\"inProgressDownloadJobId\":\"zttaboidvmf\",\"inProgressInstallJobId\":\"ppu\",\"inProgressDownloadJobStartedDateTime\":\"2021-04-02T00:41:58Z\",\"inProgressInstallJobStartedDateTime\":\"2021-04-23T03:49:20Z\",\"updateTitles\":[\"fgkmtdhern\",\"btcjuah\"],\"updates\":[{\"updateTitle\":\"obkauxofsh\",\"updateSize\":97.18456693128485,\"updateType\":\"Firmware\",\"targetVersion\":\"lai\",\"friendlyVersionNumber\":\"zejywhslw\",\"estimatedInstallTimeInMins\":1142499440,\"rebootBehavior\":\"NeverReboots\",\"installationImpact\":\"DeviceRebooted\",\"status\":\"InstallStarted\"},{\"updateTitle\":\"dwrpqafgfugsnn\",\"updateSize\":39.67464874378138,\"updateType\":\"Kubernetes\",\"targetVersion\":\"ypococtfjgtixr\",\"friendlyVersionNumber\":\"zuyt\",\"estimatedInstallTimeInMins\":1921621659,\"rebootBehavior\":\"RequestReboot\",\"installationImpact\":\"KubernetesWorkloadsDown\",\"status\":\"InstallCompleted\"},{\"updateTitle\":\"bauiropi\",\"updateSize\":78.64054728971267,\"updateType\":\"Firmware\",\"targetVersion\":\"pngajin\",\"friendlyVersionNumber\":\"xjawrt\",\"estimatedInstallTimeInMins\":968564059,\"rebootBehavior\":\"NeverReboots\",\"installationImpact\":\"None\",\"status\":\"DownloadPending\"}],\"totalUpdateSizeInBytes\":74.40606704095953,\"totalTimeInMinutes\":1559080880},\"id\":\"ovne\",\"name\":\"henlusfnr\",\"type\":\"tjxtxr\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); DataBoxEdgeManager manager = DataBoxEdgeManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); UpdateSummary response = manager.devices() - .getUpdateSummaryWithResponse("wkojgcyztsfmzn", "aeqphchqnr", com.azure.core.util.Context.NONE) + .getUpdateSummaryWithResponse("filkmkkholv", "ndviauogphuartvt", com.azure.core.util.Context.NONE) .getValue(); - Assertions.assertEquals("x", response.deviceVersionNumber()); - Assertions.assertEquals("uwrykqgaifmvikl", response.friendlyDeviceVersionName()); - Assertions.assertEquals(OffsetDateTime.parse("2021-05-22T16:01:58Z"), response.deviceLastScannedDateTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-05-16T18:34:19Z"), response.lastCompletedScanJobDateTime()); + Assertions.assertEquals("yefchnm", response.deviceVersionNumber()); + Assertions.assertEquals("hmnxhkxjqi", response.friendlyDeviceVersionName()); + Assertions.assertEquals(OffsetDateTime.parse("2021-01-17T11:13:52Z"), response.deviceLastScannedDateTime()); + Assertions.assertEquals(OffsetDateTime.parse("2021-08-31T12:50:30Z"), response.lastCompletedScanJobDateTime()); + Assertions.assertEquals(OffsetDateTime.parse("2021-07-08T10:33:14Z"), response.lastSuccessfulScanJobTime()); + Assertions.assertEquals(OffsetDateTime.parse("2021-06-11T14:56:28Z"), + response.lastSuccessfulInstallJobDateTime()); } } diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/DevicesInstallUpdatesMockTests.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/DevicesInstallUpdatesMockTests.java index a290ed6afa25..fbdad1c90d7f 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/DevicesInstallUpdatesMockTests.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/DevicesInstallUpdatesMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.databoxedge.DataBoxEdgeManager; import java.nio.charset.StandardCharsets; @@ -25,9 +25,9 @@ public void testInstallUpdates() throws Exception { DataBoxEdgeManager manager = DataBoxEdgeManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - manager.devices().installUpdates("honnxkrlgnyhmos", "xkk", com.azure.core.util.Context.NONE); + manager.devices().installUpdates("wohqfzizvu", "mmkjsvthnwpztek", com.azure.core.util.Context.NONE); } } diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/DevicesListByResourceGroupMockTests.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/DevicesListByResourceGroupMockTests.java index 419e38144e96..5eaafa4e9326 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/DevicesListByResourceGroupMockTests.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/DevicesListByResourceGroupMockTests.java @@ -1,18 +1,19 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.databoxedge.DataBoxEdgeManager; import com.azure.resourcemanager.databoxedge.models.DataBoxEdgeDevice; -import com.azure.resourcemanager.databoxedge.models.DataBoxEdgeDeviceStatus; +import com.azure.resourcemanager.databoxedge.models.DataResidencyType; +import com.azure.resourcemanager.databoxedge.models.MsiIdentityType; import com.azure.resourcemanager.databoxedge.models.SkuName; import com.azure.resourcemanager.databoxedge.models.SkuTier; import java.nio.charset.StandardCharsets; @@ -25,26 +26,25 @@ public final class DevicesListByResourceGroupMockTests { @Test public void testListByResourceGroup() throws Exception { String responseStr - = "{\"value\":[{\"location\":\"dn\",\"tags\":{\"xkw\":\"vgbmhr\",\"xccbdreaxhcex\":\"yijejvegrhbpnaix\",\"qkghtpwijnhy\":\"rrvqa\",\"owvrvmtgjqppyos\":\"svfycxzbfv\"},\"sku\":{\"name\":\"TEA_1Node_Heater\",\"tier\":\"Standard\"},\"etag\":\"hgfipnsxkmcw\",\"properties\":{\"dataBoxEdgeDeviceStatus\":\"Offline\",\"serialNumber\":\"jreafxtsgum\",\"description\":\"glikkxwslolb\",\"modelDescription\":\"vuzlm\",\"deviceType\":\"DataBoxEdgeDevice\",\"friendlyName\":\"fktgplc\",\"culture\":\"wjxeznoigbr\",\"deviceModel\":\"w\",\"deviceSoftwareVersion\":\"kpnb\",\"deviceLocalCapacity\":7370979287660011871,\"timeZone\":\"joqkagfhsxt\",\"deviceHcsVersion\":\"ugzxnf\",\"configuredRoleTypes\":[\"Functions\",\"Cognitive\"],\"nodeCount\":2134025822},\"id\":\"n\",\"name\":\"dm\",\"type\":\"qjjlwuen\"}]}"; + = "{\"value\":[{\"properties\":{\"dataBoxEdgeDeviceStatus\":\"Maintenance\",\"serialNumber\":\"ccsrmozihmipgaw\",\"description\":\"xp\",\"modelDescription\":\"jcxcjxgrytfmpcyc\",\"deviceType\":\"DataBoxEdgeDevice\",\"friendlyName\":\"caykggnoxuz\",\"culture\":\"ksxwpnd\",\"deviceModel\":\"pfnznthjtwkj\",\"deviceSoftwareVersion\":\"srxuzvoam\",\"deviceLocalCapacity\":2008218517576011208,\"timeZone\":\"os\",\"deviceHcsVersion\":\"bzahgxqd\",\"configuredRoleTypes\":[\"Cognitive\",\"MEC\"],\"nodeCount\":1395240119,\"resourceMoveDetails\":{\"operationInProgress\":\"ResourceMoveFailed\",\"operationInProgressLockTimeoutInUTC\":\"2021-09-17T05:36:33Z\"},\"edgeProfile\":{\"subscription\":{\"registrationId\":\"tbhjmznnbsoqe\",\"id\":\"larvlagunbtg\",\"state\":\"Warned\",\"registrationDate\":\"l\",\"subscriptionId\":\"mhyreeudz\",\"properties\":{\"tenantId\":\"bpdqmjxlyy\",\"locationPlacementId\":\"lgouwtlmjj\",\"quotaId\":\"ojqtobaxk\",\"serializedDetails\":\"ytunlbfjkwr\",\"registeredFeatures\":[{},{},{}]}}},\"dataResidency\":{\"type\":\"GeoZoneReplication\"},\"kubernetesWorkloadProfile\":\"syrq\"},\"sku\":{\"name\":\"TEA_4Node_Heater\",\"tier\":\"Standard\"},\"etag\":\"nxaulk\",\"identity\":{\"type\":\"UserAssigned\",\"principalId\":\"ifmjnn\",\"tenantId\":\"tqabpxuckpgg\"},\"kind\":\"AzureDataBoxGateway\",\"location\":\"yirdhlisngwflqq\",\"tags\":{\"qxpxiwfcngjsaa\":\"zruwn\",\"kv\":\"iixtmkzj\",\"ra\":\"irhgfgrwsdp\",\"ctctbrxkjz\":\"zvzbglbyv\"},\"id\":\"rgxffmshkw\",\"name\":\"bkgozxwopdbydpi\",\"type\":\"qaclnapxbiy\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); DataBoxEdgeManager manager = DataBoxEdgeManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); PagedIterable response - = manager.devices().listByResourceGroup("bnhlmc", "l", com.azure.core.util.Context.NONE); + = manager.devices().listByResourceGroup("tsxoatftgz", "npbs", com.azure.core.util.Context.NONE); - Assertions.assertEquals("dn", response.iterator().next().location()); - Assertions.assertEquals("vgbmhr", response.iterator().next().tags().get("xkw")); - Assertions.assertEquals(SkuName.TEA_1NODE_HEATER, response.iterator().next().sku().name()); + Assertions.assertEquals("yirdhlisngwflqq", response.iterator().next().location()); + Assertions.assertEquals("zruwn", response.iterator().next().tags().get("qxpxiwfcngjsaa")); + Assertions.assertEquals(SkuName.TEA_4NODE_HEATER, response.iterator().next().sku().name()); Assertions.assertEquals(SkuTier.STANDARD, response.iterator().next().sku().tier()); - Assertions.assertEquals("hgfipnsxkmcw", response.iterator().next().etag()); - Assertions.assertEquals(DataBoxEdgeDeviceStatus.OFFLINE, response.iterator().next().dataBoxEdgeDeviceStatus()); - Assertions.assertEquals("glikkxwslolb", response.iterator().next().description()); - Assertions.assertEquals("vuzlm", response.iterator().next().modelDescription()); - Assertions.assertEquals("fktgplc", response.iterator().next().friendlyName()); + Assertions.assertEquals("nxaulk", response.iterator().next().etag()); + Assertions.assertEquals(MsiIdentityType.USER_ASSIGNED, response.iterator().next().identity().type()); + Assertions.assertEquals(DataResidencyType.GEO_ZONE_REPLICATION, + response.iterator().next().dataResidency().type()); } } diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/DevicesListMockTests.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/DevicesListMockTests.java index 126fff8f1b92..d27337dd1c8a 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/DevicesListMockTests.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/DevicesListMockTests.java @@ -1,18 +1,19 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.databoxedge.DataBoxEdgeManager; import com.azure.resourcemanager.databoxedge.models.DataBoxEdgeDevice; -import com.azure.resourcemanager.databoxedge.models.DataBoxEdgeDeviceStatus; +import com.azure.resourcemanager.databoxedge.models.DataResidencyType; +import com.azure.resourcemanager.databoxedge.models.MsiIdentityType; import com.azure.resourcemanager.databoxedge.models.SkuName; import com.azure.resourcemanager.databoxedge.models.SkuTier; import java.nio.charset.StandardCharsets; @@ -25,26 +26,23 @@ public final class DevicesListMockTests { @Test public void testList() throws Exception { String responseStr - = "{\"value\":[{\"location\":\"ccyajg\",\"tags\":{\"lvdnkfx\":\"hwyg\",\"apfcqdpsq\":\"semdwzrmu\",\"celve\":\"qvpsvuoymg\",\"erqwkyhkobopg\":\"rypqlmfeo\"},\"sku\":{\"name\":\"TEA_1Node_Heater\",\"tier\":\"Standard\"},\"etag\":\"pbqpcrfkbwccsn\",\"properties\":{\"dataBoxEdgeDeviceStatus\":\"Maintenance\",\"serialNumber\":\"xlpqekftnkhtjsy\",\"description\":\"gwfqatmt\",\"modelDescription\":\"tmdvypgikdgs\",\"deviceType\":\"DataBoxEdgeDevice\",\"friendlyName\":\"birryuzhl\",\"culture\":\"joqrvqqaatj\",\"deviceModel\":\"rv\",\"deviceSoftwareVersion\":\"upmfiibfg\",\"deviceLocalCapacity\":9051786010935823048,\"timeZone\":\"lvrwxkvtkk\",\"deviceHcsVersion\":\"lqwjygvjayvblm\",\"configuredRoleTypes\":[\"Cognitive\"],\"nodeCount\":2100624724},\"id\":\"bxvvyhg\",\"name\":\"opbyrqufegxu\",\"type\":\"wz\"}]}"; + = "{\"value\":[{\"properties\":{\"dataBoxEdgeDeviceStatus\":\"PartiallyDisconnected\",\"serialNumber\":\"cttuxuu\",\"description\":\"lflqoiqu\",\"modelDescription\":\"ehmrn\",\"deviceType\":\"DataBoxEdgeDevice\",\"friendlyName\":\"ujztcz\",\"culture\":\"qjtwhauu\",\"deviceModel\":\"prnjletlxsmr\",\"deviceSoftwareVersion\":\"do\",\"deviceLocalCapacity\":1946513057158400175,\"timeZone\":\"owa\",\"deviceHcsVersion\":\"yn\",\"configuredRoleTypes\":[\"CloudEdgeManagement\",\"CloudEdgeManagement\",\"IOT\",\"MEC\"],\"nodeCount\":1814924946,\"resourceMoveDetails\":{\"operationInProgress\":\"None\",\"operationInProgressLockTimeoutInUTC\":\"2021-07-20T17:56:39Z\"},\"edgeProfile\":{\"subscription\":{\"registrationId\":\"tmaaj\",\"id\":\"huxy\",\"state\":\"Unregistered\",\"registrationDate\":\"m\",\"subscriptionId\":\"g\",\"properties\":{\"tenantId\":\"zyos\",\"locationPlacementId\":\"p\",\"quotaId\":\"c\",\"serializedDetails\":\"kyjpmspbps\",\"registeredFeatures\":[{},{},{},{}]}}},\"dataResidency\":{\"type\":\"ZoneReplication\"},\"kubernetesWorkloadProfile\":\"gt\"},\"sku\":{\"name\":\"RDC\",\"tier\":\"Standard\"},\"etag\":\"czkcnyxrxmunjd\",\"identity\":{\"type\":\"UserAssigned\",\"principalId\":\"kvxlxpa\",\"tenantId\":\"qivbgkcvkh\"},\"kind\":\"AzureDataBoxGateway\",\"location\":\"qdf\",\"tags\":{\"xtiv\":\"niypfpubcpzg\",\"nidibgqjxg\":\"j\",\"hgovfgp\":\"n\",\"zvuporqzdfuydz\":\"kqmhhaowjr\"},\"id\":\"kfvxcnq\",\"name\":\"xqpswok\",\"type\":\"vkhlggdhbemz\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); DataBoxEdgeManager manager = DataBoxEdgeManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - PagedIterable response = manager.devices().list("v", com.azure.core.util.Context.NONE); + PagedIterable response = manager.devices().list("nugj", com.azure.core.util.Context.NONE); - Assertions.assertEquals("ccyajg", response.iterator().next().location()); - Assertions.assertEquals("hwyg", response.iterator().next().tags().get("lvdnkfx")); - Assertions.assertEquals(SkuName.TEA_1NODE_HEATER, response.iterator().next().sku().name()); + Assertions.assertEquals("qdf", response.iterator().next().location()); + Assertions.assertEquals("niypfpubcpzg", response.iterator().next().tags().get("xtiv")); + Assertions.assertEquals(SkuName.RDC, response.iterator().next().sku().name()); Assertions.assertEquals(SkuTier.STANDARD, response.iterator().next().sku().tier()); - Assertions.assertEquals("pbqpcrfkbwccsn", response.iterator().next().etag()); - Assertions.assertEquals(DataBoxEdgeDeviceStatus.MAINTENANCE, - response.iterator().next().dataBoxEdgeDeviceStatus()); - Assertions.assertEquals("gwfqatmt", response.iterator().next().description()); - Assertions.assertEquals("tmdvypgikdgs", response.iterator().next().modelDescription()); - Assertions.assertEquals("birryuzhl", response.iterator().next().friendlyName()); + Assertions.assertEquals("czkcnyxrxmunjd", response.iterator().next().etag()); + Assertions.assertEquals(MsiIdentityType.USER_ASSIGNED, response.iterator().next().identity().type()); + Assertions.assertEquals(DataResidencyType.ZONE_REPLICATION, response.iterator().next().dataResidency().type()); } } diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/DevicesScanForUpdatesMockTests.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/DevicesScanForUpdatesMockTests.java index 107e74a7dba6..6b635999e00c 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/DevicesScanForUpdatesMockTests.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/DevicesScanForUpdatesMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.databoxedge.DataBoxEdgeManager; import java.nio.charset.StandardCharsets; @@ -25,9 +25,9 @@ public void testScanForUpdates() throws Exception { DataBoxEdgeManager manager = DataBoxEdgeManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - manager.devices().scanForUpdates("mrtwna", "jslb", com.azure.core.util.Context.NONE); + manager.devices().scanForUpdates("vmribiat", "gplucfotangcfhny", com.azure.core.util.Context.NONE); } } diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/DevicesUploadCertificateWithResponseMockTests.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/DevicesUploadCertificateWithResponseMockTests.java index 9fc53bc25e86..63bc8a089925 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/DevicesUploadCertificateWithResponseMockTests.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/DevicesUploadCertificateWithResponseMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.databoxedge.DataBoxEdgeManager; import com.azure.resourcemanager.databoxedge.models.AuthenticationType; @@ -23,19 +23,19 @@ public final class DevicesUploadCertificateWithResponseMockTests { @Test public void testUploadCertificateWithResponse() throws Exception { String responseStr - = "{\"authType\":\"Invalid\",\"resourceId\":\"baxk\",\"aadAuthority\":\"ywrckp\",\"aadTenantId\":\"lyhpluodpvruud\",\"servicePrincipalClientId\":\"zibt\",\"servicePrincipalObjectId\":\"stgktst\",\"azureManagementEndpointAudience\":\"xeclzedqbcvhzlhp\",\"aadAudience\":\"dqkdlwwqfbu\"}"; + = "{\"authType\":\"Invalid\",\"resourceId\":\"jiuqhibtozi\",\"aadAuthority\":\"wjedmurrxxgew\",\"aadTenantId\":\"tvqylkmqpzoyhlfb\",\"servicePrincipalClientId\":\"wgcloxoebqinji\",\"servicePrincipalObjectId\":\"wjfuj\",\"azureManagementEndpointAudience\":\"afcba\",\"aadAudience\":\"pzpofoiyjw\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); DataBoxEdgeManager manager = DataBoxEdgeManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); UploadCertificateResponse response = manager.devices() - .uploadCertificateWithResponse("ydbsd", "hmkxmaehvbb", - new UploadCertificateRequest().withAuthenticationType(AuthenticationType.INVALID) - .withCertificate("iplt"), + .uploadCertificateWithResponse("npdkv", "fabuiyjibu", + new UploadCertificateRequest().withAuthenticationType(AuthenticationType.AZURE_ACTIVE_DIRECTORY) + .withCertificate("dugneiknp"), com.azure.core.util.Context.NONE) .getValue(); diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/DiagnosticProactiveLogCollectionSettingsInnerTests.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/DiagnosticProactiveLogCollectionSettingsInnerTests.java new file mode 100644 index 000000000000..f1ac7725f3f9 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/DiagnosticProactiveLogCollectionSettingsInnerTests.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.databoxedge.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.databoxedge.fluent.models.DiagnosticProactiveLogCollectionSettingsInner; +import com.azure.resourcemanager.databoxedge.models.ProactiveDiagnosticsConsent; +import org.junit.jupiter.api.Assertions; + +public final class DiagnosticProactiveLogCollectionSettingsInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + DiagnosticProactiveLogCollectionSettingsInner model = BinaryData.fromString( + "{\"properties\":{\"userConsent\":\"Enabled\"},\"id\":\"rpkhjwn\",\"name\":\"yqsluic\",\"type\":\"dggkzzlvmbmpa\"}") + .toObject(DiagnosticProactiveLogCollectionSettingsInner.class); + Assertions.assertEquals(ProactiveDiagnosticsConsent.ENABLED, model.userConsent()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + DiagnosticProactiveLogCollectionSettingsInner model + = new DiagnosticProactiveLogCollectionSettingsInner().withUserConsent(ProactiveDiagnosticsConsent.ENABLED); + model = BinaryData.fromObject(model).toObject(DiagnosticProactiveLogCollectionSettingsInner.class); + Assertions.assertEquals(ProactiveDiagnosticsConsent.ENABLED, model.userConsent()); + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/DiagnosticRemoteSupportSettingsInnerTests.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/DiagnosticRemoteSupportSettingsInnerTests.java new file mode 100644 index 000000000000..4da37ed743b3 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/DiagnosticRemoteSupportSettingsInnerTests.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.databoxedge.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.databoxedge.fluent.models.DiagnosticRemoteSupportSettingsInner; +import com.azure.resourcemanager.databoxedge.models.AccessLevel; +import com.azure.resourcemanager.databoxedge.models.RemoteApplicationType; +import com.azure.resourcemanager.databoxedge.models.RemoteSupportSettings; +import java.time.OffsetDateTime; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class DiagnosticRemoteSupportSettingsInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + DiagnosticRemoteSupportSettingsInner model = BinaryData.fromString( + "{\"properties\":{\"remoteSupportSettingsList\":[{\"remoteApplicationType\":\"AllApplications\",\"accessLevel\":\"None\",\"expirationTimeStampInUTC\":\"2021-08-18T20:12:47Z\"},{\"remoteApplicationType\":\"LocalUI\",\"accessLevel\":\"ReadWrite\",\"expirationTimeStampInUTC\":\"2021-03-23T00:46:03Z\"}]},\"id\":\"wyhrfouyftaakc\",\"name\":\"wiyzvqtmnubexkp\",\"type\":\"ksmond\"}") + .toObject(DiagnosticRemoteSupportSettingsInner.class); + Assertions.assertEquals(RemoteApplicationType.ALL_APPLICATIONS, + model.remoteSupportSettingsList().get(0).remoteApplicationType()); + Assertions.assertEquals(AccessLevel.NONE, model.remoteSupportSettingsList().get(0).accessLevel()); + Assertions.assertEquals(OffsetDateTime.parse("2021-08-18T20:12:47Z"), + model.remoteSupportSettingsList().get(0).expirationTimeStampInUTC()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + DiagnosticRemoteSupportSettingsInner model + = new DiagnosticRemoteSupportSettingsInner().withRemoteSupportSettingsList(Arrays.asList( + new RemoteSupportSettings().withRemoteApplicationType(RemoteApplicationType.ALL_APPLICATIONS) + .withAccessLevel(AccessLevel.NONE) + .withExpirationTimeStampInUTC(OffsetDateTime.parse("2021-08-18T20:12:47Z")), + new RemoteSupportSettings().withRemoteApplicationType(RemoteApplicationType.LOCAL_UI) + .withAccessLevel(AccessLevel.READ_WRITE) + .withExpirationTimeStampInUTC(OffsetDateTime.parse("2021-03-23T00:46:03Z")))); + model = BinaryData.fromObject(model).toObject(DiagnosticRemoteSupportSettingsInner.class); + Assertions.assertEquals(RemoteApplicationType.ALL_APPLICATIONS, + model.remoteSupportSettingsList().get(0).remoteApplicationType()); + Assertions.assertEquals(AccessLevel.NONE, model.remoteSupportSettingsList().get(0).accessLevel()); + Assertions.assertEquals(OffsetDateTime.parse("2021-08-18T20:12:47Z"), + model.remoteSupportSettingsList().get(0).expirationTimeStampInUTC()); + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/DiagnosticRemoteSupportSettingsPropertiesTests.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/DiagnosticRemoteSupportSettingsPropertiesTests.java new file mode 100644 index 000000000000..fb3a69260d89 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/DiagnosticRemoteSupportSettingsPropertiesTests.java @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.databoxedge.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.databoxedge.fluent.models.DiagnosticRemoteSupportSettingsProperties; +import com.azure.resourcemanager.databoxedge.models.AccessLevel; +import com.azure.resourcemanager.databoxedge.models.RemoteApplicationType; +import com.azure.resourcemanager.databoxedge.models.RemoteSupportSettings; +import java.time.OffsetDateTime; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class DiagnosticRemoteSupportSettingsPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + DiagnosticRemoteSupportSettingsProperties model = BinaryData.fromString( + "{\"remoteSupportSettingsList\":[{\"remoteApplicationType\":\"Powershell\",\"accessLevel\":\"ReadWrite\",\"expirationTimeStampInUTC\":\"2021-05-06T07:42:13Z\"},{\"remoteApplicationType\":\"AllApplications\",\"accessLevel\":\"ReadOnly\",\"expirationTimeStampInUTC\":\"2021-08-12T00:08:05Z\"},{\"remoteApplicationType\":\"AllApplications\",\"accessLevel\":\"None\",\"expirationTimeStampInUTC\":\"2021-08-09T17:57:45Z\"}]}") + .toObject(DiagnosticRemoteSupportSettingsProperties.class); + Assertions.assertEquals(RemoteApplicationType.POWERSHELL, + model.remoteSupportSettingsList().get(0).remoteApplicationType()); + Assertions.assertEquals(AccessLevel.READ_WRITE, model.remoteSupportSettingsList().get(0).accessLevel()); + Assertions.assertEquals(OffsetDateTime.parse("2021-05-06T07:42:13Z"), + model.remoteSupportSettingsList().get(0).expirationTimeStampInUTC()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + DiagnosticRemoteSupportSettingsProperties model + = new DiagnosticRemoteSupportSettingsProperties().withRemoteSupportSettingsList(Arrays.asList( + new RemoteSupportSettings().withRemoteApplicationType(RemoteApplicationType.POWERSHELL) + .withAccessLevel(AccessLevel.READ_WRITE) + .withExpirationTimeStampInUTC(OffsetDateTime.parse("2021-05-06T07:42:13Z")), + new RemoteSupportSettings().withRemoteApplicationType(RemoteApplicationType.ALL_APPLICATIONS) + .withAccessLevel(AccessLevel.READ_ONLY) + .withExpirationTimeStampInUTC(OffsetDateTime.parse("2021-08-12T00:08:05Z")), + new RemoteSupportSettings().withRemoteApplicationType(RemoteApplicationType.ALL_APPLICATIONS) + .withAccessLevel(AccessLevel.NONE) + .withExpirationTimeStampInUTC(OffsetDateTime.parse("2021-08-09T17:57:45Z")))); + model = BinaryData.fromObject(model).toObject(DiagnosticRemoteSupportSettingsProperties.class); + Assertions.assertEquals(RemoteApplicationType.POWERSHELL, + model.remoteSupportSettingsList().get(0).remoteApplicationType()); + Assertions.assertEquals(AccessLevel.READ_WRITE, model.remoteSupportSettingsList().get(0).accessLevel()); + Assertions.assertEquals(OffsetDateTime.parse("2021-05-06T07:42:13Z"), + model.remoteSupportSettingsList().get(0).expirationTimeStampInUTC()); + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/DiagnosticSettingsGetDiagnosticProactiveLogCollectionSettingsWithResponseMockTests.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/DiagnosticSettingsGetDiagnosticProactiveLogCollectionSettingsWithResponseMockTests.java new file mode 100644 index 000000000000..94bcf02c5a6d --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/DiagnosticSettingsGetDiagnosticProactiveLogCollectionSettingsWithResponseMockTests.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.databoxedge.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.databoxedge.DataBoxEdgeManager; +import com.azure.resourcemanager.databoxedge.models.DiagnosticProactiveLogCollectionSettings; +import com.azure.resourcemanager.databoxedge.models.ProactiveDiagnosticsConsent; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class DiagnosticSettingsGetDiagnosticProactiveLogCollectionSettingsWithResponseMockTests { + @Test + public void testGetDiagnosticProactiveLogCollectionSettingsWithResponse() throws Exception { + String responseStr + = "{\"properties\":{\"userConsent\":\"Disabled\"},\"id\":\"vopwndyqleallk\",\"name\":\"mtkhlowkxxpvbr\",\"type\":\"fjmzsyzfho\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + DataBoxEdgeManager manager = DataBoxEdgeManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + DiagnosticProactiveLogCollectionSettings response = manager.diagnosticSettings() + .getDiagnosticProactiveLogCollectionSettingsWithResponse("ydsx", "efoh", com.azure.core.util.Context.NONE) + .getValue(); + + Assertions.assertEquals(ProactiveDiagnosticsConsent.DISABLED, response.userConsent()); + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/DiagnosticSettingsGetDiagnosticRemoteSupportSettingsWithResponseMockTests.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/DiagnosticSettingsGetDiagnosticRemoteSupportSettingsWithResponseMockTests.java new file mode 100644 index 000000000000..f893d2903a97 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/DiagnosticSettingsGetDiagnosticRemoteSupportSettingsWithResponseMockTests.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.databoxedge.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.databoxedge.DataBoxEdgeManager; +import com.azure.resourcemanager.databoxedge.models.AccessLevel; +import com.azure.resourcemanager.databoxedge.models.DiagnosticRemoteSupportSettings; +import com.azure.resourcemanager.databoxedge.models.RemoteApplicationType; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class DiagnosticSettingsGetDiagnosticRemoteSupportSettingsWithResponseMockTests { + @Test + public void testGetDiagnosticRemoteSupportSettingsWithResponse() throws Exception { + String responseStr + = "{\"properties\":{\"remoteSupportSettingsList\":[{\"remoteApplicationType\":\"AllApplications\",\"accessLevel\":\"ReadOnly\",\"expirationTimeStampInUTC\":\"2021-09-27T04:39:57Z\"},{\"remoteApplicationType\":\"WAC\",\"accessLevel\":\"FullAccess\",\"expirationTimeStampInUTC\":\"2021-09-28T04:14:11Z\"}]},\"id\":\"yejylmbkzudnigrf\",\"name\":\"hotj\",\"type\":\"wlpxuzzjg\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + DataBoxEdgeManager manager = DataBoxEdgeManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + DiagnosticRemoteSupportSettings response = manager.diagnosticSettings() + .getDiagnosticRemoteSupportSettingsWithResponse("qmemc", "jk", com.azure.core.util.Context.NONE) + .getValue(); + + Assertions.assertEquals(RemoteApplicationType.ALL_APPLICATIONS, + response.remoteSupportSettingsList().get(0).remoteApplicationType()); + Assertions.assertEquals(AccessLevel.READ_ONLY, response.remoteSupportSettingsList().get(0).accessLevel()); + Assertions.assertEquals(OffsetDateTime.parse("2021-09-27T04:39:57Z"), + response.remoteSupportSettingsList().get(0).expirationTimeStampInUTC()); + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/DiagnosticSettingsUpdateDiagnosticProactiveLogCollectionSettingsMockTests.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/DiagnosticSettingsUpdateDiagnosticProactiveLogCollectionSettingsMockTests.java new file mode 100644 index 000000000000..35322ed563fd --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/DiagnosticSettingsUpdateDiagnosticProactiveLogCollectionSettingsMockTests.java @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.databoxedge.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.databoxedge.DataBoxEdgeManager; +import com.azure.resourcemanager.databoxedge.fluent.models.DiagnosticProactiveLogCollectionSettingsInner; +import com.azure.resourcemanager.databoxedge.models.DiagnosticProactiveLogCollectionSettings; +import com.azure.resourcemanager.databoxedge.models.ProactiveDiagnosticsConsent; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class DiagnosticSettingsUpdateDiagnosticProactiveLogCollectionSettingsMockTests { + @Test + public void testUpdateDiagnosticProactiveLogCollectionSettings() throws Exception { + String responseStr + = "{\"properties\":{\"userConsent\":\"Disabled\"},\"id\":\"ocu\",\"name\":\"zlwhhmemhooclu\",\"type\":\"n\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + DataBoxEdgeManager manager = DataBoxEdgeManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + DiagnosticProactiveLogCollectionSettings response = manager.diagnosticSettings() + .updateDiagnosticProactiveLogCollectionSettings("lhikcyychunsj", "pjrtws", + new DiagnosticProactiveLogCollectionSettingsInner() + .withUserConsent(ProactiveDiagnosticsConsent.ENABLED), + com.azure.core.util.Context.NONE); + + Assertions.assertEquals(ProactiveDiagnosticsConsent.DISABLED, response.userConsent()); + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/DiagnosticSettingsUpdateDiagnosticRemoteSupportSettingsMockTests.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/DiagnosticSettingsUpdateDiagnosticRemoteSupportSettingsMockTests.java new file mode 100644 index 000000000000..daceb865de05 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/DiagnosticSettingsUpdateDiagnosticRemoteSupportSettingsMockTests.java @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.databoxedge.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.databoxedge.DataBoxEdgeManager; +import com.azure.resourcemanager.databoxedge.fluent.models.DiagnosticRemoteSupportSettingsInner; +import com.azure.resourcemanager.databoxedge.models.AccessLevel; +import com.azure.resourcemanager.databoxedge.models.DiagnosticRemoteSupportSettings; +import com.azure.resourcemanager.databoxedge.models.RemoteApplicationType; +import com.azure.resourcemanager.databoxedge.models.RemoteSupportSettings; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class DiagnosticSettingsUpdateDiagnosticRemoteSupportSettingsMockTests { + @Test + public void testUpdateDiagnosticRemoteSupportSettings() throws Exception { + String responseStr + = "{\"properties\":{\"remoteSupportSettingsList\":[{\"remoteApplicationType\":\"WAC\",\"accessLevel\":\"ReadOnly\",\"expirationTimeStampInUTC\":\"2021-01-17T19:06:28Z\"},{\"remoteApplicationType\":\"Powershell\",\"accessLevel\":\"None\",\"expirationTimeStampInUTC\":\"2021-06-18T06:07:56Z\"},{\"remoteApplicationType\":\"LocalUI\",\"accessLevel\":\"FullAccess\",\"expirationTimeStampInUTC\":\"2021-07-10T02:57:51Z\"}]},\"id\":\"rvkmjcwmjvlgfggc\",\"name\":\"kyylizr\",\"type\":\"bjpsfxsfuztlvtm\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + DataBoxEdgeManager manager = DataBoxEdgeManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + DiagnosticRemoteSupportSettings response = manager.diagnosticSettings() + .updateDiagnosticRemoteSupportSettings("refqy", "qotoihiqakydiwfb", + new DiagnosticRemoteSupportSettingsInner().withRemoteSupportSettingsList(Arrays.asList( + new RemoteSupportSettings().withRemoteApplicationType(RemoteApplicationType.POWERSHELL) + .withAccessLevel(AccessLevel.FULL_ACCESS) + .withExpirationTimeStampInUTC(OffsetDateTime.parse("2021-04-17T02:34:51Z")), + new RemoteSupportSettings().withRemoteApplicationType(RemoteApplicationType.LOCAL_UI) + .withAccessLevel(AccessLevel.READ_ONLY) + .withExpirationTimeStampInUTC(OffsetDateTime.parse("2021-06-30T10:47:24Z")), + new RemoteSupportSettings().withRemoteApplicationType(RemoteApplicationType.ALL_APPLICATIONS) + .withAccessLevel(AccessLevel.NONE) + .withExpirationTimeStampInUTC(OffsetDateTime.parse("2021-04-02T16:16:56Z")))), + com.azure.core.util.Context.NONE); + + Assertions.assertEquals(RemoteApplicationType.WAC, + response.remoteSupportSettingsList().get(0).remoteApplicationType()); + Assertions.assertEquals(AccessLevel.READ_ONLY, response.remoteSupportSettingsList().get(0).accessLevel()); + Assertions.assertEquals(OffsetDateTime.parse("2021-01-17T19:06:28Z"), + response.remoteSupportSettingsList().get(0).expirationTimeStampInUTC()); + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/EdgeProfilePatchTests.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/EdgeProfilePatchTests.java new file mode 100644 index 000000000000..75365c27a54e --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/EdgeProfilePatchTests.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.databoxedge.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.databoxedge.models.EdgeProfilePatch; +import com.azure.resourcemanager.databoxedge.models.EdgeProfileSubscriptionPatch; +import org.junit.jupiter.api.Assertions; + +public final class EdgeProfilePatchTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + EdgeProfilePatch model + = BinaryData.fromString("{\"subscription\":{\"id\":\"zlsico\"}}").toObject(EdgeProfilePatch.class); + Assertions.assertEquals("zlsico", model.subscription().id()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + EdgeProfilePatch model + = new EdgeProfilePatch().withSubscription(new EdgeProfileSubscriptionPatch().withId("zlsico")); + model = BinaryData.fromObject(model).toObject(EdgeProfilePatch.class); + Assertions.assertEquals("zlsico", model.subscription().id()); + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/EdgeProfileSubscriptionPatchTests.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/EdgeProfileSubscriptionPatchTests.java new file mode 100644 index 000000000000..a104a24ce5b3 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/EdgeProfileSubscriptionPatchTests.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.databoxedge.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.databoxedge.models.EdgeProfileSubscriptionPatch; +import org.junit.jupiter.api.Assertions; + +public final class EdgeProfileSubscriptionPatchTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + EdgeProfileSubscriptionPatch model + = BinaryData.fromString("{\"id\":\"qqn\"}").toObject(EdgeProfileSubscriptionPatch.class); + Assertions.assertEquals("qqn", model.id()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + EdgeProfileSubscriptionPatch model = new EdgeProfileSubscriptionPatch().withId("qqn"); + model = BinaryData.fromObject(model).toObject(EdgeProfileSubscriptionPatch.class); + Assertions.assertEquals("qqn", model.id()); + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/EdgeProfileSubscriptionTests.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/EdgeProfileSubscriptionTests.java new file mode 100644 index 000000000000..a148fe59d5f7 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/EdgeProfileSubscriptionTests.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.databoxedge.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.databoxedge.models.EdgeProfileSubscription; +import com.azure.resourcemanager.databoxedge.models.SubscriptionState; +import org.junit.jupiter.api.Assertions; + +public final class EdgeProfileSubscriptionTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + EdgeProfileSubscription model = BinaryData.fromString( + "{\"registrationId\":\"s\",\"id\":\"ddystkiiuxhqy\",\"state\":\"Registered\",\"registrationDate\":\"rrqnbpoczvyifqrv\",\"subscriptionId\":\"vjsllrmvvdfw\",\"properties\":{\"tenantId\":\"pnpulexxbczwtru\",\"locationPlacementId\":\"qzbqjvsov\",\"quotaId\":\"okacspk\",\"serializedDetails\":\"hzdobpxjmflbvvnc\",\"registeredFeatures\":[{\"name\":\"ciwwzjuqkhr\",\"state\":\"jiwkuofoskghsau\"},{\"name\":\"mjmvxieduugidyjr\",\"state\":\"byao\"},{\"name\":\"e\",\"state\":\"sonpclhocohs\"},{\"name\":\"ev\",\"state\":\"ggzfbu\"}]}}") + .toObject(EdgeProfileSubscription.class); + Assertions.assertEquals("s", model.registrationId()); + Assertions.assertEquals("ddystkiiuxhqy", model.id()); + Assertions.assertEquals(SubscriptionState.REGISTERED, model.state()); + Assertions.assertEquals("rrqnbpoczvyifqrv", model.registrationDate()); + Assertions.assertEquals("vjsllrmvvdfw", model.subscriptionId()); + Assertions.assertEquals("pnpulexxbczwtru", model.tenantId()); + Assertions.assertEquals("qzbqjvsov", model.locationPlacementId()); + Assertions.assertEquals("okacspk", model.quotaId()); + Assertions.assertEquals("hzdobpxjmflbvvnc", model.serializedDetails()); + Assertions.assertEquals("ciwwzjuqkhr", model.registeredFeatures().get(0).name()); + Assertions.assertEquals("jiwkuofoskghsau", model.registeredFeatures().get(0).state()); + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/EdgeProfileTests.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/EdgeProfileTests.java new file mode 100644 index 000000000000..687459a5c99a --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/EdgeProfileTests.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.databoxedge.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.databoxedge.models.EdgeProfile; +import com.azure.resourcemanager.databoxedge.models.SubscriptionState; +import org.junit.jupiter.api.Assertions; + +public final class EdgeProfileTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + EdgeProfile model = BinaryData.fromString( + "{\"subscription\":{\"registrationId\":\"a\",\"id\":\"ae\",\"state\":\"Suspended\",\"registrationDate\":\"yhltrpmopjmcm\",\"subscriptionId\":\"u\",\"properties\":{\"tenantId\":\"hfuiuaodsfc\",\"locationPlacementId\":\"vxodpu\",\"quotaId\":\"myzydagfuaxbez\",\"serializedDetails\":\"uokktwhrdxwz\",\"registeredFeatures\":[{\"name\":\"mbsureximo\",\"state\":\"ocfs\"}]}}}") + .toObject(EdgeProfile.class); + Assertions.assertEquals("a", model.subscription().registrationId()); + Assertions.assertEquals("ae", model.subscription().id()); + Assertions.assertEquals(SubscriptionState.SUSPENDED, model.subscription().state()); + Assertions.assertEquals("yhltrpmopjmcm", model.subscription().registrationDate()); + Assertions.assertEquals("u", model.subscription().subscriptionId()); + Assertions.assertEquals("hfuiuaodsfc", model.subscription().tenantId()); + Assertions.assertEquals("vxodpu", model.subscription().locationPlacementId()); + Assertions.assertEquals("myzydagfuaxbez", model.subscription().quotaId()); + Assertions.assertEquals("uokktwhrdxwz", model.subscription().serializedDetails()); + Assertions.assertEquals("mbsureximo", model.subscription().registeredFeatures().get(0).name()); + Assertions.assertEquals("ocfs", model.subscription().registeredFeatures().get(0).state()); + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/FileEventTriggerTests.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/FileEventTriggerTests.java deleted file mode 100644 index 2922eef6255b..000000000000 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/FileEventTriggerTests.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.databoxedge.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.databoxedge.models.FileEventTrigger; -import com.azure.resourcemanager.databoxedge.models.FileSourceInfo; -import com.azure.resourcemanager.databoxedge.models.RoleSinkInfo; -import org.junit.jupiter.api.Assertions; - -public final class FileEventTriggerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - FileEventTrigger model = BinaryData.fromString( - "{\"kind\":\"FileEvent\",\"properties\":{\"sourceInfo\":{\"shareId\":\"twdw\"},\"sinkInfo\":{\"roleId\":\"ftswibyrcdlbhsh\"},\"customContextTag\":\"p\"},\"id\":\"acstwityk\",\"name\":\"evxccedcp\",\"type\":\"md\"}") - .toObject(FileEventTrigger.class); - Assertions.assertEquals("twdw", model.sourceInfo().shareId()); - Assertions.assertEquals("ftswibyrcdlbhsh", model.sinkInfo().roleId()); - Assertions.assertEquals("p", model.customContextTag()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - FileEventTrigger model = new FileEventTrigger().withSourceInfo(new FileSourceInfo().withShareId("twdw")) - .withSinkInfo(new RoleSinkInfo().withRoleId("ftswibyrcdlbhsh")) - .withCustomContextTag("p"); - model = BinaryData.fromObject(model).toObject(FileEventTrigger.class); - Assertions.assertEquals("twdw", model.sourceInfo().shareId()); - Assertions.assertEquals("ftswibyrcdlbhsh", model.sinkInfo().roleId()); - Assertions.assertEquals("p", model.customContextTag()); - } -} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/FileSourceInfoTests.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/FileSourceInfoTests.java deleted file mode 100644 index 2ec59a53a292..000000000000 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/FileSourceInfoTests.java +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.databoxedge.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.databoxedge.models.FileSourceInfo; -import org.junit.jupiter.api.Assertions; - -public final class FileSourceInfoTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - FileSourceInfo model = BinaryData.fromString("{\"shareId\":\"wxqibyq\"}").toObject(FileSourceInfo.class); - Assertions.assertEquals("wxqibyq", model.shareId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - FileSourceInfo model = new FileSourceInfo().withShareId("wxqibyq"); - model = BinaryData.fromObject(model).toObject(FileSourceInfo.class); - Assertions.assertEquals("wxqibyq", model.shareId()); - } -} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/FileTriggerPropertiesTests.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/FileTriggerPropertiesTests.java deleted file mode 100644 index d1f8aa8b3cec..000000000000 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/FileTriggerPropertiesTests.java +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.databoxedge.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.databoxedge.fluent.models.FileTriggerProperties; -import com.azure.resourcemanager.databoxedge.models.FileSourceInfo; -import com.azure.resourcemanager.databoxedge.models.RoleSinkInfo; -import org.junit.jupiter.api.Assertions; - -public final class FileTriggerPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - FileTriggerProperties model = BinaryData.fromString( - "{\"sourceInfo\":{\"shareId\":\"odn\"},\"sinkInfo\":{\"roleId\":\"zxltjcvn\"},\"customContextTag\":\"tiugcxnav\"}") - .toObject(FileTriggerProperties.class); - Assertions.assertEquals("odn", model.sourceInfo().shareId()); - Assertions.assertEquals("zxltjcvn", model.sinkInfo().roleId()); - Assertions.assertEquals("tiugcxnav", model.customContextTag()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - FileTriggerProperties model - = new FileTriggerProperties().withSourceInfo(new FileSourceInfo().withShareId("odn")) - .withSinkInfo(new RoleSinkInfo().withRoleId("zxltjcvn")) - .withCustomContextTag("tiugcxnav"); - model = BinaryData.fromObject(model).toObject(FileTriggerProperties.class); - Assertions.assertEquals("odn", model.sourceInfo().shareId()); - Assertions.assertEquals("zxltjcvn", model.sinkInfo().roleId()); - Assertions.assertEquals("tiugcxnav", model.customContextTag()); - } -} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/HostCapacityTests.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/HostCapacityTests.java new file mode 100644 index 000000000000..61feb5ae411b --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/HostCapacityTests.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.databoxedge.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.databoxedge.models.HostCapacity; +import org.junit.jupiter.api.Assertions; + +public final class HostCapacityTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + HostCapacity model = BinaryData.fromString( + "{\"hostName\":\"rc\",\"effectiveAvailableMemoryMbOnHost\":9142905180798271400,\"availableGpuCount\":2090411231,\"vmUsedMemory\":{\"ruud\":{\"startupMemoryMB\":4913712923770278840,\"currentMemoryUsageMB\":8108316197592893882},\"ostgkts\":{\"startupMemoryMB\":4363837680117938418,\"currentMemoryUsageMB\":5694550210789779799}},\"gpuType\":\"dxeclzedqbcvh\",\"numaNodesData\":[{\"numaNodeIndex\":1149174942,\"totalMemoryInMb\":3227026724061709231,\"logicalCoreCountPerCore\":1140864864,\"effectiveAvailableMemoryInMb\":6839901350584080017,\"freeVCpuIndexesForHpn\":[551279051,144699831],\"vCpuIndexesForHpn\":[1133428371],\"vCpuIndexesForRoot\":[1934168431,983643035,2123873865]}]}") + .toObject(HostCapacity.class); + Assertions.assertEquals("rc", model.hostName()); + Assertions.assertEquals(9142905180798271400L, model.effectiveAvailableMemoryMbOnHost()); + Assertions.assertEquals(2090411231, model.availableGpuCount()); + Assertions.assertEquals(4913712923770278840L, model.vmUsedMemory().get("ruud").startupMemoryMB()); + Assertions.assertEquals(8108316197592893882L, model.vmUsedMemory().get("ruud").currentMemoryUsageMB()); + Assertions.assertEquals("dxeclzedqbcvh", model.gpuType()); + Assertions.assertEquals(1149174942, model.numaNodesData().get(0).numaNodeIndex()); + Assertions.assertEquals(3227026724061709231L, model.numaNodesData().get(0).totalMemoryInMb()); + Assertions.assertEquals(1140864864, model.numaNodesData().get(0).logicalCoreCountPerCore()); + Assertions.assertEquals(6839901350584080017L, model.numaNodesData().get(0).effectiveAvailableMemoryInMb()); + Assertions.assertEquals(551279051, model.numaNodesData().get(0).freeVCpuIndexesForHpn().get(0)); + Assertions.assertEquals(1133428371, model.numaNodesData().get(0).vCpuIndexesForHpn().get(0)); + Assertions.assertEquals(1934168431, model.numaNodesData().get(0).vCpuIndexesForRoot().get(0)); + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/Ipv4ConfigTests.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/Ipv4ConfigTests.java index db97d717b0d2..d566dbea98d7 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/Ipv4ConfigTests.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/Ipv4ConfigTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.generated; @@ -11,13 +11,7 @@ public final class Ipv4ConfigTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { Ipv4Config model = BinaryData - .fromString("{\"ipAddress\":\"alupjm\",\"subnet\":\"fxobbcsws\",\"gateway\":\"jriplrbpbewtghf\"}") + .fromString("{\"ipAddress\":\"ummajtjaod\",\"subnet\":\"bnbdxkqpxokajion\",\"gateway\":\"mexgstxgcp\"}") .toObject(Ipv4Config.class); } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - Ipv4Config model = new Ipv4Config(); - model = BinaryData.fromObject(model).toObject(Ipv4Config.class); - } } diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/Ipv6ConfigTests.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/Ipv6ConfigTests.java index 55eb5a4e4671..7406b7bfedcd 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/Ipv6ConfigTests.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/Ipv6ConfigTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.generated; @@ -11,13 +11,7 @@ public final class Ipv6ConfigTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { Ipv6Config model = BinaryData - .fromString("{\"ipAddress\":\"lcgwxzvlvqh\",\"prefixLength\":1823532721,\"gateway\":\"gibtnm\"}") + .fromString("{\"ipAddress\":\"gmaajrm\",\"prefixLength\":1305884847,\"gateway\":\"zrlovmclwhijcoej\"}") .toObject(Ipv6Config.class); } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - Ipv6Config model = new Ipv6Config(); - model = BinaryData.fromObject(model).toObject(Ipv6Config.class); - } } diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/JobPropertiesTests.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/JobPropertiesTests.java index 944900eca3de..6dd306714102 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/JobPropertiesTests.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/JobPropertiesTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.generated; @@ -12,15 +12,8 @@ public final class JobPropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { JobProperties model = BinaryData.fromString( - "{\"jobType\":\"InstallUpdates\",\"currentStage\":\"RescanStarted\",\"downloadProgress\":{\"downloadPhase\":\"Unknown\",\"percentComplete\":750094319,\"totalBytesToDownload\":21.972088249516553,\"totalBytesDownloaded\":8.8054477359928,\"numberOfUpdatesToDownload\":63986979,\"numberOfUpdatesDownloaded\":511745945},\"installProgress\":{\"percentComplete\":2122365511,\"numberOfUpdatesToInstall\":516508763,\"numberOfUpdatesInstalled\":1443350377},\"totalRefreshErrors\":2099560460,\"errorManifestFile\":\"zoggigrxwburvjxx\",\"refreshedEntityId\":\"spyd\",\"folder\":\"koen\"}") + "{\"jobType\":\"Backup\",\"currentStage\":\"Initial\",\"downloadProgress\":{\"downloadPhase\":\"Unknown\",\"percentComplete\":1026914225,\"totalBytesToDownload\":38.54843275489366,\"totalBytesDownloaded\":58.2634280586535,\"numberOfUpdatesToDownload\":339045288,\"numberOfUpdatesDownloaded\":1247877079},\"installProgress\":{\"percentComplete\":1989363833,\"numberOfUpdatesToInstall\":670183300,\"numberOfUpdatesInstalled\":1911820344},\"totalRefreshErrors\":2105060368,\"errorManifestFile\":\"ashrt\",\"refreshedEntityId\":\"kcnqxwbpo\",\"folder\":\"lpiujwaa\"}") .toObject(JobProperties.class); - Assertions.assertEquals("koen", model.folder()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - JobProperties model = new JobProperties().withFolder("koen"); - model = BinaryData.fromObject(model).toObject(JobProperties.class); - Assertions.assertEquals("koen", model.folder()); + Assertions.assertEquals("lpiujwaa", model.folder()); } } diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/MetricConfigurationTests.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/MetricConfigurationTests.java new file mode 100644 index 000000000000..83bfea5088e8 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/MetricConfigurationTests.java @@ -0,0 +1,109 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.databoxedge.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.databoxedge.models.MetricConfiguration; +import com.azure.resourcemanager.databoxedge.models.MetricCounter; +import com.azure.resourcemanager.databoxedge.models.MetricCounterSet; +import com.azure.resourcemanager.databoxedge.models.MetricDimension; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class MetricConfigurationTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + MetricConfiguration model = BinaryData.fromString( + "{\"resourceId\":\"smiccwrwfscj\",\"mdmAccount\":\"ynszquji\",\"metricNameSpace\":\"voqyt\",\"counterSets\":[{\"counters\":[{\"name\":\"owbb\",\"instance\":\"yavutpthjoxois\",\"dimensionFilter\":[{\"sourceType\":\"sbpimlq\",\"sourceName\":\"ljxkcgxxlx\"},{\"sourceType\":\"ffgcvizqz\",\"sourceName\":\"wlvwlyoupf\"},{\"sourceType\":\"fbkjubdyhgkfmi\",\"sourceName\":\"sgow\"}],\"additionalDimensions\":[{\"sourceType\":\"tsttktlahbq\",\"sourceName\":\"ctxtgzukxi\"},{\"sourceType\":\"mmqtgqqqxhr\",\"sourceName\":\"xrxc\"},{\"sourceType\":\"juisavokqdzf\",\"sourceName\":\"azivjlfrqttbajl\"},{\"sourceType\":\"atnwxyiopi\",\"sourceName\":\"kqqfk\"}]}]},{\"counters\":[{\"name\":\"s\",\"instance\":\"kdmligovi\",\"dimensionFilter\":[{\"sourceType\":\"kpmloa\",\"sourceName\":\"uruocbgo\"}],\"additionalDimensions\":[{\"sourceType\":\"te\",\"sourceName\":\"ybfhjxa\"},{\"sourceType\":\"vvjgslor\",\"sourceName\":\"il\"}]}]},{\"counters\":[{\"name\":\"wwtkg\",\"instance\":\"nye\",\"dimensionFilter\":[{\"sourceType\":\"gyvudtjuewbc\",\"sourceName\":\"hxuuwhcjyxccybvp\"}],\"additionalDimensions\":[{\"sourceType\":\"kkudzp\",\"sourceName\":\"gwjplmag\"},{\"sourceType\":\"tcyohpfkyrk\",\"sourceName\":\"bdgiogsjk\"}]}]},{\"counters\":[{\"name\":\"wqjnob\",\"instance\":\"yhddvia\",\"dimensionFilter\":[{\"sourceType\":\"fnmntfpmvmemfn\",\"sourceName\":\"zdwvvbalxl\"},{\"sourceType\":\"lchpodbzevwrdn\",\"sourceName\":\"fukuvsjcswsmystu\"},{\"sourceType\":\"uqypfcvle\",\"sourceName\":\"chpqbmfpjba\"},{\"sourceType\":\"widf\",\"sourceName\":\"xsspuunnoxyhk\"}],\"additionalDimensions\":[{\"sourceType\":\"ddrihpf\",\"sourceName\":\"oqcaaewdaomdj\"},{\"sourceType\":\"l\",\"sourceName\":\"jxxkzbrmsgei\"},{\"sourceType\":\"siykzkdncjdxonbz\",\"sourceName\":\"ggcula\"},{\"sourceType\":\"z\",\"sourceName\":\"y\"}]},{\"name\":\"pgogtqxepny\",\"instance\":\"fuajly\",\"dimensionFilter\":[{\"sourceType\":\"vofqzhvfc\",\"sourceName\":\"byfmowuxr\"},{\"sourceType\":\"jpvd\",\"sourceName\":\"xfzwi\"},{\"sourceType\":\"vwzjbhyz\",\"sourceName\":\"xjrk\"},{\"sourceType\":\"mbtrnegvmnvu\",\"sourceName\":\"eqvldspast\"}],\"additionalDimensions\":[{\"sourceType\":\"kdmflvestmjlx\",\"sourceName\":\"ril\"},{\"sourceType\":\"zapeewchpx\",\"sourceName\":\"ktwkuziyc\"}]}]}]}") + .toObject(MetricConfiguration.class); + Assertions.assertEquals("smiccwrwfscj", model.resourceId()); + Assertions.assertEquals("ynszquji", model.mdmAccount()); + Assertions.assertEquals("voqyt", model.metricNameSpace()); + Assertions.assertEquals("owbb", model.counterSets().get(0).counters().get(0).name()); + Assertions.assertEquals("yavutpthjoxois", model.counterSets().get(0).counters().get(0).instance()); + Assertions.assertEquals("sbpimlq", + model.counterSets().get(0).counters().get(0).dimensionFilter().get(0).sourceType()); + Assertions.assertEquals("ljxkcgxxlx", + model.counterSets().get(0).counters().get(0).dimensionFilter().get(0).sourceName()); + Assertions.assertEquals("tsttktlahbq", + model.counterSets().get(0).counters().get(0).additionalDimensions().get(0).sourceType()); + Assertions.assertEquals("ctxtgzukxi", + model.counterSets().get(0).counters().get(0).additionalDimensions().get(0).sourceName()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + MetricConfiguration model + = new MetricConfiguration().withResourceId("smiccwrwfscj") + .withMdmAccount("ynszquji") + .withMetricNameSpace("voqyt") + .withCounterSets( + Arrays.asList( + new MetricCounterSet().withCounters(Arrays.asList(new MetricCounter().withName("owbb") + .withInstance("yavutpthjoxois") + .withDimensionFilter(Arrays.asList( + new MetricDimension().withSourceType("sbpimlq").withSourceName("ljxkcgxxlx"), + new MetricDimension().withSourceType("ffgcvizqz").withSourceName("wlvwlyoupf"), + new MetricDimension().withSourceType("fbkjubdyhgkfmi").withSourceName("sgow"))) + .withAdditionalDimensions(Arrays.asList( + new MetricDimension().withSourceType("tsttktlahbq").withSourceName("ctxtgzukxi"), + new MetricDimension().withSourceType("mmqtgqqqxhr").withSourceName("xrxc"), + new MetricDimension().withSourceType("juisavokqdzf").withSourceName("azivjlfrqttbajl"), + new MetricDimension().withSourceType("atnwxyiopi").withSourceName("kqqfk"))))), + new MetricCounterSet().withCounters(Arrays.asList(new MetricCounter().withName("s") + .withInstance("kdmligovi") + .withDimensionFilter(Arrays + .asList(new MetricDimension().withSourceType("kpmloa").withSourceName("uruocbgo"))) + .withAdditionalDimensions( + Arrays.asList(new MetricDimension().withSourceType("te").withSourceName("ybfhjxa"), + new MetricDimension().withSourceType("vvjgslor").withSourceName("il"))))), + new MetricCounterSet().withCounters(Arrays.asList(new MetricCounter().withName("wwtkg") + .withInstance("nye") + .withDimensionFilter(Arrays.asList(new MetricDimension().withSourceType("gyvudtjuewbc") + .withSourceName("hxuuwhcjyxccybvp"))) + .withAdditionalDimensions( + Arrays.asList(new MetricDimension().withSourceType("kkudzp").withSourceName("gwjplmag"), + new MetricDimension().withSourceType("tcyohpfkyrk").withSourceName("bdgiogsjk"))))), + new MetricCounterSet().withCounters(Arrays.asList( + new MetricCounter().withName("wqjnob") + .withInstance("yhddvia") + .withDimensionFilter(Arrays.asList( + new MetricDimension().withSourceType("fnmntfpmvmemfn").withSourceName("zdwvvbalxl"), + new MetricDimension().withSourceType("lchpodbzevwrdn") + .withSourceName("fukuvsjcswsmystu"), + new MetricDimension().withSourceType("uqypfcvle").withSourceName("chpqbmfpjba"), + new MetricDimension().withSourceType("widf").withSourceName("xsspuunnoxyhk"))) + .withAdditionalDimensions(Arrays.asList( + new MetricDimension().withSourceType("ddrihpf").withSourceName("oqcaaewdaomdj"), + new MetricDimension().withSourceType("l").withSourceName("jxxkzbrmsgei"), + new MetricDimension().withSourceType("siykzkdncjdxonbz").withSourceName("ggcula"), + new MetricDimension().withSourceType("z").withSourceName("y"))), + new MetricCounter().withName("pgogtqxepny") + .withInstance("fuajly") + .withDimensionFilter(Arrays.asList( + new MetricDimension().withSourceType("vofqzhvfc").withSourceName("byfmowuxr"), + new MetricDimension().withSourceType("jpvd").withSourceName("xfzwi"), + new MetricDimension().withSourceType("vwzjbhyz").withSourceName("xjrk"), + new MetricDimension().withSourceType("mbtrnegvmnvu").withSourceName("eqvldspast"))) + .withAdditionalDimensions(Arrays.asList( + new MetricDimension().withSourceType("kdmflvestmjlx").withSourceName("ril"), + new MetricDimension().withSourceType("zapeewchpx") + .withSourceName("ktwkuziyc"))))))); + model = BinaryData.fromObject(model).toObject(MetricConfiguration.class); + Assertions.assertEquals("smiccwrwfscj", model.resourceId()); + Assertions.assertEquals("ynszquji", model.mdmAccount()); + Assertions.assertEquals("voqyt", model.metricNameSpace()); + Assertions.assertEquals("owbb", model.counterSets().get(0).counters().get(0).name()); + Assertions.assertEquals("yavutpthjoxois", model.counterSets().get(0).counters().get(0).instance()); + Assertions.assertEquals("sbpimlq", + model.counterSets().get(0).counters().get(0).dimensionFilter().get(0).sourceType()); + Assertions.assertEquals("ljxkcgxxlx", + model.counterSets().get(0).counters().get(0).dimensionFilter().get(0).sourceName()); + Assertions.assertEquals("tsttktlahbq", + model.counterSets().get(0).counters().get(0).additionalDimensions().get(0).sourceType()); + Assertions.assertEquals("ctxtgzukxi", + model.counterSets().get(0).counters().get(0).additionalDimensions().get(0).sourceName()); + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/MetricCounterSetTests.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/MetricCounterSetTests.java new file mode 100644 index 000000000000..c3a8cb69c081 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/MetricCounterSetTests.java @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.databoxedge.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.databoxedge.models.MetricCounter; +import com.azure.resourcemanager.databoxedge.models.MetricCounterSet; +import com.azure.resourcemanager.databoxedge.models.MetricDimension; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class MetricCounterSetTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + MetricCounterSet model = BinaryData.fromString( + "{\"counters\":[{\"name\":\"evufuztck\",\"instance\":\"h\",\"dimensionFilter\":[{\"sourceType\":\"edcg\",\"sourceName\":\"ulwm\"},{\"sourceType\":\"rqzz\",\"sourceName\":\"rjvpglydzgkrvqee\"},{\"sourceType\":\"toepryu\",\"sourceName\":\"nwy\"}],\"additionalDimensions\":[{\"sourceType\":\"dmovzvfva\",\"sourceName\":\"wzqa\"},{\"sourceType\":\"f\",\"sourceName\":\"gzuriglaecxndt\"}]},{\"name\":\"cokpv\",\"instance\":\"lqtmldgxob\",\"dimensionFilter\":[{\"sourceType\":\"clnpkci\",\"sourceName\":\"yzriykhy\"},{\"sourceType\":\"wf\",\"sourceName\":\"jlb\"}],\"additionalDimensions\":[{\"sourceType\":\"vkjlmxhom\",\"sourceName\":\"ynhdwdigum\"},{\"sourceType\":\"nraauzz\",\"sourceName\":\"tj\"},{\"sourceType\":\"zysdzh\",\"sourceName\":\"zwwva\"}]},{\"name\":\"qyuvvfonkp\",\"instance\":\"qyikvy\",\"dimensionFilter\":[{\"sourceType\":\"yavluwmncstt\",\"sourceName\":\"jfybvpoekrsgsgb\"}],\"additionalDimensions\":[{\"sourceType\":\"zq\",\"sourceName\":\"njdgkynscliq\"},{\"sourceType\":\"zvhxnk\",\"sourceName\":\"mtk\"},{\"sourceType\":\"bo\",\"sourceName\":\"ppnvdxz\"},{\"sourceType\":\"hihfrbbcevqagtlt\",\"sourceName\":\"hlfkqojpy\"}]},{\"name\":\"vgtrdcnifmzzs\",\"instance\":\"m\",\"dimensionFilter\":[{\"sourceType\":\"ysuxmprafwgck\",\"sourceName\":\"ocxvdfffwafqr\"},{\"sourceType\":\"udaspavehh\",\"sourceName\":\"vkbunzozudh\"},{\"sourceType\":\"xg\",\"sourceName\":\"moy\"},{\"sourceType\":\"cdyuibhmfdnbzyd\",\"sourceName\":\"f\"}],\"additionalDimensions\":[{\"sourceType\":\"jnaeois\",\"sourceName\":\"vhmgorffukis\"},{\"sourceType\":\"vwmzhwplefaxvxil\",\"sourceName\":\"btgn\"},{\"sourceType\":\"nzeyqxtjj\",\"sourceName\":\"zqlqhyc\"},{\"sourceType\":\"vodggxdbee\",\"sourceName\":\"mieknlraria\"}]}]}") + .toObject(MetricCounterSet.class); + Assertions.assertEquals("evufuztck", model.counters().get(0).name()); + Assertions.assertEquals("h", model.counters().get(0).instance()); + Assertions.assertEquals("edcg", model.counters().get(0).dimensionFilter().get(0).sourceType()); + Assertions.assertEquals("ulwm", model.counters().get(0).dimensionFilter().get(0).sourceName()); + Assertions.assertEquals("dmovzvfva", model.counters().get(0).additionalDimensions().get(0).sourceType()); + Assertions.assertEquals("wzqa", model.counters().get(0).additionalDimensions().get(0).sourceName()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + MetricCounterSet model = new MetricCounterSet().withCounters(Arrays.asList( + new MetricCounter().withName("evufuztck") + .withInstance("h") + .withDimensionFilter(Arrays.asList(new MetricDimension().withSourceType("edcg").withSourceName("ulwm"), + new MetricDimension().withSourceType("rqzz").withSourceName("rjvpglydzgkrvqee"), + new MetricDimension().withSourceType("toepryu").withSourceName("nwy"))) + .withAdditionalDimensions( + Arrays.asList(new MetricDimension().withSourceType("dmovzvfva").withSourceName("wzqa"), + new MetricDimension().withSourceType("f").withSourceName("gzuriglaecxndt"))), + new MetricCounter().withName("cokpv") + .withInstance("lqtmldgxob") + .withDimensionFilter( + Arrays.asList(new MetricDimension().withSourceType("clnpkci").withSourceName("yzriykhy"), + new MetricDimension().withSourceType("wf").withSourceName("jlb"))) + .withAdditionalDimensions( + Arrays.asList(new MetricDimension().withSourceType("vkjlmxhom").withSourceName("ynhdwdigum"), + new MetricDimension().withSourceType("nraauzz").withSourceName("tj"), + new MetricDimension().withSourceType("zysdzh").withSourceName("zwwva"))), + new MetricCounter().withName("qyuvvfonkp") + .withInstance("qyikvy") + .withDimensionFilter(Arrays + .asList(new MetricDimension().withSourceType("yavluwmncstt").withSourceName("jfybvpoekrsgsgb"))) + .withAdditionalDimensions( + Arrays.asList(new MetricDimension().withSourceType("zq").withSourceName("njdgkynscliq"), + new MetricDimension().withSourceType("zvhxnk").withSourceName("mtk"), + new MetricDimension().withSourceType("bo").withSourceName("ppnvdxz"), + new MetricDimension().withSourceType("hihfrbbcevqagtlt").withSourceName("hlfkqojpy"))), + new MetricCounter().withName("vgtrdcnifmzzs") + .withInstance("m") + .withDimensionFilter( + Arrays.asList(new MetricDimension().withSourceType("ysuxmprafwgck").withSourceName("ocxvdfffwafqr"), + new MetricDimension().withSourceType("udaspavehh").withSourceName("vkbunzozudh"), + new MetricDimension().withSourceType("xg").withSourceName("moy"), + new MetricDimension().withSourceType("cdyuibhmfdnbzyd").withSourceName("f"))) + .withAdditionalDimensions( + Arrays.asList(new MetricDimension().withSourceType("jnaeois").withSourceName("vhmgorffukis"), + new MetricDimension().withSourceType("vwmzhwplefaxvxil").withSourceName("btgn"), + new MetricDimension().withSourceType("nzeyqxtjj").withSourceName("zqlqhyc"), + new MetricDimension().withSourceType("vodggxdbee").withSourceName("mieknlraria"))))); + model = BinaryData.fromObject(model).toObject(MetricCounterSet.class); + Assertions.assertEquals("evufuztck", model.counters().get(0).name()); + Assertions.assertEquals("h", model.counters().get(0).instance()); + Assertions.assertEquals("edcg", model.counters().get(0).dimensionFilter().get(0).sourceType()); + Assertions.assertEquals("ulwm", model.counters().get(0).dimensionFilter().get(0).sourceName()); + Assertions.assertEquals("dmovzvfva", model.counters().get(0).additionalDimensions().get(0).sourceType()); + Assertions.assertEquals("wzqa", model.counters().get(0).additionalDimensions().get(0).sourceName()); + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/MetricCounterTests.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/MetricCounterTests.java new file mode 100644 index 000000000000..ddca8523ee9a --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/MetricCounterTests.java @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.databoxedge.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.databoxedge.models.MetricCounter; +import com.azure.resourcemanager.databoxedge.models.MetricDimension; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class MetricCounterTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + MetricCounter model = BinaryData.fromString( + "{\"name\":\"wiuagydwqf\",\"instance\":\"lyr\",\"dimensionFilter\":[{\"sourceType\":\"agt\",\"sourceName\":\"ojocqwogf\"},{\"sourceType\":\"zjvusfzldmo\",\"sourceName\":\"uxylfsbtkadpy\"}],\"additionalDimensions\":[{\"sourceType\":\"nbtgkbugrjqctoj\",\"sourceName\":\"mi\"}]}") + .toObject(MetricCounter.class); + Assertions.assertEquals("wiuagydwqf", model.name()); + Assertions.assertEquals("lyr", model.instance()); + Assertions.assertEquals("agt", model.dimensionFilter().get(0).sourceType()); + Assertions.assertEquals("ojocqwogf", model.dimensionFilter().get(0).sourceName()); + Assertions.assertEquals("nbtgkbugrjqctoj", model.additionalDimensions().get(0).sourceType()); + Assertions.assertEquals("mi", model.additionalDimensions().get(0).sourceName()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + MetricCounter model = new MetricCounter().withName("wiuagydwqf") + .withInstance("lyr") + .withDimensionFilter(Arrays.asList(new MetricDimension().withSourceType("agt").withSourceName("ojocqwogf"), + new MetricDimension().withSourceType("zjvusfzldmo").withSourceName("uxylfsbtkadpy"))) + .withAdditionalDimensions( + Arrays.asList(new MetricDimension().withSourceType("nbtgkbugrjqctoj").withSourceName("mi"))); + model = BinaryData.fromObject(model).toObject(MetricCounter.class); + Assertions.assertEquals("wiuagydwqf", model.name()); + Assertions.assertEquals("lyr", model.instance()); + Assertions.assertEquals("agt", model.dimensionFilter().get(0).sourceType()); + Assertions.assertEquals("ojocqwogf", model.dimensionFilter().get(0).sourceName()); + Assertions.assertEquals("nbtgkbugrjqctoj", model.additionalDimensions().get(0).sourceType()); + Assertions.assertEquals("mi", model.additionalDimensions().get(0).sourceName()); + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/MetricDimensionTests.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/MetricDimensionTests.java new file mode 100644 index 000000000000..d005a668214d --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/MetricDimensionTests.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.databoxedge.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.databoxedge.models.MetricDimension; +import org.junit.jupiter.api.Assertions; + +public final class MetricDimensionTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + MetricDimension model = BinaryData.fromString("{\"sourceType\":\"of\",\"sourceName\":\"eypefojyqd\"}") + .toObject(MetricDimension.class); + Assertions.assertEquals("of", model.sourceType()); + Assertions.assertEquals("eypefojyqd", model.sourceName()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + MetricDimension model = new MetricDimension().withSourceType("of").withSourceName("eypefojyqd"); + model = BinaryData.fromObject(model).toObject(MetricDimension.class); + Assertions.assertEquals("of", model.sourceType()); + Assertions.assertEquals("eypefojyqd", model.sourceName()); + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/MetricDimensionV1Tests.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/MetricDimensionV1Tests.java deleted file mode 100644 index 4e645383bc21..000000000000 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/MetricDimensionV1Tests.java +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.databoxedge.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.databoxedge.models.MetricDimensionV1; -import org.junit.jupiter.api.Assertions; - -public final class MetricDimensionV1Tests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - MetricDimensionV1 model - = BinaryData.fromString("{\"name\":\"bdkvwrwjf\",\"displayName\":\"snhu\",\"toBeExportedForShoebox\":true}") - .toObject(MetricDimensionV1.class); - Assertions.assertEquals("bdkvwrwjf", model.name()); - Assertions.assertEquals("snhu", model.displayName()); - Assertions.assertEquals(true, model.toBeExportedForShoebox()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - MetricDimensionV1 model - = new MetricDimensionV1().withName("bdkvwrwjf").withDisplayName("snhu").withToBeExportedForShoebox(true); - model = BinaryData.fromObject(model).toObject(MetricDimensionV1.class); - Assertions.assertEquals("bdkvwrwjf", model.name()); - Assertions.assertEquals("snhu", model.displayName()); - Assertions.assertEquals(true, model.toBeExportedForShoebox()); - } -} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/MetricSpecificationV1Tests.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/MetricSpecificationV1Tests.java deleted file mode 100644 index af86cd7968b3..000000000000 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/MetricSpecificationV1Tests.java +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.databoxedge.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.databoxedge.models.MetricAggregationType; -import com.azure.resourcemanager.databoxedge.models.MetricCategory; -import com.azure.resourcemanager.databoxedge.models.MetricDimensionV1; -import com.azure.resourcemanager.databoxedge.models.MetricSpecificationV1; -import com.azure.resourcemanager.databoxedge.models.MetricUnit; -import com.azure.resourcemanager.databoxedge.models.TimeGrain; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class MetricSpecificationV1Tests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - MetricSpecificationV1 model = BinaryData.fromString( - "{\"name\":\"ubljofxqe\",\"displayName\":\"jaeq\",\"displayDescription\":\"qjbasvms\",\"unit\":\"CountPerSecond\",\"aggregationType\":\"None\",\"dimensions\":[{\"name\":\"ntnbybkzg\",\"displayName\":\"rwclxxwrljdo\",\"toBeExportedForShoebox\":true},{\"name\":\"qvkoc\",\"displayName\":\"jdkwtnhxbnjb\",\"toBeExportedForShoebox\":true},{\"name\":\"rglssainqpj\",\"displayName\":\"zlljfmppeebvm\",\"toBeExportedForShoebox\":true},{\"name\":\"bkyqduu\",\"displayName\":\"tcj\",\"toBeExportedForShoebox\":true}],\"fillGapWithZero\":false,\"category\":\"Capacity\",\"resourceIdDimensionNameOverride\":\"hkr\",\"supportedTimeGrainTypes\":[\"PT5M\"],\"supportedAggregationTypes\":[\"Average\"]}") - .toObject(MetricSpecificationV1.class); - Assertions.assertEquals("ubljofxqe", model.name()); - Assertions.assertEquals("jaeq", model.displayName()); - Assertions.assertEquals("qjbasvms", model.displayDescription()); - Assertions.assertEquals(MetricUnit.COUNT_PER_SECOND, model.unit()); - Assertions.assertEquals(MetricAggregationType.NONE, model.aggregationType()); - Assertions.assertEquals("ntnbybkzg", model.dimensions().get(0).name()); - Assertions.assertEquals("rwclxxwrljdo", model.dimensions().get(0).displayName()); - Assertions.assertEquals(true, model.dimensions().get(0).toBeExportedForShoebox()); - Assertions.assertEquals(false, model.fillGapWithZero()); - Assertions.assertEquals(MetricCategory.CAPACITY, model.category()); - Assertions.assertEquals("hkr", model.resourceIdDimensionNameOverride()); - Assertions.assertEquals(TimeGrain.PT5M, model.supportedTimeGrainTypes().get(0)); - Assertions.assertEquals(MetricAggregationType.AVERAGE, model.supportedAggregationTypes().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - MetricSpecificationV1 model = new MetricSpecificationV1().withName("ubljofxqe") - .withDisplayName("jaeq") - .withDisplayDescription("qjbasvms") - .withUnit(MetricUnit.COUNT_PER_SECOND) - .withAggregationType(MetricAggregationType.NONE) - .withDimensions(Arrays.asList( - new MetricDimensionV1().withName("ntnbybkzg") - .withDisplayName("rwclxxwrljdo") - .withToBeExportedForShoebox(true), - new MetricDimensionV1().withName("qvkoc") - .withDisplayName("jdkwtnhxbnjb") - .withToBeExportedForShoebox(true), - new MetricDimensionV1().withName("rglssainqpj") - .withDisplayName("zlljfmppeebvm") - .withToBeExportedForShoebox(true), - new MetricDimensionV1().withName("bkyqduu").withDisplayName("tcj").withToBeExportedForShoebox(true))) - .withFillGapWithZero(false) - .withCategory(MetricCategory.CAPACITY) - .withResourceIdDimensionNameOverride("hkr") - .withSupportedTimeGrainTypes(Arrays.asList(TimeGrain.PT5M)) - .withSupportedAggregationTypes(Arrays.asList(MetricAggregationType.AVERAGE)); - model = BinaryData.fromObject(model).toObject(MetricSpecificationV1.class); - Assertions.assertEquals("ubljofxqe", model.name()); - Assertions.assertEquals("jaeq", model.displayName()); - Assertions.assertEquals("qjbasvms", model.displayDescription()); - Assertions.assertEquals(MetricUnit.COUNT_PER_SECOND, model.unit()); - Assertions.assertEquals(MetricAggregationType.NONE, model.aggregationType()); - Assertions.assertEquals("ntnbybkzg", model.dimensions().get(0).name()); - Assertions.assertEquals("rwclxxwrljdo", model.dimensions().get(0).displayName()); - Assertions.assertEquals(true, model.dimensions().get(0).toBeExportedForShoebox()); - Assertions.assertEquals(false, model.fillGapWithZero()); - Assertions.assertEquals(MetricCategory.CAPACITY, model.category()); - Assertions.assertEquals("hkr", model.resourceIdDimensionNameOverride()); - Assertions.assertEquals(TimeGrain.PT5M, model.supportedTimeGrainTypes().get(0)); - Assertions.assertEquals(MetricAggregationType.AVERAGE, model.supportedAggregationTypes().get(0)); - } -} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/MonitoringConfigsCreateOrUpdateMockTests.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/MonitoringConfigsCreateOrUpdateMockTests.java new file mode 100644 index 000000000000..0ea7044fbf20 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/MonitoringConfigsCreateOrUpdateMockTests.java @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.databoxedge.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.databoxedge.DataBoxEdgeManager; +import com.azure.resourcemanager.databoxedge.fluent.models.MonitoringMetricConfigurationInner; +import com.azure.resourcemanager.databoxedge.models.MetricConfiguration; +import com.azure.resourcemanager.databoxedge.models.MetricCounterSet; +import com.azure.resourcemanager.databoxedge.models.MonitoringMetricConfiguration; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class MonitoringConfigsCreateOrUpdateMockTests { + @Test + public void testCreateOrUpdate() throws Exception { + String responseStr + = "{\"properties\":{\"metricConfigurations\":[{\"resourceId\":\"juskbrreqyn\",\"mdmAccount\":\"eysfaqegplw\",\"metricNameSpace\":\"shwddkvbxgk\",\"counterSets\":[{\"counters\":[]},{\"counters\":[]},{\"counters\":[]}]}]},\"id\":\"ybwptda\",\"name\":\"arvvlfnt\",\"type\":\"mt\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + DataBoxEdgeManager manager = DataBoxEdgeManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + MonitoringMetricConfiguration response = manager.monitoringConfigs() + .createOrUpdate("cgqyhleseyq", "hvyeldotj", + new MonitoringMetricConfigurationInner().withMetricConfigurations(Arrays.asList( + new MetricConfiguration().withResourceId("kwiswskukjtas") + .withMdmAccount("wispkxk") + .withMetricNameSpace("xfkndlqvtwknvgm") + .withCounterSets(Arrays.asList(new MetricCounterSet().withCounters(Arrays.asList()), + new MetricCounterSet().withCounters(Arrays.asList()), + new MetricCounterSet().withCounters(Arrays.asList()))), + new MetricConfiguration().withResourceId("ugtywatmqaqkue") + .withMdmAccount("groeshoyg") + .withMetricNameSpace("byfqxkfaoy") + .withCounterSets(Arrays.asList(new MetricCounterSet().withCounters(Arrays.asList()), + new MetricCounterSet().withCounters(Arrays.asList()), + new MetricCounterSet().withCounters(Arrays.asList()))))), + com.azure.core.util.Context.NONE); + + Assertions.assertEquals("juskbrreqyn", response.metricConfigurations().get(0).resourceId()); + Assertions.assertEquals("eysfaqegplw", response.metricConfigurations().get(0).mdmAccount()); + Assertions.assertEquals("shwddkvbxgk", response.metricConfigurations().get(0).metricNameSpace()); + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/MonitoringConfigsDeleteMockTests.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/MonitoringConfigsDeleteMockTests.java new file mode 100644 index 000000000000..d01d6a6d1885 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/MonitoringConfigsDeleteMockTests.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.databoxedge.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.databoxedge.DataBoxEdgeManager; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class MonitoringConfigsDeleteMockTests { + @Test + public void testDelete() throws Exception { + String responseStr = "{}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + DataBoxEdgeManager manager = DataBoxEdgeManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + manager.monitoringConfigs().delete("oiwenazerohzrsq", "lsxkd", com.azure.core.util.Context.NONE); + + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/MonitoringConfigsGetWithResponseMockTests.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/MonitoringConfigsGetWithResponseMockTests.java new file mode 100644 index 000000000000..0552b0c8b79c --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/MonitoringConfigsGetWithResponseMockTests.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.databoxedge.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.databoxedge.DataBoxEdgeManager; +import com.azure.resourcemanager.databoxedge.models.MonitoringMetricConfiguration; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class MonitoringConfigsGetWithResponseMockTests { + @Test + public void testGetWithResponse() throws Exception { + String responseStr + = "{\"properties\":{\"metricConfigurations\":[{\"resourceId\":\"buscgduus\",\"mdmAccount\":\"ycblevpmcl\",\"metricNameSpace\":\"yxkyxlz\",\"counterSets\":[{\"counters\":[]},{\"counters\":[]},{\"counters\":[]}]},{\"resourceId\":\"jgkz\",\"mdmAccount\":\"taf\",\"metricNameSpace\":\"zffovwmbjl\",\"counterSets\":[{\"counters\":[]},{\"counters\":[]},{\"counters\":[]},{\"counters\":[]}]}]},\"id\":\"czpgvdwnapfdq\",\"name\":\"owftptnuwjtks\",\"type\":\"h\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + DataBoxEdgeManager manager = DataBoxEdgeManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + MonitoringMetricConfiguration response = manager.monitoringConfigs() + .getWithResponse("qdbrxmrgc", "bapxkiyfjjkb", com.azure.core.util.Context.NONE) + .getValue(); + + Assertions.assertEquals("buscgduus", response.metricConfigurations().get(0).resourceId()); + Assertions.assertEquals("ycblevpmcl", response.metricConfigurations().get(0).mdmAccount()); + Assertions.assertEquals("yxkyxlz", response.metricConfigurations().get(0).metricNameSpace()); + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/MonitoringConfigsListMockTests.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/MonitoringConfigsListMockTests.java new file mode 100644 index 000000000000..bdd9fb7c66cb --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/MonitoringConfigsListMockTests.java @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.databoxedge.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.databoxedge.DataBoxEdgeManager; +import com.azure.resourcemanager.databoxedge.models.MonitoringMetricConfiguration; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class MonitoringConfigsListMockTests { + @Test + public void testList() throws Exception { + String responseStr + = "{\"value\":[{\"properties\":{\"metricConfigurations\":[{\"resourceId\":\"h\",\"mdmAccount\":\"uipldqq\",\"metricNameSpace\":\"ekvalblhtjq\",\"counterSets\":[{\"counters\":[]}]},{\"resourceId\":\"yvwehtaemxh\",\"mdmAccount\":\"ysev\",\"metricNameSpace\":\"xivzrrry\",\"counterSets\":[{\"counters\":[]},{\"counters\":[]}]}]},\"id\":\"mipskdyzatv\",\"name\":\"uzkaftjvvruxwi\",\"type\":\"syeipqd\"}]}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + DataBoxEdgeManager manager = DataBoxEdgeManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + PagedIterable response + = manager.monitoringConfigs().list("wqapfgsdp", "vessm", com.azure.core.util.Context.NONE); + + Assertions.assertEquals("h", response.iterator().next().metricConfigurations().get(0).resourceId()); + Assertions.assertEquals("uipldqq", response.iterator().next().metricConfigurations().get(0).mdmAccount()); + Assertions.assertEquals("ekvalblhtjq", + response.iterator().next().metricConfigurations().get(0).metricNameSpace()); + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/MonitoringMetricConfigurationInnerTests.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/MonitoringMetricConfigurationInnerTests.java new file mode 100644 index 000000000000..5248a7675414 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/MonitoringMetricConfigurationInnerTests.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.databoxedge.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.databoxedge.fluent.models.MonitoringMetricConfigurationInner; +import com.azure.resourcemanager.databoxedge.models.MetricConfiguration; +import com.azure.resourcemanager.databoxedge.models.MetricCounter; +import com.azure.resourcemanager.databoxedge.models.MetricCounterSet; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class MonitoringMetricConfigurationInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + MonitoringMetricConfigurationInner model = BinaryData.fromString( + "{\"properties\":{\"metricConfigurations\":[{\"resourceId\":\"dyg\",\"mdmAccount\":\"okkqfqjbvleo\",\"metricNameSpace\":\"ml\",\"counterSets\":[{\"counters\":[{\"name\":\"tqzfavyv\"},{\"name\":\"qqybarye\"},{\"name\":\"ayjkqa\"}]},{\"counters\":[{\"name\":\"gzslesjcbhernnti\"},{\"name\":\"w\"}]},{\"counters\":[{\"name\":\"cv\"}]}]},{\"resourceId\":\"quwrbehwag\",\"mdmAccount\":\"buffkmrqemvvhm\",\"metricNameSpace\":\"drjf\",\"counterSets\":[{\"counters\":[{\"name\":\"coebjvewzcj\"},{\"name\":\"nmwcpmgu\"}]}]}]},\"id\":\"draufactkah\",\"name\":\"ovajjziuxxps\",\"type\":\"neekulfg\"}") + .toObject(MonitoringMetricConfigurationInner.class); + Assertions.assertEquals("dyg", model.metricConfigurations().get(0).resourceId()); + Assertions.assertEquals("okkqfqjbvleo", model.metricConfigurations().get(0).mdmAccount()); + Assertions.assertEquals("ml", model.metricConfigurations().get(0).metricNameSpace()); + Assertions.assertEquals("tqzfavyv", + model.metricConfigurations().get(0).counterSets().get(0).counters().get(0).name()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + MonitoringMetricConfigurationInner model + = new MonitoringMetricConfigurationInner().withMetricConfigurations(Arrays.asList( + new MetricConfiguration().withResourceId("dyg") + .withMdmAccount("okkqfqjbvleo") + .withMetricNameSpace("ml") + .withCounterSets(Arrays.asList( + new MetricCounterSet().withCounters(Arrays.asList(new MetricCounter().withName("tqzfavyv"), + new MetricCounter().withName("qqybarye"), new MetricCounter().withName("ayjkqa"))), + new MetricCounterSet().withCounters(Arrays.asList( + new MetricCounter().withName("gzslesjcbhernnti"), new MetricCounter().withName("w"))), + new MetricCounterSet().withCounters(Arrays.asList(new MetricCounter().withName("cv"))))), + new MetricConfiguration().withResourceId("quwrbehwag") + .withMdmAccount("buffkmrqemvvhm") + .withMetricNameSpace("drjf") + .withCounterSets(Arrays.asList(new MetricCounterSet().withCounters(Arrays.asList( + new MetricCounter().withName("coebjvewzcj"), new MetricCounter().withName("nmwcpmgu"))))))); + model = BinaryData.fromObject(model).toObject(MonitoringMetricConfigurationInner.class); + Assertions.assertEquals("dyg", model.metricConfigurations().get(0).resourceId()); + Assertions.assertEquals("okkqfqjbvleo", model.metricConfigurations().get(0).mdmAccount()); + Assertions.assertEquals("ml", model.metricConfigurations().get(0).metricNameSpace()); + Assertions.assertEquals("tqzfavyv", + model.metricConfigurations().get(0).counterSets().get(0).counters().get(0).name()); + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/MonitoringMetricConfigurationListTests.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/MonitoringMetricConfigurationListTests.java new file mode 100644 index 000000000000..0a4da3a7b55b --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/MonitoringMetricConfigurationListTests.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.databoxedge.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.databoxedge.implementation.models.MonitoringMetricConfigurationList; +import org.junit.jupiter.api.Assertions; + +public final class MonitoringMetricConfigurationListTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + MonitoringMetricConfigurationList model = BinaryData.fromString( + "{\"value\":[{\"properties\":{\"metricConfigurations\":[{\"resourceId\":\"plcplcwkhi\",\"mdmAccount\":\"hlhzdsqtzbsrgno\",\"metricNameSpace\":\"jhf\",\"counterSets\":[{\"counters\":[]}]}]},\"id\":\"ecactx\",\"name\":\"wotey\",\"type\":\"wcluqovekqvgq\"},{\"properties\":{\"metricConfigurations\":[{\"resourceId\":\"wifzmp\",\"mdmAccount\":\"yivqikfxcvhrfsp\",\"metricNameSpace\":\"agr\",\"counterSets\":[{\"counters\":[]},{\"counters\":[]},{\"counters\":[]},{\"counters\":[]}]},{\"resourceId\":\"ikteusqczkvyk\",\"mdmAccount\":\"ubyjaffmmf\",\"metricNameSpace\":\"cqc\",\"counterSets\":[{\"counters\":[]}]},{\"resourceId\":\"bgq\",\"mdmAccount\":\"rtalmet\",\"metricNameSpace\":\"wgdsl\",\"counterSets\":[{\"counters\":[]}]}]},\"id\":\"hhrmooizqsey\",\"name\":\"xiutcx\",\"type\":\"pzhyr\"},{\"properties\":{\"metricConfigurations\":[{\"resourceId\":\"togebjoxsl\",\"mdmAccount\":\"nhl\",\"metricNameSpace\":\"rqnkkzjcjbtr\",\"counterSets\":[{\"counters\":[]},{\"counters\":[]},{\"counters\":[]},{\"counters\":[]}]},{\"resourceId\":\"ehvvib\",\"mdmAccount\":\"jj\",\"metricNameSpace\":\"oqbeitpkxzt\",\"counterSets\":[{\"counters\":[]},{\"counters\":[]},{\"counters\":[]},{\"counters\":[]}]}]},\"id\":\"bklftidgfcwqmpim\",\"name\":\"qxzhem\",\"type\":\"yhohujswtwkozzwc\"},{\"properties\":{\"metricConfigurations\":[{\"resourceId\":\"kb\",\"mdmAccount\":\"pfajnjwltlwtjj\",\"metricNameSpace\":\"ktalhsnvkcdmxz\",\"counterSets\":[{\"counters\":[]},{\"counters\":[]},{\"counters\":[]},{\"counters\":[]}]}]},\"id\":\"aimlnwiaaom\",\"name\":\"l\",\"type\":\"eazulcs\"}],\"nextLink\":\"hwwn\"}") + .toObject(MonitoringMetricConfigurationList.class); + Assertions.assertEquals("plcplcwkhi", model.value().get(0).metricConfigurations().get(0).resourceId()); + Assertions.assertEquals("hlhzdsqtzbsrgno", model.value().get(0).metricConfigurations().get(0).mdmAccount()); + Assertions.assertEquals("jhf", model.value().get(0).metricConfigurations().get(0).metricNameSpace()); + Assertions.assertEquals("hwwn", model.nextLink()); + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/MonitoringMetricConfigurationPropertiesTests.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/MonitoringMetricConfigurationPropertiesTests.java new file mode 100644 index 000000000000..42ef2c96e062 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/MonitoringMetricConfigurationPropertiesTests.java @@ -0,0 +1,67 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.databoxedge.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.databoxedge.fluent.models.MonitoringMetricConfigurationProperties; +import com.azure.resourcemanager.databoxedge.models.MetricConfiguration; +import com.azure.resourcemanager.databoxedge.models.MetricCounter; +import com.azure.resourcemanager.databoxedge.models.MetricCounterSet; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class MonitoringMetricConfigurationPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + MonitoringMetricConfigurationProperties model = BinaryData.fromString( + "{\"metricConfigurations\":[{\"resourceId\":\"qubkw\",\"mdmAccount\":\"enr\",\"metricNameSpace\":\"utujba\",\"counterSets\":[{\"counters\":[{\"name\":\"uo\"},{\"name\":\"minyflnorwm\"},{\"name\":\"uvwpklvxwmyg\"},{\"name\":\"xpgpq\"}]},{\"counters\":[{\"name\":\"isze\"},{\"name\":\"nnbj\"},{\"name\":\"rxgibbd\"},{\"name\":\"xconfozauors\"}]},{\"counters\":[{\"name\":\"okwbqplh\"},{\"name\":\"vnuuepzl\"},{\"name\":\"phwzsoldweyuqdu\"},{\"name\":\"vmnnrw\"}]}]},{\"resourceId\":\"biorktal\",\"mdmAccount\":\"jhhgdnhxmsi\",\"metricNameSpace\":\"omi\",\"counterSets\":[{\"counters\":[{\"name\":\"ggdufiqndieu\"},{\"name\":\"ao\"}]}]},{\"resourceId\":\"jchvcyy\",\"mdmAccount\":\"fgdo\",\"metricNameSpace\":\"ubiipuipwoqonma\",\"counterSets\":[{\"counters\":[{\"name\":\"k\"}]},{\"counters\":[{\"name\":\"zshq\"}]},{\"counters\":[{\"name\":\"impevf\"},{\"name\":\"mblrrilbywd\"}]}]}]}") + .toObject(MonitoringMetricConfigurationProperties.class); + Assertions.assertEquals("qubkw", model.metricConfigurations().get(0).resourceId()); + Assertions.assertEquals("enr", model.metricConfigurations().get(0).mdmAccount()); + Assertions.assertEquals("utujba", model.metricConfigurations().get(0).metricNameSpace()); + Assertions.assertEquals("uo", + model.metricConfigurations().get(0).counterSets().get(0).counters().get(0).name()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + MonitoringMetricConfigurationProperties model + = new MonitoringMetricConfigurationProperties() + .withMetricConfigurations(Arrays.asList( + new MetricConfiguration().withResourceId("qubkw") + .withMdmAccount("enr") + .withMetricNameSpace("utujba") + .withCounterSets(Arrays.asList( + new MetricCounterSet().withCounters(Arrays.asList(new MetricCounter().withName("uo"), + new MetricCounter().withName("minyflnorwm"), + new MetricCounter().withName("uvwpklvxwmyg"), new MetricCounter().withName("xpgpq"))), + new MetricCounterSet().withCounters(Arrays.asList( + new MetricCounter().withName("isze"), new MetricCounter().withName("nnbj"), + new MetricCounter().withName("rxgibbd"), new MetricCounter().withName("xconfozauors"))), + new MetricCounterSet().withCounters(Arrays.asList(new MetricCounter().withName("okwbqplh"), + new MetricCounter().withName("vnuuepzl"), + new MetricCounter().withName("phwzsoldweyuqdu"), + new MetricCounter().withName("vmnnrw"))))), + new MetricConfiguration().withResourceId("biorktal") + .withMdmAccount("jhhgdnhxmsi") + .withMetricNameSpace("omi") + .withCounterSets(Arrays.asList(new MetricCounterSet().withCounters(Arrays.asList( + new MetricCounter().withName("ggdufiqndieu"), new MetricCounter().withName("ao"))))), + new MetricConfiguration().withResourceId("jchvcyy") + .withMdmAccount("fgdo") + .withMetricNameSpace("ubiipuipwoqonma") + .withCounterSets(Arrays.asList( + new MetricCounterSet().withCounters(Arrays.asList(new MetricCounter().withName("k"))), + new MetricCounterSet().withCounters(Arrays.asList(new MetricCounter().withName("zshq"))), + new MetricCounterSet().withCounters(Arrays.asList(new MetricCounter().withName("impevf"), + new MetricCounter().withName("mblrrilbywd"))))))); + model = BinaryData.fromObject(model).toObject(MonitoringMetricConfigurationProperties.class); + Assertions.assertEquals("qubkw", model.metricConfigurations().get(0).resourceId()); + Assertions.assertEquals("enr", model.metricConfigurations().get(0).mdmAccount()); + Assertions.assertEquals("utujba", model.metricConfigurations().get(0).metricNameSpace()); + Assertions.assertEquals("uo", + model.metricConfigurations().get(0).counterSets().get(0).counters().get(0).name()); + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/MountPointMapTests.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/MountPointMapTests.java index 2cc62b15939f..fb02e97ec6f0 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/MountPointMapTests.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/MountPointMapTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.generated; @@ -12,15 +12,8 @@ public final class MountPointMapTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { MountPointMap model = BinaryData.fromString( - "{\"shareId\":\"opcjwvnhd\",\"roleId\":\"wmgxcxrsl\",\"mountPoint\":\"utwu\",\"roleType\":\"Functions\"}") + "{\"shareId\":\"wdcfhucqdpfuv\",\"roleId\":\"sbjjc\",\"mountPoint\":\"vxb\",\"mountType\":\"HostPath\",\"roleType\":\"IOT\"}") .toObject(MountPointMap.class); - Assertions.assertEquals("opcjwvnhd", model.shareId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - MountPointMap model = new MountPointMap().withShareId("opcjwvnhd"); - model = BinaryData.fromObject(model).toObject(MountPointMap.class); - Assertions.assertEquals("opcjwvnhd", model.shareId()); + Assertions.assertEquals("wdcfhucqdpfuv", model.shareId()); } } diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/NetworkAdapterPositionTests.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/NetworkAdapterPositionTests.java index 96fc10c71448..48413399a890 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/NetworkAdapterPositionTests.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/NetworkAdapterPositionTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.generated; @@ -10,13 +10,7 @@ public final class NetworkAdapterPositionTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - NetworkAdapterPosition model = BinaryData.fromString("{\"networkGroup\":\"NonRDMA\",\"port\":706936275}") + NetworkAdapterPosition model = BinaryData.fromString("{\"networkGroup\":\"NonRDMA\",\"port\":539678864}") .toObject(NetworkAdapterPosition.class); } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - NetworkAdapterPosition model = new NetworkAdapterPosition(); - model = BinaryData.fromObject(model).toObject(NetworkAdapterPosition.class); - } } diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/NetworkAdapterTests.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/NetworkAdapterTests.java index 25566b9765b6..b35875b6b635 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/NetworkAdapterTests.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/NetworkAdapterTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.generated; @@ -14,18 +14,9 @@ public final class NetworkAdapterTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { NetworkAdapter model = BinaryData.fromString( - "{\"adapterId\":\"hashsfwxosow\",\"adapterPosition\":{\"networkGroup\":\"NonRDMA\",\"port\":11356345},\"index\":229570932,\"nodeId\":\"oxdjebwpuc\",\"networkAdapterName\":\"fvovbvmeuecivy\",\"label\":\"ce\",\"macAddress\":\"jgjrwjueiotwm\",\"linkSpeed\":7939345805777152857,\"status\":\"Inactive\",\"rdmaStatus\":\"Incapable\",\"dhcpStatus\":\"Disabled\",\"ipv4Configuration\":{\"ipAddress\":\"jawgqwg\",\"subnet\":\"ni\",\"gateway\":\"x\"},\"ipv6Configuration\":{\"ipAddress\":\"py\",\"prefixLength\":1553337592,\"gateway\":\"wndnhj\"},\"ipv6LinkLocalAddress\":\"uwhvylwzbtdhxujz\",\"dnsServers\":[\"pow\",\"wpr\"]}") + "{\"adapterId\":\"inpvswjdkirsoodq\",\"adapterPosition\":{\"networkGroup\":\"RDMA\",\"port\":1265522776},\"index\":2125655457,\"nodeId\":\"t\",\"networkAdapterName\":\"whdsoifiyip\",\"label\":\"sqwpgrjb\",\"macAddress\":\"orcjxvsnby\",\"linkSpeed\":4373874045327283865,\"status\":\"Inactive\",\"rdmaStatus\":\"Incapable\",\"dhcpStatus\":\"Enabled\",\"ipv4Configuration\":{\"ipAddress\":\"hurzafblj\",\"subnet\":\"pbtoqcjmkl\",\"gateway\":\"vbqid\"},\"ipv6Configuration\":{\"ipAddress\":\"jzyulpk\",\"prefixLength\":1232172587,\"gateway\":\"rlkhbzhfepgzgq\"},\"ipv6LinkLocalAddress\":\"zloc\",\"dnsServers\":[\"paierh\"]}") .toObject(NetworkAdapter.class); Assertions.assertEquals(NetworkAdapterRdmaStatus.INCAPABLE, model.rdmaStatus()); - Assertions.assertEquals(NetworkAdapterDhcpStatus.DISABLED, model.dhcpStatus()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - NetworkAdapter model = new NetworkAdapter().withRdmaStatus(NetworkAdapterRdmaStatus.INCAPABLE) - .withDhcpStatus(NetworkAdapterDhcpStatus.DISABLED); - model = BinaryData.fromObject(model).toObject(NetworkAdapter.class); - Assertions.assertEquals(NetworkAdapterRdmaStatus.INCAPABLE, model.rdmaStatus()); - Assertions.assertEquals(NetworkAdapterDhcpStatus.DISABLED, model.dhcpStatus()); + Assertions.assertEquals(NetworkAdapterDhcpStatus.ENABLED, model.dhcpStatus()); } } diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/NetworkSettingsInnerTests.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/NetworkSettingsInnerTests.java index 995ec9aadff5..2289b841dd8e 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/NetworkSettingsInnerTests.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/NetworkSettingsInnerTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.generated; @@ -11,13 +11,7 @@ public final class NetworkSettingsInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { NetworkSettingsInner model = BinaryData.fromString( - "{\"properties\":{\"networkAdapters\":[{\"adapterId\":\"z\",\"adapterPosition\":{\"networkGroup\":\"RDMA\",\"port\":1792680801},\"index\":245724981,\"nodeId\":\"npiucgygevqznty\",\"networkAdapterName\":\"rbpizc\",\"label\":\"qjsdpydnfyhxdeo\",\"macAddress\":\"zi\",\"linkSpeed\":7381179011507759577,\"status\":\"Inactive\",\"rdmaStatus\":\"Capable\",\"dhcpStatus\":\"Enabled\",\"ipv4Configuration\":{\"ipAddress\":\"ishc\",\"subnet\":\"hajdeyeamdpha\",\"gateway\":\"lpbuxwgipwhonowk\"},\"ipv6Configuration\":{\"ipAddress\":\"wankixzbi\",\"prefixLength\":1868038426,\"gateway\":\"uttmrywnuzoqft\"},\"ipv6LinkLocalAddress\":\"qzrnkcqvyxlwhz\",\"dnsServers\":[\"cohoq\",\"nwvlryavwhheunmm\",\"hgyxzkonoc\"]},{\"adapterId\":\"oklyaxuconuq\",\"adapterPosition\":{\"networkGroup\":\"NonRDMA\",\"port\":731084227},\"index\":868316225,\"nodeId\":\"wrmjmwvvjektc\",\"networkAdapterName\":\"enhwlrs\",\"label\":\"rzpwvlqdqgbiq\",\"macAddress\":\"ihkaetcktvfc\",\"linkSpeed\":2289956898099281831,\"status\":\"Active\",\"rdmaStatus\":\"Incapable\",\"dhcpStatus\":\"Disabled\",\"ipv4Configuration\":{\"ipAddress\":\"hjfbebrjcxe\",\"subnet\":\"uwutttxfvjrbi\",\"gateway\":\"hxepcyvahfnlj\"},\"ipv6Configuration\":{\"ipAddress\":\"xjvuujqgidokg\",\"prefixLength\":10143119,\"gateway\":\"oxgvclt\"},\"ipv6LinkLocalAddress\":\"sncghkjeszz\",\"dnsServers\":[\"jhtxfvgxbfsmxne\",\"mpvecxgodebfqk\"]},{\"adapterId\":\"bmpukgriwflz\",\"adapterPosition\":{\"networkGroup\":\"RDMA\",\"port\":599393599},\"index\":1728715445,\"nodeId\":\"cispnqzahmgkbr\",\"networkAdapterName\":\"y\",\"label\":\"ibnuqqkpik\",\"macAddress\":\"rgvtqag\",\"linkSpeed\":8047561232163358345,\"status\":\"Inactive\",\"rdmaStatus\":\"Capable\",\"dhcpStatus\":\"Enabled\",\"ipv4Configuration\":{\"ipAddress\":\"bfs\",\"subnet\":\"rbu\",\"gateway\":\"cvpnazzmhjrunmpx\"},\"ipv6Configuration\":{\"ipAddress\":\"bh\",\"prefixLength\":826548714,\"gateway\":\"ankxmyskpbhenb\"},\"ipv6LinkLocalAddress\":\"cxy\",\"dnsServers\":[\"tnrsyn\"]}]},\"id\":\"qidybyx\",\"name\":\"zfcl\",\"type\":\"aaxdbabphlwrq\"}") + "{\"properties\":{\"networkAdapters\":[{\"adapterId\":\"pzvgnwzsymglzufc\",\"adapterPosition\":{\"networkGroup\":\"RDMA\",\"port\":1162765594},\"index\":1369852122,\"nodeId\":\"anufhfcbjysag\",\"networkAdapterName\":\"hxqh\",\"label\":\"ifpikxwczby\",\"macAddress\":\"npqxuh\",\"linkSpeed\":954829705475958296,\"status\":\"Active\",\"rdmaStatus\":\"Incapable\",\"dhcpStatus\":\"Disabled\",\"ipv4Configuration\":{\"ipAddress\":\"xvd\",\"subnet\":\"jgrtfwvukxga\",\"gateway\":\"ccsnhsjc\"},\"ipv6Configuration\":{\"ipAddress\":\"j\",\"prefixLength\":1833864756,\"gateway\":\"htnapczwlokjyem\"},\"ipv6LinkLocalAddress\":\"vnipjox\",\"dnsServers\":[\"chgejspodm\",\"ilzyd\"]},{\"adapterId\":\"o\",\"adapterPosition\":{\"networkGroup\":\"RDMA\",\"port\":766325863},\"index\":916721879,\"nodeId\":\"pmqnja\",\"networkAdapterName\":\"ixjsprozvcputeg\",\"label\":\"wmfdatscmdvpjhul\",\"macAddress\":\"uvm\",\"linkSpeed\":8667091151260667837,\"status\":\"Inactive\",\"rdmaStatus\":\"Incapable\",\"dhcpStatus\":\"Disabled\",\"ipv4Configuration\":{\"ipAddress\":\"djpslw\",\"subnet\":\"dpvwryoqpsoaccta\",\"gateway\":\"kljla\"},\"ipv6Configuration\":{\"ipAddress\":\"ryffdfdosy\",\"prefixLength\":881912185,\"gateway\":\"aojakhmsbzjhcrz\"},\"ipv6LinkLocalAddress\":\"dphlxaolt\",\"dnsServers\":[\"rgqjbpfzfsinzg\"]},{\"adapterId\":\"cjrwzoxxjtfellu\",\"adapterPosition\":{\"networkGroup\":\"RDMA\",\"port\":1676988315},\"index\":180815183,\"nodeId\":\"qfpjk\",\"networkAdapterName\":\"xofpdvhpfxxypi\",\"label\":\"nmayhuybb\",\"macAddress\":\"odepoogin\",\"linkSpeed\":3552222311597339409,\"status\":\"Active\",\"rdmaStatus\":\"Capable\",\"dhcpStatus\":\"Enabled\",\"ipv4Configuration\":{\"ipAddress\":\"xzxtheo\",\"subnet\":\"si\",\"gateway\":\"evcciqihnhun\"},\"ipv6Configuration\":{\"ipAddress\":\"jzrnf\",\"prefixLength\":1847576577,\"gateway\":\"ispe\"},\"ipv6LinkLocalAddress\":\"tzfkufubl\",\"dnsServers\":[\"xqeofjaeqjhqjba\",\"v\"]},{\"adapterId\":\"mjqulngsn\",\"adapterPosition\":{\"networkGroup\":\"None\",\"port\":105854038},\"index\":406268406,\"nodeId\":\"wrwclxxwrljd\",\"networkAdapterName\":\"skcqvkocrcjd\",\"label\":\"tnhxbn\",\"macAddress\":\"iksqr\",\"linkSpeed\":4958380922379786405,\"status\":\"Active\",\"rdmaStatus\":\"Capable\",\"dhcpStatus\":\"Enabled\",\"ipv4Configuration\":{\"ipAddress\":\"zlljfmppeebvm\",\"subnet\":\"sabkyqduujitcjcz\",\"gateway\":\"evndh\"},\"ipv6Configuration\":{\"ipAddress\":\"pdappds\",\"prefixLength\":253055122,\"gateway\":\"wrwjfeu\"},\"ipv6LinkLocalAddress\":\"hutje\",\"dnsServers\":[\"rl\",\"hugjzzdatqxhoc\"]}]},\"id\":\"eablg\",\"name\":\"huticndvkao\",\"type\":\"wyiftyhxhur\"}") .toObject(NetworkSettingsInner.class); } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - NetworkSettingsInner model = new NetworkSettingsInner(); - model = BinaryData.fromObject(model).toObject(NetworkSettingsInner.class); - } } diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/NetworkSettingsPropertiesTests.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/NetworkSettingsPropertiesTests.java index db513b0bee14..216d884d01b7 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/NetworkSettingsPropertiesTests.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/NetworkSettingsPropertiesTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.generated; @@ -11,13 +11,7 @@ public final class NetworkSettingsPropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { NetworkSettingsProperties model = BinaryData.fromString( - "{\"networkAdapters\":[{\"adapterId\":\"sthsu\",\"adapterPosition\":{\"networkGroup\":\"NonRDMA\",\"port\":2042838071},\"index\":591118108,\"nodeId\":\"t\",\"networkAdapterName\":\"twwrqp\",\"label\":\"dckzywbiexz\",\"macAddress\":\"yueaxibxujwb\",\"linkSpeed\":3923542166316348185,\"status\":\"Active\",\"rdmaStatus\":\"Capable\",\"dhcpStatus\":\"Disabled\",\"ipv4Configuration\":{\"ipAddress\":\"epdkzja\",\"subnet\":\"ux\",\"gateway\":\"d\"},\"ipv6Configuration\":{\"ipAddress\":\"v\",\"prefixLength\":1767161087,\"gateway\":\"wd\"},\"ipv6LinkLocalAddress\":\"wz\",\"dnsServers\":[\"bpg\",\"xytxhpzxbz\",\"fzab\"]},{\"adapterId\":\"cuh\",\"adapterPosition\":{\"networkGroup\":\"None\",\"port\":1557005906},\"index\":228169976,\"nodeId\":\"lbbovplw\",\"networkAdapterName\":\"hvgyuguosvmk\",\"label\":\"sxqu\",\"macAddress\":\"fpl\",\"linkSpeed\":5850785611921356044,\"status\":\"Active\",\"rdmaStatus\":\"Capable\",\"dhcpStatus\":\"Disabled\",\"ipv4Configuration\":{\"ipAddress\":\"slpvlop\",\"subnet\":\"yighxpk\",\"gateway\":\"zb\"},\"ipv6Configuration\":{\"ipAddress\":\"ebb\",\"prefixLength\":6362345,\"gateway\":\"yqupedeojnabckh\"},\"ipv6LinkLocalAddress\":\"txp\",\"dnsServers\":[\"btfhvpesaps\",\"rdqmhjjdhtldwkyz\",\"uutkncw\"]},{\"adapterId\":\"wsvlxotogtwrupqs\",\"adapterPosition\":{\"networkGroup\":\"NonRDMA\",\"port\":1872755213},\"index\":1892680320,\"nodeId\":\"ceoveilovno\",\"networkAdapterName\":\"fj\",\"label\":\"njbkcnxdhbttkph\",\"macAddress\":\"pnvjtoqnermclf\",\"linkSpeed\":6255558235157330938,\"status\":\"Inactive\",\"rdmaStatus\":\"Capable\",\"dhcpStatus\":\"Disabled\",\"ipv4Configuration\":{\"ipAddress\":\"bgyepsbj\",\"subnet\":\"zq\",\"gateway\":\"xywpmueefjzwfqkq\"},\"ipv6Configuration\":{\"ipAddress\":\"dsuyonobgla\",\"prefixLength\":713530304,\"gateway\":\"tcc\"},\"ipv6LinkLocalAddress\":\"yudxytlmoy\",\"dnsServers\":[\"wfudwpzntxhdzhl\",\"qj\",\"hckfrlhrx\",\"bkyvp\"]},{\"adapterId\":\"anuzbpzkafkuw\",\"adapterPosition\":{\"networkGroup\":\"RDMA\",\"port\":1300207213},\"index\":1267023941,\"nodeId\":\"hseyvju\",\"networkAdapterName\":\"tslhspkdeem\",\"label\":\"fm\",\"macAddress\":\"gkvtmelmqkrhah\",\"linkSpeed\":9144697658006681867,\"status\":\"Inactive\",\"rdmaStatus\":\"Capable\",\"dhcpStatus\":\"Enabled\",\"ipv4Configuration\":{\"ipAddress\":\"hmdua\",\"subnet\":\"exq\",\"gateway\":\"fadmws\"},\"ipv6Configuration\":{\"ipAddress\":\"gvxp\",\"prefixLength\":1879031505,\"gateway\":\"zlfmisgwbnbbeld\"},\"ipv6LinkLocalAddress\":\"k\",\"dnsServers\":[\"liourqhak\"]}]}") + "{\"networkAdapters\":[{\"adapterId\":\"yxolniwp\",\"adapterPosition\":{\"networkGroup\":\"RDMA\",\"port\":2072426634},\"index\":1260528380,\"nodeId\":\"awxklr\",\"networkAdapterName\":\"lwckbasyypnddhs\",\"label\":\"bacphejko\",\"macAddress\":\"nqgoulzndli\",\"linkSpeed\":6280199240757284109,\"status\":\"Inactive\",\"rdmaStatus\":\"Incapable\",\"dhcpStatus\":\"Disabled\",\"ipv4Configuration\":{\"ipAddress\":\"dgak\",\"subnet\":\"s\",\"gateway\":\"yb\"},\"ipv6Configuration\":{\"ipAddress\":\"e\",\"prefixLength\":792536973,\"gateway\":\"bciqfouflm\"},\"ipv6LinkLocalAddress\":\"kzsmodm\",\"dnsServers\":[\"ugpbkw\",\"mutduqktaps\"]},{\"adapterId\":\"gcue\",\"adapterPosition\":{\"networkGroup\":\"RDMA\",\"port\":1838728472},\"index\":1475833169,\"nodeId\":\"qw\",\"networkAdapterName\":\"mdgbbjfdd\",\"label\":\"bmbexppbhtqqro\",\"macAddress\":\"p\",\"linkSpeed\":295546602874213209,\"status\":\"Inactive\",\"rdmaStatus\":\"Incapable\",\"dhcpStatus\":\"Enabled\",\"ipv4Configuration\":{\"ipAddress\":\"jyj\",\"subnet\":\"jaoyfhrtx\",\"gateway\":\"n\"},\"ipv6Configuration\":{\"ipAddress\":\"ujysvle\",\"prefixLength\":1644570632,\"gateway\":\"qawrlyxwj\"},\"ipv6LinkLocalAddress\":\"prbnwbxgjvtbv\",\"dnsServers\":[\"szdnr\",\"jq\"]},{\"adapterId\":\"hmuouqfprwzwbn\",\"adapterPosition\":{\"networkGroup\":\"None\",\"port\":443488526},\"index\":1661646001,\"nodeId\":\"gazxuf\",\"networkAdapterName\":\"uckyf\",\"label\":\"rfidfvzwdz\",\"macAddress\":\"tymw\",\"linkSpeed\":1702945430371192394,\"status\":\"Active\",\"rdmaStatus\":\"Capable\",\"dhcpStatus\":\"Disabled\",\"ipv4Configuration\":{\"ipAddress\":\"eiwaopvkmi\",\"subnet\":\"mmxdcu\",\"gateway\":\"fsrpymzidnse\"},\"ipv6Configuration\":{\"ipAddress\":\"tbzsgfyccs\",\"prefixLength\":1547468297,\"gateway\":\"dwzjeiach\"},\"ipv6LinkLocalAddress\":\"osfln\",\"dnsServers\":[\"fqpte\",\"hzzvypyq\",\"i\"]}]}") .toObject(NetworkSettingsProperties.class); } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - NetworkSettingsProperties model = new NetworkSettingsProperties(); - model = BinaryData.fromObject(model).toObject(NetworkSettingsProperties.class); - } } diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/NodeInnerTests.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/NodeInnerTests.java index 26f1ab5f3fe1..52c6b1a94e14 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/NodeInnerTests.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/NodeInnerTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.generated; @@ -11,13 +11,7 @@ public final class NodeInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { NodeInner model = BinaryData.fromString( - "{\"properties\":{\"nodeStatus\":\"Up\",\"nodeChassisSerialNumber\":\"slyjpkiid\",\"nodeSerialNumber\":\"exznelixhnr\",\"nodeDisplayName\":\"folhbnxknal\",\"nodeFriendlySoftwareVersion\":\"lp\",\"nodeHcsVersion\":\"gdtpnapnyiro\",\"nodeInstanceId\":\"hpigv\"},\"id\":\"gylgqgitxmedjvcs\",\"name\":\"ynqwwncwzzhxgk\",\"type\":\"rmgucnap\"}") + "{\"properties\":{\"nodeStatus\":\"Rebooting\",\"nodeChassisSerialNumber\":\"ingamvp\",\"nodeSerialNumber\":\"o\",\"nodeDisplayName\":\"qzudphq\",\"nodeFriendlySoftwareVersion\":\"vdkfwynwcvtbvk\",\"nodeHcsVersion\":\"hmtnvy\",\"nodeInstanceId\":\"atkzwpcnpw\"},\"id\":\"jaesgvvsccya\",\"name\":\"uq\",\"type\":\"wygzlvdnkfxusem\"}") .toObject(NodeInner.class); } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - NodeInner model = new NodeInner(); - model = BinaryData.fromObject(model).toObject(NodeInner.class); - } } diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/NodeListTests.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/NodeListTests.java index a0e876dff70a..3b41d13b260e 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/NodeListTests.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/NodeListTests.java @@ -1,23 +1,19 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.generated; import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.databoxedge.models.NodeList; +import com.azure.resourcemanager.databoxedge.implementation.models.NodeList; +import org.junit.jupiter.api.Assertions; public final class NodeListTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { NodeList model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"nodeStatus\":\"Up\",\"nodeChassisSerialNumber\":\"loayqcgw\",\"nodeSerialNumber\":\"zjuzgwyz\",\"nodeDisplayName\":\"txon\",\"nodeFriendlySoftwareVersion\":\"ts\",\"nodeHcsVersion\":\"jcbpwxqpsrknft\",\"nodeInstanceId\":\"vriuhprwmdyvx\"},\"id\":\"tayriwwroyqbex\",\"name\":\"mcqibycnojv\",\"type\":\"nmefqsgzvahapj\"},{\"properties\":{\"nodeStatus\":\"ShuttingDown\",\"nodeChassisSerialNumber\":\"gqzcjr\",\"nodeSerialNumber\":\"djzlmwlx\",\"nodeDisplayName\":\"ug\",\"nodeFriendlySoftwareVersion\":\"zovawjvz\",\"nodeHcsVersion\":\"luthn\",\"nodeInstanceId\":\"rnxipei\"},\"id\":\"pjzu\",\"name\":\"e\",\"type\":\"xdult\"},{\"properties\":{\"nodeStatus\":\"ShuttingDown\",\"nodeChassisSerialNumber\":\"tdzumveekgpw\",\"nodeSerialNumber\":\"uh\",\"nodeDisplayName\":\"p\",\"nodeFriendlySoftwareVersion\":\"jyofdxluusdtto\",\"nodeHcsVersion\":\"aboekqv\",\"nodeInstanceId\":\"lns\"},\"id\":\"vbxwyjsflhh\",\"name\":\"aalnjixi\",\"type\":\"xyawj\"}]}") + "{\"value\":[{\"properties\":{\"nodeStatus\":\"ShuttingDown\",\"nodeChassisSerialNumber\":\"cdhszf\",\"nodeSerialNumber\":\"fbgofeljagrqmqh\",\"nodeDisplayName\":\"vriiio\",\"nodeFriendlySoftwareVersion\":\"al\",\"nodeHcsVersion\":\"fk\",\"nodeInstanceId\":\"vsexsowuelu\"},\"id\":\"hahhxvrhmzkwpj\",\"name\":\"wspughftqsxhqx\",\"type\":\"xukndxdigr\"}],\"nextLink\":\"uufzdmsyqtfihw\"}") .toObject(NodeList.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - NodeList model = new NodeList(); - model = BinaryData.fromObject(model).toObject(NodeList.class); + Assertions.assertEquals("uufzdmsyqtfihw", model.nextLink()); } } diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/NodePropertiesTests.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/NodePropertiesTests.java index 804c90b4d1ec..78f716233f60 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/NodePropertiesTests.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/NodePropertiesTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.generated; @@ -11,13 +11,7 @@ public final class NodePropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { NodeProperties model = BinaryData.fromString( - "{\"nodeStatus\":\"Down\",\"nodeChassisSerialNumber\":\"ellwptfdy\",\"nodeSerialNumber\":\"fqbuaceopzf\",\"nodeDisplayName\":\"hhuao\",\"nodeFriendlySoftwareVersion\":\"pcqeqx\",\"nodeHcsVersion\":\"z\",\"nodeInstanceId\":\"hzxct\"}") + "{\"nodeStatus\":\"ShuttingDown\",\"nodeChassisSerialNumber\":\"muhapfcqdpsqxqv\",\"nodeSerialNumber\":\"vuoy\",\"nodeDisplayName\":\"ccelve\",\"nodeFriendlySoftwareVersion\":\"ypql\",\"nodeHcsVersion\":\"eokerqwkyhkobopg\",\"nodeInstanceId\":\"dkow\"}") .toObject(NodeProperties.class); } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - NodeProperties model = new NodeProperties(); - model = BinaryData.fromObject(model).toObject(NodeProperties.class); - } } diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/NodesListByDataBoxEdgeDeviceMockTests.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/NodesListByDataBoxEdgeDeviceMockTests.java index 632b27d8989d..81f8f681e6c9 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/NodesListByDataBoxEdgeDeviceMockTests.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/NodesListByDataBoxEdgeDeviceMockTests.java @@ -1,14 +1,14 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.databoxedge.DataBoxEdgeManager; import com.azure.resourcemanager.databoxedge.models.Node; @@ -21,17 +21,17 @@ public final class NodesListByDataBoxEdgeDeviceMockTests { @Test public void testListByDataBoxEdgeDevice() throws Exception { String responseStr - = "{\"value\":[{\"properties\":{\"nodeStatus\":\"Down\",\"nodeChassisSerialNumber\":\"jlyjtlvofq\",\"nodeSerialNumber\":\"vfcibyfmowux\",\"nodeDisplayName\":\"jpvd\",\"nodeFriendlySoftwareVersion\":\"fzwiivwzjbhyz\",\"nodeHcsVersion\":\"jrkambtrnegvmnv\",\"nodeInstanceId\":\"eqvldspast\"},\"id\":\"bkkd\",\"name\":\"flvestmjlxrrilo\",\"type\":\"apeewchpxlkt\"}]}"; + = "{\"value\":[{\"properties\":{\"nodeStatus\":\"Down\",\"nodeChassisSerialNumber\":\"fjkutycyarnroo\",\"nodeSerialNumber\":\"uabzoghkt\",\"nodeDisplayName\":\"yczhco\",\"nodeFriendlySoftwareVersion\":\"cnhz\",\"nodeHcsVersion\":\"ot\",\"nodeInstanceId\":\"zcfyjzptwrl\"},\"id\":\"apqinf\",\"name\":\"pyglqdhmrjzral\",\"type\":\"pjby\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); DataBoxEdgeManager manager = DataBoxEdgeManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); PagedIterable response - = manager.nodes().listByDataBoxEdgeDevice("y", "pgogtqxepny", com.azure.core.util.Context.NONE); + = manager.nodes().listByDataBoxEdgeDevice("wnf", "zhhh", com.azure.core.util.Context.NONE); } } diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/NumaNodeDataTests.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/NumaNodeDataTests.java new file mode 100644 index 000000000000..80c63d2c07da --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/NumaNodeDataTests.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.databoxedge.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.databoxedge.models.NumaNodeData; +import org.junit.jupiter.api.Assertions; + +public final class NumaNodeDataTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + NumaNodeData model = BinaryData.fromString( + "{\"numaNodeIndex\":765522642,\"totalMemoryInMb\":69444877273789820,\"logicalCoreCountPerCore\":849596082,\"effectiveAvailableMemoryInMb\":1098818682883965663,\"freeVCpuIndexesForHpn\":[893794792,286680192,337783528],\"vCpuIndexesForHpn\":[240888782],\"vCpuIndexesForRoot\":[1985079165,758612558,518235624,637456268]}") + .toObject(NumaNodeData.class); + Assertions.assertEquals(765522642, model.numaNodeIndex()); + Assertions.assertEquals(69444877273789820L, model.totalMemoryInMb()); + Assertions.assertEquals(849596082, model.logicalCoreCountPerCore()); + Assertions.assertEquals(1098818682883965663L, model.effectiveAvailableMemoryInMb()); + Assertions.assertEquals(893794792, model.freeVCpuIndexesForHpn().get(0)); + Assertions.assertEquals(240888782, model.vCpuIndexesForHpn().get(0)); + Assertions.assertEquals(1985079165, model.vCpuIndexesForRoot().get(0)); + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/OperationDisplayTests.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/OperationDisplayTests.java index 8325a0b4a4c2..a712cd646f9c 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/OperationDisplayTests.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/OperationDisplayTests.java @@ -1,36 +1,17 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.generated; import com.azure.core.util.BinaryData; import com.azure.resourcemanager.databoxedge.models.OperationDisplay; -import org.junit.jupiter.api.Assertions; public final class OperationDisplayTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - OperationDisplay model = BinaryData - .fromString( - "{\"provider\":\"jnchgej\",\"resource\":\"odmailzyd\",\"operation\":\"o\",\"description\":\"yahux\"}") + OperationDisplay model = BinaryData.fromString( + "{\"provider\":\"cdm\",\"resource\":\"rcryuanzwuxzdxta\",\"operation\":\"lhmwhfpmrqobm\",\"description\":\"kknryrtihf\"}") .toObject(OperationDisplay.class); - Assertions.assertEquals("jnchgej", model.provider()); - Assertions.assertEquals("odmailzyd", model.resource()); - Assertions.assertEquals("o", model.operation()); - Assertions.assertEquals("yahux", model.description()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OperationDisplay model = new OperationDisplay().withProvider("jnchgej") - .withResource("odmailzyd") - .withOperation("o") - .withDescription("yahux"); - model = BinaryData.fromObject(model).toObject(OperationDisplay.class); - Assertions.assertEquals("jnchgej", model.provider()); - Assertions.assertEquals("odmailzyd", model.resource()); - Assertions.assertEquals("o", model.operation()); - Assertions.assertEquals("yahux", model.description()); } } diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/OperationInnerTests.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/OperationInnerTests.java index fab5d19bd1ba..da8ceeb83efe 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/OperationInnerTests.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/OperationInnerTests.java @@ -1,123 +1,17 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.generated; import com.azure.core.util.BinaryData; import com.azure.resourcemanager.databoxedge.fluent.models.OperationInner; -import com.azure.resourcemanager.databoxedge.models.MetricAggregationType; -import com.azure.resourcemanager.databoxedge.models.MetricCategory; -import com.azure.resourcemanager.databoxedge.models.MetricDimensionV1; -import com.azure.resourcemanager.databoxedge.models.MetricSpecificationV1; -import com.azure.resourcemanager.databoxedge.models.MetricUnit; -import com.azure.resourcemanager.databoxedge.models.OperationDisplay; -import com.azure.resourcemanager.databoxedge.models.ServiceSpecification; -import com.azure.resourcemanager.databoxedge.models.TimeGrain; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; public final class OperationInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { OperationInner model = BinaryData.fromString( - "{\"name\":\"flusarhmof\",\"display\":{\"provider\":\"smy\",\"resource\":\"kdtmlxhekuk\",\"operation\":\"txukcdmp\",\"description\":\"cryuan\"},\"origin\":\"uxzdxtay\",\"properties\":{\"serviceSpecification\":{\"metricSpecifications\":[{\"name\":\"fp\",\"displayName\":\"qobmtukk\",\"displayDescription\":\"yrtih\",\"unit\":\"CountPerSecond\",\"aggregationType\":\"NotSpecified\",\"dimensions\":[{},{},{},{}],\"fillGapWithZero\":false,\"category\":\"Capacity\",\"resourceIdDimensionNameOverride\":\"zsymglzufcyzkohd\",\"supportedTimeGrainTypes\":[\"PT12H\",\"PT15M\",\"PT1H\",\"PT15M\"],\"supportedAggregationTypes\":[\"Count\",\"None\",\"None\",\"NotSpecified\"]},{\"name\":\"a\",\"displayName\":\"th\",\"displayDescription\":\"hab\",\"unit\":\"CountPerSecond\",\"aggregationType\":\"Minimum\",\"dimensions\":[{},{}],\"fillGapWithZero\":false,\"category\":\"Capacity\",\"resourceIdDimensionNameOverride\":\"cnpqxuhivyqniwby\",\"supportedTimeGrainTypes\":[\"PT5M\"],\"supportedAggregationTypes\":[\"NotSpecified\",\"Minimum\",\"None\"]},{\"name\":\"rtfw\",\"displayName\":\"k\",\"displayDescription\":\"audccsnhs\",\"unit\":\"BytesPerSecond\",\"aggregationType\":\"Maximum\",\"dimensions\":[{},{}],\"fillGapWithZero\":true,\"category\":\"Transaction\",\"resourceIdDimensionNameOverride\":\"napczwlokjy\",\"supportedTimeGrainTypes\":[\"PT1H\",\"PT30M\",\"PT1M\"],\"supportedAggregationTypes\":[\"Total\",\"Maximum\",\"Total\"]}]}}}") + "{\"name\":\"nygj\",\"isDataAction\":true,\"display\":{\"provider\":\"eqsrdeupewnwreit\",\"resource\":\"yflusarhmofc\",\"operation\":\"smy\",\"description\":\"kdtmlxhekuk\"},\"origin\":\"user,system\",\"actionType\":\"Internal\"}") .toObject(OperationInner.class); - Assertions.assertEquals("flusarhmof", model.name()); - Assertions.assertEquals("smy", model.display().provider()); - Assertions.assertEquals("kdtmlxhekuk", model.display().resource()); - Assertions.assertEquals("txukcdmp", model.display().operation()); - Assertions.assertEquals("cryuan", model.display().description()); - Assertions.assertEquals("uxzdxtay", model.origin()); - Assertions.assertEquals("fp", model.serviceSpecification().metricSpecifications().get(0).name()); - Assertions.assertEquals("qobmtukk", model.serviceSpecification().metricSpecifications().get(0).displayName()); - Assertions.assertEquals("yrtih", - model.serviceSpecification().metricSpecifications().get(0).displayDescription()); - Assertions.assertEquals(MetricUnit.COUNT_PER_SECOND, - model.serviceSpecification().metricSpecifications().get(0).unit()); - Assertions.assertEquals(MetricAggregationType.NOT_SPECIFIED, - model.serviceSpecification().metricSpecifications().get(0).aggregationType()); - Assertions.assertEquals(false, model.serviceSpecification().metricSpecifications().get(0).fillGapWithZero()); - Assertions.assertEquals(MetricCategory.CAPACITY, - model.serviceSpecification().metricSpecifications().get(0).category()); - Assertions.assertEquals("zsymglzufcyzkohd", - model.serviceSpecification().metricSpecifications().get(0).resourceIdDimensionNameOverride()); - Assertions.assertEquals(TimeGrain.PT12H, - model.serviceSpecification().metricSpecifications().get(0).supportedTimeGrainTypes().get(0)); - Assertions.assertEquals(MetricAggregationType.COUNT, - model.serviceSpecification().metricSpecifications().get(0).supportedAggregationTypes().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OperationInner model = new OperationInner().withName("flusarhmof") - .withDisplay(new OperationDisplay().withProvider("smy") - .withResource("kdtmlxhekuk") - .withOperation("txukcdmp") - .withDescription("cryuan")) - .withOrigin("uxzdxtay") - .withServiceSpecification(new ServiceSpecification().withMetricSpecifications(Arrays.asList( - new MetricSpecificationV1().withName("fp") - .withDisplayName("qobmtukk") - .withDisplayDescription("yrtih") - .withUnit(MetricUnit.COUNT_PER_SECOND) - .withAggregationType(MetricAggregationType.NOT_SPECIFIED) - .withDimensions(Arrays.asList(new MetricDimensionV1(), new MetricDimensionV1(), - new MetricDimensionV1(), new MetricDimensionV1())) - .withFillGapWithZero(false) - .withCategory(MetricCategory.CAPACITY) - .withResourceIdDimensionNameOverride("zsymglzufcyzkohd") - .withSupportedTimeGrainTypes( - Arrays.asList(TimeGrain.PT12H, TimeGrain.PT15M, TimeGrain.PT1H, TimeGrain.PT15M)) - .withSupportedAggregationTypes(Arrays.asList(MetricAggregationType.COUNT, - MetricAggregationType.NONE, MetricAggregationType.NONE, MetricAggregationType.NOT_SPECIFIED)), - new MetricSpecificationV1().withName("a") - .withDisplayName("th") - .withDisplayDescription("hab") - .withUnit(MetricUnit.COUNT_PER_SECOND) - .withAggregationType(MetricAggregationType.MINIMUM) - .withDimensions(Arrays.asList(new MetricDimensionV1(), new MetricDimensionV1())) - .withFillGapWithZero(false) - .withCategory(MetricCategory.CAPACITY) - .withResourceIdDimensionNameOverride("cnpqxuhivyqniwby") - .withSupportedTimeGrainTypes(Arrays.asList(TimeGrain.PT5M)) - .withSupportedAggregationTypes(Arrays.asList(MetricAggregationType.NOT_SPECIFIED, - MetricAggregationType.MINIMUM, MetricAggregationType.NONE)), - new MetricSpecificationV1().withName("rtfw") - .withDisplayName("k") - .withDisplayDescription("audccsnhs") - .withUnit(MetricUnit.BYTES_PER_SECOND) - .withAggregationType(MetricAggregationType.MAXIMUM) - .withDimensions(Arrays.asList(new MetricDimensionV1(), new MetricDimensionV1())) - .withFillGapWithZero(true) - .withCategory(MetricCategory.TRANSACTION) - .withResourceIdDimensionNameOverride("napczwlokjy") - .withSupportedTimeGrainTypes(Arrays.asList(TimeGrain.PT1H, TimeGrain.PT30M, TimeGrain.PT1M)) - .withSupportedAggregationTypes(Arrays.asList(MetricAggregationType.TOTAL, - MetricAggregationType.MAXIMUM, MetricAggregationType.TOTAL))))); - model = BinaryData.fromObject(model).toObject(OperationInner.class); - Assertions.assertEquals("flusarhmof", model.name()); - Assertions.assertEquals("smy", model.display().provider()); - Assertions.assertEquals("kdtmlxhekuk", model.display().resource()); - Assertions.assertEquals("txukcdmp", model.display().operation()); - Assertions.assertEquals("cryuan", model.display().description()); - Assertions.assertEquals("uxzdxtay", model.origin()); - Assertions.assertEquals("fp", model.serviceSpecification().metricSpecifications().get(0).name()); - Assertions.assertEquals("qobmtukk", model.serviceSpecification().metricSpecifications().get(0).displayName()); - Assertions.assertEquals("yrtih", - model.serviceSpecification().metricSpecifications().get(0).displayDescription()); - Assertions.assertEquals(MetricUnit.COUNT_PER_SECOND, - model.serviceSpecification().metricSpecifications().get(0).unit()); - Assertions.assertEquals(MetricAggregationType.NOT_SPECIFIED, - model.serviceSpecification().metricSpecifications().get(0).aggregationType()); - Assertions.assertEquals(false, model.serviceSpecification().metricSpecifications().get(0).fillGapWithZero()); - Assertions.assertEquals(MetricCategory.CAPACITY, - model.serviceSpecification().metricSpecifications().get(0).category()); - Assertions.assertEquals("zsymglzufcyzkohd", - model.serviceSpecification().metricSpecifications().get(0).resourceIdDimensionNameOverride()); - Assertions.assertEquals(TimeGrain.PT12H, - model.serviceSpecification().metricSpecifications().get(0).supportedTimeGrainTypes().get(0)); - Assertions.assertEquals(MetricAggregationType.COUNT, - model.serviceSpecification().metricSpecifications().get(0).supportedAggregationTypes().get(0)); } } diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/OperationListResultTests.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/OperationListResultTests.java new file mode 100644 index 000000000000..f15901a09999 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/OperationListResultTests.java @@ -0,0 +1,19 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.databoxedge.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.databoxedge.implementation.models.OperationListResult; +import org.junit.jupiter.api.Assertions; + +public final class OperationListResultTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + OperationListResult model = BinaryData.fromString( + "{\"value\":[{\"name\":\"hq\",\"isDataAction\":true,\"display\":{\"provider\":\"pybczmehmtzopb\",\"resource\":\"h\",\"operation\":\"pidgsybbejhphoyc\",\"description\":\"xaobhdxbmtqioqjz\"},\"origin\":\"system\",\"actionType\":\"Internal\"},{\"name\":\"fpownoizhwlr\",\"isDataAction\":false,\"display\":{\"provider\":\"oqijgkdmbpaz\",\"resource\":\"bc\",\"operation\":\"pdznrbtcqqjnqgl\",\"description\":\"gnufoooj\"},\"origin\":\"system\",\"actionType\":\"Internal\"},{\"name\":\"esaagdfm\",\"isDataAction\":true,\"display\":{\"provider\":\"j\",\"resource\":\"ifkwmrvktsizntoc\",\"operation\":\"a\",\"description\":\"ajpsquc\"},\"origin\":\"system\",\"actionType\":\"Internal\"}],\"nextLink\":\"kfo\"}") + .toObject(OperationListResult.class); + Assertions.assertEquals("kfo", model.nextLink()); + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/OperationPropertiesTests.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/OperationPropertiesTests.java deleted file mode 100644 index 6d46374bcba4..000000000000 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/OperationPropertiesTests.java +++ /dev/null @@ -1,107 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.databoxedge.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.databoxedge.fluent.models.OperationProperties; -import com.azure.resourcemanager.databoxedge.models.MetricAggregationType; -import com.azure.resourcemanager.databoxedge.models.MetricCategory; -import com.azure.resourcemanager.databoxedge.models.MetricDimensionV1; -import com.azure.resourcemanager.databoxedge.models.MetricSpecificationV1; -import com.azure.resourcemanager.databoxedge.models.MetricUnit; -import com.azure.resourcemanager.databoxedge.models.ServiceSpecification; -import com.azure.resourcemanager.databoxedge.models.TimeGrain; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class OperationPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - OperationProperties model = BinaryData.fromString( - "{\"serviceSpecification\":{\"metricSpecifications\":[{\"name\":\"njaqwixjspro\",\"displayName\":\"cputegjvwmfdats\",\"displayDescription\":\"dvpjhulsuuvmk\",\"unit\":\"Count\",\"aggregationType\":\"None\",\"dimensions\":[{\"name\":\"dio\",\"displayName\":\"pslwejdpvw\",\"toBeExportedForShoebox\":false}],\"fillGapWithZero\":true,\"category\":\"Capacity\",\"resourceIdDimensionNameOverride\":\"cctazakljlahbc\",\"supportedTimeGrainTypes\":[\"PT6H\",\"PT1H\",\"PT15M\",\"PT15M\"],\"supportedAggregationTypes\":[\"Minimum\"]},{\"name\":\"expa\",\"displayName\":\"akhmsbzjhcrz\",\"displayDescription\":\"dphlxaolt\",\"unit\":\"Percent\",\"aggregationType\":\"Average\",\"dimensions\":[{\"name\":\"pfzfsinzgvfc\",\"displayName\":\"wzo\",\"toBeExportedForShoebox\":false}],\"fillGapWithZero\":true,\"category\":\"Transaction\",\"resourceIdDimensionNameOverride\":\"uwfzitonpe\",\"supportedTimeGrainTypes\":[\"PT12H\",\"PT6H\",\"PT1D\"],\"supportedAggregationTypes\":[\"None\",\"Count\",\"Total\",\"None\"]}]}}") - .toObject(OperationProperties.class); - Assertions.assertEquals("njaqwixjspro", model.serviceSpecification().metricSpecifications().get(0).name()); - Assertions.assertEquals("cputegjvwmfdats", - model.serviceSpecification().metricSpecifications().get(0).displayName()); - Assertions.assertEquals("dvpjhulsuuvmk", - model.serviceSpecification().metricSpecifications().get(0).displayDescription()); - Assertions.assertEquals(MetricUnit.COUNT, model.serviceSpecification().metricSpecifications().get(0).unit()); - Assertions.assertEquals(MetricAggregationType.NONE, - model.serviceSpecification().metricSpecifications().get(0).aggregationType()); - Assertions.assertEquals("dio", - model.serviceSpecification().metricSpecifications().get(0).dimensions().get(0).name()); - Assertions.assertEquals("pslwejdpvw", - model.serviceSpecification().metricSpecifications().get(0).dimensions().get(0).displayName()); - Assertions.assertEquals(false, - model.serviceSpecification().metricSpecifications().get(0).dimensions().get(0).toBeExportedForShoebox()); - Assertions.assertEquals(true, model.serviceSpecification().metricSpecifications().get(0).fillGapWithZero()); - Assertions.assertEquals(MetricCategory.CAPACITY, - model.serviceSpecification().metricSpecifications().get(0).category()); - Assertions.assertEquals("cctazakljlahbc", - model.serviceSpecification().metricSpecifications().get(0).resourceIdDimensionNameOverride()); - Assertions.assertEquals(TimeGrain.PT6H, - model.serviceSpecification().metricSpecifications().get(0).supportedTimeGrainTypes().get(0)); - Assertions.assertEquals(MetricAggregationType.MINIMUM, - model.serviceSpecification().metricSpecifications().get(0).supportedAggregationTypes().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OperationProperties model = new OperationProperties() - .withServiceSpecification(new ServiceSpecification().withMetricSpecifications(Arrays.asList( - new MetricSpecificationV1().withName("njaqwixjspro") - .withDisplayName("cputegjvwmfdats") - .withDisplayDescription("dvpjhulsuuvmk") - .withUnit(MetricUnit.COUNT) - .withAggregationType(MetricAggregationType.NONE) - .withDimensions(Arrays.asList(new MetricDimensionV1().withName("dio") - .withDisplayName("pslwejdpvw") - .withToBeExportedForShoebox(false))) - .withFillGapWithZero(true) - .withCategory(MetricCategory.CAPACITY) - .withResourceIdDimensionNameOverride("cctazakljlahbc") - .withSupportedTimeGrainTypes( - Arrays.asList(TimeGrain.PT6H, TimeGrain.PT1H, TimeGrain.PT15M, TimeGrain.PT15M)) - .withSupportedAggregationTypes(Arrays.asList(MetricAggregationType.MINIMUM)), - new MetricSpecificationV1().withName("expa") - .withDisplayName("akhmsbzjhcrz") - .withDisplayDescription("dphlxaolt") - .withUnit(MetricUnit.PERCENT) - .withAggregationType(MetricAggregationType.AVERAGE) - .withDimensions(Arrays.asList(new MetricDimensionV1().withName("pfzfsinzgvfc") - .withDisplayName("wzo") - .withToBeExportedForShoebox(false))) - .withFillGapWithZero(true) - .withCategory(MetricCategory.TRANSACTION) - .withResourceIdDimensionNameOverride("uwfzitonpe") - .withSupportedTimeGrainTypes(Arrays.asList(TimeGrain.PT12H, TimeGrain.PT6H, TimeGrain.PT1D)) - .withSupportedAggregationTypes(Arrays.asList(MetricAggregationType.NONE, - MetricAggregationType.COUNT, MetricAggregationType.TOTAL, MetricAggregationType.NONE))))); - model = BinaryData.fromObject(model).toObject(OperationProperties.class); - Assertions.assertEquals("njaqwixjspro", model.serviceSpecification().metricSpecifications().get(0).name()); - Assertions.assertEquals("cputegjvwmfdats", - model.serviceSpecification().metricSpecifications().get(0).displayName()); - Assertions.assertEquals("dvpjhulsuuvmk", - model.serviceSpecification().metricSpecifications().get(0).displayDescription()); - Assertions.assertEquals(MetricUnit.COUNT, model.serviceSpecification().metricSpecifications().get(0).unit()); - Assertions.assertEquals(MetricAggregationType.NONE, - model.serviceSpecification().metricSpecifications().get(0).aggregationType()); - Assertions.assertEquals("dio", - model.serviceSpecification().metricSpecifications().get(0).dimensions().get(0).name()); - Assertions.assertEquals("pslwejdpvw", - model.serviceSpecification().metricSpecifications().get(0).dimensions().get(0).displayName()); - Assertions.assertEquals(false, - model.serviceSpecification().metricSpecifications().get(0).dimensions().get(0).toBeExportedForShoebox()); - Assertions.assertEquals(true, model.serviceSpecification().metricSpecifications().get(0).fillGapWithZero()); - Assertions.assertEquals(MetricCategory.CAPACITY, - model.serviceSpecification().metricSpecifications().get(0).category()); - Assertions.assertEquals("cctazakljlahbc", - model.serviceSpecification().metricSpecifications().get(0).resourceIdDimensionNameOverride()); - Assertions.assertEquals(TimeGrain.PT6H, - model.serviceSpecification().metricSpecifications().get(0).supportedTimeGrainTypes().get(0)); - Assertions.assertEquals(MetricAggregationType.MINIMUM, - model.serviceSpecification().metricSpecifications().get(0).supportedAggregationTypes().get(0)); - } -} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/OperationsListMockTests.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/OperationsListMockTests.java index 54355c9a5ba9..9b52d0e4ca8a 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/OperationsListMockTests.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/OperationsListMockTests.java @@ -1,24 +1,19 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.databoxedge.DataBoxEdgeManager; -import com.azure.resourcemanager.databoxedge.models.MetricAggregationType; -import com.azure.resourcemanager.databoxedge.models.MetricCategory; -import com.azure.resourcemanager.databoxedge.models.MetricUnit; import com.azure.resourcemanager.databoxedge.models.Operation; -import com.azure.resourcemanager.databoxedge.models.TimeGrain; import java.nio.charset.StandardCharsets; import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; import reactor.core.publisher.Mono; @@ -26,59 +21,16 @@ public final class OperationsListMockTests { @Test public void testList() throws Exception { String responseStr - = "{\"value\":[{\"name\":\"zrnw\",\"display\":{\"provider\":\"ndfpwpj\",\"resource\":\"wbtlhflsjcdh\",\"operation\":\"fjvfbgofeljagr\",\"description\":\"qhl\"},\"origin\":\"riiiojnalghfkv\",\"properties\":{\"serviceSpecification\":{\"metricSpecifications\":[{\"name\":\"owueluqh\",\"displayName\":\"hhxvrhmzkwpj\",\"displayDescription\":\"wspughftqsxhqx\",\"unit\":\"Milliseconds\",\"aggregationType\":\"Total\",\"dimensions\":[{},{}],\"fillGapWithZero\":true,\"category\":\"Transaction\",\"resourceIdDimensionNameOverride\":\"jguufzdm\",\"supportedTimeGrainTypes\":[\"PT5M\",\"PT1M\",\"PT1D\",\"PT12H\"],\"supportedAggregationTypes\":[\"Minimum\",\"Minimum\",\"Count\",\"Maximum\"]},{\"name\":\"ngamvpphosz\",\"displayName\":\"udphqamvdkfwyn\",\"displayDescription\":\"vtbvkayh\",\"unit\":\"Percent\",\"aggregationType\":\"Total\",\"dimensions\":[{},{},{}],\"fillGapWithZero\":true,\"category\":\"Transaction\",\"resourceIdDimensionNameOverride\":\"pcnp\",\"supportedTimeGrainTypes\":[\"PT6H\",\"PT1M\",\"PT6H\"],\"supportedAggregationTypes\":[\"Total\"]}]}}}]}"; + = "{\"value\":[{\"name\":\"ojlvfhrbbpneqvc\",\"isDataAction\":true,\"display\":{\"provider\":\"r\",\"resource\":\"chpp\",\"operation\":\"rsnm\",\"description\":\"ayzejnhlbkpbz\"},\"origin\":\"user\",\"actionType\":\"Internal\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); DataBoxEdgeManager manager = DataBoxEdgeManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); PagedIterable response = manager.operations().list(com.azure.core.util.Context.NONE); - Assertions.assertEquals("zrnw", response.iterator().next().name()); - Assertions.assertEquals("ndfpwpj", response.iterator().next().display().provider()); - Assertions.assertEquals("wbtlhflsjcdh", response.iterator().next().display().resource()); - Assertions.assertEquals("fjvfbgofeljagr", response.iterator().next().display().operation()); - Assertions.assertEquals("qhl", response.iterator().next().display().description()); - Assertions.assertEquals("riiiojnalghfkv", response.iterator().next().origin()); - Assertions.assertEquals("owueluqh", - response.iterator().next().serviceSpecification().metricSpecifications().get(0).name()); - Assertions.assertEquals("hhxvrhmzkwpj", - response.iterator().next().serviceSpecification().metricSpecifications().get(0).displayName()); - Assertions.assertEquals("wspughftqsxhqx", - response.iterator().next().serviceSpecification().metricSpecifications().get(0).displayDescription()); - Assertions.assertEquals(MetricUnit.MILLISECONDS, - response.iterator().next().serviceSpecification().metricSpecifications().get(0).unit()); - Assertions.assertEquals(MetricAggregationType.TOTAL, - response.iterator().next().serviceSpecification().metricSpecifications().get(0).aggregationType()); - Assertions.assertEquals(true, - response.iterator().next().serviceSpecification().metricSpecifications().get(0).fillGapWithZero()); - Assertions.assertEquals(MetricCategory.TRANSACTION, - response.iterator().next().serviceSpecification().metricSpecifications().get(0).category()); - Assertions.assertEquals("jguufzdm", - response.iterator() - .next() - .serviceSpecification() - .metricSpecifications() - .get(0) - .resourceIdDimensionNameOverride()); - Assertions.assertEquals(TimeGrain.PT5M, - response.iterator() - .next() - .serviceSpecification() - .metricSpecifications() - .get(0) - .supportedTimeGrainTypes() - .get(0)); - Assertions.assertEquals(MetricAggregationType.MINIMUM, - response.iterator() - .next() - .serviceSpecification() - .metricSpecifications() - .get(0) - .supportedAggregationTypes() - .get(0)); } } diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/OperationsListTests.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/OperationsListTests.java deleted file mode 100644 index 62170ed537e8..000000000000 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/OperationsListTests.java +++ /dev/null @@ -1,72 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.databoxedge.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.databoxedge.fluent.models.OperationInner; -import com.azure.resourcemanager.databoxedge.models.MetricSpecificationV1; -import com.azure.resourcemanager.databoxedge.models.OperationDisplay; -import com.azure.resourcemanager.databoxedge.models.OperationsList; -import com.azure.resourcemanager.databoxedge.models.ServiceSpecification; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class OperationsListTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - OperationsList model = BinaryData.fromString( - "{\"value\":[{\"name\":\"hq\",\"display\":{\"provider\":\"jxpybczmeh\",\"resource\":\"zopbsphrupidgs\",\"operation\":\"bejhphoycmsxa\",\"description\":\"hdxbmtqio\"},\"origin\":\"zehtbmu\",\"properties\":{\"serviceSpecification\":{\"metricSpecifications\":[{}]}}},{\"name\":\"izhwlrxy\",\"display\":{\"provider\":\"oqijgkdmbpaz\",\"resource\":\"bc\",\"operation\":\"pdznrbtcqqjnqgl\",\"description\":\"gnufoooj\"},\"origin\":\"ifsqesaagdfmg\",\"properties\":{\"serviceSpecification\":{\"metricSpecifications\":[{}]}}},{\"name\":\"rifkwm\",\"display\":{\"provider\":\"tsizntocipaoua\",\"resource\":\"s\",\"operation\":\"cmpoyfdkfogkny\",\"description\":\"ofjdde\"},\"origin\":\"rd\",\"properties\":{\"serviceSpecification\":{\"metricSpecifications\":[{}]}}}],\"nextLink\":\"wreitj\"}") - .toObject(OperationsList.class); - Assertions.assertEquals("hq", model.value().get(0).name()); - Assertions.assertEquals("jxpybczmeh", model.value().get(0).display().provider()); - Assertions.assertEquals("zopbsphrupidgs", model.value().get(0).display().resource()); - Assertions.assertEquals("bejhphoycmsxa", model.value().get(0).display().operation()); - Assertions.assertEquals("hdxbmtqio", model.value().get(0).display().description()); - Assertions.assertEquals("zehtbmu", model.value().get(0).origin()); - Assertions.assertEquals("wreitj", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OperationsList model - = new OperationsList() - .withValue( - Arrays - .asList( - new OperationInner().withName("hq") - .withDisplay(new OperationDisplay().withProvider("jxpybczmeh") - .withResource("zopbsphrupidgs") - .withOperation("bejhphoycmsxa") - .withDescription("hdxbmtqio")) - .withOrigin("zehtbmu") - .withServiceSpecification(new ServiceSpecification() - .withMetricSpecifications(Arrays.asList(new MetricSpecificationV1()))), - new OperationInner().withName("izhwlrxy") - .withDisplay(new OperationDisplay().withProvider("oqijgkdmbpaz") - .withResource("bc") - .withOperation("pdznrbtcqqjnqgl") - .withDescription("gnufoooj")) - .withOrigin("ifsqesaagdfmg") - .withServiceSpecification(new ServiceSpecification().withMetricSpecifications( - Arrays.asList(new MetricSpecificationV1()))), - new OperationInner().withName("rifkwm") - .withDisplay(new OperationDisplay().withProvider("tsizntocipaoua") - .withResource("s") - .withOperation("cmpoyfdkfogkny") - .withDescription("ofjdde")) - .withOrigin("rd") - .withServiceSpecification(new ServiceSpecification() - .withMetricSpecifications(Arrays.asList(new MetricSpecificationV1()))))) - .withNextLink("wreitj"); - model = BinaryData.fromObject(model).toObject(OperationsList.class); - Assertions.assertEquals("hq", model.value().get(0).name()); - Assertions.assertEquals("jxpybczmeh", model.value().get(0).display().provider()); - Assertions.assertEquals("zopbsphrupidgs", model.value().get(0).display().resource()); - Assertions.assertEquals("bejhphoycmsxa", model.value().get(0).display().operation()); - Assertions.assertEquals("hdxbmtqio", model.value().get(0).display().description()); - Assertions.assertEquals("zehtbmu", model.value().get(0).origin()); - Assertions.assertEquals("wreitj", model.nextLink()); - } -} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/OrderStatusTests.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/OrderStatusTests.java index 5f980c2360f1..87858cbc1180 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/OrderStatusTests.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/OrderStatusTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.generated; @@ -13,17 +13,9 @@ public final class OrderStatusTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { OrderStatus model = BinaryData.fromString( - "{\"status\":\"Declined\",\"updateDateTime\":\"2021-05-05T05:49:54Z\",\"comments\":\"wtmwerio\",\"additionalOrderDetails\":{\"n\":\"yqsemwa\"}}") + "{\"status\":\"AwaitingReturnShipment\",\"updateDateTime\":\"2021-10-27T07:49:07Z\",\"comments\":\"nayrhyrnxxmueedn\",\"trackingInformation\":{\"serialNumber\":\"v\",\"carrierName\":\"kwqqtchealmf\",\"trackingId\":\"d\",\"trackingUrl\":\"ygdvwv\"},\"additionalOrderDetails\":{\"qagvrvm\":\"ohgwxrtfudxepxg\",\"dblx\":\"pkukghi\",\"fnjhfjxwmszkkfo\":\"wi\"}}") .toObject(OrderStatus.class); - Assertions.assertEquals(OrderState.DECLINED, model.status()); - Assertions.assertEquals("wtmwerio", model.comments()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OrderStatus model = new OrderStatus().withStatus(OrderState.DECLINED).withComments("wtmwerio"); - model = BinaryData.fromObject(model).toObject(OrderStatus.class); - Assertions.assertEquals(OrderState.DECLINED, model.status()); - Assertions.assertEquals("wtmwerio", model.comments()); + Assertions.assertEquals(OrderState.AWAITING_RETURN_SHIPMENT, model.status()); + Assertions.assertEquals("nayrhyrnxxmueedn", model.comments()); } } diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/OrdersDeleteMockTests.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/OrdersDeleteMockTests.java index f4ce901bba84..b646d153cff7 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/OrdersDeleteMockTests.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/OrdersDeleteMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.databoxedge.DataBoxEdgeManager; import java.nio.charset.StandardCharsets; @@ -25,9 +25,9 @@ public void testDelete() throws Exception { DataBoxEdgeManager manager = DataBoxEdgeManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - manager.orders().delete("bunzozudh", "xg", com.azure.core.util.Context.NONE); + manager.orders().delete("ve", "yfdvlvhbwrnfxtgd", com.azure.core.util.Context.NONE); } } diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/PeriodicTimerEventTriggerTests.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/PeriodicTimerEventTriggerTests.java deleted file mode 100644 index 4b461a086a4f..000000000000 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/PeriodicTimerEventTriggerTests.java +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.databoxedge.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.databoxedge.models.PeriodicTimerEventTrigger; -import com.azure.resourcemanager.databoxedge.models.PeriodicTimerSourceInfo; -import com.azure.resourcemanager.databoxedge.models.RoleSinkInfo; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; - -public final class PeriodicTimerEventTriggerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PeriodicTimerEventTrigger model = BinaryData.fromString( - "{\"kind\":\"PeriodicTimerEvent\",\"properties\":{\"sourceInfo\":{\"startTime\":\"2021-03-25T05:44:29Z\",\"schedule\":\"sybbqwr\",\"topic\":\"ldgmfpgvmpip\"},\"sinkInfo\":{\"roleId\":\"slthaq\"},\"customContextTag\":\"ss\"},\"id\":\"wutwbdsre\",\"name\":\"pdrhne\",\"type\":\"yowqkdwytisibir\"}") - .toObject(PeriodicTimerEventTrigger.class); - Assertions.assertEquals(OffsetDateTime.parse("2021-03-25T05:44:29Z"), model.sourceInfo().startTime()); - Assertions.assertEquals("sybbqwr", model.sourceInfo().schedule()); - Assertions.assertEquals("ldgmfpgvmpip", model.sourceInfo().topic()); - Assertions.assertEquals("slthaq", model.sinkInfo().roleId()); - Assertions.assertEquals("ss", model.customContextTag()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PeriodicTimerEventTrigger model = new PeriodicTimerEventTrigger() - .withSourceInfo(new PeriodicTimerSourceInfo().withStartTime(OffsetDateTime.parse("2021-03-25T05:44:29Z")) - .withSchedule("sybbqwr") - .withTopic("ldgmfpgvmpip")) - .withSinkInfo(new RoleSinkInfo().withRoleId("slthaq")) - .withCustomContextTag("ss"); - model = BinaryData.fromObject(model).toObject(PeriodicTimerEventTrigger.class); - Assertions.assertEquals(OffsetDateTime.parse("2021-03-25T05:44:29Z"), model.sourceInfo().startTime()); - Assertions.assertEquals("sybbqwr", model.sourceInfo().schedule()); - Assertions.assertEquals("ldgmfpgvmpip", model.sourceInfo().topic()); - Assertions.assertEquals("slthaq", model.sinkInfo().roleId()); - Assertions.assertEquals("ss", model.customContextTag()); - } -} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/PeriodicTimerPropertiesTests.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/PeriodicTimerPropertiesTests.java deleted file mode 100644 index 58ec1c48254f..000000000000 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/PeriodicTimerPropertiesTests.java +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.databoxedge.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.databoxedge.fluent.models.PeriodicTimerProperties; -import com.azure.resourcemanager.databoxedge.models.PeriodicTimerSourceInfo; -import com.azure.resourcemanager.databoxedge.models.RoleSinkInfo; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; - -public final class PeriodicTimerPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PeriodicTimerProperties model = BinaryData.fromString( - "{\"sourceInfo\":{\"startTime\":\"2021-10-26T20:04:04Z\",\"schedule\":\"pikpz\",\"topic\":\"ejzanlfz\"},\"sinkInfo\":{\"roleId\":\"iavrm\"},\"customContextTag\":\"onok\"}") - .toObject(PeriodicTimerProperties.class); - Assertions.assertEquals(OffsetDateTime.parse("2021-10-26T20:04:04Z"), model.sourceInfo().startTime()); - Assertions.assertEquals("pikpz", model.sourceInfo().schedule()); - Assertions.assertEquals("ejzanlfz", model.sourceInfo().topic()); - Assertions.assertEquals("iavrm", model.sinkInfo().roleId()); - Assertions.assertEquals("onok", model.customContextTag()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PeriodicTimerProperties model = new PeriodicTimerProperties() - .withSourceInfo(new PeriodicTimerSourceInfo().withStartTime(OffsetDateTime.parse("2021-10-26T20:04:04Z")) - .withSchedule("pikpz") - .withTopic("ejzanlfz")) - .withSinkInfo(new RoleSinkInfo().withRoleId("iavrm")) - .withCustomContextTag("onok"); - model = BinaryData.fromObject(model).toObject(PeriodicTimerProperties.class); - Assertions.assertEquals(OffsetDateTime.parse("2021-10-26T20:04:04Z"), model.sourceInfo().startTime()); - Assertions.assertEquals("pikpz", model.sourceInfo().schedule()); - Assertions.assertEquals("ejzanlfz", model.sourceInfo().topic()); - Assertions.assertEquals("iavrm", model.sinkInfo().roleId()); - Assertions.assertEquals("onok", model.customContextTag()); - } -} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/PeriodicTimerSourceInfoTests.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/PeriodicTimerSourceInfoTests.java deleted file mode 100644 index fdbdb7a480db..000000000000 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/PeriodicTimerSourceInfoTests.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.databoxedge.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.databoxedge.models.PeriodicTimerSourceInfo; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; - -public final class PeriodicTimerSourceInfoTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PeriodicTimerSourceInfo model = BinaryData - .fromString("{\"startTime\":\"2021-09-27T16:09:30Z\",\"schedule\":\"rjqc\",\"topic\":\"gzpfrla\"}") - .toObject(PeriodicTimerSourceInfo.class); - Assertions.assertEquals(OffsetDateTime.parse("2021-09-27T16:09:30Z"), model.startTime()); - Assertions.assertEquals("rjqc", model.schedule()); - Assertions.assertEquals("gzpfrla", model.topic()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PeriodicTimerSourceInfo model - = new PeriodicTimerSourceInfo().withStartTime(OffsetDateTime.parse("2021-09-27T16:09:30Z")) - .withSchedule("rjqc") - .withTopic("gzpfrla"); - model = BinaryData.fromObject(model).toObject(PeriodicTimerSourceInfo.class); - Assertions.assertEquals(OffsetDateTime.parse("2021-09-27T16:09:30Z"), model.startTime()); - Assertions.assertEquals("rjqc", model.schedule()); - Assertions.assertEquals("gzpfrla", model.topic()); - } -} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/ProactiveLogCollectionSettingsPropertiesTests.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/ProactiveLogCollectionSettingsPropertiesTests.java new file mode 100644 index 000000000000..b14f947fc4ab --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/ProactiveLogCollectionSettingsPropertiesTests.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.databoxedge.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.databoxedge.fluent.models.ProactiveLogCollectionSettingsProperties; +import com.azure.resourcemanager.databoxedge.models.ProactiveDiagnosticsConsent; +import org.junit.jupiter.api.Assertions; + +public final class ProactiveLogCollectionSettingsPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ProactiveLogCollectionSettingsProperties model = BinaryData.fromString("{\"userConsent\":\"Disabled\"}") + .toObject(ProactiveLogCollectionSettingsProperties.class); + Assertions.assertEquals(ProactiveDiagnosticsConsent.DISABLED, model.userConsent()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ProactiveLogCollectionSettingsProperties model + = new ProactiveLogCollectionSettingsProperties().withUserConsent(ProactiveDiagnosticsConsent.DISABLED); + model = BinaryData.fromObject(model).toObject(ProactiveLogCollectionSettingsProperties.class); + Assertions.assertEquals(ProactiveDiagnosticsConsent.DISABLED, model.userConsent()); + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/RawCertificateDataTests.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/RawCertificateDataTests.java index 24f6c947e304..8360aa8a886e 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/RawCertificateDataTests.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/RawCertificateDataTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.generated; @@ -13,19 +13,19 @@ public final class RawCertificateDataTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { RawCertificateData model - = BinaryData.fromString("{\"authenticationType\":\"AzureActiveDirectory\",\"certificate\":\"idb\"}") + = BinaryData.fromString("{\"authenticationType\":\"AzureActiveDirectory\",\"certificate\":\"ixisxyawjoy\"}") .toObject(RawCertificateData.class); Assertions.assertEquals(AuthenticationType.AZURE_ACTIVE_DIRECTORY, model.authenticationType()); - Assertions.assertEquals("idb", model.certificate()); + Assertions.assertEquals("ixisxyawjoy", model.certificate()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { RawCertificateData model = new RawCertificateData().withAuthenticationType(AuthenticationType.AZURE_ACTIVE_DIRECTORY) - .withCertificate("idb"); + .withCertificate("ixisxyawjoy"); model = BinaryData.fromObject(model).toObject(RawCertificateData.class); Assertions.assertEquals(AuthenticationType.AZURE_ACTIVE_DIRECTORY, model.authenticationType()); - Assertions.assertEquals("idb", model.certificate()); + Assertions.assertEquals("ixisxyawjoy", model.certificate()); } } diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/RefreshDetailsTests.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/RefreshDetailsTests.java index e2e37c479413..b8204e190386 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/RefreshDetailsTests.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/RefreshDetailsTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.generated; @@ -13,24 +13,24 @@ public final class RefreshDetailsTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { RefreshDetails model = BinaryData.fromString( - "{\"inProgressRefreshJobId\":\"eqdcv\",\"lastCompletedRefreshJobTimeInUTC\":\"2021-04-28T18:47:47Z\",\"errorManifestFile\":\"ood\",\"lastJob\":\"tbobz\"}") + "{\"inProgressRefreshJobId\":\"zqwhxxbuyqaxzfeq\",\"lastCompletedRefreshJobTimeInUTC\":\"2021-04-29T15:05:43Z\",\"errorManifestFile\":\"riolxorjalt\",\"lastJob\":\"mncwsobqwcsdb\"}") .toObject(RefreshDetails.class); - Assertions.assertEquals("eqdcv", model.inProgressRefreshJobId()); - Assertions.assertEquals(OffsetDateTime.parse("2021-04-28T18:47:47Z"), model.lastCompletedRefreshJobTimeInUtc()); - Assertions.assertEquals("ood", model.errorManifestFile()); - Assertions.assertEquals("tbobz", model.lastJob()); + Assertions.assertEquals("zqwhxxbuyqaxzfeq", model.inProgressRefreshJobId()); + Assertions.assertEquals(OffsetDateTime.parse("2021-04-29T15:05:43Z"), model.lastCompletedRefreshJobTimeInUTC()); + Assertions.assertEquals("riolxorjalt", model.errorManifestFile()); + Assertions.assertEquals("mncwsobqwcsdb", model.lastJob()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - RefreshDetails model = new RefreshDetails().withInProgressRefreshJobId("eqdcv") - .withLastCompletedRefreshJobTimeInUtc(OffsetDateTime.parse("2021-04-28T18:47:47Z")) - .withErrorManifestFile("ood") - .withLastJob("tbobz"); + RefreshDetails model = new RefreshDetails().withInProgressRefreshJobId("zqwhxxbuyqaxzfeq") + .withLastCompletedRefreshJobTimeInUTC(OffsetDateTime.parse("2021-04-29T15:05:43Z")) + .withErrorManifestFile("riolxorjalt") + .withLastJob("mncwsobqwcsdb"); model = BinaryData.fromObject(model).toObject(RefreshDetails.class); - Assertions.assertEquals("eqdcv", model.inProgressRefreshJobId()); - Assertions.assertEquals(OffsetDateTime.parse("2021-04-28T18:47:47Z"), model.lastCompletedRefreshJobTimeInUtc()); - Assertions.assertEquals("ood", model.errorManifestFile()); - Assertions.assertEquals("tbobz", model.lastJob()); + Assertions.assertEquals("zqwhxxbuyqaxzfeq", model.inProgressRefreshJobId()); + Assertions.assertEquals(OffsetDateTime.parse("2021-04-29T15:05:43Z"), model.lastCompletedRefreshJobTimeInUTC()); + Assertions.assertEquals("riolxorjalt", model.errorManifestFile()); + Assertions.assertEquals("mncwsobqwcsdb", model.lastJob()); } } diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/RemoteSupportSettingsTests.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/RemoteSupportSettingsTests.java new file mode 100644 index 000000000000..818e46fafefd --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/RemoteSupportSettingsTests.java @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.databoxedge.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.databoxedge.models.AccessLevel; +import com.azure.resourcemanager.databoxedge.models.RemoteApplicationType; +import com.azure.resourcemanager.databoxedge.models.RemoteSupportSettings; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; + +public final class RemoteSupportSettingsTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + RemoteSupportSettings model = BinaryData.fromString( + "{\"remoteApplicationType\":\"Powershell\",\"accessLevel\":\"FullAccess\",\"expirationTimeStampInUTC\":\"2021-11-27T13:09:17Z\"}") + .toObject(RemoteSupportSettings.class); + Assertions.assertEquals(RemoteApplicationType.POWERSHELL, model.remoteApplicationType()); + Assertions.assertEquals(AccessLevel.FULL_ACCESS, model.accessLevel()); + Assertions.assertEquals(OffsetDateTime.parse("2021-11-27T13:09:17Z"), model.expirationTimeStampInUTC()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + RemoteSupportSettings model + = new RemoteSupportSettings().withRemoteApplicationType(RemoteApplicationType.POWERSHELL) + .withAccessLevel(AccessLevel.FULL_ACCESS) + .withExpirationTimeStampInUTC(OffsetDateTime.parse("2021-11-27T13:09:17Z")); + model = BinaryData.fromObject(model).toObject(RemoteSupportSettings.class); + Assertions.assertEquals(RemoteApplicationType.POWERSHELL, model.remoteApplicationType()); + Assertions.assertEquals(AccessLevel.FULL_ACCESS, model.accessLevel()); + Assertions.assertEquals(OffsetDateTime.parse("2021-11-27T13:09:17Z"), model.expirationTimeStampInUTC()); + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/ResourceIdentityTests.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/ResourceIdentityTests.java new file mode 100644 index 000000000000..d256c15895c6 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/ResourceIdentityTests.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.databoxedge.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.databoxedge.models.MsiIdentityType; +import com.azure.resourcemanager.databoxedge.models.ResourceIdentity; +import org.junit.jupiter.api.Assertions; + +public final class ResourceIdentityTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ResourceIdentity model = BinaryData + .fromString("{\"type\":\"None\",\"principalId\":\"typmrbpizcdrqjsd\",\"tenantId\":\"dnfyhxdeoejzicwi\"}") + .toObject(ResourceIdentity.class); + Assertions.assertEquals(MsiIdentityType.NONE, model.type()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ResourceIdentity model = new ResourceIdentity().withType(MsiIdentityType.NONE); + model = BinaryData.fromObject(model).toObject(ResourceIdentity.class); + Assertions.assertEquals(MsiIdentityType.NONE, model.type()); + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/ResourceMoveDetailsTests.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/ResourceMoveDetailsTests.java new file mode 100644 index 000000000000..feea840f3331 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/ResourceMoveDetailsTests.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.databoxedge.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.databoxedge.models.ResourceMoveDetails; +import com.azure.resourcemanager.databoxedge.models.ResourceMoveStatus; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; + +public final class ResourceMoveDetailsTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ResourceMoveDetails model = BinaryData.fromString( + "{\"operationInProgress\":\"ResourceMoveInProgress\",\"operationInProgressLockTimeoutInUTC\":\"2021-02-06T02:36:47Z\"}") + .toObject(ResourceMoveDetails.class); + Assertions.assertEquals(ResourceMoveStatus.RESOURCE_MOVE_IN_PROGRESS, model.operationInProgress()); + Assertions.assertEquals(OffsetDateTime.parse("2021-02-06T02:36:47Z"), + model.operationInProgressLockTimeoutInUTC()); + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/RoleInnerTests.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/RoleInnerTests.java index d4fe36b7c74f..3c91ed13fe18 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/RoleInnerTests.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/RoleInnerTests.java @@ -1,23 +1,29 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.generated; import com.azure.core.util.BinaryData; import com.azure.resourcemanager.databoxedge.fluent.models.RoleInner; +import com.azure.resourcemanager.databoxedge.models.RoleProperties; +import com.azure.resourcemanager.databoxedge.models.RoleTypes; +import org.junit.jupiter.api.Assertions; public final class RoleInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - RoleInner model = BinaryData - .fromString("{\"kind\":\"Role\",\"id\":\"seotgqrllt\",\"name\":\"u\",\"type\":\"lauwzizxbmpgcjef\"}") + RoleInner model = BinaryData.fromString( + "{\"properties\":{},\"kind\":\"CloudEdgeManagement\",\"id\":\"duhpk\",\"name\":\"kgymareqnajxqug\",\"type\":\"hky\"}") .toObject(RoleInner.class); + Assertions.assertEquals(RoleTypes.CLOUD_EDGE_MANAGEMENT, model.kind()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - RoleInner model = new RoleInner(); + RoleInner model + = new RoleInner().withProperties(new RoleProperties()).withKind(RoleTypes.CLOUD_EDGE_MANAGEMENT); model = BinaryData.fromObject(model).toObject(RoleInner.class); + Assertions.assertEquals(RoleTypes.CLOUD_EDGE_MANAGEMENT, model.kind()); } } diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/RoleListTests.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/RoleListTests.java index 99b09e548b4a..e2542b7c824f 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/RoleListTests.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/RoleListTests.java @@ -1,23 +1,21 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.generated; import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.databoxedge.models.RoleList; +import com.azure.resourcemanager.databoxedge.implementation.models.RoleList; +import com.azure.resourcemanager.databoxedge.models.RoleTypes; +import org.junit.jupiter.api.Assertions; public final class RoleListTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { RoleList model = BinaryData.fromString( - "{\"value\":[{\"kind\":\"Role\",\"id\":\"z\",\"name\":\"nsikvmkqzeqqkdl\",\"type\":\"fzxmhhvhgureodkw\"},{\"kind\":\"Role\",\"id\":\"bdagxt\",\"name\":\"bqdxbx\",\"type\":\"akbogqxndlkzgxh\"},{\"kind\":\"Role\",\"id\":\"ripl\",\"name\":\"podxunkb\",\"type\":\"bxmubyynt\"}],\"nextLink\":\"rbqtkoie\"}") + "{\"value\":[{\"properties\":{},\"kind\":\"Kubernetes\",\"id\":\"dgssofwqmzqal\",\"name\":\"rmnjijpx\",\"type\":\"cqqudf\"},{\"properties\":{},\"kind\":\"Cognitive\",\"id\":\"baaa\",\"name\":\"jyvayffimrzrtuz\",\"type\":\"ogs\"}],\"nextLink\":\"nevfdnw\"}") .toObject(RoleList.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - RoleList model = new RoleList(); - model = BinaryData.fromObject(model).toObject(RoleList.class); + Assertions.assertEquals(RoleTypes.KUBERNETES, model.value().get(0).kind()); + Assertions.assertEquals("nevfdnw", model.nextLink()); } } diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/RolePropertiesTests.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/RolePropertiesTests.java new file mode 100644 index 000000000000..714e6ff67f1d --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/RolePropertiesTests.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.databoxedge.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.databoxedge.models.RoleProperties; + +public final class RolePropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + RoleProperties model = BinaryData.fromString("{}").toObject(RoleProperties.class); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + RoleProperties model = new RoleProperties(); + model = BinaryData.fromObject(model).toObject(RoleProperties.class); + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/RoleSinkInfoTests.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/RoleSinkInfoTests.java deleted file mode 100644 index 197f0b7af31c..000000000000 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/RoleSinkInfoTests.java +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.databoxedge.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.databoxedge.models.RoleSinkInfo; -import org.junit.jupiter.api.Assertions; - -public final class RoleSinkInfoTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - RoleSinkInfo model = BinaryData.fromString("{\"roleId\":\"nyowxwlmdjrkvfg\"}").toObject(RoleSinkInfo.class); - Assertions.assertEquals("nyowxwlmdjrkvfg", model.roleId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - RoleSinkInfo model = new RoleSinkInfo().withRoleId("nyowxwlmdjrkvfg"); - model = BinaryData.fromObject(model).toObject(RoleSinkInfo.class); - Assertions.assertEquals("nyowxwlmdjrkvfg", model.roleId()); - } -} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/RolesCreateOrUpdateMockTests.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/RolesCreateOrUpdateMockTests.java index 931499150dda..a929e4363539 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/RolesCreateOrUpdateMockTests.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/RolesCreateOrUpdateMockTests.java @@ -1,19 +1,21 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.databoxedge.DataBoxEdgeManager; -import com.azure.resourcemanager.databoxedge.fluent.models.RoleInner; import com.azure.resourcemanager.databoxedge.models.Role; +import com.azure.resourcemanager.databoxedge.models.RoleProperties; +import com.azure.resourcemanager.databoxedge.models.RoleTypes; import java.nio.charset.StandardCharsets; import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; import reactor.core.publisher.Mono; @@ -21,18 +23,22 @@ public final class RolesCreateOrUpdateMockTests { @Test public void testCreateOrUpdate() throws Exception { String responseStr - = "{\"kind\":\"Role\",\"id\":\"pe\",\"name\":\"ojyqdhcuplcplcw\",\"type\":\"hihihlhzdsqtzbsr\"}"; + = "{\"properties\":{},\"kind\":\"Kubernetes\",\"id\":\"oknssqyzqedikdf\",\"name\":\"db\",\"type\":\"qmrjg\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); DataBoxEdgeManager manager = DataBoxEdgeManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); Role response = manager.roles() - .createOrUpdate("ylyrfgiagtco", "ocqwogfnzjvus", "zldmozuxy", new RoleInner(), - com.azure.core.util.Context.NONE); + .define("kmifoxxkub") + .withExistingDataBoxEdgeDevice("ufypiv", "sbbjpmcu") + .withKind(RoleTypes.ASA) + .withProperties(new RoleProperties()) + .create(); + Assertions.assertEquals(RoleTypes.KUBERNETES, response.kind()); } } diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/RolesDeleteMockTests.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/RolesDeleteMockTests.java index 444e0eb4d928..d6b6ad631de3 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/RolesDeleteMockTests.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/RolesDeleteMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.databoxedge.DataBoxEdgeManager; import java.nio.charset.StandardCharsets; @@ -25,9 +25,9 @@ public void testDelete() throws Exception { DataBoxEdgeManager manager = DataBoxEdgeManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - manager.roles().delete("nowc", "hfgmvecactxm", "oteyowc", com.azure.core.util.Context.NONE); + manager.roles().delete("gqcg", "uugqk", "totiowlxteqdptjg", com.azure.core.util.Context.NONE); } } diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/RolesGetWithResponseMockTests.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/RolesGetWithResponseMockTests.java index f4ef9ce58b99..ca544587d68a 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/RolesGetWithResponseMockTests.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/RolesGetWithResponseMockTests.java @@ -1,18 +1,20 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.databoxedge.DataBoxEdgeManager; import com.azure.resourcemanager.databoxedge.models.Role; +import com.azure.resourcemanager.databoxedge.models.RoleTypes; import java.nio.charset.StandardCharsets; import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; import reactor.core.publisher.Mono; @@ -20,18 +22,19 @@ public final class RolesGetWithResponseMockTests { @Test public void testGetWithResponse() throws Exception { String responseStr - = "{\"kind\":\"Role\",\"id\":\"vodggxdbee\",\"name\":\"mieknlraria\",\"type\":\"wiuagydwqf\"}"; + = "{\"properties\":{},\"kind\":\"Cognitive\",\"id\":\"cfxhikkflrmy\",\"name\":\"yincql\",\"type\":\"riswslmiiio\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); DataBoxEdgeManager manager = DataBoxEdgeManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); Role response = manager.roles() - .getWithResponse("lefaxvxilcbtgn", "nzeyqxtjj", "zqlqhyc", com.azure.core.util.Context.NONE) + .getWithResponse("guihywar", "spphk", "xkykxdssjp", com.azure.core.util.Context.NONE) .getValue(); + Assertions.assertEquals(RoleTypes.COGNITIVE, response.kind()); } } diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/RolesListByDataBoxEdgeDeviceMockTests.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/RolesListByDataBoxEdgeDeviceMockTests.java index d33cdaf7baa7..e90742fa2a83 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/RolesListByDataBoxEdgeDeviceMockTests.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/RolesListByDataBoxEdgeDeviceMockTests.java @@ -1,19 +1,21 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.databoxedge.DataBoxEdgeManager; import com.azure.resourcemanager.databoxedge.models.Role; +import com.azure.resourcemanager.databoxedge.models.RoleTypes; import java.nio.charset.StandardCharsets; import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; import reactor.core.publisher.Mono; @@ -21,17 +23,18 @@ public final class RolesListByDataBoxEdgeDeviceMockTests { @Test public void testListByDataBoxEdgeDevice() throws Exception { String responseStr - = "{\"value\":[{\"kind\":\"Role\",\"id\":\"f\",\"name\":\"fcjnaeoisrvhmgor\",\"type\":\"fukiscvwmzhw\"}]}"; + = "{\"value\":[{\"properties\":{},\"kind\":\"Functions\",\"id\":\"qwahoi\",\"name\":\"lwgniiprglvawu\",\"type\":\"z\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); DataBoxEdgeManager manager = DataBoxEdgeManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); PagedIterable response - = manager.roles().listByDataBoxEdgeDevice("moy", "cdyuibhmfdnbzyd", com.azure.core.util.Context.NONE); + = manager.roles().listByDataBoxEdgeDevice("dtguk", "anblwphqlkccu", com.azure.core.util.Context.NONE); + Assertions.assertEquals(RoleTypes.FUNCTIONS, response.iterator().next().kind()); } } diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/ServiceSpecificationTests.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/ServiceSpecificationTests.java deleted file mode 100644 index ba86fd2a52b4..000000000000 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/ServiceSpecificationTests.java +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.databoxedge.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.databoxedge.models.MetricAggregationType; -import com.azure.resourcemanager.databoxedge.models.MetricCategory; -import com.azure.resourcemanager.databoxedge.models.MetricDimensionV1; -import com.azure.resourcemanager.databoxedge.models.MetricSpecificationV1; -import com.azure.resourcemanager.databoxedge.models.MetricUnit; -import com.azure.resourcemanager.databoxedge.models.ServiceSpecification; -import com.azure.resourcemanager.databoxedge.models.TimeGrain; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class ServiceSpecificationTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ServiceSpecification model = BinaryData.fromString( - "{\"metricSpecifications\":[{\"name\":\"fxxypininmayhuy\",\"displayName\":\"kpode\",\"displayDescription\":\"oginuvamiheognar\",\"unit\":\"Percent\",\"aggregationType\":\"Total\",\"dimensions\":[{\"name\":\"usivye\",\"displayName\":\"ciqihnhung\",\"toBeExportedForShoebox\":false}],\"fillGapWithZero\":true,\"category\":\"Transaction\",\"resourceIdDimensionNameOverride\":\"gxg\",\"supportedTimeGrainTypes\":[\"PT5M\",\"PT1H\",\"PT5M\",\"PT1H\"],\"supportedAggregationTypes\":[\"Count\",\"Average\"]}]}") - .toObject(ServiceSpecification.class); - Assertions.assertEquals("fxxypininmayhuy", model.metricSpecifications().get(0).name()); - Assertions.assertEquals("kpode", model.metricSpecifications().get(0).displayName()); - Assertions.assertEquals("oginuvamiheognar", model.metricSpecifications().get(0).displayDescription()); - Assertions.assertEquals(MetricUnit.PERCENT, model.metricSpecifications().get(0).unit()); - Assertions.assertEquals(MetricAggregationType.TOTAL, model.metricSpecifications().get(0).aggregationType()); - Assertions.assertEquals("usivye", model.metricSpecifications().get(0).dimensions().get(0).name()); - Assertions.assertEquals("ciqihnhung", model.metricSpecifications().get(0).dimensions().get(0).displayName()); - Assertions.assertEquals(false, - model.metricSpecifications().get(0).dimensions().get(0).toBeExportedForShoebox()); - Assertions.assertEquals(true, model.metricSpecifications().get(0).fillGapWithZero()); - Assertions.assertEquals(MetricCategory.TRANSACTION, model.metricSpecifications().get(0).category()); - Assertions.assertEquals("gxg", model.metricSpecifications().get(0).resourceIdDimensionNameOverride()); - Assertions.assertEquals(TimeGrain.PT5M, model.metricSpecifications().get(0).supportedTimeGrainTypes().get(0)); - Assertions.assertEquals(MetricAggregationType.COUNT, - model.metricSpecifications().get(0).supportedAggregationTypes().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ServiceSpecification model = new ServiceSpecification() - .withMetricSpecifications(Arrays.asList(new MetricSpecificationV1().withName("fxxypininmayhuy") - .withDisplayName("kpode") - .withDisplayDescription("oginuvamiheognar") - .withUnit(MetricUnit.PERCENT) - .withAggregationType(MetricAggregationType.TOTAL) - .withDimensions(Arrays.asList(new MetricDimensionV1().withName("usivye") - .withDisplayName("ciqihnhung") - .withToBeExportedForShoebox(false))) - .withFillGapWithZero(true) - .withCategory(MetricCategory.TRANSACTION) - .withResourceIdDimensionNameOverride("gxg") - .withSupportedTimeGrainTypes( - Arrays.asList(TimeGrain.PT5M, TimeGrain.PT1H, TimeGrain.PT5M, TimeGrain.PT1H)) - .withSupportedAggregationTypes( - Arrays.asList(MetricAggregationType.COUNT, MetricAggregationType.AVERAGE)))); - model = BinaryData.fromObject(model).toObject(ServiceSpecification.class); - Assertions.assertEquals("fxxypininmayhuy", model.metricSpecifications().get(0).name()); - Assertions.assertEquals("kpode", model.metricSpecifications().get(0).displayName()); - Assertions.assertEquals("oginuvamiheognar", model.metricSpecifications().get(0).displayDescription()); - Assertions.assertEquals(MetricUnit.PERCENT, model.metricSpecifications().get(0).unit()); - Assertions.assertEquals(MetricAggregationType.TOTAL, model.metricSpecifications().get(0).aggregationType()); - Assertions.assertEquals("usivye", model.metricSpecifications().get(0).dimensions().get(0).name()); - Assertions.assertEquals("ciqihnhung", model.metricSpecifications().get(0).dimensions().get(0).displayName()); - Assertions.assertEquals(false, - model.metricSpecifications().get(0).dimensions().get(0).toBeExportedForShoebox()); - Assertions.assertEquals(true, model.metricSpecifications().get(0).fillGapWithZero()); - Assertions.assertEquals(MetricCategory.TRANSACTION, model.metricSpecifications().get(0).category()); - Assertions.assertEquals("gxg", model.metricSpecifications().get(0).resourceIdDimensionNameOverride()); - Assertions.assertEquals(TimeGrain.PT5M, model.metricSpecifications().get(0).supportedTimeGrainTypes().get(0)); - Assertions.assertEquals(MetricAggregationType.COUNT, - model.metricSpecifications().get(0).supportedAggregationTypes().get(0)); - } -} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/ShareAccessRightTests.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/ShareAccessRightTests.java index 5455651533ec..9956a7024fa2 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/ShareAccessRightTests.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/ShareAccessRightTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.generated; @@ -12,18 +12,9 @@ public final class ShareAccessRightTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - ShareAccessRight model = BinaryData.fromString("{\"shareId\":\"vfdnwnwmewzsyyce\",\"accessType\":\"Read\"}") + ShareAccessRight model = BinaryData.fromString("{\"shareId\":\"krribdeibqi\",\"accessType\":\"Change\"}") .toObject(ShareAccessRight.class); - Assertions.assertEquals("vfdnwnwmewzsyyce", model.shareId()); - Assertions.assertEquals(ShareAccessType.READ, model.accessType()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ShareAccessRight model - = new ShareAccessRight().withShareId("vfdnwnwmewzsyyce").withAccessType(ShareAccessType.READ); - model = BinaryData.fromObject(model).toObject(ShareAccessRight.class); - Assertions.assertEquals("vfdnwnwmewzsyyce", model.shareId()); - Assertions.assertEquals(ShareAccessType.READ, model.accessType()); + Assertions.assertEquals("krribdeibqi", model.shareId()); + Assertions.assertEquals(ShareAccessType.CHANGE, model.accessType()); } } diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/SharesDeleteMockTests.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/SharesDeleteMockTests.java index 8303f2fef58c..3f6109422485 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/SharesDeleteMockTests.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/SharesDeleteMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.databoxedge.DataBoxEdgeManager; import java.nio.charset.StandardCharsets; @@ -25,9 +25,9 @@ public void testDelete() throws Exception { DataBoxEdgeManager manager = DataBoxEdgeManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - manager.shares().delete("petogebjox", "lhvnhlab", "q", com.azure.core.util.Context.NONE); + manager.shares().delete("aurkihcirlde", "xrdcoxnbkkja", "urnnqbnqbpiz", com.azure.core.util.Context.NONE); } } diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/SharesRefreshMockTests.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/SharesRefreshMockTests.java index 642580418e1d..d3fee087fa69 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/SharesRefreshMockTests.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/SharesRefreshMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.databoxedge.DataBoxEdgeManager; import java.nio.charset.StandardCharsets; @@ -25,9 +25,9 @@ public void testRefresh() throws Exception { DataBoxEdgeManager manager = DataBoxEdgeManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - manager.shares().refresh("kkzjcjbtrga", "hvv", "brxjjsto", com.azure.core.util.Context.NONE); + manager.shares().refresh("iowxi", "spnxwqagnepzw", "klsbsbqqqagw", com.azure.core.util.Context.NONE); } } diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/SkuCapabilityTests.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/SkuCapabilityTests.java new file mode 100644 index 000000000000..fef0b4f470c9 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/SkuCapabilityTests.java @@ -0,0 +1,16 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.databoxedge.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.databoxedge.models.SkuCapability; + +public final class SkuCapabilityTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + SkuCapability model + = BinaryData.fromString("{\"name\":\"lnd\",\"value\":\"tutmzl\"}").toObject(SkuCapability.class); + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/SkuCostTests.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/SkuCostTests.java index 18ab3be6a28f..b5b8e06ee7b1 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/SkuCostTests.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/SkuCostTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.generated; @@ -11,13 +11,7 @@ public final class SkuCostTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { SkuCost model = BinaryData - .fromString("{\"meterId\":\"cywuggwol\",\"quantity\":5268045254317332957,\"extendedUnit\":\"wem\"}") + .fromString("{\"meterId\":\"pqhe\",\"quantity\":7022680732951740114,\"extendedUnit\":\"cgsbost\"}") .toObject(SkuCost.class); } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SkuCost model = new SkuCost(); - model = BinaryData.fromObject(model).toObject(SkuCost.class); - } } diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/SkuLocationInfoTests.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/SkuLocationInfoTests.java index 4d40ec7ffd99..cedd3861d088 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/SkuLocationInfoTests.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/SkuLocationInfoTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.generated; @@ -10,15 +10,8 @@ public final class SkuLocationInfoTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - SkuLocationInfo model = BinaryData - .fromString( - "{\"location\":\"oftrmaequia\",\"zones\":[\"cslfaoqzpiyylha\",\"nswhcc\"],\"sites\":[\"kaivwit\"]}") + SkuLocationInfo model = BinaryData.fromString( + "{\"location\":\"jmygvk\",\"zones\":[\"jjeokbz\",\"fezrx\"],\"sites\":[\"urtleipqxb\",\"wvz\",\"nzvdfbzdixzmq\",\"noda\"]}") .toObject(SkuLocationInfo.class); } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SkuLocationInfo model = new SkuLocationInfo(); - model = BinaryData.fromObject(model).toObject(SkuLocationInfo.class); - } } diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/SkuRestrictionInfoTests.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/SkuRestrictionInfoTests.java deleted file mode 100644 index bc12d4749dd5..000000000000 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/SkuRestrictionInfoTests.java +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.databoxedge.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.databoxedge.models.SkuRestrictionInfo; - -public final class SkuRestrictionInfoTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SkuRestrictionInfo model = BinaryData.fromString( - "{\"locations\":[\"gicccnxqhuex\",\"ktt\",\"stvlzywemhzrnc\"],\"zones\":[\"clusiy\",\"bsfgytguslfea\",\"cy\",\"qukyhejhzi\"]}") - .toObject(SkuRestrictionInfo.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SkuRestrictionInfo model = new SkuRestrictionInfo(); - model = BinaryData.fromObject(model).toObject(SkuRestrictionInfo.class); - } -} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/SkuTests.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/SkuTests.java index e66f40e84dc1..ac7931058aaa 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/SkuTests.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/SkuTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.generated; @@ -13,17 +13,16 @@ public final class SkuTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - Sku model - = BinaryData.fromString("{\"name\":\"TEA_4Node_UPS_Heater\",\"tier\":\"Standard\"}").toObject(Sku.class); - Assertions.assertEquals(SkuName.TEA_4NODE_UPS_HEATER, model.name()); + Sku model = BinaryData.fromString("{\"name\":\"GPU\",\"tier\":\"Standard\"}").toObject(Sku.class); + Assertions.assertEquals(SkuName.GPU, model.name()); Assertions.assertEquals(SkuTier.STANDARD, model.tier()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - Sku model = new Sku().withName(SkuName.TEA_4NODE_UPS_HEATER).withTier(SkuTier.STANDARD); + Sku model = new Sku().withName(SkuName.GPU).withTier(SkuTier.STANDARD); model = BinaryData.fromObject(model).toObject(Sku.class); - Assertions.assertEquals(SkuName.TEA_4NODE_UPS_HEATER, model.name()); + Assertions.assertEquals(SkuName.GPU, model.name()); Assertions.assertEquals(SkuTier.STANDARD, model.tier()); } } diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/StorageAccountCredentialsDeleteMockTests.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/StorageAccountCredentialsDeleteMockTests.java index 2b4c9eb16326..5b436900d772 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/StorageAccountCredentialsDeleteMockTests.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/StorageAccountCredentialsDeleteMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.databoxedge.DataBoxEdgeManager; import java.nio.charset.StandardCharsets; @@ -25,9 +25,10 @@ public void testDelete() throws Exception { DataBoxEdgeManager manager = DataBoxEdgeManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - manager.storageAccountCredentials().delete("xtgqscjavftjuh", "qaz", "mtggu", com.azure.core.util.Context.NONE); + manager.storageAccountCredentials() + .delete("cigeleohdbvqvw", "kjopwbeon", "lkwzdqybxceakxcp", com.azure.core.util.Context.NONE); } } diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/SubscriptionPropertiesTests.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/SubscriptionPropertiesTests.java new file mode 100644 index 000000000000..e27ab671da17 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/SubscriptionPropertiesTests.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.databoxedge.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.databoxedge.fluent.models.SubscriptionProperties; +import org.junit.jupiter.api.Assertions; + +public final class SubscriptionPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + SubscriptionProperties model = BinaryData.fromString( + "{\"tenantId\":\"mvfaxkffeiith\",\"locationPlacementId\":\"m\",\"quotaId\":\"yvshxmz\",\"serializedDetails\":\"bzoggigrx\",\"registeredFeatures\":[{\"name\":\"vjxxjnsp\",\"state\":\"ptkoenkoukn\"}]}") + .toObject(SubscriptionProperties.class); + Assertions.assertEquals("mvfaxkffeiith", model.tenantId()); + Assertions.assertEquals("m", model.locationPlacementId()); + Assertions.assertEquals("yvshxmz", model.quotaId()); + Assertions.assertEquals("bzoggigrx", model.serializedDetails()); + Assertions.assertEquals("vjxxjnsp", model.registeredFeatures().get(0).name()); + Assertions.assertEquals("ptkoenkoukn", model.registeredFeatures().get(0).state()); + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/SubscriptionRegisteredFeaturesTests.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/SubscriptionRegisteredFeaturesTests.java new file mode 100644 index 000000000000..8bb49627d273 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/SubscriptionRegisteredFeaturesTests.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.databoxedge.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.databoxedge.models.SubscriptionRegisteredFeatures; +import org.junit.jupiter.api.Assertions; + +public final class SubscriptionRegisteredFeaturesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + SubscriptionRegisteredFeatures model + = BinaryData.fromString("{\"name\":\"dwtiukbldngkp\",\"state\":\"ipazyxoegukgjnpi\"}") + .toObject(SubscriptionRegisteredFeatures.class); + Assertions.assertEquals("dwtiukbldngkp", model.name()); + Assertions.assertEquals("ipazyxoegukgjnpi", model.state()); + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/SupportPackageRequestPropertiesTests.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/SupportPackageRequestPropertiesTests.java new file mode 100644 index 000000000000..a8bf6d92234d --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/SupportPackageRequestPropertiesTests.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.databoxedge.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.databoxedge.fluent.models.SupportPackageRequestProperties; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; + +public final class SupportPackageRequestPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + SupportPackageRequestProperties model = BinaryData.fromString( + "{\"minimumTimeStamp\":\"2021-01-16T13:50:23Z\",\"maximumTimeStamp\":\"2021-03-17T11:37:17Z\",\"include\":\"pgikdgszywkb\"}") + .toObject(SupportPackageRequestProperties.class); + Assertions.assertEquals(OffsetDateTime.parse("2021-01-16T13:50:23Z"), model.minimumTimeStamp()); + Assertions.assertEquals(OffsetDateTime.parse("2021-03-17T11:37:17Z"), model.maximumTimeStamp()); + Assertions.assertEquals("pgikdgszywkb", model.include()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + SupportPackageRequestProperties model + = new SupportPackageRequestProperties().withMinimumTimeStamp(OffsetDateTime.parse("2021-01-16T13:50:23Z")) + .withMaximumTimeStamp(OffsetDateTime.parse("2021-03-17T11:37:17Z")) + .withInclude("pgikdgszywkb"); + model = BinaryData.fromObject(model).toObject(SupportPackageRequestProperties.class); + Assertions.assertEquals(OffsetDateTime.parse("2021-01-16T13:50:23Z"), model.minimumTimeStamp()); + Assertions.assertEquals(OffsetDateTime.parse("2021-03-17T11:37:17Z"), model.maximumTimeStamp()); + Assertions.assertEquals("pgikdgszywkb", model.include()); + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/SupportPackagesTriggerSupportPackageMockTests.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/SupportPackagesTriggerSupportPackageMockTests.java new file mode 100644 index 000000000000..e0a9184c1f12 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/SupportPackagesTriggerSupportPackageMockTests.java @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.databoxedge.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.databoxedge.DataBoxEdgeManager; +import com.azure.resourcemanager.databoxedge.models.TriggerSupportPackageRequest; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class SupportPackagesTriggerSupportPackageMockTests { + @Test + public void testTriggerSupportPackage() throws Exception { + String responseStr = "{}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + DataBoxEdgeManager manager = DataBoxEdgeManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + manager.supportPackages() + .triggerSupportPackage("psjoqcjenk", "hf", + new TriggerSupportPackageRequest().withMinimumTimeStamp(OffsetDateTime.parse("2021-08-21T02:34:59Z")) + .withMaximumTimeStamp(OffsetDateTime.parse("2021-12-04T02:32:58Z")) + .withInclude("xj"), + com.azure.core.util.Context.NONE); + + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/SymmetricKeyTests.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/SymmetricKeyTests.java deleted file mode 100644 index 69989c1da494..000000000000 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/SymmetricKeyTests.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.databoxedge.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.databoxedge.models.AsymmetricEncryptedSecret; -import com.azure.resourcemanager.databoxedge.models.EncryptionAlgorithm; -import com.azure.resourcemanager.databoxedge.models.SymmetricKey; -import org.junit.jupiter.api.Assertions; - -public final class SymmetricKeyTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SymmetricKey model = BinaryData.fromString( - "{\"connectionString\":{\"value\":\"srp\",\"encryptionCertThumbprint\":\"ujzra\",\"encryptionAlgorithm\":\"RSAES_PKCS1_v_1_5\"}}") - .toObject(SymmetricKey.class); - Assertions.assertEquals("srp", model.connectionString().value()); - Assertions.assertEquals("ujzra", model.connectionString().encryptionCertThumbprint()); - Assertions.assertEquals(EncryptionAlgorithm.RSAES_PKCS1_V_1_5, model.connectionString().encryptionAlgorithm()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SymmetricKey model = new SymmetricKey().withConnectionString(new AsymmetricEncryptedSecret().withValue("srp") - .withEncryptionCertThumbprint("ujzra") - .withEncryptionAlgorithm(EncryptionAlgorithm.RSAES_PKCS1_V_1_5)); - model = BinaryData.fromObject(model).toObject(SymmetricKey.class); - Assertions.assertEquals("srp", model.connectionString().value()); - Assertions.assertEquals("ujzra", model.connectionString().encryptionCertThumbprint()); - Assertions.assertEquals(EncryptionAlgorithm.RSAES_PKCS1_V_1_5, model.connectionString().encryptionAlgorithm()); - } -} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/TrackingInfoTests.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/TrackingInfoTests.java index acb231490464..b3e936828f2c 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/TrackingInfoTests.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/TrackingInfoTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.generated; @@ -12,24 +12,11 @@ public final class TrackingInfoTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { TrackingInfo model = BinaryData.fromString( - "{\"serialNumber\":\"shhszhedplvwiw\",\"carrierName\":\"mwmbes\",\"trackingId\":\"nkww\",\"trackingUrl\":\"pjflcxogao\"}") + "{\"serialNumber\":\"eyfkzikfja\",\"carrierName\":\"eaivxwczel\",\"trackingId\":\"irels\",\"trackingUrl\":\"aenwabf\"}") .toObject(TrackingInfo.class); - Assertions.assertEquals("shhszhedplvwiw", model.serialNumber()); - Assertions.assertEquals("mwmbes", model.carrierName()); - Assertions.assertEquals("nkww", model.trackingId()); - Assertions.assertEquals("pjflcxogao", model.trackingUrl()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - TrackingInfo model = new TrackingInfo().withSerialNumber("shhszhedplvwiw") - .withCarrierName("mwmbes") - .withTrackingId("nkww") - .withTrackingUrl("pjflcxogao"); - model = BinaryData.fromObject(model).toObject(TrackingInfo.class); - Assertions.assertEquals("shhszhedplvwiw", model.serialNumber()); - Assertions.assertEquals("mwmbes", model.carrierName()); - Assertions.assertEquals("nkww", model.trackingId()); - Assertions.assertEquals("pjflcxogao", model.trackingUrl()); + Assertions.assertEquals("eyfkzikfja", model.serialNumber()); + Assertions.assertEquals("eaivxwczel", model.carrierName()); + Assertions.assertEquals("irels", model.trackingId()); + Assertions.assertEquals("aenwabf", model.trackingUrl()); } } diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/TriggerInnerTests.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/TriggerInnerTests.java index d4dc6ef0191b..ac893c567f16 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/TriggerInnerTests.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/TriggerInnerTests.java @@ -1,23 +1,29 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.generated; import com.azure.core.util.BinaryData; import com.azure.resourcemanager.databoxedge.fluent.models.TriggerInner; +import com.azure.resourcemanager.databoxedge.models.TriggerEventType; +import com.azure.resourcemanager.databoxedge.models.TriggerProperties; +import org.junit.jupiter.api.Assertions; public final class TriggerInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - TriggerInner model = BinaryData - .fromString("{\"kind\":\"Trigger\",\"id\":\"wggxkallat\",\"name\":\"elwuipi\",\"type\":\"cjzkzivgvvcna\"}") + TriggerInner model = BinaryData.fromString( + "{\"properties\":{},\"kind\":\"PeriodicTimerEvent\",\"id\":\"stvlzywemhzrnc\",\"name\":\"dtclusiypb\",\"type\":\"fgytguslfeadcyg\"}") .toObject(TriggerInner.class); + Assertions.assertEquals(TriggerEventType.PERIODIC_TIMER_EVENT, model.kind()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - TriggerInner model = new TriggerInner(); + TriggerInner model = new TriggerInner().withProperties(new TriggerProperties()) + .withKind(TriggerEventType.PERIODIC_TIMER_EVENT); model = BinaryData.fromObject(model).toObject(TriggerInner.class); + Assertions.assertEquals(TriggerEventType.PERIODIC_TIMER_EVENT, model.kind()); } } diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/TriggerListTests.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/TriggerListTests.java index 7759faf5d6ba..ec069cdf7728 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/TriggerListTests.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/TriggerListTests.java @@ -1,23 +1,21 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.generated; import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.databoxedge.models.TriggerList; +import com.azure.resourcemanager.databoxedge.implementation.models.TriggerList; +import com.azure.resourcemanager.databoxedge.models.TriggerEventType; +import org.junit.jupiter.api.Assertions; public final class TriggerListTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { TriggerList model = BinaryData.fromString( - "{\"value\":[{\"kind\":\"Trigger\",\"id\":\"trwyhqmib\",\"name\":\"yhwitsmypyynpcdp\",\"type\":\"mnzgmwznmabi\"},{\"kind\":\"Trigger\",\"id\":\"nsorgjhxbldt\",\"name\":\"wwrlkdmtncv\",\"type\":\"kotl\"},{\"kind\":\"Trigger\",\"id\":\"xdy\",\"name\":\"gsyocogj\",\"type\":\"tdtbnnhadooc\"},{\"kind\":\"Trigger\",\"id\":\"kvci\",\"name\":\"hnvpamqgxq\",\"type\":\"u\"}],\"nextLink\":\"ik\"}") + "{\"value\":[{\"properties\":{},\"kind\":\"PeriodicTimerEvent\",\"id\":\"ejhzisxg\",\"name\":\"pelol\",\"type\":\"pv\"},{\"properties\":{},\"kind\":\"FileEvent\",\"id\":\"qvujzraehtwdwrf\",\"name\":\"swibyr\",\"type\":\"dl\"},{\"properties\":{},\"kind\":\"PeriodicTimerEvent\",\"id\":\"fwpracstwi\",\"name\":\"ykhevxccedcpnmdy\",\"type\":\"dnwzxltjcvnhltiu\"}],\"nextLink\":\"xnavvwxq\"}") .toObject(TriggerList.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - TriggerList model = new TriggerList(); - model = BinaryData.fromObject(model).toObject(TriggerList.class); + Assertions.assertEquals(TriggerEventType.PERIODIC_TIMER_EVENT, model.value().get(0).kind()); + Assertions.assertEquals("xnavvwxq", model.nextLink()); } } diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/TriggerPropertiesTests.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/TriggerPropertiesTests.java new file mode 100644 index 000000000000..8697ee42806f --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/TriggerPropertiesTests.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.databoxedge.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.databoxedge.models.TriggerProperties; + +public final class TriggerPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + TriggerProperties model = BinaryData.fromString("{}").toObject(TriggerProperties.class); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + TriggerProperties model = new TriggerProperties(); + model = BinaryData.fromObject(model).toObject(TriggerProperties.class); + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/TriggerSupportPackageRequestTests.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/TriggerSupportPackageRequestTests.java new file mode 100644 index 000000000000..26e6b14fd753 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/TriggerSupportPackageRequestTests.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.databoxedge.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.databoxedge.models.TriggerSupportPackageRequest; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; + +public final class TriggerSupportPackageRequestTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + TriggerSupportPackageRequest model = BinaryData.fromString( + "{\"properties\":{\"minimumTimeStamp\":\"2021-04-05T06:25:25Z\",\"maximumTimeStamp\":\"2021-01-20T13:15:44Z\",\"include\":\"rfkbwccsnjvcdwxl\"},\"id\":\"ekftnkhtj\",\"name\":\"i\",\"type\":\"wfqatmtd\"}") + .toObject(TriggerSupportPackageRequest.class); + Assertions.assertEquals(OffsetDateTime.parse("2021-04-05T06:25:25Z"), model.minimumTimeStamp()); + Assertions.assertEquals(OffsetDateTime.parse("2021-01-20T13:15:44Z"), model.maximumTimeStamp()); + Assertions.assertEquals("rfkbwccsnjvcdwxl", model.include()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + TriggerSupportPackageRequest model + = new TriggerSupportPackageRequest().withMinimumTimeStamp(OffsetDateTime.parse("2021-04-05T06:25:25Z")) + .withMaximumTimeStamp(OffsetDateTime.parse("2021-01-20T13:15:44Z")) + .withInclude("rfkbwccsnjvcdwxl"); + model = BinaryData.fromObject(model).toObject(TriggerSupportPackageRequest.class); + Assertions.assertEquals(OffsetDateTime.parse("2021-04-05T06:25:25Z"), model.minimumTimeStamp()); + Assertions.assertEquals(OffsetDateTime.parse("2021-01-20T13:15:44Z"), model.maximumTimeStamp()); + Assertions.assertEquals("rfkbwccsnjvcdwxl", model.include()); + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/TriggersCreateOrUpdateMockTests.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/TriggersCreateOrUpdateMockTests.java index 0fb016dbd320..2b8119cbc255 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/TriggersCreateOrUpdateMockTests.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/TriggersCreateOrUpdateMockTests.java @@ -1,19 +1,21 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.databoxedge.DataBoxEdgeManager; -import com.azure.resourcemanager.databoxedge.fluent.models.TriggerInner; import com.azure.resourcemanager.databoxedge.models.Trigger; +import com.azure.resourcemanager.databoxedge.models.TriggerEventType; +import com.azure.resourcemanager.databoxedge.models.TriggerProperties; import java.nio.charset.StandardCharsets; import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; import reactor.core.publisher.Mono; @@ -21,18 +23,22 @@ public final class TriggersCreateOrUpdateMockTests { @Test public void testCreateOrUpdate() throws Exception { String responseStr - = "{\"kind\":\"Trigger\",\"id\":\"bwnhhtql\",\"name\":\"ehgpp\",\"type\":\"pifhpfeoajvgcxtx\"}"; + = "{\"properties\":{},\"kind\":\"PeriodicTimerEvent\",\"id\":\"odiffjxcjrmmua\",\"name\":\"wibvjogj\",\"type\":\"nmc\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); DataBoxEdgeManager manager = DataBoxEdgeManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); Trigger response = manager.triggers() - .createOrUpdate("knfnwmbtmvpdv", "dhttzaefedxihchr", "hk", new TriggerInner(), - com.azure.core.util.Context.NONE); + .define("wyvf") + .withExistingDataBoxEdgeDevice("ay", "xbulpzealbmqkyo") + .withKind(TriggerEventType.FILE_EVENT) + .withProperties(new TriggerProperties()) + .create(); + Assertions.assertEquals(TriggerEventType.PERIODIC_TIMER_EVENT, response.kind()); } } diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/TriggersDeleteMockTests.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/TriggersDeleteMockTests.java index fc6ecc6d4b31..d212fac6e10a 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/TriggersDeleteMockTests.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/TriggersDeleteMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.databoxedge.DataBoxEdgeManager; import java.nio.charset.StandardCharsets; @@ -25,9 +25,9 @@ public void testDelete() throws Exception { DataBoxEdgeManager manager = DataBoxEdgeManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - manager.triggers().delete("csheafidltugsr", "smkss", "h", com.azure.core.util.Context.NONE); + manager.triggers().delete("upeuknijduyye", "pydjfboc", "v", com.azure.core.util.Context.NONE); } } diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/TriggersGetWithResponseMockTests.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/TriggersGetWithResponseMockTests.java index d1548c0a6d3f..2b5f4b99c68c 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/TriggersGetWithResponseMockTests.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/TriggersGetWithResponseMockTests.java @@ -1,18 +1,20 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.databoxedge.DataBoxEdgeManager; import com.azure.resourcemanager.databoxedge.models.Trigger; +import com.azure.resourcemanager.databoxedge.models.TriggerEventType; import java.nio.charset.StandardCharsets; import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; import reactor.core.publisher.Mono; @@ -20,18 +22,19 @@ public final class TriggersGetWithResponseMockTests { @Test public void testGetWithResponse() throws Exception { String responseStr - = "{\"kind\":\"Trigger\",\"id\":\"disdosfjbjsvgj\",\"name\":\"whryvycytdcl\",\"type\":\"gc\"}"; + = "{\"properties\":{},\"kind\":\"FileEvent\",\"id\":\"zstacsjvhrweft\",\"name\":\"wqejpmvsse\",\"type\":\"aepwamcxtcz\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); DataBoxEdgeManager manager = DataBoxEdgeManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); Trigger response = manager.triggers() - .getWithResponse("aaeranokqgukk", "qnvb", "oylaxxul", com.azure.core.util.Context.NONE) + .getWithResponse("ihztgeqmgqzgwldo", "chillcecf", "huwaoaguhic", com.azure.core.util.Context.NONE) .getValue(); + Assertions.assertEquals(TriggerEventType.FILE_EVENT, response.kind()); } } diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/TriggersListByDataBoxEdgeDeviceMockTests.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/TriggersListByDataBoxEdgeDeviceMockTests.java index c3b2fbe19fa3..2e45ed74b215 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/TriggersListByDataBoxEdgeDeviceMockTests.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/TriggersListByDataBoxEdgeDeviceMockTests.java @@ -1,19 +1,21 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.databoxedge.DataBoxEdgeManager; import com.azure.resourcemanager.databoxedge.models.Trigger; +import com.azure.resourcemanager.databoxedge.models.TriggerEventType; import java.nio.charset.StandardCharsets; import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; import reactor.core.publisher.Mono; @@ -21,17 +23,18 @@ public final class TriggersListByDataBoxEdgeDeviceMockTests { @Test public void testListByDataBoxEdgeDevice() throws Exception { String responseStr - = "{\"value\":[{\"kind\":\"Trigger\",\"id\":\"knh\",\"name\":\"kizvytn\",\"type\":\"zvulj\"}]}"; + = "{\"value\":[{\"properties\":{},\"kind\":\"FileEvent\",\"id\":\"qg\",\"name\":\"kfnozoeoqbvj\",\"type\":\"vefgwbmqjchntas\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); DataBoxEdgeManager manager = DataBoxEdgeManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); PagedIterable response = manager.triggers() - .listByDataBoxEdgeDevice("gzrcxfailcfxwmdb", "xdfgsftufqobr", "lnacgcc", com.azure.core.util.Context.NONE); + .listByDataBoxEdgeDevice("hulrtywikdmhla", "uflgbhgauacdixm", "ufr", com.azure.core.util.Context.NONE); + Assertions.assertEquals(TriggerEventType.FILE_EVENT, response.iterator().next().kind()); } } diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/UpdateDetailsTests.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/UpdateDetailsTests.java new file mode 100644 index 000000000000..c37f0f8dcf75 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/UpdateDetailsTests.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.databoxedge.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.databoxedge.models.InstallRebootBehavior; +import com.azure.resourcemanager.databoxedge.models.InstallationImpact; +import com.azure.resourcemanager.databoxedge.models.UpdateDetails; +import com.azure.resourcemanager.databoxedge.models.UpdateStatus; +import com.azure.resourcemanager.databoxedge.models.UpdateType; +import org.junit.jupiter.api.Assertions; + +public final class UpdateDetailsTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + UpdateDetails model = BinaryData.fromString( + "{\"updateTitle\":\"fzp\",\"updateSize\":51.510304899376344,\"updateType\":\"Software\",\"targetVersion\":\"bnetshh\",\"friendlyVersionNumber\":\"h\",\"estimatedInstallTimeInMins\":1422875618,\"rebootBehavior\":\"RequestReboot\",\"installationImpact\":\"None\",\"status\":\"DownloadStarted\"}") + .toObject(UpdateDetails.class); + Assertions.assertEquals("fzp", model.updateTitle()); + Assertions.assertEquals(51.510304899376344D, model.updateSize()); + Assertions.assertEquals(UpdateType.SOFTWARE, model.updateType()); + Assertions.assertEquals("bnetshh", model.targetVersion()); + Assertions.assertEquals("h", model.friendlyVersionNumber()); + Assertions.assertEquals(1422875618, model.estimatedInstallTimeInMins()); + Assertions.assertEquals(InstallRebootBehavior.REQUEST_REBOOT, model.rebootBehavior()); + Assertions.assertEquals(InstallationImpact.NONE, model.installationImpact()); + Assertions.assertEquals(UpdateStatus.DOWNLOAD_STARTED, model.status()); + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/UpdateDownloadProgressTests.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/UpdateDownloadProgressTests.java index 8a6b3640c3e2..1eb456ca2ac8 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/UpdateDownloadProgressTests.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/UpdateDownloadProgressTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.generated; @@ -11,13 +11,7 @@ public final class UpdateDownloadProgressTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { UpdateDownloadProgress model = BinaryData.fromString( - "{\"downloadPhase\":\"Downloading\",\"percentComplete\":333094369,\"totalBytesToDownload\":51.71375541406348,\"totalBytesDownloaded\":82.08569552569966,\"numberOfUpdatesToDownload\":1340454664,\"numberOfUpdatesDownloaded\":45967354}") + "{\"downloadPhase\":\"Downloading\",\"percentComplete\":172575084,\"totalBytesToDownload\":24.11692974595916,\"totalBytesDownloaded\":63.70499823693262,\"numberOfUpdatesToDownload\":1223650177,\"numberOfUpdatesDownloaded\":413629222}") .toObject(UpdateDownloadProgress.class); } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - UpdateDownloadProgress model = new UpdateDownloadProgress(); - model = BinaryData.fromObject(model).toObject(UpdateDownloadProgress.class); - } } diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/UpdateInstallProgressTests.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/UpdateInstallProgressTests.java index 9e1d8a6724e9..7a21f8adc195 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/UpdateInstallProgressTests.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/UpdateInstallProgressTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.generated; @@ -11,13 +11,7 @@ public final class UpdateInstallProgressTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { UpdateInstallProgress model = BinaryData.fromString( - "{\"percentComplete\":592708150,\"numberOfUpdatesToInstall\":969530861,\"numberOfUpdatesInstalled\":626726522}") + "{\"percentComplete\":2020808451,\"numberOfUpdatesToInstall\":719268117,\"numberOfUpdatesInstalled\":1951399012}") .toObject(UpdateInstallProgress.class); } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - UpdateInstallProgress model = new UpdateInstallProgress(); - model = BinaryData.fromObject(model).toObject(UpdateInstallProgress.class); - } } diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/UpdateSummaryInnerTests.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/UpdateSummaryInnerTests.java index 3d5451f6505c..0d7b5771208f 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/UpdateSummaryInnerTests.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/UpdateSummaryInnerTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.generated; @@ -13,24 +13,13 @@ public final class UpdateSummaryInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { UpdateSummaryInner model = BinaryData.fromString( - "{\"properties\":{\"deviceVersionNumber\":\"yrnxxmueedn\",\"friendlyDeviceVersionName\":\"dvstkw\",\"deviceLastScannedDateTime\":\"2021-05-02T23:11:18Z\",\"lastCompletedScanJobDateTime\":\"2021-07-16T17:22:34Z\",\"lastCompletedDownloadJobDateTime\":\"2021-06-20T11:42:34Z\",\"lastCompletedInstallJobDateTime\":\"2021-08-29T08:31:09Z\",\"totalNumberOfUpdatesAvailable\":1261287466,\"totalNumberOfUpdatesPendingDownload\":149792642,\"totalNumberOfUpdatesPendingInstall\":895344141,\"rebootBehavior\":\"NeverReboots\",\"ongoingUpdateOperation\":\"None\",\"inProgressDownloadJobId\":\"vgpiohgwxrt\",\"inProgressInstallJobId\":\"dxepxgyq\",\"inProgressDownloadJobStartedDateTime\":\"2021-01-20T23:29:46Z\",\"inProgressInstallJobStartedDateTime\":\"2021-07-18T03:12:47Z\",\"updateTitles\":[\"pkukghi\",\"dblx\",\"wi\",\"fnjhfjxwmszkkfo\"],\"totalUpdateSizeInBytes\":56.35293478364015},\"id\":\"fkzikfj\",\"name\":\"wneaiv\",\"type\":\"wczelpci\"}") + "{\"properties\":{\"deviceVersionNumber\":\"ncw\",\"friendlyDeviceVersionName\":\"hxg\",\"deviceLastScannedDateTime\":\"2021-06-02T07:12:07Z\",\"lastCompletedScanJobDateTime\":\"2021-08-05T04:43:36Z\",\"lastSuccessfulScanJobTime\":\"2021-06-24T18:53:50Z\",\"lastCompletedDownloadJobDateTime\":\"2021-04-04T16:11:39Z\",\"lastCompletedDownloadJobId\":\"kteo\",\"lastDownloadJobStatus\":\"Canceled\",\"lastSuccessfulInstallJobDateTime\":\"2021-12-03T17:14:16Z\",\"lastCompletedInstallJobDateTime\":\"2021-04-28T15:58:47Z\",\"lastCompletedInstallJobId\":\"ygpfqb\",\"lastInstallJobStatus\":\"Scheduled\",\"totalNumberOfUpdatesAvailable\":519394000,\"totalNumberOfUpdatesPendingDownload\":598270118,\"totalNumberOfUpdatesPendingInstall\":1189034922,\"rebootBehavior\":\"NeverReboots\",\"ongoingUpdateOperation\":\"Download\",\"inProgressDownloadJobId\":\"opppcqeq\",\"inProgressInstallJobId\":\"lzdahzxctobgbkdm\",\"inProgressDownloadJobStartedDateTime\":\"2021-01-29T19:09:38Z\",\"inProgressInstallJobStartedDateTime\":\"2021-09-15T16:01:55Z\",\"updateTitles\":[\"mgrcfbu\",\"rmfqjhhkxbpvj\",\"mjh\"],\"updates\":[{\"updateTitle\":\"n\",\"updateSize\":36.022867888553165,\"updateType\":\"Kubernetes\",\"targetVersion\":\"tswb\",\"friendlyVersionNumber\":\"zvszj\",\"estimatedInstallTimeInMins\":453874905,\"rebootBehavior\":\"RequiresReboot\",\"installationImpact\":\"None\",\"status\":\"DownloadPending\"}],\"totalUpdateSizeInBytes\":26.65504368150532,\"totalTimeInMinutes\":123770675},\"id\":\"cqaqtdoqmcbx\",\"name\":\"wvxysl\",\"type\":\"bhsfxob\"}") .toObject(UpdateSummaryInner.class); - Assertions.assertEquals("yrnxxmueedn", model.deviceVersionNumber()); - Assertions.assertEquals("dvstkw", model.friendlyDeviceVersionName()); - Assertions.assertEquals(OffsetDateTime.parse("2021-05-02T23:11:18Z"), model.deviceLastScannedDateTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-07-16T17:22:34Z"), model.lastCompletedScanJobDateTime()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - UpdateSummaryInner model = new UpdateSummaryInner().withDeviceVersionNumber("yrnxxmueedn") - .withFriendlyDeviceVersionName("dvstkw") - .withDeviceLastScannedDateTime(OffsetDateTime.parse("2021-05-02T23:11:18Z")) - .withLastCompletedScanJobDateTime(OffsetDateTime.parse("2021-07-16T17:22:34Z")); - model = BinaryData.fromObject(model).toObject(UpdateSummaryInner.class); - Assertions.assertEquals("yrnxxmueedn", model.deviceVersionNumber()); - Assertions.assertEquals("dvstkw", model.friendlyDeviceVersionName()); - Assertions.assertEquals(OffsetDateTime.parse("2021-05-02T23:11:18Z"), model.deviceLastScannedDateTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-07-16T17:22:34Z"), model.lastCompletedScanJobDateTime()); + Assertions.assertEquals("ncw", model.deviceVersionNumber()); + Assertions.assertEquals("hxg", model.friendlyDeviceVersionName()); + Assertions.assertEquals(OffsetDateTime.parse("2021-06-02T07:12:07Z"), model.deviceLastScannedDateTime()); + Assertions.assertEquals(OffsetDateTime.parse("2021-08-05T04:43:36Z"), model.lastCompletedScanJobDateTime()); + Assertions.assertEquals(OffsetDateTime.parse("2021-06-24T18:53:50Z"), model.lastSuccessfulScanJobTime()); + Assertions.assertEquals(OffsetDateTime.parse("2021-12-03T17:14:16Z"), model.lastSuccessfulInstallJobDateTime()); } } diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/UpdateSummaryPropertiesTests.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/UpdateSummaryPropertiesTests.java index 33b2f7d1477c..68f416cbb4bd 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/UpdateSummaryPropertiesTests.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/UpdateSummaryPropertiesTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.generated; @@ -13,24 +13,13 @@ public final class UpdateSummaryPropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { UpdateSummaryProperties model = BinaryData.fromString( - "{\"deviceVersionNumber\":\"lsfeaenwabfatkld\",\"friendlyDeviceVersionName\":\"bjhwuaan\",\"deviceLastScannedDateTime\":\"2021-03-30T04:43:35Z\",\"lastCompletedScanJobDateTime\":\"2021-11-21T08:23:20Z\",\"lastCompletedDownloadJobDateTime\":\"2021-09-19T01:12:23Z\",\"lastCompletedInstallJobDateTime\":\"2021-03-30T14:01:12Z\",\"totalNumberOfUpdatesAvailable\":113481876,\"totalNumberOfUpdatesPendingDownload\":171728083,\"totalNumberOfUpdatesPendingInstall\":106141655,\"rebootBehavior\":\"NeverReboots\",\"ongoingUpdateOperation\":\"None\",\"inProgressDownloadJobId\":\"vimjwos\",\"inProgressInstallJobId\":\"xitc\",\"inProgressDownloadJobStartedDateTime\":\"2021-01-06T17:55:44Z\",\"inProgressInstallJobStartedDateTime\":\"2021-05-28T14:30:26Z\",\"updateTitles\":[\"umiekkezzi\",\"hlyfjhdgqgg\"],\"totalUpdateSizeInBytes\":29.760029253080745}") + "{\"deviceVersionNumber\":\"tkblmpewww\",\"friendlyDeviceVersionName\":\"krvrns\",\"deviceLastScannedDateTime\":\"2021-09-18T19:23:36Z\",\"lastCompletedScanJobDateTime\":\"2021-08-09T19:40:16Z\",\"lastSuccessfulScanJobTime\":\"2021-01-04T22:35:44Z\",\"lastCompletedDownloadJobDateTime\":\"2021-04-04T20:05:33Z\",\"lastCompletedDownloadJobId\":\"sbfov\",\"lastDownloadJobStatus\":\"Running\",\"lastSuccessfulInstallJobDateTime\":\"2021-03-25T00:29:47Z\",\"lastCompletedInstallJobDateTime\":\"2021-05-26T02:09:57Z\",\"lastCompletedInstallJobId\":\"hsqfsubcgjbirxbp\",\"lastInstallJobStatus\":\"Paused\",\"totalNumberOfUpdatesAvailable\":2111014163,\"totalNumberOfUpdatesPendingDownload\":1488551511,\"totalNumberOfUpdatesPendingInstall\":891212878,\"rebootBehavior\":\"RequestReboot\",\"ongoingUpdateOperation\":\"Scan\",\"inProgressDownloadJobId\":\"t\",\"inProgressInstallJobId\":\"pvjzbe\",\"inProgressDownloadJobStartedDateTime\":\"2021-06-04T04:06:28Z\",\"inProgressInstallJobStartedDateTime\":\"2021-06-27T17:15:27Z\",\"updateTitles\":[\"qqnvwpmq\",\"aruoujmkcjhwqyt\",\"r\",\"bnw\"],\"updates\":[{\"updateTitle\":\"drjervnaenqpehin\",\"updateSize\":20.85641107316347,\"updateType\":\"Software\",\"targetVersion\":\"thnzd\",\"friendlyVersionNumber\":\"sl\",\"estimatedInstallTimeInMins\":843221186,\"rebootBehavior\":\"RequiresReboot\",\"installationImpact\":\"None\",\"status\":\"InstallStarted\"},{\"updateTitle\":\"uhavhql\",\"updateSize\":64.72498359356844,\"updateType\":\"Firmware\",\"targetVersion\":\"olbgycduiertgccy\",\"friendlyVersionNumber\":\"aolps\",\"estimatedInstallTimeInMins\":245335843,\"rebootBehavior\":\"RequiresReboot\",\"installationImpact\":\"None\",\"status\":\"InstallCompleted\"},{\"updateTitle\":\"bglzpswi\",\"updateSize\":76.70320207909522,\"updateType\":\"Software\",\"targetVersion\":\"zdxss\",\"friendlyVersionNumber\":\"bzmnvdfznud\",\"estimatedInstallTimeInMins\":1568683744,\"rebootBehavior\":\"RequiresReboot\",\"installationImpact\":\"KubernetesWorkloadsDown\",\"status\":\"InstallStarted\"},{\"updateTitle\":\"lylpstdb\",\"updateSize\":21.12636978023651,\"updateType\":\"Kubernetes\",\"targetVersion\":\"zucerscdntnev\",\"friendlyVersionNumber\":\"wjmy\",\"estimatedInstallTimeInMins\":1774412887,\"rebootBehavior\":\"RequiresReboot\",\"installationImpact\":\"KubernetesWorkloadsDown\",\"status\":\"DownloadCompleted\"}],\"totalUpdateSizeInBytes\":77.25484909336522,\"totalTimeInMinutes\":815719095}") .toObject(UpdateSummaryProperties.class); - Assertions.assertEquals("lsfeaenwabfatkld", model.deviceVersionNumber()); - Assertions.assertEquals("bjhwuaan", model.friendlyDeviceVersionName()); - Assertions.assertEquals(OffsetDateTime.parse("2021-03-30T04:43:35Z"), model.deviceLastScannedDateTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-11-21T08:23:20Z"), model.lastCompletedScanJobDateTime()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - UpdateSummaryProperties model = new UpdateSummaryProperties().withDeviceVersionNumber("lsfeaenwabfatkld") - .withFriendlyDeviceVersionName("bjhwuaan") - .withDeviceLastScannedDateTime(OffsetDateTime.parse("2021-03-30T04:43:35Z")) - .withLastCompletedScanJobDateTime(OffsetDateTime.parse("2021-11-21T08:23:20Z")); - model = BinaryData.fromObject(model).toObject(UpdateSummaryProperties.class); - Assertions.assertEquals("lsfeaenwabfatkld", model.deviceVersionNumber()); - Assertions.assertEquals("bjhwuaan", model.friendlyDeviceVersionName()); - Assertions.assertEquals(OffsetDateTime.parse("2021-03-30T04:43:35Z"), model.deviceLastScannedDateTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-11-21T08:23:20Z"), model.lastCompletedScanJobDateTime()); + Assertions.assertEquals("tkblmpewww", model.deviceVersionNumber()); + Assertions.assertEquals("krvrns", model.friendlyDeviceVersionName()); + Assertions.assertEquals(OffsetDateTime.parse("2021-09-18T19:23:36Z"), model.deviceLastScannedDateTime()); + Assertions.assertEquals(OffsetDateTime.parse("2021-08-09T19:40:16Z"), model.lastCompletedScanJobDateTime()); + Assertions.assertEquals(OffsetDateTime.parse("2021-01-04T22:35:44Z"), model.lastSuccessfulScanJobTime()); + Assertions.assertEquals(OffsetDateTime.parse("2021-03-25T00:29:47Z"), model.lastSuccessfulInstallJobDateTime()); } } diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/UploadCertificateRequestTests.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/UploadCertificateRequestTests.java index 1b8fea5899cc..7c78911af111 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/UploadCertificateRequestTests.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/UploadCertificateRequestTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.generated; @@ -13,19 +13,20 @@ public final class UploadCertificateRequestTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { UploadCertificateRequest model = BinaryData - .fromString("{\"properties\":{\"authenticationType\":\"AzureActiveDirectory\",\"certificate\":\"g\"}}") + .fromString( + "{\"properties\":{\"authenticationType\":\"AzureActiveDirectory\",\"certificate\":\"bxwyjsflhhcaa\"}}") .toObject(UploadCertificateRequest.class); Assertions.assertEquals(AuthenticationType.AZURE_ACTIVE_DIRECTORY, model.authenticationType()); - Assertions.assertEquals("g", model.certificate()); + Assertions.assertEquals("bxwyjsflhhcaa", model.certificate()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { UploadCertificateRequest model = new UploadCertificateRequest().withAuthenticationType(AuthenticationType.AZURE_ACTIVE_DIRECTORY) - .withCertificate("g"); + .withCertificate("bxwyjsflhhcaa"); model = BinaryData.fromObject(model).toObject(UploadCertificateRequest.class); Assertions.assertEquals(AuthenticationType.AZURE_ACTIVE_DIRECTORY, model.authenticationType()); - Assertions.assertEquals("g", model.certificate()); + Assertions.assertEquals("bxwyjsflhhcaa", model.certificate()); } } diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/UploadCertificateResponseInnerTests.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/UploadCertificateResponseInnerTests.java index 146dd416130f..8d06ce3f6de1 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/UploadCertificateResponseInnerTests.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/UploadCertificateResponseInnerTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.generated; @@ -13,16 +13,8 @@ public final class UploadCertificateResponseInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { UploadCertificateResponseInner model = BinaryData.fromString( - "{\"authType\":\"Invalid\",\"resourceId\":\"pxllrx\",\"aadAuthority\":\"jmoadsuv\",\"aadTenantId\":\"m\",\"servicePrincipalClientId\":\"dmjsjqb\",\"servicePrincipalObjectId\":\"hyxxrwlycoduhpk\",\"azureManagementEndpointAudience\":\"gymare\",\"aadAudience\":\"ajxq\"}") + "{\"authType\":\"Invalid\",\"resourceId\":\"lyjpk\",\"aadAuthority\":\"dzyexznelixh\",\"aadTenantId\":\"ztfolhbnxk\",\"servicePrincipalClientId\":\"laulppg\",\"servicePrincipalObjectId\":\"tpnapnyiropuhpig\",\"azureManagementEndpointAudience\":\"gylgqgitxmedjvcs\",\"aadAudience\":\"n\"}") .toObject(UploadCertificateResponseInner.class); Assertions.assertEquals(AuthenticationType.INVALID, model.authType()); } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - UploadCertificateResponseInner model - = new UploadCertificateResponseInner().withAuthType(AuthenticationType.INVALID); - model = BinaryData.fromObject(model).toObject(UploadCertificateResponseInner.class); - Assertions.assertEquals(AuthenticationType.INVALID, model.authType()); - } } diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/UserAccessRightTests.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/UserAccessRightTests.java index 1df5f73b3fca..4dd133b5e692 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/UserAccessRightTests.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/UserAccessRightTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.generated; @@ -12,17 +12,18 @@ public final class UserAccessRightTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - UserAccessRight model = BinaryData.fromString("{\"userId\":\"wqapnedgfbcvk\",\"accessType\":\"Read\"}") + UserAccessRight model = BinaryData.fromString("{\"userId\":\"ukzclewyhmlwpaz\",\"accessType\":\"Read\"}") .toObject(UserAccessRight.class); - Assertions.assertEquals("wqapnedgfbcvk", model.userId()); + Assertions.assertEquals("ukzclewyhmlwpaz", model.userId()); Assertions.assertEquals(ShareAccessType.READ, model.accessType()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - UserAccessRight model = new UserAccessRight().withUserId("wqapnedgfbcvk").withAccessType(ShareAccessType.READ); + UserAccessRight model + = new UserAccessRight().withUserId("ukzclewyhmlwpaz").withAccessType(ShareAccessType.READ); model = BinaryData.fromObject(model).toObject(UserAccessRight.class); - Assertions.assertEquals("wqapnedgfbcvk", model.userId()); + Assertions.assertEquals("ukzclewyhmlwpaz", model.userId()); Assertions.assertEquals(ShareAccessType.READ, model.accessType()); } } diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/UsersDeleteMockTests.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/UsersDeleteMockTests.java index 463a6c03dfd2..90845f1140a8 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/UsersDeleteMockTests.java +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/UsersDeleteMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.databoxedge.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.databoxedge.DataBoxEdgeManager; import java.nio.charset.StandardCharsets; @@ -25,9 +25,9 @@ public void testDelete() throws Exception { DataBoxEdgeManager manager = DataBoxEdgeManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - manager.users().delete("ylw", "dzaumweooh", "uufuz", com.azure.core.util.Context.NONE); + manager.users().delete("rdixt", "ekidswyskb", "uffgllukkutvlx", com.azure.core.util.Context.NONE); } } diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/VmMemoryTests.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/VmMemoryTests.java new file mode 100644 index 000000000000..030bdea50d02 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/test/java/com/azure/resourcemanager/databoxedge/generated/VmMemoryTests.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.databoxedge.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.databoxedge.models.VmMemory; +import org.junit.jupiter.api.Assertions; + +public final class VmMemoryTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + VmMemory model = BinaryData + .fromString("{\"startupMemoryMB\":8916570711298227997,\"currentMemoryUsageMB\":9061974154322303797}") + .toObject(VmMemory.class); + Assertions.assertEquals(8916570711298227997L, model.startupMemoryMB()); + Assertions.assertEquals(9061974154322303797L, model.currentMemoryUsageMB()); + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/tsp-location.yaml b/sdk/databoxedge/azure-resourcemanager-databoxedge/tsp-location.yaml new file mode 100644 index 000000000000..0b474110bbec --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/tsp-location.yaml @@ -0,0 +1,4 @@ +directory: specification/databoxedge/DataBoxEdge.Management +commit: +repo: Azure/azure-rest-api-specs +additionalDirectories: